summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2020-11-27 14:29:28 +0100
committerFabian Groffen <grobian@gentoo.org>2020-11-27 14:38:59 +0100
commit4b52e188057a6b59d3e48983f351bf44ae080081 (patch)
tree7d27f2e5e2cd88536011edaf8517379cbd5702cd
parentsys-devel/binutils-config: drop libmissing support (diff)
downloadprefix-4b52e188057a6b59d3e48983f351bf44ae080081.tar.gz
prefix-4b52e188057a6b59d3e48983f351bf44ae080081.tar.bz2
prefix-4b52e188057a6b59d3e48983f351bf44ae080081.zip
sys-devel/binutils-config-5.1-r3: revbump for libsysroot support
Big Sur (11.0) needs libsysroot support from the linker, so allow activating it. Package-Manager: Portage-3.0.8-prefix, Repoman-3.0.2 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r--sys-devel/binutils-config/binutils-config-5.1-r3.ebuild (renamed from sys-devel/binutils-config/binutils-config-5.1-r2.ebuild)10
-rw-r--r--sys-devel/binutils-config/files/ldwrapper.c14
2 files changed, 21 insertions, 3 deletions
diff --git a/sys-devel/binutils-config/binutils-config-5.1-r2.ebuild b/sys-devel/binutils-config/binutils-config-5.1-r3.ebuild
index d104bf4fb7..fd26184271 100644
--- a/sys-devel/binutils-config/binutils-config-5.1-r2.ebuild
+++ b/sys-devel/binutils-config/binutils-config-5.1-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -39,6 +39,13 @@ src_configure() {
src_compile() {
use prefix-guest || return
+ local extraargs=( )
+ if [[ ${CHOST} == *-darwin* && ${CHOST##*-darwin} -ge 20 ]] ; then
+ # macOS Big Sur has an empty /usr/lib, so the linker really has
+ # to look into the SDK, for which it needs to be told where it
+ # is (symlinked right into our EPREFIX root as MacOSX.sdk)
+ extraargs+=( -DDARWIN_LD_SYSLIBROOT=1 )
+ fi
local args=(
$(tc-getCC)
${CPPFLAGS}
@@ -46,6 +53,7 @@ src_compile() {
-o ldwrapper ${PN}-ldwrapper-${WRAPPER_REV}.c
-DEPREFIX=\"${EPREFIX}\"
-DCHOST=\"${CHOST}\"
+ "${extraargs[@]}"
${LDFLAGS}
)
echo ${args[*]}
diff --git a/sys-devel/binutils-config/files/ldwrapper.c b/sys-devel/binutils-config/files/ldwrapper.c
index 216747da5c..75575f31f6 100644
--- a/sys-devel/binutils-config/files/ldwrapper.c
+++ b/sys-devel/binutils-config/files/ldwrapper.c
@@ -20,8 +20,9 @@
* ldwrapper: Prefix helper to inject -L and -R flags to the invocation
* of ld.
*
- * On Darwin it adds -search_path_first to make sure the given paths are
- * searched before the default search path.
+ * On Darwin it adds -search_paths_first to make sure the given paths are
+ * searched before the default search path, and sets -syslibroot
+ * starting from Big Sur 11.0.
* On AIX it ensures -bsvr4 is the last argument.
* The wrapper will inject -L entries for:
* - EPREFIX/usr/CHOST/lib/gcc (when gcc)
@@ -339,6 +340,11 @@ main(int argc, char *argv[])
/* add the 2 prefix paths (-L) and -search_paths_first */
newargc += 2 + 1;
+
+#ifdef DARWIN_LD_SYSLIBROOT
+ /* add -syslibroot <path> */
+ newargc += 2;
+#endif
} else {
/* add the 4 paths we want (-L + -R) */
newargc += 8;
@@ -380,6 +386,10 @@ main(int argc, char *argv[])
if (!is_cross && is_darwin) {
/* inject this first to make the intention clear */
+#ifdef DARWIN_LD_SYSLIBROOT
+ newargv[j++] = "-syslibroot";
+ newargv[j++] = EPREFIX "/MacOSX.sdk"
+#endif
newargv[j++] = "-search_paths_first";
}