NixOS / patchelf

A small utility to modify the dynamic linker and RPATH of ELF executables
GNU General Public License v3.0
3.57k stars 486 forks source link

Test shared-rpath fails when building with lld #559

Open ziyao233 opened 4 months ago

ziyao233 commented 4 months ago

Describe the bug

When building patchelf and tests with LLVM lld, test shared-rpath fails

Steps To Reproduce

Building patchelf with LLVM lld and run tests.

On my Alpine machine,

CC=clang-18 CXX=clang++-18 LDFLAGS="-fuse-ld=lld" ./configure
make check

Expected behavior

All tests passed.

patchelf --version output

patchelf 0.18.

Additional context Differing from GNU ld, lld does not reuse string referred by DT_RPATH, which results in a shared-rpath.so with two a_symbol_name string, failing the test.

Suggest skipping this test when building with lld.

thenester commented 4 months ago

I am unsure whether it is the exact same problem, but I see the same failed shared-rpath test even without LLVM lld on NixOS 24.05.

Here are full build logs I have. Hopefully, these could ease the debug:

gcc 13.2.0 ```bash scaroboros :: ~/Projects/patchelf ‹master› % git s On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean scaroboros :: ~/Projects/patchelf ‹master› % git l 1 * a0f5433 - (HEAD -> master, origin/master, origin/HEAD) fix compilation with GCC7 (2024-06-15) % scaroboros :: ~/Projects/patchelf ‹master› % ./bootstrap.sh && ./configure && make check autoreconf: export WARNINGS=all autoreconf: Entering directory '.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force autoreconf: configure.ac: tracing autoreconf: configure.ac: creating directory build-aux autoreconf: configure.ac: not using Libtool autoreconf: configure.ac: not using Intltool autoreconf: configure.ac: not using Gtkdoc autoreconf: running: /nix/store/ysmm9sqwjjnh15whilms1xjhhxj12qmi-autoconf-2.72/bin/autoconf --force autoreconf: configure.ac: not using Autoheader autoreconf: running: automake --add-missing --copy --force-missing configure.ac:16: installing 'build-aux/compile' configure.ac:5: installing 'build-aux/install-sh' configure.ac:5: installing 'build-aux/missing' src/Makefile.am: installing 'build-aux/depcomp' parallel-tests: installing 'build-aux/test-driver' autoreconf: 'build-aux/install-sh' is updated autoreconf: Leaving directory '.' checking for a BSD-compatible install... /run/current-system/sw/bin/install -c checking whether build environment is sane... yes checking for a race-free mkdir -p... /run/current-system/sw/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for strip... strip checking for nm... nm checking for objdump... objdump checking for objcopy... objcopy checking for readelf... readelf checking for strings... strings checking whether make supports the include directive... yes (GNU style) checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether gcc accepts -g... yes checking for gcc option to enable C11 features... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for g++... g++ checking whether the compiler supports GNU C++... yes checking whether g++ accepts -g... yes checking for g++ option to enable C++11 features... none needed checking dependency style of g++... gcc3 checking dependency style of gcc... gcc3 checking whether g++ supports C++17 features with -std=c++17... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating tests/Makefile config.status: creating patchelf.spec config.status: executing depfiles commands Making check in src make[1]: Entering directory '/home/rocky/Projects/patchelf/src' g++ -std=c++17 -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -Wall -Wextra -Wcast-qual -std=c++17 -D_FILE_OFFSET_BITS=64 -g -O2 -MT patchelf.o -MD -MP -MF .deps/patchelf.Tpo -c -o patchelf.o patchelf.cc mv -f .deps/patchelf.Tpo .deps/patchelf.Po g++ -std=c++17 -Wall -Wextra -Wcast-qual -std=c++17 -D_FILE_OFFSET_BITS=64 -g -O2 -o patchelf patchelf.o make[1]: Leaving directory '/home/rocky/Projects/patchelf/src' Making check in tests make[1]: Entering directory '/home/rocky/Projects/patchelf/tests' make simple-pie simple simple-execstack main too-many-strtab main-scoped big-dynstr no-rpath contiguous-note-sections libfoo.so libfoo-scoped.so libbar.so libbar-scoped.so libsimple.so libsimple-execstack.so libbuildid.so libtoomanystrtab.so phdr-corruption.so many-syms-main libmany-syms.so liboveralign.so libshared-rpath.so libbig-dynstr.debug make[2]: Entering directory '/home/rocky/Projects/patchelf/tests' gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fPIC -pie -g -O2 -MT simple_pie-simple.o -MD -MP -MF .deps/simple_pie-simple.Tpo -c -o simple_pie-simple.o `test -f 'simple.c' || echo './'`simple.c mv -f .deps/simple_pie-simple.Tpo .deps/simple_pie-simple.Po gcc -fPIC -pie -g -O2 -o simple-pie simple_pie-simple.o gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -g -O2 -MT simple-simple.o -MD -MP -MF .deps/simple-simple.Tpo -c -o simple-simple.o `test -f 'simple.c' || echo './'`simple.c mv -f .deps/simple-simple.Tpo .deps/simple-simple.Po gcc -g -O2 -Wl,-z,noexecstack -o simple simple-simple.o gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -g -O2 -MT simple_execstack-simple.o -MD -MP -MF .deps/simple_execstack-simple.Tpo -c -o simple_execstack-simple.o `test -f 'simple.c' || echo './'`simple.c mv -f .deps/simple_execstack-simple.Tpo .deps/simple_execstack-simple.Po gcc -g -O2 -Wl,-z,execstack -o simple-execstack simple_execstack-simple.o gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c mv -f .deps/main.Tpo .deps/main.Po gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT foo.o -MD -MP -MF .deps/foo.Tpo -c -o foo.o foo.c mv -f .deps/foo.Tpo .deps/foo.Po gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT bar.o -MD -MP -MF .deps/bar.Tpo -c -o bar.o bar.c mv -f .deps/bar.Tpo .deps/bar.Po gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,-rpath,`pwd`/no-such-path -o libbar.so bar.o gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -o libfoo.so foo.o -lbar gcc -fpic -g -O2 -Wl,--disable-new-dtags -Wl,-rpath-link=. -L. -o main main.o -lfoo gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT too-many-strtab.o -MD -MP -MF .deps/too-many-strtab.Tpo -c -o too-many-strtab.o too-many-strtab.c mv -f .deps/too-many-strtab.Tpo .deps/too-many-strtab.Po gcc -g -O2 -c -o too-many-strtab2.o too-many-strtab2.s gcc -fpic -g -O2 -o too-many-strtab too-many-strtab.o too-many-strtab2.o /nix/store/7v7g86ml0ri171gfcrs1d442px5bi1p3-binutils-2.41/bin/ld: warning: too-many-strtab2.o: missing .note.GNU-stack section implies executable stack /nix/store/7v7g86ml0ri171gfcrs1d442px5bi1p3-binutils-2.41/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -o libbar-scoped.so bar.o gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -o libfoo-scoped.so foo.o -lbar-scoped gcc -fpic -g -O2 -Wl,--disable-new-dtags -Wl,-rpath-link=. -L. -o main-scoped main.o -lfoo-scoped cat main.c > big-dynstr.c i=1; while [ $i -le 2000 ]; do echo "void f$i(void) { };"; i=$(($i + 1)); done >> big-dynstr.c gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT big-dynstr.o -MD -MP -MF .deps/big-dynstr.Tpo -c -o big-dynstr.o big-dynstr.c mv -f .deps/big-dynstr.Tpo .deps/big-dynstr.Po gcc -fpic -g -O2 -Wl,--disable-new-dtags -Wl,-rpath-link=. -L. -o big-dynstr big-dynstr.o -lfoo gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -g -O2 -MT no_rpath-no-rpath.o -MD -MP -MF .deps/no_rpath-no-rpath.Tpo -c -o no_rpath-no-rpath.o `test -f 'no-rpath.c' || echo './'`no-rpath.c mv -f .deps/no_rpath-no-rpath.Tpo .deps/no_rpath-no-rpath.Po gcc -g -O2 -o no-rpath no_rpath-no-rpath.o gcc -g -O2 -c -o contiguous-note-sections.o contiguous-note-sections.s gcc -pie -g -O2 -nostdlib -T ./contiguous-note-sections.ld -o contiguous-note-sections contiguous-note-sections.o make[2]: 'libfoo.so' is up to date. make[2]: 'libfoo-scoped.so' is up to date. make[2]: 'libbar.so' is up to date. make[2]: 'libbar-scoped.so' is up to date. gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT simple.o -MD -MP -MF .deps/simple.Tpo -c -o simple.o simple.c mv -f .deps/simple.Tpo .deps/simple.Po gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,-z,noexecstack -o libsimple.so simple.o gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,-z,execstack -o libsimple-execstack.so simple.o gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,--build-id -o libbuildid.so simple.o gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -o libtoomanystrtab.so too-many-strtab.o too-many-strtab2.o /nix/store/7v7g86ml0ri171gfcrs1d442px5bi1p3-binutils-2.41/bin/ld: warning: too-many-strtab2.o: missing .note.GNU-stack section implies executable stack /nix/store/7v7g86ml0ri171gfcrs1d442px5bi1p3-binutils-2.41/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -g -O2 -MT phdr_corruption_so-void.o -MD -MP -MF .deps/phdr_corruption_so-void.Tpo -c -o phdr_corruption_so-void.o `test -f 'void.c' || echo './'`void.c mv -f .deps/phdr_corruption_so-void.Tpo .deps/phdr_corruption_so-void.Po gcc -g -O2 -nostdlib -shared -Wl,-T./phdr-corruption.ld -o phdr-corruption.so phdr_corruption_so-void.o /nix/store/7v7g86ml0ri171gfcrs1d442px5bi1p3-binutils-2.41/bin/ld: warning: phdr-corruption.so has a LOAD segment with RWX permissions echo "int main() {" > many-syms-main.c i=1; while [ $i -le 2000 ]; do echo "void f$i(); f$i();"; i=$(($i + 1)); done >> many-syms-main.c echo "}" >> many-syms-main.c gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -pie -g -O2 -MT many_syms_main-many-syms-main.o -MD -MP -MF .deps/many_syms_main-many-syms-main.Tpo -c -o many_syms_main-many-syms-main.o `test -f 'many-syms-main.c' || echo './'`many-syms-main.c mv -f .deps/many_syms_main-many-syms-main.Tpo .deps/many_syms_main-many-syms-main.Po i=1; while [ $i -le 2000 ]; do echo "void f$i() {};"; i=$(($i + 1)); done > many-syms.c gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT many-syms.o -MD -MP -MF .deps/many-syms.Tpo -c -o many-syms.o many-syms.c mv -f .deps/many-syms.Tpo .deps/many-syms.Po gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -o libmany-syms.so many-syms.o gcc -pie -g -O2 -Wl,--disable-new-dtags -Wl,-rpath-link=. -L. -o many-syms-main many_syms_main-many-syms-main.o -lmany-syms make[2]: 'libmany-syms.so' is up to date. gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,-z,max-page-size=0x10000 -o liboveralign.so simple.o gcc -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT shared-rpath.o -MD -MP -MF .deps/shared-rpath.Tpo -c -o shared-rpath.o shared-rpath.c mv -f .deps/shared-rpath.Tpo .deps/shared-rpath.Po gcc -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,-rpath=a_symbol_name -o libshared-rpath.so shared-rpath.o gcc -fPIC -shared -o libbig-dynstr.so big-dynstr.c strip --only-keep-debug libbig-dynstr.so -o libbig-dynstr.debug make[2]: Leaving directory '/home/rocky/Projects/patchelf/tests' make check-TESTS make[2]: Entering directory '/home/rocky/Projects/patchelf/tests' make[3]: Entering directory '/home/rocky/Projects/patchelf/tests' PASS: plain-fail.sh PASS: plain-run.sh PASS: shrink-rpath.sh PASS: set-interpreter-short.sh PASS: set-interpreter-long.sh PASS: set-rpath.sh PASS: add-rpath.sh FAIL: no-rpath.sh PASS: big-dynstr.sh PASS: set-rpath-library.sh PASS: soname.sh PASS: shrink-rpath-with-allowed-prefixes.sh SKIP: set-rpath-rel-map.sh PASS: force-rpath.sh PASS: plain-needed.sh PASS: output-flag.sh PASS: too-many-strtab.sh PASS: no-rpath-pie-powerpc.sh PASS: build-id.sh PASS: invalid-elf.sh PASS: endianness.sh PASS: contiguous-note-sections.sh PASS: no-gnu-hash.sh PASS: change-abi.sh PASS: grow-file.sh PASS: no-dynamic-section.sh PASS: args-from-file.sh PASS: basic-flags.sh PASS: set-empty-rpath.sh PASS: phdr-corruption.sh PASS: replace-needed.sh PASS: replace-add-needed.sh PASS: add-debug-tag.sh PASS: repeated-updates.sh PASS: empty-note.sh PASS: print-execstack.sh PASS: modify-execstack.sh PASS: rename-dynamic-symbols.sh PASS: overlapping-segments-after-rounding.sh FAIL: shared-rpath.sh SKIP: short-first-segment.sh PASS: no-rpath-amd64.sh PASS: no-rpath-armel.sh PASS: no-rpath-armhf.sh PASS: no-rpath-hurd-i386.sh PASS: no-rpath-i386.sh PASS: no-rpath-ia64.sh PASS: no-rpath-kfreebsd-amd64.sh PASS: no-rpath-kfreebsd-i386.sh PASS: no-rpath-mips.sh PASS: no-rpath-mipsel.sh PASS: no-rpath-powerpc.sh PASS: no-rpath-s390.sh PASS: no-rpath-sh4.sh PASS: no-rpath-sparc.sh ============================================================================ Testsuite summary for patchelf 0.18.0 ============================================================================ # TOTAL: 56 # PASS: 52 # SKIP: 2 # XFAIL: 0 # FAIL: 2 # XPASS: 0 # ERROR: 0 ============================================================================ See tests/test-suite.log ============================================================================ make[3]: *** [Makefile:1070: test-suite.log] Error 1 make[3]: Leaving directory '/home/rocky/Projects/patchelf/tests' make[2]: *** [Makefile:1178: check-TESTS] Error 2 make[2]: Leaving directory '/home/rocky/Projects/patchelf/tests' make[1]: *** [Makefile:1629: check-am] Error 2 make[1]: Leaving directory '/home/rocky/Projects/patchelf/tests' make: *** [Makefile:474: check-recursive] Error 1 scaroboros :: ~/Projects/patchelf ‹master*› % uname -a 2 ↵ Linux scaroboros 6.6.35 #1-NixOS SMP PREEMPT_DYNAMIC Fri Jun 21 12:38:50 UTC 2024 x86_64 GNU/Linux scaroboros :: ~/Projects/patchelf ‹master*› % nix-instantiate --eval --expr "builtins.substring 0 5 ((import {}).lib.version)" "24.05" scaroboros :: ~/Projects/patchelf ‹master*› % gcc --version gcc (GCC) 13.2.0 Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ```
clang 17.0.6 ```bash scaroboros :: ~/Projects/patchelf ‹master› % git s 130 ↵ On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean scaroboros :: ~/Projects/patchelf ‹master› % git l 1 * a0f5433 - (HEAD -> master, origin/master, origin/HEAD) fix compilation with GCC7 (2024-06-15) % scaroboros :: ~/Projects/patchelf ‹master› % ./bootstrap.sh && CC=clang CXX=clang++ ./configure && make check autoreconf: export WARNINGS=all autoreconf: Entering directory '.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force autoreconf: configure.ac: tracing autoreconf: configure.ac: creating directory build-aux autoreconf: configure.ac: not using Libtool autoreconf: configure.ac: not using Intltool autoreconf: configure.ac: not using Gtkdoc autoreconf: running: /nix/store/ysmm9sqwjjnh15whilms1xjhhxj12qmi-autoconf-2.72/bin/autoconf --force autoreconf: configure.ac: not using Autoheader autoreconf: running: automake --add-missing --copy --force-missing configure.ac:16: installing 'build-aux/compile' configure.ac:5: installing 'build-aux/install-sh' configure.ac:5: installing 'build-aux/missing' src/Makefile.am: installing 'build-aux/depcomp' parallel-tests: installing 'build-aux/test-driver' autoreconf: 'build-aux/install-sh' is updated autoreconf: Leaving directory '.' checking for a BSD-compatible install... /run/current-system/sw/bin/install -c checking whether build environment is sane... yes checking for a race-free mkdir -p... /run/current-system/sw/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for strip... strip checking for nm... nm checking for objdump... objdump checking for objcopy... objcopy checking for readelf... readelf checking for strings... strings checking whether make supports the include directive... yes (GNU style) checking for gcc... clang checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether clang accepts -g... yes checking for clang option to enable C11 features... none needed checking whether clang understands -c and -o together... yes checking dependency style of clang... gcc3 checking whether the compiler supports GNU C++... yes checking whether clang++ accepts -g... yes checking for clang++ option to enable C++11 features... none needed checking dependency style of clang++... gcc3 checking dependency style of clang... gcc3 checking whether clang++ supports C++17 features with -std=c++17... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating tests/Makefile config.status: creating patchelf.spec config.status: executing depfiles commands Making check in src make[1]: Entering directory '/home/rocky/Projects/patchelf/src' clang++ -std=c++17 -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -Wall -Wextra -Wcast-qual -std=c++17 -D_FILE_OFFSET_BITS=64 -g -O2 -MT patchelf.o -MD -MP -MF .deps/patchelf.Tpo -c -o patchelf.o patchelf.cc mv -f .deps/patchelf.Tpo .deps/patchelf.Po clang++ -std=c++17 -Wall -Wextra -Wcast-qual -std=c++17 -D_FILE_OFFSET_BITS=64 -g -O2 -o patchelf patchelf.o make[1]: Leaving directory '/home/rocky/Projects/patchelf/src' Making check in tests make[1]: Entering directory '/home/rocky/Projects/patchelf/tests' make simple-pie simple simple-execstack main too-many-strtab main-scoped big-dynstr no-rpath contiguous-note-sections libfoo.so libfoo-scoped.so libbar.so libbar-scoped.so libsimple.so libsimple-execstack.so libbuildid.so libtoomanystrtab.so phdr-corruption.so many-syms-main libmany-syms.so liboveralign.so libshared-rpath.so libbig-dynstr.debug make[2]: Entering directory '/home/rocky/Projects/patchelf/tests' clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fPIC -pie -g -O2 -MT simple_pie-simple.o -MD -MP -MF .deps/simple_pie-simple.Tpo -c -o simple_pie-simple.o `test -f 'simple.c' || echo './'`simple.c clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument] mv -f .deps/simple_pie-simple.Tpo .deps/simple_pie-simple.Po clang -fPIC -pie -g -O2 -o simple-pie simple_pie-simple.o clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -g -O2 -MT simple-simple.o -MD -MP -MF .deps/simple-simple.Tpo -c -o simple-simple.o `test -f 'simple.c' || echo './'`simple.c mv -f .deps/simple-simple.Tpo .deps/simple-simple.Po clang -g -O2 -Wl,-z,noexecstack -o simple simple-simple.o clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -g -O2 -MT simple_execstack-simple.o -MD -MP -MF .deps/simple_execstack-simple.Tpo -c -o simple_execstack-simple.o `test -f 'simple.c' || echo './'`simple.c mv -f .deps/simple_execstack-simple.Tpo .deps/simple_execstack-simple.Po clang -g -O2 -Wl,-z,execstack -o simple-execstack simple_execstack-simple.o clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c mv -f .deps/main.Tpo .deps/main.Po clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT foo.o -MD -MP -MF .deps/foo.Tpo -c -o foo.o foo.c mv -f .deps/foo.Tpo .deps/foo.Po clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT bar.o -MD -MP -MF .deps/bar.Tpo -c -o bar.o bar.c mv -f .deps/bar.Tpo .deps/bar.Po clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,-rpath,`pwd`/no-such-path -o libbar.so bar.o clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -o libfoo.so foo.o -lbar clang -fpic -g -O2 -Wl,--disable-new-dtags -Wl,-rpath-link=. -L. -o main main.o -lfoo clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT too-many-strtab.o -MD -MP -MF .deps/too-many-strtab.Tpo -c -o too-many-strtab.o too-many-strtab.c mv -f .deps/too-many-strtab.Tpo .deps/too-many-strtab.Po clang -g -O2 -c -o too-many-strtab2.o too-many-strtab2.s clang: warning: argument unused during compilation: '-idirafter /nix/store/0c5jp9d9h9818arr6s21xibgjl1ybql0-glibc-2.39-52-dev/include' [-Wunused-command-line-argument] clang -fpic -g -O2 -o too-many-strtab too-many-strtab.o too-many-strtab2.o /nix/store/7v7g86ml0ri171gfcrs1d442px5bi1p3-binutils-2.41/bin/ld: warning: too-many-strtab2.o: missing .note.GNU-stack section implies executable stack /nix/store/7v7g86ml0ri171gfcrs1d442px5bi1p3-binutils-2.41/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -o libbar-scoped.so bar.o clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -o libfoo-scoped.so foo.o -lbar-scoped clang -fpic -g -O2 -Wl,--disable-new-dtags -Wl,-rpath-link=. -L. -o main-scoped main.o -lfoo-scoped cat main.c > big-dynstr.c i=1; while [ $i -le 2000 ]; do echo "void f$i(void) { };"; i=$(($i + 1)); done >> big-dynstr.c clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT big-dynstr.o -MD -MP -MF .deps/big-dynstr.Tpo -c -o big-dynstr.o big-dynstr.c mv -f .deps/big-dynstr.Tpo .deps/big-dynstr.Po clang -fpic -g -O2 -Wl,--disable-new-dtags -Wl,-rpath-link=. -L. -o big-dynstr big-dynstr.o -lfoo clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -g -O2 -MT no_rpath-no-rpath.o -MD -MP -MF .deps/no_rpath-no-rpath.Tpo -c -o no_rpath-no-rpath.o `test -f 'no-rpath.c' || echo './'`no-rpath.c mv -f .deps/no_rpath-no-rpath.Tpo .deps/no_rpath-no-rpath.Po clang -g -O2 -o no-rpath no_rpath-no-rpath.o clang -g -O2 -c -o contiguous-note-sections.o contiguous-note-sections.s clang: warning: argument unused during compilation: '-idirafter /nix/store/0c5jp9d9h9818arr6s21xibgjl1ybql0-glibc-2.39-52-dev/include' [-Wunused-command-line-argument] clang -pie -g -O2 -nostdlib -T ./contiguous-note-sections.ld -o contiguous-note-sections contiguous-note-sections.o make[2]: 'libfoo.so' is up to date. make[2]: 'libfoo-scoped.so' is up to date. make[2]: 'libbar.so' is up to date. make[2]: 'libbar-scoped.so' is up to date. clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT simple.o -MD -MP -MF .deps/simple.Tpo -c -o simple.o simple.c mv -f .deps/simple.Tpo .deps/simple.Po clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,-z,noexecstack -o libsimple.so simple.o clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,-z,execstack -o libsimple-execstack.so simple.o clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,--build-id -o libbuildid.so simple.o clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -o libtoomanystrtab.so too-many-strtab.o too-many-strtab2.o /nix/store/7v7g86ml0ri171gfcrs1d442px5bi1p3-binutils-2.41/bin/ld: warning: too-many-strtab2.o: missing .note.GNU-stack section implies executable stack /nix/store/7v7g86ml0ri171gfcrs1d442px5bi1p3-binutils-2.41/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -g -O2 -MT phdr_corruption_so-void.o -MD -MP -MF .deps/phdr_corruption_so-void.Tpo -c -o phdr_corruption_so-void.o `test -f 'void.c' || echo './'`void.c mv -f .deps/phdr_corruption_so-void.Tpo .deps/phdr_corruption_so-void.Po clang -g -O2 -nostdlib -shared -Wl,-T./phdr-corruption.ld -o phdr-corruption.so phdr_corruption_so-void.o /nix/store/7v7g86ml0ri171gfcrs1d442px5bi1p3-binutils-2.41/bin/ld: warning: phdr-corruption.so has a LOAD segment with RWX permissions echo "int main() {" > many-syms-main.c i=1; while [ $i -le 2000 ]; do echo "void f$i(); f$i();"; i=$(($i + 1)); done >> many-syms-main.c echo "}" >> many-syms-main.c clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -pie -g -O2 -MT many_syms_main-many-syms-main.o -MD -MP -MF .deps/many_syms_main-many-syms-main.Tpo -c -o many_syms_main-many-syms-main.o `test -f 'many-syms-main.c' || echo './'`many-syms-main.c clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument] mv -f .deps/many_syms_main-many-syms-main.Tpo .deps/many_syms_main-many-syms-main.Po i=1; while [ $i -le 2000 ]; do echo "void f$i() {};"; i=$(($i + 1)); done > many-syms.c clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT many-syms.o -MD -MP -MF .deps/many-syms.Tpo -c -o many-syms.o many-syms.c mv -f .deps/many-syms.Tpo .deps/many-syms.Po clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -o libmany-syms.so many-syms.o clang -pie -g -O2 -Wl,--disable-new-dtags -Wl,-rpath-link=. -L. -o many-syms-main many_syms_main-many-syms-main.o -lmany-syms make[2]: 'libmany-syms.so' is up to date. clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,-z,max-page-size=0x10000 -o liboveralign.so simple.o clang -DPACKAGE_NAME=\"patchelf\" -DPACKAGE_TARNAME=\"patchelf\" -DPACKAGE_VERSION=\"0.18.0\" -DPACKAGE_STRING=\"patchelf\ 0.18.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"patchelf\" -DVERSION=\"0.18.0\" -DHAVE_CXX17=1 -I. -fpic -g -O2 -MT shared-rpath.o -MD -MP -MF .deps/shared-rpath.Tpo -c -o shared-rpath.o shared-rpath.c mv -f .deps/shared-rpath.Tpo .deps/shared-rpath.Po clang -fpic -g -O2 -Wl,--disable-new-dtags -shared -L. -Wl,-rpath=a_symbol_name -o libshared-rpath.so shared-rpath.o clang -fPIC -shared -o libbig-dynstr.so big-dynstr.c strip --only-keep-debug libbig-dynstr.so -o libbig-dynstr.debug make[2]: Leaving directory '/home/rocky/Projects/patchelf/tests' make check-TESTS make[2]: Entering directory '/home/rocky/Projects/patchelf/tests' make[3]: Entering directory '/home/rocky/Projects/patchelf/tests' PASS: plain-fail.sh PASS: plain-run.sh PASS: shrink-rpath.sh PASS: set-interpreter-short.sh PASS: set-interpreter-long.sh PASS: set-rpath.sh PASS: add-rpath.sh FAIL: no-rpath.sh PASS: big-dynstr.sh PASS: set-rpath-library.sh PASS: soname.sh PASS: shrink-rpath-with-allowed-prefixes.sh SKIP: set-rpath-rel-map.sh PASS: force-rpath.sh PASS: plain-needed.sh PASS: output-flag.sh PASS: too-many-strtab.sh PASS: no-rpath-pie-powerpc.sh PASS: build-id.sh PASS: invalid-elf.sh PASS: endianness.sh PASS: contiguous-note-sections.sh PASS: no-gnu-hash.sh PASS: change-abi.sh PASS: grow-file.sh PASS: no-dynamic-section.sh PASS: args-from-file.sh PASS: basic-flags.sh PASS: set-empty-rpath.sh PASS: phdr-corruption.sh PASS: replace-needed.sh PASS: replace-add-needed.sh PASS: add-debug-tag.sh PASS: repeated-updates.sh PASS: empty-note.sh PASS: print-execstack.sh PASS: modify-execstack.sh PASS: rename-dynamic-symbols.sh PASS: overlapping-segments-after-rounding.sh FAIL: shared-rpath.sh SKIP: short-first-segment.sh PASS: no-rpath-amd64.sh PASS: no-rpath-armel.sh PASS: no-rpath-armhf.sh PASS: no-rpath-hurd-i386.sh PASS: no-rpath-i386.sh PASS: no-rpath-ia64.sh PASS: no-rpath-kfreebsd-amd64.sh PASS: no-rpath-kfreebsd-i386.sh PASS: no-rpath-mips.sh PASS: no-rpath-mipsel.sh PASS: no-rpath-powerpc.sh PASS: no-rpath-s390.sh PASS: no-rpath-sh4.sh PASS: no-rpath-sparc.sh ============================================================================ Testsuite summary for patchelf 0.18.0 ============================================================================ # TOTAL: 56 # PASS: 52 # SKIP: 2 # XFAIL: 0 # FAIL: 2 # XPASS: 0 # ERROR: 0 ============================================================================ See tests/test-suite.log ============================================================================ make[3]: *** [Makefile:1070: test-suite.log] Error 1 make[3]: Leaving directory '/home/rocky/Projects/patchelf/tests' make[2]: *** [Makefile:1178: check-TESTS] Error 2 make[2]: Leaving directory '/home/rocky/Projects/patchelf/tests' make[1]: *** [Makefile:1629: check-am] Error 2 make[1]: Leaving directory '/home/rocky/Projects/patchelf/tests' make: *** [Makefile:474: check-recursive] Error 1 scaroboros :: ~/Projects/patchelf ‹master*› % clang --version 2 ↵ clang version 17.0.6 Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /nix/store/mh878417smivj8nzajlg3w52azzljvbk-clang-17.0.6/bin ```

