commit:     3cc0092c3e6ce8988912fce260932639e5554d17
Author:     Niklāvs Koļesņikovs <89q1r14hd <AT> relay <DOT> firefox <DOT> com>
AuthorDate: Sun Mar 28 12:14:45 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 18 02:45:14 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3cc0092c

xorg-3.eclass: strip -fno-plt from *FLAGS

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://github.com/gentoo/gentoo/pull/20166
Closes: https://bugs.gentoo.org/778494
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd <AT> relay.firefox.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/xorg-3.eclass | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index 378a7b8c4103..d7ff91417caf 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -337,9 +337,12 @@ 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
+
+       # Hardened flags break module autoloading et al (also fixes #778494)
+       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

Reply via email to