commit:     7138d0eb42eb640f2a08a5ef12ad51ba6c6b4255
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 26 06:30:36 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 26 06:30:36 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7138d0eb

app-emulation/qemu: suppress RWX error for optionrom

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...6-optionrom-pass-Wl-no-error-rwx-segments.patch | 37 ++++++++++++++++++++++
 app-emulation/qemu/qemu-7.2.16.ebuild              |  1 +
 app-emulation/qemu/qemu-8.2.9.ebuild               |  1 +
 app-emulation/qemu/qemu-9.1.3.ebuild               |  2 +-
 app-emulation/qemu/qemu-9.2.2.ebuild               |  1 +
 5 files changed, 41 insertions(+), 1 deletion(-)

diff --git 
a/app-emulation/qemu/files/qemu-7.2.16-optionrom-pass-Wl-no-error-rwx-segments.patch
 
b/app-emulation/qemu/files/qemu-7.2.16-optionrom-pass-Wl-no-error-rwx-segments.patch
new file mode 100644
index 000000000000..a81302f4cdf8
--- /dev/null
+++ 
b/app-emulation/qemu/files/qemu-7.2.16-optionrom-pass-Wl-no-error-rwx-segments.patch
@@ -0,0 +1,37 @@
+https://mail.gnu.org/archive/html/qemu-devel/2025-02/msg04327.html
+
+From eca5286f01652fd5801ba89b7752a7895620a852 Mon Sep 17 00:00:00 2001
+Message-ID: 
<eca5286f01652fd5801ba89b7752a7895620a852.1740071281.git....@gentoo.org>
+From: Sam James <[email protected]>
+Date: Thu, 20 Feb 2025 17:05:59 +0000
+Subject: [PATCH] optionrom: pass -Wl,--no-error-rwx-segments
+
+If GNU Binutils is configured with --enable-error-rwx-segments=yes, one
+gets the following for optionrom:
+```
+.../bin/ld: error: pvh.img has a LOAD segment with RWX permissions
+.../bin/ld: final link faile
+```
+
+Pass -Wl,--no-error-rwx-segments to suppress that.
+---
+ pc-bios/optionrom/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
+index 30d07026c7..4d3ce75af3 100644
+--- a/pc-bios/optionrom/Makefile
++++ b/pc-bios/optionrom/Makefile
+@@ -37,6 +37,7 @@ config-cc.mak: Makefile
+ -include config-cc.mak
+ 
+ override LDFLAGS = -nostdlib -Wl,--build-id=none,-T,$(SRC_DIR)/flat.lds
++override LDFLAGS += -Wl,--no-error-rwx-segments
+ 
+ pvh.img: pvh.o pvh_main.o
+ 
+
+base-commit: 40efe733e10cc00e4fb4f9f5790a28e744e63c62
+-- 
+2.48.1
+

diff --git a/app-emulation/qemu/qemu-7.2.16.ebuild 
b/app-emulation/qemu/qemu-7.2.16.ebuild
index da99aec99003..a5d40383777f 100644
--- a/app-emulation/qemu/qemu-7.2.16.ebuild
+++ b/app-emulation/qemu/qemu-7.2.16.ebuild
@@ -316,6 +316,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-7.1.0-capstone-include-path.patch
        "${FILESDIR}"/${PN}-7.2.0-disable-gmp.patch
        "${FILESDIR}"/${PN}-9.0.0-glibc-2.41.patch
+       "${FILESDIR}"/${PN}-7.2.16-optionrom-pass-Wl-no-error-rwx-segments.patch
 )
 
 QA_PREBUILT="

diff --git a/app-emulation/qemu/qemu-8.2.9.ebuild 
b/app-emulation/qemu/qemu-8.2.9.ebuild
index df42558dfc97..b2853795f01d 100644
--- a/app-emulation/qemu/qemu-8.2.9.ebuild
+++ b/app-emulation/qemu/qemu-8.2.9.ebuild
@@ -321,6 +321,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-8.1.0-skip-tests.patch
        "${FILESDIR}"/${PN}-8.1.0-find-sphinx.patch
        "${FILESDIR}"/${PN}-9.0.0-glibc-2.41.patch
+       "${FILESDIR}"/${PN}-7.2.16-optionrom-pass-Wl-no-error-rwx-segments.patch
 )
 
 QA_PREBUILT="

diff --git a/app-emulation/qemu/qemu-9.1.3.ebuild 
b/app-emulation/qemu/qemu-9.1.3.ebuild
index ecc061f64d9c..132cd093619a 100644
--- a/app-emulation/qemu/qemu-9.1.3.ebuild
+++ b/app-emulation/qemu/qemu-9.1.3.ebuild
@@ -322,7 +322,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-8.1.0-skip-tests.patch
        "${FILESDIR}"/${PN}-8.1.0-find-sphinx.patch
        "${FILESDIR}"/${PN}-9.0.0-glibc-2.41.patch
-
+       "${FILESDIR}"/${PN}-7.2.16-optionrom-pass-Wl-no-error-rwx-segments.patch
 )
 
 QA_PREBUILT="

diff --git a/app-emulation/qemu/qemu-9.2.2.ebuild 
b/app-emulation/qemu/qemu-9.2.2.ebuild
index 4bddf969ae70..dbf0d977e96c 100644
--- a/app-emulation/qemu/qemu-9.2.2.ebuild
+++ b/app-emulation/qemu/qemu-9.2.2.ebuild
@@ -319,6 +319,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-9.2.0-capstone-include-path.patch
        "${FILESDIR}"/${PN}-8.1.0-skip-tests.patch
        "${FILESDIR}"/${PN}-8.1.0-find-sphinx.patch
+       "${FILESDIR}"/${PN}-7.2.16-optionrom-pass-Wl-no-error-rwx-segments.patch
 )
 
 QA_PREBUILT="

Reply via email to