aws / aws-lc-rs

aws-lc-rs is a cryptographic library using AWS-LC for its cryptographic operations. The library strives to be API-compatible with the popular Rust library named ring.
Other
236 stars 40 forks source link

armv7-unknown-linux-gnueabihf build failed. #426

Closed zonyitoo closed 1 month ago

zonyitoo commented 1 month ago

Problem:

:: error: linking with `cc` failed: exit status: 1
::   |
::   = note: LC_ALL="C" PATH="/root/.rustup/toolchains/stable-armv7-unknown-linux-gnueabihf/lib/rustlib/armv7-unknown-linux-gnueabihf/bin:/root/.cargo/bin:/snap/snapcraft/11776/libexec/snapcraft:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "/tmp/rustcELPsaf/symbols.o" "/build/shadowsocks-rust/parts/shadowsocks-rust/build/target/release/deps/sslocal-ac1e7497de8e1e58.sslocal.52e1c4b00b93834d-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/build/shadowsocks-rust/parts/shadowsocks-rust/build/target/release/deps" "-L" "/build/shadowsocks-rust/parts/shadowsocks-rust/build/target/release/build/openssl-sys-68014d488782fa34/out/openssl-build/install/lib" "-L" "/build/shadowsocks-rust/parts/shadowsocks-rust/build/target/release/build/ring-ecb1d7a8df8f72b9/out" "-L" "/build/shadowsocks-rust/parts/shadowsocks-rust/build/target/release/build/ring-9a34e674bc03c03c/out" "-L" "/build/shadowsocks-rust/parts/shadowsocks-rust/build/target/release/build/zstd-sys-92f7e55abea1e9fb/out" "-L" "/build/shadowsocks-rust/parts/shadowsocks-rust/build/target/release/build/aws-lc-sys-39f3cae645e22220/out/build/artifacts/" "-L" "/root/.rustup/toolchains/stable-armv7-unknown-linux-gnueabihf/lib/rustlib/armv7-unknown-linux-gnueabihf/lib" "-Wl,-Bstatic" "/tmp/rustcELPsaf/libopenssl_sys-3f978028ea6fbef7.rlib" "/tmp/rustcELPsaf/libaws_lc_sys-00c2c15f1e71ac6c.rlib" "/tmp/rustcELPsaf/libzstd_sys-12f3a7842b492974.rlib" "/tmp/rustcELPsaf/libring-d2d9143dfec2ddf3.rlib" "/tmp/rustcELPsaf/libring-627367731f0440a2.rlib" "/root/.rustup/toolchains/stable-armv7-unknown-linux-gnueabihf/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libcompiler_builtins-8b56c4287b8a3def.rlib" "-Wl,-Bdynamic" "-latomic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/root/.rustup/toolchains/stable-armv7-unknown-linux-gnueabihf/lib/rustlib/armv7-unknown-linux-gnueabihf/lib" "-o" "/build/shadowsocks-rust/parts/shadowsocks-rust/build/target/release/deps/sslocal-ac1e7497de8e1e58" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-all" "-nodefaultlibs"
::   = note: /usr/bin/ld: /tmp/rustcELPsaf/libaws_lc_sys-00c2c15f1e71ac6c.rlib(sha256-armv4.S.o): in function `sha256_block_data_order_neon':
::           (.text+0xc90): multiple definition of `sha256_block_data_order_neon'; /tmp/rustcELPsaf/libopenssl_sys-3f978028ea6fbef7.rlib(libcrypto-lib-sha256-armv4.o):(.text+0xc90): first defined here
::           /usr/bin/ld: /tmp/rustcELPsaf/libaws_lc_sys-00c2c15f1e71ac6c.rlib(sha512-armv4.S.o): in function `sha512_block_data_order_neon':
::           (.text+0x710): multiple definition of `sha512_block_data_order_neon'; /tmp/rustcELPsaf/libopenssl_sys-3f978028ea6fbef7.rlib(libcrypto-lib-sha512-armv4.o):(.text+0x710): first defined here
::           collect2: error: ld returned 1 exit status

