Skip to content

missing build-id everywhere #11013

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

Open
vtjnash opened this issue Apr 16, 2025 · 3 comments
Open

missing build-id everywhere #11013

vtjnash opened this issue Apr 16, 2025 · 3 comments

Comments

@vtjnash
Copy link
Member

vtjnash commented Apr 16, 2025

The linker is supposed to set a build-id section, as many tools may expect that information to exist to function properly. Therefore, most distros provide this info by default in the compiler. Why is that section missing from all libraries produced here?

Tried:

$ readelf -n usr/lib/libLLVM-19jl.so 

Expected:


Displaying notes found in: .note.gnu.build-id
  Owner                Data size        Description
  GNU                  0x00000014       NT_GNU_BUILD_ID (unique build ID bitstring)
    Build ID: 45faaa1f2e6e832cf7ffa21199c8b51012ba8daa

Got:
nothing

(might be related to JuliaPackaging/BinaryBuilder.jl#1272)

@giordano
Copy link
Member

I don't think we do much for this not to happen. Do we need to configure GCC with --enable-linker-build-id?

@giordano
Copy link
Member

I don't see much with Clang either:

sandbox:${WORKSPACE} # echo 'int main() { return 0; }' | gcc -x c - -o gcc.out
sandbox:${WORKSPACE} # readelf -n gcc.out

Displaying notes found at file offset 0x0000021c with length 0x00000020:
  Owner                 Data size	Description
  GNU                  0x00000010	NT_GNU_ABI_TAG (ABI version tag)
    OS: Linux, ABI: 2.4.0
sandbox:${WORKSPACE} # echo 'int main() { return 0; }' | clang -x c - -o clang.out
sandbox:${WORKSPACE} # readelf -n clang.out

Displaying notes found at file offset 0x00000254 with length 0x00000020:
  Owner                 Data size	Description
  GNU                  0x00000010	NT_GNU_ABI_TAG (ABI version tag)
    OS: Linux, ABI: 2.4.0

@Zentrik
Copy link
Contributor

Zentrik commented Apr 20, 2025

As far as I can tell, to enable build id's by default in the compiler gcc should be configured with --enable-linker-build-id and clang DENABLE_LINKER_BUILD_ID per https://releases.llvm.org/3.9.0/tools/clang/docs/ReleaseNotes.html#major-new-features.
Or just pass -Wl,--build-id into the compiler flags.

vtjnash added a commit that referenced this issue May 13, 2025
Disable target features explicitly for host build, to avoid environment
conflicts, while adding Zstd and build-id support to the target.

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

No branches or pull requests

3 participants