public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/uclibc-ng/, sys-libs/uclibc-ng/files/
@ 2016-04-13  0:10 Anthony G. Basile
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony G. Basile @ 2016-04-13  0:10 UTC (permalink / raw
  To: gentoo-commits

commit:     6714d08e2f90e2d372ba4e6571d96dd6b653a764
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 13 00:05:45 2016 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Apr 13 00:05:45 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6714d08e

sys-libs/uclibc-ng: initial commit

Package-Manager: portage-2.2.26

 sys-libs/uclibc-ng/Manifest                  |   1 +
 sys-libs/uclibc-ng/files/uclibc-compat.patch |  12 +
 sys-libs/uclibc-ng/metadata.xml              |  20 ++
 sys-libs/uclibc-ng/uclibc-ng-1.0.13.ebuild   | 403 +++++++++++++++++++++++++++
 sys-libs/uclibc-ng/uclibc-ng-9999.ebuild     | 403 +++++++++++++++++++++++++++
 5 files changed, 839 insertions(+)

diff --git a/sys-libs/uclibc-ng/Manifest b/sys-libs/uclibc-ng/Manifest
new file mode 100644
index 0000000..9bef84b
--- /dev/null
+++ b/sys-libs/uclibc-ng/Manifest
@@ -0,0 +1 @@
+DIST uClibc-ng-1.0.13.tar.bz2 2950676 SHA256 2d3530fa9321022db30c4576b272d8113efb75393f9b43281bd3b014c75bd2d4 SHA512 aae994d06119756161b9a38eeb8b4a0b8531dfaf13094158218cce2500cd02dcac9067160a5a2764d355e1208ee7cda04f4c1ddf7f6812c794f4680c938e9b22 WHIRLPOOL e612f9a152335c9b89fe6e10dcab0ad44978c205da8230597f3ff3b8adee81a95a71dfcec36afc9c0c262fa56d643de47a705840e841363a13b0af2fee686653

diff --git a/sys-libs/uclibc-ng/files/uclibc-compat.patch b/sys-libs/uclibc-ng/files/uclibc-compat.patch
new file mode 100644
index 0000000..5827756
--- /dev/null
+++ b/sys-libs/uclibc-ng/files/uclibc-compat.patch
@@ -0,0 +1,12 @@
+diff -Naur uClibc-ng-1.0.13.orig/ldso/ldso/Makefile.in uClibc-ng-1.0.13/ldso/ldso/Makefile.in
+--- uClibc-ng-1.0.13.orig/ldso/ldso/Makefile.in	2016-03-13 21:48:40.000000000 +0000
++++ uClibc-ng-1.0.13/ldso/ldso/Makefile.in	2016-04-08 13:45:06.837079637 +0000
+@@ -76,8 +76,6 @@
+ $(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
+ $(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
+ 	$(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
+-	# link for backward compatibility
+-	(cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME).so.0 )
+ 
+ $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
+ 	$(Q)$(RM) $@

diff --git a/sys-libs/uclibc-ng/metadata.xml b/sys-libs/uclibc-ng/metadata.xml
new file mode 100644
index 0000000..1e21008
--- /dev/null
+++ b/sys-libs/uclibc-ng/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>blueness@gentoo.org</email>
+		<name>Anthony G. Basile</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>embedded@gentoo.org</email>
+		<name>Embedded Gentoo</name>
+	</maintainer>
+	<longdescription>
+	uClibc-ng is a small C library for developing embedded Linux systems. It is much
+	smaller than the GNU C Library, but nearly all applications supported by glibc
+	also work perfectly with uClibc-ng. 
+	</longdescription>
+	<use>
+		<flag name="rpc">Enable sun nis/rpc support (you should use libtirpc though)</flag>
+	</use>
+</pkgmetadata>

diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.13.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.13.ebuild
new file mode 100644
index 0000000..aec3523
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.13.ebuild
@@ -0,0 +1,403 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+	EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+	inherit git-r3
+	MY_P=uclibc-ng-${PV}
+else
+	MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc.org/"
+if [[ ${PV} != "9999" ]] ; then
+	PATCH_VER=""
+	SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+	KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+#    will delete the ld.so sym link prematurely and break the system. So we
+#    will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape.  We've been using
+#    the breakout library.  The disadvantage here is that we have to sprinkle
+#    LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+	!!sys-libs/uclibc
+	iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+	if [[ ${CATEGORY} == cross-* ]] ; then
+		export CTARGET=${CATEGORY#cross-}
+	fi
+fi
+
+is_crosscompile() {
+	[[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+	if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+		echo /usr/include
+	else
+		echo /usr/${CTARGET}/usr/include
+	fi
+}
+
+just_headers() {
+	use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+	# XXX: this wont work for a toolchain which is bi-endian, but we
+	#      dont have any such thing at the moment, so not a big deal
+	touch "${T}"/endian.s
+	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+	case $(file "${T}"/endian.o) in
+		*" MSB "*) echo "BIG";;
+		*" LSB "*) echo "LITTLE";;
+		*)         echo "NFC";;
+	esac
+	rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+	local flag=$1; shift
+	case ${flag} in
+		y|n) ;;
+		*) flag=$(usex ${flag} y n) ;;
+	esac
+
+	local var="defs_${flag}"
+	eval "${var}+=( $* )"
+}
+
+get_opt() {
+	(
+	unset ${1}
+	. ${2:-"${S}"/.config}
+	echo ${!1}
+	)
+}
+
+make_oldconfig() {
+	yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+	restore_config .config
+	if [ -f .config ]; then
+		make_oldconfig
+		return 0
+	else
+		ewarn "Could not locate user configfile, so we will save a default one"
+	fi
+
+	emake ARCH=$1 defconfig >/dev/null
+
+	local defs_{y,n}
+
+	# These are forced off
+	defs_n=(
+		DOASSERTS
+		DODEBUG_PT
+		HAS_NO_THREADS
+		PROPOLICE_BLOCK_ABRT
+		SSP_QUICK_CANARY
+		SUPPORT_LD_DEBUG_EARLY
+		UCLIBC_HAS_CTYPE_UNSAFE
+		UCLIBC_HAS_LOCALE
+		UCLIBC_HAS_SSP_COMPAT
+	)
+
+	# These are forced on
+	defs_y=(
+		COMPAT_ATEXIT
+		DO_C99_MATH
+		DO_XSI_MATH
+		FORCE_SHAREABLE_TEXT_SEGMENTS
+		LDSO_GNU_HASH_SUPPORT
+		LDSO_PRELINK_SUPPORT
+		LDSO_PRELOAD_FILE_SUPPORT
+		LDSO_RUNPATH_OF_EXECUTABLE
+		LDSO_STANDALONE_SUPPORT
+		MALLOC_GLIBC_COMPAT
+		PROPOLICE_BLOCK_SEGV
+		PTHREADS_DEBUG_SUPPORT
+		UCLIBC_HAS_ARC4RANDOM
+		UCLIBC_HAS_BACKTRACE
+		UCLIBC_HAS_BSD_RES_CLOSE
+		UCLIBC_HAS_CONTEXT_FUNCS
+		UCLIBC_HAS_CTYPE_CHECKED
+		UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+		UCLIBC_HAS_FENV
+		UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+		UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+		UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+		UCLIBC_HAS_FTS
+		UCLIBC_HAS_FTW
+		UCLIBC_HAS_GETPT
+		UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+		UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+		UCLIBC_HAS_GNU_GLOB
+		UCLIBC_HAS_HEXADECIMAL_FLOATS
+		UCLIBC_HAS_LIBNSL_STUB
+		UCLIBC_HAS_LIBRESOLV_STUB
+		UCLIBC_HAS_LIBUTIL
+		UCLIBC_HAS_NFTW
+		UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+		UCLIBC_HAS_OBSTACK
+		UCLIBC_HAS_PRINTF_M_SPEC
+		UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+		UCLIBC_HAS_RESOLVER_SUPPORT
+		UCLIBC_HAS_SHA256_CRYPT_IMPL
+		UCLIBC_HAS_SHA512_CRYPT_IMPL
+		UCLIBC_HAS_SSP
+		UCLIBC_HAS_STUBS
+		UCLIBC_HAS_SYS_ERRLIST
+		UCLIBC_HAS_SYS_SIGLIST
+		UCLIBC_HAS_THREADS_NATIVE
+		UCLIBC_HAS_TZ_FILE_READ_MANY
+		UCLIBC_HAS_UTMP
+		UCLIBC_HAS_UTMPX
+		UCLIBC_HAS_WCHAR
+		UCLIBC_HAS_WORDEXP
+		UCLIBC_NTP_LEGACY
+		UCLIBC_SUPPORT_AI_ADDRCONFIG
+		UCLIBC_SUSV2_LEGACY
+		UCLIBC_SUSV3_LEGACY
+		UCLIBC_SUSV3_LEGACY_MACROS
+		UCLIBC_SUSV4_LEGACY
+		UCLIBC_USE_NETLINK
+	)
+
+	sed -i -e '/ARCH_.*_ENDIAN/d' .config
+	kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+	kconfig_q_opt debug DODEBUG
+	kconfig_q_opt debug SUPPORT_LD_DEBUG
+	kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+	kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+	kconfig_q_opt rpc UCLIBC_HAS_RPC
+	kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+	kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+	kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+	kconfig_q_opt hardened UCLIBC_BUILD_NOW
+	kconfig_q_opt hardened UCLIBC_BUILD_PIE
+	kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+	kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+	local count def
+	for count in 1 2 ; do
+		# Run twice as some config opts depend on others being enabled first.
+		for def in ${defs_y[@]} ; do
+			sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+		done
+		for def in ${defs_n[@]} ; do
+			sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+		done
+		make_oldconfig
+	done
+
+	einfo "Enabled options:"
+	for def in ${defs_y[@]} ; do
+		einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+	done
+	einfo "Disabled options:"
+	for def in ${defs_n[@]} ; do
+		einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+	done
+
+	# setup build and run paths
+	sed -i \
+		-e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+		-e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+		-e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+		-e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+		-e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+		-e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+		.config || die
+
+	make_oldconfig
+}
+
+pkg_setup() {
+	# Make sure our CHOST is a uclibc toolchain for native compiling
+	if [[ ${CHOST} == ${CTARGET} ]]; then
+		case ${CHOST} in
+			*-uclinux*|*-uclibc*) ;;
+			*) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+		esac
+	fi
+
+	# uClibc-ng doesn't carry old Linux threads, and since we force
+	# threading our only choice is NPTL which requires i486 and later.
+	[[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+	local version subversion
+
+	# uclibc-ng tries to create a two sym link with ld.so,
+	# ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+	# where MAJOR_VERSION != 0 indicates the ABI verison.
+	# We want to get rid of this and just have ABI = 0.
+	eapply "${FILESDIR}"/uclibc-compat.patch
+
+	# We need to change the major.minor.sublevel of uclibc-ng.
+	# Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+	# If we really want the ABI bump, we'll have to hack the gcc
+	# spec file and change the '*link:' rule.
+	version=( $(get_version_components) )
+	if [[ -z ${version[1]} ]]; then
+		subversion=0
+	else
+		if [[ -z ${version[2]} ]]; then
+			subversion=${version[1]}
+		else
+			subversion=${version[1]}.${version[2]}
+		fi
+	fi
+
+	sed -i \
+		-e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+		-e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+		-e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+		Rules.mak || die
+
+	eapply_user
+}
+
+src_configure() {
+	# Map our toolchain arch name to the name expected by uClibc-ng.
+	local target=$(tc-arch)
+	case ${target} in
+		amd64) target="x86_64";;
+		arm)   target="arm";;
+		mips)  target="mips";;
+		ppc)   target="powerpc";;
+		x86)   target="i386";;
+	esac
+
+	# Do arch specific configuration by changing the defaults in
+	# extra/Configs/Config.<arch>.  If these are not overridden
+	# by an save .config, they will be selected by default.
+
+	# For i386, i486, i586 and i686
+	local cpu
+	if [[ ${target} == "i386" ]]; then
+		[[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+		sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+			extra/Configs/Config.i385 || die
+	fi
+
+	# For arm
+	if [[ ${target} == "arm" ]]; then
+		sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+	fi
+
+	# For mips
+	if [[ ${target} == "mips" ]]; then
+		sed -i -e "s|default CONFIG_MIPS_O32_ABI|CONFIG_MIPS_${ABI^[on]}_ABI|" \
+			extra/Configs/Config.mips || die
+	fi
+
+	# We set HOSTCC to the proper tuple rather than just 'gcc'
+	sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+	make_config ${target}
+
+	einfo
+	einfo "Runtime Prefix: /"
+	einfo "Devel Prefix:   /usr"
+	einfo "Kernel Prefix:  $(alt_build_kprefix)"
+	einfo "CBUILD:         ${CBUILD}"
+	einfo "CHOST:          ${CHOST}"
+	einfo "CTARGET:        ${CTARGET}"
+	einfo "ABI:            ${ABI}"
+	einfo "ENDIAN:         $(uclibc_endian)"
+	einfo
+}
+
+src_compile() {
+	emake headers
+	just_headers && return 0
+
+	emake
+	if is_crosscompile ; then
+		emake -C utils hostutils
+	else
+		emake utils
+	fi
+}
+
+src_test() {
+	is_crosscompile && return 0
+
+	# assert test fails on pax/grsec enabled kernels
+	# normal vfork test fails in sandbox (both glibc/uclibc)
+	emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+	local sysroot=${D}
+	is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+	local target="install"
+	just_headers && target="install_headers"
+	emake DESTDIR="${sysroot}" ${target}
+
+	save_config .config
+
+	# remove files coming from kernel-headers
+	rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+	# Make sure we install the sys-include symlink so that when
+	# we build a 2nd stage cross-compiler, gcc finds the target
+	# system headers correctly.  See gcc/doc/gccinstall.info
+	if is_crosscompile ; then
+		dosym usr/include /usr/${CTARGET}/sys-include
+		if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+			newbin utils/ldconfig.host ${CTARGET}-ldconfig
+			newbin utils/ldd.host ${CTARGET}-ldd
+		fi
+		return 0
+	fi
+
+	emake DESTDIR="${D}" install_utils
+	dobin extra/scripts/getent
+	dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+	is_crosscompile && return 0
+
+	if [ ! -e "${ROOT}"/etc/TZ ] ; then
+		ewarn "Please remember to set your timezone in /etc/TZ"
+		mkdir -p "${ROOT}"/etc
+		echo "UTC" > "${ROOT}"/etc/TZ
+	fi
+	[ "${ROOT}" != "/" ] && return 0
+	# update cache before reloading init
+	ldconfig
+	# reload init ...
+	/sbin/telinit U 2>/dev/null
+}

diff --git a/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild b/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
new file mode 100644
index 0000000..aec3523
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
@@ -0,0 +1,403 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+	EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+	inherit git-r3
+	MY_P=uclibc-ng-${PV}
+else
+	MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc.org/"
+if [[ ${PV} != "9999" ]] ; then
+	PATCH_VER=""
+	SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+	KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+#    will delete the ld.so sym link prematurely and break the system. So we
+#    will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape.  We've been using
+#    the breakout library.  The disadvantage here is that we have to sprinkle
+#    LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+	!!sys-libs/uclibc
+	iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+	if [[ ${CATEGORY} == cross-* ]] ; then
+		export CTARGET=${CATEGORY#cross-}
+	fi
+fi
+
+is_crosscompile() {
+	[[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+	if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+		echo /usr/include
+	else
+		echo /usr/${CTARGET}/usr/include
+	fi
+}
+
+just_headers() {
+	use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+	# XXX: this wont work for a toolchain which is bi-endian, but we
+	#      dont have any such thing at the moment, so not a big deal
+	touch "${T}"/endian.s
+	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+	case $(file "${T}"/endian.o) in
+		*" MSB "*) echo "BIG";;
+		*" LSB "*) echo "LITTLE";;
+		*)         echo "NFC";;
+	esac
+	rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+	local flag=$1; shift
+	case ${flag} in
+		y|n) ;;
+		*) flag=$(usex ${flag} y n) ;;
+	esac
+
+	local var="defs_${flag}"
+	eval "${var}+=( $* )"
+}
+
+get_opt() {
+	(
+	unset ${1}
+	. ${2:-"${S}"/.config}
+	echo ${!1}
+	)
+}
+
+make_oldconfig() {
+	yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+	restore_config .config
+	if [ -f .config ]; then
+		make_oldconfig
+		return 0
+	else
+		ewarn "Could not locate user configfile, so we will save a default one"
+	fi
+
+	emake ARCH=$1 defconfig >/dev/null
+
+	local defs_{y,n}
+
+	# These are forced off
+	defs_n=(
+		DOASSERTS
+		DODEBUG_PT
+		HAS_NO_THREADS
+		PROPOLICE_BLOCK_ABRT
+		SSP_QUICK_CANARY
+		SUPPORT_LD_DEBUG_EARLY
+		UCLIBC_HAS_CTYPE_UNSAFE
+		UCLIBC_HAS_LOCALE
+		UCLIBC_HAS_SSP_COMPAT
+	)
+
+	# These are forced on
+	defs_y=(
+		COMPAT_ATEXIT
+		DO_C99_MATH
+		DO_XSI_MATH
+		FORCE_SHAREABLE_TEXT_SEGMENTS
+		LDSO_GNU_HASH_SUPPORT
+		LDSO_PRELINK_SUPPORT
+		LDSO_PRELOAD_FILE_SUPPORT
+		LDSO_RUNPATH_OF_EXECUTABLE
+		LDSO_STANDALONE_SUPPORT
+		MALLOC_GLIBC_COMPAT
+		PROPOLICE_BLOCK_SEGV
+		PTHREADS_DEBUG_SUPPORT
+		UCLIBC_HAS_ARC4RANDOM
+		UCLIBC_HAS_BACKTRACE
+		UCLIBC_HAS_BSD_RES_CLOSE
+		UCLIBC_HAS_CONTEXT_FUNCS
+		UCLIBC_HAS_CTYPE_CHECKED
+		UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+		UCLIBC_HAS_FENV
+		UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+		UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+		UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+		UCLIBC_HAS_FTS
+		UCLIBC_HAS_FTW
+		UCLIBC_HAS_GETPT
+		UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+		UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+		UCLIBC_HAS_GNU_GLOB
+		UCLIBC_HAS_HEXADECIMAL_FLOATS
+		UCLIBC_HAS_LIBNSL_STUB
+		UCLIBC_HAS_LIBRESOLV_STUB
+		UCLIBC_HAS_LIBUTIL
+		UCLIBC_HAS_NFTW
+		UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+		UCLIBC_HAS_OBSTACK
+		UCLIBC_HAS_PRINTF_M_SPEC
+		UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+		UCLIBC_HAS_RESOLVER_SUPPORT
+		UCLIBC_HAS_SHA256_CRYPT_IMPL
+		UCLIBC_HAS_SHA512_CRYPT_IMPL
+		UCLIBC_HAS_SSP
+		UCLIBC_HAS_STUBS
+		UCLIBC_HAS_SYS_ERRLIST
+		UCLIBC_HAS_SYS_SIGLIST
+		UCLIBC_HAS_THREADS_NATIVE
+		UCLIBC_HAS_TZ_FILE_READ_MANY
+		UCLIBC_HAS_UTMP
+		UCLIBC_HAS_UTMPX
+		UCLIBC_HAS_WCHAR
+		UCLIBC_HAS_WORDEXP
+		UCLIBC_NTP_LEGACY
+		UCLIBC_SUPPORT_AI_ADDRCONFIG
+		UCLIBC_SUSV2_LEGACY
+		UCLIBC_SUSV3_LEGACY
+		UCLIBC_SUSV3_LEGACY_MACROS
+		UCLIBC_SUSV4_LEGACY
+		UCLIBC_USE_NETLINK
+	)
+
+	sed -i -e '/ARCH_.*_ENDIAN/d' .config
+	kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+	kconfig_q_opt debug DODEBUG
+	kconfig_q_opt debug SUPPORT_LD_DEBUG
+	kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+	kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+	kconfig_q_opt rpc UCLIBC_HAS_RPC
+	kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+	kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+	kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+	kconfig_q_opt hardened UCLIBC_BUILD_NOW
+	kconfig_q_opt hardened UCLIBC_BUILD_PIE
+	kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+	kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+	local count def
+	for count in 1 2 ; do
+		# Run twice as some config opts depend on others being enabled first.
+		for def in ${defs_y[@]} ; do
+			sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+		done
+		for def in ${defs_n[@]} ; do
+			sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+		done
+		make_oldconfig
+	done
+
+	einfo "Enabled options:"
+	for def in ${defs_y[@]} ; do
+		einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+	done
+	einfo "Disabled options:"
+	for def in ${defs_n[@]} ; do
+		einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+	done
+
+	# setup build and run paths
+	sed -i \
+		-e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+		-e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+		-e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+		-e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+		-e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+		-e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+		.config || die
+
+	make_oldconfig
+}
+
+pkg_setup() {
+	# Make sure our CHOST is a uclibc toolchain for native compiling
+	if [[ ${CHOST} == ${CTARGET} ]]; then
+		case ${CHOST} in
+			*-uclinux*|*-uclibc*) ;;
+			*) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+		esac
+	fi
+
+	# uClibc-ng doesn't carry old Linux threads, and since we force
+	# threading our only choice is NPTL which requires i486 and later.
+	[[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+	local version subversion
+
+	# uclibc-ng tries to create a two sym link with ld.so,
+	# ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+	# where MAJOR_VERSION != 0 indicates the ABI verison.
+	# We want to get rid of this and just have ABI = 0.
+	eapply "${FILESDIR}"/uclibc-compat.patch
+
+	# We need to change the major.minor.sublevel of uclibc-ng.
+	# Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+	# If we really want the ABI bump, we'll have to hack the gcc
+	# spec file and change the '*link:' rule.
+	version=( $(get_version_components) )
+	if [[ -z ${version[1]} ]]; then
+		subversion=0
+	else
+		if [[ -z ${version[2]} ]]; then
+			subversion=${version[1]}
+		else
+			subversion=${version[1]}.${version[2]}
+		fi
+	fi
+
+	sed -i \
+		-e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+		-e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+		-e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+		Rules.mak || die
+
+	eapply_user
+}
+
+src_configure() {
+	# Map our toolchain arch name to the name expected by uClibc-ng.
+	local target=$(tc-arch)
+	case ${target} in
+		amd64) target="x86_64";;
+		arm)   target="arm";;
+		mips)  target="mips";;
+		ppc)   target="powerpc";;
+		x86)   target="i386";;
+	esac
+
+	# Do arch specific configuration by changing the defaults in
+	# extra/Configs/Config.<arch>.  If these are not overridden
+	# by an save .config, they will be selected by default.
+
+	# For i386, i486, i586 and i686
+	local cpu
+	if [[ ${target} == "i386" ]]; then
+		[[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+		sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+			extra/Configs/Config.i385 || die
+	fi
+
+	# For arm
+	if [[ ${target} == "arm" ]]; then
+		sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+	fi
+
+	# For mips
+	if [[ ${target} == "mips" ]]; then
+		sed -i -e "s|default CONFIG_MIPS_O32_ABI|CONFIG_MIPS_${ABI^[on]}_ABI|" \
+			extra/Configs/Config.mips || die
+	fi
+
+	# We set HOSTCC to the proper tuple rather than just 'gcc'
+	sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+	make_config ${target}
+
+	einfo
+	einfo "Runtime Prefix: /"
+	einfo "Devel Prefix:   /usr"
+	einfo "Kernel Prefix:  $(alt_build_kprefix)"
+	einfo "CBUILD:         ${CBUILD}"
+	einfo "CHOST:          ${CHOST}"
+	einfo "CTARGET:        ${CTARGET}"
+	einfo "ABI:            ${ABI}"
+	einfo "ENDIAN:         $(uclibc_endian)"
+	einfo
+}
+
+src_compile() {
+	emake headers
+	just_headers && return 0
+
+	emake
+	if is_crosscompile ; then
+		emake -C utils hostutils
+	else
+		emake utils
+	fi
+}
+
+src_test() {
+	is_crosscompile && return 0
+
+	# assert test fails on pax/grsec enabled kernels
+	# normal vfork test fails in sandbox (both glibc/uclibc)
+	emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+	local sysroot=${D}
+	is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+	local target="install"
+	just_headers && target="install_headers"
+	emake DESTDIR="${sysroot}" ${target}
+
+	save_config .config
+
+	# remove files coming from kernel-headers
+	rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+	# Make sure we install the sys-include symlink so that when
+	# we build a 2nd stage cross-compiler, gcc finds the target
+	# system headers correctly.  See gcc/doc/gccinstall.info
+	if is_crosscompile ; then
+		dosym usr/include /usr/${CTARGET}/sys-include
+		if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+			newbin utils/ldconfig.host ${CTARGET}-ldconfig
+			newbin utils/ldd.host ${CTARGET}-ldd
+		fi
+		return 0
+	fi
+
+	emake DESTDIR="${D}" install_utils
+	dobin extra/scripts/getent
+	dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+	is_crosscompile && return 0
+
+	if [ ! -e "${ROOT}"/etc/TZ ] ; then
+		ewarn "Please remember to set your timezone in /etc/TZ"
+		mkdir -p "${ROOT}"/etc
+		echo "UTC" > "${ROOT}"/etc/TZ
+	fi
+	[ "${ROOT}" != "/" ] && return 0
+	# update cache before reloading init
+	ldconfig
+	# reload init ...
+	/sbin/telinit U 2>/dev/null
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/uclibc-ng/, sys-libs/uclibc-ng/files/
@ 2016-10-01 10:39 Anthony G. Basile
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony G. Basile @ 2016-10-01 10:39 UTC (permalink / raw
  To: gentoo-commits

commit:     ea4599c4074aaaa31a461bfd452f7b3a1a790d0d
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  1 10:39:24 2016 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Oct  1 10:39:24 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea4599c4

sys-libs/uclibc-ng: version bump to 1.0.18

Package-Manager: portage-2.2.28

 sys-libs/uclibc-ng/Manifest                               |  1 +
 sys-libs/uclibc-ng/files/uclibc-compat-r1.patch           | 15 +++++++++++++++
 .../{uclibc-ng-9999.ebuild => uclibc-ng-1.0.18.ebuild}    |  2 +-
 sys-libs/uclibc-ng/uclibc-ng-9999.ebuild                  |  2 +-
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/sys-libs/uclibc-ng/Manifest b/sys-libs/uclibc-ng/Manifest
index e8baa7e..2bf9152 100644
--- a/sys-libs/uclibc-ng/Manifest
+++ b/sys-libs/uclibc-ng/Manifest
@@ -1,2 +1,3 @@
 DIST uClibc-ng-1.0.16.tar.bz2 2769238 SHA256 f0ded5cb1ff7aac670ca9df931fc820648d91b27085a3efecc1b7f06d65f57f6 SHA512 05110f0b6651862f16b01d1b45d59258b93686a7635815f9e050ab6b8f0eb14581782c95f305649d62aa80e78060865620a5306a657ea7e9ac396c68d61347cb WHIRLPOOL d79830b46d4bcb2f19917da936a35443da95728c25a050e5a313f6a374669be8c29d5df12a6e9ac5efc65416a0206672a70c7b6d75cb3fdc4017220e32222bf3
 DIST uClibc-ng-1.0.17.tar.bz2 2769872 SHA256 fb4ab60698256d110bf30678a4cb27f14b3cf6eae60ed4ad21b2de5cac8c0bf3 SHA512 de6c7bf2168fe76ad0fa3a59c2c4264040383683b4774e846c97c20802d92dc478d3fcf271800f008c5b2ee06d3f50baac47bc5f28b43366e418c65b11d3bdb4 WHIRLPOOL 430fcd6992097bcd995936e36450617d0d9f57182542ffc42f0bdf021a2e7c0a5c9f8bce50c498567e9219379ef80a20e444f872429ab36dc43eda11134a03f6
+DIST uClibc-ng-1.0.18.tar.bz2 2754404 SHA256 71b2d401025c1235a061cfc80d394760fb37f3611566e105b39dd034f6ed001c SHA512 579ddf4470d684979ba00b71545e7c34ca48d0ad58767222835f95c1401dea5435b6a945390c992e027cc59f2b419a9d835081d08c9d2e6db8b8ddeeed24f5cd WHIRLPOOL 60cd9cc03668af81988d603edc637a8d3dba8276bc0d71e6e915263119c8cf629d293e2da73a57def5b07732cd37f35527b1bc7d3ef01ff09dd6fcc2cf7d3a59

diff --git a/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch b/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch
new file mode 100644
index 00000000..f47e0f9
--- /dev/null
+++ b/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch
@@ -0,0 +1,15 @@
+diff -Naur uClibc-ng-1.0.18.orig/ldso/ldso/Makefile.in uClibc-ng-1.0.18/ldso/ldso/Makefile.in
+--- uClibc-ng-1.0.18.orig/ldso/ldso/Makefile.in	2016-09-27 15:26:37.000000000 -0400
++++ uClibc-ng-1.0.18/ldso/ldso/Makefile.in	2016-10-01 06:31:44.106589780 -0400
+@@ -80,11 +80,6 @@
+ $(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
+ $(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
+ 	$(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
+-	# link for backward compatibility
+-	(cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME).so.0 )
+-ifeq ($(CONFIG_MIPS_NAN_2008),y)
+-	(cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME)-mipsn8.so.0)
+-endif
+ 
+ $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
+ 	$(Q)$(RM) $@

diff --git a/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.18.ebuild
similarity index 99%
copy from sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
copy to sys-libs/uclibc-ng/uclibc-ng-1.0.18.ebuild
index 2d3a099..8635e40 100644
--- a/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.18.ebuild
@@ -260,7 +260,7 @@ src_prepare() {
 	# ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
 	# where MAJOR_VERSION != 0 indicates the ABI verison.
 	# We want to get rid of this and just have ABI = 0.
-	eapply "${FILESDIR}"/uclibc-compat.patch
+	eapply "${FILESDIR}"/uclibc-compat-r1.patch
 
 	# We need to change the major.minor.sublevel of uclibc-ng.
 	# Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.

diff --git a/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild b/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
index 2d3a099..8635e40 100644
--- a/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
+++ b/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
@@ -260,7 +260,7 @@ src_prepare() {
 	# ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
 	# where MAJOR_VERSION != 0 indicates the ABI verison.
 	# We want to get rid of this and just have ABI = 0.
-	eapply "${FILESDIR}"/uclibc-compat.patch
+	eapply "${FILESDIR}"/uclibc-compat-r1.patch
 
 	# We need to change the major.minor.sublevel of uclibc-ng.
 	# Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/uclibc-ng/, sys-libs/uclibc-ng/files/
@ 2022-01-02 10:02 David Seifert
  0 siblings, 0 replies; 3+ messages in thread
From: David Seifert @ 2022-01-02 10:02 UTC (permalink / raw
  To: gentoo-commits

commit:     1416c5b0e64e173eeab9e4a9c7e1f051590fccbd
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  2 10:01:48 2022 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Jan  2 10:01:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1416c5b0

sys-libs/uclibc-ng: remove uclibc

Closes: https://github.com/gentoo/gentoo/pull/23608
Closes: https://bugs.gentoo.org/820905
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-libs/uclibc-ng/Manifest                        |   4 -
 sys-libs/uclibc-ng/files/uclibc-compat-r1.patch    |  15 -
 .../files/uclibc-ng-1.0.30-fix-ld.so.cache.patch   |  48 ---
 sys-libs/uclibc-ng/metadata.xml                    |  21 --
 sys-libs/uclibc-ng/uclibc-ng-1.0.30-r1.ebuild      | 403 ---------------------
 sys-libs/uclibc-ng/uclibc-ng-1.0.32.ebuild         | 402 --------------------
 sys-libs/uclibc-ng/uclibc-ng-1.0.33.ebuild         | 402 --------------------
 sys-libs/uclibc-ng/uclibc-ng-1.0.35.ebuild         | 402 --------------------
 sys-libs/uclibc-ng/uclibc-ng-9999.ebuild           | 402 --------------------
 9 files changed, 2099 deletions(-)

diff --git a/sys-libs/uclibc-ng/Manifest b/sys-libs/uclibc-ng/Manifest
deleted file mode 100644
index cd8ee877e8b9..000000000000
--- a/sys-libs/uclibc-ng/Manifest
+++ /dev/null
@@ -1,4 +0,0 @@
-DIST uClibc-ng-1.0.30.tar.bz2 2302796 BLAKE2B 21888dfe5a68f83b7ba56bb557ecc5aa19fd75cedc82f2ed48073f47655888719feb27943e0309f8101a24fd2fd9165af31d5679f21c00b12f27ebfccf354bac SHA512 ddd1d91dcfdf7be8471afecf13196563ad348c41e2fa8b63ae50b83f103cf8ed8d9f003b51a54a58db2935b84692b7c011a4779582f30610ede44cb583aae742
-DIST uClibc-ng-1.0.32.tar.bz2 2352471 BLAKE2B 887b67f7f03fc8610d8236a18f90584720a78bfc3a036cd6616453bea6e31140f5fd1dfd1d207cc5100854bf3e0c5cc1ca38fe6c31cf97b631892767ae23ec27 SHA512 1de5d4e99b94eeeada4233c53a95ea1b9e704ce1d4aa19ca9b17535c0328b2372ed93d24591c6ea5bfbc0b950aa575c18dcf6950fb04342924bb2b5f9ee235e8
-DIST uClibc-ng-1.0.33.tar.bz2 2399235 BLAKE2B c20fd767487b2f24a0af432a1366bfb6ddf02243495d2f1c3fa95db25551a8d6215be184608528ee544661ec2ddbc2f439299245ff3dff4597b376dc7a4658ec SHA512 cab89fb6a6e314c6cc8ac964604bdfae01d2e45dc71678bbb6a8985871f625ac680fec3ddc1cb29f6d15585b7fcb782eaf40fa6c89207cde2a04286c3d610169
-DIST uClibc-ng-1.0.35.tar.bz2 2396789 BLAKE2B b4e08ccb2bbf15d6a63e279f80792520edba78a9b95cde0432a2dbfc10d4830a621d71af97d4f2bbd867e6367182847c35b62f3c315dff85ecf0c680122238e0 SHA512 da2a1bc6e4a9ce1e3f436b9987fc5f6bb968e52f09508bef6588b409b861ece29d9c1411ffb88863de3a700cb19ad52a8d38596955d3b7bbfb3b0d3745daa25f

diff --git a/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch b/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch
deleted file mode 100644
index f47e0f9a0152..000000000000
--- a/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -Naur uClibc-ng-1.0.18.orig/ldso/ldso/Makefile.in uClibc-ng-1.0.18/ldso/ldso/Makefile.in
---- uClibc-ng-1.0.18.orig/ldso/ldso/Makefile.in	2016-09-27 15:26:37.000000000 -0400
-+++ uClibc-ng-1.0.18/ldso/ldso/Makefile.in	2016-10-01 06:31:44.106589780 -0400
-@@ -80,11 +80,6 @@
- $(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
- $(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
- 	$(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
--	# link for backward compatibility
--	(cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME).so.0 )
--ifeq ($(CONFIG_MIPS_NAN_2008),y)
--	(cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME)-mipsn8.so.0)
--endif
- 
- $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
- 	$(Q)$(RM) $@

diff --git a/sys-libs/uclibc-ng/files/uclibc-ng-1.0.30-fix-ld.so.cache.patch b/sys-libs/uclibc-ng/files/uclibc-ng-1.0.30-fix-ld.so.cache.patch
deleted file mode 100644
index 6b13e0890d25..000000000000
--- a/sys-libs/uclibc-ng/files/uclibc-ng-1.0.30-fix-ld.so.cache.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-commit 92d250d387e247029900c9074150f45866b29781
-Author: Waldemar Brodkorb <wbx@openadk.org>
-Date:   Sun Apr 29 19:34:11 2018 +0200
-
-    Revert "ldconfig: add glibc compatibility fix"
-    
-    This reverts commit 2a3bb4daf5778c5875674cd26a3c75b3d460a042.
-    
-    This is breaking ld.so.cache usage. Seen on Gentoo/amd64.
-    
-    Reported-by: "Anthony G. Basile" <basile@freeharbor.net>
-
-diff --git a/utils/ldconfig.c b/utils/ldconfig.c
-index 58939d689..e6b788118 100644
---- a/utils/ldconfig.c
-+++ b/utils/ldconfig.c
-@@ -184,9 +184,10 @@ static char *readsoname(char *name, FILE *infile, int expected_type,
- 		res = readsoname32(name, infile, expected_type, type);
- 	else {
- 		res = readsoname64(name, infile, expected_type, type);
--
--		// For 64-bit glibc compatibility
--		*type |= FLAG_X8664_LIB64;
-+#if 0
-+		/* relies on multilib support which we dont have ... */
-+		*type |= LIB_ELF64;
-+#endif
- 	}
- 
- 	return res;
-@@ -757,7 +758,7 @@ void cache_print(void)
- 
- 	for (fd = 0; fd < header->nlibs; fd++) {
- 		printf("\t%s ", strs + libent[fd].sooffset);
--		switch (libent[fd].flags & ~LIB_ELF64 & FLAG_TYPE_MASK) {
-+		switch (libent[fd].flags & ~LIB_ELF64) {
- 		case LIB_DLL:
- 			printf("(libc4)");
- 			break;
-@@ -770,7 +771,7 @@ void cache_print(void)
- 		case LIB_ELF_LIBC5:
- 		case LIB_ELF_LIBC6:
- 			printf("(libc%d%s)",
--			       (libent[fd].flags & ~LIB_ELF64 & FLAG_TYPE_MASK) + 3,
-+			       (libent[fd].flags & ~LIB_ELF64) + 3,
- 			       libent[fd].flags & LIB_ELF64 ? "/64" : "");
- 			break;
- 		default:

diff --git a/sys-libs/uclibc-ng/metadata.xml b/sys-libs/uclibc-ng/metadata.xml
deleted file mode 100644
index 6d1928f173d8..000000000000
--- a/sys-libs/uclibc-ng/metadata.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
-	<maintainer type="person">
-		<email>blueness@gentoo.org</email>
-		<name>Anthony G. Basile</name>
-	</maintainer>
-	<maintainer type="project">
-		<email>embedded@gentoo.org</email>
-		<name>Embedded Gentoo</name>
-	</maintainer>
-	<longdescription>
-	uClibc-ng is a small C library for developing embedded Linux systems. It is much
-	smaller than the GNU C Library, but nearly all applications supported by glibc
-	also work perfectly with uClibc-ng.
-	</longdescription>
-	<use>
-		<flag name="symlink-compat">Explicitly add sym links for libdl.so.0, libm.so.0, and
-		friends for backward compatibility with sys-libs/uclibc-ng-1.0.17 and earlier</flag>
-	</use>
-</pkgmetadata>

diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.30-r1.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.30-r1.ebuild
deleted file mode 100644
index 375d030fc404..000000000000
--- a/sys-libs/uclibc-ng/uclibc-ng-1.0.30-r1.ebuild
+++ /dev/null
@@ -1,403 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
-
-if [[ ${PV} == "9999" ]] ; then
-	EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
-	inherit git-r3
-	MY_P=uclibc-ng-${PV}
-else
-	MY_P=uClibc-ng-${PV}
-fi
-
-DESCRIPTION="C library for developing embedded Linux systems"
-HOMEPAGE="https://uclibc-ng.org/"
-if [[ ${PV} != "9999" ]] ; then
-	PATCH_VER=""
-	SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
-	KEYWORDS="-* arm"
-fi
-
-LICENSE="LGPL-2"
-SLOT="0"
-IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
-# tests fail due to unusual makefile
-RESTRICT="strip test"
-
-# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
-#    will delete the ld.so sym link prematurely and break the system. So we
-#    will hard block and give manual migration instructions.
-# 2) Currently uclibc and uclibc-ng's iconv are in bad shape.  We've been using
-#    the breakout library.  The disadvantage here is that we have to sprinkle
-#    LDFAGS=-liconv on build systems that need to link against libiconv.
-RDEPEND="
-	!!sys-libs/uclibc
-	iconv? ( dev-libs/libiconv )"
-
-S=${WORKDIR}/${MY_P}
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CHOST} == ${CTARGET} ]] ; then
-	if [[ ${CATEGORY} == cross-* ]] ; then
-		export CTARGET=${CATEGORY#cross-}
-	fi
-fi
-
-is_crosscompile() {
-	[[ ${CHOST} != ${CTARGET} ]]
-}
-
-alt_build_kprefix() {
-	if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
-		echo /usr/include
-	else
-		echo /usr/${CTARGET}/usr/include
-	fi
-}
-
-just_headers() {
-	use headers-only && is_crosscompile
-}
-
-uclibc_endian() {
-	# XXX: this wont work for a toolchain which is bi-endian, but we
-	#      dont have any such thing at the moment, so not a big deal
-	touch "${T}"/endian.s
-	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
-	case $(file "${T}"/endian.o) in
-		*" MSB "*) echo "BIG";;
-		*" LSB "*) echo "LITTLE";;
-		*)         echo "NFC";;
-	esac
-	rm -f "${T}"/endian.{s,o}
-}
-
-kconfig_q_opt() {
-	local flag=$1; shift
-	case ${flag} in
-		y|n) ;;
-		*) flag=$(usex ${flag} y n) ;;
-	esac
-
-	local var="defs_${flag}"
-	eval "${var}+=( $* )"
-}
-
-get_opt() {
-	(
-	unset ${1}
-	. ${2:-"${S}"/.config}
-	echo ${!1}
-	)
-}
-
-make_oldconfig() {
-	yes "" 2>/dev/null | emake -s oldconfig >/dev/null
-}
-
-make_config() {
-	restore_config .config
-	if [ -f .config ]; then
-		make_oldconfig
-		return 0
-	else
-		ewarn "Could not locate user configfile, so we will save a default one"
-	fi
-
-	emake ARCH=$1 defconfig >/dev/null
-
-	local defs_{y,n}
-
-	# These are forced off
-	defs_n=(
-		DOASSERTS
-		DODEBUG_PT
-		HAS_NO_THREADS
-		PROPOLICE_BLOCK_ABRT
-		SSP_QUICK_CANARY
-		SUPPORT_LD_DEBUG_EARLY
-		UCLIBC_HAS_CTYPE_UNSAFE
-		UCLIBC_HAS_LOCALE
-		LDSO_SAFE_RUNPATH
-	)
-
-	# These are forced on
-	defs_y=(
-		DO_C99_MATH
-		DO_XSI_MATH
-		FORCE_SHAREABLE_TEXT_SEGMENTS
-		LDSO_GNU_HASH_SUPPORT
-		LDSO_PRELOAD_FILE_SUPPORT
-		LDSO_RUNPATH
-		LDSO_RUNPATH_OF_EXECUTABLE
-		LDSO_STANDALONE_SUPPORT
-		PROPOLICE_BLOCK_SEGV
-		PTHREADS_DEBUG_SUPPORT
-		UCLIBC_HAS_ARC4RANDOM
-		UCLIBC_HAS_BACKTRACE
-		UCLIBC_HAS_BSD_RES_CLOSE
-		UCLIBC_HAS_CONTEXT_FUNCS
-		UCLIBC_HAS_CTYPE_CHECKED
-		UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
-		UCLIBC_HAS_FENV
-		UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
-		UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
-		UCLIBC_HAS_FOPEN_LARGEFILE_MODE
-		UCLIBC_HAS_FTS
-		UCLIBC_HAS_FTW
-		UCLIBC_HAS_GETPT
-		UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
-		UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
-		UCLIBC_HAS_GNU_GLOB
-		UCLIBC_HAS_HEXADECIMAL_FLOATS
-		UCLIBC_HAS_LIBUTIL
-		UCLIBC_HAS_NFTW
-		UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
-		UCLIBC_HAS_PRINTF_M_SPEC
-		UCLIBC_HAS_PROGRAM_INVOCATION_NAME
-		UCLIBC_HAS_RESOLVER_SUPPORT
-		UCLIBC_HAS_SHA256_CRYPT_IMPL
-		UCLIBC_HAS_SHA512_CRYPT_IMPL
-		UCLIBC_HAS_SSP
-		UCLIBC_HAS_STUBS
-		UCLIBC_HAS_SYS_ERRLIST
-		UCLIBC_HAS_SYS_SIGLIST
-		UCLIBC_HAS_THREADS_NATIVE
-		UCLIBC_HAS_TZ_FILE_READ_MANY
-		UCLIBC_HAS_UTMP
-		UCLIBC_HAS_UTMPX
-		UCLIBC_HAS_WCHAR
-		UCLIBC_HAS_WORDEXP
-		UCLIBC_NTP_LEGACY
-		UCLIBC_SUPPORT_AI_ADDRCONFIG
-		UCLIBC_SUSV2_LEGACY
-		UCLIBC_SUSV3_LEGACY
-		UCLIBC_SUSV3_LEGACY_MACROS
-		UCLIBC_SUSV4_LEGACY
-		UCLIBC_USE_NETLINK
-	)
-
-	sed -i -e '/ARCH_.*_ENDIAN/d' .config
-	kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
-
-	kconfig_q_opt debug DODEBUG
-	kconfig_q_opt debug SUPPORT_LD_DEBUG
-	kconfig_q_opt debug UCLIBC_HAS_PROFILING
-
-	kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
-
-	kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
-	kconfig_q_opt hardened UCLIBC_BUILD_NOW
-	kconfig_q_opt hardened UCLIBC_BUILD_PIE
-	kconfig_q_opt hardened UCLIBC_BUILD_RELRO
-	kconfig_q_opt hardened UCLIBC_BUILD_SSP
-
-	local count def
-	for count in 1 2 ; do
-		# Run twice as some config opts depend on others being enabled first.
-		for def in ${defs_y[@]} ; do
-			sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
-		done
-		for def in ${defs_n[@]} ; do
-			sed -i -e "s|${def}=y|# ${def} is not set|g" .config
-		done
-		make_oldconfig
-	done
-
-	einfo "Enabled options:"
-	for def in ${defs_y[@]} ; do
-		einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
-	done
-	einfo "Disabled options:"
-	for def in ${defs_n[@]} ; do
-		einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
-	done
-
-	# setup build and run paths
-	sed -i \
-		-e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
-		-e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
-		-e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
-		-e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
-		-e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
-		-e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
-		.config || die
-
-	make_oldconfig
-}
-
-pkg_setup() {
-	# Make sure our CHOST is a uclibc toolchain for native compiling
-	if [[ ${CHOST} == ${CTARGET} ]]; then
-		case ${CHOST} in
-			*-uclinux*|*-uclibc*) ;;
-			*) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
-		esac
-	fi
-
-	# uClibc-ng doesn't carry old Linux threads, and since we force
-	# threading our only choice is NPTL which requires i486 and later.
-	[[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
-}
-
-src_prepare() {
-	local version subversion extraversion
-
-	# uclibc-ng tries to create a two sym link with ld.so,
-	# ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
-	# where MAJOR_VERSION != 0 indicates the ABI verison.
-	# We want to get rid of this and just have ABI = 0.
-	eapply "${FILESDIR}"/uclibc-compat-r1.patch
-
-	# Critical fix for ld.so.cache
-	eapply "${FILESDIR}"/${P}-fix-ld.so.cache.patch
-
-	# We need to change the major.minor.sublevel of uclibc-ng.
-	# Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
-	# If we really want the ABI bump, we'll have to hack the gcc
-	# spec file and change the '*link:' rule.
-	version=( $(get_version_components) )
-	if [[ -z ${version[1]} ]]; then
-		subversion=0
-		extraversion=0
-	else
-		subversion=${version[1]}
-		if [[ -z ${version[2]} ]]; then
-			extraversion=0
-		else
-			extraversion=.${version[2]}
-		fi
-	fi
-
-	sed -i \
-		-e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
-		-e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
-		-e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
-		-e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
-		Rules.mak || die
-
-	eapply_user
-}
-
-src_configure() {
-	# Map our toolchain arch name to the name expected by uClibc-ng.
-	local target=$(tc-arch)
-	case ${target} in
-		amd64) target="x86_64";;
-		arm)   target="arm";;
-		mips)  target="mips";;
-		ppc)   target="powerpc";;
-		x86)   target="i386";;
-	esac
-
-	# Do arch specific configuration by changing the defaults in
-	# extra/Configs/Config.<arch>.  If these are not overridden
-	# by an save .config, they will be selected by default.
-
-	# For i386, i486, i586 and i686
-	local cpu
-	if [[ ${target} == "i386" ]]; then
-		[[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
-		sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
-			extra/Configs/Config.i386 || die
-	fi
-
-	# For arm
-	if [[ ${target} == "arm" ]]; then
-		sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
-	fi
-
-	# We set HOSTCC to the proper tuple rather than just 'gcc'
-	sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
-
-	make_config ${target}
-
-	einfo
-	einfo "Runtime Prefix: /"
-	einfo "Devel Prefix:   /usr"
-	einfo "Kernel Prefix:  $(alt_build_kprefix)"
-	einfo "CBUILD:         ${CBUILD}"
-	einfo "CHOST:          ${CHOST}"
-	einfo "CTARGET:        ${CTARGET}"
-	einfo "ABI:            ${ABI}"
-	einfo "ENDIAN:         $(uclibc_endian)"
-	einfo
-}
-
-src_compile() {
-	emake headers
-	just_headers && return 0
-
-	emake
-	if is_crosscompile ; then
-		emake -C utils hostutils
-	else
-		emake utils
-	fi
-}
-
-src_test() {
-	is_crosscompile && return 0
-
-	# assert test fails on pax/grsec enabled kernels
-	# normal vfork test fails in sandbox (both glibc/uclibc)
-	emake UCLIBC_ONLY=1 check
-}
-
-src_install() {
-	local sysroot=${D}
-	is_crosscompile && sysroot+="/usr/${CTARGET}"
-
-	local target="install"
-	just_headers && target="install_headers"
-	emake DESTDIR="${sysroot}" ${target}
-
-	save_config .config
-
-	# remove files coming from kernel-headers
-	rm -rf "${sysroot}"/usr/include/{linux,asm*}
-
-	# Make sure we install the sys-include symlink so that when
-	# we build a 2nd stage cross-compiler, gcc finds the target
-	# system headers correctly.  See gcc/doc/gccinstall.info
-	if is_crosscompile ; then
-		dosym usr/include /usr/${CTARGET}/sys-include
-		if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
-			newbin utils/ldconfig.host ${CTARGET}-ldconfig
-			newbin utils/ldd.host ${CTARGET}-ldd
-		fi
-		return 0
-	fi
-
-	if use symlink-compat; then
-		dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
-	fi
-
-	emake DESTDIR="${D}" install_utils
-	dobin extra/scripts/getent
-	dodoc README docs/*.txt
-}
-
-pkg_postinst() {
-	is_crosscompile && return 0
-
-	if [ ! -e "${ROOT}"/etc/TZ ] ; then
-		ewarn "Please remember to set your timezone in /etc/TZ"
-		mkdir -p "${ROOT}"/etc
-		echo "UTC" > "${ROOT}"/etc/TZ
-	fi
-	[ "${ROOT}" != "/" ] && return 0
-	# update cache before reloading init
-	ldconfig
-}

diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.32.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.32.ebuild
deleted file mode 100644
index fffc7f103fb8..000000000000
--- a/sys-libs/uclibc-ng/uclibc-ng-1.0.32.ebuild
+++ /dev/null
@@ -1,402 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit flag-o-matic multilib savedconfig toolchain-funcs
-
-if [[ ${PV} == "9999" ]] ; then
-	EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
-	inherit git-r3
-	MY_P=uclibc-ng-${PV}
-else
-	MY_P=uClibc-ng-${PV}
-fi
-
-DESCRIPTION="C library for developing embedded Linux systems"
-HOMEPAGE="https://uclibc-ng.org/"
-if [[ ${PV} != "9999" ]] ; then
-	PATCH_VER=""
-	SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
-	KEYWORDS="-* amd64 ~mips ppc x86"
-fi
-
-LICENSE="LGPL-2"
-SLOT="0"
-IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
-# tests fail due to unusual makefile
-RESTRICT="strip test"
-
-# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
-#    will delete the ld.so sym link prematurely and break the system. So we
-#    will hard block and give manual migration instructions.
-# 2) Currently uclibc and uclibc-ng's iconv are in bad shape.  We've been using
-#    the breakout library.  The disadvantage here is that we have to sprinkle
-#    LDFAGS=-liconv on build systems that need to link against libiconv.
-RDEPEND="
-	!!sys-libs/uclibc
-	iconv? ( dev-libs/libiconv )"
-
-S=${WORKDIR}/${MY_P}
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CHOST} == ${CTARGET} ]] ; then
-	if [[ ${CATEGORY} == cross-* ]] ; then
-		export CTARGET=${CATEGORY#cross-}
-	fi
-fi
-
-is_crosscompile() {
-	[[ ${CHOST} != ${CTARGET} ]]
-}
-
-alt_build_kprefix() {
-	if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
-		echo /usr/include
-	else
-		echo /usr/${CTARGET}/usr/include
-	fi
-}
-
-just_headers() {
-	use headers-only && is_crosscompile
-}
-
-uclibc_endian() {
-	# XXX: this wont work for a toolchain which is bi-endian, but we
-	#      dont have any such thing at the moment, so not a big deal
-	touch "${T}"/endian.s
-	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
-	case $(file "${T}"/endian.o) in
-		*" MSB "*) echo "BIG";;
-		*" LSB "*) echo "LITTLE";;
-		*)         echo "NFC";;
-	esac
-	rm -f "${T}"/endian.{s,o}
-}
-
-kconfig_q_opt() {
-	local flag=$1; shift
-	case ${flag} in
-		y|n) ;;
-		*) flag=$(usex ${flag} y n) ;;
-	esac
-
-	local var="defs_${flag}"
-	eval "${var}+=( $* )"
-}
-
-get_opt() {
-	(
-	unset ${1}
-	. ${2:-"${S}"/.config}
-	echo ${!1}
-	)
-}
-
-make_oldconfig() {
-	yes "" 2>/dev/null | emake -s oldconfig >/dev/null
-}
-
-make_config() {
-	restore_config .config
-	if [ -f .config ]; then
-		make_oldconfig
-		return 0
-	else
-		ewarn "Could not locate user configfile, so we will save a default one"
-	fi
-
-	emake ARCH=$1 defconfig >/dev/null
-
-	local defs_{y,n}
-
-	# These are forced off
-	defs_n=(
-		DOASSERTS
-		DODEBUG_PT
-		HAS_NO_THREADS
-		PROPOLICE_BLOCK_ABRT
-		SSP_QUICK_CANARY
-		SUPPORT_LD_DEBUG_EARLY
-		UCLIBC_HAS_CTYPE_UNSAFE
-		UCLIBC_HAS_LOCALE
-		LDSO_SAFE_RUNPATH
-	)
-
-	# These are forced on
-	defs_y=(
-		DO_C99_MATH
-		DO_XSI_MATH
-		FORCE_SHAREABLE_TEXT_SEGMENTS
-		LDSO_GNU_HASH_SUPPORT
-		LDSO_PRELOAD_FILE_SUPPORT
-		LDSO_RUNPATH
-		LDSO_RUNPATH_OF_EXECUTABLE
-		LDSO_STANDALONE_SUPPORT
-		PROPOLICE_BLOCK_SEGV
-		PTHREADS_DEBUG_SUPPORT
-		UCLIBC_HAS_ARC4RANDOM
-		UCLIBC_HAS_BACKTRACE
-		UCLIBC_HAS_BSD_RES_CLOSE
-		UCLIBC_HAS_CONTEXT_FUNCS
-		UCLIBC_HAS_CTYPE_CHECKED
-		UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
-		UCLIBC_HAS_FENV
-		UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
-		UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
-		UCLIBC_HAS_FOPEN_LARGEFILE_MODE
-		UCLIBC_HAS_FTS
-		UCLIBC_HAS_FTW
-		UCLIBC_HAS_GETPT
-		UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
-		UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
-		UCLIBC_HAS_GNU_GLOB
-		UCLIBC_HAS_HEXADECIMAL_FLOATS
-		UCLIBC_HAS_LIBUTIL
-		UCLIBC_HAS_NFTW
-		UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
-		UCLIBC_HAS_PRINTF_M_SPEC
-		UCLIBC_HAS_PROGRAM_INVOCATION_NAME
-		UCLIBC_HAS_RESOLVER_SUPPORT
-		UCLIBC_HAS_SHA256_CRYPT_IMPL
-		UCLIBC_HAS_SHA512_CRYPT_IMPL
-		UCLIBC_HAS_SSP
-		UCLIBC_HAS_STUBS
-		UCLIBC_HAS_SYS_ERRLIST
-		UCLIBC_HAS_SYS_SIGLIST
-		UCLIBC_HAS_THREADS_NATIVE
-		UCLIBC_HAS_TZ_FILE_READ_MANY
-		UCLIBC_HAS_UTMP
-		UCLIBC_HAS_UTMPX
-		UCLIBC_HAS_WCHAR
-		UCLIBC_HAS_WORDEXP
-		UCLIBC_NTP_LEGACY
-		UCLIBC_SUPPORT_AI_ADDRCONFIG
-		UCLIBC_SUSV2_LEGACY
-		UCLIBC_SUSV3_LEGACY
-		UCLIBC_SUSV3_LEGACY_MACROS
-		UCLIBC_SUSV4_LEGACY
-		UCLIBC_USE_NETLINK
-	)
-
-	sed -i -e '/ARCH_.*_ENDIAN/d' .config
-	kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
-
-	kconfig_q_opt debug DODEBUG
-	kconfig_q_opt debug SUPPORT_LD_DEBUG
-	kconfig_q_opt debug UCLIBC_HAS_PROFILING
-
-	kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
-
-	kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
-	kconfig_q_opt hardened UCLIBC_BUILD_NOW
-	kconfig_q_opt hardened UCLIBC_BUILD_PIE
-	kconfig_q_opt hardened UCLIBC_BUILD_RELRO
-	kconfig_q_opt hardened UCLIBC_BUILD_SSP
-
-	local count def
-	for count in 1 2 ; do
-		# Run twice as some config opts depend on others being enabled first.
-		for def in ${defs_y[@]} ; do
-			sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
-		done
-		for def in ${defs_n[@]} ; do
-			sed -i -e "s|${def}=y|# ${def} is not set|g" .config
-		done
-		make_oldconfig
-	done
-
-	einfo "Enabled options:"
-	for def in ${defs_y[@]} ; do
-		einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
-	done
-	einfo "Disabled options:"
-	for def in ${defs_n[@]} ; do
-		einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
-	done
-
-	# setup build and run paths
-	sed -i \
-		-e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
-		-e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
-		-e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
-		-e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
-		-e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
-		-e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
-		.config || die
-
-	make_oldconfig
-}
-
-pkg_setup() {
-	# Make sure our CHOST is a uclibc toolchain for native compiling
-	if [[ ${CHOST} == ${CTARGET} ]]; then
-		case ${CHOST} in
-			*-uclinux*|*-uclibc*) ;;
-			*) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
-		esac
-	fi
-
-	# uClibc-ng doesn't carry old Linux threads, and since we force
-	# threading our only choice is NPTL which requires i486 and later.
-	[[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
-}
-
-src_prepare() {
-	local version subversion extraversion
-
-	# uclibc-ng tries to create a two sym link with ld.so,
-	# ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
-	# where MAJOR_VERSION != 0 indicates the ABI verison.
-	# We want to get rid of this and just have ABI = 0.
-	eapply "${FILESDIR}"/uclibc-compat-r1.patch
-
-	# We need to change the major.minor.sublevel of uclibc-ng.
-	# Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
-	# If we really want the ABI bump, we'll have to hack the gcc
-	# spec file and change the '*link:' rule.
-	version_0=$(ver_cut 1)
-	version_1=$(ver_cut 2)
-	version_2=$(ver_cut 3)
-	if [[ -z ${version_1} ]]; then
-		subversion=0
-		extraversion=0
-	else
-		subversion=${version_1}
-		if [[ -z ${version_2} ]]; then
-			extraversion=0
-		else
-			extraversion=.${version_2}
-		fi
-	fi
-
-	sed -i \
-		-e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
-		-e "/^MINOR_VERSION/s|:=.*|:= ${version_0}|" \
-		-e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
-		-e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
-		Rules.mak || die
-
-	eapply_user
-}
-
-src_configure() {
-	# Map our toolchain arch name to the name expected by uClibc-ng.
-	local target=$(tc-arch)
-	case ${target} in
-		amd64) target="x86_64";;
-		arm)   target="arm";;
-		mips)  target="mips";;
-		ppc)   target="powerpc";;
-		x86)   target="i386";;
-	esac
-
-	# Do arch specific configuration by changing the defaults in
-	# extra/Configs/Config.<arch>.  If these are not overridden
-	# by an save .config, they will be selected by default.
-
-	# For i386, i486, i586 and i686
-	local cpu
-	if [[ ${target} == "i386" ]]; then
-		[[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
-		sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
-			extra/Configs/Config.i386 || die
-	fi
-
-	# For arm
-	if [[ ${target} == "arm" ]]; then
-		sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
-	fi
-
-	# We set HOSTCC to the proper tuple rather than just 'gcc'
-	sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
-
-	make_config ${target}
-
-	einfo
-	einfo "Runtime Prefix: /"
-	einfo "Devel Prefix:   /usr"
-	einfo "Kernel Prefix:  $(alt_build_kprefix)"
-	einfo "CBUILD:         ${CBUILD}"
-	einfo "CHOST:          ${CHOST}"
-	einfo "CTARGET:        ${CTARGET}"
-	einfo "ABI:            ${ABI}"
-	einfo "ENDIAN:         $(uclibc_endian)"
-	einfo
-}
-
-src_compile() {
-	emake headers
-	just_headers && return 0
-
-	emake
-	if is_crosscompile ; then
-		emake -C utils hostutils
-	else
-		emake utils
-	fi
-}
-
-src_test() {
-	is_crosscompile && return 0
-
-	# assert test fails on pax/grsec enabled kernels
-	# normal vfork test fails in sandbox (both glibc/uclibc)
-	emake UCLIBC_ONLY=1 check
-}
-
-src_install() {
-	local sysroot=${D}
-	is_crosscompile && sysroot+="/usr/${CTARGET}"
-
-	local target="install"
-	just_headers && target="install_headers"
-	emake DESTDIR="${sysroot}" ${target}
-
-	save_config .config
-
-	# remove files coming from kernel-headers
-	rm -rf "${sysroot}"/usr/include/{linux,asm*}
-
-	# Make sure we install the sys-include symlink so that when
-	# we build a 2nd stage cross-compiler, gcc finds the target
-	# system headers correctly.  See gcc/doc/gccinstall.info
-	if is_crosscompile ; then
-		dosym usr/include /usr/${CTARGET}/sys-include
-		if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
-			newbin utils/ldconfig.host ${CTARGET}-ldconfig
-			newbin utils/ldd.host ${CTARGET}-ldd
-		fi
-		return 0
-	fi
-
-	if use symlink-compat; then
-		dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
-	fi
-
-	emake DESTDIR="${D}" install_utils
-	dobin extra/scripts/getent
-	dodoc README docs/*.txt
-}
-
-pkg_postinst() {
-	is_crosscompile && return 0
-
-	if [ ! -e "${ROOT}"/etc/TZ ] ; then
-		ewarn "Please remember to set your timezone in /etc/TZ"
-		mkdir -p "${ROOT}"/etc
-		echo "UTC" > "${ROOT}"/etc/TZ
-	fi
-	[ "${ROOT}" != "/" ] && return 0
-	# update cache before reloading init
-	ldconfig
-}

diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.33.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.33.ebuild
deleted file mode 100644
index 4dd7db70cc0f..000000000000
--- a/sys-libs/uclibc-ng/uclibc-ng-1.0.33.ebuild
+++ /dev/null
@@ -1,402 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit flag-o-matic multilib savedconfig toolchain-funcs
-
-if [[ ${PV} == "9999" ]] ; then
-	EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
-	inherit git-r3
-	MY_P=uclibc-ng-${PV}
-else
-	MY_P=uClibc-ng-${PV}
-fi
-
-DESCRIPTION="C library for developing embedded Linux systems"
-HOMEPAGE="https://uclibc-ng.org/"
-if [[ ${PV} != "9999" ]] ; then
-	PATCH_VER=""
-	SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
-	KEYWORDS="-* amd64 ~arm ~mips ~ppc x86"
-fi
-
-LICENSE="LGPL-2"
-SLOT="0"
-IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
-# tests fail due to unusual makefile
-RESTRICT="strip test"
-
-# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
-#    will delete the ld.so sym link prematurely and break the system. So we
-#    will hard block and give manual migration instructions.
-# 2) Currently uclibc and uclibc-ng's iconv are in bad shape.  We've been using
-#    the breakout library.  The disadvantage here is that we have to sprinkle
-#    LDFAGS=-liconv on build systems that need to link against libiconv.
-RDEPEND="
-	!!sys-libs/uclibc
-	iconv? ( dev-libs/libiconv )"
-
-S=${WORKDIR}/${MY_P}
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CHOST} == ${CTARGET} ]] ; then
-	if [[ ${CATEGORY} == cross-* ]] ; then
-		export CTARGET=${CATEGORY#cross-}
-	fi
-fi
-
-is_crosscompile() {
-	[[ ${CHOST} != ${CTARGET} ]]
-}
-
-alt_build_kprefix() {
-	if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
-		echo /usr/include
-	else
-		echo /usr/${CTARGET}/usr/include
-	fi
-}
-
-just_headers() {
-	use headers-only && is_crosscompile
-}
-
-uclibc_endian() {
-	# XXX: this wont work for a toolchain which is bi-endian, but we
-	#      dont have any such thing at the moment, so not a big deal
-	touch "${T}"/endian.s
-	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
-	case $(file "${T}"/endian.o) in
-		*" MSB "*) echo "BIG";;
-		*" LSB "*) echo "LITTLE";;
-		*)         echo "NFC";;
-	esac
-	rm -f "${T}"/endian.{s,o}
-}
-
-kconfig_q_opt() {
-	local flag=$1; shift
-	case ${flag} in
-		y|n) ;;
-		*) flag=$(usex ${flag} y n) ;;
-	esac
-
-	local var="defs_${flag}"
-	eval "${var}+=( $* )"
-}
-
-get_opt() {
-	(
-	unset ${1}
-	. ${2:-"${S}"/.config}
-	echo ${!1}
-	)
-}
-
-make_oldconfig() {
-	yes "" 2>/dev/null | emake -s oldconfig >/dev/null
-}
-
-make_config() {
-	restore_config .config
-	if [ -f .config ]; then
-		make_oldconfig
-		return 0
-	else
-		ewarn "Could not locate user configfile, so we will save a default one"
-	fi
-
-	emake ARCH=$1 defconfig >/dev/null
-
-	local defs_{y,n}
-
-	# These are forced off
-	defs_n=(
-		DOASSERTS
-		DODEBUG_PT
-		HAS_NO_THREADS
-		PROPOLICE_BLOCK_ABRT
-		SSP_QUICK_CANARY
-		SUPPORT_LD_DEBUG_EARLY
-		UCLIBC_HAS_CTYPE_UNSAFE
-		UCLIBC_HAS_LOCALE
-		LDSO_SAFE_RUNPATH
-	)
-
-	# These are forced on
-	defs_y=(
-		DO_C99_MATH
-		DO_XSI_MATH
-		FORCE_SHAREABLE_TEXT_SEGMENTS
-		LDSO_GNU_HASH_SUPPORT
-		LDSO_PRELOAD_FILE_SUPPORT
-		LDSO_RUNPATH
-		LDSO_RUNPATH_OF_EXECUTABLE
-		LDSO_STANDALONE_SUPPORT
-		PROPOLICE_BLOCK_SEGV
-		PTHREADS_DEBUG_SUPPORT
-		UCLIBC_HAS_ARC4RANDOM
-		UCLIBC_HAS_BACKTRACE
-		UCLIBC_HAS_BSD_RES_CLOSE
-		UCLIBC_HAS_CONTEXT_FUNCS
-		UCLIBC_HAS_CTYPE_CHECKED
-		UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
-		UCLIBC_HAS_FENV
-		UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
-		UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
-		UCLIBC_HAS_FOPEN_LARGEFILE_MODE
-		UCLIBC_HAS_FTS
-		UCLIBC_HAS_FTW
-		UCLIBC_HAS_GETPT
-		UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
-		UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
-		UCLIBC_HAS_GNU_GLOB
-		UCLIBC_HAS_HEXADECIMAL_FLOATS
-		UCLIBC_HAS_LIBUTIL
-		UCLIBC_HAS_NFTW
-		UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
-		UCLIBC_HAS_PRINTF_M_SPEC
-		UCLIBC_HAS_PROGRAM_INVOCATION_NAME
-		UCLIBC_HAS_RESOLVER_SUPPORT
-		UCLIBC_HAS_SHA256_CRYPT_IMPL
-		UCLIBC_HAS_SHA512_CRYPT_IMPL
-		UCLIBC_HAS_SSP
-		UCLIBC_HAS_STUBS
-		UCLIBC_HAS_SYS_ERRLIST
-		UCLIBC_HAS_SYS_SIGLIST
-		UCLIBC_HAS_THREADS_NATIVE
-		UCLIBC_HAS_TZ_FILE_READ_MANY
-		UCLIBC_HAS_UTMP
-		UCLIBC_HAS_UTMPX
-		UCLIBC_HAS_WCHAR
-		UCLIBC_HAS_WORDEXP
-		UCLIBC_NTP_LEGACY
-		UCLIBC_SUPPORT_AI_ADDRCONFIG
-		UCLIBC_SUSV2_LEGACY
-		UCLIBC_SUSV3_LEGACY
-		UCLIBC_SUSV3_LEGACY_MACROS
-		UCLIBC_SUSV4_LEGACY
-		UCLIBC_USE_NETLINK
-	)
-
-	sed -i -e '/ARCH_.*_ENDIAN/d' .config
-	kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
-
-	kconfig_q_opt debug DODEBUG
-	kconfig_q_opt debug SUPPORT_LD_DEBUG
-	kconfig_q_opt debug UCLIBC_HAS_PROFILING
-
-	kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
-
-	kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
-	kconfig_q_opt hardened UCLIBC_BUILD_NOW
-	kconfig_q_opt hardened UCLIBC_BUILD_PIE
-	kconfig_q_opt hardened UCLIBC_BUILD_RELRO
-	kconfig_q_opt hardened UCLIBC_BUILD_SSP
-
-	local count def
-	for count in 1 2 ; do
-		# Run twice as some config opts depend on others being enabled first.
-		for def in ${defs_y[@]} ; do
-			sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
-		done
-		for def in ${defs_n[@]} ; do
-			sed -i -e "s|${def}=y|# ${def} is not set|g" .config
-		done
-		make_oldconfig
-	done
-
-	einfo "Enabled options:"
-	for def in ${defs_y[@]} ; do
-		einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
-	done
-	einfo "Disabled options:"
-	for def in ${defs_n[@]} ; do
-		einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
-	done
-
-	# setup build and run paths
-	sed -i \
-		-e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
-		-e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
-		-e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
-		-e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
-		-e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
-		-e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
-		.config || die
-
-	make_oldconfig
-}
-
-pkg_setup() {
-	# Make sure our CHOST is a uclibc toolchain for native compiling
-	if [[ ${CHOST} == ${CTARGET} ]]; then
-		case ${CHOST} in
-			*-uclinux*|*-uclibc*) ;;
-			*) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
-		esac
-	fi
-
-	# uClibc-ng doesn't carry old Linux threads, and since we force
-	# threading our only choice is NPTL which requires i486 and later.
-	[[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
-}
-
-src_prepare() {
-	local version subversion extraversion
-
-	# uclibc-ng tries to create a two sym link with ld.so,
-	# ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
-	# where MAJOR_VERSION != 0 indicates the ABI verison.
-	# We want to get rid of this and just have ABI = 0.
-	eapply "${FILESDIR}"/uclibc-compat-r1.patch
-
-	# We need to change the major.minor.sublevel of uclibc-ng.
-	# Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
-	# If we really want the ABI bump, we'll have to hack the gcc
-	# spec file and change the '*link:' rule.
-	version_0=$(ver_cut 1)
-	version_1=$(ver_cut 2)
-	version_2=$(ver_cut 3)
-	if [[ -z ${version_1} ]]; then
-		subversion=0
-		extraversion=0
-	else
-		subversion=${version_1}
-		if [[ -z ${version_2} ]]; then
-			extraversion=0
-		else
-			extraversion=.${version_2}
-		fi
-	fi
-
-	sed -i \
-		-e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
-		-e "/^MINOR_VERSION/s|:=.*|:= ${version_0}|" \
-		-e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
-		-e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
-		Rules.mak || die
-
-	eapply_user
-}
-
-src_configure() {
-	# Map our toolchain arch name to the name expected by uClibc-ng.
-	local target=$(tc-arch)
-	case ${target} in
-		amd64) target="x86_64";;
-		arm)   target="arm";;
-		mips)  target="mips";;
-		ppc)   target="powerpc";;
-		x86)   target="i386";;
-	esac
-
-	# Do arch specific configuration by changing the defaults in
-	# extra/Configs/Config.<arch>.  If these are not overridden
-	# by an save .config, they will be selected by default.
-
-	# For i386, i486, i586 and i686
-	local cpu
-	if [[ ${target} == "i386" ]]; then
-		[[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
-		sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
-			extra/Configs/Config.i386 || die
-	fi
-
-	# For arm
-	if [[ ${target} == "arm" ]]; then
-		sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
-	fi
-
-	# We set HOSTCC to the proper tuple rather than just 'gcc'
-	sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
-
-	make_config ${target}
-
-	einfo
-	einfo "Runtime Prefix: /"
-	einfo "Devel Prefix:   /usr"
-	einfo "Kernel Prefix:  $(alt_build_kprefix)"
-	einfo "CBUILD:         ${CBUILD}"
-	einfo "CHOST:          ${CHOST}"
-	einfo "CTARGET:        ${CTARGET}"
-	einfo "ABI:            ${ABI}"
-	einfo "ENDIAN:         $(uclibc_endian)"
-	einfo
-}
-
-src_compile() {
-	emake headers
-	just_headers && return 0
-
-	emake
-	if is_crosscompile ; then
-		emake -C utils hostutils
-	else
-		emake utils
-	fi
-}
-
-src_test() {
-	is_crosscompile && return 0
-
-	# assert test fails on pax/grsec enabled kernels
-	# normal vfork test fails in sandbox (both glibc/uclibc)
-	emake UCLIBC_ONLY=1 check
-}
-
-src_install() {
-	local sysroot=${D}
-	is_crosscompile && sysroot+="/usr/${CTARGET}"
-
-	local target="install"
-	just_headers && target="install_headers"
-	emake DESTDIR="${sysroot}" ${target}
-
-	save_config .config
-
-	# remove files coming from kernel-headers
-	rm -rf "${sysroot}"/usr/include/{linux,asm*}
-
-	# Make sure we install the sys-include symlink so that when
-	# we build a 2nd stage cross-compiler, gcc finds the target
-	# system headers correctly.  See gcc/doc/gccinstall.info
-	if is_crosscompile ; then
-		dosym usr/include /usr/${CTARGET}/sys-include
-		if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
-			newbin utils/ldconfig.host ${CTARGET}-ldconfig
-			newbin utils/ldd.host ${CTARGET}-ldd
-		fi
-		return 0
-	fi
-
-	if use symlink-compat; then
-		dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
-	fi
-
-	emake DESTDIR="${D}" install_utils
-	dobin extra/scripts/getent
-	dodoc README docs/*.txt
-}
-
-pkg_postinst() {
-	is_crosscompile && return 0
-
-	if [ ! -e "${ROOT}"/etc/TZ ] ; then
-		ewarn "Please remember to set your timezone in /etc/TZ"
-		mkdir -p "${ROOT}"/etc
-		echo "UTC" > "${ROOT}"/etc/TZ
-	fi
-	[ "${ROOT}" != "/" ] && return 0
-	# update cache before reloading init
-	ldconfig
-}

diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.35.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.35.ebuild
deleted file mode 100644
index 5ef7e61a3a91..000000000000
--- a/sys-libs/uclibc-ng/uclibc-ng-1.0.35.ebuild
+++ /dev/null
@@ -1,402 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit flag-o-matic multilib savedconfig toolchain-funcs
-
-if [[ ${PV} == "9999" ]] ; then
-	EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
-	inherit git-r3
-	MY_P=uclibc-ng-${PV}
-else
-	MY_P=uClibc-ng-${PV}
-fi
-
-DESCRIPTION="C library for developing embedded Linux systems"
-HOMEPAGE="https://uclibc-ng.org/"
-if [[ ${PV} != "9999" ]] ; then
-	PATCH_VER=""
-	SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
-	KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
-fi
-
-LICENSE="LGPL-2"
-SLOT="0"
-IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
-# tests fail due to unusual makefile
-RESTRICT="strip test"
-
-# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
-#    will delete the ld.so sym link prematurely and break the system. So we
-#    will hard block and give manual migration instructions.
-# 2) Currently uclibc and uclibc-ng's iconv are in bad shape.  We've been using
-#    the breakout library.  The disadvantage here is that we have to sprinkle
-#    LDFAGS=-liconv on build systems that need to link against libiconv.
-RDEPEND="
-	!!sys-libs/uclibc
-	iconv? ( dev-libs/libiconv )"
-
-S=${WORKDIR}/${MY_P}
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CHOST} == ${CTARGET} ]] ; then
-	if [[ ${CATEGORY} == cross-* ]] ; then
-		export CTARGET=${CATEGORY#cross-}
-	fi
-fi
-
-is_crosscompile() {
-	[[ ${CHOST} != ${CTARGET} ]]
-}
-
-alt_build_kprefix() {
-	if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
-		echo /usr/include
-	else
-		echo /usr/${CTARGET}/usr/include
-	fi
-}
-
-just_headers() {
-	use headers-only && is_crosscompile
-}
-
-uclibc_endian() {
-	# XXX: this wont work for a toolchain which is bi-endian, but we
-	#      dont have any such thing at the moment, so not a big deal
-	touch "${T}"/endian.s
-	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
-	case $(file "${T}"/endian.o) in
-		*" MSB "*) echo "BIG";;
-		*" LSB "*) echo "LITTLE";;
-		*)         echo "NFC";;
-	esac
-	rm -f "${T}"/endian.{s,o}
-}
-
-kconfig_q_opt() {
-	local flag=$1; shift
-	case ${flag} in
-		y|n) ;;
-		*) flag=$(usex ${flag} y n) ;;
-	esac
-
-	local var="defs_${flag}"
-	eval "${var}+=( $* )"
-}
-
-get_opt() {
-	(
-	unset ${1}
-	. ${2:-"${S}"/.config}
-	echo ${!1}
-	)
-}
-
-make_oldconfig() {
-	yes "" 2>/dev/null | emake -s oldconfig >/dev/null
-}
-
-make_config() {
-	restore_config .config
-	if [ -f .config ]; then
-		make_oldconfig
-		return 0
-	else
-		ewarn "Could not locate user configfile, so we will save a default one"
-	fi
-
-	emake ARCH=$1 defconfig >/dev/null
-
-	local defs_{y,n}
-
-	# These are forced off
-	defs_n=(
-		DOASSERTS
-		DODEBUG_PT
-		HAS_NO_THREADS
-		PROPOLICE_BLOCK_ABRT
-		SSP_QUICK_CANARY
-		SUPPORT_LD_DEBUG_EARLY
-		UCLIBC_HAS_CTYPE_UNSAFE
-		UCLIBC_HAS_LOCALE
-		LDSO_SAFE_RUNPATH
-	)
-
-	# These are forced on
-	defs_y=(
-		DO_C99_MATH
-		DO_XSI_MATH
-		FORCE_SHAREABLE_TEXT_SEGMENTS
-		LDSO_GNU_HASH_SUPPORT
-		LDSO_PRELOAD_FILE_SUPPORT
-		LDSO_RUNPATH
-		LDSO_RUNPATH_OF_EXECUTABLE
-		LDSO_STANDALONE_SUPPORT
-		PROPOLICE_BLOCK_SEGV
-		PTHREADS_DEBUG_SUPPORT
-		UCLIBC_HAS_ARC4RANDOM
-		UCLIBC_HAS_BACKTRACE
-		UCLIBC_HAS_BSD_RES_CLOSE
-		UCLIBC_HAS_CONTEXT_FUNCS
-		UCLIBC_HAS_CTYPE_CHECKED
-		UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
-		UCLIBC_HAS_FENV
-		UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
-		UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
-		UCLIBC_HAS_FOPEN_LARGEFILE_MODE
-		UCLIBC_HAS_FTS
-		UCLIBC_HAS_FTW
-		UCLIBC_HAS_GETPT
-		UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
-		UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
-		UCLIBC_HAS_GNU_GLOB
-		UCLIBC_HAS_HEXADECIMAL_FLOATS
-		UCLIBC_HAS_LIBUTIL
-		UCLIBC_HAS_NFTW
-		UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
-		UCLIBC_HAS_PRINTF_M_SPEC
-		UCLIBC_HAS_PROGRAM_INVOCATION_NAME
-		UCLIBC_HAS_RESOLVER_SUPPORT
-		UCLIBC_HAS_SHA256_CRYPT_IMPL
-		UCLIBC_HAS_SHA512_CRYPT_IMPL
-		UCLIBC_HAS_SSP
-		UCLIBC_HAS_STUBS
-		UCLIBC_HAS_SYS_ERRLIST
-		UCLIBC_HAS_SYS_SIGLIST
-		UCLIBC_HAS_THREADS_NATIVE
-		UCLIBC_HAS_TZ_FILE_READ_MANY
-		UCLIBC_HAS_UTMP
-		UCLIBC_HAS_UTMPX
-		UCLIBC_HAS_WCHAR
-		UCLIBC_HAS_WORDEXP
-		UCLIBC_NTP_LEGACY
-		UCLIBC_SUPPORT_AI_ADDRCONFIG
-		UCLIBC_SUSV2_LEGACY
-		UCLIBC_SUSV3_LEGACY
-		UCLIBC_SUSV3_LEGACY_MACROS
-		UCLIBC_SUSV4_LEGACY
-		UCLIBC_USE_NETLINK
-	)
-
-	sed -i -e '/ARCH_.*_ENDIAN/d' .config
-	kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
-
-	kconfig_q_opt debug DODEBUG
-	kconfig_q_opt debug SUPPORT_LD_DEBUG
-	kconfig_q_opt debug UCLIBC_HAS_PROFILING
-
-	kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
-
-	kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
-	kconfig_q_opt hardened UCLIBC_BUILD_NOW
-	kconfig_q_opt hardened UCLIBC_BUILD_PIE
-	kconfig_q_opt hardened UCLIBC_BUILD_RELRO
-	kconfig_q_opt hardened UCLIBC_BUILD_SSP
-
-	local count def
-	for count in 1 2 ; do
-		# Run twice as some config opts depend on others being enabled first.
-		for def in ${defs_y[@]} ; do
-			sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
-		done
-		for def in ${defs_n[@]} ; do
-			sed -i -e "s|${def}=y|# ${def} is not set|g" .config
-		done
-		make_oldconfig
-	done
-
-	einfo "Enabled options:"
-	for def in ${defs_y[@]} ; do
-		einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
-	done
-	einfo "Disabled options:"
-	for def in ${defs_n[@]} ; do
-		einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
-	done
-
-	# setup build and run paths
-	sed -i \
-		-e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
-		-e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
-		-e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
-		-e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
-		-e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
-		-e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
-		.config || die
-
-	make_oldconfig
-}
-
-pkg_setup() {
-	# Make sure our CHOST is a uclibc toolchain for native compiling
-	if [[ ${CHOST} == ${CTARGET} ]]; then
-		case ${CHOST} in
-			*-uclinux*|*-uclibc*) ;;
-			*) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
-		esac
-	fi
-
-	# uClibc-ng doesn't carry old Linux threads, and since we force
-	# threading our only choice is NPTL which requires i486 and later.
-	[[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
-}
-
-src_prepare() {
-	local version subversion extraversion
-
-	# uclibc-ng tries to create a two sym link with ld.so,
-	# ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
-	# where MAJOR_VERSION != 0 indicates the ABI verison.
-	# We want to get rid of this and just have ABI = 0.
-	eapply "${FILESDIR}"/uclibc-compat-r1.patch
-
-	# We need to change the major.minor.sublevel of uclibc-ng.
-	# Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
-	# If we really want the ABI bump, we'll have to hack the gcc
-	# spec file and change the '*link:' rule.
-	version_0=$(ver_cut 1)
-	version_1=$(ver_cut 2)
-	version_2=$(ver_cut 3)
-	if [[ -z ${version_1} ]]; then
-		subversion=0
-		extraversion=0
-	else
-		subversion=${version_1}
-		if [[ -z ${version_2} ]]; then
-			extraversion=0
-		else
-			extraversion=.${version_2}
-		fi
-	fi
-
-	sed -i \
-		-e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
-		-e "/^MINOR_VERSION/s|:=.*|:= ${version_0}|" \
-		-e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
-		-e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
-		Rules.mak || die
-
-	eapply_user
-}
-
-src_configure() {
-	# Map our toolchain arch name to the name expected by uClibc-ng.
-	local target=$(tc-arch)
-	case ${target} in
-		amd64) target="x86_64";;
-		arm)   target="arm";;
-		mips)  target="mips";;
-		ppc)   target="powerpc";;
-		x86)   target="i386";;
-	esac
-
-	# Do arch specific configuration by changing the defaults in
-	# extra/Configs/Config.<arch>.  If these are not overridden
-	# by an save .config, they will be selected by default.
-
-	# For i386, i486, i586 and i686
-	local cpu
-	if [[ ${target} == "i386" ]]; then
-		[[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
-		sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
-			extra/Configs/Config.i386 || die
-	fi
-
-	# For arm
-	if [[ ${target} == "arm" ]]; then
-		sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
-	fi
-
-	# We set HOSTCC to the proper tuple rather than just 'gcc'
-	sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
-
-	make_config ${target}
-
-	einfo
-	einfo "Runtime Prefix: /"
-	einfo "Devel Prefix:   /usr"
-	einfo "Kernel Prefix:  $(alt_build_kprefix)"
-	einfo "CBUILD:         ${CBUILD}"
-	einfo "CHOST:          ${CHOST}"
-	einfo "CTARGET:        ${CTARGET}"
-	einfo "ABI:            ${ABI}"
-	einfo "ENDIAN:         $(uclibc_endian)"
-	einfo
-}
-
-src_compile() {
-	emake headers
-	just_headers && return 0
-
-	emake
-	if is_crosscompile ; then
-		emake -C utils hostutils
-	else
-		emake utils
-	fi
-}
-
-src_test() {
-	is_crosscompile && return 0
-
-	# assert test fails on pax/grsec enabled kernels
-	# normal vfork test fails in sandbox (both glibc/uclibc)
-	emake UCLIBC_ONLY=1 check
-}
-
-src_install() {
-	local sysroot=${D}
-	is_crosscompile && sysroot+="/usr/${CTARGET}"
-
-	local target="install"
-	just_headers && target="install_headers"
-	emake DESTDIR="${sysroot}" ${target}
-
-	save_config .config
-
-	# remove files coming from kernel-headers
-	rm -rf "${sysroot}"/usr/include/{linux,asm*}
-
-	# Make sure we install the sys-include symlink so that when
-	# we build a 2nd stage cross-compiler, gcc finds the target
-	# system headers correctly.  See gcc/doc/gccinstall.info
-	if is_crosscompile ; then
-		dosym usr/include /usr/${CTARGET}/sys-include
-		if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
-			newbin utils/ldconfig.host ${CTARGET}-ldconfig
-			newbin utils/ldd.host ${CTARGET}-ldd
-		fi
-		return 0
-	fi
-
-	if use symlink-compat; then
-		dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
-	fi
-
-	emake DESTDIR="${D}" install_utils
-	dobin extra/scripts/getent
-	dodoc README docs/*.txt
-}
-
-pkg_postinst() {
-	is_crosscompile && return 0
-
-	if [ ! -e "${ROOT}"/etc/TZ ] ; then
-		ewarn "Please remember to set your timezone in /etc/TZ"
-		mkdir -p "${ROOT}"/etc
-		echo "UTC" > "${ROOT}"/etc/TZ
-	fi
-	[ "${ROOT}" != "/" ] && return 0
-	# update cache before reloading init
-	ldconfig
-}

diff --git a/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild b/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
deleted file mode 100644
index 5ef7e61a3a91..000000000000
--- a/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
+++ /dev/null
@@ -1,402 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit flag-o-matic multilib savedconfig toolchain-funcs
-
-if [[ ${PV} == "9999" ]] ; then
-	EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
-	inherit git-r3
-	MY_P=uclibc-ng-${PV}
-else
-	MY_P=uClibc-ng-${PV}
-fi
-
-DESCRIPTION="C library for developing embedded Linux systems"
-HOMEPAGE="https://uclibc-ng.org/"
-if [[ ${PV} != "9999" ]] ; then
-	PATCH_VER=""
-	SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
-	KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
-fi
-
-LICENSE="LGPL-2"
-SLOT="0"
-IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
-# tests fail due to unusual makefile
-RESTRICT="strip test"
-
-# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
-#    will delete the ld.so sym link prematurely and break the system. So we
-#    will hard block and give manual migration instructions.
-# 2) Currently uclibc and uclibc-ng's iconv are in bad shape.  We've been using
-#    the breakout library.  The disadvantage here is that we have to sprinkle
-#    LDFAGS=-liconv on build systems that need to link against libiconv.
-RDEPEND="
-	!!sys-libs/uclibc
-	iconv? ( dev-libs/libiconv )"
-
-S=${WORKDIR}/${MY_P}
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CHOST} == ${CTARGET} ]] ; then
-	if [[ ${CATEGORY} == cross-* ]] ; then
-		export CTARGET=${CATEGORY#cross-}
-	fi
-fi
-
-is_crosscompile() {
-	[[ ${CHOST} != ${CTARGET} ]]
-}
-
-alt_build_kprefix() {
-	if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
-		echo /usr/include
-	else
-		echo /usr/${CTARGET}/usr/include
-	fi
-}
-
-just_headers() {
-	use headers-only && is_crosscompile
-}
-
-uclibc_endian() {
-	# XXX: this wont work for a toolchain which is bi-endian, but we
-	#      dont have any such thing at the moment, so not a big deal
-	touch "${T}"/endian.s
-	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
-	case $(file "${T}"/endian.o) in
-		*" MSB "*) echo "BIG";;
-		*" LSB "*) echo "LITTLE";;
-		*)         echo "NFC";;
-	esac
-	rm -f "${T}"/endian.{s,o}
-}
-
-kconfig_q_opt() {
-	local flag=$1; shift
-	case ${flag} in
-		y|n) ;;
-		*) flag=$(usex ${flag} y n) ;;
-	esac
-
-	local var="defs_${flag}"
-	eval "${var}+=( $* )"
-}
-
-get_opt() {
-	(
-	unset ${1}
-	. ${2:-"${S}"/.config}
-	echo ${!1}
-	)
-}
-
-make_oldconfig() {
-	yes "" 2>/dev/null | emake -s oldconfig >/dev/null
-}
-
-make_config() {
-	restore_config .config
-	if [ -f .config ]; then
-		make_oldconfig
-		return 0
-	else
-		ewarn "Could not locate user configfile, so we will save a default one"
-	fi
-
-	emake ARCH=$1 defconfig >/dev/null
-
-	local defs_{y,n}
-
-	# These are forced off
-	defs_n=(
-		DOASSERTS
-		DODEBUG_PT
-		HAS_NO_THREADS
-		PROPOLICE_BLOCK_ABRT
-		SSP_QUICK_CANARY
-		SUPPORT_LD_DEBUG_EARLY
-		UCLIBC_HAS_CTYPE_UNSAFE
-		UCLIBC_HAS_LOCALE
-		LDSO_SAFE_RUNPATH
-	)
-
-	# These are forced on
-	defs_y=(
-		DO_C99_MATH
-		DO_XSI_MATH
-		FORCE_SHAREABLE_TEXT_SEGMENTS
-		LDSO_GNU_HASH_SUPPORT
-		LDSO_PRELOAD_FILE_SUPPORT
-		LDSO_RUNPATH
-		LDSO_RUNPATH_OF_EXECUTABLE
-		LDSO_STANDALONE_SUPPORT
-		PROPOLICE_BLOCK_SEGV
-		PTHREADS_DEBUG_SUPPORT
-		UCLIBC_HAS_ARC4RANDOM
-		UCLIBC_HAS_BACKTRACE
-		UCLIBC_HAS_BSD_RES_CLOSE
-		UCLIBC_HAS_CONTEXT_FUNCS
-		UCLIBC_HAS_CTYPE_CHECKED
-		UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
-		UCLIBC_HAS_FENV
-		UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
-		UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
-		UCLIBC_HAS_FOPEN_LARGEFILE_MODE
-		UCLIBC_HAS_FTS
-		UCLIBC_HAS_FTW
-		UCLIBC_HAS_GETPT
-		UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
-		UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
-		UCLIBC_HAS_GNU_GLOB
-		UCLIBC_HAS_HEXADECIMAL_FLOATS
-		UCLIBC_HAS_LIBUTIL
-		UCLIBC_HAS_NFTW
-		UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
-		UCLIBC_HAS_PRINTF_M_SPEC
-		UCLIBC_HAS_PROGRAM_INVOCATION_NAME
-		UCLIBC_HAS_RESOLVER_SUPPORT
-		UCLIBC_HAS_SHA256_CRYPT_IMPL
-		UCLIBC_HAS_SHA512_CRYPT_IMPL
-		UCLIBC_HAS_SSP
-		UCLIBC_HAS_STUBS
-		UCLIBC_HAS_SYS_ERRLIST
-		UCLIBC_HAS_SYS_SIGLIST
-		UCLIBC_HAS_THREADS_NATIVE
-		UCLIBC_HAS_TZ_FILE_READ_MANY
-		UCLIBC_HAS_UTMP
-		UCLIBC_HAS_UTMPX
-		UCLIBC_HAS_WCHAR
-		UCLIBC_HAS_WORDEXP
-		UCLIBC_NTP_LEGACY
-		UCLIBC_SUPPORT_AI_ADDRCONFIG
-		UCLIBC_SUSV2_LEGACY
-		UCLIBC_SUSV3_LEGACY
-		UCLIBC_SUSV3_LEGACY_MACROS
-		UCLIBC_SUSV4_LEGACY
-		UCLIBC_USE_NETLINK
-	)
-
-	sed -i -e '/ARCH_.*_ENDIAN/d' .config
-	kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
-
-	kconfig_q_opt debug DODEBUG
-	kconfig_q_opt debug SUPPORT_LD_DEBUG
-	kconfig_q_opt debug UCLIBC_HAS_PROFILING
-
-	kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
-
-	kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
-	kconfig_q_opt hardened UCLIBC_BUILD_NOW
-	kconfig_q_opt hardened UCLIBC_BUILD_PIE
-	kconfig_q_opt hardened UCLIBC_BUILD_RELRO
-	kconfig_q_opt hardened UCLIBC_BUILD_SSP
-
-	local count def
-	for count in 1 2 ; do
-		# Run twice as some config opts depend on others being enabled first.
-		for def in ${defs_y[@]} ; do
-			sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
-		done
-		for def in ${defs_n[@]} ; do
-			sed -i -e "s|${def}=y|# ${def} is not set|g" .config
-		done
-		make_oldconfig
-	done
-
-	einfo "Enabled options:"
-	for def in ${defs_y[@]} ; do
-		einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
-	done
-	einfo "Disabled options:"
-	for def in ${defs_n[@]} ; do
-		einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
-	done
-
-	# setup build and run paths
-	sed -i \
-		-e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
-		-e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
-		-e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
-		-e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
-		-e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
-		-e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
-		.config || die
-
-	make_oldconfig
-}
-
-pkg_setup() {
-	# Make sure our CHOST is a uclibc toolchain for native compiling
-	if [[ ${CHOST} == ${CTARGET} ]]; then
-		case ${CHOST} in
-			*-uclinux*|*-uclibc*) ;;
-			*) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
-		esac
-	fi
-
-	# uClibc-ng doesn't carry old Linux threads, and since we force
-	# threading our only choice is NPTL which requires i486 and later.
-	[[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
-}
-
-src_prepare() {
-	local version subversion extraversion
-
-	# uclibc-ng tries to create a two sym link with ld.so,
-	# ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
-	# where MAJOR_VERSION != 0 indicates the ABI verison.
-	# We want to get rid of this and just have ABI = 0.
-	eapply "${FILESDIR}"/uclibc-compat-r1.patch
-
-	# We need to change the major.minor.sublevel of uclibc-ng.
-	# Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
-	# If we really want the ABI bump, we'll have to hack the gcc
-	# spec file and change the '*link:' rule.
-	version_0=$(ver_cut 1)
-	version_1=$(ver_cut 2)
-	version_2=$(ver_cut 3)
-	if [[ -z ${version_1} ]]; then
-		subversion=0
-		extraversion=0
-	else
-		subversion=${version_1}
-		if [[ -z ${version_2} ]]; then
-			extraversion=0
-		else
-			extraversion=.${version_2}
-		fi
-	fi
-
-	sed -i \
-		-e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
-		-e "/^MINOR_VERSION/s|:=.*|:= ${version_0}|" \
-		-e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
-		-e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
-		Rules.mak || die
-
-	eapply_user
-}
-
-src_configure() {
-	# Map our toolchain arch name to the name expected by uClibc-ng.
-	local target=$(tc-arch)
-	case ${target} in
-		amd64) target="x86_64";;
-		arm)   target="arm";;
-		mips)  target="mips";;
-		ppc)   target="powerpc";;
-		x86)   target="i386";;
-	esac
-
-	# Do arch specific configuration by changing the defaults in
-	# extra/Configs/Config.<arch>.  If these are not overridden
-	# by an save .config, they will be selected by default.
-
-	# For i386, i486, i586 and i686
-	local cpu
-	if [[ ${target} == "i386" ]]; then
-		[[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
-		sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
-			extra/Configs/Config.i386 || die
-	fi
-
-	# For arm
-	if [[ ${target} == "arm" ]]; then
-		sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
-	fi
-
-	# We set HOSTCC to the proper tuple rather than just 'gcc'
-	sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
-
-	make_config ${target}
-
-	einfo
-	einfo "Runtime Prefix: /"
-	einfo "Devel Prefix:   /usr"
-	einfo "Kernel Prefix:  $(alt_build_kprefix)"
-	einfo "CBUILD:         ${CBUILD}"
-	einfo "CHOST:          ${CHOST}"
-	einfo "CTARGET:        ${CTARGET}"
-	einfo "ABI:            ${ABI}"
-	einfo "ENDIAN:         $(uclibc_endian)"
-	einfo
-}
-
-src_compile() {
-	emake headers
-	just_headers && return 0
-
-	emake
-	if is_crosscompile ; then
-		emake -C utils hostutils
-	else
-		emake utils
-	fi
-}
-
-src_test() {
-	is_crosscompile && return 0
-
-	# assert test fails on pax/grsec enabled kernels
-	# normal vfork test fails in sandbox (both glibc/uclibc)
-	emake UCLIBC_ONLY=1 check
-}
-
-src_install() {
-	local sysroot=${D}
-	is_crosscompile && sysroot+="/usr/${CTARGET}"
-
-	local target="install"
-	just_headers && target="install_headers"
-	emake DESTDIR="${sysroot}" ${target}
-
-	save_config .config
-
-	# remove files coming from kernel-headers
-	rm -rf "${sysroot}"/usr/include/{linux,asm*}
-
-	# Make sure we install the sys-include symlink so that when
-	# we build a 2nd stage cross-compiler, gcc finds the target
-	# system headers correctly.  See gcc/doc/gccinstall.info
-	if is_crosscompile ; then
-		dosym usr/include /usr/${CTARGET}/sys-include
-		if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
-			newbin utils/ldconfig.host ${CTARGET}-ldconfig
-			newbin utils/ldd.host ${CTARGET}-ldd
-		fi
-		return 0
-	fi
-
-	if use symlink-compat; then
-		dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
-		dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
-	fi
-
-	emake DESTDIR="${D}" install_utils
-	dobin extra/scripts/getent
-	dodoc README docs/*.txt
-}
-
-pkg_postinst() {
-	is_crosscompile && return 0
-
-	if [ ! -e "${ROOT}"/etc/TZ ] ; then
-		ewarn "Please remember to set your timezone in /etc/TZ"
-		mkdir -p "${ROOT}"/etc
-		echo "UTC" > "${ROOT}"/etc/TZ
-	fi
-	[ "${ROOT}" != "/" ] && return 0
-	# update cache before reloading init
-	ldconfig
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-02 10:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-01 10:39 [gentoo-commits] repo/gentoo:master commit in: sys-libs/uclibc-ng/, sys-libs/uclibc-ng/files/ Anthony G. Basile
  -- strict thread matches above, loose matches on Subject: below --
2022-01-02 10:02 David Seifert
2016-04-13  0:10 Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox