app-admin/coreboot-utils-25.06: version bump

fixes for -Oz compilation

Closes: https://bugs.gentoo.org/961917
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
This commit is contained in:
Fabian Groffen
2025-08-31 10:32:40 +02:00
parent 06852382c9
commit 5ec88f908e
4 changed files with 94 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST coreboot-25.06.tar.xz 65295812 BLAKE2B 71d88e8f886df117768aa9d8f8913c9bef4c981b36c7eefd37e00d0ce746a588b6fc6aa658be59d141010e3ef1726ee492b52d87d9b4ace7a74dce78361bc1d2 SHA512 380546ee0353098065e824f1ae3f7fca012bb23adf47432b0b598a64ac6940d71035f8614f39ecb48f444c854bf532096c66149c26134ff1ed9ec14f7a836a22
DIST coreboot-4.18.tar.xz 57868424 BLAKE2B 981d8c1cf007be15a85d5860dcfcfa6fa637f66438ff4ef6619491aaf0192e622bfbe9608deb13a975d899c94430bc3d1f0eb3a5a3dc6598f49a726b8ff641e1 SHA512 b363850d31074950bc710bd0a47a896a6c6ef23c53d720ae90ec2257697a3eeeb211e163199064b5e532e5b1e86cdecf997276d742435deeaaacfb19b83f4e6d

View File

@@ -0,0 +1,67 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit toolchain-funcs
DESCRIPTION="A selection from coreboot/utils useful in general"
HOMEPAGE="https://www.coreboot.org/"
SRC_URI="https://coreboot.org/releases/coreboot-${PV}.tar.xz"
S="${WORKDIR}/coreboot-${PV}"
LICENSE="GPL-2+ GPL-2"
SLOT="0"
KEYWORDS="~amd64"
DEPEND="sys-apps/pciutils
sys-libs/zlib"
RDEPEND="${DEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-25.06-includes.patch
"${FILESDIR}"/${PN}-25.06-Oz.patch
)
# selection from README.md that seem useful outside coreboot
coreboot_utils=(
#cbfstool has textrels and is not really necessary outside coreboot
cbmem
ifdtool
intelmetool
inteltool
me_cleaner
nvramtool
pmh7tool
superiotool
)
src_prepare() {
default
# drop some CFLAGS that hurt compilation on modern toolchains or
# force optimisation
# can't do this in one sed, because it all happens back-to-back
for e in '-O[01234567s]' '-g' '-Werror' '-ansi' '-pendantic' ; do
sed -i -e 's/\( \|=\)'"${e}"'\( \|$\)/\1/g' util/*/Makefile* \
|| die
done
}
src_compile() {
tc-export CC
export HOSTCFLAGS="${CFLAGS}"
for tool in ${coreboot_utils[*]} ; do
[[ -f util/${tool}/Makefile ]] || continue
emake -C util/${tool} V=1
done
}
src_install() {
exeinto /usr/sbin
for tool in ${coreboot_utils[*]} ; do
[[ -e util/${tool}/${tool} ]] && doexe util/${tool}/${tool}
[[ -e util/${tool}/${tool}.py ]] && doexe util/${tool}/${tool}.py
[[ -e util/${tool}/${tool}.8 ]] && doman util/${tool}/${tool}.8
[[ -d util/${tool}/man ]] && doman util/${tool}/man/*.[12345678]
done
}

View File

@@ -0,0 +1,13 @@
Bug: https://bugs.gentoo.org/961917
--- a/util/inteltool/cpu.c
+++ b/util/inteltool/cpu.c
@@ -53,7 +53,7 @@
return ret;
}
-inline cpuid_result_t cpuid_ext(int op, unsigned int ecx)
+inline static cpuid_result_t cpuid_ext(int op, unsigned int ecx)
{
cpuid_result_t result;

View File

@@ -0,0 +1,13 @@
fix compilation when CFLAGS is set (which in Gentoo it always is)
--- a/util/intelmetool/Makefile
+++ b/util/intelmetool/Makefile
@@ -7,6 +7,8 @@
INSTALL ?= /usr/bin/env install
PREFIX ?= /usr/local
CFLAGS ?= -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function \
+# \ on prev and next line for patch
+CFLAGS += \
-I $(TOP)/src/commonlib/bsd/include
LDFLAGS += -lpci -lz