Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/uclibc-ng/, sys-libs/uclibc-ng/files/
Date: Sun, 02 Jan 2022 10:02:06
Message-Id: 1641117708.1416c5b0e64e173eeab9e4a9c7e1f051590fccbd.soap@gentoo
1 commit: 1416c5b0e64e173eeab9e4a9c7e1f051590fccbd
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 2 10:01:48 2022 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 2 10:01:48 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1416c5b0
7
8 sys-libs/uclibc-ng: remove uclibc
9
10 Closes: https://github.com/gentoo/gentoo/pull/23608
11 Closes: https://bugs.gentoo.org/820905
12 Signed-off-by: David Seifert <soap <AT> gentoo.org>
13
14 sys-libs/uclibc-ng/Manifest | 4 -
15 sys-libs/uclibc-ng/files/uclibc-compat-r1.patch | 15 -
16 .../files/uclibc-ng-1.0.30-fix-ld.so.cache.patch | 48 ---
17 sys-libs/uclibc-ng/metadata.xml | 21 --
18 sys-libs/uclibc-ng/uclibc-ng-1.0.30-r1.ebuild | 403 ---------------------
19 sys-libs/uclibc-ng/uclibc-ng-1.0.32.ebuild | 402 --------------------
20 sys-libs/uclibc-ng/uclibc-ng-1.0.33.ebuild | 402 --------------------
21 sys-libs/uclibc-ng/uclibc-ng-1.0.35.ebuild | 402 --------------------
22 sys-libs/uclibc-ng/uclibc-ng-9999.ebuild | 402 --------------------
23 9 files changed, 2099 deletions(-)
24
25 diff --git a/sys-libs/uclibc-ng/Manifest b/sys-libs/uclibc-ng/Manifest
26 deleted file mode 100644
27 index cd8ee877e8b9..000000000000
28 --- a/sys-libs/uclibc-ng/Manifest
29 +++ /dev/null
30 @@ -1,4 +0,0 @@
31 -DIST uClibc-ng-1.0.30.tar.bz2 2302796 BLAKE2B 21888dfe5a68f83b7ba56bb557ecc5aa19fd75cedc82f2ed48073f47655888719feb27943e0309f8101a24fd2fd9165af31d5679f21c00b12f27ebfccf354bac SHA512 ddd1d91dcfdf7be8471afecf13196563ad348c41e2fa8b63ae50b83f103cf8ed8d9f003b51a54a58db2935b84692b7c011a4779582f30610ede44cb583aae742
32 -DIST uClibc-ng-1.0.32.tar.bz2 2352471 BLAKE2B 887b67f7f03fc8610d8236a18f90584720a78bfc3a036cd6616453bea6e31140f5fd1dfd1d207cc5100854bf3e0c5cc1ca38fe6c31cf97b631892767ae23ec27 SHA512 1de5d4e99b94eeeada4233c53a95ea1b9e704ce1d4aa19ca9b17535c0328b2372ed93d24591c6ea5bfbc0b950aa575c18dcf6950fb04342924bb2b5f9ee235e8
33 -DIST uClibc-ng-1.0.33.tar.bz2 2399235 BLAKE2B c20fd767487b2f24a0af432a1366bfb6ddf02243495d2f1c3fa95db25551a8d6215be184608528ee544661ec2ddbc2f439299245ff3dff4597b376dc7a4658ec SHA512 cab89fb6a6e314c6cc8ac964604bdfae01d2e45dc71678bbb6a8985871f625ac680fec3ddc1cb29f6d15585b7fcb782eaf40fa6c89207cde2a04286c3d610169
34 -DIST uClibc-ng-1.0.35.tar.bz2 2396789 BLAKE2B b4e08ccb2bbf15d6a63e279f80792520edba78a9b95cde0432a2dbfc10d4830a621d71af97d4f2bbd867e6367182847c35b62f3c315dff85ecf0c680122238e0 SHA512 da2a1bc6e4a9ce1e3f436b9987fc5f6bb968e52f09508bef6588b409b861ece29d9c1411ffb88863de3a700cb19ad52a8d38596955d3b7bbfb3b0d3745daa25f
35
36 diff --git a/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch b/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch
37 deleted file mode 100644
38 index f47e0f9a0152..000000000000
39 --- a/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch
40 +++ /dev/null
41 @@ -1,15 +0,0 @@
42 -diff -Naur uClibc-ng-1.0.18.orig/ldso/ldso/Makefile.in uClibc-ng-1.0.18/ldso/ldso/Makefile.in
43 ---- uClibc-ng-1.0.18.orig/ldso/ldso/Makefile.in 2016-09-27 15:26:37.000000000 -0400
44 -+++ uClibc-ng-1.0.18/ldso/ldso/Makefile.in 2016-10-01 06:31:44.106589780 -0400
45 -@@ -80,11 +80,6 @@
46 - $(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
47 - $(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
48 - $(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
49 -- # link for backward compatibility
50 -- (cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME).so.0 )
51 --ifeq ($(CONFIG_MIPS_NAN_2008),y)
52 -- (cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME)-mipsn8.so.0)
53 --endif
54 -
55 - $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
56 - $(Q)$(RM) $@
57
58 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
59 deleted file mode 100644
60 index 6b13e0890d25..000000000000
61 --- a/sys-libs/uclibc-ng/files/uclibc-ng-1.0.30-fix-ld.so.cache.patch
62 +++ /dev/null
63 @@ -1,48 +0,0 @@
64 -commit 92d250d387e247029900c9074150f45866b29781
65 -Author: Waldemar Brodkorb <wbx@×××××××.org>
66 -Date: Sun Apr 29 19:34:11 2018 +0200
67 -
68 - Revert "ldconfig: add glibc compatibility fix"
69 -
70 - This reverts commit 2a3bb4daf5778c5875674cd26a3c75b3d460a042.
71 -
72 - This is breaking ld.so.cache usage. Seen on Gentoo/amd64.
73 -
74 - Reported-by: "Anthony G. Basile" <basile@××××××××××.net>
75 -
76 -diff --git a/utils/ldconfig.c b/utils/ldconfig.c
77 -index 58939d689..e6b788118 100644
78 ---- a/utils/ldconfig.c
79 -+++ b/utils/ldconfig.c
80 -@@ -184,9 +184,10 @@ static char *readsoname(char *name, FILE *infile, int expected_type,
81 - res = readsoname32(name, infile, expected_type, type);
82 - else {
83 - res = readsoname64(name, infile, expected_type, type);
84 --
85 -- // For 64-bit glibc compatibility
86 -- *type |= FLAG_X8664_LIB64;
87 -+#if 0
88 -+ /* relies on multilib support which we dont have ... */
89 -+ *type |= LIB_ELF64;
90 -+#endif
91 - }
92 -
93 - return res;
94 -@@ -757,7 +758,7 @@ void cache_print(void)
95 -
96 - for (fd = 0; fd < header->nlibs; fd++) {
97 - printf("\t%s ", strs + libent[fd].sooffset);
98 -- switch (libent[fd].flags & ~LIB_ELF64 & FLAG_TYPE_MASK) {
99 -+ switch (libent[fd].flags & ~LIB_ELF64) {
100 - case LIB_DLL:
101 - printf("(libc4)");
102 - break;
103 -@@ -770,7 +771,7 @@ void cache_print(void)
104 - case LIB_ELF_LIBC5:
105 - case LIB_ELF_LIBC6:
106 - printf("(libc%d%s)",
107 -- (libent[fd].flags & ~LIB_ELF64 & FLAG_TYPE_MASK) + 3,
108 -+ (libent[fd].flags & ~LIB_ELF64) + 3,
109 - libent[fd].flags & LIB_ELF64 ? "/64" : "");
110 - break;
111 - default:
112
113 diff --git a/sys-libs/uclibc-ng/metadata.xml b/sys-libs/uclibc-ng/metadata.xml
114 deleted file mode 100644
115 index 6d1928f173d8..000000000000
116 --- a/sys-libs/uclibc-ng/metadata.xml
117 +++ /dev/null
118 @@ -1,21 +0,0 @@
119 -<?xml version="1.0" encoding="UTF-8"?>
120 -<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
121 -<pkgmetadata>
122 - <maintainer type="person">
123 - <email>blueness@g.o</email>
124 - <name>Anthony G. Basile</name>
125 - </maintainer>
126 - <maintainer type="project">
127 - <email>embedded@g.o</email>
128 - <name>Embedded Gentoo</name>
129 - </maintainer>
130 - <longdescription>
131 - uClibc-ng is a small C library for developing embedded Linux systems. It is much
132 - smaller than the GNU C Library, but nearly all applications supported by glibc
133 - also work perfectly with uClibc-ng.
134 - </longdescription>
135 - <use>
136 - <flag name="symlink-compat">Explicitly add sym links for libdl.so.0, libm.so.0, and
137 - friends for backward compatibility with sys-libs/uclibc-ng-1.0.17 and earlier</flag>
138 - </use>
139 -</pkgmetadata>
140
141 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
142 deleted file mode 100644
143 index 375d030fc404..000000000000
144 --- a/sys-libs/uclibc-ng/uclibc-ng-1.0.30-r1.ebuild
145 +++ /dev/null
146 @@ -1,403 +0,0 @@
147 -# Copyright 1999-2020 Gentoo Authors
148 -# Distributed under the terms of the GNU General Public License v2
149 -
150 -EAPI="6"
151 -
152 -inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
153 -
154 -if [[ ${PV} == "9999" ]] ; then
155 - EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
156 - inherit git-r3
157 - MY_P=uclibc-ng-${PV}
158 -else
159 - MY_P=uClibc-ng-${PV}
160 -fi
161 -
162 -DESCRIPTION="C library for developing embedded Linux systems"
163 -HOMEPAGE="https://uclibc-ng.org/"
164 -if [[ ${PV} != "9999" ]] ; then
165 - PATCH_VER=""
166 - SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
167 - KEYWORDS="-* arm"
168 -fi
169 -
170 -LICENSE="LGPL-2"
171 -SLOT="0"
172 -IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
173 -# tests fail due to unusual makefile
174 -RESTRICT="strip test"
175 -
176 -# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
177 -# will delete the ld.so sym link prematurely and break the system. So we
178 -# will hard block and give manual migration instructions.
179 -# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
180 -# the breakout library. The disadvantage here is that we have to sprinkle
181 -# LDFAGS=-liconv on build systems that need to link against libiconv.
182 -RDEPEND="
183 - !!sys-libs/uclibc
184 - iconv? ( dev-libs/libiconv )"
185 -
186 -S=${WORKDIR}/${MY_P}
187 -
188 -export CBUILD=${CBUILD:-${CHOST}}
189 -export CTARGET=${CTARGET:-${CHOST}}
190 -if [[ ${CHOST} == ${CTARGET} ]] ; then
191 - if [[ ${CATEGORY} == cross-* ]] ; then
192 - export CTARGET=${CATEGORY#cross-}
193 - fi
194 -fi
195 -
196 -is_crosscompile() {
197 - [[ ${CHOST} != ${CTARGET} ]]
198 -}
199 -
200 -alt_build_kprefix() {
201 - if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
202 - echo /usr/include
203 - else
204 - echo /usr/${CTARGET}/usr/include
205 - fi
206 -}
207 -
208 -just_headers() {
209 - use headers-only && is_crosscompile
210 -}
211 -
212 -uclibc_endian() {
213 - # XXX: this wont work for a toolchain which is bi-endian, but we
214 - # dont have any such thing at the moment, so not a big deal
215 - touch "${T}"/endian.s
216 - $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
217 - case $(file "${T}"/endian.o) in
218 - *" MSB "*) echo "BIG";;
219 - *" LSB "*) echo "LITTLE";;
220 - *) echo "NFC";;
221 - esac
222 - rm -f "${T}"/endian.{s,o}
223 -}
224 -
225 -kconfig_q_opt() {
226 - local flag=$1; shift
227 - case ${flag} in
228 - y|n) ;;
229 - *) flag=$(usex ${flag} y n) ;;
230 - esac
231 -
232 - local var="defs_${flag}"
233 - eval "${var}+=( $* )"
234 -}
235 -
236 -get_opt() {
237 - (
238 - unset ${1}
239 - . ${2:-"${S}"/.config}
240 - echo ${!1}
241 - )
242 -}
243 -
244 -make_oldconfig() {
245 - yes "" 2>/dev/null | emake -s oldconfig >/dev/null
246 -}
247 -
248 -make_config() {
249 - restore_config .config
250 - if [ -f .config ]; then
251 - make_oldconfig
252 - return 0
253 - else
254 - ewarn "Could not locate user configfile, so we will save a default one"
255 - fi
256 -
257 - emake ARCH=$1 defconfig >/dev/null
258 -
259 - local defs_{y,n}
260 -
261 - # These are forced off
262 - defs_n=(
263 - DOASSERTS
264 - DODEBUG_PT
265 - HAS_NO_THREADS
266 - PROPOLICE_BLOCK_ABRT
267 - SSP_QUICK_CANARY
268 - SUPPORT_LD_DEBUG_EARLY
269 - UCLIBC_HAS_CTYPE_UNSAFE
270 - UCLIBC_HAS_LOCALE
271 - LDSO_SAFE_RUNPATH
272 - )
273 -
274 - # These are forced on
275 - defs_y=(
276 - DO_C99_MATH
277 - DO_XSI_MATH
278 - FORCE_SHAREABLE_TEXT_SEGMENTS
279 - LDSO_GNU_HASH_SUPPORT
280 - LDSO_PRELOAD_FILE_SUPPORT
281 - LDSO_RUNPATH
282 - LDSO_RUNPATH_OF_EXECUTABLE
283 - LDSO_STANDALONE_SUPPORT
284 - PROPOLICE_BLOCK_SEGV
285 - PTHREADS_DEBUG_SUPPORT
286 - UCLIBC_HAS_ARC4RANDOM
287 - UCLIBC_HAS_BACKTRACE
288 - UCLIBC_HAS_BSD_RES_CLOSE
289 - UCLIBC_HAS_CONTEXT_FUNCS
290 - UCLIBC_HAS_CTYPE_CHECKED
291 - UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
292 - UCLIBC_HAS_FENV
293 - UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
294 - UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
295 - UCLIBC_HAS_FOPEN_LARGEFILE_MODE
296 - UCLIBC_HAS_FTS
297 - UCLIBC_HAS_FTW
298 - UCLIBC_HAS_GETPT
299 - UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
300 - UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
301 - UCLIBC_HAS_GNU_GLOB
302 - UCLIBC_HAS_HEXADECIMAL_FLOATS
303 - UCLIBC_HAS_LIBUTIL
304 - UCLIBC_HAS_NFTW
305 - UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
306 - UCLIBC_HAS_PRINTF_M_SPEC
307 - UCLIBC_HAS_PROGRAM_INVOCATION_NAME
308 - UCLIBC_HAS_RESOLVER_SUPPORT
309 - UCLIBC_HAS_SHA256_CRYPT_IMPL
310 - UCLIBC_HAS_SHA512_CRYPT_IMPL
311 - UCLIBC_HAS_SSP
312 - UCLIBC_HAS_STUBS
313 - UCLIBC_HAS_SYS_ERRLIST
314 - UCLIBC_HAS_SYS_SIGLIST
315 - UCLIBC_HAS_THREADS_NATIVE
316 - UCLIBC_HAS_TZ_FILE_READ_MANY
317 - UCLIBC_HAS_UTMP
318 - UCLIBC_HAS_UTMPX
319 - UCLIBC_HAS_WCHAR
320 - UCLIBC_HAS_WORDEXP
321 - UCLIBC_NTP_LEGACY
322 - UCLIBC_SUPPORT_AI_ADDRCONFIG
323 - UCLIBC_SUSV2_LEGACY
324 - UCLIBC_SUSV3_LEGACY
325 - UCLIBC_SUSV3_LEGACY_MACROS
326 - UCLIBC_SUSV4_LEGACY
327 - UCLIBC_USE_NETLINK
328 - )
329 -
330 - sed -i -e '/ARCH_.*_ENDIAN/d' .config
331 - kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
332 -
333 - kconfig_q_opt debug DODEBUG
334 - kconfig_q_opt debug SUPPORT_LD_DEBUG
335 - kconfig_q_opt debug UCLIBC_HAS_PROFILING
336 -
337 - kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
338 -
339 - kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
340 - kconfig_q_opt hardened UCLIBC_BUILD_NOW
341 - kconfig_q_opt hardened UCLIBC_BUILD_PIE
342 - kconfig_q_opt hardened UCLIBC_BUILD_RELRO
343 - kconfig_q_opt hardened UCLIBC_BUILD_SSP
344 -
345 - local count def
346 - for count in 1 2 ; do
347 - # Run twice as some config opts depend on others being enabled first.
348 - for def in ${defs_y[@]} ; do
349 - sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
350 - done
351 - for def in ${defs_n[@]} ; do
352 - sed -i -e "s|${def}=y|# ${def} is not set|g" .config
353 - done
354 - make_oldconfig
355 - done
356 -
357 - einfo "Enabled options:"
358 - for def in ${defs_y[@]} ; do
359 - einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
360 - done
361 - einfo "Disabled options:"
362 - for def in ${defs_n[@]} ; do
363 - einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
364 - done
365 -
366 - # setup build and run paths
367 - sed -i \
368 - -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
369 - -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
370 - -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
371 - -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
372 - -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
373 - -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
374 - .config || die
375 -
376 - make_oldconfig
377 -}
378 -
379 -pkg_setup() {
380 - # Make sure our CHOST is a uclibc toolchain for native compiling
381 - if [[ ${CHOST} == ${CTARGET} ]]; then
382 - case ${CHOST} in
383 - *-uclinux*|*-uclibc*) ;;
384 - *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
385 - esac
386 - fi
387 -
388 - # uClibc-ng doesn't carry old Linux threads, and since we force
389 - # threading our only choice is NPTL which requires i486 and later.
390 - [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
391 -}
392 -
393 -src_prepare() {
394 - local version subversion extraversion
395 -
396 - # uclibc-ng tries to create a two sym link with ld.so,
397 - # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
398 - # where MAJOR_VERSION != 0 indicates the ABI verison.
399 - # We want to get rid of this and just have ABI = 0.
400 - eapply "${FILESDIR}"/uclibc-compat-r1.patch
401 -
402 - # Critical fix for ld.so.cache
403 - eapply "${FILESDIR}"/${P}-fix-ld.so.cache.patch
404 -
405 - # We need to change the major.minor.sublevel of uclibc-ng.
406 - # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
407 - # If we really want the ABI bump, we'll have to hack the gcc
408 - # spec file and change the '*link:' rule.
409 - version=( $(get_version_components) )
410 - if [[ -z ${version[1]} ]]; then
411 - subversion=0
412 - extraversion=0
413 - else
414 - subversion=${version[1]}
415 - if [[ -z ${version[2]} ]]; then
416 - extraversion=0
417 - else
418 - extraversion=.${version[2]}
419 - fi
420 - fi
421 -
422 - sed -i \
423 - -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
424 - -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
425 - -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
426 - -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
427 - Rules.mak || die
428 -
429 - eapply_user
430 -}
431 -
432 -src_configure() {
433 - # Map our toolchain arch name to the name expected by uClibc-ng.
434 - local target=$(tc-arch)
435 - case ${target} in
436 - amd64) target="x86_64";;
437 - arm) target="arm";;
438 - mips) target="mips";;
439 - ppc) target="powerpc";;
440 - x86) target="i386";;
441 - esac
442 -
443 - # Do arch specific configuration by changing the defaults in
444 - # extra/Configs/Config.<arch>. If these are not overridden
445 - # by an save .config, they will be selected by default.
446 -
447 - # For i386, i486, i586 and i686
448 - local cpu
449 - if [[ ${target} == "i386" ]]; then
450 - [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
451 - sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
452 - extra/Configs/Config.i386 || die
453 - fi
454 -
455 - # For arm
456 - if [[ ${target} == "arm" ]]; then
457 - sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
458 - fi
459 -
460 - # We set HOSTCC to the proper tuple rather than just 'gcc'
461 - sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
462 -
463 - make_config ${target}
464 -
465 - einfo
466 - einfo "Runtime Prefix: /"
467 - einfo "Devel Prefix: /usr"
468 - einfo "Kernel Prefix: $(alt_build_kprefix)"
469 - einfo "CBUILD: ${CBUILD}"
470 - einfo "CHOST: ${CHOST}"
471 - einfo "CTARGET: ${CTARGET}"
472 - einfo "ABI: ${ABI}"
473 - einfo "ENDIAN: $(uclibc_endian)"
474 - einfo
475 -}
476 -
477 -src_compile() {
478 - emake headers
479 - just_headers && return 0
480 -
481 - emake
482 - if is_crosscompile ; then
483 - emake -C utils hostutils
484 - else
485 - emake utils
486 - fi
487 -}
488 -
489 -src_test() {
490 - is_crosscompile && return 0
491 -
492 - # assert test fails on pax/grsec enabled kernels
493 - # normal vfork test fails in sandbox (both glibc/uclibc)
494 - emake UCLIBC_ONLY=1 check
495 -}
496 -
497 -src_install() {
498 - local sysroot=${D}
499 - is_crosscompile && sysroot+="/usr/${CTARGET}"
500 -
501 - local target="install"
502 - just_headers && target="install_headers"
503 - emake DESTDIR="${sysroot}" ${target}
504 -
505 - save_config .config
506 -
507 - # remove files coming from kernel-headers
508 - rm -rf "${sysroot}"/usr/include/{linux,asm*}
509 -
510 - # Make sure we install the sys-include symlink so that when
511 - # we build a 2nd stage cross-compiler, gcc finds the target
512 - # system headers correctly. See gcc/doc/gccinstall.info
513 - if is_crosscompile ; then
514 - dosym usr/include /usr/${CTARGET}/sys-include
515 - if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
516 - newbin utils/ldconfig.host ${CTARGET}-ldconfig
517 - newbin utils/ldd.host ${CTARGET}-ldd
518 - fi
519 - return 0
520 - fi
521 -
522 - if use symlink-compat; then
523 - dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
524 - dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
525 - dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
526 - dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
527 - dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
528 - dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
529 - dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
530 - dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
531 - fi
532 -
533 - emake DESTDIR="${D}" install_utils
534 - dobin extra/scripts/getent
535 - dodoc README docs/*.txt
536 -}
537 -
538 -pkg_postinst() {
539 - is_crosscompile && return 0
540 -
541 - if [ ! -e "${ROOT}"/etc/TZ ] ; then
542 - ewarn "Please remember to set your timezone in /etc/TZ"
543 - mkdir -p "${ROOT}"/etc
544 - echo "UTC" > "${ROOT}"/etc/TZ
545 - fi
546 - [ "${ROOT}" != "/" ] && return 0
547 - # update cache before reloading init
548 - ldconfig
549 -}
550
551 diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.32.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.32.ebuild
552 deleted file mode 100644
553 index fffc7f103fb8..000000000000
554 --- a/sys-libs/uclibc-ng/uclibc-ng-1.0.32.ebuild
555 +++ /dev/null
556 @@ -1,402 +0,0 @@
557 -# Copyright 1999-2020 Gentoo Authors
558 -# Distributed under the terms of the GNU General Public License v2
559 -
560 -EAPI="7"
561 -
562 -inherit flag-o-matic multilib savedconfig toolchain-funcs
563 -
564 -if [[ ${PV} == "9999" ]] ; then
565 - EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
566 - inherit git-r3
567 - MY_P=uclibc-ng-${PV}
568 -else
569 - MY_P=uClibc-ng-${PV}
570 -fi
571 -
572 -DESCRIPTION="C library for developing embedded Linux systems"
573 -HOMEPAGE="https://uclibc-ng.org/"
574 -if [[ ${PV} != "9999" ]] ; then
575 - PATCH_VER=""
576 - SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
577 - KEYWORDS="-* amd64 ~mips ppc x86"
578 -fi
579 -
580 -LICENSE="LGPL-2"
581 -SLOT="0"
582 -IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
583 -# tests fail due to unusual makefile
584 -RESTRICT="strip test"
585 -
586 -# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
587 -# will delete the ld.so sym link prematurely and break the system. So we
588 -# will hard block and give manual migration instructions.
589 -# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
590 -# the breakout library. The disadvantage here is that we have to sprinkle
591 -# LDFAGS=-liconv on build systems that need to link against libiconv.
592 -RDEPEND="
593 - !!sys-libs/uclibc
594 - iconv? ( dev-libs/libiconv )"
595 -
596 -S=${WORKDIR}/${MY_P}
597 -
598 -export CBUILD=${CBUILD:-${CHOST}}
599 -export CTARGET=${CTARGET:-${CHOST}}
600 -if [[ ${CHOST} == ${CTARGET} ]] ; then
601 - if [[ ${CATEGORY} == cross-* ]] ; then
602 - export CTARGET=${CATEGORY#cross-}
603 - fi
604 -fi
605 -
606 -is_crosscompile() {
607 - [[ ${CHOST} != ${CTARGET} ]]
608 -}
609 -
610 -alt_build_kprefix() {
611 - if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
612 - echo /usr/include
613 - else
614 - echo /usr/${CTARGET}/usr/include
615 - fi
616 -}
617 -
618 -just_headers() {
619 - use headers-only && is_crosscompile
620 -}
621 -
622 -uclibc_endian() {
623 - # XXX: this wont work for a toolchain which is bi-endian, but we
624 - # dont have any such thing at the moment, so not a big deal
625 - touch "${T}"/endian.s
626 - $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
627 - case $(file "${T}"/endian.o) in
628 - *" MSB "*) echo "BIG";;
629 - *" LSB "*) echo "LITTLE";;
630 - *) echo "NFC";;
631 - esac
632 - rm -f "${T}"/endian.{s,o}
633 -}
634 -
635 -kconfig_q_opt() {
636 - local flag=$1; shift
637 - case ${flag} in
638 - y|n) ;;
639 - *) flag=$(usex ${flag} y n) ;;
640 - esac
641 -
642 - local var="defs_${flag}"
643 - eval "${var}+=( $* )"
644 -}
645 -
646 -get_opt() {
647 - (
648 - unset ${1}
649 - . ${2:-"${S}"/.config}
650 - echo ${!1}
651 - )
652 -}
653 -
654 -make_oldconfig() {
655 - yes "" 2>/dev/null | emake -s oldconfig >/dev/null
656 -}
657 -
658 -make_config() {
659 - restore_config .config
660 - if [ -f .config ]; then
661 - make_oldconfig
662 - return 0
663 - else
664 - ewarn "Could not locate user configfile, so we will save a default one"
665 - fi
666 -
667 - emake ARCH=$1 defconfig >/dev/null
668 -
669 - local defs_{y,n}
670 -
671 - # These are forced off
672 - defs_n=(
673 - DOASSERTS
674 - DODEBUG_PT
675 - HAS_NO_THREADS
676 - PROPOLICE_BLOCK_ABRT
677 - SSP_QUICK_CANARY
678 - SUPPORT_LD_DEBUG_EARLY
679 - UCLIBC_HAS_CTYPE_UNSAFE
680 - UCLIBC_HAS_LOCALE
681 - LDSO_SAFE_RUNPATH
682 - )
683 -
684 - # These are forced on
685 - defs_y=(
686 - DO_C99_MATH
687 - DO_XSI_MATH
688 - FORCE_SHAREABLE_TEXT_SEGMENTS
689 - LDSO_GNU_HASH_SUPPORT
690 - LDSO_PRELOAD_FILE_SUPPORT
691 - LDSO_RUNPATH
692 - LDSO_RUNPATH_OF_EXECUTABLE
693 - LDSO_STANDALONE_SUPPORT
694 - PROPOLICE_BLOCK_SEGV
695 - PTHREADS_DEBUG_SUPPORT
696 - UCLIBC_HAS_ARC4RANDOM
697 - UCLIBC_HAS_BACKTRACE
698 - UCLIBC_HAS_BSD_RES_CLOSE
699 - UCLIBC_HAS_CONTEXT_FUNCS
700 - UCLIBC_HAS_CTYPE_CHECKED
701 - UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
702 - UCLIBC_HAS_FENV
703 - UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
704 - UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
705 - UCLIBC_HAS_FOPEN_LARGEFILE_MODE
706 - UCLIBC_HAS_FTS
707 - UCLIBC_HAS_FTW
708 - UCLIBC_HAS_GETPT
709 - UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
710 - UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
711 - UCLIBC_HAS_GNU_GLOB
712 - UCLIBC_HAS_HEXADECIMAL_FLOATS
713 - UCLIBC_HAS_LIBUTIL
714 - UCLIBC_HAS_NFTW
715 - UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
716 - UCLIBC_HAS_PRINTF_M_SPEC
717 - UCLIBC_HAS_PROGRAM_INVOCATION_NAME
718 - UCLIBC_HAS_RESOLVER_SUPPORT
719 - UCLIBC_HAS_SHA256_CRYPT_IMPL
720 - UCLIBC_HAS_SHA512_CRYPT_IMPL
721 - UCLIBC_HAS_SSP
722 - UCLIBC_HAS_STUBS
723 - UCLIBC_HAS_SYS_ERRLIST
724 - UCLIBC_HAS_SYS_SIGLIST
725 - UCLIBC_HAS_THREADS_NATIVE
726 - UCLIBC_HAS_TZ_FILE_READ_MANY
727 - UCLIBC_HAS_UTMP
728 - UCLIBC_HAS_UTMPX
729 - UCLIBC_HAS_WCHAR
730 - UCLIBC_HAS_WORDEXP
731 - UCLIBC_NTP_LEGACY
732 - UCLIBC_SUPPORT_AI_ADDRCONFIG
733 - UCLIBC_SUSV2_LEGACY
734 - UCLIBC_SUSV3_LEGACY
735 - UCLIBC_SUSV3_LEGACY_MACROS
736 - UCLIBC_SUSV4_LEGACY
737 - UCLIBC_USE_NETLINK
738 - )
739 -
740 - sed -i -e '/ARCH_.*_ENDIAN/d' .config
741 - kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
742 -
743 - kconfig_q_opt debug DODEBUG
744 - kconfig_q_opt debug SUPPORT_LD_DEBUG
745 - kconfig_q_opt debug UCLIBC_HAS_PROFILING
746 -
747 - kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
748 -
749 - kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
750 - kconfig_q_opt hardened UCLIBC_BUILD_NOW
751 - kconfig_q_opt hardened UCLIBC_BUILD_PIE
752 - kconfig_q_opt hardened UCLIBC_BUILD_RELRO
753 - kconfig_q_opt hardened UCLIBC_BUILD_SSP
754 -
755 - local count def
756 - for count in 1 2 ; do
757 - # Run twice as some config opts depend on others being enabled first.
758 - for def in ${defs_y[@]} ; do
759 - sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
760 - done
761 - for def in ${defs_n[@]} ; do
762 - sed -i -e "s|${def}=y|# ${def} is not set|g" .config
763 - done
764 - make_oldconfig
765 - done
766 -
767 - einfo "Enabled options:"
768 - for def in ${defs_y[@]} ; do
769 - einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
770 - done
771 - einfo "Disabled options:"
772 - for def in ${defs_n[@]} ; do
773 - einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
774 - done
775 -
776 - # setup build and run paths
777 - sed -i \
778 - -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
779 - -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
780 - -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
781 - -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
782 - -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
783 - -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
784 - .config || die
785 -
786 - make_oldconfig
787 -}
788 -
789 -pkg_setup() {
790 - # Make sure our CHOST is a uclibc toolchain for native compiling
791 - if [[ ${CHOST} == ${CTARGET} ]]; then
792 - case ${CHOST} in
793 - *-uclinux*|*-uclibc*) ;;
794 - *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
795 - esac
796 - fi
797 -
798 - # uClibc-ng doesn't carry old Linux threads, and since we force
799 - # threading our only choice is NPTL which requires i486 and later.
800 - [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
801 -}
802 -
803 -src_prepare() {
804 - local version subversion extraversion
805 -
806 - # uclibc-ng tries to create a two sym link with ld.so,
807 - # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
808 - # where MAJOR_VERSION != 0 indicates the ABI verison.
809 - # We want to get rid of this and just have ABI = 0.
810 - eapply "${FILESDIR}"/uclibc-compat-r1.patch
811 -
812 - # We need to change the major.minor.sublevel of uclibc-ng.
813 - # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
814 - # If we really want the ABI bump, we'll have to hack the gcc
815 - # spec file and change the '*link:' rule.
816 - version_0=$(ver_cut 1)
817 - version_1=$(ver_cut 2)
818 - version_2=$(ver_cut 3)
819 - if [[ -z ${version_1} ]]; then
820 - subversion=0
821 - extraversion=0
822 - else
823 - subversion=${version_1}
824 - if [[ -z ${version_2} ]]; then
825 - extraversion=0
826 - else
827 - extraversion=.${version_2}
828 - fi
829 - fi
830 -
831 - sed -i \
832 - -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
833 - -e "/^MINOR_VERSION/s|:=.*|:= ${version_0}|" \
834 - -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
835 - -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
836 - Rules.mak || die
837 -
838 - eapply_user
839 -}
840 -
841 -src_configure() {
842 - # Map our toolchain arch name to the name expected by uClibc-ng.
843 - local target=$(tc-arch)
844 - case ${target} in
845 - amd64) target="x86_64";;
846 - arm) target="arm";;
847 - mips) target="mips";;
848 - ppc) target="powerpc";;
849 - x86) target="i386";;
850 - esac
851 -
852 - # Do arch specific configuration by changing the defaults in
853 - # extra/Configs/Config.<arch>. If these are not overridden
854 - # by an save .config, they will be selected by default.
855 -
856 - # For i386, i486, i586 and i686
857 - local cpu
858 - if [[ ${target} == "i386" ]]; then
859 - [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
860 - sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
861 - extra/Configs/Config.i386 || die
862 - fi
863 -
864 - # For arm
865 - if [[ ${target} == "arm" ]]; then
866 - sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
867 - fi
868 -
869 - # We set HOSTCC to the proper tuple rather than just 'gcc'
870 - sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
871 -
872 - make_config ${target}
873 -
874 - einfo
875 - einfo "Runtime Prefix: /"
876 - einfo "Devel Prefix: /usr"
877 - einfo "Kernel Prefix: $(alt_build_kprefix)"
878 - einfo "CBUILD: ${CBUILD}"
879 - einfo "CHOST: ${CHOST}"
880 - einfo "CTARGET: ${CTARGET}"
881 - einfo "ABI: ${ABI}"
882 - einfo "ENDIAN: $(uclibc_endian)"
883 - einfo
884 -}
885 -
886 -src_compile() {
887 - emake headers
888 - just_headers && return 0
889 -
890 - emake
891 - if is_crosscompile ; then
892 - emake -C utils hostutils
893 - else
894 - emake utils
895 - fi
896 -}
897 -
898 -src_test() {
899 - is_crosscompile && return 0
900 -
901 - # assert test fails on pax/grsec enabled kernels
902 - # normal vfork test fails in sandbox (both glibc/uclibc)
903 - emake UCLIBC_ONLY=1 check
904 -}
905 -
906 -src_install() {
907 - local sysroot=${D}
908 - is_crosscompile && sysroot+="/usr/${CTARGET}"
909 -
910 - local target="install"
911 - just_headers && target="install_headers"
912 - emake DESTDIR="${sysroot}" ${target}
913 -
914 - save_config .config
915 -
916 - # remove files coming from kernel-headers
917 - rm -rf "${sysroot}"/usr/include/{linux,asm*}
918 -
919 - # Make sure we install the sys-include symlink so that when
920 - # we build a 2nd stage cross-compiler, gcc finds the target
921 - # system headers correctly. See gcc/doc/gccinstall.info
922 - if is_crosscompile ; then
923 - dosym usr/include /usr/${CTARGET}/sys-include
924 - if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
925 - newbin utils/ldconfig.host ${CTARGET}-ldconfig
926 - newbin utils/ldd.host ${CTARGET}-ldd
927 - fi
928 - return 0
929 - fi
930 -
931 - if use symlink-compat; then
932 - dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
933 - dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
934 - dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
935 - dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
936 - dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
937 - dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
938 - dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
939 - dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
940 - fi
941 -
942 - emake DESTDIR="${D}" install_utils
943 - dobin extra/scripts/getent
944 - dodoc README docs/*.txt
945 -}
946 -
947 -pkg_postinst() {
948 - is_crosscompile && return 0
949 -
950 - if [ ! -e "${ROOT}"/etc/TZ ] ; then
951 - ewarn "Please remember to set your timezone in /etc/TZ"
952 - mkdir -p "${ROOT}"/etc
953 - echo "UTC" > "${ROOT}"/etc/TZ
954 - fi
955 - [ "${ROOT}" != "/" ] && return 0
956 - # update cache before reloading init
957 - ldconfig
958 -}
959
960 diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.33.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.33.ebuild
961 deleted file mode 100644
962 index 4dd7db70cc0f..000000000000
963 --- a/sys-libs/uclibc-ng/uclibc-ng-1.0.33.ebuild
964 +++ /dev/null
965 @@ -1,402 +0,0 @@
966 -# Copyright 1999-2020 Gentoo Authors
967 -# Distributed under the terms of the GNU General Public License v2
968 -
969 -EAPI="7"
970 -
971 -inherit flag-o-matic multilib savedconfig toolchain-funcs
972 -
973 -if [[ ${PV} == "9999" ]] ; then
974 - EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
975 - inherit git-r3
976 - MY_P=uclibc-ng-${PV}
977 -else
978 - MY_P=uClibc-ng-${PV}
979 -fi
980 -
981 -DESCRIPTION="C library for developing embedded Linux systems"
982 -HOMEPAGE="https://uclibc-ng.org/"
983 -if [[ ${PV} != "9999" ]] ; then
984 - PATCH_VER=""
985 - SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
986 - KEYWORDS="-* amd64 ~arm ~mips ~ppc x86"
987 -fi
988 -
989 -LICENSE="LGPL-2"
990 -SLOT="0"
991 -IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
992 -# tests fail due to unusual makefile
993 -RESTRICT="strip test"
994 -
995 -# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
996 -# will delete the ld.so sym link prematurely and break the system. So we
997 -# will hard block and give manual migration instructions.
998 -# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
999 -# the breakout library. The disadvantage here is that we have to sprinkle
1000 -# LDFAGS=-liconv on build systems that need to link against libiconv.
1001 -RDEPEND="
1002 - !!sys-libs/uclibc
1003 - iconv? ( dev-libs/libiconv )"
1004 -
1005 -S=${WORKDIR}/${MY_P}
1006 -
1007 -export CBUILD=${CBUILD:-${CHOST}}
1008 -export CTARGET=${CTARGET:-${CHOST}}
1009 -if [[ ${CHOST} == ${CTARGET} ]] ; then
1010 - if [[ ${CATEGORY} == cross-* ]] ; then
1011 - export CTARGET=${CATEGORY#cross-}
1012 - fi
1013 -fi
1014 -
1015 -is_crosscompile() {
1016 - [[ ${CHOST} != ${CTARGET} ]]
1017 -}
1018 -
1019 -alt_build_kprefix() {
1020 - if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
1021 - echo /usr/include
1022 - else
1023 - echo /usr/${CTARGET}/usr/include
1024 - fi
1025 -}
1026 -
1027 -just_headers() {
1028 - use headers-only && is_crosscompile
1029 -}
1030 -
1031 -uclibc_endian() {
1032 - # XXX: this wont work for a toolchain which is bi-endian, but we
1033 - # dont have any such thing at the moment, so not a big deal
1034 - touch "${T}"/endian.s
1035 - $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
1036 - case $(file "${T}"/endian.o) in
1037 - *" MSB "*) echo "BIG";;
1038 - *" LSB "*) echo "LITTLE";;
1039 - *) echo "NFC";;
1040 - esac
1041 - rm -f "${T}"/endian.{s,o}
1042 -}
1043 -
1044 -kconfig_q_opt() {
1045 - local flag=$1; shift
1046 - case ${flag} in
1047 - y|n) ;;
1048 - *) flag=$(usex ${flag} y n) ;;
1049 - esac
1050 -
1051 - local var="defs_${flag}"
1052 - eval "${var}+=( $* )"
1053 -}
1054 -
1055 -get_opt() {
1056 - (
1057 - unset ${1}
1058 - . ${2:-"${S}"/.config}
1059 - echo ${!1}
1060 - )
1061 -}
1062 -
1063 -make_oldconfig() {
1064 - yes "" 2>/dev/null | emake -s oldconfig >/dev/null
1065 -}
1066 -
1067 -make_config() {
1068 - restore_config .config
1069 - if [ -f .config ]; then
1070 - make_oldconfig
1071 - return 0
1072 - else
1073 - ewarn "Could not locate user configfile, so we will save a default one"
1074 - fi
1075 -
1076 - emake ARCH=$1 defconfig >/dev/null
1077 -
1078 - local defs_{y,n}
1079 -
1080 - # These are forced off
1081 - defs_n=(
1082 - DOASSERTS
1083 - DODEBUG_PT
1084 - HAS_NO_THREADS
1085 - PROPOLICE_BLOCK_ABRT
1086 - SSP_QUICK_CANARY
1087 - SUPPORT_LD_DEBUG_EARLY
1088 - UCLIBC_HAS_CTYPE_UNSAFE
1089 - UCLIBC_HAS_LOCALE
1090 - LDSO_SAFE_RUNPATH
1091 - )
1092 -
1093 - # These are forced on
1094 - defs_y=(
1095 - DO_C99_MATH
1096 - DO_XSI_MATH
1097 - FORCE_SHAREABLE_TEXT_SEGMENTS
1098 - LDSO_GNU_HASH_SUPPORT
1099 - LDSO_PRELOAD_FILE_SUPPORT
1100 - LDSO_RUNPATH
1101 - LDSO_RUNPATH_OF_EXECUTABLE
1102 - LDSO_STANDALONE_SUPPORT
1103 - PROPOLICE_BLOCK_SEGV
1104 - PTHREADS_DEBUG_SUPPORT
1105 - UCLIBC_HAS_ARC4RANDOM
1106 - UCLIBC_HAS_BACKTRACE
1107 - UCLIBC_HAS_BSD_RES_CLOSE
1108 - UCLIBC_HAS_CONTEXT_FUNCS
1109 - UCLIBC_HAS_CTYPE_CHECKED
1110 - UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
1111 - UCLIBC_HAS_FENV
1112 - UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
1113 - UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
1114 - UCLIBC_HAS_FOPEN_LARGEFILE_MODE
1115 - UCLIBC_HAS_FTS
1116 - UCLIBC_HAS_FTW
1117 - UCLIBC_HAS_GETPT
1118 - UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
1119 - UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
1120 - UCLIBC_HAS_GNU_GLOB
1121 - UCLIBC_HAS_HEXADECIMAL_FLOATS
1122 - UCLIBC_HAS_LIBUTIL
1123 - UCLIBC_HAS_NFTW
1124 - UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
1125 - UCLIBC_HAS_PRINTF_M_SPEC
1126 - UCLIBC_HAS_PROGRAM_INVOCATION_NAME
1127 - UCLIBC_HAS_RESOLVER_SUPPORT
1128 - UCLIBC_HAS_SHA256_CRYPT_IMPL
1129 - UCLIBC_HAS_SHA512_CRYPT_IMPL
1130 - UCLIBC_HAS_SSP
1131 - UCLIBC_HAS_STUBS
1132 - UCLIBC_HAS_SYS_ERRLIST
1133 - UCLIBC_HAS_SYS_SIGLIST
1134 - UCLIBC_HAS_THREADS_NATIVE
1135 - UCLIBC_HAS_TZ_FILE_READ_MANY
1136 - UCLIBC_HAS_UTMP
1137 - UCLIBC_HAS_UTMPX
1138 - UCLIBC_HAS_WCHAR
1139 - UCLIBC_HAS_WORDEXP
1140 - UCLIBC_NTP_LEGACY
1141 - UCLIBC_SUPPORT_AI_ADDRCONFIG
1142 - UCLIBC_SUSV2_LEGACY
1143 - UCLIBC_SUSV3_LEGACY
1144 - UCLIBC_SUSV3_LEGACY_MACROS
1145 - UCLIBC_SUSV4_LEGACY
1146 - UCLIBC_USE_NETLINK
1147 - )
1148 -
1149 - sed -i -e '/ARCH_.*_ENDIAN/d' .config
1150 - kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
1151 -
1152 - kconfig_q_opt debug DODEBUG
1153 - kconfig_q_opt debug SUPPORT_LD_DEBUG
1154 - kconfig_q_opt debug UCLIBC_HAS_PROFILING
1155 -
1156 - kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
1157 -
1158 - kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
1159 - kconfig_q_opt hardened UCLIBC_BUILD_NOW
1160 - kconfig_q_opt hardened UCLIBC_BUILD_PIE
1161 - kconfig_q_opt hardened UCLIBC_BUILD_RELRO
1162 - kconfig_q_opt hardened UCLIBC_BUILD_SSP
1163 -
1164 - local count def
1165 - for count in 1 2 ; do
1166 - # Run twice as some config opts depend on others being enabled first.
1167 - for def in ${defs_y[@]} ; do
1168 - sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
1169 - done
1170 - for def in ${defs_n[@]} ; do
1171 - sed -i -e "s|${def}=y|# ${def} is not set|g" .config
1172 - done
1173 - make_oldconfig
1174 - done
1175 -
1176 - einfo "Enabled options:"
1177 - for def in ${defs_y[@]} ; do
1178 - einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
1179 - done
1180 - einfo "Disabled options:"
1181 - for def in ${defs_n[@]} ; do
1182 - einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
1183 - done
1184 -
1185 - # setup build and run paths
1186 - sed -i \
1187 - -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
1188 - -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
1189 - -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
1190 - -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
1191 - -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
1192 - -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
1193 - .config || die
1194 -
1195 - make_oldconfig
1196 -}
1197 -
1198 -pkg_setup() {
1199 - # Make sure our CHOST is a uclibc toolchain for native compiling
1200 - if [[ ${CHOST} == ${CTARGET} ]]; then
1201 - case ${CHOST} in
1202 - *-uclinux*|*-uclibc*) ;;
1203 - *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
1204 - esac
1205 - fi
1206 -
1207 - # uClibc-ng doesn't carry old Linux threads, and since we force
1208 - # threading our only choice is NPTL which requires i486 and later.
1209 - [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
1210 -}
1211 -
1212 -src_prepare() {
1213 - local version subversion extraversion
1214 -
1215 - # uclibc-ng tries to create a two sym link with ld.so,
1216 - # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
1217 - # where MAJOR_VERSION != 0 indicates the ABI verison.
1218 - # We want to get rid of this and just have ABI = 0.
1219 - eapply "${FILESDIR}"/uclibc-compat-r1.patch
1220 -
1221 - # We need to change the major.minor.sublevel of uclibc-ng.
1222 - # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
1223 - # If we really want the ABI bump, we'll have to hack the gcc
1224 - # spec file and change the '*link:' rule.
1225 - version_0=$(ver_cut 1)
1226 - version_1=$(ver_cut 2)
1227 - version_2=$(ver_cut 3)
1228 - if [[ -z ${version_1} ]]; then
1229 - subversion=0
1230 - extraversion=0
1231 - else
1232 - subversion=${version_1}
1233 - if [[ -z ${version_2} ]]; then
1234 - extraversion=0
1235 - else
1236 - extraversion=.${version_2}
1237 - fi
1238 - fi
1239 -
1240 - sed -i \
1241 - -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
1242 - -e "/^MINOR_VERSION/s|:=.*|:= ${version_0}|" \
1243 - -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
1244 - -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
1245 - Rules.mak || die
1246 -
1247 - eapply_user
1248 -}
1249 -
1250 -src_configure() {
1251 - # Map our toolchain arch name to the name expected by uClibc-ng.
1252 - local target=$(tc-arch)
1253 - case ${target} in
1254 - amd64) target="x86_64";;
1255 - arm) target="arm";;
1256 - mips) target="mips";;
1257 - ppc) target="powerpc";;
1258 - x86) target="i386";;
1259 - esac
1260 -
1261 - # Do arch specific configuration by changing the defaults in
1262 - # extra/Configs/Config.<arch>. If these are not overridden
1263 - # by an save .config, they will be selected by default.
1264 -
1265 - # For i386, i486, i586 and i686
1266 - local cpu
1267 - if [[ ${target} == "i386" ]]; then
1268 - [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
1269 - sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
1270 - extra/Configs/Config.i386 || die
1271 - fi
1272 -
1273 - # For arm
1274 - if [[ ${target} == "arm" ]]; then
1275 - sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
1276 - fi
1277 -
1278 - # We set HOSTCC to the proper tuple rather than just 'gcc'
1279 - sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
1280 -
1281 - make_config ${target}
1282 -
1283 - einfo
1284 - einfo "Runtime Prefix: /"
1285 - einfo "Devel Prefix: /usr"
1286 - einfo "Kernel Prefix: $(alt_build_kprefix)"
1287 - einfo "CBUILD: ${CBUILD}"
1288 - einfo "CHOST: ${CHOST}"
1289 - einfo "CTARGET: ${CTARGET}"
1290 - einfo "ABI: ${ABI}"
1291 - einfo "ENDIAN: $(uclibc_endian)"
1292 - einfo
1293 -}
1294 -
1295 -src_compile() {
1296 - emake headers
1297 - just_headers && return 0
1298 -
1299 - emake
1300 - if is_crosscompile ; then
1301 - emake -C utils hostutils
1302 - else
1303 - emake utils
1304 - fi
1305 -}
1306 -
1307 -src_test() {
1308 - is_crosscompile && return 0
1309 -
1310 - # assert test fails on pax/grsec enabled kernels
1311 - # normal vfork test fails in sandbox (both glibc/uclibc)
1312 - emake UCLIBC_ONLY=1 check
1313 -}
1314 -
1315 -src_install() {
1316 - local sysroot=${D}
1317 - is_crosscompile && sysroot+="/usr/${CTARGET}"
1318 -
1319 - local target="install"
1320 - just_headers && target="install_headers"
1321 - emake DESTDIR="${sysroot}" ${target}
1322 -
1323 - save_config .config
1324 -
1325 - # remove files coming from kernel-headers
1326 - rm -rf "${sysroot}"/usr/include/{linux,asm*}
1327 -
1328 - # Make sure we install the sys-include symlink so that when
1329 - # we build a 2nd stage cross-compiler, gcc finds the target
1330 - # system headers correctly. See gcc/doc/gccinstall.info
1331 - if is_crosscompile ; then
1332 - dosym usr/include /usr/${CTARGET}/sys-include
1333 - if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
1334 - newbin utils/ldconfig.host ${CTARGET}-ldconfig
1335 - newbin utils/ldd.host ${CTARGET}-ldd
1336 - fi
1337 - return 0
1338 - fi
1339 -
1340 - if use symlink-compat; then
1341 - dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
1342 - dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
1343 - dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
1344 - dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
1345 - dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
1346 - dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
1347 - dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
1348 - dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
1349 - fi
1350 -
1351 - emake DESTDIR="${D}" install_utils
1352 - dobin extra/scripts/getent
1353 - dodoc README docs/*.txt
1354 -}
1355 -
1356 -pkg_postinst() {
1357 - is_crosscompile && return 0
1358 -
1359 - if [ ! -e "${ROOT}"/etc/TZ ] ; then
1360 - ewarn "Please remember to set your timezone in /etc/TZ"
1361 - mkdir -p "${ROOT}"/etc
1362 - echo "UTC" > "${ROOT}"/etc/TZ
1363 - fi
1364 - [ "${ROOT}" != "/" ] && return 0
1365 - # update cache before reloading init
1366 - ldconfig
1367 -}
1368
1369 diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.35.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.35.ebuild
1370 deleted file mode 100644
1371 index 5ef7e61a3a91..000000000000
1372 --- a/sys-libs/uclibc-ng/uclibc-ng-1.0.35.ebuild
1373 +++ /dev/null
1374 @@ -1,402 +0,0 @@
1375 -# Copyright 1999-2020 Gentoo Authors
1376 -# Distributed under the terms of the GNU General Public License v2
1377 -
1378 -EAPI="7"
1379 -
1380 -inherit flag-o-matic multilib savedconfig toolchain-funcs
1381 -
1382 -if [[ ${PV} == "9999" ]] ; then
1383 - EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
1384 - inherit git-r3
1385 - MY_P=uclibc-ng-${PV}
1386 -else
1387 - MY_P=uClibc-ng-${PV}
1388 -fi
1389 -
1390 -DESCRIPTION="C library for developing embedded Linux systems"
1391 -HOMEPAGE="https://uclibc-ng.org/"
1392 -if [[ ${PV} != "9999" ]] ; then
1393 - PATCH_VER=""
1394 - SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
1395 - KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
1396 -fi
1397 -
1398 -LICENSE="LGPL-2"
1399 -SLOT="0"
1400 -IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
1401 -# tests fail due to unusual makefile
1402 -RESTRICT="strip test"
1403 -
1404 -# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
1405 -# will delete the ld.so sym link prematurely and break the system. So we
1406 -# will hard block and give manual migration instructions.
1407 -# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
1408 -# the breakout library. The disadvantage here is that we have to sprinkle
1409 -# LDFAGS=-liconv on build systems that need to link against libiconv.
1410 -RDEPEND="
1411 - !!sys-libs/uclibc
1412 - iconv? ( dev-libs/libiconv )"
1413 -
1414 -S=${WORKDIR}/${MY_P}
1415 -
1416 -export CBUILD=${CBUILD:-${CHOST}}
1417 -export CTARGET=${CTARGET:-${CHOST}}
1418 -if [[ ${CHOST} == ${CTARGET} ]] ; then
1419 - if [[ ${CATEGORY} == cross-* ]] ; then
1420 - export CTARGET=${CATEGORY#cross-}
1421 - fi
1422 -fi
1423 -
1424 -is_crosscompile() {
1425 - [[ ${CHOST} != ${CTARGET} ]]
1426 -}
1427 -
1428 -alt_build_kprefix() {
1429 - if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
1430 - echo /usr/include
1431 - else
1432 - echo /usr/${CTARGET}/usr/include
1433 - fi
1434 -}
1435 -
1436 -just_headers() {
1437 - use headers-only && is_crosscompile
1438 -}
1439 -
1440 -uclibc_endian() {
1441 - # XXX: this wont work for a toolchain which is bi-endian, but we
1442 - # dont have any such thing at the moment, so not a big deal
1443 - touch "${T}"/endian.s
1444 - $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
1445 - case $(file "${T}"/endian.o) in
1446 - *" MSB "*) echo "BIG";;
1447 - *" LSB "*) echo "LITTLE";;
1448 - *) echo "NFC";;
1449 - esac
1450 - rm -f "${T}"/endian.{s,o}
1451 -}
1452 -
1453 -kconfig_q_opt() {
1454 - local flag=$1; shift
1455 - case ${flag} in
1456 - y|n) ;;
1457 - *) flag=$(usex ${flag} y n) ;;
1458 - esac
1459 -
1460 - local var="defs_${flag}"
1461 - eval "${var}+=( $* )"
1462 -}
1463 -
1464 -get_opt() {
1465 - (
1466 - unset ${1}
1467 - . ${2:-"${S}"/.config}
1468 - echo ${!1}
1469 - )
1470 -}
1471 -
1472 -make_oldconfig() {
1473 - yes "" 2>/dev/null | emake -s oldconfig >/dev/null
1474 -}
1475 -
1476 -make_config() {
1477 - restore_config .config
1478 - if [ -f .config ]; then
1479 - make_oldconfig
1480 - return 0
1481 - else
1482 - ewarn "Could not locate user configfile, so we will save a default one"
1483 - fi
1484 -
1485 - emake ARCH=$1 defconfig >/dev/null
1486 -
1487 - local defs_{y,n}
1488 -
1489 - # These are forced off
1490 - defs_n=(
1491 - DOASSERTS
1492 - DODEBUG_PT
1493 - HAS_NO_THREADS
1494 - PROPOLICE_BLOCK_ABRT
1495 - SSP_QUICK_CANARY
1496 - SUPPORT_LD_DEBUG_EARLY
1497 - UCLIBC_HAS_CTYPE_UNSAFE
1498 - UCLIBC_HAS_LOCALE
1499 - LDSO_SAFE_RUNPATH
1500 - )
1501 -
1502 - # These are forced on
1503 - defs_y=(
1504 - DO_C99_MATH
1505 - DO_XSI_MATH
1506 - FORCE_SHAREABLE_TEXT_SEGMENTS
1507 - LDSO_GNU_HASH_SUPPORT
1508 - LDSO_PRELOAD_FILE_SUPPORT
1509 - LDSO_RUNPATH
1510 - LDSO_RUNPATH_OF_EXECUTABLE
1511 - LDSO_STANDALONE_SUPPORT
1512 - PROPOLICE_BLOCK_SEGV
1513 - PTHREADS_DEBUG_SUPPORT
1514 - UCLIBC_HAS_ARC4RANDOM
1515 - UCLIBC_HAS_BACKTRACE
1516 - UCLIBC_HAS_BSD_RES_CLOSE
1517 - UCLIBC_HAS_CONTEXT_FUNCS
1518 - UCLIBC_HAS_CTYPE_CHECKED
1519 - UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
1520 - UCLIBC_HAS_FENV
1521 - UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
1522 - UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
1523 - UCLIBC_HAS_FOPEN_LARGEFILE_MODE
1524 - UCLIBC_HAS_FTS
1525 - UCLIBC_HAS_FTW
1526 - UCLIBC_HAS_GETPT
1527 - UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
1528 - UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
1529 - UCLIBC_HAS_GNU_GLOB
1530 - UCLIBC_HAS_HEXADECIMAL_FLOATS
1531 - UCLIBC_HAS_LIBUTIL
1532 - UCLIBC_HAS_NFTW
1533 - UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
1534 - UCLIBC_HAS_PRINTF_M_SPEC
1535 - UCLIBC_HAS_PROGRAM_INVOCATION_NAME
1536 - UCLIBC_HAS_RESOLVER_SUPPORT
1537 - UCLIBC_HAS_SHA256_CRYPT_IMPL
1538 - UCLIBC_HAS_SHA512_CRYPT_IMPL
1539 - UCLIBC_HAS_SSP
1540 - UCLIBC_HAS_STUBS
1541 - UCLIBC_HAS_SYS_ERRLIST
1542 - UCLIBC_HAS_SYS_SIGLIST
1543 - UCLIBC_HAS_THREADS_NATIVE
1544 - UCLIBC_HAS_TZ_FILE_READ_MANY
1545 - UCLIBC_HAS_UTMP
1546 - UCLIBC_HAS_UTMPX
1547 - UCLIBC_HAS_WCHAR
1548 - UCLIBC_HAS_WORDEXP
1549 - UCLIBC_NTP_LEGACY
1550 - UCLIBC_SUPPORT_AI_ADDRCONFIG
1551 - UCLIBC_SUSV2_LEGACY
1552 - UCLIBC_SUSV3_LEGACY
1553 - UCLIBC_SUSV3_LEGACY_MACROS
1554 - UCLIBC_SUSV4_LEGACY
1555 - UCLIBC_USE_NETLINK
1556 - )
1557 -
1558 - sed -i -e '/ARCH_.*_ENDIAN/d' .config
1559 - kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
1560 -
1561 - kconfig_q_opt debug DODEBUG
1562 - kconfig_q_opt debug SUPPORT_LD_DEBUG
1563 - kconfig_q_opt debug UCLIBC_HAS_PROFILING
1564 -
1565 - kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
1566 -
1567 - kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
1568 - kconfig_q_opt hardened UCLIBC_BUILD_NOW
1569 - kconfig_q_opt hardened UCLIBC_BUILD_PIE
1570 - kconfig_q_opt hardened UCLIBC_BUILD_RELRO
1571 - kconfig_q_opt hardened UCLIBC_BUILD_SSP
1572 -
1573 - local count def
1574 - for count in 1 2 ; do
1575 - # Run twice as some config opts depend on others being enabled first.
1576 - for def in ${defs_y[@]} ; do
1577 - sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
1578 - done
1579 - for def in ${defs_n[@]} ; do
1580 - sed -i -e "s|${def}=y|# ${def} is not set|g" .config
1581 - done
1582 - make_oldconfig
1583 - done
1584 -
1585 - einfo "Enabled options:"
1586 - for def in ${defs_y[@]} ; do
1587 - einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
1588 - done
1589 - einfo "Disabled options:"
1590 - for def in ${defs_n[@]} ; do
1591 - einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
1592 - done
1593 -
1594 - # setup build and run paths
1595 - sed -i \
1596 - -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
1597 - -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
1598 - -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
1599 - -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
1600 - -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
1601 - -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
1602 - .config || die
1603 -
1604 - make_oldconfig
1605 -}
1606 -
1607 -pkg_setup() {
1608 - # Make sure our CHOST is a uclibc toolchain for native compiling
1609 - if [[ ${CHOST} == ${CTARGET} ]]; then
1610 - case ${CHOST} in
1611 - *-uclinux*|*-uclibc*) ;;
1612 - *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
1613 - esac
1614 - fi
1615 -
1616 - # uClibc-ng doesn't carry old Linux threads, and since we force
1617 - # threading our only choice is NPTL which requires i486 and later.
1618 - [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
1619 -}
1620 -
1621 -src_prepare() {
1622 - local version subversion extraversion
1623 -
1624 - # uclibc-ng tries to create a two sym link with ld.so,
1625 - # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
1626 - # where MAJOR_VERSION != 0 indicates the ABI verison.
1627 - # We want to get rid of this and just have ABI = 0.
1628 - eapply "${FILESDIR}"/uclibc-compat-r1.patch
1629 -
1630 - # We need to change the major.minor.sublevel of uclibc-ng.
1631 - # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
1632 - # If we really want the ABI bump, we'll have to hack the gcc
1633 - # spec file and change the '*link:' rule.
1634 - version_0=$(ver_cut 1)
1635 - version_1=$(ver_cut 2)
1636 - version_2=$(ver_cut 3)
1637 - if [[ -z ${version_1} ]]; then
1638 - subversion=0
1639 - extraversion=0
1640 - else
1641 - subversion=${version_1}
1642 - if [[ -z ${version_2} ]]; then
1643 - extraversion=0
1644 - else
1645 - extraversion=.${version_2}
1646 - fi
1647 - fi
1648 -
1649 - sed -i \
1650 - -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
1651 - -e "/^MINOR_VERSION/s|:=.*|:= ${version_0}|" \
1652 - -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
1653 - -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
1654 - Rules.mak || die
1655 -
1656 - eapply_user
1657 -}
1658 -
1659 -src_configure() {
1660 - # Map our toolchain arch name to the name expected by uClibc-ng.
1661 - local target=$(tc-arch)
1662 - case ${target} in
1663 - amd64) target="x86_64";;
1664 - arm) target="arm";;
1665 - mips) target="mips";;
1666 - ppc) target="powerpc";;
1667 - x86) target="i386";;
1668 - esac
1669 -
1670 - # Do arch specific configuration by changing the defaults in
1671 - # extra/Configs/Config.<arch>. If these are not overridden
1672 - # by an save .config, they will be selected by default.
1673 -
1674 - # For i386, i486, i586 and i686
1675 - local cpu
1676 - if [[ ${target} == "i386" ]]; then
1677 - [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
1678 - sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
1679 - extra/Configs/Config.i386 || die
1680 - fi
1681 -
1682 - # For arm
1683 - if [[ ${target} == "arm" ]]; then
1684 - sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
1685 - fi
1686 -
1687 - # We set HOSTCC to the proper tuple rather than just 'gcc'
1688 - sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
1689 -
1690 - make_config ${target}
1691 -
1692 - einfo
1693 - einfo "Runtime Prefix: /"
1694 - einfo "Devel Prefix: /usr"
1695 - einfo "Kernel Prefix: $(alt_build_kprefix)"
1696 - einfo "CBUILD: ${CBUILD}"
1697 - einfo "CHOST: ${CHOST}"
1698 - einfo "CTARGET: ${CTARGET}"
1699 - einfo "ABI: ${ABI}"
1700 - einfo "ENDIAN: $(uclibc_endian)"
1701 - einfo
1702 -}
1703 -
1704 -src_compile() {
1705 - emake headers
1706 - just_headers && return 0
1707 -
1708 - emake
1709 - if is_crosscompile ; then
1710 - emake -C utils hostutils
1711 - else
1712 - emake utils
1713 - fi
1714 -}
1715 -
1716 -src_test() {
1717 - is_crosscompile && return 0
1718 -
1719 - # assert test fails on pax/grsec enabled kernels
1720 - # normal vfork test fails in sandbox (both glibc/uclibc)
1721 - emake UCLIBC_ONLY=1 check
1722 -}
1723 -
1724 -src_install() {
1725 - local sysroot=${D}
1726 - is_crosscompile && sysroot+="/usr/${CTARGET}"
1727 -
1728 - local target="install"
1729 - just_headers && target="install_headers"
1730 - emake DESTDIR="${sysroot}" ${target}
1731 -
1732 - save_config .config
1733 -
1734 - # remove files coming from kernel-headers
1735 - rm -rf "${sysroot}"/usr/include/{linux,asm*}
1736 -
1737 - # Make sure we install the sys-include symlink so that when
1738 - # we build a 2nd stage cross-compiler, gcc finds the target
1739 - # system headers correctly. See gcc/doc/gccinstall.info
1740 - if is_crosscompile ; then
1741 - dosym usr/include /usr/${CTARGET}/sys-include
1742 - if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
1743 - newbin utils/ldconfig.host ${CTARGET}-ldconfig
1744 - newbin utils/ldd.host ${CTARGET}-ldd
1745 - fi
1746 - return 0
1747 - fi
1748 -
1749 - if use symlink-compat; then
1750 - dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
1751 - dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
1752 - dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
1753 - dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
1754 - dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
1755 - dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
1756 - dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
1757 - dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
1758 - fi
1759 -
1760 - emake DESTDIR="${D}" install_utils
1761 - dobin extra/scripts/getent
1762 - dodoc README docs/*.txt
1763 -}
1764 -
1765 -pkg_postinst() {
1766 - is_crosscompile && return 0
1767 -
1768 - if [ ! -e "${ROOT}"/etc/TZ ] ; then
1769 - ewarn "Please remember to set your timezone in /etc/TZ"
1770 - mkdir -p "${ROOT}"/etc
1771 - echo "UTC" > "${ROOT}"/etc/TZ
1772 - fi
1773 - [ "${ROOT}" != "/" ] && return 0
1774 - # update cache before reloading init
1775 - ldconfig
1776 -}
1777
1778 diff --git a/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild b/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
1779 deleted file mode 100644
1780 index 5ef7e61a3a91..000000000000
1781 --- a/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
1782 +++ /dev/null
1783 @@ -1,402 +0,0 @@
1784 -# Copyright 1999-2020 Gentoo Authors
1785 -# Distributed under the terms of the GNU General Public License v2
1786 -
1787 -EAPI="7"
1788 -
1789 -inherit flag-o-matic multilib savedconfig toolchain-funcs
1790 -
1791 -if [[ ${PV} == "9999" ]] ; then
1792 - EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
1793 - inherit git-r3
1794 - MY_P=uclibc-ng-${PV}
1795 -else
1796 - MY_P=uClibc-ng-${PV}
1797 -fi
1798 -
1799 -DESCRIPTION="C library for developing embedded Linux systems"
1800 -HOMEPAGE="https://uclibc-ng.org/"
1801 -if [[ ${PV} != "9999" ]] ; then
1802 - PATCH_VER=""
1803 - SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
1804 - KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
1805 -fi
1806 -
1807 -LICENSE="LGPL-2"
1808 -SLOT="0"
1809 -IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
1810 -# tests fail due to unusual makefile
1811 -RESTRICT="strip test"
1812 -
1813 -# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
1814 -# will delete the ld.so sym link prematurely and break the system. So we
1815 -# will hard block and give manual migration instructions.
1816 -# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
1817 -# the breakout library. The disadvantage here is that we have to sprinkle
1818 -# LDFAGS=-liconv on build systems that need to link against libiconv.
1819 -RDEPEND="
1820 - !!sys-libs/uclibc
1821 - iconv? ( dev-libs/libiconv )"
1822 -
1823 -S=${WORKDIR}/${MY_P}
1824 -
1825 -export CBUILD=${CBUILD:-${CHOST}}
1826 -export CTARGET=${CTARGET:-${CHOST}}
1827 -if [[ ${CHOST} == ${CTARGET} ]] ; then
1828 - if [[ ${CATEGORY} == cross-* ]] ; then
1829 - export CTARGET=${CATEGORY#cross-}
1830 - fi
1831 -fi
1832 -
1833 -is_crosscompile() {
1834 - [[ ${CHOST} != ${CTARGET} ]]
1835 -}
1836 -
1837 -alt_build_kprefix() {
1838 - if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
1839 - echo /usr/include
1840 - else
1841 - echo /usr/${CTARGET}/usr/include
1842 - fi
1843 -}
1844 -
1845 -just_headers() {
1846 - use headers-only && is_crosscompile
1847 -}
1848 -
1849 -uclibc_endian() {
1850 - # XXX: this wont work for a toolchain which is bi-endian, but we
1851 - # dont have any such thing at the moment, so not a big deal
1852 - touch "${T}"/endian.s
1853 - $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
1854 - case $(file "${T}"/endian.o) in
1855 - *" MSB "*) echo "BIG";;
1856 - *" LSB "*) echo "LITTLE";;
1857 - *) echo "NFC";;
1858 - esac
1859 - rm -f "${T}"/endian.{s,o}
1860 -}
1861 -
1862 -kconfig_q_opt() {
1863 - local flag=$1; shift
1864 - case ${flag} in
1865 - y|n) ;;
1866 - *) flag=$(usex ${flag} y n) ;;
1867 - esac
1868 -
1869 - local var="defs_${flag}"
1870 - eval "${var}+=( $* )"
1871 -}
1872 -
1873 -get_opt() {
1874 - (
1875 - unset ${1}
1876 - . ${2:-"${S}"/.config}
1877 - echo ${!1}
1878 - )
1879 -}
1880 -
1881 -make_oldconfig() {
1882 - yes "" 2>/dev/null | emake -s oldconfig >/dev/null
1883 -}
1884 -
1885 -make_config() {
1886 - restore_config .config
1887 - if [ -f .config ]; then
1888 - make_oldconfig
1889 - return 0
1890 - else
1891 - ewarn "Could not locate user configfile, so we will save a default one"
1892 - fi
1893 -
1894 - emake ARCH=$1 defconfig >/dev/null
1895 -
1896 - local defs_{y,n}
1897 -
1898 - # These are forced off
1899 - defs_n=(
1900 - DOASSERTS
1901 - DODEBUG_PT
1902 - HAS_NO_THREADS
1903 - PROPOLICE_BLOCK_ABRT
1904 - SSP_QUICK_CANARY
1905 - SUPPORT_LD_DEBUG_EARLY
1906 - UCLIBC_HAS_CTYPE_UNSAFE
1907 - UCLIBC_HAS_LOCALE
1908 - LDSO_SAFE_RUNPATH
1909 - )
1910 -
1911 - # These are forced on
1912 - defs_y=(
1913 - DO_C99_MATH
1914 - DO_XSI_MATH
1915 - FORCE_SHAREABLE_TEXT_SEGMENTS
1916 - LDSO_GNU_HASH_SUPPORT
1917 - LDSO_PRELOAD_FILE_SUPPORT
1918 - LDSO_RUNPATH
1919 - LDSO_RUNPATH_OF_EXECUTABLE
1920 - LDSO_STANDALONE_SUPPORT
1921 - PROPOLICE_BLOCK_SEGV
1922 - PTHREADS_DEBUG_SUPPORT
1923 - UCLIBC_HAS_ARC4RANDOM
1924 - UCLIBC_HAS_BACKTRACE
1925 - UCLIBC_HAS_BSD_RES_CLOSE
1926 - UCLIBC_HAS_CONTEXT_FUNCS
1927 - UCLIBC_HAS_CTYPE_CHECKED
1928 - UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
1929 - UCLIBC_HAS_FENV
1930 - UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
1931 - UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
1932 - UCLIBC_HAS_FOPEN_LARGEFILE_MODE
1933 - UCLIBC_HAS_FTS
1934 - UCLIBC_HAS_FTW
1935 - UCLIBC_HAS_GETPT
1936 - UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
1937 - UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
1938 - UCLIBC_HAS_GNU_GLOB
1939 - UCLIBC_HAS_HEXADECIMAL_FLOATS
1940 - UCLIBC_HAS_LIBUTIL
1941 - UCLIBC_HAS_NFTW
1942 - UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
1943 - UCLIBC_HAS_PRINTF_M_SPEC
1944 - UCLIBC_HAS_PROGRAM_INVOCATION_NAME
1945 - UCLIBC_HAS_RESOLVER_SUPPORT
1946 - UCLIBC_HAS_SHA256_CRYPT_IMPL
1947 - UCLIBC_HAS_SHA512_CRYPT_IMPL
1948 - UCLIBC_HAS_SSP
1949 - UCLIBC_HAS_STUBS
1950 - UCLIBC_HAS_SYS_ERRLIST
1951 - UCLIBC_HAS_SYS_SIGLIST
1952 - UCLIBC_HAS_THREADS_NATIVE
1953 - UCLIBC_HAS_TZ_FILE_READ_MANY
1954 - UCLIBC_HAS_UTMP
1955 - UCLIBC_HAS_UTMPX
1956 - UCLIBC_HAS_WCHAR
1957 - UCLIBC_HAS_WORDEXP
1958 - UCLIBC_NTP_LEGACY
1959 - UCLIBC_SUPPORT_AI_ADDRCONFIG
1960 - UCLIBC_SUSV2_LEGACY
1961 - UCLIBC_SUSV3_LEGACY
1962 - UCLIBC_SUSV3_LEGACY_MACROS
1963 - UCLIBC_SUSV4_LEGACY
1964 - UCLIBC_USE_NETLINK
1965 - )
1966 -
1967 - sed -i -e '/ARCH_.*_ENDIAN/d' .config
1968 - kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
1969 -
1970 - kconfig_q_opt debug DODEBUG
1971 - kconfig_q_opt debug SUPPORT_LD_DEBUG
1972 - kconfig_q_opt debug UCLIBC_HAS_PROFILING
1973 -
1974 - kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
1975 -
1976 - kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
1977 - kconfig_q_opt hardened UCLIBC_BUILD_NOW
1978 - kconfig_q_opt hardened UCLIBC_BUILD_PIE
1979 - kconfig_q_opt hardened UCLIBC_BUILD_RELRO
1980 - kconfig_q_opt hardened UCLIBC_BUILD_SSP
1981 -
1982 - local count def
1983 - for count in 1 2 ; do
1984 - # Run twice as some config opts depend on others being enabled first.
1985 - for def in ${defs_y[@]} ; do
1986 - sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
1987 - done
1988 - for def in ${defs_n[@]} ; do
1989 - sed -i -e "s|${def}=y|# ${def} is not set|g" .config
1990 - done
1991 - make_oldconfig
1992 - done
1993 -
1994 - einfo "Enabled options:"
1995 - for def in ${defs_y[@]} ; do
1996 - einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
1997 - done
1998 - einfo "Disabled options:"
1999 - for def in ${defs_n[@]} ; do
2000 - einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
2001 - done
2002 -
2003 - # setup build and run paths
2004 - sed -i \
2005 - -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
2006 - -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
2007 - -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
2008 - -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
2009 - -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
2010 - -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
2011 - .config || die
2012 -
2013 - make_oldconfig
2014 -}
2015 -
2016 -pkg_setup() {
2017 - # Make sure our CHOST is a uclibc toolchain for native compiling
2018 - if [[ ${CHOST} == ${CTARGET} ]]; then
2019 - case ${CHOST} in
2020 - *-uclinux*|*-uclibc*) ;;
2021 - *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
2022 - esac
2023 - fi
2024 -
2025 - # uClibc-ng doesn't carry old Linux threads, and since we force
2026 - # threading our only choice is NPTL which requires i486 and later.
2027 - [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
2028 -}
2029 -
2030 -src_prepare() {
2031 - local version subversion extraversion
2032 -
2033 - # uclibc-ng tries to create a two sym link with ld.so,
2034 - # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
2035 - # where MAJOR_VERSION != 0 indicates the ABI verison.
2036 - # We want to get rid of this and just have ABI = 0.
2037 - eapply "${FILESDIR}"/uclibc-compat-r1.patch
2038 -
2039 - # We need to change the major.minor.sublevel of uclibc-ng.
2040 - # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
2041 - # If we really want the ABI bump, we'll have to hack the gcc
2042 - # spec file and change the '*link:' rule.
2043 - version_0=$(ver_cut 1)
2044 - version_1=$(ver_cut 2)
2045 - version_2=$(ver_cut 3)
2046 - if [[ -z ${version_1} ]]; then
2047 - subversion=0
2048 - extraversion=0
2049 - else
2050 - subversion=${version_1}
2051 - if [[ -z ${version_2} ]]; then
2052 - extraversion=0
2053 - else
2054 - extraversion=.${version_2}
2055 - fi
2056 - fi
2057 -
2058 - sed -i \
2059 - -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
2060 - -e "/^MINOR_VERSION/s|:=.*|:= ${version_0}|" \
2061 - -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
2062 - -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
2063 - Rules.mak || die
2064 -
2065 - eapply_user
2066 -}
2067 -
2068 -src_configure() {
2069 - # Map our toolchain arch name to the name expected by uClibc-ng.
2070 - local target=$(tc-arch)
2071 - case ${target} in
2072 - amd64) target="x86_64";;
2073 - arm) target="arm";;
2074 - mips) target="mips";;
2075 - ppc) target="powerpc";;
2076 - x86) target="i386";;
2077 - esac
2078 -
2079 - # Do arch specific configuration by changing the defaults in
2080 - # extra/Configs/Config.<arch>. If these are not overridden
2081 - # by an save .config, they will be selected by default.
2082 -
2083 - # For i386, i486, i586 and i686
2084 - local cpu
2085 - if [[ ${target} == "i386" ]]; then
2086 - [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
2087 - sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
2088 - extra/Configs/Config.i386 || die
2089 - fi
2090 -
2091 - # For arm
2092 - if [[ ${target} == "arm" ]]; then
2093 - sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
2094 - fi
2095 -
2096 - # We set HOSTCC to the proper tuple rather than just 'gcc'
2097 - sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
2098 -
2099 - make_config ${target}
2100 -
2101 - einfo
2102 - einfo "Runtime Prefix: /"
2103 - einfo "Devel Prefix: /usr"
2104 - einfo "Kernel Prefix: $(alt_build_kprefix)"
2105 - einfo "CBUILD: ${CBUILD}"
2106 - einfo "CHOST: ${CHOST}"
2107 - einfo "CTARGET: ${CTARGET}"
2108 - einfo "ABI: ${ABI}"
2109 - einfo "ENDIAN: $(uclibc_endian)"
2110 - einfo
2111 -}
2112 -
2113 -src_compile() {
2114 - emake headers
2115 - just_headers && return 0
2116 -
2117 - emake
2118 - if is_crosscompile ; then
2119 - emake -C utils hostutils
2120 - else
2121 - emake utils
2122 - fi
2123 -}
2124 -
2125 -src_test() {
2126 - is_crosscompile && return 0
2127 -
2128 - # assert test fails on pax/grsec enabled kernels
2129 - # normal vfork test fails in sandbox (both glibc/uclibc)
2130 - emake UCLIBC_ONLY=1 check
2131 -}
2132 -
2133 -src_install() {
2134 - local sysroot=${D}
2135 - is_crosscompile && sysroot+="/usr/${CTARGET}"
2136 -
2137 - local target="install"
2138 - just_headers && target="install_headers"
2139 - emake DESTDIR="${sysroot}" ${target}
2140 -
2141 - save_config .config
2142 -
2143 - # remove files coming from kernel-headers
2144 - rm -rf "${sysroot}"/usr/include/{linux,asm*}
2145 -
2146 - # Make sure we install the sys-include symlink so that when
2147 - # we build a 2nd stage cross-compiler, gcc finds the target
2148 - # system headers correctly. See gcc/doc/gccinstall.info
2149 - if is_crosscompile ; then
2150 - dosym usr/include /usr/${CTARGET}/sys-include
2151 - if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
2152 - newbin utils/ldconfig.host ${CTARGET}-ldconfig
2153 - newbin utils/ldd.host ${CTARGET}-ldd
2154 - fi
2155 - return 0
2156 - fi
2157 -
2158 - if use symlink-compat; then
2159 - dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
2160 - dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
2161 - dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
2162 - dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
2163 - dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
2164 - dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
2165 - dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
2166 - dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
2167 - fi
2168 -
2169 - emake DESTDIR="${D}" install_utils
2170 - dobin extra/scripts/getent
2171 - dodoc README docs/*.txt
2172 -}
2173 -
2174 -pkg_postinst() {
2175 - is_crosscompile && return 0
2176 -
2177 - if [ ! -e "${ROOT}"/etc/TZ ] ; then
2178 - ewarn "Please remember to set your timezone in /etc/TZ"
2179 - mkdir -p "${ROOT}"/etc
2180 - echo "UTC" > "${ROOT}"/etc/TZ
2181 - fi
2182 - [ "${ROOT}" != "/" ] && return 0
2183 - # update cache before reloading init
2184 - ldconfig
2185 -}