summaryrefslogtreecommitdiff
path: root/sys-libs
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/Manifest.gzbin15936 -> 15781 bytes
-rw-r--r--sys-libs/binutils-libs/Manifest2
-rw-r--r--sys-libs/binutils-libs/binutils-libs-2.30-r4.ebuild2
-rw-r--r--sys-libs/glibc/Manifest8
-rw-r--r--sys-libs/glibc/glibc-2.27-r6.ebuild4
-rw-r--r--sys-libs/glibc/glibc-2.28-r1.ebuild1429
-rw-r--r--sys-libs/glibc/glibc-9999.ebuild8
-rw-r--r--sys-libs/libutempter/Manifest2
-rw-r--r--sys-libs/libutempter/libutempter-1.1.6-r2.ebuild4
-rw-r--r--sys-libs/pam/Manifest2
-rw-r--r--sys-libs/pam/pam-1.3.0-r2.ebuild2
-rw-r--r--sys-libs/uclibc/Manifest6
-rw-r--r--sys-libs/uclibc/metadata.xml28
-rw-r--r--sys-libs/uclibc/uclibc-0.9.33.2-r15.ebuild355
-rw-r--r--sys-libs/uclibc/uclibc-0.9.33.9999.ebuild354
-rw-r--r--sys-libs/uclibc/uclibc-9999.ebuild353
16 files changed, 1447 insertions, 1112 deletions
diff --git a/sys-libs/Manifest.gz b/sys-libs/Manifest.gz
index cc8bf67b112f..e51203703b0b 100644
--- a/sys-libs/Manifest.gz
+++ b/sys-libs/Manifest.gz
Binary files differ
diff --git a/sys-libs/binutils-libs/Manifest b/sys-libs/binutils-libs/Manifest
index 6f0e84d6c24a..dca3288819b5 100644
--- a/sys-libs/binutils-libs/Manifest
+++ b/sys-libs/binutils-libs/Manifest
@@ -19,7 +19,7 @@ EBUILD binutils-libs-2.28.1.ebuild 2872 BLAKE2B f0ef199dfc0025b06dbdab74f76f0a17
EBUILD binutils-libs-2.29.1-r1.ebuild 2921 BLAKE2B f38060716462c9c51bc84b98348b82952b6bb47cd33136d7eaaca822ba6e40504fad2b0c778a4a02989ca9e20f812d928d718295376141dd02e519e541a605a3 SHA512 8fc849244e3cdb9b1a35e9bed1f2e57e8bba210e6ab9aa7408904b5a04cc532dfff52a9840e866df5985f6b1d05c96ce7549c7514389a8dae9a4d5d798d48c8e
EBUILD binutils-libs-2.30-r2.ebuild 3198 BLAKE2B 02001b84f17d61382bfa152c31dc0e54f98b3db753a41efa7a4e658917c17b4927e5f868dd64af356867f0bd0d33f5de7315b1f260d5a6d655b7645ca7bc5c48 SHA512 f028499c94299f331dc597c87f4fd8d2f96393e55af73f85275ae1cdd30a74ba73004b7aef31b5e561ec56d157d1def72425e9de8a3fd70e44df33ad94739e58
EBUILD binutils-libs-2.30-r3.ebuild 3211 BLAKE2B 7715a2ba111df9c62f3b00998ecb7d2b6d9aa42273195488fd121ea3f0d52554a7dd1a98e138d5b9870becfe9038ba57da8254c84720f5768af60822113386b8 SHA512 f08ecc65cb4ec222ae651ecb9fce48ebe2503ffb18204fb3183f18e802485721937e41f9140b54d56068bfa69468261d32aacaeffe595feb8788bcc837795c39
-EBUILD binutils-libs-2.30-r4.ebuild 3602 BLAKE2B 79fae579b8f61c1ba84ee242491d5cc38401814b9b15b07a8e1c77315790123569302b29999a96de97ea86e4e9ab456ed5a53b6f92ec6ca029725e8a0b811309 SHA512 ffae2a03e5c53c205bd92adf0afc77a4a52306dd52f2d488c1250758eb11ea6b72a38f10cf53ed0edcfb6994b98645ea3268eb88dc249441feca7d5e31b390d1
+EBUILD binutils-libs-2.30-r4.ebuild 3596 BLAKE2B f1a2394d52f8dfa577bf7de32fd8be94c8fab51a26a474cd55e9f196c0f7e45fcb4f82c51025cdc1950c7d2ea93a767df130a0fb3eef3f23cd37d3ed0fddbf2c SHA512 7dc4aa97aecc0bb2a086a533d18ec98265efc95c8a37cc33bba00c05ea01b419d5fcd34f5e2a44b85d6ccf16cb642b54617ef5cca364c4d24194f1b9f2fdfcbd
EBUILD binutils-libs-2.31.1-r1.ebuild 3495 BLAKE2B e5c9ed2a14efb11e121cf853291f670c782e66584375b854f99e36dd9901b2fce09c6a58b355f517d0f8fe4297dee4b602a3ed4125650a9ed3bf12825bd1c239 SHA512 b4743dfff7d2781b0b6e5a566df944558e55c82287bc146a52551bbf762a1449ef198f04745714c0ca792e5288b07293a02c69b9e20248e6f36b52459539b564
EBUILD binutils-libs-2.31.1.ebuild 3093 BLAKE2B da00f2d3a3d3d53fffd02f1d0236b6d8f2c5b184001d7ed47e5c91ae06b524e9f9b2cd85a3ce6877de9be609a75b784db0da2413bb4cabec626abe291b072939 SHA512 762534285aa25b69e981fc50a22baeb882ce758f9e62e42eda20612041aaf7fb04b89699979659850224b5d1403523a74c8f14db0360f12b012b596aeb66872e
MISC metadata.xml 524 BLAKE2B 6f00793b2dc155b19d816b8acfd49e6bfc2ae35418ecc97fbbd3f9d0ed08b5f95a299b28fe6edad1a66f4d64abe99dc8a62a974fd70e28b535cd366239bf1cca SHA512 9db7c7a3082ee848ec4963831da06cced596d543e53660747fb56ac33998c219e1d7252892ffc32132d7db3c99ce9746fb6d9e85f866c3cba97552c31948342c
diff --git a/sys-libs/binutils-libs/binutils-libs-2.30-r4.ebuild b/sys-libs/binutils-libs/binutils-libs-2.30-r4.ebuild
index f44a3e1e5349..1f35f4dd31a2 100644
--- a/sys-libs/binutils-libs/binutils-libs-2.30-r4.ebuild
+++ b/sys-libs/binutils-libs/binutils-libs-2.30-r4.ebuild
@@ -21,7 +21,7 @@ LICENSE="|| ( GPL-3 LGPL-3 )"
# The shared lib SONAMEs use the ${PV} in them.
# -r1 is a one-off subslot bump where SONAME changed for bug #666100
SLOT="0/${PV}-r1"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="64-bit-bfd multitarget nls static-libs"
COMMON_DEPEND="sys-libs/zlib[${MULTILIB_USEDEP}]"
diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
index d28581f29880..57b5e8d77528 100644
--- a/sys-libs/glibc/Manifest
+++ b/sys-libs/glibc/Manifest
@@ -34,8 +34,9 @@ DIST glibc-2.26.tar.xz 14682748 BLAKE2B c1c9dbec110dd4e25b2f463a96d8afc43b8e3ebf
DIST glibc-2.27-patches-3.tar.bz2 166511 BLAKE2B 1dc54bef6e82112935c7411f7a5cd07c1edb24c3edaa1e0243b846b3832a40af1ba3a7b77aef04c54a173388156b464ea442fa8310a02e6f44e2ed5b78994286 SHA512 12496e9b0c60630dbec4c2febdd6d20df1f3d7a2c243cc55b595202b27f682b9208e16cd8c387687c0cc9e18b36c3caeef8d1b1148eb3ee8081431997270db5e
DIST glibc-2.27.tar.xz 15395316 BLAKE2B ea206d304c8c9aa86d69db981a14bea008602cea06a6c151c4971a8df059949ffe5632b42a67ab0ffcd7c4d7ce1ec02ac48815dac4dade1c4dd41eaee8a6ed33 SHA512 7c5581154487d38d173ce1feb944e60207139cca148bccf066eaae322c0c2d219423bdcfa15c7f9be1b5e45dfc43c641cc5d80d3c3c65837d08a83cdb4e2a147
DIST glibc-2.28-patches-1.tar.bz2 15028 BLAKE2B 4b2bcb4123a2a6d5df9c5bdf6bda29a4b7633159917d3e385bfe00d6685b71a3e42e8739a791a4ae5d88280a82227531cc6cd42536e5bd6b795f391cbcc62783 SHA512 6b9451df7a0e83e93b06ae97c564653ac17c8e0d9c78f8a0ed42750bd6e3e58938491acb018681341eb57898811dc6020fa42287e408dfd6e8189cb362e393f1
+DIST glibc-2.28-patches-2.tar.xz 43216 BLAKE2B e33b76d401343239ad32a1f142a214ae81a3ec3fc99ea21200255c0aee40a6b702ce98f0ffdacb2546711820ce1f51cd0782d405388bb815133739ad00c0183a SHA512 90ebfe90b79f869a8604150023aaf2d5b4de1c3d0028ebd48d803dd980efd149ced4276617a944931a2875f70918372f3a061a1f06d96f74cc96d65c117fdfef
DIST glibc-2.28.tar.xz 16484344 BLAKE2B 9aa8cbd5a145c2a6fde3a60b3d0a14b12b46ed79333ad1ca3e73464adcfe700277a17a9e7fd0ca36e355a0c5b0b27decfa091da320ba802741ad75cc955bbcc8 SHA512 521f820953ff07c69ece4c2186f59fc061a7f9747932cd70ef2995c2b2deee76eeb6de700d85071cdca5949179aa8ccee75eda7feca1394121ec7b821ad0a3f3
-DIST glibc-9999-patches-7.tar.bz2 15065 BLAKE2B 23dbe7b6dac30aedb8f563d492a2d44673c1a8233ac67b05a88fb9658b437eda8dff7ef8199d30ea07a0ef5d95b51a57c7db405ba3fdeab108b797caf6811d22 SHA512 ec2bee03969144e42849cb9923a11ac7dfe7418d8214243469227a97cd440c998d027d4d91b8e5d6c42fe5614f4c2fdfe4bfa06022e1e98efaa4150ca65387e2
+DIST glibc-9999-patches-8.tar.xz 14708 BLAKE2B 6c468f11f5b85460219f56ac694e1d3dc3de9a2a23daf7d4f2c715e1b9189bd7a5383093fd8076c2456f9ac0874cb0e2daad8fb360a62038e763a87234f95d95 SHA512 172ab4bc2e716900224b699c9ef89629ffc12756cb72fb7d9628e0ea8fc840cfb2da20ca69fa6c6e1a709f7e2a990bb0f85c32b6ace6fd2d57e2242471900e30
EBUILD glibc-2.19-r2.ebuild 40604 BLAKE2B 8fea38d437019ff88a832d725a5fc76f58b382bc297ba13ad3c61a283a5549210307495e34fecbfcda30a5a9925416d963340c25a5e61ade4bd1637141849a53 SHA512 4ce1a7397be122d0fbb7369f8bf62599e5f8ee55a1626ce85f6f6f13a2b932c0574a7534442ed0a62c269dda07d73ba1cedf6c559a59385bc22c0f1fd406c5b9
EBUILD glibc-2.20-r2.ebuild 4924 BLAKE2B 8f2b71dd56f535915564e2517769844b234b5b02cbd4edaeb9ffd0a323e8cc7be663e6e57bad0c28df453ea332bfbb5891b07a569a0885a76c9427d680959ecd SHA512 00af5f249a1fcb0eb3ecc460ccd288daf752575df6ef3887bbffbaf3999360a24ae4058ad7e770206d8c2a86828238981d1820e28780be38481361f2f55518a8
EBUILD glibc-2.21-r2.ebuild 4899 BLAKE2B 4097f29160b437edb96e6f731c797cba43bfb65fe164c1ffc3af0025d52c18a286b9a75d56d3e371e33e87f99a71a2115ba2eba7cb174dd2787a9b6a6d84b674 SHA512 68cc49c310ff816b2433b4f9e389e992d64f623809d4a4c3391dcce7ee4c385365ef4278de79bf4b6b9a4ed969e10b94bebabe86e560295bd1c0a9652aec12ec
@@ -44,7 +45,8 @@ EBUILD glibc-2.23-r4.ebuild 4949 BLAKE2B 99db0ec4a452f04a2aef9b347a5ddec03cc88fb
EBUILD glibc-2.24-r4.ebuild 4988 BLAKE2B 8e08345c96e176984b73a073efca21f771d41af1af75106ec88a22bd55d7f69f28d9c01989026a3e58f3df4fac2a59db68d5ac8a8bbb0f411c75da8792f3402a SHA512 dd1d996eaf35197f7b7b6c111957eb98ef776d0a76a949b95f9bb17075dca43b2a354f8d15be133b9f3ff6c40a5b1f4ec28bd8d41c5cfc51da006eda8b005a05
EBUILD glibc-2.25-r11.ebuild 4975 BLAKE2B cef32f5d160644845e7cf45a9dd4c8cef1dcff8fca6b64c083c3e05d07533e445a6139939710b9284f7587bbf3977ca556caeb964e73ac21a382d942423d886a SHA512 f26645acc02f16209ec068641a800ef0a4ad2a422c9473e14a273fdece9b53074b837907d635a8585cf9dbb1acea14178166a4a3410aa4c70a745b89a764b6f1
EBUILD glibc-2.26-r7.ebuild 25616 BLAKE2B 924fbcb527d249abe6d5e74211d0339cacdc03db08c9504c6bcdefb4e320d3c3767708707e9dba4becc083b020db480238afa2bdd46d43a9e8cb7e23cc85d6d9 SHA512 f18bd985fef3ae83b4ea88ccc783dc7f5eaa3952218a9cbb7f9817b63d32481b7b4edc0a5c6121e792678107e348a41424f19a066923e76d2cfc43d6848c7723
-EBUILD glibc-2.27-r6.ebuild 41539 BLAKE2B 336165f2198d1572acdddb3c4c855c4e510938289fb62438e312320f4d3e793b9f70583cf3901f0f370f7c38756dddeb6a7349d0def99272b7f3ad2d630c43ac SHA512 38f361e8a17dd72612899dc8e69f2784b760e6a49d0b006343919d62403facb28385e6715003924248fc40f4fb448d7fb36ac14887aa7ff9e9726dec8a423a3b
+EBUILD glibc-2.27-r6.ebuild 41534 BLAKE2B 7c09a90a8e780ff1daf87046bf0c62d74cbd3ef975890d3cf8f843f2664e3c99d2a4afc0cdf2bda147aafb4b8cc772f3badd7b4944a2c9021023b0e36a29d593 SHA512 e1fc683d4bfa5204225e9e70c07d3ee10f0f363019acf5d197a703c442357fac94c900c8a29837794af20dc2a7e485b76100f9d0387885bcf94febae1fa68363
+EBUILD glibc-2.28-r1.ebuild 41856 BLAKE2B 84d4f7c35f44bddd2ad4e63d66385a43e8d39168c2c67b3e17317a55f34b998a9514f6034ad05201f0bf39e48529432e1e4ef049f4a7843dac041bb269eede5e SHA512 1a19a5bbf4f6e2846438a32e4f37f62be24444ab849cf089634b96d5c550afca35f6f3538798f138a2723c76c3efb0acc3ee60fb80160c65bbe282f83b130536
EBUILD glibc-2.28.ebuild 41861 BLAKE2B f747cf7117f8a629e8353fee9a5ca2ddc8a128e2722381fdbf27849ff6be676b147596d0cbea52c78edc0e4a369d0eb4cda0a4c33d8eb99b4a1ee51aef68bfda SHA512 80015c199dbb2086daf7801184ce3501838fd97265378ed732fce96ff7dda95524ababdc738d392411d35bc174522a25dd62571676cd4c09435769bb855ea990
-EBUILD glibc-9999.ebuild 41861 BLAKE2B fae057c79abc53eb68b73394cb03404a8c6e33d07f3c60df52ee089322503bafa196bea96736966fe5eef8b224ee018ed26ecf0da188371a635bb676da429506 SHA512 7bd763ec64e227da5f6e8960e4d004c894bd744a0136b2f7fd3ce7b0f6cff48a9e8302a98ad5bb6cb7a86db2d2038b9c3c3a5069a11e3f7d09842c1420c53d93
+EBUILD glibc-9999.ebuild 41856 BLAKE2B 06bd334aa7a53f08e52c0d29744eccce8ac150b4dcea62beba6a26b11a81722b8e42a8d52abb846f94adf4b3a76268fe4657d0e530cdd728403133daa84a0ecc SHA512 894a4416f45cbd848749ba4c3ca7c7dbfab87d21942e9e04bddafbb33b19b860a2dc8bda78213054fdd57f71c3ac22d8fdd5d8946975968a970bdd37f752aef2
MISC metadata.xml 1255 BLAKE2B f76cdfb02dfaf8b51cff3e074d41df76b34d5ae84bd5f8e9c05fba2a0d83f85751d74e1d84a3ead510ee905782d8e2b0134c276aea85a684fb42ccfef57e366b SHA512 da070159b83cfb5af39c9cd8cc44f6c4135c9b3f71c899829faf4ebe511c9cd60e121cd01a9268264f4a680b0467847f84d1887614366ff5a937b4dbb6d38ad3
diff --git a/sys-libs/glibc/glibc-2.27-r6.ebuild b/sys-libs/glibc/glibc-2.27-r6.ebuild
index 4f328fea7cb0..b176360b42d3 100644
--- a/sys-libs/glibc/glibc-2.27-r6.ebuild
+++ b/sys-libs/glibc/glibc-2.27-r6.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -18,7 +18,7 @@ if [[ ${PV} == 9999* ]]; then
EGIT_REPO_URI="https://sourceware.org/git/glibc.git"
inherit git-r3
else
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86"
SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
fi
diff --git a/sys-libs/glibc/glibc-2.28-r1.ebuild b/sys-libs/glibc/glibc-2.28-r1.ebuild
new file mode 100644
index 000000000000..5d2d8b788b90
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.28-r1.ebuild
@@ -0,0 +1,1429 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit prefix eutils versionator toolchain-funcs flag-o-matic gnuconfig \
+ multilib systemd multiprocessing
+
+DESCRIPTION="GNU libc C library"
+HOMEPAGE="https://www.gnu.org/software/libc/"
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+RESTRICT="strip" # Strip ourself #46186
+SLOT="2.2"
+
+EMULTILIB_PKG="true"
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="https://sourceware.org/git/glibc.git"
+ inherit git-r3
+else
+ # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ KEYWORDS=""
+ SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
+fi
+
+RELEASE_VER=${PV}
+
+GCC_BOOTSTRAP_VER=20180511
+
+# Gentoo patchset
+PATCH_VER=2
+
+SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
+SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
+
+IUSE="audit caps cet compile-locales doc gd hardened headers-only +multiarch multilib nscd profile selinux suid systemtap test vanilla"
+
+# Minimum kernel version that glibc requires
+MIN_KERN_VER="3.2.0"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+#
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+# We need a new-enough binutils/gcc to match upstream baseline.
+# Also we need to make sure our binutils/gcc supports TLS.
+COMMON_DEPEND="
+ nscd? ( selinux? (
+ audit? ( sys-process/audit )
+ caps? ( sys-libs/libcap )
+ ) )
+ suid? ( caps? ( sys-libs/libcap ) )
+ selinux? ( sys-libs/libselinux )
+ systemtap? ( dev-util/systemtap )
+"
+DEPEND="${COMMON_DEPEND}
+ >=app-misc/pax-utils-0.1.10
+ sys-devel/bison
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+ !<sys-devel/bison-2.7
+ !<sys-devel/make-4
+ doc? ( sys-apps/texinfo )
+ test? ( >=net-dns/libidn2-2.0.5 )
+"
+RDEPEND="${COMMON_DEPEND}
+ >=net-dns/libidn2-2.0.5
+ sys-apps/gentoo-functions
+ !sys-kernel/ps3-sources
+ !sys-libs/nss-db
+"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.9
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.9
+ virtual/os-headers
+ "
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+#
+# Small helper functions
+#
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+just_headers() {
+ is_crosscompile && use headers-only
+}
+
+alt_prefix() {
+ is_crosscompile && echo /usr/${CTARGET}
+}
+
+# We need to be able to set alternative headers for compiling for non-native
+# platform. Will also become useful for testing kernel-headers without screwing
+# up the whole system.
+alt_headers() {
+ echo ${ALT_HEADERS:=$(alt_prefix)/usr/include}
+}
+
+alt_build_headers() {
+ if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
+ ALT_BUILD_HEADERS="${EPREFIX}$(alt_headers)"
+ if tc-is-cross-compiler ; then
+ ALT_BUILD_HEADERS=${SYSROOT}$(alt_headers)
+ if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then
+ local header_path=$(echo '#include <linux/version.h>' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h')
+ ALT_BUILD_HEADERS=${header_path%/linux/version.h}
+ fi
+ fi
+ fi
+ echo "${ALT_BUILD_HEADERS}"
+}
+
+alt_libdir() {
+ echo $(alt_prefix)/$(get_libdir)
+}
+alt_usrlibdir() {
+ echo $(alt_prefix)/usr/$(get_libdir)
+}
+
+builddir() {
+ echo "${WORKDIR}/build-${ABI}-${CTARGET}-$1"
+}
+
+do_compile_test() {
+ local ret save_cflags=${CFLAGS}
+ CFLAGS+=" $1"
+ shift
+
+ pushd "${T}" >/dev/null
+
+ rm -f glibc-test*
+ printf '%b' "$*" > glibc-test.c
+
+ nonfatal emake -s glibc-test
+ ret=$?
+
+ popd >/dev/null
+
+ CFLAGS=${save_cflags}
+ return ${ret}
+}
+
+do_run_test() {
+ local ret
+
+ if [[ ${MERGE_TYPE} == "binary" ]] ; then
+ # ignore build failures when installing a binary package #324685
+ do_compile_test "" "$@" 2>/dev/null || return 0
+ else
+ if ! do_compile_test "" "$@" ; then
+ ewarn "Simple build failed ... assuming this is desired #324685"
+ return 0
+ fi
+ fi
+
+ pushd "${T}" >/dev/null
+
+ ./glibc-test
+ ret=$?
+ rm -f glibc-test*
+
+ popd >/dev/null
+
+ return ${ret}
+}
+
+setup_target_flags() {
+ # This largely mucks with compiler flags. None of which should matter
+ # when building up just the headers.
+ just_headers && return 0
+
+ case $(tc-arch) in
+ x86)
+ # -march needed for #185404 #199334
+ # TODO: When creating the first glibc cross-compile, this test will
+ # always fail as it does a full link which in turn requires glibc.
+ # Probably also applies when changing multilib profile settings (e.g.
+ # enabling x86 when the profile was amd64-only previously).
+ # We could change main to _start and pass -nostdlib here so that we
+ # only test the gcc code compilation. Or we could do a compile and
+ # then look for the symbol via scanelf.
+ if ! do_compile_test "" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n' 2>/dev/null ; then
+ local t=${CTARGET_OPT:-${CTARGET}}
+ t=${t%%-*}
+ filter-flags '-march=*'
+ export CFLAGS="-march=${t} ${CFLAGS}"
+ einfo "Auto adding -march=${t} to CFLAGS #185404"
+ fi
+ ;;
+ amd64)
+ # -march needed for #185404 #199334
+ # Note: This test only matters when the x86 ABI is enabled, so we could
+ # optimize a bit and elide it.
+ # TODO: See cross-compile issues listed above for x86.
+ if ! do_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n' 2>/dev/null ; then
+ local t=${CTARGET_OPT:-${CTARGET}}
+ t=${t%%-*}
+ # Normally the target is x86_64-xxx, so turn that into the -march that
+ # gcc actually accepts. #528708
+ [[ ${t} == "x86_64" ]] && t="x86-64"
+ filter-flags '-march=*'
+ # ugly, ugly, ugly. ugly.
+ CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}")
+ export CFLAGS_x86="${CFLAGS_x86} -march=${t}"
+ einfo "Auto adding -march=${t} to CFLAGS_x86 #185404"
+ fi
+ ;;
+ mips)
+ # The mips abi cannot support the GNU style hashes. #233233
+ filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both
+ ;;
+ sparc)
+ # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
+ filter-flags "-fcall-used-g7"
+ append-flags "-fcall-used-g6"
+
+ # If the CHOST is the basic one (e.g. not sparcv9-xxx already),
+ # try to pick a better one so glibc can use cpu-specific .S files.
+ # We key off the CFLAGS to get a good value. Also need to handle
+ # version skew.
+ # We can't force users to set their CHOST to their exact machine
+ # as many of these are not recognized by config.sub/gcc and such :(.
+ # Note: If the mcpu values don't scale, we might try probing CPP defines.
+ # Note: Should we factor in -Wa,-AvXXX flags too ? Or -mvis/etc... ?
+
+ local cpu
+ case ${CTARGET} in
+ sparc64-*)
+ case $(get-flag mcpu) in
+ niagara[234])
+ if version_is_at_least 2.8 ; then
+ cpu="sparc64v2"
+ elif version_is_at_least 2.4 ; then
+ cpu="sparc64v"
+ elif version_is_at_least 2.2.3 ; then
+ cpu="sparc64b"
+ fi
+ ;;
+ niagara)
+ if version_is_at_least 2.4 ; then
+ cpu="sparc64v"
+ elif version_is_at_least 2.2.3 ; then
+ cpu="sparc64b"
+ fi
+ ;;
+ ultrasparc3)
+ cpu="sparc64b"
+ ;;
+ *)
+ # We need to force at least v9a because the base build doesn't
+ # work with just v9.
+ # https://sourceware.org/bugzilla/show_bug.cgi?id=19477
+ [[ -z ${cpu} ]] && append-flags "-Wa,-xarch=v9a"
+ ;;
+ esac
+ ;;
+ sparc-*)
+ case $(get-flag mcpu) in
+ niagara[234])
+ if version_is_at_least 2.8 ; then
+ cpu="sparcv9v2"
+ elif version_is_at_least 2.4 ; then
+ cpu="sparcv9v"
+ elif version_is_at_least 2.2.3 ; then
+ cpu="sparcv9b"
+ else
+ cpu="sparcv9"
+ fi
+ ;;
+ niagara)
+ if version_is_at_least 2.4 ; then
+ cpu="sparcv9v"
+ elif version_is_at_least 2.2.3 ; then
+ cpu="sparcv9b"
+ else
+ cpu="sparcv9"
+ fi
+ ;;
+ ultrasparc3)
+ cpu="sparcv9b"
+ ;;
+ v9|ultrasparc)
+ cpu="sparcv9"
+ ;;
+ v8|supersparc|hypersparc|leon|leon3)
+ cpu="sparcv8"
+ ;;
+ esac
+ ;;
+ esac
+ [[ -n ${cpu} ]] && CTARGET_OPT="${cpu}-${CTARGET#*-}"
+ ;;
+ esac
+}
+
+setup_flags() {
+ # Make sure host make.conf doesn't pollute us
+ if is_crosscompile || tc-is-cross-compiler ; then
+ CHOST=${CTARGET} strip-unsupported-flags
+ fi
+
+ # Store our CFLAGS because it's changed depending on which CTARGET
+ # we are building when pulling glibc on a multilib profile
+ CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
+ CFLAGS=${CFLAGS_BASE}
+ CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}}
+ CXXFLAGS=${CXXFLAGS_BASE}
+ ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
+ ASFLAGS=${ASFLAGS_BASE}
+
+ # Over-zealous CFLAGS can often cause problems. What may work for one
+ # person may not work for another. To avoid a large influx of bugs
+ # relating to failed builds, we strip most CFLAGS out to ensure as few
+ # problems as possible.
+ strip-flags
+ strip-unsupported-flags
+ filter-flags -m32 -m64 '-mabi=*'
+
+ # glibc aborts if rpath is set by LDFLAGS
+ filter-ldflags '-Wl,-rpath=*'
+
+ # #492892
+ filter-flags -frecord-gcc-switches
+
+ unset CBUILD_OPT CTARGET_OPT
+ if use multilib ; then
+ CTARGET_OPT=$(get_abi_CTARGET)
+ [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
+ fi
+
+ setup_target_flags
+
+ if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
+ CBUILD_OPT=${CTARGET_OPT}
+ fi
+
+ # Lock glibc at -O2; we want to be conservative here.
+ # -fno-strict-aliasing is to work around #155906.
+ filter-flags '-O?'
+ append-flags -O2 -fno-strict-aliasing
+
+ filter-flags '-fstack-protector*'
+
+ # Starting with gcc-6 (and fully upstreamed pie patches) we control
+ # default enabled/disabled pie via use flags. So nothing to do
+ # here then. #618160
+ if [[ $(gcc-major-version) -lt 6 ]]; then
+ if use hardened && tc-enables-pie ; then
+ # Force PIC macro definition for all compilations since they're all
+ # either -fPIC or -fPIE with the default-PIE compiler.
+ append-cppflags -DPIC
+ else
+ # Don't build -fPIE without the default-PIE compiler and the
+ # hardened-pie patch
+ filter-flags -fPIE
+ fi
+ fi
+}
+
+want_tls() {
+ # Archs that can use TLS (Thread Local Storage)
+ case $(tc-arch) in
+ x86)
+ # requires i486 or better #106556
+ [[ ${CTARGET} == i[4567]86* ]] && return 0
+ return 1
+ ;;
+ esac
+ return 0
+}
+
+want__thread() {
+ want_tls || return 1
+
+ # For some reason --with-tls --with__thread is causing segfaults on sparc32.
+ [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
+
+ [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
+
+ # only test gcc -- can't test linking yet
+ tc-has-tls -c ${CTARGET}
+ WANT__THREAD=$?
+
+ return ${WANT__THREAD}
+}
+
+use_multiarch() {
+ # Allow user to disable runtime arch detection in multilib.
+ use multiarch || return 1
+ # Make sure binutils is new enough to support indirect functions,
+ # #336792. This funky sed supports gold and bfd linkers.
+ local bver nver
+ bver=$($(tc-getLD ${CTARGET}) -v | sed -n -r '1{s:[^0-9]*::;s:^([0-9.]*).*:\1:;p}')
+ case $(tc-arch ${CTARGET}) in
+ amd64|x86) nver="2.20" ;;
+ arm) nver="2.22" ;;
+ hppa) nver="2.23" ;;
+ ppc|ppc64) nver="2.20" ;;
+ # ifunc support was added in 2.23, but glibc also needs
+ # machinemode which is in 2.24.
+ s390) nver="2.24" ;;
+ sparc) nver="2.21" ;;
+ *) return 1 ;;
+ esac
+ version_is_at_least ${nver} ${bver}
+}
+
+# Setup toolchain variables that had historically been defined in the
+# profiles for these archs.
+setup_env() {
+ # silly users
+ unset LD_RUN_PATH
+ unset LD_ASSUME_KERNEL
+
+ if is_crosscompile || tc-is-cross-compiler ; then
+ multilib_env ${CTARGET_OPT:-${CTARGET}}
+
+ if ! use multilib ; then
+ MULTILIB_ABIS=${DEFAULT_ABI}
+ else
+ MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
+ fi
+
+ # If the user has CFLAGS_<CTARGET> in their make.conf, use that,
+ # and fall back on CFLAGS.
+ local VAR=CFLAGS_${CTARGET//[-.]/_}
+ CFLAGS=${!VAR-${CFLAGS}}
+ einfo " $(printf '%15s' 'Manual CFLAGS:') ${CFLAGS}"
+ fi
+
+ setup_flags
+
+ export ABI=${ABI:-${DEFAULT_ABI:-default}}
+
+ if use headers-only ; then
+ # Avoid mixing host's CC and target's CFLAGS_${ABI}:
+ # At this bootstrap stage we have only binutils for
+ # target but not compiler yet.
+ einfo "Skip CC ABI injection. We can't use (cross-)compiler yet."
+ return 0
+ fi
+ local VAR=CFLAGS_${ABI}
+ # We need to export CFLAGS with abi information in them because glibc's
+ # configure script checks CFLAGS for some targets (like mips). Keep
+ # around the original clean value to avoid appending multiple ABIs on
+ # top of each other.
+ : ${__GLIBC_CC:=$(tc-getCC ${CTARGET_OPT:-${CTARGET}})}
+ export __GLIBC_CC CC="${__GLIBC_CC} ${!VAR}"
+ einfo " $(printf '%15s' 'Manual CC:') ${CC}"
+}
+
+foreach_abi() {
+ setup_env
+
+ local ret=0
+ local abilist=""
+ if use multilib ; then
+ abilist=$(get_install_abis)
+ else
+ abilist=${DEFAULT_ABI}
+ fi
+ local -x ABI
+ for ABI in ${abilist:-default} ; do
+ setup_env
+ einfo "Running $1 for ABI ${ABI}"
+ $1
+ : $(( ret |= $? ))
+ done
+ return ${ret}
+}
+
+glibc_banner() {
+ local b="Gentoo ${PVR}"
+ [[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" p${PATCH_VER}"
+ echo "${b}"
+}
+
+check_devpts() {
+ # Make sure devpts is mounted correctly for use w/out setuid pt_chown.
+
+ # If merely building the binary package, then there's nothing to verify.
+ [[ ${MERGE_TYPE} == "buildonly" ]] && return
+
+ # Only sanity check when installing the native glibc.
+ [[ ${ROOT} != "/" ]] && return
+
+ # If they're opting in to the old suid code, then no need to check.
+ use suid && return
+
+ if awk '$3 == "devpts" && $4 ~ /[, ]gid=5[, ]/ { exit 1 }' /proc/mounts ; then
+ eerror "In order to use glibc with USE=-suid, you must make sure that"
+ eerror "you have devpts mounted at /dev/pts with the gid=5 option."
+ eerror "Openrc should do this for you, so you should check /etc/fstab"
+ eerror "and make sure you do not have any invalid settings there."
+ die "mount & fix your /dev/pts settings"
+ fi
+}
+
+# The following Kernel version handling functions are mostly copied from portage
+# source. It's better not to use linux-info.eclass here since a) it adds too
+# much magic, see bug 326693 for some of the arguments, and b) some of the
+# functions are just not provided.
+
+g_get_running_KV() {
+ uname -r
+ return $?
+}
+
+g_KV_major() {
+ [[ -z $1 ]] && return 1
+ local KV=$@
+ echo "${KV%%.*}"
+}
+
+g_KV_minor() {
+ [[ -z $1 ]] && return 1
+ local KV=$@
+ KV=${KV#*.}
+ echo "${KV%%.*}"
+}
+
+g_KV_micro() {
+ [[ -z $1 ]] && return 1
+ local KV=$@
+ KV=${KV#*.*.}
+ echo "${KV%%[^[:digit:]]*}"
+}
+
+g_KV_to_int() {
+ [[ -z $1 ]] && return 1
+ local KV_MAJOR=$(g_KV_major "$1")
+ local KV_MINOR=$(g_KV_minor "$1")
+ local KV_MICRO=$(g_KV_micro "$1")
+ local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO ))
+
+ # We make version 2.2.0 the minimum version we will handle as
+ # a sanity check ... if its less, we fail ...
+ if [[ ${KV_int} -ge 131584 ]] ; then
+ echo "${KV_int}"
+ return 0
+ fi
+ return 1
+}
+
+g_int_to_KV() {
+ local version=$1 major minor micro
+ major=$((version / 65536))
+ minor=$(((version % 65536) / 256))
+ micro=$((version % 256))
+ echo ${major}.${minor}.${micro}
+}
+
+eend_KV() {
+ [[ $(g_KV_to_int $1) -ge $(g_KV_to_int $2) ]]
+ eend $?
+}
+
+get_kheader_version() {
+ printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \
+ $(tc-getCPP ${CTARGET}) -I "${EPREFIX}/$(alt_build_headers)" - | \
+ tail -n 1
+}
+
+# We collect all sanity checks here. Consistency is not guranteed between
+# pkg_ and src_ phases, so we call this function both in pkg_pretend and in
+# src_unpack.
+sanity_prechecks() {
+ # Make sure devpts is mounted correctly for use w/out setuid pt_chown
+ check_devpts
+
+ # Prevent native builds from downgrading
+ if [[ ${MERGE_TYPE} != "buildonly" ]] && \
+ [[ ${ROOT} == "/" ]] && \
+ [[ ${CBUILD} == ${CHOST} ]] && \
+ [[ ${CHOST} == ${CTARGET} ]] ; then
+
+ # The high rev # is to allow people to downgrade between -r#
+ # versions. We want to block 2.20->2.19, but 2.20-r3->2.20-r2
+ # should be fine. Hopefully we never actually use a r# this
+ # high.
+ if has_version ">${CATEGORY}/${P}-r10000" ; then
+ eerror "Sanity check to keep you from breaking your system:"
+ eerror " Downgrading glibc is not supported and a sure way to destruction."
+ die "Aborting to save your system."
+ fi
+
+ if ! do_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' ; then
+ eerror "Your old kernel is broken. You need to update it to a newer"
+ eerror "version as syscall(<bignum>) will break. See bug 279260."
+ die "Old and broken kernel."
+ fi
+ fi
+
+ # Users have had a chance to phase themselves, time to give em the boot
+ if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
+ eerror "You still haven't deleted ${EROOT}/etc/locales.build."
+ eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
+ die "Lazy upgrader detected"
+ fi
+
+ if [[ ${CTARGET} == i386-* ]] ; then
+ eerror "i386 CHOSTs are no longer supported."
+ eerror "Chances are you don't actually want/need i386."
+ eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml"
+ die "Please fix your CHOST"
+ fi
+
+ if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
+ ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
+ ewarn "This will result in a 50% performance penalty when running with a 32bit"
+ ewarn "hypervisor, which is probably not what you want."
+ fi
+
+ use hardened && ! tc-enables-pie && \
+ ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
+
+ # Check for sanity of /etc/nsswitch.conf
+ if [[ -e ${EROOT}/etc/nsswitch.conf ]] ; then
+ local entry
+ for entry in passwd group shadow; do
+ if ! egrep -q "^[ \t]*${entry}:.*files" "${EROOT}"/etc/nsswitch.conf; then
+ eerror "Your ${EROOT}/etc/nsswitch.conf is out of date."
+ eerror "Please make sure you have 'files' entries for"
+ eerror "'passwd:', 'group:' and 'shadow:' databases."
+ eerror "For more details see:"
+ eerror " https://wiki.gentoo.org/wiki/Project:Toolchain/nsswitch.conf_in_glibc-2.26"
+ die "nsswitch.conf has no 'files' provider in '${entry}'."
+ fi
+ done
+ fi
+
+ # ABI-specific checks follow here. Hey, we have a lot more specific conditions that
+ # we test for...
+ if ! is_crosscompile ; then
+ if use amd64 && use multilib && [[ ${MERGE_TYPE} != "binary" ]] ; then
+ ebegin "Checking that IA32 emulation is enabled in the running kernel"
+ echo 'int main(){return 0;}' > "${T}/check-ia32-emulation.c"
+ local STAT
+ if "${CC-${CHOST}-gcc}" ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32"; then
+ "${T}/check-ia32-emulation.elf32"
+ STAT=$?
+ else
+ # Don't fail here to allow single->multi ABI switch
+ # or recover from breakage like bug #646424
+ ewarn "Failed to compile the ABI test. Broken host glibc?"
+ STAT=0
+ fi
+ rm -f "${T}/check-ia32-emulation.elf32"
+ eend $STAT
+ [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION must be enabled in the kernel to compile a multilib glibc."
+ fi
+
+ fi
+
+ # When we actually have to compile something...
+ if ! just_headers ; then
+ ebegin "Checking gcc for __thread support"
+ if ! eend $(want__thread ; echo $?) ; then
+ echo
+ eerror "Could not find a gcc that supports the __thread directive!"
+ eerror "Please update your binutils/gcc and try again."
+ die "No __thread support in gcc!"
+ fi
+
+ if [[ ${CTARGET} == *-linux* ]] ; then
+ local run_kv build_kv want_kv
+
+ run_kv=$(g_get_running_KV)
+ build_kv=$(g_int_to_KV $(get_kheader_version))
+ want_kv=${MIN_KERN_VER}
+
+ if ! is_crosscompile && ! tc-is-cross-compiler ; then
+ # Building fails on an non-supporting kernel
+ ebegin "Checking running kernel version (${run_kv} >= ${want_kv})"
+ if ! eend_KV ${run_kv} ${want_kv} ; then
+ echo
+ eerror "You need a kernel of at least ${want_kv}!"
+ die "Kernel version too low!"
+ fi
+ fi
+
+ ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})"
+ if ! eend_KV ${build_kv} ${want_kv} ; then
+ echo
+ eerror "You need linux-headers of at least ${want_kv}!"
+ die "linux-headers version too low!"
+ fi
+ fi
+ fi
+}
+
+#
+# the phases
+#
+
+# pkg_pretend
+
+pkg_pretend() {
+ # All the checks...
+ einfo "Checking general environment sanity."
+ sanity_prechecks
+}
+
+# src_unpack
+
+src_unpack() {
+ # Consistency is not guaranteed between pkg_ and src_ ...
+ sanity_prechecks
+
+ use multilib && unpack gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz
+
+ setup_env
+
+ if [[ -n ${EGIT_REPO_URI} ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${P}.tar.xz
+ fi
+
+ cd "${S}" || die
+ touch locale/C-translit.h || die #185476 #218003
+
+ cd "${WORKDIR}" || die
+ unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz
+}
+
+src_prepare() {
+ if ! use vanilla ; then
+ elog "Applying Gentoo Glibc Patchset ${RELEASE_VER}-${PATCH_VER}"
+ eapply "${WORKDIR}"/patches
+ einfo "Done."
+ fi
+
+ default
+
+ gnuconfig_update
+
+ cd "${WORKDIR}"
+ find . -name configure -exec touch {} +
+
+ eprefixify extra/locale/locale-gen
+
+ # Fix permissions on some of the scripts.
+ chmod u+x "${S}"/scripts/*.sh
+
+ cd "${S}"
+}
+
+glibc_do_configure() {
+ # Glibc does not work with gold (for various reasons) #269274.
+ tc-ld-disable-gold
+
+ # CXX isnt handled by the multilib system, so if we dont unset here
+ # we accumulate crap across abis
+ unset CXX
+
+ einfo "Configuring glibc for nptl"
+
+ if use doc ; then
+ export MAKEINFO=makeinfo
+ else
+ export MAKEINFO=/dev/null
+ fi
+
+ local v
+ for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO ; do
+ einfo " $(printf '%15s' ${v}:) ${!v}"
+ done
+
+ # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760
+ # To build .S (assembly) files with the same ABI-specific flags
+ # upstream currently recommends adding CFLAGS to CC/CXX:
+ # https://sourceware.org/PR23273
+ # Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS
+ # and breaks multiarch support. See 659030#c3 for an example.
+ # The glibc configure script doesn't properly use LDFLAGS all the time.
+ export CC="$(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS}"
+ einfo " $(printf '%15s' 'Manual CC:') ${CC}"
+
+ # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
+ export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS) ${CFLAGS}"
+ einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
+
+ echo
+
+ local myconf=()
+
+ case ${CTARGET} in
+ powerpc-*)
+ # Currently gcc on powerpc32 generates invalid code for
+ # __builtin_return_address(0) calls. Normally programs
+ # don't do that but malloc hooks in glibc do:
+ # https://gcc.gnu.org/PR81996
+ # https://bugs.gentoo.org/629054
+ myconf+=( --enable-stack-protector=no )
+ ;;
+ *)
+ myconf+=( --enable-stack-protector=all )
+ ;;
+ esac
+ myconf+=( --enable-stackguard-randomization )
+
+ # Keep a whitelist of targets supporing IFUNC. glibc's ./configure
+ # is not robust enough to detect proper support:
+ # https://bugs.gentoo.org/641216
+ # https://sourceware.org/PR22634#c0
+ case $(tc-arch ${CTARGET}) in
+ # Keep whitelist of targets where autodetection mostly works.
+ amd64|x86|sparc|ppc|ppc64|arm|arm64|s390) ;;
+ # Blacklist everywhere else
+ *) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;;
+ esac
+
+ # Enable Intel Control-flow Enforcement Technology on amd64 if requested
+ case ${CTARGET} in
+ x86_64-*) myconf+=( $(use_enable cet) ) ;;
+ *) ;;
+ esac
+
+ [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp )
+
+ myconf+=( --enable-kernel=${MIN_KERN_VER} )
+
+ # Since SELinux support is only required for nscd, only enable it if:
+ # 1. USE selinux
+ # 2. only for the primary ABI on multilib systems
+ # 3. Not a crosscompile
+ if ! is_crosscompile && use selinux ; then
+ if use multilib ; then
+ if is_final_abi ; then
+ myconf+=( --with-selinux )
+ else
+ myconf+=( --without-selinux )
+ fi
+ else
+ myconf+=( --with-selinux )
+ fi
+ else
+ myconf+=( --without-selinux )
+ fi
+
+ # Force a few tests where we always know the answer but
+ # configure is incapable of finding it.
+ if is_crosscompile ; then
+ export \
+ libc_cv_c_cleanup=yes \
+ libc_cv_forced_unwind=yes
+ fi
+
+ myconf+=(
+ --without-cvs
+ --disable-werror
+ --enable-bind-now
+ --build=${CBUILD_OPT:-${CBUILD}}
+ --host=${CTARGET_OPT:-${CTARGET}}
+ $(use_enable profile)
+ $(use_with gd)
+ --with-headers=$(alt_build_headers)
+ --prefix="${EPREFIX}/usr"
+ --sysconfdir="${EPREFIX}/etc"
+ --localstatedir="${EPREFIX}/var"
+ --libdir='$(prefix)'/$(get_libdir)
+ --mandir='$(prefix)'/share/man
+ --infodir='$(prefix)'/share/info
+ --libexecdir='$(libdir)'/misc/glibc
+ --with-bugurl=https://bugs.gentoo.org/
+ --with-pkgversion="$(glibc_banner)"
+ $(use_multiarch || echo --disable-multi-arch)
+ $(use_enable systemtap)
+ $(use_enable nscd)
+ ${EXTRA_ECONF}
+ )
+
+ # We rely on sys-libs/timezone-data for timezone tools normally.
+ myconf+=( $(use_enable vanilla timezone-tools) )
+
+ # These libs don't have configure flags.
+ ac_cv_lib_audit_audit_log_user_avc_message=$(usex audit || echo no)
+ ac_cv_lib_cap_cap_init=$(usex caps || echo no)
+
+ # There is no configure option for this and we need to export it
+ # since the glibc build will re-run configure on itself
+ export libc_cv_rootsbindir="${EPREFIX}/sbin"
+ export libc_cv_slibdir="${EPREFIX}/$(get_libdir)"
+
+ # We take care of patching our binutils to use both hash styles,
+ # and many people like to force gnu hash style only, so disable
+ # this overriding check. #347761
+ export libc_cv_hashstyle=no
+
+ local builddir=$(builddir nptl)
+ mkdir -p "${builddir}"
+ cd "${builddir}"
+ set -- "${S}"/configure "${myconf[@]}"
+ echo "$@"
+ "$@" || die "failed to configure glibc"
+
+ # ia64 static cross-compilers are a pita in so much that they
+ # can't produce static ELFs (as the libgcc.a is broken). so
+ # disable building of the programs for those targets if it
+ # doesn't work.
+ # XXX: We could turn this into a compiler test, but ia64 is
+ # the only one that matters, so this should be fine for now.
+ if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then
+ sed -i '1i+link-static = touch $@' config.make
+ fi
+
+ # If we're trying to migrate between ABI sets, we need
+ # to lie and use a local copy of gcc. Like if the system
+ # is built with MULTILIB_ABIS="amd64 x86" but we want to
+ # add x32 to it, gcc/glibc don't yet support x32.
+ #
+ if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib ; then
+ echo 'main(){}' > "${T}"/test.c
+ if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then
+ sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die
+ fi
+ fi
+}
+
+glibc_headers_configure() {
+ export ABI=default
+
+ local builddir=$(builddir "headers")
+ mkdir -p "${builddir}"
+ cd "${builddir}"
+
+ # if we don't have a compiler yet, we can't really test it now ...
+ # hopefully they don't affect header generation, so let's hope for
+ # the best here ...
+ local v vars=(
+ ac_cv_header_cpuid_h=yes
+ libc_cv_{386,390,alpha,arm,hppa,ia64,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes
+ libc_cv_asm_cfi_directives=yes
+ libc_cv_broken_visibility_attribute=no
+ libc_cv_c_cleanup=yes
+ libc_cv_compiler_powerpc64le_binary128_ok=yes
+ libc_cv_forced_unwind=yes
+ libc_cv_gcc___thread=yes
+ libc_cv_mlong_double_128=yes
+ libc_cv_mlong_double_128ibm=yes
+ libc_cv_ppc_machine=yes
+ libc_cv_ppc_rel16=yes
+ libc_cv_predef_fortify_source=no
+ libc_cv_target_power8_ok=yes
+ libc_cv_visibility_attribute=yes
+ libc_cv_z_combreloc=yes
+ libc_cv_z_execstack=yes
+ libc_cv_z_initfirst=yes
+ libc_cv_z_nodelete=yes
+ libc_cv_z_nodlopen=yes
+ libc_cv_z_relro=yes
+ libc_mips_abi=${ABI}
+ libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard)
+ # These libs don't have configure flags.
+ ac_cv_lib_audit_audit_log_user_avc_message=no
+ ac_cv_lib_cap_cap_init=no
+ )
+
+ einfo "Forcing cached settings:"
+ for v in "${vars[@]}" ; do
+ einfo " ${v}"
+ export ${v}
+ done
+
+ local headers_only_arch_CPPFLAGS=()
+
+ # Blow away some random CC settings that screw things up. #550192
+ if [[ -d ${S}/sysdeps/mips ]]; then
+ pushd "${S}"/sysdeps/mips >/dev/null
+ sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die
+ sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die
+
+ # Force the mips ABI to the default. This is OK because the set of
+ # installed headers in this phase is the same between the 3 ABIs.
+ # If this ever changes, this hack will break, but that's unlikely
+ # as glibc discourages that behavior.
+ # https://crbug.com/647033
+ sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die
+
+ popd >/dev/null
+ fi
+
+ case ${CTARGET} in
+ riscv*)
+ # RISC-V interrogates the compiler to determine which target to
+ # build. If building the headers then we don't strictly need a
+ # RISC-V compiler, so the built-in definitions that are provided
+ # along with all RISC-V compiler might not exist. This causes
+ # glibc's RISC-V preconfigure script to blow up. Since we're just
+ # building the headers any value will actually work here, so just
+ # pick the standard one (rv64g/lp64d) to make the build scripts
+ # happy for now -- the headers are all the same anyway so it
+ # doesn't matter.
+ headers_only_arch_CPPFLAGS+=(
+ -D__riscv_xlen=64
+ -D__riscv_flen=64
+ -D__riscv_float_abi_double=1
+ -D__riscv_atomic=1
+ ) ;;
+ esac
+
+ local myconf=()
+ myconf+=(
+ --disable-sanity-checks
+ --enable-hacker-mode
+ --without-cvs
+ --disable-werror
+ --enable-bind-now
+ --build=${CBUILD_OPT:-${CBUILD}}
+ --host=${CTARGET_OPT:-${CTARGET}}
+ --with-headers=$(alt_build_headers)
+ --prefix="${EPREFIX}/usr"
+ ${EXTRA_ECONF}
+ )
+
+ # Nothing is compiled here which would affect the headers for the target.
+ # So forcing CC/CFLAGS is sane.
+ local headers_only_CC=$(tc-getBUILD_CC)
+ local headers_only_CFLAGS="-O1 -pipe"
+ local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}"
+ local headers_only_LDFLAGS=""
+ set -- "${S}"/configure "${myconf[@]}"
+ echo \
+ "CC=${headers_only_CC}" \
+ "CFLAGS=${headers_only_CFLAGS}" \
+ "CPPFLAGS=${headers_only_CPPFLAGS}" \
+ "LDFLAGS=${headers_only_LDFLAGS}" \
+ "$@"
+ CC=${headers_only_CC} \
+ CFLAGS=${headers_only_CFLAGS} \
+ CPPFLAGS=${headers_only_CPPFLAGS} \
+ LDFLAGS="" \
+ "$@" || die "failed to configure glibc"
+}
+
+do_src_configure() {
+ if just_headers ; then
+ glibc_headers_configure
+ else
+ glibc_do_configure nptl
+ fi
+}
+
+src_configure() {
+ foreach_abi do_src_configure
+}
+
+do_src_compile() {
+ emake -C "$(builddir nptl)" || die "make nptl for ${ABI} failed"
+}
+
+src_compile() {
+ if just_headers ; then
+ return
+ fi
+
+ foreach_abi do_src_compile
+}
+
+glibc_src_test() {
+ cd "$(builddir nptl)"
+ emake check
+}
+
+do_src_test() {
+ local ret=0
+
+ glibc_src_test
+ : $(( ret |= $? ))
+
+ return ${ret}
+}
+
+src_test() {
+ if just_headers ; then
+ return
+ fi
+
+ # Give tests more time to complete.
+ export TIMEOUTFACTOR=5
+
+ foreach_abi do_src_test || die "tests failed"
+}
+
+run_locale_gen() {
+ # if the host locales.gen contains no entries, we'll install everything
+ local root="$1"
+ local locale_list="${root}/etc/locale.gen"
+ if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
+ ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
+ locale_list="${root}/usr/share/i18n/SUPPORTED"
+ fi
+
+ locale-gen --jobs $(makeopts_jobs) --config "${locale_list}" \
+ --destdir "${root}"
+}
+
+glibc_do_src_install() {
+ local builddir=$(builddir nptl)
+ cd "${builddir}"
+
+ emake install_root="${D}$(alt_prefix)" install || die
+
+ # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support
+ # which come without headers etc. Only needed for binary packages since the
+ # external net-libs/libnsl has increased soversion. Keep only versioned libraries.
+ find "${D}" -name "libnsl.a" -delete
+ find "${D}" -name "libnsl.so" -delete
+
+ # Normally upstream_pv is ${PV}. Live ebuilds are exception, there we need
+ # to infer upstream version:
+ # '#define VERSION "2.26.90"' -> '2.26.90'
+ local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
+
+ if [[ -e ${ED}$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
+ # Move versioned .a file out of libdir to evade portage QA checks
+ # instead of using gen_usr_ldscript(). We fix ldscript as:
+ # "GROUP ( /usr/lib64/libm-<pv>.a ..." -> "GROUP ( /usr/lib64/glibc-<pv>/libm-<pv>.a ..."
+ sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"$(alt_usrlibdir)/libm.a || die
+ dodir $(alt_usrlibdir)/${P}
+ mv "${ED}"$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die
+ fi
+
+ # We'll take care of the cache ourselves
+ rm -f "${ED}"/etc/ld.so.cache
+
+ # Everything past this point just needs to be done once ...
+ is_final_abi || return 0
+
+ # Make sure the non-native interp can be found on multilib systems even
+ # if the main library set isn't installed into the right place. Maybe
+ # we should query the active gcc for info instead of hardcoding it ?
+ local i ldso_abi ldso_name
+ local ldso_abi_list=(
+ # x86
+ amd64 /lib64/ld-linux-x86-64.so.2
+ x32 /libx32/ld-linux-x32.so.2
+ x86 /lib/ld-linux.so.2
+ # mips
+ o32 /lib/ld.so.1
+ n32 /lib32/ld.so.1
+ n64 /lib64/ld.so.1
+ # powerpc
+ ppc /lib/ld.so.1
+ ppc64 /lib64/ld64.so.1
+ # s390
+ s390 /lib/ld.so.1
+ s390x /lib/ld64.so.1
+ # sparc
+ sparc32 /lib/ld-linux.so.2
+ sparc64 /lib64/ld-linux.so.2
+ )
+ case $(tc-endian) in
+ little)
+ ldso_abi_list+=(
+ # arm
+ arm64 /lib/ld-linux-aarch64.so.1
+ )
+ ;;
+ big)
+ ldso_abi_list+=(
+ # arm
+ arm64 /lib/ld-linux-aarch64_be.so.1
+ )
+ ;;
+ esac
+ if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib
+ fi
+ for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do
+ ldso_abi=${ldso_abi_list[i]}
+ has ${ldso_abi} $(get_install_abis) || continue
+
+ ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}"
+ if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then
+ dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name}
+ fi
+ done
+
+ # With devpts under Linux mounted properly, we do not need the pt_chown
+ # binary to be setuid. This is because the default owners/perms will be
+ # exactly what we want.
+ if ! use suid ; then
+ find "${ED}" -name pt_chown -exec chmod -s {} +
+ fi
+
+ #################################################################
+ # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
+ # Make sure we install some symlink hacks 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
+ # We need to make sure that /lib and /usr/lib always exists.
+ # gcc likes to use relative paths to get to its multilibs like
+ # /usr/lib/../lib64/. So while we don't install any files into
+ # /usr/lib/, we do need it to exist.
+ keepdir $(alt_prefix)/lib
+ keepdir $(alt_prefix)/usr/lib
+
+ dosym usr/include $(alt_prefix)/sys-include
+ return 0
+ fi
+
+ # Files for Debian-style locale updating
+ dodir /usr/share/i18n
+ sed \
+ -e "/^#/d" \
+ -e "/SUPPORTED-LOCALES=/d" \
+ -e "s: \\\\::g" -e "s:/: :g" \
+ "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \
+ || die "generating /usr/share/i18n/SUPPORTED failed"
+ cd "${WORKDIR}"/extra/locale
+ dosbin locale-gen
+ doman *.[0-8]
+ insinto /etc
+ doins locale.gen
+
+ # Make sure all the ABI's can find the locales and so we only
+ # have to generate one set
+ local a
+ keepdir /usr/$(get_libdir)/locale
+ for a in $(get_install_abis) ; do
+ if [[ ! -e ${ED}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
+ dosym ../$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
+ fi
+ done
+
+ cd "${S}"
+
+ # Install misc network config files
+ insinto /etc
+ doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf
+ doins "${WORKDIR}"/extra/etc/*.conf
+
+ if use nscd ; then
+ doinitd "$(prefixify_ro "${WORKDIR}"/extra/etc/nscd)"
+
+ local nscd_args=(
+ -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
+ )
+
+ sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd
+
+ systemd_dounit nscd/nscd.service
+ systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf
+ else
+ # Do this since extra/etc/*.conf above might have nscd.conf.
+ rm -f "${ED}"/etc/nscd.conf
+ fi
+
+ echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
+ doenvd "${T}"/00glibc
+
+ for d in BUGS ChangeLog CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do
+ [[ -s ${d} ]] && dodoc ${d}
+ done
+ dodoc -r ChangeLog.old
+
+ # Prevent overwriting of the /etc/localtime symlink. We'll handle the
+ # creation of the "factory" symlink in pkg_postinst().
+ rm -f "${ED}"/etc/localtime
+
+ # Generate all locales if this is a native build as locale generation
+ if use compile-locales && ! is_crosscompile ; then
+ run_locale_gen "${ED}"
+ fi
+}
+
+glibc_headers_install() {
+ local builddir=$(builddir "headers")
+ cd "${builddir}"
+ emake install_root="${D}$(alt_prefix)" install-headers
+
+ insinto $(alt_headers)/gnu
+ doins "${S}"/include/gnu/stubs.h
+
+ # 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
+ dosym usr/include $(alt_prefix)/sys-include
+}
+
+src_strip() {
+ # gdb is lame and requires some debugging information to remain in
+ # libpthread, so we need to strip it by hand. libthread_db makes no
+ # sense stripped as it is only used when debugging.
+ local pthread=$(has splitdebug ${FEATURES} && echo "libthread_db" || echo "lib{pthread,thread_db}")
+ env \
+ -uRESTRICT \
+ CHOST=${CTARGET} \
+ STRIP_MASK="/*/{,tls/}${pthread}*" \
+ prepallstrip
+ # if user has stripping enabled and does not have split debug turned on,
+ # then leave the debugging sections in libpthread.
+ if ! has nostrip ${FEATURES} && ! has splitdebug ${FEATURES} ; then
+ ${STRIP:-${CTARGET}-strip} --strip-debug "${ED}"$(alt_prefix)/*/libpthread-*.so
+ fi
+}
+
+src_install() {
+ if just_headers ; then
+ export ABI=default
+ glibc_headers_install
+ return
+ fi
+
+ foreach_abi glibc_do_src_install
+ src_strip
+}
+
+# Simple test to make sure our new glibc isn't completely broken.
+# Make sure we don't test with statically built binaries since
+# they will fail. Also, skip if this glibc is a cross compiler.
+#
+# If coreutils is built with USE=multicall, some of these files
+# will just be wrapper scripts, not actual ELFs we can test.
+glibc_sanity_check() {
+ cd / #228809
+
+ # We enter ${ED} so to avoid trouble if the path contains
+ # special characters; for instance if the path contains the
+ # colon character (:), then the linker will try to split it
+ # and look for the libraries in an unexpected place. This can
+ # lead to unsafe code execution if the generated prefix is
+ # within a world-writable directory.
+ # (e.g. /var/tmp/portage:${HOSTNAME})
+ pushd "${ED}"/$(get_libdir) >/dev/null
+
+ local x striptest
+ for x in cal date env free ls true uname uptime ; do
+ x=$(type -p ${x})
+ [[ -z ${x} || ${x} != ${EPREFIX}/* ]] && continue
+ striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) || continue
+ case ${striptest} in
+ *"statically linked"*) continue;;
+ *"ASCII text"*) continue;;
+ esac
+ # We need to clear the locale settings as the upgrade might want
+ # incompatible locale data. This test is not for verifying that.
+ LC_ALL=C \
+ ./ld-*.so --library-path . ${x} > /dev/null \
+ || die "simple run test (${x}) failed"
+ done
+
+ popd >/dev/null
+}
+
+pkg_preinst() {
+ # nothing to do if just installing headers
+ just_headers && return
+
+ # prepare /etc/ld.so.conf.d/ for files
+ mkdir -p "${EROOT}"/etc/ld.so.conf.d
+
+ # Default /etc/hosts.conf:multi to on for systems with small dbs.
+ if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then
+ sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf
+ einfo "Defaulting /etc/host.conf:multi to on"
+ fi
+
+ [[ ${ROOT} != "/" ]] && return 0
+ [[ -d ${ED}/$(get_libdir) ]] || return 0
+ [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check
+}
+
+pkg_postinst() {
+ # nothing to do if just installing headers
+ just_headers && return
+
+ if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then
+ # Generate fastloading iconv module configuration file.
+ "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
+ fi
+
+ if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
+ # Reload init ... if in a chroot or a diff init package, ignore
+ # errors from this step #253697
+ /sbin/telinit U 2>/dev/null
+
+ use compile-locales || run_locale_gen "${EROOT}"
+ fi
+
+ # Check for sanity of /etc/nsswitch.conf, take 2
+ if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then
+ local entry
+ for entry in passwd group shadow; do
+ if egrep -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then
+ ewarn ""
+ ewarn "Your ${EROOT}/etc/nsswitch.conf uses NIS. Support for that has been"
+ ewarn "removed from glibc and is now provided by the package"
+ ewarn " sys-auth/libnss-nis"
+ ewarn "Install it now to keep your NIS setup working."
+ ewarn ""
+ fi
+ done
+ fi
+}
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index 4069c5f71ea1..8da63740e858 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -28,9 +28,9 @@ RELEASE_VER=${PV}
GCC_BOOTSTRAP_VER=20180511
# Gentoo patchset
-PATCH_VER=7
+PATCH_VER=8
-SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.bz2"
+SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
IUSE="audit caps cet compile-locales doc gd hardened headers-only +multiarch multilib nscd profile selinux suid systemtap test vanilla"
@@ -752,7 +752,7 @@ src_unpack() {
touch locale/C-translit.h || die #185476 #218003
cd "${WORKDIR}" || die
- unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
+ unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz
}
src_prepare() {
diff --git a/sys-libs/libutempter/Manifest b/sys-libs/libutempter/Manifest
index 5446c016a3fe..32ad4f36cb44 100644
--- a/sys-libs/libutempter/Manifest
+++ b/sys-libs/libutempter/Manifest
@@ -1,3 +1,3 @@
DIST libutempter-1.1.6.tar.bz2 15705 BLAKE2B 147bf96990913019c35565507eb635ba60ff5ed67134805e9f146f8f70882615ff96d7b2e52b40fb73110905afb87893a72bdec4327d879e5bdc2ec1d39ff9f0 SHA512 6ada410b981d157ae20b578de8ce20997ec0446ec6de6859549b080aa65976fc9900d211600dab09dc3d0d109daabad0994a648b093b8781b442ff26ca17fede
-EBUILD libutempter-1.1.6-r2.ebuild 1705 BLAKE2B 9a4119063b004d4efb0780968e24c07d2724ed42ebf022edcd28c688dd2c199236dcaf6614991b9579e621b605195cfd1c0071cefa0c5e13528e3f2b2cd2f243 SHA512 c137947e45a12ba756e68d84d3c713c83b7a06b3887d1598d1463e34189be00a7dbf8112cca55ada8879baf8a65aa8b8766191a4d79ef8d0d3680fa8eef8ef9e
+EBUILD libutempter-1.1.6-r2.ebuild 1701 BLAKE2B 8b4877016d23794374fb96067ae3e1dd32add78f7aaffa7978ec5ff3a32a3a620f9f503142cb8419044179cf30b7dfe9afd4212f789fb1f5cd0e902634afa0c7 SHA512 4831c68a45394cbc38ee84a5b62547eca87f989be444189670cc5493e76aafddf20b17c4e1ff099d8e8160da090a59c340fe73df3908b370badf9ba03eb1dfc2
MISC metadata.xml 344 BLAKE2B 090f0e14a3a7fec427cbffa3abc85b6caf242a4f471358ba0614a23682a183a2ac93fd4d6695ab0059b0c7e5573d8429ea4600506050753e2ceca3c1217c394a SHA512 77307533cb1ddb71561957493f7062330c1748f62ab1381f369c5fb864f0e2a6608cfa5c86005b816c2a9a2523bb9a2264c807f1d6c31a5e2bb6177876b94ed9
diff --git a/sys-libs/libutempter/libutempter-1.1.6-r2.ebuild b/sys-libs/libutempter/libutempter-1.1.6-r2.ebuild
index 0d3be4809b93..5e7ac7cbd6a8 100644
--- a/sys-libs/libutempter/libutempter-1.1.6-r2.ebuild
+++ b/sys-libs/libutempter/libutempter-1.1.6-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="4"
@@ -11,7 +11,7 @@ SRC_URI="ftp://ftp.altlinux.org/pub/people/ldv/${PN}/${P}.tar.bz2"
LICENSE="LGPL-2.1"
SLOT="0"
-KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux"
IUSE="static-libs elibc_FreeBSD"
RDEPEND="!sys-apps/utempter"
diff --git a/sys-libs/pam/Manifest b/sys-libs/pam/Manifest
index 9dd20048b65a..d0a194aa1733 100644
--- a/sys-libs/pam/Manifest
+++ b/sys-libs/pam/Manifest
@@ -5,6 +5,6 @@ DIST Linux-PAM-1.3.0-docs.tar.bz2 492805 BLAKE2B 1dd48f65ae76e0d4d2c02664f9a2ada
DIST Linux-PAM-1.3.0.tar.bz2 1302820 BLAKE2B 0ed5553308e8bc4bef91746a1c79db41bf5f0a48a31796d5a13819387c0a04d553efa210435273ad8565d0a53f354817bc3e0f254e35a5e75b7b7b586cad5d16 SHA512 4a89ca4b6f4676107aca4018f7c11addf03495266b209cb11c913f8b5d191d9a1f72197715dcf2a69216b4036de88780bcbbb5a8652e386910d71ba1b6282e42
DIST pam-1.3.1.tar.gz 749997 BLAKE2B 3b44c41daaa5810c53e3e2baeac1ab58463768fde433f874b9bd09c7c28cfd55e0f227c9a0c318e66444a3adb23c112a2db32d5c7211b07c84c2d4600a47ca5c SHA512 0c5019493b2ac42180ee9c4974a51329a2395a44f5f892c1ca567ec9b43cc3a9bce0212861d4dfb82eb236c5eaa682b27189ce672ed6cafa37d8801d059a944d
EBUILD pam-1.2.1-r2.ebuild 6111 BLAKE2B fe4c0f339a51a041932d25426845ab48b2d73789a17f950cb9a7bcbb13657677da3ebbf3f9f92a7ff91d1fcf106b54bd3a5403d212f1e3d7474367dbb8eb3045 SHA512 3024bdb42d6dba4831e3b7dc80b017184907422d34750c2895897fe6a066be139fa8b688d0f0874b6d788c54f680d29b532615ed10b3ab8e82984fc5a582d8af
-EBUILD pam-1.3.0-r2.ebuild 5989 BLAKE2B 1f81638ced909b267474c79bcee93a1dd0e417a8d14ea320cc928c6156f998dca1eaf1994042c6a5a3ee43354f21a963b238b21674d1c492ff2992a4829a297d SHA512 405d2f70877fa938e24f121121a653c0a4cef3abce8ee4770f18c2e0727b18588bd19687503460fcd59399a8a8d40527ac849c022adbe9e60c3d9c1b359334c3
+EBUILD pam-1.3.0-r2.ebuild 5987 BLAKE2B 532105561700adc457cf26b95d83fa89a8bc6a2694688335a1c16fc470f2e43460a9e3e490c2724fd4d142376c66a20033f1ebf68055fd769ca1ab0de88124d2 SHA512 a417c8a2710e6ccdfe60ea6a76dc9dc4a9d268afbdaea16f479b5587fcd0c08fa4e4ef147fba935f994d25fcce4df3b3dfb8722094701d6516b035bb834564f5
EBUILD pam-1.3.1.ebuild 3682 BLAKE2B ff4750e0a084a0ae199ca729eb08f47daef9747746f3889dba38460a4ec4fda67b7897f9e68897a140d1777f7e475d684ea78dabacf378961b2fca02942158ec SHA512 8b830ac4815d499c7773289bc470e95e2cc26717ab2103cf7fee1b7ad53eba905cde75f8bd449005a56f51022b1e02d18808546fb7eb538045ec09b65946ea98
MISC metadata.xml 1187 BLAKE2B 10a98ba0eb29e16429e80c982bbcfabf5e13d357c79dcd8c9b29edb78c95d640c24a0e6dd765c681c9a3e0d53236d8593fd60a023a15a368268b6cf857c74e0c SHA512 a259f44cac488c66bc07ac28448200251bfa9fa12d696bc6ba4e98456c2d96ae90236017d3c7cd9364c6b9a46e3742bb2c5fa995fe178d38453bcbbb58c527a2
diff --git a/sys-libs/pam/pam-1.3.0-r2.ebuild b/sys-libs/pam/pam-1.3.0-r2.ebuild
index 2c79c948e747..8c4a1274f905 100644
--- a/sys-libs/pam/pam-1.3.0-r2.ebuild
+++ b/sys-libs/pam/pam-1.3.0-r2.ebuild
@@ -15,7 +15,7 @@ SRC_URI="http://www.linux-pam.org/library/${MY_P}.tar.bz2
LICENSE="|| ( BSD GPL-2 )"
SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
IUSE="audit berkdb +cracklib debug nis nls +pie selinux test vim-syntax"
RDEPEND="
diff --git a/sys-libs/uclibc/Manifest b/sys-libs/uclibc/Manifest
deleted file mode 100644
index 8c1290f51547..000000000000
--- a/sys-libs/uclibc/Manifest
+++ /dev/null
@@ -1,6 +0,0 @@
-DIST uClibc-0.9.33.2-patches-17.tar.bz2 32437 BLAKE2B c051e8acf4f7d8da219918a5cd7b465865da7e64307b2a1c64b6b86f8381340edf03745301f0b3b358403d56712964c3d57f330b88a3e8ff2da22d898a35c909 SHA512 6a6ad8aef862f742e60965c447e5abee2349886f01bf5e44111b2a6c21e59e4644195cf36e85b8ce0dabbf7b92dc2c36ae27f0b7a02b0f9f4278e46ec5fb5a76
-DIST uClibc-0.9.33.2.tar.bz2 2834029 BLAKE2B a23e7b3a1a8142ef08349179e27f2d47765757829c2a88d4937d02314bc7c07bd36a21d815213f1478b24075bb029112738161bb1be383df08cec5e786aae260 SHA512 1cf18fe5418e12ae12ce995d7455d465bc4737f225afc49512ec69858771e099bead7b18408b01c7e6f845dcc80c3b4f875332eeffdcc04ae4b48474fb29a8dd
-EBUILD uclibc-0.9.33.2-r15.ebuild 9386 BLAKE2B ac8aa826c8b51d9bc6d3a54b35105af17fa3d735cbeeca5283ef1a6312aad80e405100af6078658b51037bbeba3a873846d6244753dcd8c08027eab2f56af19a SHA512 7bdf5a54c1fe8a781c655ec44a8b4f50f7f758b4b7547de0d2a44a2c321291282c427e6d140de581ebb471a377009eec77d8c27f432617b91863bb780ad37d1d
-EBUILD uclibc-0.9.33.9999.ebuild 9348 BLAKE2B 0889fa7e2bc7c86f5a461ad43bfde8b7968e3ab7624ee881da04b11000164f6586683095fcd0773eb6e47d195b48b041450999da67f226939c1ecef6a724fbf5 SHA512 f9f97e41563be062974547c6945c45716edf16433c308bee9593ee051e6fb0d5ce786348d76acc8318db7d48ed27e451eba16a121538ed658218503492938e34
-EBUILD uclibc-9999.ebuild 9329 BLAKE2B c833b8f34dd30ef29c0d843731ded7b8778b9a60c675b5e8c009ed82bd827a9ed3355b7fd613e99b7fa2655f49cefe04147b5b3075e4691a2c74231fb75b7ac7 SHA512 ea49b5e167e624328efa4a145183e500ac916a979216d38e7d642ee3aaad704da70cb0b957bb0161242ce3709d123d701664a43717e38cb172c5b09ff5ef41d8
-MISC metadata.xml 1388 BLAKE2B 2c031c5d87aefe90b83a2d0de01ee836b978bf1e89a8b16cbbf71acbc5366a57c3d15423a4beb6a6c51ad6adecc45731b949591fdf6faa5de7a6516ea04d5ce9 SHA512 59111cac2b1c0e2df5ed96d01e6913307915281c8d24019f5a12213dabd0621adfb52e87d344e1de484e1b6dd19014ce695f00b96f27ce26d7632e825863beeb
diff --git a/sys-libs/uclibc/metadata.xml b/sys-libs/uclibc/metadata.xml
deleted file mode 100644
index d5ebc1b71d8d..000000000000
--- a/sys-libs/uclibc/metadata.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="person">
- <email>blueness@gentoo.org</email>
- <name>Anthony G. Basile</name>
- </maintainer>
- <maintainer type="project">
- <email>embedded@gentoo.org</email>
- <name>Embedded Gentoo</name>
- </maintainer>
- <longdescription>
- uClibc pronounced yew-see-lib-see is a C library for developing embedded Linux
- systems. It is much smaller than the GNU C Library, but nearly all applications supported
- by glibc also work perfectly with uClibc. Porting applications from glibc to uClibc
- typically involves just recompiling the source code. uClibc even supports shared libraries
- and threading. It currently runs on standard Linux and MMU-less (also known as uClinux)
- systems with support for alpha, ARM, cris, i386, i960, h8300, m68k, mips/mipsel, PowerPC,
- SH, SPARC, and v850 processors.
- </longdescription>
- <use>
- <flag name="rpc">Enable sun nis/rpc support (you should use libtirpc though)</flag>
- <flag name="ssp">Force the use of ssp to be built into a hardened uclibc setup</flag>
- <flag name="savedconfig">Adds support for user defined configs</flag>
- <flag name="uclibc-compat">Build uclibc with backwards compatible options</flag>
- <flag name="wordexp">Add support for word expansion (wordexp.h)</flag>
- </use>
-</pkgmetadata>
diff --git a/sys-libs/uclibc/uclibc-0.9.33.2-r15.ebuild b/sys-libs/uclibc/uclibc-0.9.33.2-r15.ebuild
deleted file mode 100644
index 32bb54180854..000000000000
--- a/sys-libs/uclibc/uclibc-0.9.33.2-r15.ebuild
+++ /dev/null
@@ -1,355 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-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-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-MY_P=uClibc-${PV}
-DESCRIPTION="C library for developing embedded Linux systems"
-HOMEPAGE="https://www.uclibc.org/"
-if [[ ${PV} != "9999" ]] ; then
- PATCH_VER="17"
- SRC_URI="https://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 headers-only"
-RESTRICT="strip"
-
-# We cannot migrate between uclibc and uclibc-ng because as soon as portage
-# updates the ld.so sym link, the system breaks. Ideally this should be a
-# hard blocker, but EAPI=0 doesn't allow hard blockers.
-RDEPEND="!sys-libs/uclibc-ng"
-
-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 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
-}
-
-check_cpu_opts() {
- case ${CTARGET} in
- # Need to handle $ABI here w/mips.
- mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";;
- sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";;
- i[3456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";;
- # XXX: Should figure out how to handle sparc.
- esac
-
- if use nptl ; then
- case ${CTARGET} in
- i386*)
- die "Your target has no support for NPTL"
- ;;
- esac
- 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=(
- LDSO_GNU_HASH_SUPPORT
- 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_SHA256_CRYPT_IMPL
- UCLIBC_HAS_SHA512_CRYPT_IMPL
- 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
-
- epatch_user
-
- 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=$(tc-arch) config_target
- case ${target} in
- amd64) target="x86_64";;
- arm) target="arm"; config_target="GENERIC_ARM";;
- avr) target="avr32";;
- mips) target="mips"; config_target="MIPS_ISA_1";;
- ppc) target="powerpc";;
- sh) target="sh"; config_target="SH4";;
- x86) target="i386"; config_target="486";;
- esac
- if [[ -n ${config_target} ]] ; then
- sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
- extra/Configs/Config.${target} || die
- fi
- 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
-}
diff --git a/sys-libs/uclibc/uclibc-0.9.33.9999.ebuild b/sys-libs/uclibc/uclibc-0.9.33.9999.ebuild
deleted file mode 100644
index fbc8a60a1fc9..000000000000
--- a/sys-libs/uclibc/uclibc-0.9.33.9999.ebuild
+++ /dev/null
@@ -1,354 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-inherit eutils flag-o-matic multilib toolchain-funcs savedconfig
-if [[ ${PV} == *9999 ]] ; then
- EGIT_BRANCH="0.9.33"
- 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-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-MY_P=uClibc-${PV}
-DESCRIPTION="C library for developing embedded Linux systems"
-HOMEPAGE="https://www.uclibc.org/"
-if [[ ${PV} != *9999 ]] ; then
- PATCH_VER=""
- SRC_URI="https://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 headers-only"
-RESTRICT="strip"
-
-# We cannot migrate between uclibc and uclibc-ng because as soon as portage
-# updates the ld.so sym link, the system breaks. Ideally this should be a
-# hard blocker, but EAPI=0 doesn't allow hard blockers.
-RDEPEND="!sys-libs/uclibc-ng"
-
-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 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
-}
-
-check_cpu_opts() {
- case ${CTARGET} in
- # Need to handle $ABI here w/mips.
- mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";;
- sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";;
- i[3456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";;
- # XXX: Should figure out how to handle sparc.
- esac
-
- if use nptl ; then
- case ${CTARGET} in
- i386*)
- die "Your target has no support for NPTL"
- ;;
- esac
- 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=(
- LDSO_GNU_HASH_SUPPORT
- 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
-
- epatch_user
-
- 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=$(tc-arch) config_target
- case ${target} in
- amd64) target="x86_64";;
- arm) target="arm"; config_target="GENERIC_ARM";;
- avr) target="avr32";;
- mips) target="mips"; config_target="MIPS_ISA_1";;
- ppc) target="powerpc";;
- sh) target="sh"; config_target="SH4";;
- x86) target="i386"; config_target="486";;
- esac
- if [[ -n ${config_target} ]] ; then
- sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
- extra/Configs/Config.${target} || die
- fi
- 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
-}
diff --git a/sys-libs/uclibc/uclibc-9999.ebuild b/sys-libs/uclibc/uclibc-9999.ebuild
deleted file mode 100644
index f5cec3749e75..000000000000
--- a/sys-libs/uclibc/uclibc-9999.ebuild
+++ /dev/null
@@ -1,353 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-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-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-MY_P=uClibc-${PV}
-DESCRIPTION="C library for developing embedded Linux systems"
-HOMEPAGE="https://www.uclibc.org/"
-if [[ ${PV} != "9999" ]] ; then
- PATCH_VER=""
- SRC_URI="https://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 headers-only"
-RESTRICT="strip"
-
-# We cannot migrate between uclibc and uclibc-ng because as soon as portage
-# updates the ld.so sym link, the system breaks. Ideally this should be a
-# hard blocker, but EAPI=0 doesn't allow hard blockers.
-RDEPEND="!sys-libs/uclibc-ng"
-
-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 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
-}
-
-check_cpu_opts() {
- case ${CTARGET} in
- # Need to handle $ABI here w/mips.
- mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";;
- sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";;
- i[3456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";;
- # XXX: Should figure out how to handle sparc.
- esac
-
- if use nptl ; then
- case ${CTARGET} in
- i386*)
- die "Your target has no support for NPTL"
- ;;
- esac
- 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=(
- LDSO_GNU_HASH_SUPPORT
- 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
-
- epatch_user
-
- 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=$(tc-arch) config_target
- case ${target} in
- amd64) target="x86_64";;
- arm) target="arm"; config_target="GENERIC_ARM";;
- avr) target="avr32";;
- mips) target="mips"; config_target="MIPS_ISA_1";;
- ppc) target="powerpc";;
- sh) target="sh"; config_target="SH4";;
- x86) target="i386"; config_target="486";;
- esac
- if [[ -n ${config_target} ]] ; then
- sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
- extra/Configs/Config.${target} || die
- fi
- 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
-}