This is the build on Snap (build log): https://snapcraft.io/shadowsocks-rust/builds/2492790#footer

Relevant details

AWS-LC for Rust versions or commit: (crates.io aws-lc-rs v1.7.2)

System information: for linux, below info can be collected by running uname -srvmp

zonyitoo commented 1 month ago

Further more, same problem could be found when building for target armv7-unknown-linux-musleabihf:

Compiling shadowsocks-rust v1.19.0 (/project)
error: linking with `arm-linux-musleabihf-gcc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/rust/lib/rustlib/x86_64-unknown-linux-gnu/bin:/rust/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/rust/bin" VSLANG="1033" "arm-linux-musleabihf-gcc" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained/crt1.o" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained/crti.o" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained/crtbegin.o" "/tmp/rustcThA1GS/symbols.o" "/target/armv7-unknown-linux-musleabihf/release/deps/sslocal-351200f3718edcbc.sslocal.bfb2638088c0dfbd-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/target/armv7-unknown-linux-musleabihf/release/deps" "-L" "/target/release/deps" "-L" "/target/armv7-unknown-linux-musleabihf/release/build/openssl-sys-78fc496f0f791454/out/openssl-build/install/lib" "-L" "/target/armv7-unknown-linux-musleabihf/release/build/ring-48035827ecb53254/out" "-L" "/target/armv7-unknown-linux-musleabihf/release/build/ring-5c07b5e2b190f099/out" "-L" "/target/armv7-unknown-linux-musleabihf/release/build/zstd-sys-eb415a1bafaa948c/out" "-L" "/target/armv7-unknown-linux-musleabihf/release/build/aws-lc-sys-3c0baa9ba01ab963/out/build/artifacts/" "-L" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib" "-Wl,-Bstatic" "/tmp/rustcThA1GS/libopenssl_sys-0617dfd9b98df13d.rlib" "-latomic" "/tmp/rustcThA1GS/libaws_lc_sys-a5380391b2deb1d8.rlib" "/tmp/rustcThA1GS/libzstd_sys-b2344cf0f1a536a9.rlib" "/tmp/rustcThA1GS/libring-ee8a3c4283835c4c.rlib" "/tmp/rustcThA1GS/libring-00e0dec3131afd27.rlib" "-lunwind" "-lc" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/libcompiler_builtins-12f423a053b39417.rlib" "-Wl,-Bdynamic" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-nostartfiles" "-L" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib" "-L" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained" "-o" "/target/armv7-unknown-linux-musleabihf/release/deps/sslocal-351200f3718edcbc" "-Wl,--gc-sections" "-static" "-no-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-all" "-nodefaultlibs" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained/crtend.o" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained/crtn.o"
  = note: /usr/local/bin/../lib/gcc/arm-linux-musleabihf/9.2.0/../../../../arm-linux-musleabihf/bin/ld: /tmp/rustcThA1GS/libaws_lc_sys-a5380391b2deb1d8.rlib(sha256-armv4.S.o): in function `sha256_block_data_order_neon':
          (.text+0xc90): multiple definition of `sha256_block_data_order_neon'; /tmp/rustcThA1GS/libopenssl_sys-0617dfd9b98df13d.rlib(libcrypto-lib-sha256-armv4.o):(.text+0xc90): first defined here
          /usr/local/bin/../lib/gcc/arm-linux-musleabihf/9.2.0/../../../../arm-linux-musleabihf/bin/ld: /tmp/rustcThA1GS/libaws_lc_sys-a5380391b2deb1d8.rlib(sha512-armv4.S.o): in function `sha512_block_data_order_neon':
          (.text+0x710): multiple definition of `sha512_block_data_order_neon'; /tmp/rustcThA1GS/libopenssl_sys-0617dfd9b98df13d.rlib(libcrypto-lib-sha512-armv4.o):(.text+0x710): first defined here
          collect2: error: ld returned 1 exit status

error: could not compile `shadowsocks-rust` (bin "sslocal") due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: linking with `arm-linux-musleabihf-gcc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/rust/lib/rustlib/x86_64-unknown-linux-gnu/bin:/rust/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/rust/bin" VSLANG="1033" "arm-linux-musleabihf-gcc" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained/crt1.o" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained/crti.o" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained/crtbegin.o" "/tmp/rustc1ZHeGi/symbols.o" "/target/armv7-unknown-linux-musleabihf/release/deps/ssservice-e3ee515ae4e02a3b.ssservice.848519e29[620](https://github.com/shadowsocks/shadowsocks-rust/actions/runs/9237206906/job/25414561792#step:5:621)55fc-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/target/armv7-unknown-linux-musleabihf/release/deps" "-L" "/target/release/deps" "-L" "/target/armv7-unknown-linux-musleabihf/release/build/openssl-sys-78fc496f0f791454/out/openssl-build/install/lib" "-L" "/target/armv7-unknown-linux-musleabihf/release/build/ring-48035827ecb53254/out" "-L" "/target/armv7-unknown-linux-musleabihf/release/build/ring-5c07b5e2b190f099/out" "-L" "/target/armv7-unknown-linux-musleabihf/release/build/zstd-sys-eb415a1bafaa948c/out" "-L" "/target/armv7-unknown-linux-musleabihf/release/build/aws-lc-sys-3c0baa9ba01ab963/out/build/artifacts/" "-L" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib" "-Wl,-Bstatic" "/tmp/rustc1ZHeGi/libopenssl_sys-0617dfd9b98df13d.rlib" "-latomic" "/tmp/rustc1ZHeGi/libaws_lc_sys-a5380391b2deb1d8.rlib" "/tmp/rustc1ZHeGi/libzstd_sys-b2344cf0f1a536a9.rlib" "/tmp/rustc1ZHeGi/libring-ee8a3c4283835c4c.rlib" "/tmp/rustc1ZHeGi/libring-00e0dec3131afd27.rlib" "-lunwind" "-lc" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/libcompiler_builtins-12f423a053b39417.rlib" "-Wl,-Bdynamic" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-nostartfiles" "-L" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib" "-L" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained" "-o" "/target/armv7-unknown-linux-musleabihf/release/deps/ssservice-e3ee515ae4e02a3b" "-Wl,--gc-sections" "-static" "-no-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-all" "-nodefaultlibs" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained/crtend.o" "/rust/lib/rustlib/armv7-unknown-linux-musleabihf/lib/self-contained/crtn.o"
  = note: /usr/local/bin/../lib/gcc/arm-linux-musleabihf/9.2.0/../../../../arm-linux-musleabihf/bin/ld: /tmp/rustc1ZHeGi/libaws_lc_sys-a5380391b2deb1d8.rlib(sha256-armv4.S.o): in function `sha256_block_data_order_neon':
          (.text+0xc90): multiple definition of `sha256_block_data_order_neon'; /tmp/rustc1ZHeGi/libopenssl_sys-0617dfd9b98df13d.rlib(libcrypto-lib-sha256-armv4.o):(.text+0xc90): first defined here
          /usr/local/bin/../lib/gcc/arm-linux-musleabihf/9.2.0/../../../../arm-linux-musleabihf/bin/ld: /tmp/rustc1ZHeGi/libaws_lc_sys-a5380391b2deb1d8.rlib(sha512-armv4.S.o): in function `sha512_block_data_order_neon':
          (.text+0x710): multiple definition of `sha512_block_data_order_neon'; /tmp/rustc1ZHeGi/libopenssl_sys-0617dfd9b98df13d.rlib(libcrypto-lib-sha512-armv4.o):(.text+0x710): first defined here
          collect2: error: ld returned 1 exit status
justsmth commented 1 month ago

I believe the problem related to the Cross.toml configuration that you have here. See my comment on your other issue. Since I believe these have the same root cause, I will close this issue.