[Bug dynamic-link/31719] New: --enable-hardcoded-path-in-tests doesn't work with -Wl,--enable-new-dtags

hjl.tools at gmail dot com sourceware-bugzilla@sourceware.org
Fri May 10 01:26:53 GMT 2024


https://sourceware.org/bugzilla/show_bug.cgi?id=31719

            Bug ID: 31719
           Summary: --enable-hardcoded-path-in-tests doesn't work with
                    -Wl,--enable-new-dtags
           Product: glibc
           Version: 2.34
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
                CC: skpgkp2 at gmail dot com
  Target Milestone: ---

On Fedora 40/x86-64, build glibc 2.34 with --enable-hardcoded-path-in-tests
causes:

FAIL: assert/tst-assert-c++
FAIL: assert/tst-assert-g++
FAIL: debug/tst-fortify-cc-default-1
FAIL: debug/tst-fortify-cc-default-2
FAIL: debug/tst-fortify-cc-default-3
FAIL: debug/tst-fortify-cc-lfs-1
FAIL: debug/tst-fortify-cc-lfs-2
FAIL: debug/tst-fortify-cc-lfs-3
FAIL: debug/tst-fortify-cc-nongnu-1
FAIL: debug/tst-fortify-cc-nongnu-2
FAIL: debug/tst-fortify-cc-nongnu-3

The problems are

1. ld defaults to --enable-new-dtags.
2. When --enable-hardcoded-path-in-tests is used, DT_RUNPATH is generated
instead of DT_RPATH:

Dynamic section at offset 0x10d20 contains 31 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000001d (RUNPATH)            Library runpath:
[/export/build/gnu/tools-build/glibc-release/build-x86_64-linux:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/math:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/elf:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/dlfcn:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/nss:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/nis:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/rt:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/resolv:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/mathvec:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/support:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/crypt:/export/build/gnu/tools-build/glibc-release/build-x86_64-linux/nptl]

Unlike DT_RPATH, DT_RUNPATH only applies when loading libstdc++.so.6 and
doesn't
apply to DT_NEEDED entries in libstdc++.so.6, which leads to

./debug/tst-fortify-cc-default-1:
/export/build/gnu/tools-build/glibc-gitlab-release/build-x86_64-linux/libc.so.6:
version `GLIBC_2.36' not found (required by /lib64/libm.so.6)
./debug/tst-fortify-cc-default-1:
/export/build/gnu/tools-build/glibc-gitlab-release/build-x86_64-linux/libc.so.6:
version `GLIBC_ABI_DT_RELR' not found (required by /lib64/libm.so.6)

/lib64/libm.so.6 is loaded by DT_NEEDED of libstdc++.so.6.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list