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: Sat, 09 Sep 2017 21:23:23
Message-Id: 1504992089.97d60d19aa080ba85e9c51b3833bf813ec163bec.dilfridge@gentoo
1 commit: 97d60d19aa080ba85e9c51b3833bf813ec163bec
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 5 20:18:37 2017 +0000
4 Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 9 21:21:29 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97d60d19
7
8 sys-libs/glibc: Simplification, removing a lot of outdated cruft and black magic
9
10 sys-libs/glibc/glibc-2.26-r1.ebuild | 344 ++++++++++++------------------------
11 1 file changed, 109 insertions(+), 235 deletions(-)
12
13 diff --git a/sys-libs/glibc/glibc-2.26-r1.ebuild b/sys-libs/glibc/glibc-2.26-r1.ebuild
14 index 98b89a06c6f..450e89d8f74 100644
15 --- a/sys-libs/glibc/glibc-2.26-r1.ebuild
16 +++ b/sys-libs/glibc/glibc-2.26-r1.ebuild
17 @@ -3,34 +3,40 @@
18
19 EAPI=6
20
21 -inherit toolchain-glibc
22 +inherit prefix toolchain-glibc
23
24 -DESCRIPTION="GNU libc6 (also called glibc2) C library"
25 -HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
26 +DESCRIPTION="GNU libc C library"
27 +HOMEPAGE="https://www.gnu.org/software/libc/"
28
29 LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
30 -RESTRICT="strip" # strip ourself #46186
31 +RESTRICT="strip" # Strip ourself #46186
32 EMULTILIB_PKG="true"
33
34 # Configuration variables
35
36 if [[ ${PV} == 9999* ]]; then
37 - EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
38 - EGIT_SOURCEDIRS="${S}"
39 - inherit git-2
40 + EGIT_REPO_URI="git://sourceware.org/git/glibc.git"
41 + inherit git-r3
42 else
43 # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
44 KEYWORDS=""
45 + SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
46 fi
47
48 RELEASE_VER=${PV}
49
50 GCC_BOOTSTRAP_VER="4.7.3-r1"
51 -# patches live at https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/
52 -PATCH_VER="0" # Gentoo patchset
53 -: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires
54
55 -IUSE="audit caps debug gd hardened multilib nscd +rpc selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
56 +# Gentoo patchset
57 +PATCH_VER="0"
58 +
59 +SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.bz2"
60 +SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2 )"
61 +
62 +IUSE="audit caps debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
63 +
64 +# Min kernel version nptl requires
65 +: ${NPTL_KERN_VER:="2.6.32"}
66
67 # Here's how the cross-compile logic breaks down ...
68 # CTARGET - machine that will target the binaries
69 @@ -58,8 +64,6 @@ is_crosscompile() {
70 [[ ${CHOST} != ${CTARGET} ]]
71 }
72
73 -# Why SLOT 2.2 you ask yourself while sippin your tea ?
74 -# Everyone knows 2.2 > 0, duh.
75 SLOT="2.2"
76
77 # General: We need a new-enough binutils/gcc to match upstream baseline.
78 @@ -75,11 +79,13 @@ COMMON_DEPEND="
79 DEPEND="${COMMON_DEPEND}
80 >=app-misc/pax-utils-0.1.10
81 !<sys-apps/sandbox-1.6
82 - !<sys-apps/portage-2.1.2"
83 + !<sys-apps/portage-2.1.2
84 +"
85 RDEPEND="${COMMON_DEPEND}
86 !sys-kernel/ps3-sources
87 sys-apps/gentoo-functions
88 - !sys-libs/nss-db"
89 + !sys-libs/nss-db
90 +"
91
92 if [[ ${CATEGORY} == cross-* ]] ; then
93 DEPEND+=" !crosscompile_opts_headers-only? (
94 @@ -91,33 +97,23 @@ else
95 DEPEND+="
96 >=sys-devel/binutils-2.24
97 >=sys-devel/gcc-4.7
98 - virtual/os-headers"
99 + virtual/os-headers
100 + "
101 RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
102 PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
103 fi
104
105 -upstream_uris() {
106 - echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
107 -}
108 -gentoo_uris() {
109 - local devspace="HTTP~vapier/dist/URI HTTP~tamiko/distfiles/URI HTTP~dilfridge/distfiles/URI HTTP~slyfox/distfiles/URI"
110 - devspace=${devspace//HTTP/https://dev.gentoo.org/}
111 - echo mirror://gentoo/$1 ${devspace//URI/$1}
112 -}
113 -SRC_URI=$(
114 - [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
115 - [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
116 -)
117 -SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
118 -
119 #
120 # the phases
121 #
122
123 pkg_pretend() {
124 - check_devpts
125 + die "This is work in progress. DONT try to use it. dilfridge"
126
127 - # Prevent native builds from downgrading.
128 + # Make sure devpts is mounted correctly for use w/out setuid pt_chown
129 + check_devpts
130 +
131 + # Prevent native builds from downgrading
132 if [[ ${MERGE_TYPE} != "buildonly" ]] && \
133 [[ ${ROOT} == "/" ]] && \
134 [[ ${CBUILD} == ${CHOST} ]] && \
135 @@ -128,7 +124,7 @@ pkg_pretend() {
136 if has_version ">${CATEGORY}/${P}-r10000" ; then
137 eerror "Sanity check to keep you from breaking your system:"
138 eerror " Downgrading glibc is not supported and a sure way to destruction"
139 - die "aborting to save your system"
140 + die "Aborting to save your system"
141 fi
142
143 if ! glibc_run_test '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n'
144 @@ -136,31 +132,31 @@ pkg_pretend() {
145 eerror "Your patched vendor kernel is broken. You need to get an"
146 eerror "update from whoever is providing the kernel to you."
147 eerror "https://sourceware.org/bugzilla/show_bug.cgi?id=5227"
148 - eerror "http://bugs.gentoo.org/262698"
149 - die "keeping your system alive, say thank you"
150 + eerror "https://bugs.gentoo.org/262698"
151 + die "Keeping your system alive, say thank you"
152 fi
153
154 if ! glibc_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n'
155 then
156 eerror "Your old kernel is broken. You need to update it to"
157 eerror "a newer version as syscall(<bignum>) will break."
158 - eerror "http://bugs.gentoo.org/279260"
159 - die "keeping your system alive, say thank you"
160 + eerror "https://bugs.gentoo.org/279260"
161 + die "Keeping your system alive, say thank you"
162 fi
163 fi
164
165 - # users have had a chance to phase themselves, time to give em the boot
166 + # Users have had a chance to phase themselves, time to give em the boot
167 if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
168 eerror "You still haven't deleted ${EROOT}/etc/locales.build."
169 eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
170 - die "lazy upgrader detected"
171 + die "Lazy upgrader detected"
172 fi
173
174 if [[ ${CTARGET} == i386-* ]] ; then
175 eerror "i386 CHOSTs are no longer supported."
176 eerror "Chances are you don't actually want/need i386."
177 - eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml"
178 - die "please fix your CHOST"
179 + eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml"
180 + die "Please fix your CHOST"
181 fi
182
183 if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
184 @@ -198,61 +194,37 @@ pkg_pretend() {
185 }
186
187 src_unpack() {
188 - [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
189 + use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
190
191 setup_env
192
193 # Check NPTL support _before_ we unpack things to save some time
194 - want_nptl && check_nptl_support
195 -
196 - if [[ -n ${EGIT_REPO_URIS} ]] ; then
197 - local i d
198 - for ((i=0; i<${#EGIT_REPO_URIS[@]}; ++i)) ; do
199 - EGIT_REPO_URI=${EGIT_REPO_URIS[$i]}
200 - EGIT_SOURCEDIR=${EGIT_SOURCEDIRS[$i]}
201 - git-2_src_unpack
202 - done
203 + check_nptl_support
204 +
205 + if [[ -n ${EGIT_REPO_URI} ]] ; then
206 + git-r3_src_unpack
207 else
208 - unpack_pkg
209 + unpack ${PN}.tar.xz
210 fi
211
212 cd "${S}"
213 touch locale/C-translit.h #185476 #218003
214 - [[ -n ${LT_VER} ]] && unpack_pkg linuxthreads ${LT_VER}
215 - [[ -n ${PORTS_VER} ]] && unpack_pkg ports ${PORTS_VER}
216 - [[ -n ${LIBIDN_VER} ]] && unpack_pkg libidn
217 -
218 - if [[ -n ${PATCH_VER} ]] ; then
219 - cd "${WORKDIR}"
220 - unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
221 - # pull out all the addons
222 - local d
223 - for d in extra/*/configure ; do
224 - d=${d%/configure}
225 - [[ -d ${S}/${d} ]] && die "${d} already exists in \${S}"
226 - mv "${d}" "${S}" || die "moving ${d} failed"
227 - done
228 - fi
229 +
230 + cd "${WORKDIR}"
231 + unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
232 + # pull out all the addons
233 + local d
234 + for d in extra/*/configure ; do
235 + d=${d%/configure}
236 + [[ -d ${S}/${d} ]] && die "${d} already exists in \${S}"
237 + mv "${d}" "${S}" || die "moving ${d} failed"
238 + done
239 }
240
241 src_prepare() {
242 - # XXX: We should do the branchupdate, before extracting the manpages and
243 - # infopages else it does not help much (mtimes change if there is a change
244 - # to them with branchupdate)
245 - if [[ -n ${BRANCH_UPDATE} ]] ; then
246 - epatch "${DISTDIR}"/glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
247 -
248 - # Snapshot date patch
249 - einfo "Patching version to display snapshot date ..."
250 - sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
251 - fi
252 -
253 - if [[ -n ${PATCH_VER} ]] && ! use vanilla ; then
254 - EPATCH_MULTI_MSG="Applying Gentoo Glibc Patchset ${RELEASE_VER}-${PATCH_VER} ..." \
255 - EPATCH_EXCLUDE=${GLIBC_PATCH_EXCLUDE} \
256 - EPATCH_SUFFIX="patch" \
257 - ARCH=$(tc-arch) \
258 - epatch "${WORKDIR}"/patches
259 + if ! use vanilla ; then
260 + elog "Applying Gentoo Glibc Patchset ${RELEASE_VER}-${PATCH_VER} ..."
261 + eapply "${WORKDIR}"/patches/*.patch
262 fi
263
264 if just_headers ; then
265 @@ -265,7 +237,7 @@ src_prepare() {
266 fi
267 fi
268
269 - eapply_user
270 + default
271
272 gnuconfig_update
273
274 @@ -301,7 +273,7 @@ src_prepare() {
275 4.8.[0-3]|4.9.0)
276 eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] and gcc-4.9.0 miscompile"
277 eerror "glibc. See https://bugs.gentoo.org/547420 for details."
278 - die "need to switch compilers #547420"
279 + die "Need to switch compilers #547420"
280 ;;
281 esac
282 }
283 @@ -310,7 +282,17 @@ glibc_do_configure() {
284 # Glibc does not work with gold (for various reasons) #269274.
285 tc-ld-disable-gold
286
287 - dump_toolchain_settings "Configuring glibc for $1"
288 + einfo "Configuring glibc for $1"
289 +
290 + local v
291 + for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC LD {AS,C,CPP,CXX,LD}FLAGS ; do
292 + einfo " $(printf '%15s' ${v}:) ${!v}"
293 + done
294 +
295 + # The glibc configure script doesn't properly use LDFLAGS all the time.
296 + export CC="$(tc-getCC ${CTARGET}) ${LDFLAGS}"
297 + einfo " $(printf '%15s' 'Manual CC:') ${CC}"
298 + echo
299
300 local myconf=()
301
302 @@ -326,41 +308,12 @@ glibc_do_configure() {
303 [[ -d ports ]] && addons+=",ports"
304 popd > /dev/null
305
306 - if has_version '<sys-libs/glibc-2.13' ; then
307 - myconf+=( --enable-old-ssp-compat )
308 - fi
309 -
310 - if version_is_at_least 2.25 ; then
311 - myconf+=( --enable-stack-protector=all )
312 - fi
313 -
314 - if version_is_at_least 2.25 ; then
315 - myconf+=( --enable-stackguard-randomization )
316 - else
317 - myconf+=( $(use_enable hardened stackguard-randomization) )
318 - fi
319 + myconf+=( --enable-stack-protector=all )
320 + myconf+=( --enable-stackguard-randomization )
321
322 [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp )
323
324 - if [[ $1 == "linuxthreads" ]] ; then
325 - if want_tls ; then
326 - myconf+=( --with-tls )
327 -
328 - if ! want__thread || use glibc-compat20 || [[ ${LT_KER_VER} == 2.[02].* ]] ; then
329 - myconf+=( --without-__thread )
330 - else
331 - myconf+=( --with-__thread )
332 - fi
333 - else
334 - myconf+=( --without-tls --without-__thread )
335 - fi
336 -
337 - myconf+=( --disable-sanity-checks )
338 - addons="linuxthreads${addons}"
339 - myconf+=( --enable-kernel=${LT_KER_VER} )
340 - elif [[ $1 == "nptl" ]] ; then
341 - # Newer versions require nptl, so there is no addon for it.
342 - version_is_at_least 2.20 || addons="nptl${addons}"
343 + if [[ $1 == "nptl" ]] ; then
344 myconf+=( --enable-kernel=${NPTL_KERN_VER} )
345 else
346 die "invalid pthread option"
347 @@ -409,19 +362,16 @@ glibc_do_configure() {
348 --mandir='$(prefix)'/share/man
349 --infodir='$(prefix)'/share/info
350 --libexecdir='$(libdir)'/misc/glibc
351 - --with-bugurl=http://bugs.gentoo.org/
352 + --with-bugurl=https://bugs.gentoo.org/
353 --with-pkgversion="$(glibc_banner)"
354 $(use_multiarch || echo --disable-multi-arch)
355 - $(in_iuse rpc && use_enable rpc obsolete-rpc || echo --enable-obsolete-rpc)
356 $(in_iuse systemtap && use_enable systemtap)
357 $(in_iuse nscd && use_enable nscd)
358 ${EXTRA_ECONF}
359 )
360
361 # We rely on sys-libs/timezone-data for timezone tools normally.
362 - if version_is_at_least 2.23 ; then
363 - myconf+=( $(use_enable vanilla timezone-tools) )
364 - fi
365 + myconf+=( $(use_enable vanilla timezone-tools) )
366
367 # These libs don't have configure flags.
368 ac_cv_lib_audit_audit_log_user_avc_message=$(in_iuse audit && usex audit || echo no)
369 @@ -437,13 +387,6 @@ glibc_do_configure() {
370 # this overriding check. #347761
371 export libc_cv_hashstyle=no
372
373 - # Overtime, generating info pages can be painful. So disable this for
374 - # versions older than the latest stable to avoid the issue (this ver
375 - # should be updated from time to time). #464394 #465816
376 - if ! version_is_at_least 2.17 ; then
377 - export ac_cv_prog_MAKEINFO=:
378 - fi
379 -
380 local builddir=$(builddir "$1")
381 mkdir -p "${builddir}"
382 cd "${builddir}"
383 @@ -512,11 +455,7 @@ glibc_headers_configure() {
384 ac_cv_lib_audit_audit_log_user_avc_message=no
385 ac_cv_lib_cap_cap_init=no
386 )
387 - if ! version_is_at_least 2.25 ; then
388 - vars+=(
389 - libc_cv_predef_stack_protector=no
390 - )
391 - fi
392 +
393 einfo "Forcing cached settings:"
394 for v in "${vars[@]}" ; do
395 einfo " ${v}"
396 @@ -528,14 +467,14 @@ glibc_headers_configure() {
397 pushd "${S}"/sysdeps/mips >/dev/null
398 sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die
399 sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die
400 - if version_is_at_least 2.21 ; then
401 - # Force the mips ABI to the default. This is OK because the set of
402 - # installed headers in this phase is the same between the 3 ABIs.
403 - # If this ever changes, this hack will break, but that's unlikely
404 - # as glibc discourages that behavior.
405 - # https://crbug.com/647033
406 - sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die
407 - fi
408 +
409 + # Force the mips ABI to the default. This is OK because the set of
410 + # installed headers in this phase is the same between the 3 ABIs.
411 + # If this ever changes, this hack will break, but that's unlikely
412 + # as glibc discourages that behavior.
413 + # https://crbug.com/647033
414 + sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die
415 +
416 popd >/dev/null
417 fi
418
419 @@ -555,8 +494,6 @@ glibc_headers_configure() {
420
421 local addons
422 [[ -d ${S}/ports ]] && addons+=",ports"
423 - # Newer versions require nptl, so there is no addon for it.
424 - version_is_at_least 2.20 || addons+=",nptl"
425 myconf+=( --enable-add-ons="${addons#,}" )
426
427 # Nothing is compiled here which would affect the headers for the target.
428 @@ -574,8 +511,7 @@ do_src_configure() {
429 if just_headers ; then
430 glibc_headers_configure
431 else
432 - want_linuxthreads && glibc_do_configure linuxthreads
433 - want_nptl && glibc_do_configure nptl
434 + glibc_do_configure nptl
435 fi
436 }
437
438 @@ -584,12 +520,7 @@ src_configure() {
439 }
440
441 do_src_compile() {
442 - local t
443 - for t in linuxthreads nptl ; do
444 - if want_${t} ; then
445 - emake -C "$(builddir ${t})" || die "make ${t} for ${ABI} failed"
446 - fi
447 - done
448 + emake -C "$(builddir nptl)" || die "make nptl for ${ABI} failed"
449 }
450
451 src_compile() {
452 @@ -602,21 +533,15 @@ src_compile() {
453
454 glibc_src_test() {
455 cd "$(builddir $1)"
456 - nonfatal emake -j1 check && return 0
457 - einfo "make check failed - re-running with --keep-going to get the rest of the results"
458 - nonfatal emake -j1 -k check
459 - ewarn "make check failed for ${ABI}-${CTARGET}-$1"
460 - return 1
461 + emake -j1 check
462 }
463
464 -glibc_do_src_test() {
465 - local ret=0 t
466 - for t in linuxthreads nptl ; do
467 - if want_${t} ; then
468 - glibc_src_test ${t}
469 - : $(( ret |= $? ))
470 - fi
471 - done
472 +do_src_test() {
473 + local ret=0
474 +
475 + glibc_src_test nptl
476 + : $(( ret |= $? ))
477 +
478 return ${ret}
479 }
480
481 @@ -624,62 +549,20 @@ src_test() {
482 # Give tests more time to complete.
483 export TIMEOUTFACTOR=5
484
485 - foreach_abi toolchain-glibc_do_src_test || die "tests failed"
486 + foreach_abi do_src_test || die "tests failed"
487 }
488
489 glibc_do_src_install() {
490 - local builddir=$(builddir $(want_linuxthreads && echo linuxthreads || echo nptl))
491 + local builddir=$(builddir nptl)
492 cd "${builddir}"
493
494 emake install_root="${D}$(alt_prefix)" install || die
495
496 - if want_linuxthreads && want_nptl ; then
497 - einfo "Installing NPTL to $(alt_libdir)/tls/..."
498 - cd "$(builddir nptl)"
499 - dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
500 -
501 - local l src_lib
502 - for l in libc libm librt libpthread libthread_db ; do
503 - # take care of shared lib first ...
504 - l=${l}.so
505 - if [[ -e ${l} ]] ; then
506 - src_lib=${l}
507 - else
508 - src_lib=$(eval echo */${l})
509 - fi
510 - cp -a ${src_lib} "${ED}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
511 - fperms a+rx $(alt_libdir)/tls/${l}
512 - dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
513 -
514 - # then grab the linker script or the symlink ...
515 - if [[ -L ${ED}$(alt_usrlibdir)/${l} ]] ; then
516 - dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
517 - else
518 - sed \
519 - -e "s:/${l}:/tls/${l}:g" \
520 - -e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
521 - "${ED}"$(alt_usrlibdir)/${l} > "${ED}"$(alt_usrlibdir)/nptl/${l}
522 - fi
523 -
524 - # then grab the static lib ...
525 - src_lib=${src_lib/%.so/.a}
526 - [[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
527 - cp -a ${src_lib} "${ED}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
528 - src_lib=${src_lib/%.a/_nonshared.a}
529 - if [[ -e ${src_lib} ]] ; then
530 - cp -a ${src_lib} "${ED}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
531 - fi
532 - done
533 -
534 - # use the nptl linker instead of the linuxthreads one as the linuxthreads
535 - # one may lack TLS support and that can be really bad for business
536 - cp -a elf/ld.so "${ED}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
537 - fi
538 -
539 # Normally real_pv is ${PV}. Live ebuilds are exception, there we need
540 # to infer upstream version:
541 # '#define VERSION "2.26.90"' -> '2.26.90'
542 local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
543 +
544 # Newer versions get fancy with libm linkage to include vectorized support.
545 # While we don't really need a ldscript here, portage QA checks get upset.
546 if [[ -e ${ED}$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
547 @@ -777,10 +660,10 @@ glibc_do_src_install() {
548 "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \
549 || die "generating /usr/share/i18n/SUPPORTED failed"
550 cd "${WORKDIR}"/extra/locale
551 - dosbin locale-gen || die
552 + dosbin locale-gen
553 doman *.[0-8]
554 insinto /etc
555 - doins locale.gen || die
556 + doins locale.gen
557
558 # Make sure all the ABI's can find the locales and so we only
559 # have to generate one set
560 @@ -796,34 +679,27 @@ glibc_do_src_install() {
561
562 # Install misc network config files
563 insinto /etc
564 - doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf || die
565 - doins "${WORKDIR}"/extra/etc/*.conf || die
566 + doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf
567 + doins "${WORKDIR}"/extra/etc/*.conf
568
569 - if ! in_iuse nscd || use nscd ; then
570 - doinitd "${WORKDIR}"/extra/etc/nscd || die
571 + if use nscd ; then
572 + doinitd "${WORKDIR}"/extra/etc/nscd
573
574 local nscd_args=(
575 -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
576 )
577 - version_is_at_least 2.16 || nscd_args+=( -e 's: --foreground : :' )
578 +
579 sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd
580
581 - # Newer versions of glibc include the nscd.service themselves.
582 - # TODO: Drop the $FILESDIR copy once 2.19 goes stable.
583 - if version_is_at_least 2.19 ; then
584 - systemd_dounit nscd/nscd.service || die
585 - systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf || die
586 - else
587 - systemd_dounit "${FILESDIR}"/nscd.service || die
588 - systemd_newtmpfilesd "${FILESDIR}"/nscd.tmpfilesd nscd.conf || die
589 - fi
590 + systemd_dounit nscd/nscd.service
591 + systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf
592 else
593 # Do this since extra/etc/*.conf above might have nscd.conf.
594 rm -f "${ED}"/etc/nscd.conf
595 fi
596
597 echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
598 - doenvd "${T}"/00glibc || die
599 + doenvd "${T}"/00glibc
600
601 for d in BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do
602 [[ -s ${d} ]] && dodoc ${d}
603 @@ -837,13 +713,11 @@ glibc_do_src_install() {
604 glibc_headers_install() {
605 local builddir=$(builddir "headers")
606 cd "${builddir}"
607 - emake install_root="${D}$(alt_prefix)" install-headers || die
608 - if ! version_is_at_least 2.16 ; then
609 - insinto $(alt_headers)/bits
610 - doins bits/stdio_lim.h || die
611 - fi
612 + emake install_root="${D}$(alt_prefix)" install-headers
613 +
614 insinto $(alt_headers)/gnu
615 - doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
616 + doins "${S}"/include/gnu/stubs.h
617 +
618 # Make sure we install the sys-include symlink so that when
619 # we build a 2nd stage cross-compiler, gcc finds the target
620 # system headers correctly. See gcc/doc/gccinstall.info