1 |
commit: c03fd9aeed5fb3fae58d6e08121b9369b9f8c458 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 4 02:02:51 2017 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 4 02:02:51 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c03fd9ae |
7 |
|
8 |
sys-libs/uclibc-ng: remove older versions |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
sys-libs/uclibc-ng/Manifest | 3 - |
13 |
sys-libs/uclibc-ng/uclibc-ng-1.0.16.ebuild | 399 ------------------------- |
14 |
sys-libs/uclibc-ng/uclibc-ng-1.0.17.ebuild | 399 ------------------------- |
15 |
sys-libs/uclibc-ng/uclibc-ng-1.0.18-r1.ebuild | 408 -------------------------- |
16 |
4 files changed, 1209 deletions(-) |
17 |
|
18 |
diff --git a/sys-libs/uclibc-ng/Manifest b/sys-libs/uclibc-ng/Manifest |
19 |
index 1025f878bc7..ecb210bdedf 100644 |
20 |
--- a/sys-libs/uclibc-ng/Manifest |
21 |
+++ b/sys-libs/uclibc-ng/Manifest |
22 |
@@ -1,6 +1,3 @@ |
23 |
-DIST uClibc-ng-1.0.16.tar.bz2 2769238 SHA256 f0ded5cb1ff7aac670ca9df931fc820648d91b27085a3efecc1b7f06d65f57f6 SHA512 05110f0b6651862f16b01d1b45d59258b93686a7635815f9e050ab6b8f0eb14581782c95f305649d62aa80e78060865620a5306a657ea7e9ac396c68d61347cb WHIRLPOOL d79830b46d4bcb2f19917da936a35443da95728c25a050e5a313f6a374669be8c29d5df12a6e9ac5efc65416a0206672a70c7b6d75cb3fdc4017220e32222bf3 |
24 |
-DIST uClibc-ng-1.0.17.tar.bz2 2769872 SHA256 fb4ab60698256d110bf30678a4cb27f14b3cf6eae60ed4ad21b2de5cac8c0bf3 SHA512 de6c7bf2168fe76ad0fa3a59c2c4264040383683b4774e846c97c20802d92dc478d3fcf271800f008c5b2ee06d3f50baac47bc5f28b43366e418c65b11d3bdb4 WHIRLPOOL 430fcd6992097bcd995936e36450617d0d9f57182542ffc42f0bdf021a2e7c0a5c9f8bce50c498567e9219379ef80a20e444f872429ab36dc43eda11134a03f6 |
25 |
-DIST uClibc-ng-1.0.18.tar.bz2 2754404 SHA256 71b2d401025c1235a061cfc80d394760fb37f3611566e105b39dd034f6ed001c SHA512 579ddf4470d684979ba00b71545e7c34ca48d0ad58767222835f95c1401dea5435b6a945390c992e027cc59f2b419a9d835081d08c9d2e6db8b8ddeeed24f5cd WHIRLPOOL 60cd9cc03668af81988d603edc637a8d3dba8276bc0d71e6e915263119c8cf629d293e2da73a57def5b07732cd37f35527b1bc7d3ef01ff09dd6fcc2cf7d3a59 |
26 |
DIST uClibc-ng-1.0.19.tar.bz2 2748768 SHA256 139c495d8f71ec31da97e0330b056302ff40f0acba66988fcd737cfb4eb445ed SHA512 d385eca25c4a356b01b6d7acaef63daeeb172769d6306525fb95f62e818aca354cf04fae15af65bc346f19dcfdc601f87e52a8dc95f528d7392648d1b056fe63 WHIRLPOOL 1cc6b64df85df5f9e8c15c9cad3ed5641add20f402657a7d9c6283527ba7feac3c90ce293f2b15578c6d816c19018467336e50cd469a46482c2e4168f2addaf5 |
27 |
DIST uClibc-ng-1.0.20.tar.bz2 2414313 SHA256 0d0ee9d4df82958f65088f446ffd7548d88deb1f1b949f9ec3e673decb910597 SHA512 c0d4fc442f087d9bf994a7b84fa12cfae96f2980061cbb39b1c2cf243692d44fcab79d4a686ac5a7889b9081682aa13d013da0ad99cb30ad2b7150bdb19de0de WHIRLPOOL 16035dd540629aa453e023b6ea96eab5e577579e7bb940ed3411107ffd12bc78148e7a14222184207ae40633d30871d9e583c3456a04cc28b96dfd40b287e713 |
28 |
DIST uClibc-ng-1.0.22.tar.bz2 2435181 SHA256 430bebc26545022c5c3e9cebd4ee682db0053b94235e0be5df7eeab7ff19a9e0 SHA512 d29a14813f6b795fbd380a9593742f696cd32ec8fd22001ce092382ca0059357bc921b8eac7d0a6ae2a9cab724b0ddd15f9959ec789b4824a5db820cbd00b6e7 WHIRLPOOL 14336e9e159585472a9a01cb69acc0cb59d8df89769e532c4deec4c1a6a0056d8ff091904163ad9ab29c2c5107fe57f3241c8d4e898fe831f21b1a8e685aaec1 |
29 |
|
30 |
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.16.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.16.ebuild |
31 |
deleted file mode 100644 |
32 |
index ef86bc4a36e..00000000000 |
33 |
--- a/sys-libs/uclibc-ng/uclibc-ng-1.0.16.ebuild |
34 |
+++ /dev/null |
35 |
@@ -1,399 +0,0 @@ |
36 |
-# Copyright 1999-2016 Gentoo Foundation |
37 |
-# Distributed under the terms of the GNU General Public License v2 |
38 |
- |
39 |
-EAPI="6" |
40 |
- |
41 |
-inherit flag-o-matic multilib savedconfig toolchain-funcs versionator |
42 |
- |
43 |
-if [[ ${PV} == "9999" ]] ; then |
44 |
- EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng" |
45 |
- inherit git-r3 |
46 |
- MY_P=uclibc-ng-${PV} |
47 |
-else |
48 |
- MY_P=uClibc-ng-${PV} |
49 |
-fi |
50 |
- |
51 |
-DESCRIPTION="C library for developing embedded Linux systems" |
52 |
-HOMEPAGE="http://www.uclibc-ng.org/" |
53 |
-if [[ ${PV} != "9999" ]] ; then |
54 |
- PATCH_VER="" |
55 |
- SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2" |
56 |
- KEYWORDS="-* amd64 arm ~mips ~ppc x86" |
57 |
-fi |
58 |
- |
59 |
-LICENSE="LGPL-2" |
60 |
-SLOT="0" |
61 |
-IUSE="debug hardened iconv ipv6 rpc crosscompile_opts_headers-only" |
62 |
-RESTRICT="strip" |
63 |
- |
64 |
-# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage |
65 |
-# will delete the ld.so sym link prematurely and break the system. So we |
66 |
-# will hard block and give manual migration instructions. |
67 |
-# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using |
68 |
-# the breakout library. The disadvantage here is that we have to sprinkle |
69 |
-# LDFAGS=-liconv on build systems that need to link against libiconv. |
70 |
-RDEPEND=" |
71 |
- !!sys-libs/uclibc |
72 |
- iconv? ( dev-libs/libiconv )" |
73 |
- |
74 |
-S=${WORKDIR}/${MY_P} |
75 |
- |
76 |
-export CBUILD=${CBUILD:-${CHOST}} |
77 |
-export CTARGET=${CTARGET:-${CHOST}} |
78 |
-if [[ ${CHOST} == ${CTARGET} ]] ; then |
79 |
- if [[ ${CATEGORY} == cross-* ]] ; then |
80 |
- export CTARGET=${CATEGORY#cross-} |
81 |
- fi |
82 |
-fi |
83 |
- |
84 |
-is_crosscompile() { |
85 |
- [[ ${CHOST} != ${CTARGET} ]] |
86 |
-} |
87 |
- |
88 |
-alt_build_kprefix() { |
89 |
- if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then |
90 |
- echo /usr/include |
91 |
- else |
92 |
- echo /usr/${CTARGET}/usr/include |
93 |
- fi |
94 |
-} |
95 |
- |
96 |
-just_headers() { |
97 |
- use crosscompile_opts_headers-only && is_crosscompile |
98 |
-} |
99 |
- |
100 |
-uclibc_endian() { |
101 |
- # XXX: this wont work for a toolchain which is bi-endian, but we |
102 |
- # dont have any such thing at the moment, so not a big deal |
103 |
- touch "${T}"/endian.s |
104 |
- $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o |
105 |
- case $(file "${T}"/endian.o) in |
106 |
- *" MSB "*) echo "BIG";; |
107 |
- *" LSB "*) echo "LITTLE";; |
108 |
- *) echo "NFC";; |
109 |
- esac |
110 |
- rm -f "${T}"/endian.{s,o} |
111 |
-} |
112 |
- |
113 |
-kconfig_q_opt() { |
114 |
- local flag=$1; shift |
115 |
- case ${flag} in |
116 |
- y|n) ;; |
117 |
- *) flag=$(usex ${flag} y n) ;; |
118 |
- esac |
119 |
- |
120 |
- local var="defs_${flag}" |
121 |
- eval "${var}+=( $* )" |
122 |
-} |
123 |
- |
124 |
-get_opt() { |
125 |
- ( |
126 |
- unset ${1} |
127 |
- . ${2:-"${S}"/.config} |
128 |
- echo ${!1} |
129 |
- ) |
130 |
-} |
131 |
- |
132 |
-make_oldconfig() { |
133 |
- yes "" 2>/dev/null | emake -s oldconfig >/dev/null |
134 |
-} |
135 |
- |
136 |
-make_config() { |
137 |
- restore_config .config |
138 |
- if [ -f .config ]; then |
139 |
- make_oldconfig |
140 |
- return 0 |
141 |
- else |
142 |
- ewarn "Could not locate user configfile, so we will save a default one" |
143 |
- fi |
144 |
- |
145 |
- emake ARCH=$1 defconfig >/dev/null |
146 |
- |
147 |
- local defs_{y,n} |
148 |
- |
149 |
- # These are forced off |
150 |
- defs_n=( |
151 |
- DOASSERTS |
152 |
- DODEBUG_PT |
153 |
- HAS_NO_THREADS |
154 |
- PROPOLICE_BLOCK_ABRT |
155 |
- SSP_QUICK_CANARY |
156 |
- SUPPORT_LD_DEBUG_EARLY |
157 |
- UCLIBC_HAS_CTYPE_UNSAFE |
158 |
- UCLIBC_HAS_LOCALE |
159 |
- UCLIBC_HAS_SSP_COMPAT |
160 |
- ) |
161 |
- |
162 |
- # These are forced on |
163 |
- defs_y=( |
164 |
- COMPAT_ATEXIT |
165 |
- DO_C99_MATH |
166 |
- DO_XSI_MATH |
167 |
- FORCE_SHAREABLE_TEXT_SEGMENTS |
168 |
- LDSO_GNU_HASH_SUPPORT |
169 |
- LDSO_PRELINK_SUPPORT |
170 |
- LDSO_PRELOAD_FILE_SUPPORT |
171 |
- LDSO_RUNPATH_OF_EXECUTABLE |
172 |
- LDSO_STANDALONE_SUPPORT |
173 |
- MALLOC_GLIBC_COMPAT |
174 |
- PROPOLICE_BLOCK_SEGV |
175 |
- PTHREADS_DEBUG_SUPPORT |
176 |
- UCLIBC_HAS_ARC4RANDOM |
177 |
- UCLIBC_HAS_BACKTRACE |
178 |
- UCLIBC_HAS_BSD_RES_CLOSE |
179 |
- UCLIBC_HAS_CONTEXT_FUNCS |
180 |
- UCLIBC_HAS_CTYPE_CHECKED |
181 |
- UCLIBC_HAS_EXTRA_COMPAT_RES_STATE |
182 |
- UCLIBC_HAS_FENV |
183 |
- UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE |
184 |
- UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE |
185 |
- UCLIBC_HAS_FOPEN_LARGEFILE_MODE |
186 |
- UCLIBC_HAS_FTS |
187 |
- UCLIBC_HAS_FTW |
188 |
- UCLIBC_HAS_GETPT |
189 |
- UCLIBC_HAS_GLIBC_CUSTOM_PRINTF |
190 |
- UCLIBC_HAS_GLIBC_CUSTOM_STREAMS |
191 |
- UCLIBC_HAS_GNU_GLOB |
192 |
- UCLIBC_HAS_HEXADECIMAL_FLOATS |
193 |
- UCLIBC_HAS_LIBNSL_STUB |
194 |
- UCLIBC_HAS_LIBRESOLV_STUB |
195 |
- UCLIBC_HAS_LIBUTIL |
196 |
- UCLIBC_HAS_NFTW |
197 |
- UCLIBC_HAS_OBSOLETE_BSD_SIGNAL |
198 |
- UCLIBC_HAS_OBSTACK |
199 |
- UCLIBC_HAS_PRINTF_M_SPEC |
200 |
- UCLIBC_HAS_PROGRAM_INVOCATION_NAME |
201 |
- UCLIBC_HAS_RESOLVER_SUPPORT |
202 |
- UCLIBC_HAS_SHA256_CRYPT_IMPL |
203 |
- UCLIBC_HAS_SHA512_CRYPT_IMPL |
204 |
- UCLIBC_HAS_SSP |
205 |
- UCLIBC_HAS_STUBS |
206 |
- UCLIBC_HAS_SYS_ERRLIST |
207 |
- UCLIBC_HAS_SYS_SIGLIST |
208 |
- UCLIBC_HAS_THREADS_NATIVE |
209 |
- UCLIBC_HAS_TZ_FILE_READ_MANY |
210 |
- UCLIBC_HAS_UTMP |
211 |
- UCLIBC_HAS_UTMPX |
212 |
- UCLIBC_HAS_WCHAR |
213 |
- UCLIBC_HAS_WORDEXP |
214 |
- UCLIBC_NTP_LEGACY |
215 |
- UCLIBC_SUPPORT_AI_ADDRCONFIG |
216 |
- UCLIBC_SUSV2_LEGACY |
217 |
- UCLIBC_SUSV3_LEGACY |
218 |
- UCLIBC_SUSV3_LEGACY_MACROS |
219 |
- UCLIBC_SUSV4_LEGACY |
220 |
- UCLIBC_USE_NETLINK |
221 |
- ) |
222 |
- |
223 |
- sed -i -e '/ARCH_.*_ENDIAN/d' .config |
224 |
- kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN" |
225 |
- |
226 |
- kconfig_q_opt debug DODEBUG |
227 |
- kconfig_q_opt debug SUPPORT_LD_DEBUG |
228 |
- kconfig_q_opt debug UCLIBC_HAS_PROFILING |
229 |
- |
230 |
- kconfig_q_opt ipv6 UCLIBC_HAS_IPV6 |
231 |
- |
232 |
- kconfig_q_opt rpc UCLIBC_HAS_RPC |
233 |
- kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC |
234 |
- kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC |
235 |
- |
236 |
- kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK |
237 |
- kconfig_q_opt hardened UCLIBC_BUILD_NOW |
238 |
- kconfig_q_opt hardened UCLIBC_BUILD_PIE |
239 |
- kconfig_q_opt hardened UCLIBC_BUILD_RELRO |
240 |
- kconfig_q_opt hardened UCLIBC_BUILD_SSP |
241 |
- |
242 |
- local count def |
243 |
- for count in 1 2 ; do |
244 |
- # Run twice as some config opts depend on others being enabled first. |
245 |
- for def in ${defs_y[@]} ; do |
246 |
- sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config |
247 |
- done |
248 |
- for def in ${defs_n[@]} ; do |
249 |
- sed -i -e "s|${def}=y|# ${def} is not set|g" .config |
250 |
- done |
251 |
- make_oldconfig |
252 |
- done |
253 |
- |
254 |
- einfo "Enabled options:" |
255 |
- for def in ${defs_y[@]} ; do |
256 |
- einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}") |
257 |
- done |
258 |
- einfo "Disabled options:" |
259 |
- for def in ${defs_n[@]} ; do |
260 |
- einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}") |
261 |
- done |
262 |
- |
263 |
- # setup build and run paths |
264 |
- sed -i \ |
265 |
- -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \ |
266 |
- -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \ |
267 |
- -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \ |
268 |
- -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \ |
269 |
- -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \ |
270 |
- -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \ |
271 |
- .config || die |
272 |
- |
273 |
- make_oldconfig |
274 |
-} |
275 |
- |
276 |
-pkg_setup() { |
277 |
- # Make sure our CHOST is a uclibc toolchain for native compiling |
278 |
- if [[ ${CHOST} == ${CTARGET} ]]; then |
279 |
- case ${CHOST} in |
280 |
- *-uclinux*|*-uclibc*) ;; |
281 |
- *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;; |
282 |
- esac |
283 |
- fi |
284 |
- |
285 |
- # uClibc-ng doesn't carry old Linux threads, and since we force |
286 |
- # threading our only choice is NPTL which requires i486 and later. |
287 |
- [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)." |
288 |
-} |
289 |
- |
290 |
-src_prepare() { |
291 |
- local version subversion extraversion |
292 |
- |
293 |
- # uclibc-ng tries to create a two sym link with ld.so, |
294 |
- # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so |
295 |
- # where MAJOR_VERSION != 0 indicates the ABI verison. |
296 |
- # We want to get rid of this and just have ABI = 0. |
297 |
- eapply "${FILESDIR}"/uclibc-compat.patch |
298 |
- |
299 |
- # We need to change the major.minor.sublevel of uclibc-ng. |
300 |
- # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking. |
301 |
- # If we really want the ABI bump, we'll have to hack the gcc |
302 |
- # spec file and change the '*link:' rule. |
303 |
- version=( $(get_version_components) ) |
304 |
- if [[ -z ${version[1]} ]]; then |
305 |
- subversion=0 |
306 |
- extraversion=0 |
307 |
- else |
308 |
- subversion=${version[1]} |
309 |
- if [[ -z ${version[2]} ]]; then |
310 |
- extraversion=0 |
311 |
- else |
312 |
- extraversion=.${version[2]} |
313 |
- fi |
314 |
- fi |
315 |
- |
316 |
- sed -i \ |
317 |
- -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \ |
318 |
- -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \ |
319 |
- -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \ |
320 |
- -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \ |
321 |
- Rules.mak || die |
322 |
- |
323 |
- eapply_user |
324 |
-} |
325 |
- |
326 |
-src_configure() { |
327 |
- # Map our toolchain arch name to the name expected by uClibc-ng. |
328 |
- local target=$(tc-arch) |
329 |
- case ${target} in |
330 |
- amd64) target="x86_64";; |
331 |
- arm) target="arm";; |
332 |
- mips) target="mips";; |
333 |
- ppc) target="powerpc";; |
334 |
- x86) target="i386";; |
335 |
- esac |
336 |
- |
337 |
- # Do arch specific configuration by changing the defaults in |
338 |
- # extra/Configs/Config.<arch>. If these are not overridden |
339 |
- # by an save .config, they will be selected by default. |
340 |
- |
341 |
- # For i386, i486, i586 and i686 |
342 |
- local cpu |
343 |
- if [[ ${target} == "i386" ]]; then |
344 |
- [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86" |
345 |
- sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \ |
346 |
- extra/Configs/Config.i386 || die |
347 |
- fi |
348 |
- |
349 |
- # For arm |
350 |
- if [[ ${target} == "arm" ]]; then |
351 |
- sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm |
352 |
- fi |
353 |
- |
354 |
- # We set HOSTCC to the proper tuple rather than just 'gcc' |
355 |
- sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak |
356 |
- |
357 |
- make_config ${target} |
358 |
- |
359 |
- einfo |
360 |
- einfo "Runtime Prefix: /" |
361 |
- einfo "Devel Prefix: /usr" |
362 |
- einfo "Kernel Prefix: $(alt_build_kprefix)" |
363 |
- einfo "CBUILD: ${CBUILD}" |
364 |
- einfo "CHOST: ${CHOST}" |
365 |
- einfo "CTARGET: ${CTARGET}" |
366 |
- einfo "ABI: ${ABI}" |
367 |
- einfo "ENDIAN: $(uclibc_endian)" |
368 |
- einfo |
369 |
-} |
370 |
- |
371 |
-src_compile() { |
372 |
- emake headers |
373 |
- just_headers && return 0 |
374 |
- |
375 |
- emake |
376 |
- if is_crosscompile ; then |
377 |
- emake -C utils hostutils |
378 |
- else |
379 |
- emake utils |
380 |
- fi |
381 |
-} |
382 |
- |
383 |
-src_test() { |
384 |
- is_crosscompile && return 0 |
385 |
- |
386 |
- # assert test fails on pax/grsec enabled kernels |
387 |
- # normal vfork test fails in sandbox (both glibc/uclibc) |
388 |
- emake UCLIBC_ONLY=1 check |
389 |
-} |
390 |
- |
391 |
-src_install() { |
392 |
- local sysroot=${D} |
393 |
- is_crosscompile && sysroot+="/usr/${CTARGET}" |
394 |
- |
395 |
- local target="install" |
396 |
- just_headers && target="install_headers" |
397 |
- emake DESTDIR="${sysroot}" ${target} |
398 |
- |
399 |
- save_config .config |
400 |
- |
401 |
- # remove files coming from kernel-headers |
402 |
- rm -rf "${sysroot}"/usr/include/{linux,asm*} |
403 |
- |
404 |
- # Make sure we install the sys-include symlink so that when |
405 |
- # we build a 2nd stage cross-compiler, gcc finds the target |
406 |
- # system headers correctly. See gcc/doc/gccinstall.info |
407 |
- if is_crosscompile ; then |
408 |
- dosym usr/include /usr/${CTARGET}/sys-include |
409 |
- if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then |
410 |
- newbin utils/ldconfig.host ${CTARGET}-ldconfig |
411 |
- newbin utils/ldd.host ${CTARGET}-ldd |
412 |
- fi |
413 |
- return 0 |
414 |
- fi |
415 |
- |
416 |
- emake DESTDIR="${D}" install_utils |
417 |
- dobin extra/scripts/getent |
418 |
- dodoc README docs/*.txt |
419 |
-} |
420 |
- |
421 |
-pkg_postinst() { |
422 |
- is_crosscompile && return 0 |
423 |
- |
424 |
- if [ ! -e "${ROOT}"/etc/TZ ] ; then |
425 |
- ewarn "Please remember to set your timezone in /etc/TZ" |
426 |
- mkdir -p "${ROOT}"/etc |
427 |
- echo "UTC" > "${ROOT}"/etc/TZ |
428 |
- fi |
429 |
- [ "${ROOT}" != "/" ] && return 0 |
430 |
- # update cache before reloading init |
431 |
- ldconfig |
432 |
- # reload init ... |
433 |
- /sbin/telinit U 2>/dev/null |
434 |
-} |
435 |
|
436 |
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.17.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.17.ebuild |
437 |
deleted file mode 100644 |
438 |
index ba63764701e..00000000000 |
439 |
--- a/sys-libs/uclibc-ng/uclibc-ng-1.0.17.ebuild |
440 |
+++ /dev/null |
441 |
@@ -1,399 +0,0 @@ |
442 |
-# Copyright 1999-2016 Gentoo Foundation |
443 |
-# Distributed under the terms of the GNU General Public License v2 |
444 |
- |
445 |
-EAPI="6" |
446 |
- |
447 |
-inherit flag-o-matic multilib savedconfig toolchain-funcs versionator |
448 |
- |
449 |
-if [[ ${PV} == "9999" ]] ; then |
450 |
- EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng" |
451 |
- inherit git-r3 |
452 |
- MY_P=uclibc-ng-${PV} |
453 |
-else |
454 |
- MY_P=uClibc-ng-${PV} |
455 |
-fi |
456 |
- |
457 |
-DESCRIPTION="C library for developing embedded Linux systems" |
458 |
-HOMEPAGE="http://www.uclibc-ng.org/" |
459 |
-if [[ ${PV} != "9999" ]] ; then |
460 |
- PATCH_VER="" |
461 |
- SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2" |
462 |
- KEYWORDS="-* amd64 arm ~mips ppc x86" |
463 |
-fi |
464 |
- |
465 |
-LICENSE="LGPL-2" |
466 |
-SLOT="0" |
467 |
-IUSE="debug hardened iconv ipv6 rpc crosscompile_opts_headers-only" |
468 |
-RESTRICT="strip" |
469 |
- |
470 |
-# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage |
471 |
-# will delete the ld.so sym link prematurely and break the system. So we |
472 |
-# will hard block and give manual migration instructions. |
473 |
-# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using |
474 |
-# the breakout library. The disadvantage here is that we have to sprinkle |
475 |
-# LDFAGS=-liconv on build systems that need to link against libiconv. |
476 |
-RDEPEND=" |
477 |
- !!sys-libs/uclibc |
478 |
- iconv? ( dev-libs/libiconv )" |
479 |
- |
480 |
-S=${WORKDIR}/${MY_P} |
481 |
- |
482 |
-export CBUILD=${CBUILD:-${CHOST}} |
483 |
-export CTARGET=${CTARGET:-${CHOST}} |
484 |
-if [[ ${CHOST} == ${CTARGET} ]] ; then |
485 |
- if [[ ${CATEGORY} == cross-* ]] ; then |
486 |
- export CTARGET=${CATEGORY#cross-} |
487 |
- fi |
488 |
-fi |
489 |
- |
490 |
-is_crosscompile() { |
491 |
- [[ ${CHOST} != ${CTARGET} ]] |
492 |
-} |
493 |
- |
494 |
-alt_build_kprefix() { |
495 |
- if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then |
496 |
- echo /usr/include |
497 |
- else |
498 |
- echo /usr/${CTARGET}/usr/include |
499 |
- fi |
500 |
-} |
501 |
- |
502 |
-just_headers() { |
503 |
- use crosscompile_opts_headers-only && is_crosscompile |
504 |
-} |
505 |
- |
506 |
-uclibc_endian() { |
507 |
- # XXX: this wont work for a toolchain which is bi-endian, but we |
508 |
- # dont have any such thing at the moment, so not a big deal |
509 |
- touch "${T}"/endian.s |
510 |
- $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o |
511 |
- case $(file "${T}"/endian.o) in |
512 |
- *" MSB "*) echo "BIG";; |
513 |
- *" LSB "*) echo "LITTLE";; |
514 |
- *) echo "NFC";; |
515 |
- esac |
516 |
- rm -f "${T}"/endian.{s,o} |
517 |
-} |
518 |
- |
519 |
-kconfig_q_opt() { |
520 |
- local flag=$1; shift |
521 |
- case ${flag} in |
522 |
- y|n) ;; |
523 |
- *) flag=$(usex ${flag} y n) ;; |
524 |
- esac |
525 |
- |
526 |
- local var="defs_${flag}" |
527 |
- eval "${var}+=( $* )" |
528 |
-} |
529 |
- |
530 |
-get_opt() { |
531 |
- ( |
532 |
- unset ${1} |
533 |
- . ${2:-"${S}"/.config} |
534 |
- echo ${!1} |
535 |
- ) |
536 |
-} |
537 |
- |
538 |
-make_oldconfig() { |
539 |
- yes "" 2>/dev/null | emake -s oldconfig >/dev/null |
540 |
-} |
541 |
- |
542 |
-make_config() { |
543 |
- restore_config .config |
544 |
- if [ -f .config ]; then |
545 |
- make_oldconfig |
546 |
- return 0 |
547 |
- else |
548 |
- ewarn "Could not locate user configfile, so we will save a default one" |
549 |
- fi |
550 |
- |
551 |
- emake ARCH=$1 defconfig >/dev/null |
552 |
- |
553 |
- local defs_{y,n} |
554 |
- |
555 |
- # These are forced off |
556 |
- defs_n=( |
557 |
- DOASSERTS |
558 |
- DODEBUG_PT |
559 |
- HAS_NO_THREADS |
560 |
- PROPOLICE_BLOCK_ABRT |
561 |
- SSP_QUICK_CANARY |
562 |
- SUPPORT_LD_DEBUG_EARLY |
563 |
- UCLIBC_HAS_CTYPE_UNSAFE |
564 |
- UCLIBC_HAS_LOCALE |
565 |
- UCLIBC_HAS_SSP_COMPAT |
566 |
- ) |
567 |
- |
568 |
- # These are forced on |
569 |
- defs_y=( |
570 |
- COMPAT_ATEXIT |
571 |
- DO_C99_MATH |
572 |
- DO_XSI_MATH |
573 |
- FORCE_SHAREABLE_TEXT_SEGMENTS |
574 |
- LDSO_GNU_HASH_SUPPORT |
575 |
- LDSO_PRELINK_SUPPORT |
576 |
- LDSO_PRELOAD_FILE_SUPPORT |
577 |
- LDSO_RUNPATH_OF_EXECUTABLE |
578 |
- LDSO_STANDALONE_SUPPORT |
579 |
- MALLOC_GLIBC_COMPAT |
580 |
- PROPOLICE_BLOCK_SEGV |
581 |
- PTHREADS_DEBUG_SUPPORT |
582 |
- UCLIBC_HAS_ARC4RANDOM |
583 |
- UCLIBC_HAS_BACKTRACE |
584 |
- UCLIBC_HAS_BSD_RES_CLOSE |
585 |
- UCLIBC_HAS_CONTEXT_FUNCS |
586 |
- UCLIBC_HAS_CTYPE_CHECKED |
587 |
- UCLIBC_HAS_EXTRA_COMPAT_RES_STATE |
588 |
- UCLIBC_HAS_FENV |
589 |
- UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE |
590 |
- UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE |
591 |
- UCLIBC_HAS_FOPEN_LARGEFILE_MODE |
592 |
- UCLIBC_HAS_FTS |
593 |
- UCLIBC_HAS_FTW |
594 |
- UCLIBC_HAS_GETPT |
595 |
- UCLIBC_HAS_GLIBC_CUSTOM_PRINTF |
596 |
- UCLIBC_HAS_GLIBC_CUSTOM_STREAMS |
597 |
- UCLIBC_HAS_GNU_GLOB |
598 |
- UCLIBC_HAS_HEXADECIMAL_FLOATS |
599 |
- UCLIBC_HAS_LIBNSL_STUB |
600 |
- UCLIBC_HAS_LIBRESOLV_STUB |
601 |
- UCLIBC_HAS_LIBUTIL |
602 |
- UCLIBC_HAS_NFTW |
603 |
- UCLIBC_HAS_OBSOLETE_BSD_SIGNAL |
604 |
- UCLIBC_HAS_OBSTACK |
605 |
- UCLIBC_HAS_PRINTF_M_SPEC |
606 |
- UCLIBC_HAS_PROGRAM_INVOCATION_NAME |
607 |
- UCLIBC_HAS_RESOLVER_SUPPORT |
608 |
- UCLIBC_HAS_SHA256_CRYPT_IMPL |
609 |
- UCLIBC_HAS_SHA512_CRYPT_IMPL |
610 |
- UCLIBC_HAS_SSP |
611 |
- UCLIBC_HAS_STUBS |
612 |
- UCLIBC_HAS_SYS_ERRLIST |
613 |
- UCLIBC_HAS_SYS_SIGLIST |
614 |
- UCLIBC_HAS_THREADS_NATIVE |
615 |
- UCLIBC_HAS_TZ_FILE_READ_MANY |
616 |
- UCLIBC_HAS_UTMP |
617 |
- UCLIBC_HAS_UTMPX |
618 |
- UCLIBC_HAS_WCHAR |
619 |
- UCLIBC_HAS_WORDEXP |
620 |
- UCLIBC_NTP_LEGACY |
621 |
- UCLIBC_SUPPORT_AI_ADDRCONFIG |
622 |
- UCLIBC_SUSV2_LEGACY |
623 |
- UCLIBC_SUSV3_LEGACY |
624 |
- UCLIBC_SUSV3_LEGACY_MACROS |
625 |
- UCLIBC_SUSV4_LEGACY |
626 |
- UCLIBC_USE_NETLINK |
627 |
- ) |
628 |
- |
629 |
- sed -i -e '/ARCH_.*_ENDIAN/d' .config |
630 |
- kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN" |
631 |
- |
632 |
- kconfig_q_opt debug DODEBUG |
633 |
- kconfig_q_opt debug SUPPORT_LD_DEBUG |
634 |
- kconfig_q_opt debug UCLIBC_HAS_PROFILING |
635 |
- |
636 |
- kconfig_q_opt ipv6 UCLIBC_HAS_IPV6 |
637 |
- |
638 |
- kconfig_q_opt rpc UCLIBC_HAS_RPC |
639 |
- kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC |
640 |
- kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC |
641 |
- |
642 |
- kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK |
643 |
- kconfig_q_opt hardened UCLIBC_BUILD_NOW |
644 |
- kconfig_q_opt hardened UCLIBC_BUILD_PIE |
645 |
- kconfig_q_opt hardened UCLIBC_BUILD_RELRO |
646 |
- kconfig_q_opt hardened UCLIBC_BUILD_SSP |
647 |
- |
648 |
- local count def |
649 |
- for count in 1 2 ; do |
650 |
- # Run twice as some config opts depend on others being enabled first. |
651 |
- for def in ${defs_y[@]} ; do |
652 |
- sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config |
653 |
- done |
654 |
- for def in ${defs_n[@]} ; do |
655 |
- sed -i -e "s|${def}=y|# ${def} is not set|g" .config |
656 |
- done |
657 |
- make_oldconfig |
658 |
- done |
659 |
- |
660 |
- einfo "Enabled options:" |
661 |
- for def in ${defs_y[@]} ; do |
662 |
- einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}") |
663 |
- done |
664 |
- einfo "Disabled options:" |
665 |
- for def in ${defs_n[@]} ; do |
666 |
- einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}") |
667 |
- done |
668 |
- |
669 |
- # setup build and run paths |
670 |
- sed -i \ |
671 |
- -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \ |
672 |
- -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \ |
673 |
- -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \ |
674 |
- -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \ |
675 |
- -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \ |
676 |
- -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \ |
677 |
- .config || die |
678 |
- |
679 |
- make_oldconfig |
680 |
-} |
681 |
- |
682 |
-pkg_setup() { |
683 |
- # Make sure our CHOST is a uclibc toolchain for native compiling |
684 |
- if [[ ${CHOST} == ${CTARGET} ]]; then |
685 |
- case ${CHOST} in |
686 |
- *-uclinux*|*-uclibc*) ;; |
687 |
- *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;; |
688 |
- esac |
689 |
- fi |
690 |
- |
691 |
- # uClibc-ng doesn't carry old Linux threads, and since we force |
692 |
- # threading our only choice is NPTL which requires i486 and later. |
693 |
- [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)." |
694 |
-} |
695 |
- |
696 |
-src_prepare() { |
697 |
- local version subversion extraversion |
698 |
- |
699 |
- # uclibc-ng tries to create a two sym link with ld.so, |
700 |
- # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so |
701 |
- # where MAJOR_VERSION != 0 indicates the ABI verison. |
702 |
- # We want to get rid of this and just have ABI = 0. |
703 |
- eapply "${FILESDIR}"/uclibc-compat.patch |
704 |
- |
705 |
- # We need to change the major.minor.sublevel of uclibc-ng. |
706 |
- # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking. |
707 |
- # If we really want the ABI bump, we'll have to hack the gcc |
708 |
- # spec file and change the '*link:' rule. |
709 |
- version=( $(get_version_components) ) |
710 |
- if [[ -z ${version[1]} ]]; then |
711 |
- subversion=0 |
712 |
- extraversion=0 |
713 |
- else |
714 |
- subversion=${version[1]} |
715 |
- if [[ -z ${version[2]} ]]; then |
716 |
- extraversion=0 |
717 |
- else |
718 |
- extraversion=.${version[2]} |
719 |
- fi |
720 |
- fi |
721 |
- |
722 |
- sed -i \ |
723 |
- -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \ |
724 |
- -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \ |
725 |
- -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \ |
726 |
- -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \ |
727 |
- Rules.mak || die |
728 |
- |
729 |
- eapply_user |
730 |
-} |
731 |
- |
732 |
-src_configure() { |
733 |
- # Map our toolchain arch name to the name expected by uClibc-ng. |
734 |
- local target=$(tc-arch) |
735 |
- case ${target} in |
736 |
- amd64) target="x86_64";; |
737 |
- arm) target="arm";; |
738 |
- mips) target="mips";; |
739 |
- ppc) target="powerpc";; |
740 |
- x86) target="i386";; |
741 |
- esac |
742 |
- |
743 |
- # Do arch specific configuration by changing the defaults in |
744 |
- # extra/Configs/Config.<arch>. If these are not overridden |
745 |
- # by an save .config, they will be selected by default. |
746 |
- |
747 |
- # For i386, i486, i586 and i686 |
748 |
- local cpu |
749 |
- if [[ ${target} == "i386" ]]; then |
750 |
- [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86" |
751 |
- sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \ |
752 |
- extra/Configs/Config.i386 || die |
753 |
- fi |
754 |
- |
755 |
- # For arm |
756 |
- if [[ ${target} == "arm" ]]; then |
757 |
- sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm |
758 |
- fi |
759 |
- |
760 |
- # We set HOSTCC to the proper tuple rather than just 'gcc' |
761 |
- sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak |
762 |
- |
763 |
- make_config ${target} |
764 |
- |
765 |
- einfo |
766 |
- einfo "Runtime Prefix: /" |
767 |
- einfo "Devel Prefix: /usr" |
768 |
- einfo "Kernel Prefix: $(alt_build_kprefix)" |
769 |
- einfo "CBUILD: ${CBUILD}" |
770 |
- einfo "CHOST: ${CHOST}" |
771 |
- einfo "CTARGET: ${CTARGET}" |
772 |
- einfo "ABI: ${ABI}" |
773 |
- einfo "ENDIAN: $(uclibc_endian)" |
774 |
- einfo |
775 |
-} |
776 |
- |
777 |
-src_compile() { |
778 |
- emake headers |
779 |
- just_headers && return 0 |
780 |
- |
781 |
- emake |
782 |
- if is_crosscompile ; then |
783 |
- emake -C utils hostutils |
784 |
- else |
785 |
- emake utils |
786 |
- fi |
787 |
-} |
788 |
- |
789 |
-src_test() { |
790 |
- is_crosscompile && return 0 |
791 |
- |
792 |
- # assert test fails on pax/grsec enabled kernels |
793 |
- # normal vfork test fails in sandbox (both glibc/uclibc) |
794 |
- emake UCLIBC_ONLY=1 check |
795 |
-} |
796 |
- |
797 |
-src_install() { |
798 |
- local sysroot=${D} |
799 |
- is_crosscompile && sysroot+="/usr/${CTARGET}" |
800 |
- |
801 |
- local target="install" |
802 |
- just_headers && target="install_headers" |
803 |
- emake DESTDIR="${sysroot}" ${target} |
804 |
- |
805 |
- save_config .config |
806 |
- |
807 |
- # remove files coming from kernel-headers |
808 |
- rm -rf "${sysroot}"/usr/include/{linux,asm*} |
809 |
- |
810 |
- # Make sure we install the sys-include symlink so that when |
811 |
- # we build a 2nd stage cross-compiler, gcc finds the target |
812 |
- # system headers correctly. See gcc/doc/gccinstall.info |
813 |
- if is_crosscompile ; then |
814 |
- dosym usr/include /usr/${CTARGET}/sys-include |
815 |
- if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then |
816 |
- newbin utils/ldconfig.host ${CTARGET}-ldconfig |
817 |
- newbin utils/ldd.host ${CTARGET}-ldd |
818 |
- fi |
819 |
- return 0 |
820 |
- fi |
821 |
- |
822 |
- emake DESTDIR="${D}" install_utils |
823 |
- dobin extra/scripts/getent |
824 |
- dodoc README docs/*.txt |
825 |
-} |
826 |
- |
827 |
-pkg_postinst() { |
828 |
- is_crosscompile && return 0 |
829 |
- |
830 |
- if [ ! -e "${ROOT}"/etc/TZ ] ; then |
831 |
- ewarn "Please remember to set your timezone in /etc/TZ" |
832 |
- mkdir -p "${ROOT}"/etc |
833 |
- echo "UTC" > "${ROOT}"/etc/TZ |
834 |
- fi |
835 |
- [ "${ROOT}" != "/" ] && return 0 |
836 |
- # update cache before reloading init |
837 |
- ldconfig |
838 |
- # reload init ... |
839 |
- /sbin/telinit U 2>/dev/null |
840 |
-} |
841 |
|
842 |
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.18-r1.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.18-r1.ebuild |
843 |
deleted file mode 100644 |
844 |
index f6fc8c5d528..00000000000 |
845 |
--- a/sys-libs/uclibc-ng/uclibc-ng-1.0.18-r1.ebuild |
846 |
+++ /dev/null |
847 |
@@ -1,408 +0,0 @@ |
848 |
-# Copyright 1999-2016 Gentoo Foundation |
849 |
-# Distributed under the terms of the GNU General Public License v2 |
850 |
- |
851 |
-EAPI="6" |
852 |
- |
853 |
-inherit flag-o-matic multilib savedconfig toolchain-funcs versionator |
854 |
- |
855 |
-if [[ ${PV} == "9999" ]] ; then |
856 |
- EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng" |
857 |
- inherit git-r3 |
858 |
- MY_P=uclibc-ng-${PV} |
859 |
-else |
860 |
- MY_P=uClibc-ng-${PV} |
861 |
-fi |
862 |
- |
863 |
-DESCRIPTION="C library for developing embedded Linux systems" |
864 |
-HOMEPAGE="http://www.uclibc-ng.org/" |
865 |
-if [[ ${PV} != "9999" ]] ; then |
866 |
- PATCH_VER="" |
867 |
- SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2" |
868 |
- KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86" |
869 |
-fi |
870 |
- |
871 |
-LICENSE="LGPL-2" |
872 |
-SLOT="0" |
873 |
-IUSE="debug hardened iconv ipv6 rpc crosscompile_opts_headers-only" |
874 |
-RESTRICT="strip" |
875 |
- |
876 |
-# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage |
877 |
-# will delete the ld.so sym link prematurely and break the system. So we |
878 |
-# will hard block and give manual migration instructions. |
879 |
-# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using |
880 |
-# the breakout library. The disadvantage here is that we have to sprinkle |
881 |
-# LDFAGS=-liconv on build systems that need to link against libiconv. |
882 |
-RDEPEND=" |
883 |
- !!sys-libs/uclibc |
884 |
- iconv? ( dev-libs/libiconv )" |
885 |
- |
886 |
-S=${WORKDIR}/${MY_P} |
887 |
- |
888 |
-export CBUILD=${CBUILD:-${CHOST}} |
889 |
-export CTARGET=${CTARGET:-${CHOST}} |
890 |
-if [[ ${CHOST} == ${CTARGET} ]] ; then |
891 |
- if [[ ${CATEGORY} == cross-* ]] ; then |
892 |
- export CTARGET=${CATEGORY#cross-} |
893 |
- fi |
894 |
-fi |
895 |
- |
896 |
-is_crosscompile() { |
897 |
- [[ ${CHOST} != ${CTARGET} ]] |
898 |
-} |
899 |
- |
900 |
-alt_build_kprefix() { |
901 |
- if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then |
902 |
- echo /usr/include |
903 |
- else |
904 |
- echo /usr/${CTARGET}/usr/include |
905 |
- fi |
906 |
-} |
907 |
- |
908 |
-just_headers() { |
909 |
- use crosscompile_opts_headers-only && is_crosscompile |
910 |
-} |
911 |
- |
912 |
-uclibc_endian() { |
913 |
- # XXX: this wont work for a toolchain which is bi-endian, but we |
914 |
- # dont have any such thing at the moment, so not a big deal |
915 |
- touch "${T}"/endian.s |
916 |
- $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o |
917 |
- case $(file "${T}"/endian.o) in |
918 |
- *" MSB "*) echo "BIG";; |
919 |
- *" LSB "*) echo "LITTLE";; |
920 |
- *) echo "NFC";; |
921 |
- esac |
922 |
- rm -f "${T}"/endian.{s,o} |
923 |
-} |
924 |
- |
925 |
-kconfig_q_opt() { |
926 |
- local flag=$1; shift |
927 |
- case ${flag} in |
928 |
- y|n) ;; |
929 |
- *) flag=$(usex ${flag} y n) ;; |
930 |
- esac |
931 |
- |
932 |
- local var="defs_${flag}" |
933 |
- eval "${var}+=( $* )" |
934 |
-} |
935 |
- |
936 |
-get_opt() { |
937 |
- ( |
938 |
- unset ${1} |
939 |
- . ${2:-"${S}"/.config} |
940 |
- echo ${!1} |
941 |
- ) |
942 |
-} |
943 |
- |
944 |
-make_oldconfig() { |
945 |
- yes "" 2>/dev/null | emake -s oldconfig >/dev/null |
946 |
-} |
947 |
- |
948 |
-make_config() { |
949 |
- restore_config .config |
950 |
- if [ -f .config ]; then |
951 |
- make_oldconfig |
952 |
- return 0 |
953 |
- else |
954 |
- ewarn "Could not locate user configfile, so we will save a default one" |
955 |
- fi |
956 |
- |
957 |
- emake ARCH=$1 defconfig >/dev/null |
958 |
- |
959 |
- local defs_{y,n} |
960 |
- |
961 |
- # These are forced off |
962 |
- defs_n=( |
963 |
- DOASSERTS |
964 |
- DODEBUG_PT |
965 |
- HAS_NO_THREADS |
966 |
- PROPOLICE_BLOCK_ABRT |
967 |
- SSP_QUICK_CANARY |
968 |
- SUPPORT_LD_DEBUG_EARLY |
969 |
- UCLIBC_HAS_CTYPE_UNSAFE |
970 |
- UCLIBC_HAS_LOCALE |
971 |
- UCLIBC_HAS_SSP_COMPAT |
972 |
- ) |
973 |
- |
974 |
- # These are forced on |
975 |
- defs_y=( |
976 |
- COMPAT_ATEXIT |
977 |
- DO_C99_MATH |
978 |
- DO_XSI_MATH |
979 |
- FORCE_SHAREABLE_TEXT_SEGMENTS |
980 |
- LDSO_GNU_HASH_SUPPORT |
981 |
- LDSO_PRELINK_SUPPORT |
982 |
- LDSO_PRELOAD_FILE_SUPPORT |
983 |
- LDSO_RUNPATH_OF_EXECUTABLE |
984 |
- LDSO_STANDALONE_SUPPORT |
985 |
- MALLOC_GLIBC_COMPAT |
986 |
- PROPOLICE_BLOCK_SEGV |
987 |
- PTHREADS_DEBUG_SUPPORT |
988 |
- UCLIBC_HAS_ARC4RANDOM |
989 |
- UCLIBC_HAS_BACKTRACE |
990 |
- UCLIBC_HAS_BSD_RES_CLOSE |
991 |
- UCLIBC_HAS_CONTEXT_FUNCS |
992 |
- UCLIBC_HAS_CTYPE_CHECKED |
993 |
- UCLIBC_HAS_EXTRA_COMPAT_RES_STATE |
994 |
- UCLIBC_HAS_FENV |
995 |
- UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE |
996 |
- UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE |
997 |
- UCLIBC_HAS_FOPEN_LARGEFILE_MODE |
998 |
- UCLIBC_HAS_FTS |
999 |
- UCLIBC_HAS_FTW |
1000 |
- UCLIBC_HAS_GETPT |
1001 |
- UCLIBC_HAS_GLIBC_CUSTOM_PRINTF |
1002 |
- UCLIBC_HAS_GLIBC_CUSTOM_STREAMS |
1003 |
- UCLIBC_HAS_GNU_GLOB |
1004 |
- UCLIBC_HAS_HEXADECIMAL_FLOATS |
1005 |
- UCLIBC_HAS_LIBNSL_STUB |
1006 |
- UCLIBC_HAS_LIBRESOLV_STUB |
1007 |
- UCLIBC_HAS_LIBUTIL |
1008 |
- UCLIBC_HAS_NFTW |
1009 |
- UCLIBC_HAS_OBSOLETE_BSD_SIGNAL |
1010 |
- UCLIBC_HAS_OBSTACK |
1011 |
- UCLIBC_HAS_PRINTF_M_SPEC |
1012 |
- UCLIBC_HAS_PROGRAM_INVOCATION_NAME |
1013 |
- UCLIBC_HAS_RESOLVER_SUPPORT |
1014 |
- UCLIBC_HAS_SHA256_CRYPT_IMPL |
1015 |
- UCLIBC_HAS_SHA512_CRYPT_IMPL |
1016 |
- UCLIBC_HAS_SSP |
1017 |
- UCLIBC_HAS_STUBS |
1018 |
- UCLIBC_HAS_SYS_ERRLIST |
1019 |
- UCLIBC_HAS_SYS_SIGLIST |
1020 |
- UCLIBC_HAS_THREADS_NATIVE |
1021 |
- UCLIBC_HAS_TZ_FILE_READ_MANY |
1022 |
- UCLIBC_HAS_UTMP |
1023 |
- UCLIBC_HAS_UTMPX |
1024 |
- UCLIBC_HAS_WCHAR |
1025 |
- UCLIBC_HAS_WORDEXP |
1026 |
- UCLIBC_NTP_LEGACY |
1027 |
- UCLIBC_SUPPORT_AI_ADDRCONFIG |
1028 |
- UCLIBC_SUSV2_LEGACY |
1029 |
- UCLIBC_SUSV3_LEGACY |
1030 |
- UCLIBC_SUSV3_LEGACY_MACROS |
1031 |
- UCLIBC_SUSV4_LEGACY |
1032 |
- UCLIBC_USE_NETLINK |
1033 |
- ) |
1034 |
- |
1035 |
- sed -i -e '/ARCH_.*_ENDIAN/d' .config |
1036 |
- kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN" |
1037 |
- |
1038 |
- kconfig_q_opt debug DODEBUG |
1039 |
- kconfig_q_opt debug SUPPORT_LD_DEBUG |
1040 |
- kconfig_q_opt debug UCLIBC_HAS_PROFILING |
1041 |
- |
1042 |
- kconfig_q_opt ipv6 UCLIBC_HAS_IPV6 |
1043 |
- |
1044 |
- kconfig_q_opt rpc UCLIBC_HAS_RPC |
1045 |
- kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC |
1046 |
- kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC |
1047 |
- |
1048 |
- kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK |
1049 |
- kconfig_q_opt hardened UCLIBC_BUILD_NOW |
1050 |
- kconfig_q_opt hardened UCLIBC_BUILD_PIE |
1051 |
- kconfig_q_opt hardened UCLIBC_BUILD_RELRO |
1052 |
- kconfig_q_opt hardened UCLIBC_BUILD_SSP |
1053 |
- |
1054 |
- local count def |
1055 |
- for count in 1 2 ; do |
1056 |
- # Run twice as some config opts depend on others being enabled first. |
1057 |
- for def in ${defs_y[@]} ; do |
1058 |
- sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config |
1059 |
- done |
1060 |
- for def in ${defs_n[@]} ; do |
1061 |
- sed -i -e "s|${def}=y|# ${def} is not set|g" .config |
1062 |
- done |
1063 |
- make_oldconfig |
1064 |
- done |
1065 |
- |
1066 |
- einfo "Enabled options:" |
1067 |
- for def in ${defs_y[@]} ; do |
1068 |
- einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}") |
1069 |
- done |
1070 |
- einfo "Disabled options:" |
1071 |
- for def in ${defs_n[@]} ; do |
1072 |
- einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}") |
1073 |
- done |
1074 |
- |
1075 |
- # setup build and run paths |
1076 |
- sed -i \ |
1077 |
- -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \ |
1078 |
- -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \ |
1079 |
- -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \ |
1080 |
- -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \ |
1081 |
- -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \ |
1082 |
- -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \ |
1083 |
- .config || die |
1084 |
- |
1085 |
- make_oldconfig |
1086 |
-} |
1087 |
- |
1088 |
-pkg_setup() { |
1089 |
- # Make sure our CHOST is a uclibc toolchain for native compiling |
1090 |
- if [[ ${CHOST} == ${CTARGET} ]]; then |
1091 |
- case ${CHOST} in |
1092 |
- *-uclinux*|*-uclibc*) ;; |
1093 |
- *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;; |
1094 |
- esac |
1095 |
- fi |
1096 |
- |
1097 |
- # uClibc-ng doesn't carry old Linux threads, and since we force |
1098 |
- # threading our only choice is NPTL which requires i486 and later. |
1099 |
- [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)." |
1100 |
-} |
1101 |
- |
1102 |
-src_prepare() { |
1103 |
- local version subversion extraversion |
1104 |
- |
1105 |
- # uclibc-ng tries to create a two sym link with ld.so, |
1106 |
- # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so |
1107 |
- # where MAJOR_VERSION != 0 indicates the ABI verison. |
1108 |
- # We want to get rid of this and just have ABI = 0. |
1109 |
- eapply "${FILESDIR}"/uclibc-compat-r1.patch |
1110 |
- |
1111 |
- # We need to change the major.minor.sublevel of uclibc-ng. |
1112 |
- # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking. |
1113 |
- # If we really want the ABI bump, we'll have to hack the gcc |
1114 |
- # spec file and change the '*link:' rule. |
1115 |
- version=( $(get_version_components) ) |
1116 |
- if [[ -z ${version[1]} ]]; then |
1117 |
- subversion=0 |
1118 |
- extraversion=0 |
1119 |
- else |
1120 |
- subversion=${version[1]} |
1121 |
- if [[ -z ${version[2]} ]]; then |
1122 |
- extraversion=0 |
1123 |
- else |
1124 |
- extraversion=.${version[2]} |
1125 |
- fi |
1126 |
- fi |
1127 |
- |
1128 |
- sed -i \ |
1129 |
- -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \ |
1130 |
- -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \ |
1131 |
- -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \ |
1132 |
- -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \ |
1133 |
- Rules.mak || die |
1134 |
- |
1135 |
- eapply_user |
1136 |
-} |
1137 |
- |
1138 |
-src_configure() { |
1139 |
- # Map our toolchain arch name to the name expected by uClibc-ng. |
1140 |
- local target=$(tc-arch) |
1141 |
- case ${target} in |
1142 |
- amd64) target="x86_64";; |
1143 |
- arm) target="arm";; |
1144 |
- mips) target="mips";; |
1145 |
- ppc) target="powerpc";; |
1146 |
- x86) target="i386";; |
1147 |
- esac |
1148 |
- |
1149 |
- # Do arch specific configuration by changing the defaults in |
1150 |
- # extra/Configs/Config.<arch>. If these are not overridden |
1151 |
- # by an save .config, they will be selected by default. |
1152 |
- |
1153 |
- # For i386, i486, i586 and i686 |
1154 |
- local cpu |
1155 |
- if [[ ${target} == "i386" ]]; then |
1156 |
- [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86" |
1157 |
- sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \ |
1158 |
- extra/Configs/Config.i386 || die |
1159 |
- fi |
1160 |
- |
1161 |
- # For arm |
1162 |
- if [[ ${target} == "arm" ]]; then |
1163 |
- sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm |
1164 |
- fi |
1165 |
- |
1166 |
- # We set HOSTCC to the proper tuple rather than just 'gcc' |
1167 |
- sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak |
1168 |
- |
1169 |
- make_config ${target} |
1170 |
- |
1171 |
- einfo |
1172 |
- einfo "Runtime Prefix: /" |
1173 |
- einfo "Devel Prefix: /usr" |
1174 |
- einfo "Kernel Prefix: $(alt_build_kprefix)" |
1175 |
- einfo "CBUILD: ${CBUILD}" |
1176 |
- einfo "CHOST: ${CHOST}" |
1177 |
- einfo "CTARGET: ${CTARGET}" |
1178 |
- einfo "ABI: ${ABI}" |
1179 |
- einfo "ENDIAN: $(uclibc_endian)" |
1180 |
- einfo |
1181 |
-} |
1182 |
- |
1183 |
-src_compile() { |
1184 |
- emake headers |
1185 |
- just_headers && return 0 |
1186 |
- |
1187 |
- emake |
1188 |
- if is_crosscompile ; then |
1189 |
- emake -C utils hostutils |
1190 |
- else |
1191 |
- emake utils |
1192 |
- fi |
1193 |
-} |
1194 |
- |
1195 |
-src_test() { |
1196 |
- is_crosscompile && return 0 |
1197 |
- |
1198 |
- # assert test fails on pax/grsec enabled kernels |
1199 |
- # normal vfork test fails in sandbox (both glibc/uclibc) |
1200 |
- emake UCLIBC_ONLY=1 check |
1201 |
-} |
1202 |
- |
1203 |
-src_install() { |
1204 |
- local sysroot=${D} |
1205 |
- is_crosscompile && sysroot+="/usr/${CTARGET}" |
1206 |
- |
1207 |
- local target="install" |
1208 |
- just_headers && target="install_headers" |
1209 |
- emake DESTDIR="${sysroot}" ${target} |
1210 |
- |
1211 |
- save_config .config |
1212 |
- |
1213 |
- # remove files coming from kernel-headers |
1214 |
- rm -rf "${sysroot}"/usr/include/{linux,asm*} |
1215 |
- |
1216 |
- # Make sure we install the sys-include symlink so that when |
1217 |
- # we build a 2nd stage cross-compiler, gcc finds the target |
1218 |
- # system headers correctly. See gcc/doc/gccinstall.info |
1219 |
- if is_crosscompile ; then |
1220 |
- dosym usr/include /usr/${CTARGET}/sys-include |
1221 |
- if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then |
1222 |
- newbin utils/ldconfig.host ${CTARGET}-ldconfig |
1223 |
- newbin utils/ldd.host ${CTARGET}-ldd |
1224 |
- fi |
1225 |
- return 0 |
1226 |
- fi |
1227 |
- |
1228 |
- dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0 |
1229 |
- dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0 |
1230 |
- dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0 |
1231 |
- dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0 |
1232 |
- dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0 |
1233 |
- dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0 |
1234 |
- dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0 |
1235 |
- dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0 |
1236 |
- |
1237 |
- emake DESTDIR="${D}" install_utils |
1238 |
- dobin extra/scripts/getent |
1239 |
- dodoc README docs/*.txt |
1240 |
-} |
1241 |
- |
1242 |
-pkg_postinst() { |
1243 |
- is_crosscompile && return 0 |
1244 |
- |
1245 |
- if [ ! -e "${ROOT}"/etc/TZ ] ; then |
1246 |
- ewarn "Please remember to set your timezone in /etc/TZ" |
1247 |
- mkdir -p "${ROOT}"/etc |
1248 |
- echo "UTC" > "${ROOT}"/etc/TZ |
1249 |
- fi |
1250 |
- [ "${ROOT}" != "/" ] && return 0 |
1251 |
- # update cache before reloading init |
1252 |
- ldconfig |
1253 |
- # reload init ... |
1254 |
- /sbin/telinit U 2>/dev/null |
1255 |
-} |