Lines 1-1714
Link Here
|
1 |
# Copyright 1999-2023 Gentoo Authors |
1 |
# Copyright 1999-2023 Gentoo Authors |
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
3 |
|
4 |
EAPI=8 |
4 |
EAPI=8 |
5 |
|
5 |
|
6 |
# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc |
6 |
# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc |
7 |
# Please read & adapt the page as necessary if obsolete. |
7 |
# Please read & adapt the page as necessary if obsolete. |
8 |
|
8 |
|
9 |
PYTHON_COMPAT=( python3_{9..12} ) |
9 |
PYTHON_COMPAT=( python3_{9..12} ) |
10 |
TMPFILES_OPTIONAL=1 |
10 |
TMPFILES_OPTIONAL=1 |
11 |
|
11 |
|
12 |
inherit python-any-r1 prefix preserve-libs toolchain-funcs flag-o-matic gnuconfig \ |
12 |
inherit python-any-r1 prefix preserve-libs toolchain-funcs flag-o-matic gnuconfig \ |
13 |
multilib systemd multiprocessing tmpfiles |
13 |
multilib systemd multiprocessing tmpfiles |
14 |
|
14 |
|
15 |
DESCRIPTION="GNU libc C library" |
15 |
DESCRIPTION="GNU libc C library" |
16 |
HOMEPAGE="https://www.gnu.org/software/libc/" |
16 |
HOMEPAGE="https://www.gnu.org/software/libc/" |
17 |
LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE" |
17 |
LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE" |
18 |
SLOT="2.2" |
18 |
SLOT="2.2" |
19 |
|
19 |
|
20 |
EMULTILIB_PKG="true" |
20 |
EMULTILIB_PKG="true" |
21 |
|
21 |
|
22 |
# Gentoo patchset (ignored for live ebuilds) |
22 |
# Gentoo patchset (ignored for live ebuilds) |
23 |
PATCH_VER=9 |
23 |
PATCH_VER=9 |
24 |
PATCH_DEV=dilfridge |
24 |
PATCH_DEV=dilfridge |
25 |
|
25 |
|
26 |
# gcc mulitilib bootstrap files version |
26 |
# gcc mulitilib bootstrap files version |
27 |
GCC_BOOTSTRAP_VER=20201208 |
27 |
GCC_BOOTSTRAP_VER=20201208 |
28 |
|
28 |
|
29 |
# systemd integration version |
29 |
# systemd integration version |
30 |
GLIBC_SYSTEMD_VER=20210729 |
30 |
GLIBC_SYSTEMD_VER=20210729 |
31 |
|
31 |
|
32 |
# Minimum kernel version that glibc requires |
32 |
# Minimum kernel version that glibc requires |
33 |
MIN_KERN_VER="3.2.0" |
33 |
MIN_KERN_VER="3.2.0" |
34 |
|
34 |
|
35 |
# Minimum pax-utils version needed (which contains any new syscall changes for |
35 |
# Minimum pax-utils version needed (which contains any new syscall changes for |
36 |
# its seccomp filter!). Please double check this! |
36 |
# its seccomp filter!). Please double check this! |
37 |
MIN_PAX_UTILS_VER="1.3.3" |
37 |
MIN_PAX_UTILS_VER="1.3.3" |
38 |
|
38 |
|
39 |
if [[ ${PV} == 9999* ]]; then |
39 |
if [[ ${PV} == 9999* ]]; then |
40 |
inherit git-r3 |
40 |
inherit git-r3 |
41 |
else |
41 |
else |
42 |
# KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" |
42 |
# KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" |
43 |
SRC_URI="mirror://gnu/glibc/${P}.tar.xz" |
43 |
SRC_URI="mirror://gnu/glibc/${P}.tar.xz" |
44 |
SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz" |
44 |
SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz" |
45 |
fi |
45 |
fi |
46 |
|
46 |
|
47 |
SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )" |
47 |
SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )" |
48 |
SRC_URI+=" systemd? ( https://gitweb.gentoo.org/proj/toolchain/glibc-systemd.git/snapshot/glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz )" |
48 |
SRC_URI+=" systemd? ( https://gitweb.gentoo.org/proj/toolchain/glibc-systemd.git/snapshot/glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz )" |
49 |
|
49 |
|
50 |
IUSE="audit caps cet compile-locales +crypt custom-cflags doc gd hash-sysv-compat headers-only +multiarch multilib multilib-bootstrap nscd perl profile selinux +ssp stack-realign +static-libs suid systemd systemtap test vanilla" |
50 |
IUSE="audit caps cet compile-locales +crypt custom-cflags doc gd hash-sysv-compat headers-only +multiarch multilib multilib-bootstrap nscd perl profile selinux +ssp stack-realign +static-libs suid systemd systemtap test vanilla" |
51 |
|
51 |
|
52 |
# Here's how the cross-compile logic breaks down ... |
52 |
# Here's how the cross-compile logic breaks down ... |
53 |
# CTARGET - machine that will target the binaries |
53 |
# CTARGET - machine that will target the binaries |
54 |
# CHOST - machine that will host the binaries |
54 |
# CHOST - machine that will host the binaries |
55 |
# CBUILD - machine that will build the binaries |
55 |
# CBUILD - machine that will build the binaries |
56 |
# If CTARGET != CHOST, it means you want a libc for cross-compiling. |
56 |
# If CTARGET != CHOST, it means you want a libc for cross-compiling. |
57 |
# If CHOST != CBUILD, it means you want to cross-compile the libc. |
57 |
# If CHOST != CBUILD, it means you want to cross-compile the libc. |
58 |
# CBUILD = CHOST = CTARGET - native build/install |
58 |
# CBUILD = CHOST = CTARGET - native build/install |
59 |
# CBUILD != (CHOST = CTARGET) - cross-compile a native build |
59 |
# CBUILD != (CHOST = CTARGET) - cross-compile a native build |
60 |
# (CBUILD = CHOST) != CTARGET - libc for cross-compiler |
60 |
# (CBUILD = CHOST) != CTARGET - libc for cross-compiler |
61 |
# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler |
61 |
# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler |
62 |
# For install paths: |
62 |
# For install paths: |
63 |
# CHOST = CTARGET - install into / |
63 |
# CHOST = CTARGET - install into / |
64 |
# CHOST != CTARGET - install into /usr/CTARGET/ |
64 |
# CHOST != CTARGET - install into /usr/CTARGET/ |
65 |
# |
65 |
# |
66 |
export CBUILD=${CBUILD:-${CHOST}} |
66 |
export CBUILD=${CBUILD:-${CHOST}} |
67 |
export CTARGET=${CTARGET:-${CHOST}} |
67 |
export CTARGET=${CTARGET:-${CHOST}} |
68 |
if [[ ${CTARGET} == ${CHOST} ]] ; then |
68 |
if [[ ${CTARGET} == ${CHOST} ]] ; then |
69 |
if [[ ${CATEGORY} == cross-* ]] ; then |
69 |
if [[ ${CATEGORY} == cross-* ]] ; then |
70 |
export CTARGET=${CATEGORY#cross-} |
70 |
export CTARGET=${CATEGORY#cross-} |
71 |
fi |
71 |
fi |
72 |
fi |
72 |
fi |
73 |
|
73 |
|
74 |
# Note [Disable automatic stripping] |
74 |
# Note [Disable automatic stripping] |
75 |
# Disabling automatic stripping for a few reasons: |
75 |
# Disabling automatic stripping for a few reasons: |
76 |
# - portage's attempt to strip breaks non-native binaries at least on |
76 |
# - portage's attempt to strip breaks non-native binaries at least on |
77 |
# arm: bug #697428 |
77 |
# arm: bug #697428 |
78 |
# - portage's attempt to strip libpthread.so.0 breaks gdb thread |
78 |
# - portage's attempt to strip libpthread.so.0 breaks gdb thread |
79 |
# enumeration: bug #697910. This is quite subtle: |
79 |
# enumeration: bug #697910. This is quite subtle: |
80 |
# * gdb uses glibc's libthread_db-1.0.so to enumerate threads. |
80 |
# * gdb uses glibc's libthread_db-1.0.so to enumerate threads. |
81 |
# * libthread_db-1.0.so needs access to libpthread.so.0 local symbols |
81 |
# * libthread_db-1.0.so needs access to libpthread.so.0 local symbols |
82 |
# via 'ps_pglobal_lookup' symbol defined in gdb. |
82 |
# via 'ps_pglobal_lookup' symbol defined in gdb. |
83 |
# * 'ps_pglobal_lookup' uses '.symtab' section table to resolve all |
83 |
# * 'ps_pglobal_lookup' uses '.symtab' section table to resolve all |
84 |
# known symbols in 'libpthread.so.0'. Specifically 'nptl_version' |
84 |
# known symbols in 'libpthread.so.0'. Specifically 'nptl_version' |
85 |
# (unexported) is used to sanity check compatibility before enabling |
85 |
# (unexported) is used to sanity check compatibility before enabling |
86 |
# debugging. |
86 |
# debugging. |
87 |
# 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 |
87 |
# 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 |
88 |
# * normal 'strip' command trims '.symtab' |
88 |
# * normal 'strip' command trims '.symtab' |
89 |
# Thus our main goal here is to prevent 'libpthread.so.0' from |
89 |
# Thus our main goal here is to prevent 'libpthread.so.0' from |
90 |
# losing it's '.symtab' entries. |
90 |
# losing it's '.symtab' entries. |
|
|
91 |
# - similarly, valgrind requires knowledge about symbols in ld.so: |
92 |
# bug #920753 |
91 |
# As Gentoo's strip does not allow us to pass less aggressive stripping |
93 |
# As Gentoo's strip does not allow us to pass less aggressive stripping |
92 |
# options and does not check the machine target we strip selectively. |
94 |
# options and does not check the machine target we strip selectively. |
93 |
|
95 |
|
94 |
# We need a new-enough binutils/gcc to match upstream baseline. |
96 |
# We need a new-enough binutils/gcc to match upstream baseline. |
95 |
# Also we need to make sure our binutils/gcc supports TLS, |
97 |
# Also we need to make sure our binutils/gcc supports TLS, |
96 |
# and that gcc already contains the hardened patches. |
98 |
# and that gcc already contains the hardened patches. |
97 |
# Lastly, let's avoid some openssh nastiness, bug 708224, as |
99 |
# Lastly, let's avoid some openssh nastiness, bug 708224, as |
98 |
# convenience to our users. |
100 |
# convenience to our users. |
99 |
|
101 |
|
100 |
IDEPEND=" |
102 |
IDEPEND=" |
101 |
!compile-locales? ( sys-apps/locale-gen ) |
103 |
!compile-locales? ( sys-apps/locale-gen ) |
102 |
" |
104 |
" |
103 |
BDEPEND=" |
105 |
BDEPEND=" |
104 |
${PYTHON_DEPS} |
106 |
${PYTHON_DEPS} |
105 |
>=app-misc/pax-utils-${MIN_PAX_UTILS_VER} |
107 |
>=app-misc/pax-utils-${MIN_PAX_UTILS_VER} |
106 |
sys-devel/bison |
108 |
sys-devel/bison |
107 |
compile-locales? ( sys-apps/locale-gen ) |
109 |
compile-locales? ( sys-apps/locale-gen ) |
108 |
doc? ( |
110 |
doc? ( |
109 |
dev-lang/perl |
111 |
dev-lang/perl |
110 |
sys-apps/texinfo |
112 |
sys-apps/texinfo |
111 |
) |
113 |
) |
112 |
test? ( |
114 |
test? ( |
113 |
dev-lang/perl |
115 |
dev-lang/perl |
114 |
>=net-dns/libidn2-2.3.0 |
116 |
>=net-dns/libidn2-2.3.0 |
115 |
) |
117 |
) |
116 |
" |
118 |
" |
117 |
COMMON_DEPEND=" |
119 |
COMMON_DEPEND=" |
118 |
gd? ( media-libs/gd:2= ) |
120 |
gd? ( media-libs/gd:2= ) |
119 |
nscd? ( selinux? ( |
121 |
nscd? ( selinux? ( |
120 |
audit? ( sys-process/audit ) |
122 |
audit? ( sys-process/audit ) |
121 |
caps? ( sys-libs/libcap ) |
123 |
caps? ( sys-libs/libcap ) |
122 |
) ) |
124 |
) ) |
123 |
suid? ( caps? ( sys-libs/libcap ) ) |
125 |
suid? ( caps? ( sys-libs/libcap ) ) |
124 |
selinux? ( sys-libs/libselinux ) |
126 |
selinux? ( sys-libs/libselinux ) |
125 |
systemtap? ( dev-util/systemtap ) |
127 |
systemtap? ( dev-util/systemtap ) |
126 |
" |
128 |
" |
127 |
DEPEND="${COMMON_DEPEND} |
129 |
DEPEND="${COMMON_DEPEND} |
128 |
" |
130 |
" |
129 |
RDEPEND="${COMMON_DEPEND} |
131 |
RDEPEND="${COMMON_DEPEND} |
130 |
!<app-misc/pax-utils-${MIN_PAX_UTILS_VER} |
132 |
!<app-misc/pax-utils-${MIN_PAX_UTILS_VER} |
131 |
perl? ( dev-lang/perl ) |
133 |
perl? ( dev-lang/perl ) |
132 |
" |
134 |
" |
133 |
|
135 |
|
134 |
RESTRICT="!test? ( test )" |
136 |
RESTRICT="!test? ( test )" |
135 |
|
137 |
|
136 |
if [[ ${CATEGORY} == cross-* ]] ; then |
138 |
if [[ ${CATEGORY} == cross-* ]] ; then |
137 |
BDEPEND+=" !headers-only? ( |
139 |
BDEPEND+=" !headers-only? ( |
138 |
>=${CATEGORY}/binutils-2.27 |
140 |
>=${CATEGORY}/binutils-2.27 |
139 |
>=${CATEGORY}/gcc-6.2 |
141 |
>=${CATEGORY}/gcc-6.2 |
140 |
)" |
142 |
)" |
141 |
[[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers" |
143 |
[[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers" |
142 |
else |
144 |
else |
143 |
BDEPEND+=" |
145 |
BDEPEND+=" |
144 |
>=sys-devel/binutils-2.27 |
146 |
>=sys-devel/binutils-2.27 |
145 |
>=sys-devel/gcc-6.2 |
147 |
>=sys-devel/gcc-6.2 |
146 |
" |
148 |
" |
147 |
DEPEND+=" virtual/os-headers " |
149 |
DEPEND+=" virtual/os-headers " |
148 |
RDEPEND+=" |
150 |
RDEPEND+=" |
149 |
>=net-dns/libidn2-2.3.0 |
151 |
>=net-dns/libidn2-2.3.0 |
150 |
vanilla? ( !sys-libs/timezone-data ) |
152 |
vanilla? ( !sys-libs/timezone-data ) |
151 |
" |
153 |
" |
152 |
PDEPEND+=" !vanilla? ( sys-libs/timezone-data )" |
154 |
PDEPEND+=" !vanilla? ( sys-libs/timezone-data )" |
153 |
fi |
155 |
fi |
154 |
|
156 |
|
155 |
# Ignore tests whitelisted below |
157 |
# Ignore tests whitelisted below |
156 |
GENTOO_GLIBC_XFAIL_TESTS="${GENTOO_GLIBC_XFAIL_TESTS:-yes}" |
158 |
GENTOO_GLIBC_XFAIL_TESTS="${GENTOO_GLIBC_XFAIL_TESTS:-yes}" |
157 |
|
159 |
|
158 |
# The following tests fail due to the Gentoo build system and are thus |
160 |
# The following tests fail due to the Gentoo build system and are thus |
159 |
# executed but ignored: |
161 |
# executed but ignored: |
160 |
XFAIL_TEST_LIST=( |
162 |
XFAIL_TEST_LIST=( |
161 |
# buggy test, assumes /dev/ and /dev/null on a single filesystem |
163 |
# buggy test, assumes /dev/ and /dev/null on a single filesystem |
162 |
# 'mount --bind /dev/null /chroot/dev/null' breaks it. |
164 |
# 'mount --bind /dev/null /chroot/dev/null' breaks it. |
163 |
# https://sourceware.org/PR25909 |
165 |
# https://sourceware.org/PR25909 |
164 |
tst-support_descriptors |
166 |
tst-support_descriptors |
165 |
|
167 |
|
166 |
# The following tests fail only inside portage |
168 |
# The following tests fail only inside portage |
167 |
# https://bugs.gentoo.org/831267 |
169 |
# https://bugs.gentoo.org/831267 |
168 |
tst-system |
170 |
tst-system |
169 |
tst-strerror |
171 |
tst-strerror |
170 |
tst-strsignal |
172 |
tst-strsignal |
171 |
# Fails with certain PORTAGE_NICENESS/PORTAGE_SCHEDULING_POLICY |
173 |
# Fails with certain PORTAGE_NICENESS/PORTAGE_SCHEDULING_POLICY |
172 |
tst-sched1 |
174 |
tst-sched1 |
173 |
) |
175 |
) |
174 |
|
176 |
|
175 |
XFAIL_NSPAWN_TEST_LIST=( |
177 |
XFAIL_NSPAWN_TEST_LIST=( |
176 |
# These tests need to be adapted to handle EPERM/ENOSYS(?) properly |
178 |
# These tests need to be adapted to handle EPERM/ENOSYS(?) properly |
177 |
# upstream, as systemd-nspawn's default seccomp whitelist is too strict. |
179 |
# upstream, as systemd-nspawn's default seccomp whitelist is too strict. |
178 |
# https://sourceware.org/PR30603 |
180 |
# https://sourceware.org/PR30603 |
179 |
test-errno-linux |
181 |
test-errno-linux |
180 |
tst-bz21269 |
182 |
tst-bz21269 |
181 |
tst-mlock2 |
183 |
tst-mlock2 |
182 |
tst-ntp_gettime |
184 |
tst-ntp_gettime |
183 |
tst-ntp_gettime-time64 |
185 |
tst-ntp_gettime-time64 |
184 |
tst-ntp_gettimex |
186 |
tst-ntp_gettimex |
185 |
tst-ntp_gettimex-time64 |
187 |
tst-ntp_gettimex-time64 |
186 |
tst-pkey |
188 |
tst-pkey |
187 |
tst-process_mrelease |
189 |
tst-process_mrelease |
188 |
tst-adjtime |
190 |
tst-adjtime |
189 |
tst-adjtime-time64 |
191 |
tst-adjtime-time64 |
190 |
tst-clock2 |
192 |
tst-clock2 |
191 |
tst-clock2-time64 |
193 |
tst-clock2-time64 |
192 |
|
194 |
|
193 |
# These fail if --suppress-sync and/or low priority is set |
195 |
# These fail if --suppress-sync and/or low priority is set |
194 |
tst-sync_file_range |
196 |
tst-sync_file_range |
195 |
test-errno |
197 |
test-errno |
196 |
) |
198 |
) |
197 |
|
199 |
|
198 |
# |
200 |
# |
199 |
# Small helper functions |
201 |
# Small helper functions |
200 |
# |
202 |
# |
201 |
|
203 |
|
202 |
dump_build_environment() { |
204 |
dump_build_environment() { |
203 |
einfo ==== glibc build environment ======================================================== |
205 |
einfo ==== glibc build environment ======================================================== |
204 |
local v |
206 |
local v |
205 |
for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX CPP LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM AR AS STRIP RANLIB OBJCOPY STRINGS OBJDUMP READELF; do |
207 |
for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX CPP LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM AR AS STRIP RANLIB OBJCOPY STRINGS OBJDUMP READELF; do |
206 |
einfo " $(printf '%15s' ${v}:) ${!v}" |
208 |
einfo " $(printf '%15s' ${v}:) ${!v}" |
207 |
done |
209 |
done |
208 |
einfo ===================================================================================== |
210 |
einfo ===================================================================================== |
209 |
} |
211 |
} |
210 |
|
212 |
|
211 |
is_crosscompile() { |
213 |
is_crosscompile() { |
212 |
[[ ${CHOST} != ${CTARGET} ]] |
214 |
[[ ${CHOST} != ${CTARGET} ]] |
213 |
} |
215 |
} |
214 |
|
216 |
|
215 |
just_headers() { |
217 |
just_headers() { |
216 |
is_crosscompile && use headers-only |
218 |
is_crosscompile && use headers-only |
217 |
} |
219 |
} |
218 |
|
220 |
|
219 |
alt_prefix() { |
221 |
alt_prefix() { |
220 |
is_crosscompile && echo /usr/${CTARGET} |
222 |
is_crosscompile && echo /usr/${CTARGET} |
221 |
} |
223 |
} |
222 |
|
224 |
|
223 |
# This prefix is applicable to CHOST when building against this |
225 |
# This prefix is applicable to CHOST when building against this |
224 |
# glibc. It is baked into the library at configure time. |
226 |
# glibc. It is baked into the library at configure time. |
225 |
host_eprefix() { |
227 |
host_eprefix() { |
226 |
is_crosscompile || echo "${EPREFIX}" |
228 |
is_crosscompile || echo "${EPREFIX}" |
227 |
} |
229 |
} |
228 |
|
230 |
|
229 |
# This prefix is applicable to CBUILD when building against this |
231 |
# This prefix is applicable to CBUILD when building against this |
230 |
# glibc. It determines the destination path at install time. |
232 |
# glibc. It determines the destination path at install time. |
231 |
build_eprefix() { |
233 |
build_eprefix() { |
232 |
is_crosscompile && echo "${EPREFIX}" |
234 |
is_crosscompile && echo "${EPREFIX}" |
233 |
} |
235 |
} |
234 |
|
236 |
|
235 |
# We need to be able to set alternative headers for compiling for non-native |
237 |
# We need to be able to set alternative headers for compiling for non-native |
236 |
# platform. Will also become useful for testing kernel-headers without screwing |
238 |
# platform. Will also become useful for testing kernel-headers without screwing |
237 |
# up the whole system. |
239 |
# up the whole system. |
238 |
alt_headers() { |
240 |
alt_headers() { |
239 |
echo ${ALT_HEADERS:=$(alt_prefix)/usr/include} |
241 |
echo ${ALT_HEADERS:=$(alt_prefix)/usr/include} |
240 |
} |
242 |
} |
241 |
|
243 |
|
242 |
alt_build_headers() { |
244 |
alt_build_headers() { |
243 |
if [[ -z ${ALT_BUILD_HEADERS} ]] ; then |
245 |
if [[ -z ${ALT_BUILD_HEADERS} ]] ; then |
244 |
ALT_BUILD_HEADERS="$(host_eprefix)$(alt_headers)" |
246 |
ALT_BUILD_HEADERS="$(host_eprefix)$(alt_headers)" |
245 |
if tc-is-cross-compiler ; then |
247 |
if tc-is-cross-compiler ; then |
246 |
ALT_BUILD_HEADERS=${SYSROOT}$(alt_headers) |
248 |
ALT_BUILD_HEADERS=${SYSROOT}$(alt_headers) |
247 |
if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then |
249 |
if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then |
248 |
local header_path=$(echo '#include <linux/version.h>' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h') |
250 |
local header_path=$(echo '#include <linux/version.h>' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h') |
249 |
ALT_BUILD_HEADERS=${header_path%/linux/version.h} |
251 |
ALT_BUILD_HEADERS=${header_path%/linux/version.h} |
250 |
fi |
252 |
fi |
251 |
fi |
253 |
fi |
252 |
fi |
254 |
fi |
253 |
echo "${ALT_BUILD_HEADERS}" |
255 |
echo "${ALT_BUILD_HEADERS}" |
254 |
} |
256 |
} |
255 |
|
257 |
|
256 |
alt_libdir() { |
258 |
alt_libdir() { |
257 |
echo $(alt_prefix)/$(get_libdir) |
259 |
echo $(alt_prefix)/$(get_libdir) |
258 |
} |
260 |
} |
259 |
alt_usrlibdir() { |
261 |
alt_usrlibdir() { |
260 |
echo $(alt_prefix)/usr/$(get_libdir) |
262 |
echo $(alt_prefix)/usr/$(get_libdir) |
261 |
} |
263 |
} |
262 |
|
264 |
|
263 |
builddir() { |
265 |
builddir() { |
264 |
echo "${WORKDIR}/build-${ABI}-${CTARGET}-$1" |
266 |
echo "${WORKDIR}/build-${ABI}-${CTARGET}-$1" |
265 |
} |
267 |
} |
266 |
|
268 |
|
267 |
do_compile_test() { |
269 |
do_compile_test() { |
268 |
local ret save_cflags=${CFLAGS} |
270 |
local ret save_cflags=${CFLAGS} |
269 |
CFLAGS+=" $1" |
271 |
CFLAGS+=" $1" |
270 |
shift |
272 |
shift |
271 |
|
273 |
|
272 |
pushd "${T}" >/dev/null |
274 |
pushd "${T}" >/dev/null |
273 |
|
275 |
|
274 |
rm -f glibc-test* |
276 |
rm -f glibc-test* |
275 |
printf '%b' "$*" > glibc-test.c |
277 |
printf '%b' "$*" > glibc-test.c |
276 |
|
278 |
|
277 |
# We assume CC is already set up. |
279 |
# We assume CC is already set up. |
278 |
nonfatal emake glibc-test |
280 |
nonfatal emake glibc-test |
279 |
ret=$? |
281 |
ret=$? |
280 |
|
282 |
|
281 |
popd >/dev/null |
283 |
popd >/dev/null |
282 |
|
284 |
|
283 |
CFLAGS=${save_cflags} |
285 |
CFLAGS=${save_cflags} |
284 |
return ${ret} |
286 |
return ${ret} |
285 |
} |
287 |
} |
286 |
|
288 |
|
287 |
do_run_test() { |
289 |
do_run_test() { |
288 |
local ret |
290 |
local ret |
289 |
|
291 |
|
290 |
if [[ ${MERGE_TYPE} == "binary" ]] ; then |
292 |
if [[ ${MERGE_TYPE} == "binary" ]] ; then |
291 |
# ignore build failures when installing a binary package #324685 |
293 |
# ignore build failures when installing a binary package #324685 |
292 |
do_compile_test "" "$@" 2>/dev/null || return 0 |
294 |
do_compile_test "" "$@" 2>/dev/null || return 0 |
293 |
else |
295 |
else |
294 |
if ! do_compile_test "" "$@" ; then |
296 |
if ! do_compile_test "" "$@" ; then |
295 |
ewarn "Simple build failed ... assuming this is desired #324685" |
297 |
ewarn "Simple build failed ... assuming this is desired #324685" |
296 |
return 0 |
298 |
return 0 |
297 |
fi |
299 |
fi |
298 |
fi |
300 |
fi |
299 |
|
301 |
|
300 |
pushd "${T}" >/dev/null |
302 |
pushd "${T}" >/dev/null |
301 |
|
303 |
|
302 |
./glibc-test |
304 |
./glibc-test |
303 |
ret=$? |
305 |
ret=$? |
304 |
rm -f glibc-test* |
306 |
rm -f glibc-test* |
305 |
|
307 |
|
306 |
popd >/dev/null |
308 |
popd >/dev/null |
307 |
|
309 |
|
308 |
return ${ret} |
310 |
return ${ret} |
309 |
} |
311 |
} |
310 |
|
312 |
|
311 |
setup_target_flags() { |
313 |
setup_target_flags() { |
312 |
# This largely mucks with compiler flags. None of which should matter |
314 |
# This largely mucks with compiler flags. None of which should matter |
313 |
# when building up just the headers. |
315 |
# when building up just the headers. |
314 |
just_headers && return 0 |
316 |
just_headers && return 0 |
315 |
|
317 |
|
316 |
case $(tc-arch) in |
318 |
case $(tc-arch) in |
317 |
x86) |
319 |
x86) |
318 |
# -march needed for #185404 #199334 |
320 |
# -march needed for #185404 #199334 |
319 |
# TODO: When creating the first glibc cross-compile, this test will |
321 |
# TODO: When creating the first glibc cross-compile, this test will |
320 |
# always fail as it does a full link which in turn requires glibc. |
322 |
# always fail as it does a full link which in turn requires glibc. |
321 |
# Probably also applies when changing multilib profile settings (e.g. |
323 |
# Probably also applies when changing multilib profile settings (e.g. |
322 |
# enabling x86 when the profile was amd64-only previously). |
324 |
# enabling x86 when the profile was amd64-only previously). |
323 |
# We could change main to _start and pass -nostdlib here so that we |
325 |
# We could change main to _start and pass -nostdlib here so that we |
324 |
# only test the gcc code compilation. Or we could do a compile and |
326 |
# only test the gcc code compilation. Or we could do a compile and |
325 |
# then look for the symbol via scanelf. |
327 |
# then look for the symbol via scanelf. |
326 |
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 |
328 |
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 |
327 |
local t=${CTARGET_OPT:-${CTARGET}} |
329 |
local t=${CTARGET_OPT:-${CTARGET}} |
328 |
t=${t%%-*} |
330 |
t=${t%%-*} |
329 |
filter-flags '-march=*' |
331 |
filter-flags '-march=*' |
330 |
export CFLAGS="-march=${t} ${CFLAGS}" |
332 |
export CFLAGS="-march=${t} ${CFLAGS}" |
331 |
einfo "Auto adding -march=${t} to CFLAGS #185404" |
333 |
einfo "Auto adding -march=${t} to CFLAGS #185404" |
332 |
fi |
334 |
fi |
333 |
# For compatibility with older binaries at slight performance cost. |
335 |
# For compatibility with older binaries at slight performance cost. |
334 |
use stack-realign && export CFLAGS+=" -mstackrealign" |
336 |
use stack-realign && export CFLAGS+=" -mstackrealign" |
335 |
;; |
337 |
;; |
336 |
amd64) |
338 |
amd64) |
337 |
# -march needed for #185404 #199334 |
339 |
# -march needed for #185404 #199334 |
338 |
# TODO: See cross-compile issues listed above for x86. |
340 |
# TODO: See cross-compile issues listed above for x86. |
339 |
if [[ ${ABI} == x86 ]]; then |
341 |
if [[ ${ABI} == x86 ]]; then |
340 |
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 |
342 |
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 |
341 |
local t=${CTARGET_OPT:-${CTARGET}} |
343 |
local t=${CTARGET_OPT:-${CTARGET}} |
342 |
t=${t%%-*} |
344 |
t=${t%%-*} |
343 |
# Normally the target is x86_64-xxx, so turn that into the -march that |
345 |
# Normally the target is x86_64-xxx, so turn that into the -march that |
344 |
# gcc actually accepts. #528708 |
346 |
# gcc actually accepts. #528708 |
345 |
[[ ${t} == "x86_64" ]] && t="x86-64" |
347 |
[[ ${t} == "x86_64" ]] && t="x86-64" |
346 |
filter-flags '-march=*' |
348 |
filter-flags '-march=*' |
347 |
# ugly, ugly, ugly. ugly. |
349 |
# ugly, ugly, ugly. ugly. |
348 |
CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}") |
350 |
CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}") |
349 |
export CFLAGS_x86="${CFLAGS_x86} -march=${t}" |
351 |
export CFLAGS_x86="${CFLAGS_x86} -march=${t}" |
350 |
einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})" |
352 |
einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})" |
351 |
fi |
353 |
fi |
352 |
# For compatibility with older binaries at slight performance cost. |
354 |
# For compatibility with older binaries at slight performance cost. |
353 |
use stack-realign && export CFLAGS_x86+=" -mstackrealign" |
355 |
use stack-realign && export CFLAGS_x86+=" -mstackrealign" |
354 |
|
356 |
|
355 |
# Workaround for bug #823780. |
357 |
# Workaround for bug #823780. |
356 |
# Need to save/restore CC because earlier on, we stuff it full of CFLAGS, and tc-getCPP doesn't like that. |
358 |
# Need to save/restore CC because earlier on, we stuff it full of CFLAGS, and tc-getCPP doesn't like that. |
357 |
CC_mangled=${CC} |
359 |
CC_mangled=${CC} |
358 |
CC=${glibc__GLIBC_CC} |
360 |
CC=${glibc__GLIBC_CC} |
359 |
if tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then |
361 |
if tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then |
360 |
export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f" |
362 |
export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f" |
361 |
einfo "Auto adding -mno-avx512f to CFLAGS_x86 for buggy GCC version (bug #823780) (ABI=${ABI})" |
363 |
einfo "Auto adding -mno-avx512f to CFLAGS_x86 for buggy GCC version (bug #823780) (ABI=${ABI})" |
362 |
fi |
364 |
fi |
363 |
CC=${CC_mangled} |
365 |
CC=${CC_mangled} |
364 |
fi |
366 |
fi |
365 |
;; |
367 |
;; |
366 |
mips) |
368 |
mips) |
367 |
# The mips abi cannot support the GNU style hashes. #233233 |
369 |
# The mips abi cannot support the GNU style hashes. #233233 |
368 |
filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both |
370 |
filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both |
369 |
;; |
371 |
;; |
370 |
ppc|ppc64) |
372 |
ppc|ppc64) |
371 |
# Many arch-specific implementations do not work on ppc with |
373 |
# Many arch-specific implementations do not work on ppc with |
372 |
# cache-block not equal to 128 bytes. This breaks memset: |
374 |
# cache-block not equal to 128 bytes. This breaks memset: |
373 |
# https://sourceware.org/PR26522 |
375 |
# https://sourceware.org/PR26522 |
374 |
# https://bugs.gentoo.org/737996 |
376 |
# https://bugs.gentoo.org/737996 |
375 |
# Use default -mcpu=. For ppc it means non-multiarch setup. |
377 |
# Use default -mcpu=. For ppc it means non-multiarch setup. |
376 |
filter-flags '-mcpu=*' |
378 |
filter-flags '-mcpu=*' |
377 |
;; |
379 |
;; |
378 |
sparc) |
380 |
sparc) |
379 |
# Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though. |
381 |
# Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though. |
380 |
filter-flags "-fcall-used-g7" |
382 |
filter-flags "-fcall-used-g7" |
381 |
append-flags "-fcall-used-g6" |
383 |
append-flags "-fcall-used-g6" |
382 |
|
384 |
|
383 |
local cpu |
385 |
local cpu |
384 |
case ${CTARGET} in |
386 |
case ${CTARGET} in |
385 |
sparc64-*) |
387 |
sparc64-*) |
386 |
cpu="sparc64" |
388 |
cpu="sparc64" |
387 |
case $(get-flag mcpu) in |
389 |
case $(get-flag mcpu) in |
388 |
v9) |
390 |
v9) |
389 |
# We need to force at least v9a because the base build doesn't |
391 |
# We need to force at least v9a because the base build doesn't |
390 |
# work with just v9. |
392 |
# work with just v9. |
391 |
# https://sourceware.org/bugzilla/show_bug.cgi?id=19477 |
393 |
# https://sourceware.org/bugzilla/show_bug.cgi?id=19477 |
392 |
append-flags "-Wa,-xarch=v9a" |
394 |
append-flags "-Wa,-xarch=v9a" |
393 |
;; |
395 |
;; |
394 |
esac |
396 |
esac |
395 |
;; |
397 |
;; |
396 |
sparc-*) |
398 |
sparc-*) |
397 |
case $(get-flag mcpu) in |
399 |
case $(get-flag mcpu) in |
398 |
v8|supersparc|hypersparc|leon|leon3) |
400 |
v8|supersparc|hypersparc|leon|leon3) |
399 |
cpu="sparcv8" |
401 |
cpu="sparcv8" |
400 |
;; |
402 |
;; |
401 |
*) |
403 |
*) |
402 |
cpu="sparcv9" |
404 |
cpu="sparcv9" |
403 |
;; |
405 |
;; |
404 |
esac |
406 |
esac |
405 |
;; |
407 |
;; |
406 |
esac |
408 |
esac |
407 |
[[ -n ${cpu} ]] && CTARGET_OPT="${cpu}-${CTARGET#*-}" |
409 |
[[ -n ${cpu} ]] && CTARGET_OPT="${cpu}-${CTARGET#*-}" |
408 |
;; |
410 |
;; |
409 |
esac |
411 |
esac |
410 |
} |
412 |
} |
411 |
|
413 |
|
412 |
setup_flags() { |
414 |
setup_flags() { |
413 |
# Make sure host make.conf doesn't pollute us |
415 |
# Make sure host make.conf doesn't pollute us |
414 |
if is_crosscompile || tc-is-cross-compiler ; then |
416 |
if is_crosscompile || tc-is-cross-compiler ; then |
415 |
CHOST=${CTARGET} strip-unsupported-flags |
417 |
CHOST=${CTARGET} strip-unsupported-flags |
416 |
fi |
418 |
fi |
417 |
|
419 |
|
418 |
# Store our CFLAGS because it's changed depending on which CTARGET |
420 |
# Store our CFLAGS because it's changed depending on which CTARGET |
419 |
# we are building when pulling glibc on a multilib profile |
421 |
# we are building when pulling glibc on a multilib profile |
420 |
CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}} |
422 |
CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}} |
421 |
CFLAGS=${CFLAGS_BASE} |
423 |
CFLAGS=${CFLAGS_BASE} |
422 |
CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}} |
424 |
CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}} |
423 |
CXXFLAGS=${CXXFLAGS_BASE} |
425 |
CXXFLAGS=${CXXFLAGS_BASE} |
424 |
ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}} |
426 |
ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}} |
425 |
ASFLAGS=${ASFLAGS_BASE} |
427 |
ASFLAGS=${ASFLAGS_BASE} |
426 |
|
428 |
|
427 |
# Allow users to explicitly avoid flag sanitization via |
429 |
# Allow users to explicitly avoid flag sanitization via |
428 |
# USE=custom-cflags. |
430 |
# USE=custom-cflags. |
429 |
if ! use custom-cflags; then |
431 |
if ! use custom-cflags; then |
430 |
# Over-zealous CFLAGS can often cause problems. What may work for one |
432 |
# Over-zealous CFLAGS can often cause problems. What may work for one |
431 |
# person may not work for another. To avoid a large influx of bugs |
433 |
# person may not work for another. To avoid a large influx of bugs |
432 |
# relating to failed builds, we strip most CFLAGS out to ensure as few |
434 |
# relating to failed builds, we strip most CFLAGS out to ensure as few |
433 |
# problems as possible. |
435 |
# problems as possible. |
434 |
strip-flags |
436 |
strip-flags |
435 |
# Lock glibc at -O2; we want to be conservative here. |
437 |
# Lock glibc at -O2; we want to be conservative here. |
436 |
filter-flags '-O?' |
438 |
filter-flags '-O?' |
437 |
append-flags -O2 |
439 |
append-flags -O2 |
438 |
fi |
440 |
fi |
439 |
|
441 |
|
440 |
strip-unsupported-flags |
442 |
strip-unsupported-flags |
441 |
filter-lto |
443 |
filter-lto |
442 |
filter-flags -m32 -m64 '-mabi=*' |
444 |
filter-flags -m32 -m64 '-mabi=*' |
443 |
|
445 |
|
444 |
# glibc aborts if rpath is set by LDFLAGS |
446 |
# glibc aborts if rpath is set by LDFLAGS |
445 |
filter-ldflags '-Wl,-rpath=*' |
447 |
filter-ldflags '-Wl,-rpath=*' |
446 |
|
448 |
|
447 |
# ld can't use -r & --relax at the same time, bug #788901 |
449 |
# ld can't use -r & --relax at the same time, bug #788901 |
448 |
# https://sourceware.org/PR27837 |
450 |
# https://sourceware.org/PR27837 |
449 |
filter-ldflags '-Wl,--relax' |
451 |
filter-ldflags '-Wl,--relax' |
450 |
|
452 |
|
451 |
# Flag added for cross-prefix, but causes ldconfig to segfault. Not needed |
453 |
# Flag added for cross-prefix, but causes ldconfig to segfault. Not needed |
452 |
# anyway because glibc already handles this by itself. |
454 |
# anyway because glibc already handles this by itself. |
453 |
filter-ldflags '-Wl,--dynamic-linker=*' |
455 |
filter-ldflags '-Wl,--dynamic-linker=*' |
454 |
|
456 |
|
455 |
# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100 |
457 |
# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100 |
456 |
# we have to do that here already so mips can filter it out again :P |
458 |
# we have to do that here already so mips can filter it out again :P |
457 |
if use hash-sysv-compat ; then |
459 |
if use hash-sysv-compat ; then |
458 |
append-ldflags '-Wl,--hash-style=both' |
460 |
append-ldflags '-Wl,--hash-style=both' |
459 |
fi |
461 |
fi |
460 |
|
462 |
|
461 |
# #492892 |
463 |
# #492892 |
462 |
filter-flags -frecord-gcc-switches |
464 |
filter-flags -frecord-gcc-switches |
463 |
|
465 |
|
464 |
# #898098 |
466 |
# #898098 |
465 |
filter-flags -fno-builtin |
467 |
filter-flags -fno-builtin |
466 |
|
468 |
|
467 |
# #829583 |
469 |
# #829583 |
468 |
filter-lfs-flags |
470 |
filter-lfs-flags |
469 |
|
471 |
|
470 |
unset CBUILD_OPT CTARGET_OPT |
472 |
unset CBUILD_OPT CTARGET_OPT |
471 |
if use multilib ; then |
473 |
if use multilib ; then |
472 |
CTARGET_OPT=$(get_abi_CTARGET) |
474 |
CTARGET_OPT=$(get_abi_CTARGET) |
473 |
[[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST) |
475 |
[[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST) |
474 |
fi |
476 |
fi |
475 |
|
477 |
|
476 |
setup_target_flags |
478 |
setup_target_flags |
477 |
|
479 |
|
478 |
if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then |
480 |
if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then |
479 |
CBUILD_OPT=${CTARGET_OPT} |
481 |
CBUILD_OPT=${CTARGET_OPT} |
480 |
fi |
482 |
fi |
481 |
|
483 |
|
482 |
# glibc's headers disallow -O0 and fail at build time: |
484 |
# glibc's headers disallow -O0 and fail at build time: |
483 |
# include/libc-symbols.h:75:3: #error "glibc cannot be compiled without optimization" |
485 |
# include/libc-symbols.h:75:3: #error "glibc cannot be compiled without optimization" |
484 |
# https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F |
486 |
# https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F |
485 |
replace-flags -O0 -O1 |
487 |
replace-flags -O0 -O1 |
486 |
|
488 |
|
487 |
# glibc handles this internally already where it's appropriate; |
489 |
# glibc handles this internally already where it's appropriate; |
488 |
# can't always have SSP when we're the ones setting it up, etc |
490 |
# can't always have SSP when we're the ones setting it up, etc |
489 |
filter-flags '-fstack-protector*' |
491 |
filter-flags '-fstack-protector*' |
490 |
|
492 |
|
491 |
# Similar issues as with SSP. Can't inject yourself that early. |
493 |
# Similar issues as with SSP. Can't inject yourself that early. |
492 |
filter-flags '-fsanitize=*' |
494 |
filter-flags '-fsanitize=*' |
493 |
|
495 |
|
494 |
# See end of bug #830454; we handle this via USE=cet |
496 |
# See end of bug #830454; we handle this via USE=cet |
495 |
filter-flags '-fcf-protection=*' |
497 |
filter-flags '-fcf-protection=*' |
496 |
|
498 |
|
497 |
# When bootstrapping, we may have a situation where |
499 |
# When bootstrapping, we may have a situation where |
498 |
# CET-enabled gcc from seed is used to build CET-disabled |
500 |
# CET-enabled gcc from seed is used to build CET-disabled |
499 |
# glibc. As such, gcc implicitly enables CET if no |
501 |
# glibc. As such, gcc implicitly enables CET if no |
500 |
# -fcf-protection flag is passed. For a typical package it |
502 |
# -fcf-protection flag is passed. For a typical package it |
501 |
# should not be a problem, but for glibc it matters as it is |
503 |
# should not be a problem, but for glibc it matters as it is |
502 |
# dealing with CET in ld.so. So if CET is supposed to be |
504 |
# dealing with CET in ld.so. So if CET is supposed to be |
503 |
# disabled for glibc, be explicit about it. |
505 |
# disabled for glibc, be explicit about it. |
504 |
if (use amd64 || use x86) && ! use cet; then |
506 |
if (use amd64 || use x86) && ! use cet; then |
505 |
append-flags '-fcf-protection=none' |
507 |
append-flags '-fcf-protection=none' |
506 |
fi |
508 |
fi |
507 |
} |
509 |
} |
508 |
|
510 |
|
509 |
use_multiarch() { |
511 |
use_multiarch() { |
510 |
# Allow user to disable runtime arch detection in multilib. |
512 |
# Allow user to disable runtime arch detection in multilib. |
511 |
use multiarch || return 1 |
513 |
use multiarch || return 1 |
512 |
# Make sure binutils is new enough to support indirect functions, |
514 |
# Make sure binutils is new enough to support indirect functions, |
513 |
# #336792. This funky sed supports gold and bfd linkers. |
515 |
# #336792. This funky sed supports gold and bfd linkers. |
514 |
local bver nver |
516 |
local bver nver |
515 |
bver=$($(tc-getLD ${CTARGET}) -v | sed -n -r '1{s:[^0-9]*::;s:^([0-9.]*).*:\1:;p}') |
517 |
bver=$($(tc-getLD ${CTARGET}) -v | sed -n -r '1{s:[^0-9]*::;s:^([0-9.]*).*:\1:;p}') |
516 |
case $(tc-arch ${CTARGET}) in |
518 |
case $(tc-arch ${CTARGET}) in |
517 |
amd64|x86) nver="2.20" ;; |
519 |
amd64|x86) nver="2.20" ;; |
518 |
arm) nver="2.22" ;; |
520 |
arm) nver="2.22" ;; |
519 |
hppa) nver="2.23" ;; |
521 |
hppa) nver="2.23" ;; |
520 |
ppc|ppc64) nver="2.20" ;; |
522 |
ppc|ppc64) nver="2.20" ;; |
521 |
# ifunc support was added in 2.23, but glibc also needs |
523 |
# ifunc support was added in 2.23, but glibc also needs |
522 |
# machinemode which is in 2.24. |
524 |
# machinemode which is in 2.24. |
523 |
s390) nver="2.24" ;; |
525 |
s390) nver="2.24" ;; |
524 |
sparc) nver="2.21" ;; |
526 |
sparc) nver="2.21" ;; |
525 |
*) return 1 ;; |
527 |
*) return 1 ;; |
526 |
esac |
528 |
esac |
527 |
ver_test ${bver} -ge ${nver} |
529 |
ver_test ${bver} -ge ${nver} |
528 |
} |
530 |
} |
529 |
|
531 |
|
530 |
# Setup toolchain variables that had historically been defined in the |
532 |
# Setup toolchain variables that had historically been defined in the |
531 |
# profiles for these archs. |
533 |
# profiles for these archs. |
532 |
setup_env() { |
534 |
setup_env() { |
533 |
# silly users |
535 |
# silly users |
534 |
unset LD_RUN_PATH |
536 |
unset LD_RUN_PATH |
535 |
unset LD_ASSUME_KERNEL |
537 |
unset LD_ASSUME_KERNEL |
536 |
|
538 |
|
537 |
if is_crosscompile || tc-is-cross-compiler ; then |
539 |
if is_crosscompile || tc-is-cross-compiler ; then |
538 |
multilib_env ${CTARGET_OPT:-${CTARGET}} |
540 |
multilib_env ${CTARGET_OPT:-${CTARGET}} |
539 |
|
541 |
|
540 |
if ! use multilib ; then |
542 |
if ! use multilib ; then |
541 |
MULTILIB_ABIS=${DEFAULT_ABI} |
543 |
MULTILIB_ABIS=${DEFAULT_ABI} |
542 |
else |
544 |
else |
543 |
MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}} |
545 |
MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}} |
544 |
fi |
546 |
fi |
545 |
|
547 |
|
546 |
# If the user has CFLAGS_<CTARGET> in their make.conf, use that, |
548 |
# If the user has CFLAGS_<CTARGET> in their make.conf, use that, |
547 |
# and fall back on CFLAGS. |
549 |
# and fall back on CFLAGS. |
548 |
local VAR=CFLAGS_${CTARGET//[-.]/_} |
550 |
local VAR=CFLAGS_${CTARGET//[-.]/_} |
549 |
CFLAGS=${!VAR-${CFLAGS}} |
551 |
CFLAGS=${!VAR-${CFLAGS}} |
550 |
einfo " $(printf '%15s' 'Manual CFLAGS:') ${CFLAGS}" |
552 |
einfo " $(printf '%15s' 'Manual CFLAGS:') ${CFLAGS}" |
551 |
fi |
553 |
fi |
552 |
|
554 |
|
553 |
setup_flags |
555 |
setup_flags |
554 |
|
556 |
|
555 |
export ABI=${ABI:-${DEFAULT_ABI:-default}} |
557 |
export ABI=${ABI:-${DEFAULT_ABI:-default}} |
556 |
|
558 |
|
557 |
if just_headers ; then |
559 |
if just_headers ; then |
558 |
# Avoid mixing host's CC and target's CFLAGS_${ABI}: |
560 |
# Avoid mixing host's CC and target's CFLAGS_${ABI}: |
559 |
# At this bootstrap stage we have only binutils for |
561 |
# At this bootstrap stage we have only binutils for |
560 |
# target but not compiler yet. |
562 |
# target but not compiler yet. |
561 |
einfo "Skip CC ABI injection. We can't use (cross-)compiler yet." |
563 |
einfo "Skip CC ABI injection. We can't use (cross-)compiler yet." |
562 |
return 0 |
564 |
return 0 |
563 |
fi |
565 |
fi |
564 |
|
566 |
|
565 |
# Glibc does not work with gold (for various reasons) #269274. |
567 |
# Glibc does not work with gold (for various reasons) #269274. |
566 |
tc-ld-disable-gold |
568 |
tc-ld-disable-gold |
567 |
|
569 |
|
568 |
if use doc ; then |
570 |
if use doc ; then |
569 |
export MAKEINFO=makeinfo |
571 |
export MAKEINFO=makeinfo |
570 |
else |
572 |
else |
571 |
export MAKEINFO=/dev/null |
573 |
export MAKEINFO=/dev/null |
572 |
fi |
574 |
fi |
573 |
|
575 |
|
574 |
# Reset CC and CXX to the value at start of emerge |
576 |
# Reset CC and CXX to the value at start of emerge |
575 |
export CC=${glibc__ORIG_CC:-${CC:-$(tc-getCC ${CTARGET})}} |
577 |
export CC=${glibc__ORIG_CC:-${CC:-$(tc-getCC ${CTARGET})}} |
576 |
export CXX=${glibc__ORIG_CXX:-${CXX:-$(tc-getCXX ${CTARGET})}} |
578 |
export CXX=${glibc__ORIG_CXX:-${CXX:-$(tc-getCXX ${CTARGET})}} |
577 |
|
579 |
|
578 |
# and make sure glibc__ORIG_CC and glibc__ORIG_CXX is defined now. |
580 |
# and make sure glibc__ORIG_CC and glibc__ORIG_CXX is defined now. |
579 |
export glibc__ORIG_CC=${CC} |
581 |
export glibc__ORIG_CC=${CC} |
580 |
export glibc__ORIG_CXX=${CXX} |
582 |
export glibc__ORIG_CXX=${CXX} |
581 |
|
583 |
|
582 |
if tc-is-clang && ! use custom-cflags && ! is_crosscompile ; then |
584 |
if tc-is-clang && ! use custom-cflags && ! is_crosscompile ; then |
583 |
export glibc__force_gcc=yes |
585 |
export glibc__force_gcc=yes |
584 |
# once this is toggled on, it needs to stay on, since with CPP manipulated |
586 |
# once this is toggled on, it needs to stay on, since with CPP manipulated |
585 |
# tc-is-clang does not work correctly anymore... |
587 |
# tc-is-clang does not work correctly anymore... |
586 |
fi |
588 |
fi |
587 |
|
589 |
|
588 |
if [[ ${glibc__force_gcc} == "yes" ]] ; then |
590 |
if [[ ${glibc__force_gcc} == "yes" ]] ; then |
589 |
# If we are running in an otherwise clang/llvm environment, we need to |
591 |
# If we are running in an otherwise clang/llvm environment, we need to |
590 |
# recover the proper gcc and binutils settings here, at least until glibc |
592 |
# recover the proper gcc and binutils settings here, at least until glibc |
591 |
# is finally building with clang. So let's override everything that is |
593 |
# is finally building with clang. So let's override everything that is |
592 |
# set in the clang profiles. |
594 |
# set in the clang profiles. |
593 |
# Want to shoot yourself into the foot? Set USE=custom-cflags, that's always |
595 |
# Want to shoot yourself into the foot? Set USE=custom-cflags, that's always |
594 |
# a good start into that direction. |
596 |
# a good start into that direction. |
595 |
# Also, if you're crosscompiling, let's assume you know what you are doing. |
597 |
# Also, if you're crosscompiling, let's assume you know what you are doing. |
596 |
# Hopefully. |
598 |
# Hopefully. |
597 |
# Last, we need the settings of the *build* environment, not of the |
599 |
# Last, we need the settings of the *build* environment, not of the |
598 |
# target environment... |
600 |
# target environment... |
599 |
|
601 |
|
600 |
local current_binutils_path=$(env ROOT="${BROOT}" binutils-config -B) |
602 |
local current_binutils_path=$(env ROOT="${BROOT}" binutils-config -B) |
601 |
local current_gcc_path=$(env ROOT="${BROOT}" gcc-config -B) |
603 |
local current_gcc_path=$(env ROOT="${BROOT}" gcc-config -B) |
602 |
einfo "Overriding clang configuration, since it won't work here" |
604 |
einfo "Overriding clang configuration, since it won't work here" |
603 |
|
605 |
|
604 |
export CC="${current_gcc_path}/gcc" |
606 |
export CC="${current_gcc_path}/gcc" |
605 |
export CPP="${current_gcc_path}/cpp" |
607 |
export CPP="${current_gcc_path}/cpp" |
606 |
export CXX="${current_gcc_path}/g++" |
608 |
export CXX="${current_gcc_path}/g++" |
607 |
export LD="${current_binutils_path}/ld.bfd" |
609 |
export LD="${current_binutils_path}/ld.bfd" |
608 |
export AR="${current_binutils_path}/ar" |
610 |
export AR="${current_binutils_path}/ar" |
609 |
export AS="${current_binutils_path}/as" |
611 |
export AS="${current_binutils_path}/as" |
610 |
export NM="${current_binutils_path}/nm" |
612 |
export NM="${current_binutils_path}/nm" |
611 |
export STRIP="${current_binutils_path}/strip" |
613 |
export STRIP="${current_binutils_path}/strip" |
612 |
export RANLIB="${current_binutils_path}/ranlib" |
614 |
export RANLIB="${current_binutils_path}/ranlib" |
613 |
export OBJCOPY="${current_binutils_path}/objcopy" |
615 |
export OBJCOPY="${current_binutils_path}/objcopy" |
614 |
export STRINGS="${current_binutils_path}/strings" |
616 |
export STRINGS="${current_binutils_path}/strings" |
615 |
export OBJDUMP="${current_binutils_path}/objdump" |
617 |
export OBJDUMP="${current_binutils_path}/objdump" |
616 |
export READELF="${current_binutils_path}/readelf" |
618 |
export READELF="${current_binutils_path}/readelf" |
617 |
export ADDR2LINE="${current_binutils_path}/addr2line" |
619 |
export ADDR2LINE="${current_binutils_path}/addr2line" |
618 |
|
620 |
|
619 |
# do we need to also do flags munging here? yes! at least... |
621 |
# do we need to also do flags munging here? yes! at least... |
620 |
filter-flags '-fuse-ld=*' |
622 |
filter-flags '-fuse-ld=*' |
621 |
filter-flags '-D_FORTIFY_SOURCE=*' |
623 |
filter-flags '-D_FORTIFY_SOURCE=*' |
622 |
|
624 |
|
623 |
else |
625 |
else |
624 |
|
626 |
|
625 |
# this is the "normal" case |
627 |
# this is the "normal" case |
626 |
|
628 |
|
627 |
export CC="$(tc-getCC ${CTARGET})" |
629 |
export CC="$(tc-getCC ${CTARGET})" |
628 |
export CXX="$(tc-getCXX ${CTARGET})" |
630 |
export CXX="$(tc-getCXX ${CTARGET})" |
629 |
|
631 |
|
630 |
# Always use tuple-prefixed toolchain. For non-native ABI glibc's configure |
632 |
# Always use tuple-prefixed toolchain. For non-native ABI glibc's configure |
631 |
# can't detect them automatically due to ${CHOST} mismatch and fallbacks |
633 |
# can't detect them automatically due to ${CHOST} mismatch and fallbacks |
632 |
# to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup(). |
634 |
# to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup(). |
633 |
export NM="$(tc-getNM ${CTARGET})" |
635 |
export NM="$(tc-getNM ${CTARGET})" |
634 |
export READELF="$(tc-getREADELF ${CTARGET})" |
636 |
export READELF="$(tc-getREADELF ${CTARGET})" |
635 |
|
637 |
|
636 |
fi |
638 |
fi |
637 |
|
639 |
|
638 |
# We need to export CFLAGS with abi information in them because glibc's |
640 |
# We need to export CFLAGS with abi information in them because glibc's |
639 |
# configure script checks CFLAGS for some targets (like mips). Keep |
641 |
# configure script checks CFLAGS for some targets (like mips). Keep |
640 |
# around the original clean value to avoid appending multiple ABIs on |
642 |
# around the original clean value to avoid appending multiple ABIs on |
641 |
# top of each other. (Why does the comment talk about CFLAGS if the code |
643 |
# top of each other. (Why does the comment talk about CFLAGS if the code |
642 |
# acts on CC?) |
644 |
# acts on CC?) |
643 |
export glibc__GLIBC_CC=${CC} |
645 |
export glibc__GLIBC_CC=${CC} |
644 |
export glibc__GLIBC_CXX=${CXX} |
646 |
export glibc__GLIBC_CXX=${CXX} |
645 |
|
647 |
|
646 |
export glibc__abi_CFLAGS="$(get_abi_CFLAGS)" |
648 |
export glibc__abi_CFLAGS="$(get_abi_CFLAGS)" |
647 |
|
649 |
|
648 |
# CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760 |
650 |
# CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760 |
649 |
# To build .S (assembly) files with the same ABI-specific flags |
651 |
# To build .S (assembly) files with the same ABI-specific flags |
650 |
# upstream currently recommends adding CFLAGS to CC/CXX: |
652 |
# upstream currently recommends adding CFLAGS to CC/CXX: |
651 |
# https://sourceware.org/PR23273 |
653 |
# https://sourceware.org/PR23273 |
652 |
# Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS |
654 |
# Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS |
653 |
# and breaks multiarch support. See 659030#c3 for an example. |
655 |
# and breaks multiarch support. See 659030#c3 for an example. |
654 |
# The glibc configure script doesn't properly use LDFLAGS all the time. |
656 |
# The glibc configure script doesn't properly use LDFLAGS all the time. |
655 |
export CC="${glibc__GLIBC_CC} ${glibc__abi_CFLAGS} ${CFLAGS} ${LDFLAGS}" |
657 |
export CC="${glibc__GLIBC_CC} ${glibc__abi_CFLAGS} ${CFLAGS} ${LDFLAGS}" |
656 |
|
658 |
|
657 |
# Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548 |
659 |
# Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548 |
658 |
export CXX="${glibc__GLIBC_CXX} ${glibc__abi_CFLAGS} ${CFLAGS}" |
660 |
export CXX="${glibc__GLIBC_CXX} ${glibc__abi_CFLAGS} ${CFLAGS}" |
659 |
|
661 |
|
660 |
if is_crosscompile; then |
662 |
if is_crosscompile; then |
661 |
# Assume worst-case bootstrap: glibc is built for the first time |
663 |
# Assume worst-case bootstrap: glibc is built for the first time |
662 |
# with ${CTARGET}-g++ not available yet. We avoid |
664 |
# with ${CTARGET}-g++ not available yet. We avoid |
663 |
# building auxiliary programs that require C++: bug #683074 |
665 |
# building auxiliary programs that require C++: bug #683074 |
664 |
# It should not affect final result. |
666 |
# It should not affect final result. |
665 |
export libc_cv_cxx_link_ok=no |
667 |
export libc_cv_cxx_link_ok=no |
666 |
# The line above has the same effect. We set CXX explicitly |
668 |
# The line above has the same effect. We set CXX explicitly |
667 |
# to make build logs less confusing. |
669 |
# to make build logs less confusing. |
668 |
export CXX= |
670 |
export CXX= |
669 |
fi |
671 |
fi |
670 |
} |
672 |
} |
671 |
|
673 |
|
672 |
foreach_abi() { |
674 |
foreach_abi() { |
673 |
setup_env |
675 |
setup_env |
674 |
|
676 |
|
675 |
local ret=0 |
677 |
local ret=0 |
676 |
local abilist="" |
678 |
local abilist="" |
677 |
if use multilib ; then |
679 |
if use multilib ; then |
678 |
abilist=$(get_install_abis) |
680 |
abilist=$(get_install_abis) |
679 |
else |
681 |
else |
680 |
abilist=${DEFAULT_ABI} |
682 |
abilist=${DEFAULT_ABI} |
681 |
fi |
683 |
fi |
682 |
local -x ABI |
684 |
local -x ABI |
683 |
for ABI in ${abilist:-default} ; do |
685 |
for ABI in ${abilist:-default} ; do |
684 |
setup_env |
686 |
setup_env |
685 |
einfo "Running $1 for ABI ${ABI}" |
687 |
einfo "Running $1 for ABI ${ABI}" |
686 |
$1 |
688 |
$1 |
687 |
: $(( ret |= $? )) |
689 |
: $(( ret |= $? )) |
688 |
done |
690 |
done |
689 |
return ${ret} |
691 |
return ${ret} |
690 |
} |
692 |
} |
691 |
|
693 |
|
692 |
glibc_banner() { |
694 |
glibc_banner() { |
693 |
local b="Gentoo ${PVR}" |
695 |
local b="Gentoo ${PVR}" |
694 |
[[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" (patchset ${PATCH_VER})" |
696 |
[[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" (patchset ${PATCH_VER})" |
695 |
echo "${b}" |
697 |
echo "${b}" |
696 |
} |
698 |
} |
697 |
|
699 |
|
698 |
# The following Kernel version handling functions are mostly copied from portage |
700 |
# The following Kernel version handling functions are mostly copied from portage |
699 |
# source. It's better not to use linux-info.eclass here since a) it adds too |
701 |
# source. It's better not to use linux-info.eclass here since a) it adds too |
700 |
# much magic, see bug 326693 for some of the arguments, and b) some of the |
702 |
# much magic, see bug 326693 for some of the arguments, and b) some of the |
701 |
# functions are just not provided. |
703 |
# functions are just not provided. |
702 |
|
704 |
|
703 |
g_get_running_KV() { |
705 |
g_get_running_KV() { |
704 |
uname -r |
706 |
uname -r |
705 |
return $? |
707 |
return $? |
706 |
} |
708 |
} |
707 |
|
709 |
|
708 |
g_KV_major() { |
710 |
g_KV_major() { |
709 |
[[ -z $1 ]] && return 1 |
711 |
[[ -z $1 ]] && return 1 |
710 |
local KV=$@ |
712 |
local KV=$@ |
711 |
echo "${KV%%.*}" |
713 |
echo "${KV%%.*}" |
712 |
} |
714 |
} |
713 |
|
715 |
|
714 |
g_KV_minor() { |
716 |
g_KV_minor() { |
715 |
[[ -z $1 ]] && return 1 |
717 |
[[ -z $1 ]] && return 1 |
716 |
local KV=$@ |
718 |
local KV=$@ |
717 |
KV=${KV#*.} |
719 |
KV=${KV#*.} |
718 |
echo "${KV%%.*}" |
720 |
echo "${KV%%.*}" |
719 |
} |
721 |
} |
720 |
|
722 |
|
721 |
g_KV_micro() { |
723 |
g_KV_micro() { |
722 |
[[ -z $1 ]] && return 1 |
724 |
[[ -z $1 ]] && return 1 |
723 |
local KV=$@ |
725 |
local KV=$@ |
724 |
KV=${KV#*.*.} |
726 |
KV=${KV#*.*.} |
725 |
echo "${KV%%[^[:digit:]]*}" |
727 |
echo "${KV%%[^[:digit:]]*}" |
726 |
} |
728 |
} |
727 |
|
729 |
|
728 |
g_KV_to_int() { |
730 |
g_KV_to_int() { |
729 |
[[ -z $1 ]] && return 1 |
731 |
[[ -z $1 ]] && return 1 |
730 |
local KV_MAJOR=$(g_KV_major "$1") |
732 |
local KV_MAJOR=$(g_KV_major "$1") |
731 |
local KV_MINOR=$(g_KV_minor "$1") |
733 |
local KV_MINOR=$(g_KV_minor "$1") |
732 |
local KV_MICRO=$(g_KV_micro "$1") |
734 |
local KV_MICRO=$(g_KV_micro "$1") |
733 |
local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO )) |
735 |
local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO )) |
734 |
|
736 |
|
735 |
# We make version 2.2.0 the minimum version we will handle as |
737 |
# We make version 2.2.0 the minimum version we will handle as |
736 |
# a sanity check ... if its less, we fail ... |
738 |
# a sanity check ... if its less, we fail ... |
737 |
if [[ ${KV_int} -ge 131584 ]] ; then |
739 |
if [[ ${KV_int} -ge 131584 ]] ; then |
738 |
echo "${KV_int}" |
740 |
echo "${KV_int}" |
739 |
return 0 |
741 |
return 0 |
740 |
fi |
742 |
fi |
741 |
return 1 |
743 |
return 1 |
742 |
} |
744 |
} |
743 |
|
745 |
|
744 |
g_int_to_KV() { |
746 |
g_int_to_KV() { |
745 |
local version=$1 major minor micro |
747 |
local version=$1 major minor micro |
746 |
major=$((version / 65536)) |
748 |
major=$((version / 65536)) |
747 |
minor=$(((version % 65536) / 256)) |
749 |
minor=$(((version % 65536) / 256)) |
748 |
micro=$((version % 256)) |
750 |
micro=$((version % 256)) |
749 |
echo ${major}.${minor}.${micro} |
751 |
echo ${major}.${minor}.${micro} |
750 |
} |
752 |
} |
751 |
|
753 |
|
752 |
eend_KV() { |
754 |
eend_KV() { |
753 |
[[ $(g_KV_to_int $1) -ge $(g_KV_to_int $2) ]] |
755 |
[[ $(g_KV_to_int $1) -ge $(g_KV_to_int $2) ]] |
754 |
eend $? |
756 |
eend $? |
755 |
} |
757 |
} |
756 |
|
758 |
|
757 |
get_kheader_version() { |
759 |
get_kheader_version() { |
758 |
printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \ |
760 |
printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \ |
759 |
$(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \ |
761 |
$(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \ |
760 |
tail -n 1 |
762 |
tail -n 1 |
761 |
} |
763 |
} |
762 |
|
764 |
|
763 |
# We collect all sanity checks here. Consistency is not guranteed between |
765 |
# We collect all sanity checks here. Consistency is not guranteed between |
764 |
# pkg_ and src_ phases, so we call this function both in pkg_pretend and in |
766 |
# pkg_ and src_ phases, so we call this function both in pkg_pretend and in |
765 |
# src_unpack. |
767 |
# src_unpack. |
766 |
sanity_prechecks() { |
768 |
sanity_prechecks() { |
767 |
# Prevent native builds from downgrading |
769 |
# Prevent native builds from downgrading |
768 |
if [[ ${MERGE_TYPE} != "buildonly" ]] && \ |
770 |
if [[ ${MERGE_TYPE} != "buildonly" ]] && \ |
769 |
[[ -z ${ROOT} ]] && \ |
771 |
[[ -z ${ROOT} ]] && \ |
770 |
[[ ${CBUILD} == ${CHOST} ]] && \ |
772 |
[[ ${CBUILD} == ${CHOST} ]] && \ |
771 |
[[ ${CHOST} == ${CTARGET} ]] ; then |
773 |
[[ ${CHOST} == ${CTARGET} ]] ; then |
772 |
|
774 |
|
773 |
# The high rev # is to allow people to downgrade between -r# |
775 |
# The high rev # is to allow people to downgrade between -r# |
774 |
# versions. We want to block 2.20->2.19, but 2.20-r3->2.20-r2 |
776 |
# versions. We want to block 2.20->2.19, but 2.20-r3->2.20-r2 |
775 |
# should be fine. Hopefully we never actually use a r# this |
777 |
# should be fine. Hopefully we never actually use a r# this |
776 |
# high. |
778 |
# high. |
777 |
if has_version ">${CATEGORY}/${P}-r10000" ; then |
779 |
if has_version ">${CATEGORY}/${P}-r10000" ; then |
778 |
eerror "Sanity check to keep you from breaking your system:" |
780 |
eerror "Sanity check to keep you from breaking your system:" |
779 |
eerror " Downgrading glibc is not supported and a sure way to destruction." |
781 |
eerror " Downgrading glibc is not supported and a sure way to destruction." |
780 |
[[ ${I_ALLOW_TO_BREAK_MY_SYSTEM} = yes ]] || die "Aborting to save your system." |
782 |
[[ ${I_ALLOW_TO_BREAK_MY_SYSTEM} = yes ]] || die "Aborting to save your system." |
781 |
fi |
783 |
fi |
782 |
|
784 |
|
783 |
if ! do_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' ; then |
785 |
if ! do_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' ; then |
784 |
eerror "Your old kernel is broken. You need to update it to a newer" |
786 |
eerror "Your old kernel is broken. You need to update it to a newer" |
785 |
eerror "version as syscall(<bignum>) will break. See bug 279260." |
787 |
eerror "version as syscall(<bignum>) will break. See bug 279260." |
786 |
die "Old and broken kernel." |
788 |
die "Old and broken kernel." |
787 |
fi |
789 |
fi |
788 |
fi |
790 |
fi |
789 |
|
791 |
|
790 |
if [[ ${CTARGET} == i386-* ]] ; then |
792 |
if [[ ${CTARGET} == i386-* ]] ; then |
791 |
eerror "i386 CHOSTs are no longer supported." |
793 |
eerror "i386 CHOSTs are no longer supported." |
792 |
eerror "Chances are you don't actually want/need i386." |
794 |
eerror "Chances are you don't actually want/need i386." |
793 |
eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml" |
795 |
eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml" |
794 |
die "Please fix your CHOST" |
796 |
die "Please fix your CHOST" |
795 |
fi |
797 |
fi |
796 |
|
798 |
|
797 |
if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then |
799 |
if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then |
798 |
ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS." |
800 |
ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS." |
799 |
ewarn "This will result in a 50% performance penalty when running with a 32bit" |
801 |
ewarn "This will result in a 50% performance penalty when running with a 32bit" |
800 |
ewarn "hypervisor, which is probably not what you want." |
802 |
ewarn "hypervisor, which is probably not what you want." |
801 |
fi |
803 |
fi |
802 |
|
804 |
|
803 |
# ABI-specific checks follow here. Hey, we have a lot more specific conditions that |
805 |
# ABI-specific checks follow here. Hey, we have a lot more specific conditions that |
804 |
# we test for... |
806 |
# we test for... |
805 |
if ! is_crosscompile ; then |
807 |
if ! is_crosscompile ; then |
806 |
if use amd64 && use multilib && [[ ${MERGE_TYPE} != "binary" ]] ; then |
808 |
if use amd64 && use multilib && [[ ${MERGE_TYPE} != "binary" ]] ; then |
807 |
ebegin "Checking that IA32 emulation is enabled in the running kernel" |
809 |
ebegin "Checking that IA32 emulation is enabled in the running kernel" |
808 |
echo 'int main(){return 0;}' > "${T}/check-ia32-emulation.c" |
810 |
echo 'int main(){return 0;}' > "${T}/check-ia32-emulation.c" |
809 |
local STAT |
811 |
local STAT |
810 |
if ${CC-${CHOST}-gcc} ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32"; then |
812 |
if ${CC-${CHOST}-gcc} ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32"; then |
811 |
"${T}/check-ia32-emulation.elf32" |
813 |
"${T}/check-ia32-emulation.elf32" |
812 |
STAT=$? |
814 |
STAT=$? |
813 |
else |
815 |
else |
814 |
# Don't fail here to allow single->multi ABI switch |
816 |
# Don't fail here to allow single->multi ABI switch |
815 |
# or recover from breakage like bug #646424 |
817 |
# or recover from breakage like bug #646424 |
816 |
ewarn "Failed to compile the ABI test. Broken host glibc?" |
818 |
ewarn "Failed to compile the ABI test. Broken host glibc?" |
817 |
STAT=0 |
819 |
STAT=0 |
818 |
fi |
820 |
fi |
819 |
rm -f "${T}/check-ia32-emulation.elf32" |
821 |
rm -f "${T}/check-ia32-emulation.elf32" |
820 |
eend $STAT |
822 |
eend $STAT |
821 |
[[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION must be enabled in the kernel to compile a multilib glibc." |
823 |
[[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION must be enabled in the kernel to compile a multilib glibc." |
822 |
fi |
824 |
fi |
823 |
|
825 |
|
824 |
fi |
826 |
fi |
825 |
|
827 |
|
826 |
# When we actually have to compile something... |
828 |
# When we actually have to compile something... |
827 |
if ! just_headers && [[ ${MERGE_TYPE} != "binary" ]] ; then |
829 |
if ! just_headers && [[ ${MERGE_TYPE} != "binary" ]] ; then |
828 |
if [[ -d "${ESYSROOT}"/usr/lib/include ]] ; then |
830 |
if [[ -d "${ESYSROOT}"/usr/lib/include ]] ; then |
829 |
# bug #833620, bug #643302 |
831 |
# bug #833620, bug #643302 |
830 |
eerror "Found ${ESYSROOT}/usr/lib/include directory!" |
832 |
eerror "Found ${ESYSROOT}/usr/lib/include directory!" |
831 |
eerror "This is known to break glibc's build." |
833 |
eerror "This is known to break glibc's build." |
832 |
eerror "Please backup its contents then remove the directory." |
834 |
eerror "Please backup its contents then remove the directory." |
833 |
die "Found directory (${ESYSROOT}/usr/lib/include) which will break build (bug #833620)!" |
835 |
die "Found directory (${ESYSROOT}/usr/lib/include) which will break build (bug #833620)!" |
834 |
fi |
836 |
fi |
835 |
|
837 |
|
836 |
if [[ ${CTARGET} == *-linux* ]] ; then |
838 |
if [[ ${CTARGET} == *-linux* ]] ; then |
837 |
local run_kv build_kv want_kv |
839 |
local run_kv build_kv want_kv |
838 |
|
840 |
|
839 |
run_kv=$(g_get_running_KV) |
841 |
run_kv=$(g_get_running_KV) |
840 |
build_kv=$(g_int_to_KV $(get_kheader_version)) |
842 |
build_kv=$(g_int_to_KV $(get_kheader_version)) |
841 |
want_kv=${MIN_KERN_VER} |
843 |
want_kv=${MIN_KERN_VER} |
842 |
|
844 |
|
843 |
if ! is_crosscompile && ! tc-is-cross-compiler ; then |
845 |
if ! is_crosscompile && ! tc-is-cross-compiler ; then |
844 |
# Building fails on an non-supporting kernel |
846 |
# Building fails on an non-supporting kernel |
845 |
ebegin "Checking running kernel version (${run_kv} >= ${want_kv})" |
847 |
ebegin "Checking running kernel version (${run_kv} >= ${want_kv})" |
846 |
if ! eend_KV ${run_kv} ${want_kv} ; then |
848 |
if ! eend_KV ${run_kv} ${want_kv} ; then |
847 |
echo |
849 |
echo |
848 |
eerror "You need a kernel of at least ${want_kv}!" |
850 |
eerror "You need a kernel of at least ${want_kv}!" |
849 |
die "Kernel version too low!" |
851 |
die "Kernel version too low!" |
850 |
fi |
852 |
fi |
851 |
fi |
853 |
fi |
852 |
|
854 |
|
853 |
# Do not run this check for pkg_pretend, just pkg_setup and friends (if we ever get used there). |
855 |
# Do not run this check for pkg_pretend, just pkg_setup and friends (if we ever get used there). |
854 |
# It's plausible (seen it in the wild) that Portage will (correctly) schedule a linux-headers |
856 |
# It's plausible (seen it in the wild) that Portage will (correctly) schedule a linux-headers |
855 |
# upgrade before glibc, but because pkg_pretend gets run before any packages are merged at all (not |
857 |
# upgrade before glibc, but because pkg_pretend gets run before any packages are merged at all (not |
856 |
# just glibc), the whole emerge gets aborted without a good reason. We probably don't |
858 |
# just glibc), the whole emerge gets aborted without a good reason. We probably don't |
857 |
# need to run this check at all given we have a dependency on the right headers, |
859 |
# need to run this check at all given we have a dependency on the right headers, |
858 |
# but let's leave it as-is for now. |
860 |
# but let's leave it as-is for now. |
859 |
if [[ ${EBUILD_PHASE_FUNC} != pkg_pretend ]] ; then |
861 |
if [[ ${EBUILD_PHASE_FUNC} != pkg_pretend ]] ; then |
860 |
ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})" |
862 |
ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})" |
861 |
if ! eend_KV ${build_kv} ${want_kv} ; then |
863 |
if ! eend_KV ${build_kv} ${want_kv} ; then |
862 |
echo |
864 |
echo |
863 |
eerror "You need linux-headers of at least ${want_kv}!" |
865 |
eerror "You need linux-headers of at least ${want_kv}!" |
864 |
die "linux-headers version too low!" |
866 |
die "linux-headers version too low!" |
865 |
fi |
867 |
fi |
866 |
fi |
868 |
fi |
867 |
fi |
869 |
fi |
868 |
fi |
870 |
fi |
869 |
} |
871 |
} |
870 |
|
872 |
|
871 |
upgrade_warning() { |
873 |
upgrade_warning() { |
872 |
is_crosscompile && return |
874 |
is_crosscompile && return |
873 |
|
875 |
|
874 |
if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then |
876 |
if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then |
875 |
local oldv newv=$(ver_cut 1-2 ${PV}) |
877 |
local oldv newv=$(ver_cut 1-2 ${PV}) |
876 |
for oldv in ${REPLACING_VERSIONS}; do |
878 |
for oldv in ${REPLACING_VERSIONS}; do |
877 |
if ver_test ${oldv} -lt ${newv}; then |
879 |
if ver_test ${oldv} -lt ${newv}; then |
878 |
ewarn "After upgrading glibc, please restart all running processes." |
880 |
ewarn "After upgrading glibc, please restart all running processes." |
879 |
ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)." |
881 |
ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)." |
880 |
ewarn "Alternatively, reboot your system." |
882 |
ewarn "Alternatively, reboot your system." |
881 |
ewarn "(See bug #660556, bug #741116, bug #823756, etc)" |
883 |
ewarn "(See bug #660556, bug #741116, bug #823756, etc)" |
882 |
break |
884 |
break |
883 |
fi |
885 |
fi |
884 |
done |
886 |
done |
885 |
fi |
887 |
fi |
886 |
} |
888 |
} |
887 |
|
889 |
|
888 |
# |
890 |
# |
889 |
# the phases |
891 |
# the phases |
890 |
# |
892 |
# |
891 |
|
893 |
|
892 |
# pkg_pretend |
894 |
# pkg_pretend |
893 |
|
895 |
|
894 |
pkg_pretend() { |
896 |
pkg_pretend() { |
895 |
upgrade_warning |
897 |
upgrade_warning |
896 |
} |
898 |
} |
897 |
|
899 |
|
898 |
# pkg_setup |
900 |
# pkg_setup |
899 |
|
901 |
|
900 |
pkg_setup() { |
902 |
pkg_setup() { |
901 |
# see bug 682570 |
903 |
# see bug 682570 |
902 |
[[ -z ${BOOTSTRAP_RAP} ]] && python-any-r1_pkg_setup |
904 |
[[ -z ${BOOTSTRAP_RAP} ]] && python-any-r1_pkg_setup |
903 |
} |
905 |
} |
904 |
|
906 |
|
905 |
# src_unpack |
907 |
# src_unpack |
906 |
|
908 |
|
907 |
src_unpack() { |
909 |
src_unpack() { |
908 |
setup_env |
910 |
setup_env |
909 |
|
911 |
|
910 |
einfo "Checking general environment sanity." |
912 |
einfo "Checking general environment sanity." |
911 |
sanity_prechecks |
913 |
sanity_prechecks |
912 |
|
914 |
|
913 |
use multilib-bootstrap && unpack gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz |
915 |
use multilib-bootstrap && unpack gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz |
914 |
|
916 |
|
915 |
if [[ ${PV} == 9999* ]] ; then |
917 |
if [[ ${PV} == 9999* ]] ; then |
916 |
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/glibc-patches.git" |
918 |
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/glibc-patches.git" |
917 |
EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git |
919 |
EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git |
918 |
git-r3_src_unpack |
920 |
git-r3_src_unpack |
919 |
mv patches-git/9999 patches || die |
921 |
mv patches-git/9999 patches || die |
920 |
|
922 |
|
921 |
EGIT_REPO_URI="https://sourceware.org/git/glibc.git" |
923 |
EGIT_REPO_URI="https://sourceware.org/git/glibc.git" |
922 |
EGIT_CHECKOUT_DIR=${S} |
924 |
EGIT_CHECKOUT_DIR=${S} |
923 |
git-r3_src_unpack |
925 |
git-r3_src_unpack |
924 |
else |
926 |
else |
925 |
unpack ${P}.tar.xz |
927 |
unpack ${P}.tar.xz |
926 |
|
928 |
|
927 |
cd "${WORKDIR}" || die |
929 |
cd "${WORKDIR}" || die |
928 |
unpack glibc-${PV}-patches-${PATCH_VER}.tar.xz |
930 |
unpack glibc-${PV}-patches-${PATCH_VER}.tar.xz |
929 |
fi |
931 |
fi |
930 |
|
932 |
|
931 |
cd "${WORKDIR}" || die |
933 |
cd "${WORKDIR}" || die |
932 |
use systemd && unpack glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz |
934 |
use systemd && unpack glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz |
933 |
} |
935 |
} |
934 |
|
936 |
|
935 |
# src_prepare |
937 |
# src_prepare |
936 |
|
938 |
|
937 |
src_prepare() { |
939 |
src_prepare() { |
938 |
local patchsetname |
940 |
local patchsetname |
939 |
if ! use vanilla ; then |
941 |
if ! use vanilla ; then |
940 |
if [[ ${PV} == 9999* ]] ; then |
942 |
if [[ ${PV} == 9999* ]] ; then |
941 |
patchsetname="from git master" |
943 |
patchsetname="from git master" |
942 |
else |
944 |
else |
943 |
patchsetname="${PV}-${PATCH_VER}" |
945 |
patchsetname="${PV}-${PATCH_VER}" |
944 |
fi |
946 |
fi |
945 |
einfo "Applying Gentoo Glibc patchset ${patchsetname}" |
947 |
einfo "Applying Gentoo Glibc patchset ${patchsetname}" |
946 |
eapply "${WORKDIR}"/patches |
948 |
eapply "${WORKDIR}"/patches |
947 |
einfo "Done." |
949 |
einfo "Done." |
948 |
fi |
950 |
fi |
949 |
|
951 |
|
950 |
default |
952 |
default |
951 |
|
953 |
|
952 |
gnuconfig_update |
954 |
gnuconfig_update |
953 |
|
955 |
|
954 |
cd "${WORKDIR}" || die |
956 |
cd "${WORKDIR}" || die |
955 |
find . -name configure -exec touch {} + |
957 |
find . -name configure -exec touch {} + |
956 |
|
958 |
|
957 |
# Fix permissions on some of the scripts. |
959 |
# Fix permissions on some of the scripts. |
958 |
chmod u+x "${S}"/scripts/*.sh |
960 |
chmod u+x "${S}"/scripts/*.sh |
959 |
|
961 |
|
960 |
cd "${S}" || die |
962 |
cd "${S}" || die |
961 |
} |
963 |
} |
962 |
|
964 |
|
963 |
# src_configure |
965 |
# src_configure |
964 |
|
966 |
|
965 |
glibc_do_configure() { |
967 |
glibc_do_configure() { |
966 |
dump_build_environment |
968 |
dump_build_environment |
967 |
|
969 |
|
968 |
local myconf=() |
970 |
local myconf=() |
969 |
|
971 |
|
970 |
# Use '=strong' instead of '=all' to protect only functions |
972 |
# Use '=strong' instead of '=all' to protect only functions |
971 |
# worth protecting from stack smashes. |
973 |
# worth protecting from stack smashes. |
972 |
myconf+=( --enable-stack-protector=$(usex ssp strong no) ) |
974 |
myconf+=( --enable-stack-protector=$(usex ssp strong no) ) |
973 |
|
975 |
|
974 |
# Keep a whitelist of targets supporing IFUNC. glibc's ./configure |
976 |
# Keep a whitelist of targets supporing IFUNC. glibc's ./configure |
975 |
# is not robust enough to detect proper support: |
977 |
# is not robust enough to detect proper support: |
976 |
# https://bugs.gentoo.org/641216 |
978 |
# https://bugs.gentoo.org/641216 |
977 |
# https://sourceware.org/PR22634#c0 |
979 |
# https://sourceware.org/PR22634#c0 |
978 |
case $(tc-arch ${CTARGET}) in |
980 |
case $(tc-arch ${CTARGET}) in |
979 |
# Keep whitelist of targets where autodetection mostly works. |
981 |
# Keep whitelist of targets where autodetection mostly works. |
980 |
amd64|x86|sparc|ppc|ppc64|arm|arm64|s390|riscv|loong) ;; |
982 |
amd64|x86|sparc|ppc|ppc64|arm|arm64|s390|riscv|loong) ;; |
981 |
# Blacklist everywhere else |
983 |
# Blacklist everywhere else |
982 |
*) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;; |
984 |
*) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;; |
983 |
esac |
985 |
esac |
984 |
|
986 |
|
985 |
# Enable Intel Control-flow Enforcement Technology on amd64 if requested |
987 |
# Enable Intel Control-flow Enforcement Technology on amd64 if requested |
986 |
case ${CTARGET} in |
988 |
case ${CTARGET} in |
987 |
x86_64-*) myconf+=( $(use_enable cet) ) ;; |
989 |
x86_64-*) myconf+=( $(use_enable cet) ) ;; |
988 |
*) ;; |
990 |
*) ;; |
989 |
esac |
991 |
esac |
990 |
|
992 |
|
991 |
[[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp ) |
993 |
[[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp ) |
992 |
|
994 |
|
993 |
myconf+=( --enable-kernel=${MIN_KERN_VER} ) |
995 |
myconf+=( --enable-kernel=${MIN_KERN_VER} ) |
994 |
|
996 |
|
995 |
# Since SELinux support is only required for nscd, only enable it if: |
997 |
# Since SELinux support is only required for nscd, only enable it if: |
996 |
# 1. USE selinux |
998 |
# 1. USE selinux |
997 |
# 2. only for the primary ABI on multilib systems |
999 |
# 2. only for the primary ABI on multilib systems |
998 |
# 3. Not a crosscompile |
1000 |
# 3. Not a crosscompile |
999 |
if ! is_crosscompile && use selinux ; then |
1001 |
if ! is_crosscompile && use selinux ; then |
1000 |
if use multilib ; then |
1002 |
if use multilib ; then |
1001 |
if is_final_abi ; then |
1003 |
if is_final_abi ; then |
1002 |
myconf+=( --with-selinux ) |
1004 |
myconf+=( --with-selinux ) |
1003 |
else |
1005 |
else |
1004 |
myconf+=( --without-selinux ) |
1006 |
myconf+=( --without-selinux ) |
1005 |
fi |
1007 |
fi |
1006 |
else |
1008 |
else |
1007 |
myconf+=( --with-selinux ) |
1009 |
myconf+=( --with-selinux ) |
1008 |
fi |
1010 |
fi |
1009 |
else |
1011 |
else |
1010 |
myconf+=( --without-selinux ) |
1012 |
myconf+=( --without-selinux ) |
1011 |
fi |
1013 |
fi |
1012 |
|
1014 |
|
1013 |
# Force a few tests where we always know the answer but |
1015 |
# Force a few tests where we always know the answer but |
1014 |
# configure is incapable of finding it. |
1016 |
# configure is incapable of finding it. |
1015 |
if is_crosscompile ; then |
1017 |
if is_crosscompile ; then |
1016 |
export \ |
1018 |
export \ |
1017 |
libc_cv_c_cleanup=yes \ |
1019 |
libc_cv_c_cleanup=yes \ |
1018 |
libc_cv_forced_unwind=yes |
1020 |
libc_cv_forced_unwind=yes |
1019 |
fi |
1021 |
fi |
1020 |
|
1022 |
|
1021 |
myconf+=( |
1023 |
myconf+=( |
1022 |
--disable-werror |
1024 |
--disable-werror |
1023 |
--enable-bind-now |
1025 |
--enable-bind-now |
1024 |
--enable-fortify-source |
1026 |
--enable-fortify-source |
1025 |
--build=${CBUILD_OPT:-${CBUILD}} |
1027 |
--build=${CBUILD_OPT:-${CBUILD}} |
1026 |
--host=${CTARGET_OPT:-${CTARGET}} |
1028 |
--host=${CTARGET_OPT:-${CTARGET}} |
1027 |
$(use_enable profile) |
1029 |
$(use_enable profile) |
1028 |
$(use_with gd) |
1030 |
$(use_with gd) |
1029 |
--with-headers=$(build_eprefix)$(alt_build_headers) |
1031 |
--with-headers=$(build_eprefix)$(alt_build_headers) |
1030 |
--prefix="$(host_eprefix)/usr" |
1032 |
--prefix="$(host_eprefix)/usr" |
1031 |
--sysconfdir="$(host_eprefix)/etc" |
1033 |
--sysconfdir="$(host_eprefix)/etc" |
1032 |
--localstatedir="$(host_eprefix)/var" |
1034 |
--localstatedir="$(host_eprefix)/var" |
1033 |
--libdir='$(prefix)'/$(get_libdir) |
1035 |
--libdir='$(prefix)'/$(get_libdir) |
1034 |
--mandir='$(prefix)'/share/man |
1036 |
--mandir='$(prefix)'/share/man |
1035 |
--infodir='$(prefix)'/share/info |
1037 |
--infodir='$(prefix)'/share/info |
1036 |
--libexecdir='$(libdir)'/misc/glibc |
1038 |
--libexecdir='$(libdir)'/misc/glibc |
1037 |
--with-bugurl=https://bugs.gentoo.org/ |
1039 |
--with-bugurl=https://bugs.gentoo.org/ |
1038 |
--with-pkgversion="$(glibc_banner)" |
1040 |
--with-pkgversion="$(glibc_banner)" |
1039 |
$(use_enable crypt) |
1041 |
$(use_enable crypt) |
1040 |
$(use_multiarch || echo --disable-multi-arch) |
1042 |
$(use_multiarch || echo --disable-multi-arch) |
1041 |
$(use_enable systemtap) |
1043 |
$(use_enable systemtap) |
1042 |
$(use_enable nscd) |
1044 |
$(use_enable nscd) |
1043 |
|
1045 |
|
1044 |
# /usr/bin/mtrace has a Perl shebang. Gentoo Prefix QA checks fail if |
1046 |
# /usr/bin/mtrace has a Perl shebang. Gentoo Prefix QA checks fail if |
1045 |
# Perl hasn't been installed inside the prefix yet and configure picks |
1047 |
# Perl hasn't been installed inside the prefix yet and configure picks |
1046 |
# up a Perl from outside the prefix instead. configure will fail to |
1048 |
# up a Perl from outside the prefix instead. configure will fail to |
1047 |
# execute Perl during configure if we're cross-compiling a prefix, but |
1049 |
# execute Perl during configure if we're cross-compiling a prefix, but |
1048 |
# it will just disable mtrace in that case. |
1050 |
# it will just disable mtrace in that case. |
1049 |
# Note: mtrace is needed by the test suite. |
1051 |
# Note: mtrace is needed by the test suite. |
1050 |
ac_cv_path_PERL="$(usex perl "${EPREFIX}"/usr/bin/perl $(usex test "${EPREFIX}"/usr/bin/perl $(usex doc "${EPREFIX}"/usr/bin/perl no)))" |
1052 |
ac_cv_path_PERL="$(usex perl "${EPREFIX}"/usr/bin/perl $(usex test "${EPREFIX}"/usr/bin/perl $(usex doc "${EPREFIX}"/usr/bin/perl no)))" |
1051 |
|
1053 |
|
1052 |
# locale data is arch-independent |
1054 |
# locale data is arch-independent |
1053 |
# https://bugs.gentoo.org/753740 |
1055 |
# https://bugs.gentoo.org/753740 |
1054 |
libc_cv_complocaledir='${exec_prefix}/lib/locale' |
1056 |
libc_cv_complocaledir='${exec_prefix}/lib/locale' |
1055 |
|
1057 |
|
1056 |
# On aarch64 there is no way to override -mcpu=native, and if |
1058 |
# On aarch64 there is no way to override -mcpu=native, and if |
1057 |
# the current cpu does not support SVE configure fails. |
1059 |
# the current cpu does not support SVE configure fails. |
1058 |
# Let's boldly assume our toolchain can always build SVE instructions. |
1060 |
# Let's boldly assume our toolchain can always build SVE instructions. |
1059 |
libc_cv_aarch64_sve_asm=yes |
1061 |
libc_cv_aarch64_sve_asm=yes |
1060 |
|
1062 |
|
1061 |
${EXTRA_ECONF} |
1063 |
${EXTRA_ECONF} |
1062 |
) |
1064 |
) |
1063 |
|
1065 |
|
1064 |
# We rely on sys-libs/timezone-data for timezone tools normally. |
1066 |
# We rely on sys-libs/timezone-data for timezone tools normally. |
1065 |
myconf+=( $(use_enable vanilla timezone-tools) ) |
1067 |
myconf+=( $(use_enable vanilla timezone-tools) ) |
1066 |
|
1068 |
|
1067 |
# These libs don't have configure flags. |
1069 |
# These libs don't have configure flags. |
1068 |
ac_cv_lib_audit_audit_log_user_avc_message=$(usex audit || echo no) |
1070 |
ac_cv_lib_audit_audit_log_user_avc_message=$(usex audit || echo no) |
1069 |
ac_cv_lib_cap_cap_init=$(usex caps || echo no) |
1071 |
ac_cv_lib_cap_cap_init=$(usex caps || echo no) |
1070 |
|
1072 |
|
1071 |
# There is no configure option for this and we need to export it |
1073 |
# There is no configure option for this and we need to export it |
1072 |
# since the glibc build will re-run configure on itself |
1074 |
# since the glibc build will re-run configure on itself |
1073 |
export libc_cv_rootsbindir="$(host_eprefix)/sbin" |
1075 |
export libc_cv_rootsbindir="$(host_eprefix)/sbin" |
1074 |
export libc_cv_slibdir="$(host_eprefix)/$(get_libdir)" |
1076 |
export libc_cv_slibdir="$(host_eprefix)/$(get_libdir)" |
1075 |
|
1077 |
|
1076 |
local builddir=$(builddir nptl) |
1078 |
local builddir=$(builddir nptl) |
1077 |
mkdir -p "${builddir}" |
1079 |
mkdir -p "${builddir}" |
1078 |
cd "${builddir}" |
1080 |
cd "${builddir}" |
1079 |
set -- "${S}"/configure "${myconf[@]}" |
1081 |
set -- "${S}"/configure "${myconf[@]}" |
1080 |
echo "$@" |
1082 |
echo "$@" |
1081 |
"$@" || die "failed to configure glibc" |
1083 |
"$@" || die "failed to configure glibc" |
1082 |
|
1084 |
|
1083 |
# ia64 static cross-compilers are a pita in so much that they |
1085 |
# ia64 static cross-compilers are a pita in so much that they |
1084 |
# can't produce static ELFs (as the libgcc.a is broken). so |
1086 |
# can't produce static ELFs (as the libgcc.a is broken). so |
1085 |
# disable building of the programs for those targets if it |
1087 |
# disable building of the programs for those targets if it |
1086 |
# doesn't work. |
1088 |
# doesn't work. |
1087 |
# XXX: We could turn this into a compiler test, but ia64 is |
1089 |
# XXX: We could turn this into a compiler test, but ia64 is |
1088 |
# the only one that matters, so this should be fine for now. |
1090 |
# the only one that matters, so this should be fine for now. |
1089 |
if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then |
1091 |
if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then |
1090 |
sed -i '1i+link-static = touch $@' config.make |
1092 |
sed -i '1i+link-static = touch $@' config.make |
1091 |
fi |
1093 |
fi |
1092 |
|
1094 |
|
1093 |
# If we're trying to migrate between ABI sets, we need |
1095 |
# If we're trying to migrate between ABI sets, we need |
1094 |
# to lie and use a local copy of gcc. Like if the system |
1096 |
# to lie and use a local copy of gcc. Like if the system |
1095 |
# is built with MULTILIB_ABIS="amd64 x86" but we want to |
1097 |
# is built with MULTILIB_ABIS="amd64 x86" but we want to |
1096 |
# add x32 to it, gcc/glibc don't yet support x32. |
1098 |
# add x32 to it, gcc/glibc don't yet support x32. |
1097 |
# |
1099 |
# |
1098 |
if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib-bootstrap ; then |
1100 |
if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib-bootstrap ; then |
1099 |
echo 'int main(void){}' > "${T}"/test.c || die |
1101 |
echo 'int main(void){}' > "${T}"/test.c || die |
1100 |
if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then |
1102 |
if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then |
1101 |
sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die |
1103 |
sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die |
1102 |
fi |
1104 |
fi |
1103 |
fi |
1105 |
fi |
1104 |
} |
1106 |
} |
1105 |
|
1107 |
|
1106 |
glibc_headers_configure() { |
1108 |
glibc_headers_configure() { |
1107 |
export ABI=default |
1109 |
export ABI=default |
1108 |
|
1110 |
|
1109 |
local builddir=$(builddir "headers") |
1111 |
local builddir=$(builddir "headers") |
1110 |
mkdir -p "${builddir}" |
1112 |
mkdir -p "${builddir}" |
1111 |
cd "${builddir}" |
1113 |
cd "${builddir}" |
1112 |
|
1114 |
|
1113 |
# if we don't have a compiler yet, we can't really test it now ... |
1115 |
# if we don't have a compiler yet, we can't really test it now ... |
1114 |
# hopefully they don't affect header generation, so let's hope for |
1116 |
# hopefully they don't affect header generation, so let's hope for |
1115 |
# the best here ... |
1117 |
# the best here ... |
1116 |
local v vars=( |
1118 |
local v vars=( |
1117 |
ac_cv_header_cpuid_h=yes |
1119 |
ac_cv_header_cpuid_h=yes |
1118 |
libc_cv_{386,390,alpha,arm,hppa,ia64,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes |
1120 |
libc_cv_{386,390,alpha,arm,hppa,ia64,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes |
1119 |
libc_cv_asm_cfi_directives=yes |
1121 |
libc_cv_asm_cfi_directives=yes |
1120 |
libc_cv_broken_visibility_attribute=no |
1122 |
libc_cv_broken_visibility_attribute=no |
1121 |
libc_cv_c_cleanup=yes |
1123 |
libc_cv_c_cleanup=yes |
1122 |
libc_cv_compiler_powerpc64le_binary128_ok=yes |
1124 |
libc_cv_compiler_powerpc64le_binary128_ok=yes |
1123 |
libc_cv_forced_unwind=yes |
1125 |
libc_cv_forced_unwind=yes |
1124 |
libc_cv_gcc___thread=yes |
1126 |
libc_cv_gcc___thread=yes |
1125 |
libc_cv_mlong_double_128=yes |
1127 |
libc_cv_mlong_double_128=yes |
1126 |
libc_cv_mlong_double_128ibm=yes |
1128 |
libc_cv_mlong_double_128ibm=yes |
1127 |
libc_cv_ppc_machine=yes |
1129 |
libc_cv_ppc_machine=yes |
1128 |
libc_cv_ppc_rel16=yes |
1130 |
libc_cv_ppc_rel16=yes |
1129 |
libc_cv_predef_fortify_source=no |
1131 |
libc_cv_predef_fortify_source=no |
1130 |
libc_cv_target_power8_ok=yes |
1132 |
libc_cv_target_power8_ok=yes |
1131 |
libc_cv_visibility_attribute=yes |
1133 |
libc_cv_visibility_attribute=yes |
1132 |
libc_cv_z_combreloc=yes |
1134 |
libc_cv_z_combreloc=yes |
1133 |
libc_cv_z_execstack=yes |
1135 |
libc_cv_z_execstack=yes |
1134 |
libc_cv_z_initfirst=yes |
1136 |
libc_cv_z_initfirst=yes |
1135 |
libc_cv_z_nodelete=yes |
1137 |
libc_cv_z_nodelete=yes |
1136 |
libc_cv_z_nodlopen=yes |
1138 |
libc_cv_z_nodlopen=yes |
1137 |
libc_cv_z_relro=yes |
1139 |
libc_cv_z_relro=yes |
1138 |
libc_mips_abi=${ABI} |
1140 |
libc_mips_abi=${ABI} |
1139 |
libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard) |
1141 |
libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard) |
1140 |
# These libs don't have configure flags. |
1142 |
# These libs don't have configure flags. |
1141 |
ac_cv_lib_audit_audit_log_user_avc_message=no |
1143 |
ac_cv_lib_audit_audit_log_user_avc_message=no |
1142 |
ac_cv_lib_cap_cap_init=no |
1144 |
ac_cv_lib_cap_cap_init=no |
1143 |
) |
1145 |
) |
1144 |
|
1146 |
|
1145 |
einfo "Forcing cached settings:" |
1147 |
einfo "Forcing cached settings:" |
1146 |
for v in "${vars[@]}" ; do |
1148 |
for v in "${vars[@]}" ; do |
1147 |
einfo " ${v}" |
1149 |
einfo " ${v}" |
1148 |
export ${v} |
1150 |
export ${v} |
1149 |
done |
1151 |
done |
1150 |
|
1152 |
|
1151 |
local headers_only_arch_CPPFLAGS=() |
1153 |
local headers_only_arch_CPPFLAGS=() |
1152 |
|
1154 |
|
1153 |
# Blow away some random CC settings that screw things up. #550192 |
1155 |
# Blow away some random CC settings that screw things up. #550192 |
1154 |
if [[ -d ${S}/sysdeps/mips ]]; then |
1156 |
if [[ -d ${S}/sysdeps/mips ]]; then |
1155 |
pushd "${S}"/sysdeps/mips >/dev/null |
1157 |
pushd "${S}"/sysdeps/mips >/dev/null |
1156 |
sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die |
1158 |
sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die |
1157 |
sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die |
1159 |
sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die |
1158 |
|
1160 |
|
1159 |
# Force the mips ABI to the default. This is OK because the set of |
1161 |
# Force the mips ABI to the default. This is OK because the set of |
1160 |
# installed headers in this phase is the same between the 3 ABIs. |
1162 |
# installed headers in this phase is the same between the 3 ABIs. |
1161 |
# If this ever changes, this hack will break, but that's unlikely |
1163 |
# If this ever changes, this hack will break, but that's unlikely |
1162 |
# as glibc discourages that behavior. |
1164 |
# as glibc discourages that behavior. |
1163 |
# https://crbug.com/647033 |
1165 |
# https://crbug.com/647033 |
1164 |
sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die |
1166 |
sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die |
1165 |
|
1167 |
|
1166 |
popd >/dev/null |
1168 |
popd >/dev/null |
1167 |
fi |
1169 |
fi |
1168 |
|
1170 |
|
1169 |
local myconf=() |
1171 |
local myconf=() |
1170 |
|
1172 |
|
1171 |
case ${CTARGET} in |
1173 |
case ${CTARGET} in |
1172 |
aarch64*) |
1174 |
aarch64*) |
1173 |
# The configure checks fail during cross-build, so disable here |
1175 |
# The configure checks fail during cross-build, so disable here |
1174 |
# for headers-only |
1176 |
# for headers-only |
1175 |
myconf+=( |
1177 |
myconf+=( |
1176 |
--disable-mathvec |
1178 |
--disable-mathvec |
1177 |
) ;; |
1179 |
) ;; |
1178 |
riscv*) |
1180 |
riscv*) |
1179 |
# RISC-V interrogates the compiler to determine which target to |
1181 |
# RISC-V interrogates the compiler to determine which target to |
1180 |
# build. If building the headers then we don't strictly need a |
1182 |
# build. If building the headers then we don't strictly need a |
1181 |
# RISC-V compiler, so the built-in definitions that are provided |
1183 |
# RISC-V compiler, so the built-in definitions that are provided |
1182 |
# along with all RISC-V compiler might not exist. This causes |
1184 |
# along with all RISC-V compiler might not exist. This causes |
1183 |
# glibc's RISC-V preconfigure script to blow up. Since we're just |
1185 |
# glibc's RISC-V preconfigure script to blow up. Since we're just |
1184 |
# building the headers any value will actually work here, so just |
1186 |
# building the headers any value will actually work here, so just |
1185 |
# pick the standard one (rv64g/lp64d) to make the build scripts |
1187 |
# pick the standard one (rv64g/lp64d) to make the build scripts |
1186 |
# happy for now -- the headers are all the same anyway so it |
1188 |
# happy for now -- the headers are all the same anyway so it |
1187 |
# doesn't matter. |
1189 |
# doesn't matter. |
1188 |
headers_only_arch_CPPFLAGS+=( |
1190 |
headers_only_arch_CPPFLAGS+=( |
1189 |
-D__riscv_xlen=64 |
1191 |
-D__riscv_xlen=64 |
1190 |
-D__riscv_flen=64 |
1192 |
-D__riscv_flen=64 |
1191 |
-D__riscv_float_abi_double=1 |
1193 |
-D__riscv_float_abi_double=1 |
1192 |
-D__riscv_atomic=1 |
1194 |
-D__riscv_atomic=1 |
1193 |
) ;; |
1195 |
) ;; |
1194 |
esac |
1196 |
esac |
1195 |
|
1197 |
|
1196 |
myconf+=( |
1198 |
myconf+=( |
1197 |
--disable-sanity-checks |
1199 |
--disable-sanity-checks |
1198 |
--enable-hacker-mode |
1200 |
--enable-hacker-mode |
1199 |
--disable-werror |
1201 |
--disable-werror |
1200 |
--enable-bind-now |
1202 |
--enable-bind-now |
1201 |
--build=${CBUILD_OPT:-${CBUILD}} |
1203 |
--build=${CBUILD_OPT:-${CBUILD}} |
1202 |
--host=${CTARGET_OPT:-${CTARGET}} |
1204 |
--host=${CTARGET_OPT:-${CTARGET}} |
1203 |
--with-headers=$(build_eprefix)$(alt_build_headers) |
1205 |
--with-headers=$(build_eprefix)$(alt_build_headers) |
1204 |
--prefix="$(host_eprefix)/usr" |
1206 |
--prefix="$(host_eprefix)/usr" |
1205 |
$(use_enable crypt) |
1207 |
$(use_enable crypt) |
1206 |
${EXTRA_ECONF} |
1208 |
${EXTRA_ECONF} |
1207 |
) |
1209 |
) |
1208 |
|
1210 |
|
1209 |
# Nothing is compiled here which would affect the headers for the target. |
1211 |
# Nothing is compiled here which would affect the headers for the target. |
1210 |
# So forcing CC/CFLAGS is sane. |
1212 |
# So forcing CC/CFLAGS is sane. |
1211 |
local headers_only_CC=$(tc-getBUILD_CC) |
1213 |
local headers_only_CC=$(tc-getBUILD_CC) |
1212 |
local headers_only_CFLAGS="-O1 -pipe" |
1214 |
local headers_only_CFLAGS="-O1 -pipe" |
1213 |
local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}" |
1215 |
local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}" |
1214 |
local headers_only_LDFLAGS="" |
1216 |
local headers_only_LDFLAGS="" |
1215 |
set -- "${S}"/configure "${myconf[@]}" |
1217 |
set -- "${S}"/configure "${myconf[@]}" |
1216 |
echo \ |
1218 |
echo \ |
1217 |
"CC=${headers_only_CC}" \ |
1219 |
"CC=${headers_only_CC}" \ |
1218 |
"CFLAGS=${headers_only_CFLAGS}" \ |
1220 |
"CFLAGS=${headers_only_CFLAGS}" \ |
1219 |
"CPPFLAGS=${headers_only_CPPFLAGS}" \ |
1221 |
"CPPFLAGS=${headers_only_CPPFLAGS}" \ |
1220 |
"LDFLAGS=${headers_only_LDFLAGS}" \ |
1222 |
"LDFLAGS=${headers_only_LDFLAGS}" \ |
1221 |
"$@" |
1223 |
"$@" |
1222 |
CC=${headers_only_CC} \ |
1224 |
CC=${headers_only_CC} \ |
1223 |
CFLAGS=${headers_only_CFLAGS} \ |
1225 |
CFLAGS=${headers_only_CFLAGS} \ |
1224 |
CPPFLAGS=${headers_only_CPPFLAGS} \ |
1226 |
CPPFLAGS=${headers_only_CPPFLAGS} \ |
1225 |
LDFLAGS="" \ |
1227 |
LDFLAGS="" \ |
1226 |
"$@" || die "failed to configure glibc" |
1228 |
"$@" || die "failed to configure glibc" |
1227 |
} |
1229 |
} |
1228 |
|
1230 |
|
1229 |
do_src_configure() { |
1231 |
do_src_configure() { |
1230 |
if just_headers ; then |
1232 |
if just_headers ; then |
1231 |
glibc_headers_configure |
1233 |
glibc_headers_configure |
1232 |
else |
1234 |
else |
1233 |
glibc_do_configure nptl |
1235 |
glibc_do_configure nptl |
1234 |
fi |
1236 |
fi |
1235 |
} |
1237 |
} |
1236 |
|
1238 |
|
1237 |
src_configure() { |
1239 |
src_configure() { |
1238 |
foreach_abi do_src_configure |
1240 |
foreach_abi do_src_configure |
1239 |
} |
1241 |
} |
1240 |
|
1242 |
|
1241 |
# src_compile |
1243 |
# src_compile |
1242 |
|
1244 |
|
1243 |
do_src_compile() { |
1245 |
do_src_compile() { |
1244 |
emake -C "$(builddir nptl)" |
1246 |
emake -C "$(builddir nptl)" |
1245 |
} |
1247 |
} |
1246 |
|
1248 |
|
1247 |
src_compile() { |
1249 |
src_compile() { |
1248 |
if just_headers ; then |
1250 |
if just_headers ; then |
1249 |
return |
1251 |
return |
1250 |
fi |
1252 |
fi |
1251 |
|
1253 |
|
1252 |
foreach_abi do_src_compile |
1254 |
foreach_abi do_src_compile |
1253 |
} |
1255 |
} |
1254 |
|
1256 |
|
1255 |
# src_test |
1257 |
# src_test |
1256 |
|
1258 |
|
1257 |
glibc_src_test() { |
1259 |
glibc_src_test() { |
1258 |
cd "$(builddir nptl)" |
1260 |
cd "$(builddir nptl)" |
1259 |
|
1261 |
|
1260 |
local myxfailparams="" |
1262 |
local myxfailparams="" |
1261 |
if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then |
1263 |
if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then |
1262 |
local virt=$(systemd-detect-virt 2>/dev/null) |
1264 |
local virt=$(systemd-detect-virt 2>/dev/null) |
1263 |
if [[ ${virt} == systemd-nspawn ]] ; then |
1265 |
if [[ ${virt} == systemd-nspawn ]] ; then |
1264 |
ewarn "Skipping extra tests because in systemd-nspawn container" |
1266 |
ewarn "Skipping extra tests because in systemd-nspawn container" |
1265 |
XFAIL_TEST_LIST+=( "${XFAIL_NSPAWN_TEST_LIST[@]}" ) |
1267 |
XFAIL_TEST_LIST+=( "${XFAIL_NSPAWN_TEST_LIST[@]}" ) |
1266 |
fi |
1268 |
fi |
1267 |
|
1269 |
|
1268 |
for myt in ${XFAIL_TEST_LIST[@]} ; do |
1270 |
for myt in ${XFAIL_TEST_LIST[@]} ; do |
1269 |
myxfailparams+="test-xfail-${myt}=yes " |
1271 |
myxfailparams+="test-xfail-${myt}=yes " |
1270 |
done |
1272 |
done |
1271 |
fi |
1273 |
fi |
1272 |
|
1274 |
|
1273 |
# sandbox does not understand unshare() and prevents |
1275 |
# sandbox does not understand unshare() and prevents |
1274 |
# writes to /proc/, which makes many tests fail |
1276 |
# writes to /proc/, which makes many tests fail |
1275 |
|
1277 |
|
1276 |
# we give the tests a bit more time to avoid spurious |
1278 |
# we give the tests a bit more time to avoid spurious |
1277 |
# bug reports on slow arches |
1279 |
# bug reports on slow arches |
1278 |
|
1280 |
|
1279 |
SANDBOX_ON=0 LD_PRELOAD= TIMEOUTFACTOR=32 emake ${myxfailparams} check |
1281 |
SANDBOX_ON=0 LD_PRELOAD= TIMEOUTFACTOR=32 emake ${myxfailparams} check |
1280 |
} |
1282 |
} |
1281 |
|
1283 |
|
1282 |
src_test() { |
1284 |
src_test() { |
1283 |
if just_headers ; then |
1285 |
if just_headers ; then |
1284 |
return |
1286 |
return |
1285 |
fi |
1287 |
fi |
1286 |
|
1288 |
|
1287 |
foreach_abi glibc_src_test || die "tests failed" |
1289 |
foreach_abi glibc_src_test || die "tests failed" |
1288 |
} |
1290 |
} |
1289 |
|
1291 |
|
1290 |
# src_install |
1292 |
# src_install |
1291 |
|
1293 |
|
1292 |
run_locale_gen() { |
1294 |
run_locale_gen() { |
1293 |
# if the host locales.gen contains no entries, we'll install everything |
1295 |
# if the host locales.gen contains no entries, we'll install everything |
1294 |
local root="$1" |
1296 |
local root="$1" |
1295 |
local inplace="" |
1297 |
local inplace="" |
1296 |
|
1298 |
|
1297 |
if [[ "${root}" == "--inplace-glibc" ]] ; then |
1299 |
if [[ "${root}" == "--inplace-glibc" ]] ; then |
1298 |
inplace="--inplace-glibc" |
1300 |
inplace="--inplace-glibc" |
1299 |
root="$2" |
1301 |
root="$2" |
1300 |
fi |
1302 |
fi |
1301 |
|
1303 |
|
1302 |
local locale_list="${root%/}/etc/locale.gen" |
1304 |
local locale_list="${root%/}/etc/locale.gen" |
1303 |
|
1305 |
|
1304 |
pushd "${ED}"/$(get_libdir) >/dev/null |
1306 |
pushd "${ED}"/$(get_libdir) >/dev/null |
1305 |
|
1307 |
|
1306 |
if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then |
1308 |
if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then |
1307 |
[[ -z ${inplace} ]] && ewarn "Generating all locales; edit /etc/locale.gen to save time/space" |
1309 |
[[ -z ${inplace} ]] && ewarn "Generating all locales; edit /etc/locale.gen to save time/space" |
1308 |
locale_list="${root%/}/usr/share/i18n/SUPPORTED" |
1310 |
locale_list="${root%/}/usr/share/i18n/SUPPORTED" |
1309 |
fi |
1311 |
fi |
1310 |
|
1312 |
|
1311 |
# bug 736794: we need to be careful with the parallelization... the number of |
1313 |
# bug 736794: we need to be careful with the parallelization... the number of |
1312 |
# processors saved in the environment of a binary package may differ strongly |
1314 |
# processors saved in the environment of a binary package may differ strongly |
1313 |
# from the number of processes available during postinst |
1315 |
# from the number of processes available during postinst |
1314 |
local mygenjobs="$(makeopts_jobs)" |
1316 |
local mygenjobs="$(makeopts_jobs)" |
1315 |
if [[ "${EMERGE_FROM}" == "binary" ]] ; then |
1317 |
if [[ "${EMERGE_FROM}" == "binary" ]] ; then |
1316 |
mygenjobs="$(nproc)" |
1318 |
mygenjobs="$(nproc)" |
1317 |
fi |
1319 |
fi |
1318 |
|
1320 |
|
1319 |
set -- locale-gen ${inplace} --jobs "${mygenjobs}" --config "${locale_list}" \ |
1321 |
set -- locale-gen ${inplace} --jobs "${mygenjobs}" --config "${locale_list}" \ |
1320 |
--destdir "${root}" |
1322 |
--destdir "${root}" |
1321 |
echo "$@" |
1323 |
echo "$@" |
1322 |
"$@" |
1324 |
"$@" |
1323 |
|
1325 |
|
1324 |
popd >/dev/null |
1326 |
popd >/dev/null |
1325 |
} |
1327 |
} |
1326 |
|
1328 |
|
1327 |
glibc_do_src_install() { |
1329 |
glibc_do_src_install() { |
1328 |
local builddir=$(builddir nptl) |
1330 |
local builddir=$(builddir nptl) |
1329 |
cd "${builddir}" |
1331 |
cd "${builddir}" |
1330 |
|
1332 |
|
1331 |
emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install |
1333 |
emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install |
1332 |
|
1334 |
|
1333 |
# This version (2.26) provides some compatibility libraries for the NIS/NIS+ support |
1335 |
# This version (2.26) provides some compatibility libraries for the NIS/NIS+ support |
1334 |
# which come without headers etc. Only needed for binary packages since the |
1336 |
# which come without headers etc. Only needed for binary packages since the |
1335 |
# external net-libs/libnsl has increased soversion. Keep only versioned libraries. |
1337 |
# external net-libs/libnsl has increased soversion. Keep only versioned libraries. |
1336 |
find "${D}" -name "libnsl.a" -delete |
1338 |
find "${D}" -name "libnsl.a" -delete |
1337 |
find "${D}" -name "libnsl.so" -delete |
1339 |
find "${D}" -name "libnsl.so" -delete |
1338 |
|
1340 |
|
1339 |
# Normally upstream_pv is ${PV}. Live ebuilds are exception, there we need |
1341 |
# Normally upstream_pv is ${PV}. Live ebuilds are exception, there we need |
1340 |
# to infer upstream version: |
1342 |
# to infer upstream version: |
1341 |
# '#define VERSION "2.26.90"' -> '2.26.90' |
1343 |
# '#define VERSION "2.26.90"' -> '2.26.90' |
1342 |
local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h) |
1344 |
local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h) |
1343 |
|
1345 |
|
1344 |
# Avoid stripping binaries not targeted by ${CHOST}. Or else |
1346 |
# Avoid stripping binaries not targeted by ${CHOST}. Or else |
1345 |
# ${CHOST}-strip would break binaries build for ${CTARGET}. |
1347 |
# ${CHOST}-strip would break binaries build for ${CTARGET}. |
1346 |
is_crosscompile && dostrip -x / |
1348 |
is_crosscompile && dostrip -x / |
1347 |
|
1349 |
|
1348 |
# gdb thread introspection relies on local libpthreads symbols. stripping breaks it |
1350 |
# gdb thread introspection relies on local libpthreads symbols. stripping breaks it |
1349 |
# See Note [Disable automatic stripping] |
1351 |
# See Note [Disable automatic stripping] |
1350 |
dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so |
1352 |
dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so |
|
|
1353 |
# valgrind requires knowledge about ld.so symbols. |
1354 |
dostrip -x $(alt_libdir)/ld-*.so* |
1351 |
|
1355 |
|
1352 |
if [[ -e ${ED}/$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then |
1356 |
if [[ -e ${ED}/$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then |
1353 |
# Move versioned .a file out of libdir to evade portage QA checks |
1357 |
# Move versioned .a file out of libdir to evade portage QA checks |
1354 |
# instead of using gen_usr_ldscript(). We fix ldscript as: |
1358 |
# instead of using gen_usr_ldscript(). We fix ldscript as: |
1355 |
# "GROUP ( /usr/lib64/libm-<pv>.a ..." -> "GROUP ( /usr/lib64/glibc-<pv>/libm-<pv>.a ..." |
1359 |
# "GROUP ( /usr/lib64/libm-<pv>.a ..." -> "GROUP ( /usr/lib64/glibc-<pv>/libm-<pv>.a ..." |
1356 |
sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"/$(alt_usrlibdir)/libm.a || die |
1360 |
sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"/$(alt_usrlibdir)/libm.a || die |
1357 |
dodir $(alt_usrlibdir)/${P} |
1361 |
dodir $(alt_usrlibdir)/${P} |
1358 |
mv "${ED}"/$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"/$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die |
1362 |
mv "${ED}"/$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"/$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die |
1359 |
fi |
1363 |
fi |
1360 |
|
1364 |
|
1361 |
# We configure toolchains for standalone prefix systems with a sysroot, |
1365 |
# We configure toolchains for standalone prefix systems with a sysroot, |
1362 |
# which is prepended to paths in ld scripts, so strip the prefix from these. |
1366 |
# which is prepended to paths in ld scripts, so strip the prefix from these. |
1363 |
# Before: GROUP ( /foo/lib64/libc.so.6 /foo/usr/lib64/libc_nonshared.a AS_NEEDED ( /foo/lib64/ld-linux-x86-64.so.2 ) ) |
1367 |
# Before: GROUP ( /foo/lib64/libc.so.6 /foo/usr/lib64/libc_nonshared.a AS_NEEDED ( /foo/lib64/ld-linux-x86-64.so.2 ) ) |
1364 |
# After: GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) |
1368 |
# After: GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) |
1365 |
if [[ -n $(host_eprefix) ]] ; then |
1369 |
if [[ -n $(host_eprefix) ]] ; then |
1366 |
local file |
1370 |
local file |
1367 |
grep -lZIF "ld script" "${ED}/$(alt_usrlibdir)"/lib*.{a,so} 2>/dev/null | while read -rd '' file ; do |
1371 |
grep -lZIF "ld script" "${ED}/$(alt_usrlibdir)"/lib*.{a,so} 2>/dev/null | while read -rd '' file ; do |
1368 |
sed -i "s|$(host_eprefix)/|/|g" "${file}" || die |
1372 |
sed -i "s|$(host_eprefix)/|/|g" "${file}" || die |
1369 |
done |
1373 |
done |
1370 |
fi |
1374 |
fi |
1371 |
|
1375 |
|
1372 |
# We'll take care of the cache ourselves |
1376 |
# We'll take care of the cache ourselves |
1373 |
rm -f "${ED}"/etc/ld.so.cache |
1377 |
rm -f "${ED}"/etc/ld.so.cache |
1374 |
|
1378 |
|
1375 |
# Everything past this point just needs to be done once ... |
1379 |
# Everything past this point just needs to be done once ... |
1376 |
is_final_abi || return 0 |
1380 |
is_final_abi || return 0 |
1377 |
|
1381 |
|
1378 |
# Make sure the non-native interp can be found on multilib systems even |
1382 |
# Make sure the non-native interp can be found on multilib systems even |
1379 |
# if the main library set isn't installed into the right place. Maybe |
1383 |
# if the main library set isn't installed into the right place. Maybe |
1380 |
# we should query the active gcc for info instead of hardcoding it ? |
1384 |
# we should query the active gcc for info instead of hardcoding it ? |
1381 |
local i ldso_abi ldso_name |
1385 |
local i ldso_abi ldso_name |
1382 |
local ldso_abi_list=( |
1386 |
local ldso_abi_list=( |
1383 |
# x86 |
1387 |
# x86 |
1384 |
amd64 /lib64/ld-linux-x86-64.so.2 |
1388 |
amd64 /lib64/ld-linux-x86-64.so.2 |
1385 |
x32 /libx32/ld-linux-x32.so.2 |
1389 |
x32 /libx32/ld-linux-x32.so.2 |
1386 |
x86 /lib/ld-linux.so.2 |
1390 |
x86 /lib/ld-linux.so.2 |
1387 |
# mips |
1391 |
# mips |
1388 |
o32 /lib/ld.so.1 |
1392 |
o32 /lib/ld.so.1 |
1389 |
n32 /lib32/ld.so.1 |
1393 |
n32 /lib32/ld.so.1 |
1390 |
n64 /lib64/ld.so.1 |
1394 |
n64 /lib64/ld.so.1 |
1391 |
# powerpc |
1395 |
# powerpc |
1392 |
ppc /lib/ld.so.1 |
1396 |
ppc /lib/ld.so.1 |
1393 |
# riscv |
1397 |
# riscv |
1394 |
ilp32d /lib/ld-linux-riscv32-ilp32d.so.1 |
1398 |
ilp32d /lib/ld-linux-riscv32-ilp32d.so.1 |
1395 |
ilp32 /lib/ld-linux-riscv32-ilp32.so.1 |
1399 |
ilp32 /lib/ld-linux-riscv32-ilp32.so.1 |
1396 |
lp64d /lib/ld-linux-riscv64-lp64d.so.1 |
1400 |
lp64d /lib/ld-linux-riscv64-lp64d.so.1 |
1397 |
lp64 /lib/ld-linux-riscv64-lp64.so.1 |
1401 |
lp64 /lib/ld-linux-riscv64-lp64.so.1 |
1398 |
# s390 |
1402 |
# s390 |
1399 |
s390 /lib/ld.so.1 |
1403 |
s390 /lib/ld.so.1 |
1400 |
s390x /lib/ld64.so.1 |
1404 |
s390x /lib/ld64.so.1 |
1401 |
# sparc |
1405 |
# sparc |
1402 |
sparc32 /lib/ld-linux.so.2 |
1406 |
sparc32 /lib/ld-linux.so.2 |
1403 |
sparc64 /lib64/ld-linux.so.2 |
1407 |
sparc64 /lib64/ld-linux.so.2 |
1404 |
) |
1408 |
) |
1405 |
case $(tc-endian) in |
1409 |
case $(tc-endian) in |
1406 |
little) |
1410 |
little) |
1407 |
ldso_abi_list+=( |
1411 |
ldso_abi_list+=( |
1408 |
# arm |
1412 |
# arm |
1409 |
arm64 /lib/ld-linux-aarch64.so.1 |
1413 |
arm64 /lib/ld-linux-aarch64.so.1 |
1410 |
# ELFv2 (glibc does not support ELFv1 on LE) |
1414 |
# ELFv2 (glibc does not support ELFv1 on LE) |
1411 |
ppc64 /lib64/ld64.so.2 |
1415 |
ppc64 /lib64/ld64.so.2 |
1412 |
) |
1416 |
) |
1413 |
;; |
1417 |
;; |
1414 |
big) |
1418 |
big) |
1415 |
ldso_abi_list+=( |
1419 |
ldso_abi_list+=( |
1416 |
# arm |
1420 |
# arm |
1417 |
arm64 /lib/ld-linux-aarch64_be.so.1 |
1421 |
arm64 /lib/ld-linux-aarch64_be.so.1 |
1418 |
# ELFv1 (glibc does not support ELFv2 on BE) |
1422 |
# ELFv1 (glibc does not support ELFv2 on BE) |
1419 |
ppc64 /lib64/ld64.so.1 |
1423 |
ppc64 /lib64/ld64.so.1 |
1420 |
) |
1424 |
) |
1421 |
;; |
1425 |
;; |
1422 |
esac |
1426 |
esac |
1423 |
if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then |
1427 |
if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then |
1424 |
dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib |
1428 |
dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib |
1425 |
fi |
1429 |
fi |
1426 |
for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do |
1430 |
for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do |
1427 |
ldso_abi=${ldso_abi_list[i]} |
1431 |
ldso_abi=${ldso_abi_list[i]} |
1428 |
has ${ldso_abi} $(get_install_abis) || continue |
1432 |
has ${ldso_abi} $(get_install_abis) || continue |
1429 |
|
1433 |
|
1430 |
ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}" |
1434 |
ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}" |
1431 |
if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then |
1435 |
if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then |
1432 |
dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name} |
1436 |
dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name} |
1433 |
fi |
1437 |
fi |
1434 |
done |
1438 |
done |
1435 |
|
1439 |
|
1436 |
# In the LSB 5.0 definition, someone had the excellent idea to "standardize" |
1440 |
# In the LSB 5.0 definition, someone had the excellent idea to "standardize" |
1437 |
# the runtime loader name, see also https://xkcd.com/927/ |
1441 |
# the runtime loader name, see also https://xkcd.com/927/ |
1438 |
# Normally, in Gentoo one should never come across executables that require this. |
1442 |
# Normally, in Gentoo one should never come across executables that require this. |
1439 |
# However, binary commercial packages are known to adhere to weird practices. |
1443 |
# However, binary commercial packages are known to adhere to weird practices. |
1440 |
# https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-AMD64/LSB-Core-AMD64.html#BASELIB |
1444 |
# https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-AMD64/LSB-Core-AMD64.html#BASELIB |
1441 |
local lsb_ldso_name native_ldso_name lsb_ldso_abi |
1445 |
local lsb_ldso_name native_ldso_name lsb_ldso_abi |
1442 |
local lsb_ldso_abi_list=( |
1446 |
local lsb_ldso_abi_list=( |
1443 |
# x86 |
1447 |
# x86 |
1444 |
amd64 ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3 |
1448 |
amd64 ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3 |
1445 |
) |
1449 |
) |
1446 |
for (( i = 0; i < ${#lsb_ldso_abi_list[@]}; i += 3 )) ; do |
1450 |
for (( i = 0; i < ${#lsb_ldso_abi_list[@]}; i += 3 )) ; do |
1447 |
lsb_ldso_abi=${lsb_ldso_abi_list[i]} |
1451 |
lsb_ldso_abi=${lsb_ldso_abi_list[i]} |
1448 |
native_ldso_name=${lsb_ldso_abi_list[i+1]} |
1452 |
native_ldso_name=${lsb_ldso_abi_list[i+1]} |
1449 |
lsb_ldso_name=${lsb_ldso_abi_list[i+2]} |
1453 |
lsb_ldso_name=${lsb_ldso_abi_list[i+2]} |
1450 |
has ${lsb_ldso_abi} $(get_install_abis) || continue |
1454 |
has ${lsb_ldso_abi} $(get_install_abis) || continue |
1451 |
|
1455 |
|
1452 |
if [[ ! -L ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} && ! -e ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} ]] ; then |
1456 |
if [[ ! -L ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} && ! -e ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} ]] ; then |
1453 |
dosym ${native_ldso_name} "$(alt_prefix)/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name}" |
1457 |
dosym ${native_ldso_name} "$(alt_prefix)/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name}" |
1454 |
fi |
1458 |
fi |
1455 |
done |
1459 |
done |
1456 |
|
1460 |
|
1457 |
# With devpts under Linux mounted properly, we do not need the pt_chown |
1461 |
# With devpts under Linux mounted properly, we do not need the pt_chown |
1458 |
# binary to be setuid. This is because the default owners/perms will be |
1462 |
# binary to be setuid. This is because the default owners/perms will be |
1459 |
# exactly what we want. |
1463 |
# exactly what we want. |
1460 |
if ! use suid ; then |
1464 |
if ! use suid ; then |
1461 |
find "${ED}" -name pt_chown -exec chmod -s {} + |
1465 |
find "${ED}" -name pt_chown -exec chmod -s {} + |
1462 |
fi |
1466 |
fi |
1463 |
|
1467 |
|
1464 |
################################################################# |
1468 |
################################################################# |
1465 |
# EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY # |
1469 |
# EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY # |
1466 |
################################################################# |
1470 |
################################################################# |
1467 |
|
1471 |
|
1468 |
# Make sure we install some symlink hacks so that when we build |
1472 |
# Make sure we install some symlink hacks so that when we build |
1469 |
# a 2nd stage cross-compiler, gcc finds the target system |
1473 |
# a 2nd stage cross-compiler, gcc finds the target system |
1470 |
# headers correctly. See gcc/doc/gccinstall.info |
1474 |
# headers correctly. See gcc/doc/gccinstall.info |
1471 |
if is_crosscompile ; then |
1475 |
if is_crosscompile ; then |
1472 |
# We need to make sure that /lib and /usr/lib always exists. |
1476 |
# We need to make sure that /lib and /usr/lib always exists. |
1473 |
# gcc likes to use relative paths to get to its multilibs like |
1477 |
# gcc likes to use relative paths to get to its multilibs like |
1474 |
# /usr/lib/../lib64/. So while we don't install any files into |
1478 |
# /usr/lib/../lib64/. So while we don't install any files into |
1475 |
# /usr/lib/, we do need it to exist. |
1479 |
# /usr/lib/, we do need it to exist. |
1476 |
keepdir $(alt_prefix)/lib |
1480 |
keepdir $(alt_prefix)/lib |
1477 |
keepdir $(alt_prefix)/usr/lib |
1481 |
keepdir $(alt_prefix)/usr/lib |
1478 |
|
1482 |
|
1479 |
dosym usr/include $(alt_prefix)/sys-include |
1483 |
dosym usr/include $(alt_prefix)/sys-include |
1480 |
return 0 |
1484 |
return 0 |
1481 |
fi |
1485 |
fi |
1482 |
|
1486 |
|
1483 |
# Files for Debian-style locale updating |
1487 |
# Files for Debian-style locale updating |
1484 |
dodir /usr/share/i18n |
1488 |
dodir /usr/share/i18n |
1485 |
sed \ |
1489 |
sed \ |
1486 |
-e "/^#/d" \ |
1490 |
-e "/^#/d" \ |
1487 |
-e "/SUPPORTED-LOCALES=/d" \ |
1491 |
-e "/SUPPORTED-LOCALES=/d" \ |
1488 |
-e "s: \\\\::g" -e "s:/: :g" \ |
1492 |
-e "s: \\\\::g" -e "s:/: :g" \ |
1489 |
"${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \ |
1493 |
"${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \ |
1490 |
|| die "generating /usr/share/i18n/SUPPORTED failed" |
1494 |
|| die "generating /usr/share/i18n/SUPPORTED failed" |
1491 |
|
1495 |
|
1492 |
cd "${S}" || die |
1496 |
cd "${S}" || die |
1493 |
|
1497 |
|
1494 |
# Install misc network config files |
1498 |
# Install misc network config files |
1495 |
insinto /etc |
1499 |
insinto /etc |
1496 |
doins posix/gai.conf |
1500 |
doins posix/gai.conf |
1497 |
|
1501 |
|
1498 |
if use systemd ; then |
1502 |
if use systemd ; then |
1499 |
doins "${WORKDIR}/glibc-systemd-${GLIBC_SYSTEMD_VER}/gentoo-config/nsswitch.conf" |
1503 |
doins "${WORKDIR}/glibc-systemd-${GLIBC_SYSTEMD_VER}/gentoo-config/nsswitch.conf" |
1500 |
else |
1504 |
else |
1501 |
doins nss/nsswitch.conf |
1505 |
doins nss/nsswitch.conf |
1502 |
fi |
1506 |
fi |
1503 |
|
1507 |
|
1504 |
# Gentoo-specific |
1508 |
# Gentoo-specific |
1505 |
newins "${FILESDIR}"/host.conf-1 host.conf |
1509 |
newins "${FILESDIR}"/host.conf-1 host.conf |
1506 |
|
1510 |
|
1507 |
if use nscd ; then |
1511 |
if use nscd ; then |
1508 |
doins nscd/nscd.conf |
1512 |
doins nscd/nscd.conf |
1509 |
|
1513 |
|
1510 |
newinitd "$(prefixify_ro "${FILESDIR}"/nscd-1)" nscd |
1514 |
newinitd "$(prefixify_ro "${FILESDIR}"/nscd-1)" nscd |
1511 |
|
1515 |
|
1512 |
local nscd_args=( |
1516 |
local nscd_args=( |
1513 |
-e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):" |
1517 |
-e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):" |
1514 |
) |
1518 |
) |
1515 |
|
1519 |
|
1516 |
sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd |
1520 |
sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd |
1517 |
|
1521 |
|
1518 |
use systemd && systemd_dounit nscd/nscd.service |
1522 |
use systemd && systemd_dounit nscd/nscd.service |
1519 |
newtmpfiles nscd/nscd.tmpfiles nscd.conf |
1523 |
newtmpfiles nscd/nscd.tmpfiles nscd.conf |
1520 |
fi |
1524 |
fi |
1521 |
|
1525 |
|
1522 |
echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc |
1526 |
echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc |
1523 |
doenvd "${T}"/00glibc |
1527 |
doenvd "${T}"/00glibc |
1524 |
|
1528 |
|
1525 |
for d in BUGS ChangeLog CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do |
1529 |
for d in BUGS ChangeLog CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do |
1526 |
[[ -s ${d} ]] && dodoc ${d} |
1530 |
[[ -s ${d} ]] && dodoc ${d} |
1527 |
done |
1531 |
done |
1528 |
dodoc -r ChangeLog.old |
1532 |
dodoc -r ChangeLog.old |
1529 |
|
1533 |
|
1530 |
# Prevent overwriting of the /etc/localtime symlink. We'll handle the |
1534 |
# Prevent overwriting of the /etc/localtime symlink. We'll handle the |
1531 |
# creation of the "factory" symlink in pkg_postinst(). |
1535 |
# creation of the "factory" symlink in pkg_postinst(). |
1532 |
rm -f "${ED}"/etc/localtime |
1536 |
rm -f "${ED}"/etc/localtime |
1533 |
|
1537 |
|
1534 |
# Generate all locales if this is a native build as locale generation |
1538 |
# Generate all locales if this is a native build as locale generation |
1535 |
if use compile-locales && ! is_crosscompile ; then |
1539 |
if use compile-locales && ! is_crosscompile ; then |
1536 |
run_locale_gen --inplace-glibc "${ED}/" |
1540 |
run_locale_gen --inplace-glibc "${ED}/" |
1537 |
fi |
1541 |
fi |
1538 |
} |
1542 |
} |
1539 |
|
1543 |
|
1540 |
glibc_headers_install() { |
1544 |
glibc_headers_install() { |
1541 |
local builddir=$(builddir "headers") |
1545 |
local builddir=$(builddir "headers") |
1542 |
cd "${builddir}" |
1546 |
cd "${builddir}" |
1543 |
emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install-headers |
1547 |
emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install-headers |
1544 |
|
1548 |
|
1545 |
insinto $(alt_headers)/gnu |
1549 |
insinto $(alt_headers)/gnu |
1546 |
doins "${S}"/include/gnu/stubs.h |
1550 |
doins "${S}"/include/gnu/stubs.h |
1547 |
|
1551 |
|
1548 |
# Make sure we install the sys-include symlink so that when |
1552 |
# Make sure we install the sys-include symlink so that when |
1549 |
# we build a 2nd stage cross-compiler, gcc finds the target |
1553 |
# we build a 2nd stage cross-compiler, gcc finds the target |
1550 |
# system headers correctly. See gcc/doc/gccinstall.info |
1554 |
# system headers correctly. See gcc/doc/gccinstall.info |
1551 |
dosym usr/include $(alt_prefix)/sys-include |
1555 |
dosym usr/include $(alt_prefix)/sys-include |
1552 |
} |
1556 |
} |
1553 |
|
1557 |
|
1554 |
src_install() { |
1558 |
src_install() { |
1555 |
if just_headers ; then |
1559 |
if just_headers ; then |
1556 |
export ABI=default |
1560 |
export ABI=default |
1557 |
glibc_headers_install |
1561 |
glibc_headers_install |
1558 |
return |
1562 |
return |
1559 |
fi |
1563 |
fi |
1560 |
|
1564 |
|
1561 |
foreach_abi glibc_do_src_install |
1565 |
foreach_abi glibc_do_src_install |
1562 |
|
1566 |
|
1563 |
if ! use static-libs ; then |
1567 |
if ! use static-libs ; then |
1564 |
einfo "Not installing static glibc libraries" |
1568 |
einfo "Not installing static glibc libraries" |
1565 |
find "${ED}" -name "*.a" -and -not -name "*_nonshared.a" -delete |
1569 |
find "${ED}" -name "*.a" -and -not -name "*_nonshared.a" -delete |
1566 |
fi |
1570 |
fi |
1567 |
} |
1571 |
} |
1568 |
|
1572 |
|
1569 |
# Simple test to make sure our new glibc isn't completely broken. |
1573 |
# Simple test to make sure our new glibc isn't completely broken. |
1570 |
# Make sure we don't test with statically built binaries since |
1574 |
# Make sure we don't test with statically built binaries since |
1571 |
# they will fail. Also, skip if this glibc is a cross compiler. |
1575 |
# they will fail. Also, skip if this glibc is a cross compiler. |
1572 |
# |
1576 |
# |
1573 |
# If coreutils is built with USE=multicall, some of these files |
1577 |
# If coreutils is built with USE=multicall, some of these files |
1574 |
# will just be wrapper scripts, not actual ELFs we can test. |
1578 |
# will just be wrapper scripts, not actual ELFs we can test. |
1575 |
glibc_sanity_check() { |
1579 |
glibc_sanity_check() { |
1576 |
cd / #228809 |
1580 |
cd / #228809 |
1577 |
|
1581 |
|
1578 |
# We enter ${ED} so to avoid trouble if the path contains |
1582 |
# We enter ${ED} so to avoid trouble if the path contains |
1579 |
# special characters; for instance if the path contains the |
1583 |
# special characters; for instance if the path contains the |
1580 |
# colon character (:), then the linker will try to split it |
1584 |
# colon character (:), then the linker will try to split it |
1581 |
# and look for the libraries in an unexpected place. This can |
1585 |
# and look for the libraries in an unexpected place. This can |
1582 |
# lead to unsafe code execution if the generated prefix is |
1586 |
# lead to unsafe code execution if the generated prefix is |
1583 |
# within a world-writable directory. |
1587 |
# within a world-writable directory. |
1584 |
# (e.g. /var/tmp/portage:${HOSTNAME}) |
1588 |
# (e.g. /var/tmp/portage:${HOSTNAME}) |
1585 |
pushd "${ED}"/$(get_libdir) >/dev/null |
1589 |
pushd "${ED}"/$(get_libdir) >/dev/null |
1586 |
|
1590 |
|
1587 |
# first let's find the actual dynamic linker here |
1591 |
# first let's find the actual dynamic linker here |
1588 |
# symlinks may point to the wrong abi |
1592 |
# symlinks may point to the wrong abi |
1589 |
local newldso=$(find . -maxdepth 1 -name 'ld*so.?' -type f -print -quit) |
1593 |
local newldso=$(find . -maxdepth 1 -name 'ld*so.?' -type f -print -quit) |
1590 |
|
1594 |
|
1591 |
einfo Last-minute run tests with ${newldso} in /$(get_libdir) ... |
1595 |
einfo Last-minute run tests with ${newldso} in /$(get_libdir) ... |
1592 |
|
1596 |
|
1593 |
local x striptest |
1597 |
local x striptest |
1594 |
for x in cal date env free ls true uname uptime ; do |
1598 |
for x in cal date env free ls true uname uptime ; do |
1595 |
x=$(type -p ${x}) |
1599 |
x=$(type -p ${x}) |
1596 |
[[ -z ${x} || ${x} != ${EPREFIX}/* ]] && continue |
1600 |
[[ -z ${x} || ${x} != ${EPREFIX}/* ]] && continue |
1597 |
striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) || continue |
1601 |
striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) || continue |
1598 |
case ${striptest} in |
1602 |
case ${striptest} in |
1599 |
*"statically linked"*) continue;; |
1603 |
*"statically linked"*) continue;; |
1600 |
*"ASCII text"*) continue;; |
1604 |
*"ASCII text"*) continue;; |
1601 |
esac |
1605 |
esac |
1602 |
# We need to clear the locale settings as the upgrade might want |
1606 |
# We need to clear the locale settings as the upgrade might want |
1603 |
# incompatible locale data. This test is not for verifying that. |
1607 |
# incompatible locale data. This test is not for verifying that. |
1604 |
LC_ALL=C \ |
1608 |
LC_ALL=C \ |
1605 |
${newldso} --library-path . ${x} > /dev/null \ |
1609 |
${newldso} --library-path . ${x} > /dev/null \ |
1606 |
|| die "simple run test (${x}) failed" |
1610 |
|| die "simple run test (${x}) failed" |
1607 |
done |
1611 |
done |
1608 |
|
1612 |
|
1609 |
popd >/dev/null |
1613 |
popd >/dev/null |
1610 |
} |
1614 |
} |
1611 |
|
1615 |
|
1612 |
pkg_preinst() { |
1616 |
pkg_preinst() { |
1613 |
# nothing to do if just installing headers |
1617 |
# nothing to do if just installing headers |
1614 |
just_headers && return |
1618 |
just_headers && return |
1615 |
|
1619 |
|
1616 |
einfo "Checking general environment sanity." |
1620 |
einfo "Checking general environment sanity." |
1617 |
sanity_prechecks |
1621 |
sanity_prechecks |
1618 |
|
1622 |
|
1619 |
# prepare /etc/ld.so.conf.d/ for files |
1623 |
# prepare /etc/ld.so.conf.d/ for files |
1620 |
mkdir -p "${EROOT}"/etc/ld.so.conf.d |
1624 |
mkdir -p "${EROOT}"/etc/ld.so.conf.d |
1621 |
|
1625 |
|
1622 |
# Default /etc/hosts.conf:multi to on for systems with small dbs. |
1626 |
# Default /etc/hosts.conf:multi to on for systems with small dbs. |
1623 |
if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then |
1627 |
if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then |
1624 |
sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf |
1628 |
sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf |
1625 |
einfo "Defaulting /etc/host.conf:multi to on" |
1629 |
einfo "Defaulting /etc/host.conf:multi to on" |
1626 |
fi |
1630 |
fi |
1627 |
|
1631 |
|
1628 |
[[ -n ${ROOT} ]] && return 0 |
1632 |
[[ -n ${ROOT} ]] && return 0 |
1629 |
[[ -d ${ED}/$(get_libdir) ]] || return 0 |
1633 |
[[ -d ${ED}/$(get_libdir) ]] || return 0 |
1630 |
[[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check |
1634 |
[[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check |
1631 |
|
1635 |
|
1632 |
if [[ -L ${EROOT}/usr/lib/locale ]]; then |
1636 |
if [[ -L ${EROOT}/usr/lib/locale ]]; then |
1633 |
# Help portage migrate this to a directory |
1637 |
# Help portage migrate this to a directory |
1634 |
# https://bugs.gentoo.org/753740 |
1638 |
# https://bugs.gentoo.org/753740 |
1635 |
rm "${EROOT}"/usr/lib/locale || die |
1639 |
rm "${EROOT}"/usr/lib/locale || die |
1636 |
fi |
1640 |
fi |
1637 |
|
1641 |
|
1638 |
# Keep around libcrypt so that Perl doesn't break when merging libxcrypt |
1642 |
# Keep around libcrypt so that Perl doesn't break when merging libxcrypt |
1639 |
# (libxcrypt is the new provider for now of libcrypt.so.{1,2}). |
1643 |
# (libxcrypt is the new provider for now of libcrypt.so.{1,2}). |
1640 |
# bug #802207 |
1644 |
# bug #802207 |
1641 |
if ! use crypt && has_version "${CATEGORY}/${PN}[crypt]" && ! has preserve-libs ${FEATURES}; then |
1645 |
if ! use crypt && has_version "${CATEGORY}/${PN}[crypt]" && ! has preserve-libs ${FEATURES}; then |
1642 |
PRESERVED_OLD_LIBCRYPT=1 |
1646 |
PRESERVED_OLD_LIBCRYPT=1 |
1643 |
cp -p "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" "${T}/libcrypt$(get_libname 1)" || die |
1647 |
cp -p "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" "${T}/libcrypt$(get_libname 1)" || die |
1644 |
else |
1648 |
else |
1645 |
PRESERVED_OLD_LIBCRYPT=0 |
1649 |
PRESERVED_OLD_LIBCRYPT=0 |
1646 |
fi |
1650 |
fi |
1647 |
} |
1651 |
} |
1648 |
|
1652 |
|
1649 |
glibc_refresh_ldconfig() { |
1653 |
glibc_refresh_ldconfig() { |
1650 |
if [[ ${MERGE_TYPE} == buildonly ]]; then |
1654 |
if [[ ${MERGE_TYPE} == buildonly ]]; then |
1651 |
return |
1655 |
return |
1652 |
fi |
1656 |
fi |
1653 |
|
1657 |
|
1654 |
# Version check could be added to avoid unnecessary work, but ldconfig |
1658 |
# Version check could be added to avoid unnecessary work, but ldconfig |
1655 |
# should finish quickly enough to not matter. |
1659 |
# should finish quickly enough to not matter. |
1656 |
ebegin "Refreshing ld.so.cache" |
1660 |
ebegin "Refreshing ld.so.cache" |
1657 |
ldconfig -i |
1661 |
ldconfig -i |
1658 |
if ! eend $?; then |
1662 |
if ! eend $?; then |
1659 |
ewarn "Failed to refresh the ld.so.cache for you. Some programs may be broken" |
1663 |
ewarn "Failed to refresh the ld.so.cache for you. Some programs may be broken" |
1660 |
ewarn "before you manually do so (ldconfig -i)." |
1664 |
ewarn "before you manually do so (ldconfig -i)." |
1661 |
fi |
1665 |
fi |
1662 |
} |
1666 |
} |
1663 |
|
1667 |
|
1664 |
pkg_postinst() { |
1668 |
pkg_postinst() { |
1665 |
# nothing to do if just installing headers |
1669 |
# nothing to do if just installing headers |
1666 |
just_headers && return |
1670 |
just_headers && return |
1667 |
|
1671 |
|
1668 |
if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then |
1672 |
if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then |
1669 |
# Generate fastloading iconv module configuration file. |
1673 |
# Generate fastloading iconv module configuration file. |
1670 |
"${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}/" |
1674 |
"${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}/" |
1671 |
fi |
1675 |
fi |
1672 |
|
1676 |
|
1673 |
if ! is_crosscompile && [[ -z ${ROOT} ]] ; then |
1677 |
if ! is_crosscompile && [[ -z ${ROOT} ]] ; then |
1674 |
# glibc-2.38+ on loong has ldconfig support added, but the ELF e_flags |
1678 |
# glibc-2.38+ on loong has ldconfig support added, but the ELF e_flags |
1675 |
# handling has changed as well, which means stale ldconfig auxiliary |
1679 |
# handling has changed as well, which means stale ldconfig auxiliary |
1676 |
# cache entries and failure to lookup libgcc_s / libstdc++ (breaking |
1680 |
# cache entries and failure to lookup libgcc_s / libstdc++ (breaking |
1677 |
# every C++ application) / libgomp etc., among other breakages. |
1681 |
# every C++ application) / libgomp etc., among other breakages. |
1678 |
# |
1682 |
# |
1679 |
# To fix this, simply refresh the ld.so.cache without using the |
1683 |
# To fix this, simply refresh the ld.so.cache without using the |
1680 |
# auxiliary cache if we're natively installing on loong. This should |
1684 |
# auxiliary cache if we're natively installing on loong. This should |
1681 |
# be done relatively soon because we want to minimize the breakage |
1685 |
# be done relatively soon because we want to minimize the breakage |
1682 |
# window for the affected programs. |
1686 |
# window for the affected programs. |
1683 |
use loong && glibc_refresh_ldconfig |
1687 |
use loong && glibc_refresh_ldconfig |
1684 |
|
1688 |
|
1685 |
use compile-locales || run_locale_gen "${EROOT}/" |
1689 |
use compile-locales || run_locale_gen "${EROOT}/" |
1686 |
fi |
1690 |
fi |
1687 |
|
1691 |
|
1688 |
upgrade_warning |
1692 |
upgrade_warning |
1689 |
|
1693 |
|
1690 |
# Check for sanity of /etc/nsswitch.conf, take 2 |
1694 |
# Check for sanity of /etc/nsswitch.conf, take 2 |
1691 |
if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then |
1695 |
if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then |
1692 |
local entry |
1696 |
local entry |
1693 |
for entry in passwd group shadow; do |
1697 |
for entry in passwd group shadow; do |
1694 |
if grep -E -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then |
1698 |
if grep -E -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then |
1695 |
ewarn "" |
1699 |
ewarn "" |
1696 |
ewarn "Your ${EROOT}/etc/nsswitch.conf uses NIS. Support for that has been" |
1700 |
ewarn "Your ${EROOT}/etc/nsswitch.conf uses NIS. Support for that has been" |
1697 |
ewarn "removed from glibc and is now provided by the package" |
1701 |
ewarn "removed from glibc and is now provided by the package" |
1698 |
ewarn " sys-auth/libnss-nis" |
1702 |
ewarn " sys-auth/libnss-nis" |
1699 |
ewarn "Install it now to keep your NIS setup working." |
1703 |
ewarn "Install it now to keep your NIS setup working." |
1700 |
ewarn "" |
1704 |
ewarn "" |
1701 |
fi |
1705 |
fi |
1702 |
done |
1706 |
done |
1703 |
fi |
1707 |
fi |
1704 |
|
1708 |
|
1705 |
if [[ ${PRESERVED_OLD_LIBCRYPT} -eq 1 ]] ; then |
1709 |
if [[ ${PRESERVED_OLD_LIBCRYPT} -eq 1 ]] ; then |
1706 |
cp -p "${T}/libcrypt$(get_libname 1)" "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" || die |
1710 |
cp -p "${T}/libcrypt$(get_libname 1)" "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" || die |
1707 |
preserve_old_lib_notify /$(get_libdir)/libcrypt$(get_libname 1) |
1711 |
preserve_old_lib_notify /$(get_libdir)/libcrypt$(get_libname 1) |
1708 |
|
1712 |
|
1709 |
elog "Please ignore a possible later error message about a file collision involving" |
1713 |
elog "Please ignore a possible later error message about a file collision involving" |
1710 |
elog "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1). We need to preserve this file for the moment to keep" |
1714 |
elog "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1). We need to preserve this file for the moment to keep" |
1711 |
elog "the upgrade working, but it also needs to be overwritten when" |
1715 |
elog "the upgrade working, but it also needs to be overwritten when" |
1712 |
elog "sys-libs/libxcrypt is installed. See bug 802210 for more details." |
1716 |
elog "sys-libs/libxcrypt is installed. See bug 802210 for more details." |
1713 |
fi |
1717 |
fi |
1714 |
} |
1718 |
} |
1715 |
- |
|
|