summaryrefslogtreecommitdiff
path: root/sys-libs/glibc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-12-22 14:08:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2021-12-22 14:08:05 +0000
commit93a93e9a3b53c1a73142a305ea1f8136846942ee (patch)
treeb9791a06ab3284e27b568412c59316c66240c682 /sys-libs/glibc
parent2771f79232c273bc2a57d23bf335dd81ccf6af28 (diff)
gentoo resync : 22.12.2021
Diffstat (limited to 'sys-libs/glibc')
-rw-r--r--sys-libs/glibc/Manifest8
-rw-r--r--sys-libs/glibc/glibc-2.34-r3.ebuild21
-rw-r--r--sys-libs/glibc/glibc-2.34-r4.ebuild (renamed from sys-libs/glibc/glibc-2.34-r2.ebuild)166
-rw-r--r--sys-libs/glibc/glibc-9999.ebuild164
4 files changed, 239 insertions, 120 deletions
diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
index a742d8a07e61..477aa36fbf15 100644
--- a/sys-libs/glibc/Manifest
+++ b/sys-libs/glibc/Manifest
@@ -24,8 +24,8 @@ DIST glibc-2.32.tar.xz 16744512 BLAKE2B a56b4afbb35315c5cd6dca0f62e44455dceae3e6
DIST glibc-2.33-patches-4.tar.xz 60124 BLAKE2B a7a99f39c16df241745772c31b10946dc44c51e6c09f8a447b905e7dd6ba529aee08f66a581431453c6665485ac1848861559aa3f0aaba8c2061c1f1eb77d9be SHA512 05c33dc465a98097f836783bb5037dfa14b3a2c0c140014f642ea72954222ae919fe2db9573ee70ca9c1881b3b59dd4b815a8f39f331494fa12951c9012797ef
DIST glibc-2.33-patches-6.tar.xz 64632 BLAKE2B f04ca4320d65c8796c67471cb56d3bf002cc34fb6a81075b85948e41c94df46cb2a3a944cced42d6d2c17ffc11e32a9840810864e655cc0fe18e6e0fe9f3c985 SHA512 b95746cd3415ec9ca275e542a2b5fddd5ce5680aa3bda08e94e96cf431191f7488ef6b7999ff0dfaf7405a4212531a75283e9bd7f5ae65bf572912038877a6df
DIST glibc-2.33.tar.xz 17031280 BLAKE2B 703d12121c1e2c5d9e0c6ba5341f5fb5c4d9111611a83f2360029b5de9c6e5a5611249d1833684a58ed4afdf49cae614365d87ec8721ba0e5d218f593b1f229d SHA512 4cb5777b68b22b746cc51669e0e9282b43c83f6944e42656e6db7195ebb68f2f9260f130fdeb4e3cfc64efae4f58d96c43d388f52be1eb024ca448084684abdb
-DIST glibc-2.34-patches-5.tar.xz 56832 BLAKE2B e5f5e8e41551d9f90355e9fc854e541cdcd5dd172e12dafa84256b7aeb999c0980ec6e7299701b78b0257980f5cf91019edfdf9796bec6b886434aa1960b2d6c SHA512 bc56fe2870629700d931150e1ebdc6e9b3318e8dabf5491d3645efd4db11032e21562e9276d97fc052c45362bfbca7f3d80d93277c2bf8aa3e05a5001df75c60
DIST glibc-2.34-patches-6.tar.xz 58396 BLAKE2B c25696e2aceef9ea4724716acde377d91b8a76b2edca2b293fcd6c89f635f63a612f8c1ecd861367b1394ebacc4b0151b0c6b68c2b08a7bde3a54a76400f35c5 SHA512 343922492e448d978dbcad1718804f892d002b6d4ce366da4cf571d97145ed850fb4b2862645681f487a9a18a77ea48f23010c0c61ea7cf914d26fd149b8271d
+DIST glibc-2.34-patches-8.tar.xz 61284 BLAKE2B a042d3bfd85cb9732f033eb1489fc4a9d5b42ec599bb320a97a9633047819d1d02b2f00dce601ddb02036f8bf0d67f9b0d6463785965db72d9ac2ce13765fa07 SHA512 1d92abb82ae404b90841217bba3b1ccb7e03799e5f21656b0a2eaaf06bd4a5a2f0fd7ebf927acc72fce0e2af6bb1a2e8658bac431423d07e75dce1f2868bd029
DIST glibc-2.34.tar.xz 17301232 BLAKE2B 874031192f2f5a3b35c3f5b044a467d4be4e67e8593e070e5b49b901ce8ea6bde2f8d2f6c92fa33b3f61eb723572a9e5f2b45e56064168df80a96d3fdb6fa30c SHA512 15252affd9ef4523a8001db16d497f4fdcb3ddf4cde7fe80e075df0bd3cc6524dc29fbe20229dbf5f97af580556e6b1fac0de321a5fe25322bc3e72f93beb624
DIST glibc-systemd-20210729.tar.gz 1480 BLAKE2B 37722c7579df782d890e44dbab99c3de52ab466eb9de80d82405e9bb5620bf39ffc8c5f466a435bdb86ef6d36dd7019c0736573916bda6c67d02a2581e0ec979 SHA512 efd75af58b50522c28cdac7abd1fc56555bc1bb042512c90d8340c1ec09c5791b3872a305bf83723252bbde5855b75d958c041083457765c4cfd170732d09238
DIST glibc-systemd-20210814.tar.gz 1469 BLAKE2B 10fa7bcb46d4fdce9c0ab353cbd30871e9b09a347a13a9c9a3b5777f931aa3c826c158d2e49532c604d4a834f2fab4089b67495fb88d0398945dc50d45ad9ef1 SHA512 5346a9ea459a1e6ccf665389f2a294de1e16f1e3e05cdf07e3dd99ed0e4f6f8b52cc333d4bff3c75ac90ab6ce70cd4ab2b3e126f920ce7979abd6dda56315efc
@@ -38,7 +38,7 @@ EBUILD glibc-2.31-r7.ebuild 44522 BLAKE2B 1adfba68c35d3af5ec8476b2fe5d3bebf13880
EBUILD glibc-2.32-r8.ebuild 44853 BLAKE2B 724f95c0ed2cda18dc2edcaa03b0783a2bc603b72a67e1451535040ddc83be6d1a90ad4b30f9623140b5c0a329ecafb6f19793390137e629d43a3c26e202b28a SHA512 0973b86c266e40203e301cf0c6f8fddc4273c002ffb8fd6c16f6e78f2cfdfbea95fda04adfebb8ee84a14dc950763ba706eadadb2e83f7982b800bee636d5d8f
EBUILD glibc-2.33-r1.ebuild 45233 BLAKE2B 881f8eebb4c7e4e78760b92bd6cb64de2372abed3f15b916ab0d47f60d5cbceaaedf2624db92aec97a2742f205e7b243a02f7ddd3932a83ba8d0de3b40f72caf SHA512 54978040ee64ccc03bf8aea55af21775d8e360fcf5eeddad61b36c51dcc016849e9650270463e46edbd35e7eb6ffa1c72f1068031c80b6fca316980674c22dce
EBUILD glibc-2.33-r7.ebuild 46954 BLAKE2B da9c95ef74942a7261b8fb32b5ac926f71315e7197c8b235e4892bbdbbce1a4e3ad2c26c4587695dc54dd61f8cdbac274d1fb620815daec286ae8b682937ea2a SHA512 4861947122e6ccd3ddbdfe1f750dec174902ebf3778b6ac40dbda1b5e8598782800bfa40887a795858a7094ecb691f3647941d0dced05c3bedd113480c558c6e
-EBUILD glibc-2.34-r2.ebuild 48420 BLAKE2B 8f0af59f0834a99e16c7a45a7f56f5deff51b63f745da101d0f69a839a0ab4d8c8c2de2c2ddb53d35259334484bbba199c48a86fa5d3290ae80c3ba158c5024b SHA512 212949c5e6f91bde921f0074f263e2cb752e0492b94c12b5263cbf8615d2666fac427828e1ee7faa2455f701d1cdb9839465e7d1163c6810c0b10c7823733d0b
-EBUILD glibc-2.34-r3.ebuild 48459 BLAKE2B c5e71ef6938078eefc3cc2ead33e6296c5efa37f455a905a99daf43068872406c2351ec79bcc1f5f1a89d61e7d49ef2a57a6541e2e7832af4b46143fbfe3e96d SHA512 365784b53e98903d3b28bc6384650973ad864abc282944e476e0c0109b7bc852997a4604b8c59a8c2dc047e71504f34352fe335dfdb7f28786a1c6aea1cd8f07
-EBUILD glibc-9999.ebuild 47925 BLAKE2B 6c31e95d2e41fb2b76dfe2e69915bd923e8636d009f0309bcc5d948e3b7911fc5558ad4ea73777641764246dac5d2c6ab64c0f7e48a1f12c913a59825e21bcb6 SHA512 f8d6d9c836fe4550178cf92f3208b951ff762c96dc1fa0d25e0243823c955731257c411406d9ec4e1801fd5e762458b2632945e684fbd0c29a87cd8698dfcda7
+EBUILD glibc-2.34-r3.ebuild 48801 BLAKE2B dc3a516595b2e88b7635d2e80ebeed3bbb212391a751d4ae61c84dbd6ff9f4b47d4b5cc2dbba4dd87b204d7ed3be85ceb7f33bb53f3b33ec22b7be34c409e0b1 SHA512 3c002a12b8d17161959e7b0601911d06ec342306a01dbe9cb5c99ead8bc110e40cea65aad66f505b069cef281e2bc8167c52d05c376fc2133cdf70b791bdddc5
+EBUILD glibc-2.34-r4.ebuild 50229 BLAKE2B 459d0d487a39c9e8d1b4e218a70ceecb335e329ce062731507f837b8089cdd4d413e2783cc2c4574f873e9bf6572237a450ae7171d1529024f3563c34cef821e SHA512 7d624cabbdd5eb6987a3fc4d5683d1f1fe3e7ac638926c31e947d70d84e8090936946e1bce3a4c5cbc288ebdd0880526c4168d0d86d91f4b0245d1cb36638146
+EBUILD glibc-9999.ebuild 49734 BLAKE2B b779b9ae866f9f7e8ac7b4f7ebd6a7530a987228e21130ad8025b451e2d49567b8cced2a45db0e3b62966113d7c349682238595176a58b07f0ccdcfccba9ef48 SHA512 8baa4b090c515a4c3d8e21852ebe7042f13e070da02fdd6fd907803b60df68adce67d733554a2f45711a314a871c0c9565a5e757d3287cc8bb4b0b5f109b0b4b
MISC metadata.xml 1701 BLAKE2B 91bd245d0a3685d76e3f874b50db872660054767fca5181871022fbdef9a18c4e674890bfed52cc3332c9557430ae8eec64505e67cdbedff000987406ab69ac5 SHA512 524edc37a01a47958ef557d586e8f06c6132481734ea28ed57e146969503fd129ad1da813a4d2d143a9bb8abe8810b0d8c920ab3c422a729287838435c44743a
diff --git a/sys-libs/glibc/glibc-2.34-r3.ebuild b/sys-libs/glibc/glibc-2.34-r3.ebuild
index 7053b85282f1..b65194c38f6f 100644
--- a/sys-libs/glibc/glibc-2.34-r3.ebuild
+++ b/sys-libs/glibc/glibc-2.34-r3.ebuild
@@ -730,6 +730,20 @@ sanity_prechecks() {
fi
}
+upgrade_warning() {
+ if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then
+ local oldv newv=$(ver_cut 1-2 ${PV})
+ for oldv in ${REPLACING_VERSIONS}; do
+ if ver_test ${oldv} -lt ${newv}; then
+ ewarn "After upgrading glibc, please restart all running processes."
+ ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)."
+ ewarn "Alternatively, reboot your system."
+ break
+ fi
+ done
+ fi
+}
+
#
# the phases
#
@@ -740,6 +754,7 @@ pkg_pretend() {
# All the checks...
einfo "Checking general environment sanity."
sanity_prechecks
+ upgrade_warning
}
pkg_setup() {
@@ -1558,11 +1573,7 @@ pkg_postinst() {
use compile-locales || run_locale_gen "${EROOT}/"
fi
- if systemd_is_booted && [[ -z ${ROOT} ]] ; then
- # We need to restart systemd when upgrading from < 2.34
- # bug #823756
- systemctl daemon-reexec
- fi
+ upgrade_warning
# Check for sanity of /etc/nsswitch.conf, take 2
if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then
diff --git a/sys-libs/glibc/glibc-2.34-r2.ebuild b/sys-libs/glibc/glibc-2.34-r4.ebuild
index dd50e8578a35..4346f19004c8 100644
--- a/sys-libs/glibc/glibc-2.34-r2.ebuild
+++ b/sys-libs/glibc/glibc-2.34-r4.ebuild
@@ -23,7 +23,7 @@ SLOT="2.2"
EMULTILIB_PKG="true"
# Gentoo patchset (ignored for live ebuilds)
-PATCH_VER=5
+PATCH_VER=8
PATCH_DEV=dilfridge
if [[ ${PV} == 9999* ]]; then
@@ -46,7 +46,7 @@ SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${L
SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
SRC_URI+=" systemd? ( https://gitweb.gentoo.org/proj/toolchain/glibc-systemd.git/snapshot/glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz )"
-IUSE="audit caps cet compile-locales +crypt custom-cflags doc gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp +static-libs static-pie suid systemd systemtap test vanilla"
+IUSE="audit caps cet +clone3 compile-locales +crypt custom-cflags doc gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp +static-libs static-pie suid systemd systemtap test vanilla"
# Minimum kernel version that glibc requires
MIN_KERN_VER="3.2.0"
@@ -408,6 +408,7 @@ setup_flags() {
filter-flags '-O?'
append-flags -O2
fi
+
strip-unsupported-flags
filter-flags -m32 -m64 '-mabi=*'
@@ -421,6 +422,9 @@ setup_flags() {
# #492892
filter-flags -frecord-gcc-switches
+ # #829583
+ filter-lfs-flags
+
unset CBUILD_OPT CTARGET_OPT
if use multilib ; then
CTARGET_OPT=$(get_abi_CTARGET)
@@ -522,14 +526,104 @@ setup_env() {
einfo "Skip CC ABI injection. We can't use (cross-)compiler yet."
return 0
fi
- local VAR=CFLAGS_${ABI}
+
+ # Glibc does not work with gold (for various reasons) #269274.
+ tc-ld-disable-gold
+
+ if use doc ; then
+ export MAKEINFO=makeinfo
+ else
+ export MAKEINFO=/dev/null
+ fi
+
+ # Reset CC and CXX to the value at start of emerge
+ export CC=${__ORIG_CC:-${CC:-$(tc-getCC ${CTARGET})}}
+ export CXX=${__ORIG_CXX:-${CXX:-$(tc-getCXX ${CTARGET})}}
+
+ # and make sure __ORIC_CC and __ORIG_CXX is defined now.
+ export __ORIG_CC=${CC}
+ export __ORIG_CXX=${CXX}
+
+ if tc-is-clang && ! use custom-cflags && ! is_crosscompile ; then
+
+ # If we are running in an otherwise clang/llvm environment, we need to
+ # recover the proper gcc and binutils settings here, at least until glibc
+ # is finally building with clang. So let's override everything that is
+ # set in the clang profiles.
+ # Want to shoot yourself into the foot? Set USE=custom-cflags, that's always
+ # a good start into that direction.
+ # Also, if you're crosscompiling, let's assume you know what you are doing.
+ # Hopefully.
+
+ local current_binutils_path=$(binutils-config -B)
+ local current_gcc_path=$(gcc-config -B)
+ einfo "Overriding clang configuration, since it won't work here"
+
+ export CC="${current_gcc_path}/gcc"
+ export CXX="${current_gcc_path}/g++"
+ export LD="${current_binutils_path}/ld.bfd"
+ export AR="${current_binutils_path}/ar"
+ export AS="${current_binutils_path}/as"
+ export NM="${current_binutils_path}/nm"
+ export STRIP="${current_binutils_path}/strip"
+ export RANLIB="${current_binutils_path}/ranlib"
+ export OBJCOPY="${current_binutils_path}/objcopy"
+ export STRINGS="${current_binutils_path}/strings"
+ export OBJDUMP="${current_binutils_path}/objdump"
+ export READELF="${current_binutils_path}/readelf"
+ export ADDR2LINE="${current_binutils_path}/addr2line"
+
+ # do we need to also do flags munging here? yes! at least...
+ filter-flags '-fuse-ld=*'
+ filter-flags '-D_FORTIFY_SOURCE=*'
+
+ else
+
+ # this is the "normal" case
+
+ export CC="$(tc-getCC ${CTARGET})"
+ export CXX="$(tc-getCXX ${CTARGET})"
+
+ # Always use tuple-prefixed toolchain. For non-native ABI glibc's configure
+ # can't detect them automatically due to ${CHOST} mismatch and fallbacks
+ # to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup().
+ export NM="$(tc-getNM ${CTARGET})"
+ export READELF="$(tc-getREADELF ${CTARGET})"
+
+ fi
+
# We need to export CFLAGS with abi information in them because glibc's
# configure script checks CFLAGS for some targets (like mips). Keep
# around the original clean value to avoid appending multiple ABIs on
- # top of each other.
- : ${__GLIBC_CC:=$(tc-getCC ${CTARGET})}
- export __GLIBC_CC CC="${__GLIBC_CC} ${!VAR}"
- einfo " $(printf '%15s' 'Manual CC:') ${CC}"
+ # top of each other. (Why does the comment talk about CFLAGS if the code
+ # acts on CC?)
+ export __GLIBC_CC=${CC}
+ export __GLIBC_CXX=${CXX}
+
+ export __abi_CFLAGS="$(get_abi_CFLAGS)"
+
+ # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760
+ # To build .S (assembly) files with the same ABI-specific flags
+ # upstream currently recommends adding CFLAGS to CC/CXX:
+ # https://sourceware.org/PR23273
+ # Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS
+ # and breaks multiarch support. See 659030#c3 for an example.
+ # The glibc configure script doesn't properly use LDFLAGS all the time.
+ export CC="${__GLIBC_CC} ${__abi_CFLAGS} ${CFLAGS} ${LDFLAGS}"
+
+ # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
+ export CXX="${__GLIBC_CXX} ${__abi_CFLAGS} ${CFLAGS}"
+
+ if is_crosscompile; then
+ # Assume worst-case bootstrap: glibc is buil first time
+ # when ${CTARGET}-g++ is not available yet. We avoid
+ # building auxiliary programs that require C++: bug #683074
+ # It should not affect final result.
+ export libc_cv_cxx_link_ok=no
+ # The line above has the same effect. We set CXX explicitly
+ # to make build logs less confusing.
+ export CXX=
+ fi
}
foreach_abi() {
@@ -806,6 +900,14 @@ src_prepare() {
einfo "Done."
fi
+ if use clone3 ; then
+ append-cppflags -DGENTOO_USE_CLONE3
+ else
+ # See e.g. bug #827386, bug #819045.
+ elog "Disabling the clone3 syscall for compatibility with older Electron apps."
+ elog "Please re-enable this flag before filing bugs!"
+ fi
+
default
gnuconfig_update
@@ -826,61 +928,13 @@ src_prepare() {
}
glibc_do_configure() {
- # Glibc does not work with gold (for various reasons) #269274.
- tc-ld-disable-gold
-
- # CXX isnt handled by the multilib system, so if we dont unset here
- # we accumulate crap across abis
- unset CXX
-
- einfo "Configuring glibc for nptl"
-
- if use doc ; then
- export MAKEINFO=makeinfo
- else
- export MAKEINFO=/dev/null
- fi
local v
- for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM READELF; do
+ for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM AR AS STRIP RANLIB OBJCOPY STRINGS OBJDUMP READELF; do
einfo " $(printf '%15s' ${v}:) ${!v}"
done
- # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760
- # To build .S (assembly) files with the same ABI-specific flags
- # upstream currently recommends adding CFLAGS to CC/CXX:
- # https://sourceware.org/PR23273
- # Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS
- # and breaks multiarch support. See 659030#c3 for an example.
- # The glibc configure script doesn't properly use LDFLAGS all the time.
- export CC="$(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS}"
- einfo " $(printf '%15s' 'Manual CC:') ${CC}"
-
- # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
- export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS) ${CFLAGS}"
-
- if is_crosscompile; then
- # Assume worst-case bootstrap: glibc is buil first time
- # when ${CTARGET}-g++ is not available yet. We avoid
- # building auxiliary programs that require C++: bug #683074
- # It should not affect final result.
- export libc_cv_cxx_link_ok=no
- # The line above has the same effect. We set CXX explicitly
- # to make build logs less confusing.
- export CXX=
- fi
- einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
-
- # Always use tuple-prefixed toolchain. For non-native ABI glibc's configure
- # can't detect them automatically due to ${CHOST} mismatch and fallbacks
- # to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup().
- export NM="$(tc-getNM ${CTARGET})"
- export READELF="$(tc-getREADELF ${CTARGET})"
- einfo " $(printf '%15s' 'Manual NM:') ${NM}"
- einfo " $(printf '%15s' 'Manual READELF:') ${READELF}"
-
echo
-
local myconf=()
case ${CTARGET} in
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index 79318fb53543..2cb4bf86808c 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -47,7 +47,7 @@ SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${L
SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
SRC_URI+=" systemd? ( https://gitweb.gentoo.org/proj/toolchain/glibc-systemd.git/snapshot/glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz )"
-IUSE="audit caps cet compile-locales +crypt custom-cflags doc gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp +static-libs static-pie suid systemd systemtap test vanilla"
+IUSE="audit caps cet +clone3 compile-locales +crypt custom-cflags doc gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp +static-libs static-pie suid systemd systemtap test vanilla"
# Minimum kernel version that glibc requires
MIN_KERN_VER="3.2.0"
@@ -401,6 +401,7 @@ setup_flags() {
filter-flags '-O?'
append-flags -O2
fi
+
strip-unsupported-flags
filter-flags -m32 -m64 '-mabi=*'
@@ -414,6 +415,9 @@ setup_flags() {
# #492892
filter-flags -frecord-gcc-switches
+ # #829583
+ filter-lfs-flags
+
unset CBUILD_OPT CTARGET_OPT
if use multilib ; then
CTARGET_OPT=$(get_abi_CTARGET)
@@ -515,14 +519,104 @@ setup_env() {
einfo "Skip CC ABI injection. We can't use (cross-)compiler yet."
return 0
fi
- local VAR=CFLAGS_${ABI}
+
+ # Glibc does not work with gold (for various reasons) #269274.
+ tc-ld-disable-gold
+
+ if use doc ; then
+ export MAKEINFO=makeinfo
+ else
+ export MAKEINFO=/dev/null
+ fi
+
+ # Reset CC and CXX to the value at start of emerge
+ export CC=${__ORIG_CC:-${CC:-$(tc-getCC ${CTARGET})}}
+ export CXX=${__ORIG_CXX:-${CXX:-$(tc-getCXX ${CTARGET})}}
+
+ # and make sure __ORIC_CC and __ORIG_CXX is defined now.
+ export __ORIG_CC=${CC}
+ export __ORIG_CXX=${CXX}
+
+ if tc-is-clang && ! use custom-cflags && ! is_crosscompile ; then
+
+ # If we are running in an otherwise clang/llvm environment, we need to
+ # recover the proper gcc and binutils settings here, at least until glibc
+ # is finally building with clang. So let's override everything that is
+ # set in the clang profiles.
+ # Want to shoot yourself into the foot? Set USE=custom-cflags, that's always
+ # a good start into that direction.
+ # Also, if you're crosscompiling, let's assume you know what you are doing.
+ # Hopefully.
+
+ local current_binutils_path=$(binutils-config -B)
+ local current_gcc_path=$(gcc-config -B)
+ einfo "Overriding clang configuration, since it won't work here"
+
+ export CC="${current_gcc_path}/gcc"
+ export CXX="${current_gcc_path}/g++"
+ export LD="${current_binutils_path}/ld.bfd"
+ export AR="${current_binutils_path}/ar"
+ export AS="${current_binutils_path}/as"
+ export NM="${current_binutils_path}/nm"
+ export STRIP="${current_binutils_path}/strip"
+ export RANLIB="${current_binutils_path}/ranlib"
+ export OBJCOPY="${current_binutils_path}/objcopy"
+ export STRINGS="${current_binutils_path}/strings"
+ export OBJDUMP="${current_binutils_path}/objdump"
+ export READELF="${current_binutils_path}/readelf"
+ export ADDR2LINE="${current_binutils_path}/addr2line"
+
+ # do we need to also do flags munging here? yes! at least...
+ filter-flags '-fuse-ld=*'
+ filter-flags '-D_FORTIFY_SOURCE=*'
+
+ else
+
+ # this is the "normal" case
+
+ export CC="$(tc-getCC ${CTARGET})"
+ export CXX="$(tc-getCXX ${CTARGET})"
+
+ # Always use tuple-prefixed toolchain. For non-native ABI glibc's configure
+ # can't detect them automatically due to ${CHOST} mismatch and fallbacks
+ # to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup().
+ export NM="$(tc-getNM ${CTARGET})"
+ export READELF="$(tc-getREADELF ${CTARGET})"
+
+ fi
+
# We need to export CFLAGS with abi information in them because glibc's
# configure script checks CFLAGS for some targets (like mips). Keep
# around the original clean value to avoid appending multiple ABIs on
- # top of each other.
- : ${__GLIBC_CC:=$(tc-getCC ${CTARGET})}
- export __GLIBC_CC CC="${__GLIBC_CC} ${!VAR}"
- einfo " $(printf '%15s' 'Manual CC:') ${CC}"
+ # top of each other. (Why does the comment talk about CFLAGS if the code
+ # acts on CC?)
+ export __GLIBC_CC=${CC}
+ export __GLIBC_CXX=${CXX}
+
+ export __abi_CFLAGS="$(get_abi_CFLAGS)"
+
+ # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760
+ # To build .S (assembly) files with the same ABI-specific flags
+ # upstream currently recommends adding CFLAGS to CC/CXX:
+ # https://sourceware.org/PR23273
+ # Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS
+ # and breaks multiarch support. See 659030#c3 for an example.
+ # The glibc configure script doesn't properly use LDFLAGS all the time.
+ export CC="${__GLIBC_CC} ${__abi_CFLAGS} ${CFLAGS} ${LDFLAGS}"
+
+ # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
+ export CXX="${__GLIBC_CXX} ${__abi_CFLAGS} ${CFLAGS}"
+
+ if is_crosscompile; then
+ # Assume worst-case bootstrap: glibc is buil first time
+ # when ${CTARGET}-g++ is not available yet. We avoid
+ # building auxiliary programs that require C++: bug #683074
+ # It should not affect final result.
+ export libc_cv_cxx_link_ok=no
+ # The line above has the same effect. We set CXX explicitly
+ # to make build logs less confusing.
+ export CXX=
+ fi
}
foreach_abi() {
@@ -799,6 +893,14 @@ src_prepare() {
einfo "Done."
fi
+ if use clone3 ; then
+ append-cppflags -DGENTOO_USE_CLONE3
+ else
+ # See e.g. bug #827386, bug #819045.
+ elog "Disabling the clone3 syscall for compatibility with older Electron apps."
+ elog "Please re-enable this flag before filing bugs!"
+ fi
+
default
gnuconfig_update
@@ -819,61 +921,13 @@ src_prepare() {
}
glibc_do_configure() {
- # Glibc does not work with gold (for various reasons) #269274.
- tc-ld-disable-gold
-
- # CXX isnt handled by the multilib system, so if we dont unset here
- # we accumulate crap across abis
- unset CXX
-
- einfo "Configuring glibc for nptl"
-
- if use doc ; then
- export MAKEINFO=makeinfo
- else
- export MAKEINFO=/dev/null
- fi
local v
- for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM READELF; do
+ for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM AR AS STRIP RANLIB OBJCOPY STRINGS OBJDUMP READELF; do
einfo " $(printf '%15s' ${v}:) ${!v}"
done
- # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760
- # To build .S (assembly) files with the same ABI-specific flags
- # upstream currently recommends adding CFLAGS to CC/CXX:
- # https://sourceware.org/PR23273
- # Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS
- # and breaks multiarch support. See 659030#c3 for an example.
- # The glibc configure script doesn't properly use LDFLAGS all the time.
- export CC="$(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS}"
- einfo " $(printf '%15s' 'Manual CC:') ${CC}"
-
- # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
- export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS) ${CFLAGS}"
-
- if is_crosscompile; then
- # Assume worst-case bootstrap: glibc is buil first time
- # when ${CTARGET}-g++ is not available yet. We avoid
- # building auxiliary programs that require C++: bug #683074
- # It should not affect final result.
- export libc_cv_cxx_link_ok=no
- # The line above has the same effect. We set CXX explicitly
- # to make build logs less confusing.
- export CXX=
- fi
- einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
-
- # Always use tuple-prefixed toolchain. For non-native ABI glibc's configure
- # can't detect them automatically due to ${CHOST} mismatch and fallbacks
- # to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup().
- export NM="$(tc-getNM ${CTARGET})"
- export READELF="$(tc-getREADELF ${CTARGET})"
- einfo " $(printf '%15s' 'Manual NM:') ${NM}"
- einfo " $(printf '%15s' 'Manual READELF:') ${READELF}"
-
echo
-
local myconf=()
case ${CTARGET} in