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

LIBRARY_PATH seems problematic for Rust build scripts #65

Open
messense opened this issue Mar 26, 2021 · 2 comments
Open

LIBRARY_PATH seems problematic for Rust build scripts #65

messense opened this issue Mar 26, 2021 · 2 comments

Comments

@messense
Copy link
Contributor

https://github.com/messense/manylinux2014-cross-arm/runs/2194258442?check_suite_focus=true

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.0.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.1.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.10.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.11.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.12.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.13.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.14.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.15.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.2.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.3.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.4.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.5.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.6.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.7.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.8.rcgu.o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.build_script_build.98y7fziv-cgu.9.rcgu.o" "-o" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/build/syn-f5721b8c67d18e56/build_script_build-f5721b8c67d18e56.2a6x0kqhg8aetyro.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/__w/manylinux2014-cross-arm/manylinux2014-cross-arm/pyo3-test/target/release/deps" "-L" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b1047a2788193be4.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-e8e399e2092f3b2a.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-c6b02b522c91c060.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-eaad965909c4200f.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-dca728ac8ed54d87.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-4b4efaa8c4601753.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-d36e07ed2cc56ee4.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-3855d04b1bb40ceb.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-58a065cdff5508a2.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-82aeeedcc8d1450a.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-5c4d6c9d7595f844.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-2642d2bccc00517a.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-760e48b3f782e7f5.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-d4ef8bf89076ed01.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-36070e2029bb21ea.rlib" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-3aaf8f932781f33e.rlib" "-Wl,--end-group" "/github/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-e2523c360f03ba10.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
  = note: /usr/bin/ld: /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/libexec/../lib/Scrt1.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/libexec/../lib/Scrt1.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/libexec/../lib/Scrt1.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/libexec/../lib/Scrt1.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/libexec/../lib/Scrt1.o: error adding symbols: file in wrong format
          collect2: error: ld returned 1 exit status

Running the cc command directly works fine, removing LIBRARY_PATH from cross/bin/python also works.

@benfogle
Copy link
Owner

This could be tricky to solve in a clean manner. Rust build scripts mean that there's a native compilation step mixed in with cross-compilation steps in a way we have no control over. We'll have to come up with some ideas.

@messense
Copy link
Contributor Author

This could be tricky to solve in a clean manner.

Is it possible to solve with CFLAGS? For example: CFLAGS_x86_64_unknown_linux_gnu=--sysroot=/path/to/target/sysroot

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

No branches or pull requests

2 participants