Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide a statically linked aarch64 version #1477

Closed
pro-sumer opened this issue Jan 14, 2024 · 5 comments
Closed

Please provide a statically linked aarch64 version #1477

pro-sumer opened this issue Jan 14, 2024 · 5 comments

Comments

@pro-sumer
Copy link
Contributor

Thank you for creating fd! A great tool, that I run on my Mac and Raspberry Pi's. I want to run it on my router as well, but that fails:

➜ ./fd
./fd: error while loading shared libraries: libgcc_s.so.1: wrong ELF class: ELFCLASS32

My router is an ASUS ROG GT-AX6000 with the excellent third-party Asuswrt-Merlin firmware installed. I use the Entware repository for embedded devices to install additional software. Unfortunately fd is not included (that would actually be the best solution for me), but they do include libgcc (currently 8.4.0-11). I manually installed fd-v9.0.0-aarch64-unknown-linux-gnu.tar.gz, which seems to start, but fails with the error above.

I'm not sure, but it looks like I have a 64 bits executable and 32 bits library?

If so, would it be possible to publish a statically linked version of the aarch64 flavour of fd? (which contains the 64 bits version of libgcc)

@pro-sumer
Copy link
Contributor Author

I'm not sure, but it looks like I have a 64 bits executable and 32 bits library?

If true, a dynamically linked 32 bits executable might also work? (As an alternative solution)

@tmccombs
Copy link
Collaborator

a dynamically linked 32 bits executable might also work?

I'm no expert on ARM, but I think the fd-v9.0.0-arm-unknown-linux-gnueabihf.tar.gz build would be that?

and fd-v9.0.0-arm-unknown-linux-musleabihf.tar.gz would be a statically compiled 32-bit arm version.

A statically linked version might be as simple as adding a line like

          - { target: aarch64-unknown-linux-musl  , os: ubuntu-20.04, use-cross: true }

to the build matrix. But I'm not sure if there would be any problems with that, and don't have a way to test if it works.

@pro-sumer
Copy link
Contributor Author

fd-v9.0.0-arm-unknown-linux-musleabihf.tar.gz would be a statically compiled 32-bit arm version.

I already tried that, but:

➜ ./fd
zsh: illegal hardware instruction  ./fd

@pro-sumer
Copy link
Contributor Author

A statically linked version might be as simple as adding a line like ... to the build matrix. But I'm not sure if there would be any problems with that, and don't have a way to test if it works.

Excellent suggestion! (I wasn't aware that the executables were built using GitHub actions)

I forked the repo, created a branch, added that line, and tested the generated binary on my router. Result:

➜ fd --version
fd 9.0.0

The statically linked aarch64 version works!

@pro-sumer
Copy link
Contributor Author

pro-sumer commented Jan 15, 2024

Created PR #1478 to add this target (if @sharkdp approves such an addition).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants