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