From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6EE80384B000; Tue, 23 Apr 2024 19:12:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EE80384B000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713899562; bh=nGopHfcngUTDQ1oi14o/WKE/mNJXBFI8nFXGSaVI5UE=; h=From:To:Subject:Date:From; b=QF0+BPc4l8jkFqLWAGxIkHTq4oxDfIrbsDd0OCCI847vhd5BNGcV6KhG7cYzgMUNO h+mlbK99Rq7+4ZKHMCaPqCPiRB2FHu8pkI2OkiF9Qq3N1tA+VClOBqbVvomSQpD1wU ljNKx4qh3gMMCVR5RfQJRq6fImZleb1/92qFu0RY= From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/31676] New: Configuring with CC="gcc -march=x86-64-v3" --with-rtld-early-cflags=-march=x86-64 results in linker failure Date: Tue, 23 Apr 2024 19:12:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31676 Bug ID: 31676 Summary: Configuring with CC=3D"gcc -march=3Dx86-64-v3" --with-rtld-early-cflags=3D-march=3Dx86-64 results in linker failure Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: dynamic-link Assignee: unassigned at sourceware dot org Reporter: fweimer at redhat dot com Target Milestone: --- The error is: gcc -march=3Dx86-64-v3 -nostdlib -nostartfiles -shared -o =E2=80=A6/build= /elf/ld.so.new \ -Wl,-z,relro -Wl,-z,defs \ \ =E2=80=A6/build/elf/librtld.os -Wl,--version-script=3D=E2=80=A6/b= uild/ld.map=20=20=20=20=20=20=20=20=20=20=20 \ -Wl,-soname=3Dld-linux-x86-64.so.2 /usr/bin/ld: =E2=80=A6/build/elf/librtld.os: in function `init_cpu_features= ': =E2=80=A6/git/elf/../sysdeps/x86/cpu-features.c:1202: undefined reference to `_dl_runtime_resolve_fxsave' /usr/bin/ld: =E2=80=A6/build/elf/librtld.os: relocation R_X86_64_PC32 again= st undefined hidden symbol `_dl_runtime_resolve_fxsave' can not be used when making a sh= ared object /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status The reason is that we build with sysdeps/x86/dl-get-cpu-features.c with the early CFLAGS (so -march=3Dx86-64). This is necessary because the code runs = very early. But since commit befe2d3c4dec8be2cdd01a47132e47bdb7020922 Author: H.J. Lu Date: Wed Feb 28 09:51:14 2024 -0800 x86-64: Don't use SSE resolvers for ISA level 3 or above When glibc is built with ISA level 3 or above enabled, SSE resolvers aren't available and glibc fails to build: ld: .../elf/librtld.os: in function `init_cpu_features': .../elf/../sysdeps/x86/cpu-features.c:1200:(.text+0x1445f): undefined reference to `_dl_runtime_resolve_fxsave' ld: .../elf/librtld.os: relocation R_X86_64_PC32 against undefined hidd= en symbol `_dl_runtime_resolve_fxsave' can not be used when making a shared ob= ject /usr/local/bin/ld: final link failed: bad value For ISA level 3 or above, don't use _dl_runtime_resolve_fxsave nor _dl_tlsdesc_dynamic_fxsave. This fixes BZ #31429. Reviewed-by: Noah Goldstein the referenced _dl_runtime_resolve_fxsave trampoline does not exist when the rest of the dynamic linker is built for x86-64-v3. --=20 You are receiving this mail because: You are on the CC list for the bug.=