Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-libs/uclibc: uclibc-0.9.33.2-r11.ebuild ChangeLog
Date: Sun, 27 Apr 2014 19:36:41
Message-Id: 20140427193637.ABC852004B@flycatcher.gentoo.org
1 vapier 14/04/27 19:36:37
2
3 Modified: ChangeLog
4 Added: uclibc-0.9.33.2-r11.ebuild
5 Log:
6 Add fix from upstream for sys/mount.h updates #508522 by Anthony Basile.
7
8 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
9
10 Revision Changes Path
11 1.90 sys-libs/uclibc/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/uclibc/ChangeLog?rev=1.90&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/uclibc/ChangeLog?rev=1.90&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/uclibc/ChangeLog?r1=1.89&r2=1.90
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v
20 retrieving revision 1.89
21 retrieving revision 1.90
22 diff -u -r1.89 -r1.90
23 --- ChangeLog 27 Apr 2014 19:35:50 -0000 1.89
24 +++ ChangeLog 27 Apr 2014 19:36:37 -0000 1.90
25 @@ -1,6 +1,11 @@
26 # ChangeLog for sys-libs/uclibc
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.89 2014/04/27 19:35:50 vapier Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.90 2014/04/27 19:36:37 vapier Exp $
30 +
31 +*uclibc-0.9.33.2-r11 (27 Apr 2014)
32 +
33 + 27 Apr 2014; Mike Frysinger <vapier@g.o> +uclibc-0.9.33.2-r11.ebuild:
34 + Add fix from upstream for sys/mount.h updates #508522 by Anthony Basile.
35
36 27 Apr 2014; Mike Frysinger <vapier@g.o> uclibc-0.9.33.2-r10.ebuild:
37 Stabilize for all.
38
39
40
41 1.1 sys-libs/uclibc/uclibc-0.9.33.2-r11.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/uclibc/uclibc-0.9.33.2-r11.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/uclibc/uclibc-0.9.33.2-r11.ebuild?rev=1.1&content-type=text/plain
45
46 Index: uclibc-0.9.33.2-r11.ebuild
47 ===================================================================
48 # Copyright 1999-2014 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.33.2-r11.ebuild,v 1.1 2014/04/27 19:36:37 vapier Exp $
51
52 inherit eutils flag-o-matic multilib toolchain-funcs savedconfig
53 if [[ ${PV} == "9999" ]] ; then
54 EGIT_REPO_URI="git://git.busybox.net/uClibc"
55 inherit git-2
56 fi
57
58 export CBUILD=${CBUILD:-${CHOST}}
59 export CTARGET=${CTARGET:-${CHOST}}
60 if [[ ${CTARGET} == ${CHOST} ]] ; then
61 if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
62 export CTARGET=${CATEGORY/cross-}
63 fi
64 fi
65
66 MY_P=uClibc-${PV}
67 DESCRIPTION="C library for developing embedded Linux systems"
68 HOMEPAGE="http://www.uclibc.org/"
69 if [[ ${PV} != "9999" ]] ; then
70 PATCH_VER="13"
71 SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2
72 ${PATCH_VER:+mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2}"
73 KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86"
74 fi
75
76 LICENSE="LGPL-2"
77 SLOT="0"
78 IUSE="debug hardened iconv ipv6 nptl rpc ssp uclibc-compat wordexp crosscompile_opts_headers-only"
79 RESTRICT="strip"
80
81 S=${WORKDIR}/${MY_P}
82
83 is_crosscompile() {
84 [[ ${CHOST} != ${CTARGET} ]]
85 }
86 alt_build_kprefix() {
87 if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] ; then
88 echo /usr/include
89 else
90 echo /usr/${CTARGET}/usr/include
91 fi
92 }
93
94 just_headers() {
95 use crosscompile_opts_headers-only && is_crosscompile
96 }
97
98 uclibc_endian() {
99 # XXX: this wont work for a toolchain which is bi-endian, but we
100 # dont have any such thing at the moment, so not a big deal
101 touch "${T}"/endian.s
102 $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
103 case $(file "${T}"/endian.o) in
104 *" MSB "*) echo "BIG";;
105 *" LSB "*) echo "LITTLE";;
106 *) echo "NFC";;
107 esac
108 rm -f "${T}"/endian.{s,o}
109 }
110
111 pkg_setup() {
112 if [ ${CTARGET} = ${CHOST} ] ; then
113 case ${CHOST} in
114 *-uclinux*|*-uclibc*) ;;
115 *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
116 esac
117 fi
118 }
119
120 check_cpu_opts() {
121 case ${CTARGET} in
122 # Need to handle $ABI here w/mips.
123 mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";;
124 sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";;
125 i[3456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";;
126 # XXX: Should figure out how to handle sparc.
127 esac
128 }
129
130 kconfig_q_opt() {
131 local flag=$1; shift
132 case ${flag} in
133 y|n) ;;
134 *) flag=$(usex ${flag} y n) ;;
135 esac
136
137 local var="defs_${flag}"
138 eval "${var}+=( $* )"
139 }
140
141 get_opt() {
142 (
143 unset ${1}
144 . ${2:-"${S}"/.config}
145 echo ${!1}
146 )
147 }
148
149 src_oldconfig() {
150 yes "" 2>/dev/null | emake -s oldconfig >/dev/null
151 }
152 src_config() {
153 restore_config .config
154 if [ -f .config ]; then
155 src_oldconfig
156 return 0
157 else
158 ewarn "Could not locate user configfile, so we will save a default one"
159 fi
160
161 emake ARCH=${target} defconfig >/dev/null || die
162
163 local defs_{y,n} defs
164
165 defs=(
166 DO{DEBUG_PT,ASSERTS}
167 SUPPORT_LD_DEBUG_EARLY
168 UCLIBC_HAS_PROFILING
169 )
170 kconfig_q_opt n "${defs[@]}"
171 kconfig_q_opt debug DODEBUG SUPPORT_LD_DEBUG
172
173 sed -i -e '/ARCH_.*_ENDIAN/d' .config
174 kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
175
176 if [[ ${CTARGET} == arm* ]] ; then
177 kconfig_q_opt n CONFIG_ARM_OABI
178 kconfig_q_opt y CONFIG_ARM_EABI
179 fi
180
181 defs=(
182 MALLOC_GLIBC_COMPAT
183 DO_C99_MATH
184 UCLIBC_HAS_{CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC}
185 UCLIBC_HAS_FENV
186 UCLIBC_HAS_{N,}FTW
187 UCLIBC_HAS_GNU_GLOB
188 UCLIBC_HAS_LIBUTIL
189 UCLIBC_HAS_PROGRAM_INVOCATION_NAME
190 UCLIBC_HAS_RESOLVER_SUPPORT
191 UCLIBC_HAS_TZ_FILE_READ_MANY
192 UCLIBC_HAS_UTMPX
193 UCLIBC_SUPPORT_AI_ADDRCONFIG
194 UCLIBC_SUSV3_LEGACY
195 UCLIBC_SUSV3_LEGACY_MACROS
196 UCLIBC_SUSV4_LEGACY
197 UCLIBC_USE_NETLINK
198 PTHREADS_DEBUG_SUPPORT
199 )
200 kconfig_q_opt y "${defs[@]}"
201 kconfig_q_opt n UCLIBC_HAS_CTYPE_UNSAFE
202 kconfig_q_opt n UCLIBC_HAS_LOCALE
203 kconfig_q_opt n HAS_NO_THREADS
204 kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
205 kconfig_q_opt nptl UCLIBC_HAS_THREADS_NATIVE
206 kconfig_q_opt !nptl LINUXTHREADS_OLD
207 kconfig_q_opt rpc UCLIBC_HAS_{,{FULL,REENTRANT}_}RPC
208 kconfig_q_opt wordexp UCLIBC_HAS_WORDEXP
209 kconfig_q_opt uclibc-compat UCLIBC_HAS_LIB{NSL,RESOLV}_STUB COMPAT_ATEXIT
210
211 # we need to do it independently of hardened to get ssp.c built into libc
212 kconfig_q_opt y UCLIBC_HAS_SSP
213 kconfig_q_opt n UCLIBC_HAS_SSP_COMPAT
214 kconfig_q_opt y UCLIBC_HAS_ARC4RANDOM
215 kconfig_q_opt n PROPOLICE_BLOCK_ABRT
216 kconfig_q_opt y PROPOLICE_BLOCK_SEGV
217
218 # arm/mips do not emit PT_GNU_STACK, but if we enable this here
219 # it will be emitted as RWE, ppc has to be checked, x86 needs it
220 # this option should be used independently of hardened
221 if has $(tc-arch) x86 || has $(tc-arch) ppc ; then
222 kconfig_q_opt y UCLIBC_BUILD_NOEXECSTACK
223 else
224 kconfig_q_opt n UCLIBC_BUILD_NOEXECSTACK
225 fi
226 kconfig_q_opt y UCLIBC_BUILD_RELRO
227 kconfig_q_opt hardened UCLIBC_BUILD_PIE
228 kconfig_q_opt hardened UCLIBC_BUILD_NOW
229 kconfig_q_opt !ssp SSP_QUICK_CANARY
230 kconfig_q_opt ssp UCLIBC_BUILD_SSP
231
232 local def
233 for def in 1 2 ; do
234 # Run twice as some config opts depend on others being enabled first.
235 for def in ${defs_y[@]} ; do
236 sed -i -e "s:.*\<${def}\>.*set:${def}=y:g" .config
237 done
238 for def in ${defs_n[@]} ; do
239 sed -i -e "s:${def}=y:# ${def} is not set:g" .config
240 done
241 src_oldconfig
242 done
243
244 einfo "Enabled options:"
245 for def in ${defs_y[@]} ; do
246 einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
247 done
248 einfo "Disabled options:"
249 for def in ${defs_n[@]} ; do
250 einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
251 done
252
253 # setup build and run paths
254 sed -i \
255 -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CTARGET}-\":" \
256 -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \
257 -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \
258 -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
259 -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
260 -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \
261 .config || die
262
263 src_oldconfig
264 }
265
266 src_unpack() {
267 if [[ ${PV} == "9999" ]] ; then
268 git-2_src_unpack
269 else
270 unpack ${A}
271 fi
272 cd "${S}"
273 if [[ -n ${PATCH_VER} ]] ; then
274 EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
275 fi
276
277 epatch_user
278
279 check_cpu_opts
280
281 echo
282 einfo "Runtime Prefix: /"
283 einfo "Devel Prefix: /usr"
284 einfo "Kernel Prefix: $(alt_build_kprefix)"
285 einfo "CBUILD: ${CBUILD}"
286 einfo "CHOST: ${CHOST}"
287 einfo "CTARGET: ${CTARGET}"
288 einfo "CPU: ${UCLIBC_CPU:-default}"
289 einfo "ENDIAN: $(uclibc_endian)"
290 echo
291
292 ########## CPU SELECTION ##########
293
294 local target=$(tc-arch) config_target
295 case ${target} in
296 amd64) target="x86_64";;
297 arm) target="arm"; config_target="GENERIC_ARM";;
298 avr) target="avr32";;
299 mips) target="mips"; config_target="MIPS_ISA_1";;
300 ppc) target="powerpc";;
301 sh) target="sh"; config_target="SH4";;
302 x86) target="i386"; config_target="486";;
303 esac
304 if [[ -n ${config_target} ]] ; then
305 sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
306 extra/Configs/Config.${target} || die
307 fi
308 sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak
309
310 src_config
311
312 if use iconv ; then
313 # Run after make clean, otherwise files removed
314 find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt
315 if [[ ! -f /etc/locale.gen ]] ; then
316 # See ./extra/locale/LOCALES for examples
317 die "Please create an appropriate /etc/locale.gen for locale support"
318 fi
319 echo -e "@euro e\n@cyrillic c\n#---\nUTF-8 yes\n8-BIT yes\n#---\n\n" > ./extra/locale/locales.txt
320 cat /etc/locale.gen >> ./extra/locale/locales.txt
321 fi
322 }
323
324 src_compile() {
325 emake headers || die
326 just_headers && return 0
327
328 emake || die
329 if is_crosscompile ; then
330 emake -C utils hostutils || die
331 else
332 emake utils || die
333 fi
334 }
335
336 src_test() {
337 is_crosscompile && return 0
338
339 # assert test fails on pax/grsec enabled kernels - normal
340 # vfork test fails in sandbox (both glibc/uclibc)
341 emake UCLIBC_ONLY=1 check || die
342 }
343
344 src_install() {
345 local sysroot=${D}
346 is_crosscompile && sysroot+="/usr/${CTARGET}"
347
348 local target="install"
349 just_headers && target="install_headers"
350 emake DESTDIR="${sysroot}" ${target} || die
351
352 save_config .config
353
354 # remove files coming from kernel-headers
355 rm -rf "${sysroot}"/usr/include/{linux,asm*}
356
357 # Make sure we install the sys-include symlink so that when
358 # we build a 2nd stage cross-compiler, gcc finds the target
359 # system headers correctly. See gcc/doc/gccinstall.info
360 if is_crosscompile ; then
361 dosym usr/include /usr/${CTARGET}/sys-include
362 if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
363 newbin utils/ldconfig.host ${CTARGET}-ldconfig || die
364 newbin utils/ldd.host ${CTARGET}-ldd || die
365 fi
366 return 0
367 fi
368
369 emake DESTDIR="${D}" install_utils || die
370 dobin extra/scripts/getent
371 dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
372 }
373
374 pkg_postinst() {
375 is_crosscompile && return 0
376
377 if [ ! -e "${ROOT}"/etc/TZ ] ; then
378 ewarn "Please remember to set your timezone in /etc/TZ"
379 mkdir -p "${ROOT}"/etc
380 echo "UTC" > "${ROOT}"/etc/TZ
381 fi
382 [ "${ROOT}" != "/" ] && return 0
383 # update cache before reloading init
384 ldconfig
385 # reload init ...
386 /sbin/telinit U 2>/dev/null
387 }