From d6d795286a90340b1717411807762f1083345f0f Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 10 May 2024 20:28:45 +0200 Subject: [PATCH] Enable GNU2 TLS descriptors on x86-64 (GCC only) (RHEL-25031) Based on Fedora commit b7d1bfae1fb673c4d8a21a8866ba4e37b2cd6eaf. Resolves: RHEL-25031 --- buildflags.md | 2 ++ macros | 3 ++- redhat-rpm-config.spec | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/buildflags.md b/buildflags.md index 0fee80c..e817020 100644 --- a/buildflags.md +++ b/buildflags.md @@ -620,6 +620,8 @@ tuning in the `gcc` package. These settings are: applied. The default can be overriden (for any distribution) by specifying `--target x86_64_v2`, `--target x86_64_v3`, `--target x86_64_v4` in the `rpmbuild` invocation. + With the GCC toolchain, TLS descriptors are enabled using + `-mtls-dialect=gnu2`. * **aarch64** does not have any architecture-specific tuning. ### Vala-specific compiler flags diff --git a/macros b/macros index f5c0bb5..c6e9d9a 100644 --- a/macros +++ b/macros @@ -148,7 +148,8 @@ for k,_ in pairs(stripped_flags) do print(k .. " ") end %__cflags_arch_x86_64_level %[0%{?rhel} == 9 ? "-v2" : ""]%[0%{?rhel} > 9 ? "-v3" : ""] %__cflags_arch_x86_64 -march=x86-64%{?__cflags_arch_x86_64_level:%{__cflags_arch_x86_64_level}} -%__cflags_arch_x86_64_common -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection %{_frame_pointers_cflags} %{_frame_pointers_cflags_x86_64} +# -mtls-dialect=gnu2 is currently specific to GCC (#2263181). +%__cflags_arch_x86_64_common -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection %[ "%{toolchain}" == "gcc" ? "-mtls-dialect=gnu2 " : "" ]%{_frame_pointers_cflags} %{_frame_pointers_cflags_x86_64} # Also used for s390. %__cflags_arch_s390x %[0%{?rhel} >= 9 ? "-march=z14 -mtune=z15" : "-march=z13 -mtune=z14"] diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index b306493..8aad9e9 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -8,7 +8,7 @@ Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config Version: 282 -Release: 1%{?dist} +Release: 2%{?dist} # config.guess, config.sub are GPL-3.0-or-later WITH Autoconf-exception-generic License: GPL-1.0-or-later AND GPL-2.0-or-later AND GPL-3.0-or-later WITH Autoconf-exception-generic AND Boehm-GC URL: https://src.fedoraproject.org/rpms/redhat-rpm-config @@ -260,6 +260,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora common.lua %doc buildflags.md %changelog +* Fri May 10 2024 Florian Weimer - 282-2 +- Enable GNU2 TLS descriptors on x86-64 (GCC only) (RHEL-25031) + * Tue Feb 06 2024 Yaakov Selkowitz - 282-1 - Loosen rust-srpm-macros requirement