diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-01-26 18:16:34 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2013-01-26 18:16:34 +0000 |
commit | 121cacc88e4a88a56d7d88a19946a34ea979a28c (patch) | |
tree | 37860235430a63aa4fb7cc028d9bfb35fdef6f1e | |
parent | mark stable for all (diff) | |
download | historical-121cacc88e4a88a56d7d88a19946a34ea979a28c.tar.gz historical-121cacc88e4a88a56d7d88a19946a34ea979a28c.tar.bz2 historical-121cacc88e4a88a56d7d88a19946a34ea979a28c.zip |
Enable UCLIBC_SUPPORT_AI_ADDRCONFIG support #452448 by Richard Yao. Add dup3/mkostemp support #453634 by Tibor Vago.
Package-Manager: portage-2.2.0_alpha159/cvs/Linux x86_64
Manifest-Sign-Key: 0xFB7C4156
-rw-r--r-- | sys-libs/uclibc/ChangeLog | 10 | ||||
-rw-r--r-- | sys-libs/uclibc/Manifest | 32 | ||||
-rw-r--r-- | sys-libs/uclibc/uclibc-0.9.33.2-r3.ebuild | 374 |
3 files changed, 399 insertions, 17 deletions
diff --git a/sys-libs/uclibc/ChangeLog b/sys-libs/uclibc/ChangeLog index f12edb24e057..364c8b0fe928 100644 --- a/sys-libs/uclibc/ChangeLog +++ b/sys-libs/uclibc/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-libs/uclibc -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.70 2013/01/26 18:14:53 vapier Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.71 2013/01/26 18:16:29 vapier Exp $ + +*uclibc-0.9.33.2-r3 (26 Jan 2013) + + 26 Jan 2013; Mike Frysinger <vapier@gentoo.org> +uclibc-0.9.33.2-r3.ebuild: + Enable UCLIBC_SUPPORT_AI_ADDRCONFIG support #452448 by Richard Yao. Add + dup3/mkostemp support #453634 by Tibor Vago. 26 Jan 2013; Mike Frysinger <vapier@gentoo.org> uclibc-0.9.33.2-r2.ebuild: Mark stable for all. diff --git a/sys-libs/uclibc/Manifest b/sys-libs/uclibc/Manifest index 8439121e411a..b91dd280c894 100644 --- a/sys-libs/uclibc/Manifest +++ b/sys-libs/uclibc/Manifest @@ -13,6 +13,7 @@ DIST uClibc-0.9.33.1.tar.bz2 2830006 SHA256 33df86ec088ec19784e10fb954950677ddee DIST uClibc-0.9.33.2-patches-1.tar.bz2 2351 SHA256 f85756b12ce5f20747f7900b30016bc4c391e0b6977cf6ecfe35891da0f851d8 SHA512 a3f49eb0732c96ab241bd7cbca281418760f78d19e98ccc94a9cf7a54428e12884e90f1240cd0368e9d2f1f74ea9f332a4987496395176503d667abfa59b221a WHIRLPOOL de7ce039d8710b32ae5a189b173e339abdf1636868f021fc26ce77e2db984864813072eb6f033de4d1b41d0df075d426a242299edad62a2ca02045cc587ded69 DIST uClibc-0.9.33.2-patches-2.tar.bz2 2854 SHA256 a43192a582ad5428daaceec23aaf096ac037a723eb79724aa716f3850674fecd SHA512 f7ef2bc1a2498e2215828c52003a4ddc4ebe79dd43def367398fad7895c5e5ce9ae4ce68e51141193ef7d47d0727ed477c7b00fbb95b47cd6f251aacbd15048c WHIRLPOOL 80bd9de5b4c5eb671a462a094cd016d0931885ca4604a489017cc36ae5d960a5f08cb72185011d796d5bf9c4809ed2331416ca9b0dae00991ac1e998fc31f7c9 DIST uClibc-0.9.33.2-patches-3.tar.bz2 4002 SHA256 2c06d1f80c8b7e5b0ef60571720273e2ccc55551a3dacc9ed5f7c04e9eda7018 SHA512 935dded858fbd4ce7317bdd1c097f26d8752bd241c12c9b1420e621bb80e59d8f74f84a8ae4df86bb07a03b2354e6c8ce4ba980aaa6d9be63c5e518da393db52 WHIRLPOOL d72989fbc7c700191b5703591bff4ff39ba6a3bb9c230cefb11c21cb2cd5f3f25bd52e8f6783bc651bd273d15146246491923bb1c357ce117da496910acefe6e +DIST uClibc-0.9.33.2-patches-4.tar.bz2 9570 SHA256 9fbcd7943357d0a73a62039622ae1f926faa8a018bbaa94c43794cc6dc648041 SHA512 360a002e8f80e0ad2fbeeef605f367a26c4243f703205db9e87f971346cce72a0d99328d0519847e281b493c407809212ed10017383fda51148e0383a731a3c0 WHIRLPOOL f61776f474294015b1792ebba8bbdd19dcf95a23e1ed557654f5df936d6a96dd880834d4a5e6624e3d99dfc12500445afa30dceb7e0bfd0c1d9b292c5ad0c072 DIST uClibc-0.9.33.2.tar.bz2 2834029 SHA256 988d2c777e0605fe253d12157f71ec68f25d1bb8428725d2b7460bf9977e1662 SHA512 1cf18fe5418e12ae12ce995d7455d465bc4737f225afc49512ec69858771e099bead7b18408b01c7e6f845dcc80c3b4f875332eeffdcc04ae4b48474fb29a8dd WHIRLPOOL e2ca16c179893a58228e701ddf8b5614cb6b3fe2eaa6e2a9b909a27f78a348723fa7ec99f7b437ce35d9ac0870e3e2ec4e4d46834ca6b3cbc3d8fa5306b57fb4 DIST uClibc-locale-030818.tgz 236073 SHA256 c4362be318a38f18d98dccf462d22d95bab92f05548bb93f65298fe9afaebd57 EBUILD uclibc-0.9.28.3-r8.ebuild 14630 SHA256 27a5827a295d4b02c34136abcc8a41793d33c9dba849d5050a416760eb9cc8b0 SHA512 bdd97456ff19eb03f47245f8a971deebefb11d3808f15382422d39a437cc7f2881bf799f04baffe5a302ec35b406030bc4c5d79d7e6a5c68de38ebe12dd47f20 WHIRLPOOL 18e5a59ddb7e980affb2e3b84c23109a9744072b5ec525d86bc71ceea057aa19a2340ff23314ccfd56e63fde25d83d0acada8649431b417aaf62851187fa4eb0 @@ -22,25 +23,26 @@ EBUILD uclibc-0.9.30.ebuild 13759 SHA256 878f2b1a77e3de34f05949ad9d605b39971011e EBUILD uclibc-0.9.33.1-r1.ebuild 10638 SHA256 3dd5ada253e15765973bafc55b9af445e985f9abf5315210ca9ef960c979edd8 SHA512 d1e35aa06f9ce30007cc51a66bc37b6a017bd6e63fbec5fe8f6ff5bb337c3aa91960bdfcc58d451532c66baed57cf2e0b48ba1eef320e75a098940ae6bbe403d WHIRLPOOL 0b98a4b793f080a33594fa67106f33136e22f4a1dfdda1e411d7a62f6b3dbcc34d12a9a8a643f7874551553047647202472aa632c6b8ab902914facc820b2b28 EBUILD uclibc-0.9.33.1.ebuild 10612 SHA256 f175807254cff8e8e91fb0173d3d965f3eee27458e3917c042b085cf7ef7c236 SHA512 92af9117e0aee925ccc61ecb61d0c77aff60eb4a818c7e98ee96801ab7dfcf212d60c6e77ec8716dc9e24564ee1bab9534bb02a0b4c3d3746745cca4b3dd8ca2 WHIRLPOOL d469013f04cff6cf6ec54813ae7825f3f1fc5c12a427dd1d496c567820cabf525771dd1b60a1f5e070d7884b63066303486727ef00212bd1bba484310cb28343 EBUILD uclibc-0.9.33.2-r1.ebuild 10638 SHA256 b3c450389a1c396563382e8061fa206baef9acece2cc709a9acc73a03c090217 SHA512 915b875e34f14af9be8a6f682d9d502f99c9fcd6fcec21bbb01089aa8df9c974b7bd833a3f80ac413bf79c231658692cf9a04dcdced4ef1f5d47475e2716c8ff WHIRLPOOL 63cc2fd711fe328d447aead14cf404345ca9ffed306ef474b363d7bd59dcb8f44d31fb1d95964b220c1f082e4a60aba9e3bc87c349856a9833966b4182145fa8 -EBUILD uclibc-0.9.33.2-r2.ebuild 10638 SHA256 fc166ab3fc653f5eaadf7c665c595c8aaa09bd39270300e54fda6abd83745d3a SHA512 c52d15a3fb79a1bde6c158fcbd658064dea2a7e201e880f5936d999496e2dee1e6a0175803246606e1ddaae0c3ebcc50d75a0baf82283a947c51ded69e728d4a WHIRLPOOL 177ec0c1e64505673feac8b5655ddbc6e901529bd223bad1c6275b785935eee324a3779bcee72d56844697234aedf30cdaeaf2181a86ff65bc20c580fe2bfe31 +EBUILD uclibc-0.9.33.2-r2.ebuild 10631 SHA256 08f05130b3b7b7df2f0a0bb3330e2599132e872f2e38fe9f9b3586df6a180deb SHA512 a5fa061a09d21aa5d743d5d118e2a60357eff384a959e4e099d9056c557fd2f3d995dd79b01c25e7cd905ff66836e2a540b14a1fd6fcf9229db441763c9d17f5 WHIRLPOOL 60f695ca98a92f99618c4bd1c5adc68527c407c30b9ef22a83aafa9372ff16f4e6f67821cbd5aa48bae8d327e9d16c6ac5d5cb5fe39819f04ba492b1d13a9a72 +EBUILD uclibc-0.9.33.2-r3.ebuild 10690 SHA256 53149b7f57acdcf8cef858dd0d51d597758f42acf4845aa9383bb19984c7dba8 SHA512 f9912a963af70eb52f662d88d0d5492b5da3836ac6e292ab88ef176d9f8bd165505b762796e2258a3ea069b9019d2c86ff78da015c3003001ece8e0198ab4d53 WHIRLPOOL 228eceeeebac5f6796b9c453e372a53da4c0f1831e4b6c0d53bd45c83c92d03a0357d5f86c2d45cfd806144cd4f721405622a6f688d931f568308d942fa1aaf1 EBUILD uclibc-0.9.33.2.ebuild 10630 SHA256 db49c741a424d2433ec3978184c979b2a9fcb903f83eeb110adcec76940b342e SHA512 75e974586c57662f2f39d6a80a1162ec611b31b4dfa881a2ab2094f6b35c6b9375c98a53c957580395b4754cc8c27b4a53737b6d9a0f099ab4a3c45ae1169125 WHIRLPOOL 9f8f01465c556c372d926e701abef49770c1772b40ad83325439343d22561a4b1f4cf6c9bcdba78815f2e8af11d3455deee3dd81225c54b83de3dd132e2462c9 EBUILD uclibc-9999.ebuild 10630 SHA256 1cec3d6d45c9f727a958f4d8216b8b82897f9a3af6bc5ce3d32cc7aa7947c6b0 SHA512 f9f11a885676b93afa93bdc1d90ddf393a5ed6f107422a5d32a483bbd4730edfa15e4e6dcd2218a30319b6fdad2c4018389415077022d217b759b83a4f251a40 WHIRLPOOL 2ad36293a2ed90f35f42511d0cd768c2e8859aea650a6fe947098ee3787be7aa4fdb231c967cbdcc735ff6bf5d03a9983eb29f03ece70c9bf01de26544c894da -MISC ChangeLog 20410 SHA256 053c34b974c4da6d81855db7bce5db389a39da94fe70877db0ea3dcecf66ee86 SHA512 ec7efc419d24dee6c22dba93a897f5e0c93675d0ab26e216abc7295dc0928f0cbc155e55cfa2ca8d110982ef3191711764ad7248ed33af63c686aafd5916b367 WHIRLPOOL fede5fad022df70d4acc1432653977e96b0884a30526b70057fd32a09d14aac5f6e45cd4e2910ea76a90eb6aba8809b344e2a2e0552e64b5496086031641da5b +MISC ChangeLog 20747 SHA256 f7e1b76fcaf9816cf9497081f0e3d2875bbe8daa6ddd2ae71d47779194142c12 SHA512 123edfc749ebbd8e4b969f7ce76fddc428f3ce9a8f7d7ce4bcc02b955536c80f1d3d2ac291c3c9e59f4a0da11b759f655594a653fa8d3278d9a7ce54e8076441 WHIRLPOOL ca4d7e9b93c6130a0df64646bf6d990512126f22e3490c3866773942f987b4795472f798ff6e3b4a65632220eab5f831568135c37439b8fe78265e1a7dd6fefd MISC metadata.xml 1435 SHA256 cd15ca4d65ec270c128fb37bd2c489b6e83c566203028cc8ecf9a90bea9c071d SHA512 84b5c8b1afe189587178d7736c3fca20b8079cf5ab666d524962e104a0a531de3fe39bdb2d3b69e4a77c322b8392fe7df292ea50ff89d80f99201aef1a12bc2b WHIRLPOOL 1e93f7bf529709eea2a8dfa81737bff41d22bd8af35ed562f06479f337b53ddc7aedd362c91f8361016c462edb5e8007586a7fde7f960fd4b7b88eff02c42e81 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) -iQIcBAEBCAAGBQJQLy3EAAoJELEHsLL7fEFWbeMP/0Mb7VWw1tC/gu8G7v/V19Jk -oWeQhIlkuVD9cspt6Cp0YUahobqt6oDUdJJAunrr43Q1XpBSq5YLUXJSStglATCM -rs4gwIKwX7SmvnnHK5P1mYSUNWeJ5TO4jPSoY10QBTMNfrj75idXJkl4UIYQRYby -M26KfzbUr30ImPbVbf1mktNdN8P4+nSRnRIyp6SFeWnoDD5gXRu2dsPmJ0cb+pES -DIf3zG7x0Y4uo9Zp5n98jvIUCT1123xDaSOkVi6/MLKL+PQ3Xy2ZsuFu6koYZfP6 -loqgl8GlAIwwKNX0adxIqLrdB/fys1WnPcM2yPjRN/SawHkiY8z2h8YWROGBYIx3 -Ww4bAgrzOTiMKvSxRctciIjwmMLI2qyDMZUsuxyacQ//ORfVXmmL2CvwiUUTnHV2 -aE1uBLiRACW1VC1THxpdxMKTdpOqdyY41GzGySheYBUpYM+UjnWboqVgR/uTo8Cz -XGYvgG0JJxbha/3O6TXZW/r96qm7QsXjTrBrWvIWOGK4MEmwV0Mska6f4IDroM+A -o2y0hQ87Y+bC6uAoAO6fAB40p8r/boBmTTBowNcy9XdbF9G5FHWSMJ7gPQPfG659 -+SDhyfJ8U8CFsdKTpJ+Rr4157G5bQqpi9hbCnO+fQqnmM/9tVUWutqOo5EUhXYFs -EPq4ZdEfgqDXPjVi6VDa -=7Y+0 +iQIcBAEBCAAGBQJRBB2BAAoJELEHsLL7fEFWyuAP/jOAhxYjrk/R7sCuXiRmvUBt +9FGRFKxpE40dt+4xQbNV2lMM+Lx9LWqjBVYVFIlozIRTCV3V3lZEy+HYTbICopOk +HdslWpyE0CrwMfwM0RFH6pLyslwlAlCHq1DbV1TM4OcFkhW2VRrGnsffkhFAJ+rS +Wien0wrF90lF7/gCWxcnjBNZqJI8IPLc4cI0rBgBcU0xYqug8Fqu9C9xju6LhLOd +C4MYAV5M+DkpMyvieG2U1HoylDpdSR0xSLt8mJ5AYdSVHmJNXRVz3bJqYXOlzh44 +HrQvVj1hOSPqlmnvHEV7wyY/iyb4GPUs6/bVpw6mfip6gg8vURsYiyuMHmDoLbh2 +kGfB4OSdicG+iVxbq61gquKxqkilMt76nFx9PWnc2SeEUcJDRLVw0jhAWglmowwi +dKIDegXL2+sYxez9ZwllHla1I+Vy6qLYusIbGtT6NpJNyYakXi+E1iA4HpyTeVay +XtkayVdsQsMNiG+zT9abvOfkFZdMnWALqv6CYZKXjH2hpINNR0+SJNTXG7AeR/Ba +7YyGIleLqdjazY4hLhCYIhhbaY1ldSVmJDqmgCH40LbrXKc3bfL2WSic9T3+Sniy +/uDnHbhpaccvE72Xzh/Pgy7osHHO2d9xrrrtKB+403kbbQ9xXFZSgGktAr5V+NDc +n5dkaxrra4ilot5aELDE +=k5td -----END PGP SIGNATURE----- diff --git a/sys-libs/uclibc/uclibc-0.9.33.2-r3.ebuild b/sys-libs/uclibc/uclibc-0.9.33.2-r3.ebuild new file mode 100644 index 000000000000..0c65489ead7b --- /dev/null +++ b/sys-libs/uclibc/uclibc-0.9.33.2-r3.ebuild @@ -0,0 +1,374 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.33.2-r3.ebuild,v 1.1 2013/01/26 18:16:29 vapier Exp $ + +inherit eutils flag-o-matic multilib toolchain-funcs savedconfig +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="git://git.busybox.net/uClibc" + inherit git-2 +fi + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi + +MY_P=uClibc-${PV} +DESCRIPTION="C library for developing embedded Linux systems" +HOMEPAGE="http://www.uclibc.org/" +if [[ ${PV} != "9999" ]] ; then + PATCH_VER="4" + SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2 + ${PATCH_VER:+mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2}" + KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86" +fi + +LICENSE="LGPL-2" +SLOT="0" +IUSE="debug hardened iconv ipv6 nptl rpc ssp uclibc-compat wordexp crosscompile_opts_headers-only" +RESTRICT="strip" + +S=${WORKDIR}/${MY_P} + +is_crosscompile() { + [[ ${CHOST} != ${CTARGET} ]] +} +alt_build_kprefix() { + if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] ; then + echo /usr/include + else + echo /usr/${CTARGET}/usr/include + fi +} + +just_headers() { + use crosscompile_opts_headers-only && is_crosscompile +} + +uclibc_endian() { + # XXX: this wont work for a toolchain which is bi-endian, but we + # dont have any such thing at the moment, so not a big deal + touch "${T}"/endian.s + $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o + case $(file "${T}"/endian.o) in + *" MSB "*) echo "BIG";; + *" LSB "*) echo "LITTLE";; + *) echo "NFC";; + esac + rm -f "${T}"/endian.{s,o} +} + +pkg_setup() { + if [ ${CTARGET} == ${CHOST} ] ; then + case ${CHOST} in + *-uclinux*|*-uclibc*) ;; + *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;; + esac + fi +} + +# XXX: We should kill these off. +CPU_ALPHA="" +CPU_AMD64="" +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}}" +CPU_IA64="" +CPU_M68K="" +CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32{,R2},64}} MIPS_{N64,O32,N32}_ABI" +CPU_PPC="" +CPU_SH="SH{2,2A,3,4,5}" +CPU_SPARC="SPARC_V{7,8,9,9B}" +CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH" +IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}" + +check_cpu_opts() { + local cpu_var="CPU_$(echo $(tc-arch) | tr [a-z] [A-Z])" + [[ -z ${!cpu_var} ]] && return 0 + + if [[ -z ${UCLIBC_CPU} ]] ; then + ewarn "You really should consider setting UCLIBC_CPU" + ewarn "Otherwise, the build will be generic (read: slow)." + ewarn "Available CPU options:" + UCLIBC_CPU=$(eval echo ${!cpu_var}) + echo ${UCLIBC_CPU} + case ${CTARGET} in + mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";; + sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";; + i[456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";; + *) export UCLIBC_CPU=${UCLIBC_CPU%% *};; + esac + else + local cpu found=0 + for cpu in $(eval echo ${!cpu_var}) ; do + [[ ${UCLIBC_CPU} == "${cpu}" ]] && found=1 && break + done + if [[ ${found} -eq 0 ]] ; then + ewarn "UCLIBC_CPU choice '${UCLIBC_CPU}' not supported" + ewarn "Valid choices:" + eval echo ${!cpu_var} + die "pick a supported cpu type" + fi + fi +} + +kconfig_q_opt() { + local flag=$1; shift + case ${flag} in + y|n) ;; + *) flag=$(usex ${flag} y n) ;; + esac + + local var="defs_${flag}" + eval "${var}+=( $* )" +} + +get_opt() { + ( + unset ${1} + . ${2:-"${S}"/.config} + echo ${!1} + ) +} + +src_oldconfig() { + yes "" 2>/dev/null | emake -s oldconfig >/dev/null +} +src_config() { + restore_config .config + if [ -f .config ]; then + src_oldconfig + return 0 + else + ewarn "Could not locate user configfile, so we will save a default one" + fi + + emake ARCH=${target} defconfig >/dev/null || die + + local defs_{y,n} defs + + defs=( + DO{DEBUG_PT,ASSERTS} + SUPPORT_LD_DEBUG_EARLY + UCLIBC_HAS_PROFILING + ) + kconfig_q_opt n "${defs[@]}" + kconfig_q_opt debug DODEBUG SUPPORT_LD_DEBUG + + sed -i -e '/ARCH_.*_ENDIAN/d' .config + kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN" + + if [[ ${CTARGET} == arm* ]] ; then + kconfig_q_opt n CONFIG_ARM_OABI + kconfig_q_opt y CONFIG_ARM_EABI + fi + + defs=( + MALLOC_GLIBC_COMPAT + DO_C99_MATH + UCLIBC_HAS_{CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC} + UCLIBC_HAS_FENV + UCLIBC_HAS_{N,}FTW + UCLIBC_HAS_GNU_GLOB + UCLIBC_HAS_LIBUTIL + UCLIBC_HAS_PROGRAM_INVOCATION_NAME + UCLIBC_HAS_RESOLVER_SUPPORT + UCLIBC_HAS_TZ_FILE_READ_MANY + UCLIBC_HAS_UTMPX + UCLIBC_SUPPORT_AI_ADDRCONFIG + UCLIBC_SUSV3_LEGACY + UCLIBC_SUSV3_LEGACY_MACROS + UCLIBC_SUSV4_LEGACY + UCLIBC_USE_NETLINK + PTHREADS_DEBUG_SUPPORT + ) + kconfig_q_opt y "${defs[@]}" + kconfig_q_opt n UCLIBC_HAS_CTYPE_UNSAFE + kconfig_q_opt n UCLIBC_HAS_LOCALE + kconfig_q_opt n HAS_NO_THREADS + kconfig_q_opt ipv6 UCLIBC_HAS_IPV6 + kconfig_q_opt nptl UCLIBC_HAS_THREADS_NATIVE + kconfig_q_opt !nptl LINUXTHREADS_OLD + kconfig_q_opt rpc UCLIBC_HAS_{,{FULL,REENTRANT}_}RPC + kconfig_q_opt wordexp UCLIBC_HAS_WORDEXP + kconfig_q_opt uclibc-compat UCLIBC_HAS_LIB{NSL,RESOLV}_STUB COMPAT_ATEXIT + + # we need to do it independently of hardened to get ssp.c built into libc + kconfig_q_opt y UCLIBC_HAS_SSP + kconfig_q_opt n UCLIBC_HAS_SSP_COMPAT + kconfig_q_opt y UCLIBC_HAS_ARC4RANDOM + kconfig_q_opt n PROPOLICE_BLOCK_ABRT + kconfig_q_opt y PROPOLICE_BLOCK_SEGV + + # arm/mips do not emit PT_GNU_STACK, but if we enable this here + # it will be emitted as RWE, ppc has to be checked, x86 needs it + # this option should be used independently of hardened + if has $(tc-arch) x86 || has $(tc-arch) ppc ; then + kconfig_q_opt y UCLIBC_BUILD_NOEXECSTACK + else + kconfig_q_opt n UCLIBC_BUILD_NOEXECSTACK + fi + kconfig_q_opt y UCLIBC_BUILD_RELRO + kconfig_q_opt hardened UCLIBC_BUILD_PIE + kconfig_q_opt hardened UCLIBC_BUILD_NOW + kconfig_q_opt !ssp SSP_QUICK_CANARY + kconfig_q_opt ssp UCLIBC_BUILD_SSP + + local def + for def in 1 2 ; do + # Run twice as some config opts depend on others being enabled first. + for def in ${defs_y[@]} ; do + sed -i -e "s:.*\<${def}\>.*set:${def}=y:g" .config + done + for def in ${defs_n[@]} ; do + sed -i -e "s:${def}=y:# ${def} is not set:g" .config + done + src_oldconfig + done + + einfo "Enabled options:" + for def in ${defs_y[@]} ; do + einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}") + done + einfo "Disabled options:" + for def in ${defs_n[@]} ; do + einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}") + done + + # setup build and run paths + sed -i \ + -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CTARGET}-\":" \ + -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \ + -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \ + -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \ + -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \ + -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \ + .config || die + + src_oldconfig +} + +src_unpack() { + if [[ ${PV} == "9999" ]] ; then + git-2_src_unpack + else + unpack ${A} + fi + cd "${S}" + if [[ -n ${PATCH_VER} ]] ; then + EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch + fi + + check_cpu_opts + + echo + einfo "Runtime Prefix: /" + einfo "Devel Prefix: /usr" + einfo "Kernel Prefix: $(alt_build_kprefix)" + einfo "CBUILD: ${CBUILD}" + einfo "CHOST: ${CHOST}" + einfo "CTARGET: ${CTARGET}" + einfo "CPU: ${UCLIBC_CPU:-default}" + einfo "ENDIAN: $(uclibc_endian)" + echo + + ########## CPU SELECTION ########## + + local target config_target + case $(tc-arch) in + alpha) target="alpha"; config_target="no cpu-specific options";; + amd64) target="x86_64"; config_target="no cpu-specific options";; + arm) target="arm"; config_target="GENERIC_ARM";; + avr) target="avr32"; config_target="no cpu-specific options";; + ia64) target="ia64"; config_target="no cpu-specific options";; + m68k) target="m68k"; config_target="no cpu-specific options";; + mips) target="mips"; config_target="MIPS_ISA_1";; + ppc) target="powerpc"; config_target="no cpu-specific options";; + sh) target="sh"; config_target="SH4";; + sparc) target="sparc"; config_target="no cpu-specific options";; + x86) target="i386"; config_target="GENERIC_386";; + *) die "$(tc-arch) lists no defaults :/";; + esac + sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \ + extra/Configs/Config.${target} + sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak + + src_config + + if use iconv ; then + # Run after make clean, otherwise files removed + find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt + if [[ ! -f /etc/locale.gen ]] ; then + # See ./extra/locale/LOCALES for examples + die "Please create an appropriate /etc/locale.gen for locale support" + fi + echo -e "@euro e\n@cyrillic c\n#---\nUTF-8 yes\n8-BIT yes\n#---\n\n" > ./extra/locale/locales.txt + cat /etc/locale.gen >> ./extra/locale/locales.txt + fi +} + +src_compile() { + emake headers || die + just_headers && return 0 + + emake || die + if is_crosscompile ; then + emake -C utils hostutils || die + else + emake utils || die + fi +} + +src_test() { + is_crosscompile && return 0 + + # assert test fails on pax/grsec enabled kernels - normal + # vfork test fails in sandbox (both glibc/uclibc) + emake UCLIBC_ONLY=1 check || die +} + +src_install() { + local sysroot=${D} + is_crosscompile && sysroot+="/usr/${CTARGET}" + + local target="install" + just_headers && target="install_headers" + emake DESTDIR="${sysroot}" ${target} || die + + save_config .config + + # remove files coming from kernel-headers + rm -rf "${sysroot}"/usr/include/{linux,asm*} + + # Make sure we install the sys-include symlink so that when + # we build a 2nd stage cross-compiler, gcc finds the target + # system headers correctly. See gcc/doc/gccinstall.info + if is_crosscompile ; then + dosym usr/include /usr/${CTARGET}/sys-include + if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then + newbin utils/ldconfig.host ${CTARGET}-ldconfig || die + newbin utils/ldd.host ${CTARGET}-ldd || die + fi + return 0 + fi + + emake DESTDIR="${D}" install_utils || die + dobin extra/scripts/getent + dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3 +} + +pkg_postinst() { + is_crosscompile && return 0 + + if [ ! -e "${ROOT}"/etc/TZ ] ; then + ewarn "Please remember to set your timezone in /etc/TZ" + mkdir -p "${ROOT}"/etc + echo "UTC" > "${ROOT}"/etc/TZ + fi + [ "${ROOT}" != "/" ] && return 0 + # update cache before reloading init + ldconfig + # reload init ... + /sbin/telinit U 2>/dev/null +} |