public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/xen-tools/files/, app-emulation/xen-tools/
Date: Sat, 08 Feb 2025 01:47:40 +0000 (UTC)	[thread overview]
Message-ID: <1738979229.db4070ee49e11b83c6ee1711b84bec5453450b04.sam@gentoo> (raw)

commit:     db4070ee49e11b83c6ee1711b84bec5453450b04
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  8 01:42:58 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb  8 01:47:09 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db4070ee

app-emulation/xen-tools: fix build issues

* Fix build w/ hardened binutils which rejects textrels. They're fine here.
* Use gnu17 for some components as incompatible with gnu23.

Bug: https://bugs.gentoo.org/913110
Bug: https://bugs.gentoo.org/937610
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/edk2-202202-binutils-2.41-textrels.patch  | 21 +++++++++++++++++++++
 .../xen-tools/xen-tools-4.18.4_pre1.ebuild          | 16 ++++++++++++++++
 app-emulation/xen-tools/xen-tools-4.19.1.ebuild     | 11 +++++++++++
 3 files changed, 48 insertions(+)

diff --git a/app-emulation/xen-tools/files/edk2-202202-binutils-2.41-textrels.patch b/app-emulation/xen-tools/files/edk2-202202-binutils-2.41-textrels.patch
new file mode 100644
index 000000000000..22d33c9097aa
--- /dev/null
+++ b/app-emulation/xen-tools/files/edk2-202202-binutils-2.41-textrels.patch
@@ -0,0 +1,21 @@
+https://bugs.gentoo.org/913110
+--- a/BaseTools/Conf/tools_def.template
++++ b/BaseTools/Conf/tools_def.template
+@@ -1906,7 +1906,7 @@ DEFINE GCC48_IA32_X64_DLINK_COMMON   = -nostdlib -Wl,-n,-q,--gc-sections -z comm
+ DEFINE GCC48_IA32_CC_FLAGS           = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address
+ DEFINE GCC48_X64_CC_FLAGS            = DEF(GCC48_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address
+ DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
+-DEFINE GCC48_IA32_X64_DLINK_FLAGS    = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive
++DEFINE GCC48_IA32_X64_DLINK_FLAGS    = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive -Wl,-z,notext
+ DEFINE GCC48_IA32_DLINK2_FLAGS       = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON)
+ DEFINE GCC48_X64_DLINK_FLAGS         = DEF(GCC48_IA32_X64_DLINK_FLAGS) -Wl,-melf_x86_64,--oformat=elf64-x86-64,-pie
+ DEFINE GCC48_X64_DLINK2_FLAGS        = -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 DEF(GCC_DLINK2_FLAGS_COMMON)
+@@ -1929,7 +1929,7 @@ DEFINE GCC49_IA32_CC_FLAGS           = DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pi
+ DEFINE GCC49_X64_CC_FLAGS            = DEF(GCC48_X64_CC_FLAGS)
+ DEFINE GCC49_IA32_X64_DLINK_COMMON   = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40
+ DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
+-DEFINE GCC49_IA32_X64_DLINK_FLAGS    = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive
++DEFINE GCC49_IA32_X64_DLINK_FLAGS    = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive -Wl,-z,notext
+ DEFINE GCC49_IA32_DLINK2_FLAGS       = DEF(GCC48_IA32_DLINK2_FLAGS)
+ DEFINE GCC49_X64_DLINK_FLAGS         = DEF(GCC49_IA32_X64_DLINK_FLAGS) -Wl,-melf_x86_64,--oformat=elf64-x86-64,-pie
+ DEFINE GCC49_X64_DLINK2_FLAGS        = DEF(GCC48_X64_DLINK2_FLAGS)

