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

v0.15.0 tests/replace-add-needed.sh fails on ppc64le on CentOS/RHEL/Rocky 8 #406

Closed
robert-scheck opened this issue Sep 26, 2022 · 0 comments
Labels

Comments

@robert-scheck
Copy link
Contributor

robert-scheck commented Sep 26, 2022

tests/replace-add-needed.sh of patchelf 0.15.0 fails during make check on ppc64le on CentOS/RHEL/Rocky 8:

[…]
make  check-TESTS
make[2]: Entering directory '/builddir/build/BUILD/patchelf-0.15.0/tests'
make[3]: Entering directory '/builddir/build/BUILD/patchelf-0.15.0/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
PASS: no-rpath.sh
PASS: big-dynstr.sh
PASS: set-rpath-library.sh
PASS: soname.sh
PASS: shrink-rpath-with-allowed-prefixes.sh
PASS: 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: 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
FAIL: replace-add-needed.sh
PASS: add-debug-tag.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.15.0
============================================================================
# TOTAL: 46
# PASS:  45
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
============================================================================

Unfortunately, tests/replace-add-needed.sh.log was not that helpful:

$ cat tests/replace-add-needed.sh.log
FAIL replace-add-needed.sh (exit status: 1)
$ 

However, using -x in tests/replace-add-needed.sh lead to this:

[…]
+ sed -e 's/ -e/ -ex/' -i tests/replace-add-needed.sh
+ cd tests
+ ./replace-add-needed.sh
++ basename ./replace-add-needed.sh .sh
+ SCRATCH=scratch/replace-add-needed
++ readlink -f ../src/patchelf
+ PATCHELF=/builddir/build/BUILD/patchelf-0.15.0/src/patchelf
+ rm -rf scratch/replace-add-needed
+ mkdir -p scratch/replace-add-needed
+ cp simple scratch/replace-add-needed/
+ cp libfoo.so scratch/replace-add-needed/
+ cp libbar.so scratch/replace-add-needed/
+ cd scratch/replace-add-needed
++ ldd ./simple
++ awk '/ => / { print $3 }'
++ grep -E '(libc.so|ld-musl)'
+ libcldd=

Interesting…so what does e.g. ldd /usr/bin/ls actually look like on ppc64le on CentOS/RHEL/Rocky 8?

$ ldd /usr/bin/ls
	linux-vdso64.so.1 (0x00007fffb5b20000)
	libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fffb5a40000)
	libcap.so.2 => /lib64/libcap.so.2 (0x00007fffb5a10000)
	libc.so.6 => /lib64/glibc-hwcaps/power9/libc-2.28.so (0x00007fffb5800000)
	libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007fffb5750000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fffb5720000)
	/lib64/ld64.so.2 (0x00007fffb5b30000)
	libpthread.so.0 => /lib64/glibc-hwcaps/power9/libpthread-2.28.so (0x00007fffb56d0000)
$ 

Ah, it's glibc-hwcaps! While CentOS/RHEL/Rocky 8 has -mcpu=power8 -mtune=power8 during build-time for packages, there are optimizations using glibc-hwcaps when running on POWER9 ISA. See also:

@Mic92 Mic92 closed this as completed in f7053d0 Sep 27, 2022
Mic92 added a commit that referenced this issue Sep 27, 2022
Handle glibc-hwcaps on ppc64le on CentOS/RHEL/Rocky 8 for tests/replace-add-needed.sh (fixes #406)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant