Gentoo Archives: gentoo-dev

From: Matt Turner <mattst88@g.o>
To: gentoo-dev@l.g.o
Cc: "Niklāvs Koļesņikovs" <89q1r14hd@×××××××××××××.com>, Matt Turner <mattst88@g.o>
Subject: [gentoo-dev] [PATCH] xorg-3.eclass: strip -fno-plt from *FLAGS
Date: Mon, 29 Mar 2021 00:54:29
Message-Id: 20210329005418.532291-1-mattst88@gentoo.org
1 From: Niklāvs Koļesņikovs <89q1r14hd@×××××××××××××.com>
2
3 As discussed in #778494, the GCC flag -fno-plt will break lazy
4 binding, which appears to still be necessary for Xorg. Stripping the
5 offending flag out is the next best solution for reliable user
6 experience on Gentoo.
7
8 Closes: https://bugs.gentoo.org/778494
9 Closes: https://github.com/gentoo/gentoo/pull/20166
10 Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@×××××××××××××.com>
11 Signed-off-by: Matt Turner <mattst88@g.o>
12 ---
13 eclass/xorg-3.eclass | 8 +++++---
14 1 file changed, 5 insertions(+), 3 deletions(-)
15
16 diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
17 index 811168ead98..6835c6617c5 100644
18 --- a/eclass/xorg-3.eclass
19 +++ b/eclass/xorg-3.eclass
20 @@ -1,4 +1,4 @@
21 -# Copyright 1999-2020 Gentoo Authors
22 +# Copyright 1999-2021 Gentoo Authors
23 # Distributed under the terms of the GNU General Public License v2
24
25 # @ECLASS: xorg-3.eclass
26 @@ -326,8 +326,10 @@ xorg-3_flags_setup() {
27 # Win32 require special define
28 [[ ${CHOST} == *-winnt* ]] && append-cppflags -DWIN32 -D__STDC__
29 # hardened ldflags
30 - [[ ${PN} == xorg-server || ${PN} == xf86-video-* || ${PN} == xf86-input-* ]] \
31 - && append-ldflags -Wl,-z,lazy
32 + if [[ ${PN} == xorg-server || ${PN} == xf86-video-* || ${PN} == xf86-input-* ]]; then
33 + filter-flags -fno-plt
34 + append-ldflags -Wl,-z,lazy
35 + fi
36
37 # Quite few libraries fail on runtime without these:
38 if has static-libs ${IUSE//+}; then
39 --
40 2.26.2