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

musl asset: inconsistent between output of file and ldd #2989

Open
tzq0301 opened this issue Jun 6, 2024 · 2 comments
Open

musl asset: inconsistent between output of file and ldd #2989

tzq0301 opened this issue Jun 6, 2024 · 2 comments
Labels
bug Something isn't working packaging/tooling

Comments

@tzq0301
Copy link
Contributor

tzq0301 commented Jun 6, 2024

What steps will reproduce the bug?

  1. wget https://github.com/sharkdp/bat/releases/download/v0.24.0/bat-v0.24.0-x86_64-unknown-linux-musl.tar.gz
  2. tar -xf bat-v0.24.0-x86_64-unknown-linux-musl.tar.gz
  3. cd bat-v0.24.0-x86_64-unknown-linux-musl/
  4. file ./bat
  5. ldd ./bat

What happens?

ldd says ./bat is 'statically linked', and it's actually is. But file says it's 'dynamically linked', which is a bit confused.

$ file ./bat
./bat: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

$ ldd ./bat
	statically linked

What did you expect to happen instead?

The output of file should be 'statically linked'

How did you install bat?

From binaries

bat version and environment

$ ./bat --version
bat 0.24.0 (fc95468)
@tzq0301 tzq0301 added the bug Something isn't working label Jun 6, 2024
@tzq0301
Copy link
Contributor Author

tzq0301 commented Jun 6, 2024

The result of arm-musl asset is consistent with other statically-linked binary executable file:

$ file bat
bat: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped

$ ldd ./bat
	not a dynamic executable

@daniejstriata
Copy link

I noticed this on other binaries as well. Could be a bug with file itself?

→ file fd
fd: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, stripped

vs

→ ldd fd
        statically linked

or

→ file rg
rg: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, stripped

vs

→ ldd rg
        statically linked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working packaging/tooling
Projects
None yet
Development

No branches or pull requests

3 participants