rust-musl-cross icon indicating copy to clipboard operation
rust-musl-cross copied to clipboard

s390x can't build openssl-src

Open messense opened this issue 1 year ago • 3 comments

  = 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 avatar Sep 19 '22 03:09 messense

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

messense avatar Sep 21 '22 06:09 messense

__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?

paulwratt avatar Sep 21 '22 08:09 paulwratt

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

messense avatar Sep 22 '22 14:09 messense