commit: 085af7dfb91c441435b7d5f2b0b387b6369baf68
Author: Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Sat Apr 5 04:34:56 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 10 09:54:09 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=085af7df
app-emulation/xen-tools: force gcc for seabios & ipxe
* seabios: see commit log of sys-firmware/seabios
* ipxe: upstream support gcc only (at least for now), there are many
issues on 'variable length array in structure' which is an
extension will never be supported by clang
CC is passed by "make CC=...", so "override" is added in Makefile to
force ignore the assignment from command line.
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/41485
Signed-off-by: Sam James <sam <AT> gentoo.org>
app-emulation/xen-tools/files/ipxe-force-gcc.patch | 14 ++++++++++++++
app-emulation/xen-tools/xen-tools-4.19.1.ebuild | 10 +++++++++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/app-emulation/xen-tools/files/ipxe-force-gcc.patch
b/app-emulation/xen-tools/files/ipxe-force-gcc.patch
new file mode 100644
index 000000000000..781de6591356
--- /dev/null
+++ b/app-emulation/xen-tools/files/ipxe-force-gcc.patch
@@ -0,0 +1,14 @@
+diff --git a/src/Makefile b/src/Makefile
+index 548a4e3f..de5ee7ac 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -16,7 +16,8 @@ SYMBOL_PREFIX :=
+ #
+ # Locations of tools
+ #
+-HOST_CC := gcc
++override CC := gcc
++HOST_CC := ${CC}
+ RM := rm -f
+ TOUCH := touch
+ MKDIR := mkdir
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 849888b3e33e..8277a930a505 100644
--- a/app-emulation/xen-tools/xen-tools-4.19.1.ebuild
+++ b/app-emulation/xen-tools/xen-tools-4.19.1.ebuild
@@ -163,7 +163,9 @@ DEPEND="${COMMON_DEPEND}
BDEPEND="dev-lang/perl
app-alternatives/yacc
- sys-devel/gettext"
+ sys-devel/gettext
+ ipxe? ( sys-devel/gcc:* )
+ !system-seabios? ( sys-devel/gcc:* )"
# hvmloader is used to bootstrap a fully virtualized kernel
# Approved by QA team in bug #144032
@@ -280,7 +282,9 @@ src_prepare() {
# gcc 11
cp
"${XEN_GENTOO_PATCHES_DIR}/ipxe/${PN}-4.15.0-ipxe-gcc11.patch"
tools/firmware/etherboot/patches/ipxe-gcc11.patch || die
+ cp "${FILESDIR}/ipxe-force-gcc.patch"
tools/firmware/etherboot/patches/ || die
echo ipxe-gcc11.patch >>
tools/firmware/etherboot/patches/series || die
+ echo ipxe-force-gcc.patch >>
tools/firmware/etherboot/patches/series || die
fi
# Fix texi2html build error with new texi2html, qemu.doc.html
@@ -405,6 +409,10 @@ src_prepare() {
tools/firmware/ovmf-dir-remote/BaseTools/Source/C/VfrCompile/Pccts/*/makefile
|| die
fi
+ if ! use system-seabios ; then
+ sed -i "/^export HOSTCC/i override CC:=gcc"
tools/firmware/seabios-dir/Makefile
+ fi
+
default
}