Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add experimental ARM cross compile image based on zigbuild #72

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aqrln
Copy link
Member

@aqrln aqrln commented Jun 2, 2023

Currently it can successfully cross compile and link shared OpenSSL, and
cross compile the query engine, but linking fails with:

error: linking with `/root/.cache/cargo-zigbuild/0.16.10/zigcc-aarch64-unknown-linux-gnu.2.17.sh` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/opt/zig-linux-x86_64-0.11.0-dev.3348+3faf376b0:/opt/cross/zig-linux-x86_64-0.11.0-dev.3348+3faf376b0:/root/.cargo/bin:/usr/local/lib/python3.11/dist-packages/ziglang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "/root/.cache/cargo-zigbuild/0.16.10/zigcc-aarch64-unknown-linux-gnu.2.17.sh" "/tmp/rustcELa8b4/symbols.o" "/engines/target/aarch64-unknown-linux-gnu/release/deps/query_engine-9d1919b2d160d96a.query_engine.d22a280a-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/engines/target/aarch64-unknown-linux-gnu/release/deps" "-L" "/engines/target/release/deps" "-L" "/engines/target/aarch64-unknown-linux-gnu/release/build/ring-297fc3656113f209/out" "-L" "/engines/target/aarch64-unknown-linux-gnu/release/build/libsqlite3-sys-af7b3a4558256ab0/out" "-L" "/engines/target/aarch64-unknown-linux-gnu/release/build/libz-sys-27081a34b01142db/out/lib" "-L" "/engines/target/aarch64-unknown-linux-gnu/release/build/libz-sys-27081a34b01142db/out/lib" "-L" "/opt/cross/lib" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustcELa8b4/libring-634b5236e555c431.rlib" "/tmp/rustcELa8b4/liblibsqlite3_sys-c0f45f8017beeed7.rlib" "/tmp/rustcELa8b4/liblibz_sys-36ff76decbe5dfac.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib/libcompiler_builtins-25887170a022cc00.rlib" "-Wl,-Bdynamic" "-lssl" "-lcrypto" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-o" "/engines/target/aarch64-unknown-linux-gnu/release/deps/query_engine-9d1919b2d160d96a" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs"
  = note: ld.lld: error: undefined symbol: fcntl@GLIBC_2.2.5
          >>> referenced by sqlite3.c
          >>>               sqlite3.o:(aSyscall) in archive /tmp/rustcELa8b4/liblibsqlite3_sys-c0f45f8017beeed7.rlib
          >>> did you mean: fcntl
          >>> defined in: /root/.cache/zig/o/09512143defbe5a5bbd3426ded948a1a/libpthread.so.0

Currently it can successfully cross compile and link shared OpenSSL, and
cross compile the query engine, but linking fails with:

```
error: linking with `/root/.cache/cargo-zigbuild/0.16.10/zigcc-aarch64-unknown-linux-gnu.2.17.sh` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/opt/zig-linux-x86_64-0.11.0-dev.3348+3faf376b0:/opt/cross/zig-linux-x86_64-0.11.0-dev.3348+3faf376b0:/root/.cargo/bin:/usr/local/lib/python3.11/dist-packages/ziglang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "/root/.cache/cargo-zigbuild/0.16.10/zigcc-aarch64-unknown-linux-gnu.2.17.sh" "/tmp/rustcELa8b4/symbols.o" "/engines/target/aarch64-unknown-linux-gnu/release/deps/query_engine-9d1919b2d160d96a.query_engine.d22a280a-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/engines/target/aarch64-unknown-linux-gnu/release/deps" "-L" "/engines/target/release/deps" "-L" "/engines/target/aarch64-unknown-linux-gnu/release/build/ring-297fc3656113f209/out" "-L" "/engines/target/aarch64-unknown-linux-gnu/release/build/libsqlite3-sys-af7b3a4558256ab0/out" "-L" "/engines/target/aarch64-unknown-linux-gnu/release/build/libz-sys-27081a34b01142db/out/lib" "-L" "/engines/target/aarch64-unknown-linux-gnu/release/build/libz-sys-27081a34b01142db/out/lib" "-L" "/opt/cross/lib" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustcELa8b4/libring-634b5236e555c431.rlib" "/tmp/rustcELa8b4/liblibsqlite3_sys-c0f45f8017beeed7.rlib" "/tmp/rustcELa8b4/liblibz_sys-36ff76decbe5dfac.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib/libcompiler_builtins-25887170a022cc00.rlib" "-Wl,-Bdynamic" "-lssl" "-lcrypto" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-o" "/engines/target/aarch64-unknown-linux-gnu/release/deps/query_engine-9d1919b2d160d96a" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs"
  = note: ld.lld: error: undefined symbol: fcntl@GLIBC_2.2.5
          >>> referenced by sqlite3.c
          >>>               sqlite3.o:(aSyscall) in archive /tmp/rustcELa8b4/liblibsqlite3_sys-c0f45f8017beeed7.rlib
          >>> did you mean: fcntl
          >>> defined in: /root/.cache/zig/o/09512143defbe5a5bbd3426ded948a1a/libpthread.so.0
```
@aqrln aqrln force-pushed the arm64-zigbuild branch from bc0b7bd to c7b2f6b Compare June 2, 2023 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant