commit:     8307d43ab2d75e997ec160f3d80a1d42a7ad0334
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Fri Feb 28 06:23:18 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 10 10:17:34 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8307d43a

sys-apps/memtest86+: fix pkgcheck warnings & force compiler to gcc

clang failed with:

  ../app/main.c:172:5: error: indirect goto in function with no 
address-of-label expressions

for code below:

  uintptr_t *new_start_addr = (uintptr_t *)(addr + startup - _start);
  ...
  goto *new_start_addr;

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

 sys-apps/memtest86+/memtest86+-6.20-r1.ebuild | 15 ++++++++++++---
 sys-apps/memtest86+/memtest86+-7.00.ebuild    | 15 ++++++++++++---
 sys-apps/memtest86+/memtest86+-7.20.ebuild    | 15 ++++++++++++---
 3 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/sys-apps/memtest86+/memtest86+-6.20-r1.ebuild 
b/sys-apps/memtest86+/memtest86+-6.20-r1.ebuild
index 5ca6984446ce..2d377c384813 100644
--- a/sys-apps/memtest86+/memtest86+-6.20-r1.ebuild
+++ b/sys-apps/memtest86+/memtest86+-6.20-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 Gentoo Authors
+# Copyright 2022-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -11,6 +11,8 @@ DESCRIPTION="Memory tester based on PCMemTest"
 HOMEPAGE="https://www.memtest.org/";
 
SRC_URI="https://github.com/memtest86plus/memtest86plus/archive/refs/tags/v${MY_PV}.tar.gz
 -> ${P}.tar.gz"
 
+S=${WORKDIR}/memtest86plus-${MY_PV}
+
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="amd64 x86"
@@ -24,10 +26,9 @@ ISODEPS="
 BDEPEND="
        iso32? ( ${ISODEPS} )
        iso64? ( ${ISODEPS} )
+       sys-devel/gcc:*
 "
 
-S=${WORKDIR}/memtest86plus-${MY_PV}
-
 pkg_setup() {
        if use uefi32 || use uefi64; then
                secureboot_pkg_setup
@@ -42,6 +43,14 @@ src_prepare() {
                -e 's/objcopy/$(OBJCOPY)/' \
                -e 's/shell size/shell $(SIZE)/' \
                build{32,64}/Makefile || die
+
+       if ! tc-is-gcc; then
+               ewarn "clang doesn't support indirect goto in function with no 
address-of-label expressions"
+               ewarn "Ignoring CC=$(tc-getCC) and forcing ${CHOST}-gcc"
+               export CC=${CHOST}-gcc AR=${CHOST}-gcc-ar
+               tc-is-gcc || die "tc-is-gcc failed in spite of CC=${CC}"
+       fi
+
        default
 }
 

diff --git a/sys-apps/memtest86+/memtest86+-7.00.ebuild 
b/sys-apps/memtest86+/memtest86+-7.00.ebuild
index 166f6138e149..33a4c6202519 100644
--- a/sys-apps/memtest86+/memtest86+-7.00.ebuild
+++ b/sys-apps/memtest86+/memtest86+-7.00.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 Gentoo Authors
+# Copyright 2022-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -11,6 +11,8 @@ DESCRIPTION="Memory tester based on PCMemTest"
 HOMEPAGE="https://www.memtest.org/";
 
SRC_URI="https://github.com/memtest86plus/memtest86plus/archive/refs/tags/v${MY_PV}.tar.gz
 -> ${P}.tar.gz"
 
+S=${WORKDIR}/memtest86plus-${MY_PV}
+
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="amd64 x86"
@@ -24,10 +26,9 @@ ISODEPS="
 BDEPEND="
        iso32? ( ${ISODEPS} )
        iso64? ( ${ISODEPS} )
+       sys-devel/gcc:*
 "
 
-S=${WORKDIR}/memtest86plus-${MY_PV}
-
 pkg_setup() {
        if use uefi32 || use uefi64; then
                secureboot_pkg_setup
@@ -42,6 +43,14 @@ src_prepare() {
                -e 's/= objcopy/?= $(OBJCOPY)/' \
                -e 's/shell size/shell $(SIZE)/' \
                build{32,64}/Makefile || die
+
+       if ! tc-is-gcc; then
+               ewarn "clang doesn't support indirect goto in function with no 
address-of-label expressions"
+               ewarn "Ignoring CC=$(tc-getCC) and forcing ${CHOST}-gcc"
+               export CC=${CHOST}-gcc AR=${CHOST}-gcc-ar
+               tc-is-gcc || die "tc-is-gcc failed in spite of CC=${CC}"
+       fi
+
        default
 }
 

diff --git a/sys-apps/memtest86+/memtest86+-7.20.ebuild 
b/sys-apps/memtest86+/memtest86+-7.20.ebuild
index 88b05cadc68a..ce371c16b302 100644
--- a/sys-apps/memtest86+/memtest86+-7.20.ebuild
+++ b/sys-apps/memtest86+/memtest86+-7.20.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 Gentoo Authors
+# Copyright 2022-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -11,6 +11,8 @@ DESCRIPTION="Memory tester based on PCMemTest"
 HOMEPAGE="https://www.memtest.org/";
 
SRC_URI="https://github.com/memtest86plus/memtest86plus/archive/refs/tags/v${MY_PV}.tar.gz
 -> ${P}.tar.gz"
 
+S=${WORKDIR}/memtest86plus-${MY_PV}
+
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
@@ -24,10 +26,9 @@ ISODEPS="
 BDEPEND="
        iso32? ( ${ISODEPS} )
        iso64? ( ${ISODEPS} )
+       sys-devel/gcc:*
 "
 
-S=${WORKDIR}/memtest86plus-${MY_PV}
-
 pkg_setup() {
        if use uefi32 || use uefi64; then
                secureboot_pkg_setup
@@ -42,6 +43,14 @@ src_prepare() {
                -e 's/= objcopy/?= $(OBJCOPY)/' \
                -e 's/shell size/shell $(SIZE)/' \
                build{32,64}/Makefile || die
+
+       if ! tc-is-gcc; then
+               ewarn "clang doesn't support indirect goto in function with no 
address-of-label expressions"
+               ewarn "Ignoring CC=$(tc-getCC) and forcing ${CHOST}-gcc"
+               export CC=${CHOST}-gcc AR=${CHOST}-gcc-ar
+               tc-is-gcc || die "tc-is-gcc failed in spite of CC=${CC}"
+       fi
+
        default
 }
 

Reply via email to