From 61968b4cba1a7db32508870804d0e08a1d96f746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Thu, 23 Nov 2023 14:35:01 +0100 Subject: [PATCH] Set glx-read-only-text on i386 An update on the linker will now refuse to create binaries with a loadable memory segment that has read, write and execute permissions set. mesa creates one unless "glx-read-only-text" is enabled. Revert commit e2acc882a102 ("Disable rwx segment linker error") and set "glx-read-only-text" instead. See Nick's comment for more information about the revert: https://bugzilla.redhat.com/show_bug.cgi?id=2250927#c10 Fix: https://bugzilla.redhat.com/show_bug.cgi?id=2250927 --- mesa.spec | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/mesa.spec b/mesa.spec index 215ebaa..49ff335 100644 --- a/mesa.spec +++ b/mesa.spec @@ -368,19 +368,6 @@ cp %{SOURCE1} docs/ # ensure standard Rust compiler flags are set export RUSTFLAGS="%build_rustflags" -# An update on the linker will now refuse to create binaries with a loadable -# memory segment that has read, write and execute permissions set. -# mesa creates one unless "glx-read-only-text" is enabled, however, the -# documentation for "glx-read-only-text" reads: -# -# "Disable writable .text section on x86 (decreases performance)" -# -# In order to avoid possible performance regressions, disable the linker error: -# https://bugzilla.redhat.com/show_bug.cgi?id=2250927 -%ifarch %{ix86} -LDFLAGS=-Wl,--no-error-rwx-segments -%endif - # We've gotten a report that enabling LTO for mesa breaks some games. See # https://bugzilla.redhat.com/show_bug.cgi?id=1862771 for details. # Disable LTO for now @@ -430,6 +417,9 @@ LDFLAGS=-Wl,--no-error-rwx-segments -Dlmsensors=disabled \ %endif -Dandroid-libbacktrace=disabled \ +%ifarch %{ix86} + -Dglx-read-only-text=true +%endif %{nil} %meson_build