dev-libs/dietlibc: add 0.35

Closes: https://bugs.gentoo.org/944229
Closes: https://bugs.gentoo.org/722970
Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org>
Part-of: https://github.com/gentoo/gentoo/pull/43954
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Alexey Sokolov 2025-09-26 23:33:48 +01:00 committed by Sam James
parent 40bcb2158f
commit ff9b25f9e0
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
3 changed files with 99 additions and 0 deletions

View File

@ -1 +1,3 @@
DIST dietlibc-0.34.tar.xz 662732 BLAKE2B ac709f19f98c298ee424f8320cbc7bca997156323e64d3a219251146b4257185f27519262914d3df044638ecfcf06e1e3680d8af226704dca65d6e4be20b3dc4 SHA512 2b38528c0ccf50e426f587b6448fed997fab1147eecc9e1af2f3fb3efe3d8f3997656d8e66e7cf1045ceb1f602cef43456c62ba83ff494f9c9816721bdb4d6c6
DIST dietlibc-0.35.tar.xz 688508 BLAKE2B 2a12eef7fd6249d419ce0dc6491748cda13f4ef90581b05b3165f99bef41e4c5d3ccf8e1c35ad1bb17182dc3499212474e7288638897d6c0e54e243dbee277e1 SHA512 24adcdb0968c45f888fdb923f898b38d3b25e2bff09960000fbbefdfcb678d96632f7fe2987ba48c791001d134d606099a363b02b4b76ea7d477206d02844c89
DIST dietlibc-0.35.tar.xz.sig 566 BLAKE2B d8d6697c4204923e7c4cca4e3eb7d301d1dac817b79be886a9f7a3cb10aaf22f688efa150ac449e64502360922f4dfe2476e9d215b514048f0ca49b35da4af9e SHA512 75a974ed2111be4afcb82a21bc4d1977a063dc5c3df51e955c912342bb5c6f8e4f5edaa48881c64ea871813e1a47fe7085415158005c3b3defeccb7984d54080

View File

@ -0,0 +1,86 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic toolchain-funcs verify-sig
DESCRIPTION="A libc optimized for small size"
HOMEPAGE="http://www.fefe.de/dietlibc/"
SRC_URI="
http://www.fefe.de/dietlibc/${P}.tar.xz
verify-sig? ( http://www.fefe.de/dietlibc/${P}.tar.xz.sig )
"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~mips ~sparc ~x86 ~amd64-linux ~x86-linux"
DEPEND=">=sys-devel/binutils-2.31.1-r4"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-fefe )"
DIETHOME="/usr/diet"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/fefe.asc
PATCHES=(
"${FILESDIR}"/${P}-cc.patch
)
src_prepare() {
default
# bug #855677
filter-lto
# Replace sparc64 related C[XX]FLAGS (see bug #45716)
use sparc && replace-sparc64-flags
# bug 676704
use sparc && tc-is-gcc && append-flags -fno-tree-pre
# gcc-hppa suffers support for SSP, compilation will fail
use hppa && strip-unsupported-flags
# Makefile does not append CFLAGS
append-flags -W -Wall -Wchar-subscripts \
-Wmissing-prototypes -Wmissing-declarations -Wno-switch \
-Wno-unused -Wredundant-decls -fno-strict-aliasing
# Disable ssp for we default to it on >=gcc-4.8.3
append-flags $(test-flags -fno-stack-protector)
# only use -nopie on archs that support it
tc-enables-pie && append-flags -no-pie
sed -i -e 's:strip::' Makefile || die
append-flags -Wa,--noexecstack
# https://bugs.gentoo.org/944229
append-cflags -std=gnu17
# https://bugs.gentoo.org/722970
sed -i -e 's:$(CROSS)ar:$(AR):' Makefile || die
sed -i -e 's:CC=gcc::' Makefile || die
}
src_compile() {
emake prefix="${EPREFIX}"${DIETHOME} \
AR="$(tc-getAR)" \
CC="$(tc-getCC)" \
CFLAGS="${CFLAGS}" \
STRIP=":"
}
src_install() {
emake -j1 prefix="${EPREFIX}"${DIETHOME} \
DESTDIR="${D}" \
install-bin \
install-headers \
install-profiling
dobin "${ED}"${DIETHOME}/bin/*
doman "${ED}"${DIETHOME}/man/*/*
rm -r "${ED}"${DIETHOME}/{man,bin} || die
dodoc AUTHOR BUGS CAVEAT CHANGES README THANKS TODO PORTING
}

View File

@ -0,0 +1,11 @@
https://bugs.gentoo.org/722970
--- a/threadsafe.sh
+++ b/threadsafe.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-(gcc -E - << EOF | grep WANT_THREAD_SAFE > /dev/null) || echo libpthread/pthread_*.c
+(${CC} -E - << EOF | grep WANT_THREAD_SAFE > /dev/null) || echo libpthread/pthread_*.c
#include "dietfeatures.h"
WANT_THREAD_SAFE
EOF