commit: ff9b25f9e058cc7d3a371d46c007aba0f89f7118 Author: Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org> AuthorDate: Fri Sep 26 22:33:48 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Oct 3 00:46:01 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff9b25f9
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 <AT> asokolov.org> Part-of: https://github.com/gentoo/gentoo/pull/43954 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-libs/dietlibc/Manifest | 2 + dev-libs/dietlibc/dietlibc-0.35.ebuild | 86 ++++++++++++++++++++++++++ dev-libs/dietlibc/files/dietlibc-0.35-cc.patch | 11 ++++ 3 files changed, 99 insertions(+) diff --git a/dev-libs/dietlibc/Manifest b/dev-libs/dietlibc/Manifest index 62d833af56e9..2cc5f8737106 100644 --- a/dev-libs/dietlibc/Manifest +++ b/dev-libs/dietlibc/Manifest @@ -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 diff --git a/dev-libs/dietlibc/dietlibc-0.35.ebuild b/dev-libs/dietlibc/dietlibc-0.35.ebuild new file mode 100644 index 000000000000..e7912b0c2959 --- /dev/null +++ b/dev-libs/dietlibc/dietlibc-0.35.ebuild @@ -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 +} diff --git a/dev-libs/dietlibc/files/dietlibc-0.35-cc.patch b/dev-libs/dietlibc/files/dietlibc-0.35-cc.patch new file mode 100644 index 000000000000..433610ae6bac --- /dev/null +++ b/dev-libs/dietlibc/files/dietlibc-0.35-cc.patch @@ -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