diff --git a/app-emulation/xen-tools/xen-tools-4.18.4_pre1.ebuild b/app-emulation/xen-tools/xen-tools-4.18.4_pre1.ebuild
index 5928ffd9abaa..8292b81c6320 100644
--- a/app-emulation/xen-tools/xen-tools-4.18.4_pre1.ebuild
+++ b/app-emulation/xen-tools/xen-tools-4.18.4_pre1.ebuild
@@ -394,10 +394,26 @@ src_prepare() {
 		-e 's/, "-Werror"//' \
 		{} + || die
 
+	if use ovmf ; then
+		# textrels cause failures w/ hardened binutils
+		pushd tools/firmware/ovmf-dir-remote > /dev/null || die
+		eapply "${FILESDIR}"/edk2-202202-binutils-2.41-textrels.patch
+		popd > /dev/null || die
+	fi
+
+	# Use gnu17 because incompatible w/ C23
+	sed -i -e "s:-DZZLEXBUFSIZE=65536:-DZZLEXBUFSIZE=65536 -std=gnu17:" \
+		tools/firmware/ovmf-dir-remote/BaseTools/Source/C/VfrCompile/Pccts/*/makefile || die
+
 	default
 }
 
 src_configure() {
+	# Workaround from sys-firmware/edk2 (bug #913110)
+	export LDFLAGS="-z notext"
+	export EXTRA_LDFLAGS="-z notext"
+	export DLINK_FLAGS="-z notext"
+
 	local myconf=(
 		--libdir="${EPREFIX}/usr/$(get_libdir)"
 		--libexecdir="${EPREFIX}/usr/libexec"

diff --git a/app-emulation/xen-tools/xen-tools-4.19.1.ebuild b/app-emulation/xen-tools/xen-tools-4.19.1.ebuild
index bf00cacae073..06afb06cbb4d 100644
--- a/app-emulation/xen-tools/xen-tools-4.19.1.ebuild
+++ b/app-emulation/xen-tools/xen-tools-4.19.1.ebuild
@@ -394,6 +394,17 @@ src_prepare() {
 		-e 's/, "-Werror"//' \
 		{} + || die
 
+	if use ovmf ; then
+		# textrels cause failures w/ hardened binutils
+		pushd tools/firmware/ovmf-dir-remote > /dev/null || die
+		eapply "${FILESDIR}"/edk2-202202-binutils-2.41-textrels.patch
+		popd > /dev/null || die
+	fi
+
+	# Use gnu17 because incompatible w/ C23
+	sed -i -e "s:-DZZLEXBUFSIZE=65536:-DZZLEXBUFSIZE=65536 -std=gnu17:" \
+		tools/firmware/ovmf-dir-remote/BaseTools/Source/C/VfrCompile/Pccts/*/makefile || die
+
 	default
 }
 


             reply	other threads:[~2025-02-08  1:47 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-08  1:47 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-21  4:20 [gentoo-commits] repo/gentoo:master commit in: app-emulation/xen-tools/files/, app-emulation/xen-tools/ Sam James
2021-07-15  5:31 Joonas Niilola
2021-07-14 15:01 Joonas Niilola
2021-05-11 15:47 Thomas Deutschmann
2021-05-11 15:47 Thomas Deutschmann
2021-04-17  7:49 Joonas Niilola
2021-02-04 22:27 Thomas Deutschmann
2020-11-10 15:29 Thomas Deutschmann
2020-09-19  8:04 Michał Górny
2020-06-26 23:00 Thomas Deutschmann
2020-05-25 14:21 Yixun Lan
2019-12-20 10:08 Yixun Lan
2019-12-17 16:36 Yixun Lan
2019-12-15 14:05 Yixun Lan
2019-10-06 12:45 Thomas Deutschmann
2019-04-16  6:27 Yixun Lan
2019-03-28  5:44 Yixun Lan
2019-03-15 22:49 Thomas Deutschmann
2019-03-15 22:49 Thomas Deutschmann
2019-03-07 13:35 Yixun Lan
2019-02-16 13:59 Yixun Lan
2019-02-13 13:41 Thomas Deutschmann
2019-01-19  3:22 Thomas Deutschmann
2018-12-15 14:13 Yixun Lan
2018-10-02 11:03 Thomas Deutschmann
2018-07-17 11:07 Mikle Kolyada
2018-04-20  5:54 Yixun Lan
2018-03-13  4:12 Yixun Lan
2018-03-13  4:12 Yixun Lan
2017-12-05  2:24 Yixun Lan
2017-11-22  1:45 Yixun Lan
2017-09-30  5:40 Yixun Lan
2017-09-30  5:40 Yixun Lan
2017-09-07  7:15 Yixun Lan
2017-07-12  7:25 Yixun Lan
2017-05-11 10:26 Yixun Lan
2017-05-02  9:01 Yixun Lan
2016-12-08  3:19 Yixun Lan
2016-12-07  1:45 Yixun Lan
2016-02-19  2:07 Yixun Lan
2016-02-18  3:17 Yixun Lan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1738979229.db4070ee49e11b83c6ee1711b84bec5453450b04.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox