commit:     98689cf8710dff1e89f69bbc6991db16d2edd901
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Sat Apr  5 02:13:25 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 10 09:54:08 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98689cf8

sys-firmware/seabios: force compiler to gcc

known incompatiable to clang are:
* error: unknown argument: '-mpreferred-stack-boundary=2'
* error: invalid input size for constraint 'Q' (inline asm)

so force gcc is obviously an easy option until upstream support clang

Closes: https://bugs.gentoo.org/887115
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-firmware/seabios/seabios-1.16.3.ebuild | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sys-firmware/seabios/seabios-1.16.3.ebuild 
b/sys-firmware/seabios/seabios-1.16.3.ebuild
index 46cb65492f78..872b3499147c 100644
--- a/sys-firmware/seabios/seabios-1.16.3.ebuild
+++ b/sys-firmware/seabios/seabios-1.16.3.ebuild
@@ -28,6 +28,7 @@ SLOT="0"
 IUSE="debug +seavgabios"
 
 BDEPEND="
+       sys-devel/gcc:*
        >=sys-power/iasl-20060912
        ${PYTHON_DEPS}"
 RDEPEND="!sys-firmware/seabios-bin"
@@ -71,6 +72,15 @@ src_prepare() {
 
        # Ensure precompiled iasl files are never used
        find "${WORKDIR}" -name '*.hex' -delete || die
+
+       # Force gcc because build failed with clang, #887115
+       if ! tc-is-gcc ; then
+               ewarn "seabios can be built with gcc only."
+               ewarn "Ignoring CC=$(tc-getCC) and forcing ${CHOST}-gcc"
+               export CC=${CHOST}-gcc
+               export CXX=${CHOST}-g++
+               tc-is-gcc || die "tc-is-gcc failed in spite of CC=${CC}"
+       fi
 }
 
 src_configure() {

Reply via email to