JuliaPackaging / BinaryBuilderBase.jl

https://juliapackaging.github.io/BinaryBuilderBase.jl/stable
MIT License
11 stars 31 forks source link

Toolchain for `x86_64-unknown-freebsd-libgfortran3` has non-relocatable object file #159

Open giordano opened 3 years ago

giordano commented 3 years ago

This error recently popped up in the Rust tests:

x86_64-unknown-freebsd11.1-cc -o /tmp/testsuite/x86_64-unknown-freebsd11.1/c/dyn_link/dyn_link -I/usr/share/testsuite/c/dyn_link/libfoo -fPIC -g -O2 -Wl,-z,origin -Wl,-rpath,$ORIGIN/libfoo -L/tmp/testsuite/x86_64-unknown-freebsd11.1/c/dyn_link/libfoo -lfoo dyn_link.c
error: linking with `x86_64-unknown-freebsd-gcc` failed: exit code: 1
  |
  = note: "x86_64-unknown-freebsd-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib" "/usr/share/testsuite/rust/cargo_build/target/x86_64-unknown-freebsd/release/deps/cargo_build-b31da3f674f0a82e.cargo_build.16vq6tll-cgu.0.rcgu.o" "/usr/share/testsuite/rust/cargo_build/target/x86_64-unknown-freebsd/release/deps/cargo_build-b31da3f674f0a82e.cargo_build.16vq6tll-cgu.1.rcgu.o" "-o" "/usr/share/testsuite/rust/cargo_build/target/x86_64-unknown-freebsd/release/deps/cargo_build-b31da3f674f0a82e" "/usr/share/testsuite/rust/cargo_build/target/x86_64-unknown-freebsd/release/deps/cargo_build-b31da3f674f0a82e.1f957yvw5j3vum8a.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/usr/share/testsuite/rust/cargo_build/target/x86_64-unknown-freebsd/release/deps" "-L" "/usr/share/testsuite/rust/cargo_build/target/release/deps" "-L" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-3fbe8b2cc03d7ccc.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/libpanic_unwind-5fae110c92ddbf1b.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/libhashbrown-9b25d8656a1d88a2.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_alloc-9eabecaf3d8c573d.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/libbacktrace-583fee1783041933.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/libbacktrace_sys-db4821f2f4b24b43.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_demangle-85700bdf94840727.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/libunwind-0aa3d74c4c1f4b9b.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/libcfg_if-7dd3424c8e2c2dc7.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/liblibc-a5c2b50ddd067c26.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/liballoc-144c5c3608b68f63.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_core-7e5176cc9d084e3f.rlib" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/libcore-89a20c5f932d3d9f.rlib" "-Wl,--end-group" "/opt/x86_64-linux-musl/toolchains/1.43.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-freebsd/lib/libcompiler_builtins-672583d1a2562a22.rlib" "-Wl,-Bdynamic" "-lexecinfo" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /opt/x86_64-unknown-freebsd11.1/bin/../lib/gcc/x86_64-unknown-freebsd11.1/4.8.5/../../../../x86_64-unknown-freebsd11.1/bin/ld: /opt/x86_64-unknown-freebsd11.1/bin/../x86_64-unknown-freebsd11.1/sys-root/usr/lib/crt1.o: relocation R_X86_64_32 against `_DYNAMIC' can not be used when making a shared object; recompile with -fPIC
          /opt/x86_64-unknown-freebsd11.1/bin/../x86_64-unknown-freebsd11.1/sys-root/usr/lib/crt1.o: error adding symbols: Bad value
          collect2: error: ld returned 1 exit status

We've seen this error also before, for example https://github.com/JuliaPackaging/Yggdrasil/pull/1780#issuecomment-706621398.

giordano commented 3 years ago

After preliminary tests, I believe the issue is only in the toolchain of GCC v4.8.5

giordano commented 3 years ago

I found similar bug reports in FreeBSD itself:

Could go on forever, but it looks fairly clear to me this is an upstream issue. At least we have 6 other usable versions of GCC.