Gentoo Archives: gentoo-commits

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