From: Niklāvs Koļesņikovs <89q1r1...@relay.firefox.com>

As discussed in #778494, the GCC flag -fno-plt will break lazy
binding, which appears to still be necessary for Xorg. Stripping the
offending flag out is the next best solution for reliable user
experience on Gentoo.

Closes: https://bugs.gentoo.org/778494
Closes: https://github.com/gentoo/gentoo/pull/20166
Signed-off-by: Niklāvs Koļesņikovs <89q1r1...@relay.firefox.com>
Signed-off-by: Matt Turner <matts...@gentoo.org>
---
 eclass/xorg-3.eclass | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index 811168ead98..6835c6617c5 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xorg-3.eclass
@@ -326,8 +326,10 @@ xorg-3_flags_setup() {
        # Win32 require special define
        [[ ${CHOST} == *-winnt* ]] && append-cppflags -DWIN32 -D__STDC__
        # hardened ldflags
-       [[ ${PN} == xorg-server || ${PN} == xf86-video-* || ${PN} == 
xf86-input-* ]] \
-               && append-ldflags -Wl,-z,lazy
+       if [[ ${PN} == xorg-server || ${PN} == xf86-video-* || ${PN} == 
xf86-input-* ]]; then
+               filter-flags -fno-plt
+               append-ldflags -Wl,-z,lazy
+       fi
 
        # Quite few libraries fail on runtime without these:
        if has static-libs ${IUSE//+}; then
-- 
2.26.2


Reply via email to