sharkdp / fd

A simple, fast and user-friendly alternative to 'find'
Apache License 2.0
34.02k stars 817 forks source link

[BUG] Build fails with --target armv7-unknown-linux-gnueabi #1428

Open hgy59 opened 11 months ago

hgy59 commented 11 months ago

Checks

Describe the bug you encountered:

Until fd 8.7.0 build with --target armv7-unknown-linux-gnueabi works fine.

For fd 8.7.1 there is a linker error

error: linking with `/spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/arm-cortexa9-linux-gnueabi-gcc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/spksrc/distrib/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/spksrc/distrib/cargo/bin:/spksrc/cross/fd/../../distrib/cargo/bin:/spksrc/cross/fd/../../distrib/cargo/bin:/spksrc/toolchain/syno-x86-6.2.4/../../distrib/cargo/bin:/scripts:/usr/local/bin:/usr/bin:/bin:/usr/games" VSLANG="1033" "/spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/arm-cortexa9-linux-gnueabi-gcc" "/tmp/rustcbOW9bB/symbols.o" "/spksrc/cross/fd/work-hi3535-6.2.4/fd-8.7.1/target/armv7-unknown-linux-gnueabi/release/deps/fd-f2cff162ee66e01d.fd.e477d554b120399b-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/spksrc/cross/fd/work-hi3535-6.2.4/fd-8.7.1/target/armv7-unknown-linux-gnueabi/release/deps" "-L" "/spksrc/cross/fd/work-hi3535-6.2.4/fd-8.7.1/target/release/deps" "-L" "/spksrc/cross/fd/work-hi3535-6.2.4/fd-8.7.1/target/armv7-unknown-linux-gnueabi/release/build/jemalloc-sys-a9978fef0ba428ab/out/build/lib" "-L" "/spksrc/distrib/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabi/lib" "-Wl,-Bstatic" "/tmp/rustcbOW9bB/libjemalloc_sys-7d1a32bd7f6af56f.rlib" "/spksrc/distrib/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabi/lib/libcompiler_builtins-c7422c3976ceb70a.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/spksrc/distrib/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabi/lib" "-o" "/spksrc/cross/fd/work-hi3535-6.2.4/fd-8.7.1/target/armv7-unknown-linux-gnueabi/release/deps/fd-f2cff162ee66e01d" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-all" "-nodefaultlibs"
  = note: /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          /spksrc/toolchain/syno-hi3535-6.2.4/work/arm-cortexa9-linux-gnueabi/bin/../lib/gcc/arm-cortexa9-linux-gnueabi/4.8.3/../../../../arm-cortexa9-linux-gnueabi/bin/ld.bfd: BFD (crosstool-NG 1.20.0) 2.24 assertion fail /home/cpt/hi3535/.build/src/binutils-2.24/bfd/elf32-arm.c:12387
          collect2: error: ld returned 1 exit status

error: could not compile `fd-find` (bin "fd") due to previous error

probably this is an issue with the older synology toolchain for hi3535 arch.

for other targets/toolchains the build succeeds:

Describe what you expected to happen:

No response

What version of fd are you using?

8.7.1

Which operating system / distribution are you on?

Synology toolchain:
- gcc: arm-cortexa9-linux-gnueabi-gcc (crosstool-NG 1.20.0) 4.8.3 20140106 (prerelease)
- ld: GNU ld (crosstool-NG 1.20.0) 2.24

build env:
- Linux spksrc 4.19.0-24-amd64 #1 SMP Debian 4.19.282-1 (2023-04-29) x86_64 GNU/Linux

rust:
- rustc 1.74.0 (79e9716c9 2023-11-13)
sharkdp commented 11 months ago

Thank you. It looks like this is a problem in a dependency (binutils). Do you think it should be reported upstream?

th0ma7 commented 2 months ago

Thank you. It looks like this is a problem in a dependency (binutils). Do you think it should be reported upstream?

As this version of binutils is provided part of the Synology toolchain, and that support from Synology for this specific architecture has ended, there isn't much that can be done from an upstreaming point of view. Further as it uses v2.24 of binutils dating from 2013.

I've hit this issue once again https://github.com/SynoCommunity/spksrc/pull/6210 where it no longer "only" fails to build with fd >= 8.7.1, but it's now also failing with latest functional version (8.7.0) in conjunction with newer rust >= 1.80.1. We can workaround that by fixing rust version to 1.7x but this leaves a gap for future (and limited) support for updated apps.

If there is anything that can be done on fd sources side to fix this would be really nice albeit that could be a burden to maintain later on.