Skip to content

elfutils: 0.192 -> 0.193#402441

Merged
vcunat merged 1 commit intoNixOS:stagingfrom
trofi:elfutils-update
May 28, 2025
Merged

elfutils: 0.192 -> 0.193#402441
vcunat merged 1 commit intoNixOS:stagingfrom
trofi:elfutils-update

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Apr 28, 2025

Changes: https://www.mail-archive.com/elfutils-devel@sourceware.org/msg08098.html

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Apr 28, 2025
@nix-owners nix-owners bot requested a review from r-burns April 28, 2025 06:13
@trofi trofi marked this pull request as draft April 28, 2025 06:17
@trofi
Copy link
Contributor Author

trofi commented Apr 28, 2025

One new test lacks an rpath/ld_preload to run lcoally:

       > ./dwarf_srclang_check: error while loading shared libraries: libelf.so.1: cannot open shared object file: No such file or directory
       > FAIL dwarf_srclang_check (exit status: 127)

UPDATE: filed upstream as https://sourceware.org/PR32929

@trofi trofi force-pushed the elfutils-update branch from 67e9d70 to 1b8d38e Compare April 28, 2025 06:35
@trofi
Copy link
Contributor Author

trofi commented Apr 28, 2025

Added LD_LIBRARY_PATH to preCheck until it's fixed upstream.

@trofi trofi marked this pull request as ready for review April 28, 2025 06:36
@trofi trofi force-pushed the elfutils-update branch from 1b8d38e to 86b0198 Compare May 2, 2025 13:38
Copy link
Contributor

@r-burns r-burns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and builds/runs on x86_64-linux

@wegank wegank added 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. 12.approvals: 1 This PR was reviewed and approved by one person. labels May 3, 2025
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5509

javierhonduco added a commit to javierhonduco/lightswitch that referenced this pull request May 27, 2025
javierhonduco added a commit to javierhonduco/lightswitch that referenced this pull request May 27, 2025
@vcunat vcunat merged commit 9fe2db9 into NixOS:staging May 28, 2025
29 checks passed
@trofi trofi deleted the elfutils-update branch May 28, 2025 17:57
@patryk4815
Copy link
Contributor

patryk4815 commented Jun 22, 2025

@trofi probably cxx-header-collision.patch is not working now, it is not compiling on llvm

elfutils> applying patch /nix/store/919ppf60bjcpm3cnc9mzsaq2qwpnqm8x-cxx-header-collision.patch
elfutils> patching file config/eu-common.am
elfutils> patching file config/eu.am
elfutils> Hunk #2 FAILED at 31.
elfutils> 1 out of 2 hunks FAILED -- saving rejects to file config/eu.am.rej
elfutils> patching file src/Makefile.am
elfutils> Hunk #1 FAILED at 16.
elfutils> 1 out of 1 hunk FAILED -- saving rejects to file src/Makefile.am.rej

full log:

