1 |
commit: 20997e75eee46c973e23085a46d37c14c69351b6 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 29 23:11:31 2016 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 29 23:11:31 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20997e75 |
7 |
|
8 |
sys-libs/uclibc-ng: version bump to 1.0.15 |
9 |
|
10 |
Package-Manager: portage-2.2.28 |
11 |
|
12 |
sys-libs/uclibc-ng/Manifest | 1 + |
13 |
sys-libs/uclibc-ng/uclibc-ng-1.0.15.ebuild | 406 +++++++++++++++++++++++++++++ |
14 |
2 files changed, 407 insertions(+) |
15 |
|
16 |
diff --git a/sys-libs/uclibc-ng/Manifest b/sys-libs/uclibc-ng/Manifest |
17 |
index 6a0534d..301a419 100644 |
18 |
--- a/sys-libs/uclibc-ng/Manifest |
19 |
+++ b/sys-libs/uclibc-ng/Manifest |
20 |
@@ -1 +1,2 @@ |
21 |
DIST uClibc-ng-1.0.14.tar.bz2 2859522 SHA256 5e3ed3c217786b238e7e356fae05c75a158d1852e72ddea954787bdcf4d63dfa SHA512 293b9260ca9a62170746e441de161ebfedb171050f168db0131fa1aec1819477ff792204525747aec82c7f473b2f48eb93aedabcd768814ac207b28032112366 WHIRLPOOL 93dce8443c3b6d0b4a616de6084cf5169d24a55e0cf9445d90d24ea66dc51902f1612371747171967431ad30a8129fa3b22830d55d746e013dc2929a0f4d81eb |
22 |
+DIST uClibc-ng-1.0.15.tar.bz2 2765526 SHA256 89a91aa18909ffb27407cd6f56dfd3ab504f0c415e42410870290b5dc45a1cd9 SHA512 a4f7520fad9b1927d8ca738410b213514c3151822d5c01474ffc71e4cf4e60815bcb3a5fb98f141cf615d0fe57a7f1d3d0d2b1fd217ad5eaf8835d41ea686dc0 WHIRLPOOL 88f481cbac54844c9620de916a22e57dfb15ade01b223712ac679d4224807bdfd47ae4e157a1672e33d38beda618ae970605861d6e18c4a312720eca2e608c93 |
23 |
|
24 |
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.15.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.15.ebuild |
25 |
new file mode 100644 |
26 |
index 0000000..e99f8d7 |
27 |
--- /dev/null |
28 |
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.15.ebuild |
29 |
@@ -0,0 +1,406 @@ |
30 |
+# Copyright 1999-2016 Gentoo Foundation |
31 |
+# Distributed under the terms of the GNU General Public License v2 |
32 |
+# $Id$ |
33 |
+ |
34 |
+EAPI="6" |
35 |
+ |
36 |
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator |
37 |
+ |
38 |
+if [[ ${PV} == "9999" ]] ; then |
39 |
+ EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng" |
40 |
+ inherit git-r3 |
41 |
+ MY_P=uclibc-ng-${PV} |
42 |
+else |
43 |
+ MY_P=uClibc-ng-${PV} |
44 |
+fi |
45 |
+ |
46 |
+DESCRIPTION="C library for developing embedded Linux systems" |
47 |
+HOMEPAGE="http://www.uclibc-ng.org/" |
48 |
+if [[ ${PV} != "9999" ]] ; then |
49 |
+ PATCH_VER="" |
50 |
+ SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2" |
51 |
+ KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86" |
52 |
+fi |
53 |
+ |
54 |
+LICENSE="LGPL-2" |
55 |
+SLOT="0" |
56 |
+IUSE="debug hardened iconv ipv6 rpc crosscompile_opts_headers-only" |
57 |
+RESTRICT="strip" |
58 |
+ |
59 |
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage |
60 |
+# will delete the ld.so sym link prematurely and break the system. So we |
61 |
+# will hard block and give manual migration instructions. |
62 |
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using |
63 |
+# the breakout library. The disadvantage here is that we have to sprinkle |
64 |
+# LDFAGS=-liconv on build systems that need to link against libiconv. |
65 |
+RDEPEND=" |
66 |
+ !!sys-libs/uclibc |
67 |
+ iconv? ( dev-libs/libiconv )" |
68 |
+ |
69 |
+S=${WORKDIR}/${MY_P} |
70 |
+ |
71 |
+export CBUILD=${CBUILD:-${CHOST}} |
72 |
+export CTARGET=${CTARGET:-${CHOST}} |
73 |
+if [[ ${CHOST} == ${CTARGET} ]] ; then |
74 |
+ if [[ ${CATEGORY} == cross-* ]] ; then |
75 |
+ export CTARGET=${CATEGORY#cross-} |
76 |
+ fi |
77 |
+fi |
78 |
+ |
79 |
+is_crosscompile() { |
80 |
+ [[ ${CHOST} != ${CTARGET} ]] |
81 |
+} |
82 |
+ |
83 |
+alt_build_kprefix() { |
84 |
+ if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then |
85 |
+ echo /usr/include |
86 |
+ else |
87 |
+ echo /usr/${CTARGET}/usr/include |
88 |
+ fi |
89 |
+} |
90 |
+ |
91 |
+just_headers() { |
92 |
+ use crosscompile_opts_headers-only && is_crosscompile |
93 |
+} |
94 |
+ |
95 |
+uclibc_endian() { |
96 |
+ # XXX: this wont work for a toolchain which is bi-endian, but we |
97 |
+ # dont have any such thing at the moment, so not a big deal |
98 |
+ touch "${T}"/endian.s |
99 |
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o |
100 |
+ case $(file "${T}"/endian.o) in |
101 |
+ *" MSB "*) echo "BIG";; |
102 |
+ *" LSB "*) echo "LITTLE";; |
103 |
+ *) echo "NFC";; |
104 |
+ esac |
105 |
+ rm -f "${T}"/endian.{s,o} |
106 |
+} |
107 |
+ |
108 |
+kconfig_q_opt() { |
109 |
+ local flag=$1; shift |
110 |
+ case ${flag} in |
111 |
+ y|n) ;; |
112 |
+ *) flag=$(usex ${flag} y n) ;; |
113 |
+ esac |
114 |
+ |
115 |
+ local var="defs_${flag}" |
116 |
+ eval "${var}+=( $* )" |
117 |
+} |
118 |
+ |
119 |
+get_opt() { |
120 |
+ ( |
121 |
+ unset ${1} |
122 |
+ . ${2:-"${S}"/.config} |
123 |
+ echo ${!1} |
124 |
+ ) |
125 |
+} |
126 |
+ |
127 |
+make_oldconfig() { |
128 |
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null |
129 |
+} |
130 |
+ |
131 |
+make_config() { |
132 |
+ restore_config .config |
133 |
+ if [ -f .config ]; then |
134 |
+ make_oldconfig |
135 |
+ return 0 |
136 |
+ else |
137 |
+ ewarn "Could not locate user configfile, so we will save a default one" |
138 |
+ fi |
139 |
+ |
140 |
+ emake ARCH=$1 defconfig >/dev/null |
141 |
+ |
142 |
+ local defs_{y,n} |
143 |
+ |
144 |
+ # These are forced off |
145 |
+ defs_n=( |
146 |
+ DOASSERTS |
147 |
+ DODEBUG_PT |
148 |
+ HAS_NO_THREADS |
149 |
+ PROPOLICE_BLOCK_ABRT |
150 |
+ SSP_QUICK_CANARY |
151 |
+ SUPPORT_LD_DEBUG_EARLY |
152 |
+ UCLIBC_HAS_CTYPE_UNSAFE |
153 |
+ UCLIBC_HAS_LOCALE |
154 |
+ UCLIBC_HAS_SSP_COMPAT |
155 |
+ ) |
156 |
+ |
157 |
+ # These are forced on |
158 |
+ defs_y=( |
159 |
+ COMPAT_ATEXIT |
160 |
+ DO_C99_MATH |
161 |
+ DO_XSI_MATH |
162 |
+ FORCE_SHAREABLE_TEXT_SEGMENTS |
163 |
+ LDSO_GNU_HASH_SUPPORT |
164 |
+ LDSO_PRELINK_SUPPORT |
165 |
+ LDSO_PRELOAD_FILE_SUPPORT |
166 |
+ LDSO_RUNPATH_OF_EXECUTABLE |
167 |
+ LDSO_STANDALONE_SUPPORT |
168 |
+ MALLOC_GLIBC_COMPAT |
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_LIBNSL_STUB |
189 |
+ UCLIBC_HAS_LIBRESOLV_STUB |
190 |
+ UCLIBC_HAS_LIBUTIL |
191 |
+ UCLIBC_HAS_NFTW |
192 |
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL |
193 |
+ UCLIBC_HAS_OBSTACK |
194 |
+ UCLIBC_HAS_PRINTF_M_SPEC |
195 |
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME |
196 |
+ UCLIBC_HAS_RESOLVER_SUPPORT |
197 |
+ UCLIBC_HAS_SHA256_CRYPT_IMPL |
198 |
+ UCLIBC_HAS_SHA512_CRYPT_IMPL |
199 |
+ UCLIBC_HAS_SSP |
200 |
+ UCLIBC_HAS_STUBS |
201 |
+ UCLIBC_HAS_SYS_ERRLIST |
202 |
+ UCLIBC_HAS_SYS_SIGLIST |
203 |
+ UCLIBC_HAS_THREADS_NATIVE |
204 |
+ UCLIBC_HAS_TZ_FILE_READ_MANY |
205 |
+ UCLIBC_HAS_UTMP |
206 |
+ UCLIBC_HAS_UTMPX |
207 |
+ UCLIBC_HAS_WCHAR |
208 |
+ UCLIBC_HAS_WORDEXP |
209 |
+ UCLIBC_NTP_LEGACY |
210 |
+ UCLIBC_SUPPORT_AI_ADDRCONFIG |
211 |
+ UCLIBC_SUSV2_LEGACY |
212 |
+ UCLIBC_SUSV3_LEGACY |
213 |
+ UCLIBC_SUSV3_LEGACY_MACROS |
214 |
+ UCLIBC_SUSV4_LEGACY |
215 |
+ UCLIBC_USE_NETLINK |
216 |
+ ) |
217 |
+ |
218 |
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config |
219 |
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN" |
220 |
+ |
221 |
+ kconfig_q_opt debug DODEBUG |
222 |
+ kconfig_q_opt debug SUPPORT_LD_DEBUG |
223 |
+ kconfig_q_opt debug UCLIBC_HAS_PROFILING |
224 |
+ |
225 |
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6 |
226 |
+ |
227 |
+ kconfig_q_opt rpc UCLIBC_HAS_RPC |
228 |
+ kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC |
229 |
+ kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC |
230 |
+ |
231 |
+ kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK |
232 |
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW |
233 |
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE |
234 |
+ kconfig_q_opt hardened UCLIBC_BUILD_RELRO |
235 |
+ kconfig_q_opt hardened UCLIBC_BUILD_SSP |
236 |
+ |
237 |
+ local count def |
238 |
+ for count in 1 2 ; do |
239 |
+ # Run twice as some config opts depend on others being enabled first. |
240 |
+ for def in ${defs_y[@]} ; do |
241 |
+ sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config |
242 |
+ done |
243 |
+ for def in ${defs_n[@]} ; do |
244 |
+ sed -i -e "s|${def}=y|# ${def} is not set|g" .config |
245 |
+ done |
246 |
+ make_oldconfig |
247 |
+ done |
248 |
+ |
249 |
+ einfo "Enabled options:" |
250 |
+ for def in ${defs_y[@]} ; do |
251 |
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}") |
252 |
+ done |
253 |
+ einfo "Disabled options:" |
254 |
+ for def in ${defs_n[@]} ; do |
255 |
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}") |
256 |
+ done |
257 |
+ |
258 |
+ # setup build and run paths |
259 |
+ sed -i \ |
260 |
+ -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \ |
261 |
+ -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \ |
262 |
+ -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \ |
263 |
+ -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \ |
264 |
+ -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \ |
265 |
+ -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \ |
266 |
+ .config || die |
267 |
+ |
268 |
+ make_oldconfig |
269 |
+} |
270 |
+ |
271 |
+pkg_setup() { |
272 |
+ # Make sure our CHOST is a uclibc toolchain for native compiling |
273 |
+ if [[ ${CHOST} == ${CTARGET} ]]; then |
274 |
+ case ${CHOST} in |
275 |
+ *-uclinux*|*-uclibc*) ;; |
276 |
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;; |
277 |
+ esac |
278 |
+ fi |
279 |
+ |
280 |
+ # uClibc-ng doesn't carry old Linux threads, and since we force |
281 |
+ # threading our only choice is NPTL which requires i486 and later. |
282 |
+ [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)." |
283 |
+} |
284 |
+ |
285 |
+src_prepare() { |
286 |
+ local version subversion extraversion |
287 |
+ |
288 |
+ # uclibc-ng tries to create a two sym link with ld.so, |
289 |
+ # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so |
290 |
+ # where MAJOR_VERSION != 0 indicates the ABI verison. |
291 |
+ # We want to get rid of this and just have ABI = 0. |
292 |
+ eapply "${FILESDIR}"/uclibc-compat.patch |
293 |
+ |
294 |
+ # We need to change the major.minor.sublevel of uclibc-ng. |
295 |
+ # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking. |
296 |
+ # If we really want the ABI bump, we'll have to hack the gcc |
297 |
+ # spec file and change the '*link:' rule. |
298 |
+ version=( $(get_version_components) ) |
299 |
+ if [[ -z ${version[1]} ]]; then |
300 |
+ subversion=0 |
301 |
+ extraversion=0 |
302 |
+ else |
303 |
+ subversion=${version[1]} |
304 |
+ if [[ -z ${version[2]} ]]; then |
305 |
+ extraversion=0 |
306 |
+ else |
307 |
+ extraversion=.${version[2]} |
308 |
+ fi |
309 |
+ fi |
310 |
+ |
311 |
+ sed -i \ |
312 |
+ -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \ |
313 |
+ -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \ |
314 |
+ -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \ |
315 |
+ -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \ |
316 |
+ Rules.mak || die |
317 |
+ |
318 |
+ eapply_user |
319 |
+} |
320 |
+ |
321 |
+src_configure() { |
322 |
+ # Map our toolchain arch name to the name expected by uClibc-ng. |
323 |
+ local target=$(tc-arch) |
324 |
+ case ${target} in |
325 |
+ amd64) target="x86_64";; |
326 |
+ arm) target="arm";; |
327 |
+ mips) target="mips";; |
328 |
+ ppc) target="powerpc";; |
329 |
+ x86) target="i386";; |
330 |
+ esac |
331 |
+ |
332 |
+ # Do arch specific configuration by changing the defaults in |
333 |
+ # extra/Configs/Config.<arch>. If these are not overridden |
334 |
+ # by an save .config, they will be selected by default. |
335 |
+ |
336 |
+ # For i386, i486, i586 and i686 |
337 |
+ local cpu |
338 |
+ if [[ ${target} == "i386" ]]; then |
339 |
+ [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86" |
340 |
+ sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \ |
341 |
+ extra/Configs/Config.i385 || die |
342 |
+ fi |
343 |
+ |
344 |
+ # For arm |
345 |
+ if [[ ${target} == "arm" ]]; then |
346 |
+ sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm |
347 |
+ fi |
348 |
+ |
349 |
+ # For mips |
350 |
+ if [[ ${target} == "mips" ]]; then |
351 |
+ sed -i -e "s|default CONFIG_MIPS_O32_ABI|CONFIG_MIPS_${ABI^[on]}_ABI|" \ |
352 |
+ extra/Configs/Config.mips || die |
353 |
+ fi |
354 |
+ |
355 |
+ # We set HOSTCC to the proper tuple rather than just 'gcc' |
356 |
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak |
357 |
+ |
358 |
+ make_config ${target} |
359 |
+ |
360 |
+ einfo |
361 |
+ einfo "Runtime Prefix: /" |
362 |
+ einfo "Devel Prefix: /usr" |
363 |
+ einfo "Kernel Prefix: $(alt_build_kprefix)" |
364 |
+ einfo "CBUILD: ${CBUILD}" |
365 |
+ einfo "CHOST: ${CHOST}" |
366 |
+ einfo "CTARGET: ${CTARGET}" |
367 |
+ einfo "ABI: ${ABI}" |
368 |
+ einfo "ENDIAN: $(uclibc_endian)" |
369 |
+ einfo |
370 |
+} |
371 |
+ |
372 |
+src_compile() { |
373 |
+ emake headers |
374 |
+ just_headers && return 0 |
375 |
+ |
376 |
+ emake |
377 |
+ if is_crosscompile ; then |
378 |
+ emake -C utils hostutils |
379 |
+ else |
380 |
+ emake utils |
381 |
+ fi |
382 |
+} |
383 |
+ |
384 |
+src_test() { |
385 |
+ is_crosscompile && return 0 |
386 |
+ |
387 |
+ # assert test fails on pax/grsec enabled kernels |
388 |
+ # normal vfork test fails in sandbox (both glibc/uclibc) |
389 |
+ emake UCLIBC_ONLY=1 check |
390 |
+} |
391 |
+ |
392 |
+src_install() { |
393 |
+ local sysroot=${D} |
394 |
+ is_crosscompile && sysroot+="/usr/${CTARGET}" |
395 |
+ |
396 |
+ local target="install" |
397 |
+ just_headers && target="install_headers" |
398 |
+ emake DESTDIR="${sysroot}" ${target} |
399 |
+ |
400 |
+ save_config .config |
401 |
+ |
402 |
+ # remove files coming from kernel-headers |
403 |
+ rm -rf "${sysroot}"/usr/include/{linux,asm*} |
404 |
+ |
405 |
+ # Make sure we install the sys-include symlink so that when |
406 |
+ # we build a 2nd stage cross-compiler, gcc finds the target |
407 |
+ # system headers correctly. See gcc/doc/gccinstall.info |
408 |
+ if is_crosscompile ; then |
409 |
+ dosym usr/include /usr/${CTARGET}/sys-include |
410 |
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then |
411 |
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig |
412 |
+ newbin utils/ldd.host ${CTARGET}-ldd |
413 |
+ fi |
414 |
+ return 0 |
415 |
+ fi |
416 |
+ |
417 |
+ emake DESTDIR="${D}" install_utils |
418 |
+ dobin extra/scripts/getent |
419 |
+ dodoc README docs/*.txt |
420 |
+} |
421 |
+ |
422 |
+pkg_postinst() { |
423 |
+ is_crosscompile && return 0 |
424 |
+ |
425 |
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then |
426 |
+ ewarn "Please remember to set your timezone in /etc/TZ" |
427 |
+ mkdir -p "${ROOT}"/etc |
428 |
+ echo "UTC" > "${ROOT}"/etc/TZ |
429 |
+ fi |
430 |
+ [ "${ROOT}" != "/" ] && return 0 |
431 |
+ # update cache before reloading init |
432 |
+ ldconfig |
433 |
+ # reload init ... |
434 |
+ /sbin/telinit U 2>/dev/null |
435 |
+} |