Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:uclibc commit in: sys-libs/uclibc/
Date: Wed, 21 Dec 2011 01:15:11
Message-Id: 8084b6695dd4954c82b27e7078154266462e5c87.blueness@gentoo
1 commit: 8084b6695dd4954c82b27e7078154266462e5c87
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 21 01:14:54 2011 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 21 01:14:54 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=8084b669
7
8 Removed -r1
9
10 (Portage version: 2.1.10.41/git/Linux x86_64, unsigned Manifest commit)
11
12 ---
13 sys-libs/uclibc/uclibc-0.9.32-r1.ebuild | 383 -------------------------------
14 1 files changed, 0 insertions(+), 383 deletions(-)
15
16 diff --git a/sys-libs/uclibc/uclibc-0.9.32-r1.ebuild b/sys-libs/uclibc/uclibc-0.9.32-r1.ebuild
17 deleted file mode 100644
18 index 105174c..0000000
19 --- a/sys-libs/uclibc/uclibc-0.9.32-r1.ebuild
20 +++ /dev/null
21 @@ -1,383 +0,0 @@
22 -# Copyright 1999-2011 Gentoo Foundation
23 -# Distributed under the terms of the GNU General Public License v2
24 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild,v 1.9 2011/04/20 18:10:38 ulm Exp $
25 -
26 -#ESVN_REPO_URI="svn://uclibc.org/trunk/uClibc"
27 -#inherit subversion
28 -inherit eutils flag-o-matic toolchain-funcs savedconfig
29 -
30 -export CBUILD=${CBUILD:-${CHOST}}
31 -export CTARGET=${CTARGET:-${CHOST}}
32 -if [[ ${CTARGET} == ${CHOST} ]] ; then
33 - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
34 - export CTARGET=${CATEGORY/cross-}
35 - fi
36 -fi
37 -# Handle the case where we want uclibc on glibc ...
38 -if [[ ${CTARGET} == ${CHOST} ]] && [[ ${CHOST} != *-uclibc* ]] ; then
39 - export UCLIBC_AND_GLIBC="sitting in a tree"
40 - export CTARGET=${CHOST%%-*}-pc-linux-uclibc
41 -fi
42 -
43 -MY_P=uClibc-0.9.32
44 -PATCH_VER=""
45 -SVN_VER=""
46 -DESCRIPTION="C library for developing embedded Linux systems"
47 -HOMEPAGE="http://www.uclibc.org/"
48 -SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2"
49 -
50 -[[ -z ${SVN_VER} ]] || \
51 - SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-svn-update-${SVN_VER}.patch.bz2"
52 -[[ -z ${PATCH_VER} ]] || \
53 - SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2"
54 -
55 -LICENSE="LGPL-2"
56 -SLOT="0"
57 -KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86"
58 -IUSE="build uclibc-compat debug hardened ssp ipv6 minimal nptl wordexp crosscompile_opts_headers-only"
59 -RESTRICT="strip"
60 -
61 -RDEPEND=""
62 -if [[ -n $CTARGET && ${CTARGET} != ${CHOST} ]]; then
63 - DEPEND=">=cross-${CTARGET}/binutils-2.21.51.0.7"
64 - SLOT="${CTARGET}"
65 -else
66 - DEPEND="virtual/os-headers app-misc/pax-utils"
67 - SLOT="0"
68 -fi
69 -
70 -S=${WORKDIR}/${MY_P}
71 -
72 -alt_build_kprefix() {
73 - if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \
74 - || [[ -n ${UCLIBC_AND_GLIBC} ]]
75 - then
76 - echo /usr/include
77 - else
78 - echo /usr/${CTARGET}/usr/include
79 - fi
80 -}
81 -
82 -just_headers() {
83 - use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]]
84 -}
85 -
86 -uclibc_endian() {
87 - # XXX: this wont work for a toolchain which is bi-endian, but we
88 - # dont have any such thing at the moment, so not a big deal
89 - touch "${T}"/endian.s
90 - $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
91 - case $(file "${T}"/endian.o) in
92 - *" MSB "*) echo "big";;
93 - *" LSB "*) echo "little";;
94 - *) echo "NFC";;
95 - esac
96 - rm -f "${T}"/endian.{s,o}
97 -}
98 -
99 -pkg_setup() {
100 - just_headers && return 0
101 - has_version ${CATEGORY}/uclibc || return 0
102 - [[ -n ${UCLIBC_AND_GLIBC} ]] && return 0
103 - [[ ${ROOT} != "/" ]] && return 0
104 - [[ ${CATEGORY} == cross-* ]] && return 0
105 -
106 -}
107 -
108 -PIE_STABLE="arm mips ppc x86"
109 -
110 -CPU_ALPHA=""
111 -CPU_AMD64=""
112 -CPU_ARM="GENERIC_ARM ARM{610,710,7TDMI,720T,920T,922T,926T,10T,1136JF_S,1176JZ{_,F_}S,_{SA110,SA1100,XSCALE,IWMMXT},_CORTEX_{M3,M1}}"
113 -CPU_IA64=""
114 -CPU_M68K=""
115 -CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32{,R2},64}} MIPS_{N64,O32,N32}_ABI"
116 -CPU_PPC=""
117 -CPU_SH="SH{2,2A,3,4,5}"
118 -CPU_SPARC="SPARC_V{7,8,9,9B}"
119 -CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH"
120 -IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}"
121 -
122 -check_cpu_opts() {
123 - local cpu_var="CPU_$(echo $(tc-arch) | tr [a-z] [A-Z])"
124 - [[ -z ${!cpu_var} ]] && return 0
125 -
126 - if [[ -z ${UCLIBC_CPU} ]] ; then
127 - ewarn "You really should consider setting UCLIBC_CPU"
128 - ewarn "Otherwise, the build will be generic (read: slow)."
129 - ewarn "Available CPU options:"
130 - UCLIBC_CPU=$(eval echo ${!cpu_var})
131 - echo ${UCLIBC_CPU}
132 - case ${CTARGET} in
133 - mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";;
134 - sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";;
135 - i[456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";;
136 - *) export UCLIBC_CPU=${UCLIBC_CPU%% *};;
137 - esac
138 - else
139 - local cpu found=0
140 - for cpu in $(eval echo ${!cpu_var}) ; do
141 - [[ ${UCLIBC_CPU} == "${cpu}" ]] && found=1 && break
142 - done
143 - if [[ ${found} -eq 0 ]] ; then
144 - ewarn "UCLIBC_CPU choice '${UCLIBC_CPU}' not supported"
145 - ewarn "Valid choices:"
146 - eval echo ${!cpu_var}
147 - die "pick a supported cpu type"
148 - fi
149 - fi
150 -}
151 -
152 -set_opt() {
153 - sed -i -e "/^\# $1 is not set/d" -e "/^$1=.*/d" .config
154 - echo "$1=$2" >> .config
155 -}
156 -get_opt() {
157 - (
158 - unset $1
159 - . ${2:-"${S}"/.config}
160 - echo ${!1}
161 - )
162 -}
163 -
164 -src_unpack() {
165 - [[ -n ${ESVN_REPO_URI} ]] \
166 - && subversion_src_unpack \
167 - || unpack ${A}
168 - cd "${S}"
169 -
170 - check_cpu_opts
171 -
172 - echo
173 - einfo "Runtime Prefix: /"
174 - einfo "Devel Prefix: /usr"
175 - einfo "Kernel Prefix: $(alt_build_kprefix)"
176 - einfo "CBUILD: ${CBUILD}"
177 - einfo "CHOST: ${CHOST}"
178 - einfo "CTARGET: ${CTARGET}"
179 - einfo "CPU: ${UCLIBC_CPU:-default}"
180 - einfo "ENDIAN: $(uclibc_endian)"
181 - echo
182 -
183 - ########## PATCHES ##########
184 -
185 - [[ -n ${SVN_VER} ]] && \
186 - epatch "${WORKDIR}"/${MY_P}-cvs-update-${SVN_VER}.patch
187 -
188 - if [[ -n ${PATCH_VER} ]] ; then
189 - unpack ${MY_P}-patches-${PATCH_VER}.tar.bz2
190 - EPATCH_SUFFIX="patch"
191 - epatch "${WORKDIR}"/patch
192 - fi
193 -
194 - epatch "${FILESDIR}"/${P}-BJA-sandbox.patch
195 -
196 - ########## CPU SELECTION ##########
197 -
198 - local target config_target
199 - case $(tc-arch) in
200 - alpha) target="alpha"; config_target="no cpu-specific options";;
201 - amd64) target="x86_64"; config_target="no cpu-specific options";;
202 - arm) target="arm"; config_target="GENERIC_ARM";;
203 - avr) target="avr32"; config_target="no cpu-specific options";;
204 - ia64) target="ia64"; config_target="no cpu-specific options";;
205 - m68k) target="m68k"; config_target="no cpu-specific options";;
206 - mips) target="mips"; config_target="MIPS_ISA_1";;
207 - ppc) target="powerpc"; config_target="no cpu-specific options";;
208 - sh) target="sh"; config_target="SH4";;
209 - sparc) target="sparc"; config_target="no cpu-specific options";;
210 - x86) target="i386"; config_target="GENERIC_386";;
211 - *) die "$(tc-arch) lists no defaults :/";;
212 - esac
213 - sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
214 - extra/Configs/Config.${target}
215 - sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak
216 -
217 - ########## CONFIG SETUP ##########
218 -
219 - make ARCH=${target} defconfig >/dev/null || die "could not config"
220 -
221 - for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} UCLIBC_HAS_PROFILING; do
222 - sed -i -e "s:${def}=y:# ${def} is not set:" .config
223 - done
224 - if use debug ; then
225 - set_opt SUPPORT_LD_DEBUG y
226 - set_opt DODEBUG y
227 - fi
228 -
229 - sed -i -e '/ARCH_.*_ENDIAN/d' .config
230 - set_opt "ARCH_WANTS_$(uclibc_endian | tr [a-z] [A-Z])_ENDIAN" y
231 -
232 - if [[ $(tc-is-softfloat) != "no" ]] ; then
233 - set_opt UCLIBC_HAS_FPU n
234 - fi
235 -
236 - if [[ ${CTARGET/eabi} != ${CTARGET} ]] ; then
237 - set_opt CONFIG_ARM_OABI n
238 - set_opt CONFIG_ARM_EABI y
239 - fi
240 -
241 - local moredefs="COMPAT_ATEXIT"
242 - local compat_sym=atexit
243 -
244 - # We need todo this for a few months. .30 is a major upgrade.
245 - # Don't do it from cross-compiling case though
246 - if ! use uclibc-compat ; then
247 - if [[ -z ${UCLIBC_AND_GLIBC} ]] && [[ -z ${UCLIBC_SCANNED_COMPAT} ]] && \
248 - ! just_headers && [[ ${CHOST} == ${CTARGET} ]] ; then
249 - local fnames=""
250 - einfo "Doing a scanelf in paths for bins containing the ${compat_sym} symbol"
251 - fnames=$(scanelf -pyqs${compat_sym} -F%F#s)
252 - if [[ -z ${fnames} ]] ; then
253 - einfo "This system is clean."
254 - einfo "To prevent the scanning of files again in the future you can export UCLIBC_SCANNED_COMPAT=1"
255 - moredefs=""
256 - else
257 - ewarn "You need to remerge the packages that contain the following files before you can remerge ${P} without USE=uclibc-compat enabled."
258 - ewarn "qfile -Cq $(echo ${fnames}) | sort | uniq"
259 - echo
260 - ewarn "Leaving on ${moredefs}"
261 - fi
262 - else
263 - moredefs=""
264 - fi
265 - fi
266 - for def in ${moredefs} MALLOC_GLIBC_COMPAT DO_C99_MATH UCLIBC_HAS_{RPC,FULL_RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} UCLIBC_HAS_REENTRANT_RPC UCLIBC_HAS_GNU_GLOB PTHREADS_DEBUG_SUPPORT UCLIBC_HAS_TZ_FILE_READ_MANY UCLIBC_HAS_FENV UCLIBC_SUSV3_LEGACY UCLIBC_SUSV3_LEGACY_MACROS UCLIBC_HAS_PROGRAM_INVOCATION_NAME ; do
267 - set_opt "${def}" y
268 - done
269 - set_opt UCLIBC_HAS_CTYPE_UNSAFE n
270 - set_opt UCLIBC_HAS_LOCALE n
271 - set_opt HAS_NO_THREADS n
272 -
273 - use nptl && set_opt LINUXTHREADS_NEW y
274 -
275 - use ipv6 && set_opt UCLIBC_HAS_IPV6 y
276 -
277 - use wordexp && set_opt UCLIBC_HAS_WORDEXP y
278 -
279 - # we need to do it independently of hardened to get ssp.c built into libc
280 - set_opt UCLIBC_HAS_SSP y
281 - set_opt UCLIBC_HAS_SSP_COMPAT y
282 - set_opt UCLIBC_HAS_ARC4RANDOM y
283 - set_opt PROPOLICE_BLOCK_ABRT n
284 - set_opt PROPOLICE_BLOCK_SEGV y
285 -
286 - # arm/mips do not emit PT_GNU_STACK, but if we enable this here
287 - # it will be emitted as RWE, ppc has to be checked, x86 needs it
288 - # this option should be used independently of hardened
289 - if has $(tc-arch) x86 || has $(tc-arch) ppc; then
290 - set_opt UCLIBC_BUILD_NOEXECSTACK y
291 - else
292 - set_opt UCLIBC_BUILD_NOEXECSTACK n
293 - fi
294 - set_opt UCLIBC_BUILD_RELRO y
295 - if use hardened ; then
296 - if has $(tc-arch) ${PIE_STABLE} ; then
297 - set_opt UCLIBC_BUILD_PIE y
298 - else
299 - set_opt UCLIBC_BUILD_PIE n
300 - fi
301 - set_opt UCLIBC_BUILD_NOW y
302 - use ssp && {
303 - set_opt SSP_QUICK_CANARY n
304 - set_opt UCLIBC_BUILD_SSP y
305 - }
306 - else
307 - set_opt UCLIBC_BUILD_PIE n
308 - set_opt SSP_QUICK_CANARY y
309 - set_opt UCLIBC_BUILD_SSP n
310 - set_opt UCLIBC_BUILD_NOW n
311 - fi
312 -
313 - restore_config .config
314 -
315 - # setup build and run paths
316 - local cross=${CTARGET}-
317 - type -p ${cross}ar > /dev/null || cross=""
318 - sed -i \
319 - -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${cross}\":" \
320 - -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \
321 - -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \
322 - -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
323 - -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
324 - -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \
325 - .config || die
326 -
327 - yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig"
328 -
329 - cp .config myconfig
330 -
331 - emake -s clean > /dev/null || die "could not clean"
332 -}
333 -
334 -src_compile() {
335 - cp myconfig .config
336 -
337 - emake headers || die "make headers failed"
338 - just_headers && return 0
339 -
340 - emake || die "make failed"
341 - if [[ ${CTARGET} != ${CHOST} ]] ; then
342 - emake -C utils hostutils || die "make hostutils failed"
343 - elif [[ ${CHOST} == *-uclibc* ]] ; then
344 - emake utils || die "make utils failed"
345 - fi
346 -}
347 -
348 -src_test() {
349 - [[ ${CHOST} != ${CTARGET} ]] && return 0
350 - [[ ${CBUILD} != ${CHOST} ]] && return 0
351 -
352 - # assert test fails on pax/grsec enabled kernels - normal
353 - # vfork test fails in sandbox (both glibc/uclibc)
354 - make UCLIBC_ONLY=1 check || die "test failed"
355 -}
356 -
357 -src_install() {
358 - local sysroot=${D}
359 - [[ ${CHOST} != ${CTARGET} ]] && sysroot="${sysroot}/usr/${CTARGET}"
360 -
361 - local target="install"
362 - just_headers && target="install_headers"
363 - emake DESTDIR="${sysroot}" ${target} || die "install failed"
364 -
365 - save_config .config
366 -
367 - # remove files coming from kernel-headers
368 - rm -rf "${sysroot}"/usr/include/{linux,asm*}
369 -
370 - # Make sure we install the sys-include symlink so that when
371 - # we build a 2nd stage cross-compiler, gcc finds the target
372 - # system headers correctly. See gcc/doc/gccinstall.info
373 - if [[ ${CTARGET} != ${CHOST} ]] ; then
374 - dosym usr/include /usr/${CTARGET}/sys-include
375 - if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
376 - newbin utils/ldconfig.host ${CTARGET}-ldconfig || die
377 - newbin utils/ldd.host ${CTARGET}-ldd || die
378 - fi
379 - return 0
380 - fi
381 -
382 - if [[ ${CHOST} == *-uclibc* ]] ; then
383 - emake DESTDIR="${D}" install_utils || die "install-utils failed"
384 - dobin extra/scripts/getent
385 - fi
386 -
387 - dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
388 -}
389 -
390 -pkg_postinst() {
391 - [[ ${CTARGET} != ${CHOST} ]] && return 0
392 - [[ ${CHOST} != *-uclibc* ]] && return 0
393 -
394 - if [[ ! -e ${ROOT}/etc/TZ ]] ; then
395 - ewarn "Please remember to set your timezone in /etc/TZ"
396 - [[ ! -d ${ROOT}/etc ]] && mkdir -p "${ROOT}"/etc
397 - echo "UTC" > "${ROOT}"/etc/TZ
398 - fi
399 - [[ ${ROOT} != "/" ]] && return 0
400 - # update cache before reloading init
401 - /sbin/ldconfig
402 - # reload init ...
403 - [[ -x /sbin/telinit ]] && /sbin/telinit U &> /dev/null
404 -}