Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/
Date: Wed, 05 Jan 2022 21:16:49
Message-Id: 1641417387.0c221f0fa9884cc179320d1467dc302b37d9f750.dilfridge@gentoo
1 commit: 0c221f0fa9884cc179320d1467dc302b37d9f750
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 5 21:16:27 2022 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 5 21:16:27 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c221f0f
7
8 sys-libs/glibc: Remove old
9
10 Package-Manager: Portage-3.0.28, Repoman-3.0.3
11 Signed-off-by: Andreas K. Huettel <dilfridge <AT> gentoo.org>
12
13 sys-libs/glibc/Manifest | 2 -
14 sys-libs/glibc/glibc-2.33-r1.ebuild | 1521 ---------------------------------
15 sys-libs/glibc/glibc-2.34-r3.ebuild | 1602 -----------------------------------
16 3 files changed, 3125 deletions(-)
17
18 diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
19 index 214b40362a71..53275b6e62d2 100644
20 --- a/sys-libs/glibc/Manifest
21 +++ b/sys-libs/glibc/Manifest
22 @@ -11,11 +11,9 @@ DIST glibc-2.31-patches-9.tar.xz 74712 BLAKE2B 62991b67de4def4cca944e8420d2f0139
23 DIST glibc-2.31.tar.xz 16676764 BLAKE2B 91df1792345f157265eae405185a81fd4b8ce36d4c2388f44b0d5b1ae38174ea374cbc909cd260770b9f38ea58051da13766d4fa22abf41c2d4a2493257b179b SHA512 735e4c0ef10418b6ea945ad3906585e5bbd8b282d76f2131309dce4cec6b15066a5e4a3731773ce428a819b542579c9957867bb0abf05ed2030983fca4412306
24 DIST glibc-2.32-patches-8.tar.xz 65532 BLAKE2B 00c572cff396e52313d0324f7bc28192a65f06b22fc5a04aa631b76b3016842365006399715531ee693f3519720edcebef7884247f2f8c19e3518c1ddafab7cc SHA512 5240bc3a6df46d12c03ea4ce7b1a0df85301256ae3bd003fd04c61dadaaec34998873bf20544d891f6eedf896302bb916010aebc1d8d646a3cce09a93b533d0b
25 DIST glibc-2.32.tar.xz 16744512 BLAKE2B a56b4afbb35315c5cd6dca0f62e44455dceae3e6e88a8453621f9a5394a60ddf10ca9309b2db0911830c7fd77e3faa5d94694eb94d5b2c05fc5285cef52255da SHA512 8460c155b7003e04f18dabece4ed9ad77445fa2288a7dc08e80a8fc4c418828af29e0649951bd71a54ea2ad2d4da7570aafd9bdfe4a37e9951b772b442afe50b
26 -DIST glibc-2.33-patches-4.tar.xz 60124 BLAKE2B a7a99f39c16df241745772c31b10946dc44c51e6c09f8a447b905e7dd6ba529aee08f66a581431453c6665485ac1848861559aa3f0aaba8c2061c1f1eb77d9be SHA512 05c33dc465a98097f836783bb5037dfa14b3a2c0c140014f642ea72954222ae919fe2db9573ee70ca9c1881b3b59dd4b815a8f39f331494fa12951c9012797ef
27 DIST glibc-2.33-patches-6.tar.xz 64632 BLAKE2B f04ca4320d65c8796c67471cb56d3bf002cc34fb6a81075b85948e41c94df46cb2a3a944cced42d6d2c17ffc11e32a9840810864e655cc0fe18e6e0fe9f3c985 SHA512 b95746cd3415ec9ca275e542a2b5fddd5ce5680aa3bda08e94e96cf431191f7488ef6b7999ff0dfaf7405a4212531a75283e9bd7f5ae65bf572912038877a6df
28 DIST glibc-2.33.tar.xz 17031280 BLAKE2B 703d12121c1e2c5d9e0c6ba5341f5fb5c4d9111611a83f2360029b5de9c6e5a5611249d1833684a58ed4afdf49cae614365d87ec8721ba0e5d218f593b1f229d SHA512 4cb5777b68b22b746cc51669e0e9282b43c83f6944e42656e6db7195ebb68f2f9260f130fdeb4e3cfc64efae4f58d96c43d388f52be1eb024ca448084684abdb
29 DIST glibc-2.34-patches-10.tar.xz 89816 BLAKE2B c396c568804a17cf78a0da945a3db7b3740eebcd676cbb9b007bb7226c209620e5aaf533c397b7276c0a02f577d58e5f84c167a3ac6cea336d73cbe47aceb3c6 SHA512 7aa72816ef7f46f206ef6c18825423dd48e4bfe9bfbe9c2a4f760c53fc28bf6894374ee14d3212ef9478359e2c25cbdda2c062c7c41de5025850699b41661b95
30 -DIST glibc-2.34-patches-6.tar.xz 58396 BLAKE2B c25696e2aceef9ea4724716acde377d91b8a76b2edca2b293fcd6c89f635f63a612f8c1ecd861367b1394ebacc4b0151b0c6b68c2b08a7bde3a54a76400f35c5 SHA512 343922492e448d978dbcad1718804f892d002b6d4ce366da4cf571d97145ed850fb4b2862645681f487a9a18a77ea48f23010c0c61ea7cf914d26fd149b8271d
31 DIST glibc-2.34-patches-8.tar.xz 61284 BLAKE2B a042d3bfd85cb9732f033eb1489fc4a9d5b42ec599bb320a97a9633047819d1d02b2f00dce601ddb02036f8bf0d67f9b0d6463785965db72d9ac2ce13765fa07 SHA512 1d92abb82ae404b90841217bba3b1ccb7e03799e5f21656b0a2eaaf06bd4a5a2f0fd7ebf927acc72fce0e2af6bb1a2e8658bac431423d07e75dce1f2868bd029
32 DIST glibc-2.34.tar.xz 17301232 BLAKE2B 874031192f2f5a3b35c3f5b044a467d4be4e67e8593e070e5b49b901ce8ea6bde2f8d2f6c92fa33b3f61eb723572a9e5f2b45e56064168df80a96d3fdb6fa30c SHA512 15252affd9ef4523a8001db16d497f4fdcb3ddf4cde7fe80e075df0bd3cc6524dc29fbe20229dbf5f97af580556e6b1fac0de321a5fe25322bc3e72f93beb624
33 DIST glibc-systemd-20210729.tar.gz 1480 BLAKE2B 37722c7579df782d890e44dbab99c3de52ab466eb9de80d82405e9bb5620bf39ffc8c5f466a435bdb86ef6d36dd7019c0736573916bda6c67d02a2581e0ec979 SHA512 efd75af58b50522c28cdac7abd1fc56555bc1bb042512c90d8340c1ec09c5791b3872a305bf83723252bbde5855b75d958c041083457765c4cfd170732d09238
34
35 diff --git a/sys-libs/glibc/glibc-2.33-r1.ebuild b/sys-libs/glibc/glibc-2.33-r1.ebuild
36 deleted file mode 100644
37 index cdbca06cc5d5..000000000000
38 --- a/sys-libs/glibc/glibc-2.33-r1.ebuild
39 +++ /dev/null
40 @@ -1,1521 +0,0 @@
41 -# Copyright 1999-2021 Gentoo Authors
42 -# Distributed under the terms of the GNU General Public License v2
43 -
44 -EAPI=7
45 -
46 -PYTHON_COMPAT=( python3_{7,8,9,10} )
47 -TMPFILES_OPTIONAL=1
48 -
49 -inherit python-any-r1 prefix toolchain-funcs flag-o-matic gnuconfig \
50 - multilib systemd multiprocessing tmpfiles
51 -
52 -DESCRIPTION="GNU libc C library"
53 -HOMEPAGE="https://www.gnu.org/software/libc/"
54 -LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
55 -SLOT="2.2"
56 -
57 -EMULTILIB_PKG="true"
58 -
59 -# Gentoo patchset (ignored for live ebuilds)
60 -PATCH_VER=4
61 -PATCH_DEV=dilfridge
62 -
63 -if [[ ${PV} == 9999* ]]; then
64 - inherit git-r3
65 -else
66 - KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
67 - SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
68 - SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
69 -fi
70 -
71 -RELEASE_VER=${PV}
72 -
73 -GCC_BOOTSTRAP_VER=20201208
74 -
75 -LOCALE_GEN_VER=2.10
76 -
77 -SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${LOCALE_GEN_VER}.tar.gz"
78 -SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
79 -
80 -IUSE="audit caps cet compile-locales +crypt custom-cflags doc gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp +static-libs static-pie suid systemtap test vanilla"
81 -
82 -# Minimum kernel version that glibc requires
83 -MIN_KERN_VER="3.2.0"
84 -
85 -# Here's how the cross-compile logic breaks down ...
86 -# CTARGET - machine that will target the binaries
87 -# CHOST - machine that will host the binaries
88 -# CBUILD - machine that will build the binaries
89 -# If CTARGET != CHOST, it means you want a libc for cross-compiling.
90 -# If CHOST != CBUILD, it means you want to cross-compile the libc.
91 -# CBUILD = CHOST = CTARGET - native build/install
92 -# CBUILD != (CHOST = CTARGET) - cross-compile a native build
93 -# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
94 -# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
95 -# For install paths:
96 -# CHOST = CTARGET - install into /
97 -# CHOST != CTARGET - install into /usr/CTARGET/
98 -#
99 -export CBUILD=${CBUILD:-${CHOST}}
100 -export CTARGET=${CTARGET:-${CHOST}}
101 -if [[ ${CTARGET} == ${CHOST} ]] ; then
102 - if [[ ${CATEGORY} == cross-* ]] ; then
103 - export CTARGET=${CATEGORY#cross-}
104 - fi
105 -fi
106 -
107 -# Note [Disable automatic stripping]
108 -# Disabling automatic stripping for a few reasons:
109 -# - portage's attempt to strip breaks non-native binaries at least on
110 -# arm: bug #697428
111 -# - portage's attempt to strip libpthread.so.0 breaks gdb thread
112 -# enumeration: bug #697910. This is quite subtle:
113 -# * gdb uses glibc's libthread_db-1.0.so to enumerate threads.
114 -# * libthread_db-1.0.so needs access to libpthread.so.0 local symbols
115 -# via 'ps_pglobal_lookup' symbol defined in gdb.
116 -# * 'ps_pglobal_lookup' uses '.symtab' section table to resolve all
117 -# known symbols in 'libpthread.so.0'. Specifically 'nptl_version'
118 -# (unexported) is used to sanity check compatibility before enabling
119 -# debugging.
120 -# Also see https://sourceware.org/gdb/wiki/FAQ#GDB_does_not_see_any_threads_besides_the_one_in_which_crash_occurred.3B_or_SIGTRAP_kills_my_program_when_I_set_a_breakpoint
121 -# * normal 'strip' command trims '.symtab'
122 -# Thus our main goal here is to prevent 'libpthread.so.0' from
123 -# losing it's '.symtab' entries.
124 -# As Gentoo's strip does not allow us to pass less aggressive stripping
125 -# options and does not check the machine target we strip selectively.
126 -
127 -# We need a new-enough binutils/gcc to match upstream baseline.
128 -# Also we need to make sure our binutils/gcc supports TLS,
129 -# and that gcc already contains the hardened patches.
130 -# Lastly, let's avoid some openssh nastiness, bug 708224, as
131 -# convenience to our users.
132 -
133 -# gzip, grep, awk are needed by locale-gen, bug 740750
134 -
135 -BDEPEND="
136 - ${PYTHON_DEPS}
137 - >=app-misc/pax-utils-1.3.1
138 - sys-devel/bison
139 - doc? ( sys-apps/texinfo )
140 - !compile-locales? (
141 - app-arch/gzip
142 - sys-apps/grep
143 - virtual/awk
144 - )
145 -"
146 -COMMON_DEPEND="
147 - gd? ( media-libs/gd:2= )
148 - nscd? ( selinux? (
149 - audit? ( sys-process/audit )
150 - caps? ( sys-libs/libcap )
151 - ) )
152 - suid? ( caps? ( sys-libs/libcap ) )
153 - selinux? ( sys-libs/libselinux )
154 - systemtap? ( dev-util/systemtap )
155 -"
156 -DEPEND="${COMMON_DEPEND}
157 - compile-locales? (
158 - app-arch/gzip
159 - sys-apps/grep
160 - virtual/awk
161 - )
162 - test? ( >=net-dns/libidn2-2.3.0 )
163 -"
164 -RDEPEND="${COMMON_DEPEND}
165 - app-arch/gzip
166 - sys-apps/grep
167 - virtual/awk
168 - sys-apps/gentoo-functions
169 - !<app-misc/pax-utils-1.3.1
170 - !<net-misc/openssh-8.1_p1-r2
171 -"
172 -
173 -RESTRICT="!test? ( test )"
174 -
175 -if [[ ${CATEGORY} == cross-* ]] ; then
176 - BDEPEND+=" !headers-only? (
177 - >=${CATEGORY}/binutils-2.27
178 - >=${CATEGORY}/gcc-6
179 - )"
180 - [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
181 -else
182 - BDEPEND+="
183 - >=sys-devel/binutils-2.27
184 - >=sys-devel/gcc-6
185 - "
186 - DEPEND+=" virtual/os-headers "
187 - RDEPEND+="
188 - >=net-dns/libidn2-2.3.0
189 - vanilla? ( !sys-libs/timezone-data )
190 - "
191 - PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
192 -fi
193 -
194 -# Ignore tests whitelisted below
195 -GENTOO_GLIBC_XFAIL_TESTS="${GENTOO_GLIBC_XFAIL_TESTS:-yes}"
196 -
197 -# The following tests fail due to the Gentoo build system and are thus
198 -# executed but ignored:
199 -XFAIL_TEST_LIST=(
200 - # 9) Failures of unknown origin
201 - tst-latepthread
202 -
203 - # buggy test, assumes /dev/ and /dev/null on a single filesystem
204 - # 'mount --bind /dev/null /chroot/dev/null' breaks it.
205 - # https://sourceware.org/PR25909
206 - tst-support_descriptors
207 -
208 - # Flaky test, known to fail occasionally:
209 - # https://sourceware.org/PR19329
210 - # https://bugs.gentoo.org/719674#c12
211 - tst-stack4
212 -)
213 -
214 -#
215 -# Small helper functions
216 -#
217 -
218 -is_crosscompile() {
219 - [[ ${CHOST} != ${CTARGET} ]]
220 -}
221 -
222 -just_headers() {
223 - is_crosscompile && use headers-only
224 -}
225 -
226 -alt_prefix() {
227 - is_crosscompile && echo /usr/${CTARGET}
228 -}
229 -
230 -# This prefix is applicable to CHOST when building against this
231 -# glibc. It is baked into the library at configure time.
232 -host_eprefix() {
233 - is_crosscompile || echo "${EPREFIX}"
234 -}
235 -
236 -# This prefix is applicable to CBUILD when building against this
237 -# glibc. It determines the destination path at install time.
238 -build_eprefix() {
239 - is_crosscompile && echo "${EPREFIX}"
240 -}
241 -
242 -# We need to be able to set alternative headers for compiling for non-native
243 -# platform. Will also become useful for testing kernel-headers without screwing
244 -# up the whole system.
245 -alt_headers() {
246 - echo ${ALT_HEADERS:=$(alt_prefix)/usr/include}
247 -}
248 -
249 -alt_build_headers() {
250 - if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
251 - ALT_BUILD_HEADERS="$(host_eprefix)$(alt_headers)"
252 - if tc-is-cross-compiler ; then
253 - ALT_BUILD_HEADERS=${SYSROOT}$(alt_headers)
254 - if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then
255 - local header_path=$(echo '#include <linux/version.h>' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h')
256 - ALT_BUILD_HEADERS=${header_path%/linux/version.h}
257 - fi
258 - fi
259 - fi
260 - echo "${ALT_BUILD_HEADERS}"
261 -}
262 -
263 -alt_libdir() {
264 - echo $(alt_prefix)/$(get_libdir)
265 -}
266 -alt_usrlibdir() {
267 - echo $(alt_prefix)/usr/$(get_libdir)
268 -}
269 -
270 -builddir() {
271 - echo "${WORKDIR}/build-${ABI}-${CTARGET}-$1"
272 -}
273 -
274 -do_compile_test() {
275 - local ret save_cflags=${CFLAGS}
276 - CFLAGS+=" $1"
277 - shift
278 -
279 - pushd "${T}" >/dev/null
280 -
281 - rm -f glibc-test*
282 - printf '%b' "$*" > glibc-test.c
283 -
284 - # Most of the time CC is already set, but not in early sanity checks.
285 - nonfatal emake glibc-test CC="${CC-$(tc-getCC ${CTARGET})}"
286 - ret=$?
287 -
288 - popd >/dev/null
289 -
290 - CFLAGS=${save_cflags}
291 - return ${ret}
292 -}
293 -
294 -do_run_test() {
295 - local ret
296 -
297 - if [[ ${MERGE_TYPE} == "binary" ]] ; then
298 - # ignore build failures when installing a binary package #324685
299 - do_compile_test "" "$@" 2>/dev/null || return 0
300 - else
301 - if ! do_compile_test "" "$@" ; then
302 - ewarn "Simple build failed ... assuming this is desired #324685"
303 - return 0
304 - fi
305 - fi
306 -
307 - pushd "${T}" >/dev/null
308 -
309 - ./glibc-test
310 - ret=$?
311 - rm -f glibc-test*
312 -
313 - popd >/dev/null
314 -
315 - return ${ret}
316 -}
317 -
318 -setup_target_flags() {
319 - # This largely mucks with compiler flags. None of which should matter
320 - # when building up just the headers.
321 - just_headers && return 0
322 -
323 - case $(tc-arch) in
324 - x86)
325 - # -march needed for #185404 #199334
326 - # TODO: When creating the first glibc cross-compile, this test will
327 - # always fail as it does a full link which in turn requires glibc.
328 - # Probably also applies when changing multilib profile settings (e.g.
329 - # enabling x86 when the profile was amd64-only previously).
330 - # We could change main to _start and pass -nostdlib here so that we
331 - # only test the gcc code compilation. Or we could do a compile and
332 - # then look for the symbol via scanelf.
333 - 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'; then
334 - local t=${CTARGET_OPT:-${CTARGET}}
335 - t=${t%%-*}
336 - filter-flags '-march=*'
337 - export CFLAGS="-march=${t} ${CFLAGS}"
338 - einfo "Auto adding -march=${t} to CFLAGS #185404"
339 - fi
340 - ;;
341 - amd64)
342 - # -march needed for #185404 #199334
343 - # TODO: See cross-compile issues listed above for x86.
344 - [[ ${ABI} == x86 ]] &&
345 - 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'; then
346 - local t=${CTARGET_OPT:-${CTARGET}}
347 - t=${t%%-*}
348 - # Normally the target is x86_64-xxx, so turn that into the -march that
349 - # gcc actually accepts. #528708
350 - [[ ${t} == "x86_64" ]] && t="x86-64"
351 - filter-flags '-march=*'
352 - # ugly, ugly, ugly. ugly.
353 - CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}")
354 - export CFLAGS_x86="${CFLAGS_x86} -march=${t}"
355 - einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
356 - fi
357 - ;;
358 - mips)
359 - # The mips abi cannot support the GNU style hashes. #233233
360 - filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both
361 - ;;
362 - ppc|ppc64)
363 - # Many arch-specific implementations do not work on ppc with
364 - # cache-block not equal to 128 bytes. This breaks memset:
365 - # https://sourceware.org/PR26522
366 - # https://bugs.gentoo.org/737996
367 - # Use default -mcpu=. For ppc it means non-multiarch setup.
368 - filter-flags '-mcpu=*'
369 - ;;
370 - sparc)
371 - # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
372 - filter-flags "-fcall-used-g7"
373 - append-flags "-fcall-used-g6"
374 -
375 - local cpu
376 - case ${CTARGET} in
377 - sparc64-*)
378 - cpu="sparc64"
379 - case $(get-flag mcpu) in
380 - v9)
381 - # We need to force at least v9a because the base build doesn't
382 - # work with just v9.
383 - # https://sourceware.org/bugzilla/show_bug.cgi?id=19477
384 - append-flags "-Wa,-xarch=v9a"
385 - ;;
386 - esac
387 - ;;
388 - sparc-*)
389 - case $(get-flag mcpu) in
390 - v8|supersparc|hypersparc|leon|leon3)
391 - cpu="sparcv8"
392 - ;;
393 - *)
394 - cpu="sparcv9"
395 - ;;
396 - esac
397 - ;;
398 - esac
399 - [[ -n ${cpu} ]] && CTARGET_OPT="${cpu}-${CTARGET#*-}"
400 - ;;
401 - esac
402 -}
403 -
404 -setup_flags() {
405 - # Make sure host make.conf doesn't pollute us
406 - if is_crosscompile || tc-is-cross-compiler ; then
407 - CHOST=${CTARGET} strip-unsupported-flags
408 - fi
409 -
410 - # Store our CFLAGS because it's changed depending on which CTARGET
411 - # we are building when pulling glibc on a multilib profile
412 - CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
413 - CFLAGS=${CFLAGS_BASE}
414 - CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}}
415 - CXXFLAGS=${CXXFLAGS_BASE}
416 - ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
417 - ASFLAGS=${ASFLAGS_BASE}
418 -
419 - # Allow users to explicitly avoid flag sanitization via
420 - # USE=custom-cflags.
421 - if ! use custom-cflags; then
422 - # Over-zealous CFLAGS can often cause problems. What may work for one
423 - # person may not work for another. To avoid a large influx of bugs
424 - # relating to failed builds, we strip most CFLAGS out to ensure as few
425 - # problems as possible.
426 - strip-flags
427 - # Lock glibc at -O2; we want to be conservative here.
428 - filter-flags '-O?'
429 - append-flags -O2
430 - fi
431 - strip-unsupported-flags
432 - filter-flags -m32 -m64 '-mabi=*'
433 -
434 - # glibc aborts if rpath is set by LDFLAGS
435 - filter-ldflags '-Wl,-rpath=*'
436 -
437 - # ld can't use -r & --relax at the same time, bug #788901
438 - # https://sourceware.org/PR27837
439 - filter-ldflags '-Wl,--relax'
440 -
441 - # #492892
442 - filter-flags -frecord-gcc-switches
443 -
444 - unset CBUILD_OPT CTARGET_OPT
445 - if use multilib ; then
446 - CTARGET_OPT=$(get_abi_CTARGET)
447 - [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
448 - fi
449 -
450 - setup_target_flags
451 -
452 - if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
453 - CBUILD_OPT=${CTARGET_OPT}
454 - fi
455 -
456 - # glibc's headers disallow -O0 and fail at build time:
457 - # include/libc-symbols.h:75:3: #error "glibc cannot be compiled without optimization"
458 - replace-flags -O0 -O1
459 -
460 - filter-flags '-fstack-protector*'
461 -}
462 -
463 -want_tls() {
464 - # Archs that can use TLS (Thread Local Storage)
465 - case $(tc-arch) in
466 - x86)
467 - # requires i486 or better #106556
468 - [[ ${CTARGET} == i[4567]86* ]] && return 0
469 - return 1
470 - ;;
471 - esac
472 - return 0
473 -}
474 -
475 -want__thread() {
476 - want_tls || return 1
477 -
478 - # For some reason --with-tls --with__thread is causing segfaults on sparc32.
479 - [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
480 -
481 - [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
482 -
483 - # only test gcc -- can't test linking yet
484 - tc-has-tls -c ${CTARGET}
485 - WANT__THREAD=$?
486 -
487 - return ${WANT__THREAD}
488 -}
489 -
490 -use_multiarch() {
491 - # Allow user to disable runtime arch detection in multilib.
492 - use multiarch || return 1
493 - # Make sure binutils is new enough to support indirect functions,
494 - # #336792. This funky sed supports gold and bfd linkers.
495 - local bver nver
496 - bver=$($(tc-getLD ${CTARGET}) -v | sed -n -r '1{s:[^0-9]*::;s:^([0-9.]*).*:\1:;p}')
497 - case $(tc-arch ${CTARGET}) in
498 - amd64|x86) nver="2.20" ;;
499 - arm) nver="2.22" ;;
500 - hppa) nver="2.23" ;;
501 - ppc|ppc64) nver="2.20" ;;
502 - # ifunc support was added in 2.23, but glibc also needs
503 - # machinemode which is in 2.24.
504 - s390) nver="2.24" ;;
505 - sparc) nver="2.21" ;;
506 - *) return 1 ;;
507 - esac
508 - ver_test ${bver} -ge ${nver}
509 -}
510 -
511 -# Setup toolchain variables that had historically been defined in the
512 -# profiles for these archs.
513 -setup_env() {
514 - # silly users
515 - unset LD_RUN_PATH
516 - unset LD_ASSUME_KERNEL
517 -
518 - if is_crosscompile || tc-is-cross-compiler ; then
519 - multilib_env ${CTARGET_OPT:-${CTARGET}}
520 -
521 - if ! use multilib ; then
522 - MULTILIB_ABIS=${DEFAULT_ABI}
523 - else
524 - MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
525 - fi
526 -
527 - # If the user has CFLAGS_<CTARGET> in their make.conf, use that,
528 - # and fall back on CFLAGS.
529 - local VAR=CFLAGS_${CTARGET//[-.]/_}
530 - CFLAGS=${!VAR-${CFLAGS}}
531 - einfo " $(printf '%15s' 'Manual CFLAGS:') ${CFLAGS}"
532 - fi
533 -
534 - setup_flags
535 -
536 - export ABI=${ABI:-${DEFAULT_ABI:-default}}
537 -
538 - if just_headers ; then
539 - # Avoid mixing host's CC and target's CFLAGS_${ABI}:
540 - # At this bootstrap stage we have only binutils for
541 - # target but not compiler yet.
542 - einfo "Skip CC ABI injection. We can't use (cross-)compiler yet."
543 - return 0
544 - fi
545 - local VAR=CFLAGS_${ABI}
546 - # We need to export CFLAGS with abi information in them because glibc's
547 - # configure script checks CFLAGS for some targets (like mips). Keep
548 - # around the original clean value to avoid appending multiple ABIs on
549 - # top of each other.
550 - : ${__GLIBC_CC:=$(tc-getCC ${CTARGET})}
551 - export __GLIBC_CC CC="${__GLIBC_CC} ${!VAR}"
552 - einfo " $(printf '%15s' 'Manual CC:') ${CC}"
553 -}
554 -
555 -foreach_abi() {
556 - setup_env
557 -
558 - local ret=0
559 - local abilist=""
560 - if use multilib ; then
561 - abilist=$(get_install_abis)
562 - else
563 - abilist=${DEFAULT_ABI}
564 - fi
565 - local -x ABI
566 - for ABI in ${abilist:-default} ; do
567 - setup_env
568 - einfo "Running $1 for ABI ${ABI}"
569 - $1
570 - : $(( ret |= $? ))
571 - done
572 - return ${ret}
573 -}
574 -
575 -glibc_banner() {
576 - local b="Gentoo ${PVR}"
577 - [[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" p${PATCH_VER}"
578 - echo "${b}"
579 -}
580 -
581 -# The following Kernel version handling functions are mostly copied from portage
582 -# source. It's better not to use linux-info.eclass here since a) it adds too
583 -# much magic, see bug 326693 for some of the arguments, and b) some of the
584 -# functions are just not provided.
585 -
586 -g_get_running_KV() {
587 - uname -r
588 - return $?
589 -}
590 -
591 -g_KV_major() {
592 - [[ -z $1 ]] && return 1
593 - local KV=$@
594 - echo "${KV%%.*}"
595 -}
596 -
597 -g_KV_minor() {
598 - [[ -z $1 ]] && return 1
599 - local KV=$@
600 - KV=${KV#*.}
601 - echo "${KV%%.*}"
602 -}
603 -
604 -g_KV_micro() {
605 - [[ -z $1 ]] && return 1
606 - local KV=$@
607 - KV=${KV#*.*.}
608 - echo "${KV%%[^[:digit:]]*}"
609 -}
610 -
611 -g_KV_to_int() {
612 - [[ -z $1 ]] && return 1
613 - local KV_MAJOR=$(g_KV_major "$1")
614 - local KV_MINOR=$(g_KV_minor "$1")
615 - local KV_MICRO=$(g_KV_micro "$1")
616 - local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO ))
617 -
618 - # We make version 2.2.0 the minimum version we will handle as
619 - # a sanity check ... if its less, we fail ...
620 - if [[ ${KV_int} -ge 131584 ]] ; then
621 - echo "${KV_int}"
622 - return 0
623 - fi
624 - return 1
625 -}
626 -
627 -g_int_to_KV() {
628 - local version=$1 major minor micro
629 - major=$((version / 65536))
630 - minor=$(((version % 65536) / 256))
631 - micro=$((version % 256))
632 - echo ${major}.${minor}.${micro}
633 -}
634 -
635 -eend_KV() {
636 - [[ $(g_KV_to_int $1) -ge $(g_KV_to_int $2) ]]
637 - eend $?
638 -}
639 -
640 -get_kheader_version() {
641 - printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \
642 - $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \
643 - tail -n 1
644 -}
645 -
646 -# We collect all sanity checks here. Consistency is not guranteed between
647 -# pkg_ and src_ phases, so we call this function both in pkg_pretend and in
648 -# src_unpack.
649 -sanity_prechecks() {
650 - # Prevent native builds from downgrading
651 - if [[ ${MERGE_TYPE} != "buildonly" ]] && \
652 - [[ -z ${ROOT} ]] && \
653 - [[ ${CBUILD} == ${CHOST} ]] && \
654 - [[ ${CHOST} == ${CTARGET} ]] ; then
655 -
656 - # The high rev # is to allow people to downgrade between -r#
657 - # versions. We want to block 2.20->2.19, but 2.20-r3->2.20-r2
658 - # should be fine. Hopefully we never actually use a r# this
659 - # high.
660 - if has_version ">${CATEGORY}/${P}-r10000" ; then
661 - eerror "Sanity check to keep you from breaking your system:"
662 - eerror " Downgrading glibc is not supported and a sure way to destruction."
663 - [[ ${I_ALLOW_TO_BREAK_MY_SYSTEM} = yes ]] || die "Aborting to save your system."
664 - fi
665 -
666 - if ! do_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' ; then
667 - eerror "Your old kernel is broken. You need to update it to a newer"
668 - eerror "version as syscall(<bignum>) will break. See bug 279260."
669 - die "Old and broken kernel."
670 - fi
671 - fi
672 -
673 - # Users have had a chance to phase themselves, time to give em the boot
674 - if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
675 - eerror "You still haven't deleted ${EROOT}/etc/locales.build."
676 - eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
677 - die "Lazy upgrader detected"
678 - fi
679 -
680 - if [[ ${CTARGET} == i386-* ]] ; then
681 - eerror "i386 CHOSTs are no longer supported."
682 - eerror "Chances are you don't actually want/need i386."
683 - eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml"
684 - die "Please fix your CHOST"
685 - fi
686 -
687 - if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
688 - ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
689 - ewarn "This will result in a 50% performance penalty when running with a 32bit"
690 - ewarn "hypervisor, which is probably not what you want."
691 - fi
692 -
693 - # ABI-specific checks follow here. Hey, we have a lot more specific conditions that
694 - # we test for...
695 - if ! is_crosscompile ; then
696 - if use amd64 && use multilib && [[ ${MERGE_TYPE} != "binary" ]] ; then
697 - ebegin "Checking that IA32 emulation is enabled in the running kernel"
698 - echo 'int main(){return 0;}' > "${T}/check-ia32-emulation.c"
699 - local STAT
700 - if "${CC-${CHOST}-gcc}" ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32"; then
701 - "${T}/check-ia32-emulation.elf32"
702 - STAT=$?
703 - else
704 - # Don't fail here to allow single->multi ABI switch
705 - # or recover from breakage like bug #646424
706 - ewarn "Failed to compile the ABI test. Broken host glibc?"
707 - STAT=0
708 - fi
709 - rm -f "${T}/check-ia32-emulation.elf32"
710 - eend $STAT
711 - [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION must be enabled in the kernel to compile a multilib glibc."
712 - fi
713 -
714 - fi
715 -
716 - # When we actually have to compile something...
717 - if ! just_headers ; then
718 - ebegin "Checking gcc for __thread support"
719 - if ! eend $(want__thread ; echo $?) ; then
720 - echo
721 - eerror "Could not find a gcc that supports the __thread directive!"
722 - eerror "Please update your binutils/gcc and try again."
723 - die "No __thread support in gcc!"
724 - fi
725 -
726 - if [[ ${CTARGET} == *-linux* ]] ; then
727 - local run_kv build_kv want_kv
728 -
729 - run_kv=$(g_get_running_KV)
730 - build_kv=$(g_int_to_KV $(get_kheader_version))
731 - want_kv=${MIN_KERN_VER}
732 -
733 - if ! is_crosscompile && ! tc-is-cross-compiler ; then
734 - # Building fails on an non-supporting kernel
735 - ebegin "Checking running kernel version (${run_kv} >= ${want_kv})"
736 - if ! eend_KV ${run_kv} ${want_kv} ; then
737 - echo
738 - eerror "You need a kernel of at least ${want_kv}!"
739 - die "Kernel version too low!"
740 - fi
741 - fi
742 -
743 - ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})"
744 - if ! eend_KV ${build_kv} ${want_kv} ; then
745 - echo
746 - eerror "You need linux-headers of at least ${want_kv}!"
747 - die "linux-headers version too low!"
748 - fi
749 - fi
750 - fi
751 -}
752 -
753 -#
754 -# the phases
755 -#
756 -
757 -# pkg_pretend
758 -
759 -pkg_pretend() {
760 - # All the checks...
761 - einfo "Checking general environment sanity."
762 - sanity_prechecks
763 -}
764 -
765 -pkg_setup() {
766 - # see bug 682570
767 - [[ -z ${BOOTSTRAP_RAP} ]] && python-any-r1_pkg_setup
768 -}
769 -
770 -# src_unpack
771 -
772 -src_unpack() {
773 - # Consistency is not guaranteed between pkg_ and src_ ...
774 - sanity_prechecks
775 -
776 - use multilib-bootstrap && unpack gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz
777 -
778 - setup_env
779 -
780 - if [[ ${PV} == 9999* ]] ; then
781 - EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/glibc-patches.git"
782 - EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
783 - git-r3_src_unpack
784 - mv patches-git/9999 patches || die
785 -
786 - EGIT_REPO_URI="https://sourceware.org/git/glibc.git"
787 - EGIT_CHECKOUT_DIR=${S}
788 - git-r3_src_unpack
789 - else
790 - unpack ${P}.tar.xz
791 -
792 - cd "${WORKDIR}" || die
793 - unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz
794 - fi
795 -
796 - cd "${WORKDIR}" || die
797 - unpack locale-gen-${LOCALE_GEN_VER}.tar.gz
798 -}
799 -
800 -src_prepare() {
801 - local patchsetname
802 - if ! use vanilla ; then
803 - if [[ ${PV} == 9999* ]] ; then
804 - patchsetname="from git master"
805 - else
806 - patchsetname="${RELEASE_VER}-${PATCH_VER}"
807 - fi
808 - einfo "Applying Gentoo Glibc Patchset ${patchsetname}"
809 - eapply "${WORKDIR}"/patches
810 - einfo "Done."
811 - fi
812 -
813 - default
814 -
815 - gnuconfig_update
816 -
817 - cd "${WORKDIR}"
818 - find . -name configure -exec touch {} +
819 -
820 - # move the external locale-gen to its old place
821 - mkdir extra || die
822 - mv locale-gen-${LOCALE_GEN_VER} extra/locale || die
823 -
824 - eprefixify extra/locale/locale-gen
825 -
826 - # Fix permissions on some of the scripts.
827 - chmod u+x "${S}"/scripts/*.sh
828 -
829 - cd "${S}"
830 -}
831 -
832 -glibc_do_configure() {
833 - # Glibc does not work with gold (for various reasons) #269274.
834 - tc-ld-disable-gold
835 -
836 - # CXX isnt handled by the multilib system, so if we dont unset here
837 - # we accumulate crap across abis
838 - unset CXX
839 -
840 - einfo "Configuring glibc for nptl"
841 -
842 - if use doc ; then
843 - export MAKEINFO=makeinfo
844 - else
845 - export MAKEINFO=/dev/null
846 - fi
847 -
848 - local v
849 - for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM READELF; do
850 - einfo " $(printf '%15s' ${v}:) ${!v}"
851 - done
852 -
853 - # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760
854 - # To build .S (assembly) files with the same ABI-specific flags
855 - # upstream currently recommends adding CFLAGS to CC/CXX:
856 - # https://sourceware.org/PR23273
857 - # Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS
858 - # and breaks multiarch support. See 659030#c3 for an example.
859 - # The glibc configure script doesn't properly use LDFLAGS all the time.
860 - export CC="$(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS}"
861 - einfo " $(printf '%15s' 'Manual CC:') ${CC}"
862 -
863 - # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
864 - export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS) ${CFLAGS}"
865 -
866 - if is_crosscompile; then
867 - # Assume worst-case bootstrap: glibc is buil first time
868 - # when ${CTARGET}-g++ is not available yet. We avoid
869 - # building auxiliary programs that require C++: bug #683074
870 - # It should not affect final result.
871 - export libc_cv_cxx_link_ok=no
872 - # The line above has the same effect. We set CXX explicitly
873 - # to make build logs less confusing.
874 - export CXX=
875 - fi
876 - einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
877 -
878 - # Always use tuple-prefixed toolchain. For non-native ABI glibc's configure
879 - # can't detect them automatically due to ${CHOST} mismatch and fallbacks
880 - # to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup().
881 - export NM="$(tc-getNM ${CTARGET})"
882 - export READELF="$(tc-getREADELF ${CTARGET})"
883 - einfo " $(printf '%15s' 'Manual NM:') ${NM}"
884 - einfo " $(printf '%15s' 'Manual READELF:') ${READELF}"
885 -
886 - echo
887 -
888 - local myconf=()
889 -
890 - case ${CTARGET} in
891 - m68k*)
892 - # setjmp() is not compatible with stack protection:
893 - # https://sourceware.org/PR24202
894 - myconf+=( --enable-stack-protector=no )
895 - ;;
896 - *)
897 - # Use '=strong' instead of '=all' to protect only functions
898 - # worth protecting from stack smashes.
899 - # '=all' is also known to have a problem in IFUNC resolution
900 - # tests: https://sourceware.org/PR25680, bug #712356.
901 - myconf+=( --enable-stack-protector=$(usex ssp strong no) )
902 - ;;
903 - esac
904 - myconf+=( --enable-stackguard-randomization )
905 -
906 - # Keep a whitelist of targets supporing IFUNC. glibc's ./configure
907 - # is not robust enough to detect proper support:
908 - # https://bugs.gentoo.org/641216
909 - # https://sourceware.org/PR22634#c0
910 - case $(tc-arch ${CTARGET}) in
911 - # Keep whitelist of targets where autodetection mostly works.
912 - amd64|x86|sparc|ppc|ppc64|arm|arm64|s390) ;;
913 - # Blacklist everywhere else
914 - *) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;;
915 - esac
916 -
917 - # Enable Intel Control-flow Enforcement Technology on amd64 if requested
918 - case ${CTARGET} in
919 - x86_64-*) myconf+=( $(use_enable cet) ) ;;
920 - *) ;;
921 - esac
922 -
923 - [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp )
924 -
925 - myconf+=( --enable-kernel=${MIN_KERN_VER} )
926 -
927 - # Since SELinux support is only required for nscd, only enable it if:
928 - # 1. USE selinux
929 - # 2. only for the primary ABI on multilib systems
930 - # 3. Not a crosscompile
931 - if ! is_crosscompile && use selinux ; then
932 - if use multilib ; then
933 - if is_final_abi ; then
934 - myconf+=( --with-selinux )
935 - else
936 - myconf+=( --without-selinux )
937 - fi
938 - else
939 - myconf+=( --with-selinux )
940 - fi
941 - else
942 - myconf+=( --without-selinux )
943 - fi
944 -
945 - # Force a few tests where we always know the answer but
946 - # configure is incapable of finding it.
947 - if is_crosscompile ; then
948 - export \
949 - libc_cv_c_cleanup=yes \
950 - libc_cv_forced_unwind=yes
951 - fi
952 -
953 - myconf+=(
954 - --without-cvs
955 - --disable-werror
956 - --enable-bind-now
957 - --build=${CBUILD_OPT:-${CBUILD}}
958 - --host=${CTARGET_OPT:-${CTARGET}}
959 - $(use_enable profile)
960 - $(use_with gd)
961 - --with-headers=$(build_eprefix)$(alt_build_headers)
962 - --prefix="$(host_eprefix)/usr"
963 - --sysconfdir="$(host_eprefix)/etc"
964 - --localstatedir="$(host_eprefix)/var"
965 - --libdir='$(prefix)'/$(get_libdir)
966 - --mandir='$(prefix)'/share/man
967 - --infodir='$(prefix)'/share/info
968 - --libexecdir='$(libdir)'/misc/glibc
969 - --with-bugurl=https://bugs.gentoo.org/
970 - --with-pkgversion="$(glibc_banner)"
971 - $(use_enable crypt)
972 - $(use_multiarch || echo --disable-multi-arch)
973 - $(use_enable static-pie)
974 - $(use_enable systemtap)
975 - $(use_enable nscd)
976 -
977 - # locale data is arch-independent
978 - # https://bugs.gentoo.org/753740
979 - libc_cv_complocaledir='${exec_prefix}/lib/locale'
980 -
981 - # -march= option tricks build system to infer too
982 - # high ISA level: https://sourceware.org/PR27318
983 - libc_cv_include_x86_isa_level=no
984 - # Explicit override of https://sourceware.org/PR27991
985 - # exposes a bug in glibc's configure:
986 - # https://sourceware.org/PR27991
987 - libc_cv_have_x86_lahf_sahf=no
988 - libc_cv_have_x86_movbe=no
989 -
990 - ${EXTRA_ECONF}
991 - )
992 -
993 - # We rely on sys-libs/timezone-data for timezone tools normally.
994 - myconf+=( $(use_enable vanilla timezone-tools) )
995 -
996 - # These libs don't have configure flags.
997 - ac_cv_lib_audit_audit_log_user_avc_message=$(usex audit || echo no)
998 - ac_cv_lib_cap_cap_init=$(usex caps || echo no)
999 -
1000 - # There is no configure option for this and we need to export it
1001 - # since the glibc build will re-run configure on itself
1002 - export libc_cv_rootsbindir="$(host_eprefix)/sbin"
1003 - export libc_cv_slibdir="$(host_eprefix)/$(get_libdir)"
1004 -
1005 - # We take care of patching our binutils to use both hash styles,
1006 - # and many people like to force gnu hash style only, so disable
1007 - # this overriding check. #347761
1008 - export libc_cv_hashstyle=no
1009 -
1010 - local builddir=$(builddir nptl)
1011 - mkdir -p "${builddir}"
1012 - cd "${builddir}"
1013 - set -- "${S}"/configure "${myconf[@]}"
1014 - echo "$@"
1015 - "$@" || die "failed to configure glibc"
1016 -
1017 - # ia64 static cross-compilers are a pita in so much that they
1018 - # can't produce static ELFs (as the libgcc.a is broken). so
1019 - # disable building of the programs for those targets if it
1020 - # doesn't work.
1021 - # XXX: We could turn this into a compiler test, but ia64 is
1022 - # the only one that matters, so this should be fine for now.
1023 - if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then
1024 - sed -i '1i+link-static = touch $@' config.make
1025 - fi
1026 -
1027 - # If we're trying to migrate between ABI sets, we need
1028 - # to lie and use a local copy of gcc. Like if the system
1029 - # is built with MULTILIB_ABIS="amd64 x86" but we want to
1030 - # add x32 to it, gcc/glibc don't yet support x32.
1031 - #
1032 - if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib-bootstrap ; then
1033 - echo 'main(){}' > "${T}"/test.c
1034 - if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then
1035 - sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die
1036 - fi
1037 - fi
1038 -}
1039 -
1040 -glibc_headers_configure() {
1041 - export ABI=default
1042 -
1043 - local builddir=$(builddir "headers")
1044 - mkdir -p "${builddir}"
1045 - cd "${builddir}"
1046 -
1047 - # if we don't have a compiler yet, we can't really test it now ...
1048 - # hopefully they don't affect header generation, so let's hope for
1049 - # the best here ...
1050 - local v vars=(
1051 - ac_cv_header_cpuid_h=yes
1052 - libc_cv_{386,390,alpha,arm,hppa,ia64,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes
1053 - libc_cv_asm_cfi_directives=yes
1054 - libc_cv_broken_visibility_attribute=no
1055 - libc_cv_c_cleanup=yes
1056 - libc_cv_compiler_powerpc64le_binary128_ok=yes
1057 - libc_cv_forced_unwind=yes
1058 - libc_cv_gcc___thread=yes
1059 - libc_cv_mlong_double_128=yes
1060 - libc_cv_mlong_double_128ibm=yes
1061 - libc_cv_ppc_machine=yes
1062 - libc_cv_ppc_rel16=yes
1063 - libc_cv_predef_fortify_source=no
1064 - libc_cv_target_power8_ok=yes
1065 - libc_cv_visibility_attribute=yes
1066 - libc_cv_z_combreloc=yes
1067 - libc_cv_z_execstack=yes
1068 - libc_cv_z_initfirst=yes
1069 - libc_cv_z_nodelete=yes
1070 - libc_cv_z_nodlopen=yes
1071 - libc_cv_z_relro=yes
1072 - libc_mips_abi=${ABI}
1073 - libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard)
1074 - # These libs don't have configure flags.
1075 - ac_cv_lib_audit_audit_log_user_avc_message=no
1076 - ac_cv_lib_cap_cap_init=no
1077 - )
1078 -
1079 - einfo "Forcing cached settings:"
1080 - for v in "${vars[@]}" ; do
1081 - einfo " ${v}"
1082 - export ${v}
1083 - done
1084 -
1085 - local headers_only_arch_CPPFLAGS=()
1086 -
1087 - # Blow away some random CC settings that screw things up. #550192
1088 - if [[ -d ${S}/sysdeps/mips ]]; then
1089 - pushd "${S}"/sysdeps/mips >/dev/null
1090 - sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die
1091 - sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die
1092 -
1093 - # Force the mips ABI to the default. This is OK because the set of
1094 - # installed headers in this phase is the same between the 3 ABIs.
1095 - # If this ever changes, this hack will break, but that's unlikely
1096 - # as glibc discourages that behavior.
1097 - # https://crbug.com/647033
1098 - sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die
1099 -
1100 - popd >/dev/null
1101 - fi
1102 -
1103 - case ${CTARGET} in
1104 - riscv*)
1105 - # RISC-V interrogates the compiler to determine which target to
1106 - # build. If building the headers then we don't strictly need a
1107 - # RISC-V compiler, so the built-in definitions that are provided
1108 - # along with all RISC-V compiler might not exist. This causes
1109 - # glibc's RISC-V preconfigure script to blow up. Since we're just
1110 - # building the headers any value will actually work here, so just
1111 - # pick the standard one (rv64g/lp64d) to make the build scripts
1112 - # happy for now -- the headers are all the same anyway so it
1113 - # doesn't matter.
1114 - headers_only_arch_CPPFLAGS+=(
1115 - -D__riscv_xlen=64
1116 - -D__riscv_flen=64
1117 - -D__riscv_float_abi_double=1
1118 - -D__riscv_atomic=1
1119 - ) ;;
1120 - esac
1121 -
1122 - local myconf=()
1123 - myconf+=(
1124 - --disable-sanity-checks
1125 - --enable-hacker-mode
1126 - --without-cvs
1127 - --disable-werror
1128 - --enable-bind-now
1129 - --build=${CBUILD_OPT:-${CBUILD}}
1130 - --host=${CTARGET_OPT:-${CTARGET}}
1131 - --with-headers=$(build_eprefix)$(alt_build_headers)
1132 - --prefix="$(host_eprefix)/usr"
1133 - ${EXTRA_ECONF}
1134 - )
1135 -
1136 - # Nothing is compiled here which would affect the headers for the target.
1137 - # So forcing CC/CFLAGS is sane.
1138 - local headers_only_CC=$(tc-getBUILD_CC)
1139 - local headers_only_CFLAGS="-O1 -pipe"
1140 - local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}"
1141 - local headers_only_LDFLAGS=""
1142 - set -- "${S}"/configure "${myconf[@]}"
1143 - echo \
1144 - "CC=${headers_only_CC}" \
1145 - "CFLAGS=${headers_only_CFLAGS}" \
1146 - "CPPFLAGS=${headers_only_CPPFLAGS}" \
1147 - "LDFLAGS=${headers_only_LDFLAGS}" \
1148 - "$@"
1149 - CC=${headers_only_CC} \
1150 - CFLAGS=${headers_only_CFLAGS} \
1151 - CPPFLAGS=${headers_only_CPPFLAGS} \
1152 - LDFLAGS="" \
1153 - "$@" || die "failed to configure glibc"
1154 -}
1155 -
1156 -do_src_configure() {
1157 - if just_headers ; then
1158 - glibc_headers_configure
1159 - else
1160 - glibc_do_configure nptl
1161 - fi
1162 -}
1163 -
1164 -src_configure() {
1165 - foreach_abi do_src_configure
1166 -}
1167 -
1168 -do_src_compile() {
1169 - emake -C "$(builddir nptl)"
1170 -}
1171 -
1172 -src_compile() {
1173 - if just_headers ; then
1174 - return
1175 - fi
1176 -
1177 - foreach_abi do_src_compile
1178 -}
1179 -
1180 -glibc_src_test() {
1181 - cd "$(builddir nptl)"
1182 -
1183 - local myxfailparams=""
1184 - if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then
1185 - for myt in ${XFAIL_TEST_LIST[@]} ; do
1186 - myxfailparams+="test-xfail-${myt}=yes "
1187 - done
1188 - fi
1189 -
1190 - # sandbox does not understand unshare() and prevents
1191 - # writes to /proc/, which makes many tests fail
1192 -
1193 - SANDBOX_ON=0 LD_PRELOAD= emake ${myxfailparams} check
1194 -}
1195 -
1196 -do_src_test() {
1197 - local ret=0
1198 -
1199 - glibc_src_test
1200 - : $(( ret |= $? ))
1201 -
1202 - return ${ret}
1203 -}
1204 -
1205 -src_test() {
1206 - if just_headers ; then
1207 - return
1208 - fi
1209 -
1210 - # Give tests more time to complete.
1211 - export TIMEOUTFACTOR=5
1212 -
1213 - foreach_abi do_src_test || die "tests failed"
1214 -}
1215 -
1216 -run_locale_gen() {
1217 - # if the host locales.gen contains no entries, we'll install everything
1218 - local root="$1"
1219 - local inplace=""
1220 -
1221 - if [[ "${root}" == "--inplace-glibc" ]] ; then
1222 - inplace="--inplace-glibc"
1223 - root="$2"
1224 - fi
1225 -
1226 - local locale_list="${root}/etc/locale.gen"
1227 -
1228 - pushd "${ED}"/$(get_libdir) >/dev/null
1229 -
1230 - if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
1231 - [[ -z ${inplace} ]] && ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
1232 - locale_list="${root}/usr/share/i18n/SUPPORTED"
1233 - fi
1234 -
1235 - set -- locale-gen ${inplace} --jobs $(makeopts_jobs) --config "${locale_list}" \
1236 - --destdir "${root}"
1237 - echo "$@"
1238 - "$@"
1239 -
1240 - popd >/dev/null
1241 -}
1242 -
1243 -glibc_do_src_install() {
1244 - local builddir=$(builddir nptl)
1245 - cd "${builddir}"
1246 -
1247 - emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install
1248 -
1249 - # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support
1250 - # which come without headers etc. Only needed for binary packages since the
1251 - # external net-libs/libnsl has increased soversion. Keep only versioned libraries.
1252 - find "${D}" -name "libnsl.a" -delete
1253 - find "${D}" -name "libnsl.so" -delete
1254 -
1255 - # Normally upstream_pv is ${PV}. Live ebuilds are exception, there we need
1256 - # to infer upstream version:
1257 - # '#define VERSION "2.26.90"' -> '2.26.90'
1258 - local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
1259 -
1260 - # Avoid stripping binaries not targeted by ${CHOST}. Or else
1261 - # ${CHOST}-strip would break binaries build for ${CTARGET}.
1262 - is_crosscompile && dostrip -x /
1263 - # gdb thread introspection relies on local libpthreas symbols. stripping breaks it
1264 - # See Note [Disable automatic stripping]
1265 - dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so
1266 -
1267 - if [[ -e ${ED}/$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
1268 - # Move versioned .a file out of libdir to evade portage QA checks
1269 - # instead of using gen_usr_ldscript(). We fix ldscript as:
1270 - # "GROUP ( /usr/lib64/libm-<pv>.a ..." -> "GROUP ( /usr/lib64/glibc-<pv>/libm-<pv>.a ..."
1271 - sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"/$(alt_usrlibdir)/libm.a || die
1272 - dodir $(alt_usrlibdir)/${P}
1273 - mv "${ED}"/$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"/$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die
1274 - fi
1275 -
1276 - # We'll take care of the cache ourselves
1277 - rm -f "${ED}"/etc/ld.so.cache
1278 -
1279 - # Everything past this point just needs to be done once ...
1280 - is_final_abi || return 0
1281 -
1282 - # Make sure the non-native interp can be found on multilib systems even
1283 - # if the main library set isn't installed into the right place. Maybe
1284 - # we should query the active gcc for info instead of hardcoding it ?
1285 - local i ldso_abi ldso_name
1286 - local ldso_abi_list=(
1287 - # x86
1288 - amd64 /lib64/ld-linux-x86-64.so.2
1289 - x32 /libx32/ld-linux-x32.so.2
1290 - x86 /lib/ld-linux.so.2
1291 - # mips
1292 - o32 /lib/ld.so.1
1293 - n32 /lib32/ld.so.1
1294 - n64 /lib64/ld.so.1
1295 - # powerpc
1296 - ppc /lib/ld.so.1
1297 - # riscv
1298 - ilp32d /lib/ld-linux-riscv32-ilp32d.so.1
1299 - ilp32 /lib/ld-linux-riscv32-ilp32.so.1
1300 - lp64d /lib/ld-linux-riscv64-lp64d.so.1
1301 - lp64 /lib/ld-linux-riscv64-lp64.so.1
1302 - # s390
1303 - s390 /lib/ld.so.1
1304 - s390x /lib/ld64.so.1
1305 - # sparc
1306 - sparc32 /lib/ld-linux.so.2
1307 - sparc64 /lib64/ld-linux.so.2
1308 - )
1309 - case $(tc-endian) in
1310 - little)
1311 - ldso_abi_list+=(
1312 - # arm
1313 - arm64 /lib/ld-linux-aarch64.so.1
1314 - # ELFv2 (glibc does not support ELFv1 on LE)
1315 - ppc64 /lib64/ld64.so.2
1316 - )
1317 - ;;
1318 - big)
1319 - ldso_abi_list+=(
1320 - # arm
1321 - arm64 /lib/ld-linux-aarch64_be.so.1
1322 - # ELFv1 (glibc does not support ELFv2 on BE)
1323 - ppc64 /lib64/ld64.so.1
1324 - )
1325 - ;;
1326 - esac
1327 - if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then
1328 - dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib
1329 - fi
1330 - for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do
1331 - ldso_abi=${ldso_abi_list[i]}
1332 - has ${ldso_abi} $(get_install_abis) || continue
1333 -
1334 - ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}"
1335 - if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then
1336 - dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name}
1337 - fi
1338 - done
1339 -
1340 - # In the LSB 5.0 definition, someone had the excellent idea to "standardize"
1341 - # the runtime loader name, see also https://xkcd.com/927/
1342 - # Normally, in Gentoo one should never come across executables that require this.
1343 - # However, binary commercial packages are known to adhere to weird practices.
1344 - # https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-AMD64/LSB-Core-AMD64.html#BASELIB
1345 - local lsb_ldso_name native_ldso_name lsb_ldso_abi
1346 - local lsb_ldso_abi_list=(
1347 - # x86
1348 - amd64 ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
1349 - )
1350 - for (( i = 0; i < ${#lsb_ldso_abi_list[@]}; i += 3 )) ; do
1351 - lsb_ldso_abi=${lsb_ldso_abi_list[i]}
1352 - native_ldso_name=${lsb_ldso_abi_list[i+1]}
1353 - lsb_ldso_name=${lsb_ldso_abi_list[i+2]}
1354 - has ${lsb_ldso_abi} $(get_install_abis) || continue
1355 -
1356 - if [[ ! -L ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} && ! -e ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} ]] ; then
1357 - dosym ${native_ldso_name} "$(alt_prefix)/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name}"
1358 - fi
1359 - done
1360 -
1361 - # With devpts under Linux mounted properly, we do not need the pt_chown
1362 - # binary to be setuid. This is because the default owners/perms will be
1363 - # exactly what we want.
1364 - if ! use suid ; then
1365 - find "${ED}" -name pt_chown -exec chmod -s {} +
1366 - fi
1367 -
1368 - #################################################################
1369 - # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
1370 - # Make sure we install some symlink hacks so that when we build
1371 - # a 2nd stage cross-compiler, gcc finds the target system
1372 - # headers correctly. See gcc/doc/gccinstall.info
1373 - if is_crosscompile ; then
1374 - # We need to make sure that /lib and /usr/lib always exists.
1375 - # gcc likes to use relative paths to get to its multilibs like
1376 - # /usr/lib/../lib64/. So while we don't install any files into
1377 - # /usr/lib/, we do need it to exist.
1378 - keepdir $(alt_prefix)/lib
1379 - keepdir $(alt_prefix)/usr/lib
1380 -
1381 - dosym usr/include $(alt_prefix)/sys-include
1382 - return 0
1383 - fi
1384 -
1385 - # Files for Debian-style locale updating
1386 - dodir /usr/share/i18n
1387 - sed \
1388 - -e "/^#/d" \
1389 - -e "/SUPPORTED-LOCALES=/d" \
1390 - -e "s: \\\\::g" -e "s:/: :g" \
1391 - "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \
1392 - || die "generating /usr/share/i18n/SUPPORTED failed"
1393 - cd "${WORKDIR}"/extra/locale
1394 - dosbin locale-gen
1395 - doman *.[0-8]
1396 - insinto /etc
1397 - doins locale.gen
1398 -
1399 - keepdir /usr/lib/locale
1400 -
1401 - cd "${S}"
1402 -
1403 - # Install misc network config files
1404 - insinto /etc
1405 - doins posix/gai.conf nss/nsswitch.conf
1406 -
1407 - # Gentoo-specific
1408 - newins "${FILESDIR}"/host.conf-1 host.conf
1409 -
1410 - if use nscd ; then
1411 - doins nscd/nscd.conf
1412 -
1413 - newinitd "$(prefixify_ro "${FILESDIR}"/nscd-1)" nscd
1414 -
1415 - local nscd_args=(
1416 - -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
1417 - )
1418 -
1419 - sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd
1420 -
1421 - systemd_dounit nscd/nscd.service
1422 - newtmpfiles nscd/nscd.tmpfiles nscd.conf
1423 - fi
1424 -
1425 - echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
1426 - doenvd "${T}"/00glibc
1427 -
1428 - for d in BUGS ChangeLog CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do
1429 - [[ -s ${d} ]] && dodoc ${d}
1430 - done
1431 - dodoc -r ChangeLog.old
1432 -
1433 - # Prevent overwriting of the /etc/localtime symlink. We'll handle the
1434 - # creation of the "factory" symlink in pkg_postinst().
1435 - rm -f "${ED}"/etc/localtime
1436 -
1437 - # Generate all locales if this is a native build as locale generation
1438 - if use compile-locales && ! is_crosscompile ; then
1439 - run_locale_gen --inplace-glibc "${ED}/"
1440 - sed -e 's:COMPILED_LOCALES="":COMPILED_LOCALES="1":' -i "${ED}"/usr/sbin/locale-gen || die
1441 - fi
1442 -}
1443 -
1444 -glibc_headers_install() {
1445 - local builddir=$(builddir "headers")
1446 - cd "${builddir}"
1447 - emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install-headers
1448 -
1449 - insinto $(alt_headers)/gnu
1450 - doins "${S}"/include/gnu/stubs.h
1451 -
1452 - # Make sure we install the sys-include symlink so that when
1453 - # we build a 2nd stage cross-compiler, gcc finds the target
1454 - # system headers correctly. See gcc/doc/gccinstall.info
1455 - dosym usr/include $(alt_prefix)/sys-include
1456 -}
1457 -
1458 -src_install() {
1459 - if just_headers ; then
1460 - export ABI=default
1461 - glibc_headers_install
1462 - return
1463 - fi
1464 -
1465 - foreach_abi glibc_do_src_install
1466 -
1467 - if ! use static-libs ; then
1468 - einfo "Not installing static glibc libraries"
1469 - find "${ED}" -name "*.a" -and -not -name "*_nonshared.a" -delete
1470 - fi
1471 -}
1472 -
1473 -# Simple test to make sure our new glibc isn't completely broken.
1474 -# Make sure we don't test with statically built binaries since
1475 -# they will fail. Also, skip if this glibc is a cross compiler.
1476 -#
1477 -# If coreutils is built with USE=multicall, some of these files
1478 -# will just be wrapper scripts, not actual ELFs we can test.
1479 -glibc_sanity_check() {
1480 - cd / #228809
1481 -
1482 - # We enter ${ED} so to avoid trouble if the path contains
1483 - # special characters; for instance if the path contains the
1484 - # colon character (:), then the linker will try to split it
1485 - # and look for the libraries in an unexpected place. This can
1486 - # lead to unsafe code execution if the generated prefix is
1487 - # within a world-writable directory.
1488 - # (e.g. /var/tmp/portage:${HOSTNAME})
1489 - pushd "${ED}"/$(get_libdir) >/dev/null
1490 -
1491 - local x striptest
1492 - for x in cal date env free ls true uname uptime ; do
1493 - x=$(type -p ${x})
1494 - [[ -z ${x} || ${x} != ${EPREFIX}/* ]] && continue
1495 - striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) || continue
1496 - case ${striptest} in
1497 - *"statically linked"*) continue;;
1498 - *"ASCII text"*) continue;;
1499 - esac
1500 - # We need to clear the locale settings as the upgrade might want
1501 - # incompatible locale data. This test is not for verifying that.
1502 - LC_ALL=C \
1503 - ./ld-*.so --library-path . ${x} > /dev/null \
1504 - || die "simple run test (${x}) failed"
1505 - done
1506 -
1507 - popd >/dev/null
1508 -}
1509 -
1510 -pkg_preinst() {
1511 - # nothing to do if just installing headers
1512 - just_headers && return
1513 -
1514 - # prepare /etc/ld.so.conf.d/ for files
1515 - mkdir -p "${EROOT}"/etc/ld.so.conf.d
1516 -
1517 - # Default /etc/hosts.conf:multi to on for systems with small dbs.
1518 - if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then
1519 - sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf
1520 - einfo "Defaulting /etc/host.conf:multi to on"
1521 - fi
1522 -
1523 - [[ -n ${ROOT} ]] && return 0
1524 - [[ -d ${ED}/$(get_libdir) ]] || return 0
1525 - [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check
1526 -
1527 - if [[ -L ${EROOT}/usr/lib/locale ]]; then
1528 - # Help portage migrate this to a directory
1529 - # https://bugs.gentoo.org/753740
1530 - rm "${EROOT}"/usr/lib/locale || die
1531 - fi
1532 -}
1533 -
1534 -pkg_postinst() {
1535 - # nothing to do if just installing headers
1536 - just_headers && return
1537 -
1538 - if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then
1539 - # Generate fastloading iconv module configuration file.
1540 - "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}/"
1541 - fi
1542 -
1543 - if ! is_crosscompile && [[ -z ${ROOT} ]] ; then
1544 - use compile-locales || run_locale_gen "${EROOT}/"
1545 - fi
1546 -
1547 - # Check for sanity of /etc/nsswitch.conf, take 2
1548 - if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then
1549 - local entry
1550 - for entry in passwd group shadow; do
1551 - if egrep -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then
1552 - ewarn ""
1553 - ewarn "Your ${EROOT}/etc/nsswitch.conf uses NIS. Support for that has been"
1554 - ewarn "removed from glibc and is now provided by the package"
1555 - ewarn " sys-auth/libnss-nis"
1556 - ewarn "Install it now to keep your NIS setup working."
1557 - ewarn ""
1558 - fi
1559 - done
1560 - fi
1561 -}
1562
1563 diff --git a/sys-libs/glibc/glibc-2.34-r3.ebuild b/sys-libs/glibc/glibc-2.34-r3.ebuild
1564 deleted file mode 100644
1565 index b65194c38f6f..000000000000
1566 --- a/sys-libs/glibc/glibc-2.34-r3.ebuild
1567 +++ /dev/null
1568 @@ -1,1602 +0,0 @@
1569 -# Copyright 1999-2021 Gentoo Authors
1570 -# Distributed under the terms of the GNU General Public License v2
1571 -
1572 -EAPI=7
1573 -
1574 -# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc
1575 -# Please read & adapt the page as necessary if obsolete.
1576 -
1577 -# We avoid Python 3.10 here _for now_ (it does work!) to avoid circular dependencies
1578 -# on upgrades as people migrate to libxcrypt.
1579 -# https://wiki.gentoo.org/wiki/User:Sam/Portage_help/Circular_dependencies#Python_and_libcrypt
1580 -PYTHON_COMPAT=( python3_{7,8,9} )
1581 -TMPFILES_OPTIONAL=1
1582 -
1583 -inherit python-any-r1 prefix preserve-libs toolchain-funcs flag-o-matic gnuconfig \
1584 - multilib systemd multiprocessing tmpfiles
1585 -
1586 -DESCRIPTION="GNU libc C library"
1587 -HOMEPAGE="https://www.gnu.org/software/libc/"
1588 -LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
1589 -SLOT="2.2"
1590 -
1591 -EMULTILIB_PKG="true"
1592 -
1593 -# Gentoo patchset (ignored for live ebuilds)
1594 -PATCH_VER=6
1595 -PATCH_DEV=dilfridge
1596 -
1597 -if [[ ${PV} == 9999* ]]; then
1598 - inherit git-r3
1599 -else
1600 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
1601 - SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
1602 - SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
1603 -fi
1604 -
1605 -RELEASE_VER=${PV}
1606 -
1607 -GCC_BOOTSTRAP_VER=20201208
1608 -
1609 -LOCALE_GEN_VER=2.22
1610 -
1611 -GLIBC_SYSTEMD_VER=20210729
1612 -
1613 -SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${LOCALE_GEN_VER}.tar.gz"
1614 -SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
1615 -SRC_URI+=" systemd? ( https://gitweb.gentoo.org/proj/toolchain/glibc-systemd.git/snapshot/glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz )"
1616 -
1617 -IUSE="audit caps cet +clone3 compile-locales +crypt custom-cflags doc gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp +static-libs static-pie suid systemd systemtap test vanilla"
1618 -
1619 -# Minimum kernel version that glibc requires
1620 -MIN_KERN_VER="3.2.0"
1621 -# Minimum pax-utils version needed (which contains any new syscall changes for
1622 -# its seccomp filter!). Please double check this!
1623 -MIN_PAX_UTILS_VER="1.3.3"
1624 -
1625 -# Here's how the cross-compile logic breaks down ...
1626 -# CTARGET - machine that will target the binaries
1627 -# CHOST - machine that will host the binaries
1628 -# CBUILD - machine that will build the binaries
1629 -# If CTARGET != CHOST, it means you want a libc for cross-compiling.
1630 -# If CHOST != CBUILD, it means you want to cross-compile the libc.
1631 -# CBUILD = CHOST = CTARGET - native build/install
1632 -# CBUILD != (CHOST = CTARGET) - cross-compile a native build
1633 -# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
1634 -# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
1635 -# For install paths:
1636 -# CHOST = CTARGET - install into /
1637 -# CHOST != CTARGET - install into /usr/CTARGET/
1638 -#
1639 -export CBUILD=${CBUILD:-${CHOST}}
1640 -export CTARGET=${CTARGET:-${CHOST}}
1641 -if [[ ${CTARGET} == ${CHOST} ]] ; then
1642 - if [[ ${CATEGORY} == cross-* ]] ; then
1643 - export CTARGET=${CATEGORY#cross-}
1644 - fi
1645 -fi
1646 -
1647 -# Note [Disable automatic stripping]
1648 -# Disabling automatic stripping for a few reasons:
1649 -# - portage's attempt to strip breaks non-native binaries at least on
1650 -# arm: bug #697428
1651 -# - portage's attempt to strip libpthread.so.0 breaks gdb thread
1652 -# enumeration: bug #697910. This is quite subtle:
1653 -# * gdb uses glibc's libthread_db-1.0.so to enumerate threads.
1654 -# * libthread_db-1.0.so needs access to libpthread.so.0 local symbols
1655 -# via 'ps_pglobal_lookup' symbol defined in gdb.
1656 -# * 'ps_pglobal_lookup' uses '.symtab' section table to resolve all
1657 -# known symbols in 'libpthread.so.0'. Specifically 'nptl_version'
1658 -# (unexported) is used to sanity check compatibility before enabling
1659 -# debugging.
1660 -# Also see https://sourceware.org/gdb/wiki/FAQ#GDB_does_not_see_any_threads_besides_the_one_in_which_crash_occurred.3B_or_SIGTRAP_kills_my_program_when_I_set_a_breakpoint
1661 -# * normal 'strip' command trims '.symtab'
1662 -# Thus our main goal here is to prevent 'libpthread.so.0' from
1663 -# losing it's '.symtab' entries.
1664 -# As Gentoo's strip does not allow us to pass less aggressive stripping
1665 -# options and does not check the machine target we strip selectively.
1666 -
1667 -# We need a new-enough binutils/gcc to match upstream baseline.
1668 -# Also we need to make sure our binutils/gcc supports TLS,
1669 -# and that gcc already contains the hardened patches.
1670 -# Lastly, let's avoid some openssh nastiness, bug 708224, as
1671 -# convenience to our users.
1672 -
1673 -# gzip, grep, awk are needed by locale-gen, bug 740750
1674 -
1675 -BDEPEND="
1676 - ${PYTHON_DEPS}
1677 - >=app-misc/pax-utils-${MIN_PAX_UTILS_VER}
1678 - sys-devel/bison
1679 - doc? ( sys-apps/texinfo )
1680 - !compile-locales? (
1681 - app-arch/gzip
1682 - sys-apps/grep
1683 - virtual/awk
1684 - )
1685 -"
1686 -COMMON_DEPEND="
1687 - gd? ( media-libs/gd:2= )
1688 - nscd? ( selinux? (
1689 - audit? ( sys-process/audit )
1690 - caps? ( sys-libs/libcap )
1691 - ) )
1692 - suid? ( caps? ( sys-libs/libcap ) )
1693 - selinux? ( sys-libs/libselinux )
1694 - systemtap? ( dev-util/systemtap )
1695 -"
1696 -DEPEND="${COMMON_DEPEND}
1697 - compile-locales? (
1698 - app-arch/gzip
1699 - sys-apps/grep
1700 - virtual/awk
1701 - )
1702 - test? ( >=net-dns/libidn2-2.3.0 )
1703 -"
1704 -RDEPEND="${COMMON_DEPEND}
1705 - app-arch/gzip
1706 - sys-apps/grep
1707 - virtual/awk
1708 - sys-apps/gentoo-functions
1709 - !<app-misc/pax-utils-${MIN_PAX_UTILS_VER}
1710 - !<net-misc/openssh-8.1_p1-r2
1711 -"
1712 -
1713 -RESTRICT="!test? ( test )"
1714 -
1715 -if [[ ${CATEGORY} == cross-* ]] ; then
1716 - BDEPEND+=" !headers-only? (
1717 - >=${CATEGORY}/binutils-2.27
1718 - >=${CATEGORY}/gcc-6
1719 - )"
1720 - [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
1721 -else
1722 - BDEPEND+="
1723 - >=sys-devel/binutils-2.27
1724 - >=sys-devel/gcc-6
1725 - "
1726 - DEPEND+=" virtual/os-headers "
1727 - RDEPEND+="
1728 - >=net-dns/libidn2-2.3.0
1729 - vanilla? ( !sys-libs/timezone-data )
1730 - "
1731 - PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
1732 -fi
1733 -
1734 -# Ignore tests whitelisted below
1735 -GENTOO_GLIBC_XFAIL_TESTS="${GENTOO_GLIBC_XFAIL_TESTS:-yes}"
1736 -
1737 -# The following tests fail due to the Gentoo build system and are thus
1738 -# executed but ignored:
1739 -XFAIL_TEST_LIST=(
1740 - # 9) Failures of unknown origin
1741 - tst-latepthread
1742 -
1743 - # buggy test, assumes /dev/ and /dev/null on a single filesystem
1744 - # 'mount --bind /dev/null /chroot/dev/null' breaks it.
1745 - # https://sourceware.org/PR25909
1746 - tst-support_descriptors
1747 -
1748 - # Flaky test, known to fail occasionally:
1749 - # https://sourceware.org/PR19329
1750 - # https://bugs.gentoo.org/719674#c12
1751 - tst-stack4
1752 -)
1753 -
1754 -#
1755 -# Small helper functions
1756 -#
1757 -
1758 -is_crosscompile() {
1759 - [[ ${CHOST} != ${CTARGET} ]]
1760 -}
1761 -
1762 -just_headers() {
1763 - is_crosscompile && use headers-only
1764 -}
1765 -
1766 -alt_prefix() {
1767 - is_crosscompile && echo /usr/${CTARGET}
1768 -}
1769 -
1770 -# This prefix is applicable to CHOST when building against this
1771 -# glibc. It is baked into the library at configure time.
1772 -host_eprefix() {
1773 - is_crosscompile || echo "${EPREFIX}"
1774 -}
1775 -
1776 -# This prefix is applicable to CBUILD when building against this
1777 -# glibc. It determines the destination path at install time.
1778 -build_eprefix() {
1779 - is_crosscompile && echo "${EPREFIX}"
1780 -}
1781 -
1782 -# We need to be able to set alternative headers for compiling for non-native
1783 -# platform. Will also become useful for testing kernel-headers without screwing
1784 -# up the whole system.
1785 -alt_headers() {
1786 - echo ${ALT_HEADERS:=$(alt_prefix)/usr/include}
1787 -}
1788 -
1789 -alt_build_headers() {
1790 - if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
1791 - ALT_BUILD_HEADERS="$(host_eprefix)$(alt_headers)"
1792 - if tc-is-cross-compiler ; then
1793 - ALT_BUILD_HEADERS=${SYSROOT}$(alt_headers)
1794 - if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then
1795 - local header_path=$(echo '#include <linux/version.h>' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h')
1796 - ALT_BUILD_HEADERS=${header_path%/linux/version.h}
1797 - fi
1798 - fi
1799 - fi
1800 - echo "${ALT_BUILD_HEADERS}"
1801 -}
1802 -
1803 -alt_libdir() {
1804 - echo $(alt_prefix)/$(get_libdir)
1805 -}
1806 -alt_usrlibdir() {
1807 - echo $(alt_prefix)/usr/$(get_libdir)
1808 -}
1809 -
1810 -builddir() {
1811 - echo "${WORKDIR}/build-${ABI}-${CTARGET}-$1"
1812 -}
1813 -
1814 -do_compile_test() {
1815 - local ret save_cflags=${CFLAGS}
1816 - CFLAGS+=" $1"
1817 - shift
1818 -
1819 - pushd "${T}" >/dev/null
1820 -
1821 - rm -f glibc-test*
1822 - printf '%b' "$*" > glibc-test.c
1823 -
1824 - # Most of the time CC is already set, but not in early sanity checks.
1825 - nonfatal emake glibc-test CC="${CC-$(tc-getCC ${CTARGET})}"
1826 - ret=$?
1827 -
1828 - popd >/dev/null
1829 -
1830 - CFLAGS=${save_cflags}
1831 - return ${ret}
1832 -}
1833 -
1834 -do_run_test() {
1835 - local ret
1836 -
1837 - if [[ ${MERGE_TYPE} == "binary" ]] ; then
1838 - # ignore build failures when installing a binary package #324685
1839 - do_compile_test "" "$@" 2>/dev/null || return 0
1840 - else
1841 - if ! do_compile_test "" "$@" ; then
1842 - ewarn "Simple build failed ... assuming this is desired #324685"
1843 - return 0
1844 - fi
1845 - fi
1846 -
1847 - pushd "${T}" >/dev/null
1848 -
1849 - ./glibc-test
1850 - ret=$?
1851 - rm -f glibc-test*
1852 -
1853 - popd >/dev/null
1854 -
1855 - return ${ret}
1856 -}
1857 -
1858 -setup_target_flags() {
1859 - # This largely mucks with compiler flags. None of which should matter
1860 - # when building up just the headers.
1861 - just_headers && return 0
1862 -
1863 - case $(tc-arch) in
1864 - x86)
1865 - # -march needed for #185404 #199334
1866 - # TODO: When creating the first glibc cross-compile, this test will
1867 - # always fail as it does a full link which in turn requires glibc.
1868 - # Probably also applies when changing multilib profile settings (e.g.
1869 - # enabling x86 when the profile was amd64-only previously).
1870 - # We could change main to _start and pass -nostdlib here so that we
1871 - # only test the gcc code compilation. Or we could do a compile and
1872 - # then look for the symbol via scanelf.
1873 - 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'; then
1874 - local t=${CTARGET_OPT:-${CTARGET}}
1875 - t=${t%%-*}
1876 - filter-flags '-march=*'
1877 - export CFLAGS="-march=${t} ${CFLAGS}"
1878 - einfo "Auto adding -march=${t} to CFLAGS #185404"
1879 - fi
1880 - ;;
1881 - amd64)
1882 - # -march needed for #185404 #199334
1883 - # TODO: See cross-compile issues listed above for x86.
1884 - [[ ${ABI} == x86 ]] &&
1885 - 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'; then
1886 - local t=${CTARGET_OPT:-${CTARGET}}
1887 - t=${t%%-*}
1888 - # Normally the target is x86_64-xxx, so turn that into the -march that
1889 - # gcc actually accepts. #528708
1890 - [[ ${t} == "x86_64" ]] && t="x86-64"
1891 - filter-flags '-march=*'
1892 - # ugly, ugly, ugly. ugly.
1893 - CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}")
1894 - export CFLAGS_x86="${CFLAGS_x86} -march=${t}"
1895 - einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
1896 - fi
1897 -
1898 - # Workaround for https://bugs.gentoo.org/823780. This really should
1899 - # be removed when the upstream bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103275
1900 - # is fixed in our tree, either via 11.3 or an 11.2p2 patch set.
1901 - if [[ ${ABI} == x86 ]] && tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)); then
1902 - export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f"
1903 - einfo "Auto adding -mno-avx512f to CFLAGS_x86 (bug #823780) (ABI=${ABI})"
1904 - fi
1905 - ;;
1906 - mips)
1907 - # The mips abi cannot support the GNU style hashes. #233233
1908 - filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both
1909 - ;;
1910 - ppc|ppc64)
1911 - # Many arch-specific implementations do not work on ppc with
1912 - # cache-block not equal to 128 bytes. This breaks memset:
1913 - # https://sourceware.org/PR26522
1914 - # https://bugs.gentoo.org/737996
1915 - # Use default -mcpu=. For ppc it means non-multiarch setup.
1916 - filter-flags '-mcpu=*'
1917 - ;;
1918 - sparc)
1919 - # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
1920 - filter-flags "-fcall-used-g7"
1921 - append-flags "-fcall-used-g6"
1922 -
1923 - local cpu
1924 - case ${CTARGET} in
1925 - sparc64-*)
1926 - cpu="sparc64"
1927 - case $(get-flag mcpu) in
1928 - v9)
1929 - # We need to force at least v9a because the base build doesn't
1930 - # work with just v9.
1931 - # https://sourceware.org/bugzilla/show_bug.cgi?id=19477
1932 - append-flags "-Wa,-xarch=v9a"
1933 - ;;
1934 - esac
1935 - ;;
1936 - sparc-*)
1937 - case $(get-flag mcpu) in
1938 - v8|supersparc|hypersparc|leon|leon3)
1939 - cpu="sparcv8"
1940 - ;;
1941 - *)
1942 - cpu="sparcv9"
1943 - ;;
1944 - esac
1945 - ;;
1946 - esac
1947 - [[ -n ${cpu} ]] && CTARGET_OPT="${cpu}-${CTARGET#*-}"
1948 - ;;
1949 - esac
1950 -}
1951 -
1952 -setup_flags() {
1953 - # Make sure host make.conf doesn't pollute us
1954 - if is_crosscompile || tc-is-cross-compiler ; then
1955 - CHOST=${CTARGET} strip-unsupported-flags
1956 - fi
1957 -
1958 - # Store our CFLAGS because it's changed depending on which CTARGET
1959 - # we are building when pulling glibc on a multilib profile
1960 - CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
1961 - CFLAGS=${CFLAGS_BASE}
1962 - CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}}
1963 - CXXFLAGS=${CXXFLAGS_BASE}
1964 - ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
1965 - ASFLAGS=${ASFLAGS_BASE}
1966 -
1967 - # Allow users to explicitly avoid flag sanitization via
1968 - # USE=custom-cflags.
1969 - if ! use custom-cflags; then
1970 - # Over-zealous CFLAGS can often cause problems. What may work for one
1971 - # person may not work for another. To avoid a large influx of bugs
1972 - # relating to failed builds, we strip most CFLAGS out to ensure as few
1973 - # problems as possible.
1974 - strip-flags
1975 - # Lock glibc at -O2; we want to be conservative here.
1976 - filter-flags '-O?'
1977 - append-flags -O2
1978 - fi
1979 - strip-unsupported-flags
1980 - filter-flags -m32 -m64 '-mabi=*'
1981 -
1982 - # glibc aborts if rpath is set by LDFLAGS
1983 - filter-ldflags '-Wl,-rpath=*'
1984 -
1985 - # ld can't use -r & --relax at the same time, bug #788901
1986 - # https://sourceware.org/PR27837
1987 - filter-ldflags '-Wl,--relax'
1988 -
1989 - # #492892
1990 - filter-flags -frecord-gcc-switches
1991 -
1992 - unset CBUILD_OPT CTARGET_OPT
1993 - if use multilib ; then
1994 - CTARGET_OPT=$(get_abi_CTARGET)
1995 - [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
1996 - fi
1997 -
1998 - setup_target_flags
1999 -
2000 - if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
2001 - CBUILD_OPT=${CTARGET_OPT}
2002 - fi
2003 -
2004 - # glibc's headers disallow -O0 and fail at build time:
2005 - # include/libc-symbols.h:75:3: #error "glibc cannot be compiled without optimization"
2006 - replace-flags -O0 -O1
2007 -
2008 - filter-flags '-fstack-protector*'
2009 -}
2010 -
2011 -want_tls() {
2012 - # Archs that can use TLS (Thread Local Storage)
2013 - case $(tc-arch) in
2014 - x86)
2015 - # requires i486 or better #106556
2016 - [[ ${CTARGET} == i[4567]86* ]] && return 0
2017 - return 1
2018 - ;;
2019 - esac
2020 - return 0
2021 -}
2022 -
2023 -want__thread() {
2024 - want_tls || return 1
2025 -
2026 - # For some reason --with-tls --with__thread is causing segfaults on sparc32.
2027 - [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
2028 -
2029 - [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
2030 -
2031 - # only test gcc -- can't test linking yet
2032 - tc-has-tls -c ${CTARGET}
2033 - WANT__THREAD=$?
2034 -
2035 - return ${WANT__THREAD}
2036 -}
2037 -
2038 -use_multiarch() {
2039 - # Allow user to disable runtime arch detection in multilib.
2040 - use multiarch || return 1
2041 - # Make sure binutils is new enough to support indirect functions,
2042 - # #336792. This funky sed supports gold and bfd linkers.
2043 - local bver nver
2044 - bver=$($(tc-getLD ${CTARGET}) -v | sed -n -r '1{s:[^0-9]*::;s:^([0-9.]*).*:\1:;p}')
2045 - case $(tc-arch ${CTARGET}) in
2046 - amd64|x86) nver="2.20" ;;
2047 - arm) nver="2.22" ;;
2048 - hppa) nver="2.23" ;;
2049 - ppc|ppc64) nver="2.20" ;;
2050 - # ifunc support was added in 2.23, but glibc also needs
2051 - # machinemode which is in 2.24.
2052 - s390) nver="2.24" ;;
2053 - sparc) nver="2.21" ;;
2054 - *) return 1 ;;
2055 - esac
2056 - ver_test ${bver} -ge ${nver}
2057 -}
2058 -
2059 -# Setup toolchain variables that had historically been defined in the
2060 -# profiles for these archs.
2061 -setup_env() {
2062 - # silly users
2063 - unset LD_RUN_PATH
2064 - unset LD_ASSUME_KERNEL
2065 -
2066 - if is_crosscompile || tc-is-cross-compiler ; then
2067 - multilib_env ${CTARGET_OPT:-${CTARGET}}
2068 -
2069 - if ! use multilib ; then
2070 - MULTILIB_ABIS=${DEFAULT_ABI}
2071 - else
2072 - MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
2073 - fi
2074 -
2075 - # If the user has CFLAGS_<CTARGET> in their make.conf, use that,
2076 - # and fall back on CFLAGS.
2077 - local VAR=CFLAGS_${CTARGET//[-.]/_}
2078 - CFLAGS=${!VAR-${CFLAGS}}
2079 - einfo " $(printf '%15s' 'Manual CFLAGS:') ${CFLAGS}"
2080 - fi
2081 -
2082 - setup_flags
2083 -
2084 - export ABI=${ABI:-${DEFAULT_ABI:-default}}
2085 -
2086 - if just_headers ; then
2087 - # Avoid mixing host's CC and target's CFLAGS_${ABI}:
2088 - # At this bootstrap stage we have only binutils for
2089 - # target but not compiler yet.
2090 - einfo "Skip CC ABI injection. We can't use (cross-)compiler yet."
2091 - return 0
2092 - fi
2093 - local VAR=CFLAGS_${ABI}
2094 - # We need to export CFLAGS with abi information in them because glibc's
2095 - # configure script checks CFLAGS for some targets (like mips). Keep
2096 - # around the original clean value to avoid appending multiple ABIs on
2097 - # top of each other.
2098 - : ${__GLIBC_CC:=$(tc-getCC ${CTARGET})}
2099 - export __GLIBC_CC CC="${__GLIBC_CC} ${!VAR}"
2100 - einfo " $(printf '%15s' 'Manual CC:') ${CC}"
2101 -}
2102 -
2103 -foreach_abi() {
2104 - setup_env
2105 -
2106 - local ret=0
2107 - local abilist=""
2108 - if use multilib ; then
2109 - abilist=$(get_install_abis)
2110 - else
2111 - abilist=${DEFAULT_ABI}
2112 - fi
2113 - local -x ABI
2114 - for ABI in ${abilist:-default} ; do
2115 - setup_env
2116 - einfo "Running $1 for ABI ${ABI}"
2117 - $1
2118 - : $(( ret |= $? ))
2119 - done
2120 - return ${ret}
2121 -}
2122 -
2123 -glibc_banner() {
2124 - local b="Gentoo ${PVR}"
2125 - [[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" p${PATCH_VER}"
2126 - echo "${b}"
2127 -}
2128 -
2129 -# The following Kernel version handling functions are mostly copied from portage
2130 -# source. It's better not to use linux-info.eclass here since a) it adds too
2131 -# much magic, see bug 326693 for some of the arguments, and b) some of the
2132 -# functions are just not provided.
2133 -
2134 -g_get_running_KV() {
2135 - uname -r
2136 - return $?
2137 -}
2138 -
2139 -g_KV_major() {
2140 - [[ -z $1 ]] && return 1
2141 - local KV=$@
2142 - echo "${KV%%.*}"
2143 -}
2144 -
2145 -g_KV_minor() {
2146 - [[ -z $1 ]] && return 1
2147 - local KV=$@
2148 - KV=${KV#*.}
2149 - echo "${KV%%.*}"
2150 -}
2151 -
2152 -g_KV_micro() {
2153 - [[ -z $1 ]] && return 1
2154 - local KV=$@
2155 - KV=${KV#*.*.}
2156 - echo "${KV%%[^[:digit:]]*}"
2157 -}
2158 -
2159 -g_KV_to_int() {
2160 - [[ -z $1 ]] && return 1
2161 - local KV_MAJOR=$(g_KV_major "$1")
2162 - local KV_MINOR=$(g_KV_minor "$1")
2163 - local KV_MICRO=$(g_KV_micro "$1")
2164 - local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO ))
2165 -
2166 - # We make version 2.2.0 the minimum version we will handle as
2167 - # a sanity check ... if its less, we fail ...
2168 - if [[ ${KV_int} -ge 131584 ]] ; then
2169 - echo "${KV_int}"
2170 - return 0
2171 - fi
2172 - return 1
2173 -}
2174 -
2175 -g_int_to_KV() {
2176 - local version=$1 major minor micro
2177 - major=$((version / 65536))
2178 - minor=$(((version % 65536) / 256))
2179 - micro=$((version % 256))
2180 - echo ${major}.${minor}.${micro}
2181 -}
2182 -
2183 -eend_KV() {
2184 - [[ $(g_KV_to_int $1) -ge $(g_KV_to_int $2) ]]
2185 - eend $?
2186 -}
2187 -
2188 -get_kheader_version() {
2189 - printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \
2190 - $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \
2191 - tail -n 1
2192 -}
2193 -
2194 -# We collect all sanity checks here. Consistency is not guranteed between
2195 -# pkg_ and src_ phases, so we call this function both in pkg_pretend and in
2196 -# src_unpack.
2197 -sanity_prechecks() {
2198 - # Prevent native builds from downgrading
2199 - if [[ ${MERGE_TYPE} != "buildonly" ]] && \
2200 - [[ -z ${ROOT} ]] && \
2201 - [[ ${CBUILD} == ${CHOST} ]] && \
2202 - [[ ${CHOST} == ${CTARGET} ]] ; then
2203 -
2204 - # The high rev # is to allow people to downgrade between -r#
2205 - # versions. We want to block 2.20->2.19, but 2.20-r3->2.20-r2
2206 - # should be fine. Hopefully we never actually use a r# this
2207 - # high.
2208 - if has_version ">${CATEGORY}/${P}-r10000" ; then
2209 - eerror "Sanity check to keep you from breaking your system:"
2210 - eerror " Downgrading glibc is not supported and a sure way to destruction."
2211 - [[ ${I_ALLOW_TO_BREAK_MY_SYSTEM} = yes ]] || die "Aborting to save your system."
2212 - fi
2213 -
2214 - if ! do_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' ; then
2215 - eerror "Your old kernel is broken. You need to update it to a newer"
2216 - eerror "version as syscall(<bignum>) will break. See bug 279260."
2217 - die "Old and broken kernel."
2218 - fi
2219 - fi
2220 -
2221 - # Users have had a chance to phase themselves, time to give em the boot
2222 - if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
2223 - eerror "You still haven't deleted ${EROOT}/etc/locales.build."
2224 - eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
2225 - die "Lazy upgrader detected"
2226 - fi
2227 -
2228 - if [[ ${CTARGET} == i386-* ]] ; then
2229 - eerror "i386 CHOSTs are no longer supported."
2230 - eerror "Chances are you don't actually want/need i386."
2231 - eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml"
2232 - die "Please fix your CHOST"
2233 - fi
2234 -
2235 - if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
2236 - ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
2237 - ewarn "This will result in a 50% performance penalty when running with a 32bit"
2238 - ewarn "hypervisor, which is probably not what you want."
2239 - fi
2240 -
2241 - # ABI-specific checks follow here. Hey, we have a lot more specific conditions that
2242 - # we test for...
2243 - if ! is_crosscompile ; then
2244 - if use amd64 && use multilib && [[ ${MERGE_TYPE} != "binary" ]] ; then
2245 - ebegin "Checking that IA32 emulation is enabled in the running kernel"
2246 - echo 'int main(){return 0;}' > "${T}/check-ia32-emulation.c"
2247 - local STAT
2248 - if "${CC-${CHOST}-gcc}" ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32"; then
2249 - "${T}/check-ia32-emulation.elf32"
2250 - STAT=$?
2251 - else
2252 - # Don't fail here to allow single->multi ABI switch
2253 - # or recover from breakage like bug #646424
2254 - ewarn "Failed to compile the ABI test. Broken host glibc?"
2255 - STAT=0
2256 - fi
2257 - rm -f "${T}/check-ia32-emulation.elf32"
2258 - eend $STAT
2259 - [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION must be enabled in the kernel to compile a multilib glibc."
2260 - fi
2261 -
2262 - fi
2263 -
2264 - # When we actually have to compile something...
2265 - if ! just_headers && [[ ${MERGE_TYPE} != "binary" ]] ; then
2266 - ebegin "Checking gcc for __thread support"
2267 - if ! eend $(want__thread ; echo $?) ; then
2268 - echo
2269 - eerror "Could not find a gcc that supports the __thread directive!"
2270 - eerror "Please update your binutils/gcc and try again."
2271 - die "No __thread support in gcc!"
2272 - fi
2273 -
2274 - if [[ ${CTARGET} == *-linux* ]] ; then
2275 - local run_kv build_kv want_kv
2276 -
2277 - run_kv=$(g_get_running_KV)
2278 - build_kv=$(g_int_to_KV $(get_kheader_version))
2279 - want_kv=${MIN_KERN_VER}
2280 -
2281 - if ! is_crosscompile && ! tc-is-cross-compiler ; then
2282 - # Building fails on an non-supporting kernel
2283 - ebegin "Checking running kernel version (${run_kv} >= ${want_kv})"
2284 - if ! eend_KV ${run_kv} ${want_kv} ; then
2285 - echo
2286 - eerror "You need a kernel of at least ${want_kv}!"
2287 - die "Kernel version too low!"
2288 - fi
2289 - fi
2290 -
2291 - ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})"
2292 - if ! eend_KV ${build_kv} ${want_kv} ; then
2293 - echo
2294 - eerror "You need linux-headers of at least ${want_kv}!"
2295 - die "linux-headers version too low!"
2296 - fi
2297 - fi
2298 - fi
2299 -}
2300 -
2301 -upgrade_warning() {
2302 - if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then
2303 - local oldv newv=$(ver_cut 1-2 ${PV})
2304 - for oldv in ${REPLACING_VERSIONS}; do
2305 - if ver_test ${oldv} -lt ${newv}; then
2306 - ewarn "After upgrading glibc, please restart all running processes."
2307 - ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)."
2308 - ewarn "Alternatively, reboot your system."
2309 - break
2310 - fi
2311 - done
2312 - fi
2313 -}
2314 -
2315 -#
2316 -# the phases
2317 -#
2318 -
2319 -# pkg_pretend
2320 -
2321 -pkg_pretend() {
2322 - # All the checks...
2323 - einfo "Checking general environment sanity."
2324 - sanity_prechecks
2325 - upgrade_warning
2326 -}
2327 -
2328 -pkg_setup() {
2329 - # see bug 682570
2330 - [[ -z ${BOOTSTRAP_RAP} ]] && python-any-r1_pkg_setup
2331 -}
2332 -
2333 -# src_unpack
2334 -
2335 -src_unpack() {
2336 - # Consistency is not guaranteed between pkg_ and src_ ...
2337 - sanity_prechecks
2338 -
2339 - use multilib-bootstrap && unpack gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz
2340 -
2341 - setup_env
2342 -
2343 - if [[ ${PV} == 9999* ]] ; then
2344 - EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/glibc-patches.git"
2345 - EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
2346 - git-r3_src_unpack
2347 - mv patches-git/9999 patches || die
2348 -
2349 - EGIT_REPO_URI="https://sourceware.org/git/glibc.git"
2350 - EGIT_CHECKOUT_DIR=${S}
2351 - git-r3_src_unpack
2352 - else
2353 - unpack ${P}.tar.xz
2354 -
2355 - cd "${WORKDIR}" || die
2356 - unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz
2357 - fi
2358 -
2359 - cd "${WORKDIR}" || die
2360 - unpack locale-gen-${LOCALE_GEN_VER}.tar.gz
2361 - use systemd && unpack glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz
2362 -}
2363 -
2364 -src_prepare() {
2365 - local patchsetname
2366 - if ! use vanilla ; then
2367 - if [[ ${PV} == 9999* ]] ; then
2368 - patchsetname="from git master"
2369 - else
2370 - patchsetname="${RELEASE_VER}-${PATCH_VER}"
2371 - fi
2372 - einfo "Applying Gentoo Glibc Patchset ${patchsetname}"
2373 - eapply "${WORKDIR}"/patches
2374 - einfo "Done."
2375 - fi
2376 -
2377 - # Apply patch to allow conditional disabling of clone3
2378 - eapply "${FILESDIR}"/${PN}-2.34-make-clone3-syscall-optional.patch
2379 -
2380 - if use clone3 ; then
2381 - append-cppflags -DGENTOO_USE_CLONE3
2382 - else
2383 - # See e.g. bug #827386, bug #819045.
2384 - elog "Disabling the clone3 syscall for compatibility with older Electron apps."
2385 - elog "Please re-enable this flag before filing bugs!"
2386 - fi
2387 -
2388 - default
2389 -
2390 - gnuconfig_update
2391 -
2392 - cd "${WORKDIR}"
2393 - find . -name configure -exec touch {} +
2394 -
2395 - # move the external locale-gen to its old place
2396 - mkdir extra || die
2397 - mv locale-gen-${LOCALE_GEN_VER} extra/locale || die
2398 -
2399 - eprefixify extra/locale/locale-gen
2400 -
2401 - # Fix permissions on some of the scripts.
2402 - chmod u+x "${S}"/scripts/*.sh
2403 -
2404 - cd "${S}"
2405 -}
2406 -
2407 -glibc_do_configure() {
2408 - # Glibc does not work with gold (for various reasons) #269274.
2409 - tc-ld-disable-gold
2410 -
2411 - # CXX isnt handled by the multilib system, so if we dont unset here
2412 - # we accumulate crap across abis
2413 - unset CXX
2414 -
2415 - einfo "Configuring glibc for nptl"
2416 -
2417 - if use doc ; then
2418 - export MAKEINFO=makeinfo
2419 - else
2420 - export MAKEINFO=/dev/null
2421 - fi
2422 -
2423 - local v
2424 - for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM READELF; do
2425 - einfo " $(printf '%15s' ${v}:) ${!v}"
2426 - done
2427 -
2428 - # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760
2429 - # To build .S (assembly) files with the same ABI-specific flags
2430 - # upstream currently recommends adding CFLAGS to CC/CXX:
2431 - # https://sourceware.org/PR23273
2432 - # Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS
2433 - # and breaks multiarch support. See 659030#c3 for an example.
2434 - # The glibc configure script doesn't properly use LDFLAGS all the time.
2435 - export CC="$(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS}"
2436 - einfo " $(printf '%15s' 'Manual CC:') ${CC}"
2437 -
2438 - # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
2439 - export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS) ${CFLAGS}"
2440 -
2441 - if is_crosscompile; then
2442 - # Assume worst-case bootstrap: glibc is buil first time
2443 - # when ${CTARGET}-g++ is not available yet. We avoid
2444 - # building auxiliary programs that require C++: bug #683074
2445 - # It should not affect final result.
2446 - export libc_cv_cxx_link_ok=no
2447 - # The line above has the same effect. We set CXX explicitly
2448 - # to make build logs less confusing.
2449 - export CXX=
2450 - fi
2451 - einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
2452 -
2453 - # Always use tuple-prefixed toolchain. For non-native ABI glibc's configure
2454 - # can't detect them automatically due to ${CHOST} mismatch and fallbacks
2455 - # to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup().
2456 - export NM="$(tc-getNM ${CTARGET})"
2457 - export READELF="$(tc-getREADELF ${CTARGET})"
2458 - einfo " $(printf '%15s' 'Manual NM:') ${NM}"
2459 - einfo " $(printf '%15s' 'Manual READELF:') ${READELF}"
2460 -
2461 - echo
2462 -
2463 - local myconf=()
2464 -
2465 - case ${CTARGET} in
2466 - m68k*)
2467 - # setjmp() is not compatible with stack protection:
2468 - # https://sourceware.org/PR24202
2469 - myconf+=( --enable-stack-protector=no )
2470 - ;;
2471 - *)
2472 - # Use '=strong' instead of '=all' to protect only functions
2473 - # worth protecting from stack smashes.
2474 - # '=all' is also known to have a problem in IFUNC resolution
2475 - # tests: https://sourceware.org/PR25680, bug #712356.
2476 - myconf+=( --enable-stack-protector=$(usex ssp strong no) )
2477 - ;;
2478 - esac
2479 - myconf+=( --enable-stackguard-randomization )
2480 -
2481 - # Keep a whitelist of targets supporing IFUNC. glibc's ./configure
2482 - # is not robust enough to detect proper support:
2483 - # https://bugs.gentoo.org/641216
2484 - # https://sourceware.org/PR22634#c0
2485 - case $(tc-arch ${CTARGET}) in
2486 - # Keep whitelist of targets where autodetection mostly works.
2487 - amd64|x86|sparc|ppc|ppc64|arm|arm64|s390) ;;
2488 - # Blacklist everywhere else
2489 - *) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;;
2490 - esac
2491 -
2492 - # Enable Intel Control-flow Enforcement Technology on amd64 if requested
2493 - case ${CTARGET} in
2494 - x86_64-*) myconf+=( $(use_enable cet) ) ;;
2495 - *) ;;
2496 - esac
2497 -
2498 - [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp )
2499 -
2500 - myconf+=( --enable-kernel=${MIN_KERN_VER} )
2501 -
2502 - # Since SELinux support is only required for nscd, only enable it if:
2503 - # 1. USE selinux
2504 - # 2. only for the primary ABI on multilib systems
2505 - # 3. Not a crosscompile
2506 - if ! is_crosscompile && use selinux ; then
2507 - if use multilib ; then
2508 - if is_final_abi ; then
2509 - myconf+=( --with-selinux )
2510 - else
2511 - myconf+=( --without-selinux )
2512 - fi
2513 - else
2514 - myconf+=( --with-selinux )
2515 - fi
2516 - else
2517 - myconf+=( --without-selinux )
2518 - fi
2519 -
2520 - # Force a few tests where we always know the answer but
2521 - # configure is incapable of finding it.
2522 - if is_crosscompile ; then
2523 - export \
2524 - libc_cv_c_cleanup=yes \
2525 - libc_cv_forced_unwind=yes
2526 - fi
2527 -
2528 - myconf+=(
2529 - --without-cvs
2530 - --disable-werror
2531 - --enable-bind-now
2532 - --build=${CBUILD_OPT:-${CBUILD}}
2533 - --host=${CTARGET_OPT:-${CTARGET}}
2534 - $(use_enable profile)
2535 - $(use_with gd)
2536 - --with-headers=$(build_eprefix)$(alt_build_headers)
2537 - --prefix="$(host_eprefix)/usr"
2538 - --sysconfdir="$(host_eprefix)/etc"
2539 - --localstatedir="$(host_eprefix)/var"
2540 - --libdir='$(prefix)'/$(get_libdir)
2541 - --mandir='$(prefix)'/share/man
2542 - --infodir='$(prefix)'/share/info
2543 - --libexecdir='$(libdir)'/misc/glibc
2544 - --with-bugurl=https://bugs.gentoo.org/
2545 - --with-pkgversion="$(glibc_banner)"
2546 - $(use_enable crypt)
2547 - $(use_multiarch || echo --disable-multi-arch)
2548 - $(use_enable static-pie)
2549 - $(use_enable systemtap)
2550 - $(use_enable nscd)
2551 -
2552 - # locale data is arch-independent
2553 - # https://bugs.gentoo.org/753740
2554 - libc_cv_complocaledir='${exec_prefix}/lib/locale'
2555 -
2556 - # -march= option tricks build system to infer too
2557 - # high ISA level: https://sourceware.org/PR27318
2558 - libc_cv_include_x86_isa_level=no
2559 - # Explicit override of https://sourceware.org/PR27991
2560 - # exposes a bug in glibc's configure:
2561 - # https://sourceware.org/PR27991
2562 - libc_cv_have_x86_lahf_sahf=no
2563 - libc_cv_have_x86_movbe=no
2564 -
2565 - ${EXTRA_ECONF}
2566 - )
2567 -
2568 - # We rely on sys-libs/timezone-data for timezone tools normally.
2569 - myconf+=( $(use_enable vanilla timezone-tools) )
2570 -
2571 - # These libs don't have configure flags.
2572 - ac_cv_lib_audit_audit_log_user_avc_message=$(usex audit || echo no)
2573 - ac_cv_lib_cap_cap_init=$(usex caps || echo no)
2574 -
2575 - # There is no configure option for this and we need to export it
2576 - # since the glibc build will re-run configure on itself
2577 - export libc_cv_rootsbindir="$(host_eprefix)/sbin"
2578 - export libc_cv_slibdir="$(host_eprefix)/$(get_libdir)"
2579 -
2580 - # We take care of patching our binutils to use both hash styles,
2581 - # and many people like to force gnu hash style only, so disable
2582 - # this overriding check. #347761
2583 - export libc_cv_hashstyle=no
2584 -
2585 - local builddir=$(builddir nptl)
2586 - mkdir -p "${builddir}"
2587 - cd "${builddir}"
2588 - set -- "${S}"/configure "${myconf[@]}"
2589 - echo "$@"
2590 - "$@" || die "failed to configure glibc"
2591 -
2592 - # ia64 static cross-compilers are a pita in so much that they
2593 - # can't produce static ELFs (as the libgcc.a is broken). so
2594 - # disable building of the programs for those targets if it
2595 - # doesn't work.
2596 - # XXX: We could turn this into a compiler test, but ia64 is
2597 - # the only one that matters, so this should be fine for now.
2598 - if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then
2599 - sed -i '1i+link-static = touch $@' config.make
2600 - fi
2601 -
2602 - # If we're trying to migrate between ABI sets, we need
2603 - # to lie and use a local copy of gcc. Like if the system
2604 - # is built with MULTILIB_ABIS="amd64 x86" but we want to
2605 - # add x32 to it, gcc/glibc don't yet support x32.
2606 - #
2607 - if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib-bootstrap ; then
2608 - echo 'main(){}' > "${T}"/test.c
2609 - if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then
2610 - sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die
2611 - fi
2612 - fi
2613 -}
2614 -
2615 -glibc_headers_configure() {
2616 - export ABI=default
2617 -
2618 - local builddir=$(builddir "headers")
2619 - mkdir -p "${builddir}"
2620 - cd "${builddir}"
2621 -
2622 - # if we don't have a compiler yet, we can't really test it now ...
2623 - # hopefully they don't affect header generation, so let's hope for
2624 - # the best here ...
2625 - local v vars=(
2626 - ac_cv_header_cpuid_h=yes
2627 - libc_cv_{386,390,alpha,arm,hppa,ia64,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes
2628 - libc_cv_asm_cfi_directives=yes
2629 - libc_cv_broken_visibility_attribute=no
2630 - libc_cv_c_cleanup=yes
2631 - libc_cv_compiler_powerpc64le_binary128_ok=yes
2632 - libc_cv_forced_unwind=yes
2633 - libc_cv_gcc___thread=yes
2634 - libc_cv_mlong_double_128=yes
2635 - libc_cv_mlong_double_128ibm=yes
2636 - libc_cv_ppc_machine=yes
2637 - libc_cv_ppc_rel16=yes
2638 - libc_cv_predef_fortify_source=no
2639 - libc_cv_target_power8_ok=yes
2640 - libc_cv_visibility_attribute=yes
2641 - libc_cv_z_combreloc=yes
2642 - libc_cv_z_execstack=yes
2643 - libc_cv_z_initfirst=yes
2644 - libc_cv_z_nodelete=yes
2645 - libc_cv_z_nodlopen=yes
2646 - libc_cv_z_relro=yes
2647 - libc_mips_abi=${ABI}
2648 - libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard)
2649 - # These libs don't have configure flags.
2650 - ac_cv_lib_audit_audit_log_user_avc_message=no
2651 - ac_cv_lib_cap_cap_init=no
2652 - )
2653 -
2654 - einfo "Forcing cached settings:"
2655 - for v in "${vars[@]}" ; do
2656 - einfo " ${v}"
2657 - export ${v}
2658 - done
2659 -
2660 - local headers_only_arch_CPPFLAGS=()
2661 -
2662 - # Blow away some random CC settings that screw things up. #550192
2663 - if [[ -d ${S}/sysdeps/mips ]]; then
2664 - pushd "${S}"/sysdeps/mips >/dev/null
2665 - sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die
2666 - sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die
2667 -
2668 - # Force the mips ABI to the default. This is OK because the set of
2669 - # installed headers in this phase is the same between the 3 ABIs.
2670 - # If this ever changes, this hack will break, but that's unlikely
2671 - # as glibc discourages that behavior.
2672 - # https://crbug.com/647033
2673 - sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die
2674 -
2675 - popd >/dev/null
2676 - fi
2677 -
2678 - case ${CTARGET} in
2679 - riscv*)
2680 - # RISC-V interrogates the compiler to determine which target to
2681 - # build. If building the headers then we don't strictly need a
2682 - # RISC-V compiler, so the built-in definitions that are provided
2683 - # along with all RISC-V compiler might not exist. This causes
2684 - # glibc's RISC-V preconfigure script to blow up. Since we're just
2685 - # building the headers any value will actually work here, so just
2686 - # pick the standard one (rv64g/lp64d) to make the build scripts
2687 - # happy for now -- the headers are all the same anyway so it
2688 - # doesn't matter.
2689 - headers_only_arch_CPPFLAGS+=(
2690 - -D__riscv_xlen=64
2691 - -D__riscv_flen=64
2692 - -D__riscv_float_abi_double=1
2693 - -D__riscv_atomic=1
2694 - ) ;;
2695 - esac
2696 -
2697 - local myconf=()
2698 - myconf+=(
2699 - --disable-sanity-checks
2700 - --enable-hacker-mode
2701 - --without-cvs
2702 - --disable-werror
2703 - --enable-bind-now
2704 - --build=${CBUILD_OPT:-${CBUILD}}
2705 - --host=${CTARGET_OPT:-${CTARGET}}
2706 - --with-headers=$(build_eprefix)$(alt_build_headers)
2707 - --prefix="$(host_eprefix)/usr"
2708 - ${EXTRA_ECONF}
2709 - )
2710 -
2711 - # Nothing is compiled here which would affect the headers for the target.
2712 - # So forcing CC/CFLAGS is sane.
2713 - local headers_only_CC=$(tc-getBUILD_CC)
2714 - local headers_only_CFLAGS="-O1 -pipe"
2715 - local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}"
2716 - local headers_only_LDFLAGS=""
2717 - set -- "${S}"/configure "${myconf[@]}"
2718 - echo \
2719 - "CC=${headers_only_CC}" \
2720 - "CFLAGS=${headers_only_CFLAGS}" \
2721 - "CPPFLAGS=${headers_only_CPPFLAGS}" \
2722 - "LDFLAGS=${headers_only_LDFLAGS}" \
2723 - "$@"
2724 - CC=${headers_only_CC} \
2725 - CFLAGS=${headers_only_CFLAGS} \
2726 - CPPFLAGS=${headers_only_CPPFLAGS} \
2727 - LDFLAGS="" \
2728 - "$@" || die "failed to configure glibc"
2729 -}
2730 -
2731 -do_src_configure() {
2732 - if just_headers ; then
2733 - glibc_headers_configure
2734 - else
2735 - glibc_do_configure nptl
2736 - fi
2737 -}
2738 -
2739 -src_configure() {
2740 - foreach_abi do_src_configure
2741 -}
2742 -
2743 -do_src_compile() {
2744 - emake -C "$(builddir nptl)"
2745 -}
2746 -
2747 -src_compile() {
2748 - if just_headers ; then
2749 - return
2750 - fi
2751 -
2752 - foreach_abi do_src_compile
2753 -}
2754 -
2755 -glibc_src_test() {
2756 - cd "$(builddir nptl)"
2757 -
2758 - local myxfailparams=""
2759 - if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then
2760 - for myt in ${XFAIL_TEST_LIST[@]} ; do
2761 - myxfailparams+="test-xfail-${myt}=yes "
2762 - done
2763 - fi
2764 -
2765 - # sandbox does not understand unshare() and prevents
2766 - # writes to /proc/, which makes many tests fail
2767 -
2768 - SANDBOX_ON=0 LD_PRELOAD= emake ${myxfailparams} check
2769 -}
2770 -
2771 -do_src_test() {
2772 - local ret=0
2773 -
2774 - glibc_src_test
2775 - : $(( ret |= $? ))
2776 -
2777 - return ${ret}
2778 -}
2779 -
2780 -src_test() {
2781 - if just_headers ; then
2782 - return
2783 - fi
2784 -
2785 - # Give tests more time to complete.
2786 - export TIMEOUTFACTOR=5
2787 -
2788 - foreach_abi do_src_test || die "tests failed"
2789 -}
2790 -
2791 -run_locale_gen() {
2792 - # if the host locales.gen contains no entries, we'll install everything
2793 - local root="$1"
2794 - local inplace=""
2795 -
2796 - if [[ "${root}" == "--inplace-glibc" ]] ; then
2797 - inplace="--inplace-glibc"
2798 - root="$2"
2799 - fi
2800 -
2801 - local locale_list="${root%/}/etc/locale.gen"
2802 -
2803 - pushd "${ED}"/$(get_libdir) >/dev/null
2804 -
2805 - if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
2806 - [[ -z ${inplace} ]] && ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
2807 - locale_list="${root%/}/usr/share/i18n/SUPPORTED"
2808 - fi
2809 -
2810 - set -- locale-gen ${inplace} --jobs $(makeopts_jobs) --config "${locale_list}" \
2811 - --destdir "${root}"
2812 - echo "$@"
2813 - "$@"
2814 -
2815 - popd >/dev/null
2816 -}
2817 -
2818 -glibc_do_src_install() {
2819 - local builddir=$(builddir nptl)
2820 - cd "${builddir}"
2821 -
2822 - emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install
2823 -
2824 - # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support
2825 - # which come without headers etc. Only needed for binary packages since the
2826 - # external net-libs/libnsl has increased soversion. Keep only versioned libraries.
2827 - find "${D}" -name "libnsl.a" -delete
2828 - find "${D}" -name "libnsl.so" -delete
2829 -
2830 - # Normally upstream_pv is ${PV}. Live ebuilds are exception, there we need
2831 - # to infer upstream version:
2832 - # '#define VERSION "2.26.90"' -> '2.26.90'
2833 - local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
2834 -
2835 - # Avoid stripping binaries not targeted by ${CHOST}. Or else
2836 - # ${CHOST}-strip would break binaries build for ${CTARGET}.
2837 - is_crosscompile && dostrip -x /
2838 - # gdb thread introspection relies on local libpthreas symbols. stripping breaks it
2839 - # See Note [Disable automatic stripping]
2840 - dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so
2841 -
2842 - if [[ -e ${ED}/$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
2843 - # Move versioned .a file out of libdir to evade portage QA checks
2844 - # instead of using gen_usr_ldscript(). We fix ldscript as:
2845 - # "GROUP ( /usr/lib64/libm-<pv>.a ..." -> "GROUP ( /usr/lib64/glibc-<pv>/libm-<pv>.a ..."
2846 - sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"/$(alt_usrlibdir)/libm.a || die
2847 - dodir $(alt_usrlibdir)/${P}
2848 - mv "${ED}"/$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"/$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die
2849 - fi
2850 -
2851 - # We'll take care of the cache ourselves
2852 - rm -f "${ED}"/etc/ld.so.cache
2853 -
2854 - # Everything past this point just needs to be done once ...
2855 - is_final_abi || return 0
2856 -
2857 - # Make sure the non-native interp can be found on multilib systems even
2858 - # if the main library set isn't installed into the right place. Maybe
2859 - # we should query the active gcc for info instead of hardcoding it ?
2860 - local i ldso_abi ldso_name
2861 - local ldso_abi_list=(
2862 - # x86
2863 - amd64 /lib64/ld-linux-x86-64.so.2
2864 - x32 /libx32/ld-linux-x32.so.2
2865 - x86 /lib/ld-linux.so.2
2866 - # mips
2867 - o32 /lib/ld.so.1
2868 - n32 /lib32/ld.so.1
2869 - n64 /lib64/ld.so.1
2870 - # powerpc
2871 - ppc /lib/ld.so.1
2872 - # riscv
2873 - ilp32d /lib/ld-linux-riscv32-ilp32d.so.1
2874 - ilp32 /lib/ld-linux-riscv32-ilp32.so.1
2875 - lp64d /lib/ld-linux-riscv64-lp64d.so.1
2876 - lp64 /lib/ld-linux-riscv64-lp64.so.1
2877 - # s390
2878 - s390 /lib/ld.so.1
2879 - s390x /lib/ld64.so.1
2880 - # sparc
2881 - sparc32 /lib/ld-linux.so.2
2882 - sparc64 /lib64/ld-linux.so.2
2883 - )
2884 - case $(tc-endian) in
2885 - little)
2886 - ldso_abi_list+=(
2887 - # arm
2888 - arm64 /lib/ld-linux-aarch64.so.1
2889 - # ELFv2 (glibc does not support ELFv1 on LE)
2890 - ppc64 /lib64/ld64.so.2
2891 - )
2892 - ;;
2893 - big)
2894 - ldso_abi_list+=(
2895 - # arm
2896 - arm64 /lib/ld-linux-aarch64_be.so.1
2897 - # ELFv1 (glibc does not support ELFv2 on BE)
2898 - ppc64 /lib64/ld64.so.1
2899 - )
2900 - ;;
2901 - esac
2902 - if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then
2903 - dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib
2904 - fi
2905 - for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do
2906 - ldso_abi=${ldso_abi_list[i]}
2907 - has ${ldso_abi} $(get_install_abis) || continue
2908 -
2909 - ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}"
2910 - if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then
2911 - dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name}
2912 - fi
2913 - done
2914 -
2915 - # In the LSB 5.0 definition, someone had the excellent idea to "standardize"
2916 - # the runtime loader name, see also https://xkcd.com/927/
2917 - # Normally, in Gentoo one should never come across executables that require this.
2918 - # However, binary commercial packages are known to adhere to weird practices.
2919 - # https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-AMD64/LSB-Core-AMD64.html#BASELIB
2920 - local lsb_ldso_name native_ldso_name lsb_ldso_abi
2921 - local lsb_ldso_abi_list=(
2922 - # x86
2923 - amd64 ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
2924 - )
2925 - for (( i = 0; i < ${#lsb_ldso_abi_list[@]}; i += 3 )) ; do
2926 - lsb_ldso_abi=${lsb_ldso_abi_list[i]}
2927 - native_ldso_name=${lsb_ldso_abi_list[i+1]}
2928 - lsb_ldso_name=${lsb_ldso_abi_list[i+2]}
2929 - has ${lsb_ldso_abi} $(get_install_abis) || continue
2930 -
2931 - if [[ ! -L ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} && ! -e ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} ]] ; then
2932 - dosym ${native_ldso_name} "$(alt_prefix)/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name}"
2933 - fi
2934 - done
2935 -
2936 - # With devpts under Linux mounted properly, we do not need the pt_chown
2937 - # binary to be setuid. This is because the default owners/perms will be
2938 - # exactly what we want.
2939 - if ! use suid ; then
2940 - find "${ED}" -name pt_chown -exec chmod -s {} +
2941 - fi
2942 -
2943 - #################################################################
2944 - # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
2945 - # Make sure we install some symlink hacks so that when we build
2946 - # a 2nd stage cross-compiler, gcc finds the target system
2947 - # headers correctly. See gcc/doc/gccinstall.info
2948 - if is_crosscompile ; then
2949 - # We need to make sure that /lib and /usr/lib always exists.
2950 - # gcc likes to use relative paths to get to its multilibs like
2951 - # /usr/lib/../lib64/. So while we don't install any files into
2952 - # /usr/lib/, we do need it to exist.
2953 - keepdir $(alt_prefix)/lib
2954 - keepdir $(alt_prefix)/usr/lib
2955 -
2956 - dosym usr/include $(alt_prefix)/sys-include
2957 - return 0
2958 - fi
2959 -
2960 - # Files for Debian-style locale updating
2961 - dodir /usr/share/i18n
2962 - sed \
2963 - -e "/^#/d" \
2964 - -e "/SUPPORTED-LOCALES=/d" \
2965 - -e "s: \\\\::g" -e "s:/: :g" \
2966 - "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \
2967 - || die "generating /usr/share/i18n/SUPPORTED failed"
2968 - cd "${WORKDIR}"/extra/locale
2969 - dosbin locale-gen
2970 - doman *.[0-8]
2971 - insinto /etc
2972 - doins locale.gen
2973 -
2974 - keepdir /usr/lib/locale
2975 -
2976 - cd "${S}"
2977 -
2978 - # Install misc network config files
2979 - insinto /etc
2980 - doins posix/gai.conf
2981 -
2982 - if use systemd ; then
2983 - doins "${WORKDIR}/glibc-systemd-${GLIBC_SYSTEMD_VER}/gentoo-config/nsswitch.conf"
2984 - else
2985 - doins nss/nsswitch.conf
2986 - fi
2987 -
2988 - # Gentoo-specific
2989 - newins "${FILESDIR}"/host.conf-1 host.conf
2990 -
2991 - if use nscd ; then
2992 - doins nscd/nscd.conf
2993 -
2994 - newinitd "$(prefixify_ro "${FILESDIR}"/nscd-1)" nscd
2995 -
2996 - local nscd_args=(
2997 - -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
2998 - )
2999 -
3000 - sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd
3001 -
3002 - use systemd && systemd_dounit nscd/nscd.service
3003 - newtmpfiles nscd/nscd.tmpfiles nscd.conf
3004 - fi
3005 -
3006 - echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
3007 - doenvd "${T}"/00glibc
3008 -
3009 - for d in BUGS ChangeLog CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do
3010 - [[ -s ${d} ]] && dodoc ${d}
3011 - done
3012 - dodoc -r ChangeLog.old
3013 -
3014 - # Prevent overwriting of the /etc/localtime symlink. We'll handle the
3015 - # creation of the "factory" symlink in pkg_postinst().
3016 - rm -f "${ED}"/etc/localtime
3017 -
3018 - # Generate all locales if this is a native build as locale generation
3019 - if use compile-locales && ! is_crosscompile ; then
3020 - run_locale_gen --inplace-glibc "${ED}/"
3021 - sed -e 's:COMPILED_LOCALES="":COMPILED_LOCALES="1":' -i "${ED}"/usr/sbin/locale-gen || die
3022 - fi
3023 -}
3024 -
3025 -glibc_headers_install() {
3026 - local builddir=$(builddir "headers")
3027 - cd "${builddir}"
3028 - emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install-headers
3029 -
3030 - insinto $(alt_headers)/gnu
3031 - doins "${S}"/include/gnu/stubs.h
3032 -
3033 - # Make sure we install the sys-include symlink so that when
3034 - # we build a 2nd stage cross-compiler, gcc finds the target
3035 - # system headers correctly. See gcc/doc/gccinstall.info
3036 - dosym usr/include $(alt_prefix)/sys-include
3037 -}
3038 -
3039 -src_install() {
3040 - if just_headers ; then
3041 - export ABI=default
3042 - glibc_headers_install
3043 - return
3044 - fi
3045 -
3046 - foreach_abi glibc_do_src_install
3047 -
3048 - if ! use static-libs ; then
3049 - einfo "Not installing static glibc libraries"
3050 - find "${ED}" -name "*.a" -and -not -name "*_nonshared.a" -delete
3051 - fi
3052 -}
3053 -
3054 -# Simple test to make sure our new glibc isn't completely broken.
3055 -# Make sure we don't test with statically built binaries since
3056 -# they will fail. Also, skip if this glibc is a cross compiler.
3057 -#
3058 -# If coreutils is built with USE=multicall, some of these files
3059 -# will just be wrapper scripts, not actual ELFs we can test.
3060 -glibc_sanity_check() {
3061 - cd / #228809
3062 -
3063 - # We enter ${ED} so to avoid trouble if the path contains
3064 - # special characters; for instance if the path contains the
3065 - # colon character (:), then the linker will try to split it
3066 - # and look for the libraries in an unexpected place. This can
3067 - # lead to unsafe code execution if the generated prefix is
3068 - # within a world-writable directory.
3069 - # (e.g. /var/tmp/portage:${HOSTNAME})
3070 - pushd "${ED}"/$(get_libdir) >/dev/null
3071 -
3072 - # first let's find the actual dynamic linker here
3073 - # symlinks may point to the wrong abi
3074 - local newldso=$(find . -name 'ld*so.?' -type f -print -quit)
3075 -
3076 - einfo Last-minute run tests with ${newldso} in /$(get_libdir) ...
3077 -
3078 - local x striptest
3079 - for x in cal date env free ls true uname uptime ; do
3080 - x=$(type -p ${x})
3081 - [[ -z ${x} || ${x} != ${EPREFIX}/* ]] && continue
3082 - striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) || continue
3083 - case ${striptest} in
3084 - *"statically linked"*) continue;;
3085 - *"ASCII text"*) continue;;
3086 - esac
3087 - # We need to clear the locale settings as the upgrade might want
3088 - # incompatible locale data. This test is not for verifying that.
3089 - LC_ALL=C \
3090 - ${newldso} --library-path . ${x} > /dev/null \
3091 - || die "simple run test (${x}) failed"
3092 - done
3093 -
3094 - popd >/dev/null
3095 -}
3096 -
3097 -pkg_preinst() {
3098 - # nothing to do if just installing headers
3099 - just_headers && return
3100 -
3101 - # prepare /etc/ld.so.conf.d/ for files
3102 - mkdir -p "${EROOT}"/etc/ld.so.conf.d
3103 -
3104 - # Default /etc/hosts.conf:multi to on for systems with small dbs.
3105 - if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then
3106 - sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf
3107 - einfo "Defaulting /etc/host.conf:multi to on"
3108 - fi
3109 -
3110 - [[ -n ${ROOT} ]] && return 0
3111 - [[ -d ${ED}/$(get_libdir) ]] || return 0
3112 - [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check
3113 -
3114 - if [[ -L ${EROOT}/usr/lib/locale ]]; then
3115 - # Help portage migrate this to a directory
3116 - # https://bugs.gentoo.org/753740
3117 - rm "${EROOT}"/usr/lib/locale || die
3118 - fi
3119 -
3120 - # Keep around libcrypt so that Perl doesn't break when merging libxcrypt
3121 - # (libxcrypt is the new provider for now of libcrypt.so.{1,2}).
3122 - # bug #802207
3123 - if ! use crypt && has_version "${CATEGORY}/${PN}[crypt]" && ! has preserve-libs ${FEATURES}; then
3124 - PRESERVED_OLD_LIBCRYPT=1
3125 - cp -p "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" "${T}/libcrypt$(get_libname 1)" || die
3126 - else
3127 - PRESERVED_OLD_LIBCRYPT=0
3128 - fi
3129 -}
3130 -
3131 -pkg_postinst() {
3132 - # nothing to do if just installing headers
3133 - just_headers && return
3134 -
3135 - if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then
3136 - # Generate fastloading iconv module configuration file.
3137 - "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}/"
3138 - fi
3139 -
3140 - if ! is_crosscompile && [[ -z ${ROOT} ]] ; then
3141 - use compile-locales || run_locale_gen "${EROOT}/"
3142 - fi
3143 -
3144 - upgrade_warning
3145 -
3146 - # Check for sanity of /etc/nsswitch.conf, take 2
3147 - if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then
3148 - local entry
3149 - for entry in passwd group shadow; do
3150 - if egrep -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then
3151 - ewarn ""
3152 - ewarn "Your ${EROOT}/etc/nsswitch.conf uses NIS. Support for that has been"
3153 - ewarn "removed from glibc and is now provided by the package"
3154 - ewarn " sys-auth/libnss-nis"
3155 - ewarn "Install it now to keep your NIS setup working."
3156 - ewarn ""
3157 - fi
3158 - done
3159 - fi
3160 -
3161 - if [[ ${PRESERVED_OLD_LIBCRYPT} -eq 1 ]] ; then
3162 - cp -p "${T}/libcrypt$(get_libname 1)" "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" || die
3163 - preserve_old_lib_notify /$(get_libdir)/libcrypt$(get_libname 1)
3164 -
3165 - elog "Please ignore a possible later error message about a file collision involving"
3166 - elog "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1). We need to preserve this file for the moment to keep"
3167 - elog "the upgrade working, but it also needs to be overwritten when"
3168 - elog "sys-libs/libxcrypt is installed. See bug 802210 for more details."
3169 - fi
3170 -}