Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/uclibc-ng/
Date: Sun, 27 Oct 2019 02:13:09
Message-Id: 1572142377.66063d78eafb7cd8b3d9f09aaad789d531f6f70d.blueness@gentoo
1 commit: 66063d78eafb7cd8b3d9f09aaad789d531f6f70d
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 27 02:12:00 2019 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 27 02:12:57 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66063d78
7
8 sys-libs/uclibc-ng: remove older versions
9
10 Package-Manager: Portage-2.3.76, Repoman-2.3.16
11 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
12
13 sys-libs/uclibc-ng/Manifest | 2 -
14 sys-libs/uclibc-ng/metadata.xml | 1 -
15 sys-libs/uclibc-ng/uclibc-ng-1.0.26.ebuild | 411 --------------------------
16 sys-libs/uclibc-ng/uclibc-ng-1.0.30-r1.ebuild | 405 -------------------------
17 4 files changed, 819 deletions(-)
18
19 diff --git a/sys-libs/uclibc-ng/Manifest b/sys-libs/uclibc-ng/Manifest
20 index dd21e427d50..de7fae1db80 100644
21 --- a/sys-libs/uclibc-ng/Manifest
22 +++ b/sys-libs/uclibc-ng/Manifest
23 @@ -1,4 +1,2 @@
24 -DIST uClibc-ng-1.0.26.tar.bz2 2285709 BLAKE2B 6276f1d080f0c90b5a0ce4a4fc3556070852ad157b9c0a15305108b2f46a2d0f5371dde12ac0a8f05cad7db942cceb8057b5ef351e100a52609f2ebdc6b19634 SHA512 48c37ab2000af13848ef007ce89f226bded5188f37839c11371bab48497670d30d39fda2a031c6aff95f429a4abadc431ddd77c0e023810a341e2c2d2645f71b
25 -DIST uClibc-ng-1.0.30.tar.bz2 2302796 BLAKE2B 21888dfe5a68f83b7ba56bb557ecc5aa19fd75cedc82f2ed48073f47655888719feb27943e0309f8101a24fd2fd9165af31d5679f21c00b12f27ebfccf354bac SHA512 ddd1d91dcfdf7be8471afecf13196563ad348c41e2fa8b63ae50b83f103cf8ed8d9f003b51a54a58db2935b84692b7c011a4779582f30610ede44cb583aae742
26 DIST uClibc-ng-1.0.31.tar.bz2 2351728 BLAKE2B e2cad8500fdafdd98db11cbc756f3277845fedf545598c9861b1d1ef51b3a24744afe635d6894929eb537891323b0627577c2a5e5dbe1ff0ae588c5aa53a1219 SHA512 489e5f5e8952ebfad1d8a5528a04420d9d2e58fa5092029ccdae91d81dfcf8b3e00092453432da94c76fc18cab542192040bfb271e367fa42ca4926f4b45c372
27 DIST uClibc-ng-1.0.32.tar.bz2 2352471 BLAKE2B 887b67f7f03fc8610d8236a18f90584720a78bfc3a036cd6616453bea6e31140f5fd1dfd1d207cc5100854bf3e0c5cc1ca38fe6c31cf97b631892767ae23ec27 SHA512 1de5d4e99b94eeeada4233c53a95ea1b9e704ce1d4aa19ca9b17535c0328b2372ed93d24591c6ea5bfbc0b950aa575c18dcf6950fb04342924bb2b5f9ee235e8
28
29 diff --git a/sys-libs/uclibc-ng/metadata.xml b/sys-libs/uclibc-ng/metadata.xml
30 index 12420ae8d3b..a06e85b4368 100644
31 --- a/sys-libs/uclibc-ng/metadata.xml
32 +++ b/sys-libs/uclibc-ng/metadata.xml
33 @@ -15,7 +15,6 @@
34 also work perfectly with uClibc-ng.
35 </longdescription>
36 <use>
37 - <flag name="rpc">Enable sun nis/rpc support (you should use libtirpc though)</flag>
38 <flag name="symlink-compat">Explicitly add sym links for libdl.so.0, libm.so.0, and
39 friends for backward compatibility with sys-libs/uclibc-ng-1.0.17 and earlier</flag>
40 </use>
41
42 diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.26.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.26.ebuild
43 deleted file mode 100644
44 index 572b3800cec..00000000000
45 --- a/sys-libs/uclibc-ng/uclibc-ng-1.0.26.ebuild
46 +++ /dev/null
47 @@ -1,411 +0,0 @@
48 -# Copyright 1999-2018 Gentoo Authors
49 -# Distributed under the terms of the GNU General Public License v2
50 -
51 -EAPI="6"
52 -
53 -inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
54 -
55 -if [[ ${PV} == "9999" ]] ; then
56 - EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
57 - inherit git-r3
58 - MY_P=uclibc-ng-${PV}
59 -else
60 - MY_P=uClibc-ng-${PV}
61 -fi
62 -
63 -DESCRIPTION="C library for developing embedded Linux systems"
64 -HOMEPAGE="https://uclibc-ng.org/"
65 -if [[ ${PV} != "9999" ]] ; then
66 - PATCH_VER=""
67 - SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
68 - KEYWORDS="-* amd64 arm ~mips ~ppc x86"
69 -fi
70 -
71 -LICENSE="LGPL-2"
72 -SLOT="0"
73 -IUSE="debug hardened iconv ipv6 rpc symlink-compat headers-only"
74 -# tests fail due to unusual makefile
75 -RESTRICT="strip test"
76 -
77 -# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
78 -# will delete the ld.so sym link prematurely and break the system. So we
79 -# will hard block and give manual migration instructions.
80 -# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
81 -# the breakout library. The disadvantage here is that we have to sprinkle
82 -# LDFAGS=-liconv on build systems that need to link against libiconv.
83 -RDEPEND="
84 - !!sys-libs/uclibc
85 - iconv? ( dev-libs/libiconv )"
86 -
87 -S=${WORKDIR}/${MY_P}
88 -
89 -export CBUILD=${CBUILD:-${CHOST}}
90 -export CTARGET=${CTARGET:-${CHOST}}
91 -if [[ ${CHOST} == ${CTARGET} ]] ; then
92 - if [[ ${CATEGORY} == cross-* ]] ; then
93 - export CTARGET=${CATEGORY#cross-}
94 - fi
95 -fi
96 -
97 -is_crosscompile() {
98 - [[ ${CHOST} != ${CTARGET} ]]
99 -}
100 -
101 -alt_build_kprefix() {
102 - if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
103 - echo /usr/include
104 - else
105 - echo /usr/${CTARGET}/usr/include
106 - fi
107 -}
108 -
109 -just_headers() {
110 - use headers-only && is_crosscompile
111 -}
112 -
113 -uclibc_endian() {
114 - # XXX: this wont work for a toolchain which is bi-endian, but we
115 - # dont have any such thing at the moment, so not a big deal
116 - touch "${T}"/endian.s
117 - $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
118 - case $(file "${T}"/endian.o) in
119 - *" MSB "*) echo "BIG";;
120 - *" LSB "*) echo "LITTLE";;
121 - *) echo "NFC";;
122 - esac
123 - rm -f "${T}"/endian.{s,o}
124 -}
125 -
126 -kconfig_q_opt() {
127 - local flag=$1; shift
128 - case ${flag} in
129 - y|n) ;;
130 - *) flag=$(usex ${flag} y n) ;;
131 - esac
132 -
133 - local var="defs_${flag}"
134 - eval "${var}+=( $* )"
135 -}
136 -
137 -get_opt() {
138 - (
139 - unset ${1}
140 - . ${2:-"${S}"/.config}
141 - echo ${!1}
142 - )
143 -}
144 -
145 -make_oldconfig() {
146 - yes "" 2>/dev/null | emake -s oldconfig >/dev/null
147 -}
148 -
149 -make_config() {
150 - restore_config .config
151 - if [ -f .config ]; then
152 - make_oldconfig
153 - return 0
154 - else
155 - ewarn "Could not locate user configfile, so we will save a default one"
156 - fi
157 -
158 - emake ARCH=$1 defconfig >/dev/null
159 -
160 - local defs_{y,n}
161 -
162 - # These are forced off
163 - defs_n=(
164 - DOASSERTS
165 - DODEBUG_PT
166 - HAS_NO_THREADS
167 - PROPOLICE_BLOCK_ABRT
168 - SSP_QUICK_CANARY
169 - SUPPORT_LD_DEBUG_EARLY
170 - UCLIBC_HAS_CTYPE_UNSAFE
171 - UCLIBC_HAS_LOCALE
172 - UCLIBC_HAS_SSP_COMPAT
173 - )
174 -
175 - # These are forced on
176 - defs_y=(
177 - COMPAT_ATEXIT
178 - DO_C99_MATH
179 - DO_XSI_MATH
180 - FORCE_SHAREABLE_TEXT_SEGMENTS
181 - LDSO_GNU_HASH_SUPPORT
182 - LDSO_PRELINK_SUPPORT
183 - LDSO_PRELOAD_FILE_SUPPORT
184 - LDSO_RUNPATH_OF_EXECUTABLE
185 - LDSO_STANDALONE_SUPPORT
186 - MALLOC_GLIBC_COMPAT
187 - PROPOLICE_BLOCK_SEGV
188 - PTHREADS_DEBUG_SUPPORT
189 - UCLIBC_HAS_ARC4RANDOM
190 - UCLIBC_HAS_BACKTRACE
191 - UCLIBC_HAS_BSD_RES_CLOSE
192 - UCLIBC_HAS_CONTEXT_FUNCS
193 - UCLIBC_HAS_CTYPE_CHECKED
194 - UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
195 - UCLIBC_HAS_FENV
196 - UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
197 - UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
198 - UCLIBC_HAS_FOPEN_LARGEFILE_MODE
199 - UCLIBC_HAS_FTS
200 - UCLIBC_HAS_FTW
201 - UCLIBC_HAS_GETPT
202 - UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
203 - UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
204 - UCLIBC_HAS_GNU_GLOB
205 - UCLIBC_HAS_HEXADECIMAL_FLOATS
206 - UCLIBC_HAS_LIBNSL_STUB
207 - UCLIBC_HAS_LIBRESOLV_STUB
208 - UCLIBC_HAS_LIBUTIL
209 - UCLIBC_HAS_NFTW
210 - UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
211 - UCLIBC_HAS_OBSTACK
212 - UCLIBC_HAS_PRINTF_M_SPEC
213 - UCLIBC_HAS_PROGRAM_INVOCATION_NAME
214 - UCLIBC_HAS_RESOLVER_SUPPORT
215 - UCLIBC_HAS_SHA256_CRYPT_IMPL
216 - UCLIBC_HAS_SHA512_CRYPT_IMPL
217 - UCLIBC_HAS_SSP
218 - UCLIBC_HAS_STUBS
219 - UCLIBC_HAS_SYS_ERRLIST
220 - UCLIBC_HAS_SYS_SIGLIST
221 - UCLIBC_HAS_THREADS_NATIVE
222 - UCLIBC_HAS_TZ_FILE_READ_MANY
223 - UCLIBC_HAS_UTMP
224 - UCLIBC_HAS_UTMPX
225 - UCLIBC_HAS_WCHAR
226 - UCLIBC_HAS_WORDEXP
227 - UCLIBC_NTP_LEGACY
228 - UCLIBC_SUPPORT_AI_ADDRCONFIG
229 - UCLIBC_SUSV2_LEGACY
230 - UCLIBC_SUSV3_LEGACY
231 - UCLIBC_SUSV3_LEGACY_MACROS
232 - UCLIBC_SUSV4_LEGACY
233 - UCLIBC_USE_NETLINK
234 - )
235 -
236 - sed -i -e '/ARCH_.*_ENDIAN/d' .config
237 - kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
238 -
239 - kconfig_q_opt debug DODEBUG
240 - kconfig_q_opt debug SUPPORT_LD_DEBUG
241 - kconfig_q_opt debug UCLIBC_HAS_PROFILING
242 -
243 - kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
244 -
245 - kconfig_q_opt rpc UCLIBC_HAS_RPC
246 - kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
247 - kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
248 -
249 - kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
250 - kconfig_q_opt hardened UCLIBC_BUILD_NOW
251 - kconfig_q_opt hardened UCLIBC_BUILD_PIE
252 - kconfig_q_opt hardened UCLIBC_BUILD_RELRO
253 - kconfig_q_opt hardened UCLIBC_BUILD_SSP
254 -
255 - local count def
256 - for count in 1 2 ; do
257 - # Run twice as some config opts depend on others being enabled first.
258 - for def in ${defs_y[@]} ; do
259 - sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
260 - done
261 - for def in ${defs_n[@]} ; do
262 - sed -i -e "s|${def}=y|# ${def} is not set|g" .config
263 - done
264 - make_oldconfig
265 - done
266 -
267 - einfo "Enabled options:"
268 - for def in ${defs_y[@]} ; do
269 - einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
270 - done
271 - einfo "Disabled options:"
272 - for def in ${defs_n[@]} ; do
273 - einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
274 - done
275 -
276 - # setup build and run paths
277 - sed -i \
278 - -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
279 - -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
280 - -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
281 - -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
282 - -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
283 - -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
284 - .config || die
285 -
286 - make_oldconfig
287 -}
288 -
289 -pkg_setup() {
290 - # Make sure our CHOST is a uclibc toolchain for native compiling
291 - if [[ ${CHOST} == ${CTARGET} ]]; then
292 - case ${CHOST} in
293 - *-uclinux*|*-uclibc*) ;;
294 - *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
295 - esac
296 - fi
297 -
298 - # uClibc-ng doesn't carry old Linux threads, and since we force
299 - # threading our only choice is NPTL which requires i486 and later.
300 - [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
301 -}
302 -
303 -src_prepare() {
304 - local version subversion extraversion
305 -
306 - # uclibc-ng tries to create a two sym link with ld.so,
307 - # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
308 - # where MAJOR_VERSION != 0 indicates the ABI verison.
309 - # We want to get rid of this and just have ABI = 0.
310 - eapply "${FILESDIR}"/uclibc-compat-r1.patch
311 -
312 - # We need to change the major.minor.sublevel of uclibc-ng.
313 - # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
314 - # If we really want the ABI bump, we'll have to hack the gcc
315 - # spec file and change the '*link:' rule.
316 - version=( $(get_version_components) )
317 - if [[ -z ${version[1]} ]]; then
318 - subversion=0
319 - extraversion=0
320 - else
321 - subversion=${version[1]}
322 - if [[ -z ${version[2]} ]]; then
323 - extraversion=0
324 - else
325 - extraversion=.${version[2]}
326 - fi
327 - fi
328 -
329 - sed -i \
330 - -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
331 - -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
332 - -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
333 - -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
334 - Rules.mak || die
335 -
336 - eapply_user
337 -}
338 -
339 -src_configure() {
340 - # Map our toolchain arch name to the name expected by uClibc-ng.
341 - local target=$(tc-arch)
342 - case ${target} in
343 - amd64) target="x86_64";;
344 - arm) target="arm";;
345 - mips) target="mips";;
346 - ppc) target="powerpc";;
347 - x86) target="i386";;
348 - esac
349 -
350 - # Do arch specific configuration by changing the defaults in
351 - # extra/Configs/Config.<arch>. If these are not overridden
352 - # by an save .config, they will be selected by default.
353 -
354 - # For i386, i486, i586 and i686
355 - local cpu
356 - if [[ ${target} == "i386" ]]; then
357 - [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
358 - sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
359 - extra/Configs/Config.i386 || die
360 - fi
361 -
362 - # For arm
363 - if [[ ${target} == "arm" ]]; then
364 - sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
365 - fi
366 -
367 - # We set HOSTCC to the proper tuple rather than just 'gcc'
368 - sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
369 -
370 - make_config ${target}
371 -
372 - einfo
373 - einfo "Runtime Prefix: /"
374 - einfo "Devel Prefix: /usr"
375 - einfo "Kernel Prefix: $(alt_build_kprefix)"
376 - einfo "CBUILD: ${CBUILD}"
377 - einfo "CHOST: ${CHOST}"
378 - einfo "CTARGET: ${CTARGET}"
379 - einfo "ABI: ${ABI}"
380 - einfo "ENDIAN: $(uclibc_endian)"
381 - einfo
382 -}
383 -
384 -src_compile() {
385 - emake headers
386 - just_headers && return 0
387 -
388 - emake
389 - if is_crosscompile ; then
390 - emake -C utils hostutils
391 - else
392 - emake utils
393 - fi
394 -}
395 -
396 -src_test() {
397 - is_crosscompile && return 0
398 -
399 - # assert test fails on pax/grsec enabled kernels
400 - # normal vfork test fails in sandbox (both glibc/uclibc)
401 - emake UCLIBC_ONLY=1 check
402 -}
403 -
404 -src_install() {
405 - local sysroot=${D}
406 - is_crosscompile && sysroot+="/usr/${CTARGET}"
407 -
408 - local target="install"
409 - just_headers && target="install_headers"
410 - emake DESTDIR="${sysroot}" ${target}
411 -
412 - save_config .config
413 -
414 - # remove files coming from kernel-headers
415 - rm -rf "${sysroot}"/usr/include/{linux,asm*}
416 -
417 - # Make sure we install the sys-include symlink so that when
418 - # we build a 2nd stage cross-compiler, gcc finds the target
419 - # system headers correctly. See gcc/doc/gccinstall.info
420 - if is_crosscompile ; then
421 - dosym usr/include /usr/${CTARGET}/sys-include
422 - if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
423 - newbin utils/ldconfig.host ${CTARGET}-ldconfig
424 - newbin utils/ldd.host ${CTARGET}-ldd
425 - fi
426 - return 0
427 - fi
428 -
429 - if use symlink-compat; then
430 - dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
431 - dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
432 - dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
433 - dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
434 - dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
435 - dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
436 - dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
437 - dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
438 - fi
439 -
440 - emake DESTDIR="${D}" install_utils
441 - dobin extra/scripts/getent
442 - dodoc README docs/*.txt
443 -}
444 -
445 -pkg_postinst() {
446 - is_crosscompile && return 0
447 -
448 - if [ ! -e "${ROOT}"/etc/TZ ] ; then
449 - ewarn "Please remember to set your timezone in /etc/TZ"
450 - mkdir -p "${ROOT}"/etc
451 - echo "UTC" > "${ROOT}"/etc/TZ
452 - fi
453 - [ "${ROOT}" != "/" ] && return 0
454 - # update cache before reloading init
455 - ldconfig
456 - # reload init ...
457 - /sbin/telinit U 2>/dev/null
458 -}
459
460 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
461 deleted file mode 100644
462 index c7b7bac0f3e..00000000000
463 --- a/sys-libs/uclibc-ng/uclibc-ng-1.0.30-r1.ebuild
464 +++ /dev/null
465 @@ -1,405 +0,0 @@
466 -# Copyright 1999-2018 Gentoo Authors
467 -# Distributed under the terms of the GNU General Public License v2
468 -
469 -EAPI="6"
470 -
471 -inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
472 -
473 -if [[ ${PV} == "9999" ]] ; then
474 - EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
475 - inherit git-r3
476 - MY_P=uclibc-ng-${PV}
477 -else
478 - MY_P=uClibc-ng-${PV}
479 -fi
480 -
481 -DESCRIPTION="C library for developing embedded Linux systems"
482 -HOMEPAGE="https://uclibc-ng.org/"
483 -if [[ ${PV} != "9999" ]] ; then
484 - PATCH_VER=""
485 - SRC_URI="https://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
486 - KEYWORDS="-* amd64 arm ~mips ppc x86"
487 -fi
488 -
489 -LICENSE="LGPL-2"
490 -SLOT="0"
491 -IUSE="debug hardened iconv ipv6 symlink-compat headers-only"
492 -# tests fail due to unusual makefile
493 -RESTRICT="strip test"
494 -
495 -# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
496 -# will delete the ld.so sym link prematurely and break the system. So we
497 -# will hard block and give manual migration instructions.
498 -# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
499 -# the breakout library. The disadvantage here is that we have to sprinkle
500 -# LDFAGS=-liconv on build systems that need to link against libiconv.
501 -RDEPEND="
502 - !!sys-libs/uclibc
503 - iconv? ( dev-libs/libiconv )"
504 -
505 -S=${WORKDIR}/${MY_P}
506 -
507 -export CBUILD=${CBUILD:-${CHOST}}
508 -export CTARGET=${CTARGET:-${CHOST}}
509 -if [[ ${CHOST} == ${CTARGET} ]] ; then
510 - if [[ ${CATEGORY} == cross-* ]] ; then
511 - export CTARGET=${CATEGORY#cross-}
512 - fi
513 -fi
514 -
515 -is_crosscompile() {
516 - [[ ${CHOST} != ${CTARGET} ]]
517 -}
518 -
519 -alt_build_kprefix() {
520 - if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
521 - echo /usr/include
522 - else
523 - echo /usr/${CTARGET}/usr/include
524 - fi
525 -}
526 -
527 -just_headers() {
528 - use headers-only && is_crosscompile
529 -}
530 -
531 -uclibc_endian() {
532 - # XXX: this wont work for a toolchain which is bi-endian, but we
533 - # dont have any such thing at the moment, so not a big deal
534 - touch "${T}"/endian.s
535 - $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
536 - case $(file "${T}"/endian.o) in
537 - *" MSB "*) echo "BIG";;
538 - *" LSB "*) echo "LITTLE";;
539 - *) echo "NFC";;
540 - esac
541 - rm -f "${T}"/endian.{s,o}
542 -}
543 -
544 -kconfig_q_opt() {
545 - local flag=$1; shift
546 - case ${flag} in
547 - y|n) ;;
548 - *) flag=$(usex ${flag} y n) ;;
549 - esac
550 -
551 - local var="defs_${flag}"
552 - eval "${var}+=( $* )"
553 -}
554 -
555 -get_opt() {
556 - (
557 - unset ${1}
558 - . ${2:-"${S}"/.config}
559 - echo ${!1}
560 - )
561 -}
562 -
563 -make_oldconfig() {
564 - yes "" 2>/dev/null | emake -s oldconfig >/dev/null
565 -}
566 -
567 -make_config() {
568 - restore_config .config
569 - if [ -f .config ]; then
570 - make_oldconfig
571 - return 0
572 - else
573 - ewarn "Could not locate user configfile, so we will save a default one"
574 - fi
575 -
576 - emake ARCH=$1 defconfig >/dev/null
577 -
578 - local defs_{y,n}
579 -
580 - # These are forced off
581 - defs_n=(
582 - DOASSERTS
583 - DODEBUG_PT
584 - HAS_NO_THREADS
585 - PROPOLICE_BLOCK_ABRT
586 - SSP_QUICK_CANARY
587 - SUPPORT_LD_DEBUG_EARLY
588 - UCLIBC_HAS_CTYPE_UNSAFE
589 - UCLIBC_HAS_LOCALE
590 - LDSO_SAFE_RUNPATH
591 - )
592 -
593 - # These are forced on
594 - defs_y=(
595 - DO_C99_MATH
596 - DO_XSI_MATH
597 - FORCE_SHAREABLE_TEXT_SEGMENTS
598 - LDSO_GNU_HASH_SUPPORT
599 - LDSO_PRELOAD_FILE_SUPPORT
600 - LDSO_RUNPATH
601 - LDSO_RUNPATH_OF_EXECUTABLE
602 - LDSO_STANDALONE_SUPPORT
603 - PROPOLICE_BLOCK_SEGV
604 - PTHREADS_DEBUG_SUPPORT
605 - UCLIBC_HAS_ARC4RANDOM
606 - UCLIBC_HAS_BACKTRACE
607 - UCLIBC_HAS_BSD_RES_CLOSE
608 - UCLIBC_HAS_CONTEXT_FUNCS
609 - UCLIBC_HAS_CTYPE_CHECKED
610 - UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
611 - UCLIBC_HAS_FENV
612 - UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
613 - UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
614 - UCLIBC_HAS_FOPEN_LARGEFILE_MODE
615 - UCLIBC_HAS_FTS
616 - UCLIBC_HAS_FTW
617 - UCLIBC_HAS_GETPT
618 - UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
619 - UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
620 - UCLIBC_HAS_GNU_GLOB
621 - UCLIBC_HAS_HEXADECIMAL_FLOATS
622 - UCLIBC_HAS_LIBUTIL
623 - UCLIBC_HAS_NFTW
624 - UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
625 - UCLIBC_HAS_PRINTF_M_SPEC
626 - UCLIBC_HAS_PROGRAM_INVOCATION_NAME
627 - UCLIBC_HAS_RESOLVER_SUPPORT
628 - UCLIBC_HAS_SHA256_CRYPT_IMPL
629 - UCLIBC_HAS_SHA512_CRYPT_IMPL
630 - UCLIBC_HAS_SSP
631 - UCLIBC_HAS_STUBS
632 - UCLIBC_HAS_SYS_ERRLIST
633 - UCLIBC_HAS_SYS_SIGLIST
634 - UCLIBC_HAS_THREADS_NATIVE
635 - UCLIBC_HAS_TZ_FILE_READ_MANY
636 - UCLIBC_HAS_UTMP
637 - UCLIBC_HAS_UTMPX
638 - UCLIBC_HAS_WCHAR
639 - UCLIBC_HAS_WORDEXP
640 - UCLIBC_NTP_LEGACY
641 - UCLIBC_SUPPORT_AI_ADDRCONFIG
642 - UCLIBC_SUSV2_LEGACY
643 - UCLIBC_SUSV3_LEGACY
644 - UCLIBC_SUSV3_LEGACY_MACROS
645 - UCLIBC_SUSV4_LEGACY
646 - UCLIBC_USE_NETLINK
647 - )
648 -
649 - sed -i -e '/ARCH_.*_ENDIAN/d' .config
650 - kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
651 -
652 - kconfig_q_opt debug DODEBUG
653 - kconfig_q_opt debug SUPPORT_LD_DEBUG
654 - kconfig_q_opt debug UCLIBC_HAS_PROFILING
655 -
656 - kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
657 -
658 - kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
659 - kconfig_q_opt hardened UCLIBC_BUILD_NOW
660 - kconfig_q_opt hardened UCLIBC_BUILD_PIE
661 - kconfig_q_opt hardened UCLIBC_BUILD_RELRO
662 - kconfig_q_opt hardened UCLIBC_BUILD_SSP
663 -
664 - local count def
665 - for count in 1 2 ; do
666 - # Run twice as some config opts depend on others being enabled first.
667 - for def in ${defs_y[@]} ; do
668 - sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
669 - done
670 - for def in ${defs_n[@]} ; do
671 - sed -i -e "s|${def}=y|# ${def} is not set|g" .config
672 - done
673 - make_oldconfig
674 - done
675 -
676 - einfo "Enabled options:"
677 - for def in ${defs_y[@]} ; do
678 - einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
679 - done
680 - einfo "Disabled options:"
681 - for def in ${defs_n[@]} ; do
682 - einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
683 - done
684 -
685 - # setup build and run paths
686 - sed -i \
687 - -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
688 - -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
689 - -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
690 - -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
691 - -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
692 - -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
693 - .config || die
694 -
695 - make_oldconfig
696 -}
697 -
698 -pkg_setup() {
699 - # Make sure our CHOST is a uclibc toolchain for native compiling
700 - if [[ ${CHOST} == ${CTARGET} ]]; then
701 - case ${CHOST} in
702 - *-uclinux*|*-uclibc*) ;;
703 - *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
704 - esac
705 - fi
706 -
707 - # uClibc-ng doesn't carry old Linux threads, and since we force
708 - # threading our only choice is NPTL which requires i486 and later.
709 - [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
710 -}
711 -
712 -src_prepare() {
713 - local version subversion extraversion
714 -
715 - # uclibc-ng tries to create a two sym link with ld.so,
716 - # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
717 - # where MAJOR_VERSION != 0 indicates the ABI verison.
718 - # We want to get rid of this and just have ABI = 0.
719 - eapply "${FILESDIR}"/uclibc-compat-r1.patch
720 -
721 - # Critical fix for ld.so.cache
722 - eapply "${FILESDIR}"/${P}-fix-ld.so.cache.patch
723 -
724 - # We need to change the major.minor.sublevel of uclibc-ng.
725 - # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
726 - # If we really want the ABI bump, we'll have to hack the gcc
727 - # spec file and change the '*link:' rule.
728 - version=( $(get_version_components) )
729 - if [[ -z ${version[1]} ]]; then
730 - subversion=0
731 - extraversion=0
732 - else
733 - subversion=${version[1]}
734 - if [[ -z ${version[2]} ]]; then
735 - extraversion=0
736 - else
737 - extraversion=.${version[2]}
738 - fi
739 - fi
740 -
741 - sed -i \
742 - -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
743 - -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
744 - -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
745 - -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
746 - Rules.mak || die
747 -
748 - eapply_user
749 -}
750 -
751 -src_configure() {
752 - # Map our toolchain arch name to the name expected by uClibc-ng.
753 - local target=$(tc-arch)
754 - case ${target} in
755 - amd64) target="x86_64";;
756 - arm) target="arm";;
757 - mips) target="mips";;
758 - ppc) target="powerpc";;
759 - x86) target="i386";;
760 - esac
761 -
762 - # Do arch specific configuration by changing the defaults in
763 - # extra/Configs/Config.<arch>. If these are not overridden
764 - # by an save .config, they will be selected by default.
765 -
766 - # For i386, i486, i586 and i686
767 - local cpu
768 - if [[ ${target} == "i386" ]]; then
769 - [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
770 - sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
771 - extra/Configs/Config.i386 || die
772 - fi
773 -
774 - # For arm
775 - if [[ ${target} == "arm" ]]; then
776 - sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
777 - fi
778 -
779 - # We set HOSTCC to the proper tuple rather than just 'gcc'
780 - sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
781 -
782 - make_config ${target}
783 -
784 - einfo
785 - einfo "Runtime Prefix: /"
786 - einfo "Devel Prefix: /usr"
787 - einfo "Kernel Prefix: $(alt_build_kprefix)"
788 - einfo "CBUILD: ${CBUILD}"
789 - einfo "CHOST: ${CHOST}"
790 - einfo "CTARGET: ${CTARGET}"
791 - einfo "ABI: ${ABI}"
792 - einfo "ENDIAN: $(uclibc_endian)"
793 - einfo
794 -}
795 -
796 -src_compile() {
797 - emake headers
798 - just_headers && return 0
799 -
800 - emake
801 - if is_crosscompile ; then
802 - emake -C utils hostutils
803 - else
804 - emake utils
805 - fi
806 -}
807 -
808 -src_test() {
809 - is_crosscompile && return 0
810 -
811 - # assert test fails on pax/grsec enabled kernels
812 - # normal vfork test fails in sandbox (both glibc/uclibc)
813 - emake UCLIBC_ONLY=1 check
814 -}
815 -
816 -src_install() {
817 - local sysroot=${D}
818 - is_crosscompile && sysroot+="/usr/${CTARGET}"
819 -
820 - local target="install"
821 - just_headers && target="install_headers"
822 - emake DESTDIR="${sysroot}" ${target}
823 -
824 - save_config .config
825 -
826 - # remove files coming from kernel-headers
827 - rm -rf "${sysroot}"/usr/include/{linux,asm*}
828 -
829 - # Make sure we install the sys-include symlink so that when
830 - # we build a 2nd stage cross-compiler, gcc finds the target
831 - # system headers correctly. See gcc/doc/gccinstall.info
832 - if is_crosscompile ; then
833 - dosym usr/include /usr/${CTARGET}/sys-include
834 - if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
835 - newbin utils/ldconfig.host ${CTARGET}-ldconfig
836 - newbin utils/ldd.host ${CTARGET}-ldd
837 - fi
838 - return 0
839 - fi
840 -
841 - if use symlink-compat; then
842 - dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
843 - dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
844 - dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
845 - dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
846 - dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
847 - dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
848 - dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
849 - dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
850 - fi
851 -
852 - emake DESTDIR="${D}" install_utils
853 - dobin extra/scripts/getent
854 - dodoc README docs/*.txt
855 -}
856 -
857 -pkg_postinst() {
858 - is_crosscompile && return 0
859 -
860 - if [ ! -e "${ROOT}"/etc/TZ ] ; then
861 - ewarn "Please remember to set your timezone in /etc/TZ"
862 - mkdir -p "${ROOT}"/etc
863 - echo "UTC" > "${ROOT}"/etc/TZ
864 - fi
865 - [ "${ROOT}" != "/" ] && return 0
866 - # update cache before reloading init
867 - ldconfig
868 - # reload init ...
869 - /sbin/telinit U 2>/dev/null
870 -}