Gentoo Archives: gentoo-commits

From: "Andreas Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/
Date: Sun, 12 Nov 2017 14:16:46
Message-Id: 1510496128.99c7ef8fc9f4d90fc4b702713965efa909dd9bfc.dilfridge@gentoo
1 commit: 99c7ef8fc9f4d90fc4b702713965efa909dd9bfc
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 12 12:17:09 2017 +0000
4 Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 12 14:15:28 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99c7ef8f
7
8 sys-libs/glibc: Remove old
9
10 Package-Manager: Portage-2.3.13, Repoman-2.3.4
11
12 sys-libs/glibc/Manifest | 1 -
13 sys-libs/glibc/glibc-2.26-r2.ebuild | 796 ------------------------------------
14 2 files changed, 797 deletions(-)
15
16 diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
17 index b4f0de518fd..8a2c0db1f9b 100644
18 --- a/sys-libs/glibc/Manifest
19 +++ b/sys-libs/glibc/Manifest
20 @@ -19,7 +19,6 @@ DIST glibc-2.24.tar.xz 13554048 SHA256 99d4a3e8efd144d71488e478f62587578c0f4e1fa
21 DIST glibc-2.25-patches-11.tar.bz2 64221 SHA256 38c76c844238a7bbaecc85b359e67af6a98a1614f3196f25d85f83dec4358e99 SHA512 cbbbca9653f55f0cb3b73c38c979cb439c87b172819f3e999d2b435d59cd2bef2c89f11a398300c53f447ad433ee87f47a0f3e890c78f8694705c788455325dd WHIRLPOOL e61203ac129d7283f3beda1421e1365da58c229bcb6b6a1f8b71755d9ea0e2bfb64b8be69ab7698861a593d4b98ab6163d574f3c215fba0a0d9e6a1b15d2eed5
22 DIST glibc-2.25-patches-12.tar.bz2 65396 SHA256 60a8901ceab4066661285cdbf7559d3a1f66bf468c5c1a5ecdde7f8ead282d3e SHA512 6af8c304ba70b42dfda294873d9a138d6c98e7a46496e305b2cac99a085d1ad3d00315162d1e1458e651de95e158bd35be74406a3f44fde13182e30baa663fcb WHIRLPOOL 96684d379d65ca6e4da7d397d4b803e0b0516080223de86080d6bbf3cae6a17b9fc8922d6fc2071b3116f35136378d85eb6671c7d9f7cf0f2135b66d1573bb90
23 DIST glibc-2.25.tar.xz 13873900 SHA256 067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0 SHA512 5b7a2418d5b8a1b6a907c6c7fb6477ee2a473151cb45e03d0d4cdd9a33497c90b1ee39e2e7e885e2b25743dcd3747336ef114b4a73eb001da1fd79f29e0f9a6e WHIRLPOOL dc2fafaa4a0e5581268338453838a03ed0c5e7a2af844e8fb7086ab8d3ae48efbdbe6f25db1d089ae669cd2f8b0412f690d965506753d86f8525da2df59b7953
24 -DIST glibc-2.26-patches-2.tar.bz2 68040 SHA256 c40f03059d389fd8b22b54f83c0a669c44a38ee84cc359cb86d8f6dbdd1b957f SHA512 2b54d6e33b29d5ee5e4d4b64f299bf15e22ece5ce6555dafe43fd97ec8a2d9ef0645075ff24dc593ec6f89e02caf40c25a72af93ecd11113fba77268ccf486e2 WHIRLPOOL 59c54cdd2e3e64091dd206ad6b5ff467eff6c0d7f8ef5ab11504a4e6cfe958f762b9de2fbe8b6004a9e19963520a84a493ccf03908a78ea0a452dbc28e0df1e5
25 DIST glibc-2.26-patches-4.tar.bz2 315447 SHA256 2f49edd3a45bc5bb3c16f86228bfdeaba7e2b48b7eefad63e2ffa2ed3f6d628e SHA512 04d229e5f9342d62f2fce039c70489609886782d8aabd49403863a1a679e3b0890ca26c129088738a4af7ef6d95c74f24fb3c4d03695bf7ba6e45eca4de1a5f0 WHIRLPOOL 06b31af65b4f6092fa7b8776507cfdd014649670dae49c1d6a35ce61b3345d08acb9e09076a8cfe310ffe7d698d212310c8f497366c57240a463a31a39a175d9
26 DIST glibc-2.26.tar.xz 14682748 SHA256 e54e0a934cd2bc94429be79da5e9385898d2306b9eaf3c92d5a77af96190f6bd SHA512 6ed368523bc55f00976f96c5177f114e3f714b27273d7bffc252812c8b98fb81970403c1f5b5f0a61da678811532fb446530745492d2b49bfefc0d5bd71ce8c0 WHIRLPOOL 9091c3bccc9b590de6b9595aa391ba01091f0c301bd9199d7c48fbeaeeb013ec9c683c68b65b59c5a69e3905b7f842cca1b0a410431967ecb3a1229b8535486f
27 DIST glibc-9999-patches-3.tar.bz2 19892 SHA256 97f60ed6debd495610b123d7a27227e75942bea1a0fb1e5f78833a6f3bbe6c64 SHA512 75084b86a83d447d3a4b3959fa2a93d849e304ba9473ebec5570ca4fb5e2f8dfb38548faf3abc9fbd29b529f2c608b52eb2ef2e6e9a2ad5bea9a9298a19ef596 WHIRLPOOL 04a5c30aabf72530fa96fa3a8eadf8207d85d3a2a948ba5f4b72c0deeeae24e7eb71b99875f0e9b1018051fabb4a23630b41873fa4ff0d6ba9778ca6051212bf
28
29 diff --git a/sys-libs/glibc/glibc-2.26-r2.ebuild b/sys-libs/glibc/glibc-2.26-r2.ebuild
30 deleted file mode 100644
31 index 8b6e1b1520b..00000000000
32 --- a/sys-libs/glibc/glibc-2.26-r2.ebuild
33 +++ /dev/null
34 @@ -1,796 +0,0 @@
35 -# Copyright 1999-2017 Gentoo Foundation
36 -# Distributed under the terms of the GNU General Public License v2
37 -
38 -EAPI=6
39 -
40 -inherit prefix toolchain-glibc
41 -
42 -DESCRIPTION="GNU libc C library"
43 -HOMEPAGE="https://www.gnu.org/software/libc/"
44 -
45 -LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
46 -RESTRICT="strip" # Strip ourself #46186
47 -EMULTILIB_PKG="true"
48 -
49 -# Configuration variables
50 -
51 -if [[ ${PV} == 9999* ]]; then
52 - EGIT_REPO_URI="git://sourceware.org/git/glibc.git"
53 - inherit git-r3
54 -else
55 - # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
56 - KEYWORDS=""
57 - SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
58 -fi
59 -
60 -RELEASE_VER=${PV}
61 -
62 -GCC_BOOTSTRAP_VER="4.7.3-r1"
63 -
64 -# Gentoo patchset
65 -PATCH_VER=2
66 -
67 -SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.bz2"
68 -SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2 )"
69 -
70 -IUSE="audit caps debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
71 -
72 -# Min kernel version nptl requires
73 -: ${NPTL_KERN_VER:="2.6.32"}
74 -
75 -# Here's how the cross-compile logic breaks down ...
76 -# CTARGET - machine that will target the binaries
77 -# CHOST - machine that will host the binaries
78 -# CBUILD - machine that will build the binaries
79 -# If CTARGET != CHOST, it means you want a libc for cross-compiling.
80 -# If CHOST != CBUILD, it means you want to cross-compile the libc.
81 -# CBUILD = CHOST = CTARGET - native build/install
82 -# CBUILD != (CHOST = CTARGET) - cross-compile a native build
83 -# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
84 -# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
85 -# For install paths:
86 -# CHOST = CTARGET - install into /
87 -# CHOST != CTARGET - install into /usr/CTARGET/
88 -
89 -export CBUILD=${CBUILD:-${CHOST}}
90 -export CTARGET=${CTARGET:-${CHOST}}
91 -if [[ ${CTARGET} == ${CHOST} ]] ; then
92 - if [[ ${CATEGORY} == cross-* ]] ; then
93 - export CTARGET=${CATEGORY#cross-}
94 - fi
95 -fi
96 -
97 -is_crosscompile() {
98 - [[ ${CHOST} != ${CTARGET} ]]
99 -}
100 -
101 -SLOT="2.2"
102 -
103 -# General: We need a new-enough binutils/gcc to match upstream baseline.
104 -# arch: we need to make sure our binutils/gcc supports TLS.
105 -COMMON_DEPEND="
106 - nscd? ( selinux? (
107 - audit? ( sys-process/audit )
108 - caps? ( sys-libs/libcap )
109 - ) )
110 - suid? ( caps? ( sys-libs/libcap ) )
111 - selinux? ( sys-libs/libselinux )
112 - systemtap? ( dev-util/systemtap )
113 -"
114 -DEPEND="${COMMON_DEPEND}
115 - >=app-misc/pax-utils-0.1.10
116 - !<sys-apps/sandbox-1.6
117 - !<sys-apps/portage-2.1.2
118 -"
119 -RDEPEND="${COMMON_DEPEND}
120 - !sys-kernel/ps3-sources
121 - sys-apps/gentoo-functions
122 - !sys-libs/nss-db
123 -"
124 -
125 -if [[ ${CATEGORY} == cross-* ]] ; then
126 - DEPEND+=" !crosscompile_opts_headers-only? (
127 - >=${CATEGORY}/binutils-2.24
128 - >=${CATEGORY}/gcc-4.9
129 - )"
130 - [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
131 -else
132 - DEPEND+="
133 - >=sys-devel/binutils-2.24
134 - >=sys-devel/gcc-4.9
135 - virtual/os-headers
136 - "
137 - RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
138 - PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
139 -fi
140 -
141 -#
142 -# the phases
143 -#
144 -
145 -pkg_pretend() {
146 - # Make sure devpts is mounted correctly for use w/out setuid pt_chown
147 - check_devpts
148 -
149 - # Prevent native builds from downgrading
150 - if [[ ${MERGE_TYPE} != "buildonly" ]] && \
151 - [[ ${ROOT} == "/" ]] && \
152 - [[ ${CBUILD} == ${CHOST} ]] && \
153 - [[ ${CHOST} == ${CTARGET} ]] ; then
154 - # The high rev # is to allow people to downgrade between -r# versions.
155 - # We want to block 2.20->2.19, but 2.20-r3->2.20-r2 should be fine.
156 - # Hopefully we never actually use a r# this high.
157 - if has_version ">${CATEGORY}/${P}-r10000" ; then
158 - eerror "Sanity check to keep you from breaking your system:"
159 - eerror " Downgrading glibc is not supported and a sure way to destruction"
160 - die "Aborting to save your system"
161 - fi
162 -
163 - if ! glibc_run_test '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n'
164 - then
165 - eerror "Your patched vendor kernel is broken. You need to get an"
166 - eerror "update from whoever is providing the kernel to you."
167 - eerror "https://sourceware.org/bugzilla/show_bug.cgi?id=5227"
168 - eerror "https://bugs.gentoo.org/262698"
169 - die "Keeping your system alive, say thank you"
170 - fi
171 -
172 - if ! glibc_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n'
173 - then
174 - eerror "Your old kernel is broken. You need to update it to"
175 - eerror "a newer version as syscall(<bignum>) will break."
176 - eerror "https://bugs.gentoo.org/279260"
177 - die "Keeping your system alive, say thank you"
178 - fi
179 - fi
180 -
181 - # Users have had a chance to phase themselves, time to give em the boot
182 - if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
183 - eerror "You still haven't deleted ${EROOT}/etc/locales.build."
184 - eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
185 - die "Lazy upgrader detected"
186 - fi
187 -
188 - if [[ ${CTARGET} == i386-* ]] ; then
189 - eerror "i386 CHOSTs are no longer supported."
190 - eerror "Chances are you don't actually want/need i386."
191 - eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml"
192 - die "Please fix your CHOST"
193 - fi
194 -
195 - if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
196 - ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
197 - ewarn "This will result in a 50% performance penalty when running with a 32bit"
198 - ewarn "hypervisor, which is probably not what you want."
199 - fi
200 -
201 - use hardened && ! tc-enables-pie && \
202 - ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
203 -
204 - # Make sure host system is up to date #394453
205 - if has_version '<sys-libs/glibc-2.13' && \
206 - [[ -n $(scanelf -qys__guard -F'#s%F' "${EROOT}"/lib*/l*-*.so) ]]
207 - then
208 - ebegin "Scanning system for __guard to see if you need to rebuild first ..."
209 - local files=$(
210 - scanelf -qys__guard -F'#s%F' \
211 - "${EROOT}"/*bin/ \
212 - "${EROOT}"/lib* \
213 - "${EROOT}"/usr/*bin/ \
214 - "${EROOT}"/usr/lib* | \
215 - egrep -v \
216 - -e "^${EROOT}/lib.*/(libc|ld)-2.*.so$" \
217 - -e "^${EROOT}/sbin/(ldconfig|sln)$"
218 - )
219 - [[ -z ${files} ]]
220 - if ! eend $? ; then
221 - eerror "Your system still has old SSP __guard symbols. You need to"
222 - eerror "rebuild all the packages that provide these files first:"
223 - eerror "${files}"
224 - die "old __guard detected"
225 - fi
226 - fi
227 -}
228 -
229 -src_unpack() {
230 - use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
231 -
232 - setup_env
233 -
234 - # Check NPTL support _before_ we unpack things to save some time
235 - check_nptl_support
236 -
237 - if [[ -n ${EGIT_REPO_URI} ]] ; then
238 - git-r3_src_unpack
239 - else
240 - unpack ${P}.tar.xz
241 - fi
242 -
243 - cd "${S}"
244 - touch locale/C-translit.h #185476 #218003
245 -
246 - cd "${WORKDIR}"
247 - unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
248 - # pull out all the addons
249 - local d
250 - for d in extra/*/configure ; do
251 - d=${d%/configure}
252 - [[ -d ${S}/${d} ]] && die "${d} already exists in \${S}"
253 - mv "${d}" "${S}" || die "moving ${d} failed"
254 - done
255 -}
256 -
257 -src_prepare() {
258 - if ! use vanilla ; then
259 - elog "Applying Gentoo Glibc Patchset ${RELEASE_VER}-${PATCH_VER} ..."
260 - eapply "${WORKDIR}"/patches
261 - elog "Done."
262 - fi
263 -
264 - if just_headers ; then
265 - if [[ -e ports/sysdeps/mips/preconfigure ]] ; then
266 - # mips peeps like to screw with us. if building headers,
267 - # we don't have a real compiler, so we can't let them
268 - # insert -mabi on us.
269 - sed -i '/CPPFLAGS=.*-mabi/s|.*|:|' ports/sysdeps/mips/preconfigure || die
270 - find ports/sysdeps/mips/ -name Makefile -exec sed -i '/^CC.*-mabi=/s:-mabi=.*:-D_MIPS_SZPTR=32:' {} +
271 - fi
272 - fi
273 -
274 - default
275 -
276 - gnuconfig_update
277 -
278 - cd "${WORKDIR}"
279 - find . -name configure -exec touch {} +
280 -
281 - eprefixify extra/locale/locale-gen
282 -
283 - # Fix permissions on some of the scripts.
284 - chmod u+x "${S}"/scripts/*.sh
285 -
286 - cd "${S}"
287 -
288 - if use hardened ; then
289 - # We don't enable these for non-hardened as the output is very terse --
290 - # it only states that a crash happened. The default upstream behavior
291 - # includes backtraces and symbols.
292 - einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
293 - cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
294 - cp "${FILESDIR}"/2.25/glibc-2.25-gentoo-chk_fail.c debug/chk_fail.c || die
295 -
296 - if use debug ; then
297 - # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
298 - sed -i \
299 - -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
300 - -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
301 - debug/Makefile || die
302 - fi
303 - fi
304 -}
305 -
306 -glibc_do_configure() {
307 - # Glibc does not work with gold (for various reasons) #269274.
308 - tc-ld-disable-gold
309 -
310 - # CXX isnt handled by the multilib system, so if we dont unset here
311 - # we accumulate crap across abis
312 - unset CXX
313 -
314 - einfo "Configuring glibc for $1"
315 -
316 - local v
317 - for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS ; do
318 - einfo " $(printf '%15s' ${v}:) ${!v}"
319 - done
320 -
321 - # The glibc configure script doesn't properly use LDFLAGS all the time.
322 - export CC="$(tc-getCC ${CTARGET}) ${LDFLAGS}"
323 - einfo " $(printf '%15s' 'Manual CC:') ${CC}"
324 -
325 - # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
326 - export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS)"
327 - einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
328 -
329 - echo
330 -
331 - local myconf=()
332 -
333 - # set addons
334 - pushd "${S}" > /dev/null
335 - local addons=$(echo */configure | sed \
336 - -e 's:/configure::g' \
337 - -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
338 - -e 's: \+$::' \
339 - -e 's! !,!g' \
340 - -e 's!^!,!' \
341 - -e '/^,\*$/d')
342 - [[ -d ports ]] && addons+=",ports"
343 - popd > /dev/null
344 -
345 - case ${CTARGET} in
346 - powerpc-*)
347 - # Currently gcc on powerpc32 generates invalid code for
348 - # __builtin_return_address(0) calls. Normally programs
349 - # don't do that but malloc hooks in glibc do:
350 - # https://gcc.gnu.org/PR81996
351 - # https://bugs.gentoo.org/629054
352 - myconf+=( --enable-stack-protector=no )
353 - ;;
354 - *)
355 - myconf+=( --enable-stack-protector=all )
356 - ;;
357 - esac
358 - myconf+=( --enable-stackguard-randomization )
359 -
360 - [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp )
361 -
362 - if [[ $1 == "nptl" ]] ; then
363 - myconf+=( --enable-kernel=${NPTL_KERN_VER} )
364 - else
365 - die "invalid pthread option"
366 - fi
367 - myconf+=( --enable-add-ons="${addons#,}" )
368 -
369 - # Since SELinux support is only required for nscd, only enable it if:
370 - # 1. USE selinux
371 - # 2. only for the primary ABI on multilib systems
372 - # 3. Not a crosscompile
373 - if ! is_crosscompile && use selinux ; then
374 - if use multilib ; then
375 - if is_final_abi ; then
376 - myconf+=( --with-selinux )
377 - else
378 - myconf+=( --without-selinux )
379 - fi
380 - else
381 - myconf+=( --with-selinux )
382 - fi
383 - else
384 - myconf+=( --without-selinux )
385 - fi
386 -
387 - # Force a few tests where we always know the answer but
388 - # configure is incapable of finding it.
389 - if is_crosscompile ; then
390 - export \
391 - libc_cv_c_cleanup=yes \
392 - libc_cv_forced_unwind=yes
393 - fi
394 -
395 - myconf+=(
396 - --without-cvs
397 - --disable-werror
398 - --enable-bind-now
399 - --build=${CBUILD_OPT:-${CBUILD}}
400 - --host=${CTARGET_OPT:-${CTARGET}}
401 - $(use_enable profile)
402 - $(use_with gd)
403 - --with-headers=$(alt_build_headers)
404 - --prefix="${EPREFIX}/usr"
405 - --sysconfdir="${EPREFIX}/etc"
406 - --localstatedir="${EPREFIX}/var"
407 - --libdir='$(prefix)'/$(get_libdir)
408 - --mandir='$(prefix)'/share/man
409 - --infodir='$(prefix)'/share/info
410 - --libexecdir='$(libdir)'/misc/glibc
411 - --with-bugurl=https://bugs.gentoo.org/
412 - --with-pkgversion="$(glibc_banner)"
413 - $(use_multiarch || echo --disable-multi-arch)
414 - $(in_iuse systemtap && use_enable systemtap)
415 - $(in_iuse nscd && use_enable nscd)
416 - ${EXTRA_ECONF}
417 - )
418 -
419 - # We rely on sys-libs/timezone-data for timezone tools normally.
420 - myconf+=( $(use_enable vanilla timezone-tools) )
421 -
422 - # These libs don't have configure flags.
423 - ac_cv_lib_audit_audit_log_user_avc_message=$(in_iuse audit && usex audit || echo no)
424 - ac_cv_lib_cap_cap_init=$(in_iuse caps && usex caps || echo no)
425 -
426 - # There is no configure option for this and we need to export it
427 - # since the glibc build will re-run configure on itself
428 - export libc_cv_rootsbindir="${EPREFIX}/sbin"
429 - export libc_cv_slibdir="${EPREFIX}/$(get_libdir)"
430 -
431 - # We take care of patching our binutils to use both hash styles,
432 - # and many people like to force gnu hash style only, so disable
433 - # this overriding check. #347761
434 - export libc_cv_hashstyle=no
435 -
436 - local builddir=$(builddir "$1")
437 - mkdir -p "${builddir}"
438 - cd "${builddir}"
439 - set -- "${S}"/configure "${myconf[@]}"
440 - echo "$@"
441 - "$@" || die "failed to configure glibc"
442 -
443 - # ia64 static cross-compilers are a pita in so much that they
444 - # can't produce static ELFs (as the libgcc.a is broken). so
445 - # disable building of the programs for those targets if it
446 - # doesn't work.
447 - # XXX: We could turn this into a compiler test, but ia64 is
448 - # the only one that matters, so this should be fine for now.
449 - if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then
450 - sed -i '1i+link-static = touch $@' config.make
451 - fi
452 -
453 - # If we're trying to migrate between ABI sets, we need
454 - # to lie and use a local copy of gcc. Like if the system
455 - # is built with MULTILIB_ABIS="amd64 x86" but we want to
456 - # add x32 to it, gcc/glibc don't yet support x32.
457 - if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib ; then
458 - echo 'main(){}' > "${T}"/test.c
459 - if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then
460 - sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die
461 - mkdir -p sunrpc
462 - cp $(which rpcgen) sunrpc/cross-rpcgen || die
463 - touch -t 202001010101 sunrpc/cross-rpcgen || die
464 - fi
465 - fi
466 -}
467 -
468 -glibc_headers_configure() {
469 - export ABI=default
470 -
471 - local builddir=$(builddir "headers")
472 - mkdir -p "${builddir}"
473 - cd "${builddir}"
474 -
475 - # if we don't have a compiler yet, we can't really test it now ...
476 - # hopefully they don't affect header generation, so let's hope for
477 - # the best here ...
478 - local v vars=(
479 - ac_cv_header_cpuid_h=yes
480 - libc_cv_{386,390,alpha,arm,hppa,ia64,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes
481 - libc_cv_asm_cfi_directives=yes
482 - libc_cv_broken_visibility_attribute=no
483 - libc_cv_c_cleanup=yes
484 - libc_cv_forced_unwind=yes
485 - libc_cv_gcc___thread=yes
486 - libc_cv_mlong_double_128=yes
487 - libc_cv_mlong_double_128ibm=yes
488 - libc_cv_ppc_machine=yes
489 - libc_cv_ppc_rel16=yes
490 - libc_cv_predef_fortify_source=no
491 - libc_cv_visibility_attribute=yes
492 - libc_cv_z_combreloc=yes
493 - libc_cv_z_execstack=yes
494 - libc_cv_z_initfirst=yes
495 - libc_cv_z_nodelete=yes
496 - libc_cv_z_nodlopen=yes
497 - libc_cv_z_relro=yes
498 - libc_mips_abi=${ABI}
499 - libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard)
500 - # These libs don't have configure flags.
501 - ac_cv_lib_audit_audit_log_user_avc_message=no
502 - ac_cv_lib_cap_cap_init=no
503 - )
504 -
505 - einfo "Forcing cached settings:"
506 - for v in "${vars[@]}" ; do
507 - einfo " ${v}"
508 - export ${v}
509 - done
510 -
511 - # Blow away some random CC settings that screw things up. #550192
512 - if [[ -d ${S}/sysdeps/mips ]]; then
513 - pushd "${S}"/sysdeps/mips >/dev/null
514 - sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die
515 - sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die
516 -
517 - # Force the mips ABI to the default. This is OK because the set of
518 - # installed headers in this phase is the same between the 3 ABIs.
519 - # If this ever changes, this hack will break, but that's unlikely
520 - # as glibc discourages that behavior.
521 - # https://crbug.com/647033
522 - sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die
523 -
524 - popd >/dev/null
525 - fi
526 -
527 - local myconf=()
528 - myconf+=(
529 - --disable-sanity-checks
530 - --enable-hacker-mode
531 - --without-cvs
532 - --disable-werror
533 - --enable-bind-now
534 - --build=${CBUILD_OPT:-${CBUILD}}
535 - --host=${CTARGET_OPT:-${CTARGET}}
536 - --with-headers=$(alt_build_headers)
537 - --prefix="${EPREFIX}/usr"
538 - ${EXTRA_ECONF}
539 - )
540 -
541 - local addons
542 - [[ -d ${S}/ports ]] && addons+=",ports"
543 - myconf+=( --enable-add-ons="${addons#,}" )
544 -
545 - # Nothing is compiled here which would affect the headers for the target.
546 - # So forcing CC/CFLAGS is sane.
547 - set -- "${S}"/configure "${myconf[@]}"
548 - echo "$@"
549 - CC="$(tc-getBUILD_CC)" \
550 - CFLAGS="-O1 -pipe" \
551 - CPPFLAGS="-U_FORTIFY_SOURCE" \
552 - LDFLAGS="" \
553 - "$@" || die "failed to configure glibc"
554 -}
555 -
556 -do_src_configure() {
557 - if just_headers ; then
558 - glibc_headers_configure
559 - else
560 - glibc_do_configure nptl
561 - fi
562 -}
563 -
564 -src_configure() {
565 - foreach_abi do_src_configure
566 -}
567 -
568 -do_src_compile() {
569 - emake -C "$(builddir nptl)" || die "make nptl for ${ABI} failed"
570 -}
571 -
572 -src_compile() {
573 - if just_headers ; then
574 - return
575 - fi
576 -
577 - foreach_abi do_src_compile
578 -}
579 -
580 -glibc_src_test() {
581 - cd "$(builddir $1)"
582 - emake -j1 check
583 -}
584 -
585 -do_src_test() {
586 - local ret=0
587 -
588 - glibc_src_test nptl
589 - : $(( ret |= $? ))
590 -
591 - return ${ret}
592 -}
593 -
594 -src_test() {
595 - # Give tests more time to complete.
596 - export TIMEOUTFACTOR=5
597 -
598 - foreach_abi do_src_test || die "tests failed"
599 -}
600 -
601 -glibc_do_src_install() {
602 - local builddir=$(builddir nptl)
603 - cd "${builddir}"
604 -
605 - emake install_root="${D}$(alt_prefix)" install || die
606 -
607 - # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support
608 - # which come without headers etc. Only needed for binary packages since the
609 - # external net-libs/libnsl has increased soversion. Keep only versioned libraries.
610 - find "${D}" -name "libnsl.a" -delete
611 - find "${D}" -name "libnsl.so" -delete
612 -
613 - # Normally real_pv is ${PV}. Live ebuilds are exception, there we need
614 - # to infer upstream version:
615 - # '#define VERSION "2.26.90"' -> '2.26.90'
616 - local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
617 -
618 - # Newer versions get fancy with libm linkage to include vectorized support.
619 - # While we don't really need a ldscript here, portage QA checks get upset.
620 - if [[ -e ${ED}$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
621 - dosym ../../$(get_libdir)/libm-${upstream_pv}.so $(alt_usrlibdir)/libm-${upstream_pv}.so
622 - fi
623 -
624 - # We'll take care of the cache ourselves
625 - rm -f "${ED}"/etc/ld.so.cache
626 -
627 - # Everything past this point just needs to be done once ...
628 - is_final_abi || return 0
629 -
630 - # Make sure the non-native interp can be found on multilib systems even
631 - # if the main library set isn't installed into the right place. Maybe
632 - # we should query the active gcc for info instead of hardcoding it ?
633 - local i ldso_abi ldso_name
634 - local ldso_abi_list=(
635 - # x86
636 - amd64 /lib64/ld-linux-x86-64.so.2
637 - x32 /libx32/ld-linux-x32.so.2
638 - x86 /lib/ld-linux.so.2
639 - # mips
640 - o32 /lib/ld.so.1
641 - n32 /lib32/ld.so.1
642 - n64 /lib64/ld.so.1
643 - # powerpc
644 - ppc /lib/ld.so.1
645 - ppc64 /lib64/ld64.so.1
646 - # s390
647 - s390 /lib/ld.so.1
648 - s390x /lib/ld64.so.1
649 - # sparc
650 - sparc32 /lib/ld-linux.so.2
651 - sparc64 /lib64/ld-linux.so.2
652 - )
653 - case $(tc-endian) in
654 - little)
655 - ldso_abi_list+=(
656 - # arm
657 - arm64 /lib/ld-linux-aarch64.so.1
658 - )
659 - ;;
660 - big)
661 - ldso_abi_list+=(
662 - # arm
663 - arm64 /lib/ld-linux-aarch64_be.so.1
664 - )
665 - ;;
666 - esac
667 - if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then
668 - dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib
669 - fi
670 - for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do
671 - ldso_abi=${ldso_abi_list[i]}
672 - has ${ldso_abi} $(get_install_abis) || continue
673 -
674 - ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}"
675 - if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then
676 - dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name}
677 - fi
678 - done
679 -
680 - # With devpts under Linux mounted properly, we do not need the pt_chown
681 - # binary to be setuid. This is because the default owners/perms will be
682 - # exactly what we want.
683 - if in_iuse suid && ! use suid ; then
684 - find "${ED}" -name pt_chown -exec chmod -s {} +
685 - fi
686 -
687 - #################################################################
688 - # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
689 - # Make sure we install some symlink hacks so that when we build
690 - # a 2nd stage cross-compiler, gcc finds the target system
691 - # headers correctly. See gcc/doc/gccinstall.info
692 - if is_crosscompile ; then
693 - # We need to make sure that /lib and /usr/lib always exists.
694 - # gcc likes to use relative paths to get to its multilibs like
695 - # /usr/lib/../lib64/. So while we don't install any files into
696 - # /usr/lib/, we do need it to exist.
697 - cd "${ED}"$(alt_libdir)/..
698 - [[ -e lib ]] || mkdir lib
699 - cd "${ED}"$(alt_usrlibdir)/..
700 - [[ -e lib ]] || mkdir lib
701 -
702 - dosym usr/include $(alt_prefix)/sys-include
703 - return 0
704 - fi
705 -
706 - # Files for Debian-style locale updating
707 - dodir /usr/share/i18n
708 - sed \
709 - -e "/^#/d" \
710 - -e "/SUPPORTED-LOCALES=/d" \
711 - -e "s: \\\\::g" -e "s:/: :g" \
712 - "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \
713 - || die "generating /usr/share/i18n/SUPPORTED failed"
714 - cd "${WORKDIR}"/extra/locale
715 - dosbin locale-gen
716 - doman *.[0-8]
717 - insinto /etc
718 - doins locale.gen
719 -
720 - # Make sure all the ABI's can find the locales and so we only
721 - # have to generate one set
722 - local a
723 - keepdir /usr/$(get_libdir)/locale
724 - for a in $(get_install_abis) ; do
725 - if [[ ! -e ${ED}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
726 - dosym ../$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
727 - fi
728 - done
729 -
730 - cd "${S}"
731 -
732 - # Install misc network config files
733 - insinto /etc
734 - doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf
735 - doins "${WORKDIR}"/extra/etc/*.conf
736 -
737 - if use nscd ; then
738 - doinitd "$(prefixify_ro "${WORKDIR}"/extra/etc/nscd)"
739 -
740 - local nscd_args=(
741 - -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
742 - )
743 -
744 - sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd
745 -
746 - systemd_dounit nscd/nscd.service
747 - systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf
748 - else
749 - # Do this since extra/etc/*.conf above might have nscd.conf.
750 - rm -f "${ED}"/etc/nscd.conf
751 - fi
752 -
753 - echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
754 - doenvd "${T}"/00glibc
755 -
756 - for d in BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do
757 - [[ -s ${d} ]] && dodoc ${d}
758 - done
759 -
760 - # Prevent overwriting of the /etc/localtime symlink. We'll handle the
761 - # creation of the "factory" symlink in pkg_postinst().
762 - rm -f "${ED}"/etc/localtime
763 -}
764 -
765 -glibc_headers_install() {
766 - local builddir=$(builddir "headers")
767 - cd "${builddir}"
768 - emake install_root="${D}$(alt_prefix)" install-headers
769 -
770 - insinto $(alt_headers)/gnu
771 - doins "${S}"/include/gnu/stubs.h
772 -
773 - # Make sure we install the sys-include symlink so that when
774 - # we build a 2nd stage cross-compiler, gcc finds the target
775 - # system headers correctly. See gcc/doc/gccinstall.info
776 - dosym usr/include $(alt_prefix)/sys-include
777 -}
778 -
779 -src_install() {
780 - if just_headers ; then
781 - export ABI=default
782 - glibc_headers_install
783 - return
784 - fi
785 -
786 - foreach_abi glibc_do_src_install
787 - src_strip
788 -}
789 -
790 -pkg_preinst() {
791 - # nothing to do if just installing headers
792 - just_headers && return
793 -
794 - # prepare /etc/ld.so.conf.d/ for files
795 - mkdir -p "${EROOT}"/etc/ld.so.conf.d
796 -
797 - # Default /etc/hosts.conf:multi to on for systems with small dbs.
798 - if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then
799 - sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf
800 - elog "Defaulting /etc/host.conf:multi to on"
801 - fi
802 -
803 - [[ ${ROOT} != "/" ]] && return 0
804 - [[ -d ${ED}/$(get_libdir) ]] || return 0
805 - [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check
806 -}
807 -
808 -pkg_postinst() {
809 - # nothing to do if just installing headers
810 - just_headers && return
811 -
812 - if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then
813 - # Generate fastloading iconv module configuration file.
814 - "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
815 - fi
816 -
817 - if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
818 - # Reload init ... if in a chroot or a diff init package, ignore
819 - # errors from this step #253697
820 - /sbin/telinit U 2>/dev/null
821 -
822 - # if the host locales.gen contains no entries, we'll install everything
823 - local locale_list="${EROOT}etc/locale.gen"
824 - if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
825 - ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
826 - locale_list="${EROOT}usr/share/i18n/SUPPORTED"
827 - fi
828 - locale-gen -j $(makeopts_jobs) --config "${locale_list}"
829 - fi
830 -}