[gentoo-commits] repo/proj/prefix:master commit in: sys-devel/binutils-config/files/, sys-devel/binutils-config/
commit: 1e8c1aa5752b38209bb521578377cd2025773e62 Author: Fabian Groffen gentoo org> AuthorDate: Sat Apr 6 14:34:38 2024 + Commit: Fabian Groffen gentoo org> CommitDate: Sat Apr 6 14:34:38 2024 + URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=1e8c1aa5 sys-devel/binutils-config: fix -rpath and -L handling A thinko broke skipping of arguments consisting of two entries, resulting in very weird command lines. Not noticed on Darwin because for some odd reason. Signed-off-by: Fabian Groffen gentoo.org> ...1-r11.ebuild => binutils-config-5.1-r12.ebuild} | 0 sys-devel/binutils-config/files/ldwrapper.c| 22 +++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sys-devel/binutils-config/binutils-config-5.1-r11.ebuild b/sys-devel/binutils-config/binutils-config-5.1-r12.ebuild similarity index 100% rename from sys-devel/binutils-config/binutils-config-5.1-r11.ebuild rename to sys-devel/binutils-config/binutils-config-5.1-r12.ebuild diff --git a/sys-devel/binutils-config/files/ldwrapper.c b/sys-devel/binutils-config/files/ldwrapper.c index 22fbf9aba8..1aa96537d0 100644 --- a/sys-devel/binutils-config/files/ldwrapper.c +++ b/sys-devel/binutils-config/files/ldwrapper.c @@ -530,7 +530,7 @@ main(int argc, char *argv[]) char *path; int pth; char duplicate; - int before = j - 1; + int nexti = i; /* arguments can be in many ways here: * -L @@ -541,10 +541,11 @@ main(int argc, char *argv[]) while (*path != '\0' && isspace(*path)) path++; if (*path == '\0') { + nexti++; /* no more arguments?!? skip */ - if (i + 1 >= argc) + if (nexti >= argc) continue; - path = argv[i + 1]; + path = argv[nexti]; while (*path != '\0' && isspace(*path)) path++; } @@ -570,7 +571,8 @@ main(int argc, char *argv[]) } } if (duplicate) { - j = before; + i = nexti; + j--; continue; } /* record path */ @@ -584,7 +586,8 @@ main(int argc, char *argv[]) } } if (duplicate) { - j = before; + i = nexti; + j--; continue; } /* record path */ @@ -597,8 +600,12 @@ main(int argc, char *argv[]) char *path; int pth; char duplicate; + int nexti = i + 1; - path = argv[i + 1]; + /* no more arguments?!? skip */ + if (nexti >= argc) + continue; + path = argv[nexti]; while (*path != '\0' && isspace(*path)) path++; /* not absolute (or empty)?!? skip */ @@ -617,7 +624,8 @@ main(int argc, char *argv[]) } } if (duplicate) { - j -= 2; + j--; + i = nexti; continue; } /* record path */
[gentoo-commits] repo/proj/prefix:master commit in: sys-devel/binutils-config/files/, sys-devel/binutils-config/
commit: 70384d5c6846998d8cb6bcc2ddfcf0830c13c6fa Author: Fabian Groffen gentoo org> AuthorDate: Sun Jan 21 09:45:17 2024 + Commit: Fabian Groffen gentoo org> CommitDate: Sun Jan 21 09:45:17 2024 + URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=70384d5c sys-devel/binutils-config: more macOS linker tweaks This time tested with native linkers on platforms which are seen during stage2 bootstraps: Darwin 23 with dyld-1022.1 Darwin 17 with ld64-409.12 Darwin 9 with ld64-85.2.1 Signed-off-by: Fabian Groffen gentoo.org> ...5.1-r8.ebuild => binutils-config-5.1-r9.ebuild} | 0 sys-devel/binutils-config/files/ldwrapper.c| 27 +- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/sys-devel/binutils-config/binutils-config-5.1-r8.ebuild b/sys-devel/binutils-config/binutils-config-5.1-r9.ebuild similarity index 100% rename from sys-devel/binutils-config/binutils-config-5.1-r8.ebuild rename to sys-devel/binutils-config/binutils-config-5.1-r9.ebuild diff --git a/sys-devel/binutils-config/files/ldwrapper.c b/sys-devel/binutils-config/files/ldwrapper.c index c9fe7e4bb3..00d4a69f73 100644 --- a/sys-devel/binutils-config/files/ldwrapper.c +++ b/sys-devel/binutils-config/files/ldwrapper.c @@ -392,18 +392,28 @@ main(int argc, char *argv[]) /* call the linker to figure out what options we can use :( * some Developer Tools ld64 versions: -* 12.0: 609 Big Sur, requirement for sdk_version +* Xcode ld64 dyld +* 3.1.1: 85.2.1Leopard 10.5, sdk_version unknown, +* need macosx_version_min +* 8.2.1: 274.2 xtools-2.2.4, sdk_version plus +* macosx_version_min +* 10.0: 409.12High Sierra 10.13 like above +* 12.0: 609 Big Sur 11, sdk_version only * 13.0: 711 * 13.3.1: 762 * 14.0: 819.6 * 14.2: 820.1 * 14.3.1: 857.1 -* 15.0: 907 Sanoma, platform_version argument -* all to be found from the PROJECT:ld64-650.9 bit from 1st line +* 15.0: 907 1022.1 Sanoma 23, platform_version iso sdk_version +* all to be found from the PROJECT:ld64-650.9 or +* PROJECT:dyld-1022.1 bit from the first line * NOTE: e.g. my Sanoma mac with CommandLineTools has 650.9 * which is not a version from any Developer Tools ?!? * Currently we need to distinguish XCode 15 according to * bug #910277, so we look for 907 and old targets before 12 */ +#define LD64_3_18500 +#define LD64_8_2 27400 +#define LD64_10_0 40900 #define LD64_12_0 60900 #define LD64_15_0 90700 snprintf(target, sizeof(target), "%s -v 2>&1", ld); @@ -412,8 +422,11 @@ main(int argc, char *argv[]) char *proj; long comp; if (fgets(target, sizeof(target), ld64out) != 0 && - (proj = strstr(target, "PROJECT:ld64-")) != NULL) + ((proj = strstr(target, "PROJECT:ld64-")) != NULL || +(proj = strstr(target, "PROJECT:dyld-")) != NULL)) { + /* we don't distinguish between ld64 and dyld here, for +* now it seems the numbers line up for our logic */ proj += sizeof("PROJECT:ld64-") - 1; comp = strtol(proj, , 10); /* we currently have no need to parse fractions, the @@ -446,10 +459,12 @@ main(int argc, char *argv[]) newargv[j++] = "macos"; newargv[j++] = darwin_dt; newargv[j++] = "0.0"; - } else if (ld64ver >= LD64_12_0) { + } else if (ld64ver >= LD64_8_2) { newargv[j++] = "-sdk_version"; newargv[j++] = darwin_dt; - } else { + } + + if (ld64ver < LD64_12_0) { newargv[j++] = "-macosx_version_min"; newargv[j++] = darwin_dt; }
[gentoo-commits] repo/proj/prefix:master commit in: sys-devel/binutils-config/files/, sys-devel/binutils-config/
commit: 48b366594ab49dd0be7a6807561f31e82d0d82d0 Author: Fabian Groffen gentoo org> AuthorDate: Tue Dec 22 21:17:02 2020 + Commit: Fabian Groffen gentoo org> CommitDate: Tue Dec 22 21:17:02 2020 + URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=48b36659 sys-devel/binutils-config: drop ~ppc-aix Bug: https://bugs.gentoo.org/760057 Package-Manager: Portage-3.0.12-prefix, Repoman-3.0.2 Signed-off-by: Fabian Groffen gentoo.org> .../binutils-config/binutils-config-5.1-r3.ebuild | 2 +- sys-devel/binutils-config/files/ldwrapper.c| 23 -- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/sys-devel/binutils-config/binutils-config-5.1-r3.ebuild b/sys-devel/binutils-config/binutils-config-5.1-r3.ebuild index fd26184271..dc28f6c5a4 100644 --- a/sys-devel/binutils-config/binutils-config-5.1-r3.ebuild +++ b/sys-devel/binutils-config/binutils-config-5.1-r3.ebuild @@ -13,7 +13,7 @@ WRAPPER_REV="${PV%%.*}.3.4" LICENSE="GPL-2" SLOT="0" -KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" IUSE="" # We also RDEPEND on sys-apps/findutils which is in base @system diff --git a/sys-devel/binutils-config/files/ldwrapper.c b/sys-devel/binutils-config/files/ldwrapper.c index 3ff5a0bc3e..7410afd334 100644 --- a/sys-devel/binutils-config/files/ldwrapper.c +++ b/sys-devel/binutils-config/files/ldwrapper.c @@ -210,7 +210,6 @@ main(int argc, char *argv[]) char is_cross = 0; char is_darwin = 0; char darwin_use_rpath = 1; - char is_aix = 0; char *p; size_t len; int i; @@ -269,7 +268,6 @@ main(int argc, char *argv[]) snprintf(ctarget, sizeof(ctarget), "%s", CHOST); is_darwin = strstr(ctarget, "-darwin") != NULL; - is_aix = strstr(ctarget, "-aix") != NULL; /* cannonicanise wrapper step2: strip CTARGET from wrapper */ len = strlen(ctarget); @@ -349,11 +347,6 @@ main(int argc, char *argv[]) /* add the 4 paths we want (-L + -R) */ newargc += 8; } - - if (is_aix) { - /* AIX ld accepts -R only with -bsvr4 */ - newargc++; /* -bsvr4 */ - } } /* account the original arguments */ @@ -396,19 +389,6 @@ main(int argc, char *argv[]) /* position k right after the original arguments */ k = j - 1 + argc; for (i = 1; i < argc; i++, j++) { - if (is_aix) { - /* AIX ld has this problem: -* $ /usr/ccs/bin/ld -bsvr4 -bE:xx.exp -bnoentry xx.o -* ld: 0706-005 Cannot find or open file: l -* ld:open(): No such file or directory -* Simplest workaround is to put -bsvr4 last. -*/ - if (strcmp(argv[i], "-bsvr4") == 0) { - --j; --k; - continue; - } - } - newargv[j] = argv[i]; if (is_cross || (is_darwin && !darwin_use_rpath)) @@ -484,9 +464,6 @@ main(int argc, char *argv[]) newargv[k++] = "-L" EPREFIX "/lib"; newargv[k++] = "-R" EPREFIX "/lib"; } - - if (is_aix) - newargv[k++] = "-bsvr4"; /* last one, see above */ } newargv[k] = NULL;
[gentoo-commits] repo/proj/prefix:master commit in: sys-devel/binutils-config/files/, sys-devel/binutils-config/
commit: 4b52e188057a6b59d3e48983f351bf44ae080081 Author: Fabian Groffen gentoo org> AuthorDate: Fri Nov 27 13:29:28 2020 + Commit: Fabian Groffen gentoo org> CommitDate: Fri Nov 27 13:38:59 2020 + URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=4b52e188 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 gentoo.org> ...-config-5.1-r2.ebuild => binutils-config-5.1-r3.ebuild} | 10 +- sys-devel/binutils-config/files/ldwrapper.c| 14 -- 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 similarity index 84% rename from sys-devel/binutils-config/binutils-config-5.1-r2.ebuild rename to 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 */ + 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"; }
[gentoo-commits] repo/proj/prefix:master commit in: sys-devel/binutils-config/files/, sys-devel/binutils-config/
commit: f1ad58d7b8db30325c5aa9bc89c130e26fbea594 Author: Fabian Groffen gentoo org> AuthorDate: Sun Oct 13 18:11:54 2019 + Commit: Fabian Groffen gentoo org> CommitDate: Sun Oct 13 18:11:54 2019 + URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f1ad58d7 sys-devel/binutils-config: experimental support for libmissing Package-Manager: Portage-2.3.68-prefix, Repoman-2.3.17 Signed-off-by: Fabian Groffen gentoo.org> sys-devel/binutils-config/Manifest | 1 - ...5.1-r1.ebuild => binutils-config-5.1-r2.ebuild} | 5 ++- sys-devel/binutils-config/files/ldwrapper.c| 51 +- 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/sys-devel/binutils-config/Manifest b/sys-devel/binutils-config/Manifest deleted file mode 100644 index a28d45bba6..00 --- a/sys-devel/binutils-config/Manifest +++ /dev/null @@ -1 +0,0 @@ -DIST binutils-config-ldwrapper-5.3.4.c 13467 BLAKE2B 132c497c59c1315c4d9e85c842fa5636aac5d96aa2db69e1f677c31cd8a509653589c178058285c4e2e72d5095734f6849969f9ff99edfe1794c69733b60047c SHA512 cd4f33e37b2cd9e66d2e80aec28bec56e3d5383f15018b20c1afccd00e74d5f8ac2c6c2d8dde0de4be36aeec1237e2cc9b07326bceb24b2ca819e54c65ae6478 diff --git a/sys-devel/binutils-config/binutils-config-5.1-r1.ebuild b/sys-devel/binutils-config/binutils-config-5.1-r2.ebuild similarity index 86% rename from sys-devel/binutils-config/binutils-config-5.1-r1.ebuild rename to sys-devel/binutils-config/binutils-config-5.1-r2.ebuild index 5cae4a9223..d104bf4fb7 100644 --- a/sys-devel/binutils-config/binutils-config-5.1-r1.ebuild +++ b/sys-devel/binutils-config/binutils-config-5.1-r2.ebuild @@ -9,7 +9,7 @@ DESCRIPTION="Utility to change the binutils version being used" HOMEPAGE="https://www.gentoo.org/; GIT_REV="edc0d44f70c27daebcc080ac5d08e8e191bccd95" WRAPPER_REV="${PV%%.*}.3.4" -SRC_URI="https://gitweb.gentoo.org/repo/proj/prefix.git/plain/sys-devel/binutils-config/files/ldwrapper.c?id=${GIT_REV} -> ${PN}-ldwrapper-${WRAPPER_REV}.c" +#SRC_URI="https://gitweb.gentoo.org/repo/proj/prefix.git/plain/sys-devel/binutils-config/files/ldwrapper.c?id=${GIT_REV} -> ${PN}-ldwrapper-${WRAPPER_REV}.c" LICENSE="GPL-2" SLOT="0" @@ -25,6 +25,7 @@ S=${WORKDIR} # NOTE: the ld wrapper is only enabled on rpath versions of prefix. src_prepare() { cp "${FILESDIR}"/${PN}-${PV} ./${PN} || die + cp "${FILESDIR}"/ldwrapper.c ./${PN}-ldwrapper-${WRAPPER_REV}.c || die if use prefix-guest; then epatch "${FILESDIR}/${PN}-5-ldwrapper.patch" fi @@ -42,7 +43,7 @@ src_compile() { $(tc-getCC) ${CPPFLAGS} ${CFLAGS} - -o ldwrapper "${DISTDIR}"/${PN}-ldwrapper-${WRAPPER_REV}.c + -o ldwrapper ${PN}-ldwrapper-${WRAPPER_REV}.c -DEPREFIX=\"${EPREFIX}\" -DCHOST=\"${CHOST}\" ${LDFLAGS} diff --git a/sys-devel/binutils-config/files/ldwrapper.c b/sys-devel/binutils-config/files/ldwrapper.c index 3ff52acc60..07dc6ebf2a 100644 --- a/sys-devel/binutils-config/files/ldwrapper.c +++ b/sys-devel/binutils-config/files/ldwrapper.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2017 Gentoo Foundation + * Copyright 1999-2019 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 * Authors: Fabian Groffen * Michael Haubenwallner @@ -58,13 +58,13 @@ find_real_ld(char **ld, size_t ldlen, const char verbose, const char is_cross, ldoverride = getenv("BINUTILS_CONFIG_LD"); if (ldoverride != NULL && *ldoverride != '\0') { if (verbose) - fprintf(stdout, "%s: using BINUTILS_CONFIG_LD=%s " + fprintf(stderr, "%s: using BINUTILS_CONFIG_LD=%s " "from environment\n", wrapper, ldoverride); snprintf(*ld, ldlen, "%s", ldoverride); return 0; } if (verbose) - fprintf(stdout, "%s: BINUTILS_CONFIG_LD not found in environment\n", + fprintf(stderr, "%s: BINUTILS_CONFIG_LD not found in environment\n", wrapper); /* Find ld in PATH, allowing easy PATH overrides. @@ -94,14 +94,14 @@ find_real_ld(char **ld, size_t ldlen, const char verbose, const char is_cross, /* glue it together */ snprintf(*ld, ldlen, "%.*s/%s", (int)(q - p), p, wrapper); if (verbose) - fprintf(stdout, "%s: trying from PATH: %s\n", + fprintf(stderr, "%s: trying from PATH: %s\n", wrapper, *ld); if (stat(*ld, ) == 0) return 0; } } if (verbose) - fprintf(stdout, "%s: linker not found in PATH\n", wrapper); +
[gentoo-commits] repo/proj/prefix:master commit in: sys-devel/binutils-config/files/, sys-devel/binutils-config/
commit: e3db9ab7035d02c9e902615b8745b86cd2360638 Author: Fabian Groffen gentoo org> AuthorDate: Sat Apr 7 19:43:06 2018 + Commit: Fabian Groffen gentoo org> CommitDate: Sat Apr 7 19:43:06 2018 + URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=e3db9ab7 sys-devel/binutils-config: stop breaking our gcc installs Package-Manager: Portage-2.3.18-prefix, Repoman-2.3.6 sys-devel/binutils-config/Manifest | 2 - .../binutils-config/binutils-config-5-r03.1.ebuild | 78 -- ...r03.2.ebuild => binutils-config-5-r03.5.ebuild} | 9 +-- sys-devel/binutils-config/files/binutils-config-5 | 7 +- 4 files changed, 10 insertions(+), 86 deletions(-) diff --git a/sys-devel/binutils-config/Manifest b/sys-devel/binutils-config/Manifest index 290abb8cfc..a28d45bba6 100644 --- a/sys-devel/binutils-config/Manifest +++ b/sys-devel/binutils-config/Manifest @@ -1,3 +1 @@ -DIST binutils-config-ldwrapper-5.3.1.c 8342 BLAKE2B 18658a8188acfcd7494981bd60f53590f5610c7ffd9173f223da740c09acd9ed40aaf911faa6f9a517e5e8779cbaaea9d4398679b7a3037655a7994d9c319345 SHA512 af21c1b9bb465990e8490641023403ec27e31bd69f94fc86572392285a540ddc25d59fd8f682c0cb2d2a84c5e33fea08bd0ec2cb52861147075ccfd5e18067b0 -DIST binutils-config-ldwrapper-5.3.2.c 11791 BLAKE2B 7284c1f201b581b87a3dccfd9c572e0e03fa81af1c72fcd4edce15c53c04329316aa20a1135f7b728e35b3551ebb418eacc599da6a4803924dfddf7fbccaf1be SHA512 5e0917d50ba1cb0daee71bdd225809579bfc0a129c7bed234346f17a21aec6a0cddde35d5bc598924e840c45d6f9e738fd09f969904ca5df6041d38e5e0f0c2e DIST binutils-config-ldwrapper-5.3.4.c 13467 BLAKE2B 132c497c59c1315c4d9e85c842fa5636aac5d96aa2db69e1f677c31cd8a509653589c178058285c4e2e72d5095734f6849969f9ff99edfe1794c69733b60047c SHA512 cd4f33e37b2cd9e66d2e80aec28bec56e3d5383f15018b20c1afccd00e74d5f8ac2c6c2d8dde0de4be36aeec1237e2cc9b07326bceb24b2ca819e54c65ae6478 diff --git a/sys-devel/binutils-config/binutils-config-5-r03.1.ebuild b/sys-devel/binutils-config/binutils-config-5-r03.1.ebuild deleted file mode 100644 index c42663d6d1..00 --- a/sys-devel/binutils-config/binutils-config-5-r03.1.ebuild +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="5" - -inherit eutils prefix - -DESCRIPTION="Utility to change the binutils version being used" -HOMEPAGE="https://www.gentoo.org/; -GIT_REV="d469b099b5e8aed45ff2edf78f91822b805440d3" -WRAPPER_REV="${PV}.3.1" -SRC_URI="https://gitweb.gentoo.org/repo/proj/prefix.git/plain/sys-devel/binutils-config/files/ldwrapper.c?id=${GIT_REV} -> ${PN}-ldwrapper-${WRAPPER_REV}.c" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="" - -# We also RDEPEND on sys-apps/findutils which is in base @system -RDEPEND="sys-apps/gentoo-functions - !https://www.gentoo.org/; -GIT_REV="e30f557eb73bff37366a44ebbbf4efdc0c616c58" -WRAPPER_REV="${PV}.3.2" +GIT_REV="edc0d44f70c27daebcc080ac5d08e8e191bccd95" +WRAPPER_REV="${PV}.3.4" SRC_URI="https://gitweb.gentoo.org/repo/proj/prefix.git/plain/sys-devel/binutils-config/files/ldwrapper.c?id=${GIT_REV} -> ${PN}-ldwrapper-${WRAPPER_REV}.c" LICENSE="GPL-2" @@ -29,6 +29,7 @@ src_prepare() { epatch "${FILESDIR}/${PN}-5-ldwrapper.patch" fi eprefixify ${PN} + eapply_user } src_configure() { diff --git a/sys-devel/binutils-config/files/binutils-config-5 b/sys-devel/binutils-config/files/binutils-config-5 index e6c5fac002..46eb2b21c4 100755 --- a/sys-devel/binutils-config/files/binutils-config-5 +++ b/sys-devel/binutils-config/files/binutils-config-5 @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Format of /etc/env.d/binutils/: @@ -159,7 +159,10 @@ switch_profile() { mkdir -p "${dstlib}" rm -rf "${ROOT}/${BINPATH_LINKS}"/ldscripts atomic_ln "${LIBPATH}/ldscripts" "${dstlib}" "ldscripts" - find -L "${dstlib}" -xtype l -name 'lib*' -exec rm -f {} + + # PREFIX LOCAL: we have gcc under dstlib here, and wiping symlinks + # is a very bad idea there, or our symlinked sonames disappear! + find -L "${dstlib}"/ldscripts -xtype l -name 'lib*' -exec rm -f {} + + # END PREFIX LOCAL # # Clean out old generated include symlinks
[gentoo-commits] repo/proj/prefix:master commit in: sys-devel/binutils-config/files/, sys-devel/binutils-config/
commit: f1c2d739d6990e43502251afd7dcb6854abf8ce9 Author: Fabian Groffen gentoo org> AuthorDate: Sat Nov 25 15:49:08 2017 + Commit: Fabian Groffen gentoo org> CommitDate: Sat Nov 25 15:49:08 2017 + URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f1c2d739 sys-devel/binutils-config: cleanup Package-Manager: Portage-2.3.13-prefix, Repoman-2.3.4 sys-devel/binutils-config/Manifest | 1 - .../binutils-config/binutils-config-3-r03.1.ebuild | 46 -- .../binutils-config/binutils-config-4-r01.1.ebuild | 59 --- .../binutils-config/binutils-config-4-r1.ebuild| 58 --- sys-devel/binutils-config/files/binutils-config-3 | 534 - sys-devel/binutils-config/files/binutils-config-4 | 475 -- .../files/binutils-config-4-aix-ld-svr4.patch | 89 .../files/binutils-config-4-ldwrapper.patch| 32 -- .../binutils-config-4-no-macosx-version-min.patch | 16 - sys-devel/binutils-config/metadata.xml | 7 +- 10 files changed, 4 insertions(+), 1313 deletions(-) diff --git a/sys-devel/binutils-config/Manifest b/sys-devel/binutils-config/Manifest deleted file mode 100644 index fc2e289920..00 --- a/sys-devel/binutils-config/Manifest +++ /dev/null @@ -1 +0,0 @@ -DIST toolchain-prefix-wrapper-0.3.1723.tar.xz 95352 SHA256 fdb4c2a82ddcee8330ea6274db02b78ddc921670f3184028f7bbc83b5054ea29 SHA512 308933057c0888bca929aedebae7b3a54cb355a31de2568ef59871d541440267c14815556b5d40e7049fc1e3d297a239dd247393248ff6413c7a8e189357ca27 WHIRLPOOL f04684e4c1717d2d2e5e3c1a86b3c68807047c83e35625bc3e99c1bc547c16b2e208a13a1e8bce5143ac2edc07b275439d0a61663ebab4e1437ea5d68d7a3db6 diff --git a/sys-devel/binutils-config/binutils-config-3-r03.1.ebuild b/sys-devel/binutils-config/binutils-config-3-r03.1.ebuild deleted file mode 100644 index 69677ed667..00 --- a/sys-devel/binutils-config/binutils-config-3-r03.1.ebuild +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/binutils-config-3-r3.ebuild,v 1.9 2012/07/29 18:36:13 armin76 Exp $ - -EAPI=3 - -inherit eutils toolchain-funcs prefix - -DESCRIPTION="Utility to change the binutils version being used - prefix version" -HOMEPAGE="http://www.gentoo.org/; -W_VER="0.3.1723" -SRC_URI="http://dev.gentoo.org/~grobian/distfiles/toolchain-prefix-wrapper-${W_VER}.tar.xz; - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="sunld" - -RDEPEND="userland_GNU? ( !http://www.gentoo.org/; -W_VER="0.3.1723" -SRC_URI="http://dev.gentoo.org/~grobian/distfiles/toolchain-prefix-wrapper-${W_VER}.tar.xz; - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="sunld" - -S=${WORKDIR}/toolchain-prefix-wrapper-${W_VER} - -# NOTE: the ld wrapper is only enabled on rpath versions of prefix. - -src_prepare() { - cp "${FILESDIR}"/${P} ./${PN} || die - if use prefix-guest; then - epatch "${FILESDIR}/${P}-ldwrapper.patch" - fi - eprefixify ${PN} - - # fix configure stupidity, until next release - sed -i -e 's/x10\.\[3456789\]/x10.*/' configure - epatch "${FILESDIR}"/${P}-no-macosx-version-min.patch - epatch "${FILESDIR}"/${P}-aix-ld-svr4.patch -} - -src_configure() { - if use prefix-guest; then - econf --with-macosx-version-min=${MACOSX_DEPLOYMENT_TARGET} \ - $(use_with sunld native-ld) - fi -} - -src_install() { - if use prefix-guest; then - use prefix-guest && \ - emake install DESTDIR="${D}" - fi - - dobin ${PN} - doman "${FILESDIR}"/${PN}.8 -} - -pkg_postinst() { - # refresh all links and the wrapper - if [[ ${ROOT%/} == "" ]] ; then - [[ -f ${EROOT}/etc/env.d/binutils/config-${CHOST} ]] \ - && binutils-config $(binutils-config --get-current-profile) - fi -} diff --git a/sys-devel/binutils-config/binutils-config-4-r1.ebuild b/sys-devel/binutils-config/binutils-config-4-r1.ebuild deleted file mode 100644 index b9720d00b8..00 --- a/sys-devel/binutils-config/binutils-config-4-r1.ebuild +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/binutils-config-3-r3.ebuild,v 1.9 2012/07/29 18:36:13 armin76 Exp $ - -EAPI=5 - -inherit eutils toolchain-funcs prefix - -DESCRIPTION="Utility to change the binutils version being used - prefix version" -HOMEPAGE="http://www.gentoo.org/; -W_VER="0.3.1723"
[gentoo-commits] repo/proj/prefix:master commit in: sys-devel/binutils-config/files/, sys-devel/binutils-config/
commit: 72ebd34b9821ad0b04bc98b7decf07c9588c7191 Author: Fabian Groffen gentoo org> AuthorDate: Sun Feb 14 13:48:51 2016 + Commit: Fabian Groffen gentoo org> CommitDate: Sun Feb 14 13:48:51 2016 + URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=72ebd34b sys-devel/binutils-config: first version of rewritten ldwrapper, bug #572390 Package-Manager: portage-2.2.20-prefix .../binutils-config/binutils-config-5-r2.ebuild| 40 ++-- .../files/binutils-config-5-ldwrapper.patch| 22 ++ sys-devel/binutils-config/files/ldwrapper.c| 252 + 3 files changed, 297 insertions(+), 17 deletions(-) diff --git a/sys-devel/binutils-config/binutils-config-5-r2.ebuild b/sys-devel/binutils-config/binutils-config-5-r2.ebuild index 3af562d..60c601e 100644 --- a/sys-devel/binutils-config/binutils-config-5-r2.ebuild +++ b/sys-devel/binutils-config/binutils-config-5-r2.ebuild @@ -8,49 +8,55 @@ inherit eutils prefix DESCRIPTION="Utility to change the binutils version being used" HOMEPAGE="https://www.gentoo.org/; -W_VER="0.3.1723" -SRC_URI="http://dev.gentoo.org/~grobian/distfiles/toolchain-prefix-wrapper-${W_VER}.tar.xz; LICENSE="GPL-2" SLOT="0" KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="sunld" # We also RDEPEND on sys-apps/findutils which is in base @system RDEPEND="sys-apps/gentoo-functions ! + */ + +#include +#include +#include +#include +#include +#include +#include + +/** + * 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. + * The wrapper will inject -L entries for: + * - EPREFIX/usr/CHOST/lib/gcc (when gcc) + * - EPREFIX/usr/CHOST/lib (when binutils) + * - EPREFIX/usr/lib + * - EPREFIX/lib + * On ELF platforms, the wrapper will then add -R (-rpath) entries for + * all -L entries found in the invocation to ensure the libraries found + * at link time will be found at runtime too. + */ + +#ifndef EPREFIX +# error EPREFIX must be defined! +#endif +#ifndef CHOST +# error CHOST must be defined! +#endif + + +static inline void +find_real_ld(char **ld, char verbose, char *wrapper) +{ + FILE *f = NULL; + char *ldoveride; + char *path; +#define ESIZ 1024 + char *e; + struct stat lde; + + /* respect the override in environment */ + ldoveride = getenv("BINUTILS_CONFIG_LD"); + if (ldoveride != NULL && *ldoveride != '\0') { + if (verbose) + fprintf(stdout, "%s: using BINUTILS_CONFIG_LD=%s " + "from environment\n", wrapper, ldoveride); + *ld = ldoveride; + return; + } + if (verbose) + fprintf(stdout, "%s: BINUTILS_CONFIG_LD not found in environment\n", + wrapper); + + if ((e = malloc(sizeof(char) * ESIZ)) == NULL) { + fprintf(stderr, "%s: out of memory allocating string for path to ld\n", + wrapper); + exit(1); + } + + /* find ld in PATH, allowing easy PATH overrides */ + path = getenv("PATH"); + if (path != NULL && *path != '\0') { + char *p; + char *q; + + for (p = path; (q = strchr(p, ':')) != NULL; p = q + 1) { + if (q) + *q = '\0'; + if (strstr(p, "/" CHOST "/binutils-bin/") != NULL) { + snprintf(e, ESIZ, "%s/%s", p, wrapper); + if (stat(e, ) == 0) { + *ld = e; + return; + } + } + if (!q) + break; + } + } + if (verbose) + fprintf(stdout, "%s: linker not found in PATH\n", wrapper); + + /* parse EPREFIX/etc/env.d/binutils/config-CHOST to get CURRENT, then +* consider $EPREFIX/usr/CHOST/binutils-bin/CURRENT where we should +* be able to find ld */ + if ((f = fopen(EPREFIX "/etc/env.d/binutils/config-" CHOST, "r")) != NULL) { + char p[ESIZ]; + while (fgets(p, ESIZ, f) != NULL) { + if (strncmp(p, "CURRENT=", strlen("CURRENT=")) == 0) { + char *q = p + strlen(p); + /* strip trailing whitespace (fgets at least includes +* the \n) */ + for (q--; isspace(*q); q--) +