summaryrefslogtreecommitdiff
path: root/sys-devel/bpf-toolchain
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-08-16 12:22:56 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-08-16 12:22:56 +0100
commit2ca31eebd5b7496656193e0aa6ae39200d69a017 (patch)
tree6cf0c8f4ce90a3960c27acf45011134fb674dd62 /sys-devel/bpf-toolchain
parent3ad1879f00b279af69d6b9cd3ef97a2a7496d734 (diff)
gentoo auto-resync : 16:08:2024 - 12:22:56
Diffstat (limited to 'sys-devel/bpf-toolchain')
-rw-r--r--sys-devel/bpf-toolchain/Manifest4
-rw-r--r--sys-devel/bpf-toolchain/bpf-toolchain-14.2.0-r2.ebuild (renamed from sys-devel/bpf-toolchain/bpf-toolchain-14.2.0.ebuild)37
-rw-r--r--sys-devel/bpf-toolchain/metadata.xml7
3 files changed, 43 insertions, 5 deletions
diff --git a/sys-devel/bpf-toolchain/Manifest b/sys-devel/bpf-toolchain/Manifest
index 1acc70a80dbb..b340afe02461 100644
--- a/sys-devel/bpf-toolchain/Manifest
+++ b/sys-devel/bpf-toolchain/Manifest
@@ -1,4 +1,4 @@
DIST binutils-2.43.tar.xz 28175768 BLAKE2B 28b0a04a28273b76eab2d00e00160be889f155f77f5a9d8759ef8dce505c97e97641bf7ec70b92b731b520570a02b06e04e8215b068fcb1bb2573e9ef24732d9 SHA512 93e063163e54d6a6ee2bd48dc754270bf757a3635b49a702ed6b310e929e94063958512d191e66beaf44275f7ea60865dbde138b624626739679fcc306b133bb
DIST gcc-14.2.0.tar.xz 92306460 BLAKE2B 87baf2a06dfa75d8fb6cd62c747ef1f57d3b9bbbe33a360d9ed3de4b4dbeaa8d920504c67e409bd9863414202c14fd854b46108e984418171205119216d03d3b SHA512 932bdef0cda94bacedf452ab17f103c0cb511ff2cec55e9112fc0328cbf1d803b42595728ea7b200e0a057c03e85626f937012e49a7515bc5dd256b2bf4bc396
-EBUILD bpf-toolchain-14.2.0.ebuild 5435 BLAKE2B f81234bd9550045ab935fdf1b0343c954dddc83d06f19193d4c08cd589264d0f31c71ba17e146fd18f32e522653f8cfdfb4eba94ca0bf68eb080bfeb0133ab1a SHA512 d0d9a518d0bb86429a56babfa0ffb353f7aa16eace9e4bb26f1dcb207e1f715fe7021ff06aa69c37713cff5c4e38efa73c00fa49eb6cb3ea270ecf947d46ae3f
-MISC metadata.xml 394 BLAKE2B 4985eaa40c572af9a7ada59b41494a2bd95090a16fba4a9bbbcded4652a03d46dc3678ab882407235bfe77fae729971155d4720e0325f649276ddd72ff96b715 SHA512 29d42cdee5df81b868c07ea9d5419cbbc0f816c69153f24fc63ff8beeee308f85d89bd3e4351b98949e578bcbc4532d06cf2054849774a4e7d9e1c0ee78083e4
+EBUILD bpf-toolchain-14.2.0-r2.ebuild 6405 BLAKE2B 61eb6539afcd81ce031ccd47557de7d0a9595beae7cb9b879c85b6142a133cf1b643dfa87c4f65205ad27bd2562d233a5753619416bfbe8822c37f295a3e34e1 SHA512 51dc4ee4c569eb577847e418973892effade98bdc54688c06c64e546fd5959e12ca08c68e57347dd89880bf32f028ce7a164334ef8ea1d2b68b028af6b1aae84
+MISC metadata.xml 599 BLAKE2B c41d219a2ba989105be860668dae9a75ed7283924017bc5f452853325f7800d90f87f3acd8c56c51efbc150a45d630f20dff2867a73753e4a71fef2cc5adea04 SHA512 c0e7d480106f9803602288191de6b5295d80c8f4da7458dd1630dcb40ea67cf0e1258865bd7be646306b60700c991ed15c487d54c083f2a65717ac46c27a70de
diff --git a/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0.ebuild b/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0-r2.ebuild
index aba05ad111a3..dfd388189afa 100644
--- a/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0.ebuild
+++ b/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0-r2.ebuild
@@ -41,8 +41,7 @@ LICENSE="
"
SLOT="0"
KEYWORDS="-* ~amd64"
-# TODO: USE=strip, USE=bin-symlinks from dev-util/mingw64-toolchain
-IUSE="custom-cflags"
+IUSE="+bin-symlinks custom-cflags +strip"
RDEPEND="
dev-libs/gmp:=
@@ -50,6 +49,10 @@ RDEPEND="
dev-libs/mpfr:=
sys-libs/zlib:=
virtual/libiconv
+ bin-symlinks? (
+ !cross-bpf-unknown-none/binutils
+ !cross-bpf-unknown-none/gcc
+ )
"
DEPEND="${RDEPEND}"
@@ -81,7 +84,8 @@ src_compile() {
CTARGET=bpf-unknown-none
BPFT_D=${T}/root # moved to ${D} in src_install
- local prefix=${EPREFIX}/usr
+ local bpftdir=/usr/lib/${PN}
+ local prefix=${EPREFIX}${bpftdir}
local sysroot=${BPFT_D}${prefix}
local -x PATH=${sysroot}/bin:${PATH}
@@ -177,10 +181,29 @@ src_compile() {
bpft-build binutils
bpft-build gcc
+ if use bin-symlinks; then
+ mkdir -p -- "${BPFT_D}${EPREFIX}"/usr/bin/ || die
+ local bin
+ for bin in "${sysroot}"/bin/*; do
+ ln -rs -- "${bin}" "${BPFT_D}${EPREFIX}"/usr/bin/ || die
+ done
+ fi
+
# Delete libdep.a, which has a colliding name and is useless for bpf,
# which does not make use of cross-library dependencies: the libdep.a
# for the native binutils will do.
rm -f ${sysroot}/lib/bfd-plugins/libdep.a || die
+
+ # portage doesn't know the right strip executable to use for CTARGET
+ # and it can lead to .a mangling, notably with 32bit (breaks toolchain)
+ dostrip -x ${bpftdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
+
+ # TODO: Check if this is worth doing, it may not be
+ if use strip; then
+ einfo "Stripping ${CTARGET} static libraries ..."
+ find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
+ -exec ${CTARGET}-strip --strip-unneeded {} + || die
+ fi
}
src_install() {
@@ -190,6 +213,9 @@ src_install() {
}
pkg_postinst() {
+ use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] &&
+ eselect compiler-shadow update all
+
if [[ ! ${REPLACING_VERSIONS} ]]; then
elog "Note that this package is primarily intended for DTrace, systemd, and related"
elog "packages to depend on without needing a manual crossdev setup."
@@ -199,3 +225,8 @@ pkg_postinst() {
elog " https://wiki.gentoo.org/wiki/Crossdev"
fi
}
+
+pkg_postrm() {
+ use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] &&
+ eselect compiler-shadow clean all
+}
diff --git a/sys-devel/bpf-toolchain/metadata.xml b/sys-devel/bpf-toolchain/metadata.xml
index 12065082990f..34b44dd721cd 100644
--- a/sys-devel/bpf-toolchain/metadata.xml
+++ b/sys-devel/bpf-toolchain/metadata.xml
@@ -5,6 +5,13 @@
<email>toolchain@gentoo.org</email>
<name>Gentoo Toolchain Project</name>
</maintainer>
+ <use>
+ <flag name="bin-symlinks">
+ Symlink executables to usr/bin to be in default
+ PATH (conflicts with crossdev bpf, and crossdev
+ is preferable for a fully featured toolchain)
+ </flag>
+ </use>
<upstream>
<remote-id type="cpe">cpe:/a:gnu:gcc</remote-id>
<remote-id type="cpe">cpe:/a:gnu:binutils</remote-id>