rust-cross / rust-musl-cross

Docker images for compiling static Rust binaries using musl-cross
MIT License
617 stars 68 forks source link

s390x can't build openssl-src #63

Open messense opened 1 year ago

messense commented 1 year ago
  = note: /usr/local/musl/bin/../lib/gcc/s390x-unknown-linux-musl/9.2.0/../../../../s390x-unknown-linux-musl/bin/ld: /home/rust/src/target/s390x-unknown-linux-musl/debug/deps/libopenssl_sys-70172c64409e3e90.rlib(curve448.o): in function `recode_wnaf':
          /home/rust/src/target/s390x-unknown-linux-musl/debug/build/openssl-sys-1de3ca3326f5bf22/out/openssl-build/build/src/crypto/ec/curve448/curve448.c:575: undefined reference to `__ctzdi2'
          /usr/local/musl/bin/../lib/gcc/s390x-unknown-linux-musl/9.2.0/../../../../s390x-unknown-linux-musl/bin/ld: read-only segment has dynamic relocations
          collect2: error: ld returned 1 exit status

Hmm, not sure what's going on.

Originally posted by @messense in https://github.com/messense/rust-musl-cross/issues/62#issuecomment-1250523140

messense commented 1 year ago

On GCC 11.2.0

  = note: /usr/local/musl/bin/../lib/gcc/s390x-unknown-linux-musl/11.2.0/../../../../s390x-unknown-linux-musl/bin/ld: /usr/local/musl/bin/../lib/gcc/s390x-unknown-linux-musl/11.2.0/../../../../s390x-unknown-linux-musl/bin/ld: DWARF error: can't find .debug_ranges section.
          /home/rust/src/target/s390x-unknown-linux-musl/debug/deps/libopenssl_sys-70172c64409e3e90.rlib(curve448.o): in function `recode_wnaf':
          curve448.c:(.text.recode_wnaf+0xee): undefined reference to `__ctzdi2'
          /usr/local/musl/bin/../lib/gcc/s390x-unknown-linux-musl/11.2.0/../../../../s390x-unknown-linux-musl/bin/ld: read-only segment has dynamic relocations
          collect2: error: ld returned 1 exit status
paulwratt commented 1 year ago

__ctzdi2 should be in a (linux/s390) header somewhere. I am pretty sure its timezone related. I cant see anything Musl related but there was this (note not exactly the same):

https://stackoverflow.com/questions/40302458/undefined-symbol-ctzdi2

It implies its possible its GCC (the glibc?). What was that other error you got on aarch64 which forced you to change it back to using GCC 9.2?

messense commented 1 year ago

What was that other error you got on aarch64 which forced you to change it back to using GCC 9.2?

https://github.com/messense/rust-musl-cross/pull/67#issuecomment-1251905512