1 |
commit: 7c3fda3df0131e29418df03db9b93013262d7f70 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 1 22:42:56 2016 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 1 22:42:56 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c3fda3d |
7 |
|
8 |
sys-libs/uclibc-ng: version bump to 1.0.17 |
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.17.ebuild | 400 +++++++++++++++++++++++++++++ |
14 |
2 files changed, 401 insertions(+) |
15 |
|
16 |
diff --git a/sys-libs/uclibc-ng/Manifest b/sys-libs/uclibc-ng/Manifest |
17 |
index dfc48c8..e8baa7e 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.16.tar.bz2 2769238 SHA256 f0ded5cb1ff7aac670ca9df931fc820648d91b27085a3efecc1b7f06d65f57f6 SHA512 05110f0b6651862f16b01d1b45d59258b93686a7635815f9e050ab6b8f0eb14581782c95f305649d62aa80e78060865620a5306a657ea7e9ac396c68d61347cb WHIRLPOOL d79830b46d4bcb2f19917da936a35443da95728c25a050e5a313f6a374669be8c29d5df12a6e9ac5efc65416a0206672a70c7b6d75cb3fdc4017220e32222bf3 |
22 |
+DIST uClibc-ng-1.0.17.tar.bz2 2769872 SHA256 fb4ab60698256d110bf30678a4cb27f14b3cf6eae60ed4ad21b2de5cac8c0bf3 SHA512 de6c7bf2168fe76ad0fa3a59c2c4264040383683b4774e846c97c20802d92dc478d3fcf271800f008c5b2ee06d3f50baac47bc5f28b43366e418c65b11d3bdb4 WHIRLPOOL 430fcd6992097bcd995936e36450617d0d9f57182542ffc42f0bdf021a2e7c0a5c9f8bce50c498567e9219379ef80a20e444f872429ab36dc43eda11134a03f6 |
23 |
|
24 |
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.17.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.17.ebuild |
25 |
new file mode 100644 |
26 |
index 0000000..2d3a099 |
27 |
--- /dev/null |
28 |
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.17.ebuild |
29 |
@@ -0,0 +1,400 @@ |
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.i386 || 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 |
+ # We set HOSTCC to the proper tuple rather than just 'gcc' |
350 |
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak |
351 |
+ |
352 |
+ make_config ${target} |
353 |
+ |
354 |
+ einfo |
355 |
+ einfo "Runtime Prefix: /" |
356 |
+ einfo "Devel Prefix: /usr" |
357 |
+ einfo "Kernel Prefix: $(alt_build_kprefix)" |
358 |
+ einfo "CBUILD: ${CBUILD}" |
359 |
+ einfo "CHOST: ${CHOST}" |
360 |
+ einfo "CTARGET: ${CTARGET}" |
361 |
+ einfo "ABI: ${ABI}" |
362 |
+ einfo "ENDIAN: $(uclibc_endian)" |
363 |
+ einfo |
364 |
+} |
365 |
+ |
366 |
+src_compile() { |
367 |
+ emake headers |
368 |
+ just_headers && return 0 |
369 |
+ |
370 |
+ emake |
371 |
+ if is_crosscompile ; then |
372 |
+ emake -C utils hostutils |
373 |
+ else |
374 |
+ emake utils |
375 |
+ fi |
376 |
+} |
377 |
+ |
378 |
+src_test() { |
379 |
+ is_crosscompile && return 0 |
380 |
+ |
381 |
+ # assert test fails on pax/grsec enabled kernels |
382 |
+ # normal vfork test fails in sandbox (both glibc/uclibc) |
383 |
+ emake UCLIBC_ONLY=1 check |
384 |
+} |
385 |
+ |
386 |
+src_install() { |
387 |
+ local sysroot=${D} |
388 |
+ is_crosscompile && sysroot+="/usr/${CTARGET}" |
389 |
+ |
390 |
+ local target="install" |
391 |
+ just_headers && target="install_headers" |
392 |
+ emake DESTDIR="${sysroot}" ${target} |
393 |
+ |
394 |
+ save_config .config |
395 |
+ |
396 |
+ # remove files coming from kernel-headers |
397 |
+ rm -rf "${sysroot}"/usr/include/{linux,asm*} |
398 |
+ |
399 |
+ # Make sure we install the sys-include symlink so that when |
400 |
+ # we build a 2nd stage cross-compiler, gcc finds the target |
401 |
+ # system headers correctly. See gcc/doc/gccinstall.info |
402 |
+ if is_crosscompile ; then |
403 |
+ dosym usr/include /usr/${CTARGET}/sys-include |
404 |
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then |
405 |
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig |
406 |
+ newbin utils/ldd.host ${CTARGET}-ldd |
407 |
+ fi |
408 |
+ return 0 |
409 |
+ fi |
410 |
+ |
411 |
+ emake DESTDIR="${D}" install_utils |
412 |
+ dobin extra/scripts/getent |
413 |
+ dodoc README docs/*.txt |
414 |
+} |
415 |
+ |
416 |
+pkg_postinst() { |
417 |
+ is_crosscompile && return 0 |
418 |
+ |
419 |
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then |
420 |
+ ewarn "Please remember to set your timezone in /etc/TZ" |
421 |
+ mkdir -p "${ROOT}"/etc |
422 |
+ echo "UTC" > "${ROOT}"/etc/TZ |
423 |
+ fi |
424 |
+ [ "${ROOT}" != "/" ] && return 0 |
425 |
+ # update cache before reloading init |
426 |
+ ldconfig |
427 |
+ # reload init ... |
428 |
+ /sbin/telinit U 2>/dev/null |
429 |
+} |