There are two tests no-rpath.sh and shared-rpath.sh constantly failing on my system.

The test-suite.log is as follows for both gcc and clang:

===========================================
   patchelf 0.18.0: tests/test-suite.log
===========================================

# TOTAL: 56
# PASS:  52
# SKIP:  2
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: no-rpath.sh
=================

FAIL no-rpath.sh (exit status: 1)

SKIP: set-rpath-rel-map.sh
==========================

No MIPS_RLD_MAP_REL dynamic section entry, skipping
SKIP set-rpath-rel-map.sh (exit status: 77)

FAIL: shared-rpath.sh
=====================

000000000000400c B a_symbol_name
#### Number of a_symbol_name strings in the library: 4
#### Rename the rpath to something larger than the original
patching ELF file '/home/rocky/Projects/patchelf/tests/libshared-rpath.so'
Number of rpath references: 1
Tainting old rpath with Xs
new rpath is 'a_very_big_rpath_that_is_larger_than_original'
writing liblarge-rpath.so
#### Checking symbol is still there
000000000000400c B a_symbol_name
#### Checking there are no Xs
FAIL shared-rpath.sh (exit status: 1)

SKIP: short-first-segment.sh
============================

skipping test: not supported on x86_64 Linux
SKIP short-first-segment.sh (exit status: 77)