[root@host1:~]# nix build github:nixos/nixpkgs/nixpkgs-unstable#pkgsLLVM.elfutils
error: builder for '/nix/store/cp1l2khzrw41xxb0m516wsfk2yvjwqjg-elfutils-x86_64-unknown-linux-gnu-0.193.drv' failed with exit code 1;
       last 25 log lines:
       > Hunk #1 succeeded at 659 (offset 28 lines).
       > applying patch /nix/store/9lfh9b2b5x2wxscq0kw4k1m61p8yqn9w-fix-aarch64_fregs.patch
       > patching file backends/aarch64_initreg.c
       > Hunk #1 succeeded at 115 (offset 33 lines).
       > applying patch /nix/store/vg5dsxxj9ayfgn35x0d04sdih8035rr4-musl-asm-ptrace-h.patch
       > patching file backends/ppc_initreg.c
       > Hunk #1 succeeded at 33 with fuzz 2 (offset 1 line).
       > applying patch /nix/store/hi3j97v910lh9rfr44j9bckj56rm03gd-musl-macros.patch
       > patching file lib/libeu.h
       > patching file src/arlib.h
       > patching file src/strip.c
       > Hunk #1 succeeded at 45 (offset -1 lines).
       > patching file src/elfcompress.c
       > Hunk #1 succeeded at 37 with fuzz 2 (offset 2 lines).
       > applying patch /nix/store/n0q1n3zcig79inm4jbl175pnpsm5axgf-musl-strndupa.patch
       > patching file src/unstrip.c
       > Hunk #1 succeeded at 51 with fuzz 2 (offset -5 lines).
       > applying patch /nix/store/919ppf60bjcpm3cnc9mzsaq2qwpnqm8x-cxx-header-collision.patch
       > patching file config/eu-common.am
       > patching file config/eu.am
       > Hunk #2 FAILED at 31.
       > 1 out of 2 hunks FAILED -- saving rejects to file config/eu.am.rej
       > patching file src/Makefile.am
       > Hunk #1 FAILED at 16.
       > 1 out of 1 hunk FAILED -- saving rejects to file src/Makefile.am.rej
       For full logs, run 'nix log /nix/store/cp1l2khzrw41xxb0m516wsfk2yvjwqjg-elfutils-x86_64-unknown-linux-gnu-0.193.drv'.
       ```

@trofi
Copy link
Contributor Author

trofi commented Jun 23, 2025

Good catch! I keep forgetting to test it. Given that patch is a bit invasive let's fine out why stack only gets included from current directory by clang, but not gcc. Maybe it will help hacking up something less invasive.

@trofi
Copy link
Contributor Author

trofi commented Jun 23, 2025

clang search order (added -v):

x86_64-unknown-linux-gnu-clang++ -std=c++11 -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"/home/slyfox/dev/git/nixpkgs-master/outputs/out/share/locale"'  -DDEBUGPRED=0 -DSRCDIR=\"/home/slyfox/nm/elfutils-0.193/src\" -DOBJDIR=\"/home/slyfox/nm/elfutils-0.193/src\"   -iquote . -I. -I../lib -I.. -I./../libelf -I./../libebl -I./../libdw -I./../libdwelf -I./../libdwfl -I./../libdwfl_stacktrace -I./../libasm -I../debuginfod  -std=c++11 -Wall -Wshadow    -Wnull-dereference -Wimplicit-fallthrough -Werror -Wunused -Wextra    -D_FORTIFY_SOURCE=3 -Wno-unused-private-field -MT srcfiles.o -MD -MP -MF .deps/srcfiles.Tpo -c -o srcfiles.o srcfiles.cxx -v

clang -cc1 version 19.1.7 based upon LLVM 19.1.7 default target x86_64-unknown-linux-gnu
#include "..." search starts here:
 .
#include <...> search starts here:
 .
 ../lib
 ..
 ./../libelf
 ./../libebl
 ./../libdw
 ./../libdwelf
 ./../libdwfl
 ./../libdwfl_stacktrace
 ./../libasm
 ../debuginfod
 /nix/store/7mk6c0p1jvxm3vq2my5swi5jlidby1h7-libcxx-x86_64-unknown-linux-gnu-19.1.7-dev/include
 /nix/store/dq74bpzl9dkh0j0745y3p9y5brlqsy44-compiler-rt-libc-x86_64-unknown-linux-gnu-19.1.7-dev/include
 /nix/store/6jk61by0f6dzxfg0mkwhb0v7dg35sk5i-libunwind-x86_64-unknown-linux-gnu-19.1.7-dev/include
 /nix/store/dnkga7gjlhwhbqy7wb4mvx35384fpmq1-zlib-x86_64-unknown-linux-gnu-1.3.1-dev/include
 /nix/store/zzvkl51807jvrg8j3zgl1r45nzrq6csk-zstd-x86_64-unknown-linux-gnu-1.5.7-dev/include
 /nix/store/5mnyq5n7s8bzas9amcqza8id5m76ba3i-bzip2-x86_64-unknown-linux-gnu-1.0.8-dev/include
 /nix/store/zzqb3pxnidny4nr4kzhxwplaw4k18k1q-xz-x86_64-unknown-linux-gnu-5.8.1-dev/include
 /nix/store/ffw6bc7wb2w283fsfzd492f8r0lw875q-sqlite-x86_64-unknown-linux-gnu-3.50.1-dev/include
 /nix/store/d7l5b4ibq94h1vrkkx045nvldgh8jgj7-curl-x86_64-unknown-linux-gnu-8.14.1-dev/include
 /nix/store/8hfdbdfbfavsh2kf64gdhfgayd4zla6d-brotli-x86_64-unknown-linux-gnu-1.1.0-dev/include
 /nix/store/2zn34fdsfxmpfhdzfcr114xs21g8vh3j-krb5-x86_64-unknown-linux-gnu-1.21.3-dev/include
 /nix/store/aqsm2vpc2lfab9ppfzncwl2h9q0ya72x-nghttp2-x86_64-unknown-linux-gnu-1.65.0-dev/include
 /nix/store/6awbp8yp4dm1fgcgdgfrb7y7clknl9r3-libidn2-x86_64-unknown-linux-gnu-2.3.8-dev/include
 /nix/store/pl51fnydqp93lxhqxmkh6s78mazm397k-openssl-x86_64-unknown-linux-gnu-3.4.1-dev/include
 /nix/store/4q33kriab2hdcflnf1ny6pvj2xg4jk57-libpsl-x86_64-unknown-linux-gnu-0.21.5-dev/include
 /nix/store/kyhbn03ccwpw0xpszv95r2mvxmkamyjd-libssh2-x86_64-unknown-linux-gnu-1.11.1-dev/include
 /nix/store/qmkqd1lyp2vp0lwgl9b2934hf9sr6ww8-json-c-x86_64-unknown-linux-gnu-0.18-dev/include
 /nix/store/ci0f7qj9q36nc3wija3pibsn3vp083lb-libmicrohttpd-x86_64-unknown-linux-gnu-1.0.1-dev/include
 /nix/store/avk3z4jfa221bq4lfhbnx9ci4xw3l50d-libarchive-x86_64-unknown-linux-gnu-3.8.0-dev/include
 /nix/store/b6p6g38y8gab6mwbm651qa01mi44pv42-attr-x86_64-unknown-linux-gnu-2.5.2-dev/include
 /nix/store/20c2nqd3ckww4a6n5xlvqrxv0x3343bh-acl-x86_64-unknown-linux-gnu-2.3.2-dev/include
 /nix/store/7mk6c0p1jvxm3vq2my5swi5jlidby1h7-libcxx-x86_64-unknown-linux-gnu-19.1.7-dev/include/c++/v1
 /nix/store/0nw2p0v6z56jmwd6kil258n8ggc44fab-x86_64-unknown-linux-gnu-clang-wrapper-19.1.7/resource-root/include
 /nix/store/j5fw8dw29qnkpq0fp1cw00jcnm4r9rb6-glibc-x86_64-unknown-linux-gnu-2.40-66-dev/include
End of search list.

gcc search order:

$ g++ -std=c++11 -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"/home/slyfox/dev/git/nixpkgs-master/outputs/out/share/locale"'  -DDEBUGPRED=0 -DSRCDIR=\"/home/slyfox/nm/elfutils-0.193/src\" -DOBJDIR=\"/home/slyfox/nm/elfutils-0.193/src\"   -iquote . -I. -I../lib -I.. -I./../libelf -I./../libebl -I./../libdw -I./../libdwelf -I./../libdwfl -I./../libdwfl_stacktrace -I./../libasm -I../debuginfod  -std=c++11 -Wall -Wshadow    -Wnull-dereference -Wimplicit-fallthrough -Werror -Wunused -Wextra    -D_FORTIFY_SOURCE=3 -Wno-unused-private-field -MT srcfiles.o -MD -MP -MF .deps/srcfiles.Tpo -c -o srcfiles.o srcfiles.cxx -v

#include "..." search starts here:
#include <...> search starts here:
 .
 ../lib
 ..
 ./../libelf
 ./../libebl
 ./../libdw
 ./../libdwelf
 ./../libdwfl
 ./../libdwfl_stacktrace
 ./../libasm
 ../debuginfod
 /nix/store/4wsmvv5saznifza1b8kx5rpjc7dvzvs9-flex-2.6.4/include
 /nix/store/zs5crhr67zp8cxn7dh4mwq08zw3sb31m-gettext-0.22.5/include
 /nix/store/b6k07i5hpjilwfkmmpvi5p1zsf7zrdfl-bzip2-1.0.8-dev/include
 /nix/store/99mambdfxnpm6rkdjbf1hhgdg87caxa3-zlib-1.3.1-dev/include
 /nix/store/j7srhraly1gf2zklj4wbdby02a1z7ckx-zstd-1.5.7-dev/include
 /nix/store/sw32cxs33z40axz67x7iqllwjvvxcznx-xz-5.8.1-dev/include
 /nix/store/q70y1hc004sa6h8hd4jvg3l8ybwa11r1-sqlite-3.50.1-dev/include
 /nix/store/wznrhnlrvamvihizpnizjfh5hs55z98n-curl-8.14.1-dev/include
 /nix/store/v35431pqdgjr19lr8qi977kg0v41viyn-brotli-1.1.0-dev/include
 /nix/store/48wm9h7wf8ds4wkwgzzcqfrp7l722dm8-krb5-1.21.3-dev/include
 /nix/store/9pn6y4zlszr9w26rg2h52l3sd0wvzjvd-nghttp2-1.65.0-dev/include
 /nix/store/9j67k582x3vgcijfiyralx5bj1b33gdg-libidn2-2.3.8-dev/include
 /nix/store/k0699a27nkj4c2xn67bjcpfa08nqn9l4-openssl-3.4.1-dev/include
 /nix/store/y37r7yjyvnzzd648lpdgflynfj55hpns-libpsl-0.21.5-dev/include
 /nix/store/9wbcb5zbzgmih0y41qzhg6fz5zdsi085-libssh2-1.11.1-dev/include
 /nix/store/ihafi3khxki1xihbbdjs3prl7dvfj35x-json-c-0.18-dev/include
 /nix/store/9msrqbaickdqdqr9d0916rarrm0z4s97-libmicrohttpd-1.0.1-dev/include
 /nix/store/8vk1592f5qpyf3n02yiykh000mshn74j-libarchive-3.8.0-dev/include
 /nix/store/30j3mdzy1ghvki2a52lmsdvqx2b0zdav-attr-2.5.2-dev/include
 /nix/store/v2drnxjaw1vzzzciqf6m49r5zrv1md2a-acl-2.3.2-dev/include
 /nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/include/c++/14.3.0/
 /nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/include/c++/14.3.0//x86_64-unknown-linux-gnu
 /nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/include/c++/14.3.0//backward
 /nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/lib/gcc/x86_64-unknown-linux-gnu/14.3.0/include
 /nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/include
 /nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/lib/gcc/x86_64-unknown-linux-gnu/14.3.0/include-fixed
 /nix/store/x4cz3spvw0bwwz5sjsdn2qm4f89rcryn-glibc-2.40-66-dev/include
End of search list.

Looks the same. Both start from ., both have ./stack as a binary in local directory.

Ahh! It's because gcc happens not to #include <stack> in iostream. To trigger the same bug on gcc it's enough to add an unused #include <stack> into src/srcfiles.cxx.

@trofi
Copy link
Contributor Author

trofi commented Jun 23, 2025

Upstream fix: https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=b426c4db31e7c80d4262abdd845d2ece0c9a841c

Should be easy to apply. UPDATE: it's already in 0.192 and 0.193. SOmething else is off as well here.

@patryk4815
Copy link
Contributor

This elfutils is most broken library that I ever seen, how do they live with it?

@trofi
Copy link
Contributor Author

trofi commented Jun 24, 2025

Found a reasonable workaround: build out of source tree to avoid -I . with:

preConfigure = ''
  mkdir build-tree
  cd build-tree
'';
configureScript = "../configure";

Proposed the fix as:

@trofi
Copy link
Contributor Author

trofi commented Jun 24, 2025

Filed upstream bug report as https://sourceware.org/PR33103

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

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

elfutils: Error linking libraries against elfutils with undefined symbol: eu_search_tree_init

6 participants