summaryrefslogtreecommitdiff
path: root/eclass/toolchain-funcs.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-07-30 22:42:58 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-07-30 22:42:58 +0100
commit3b4199328e240d392ef1f03900219cb88bdafcff (patch)
tree06007a008d485a5e0a169f2807b68f456e9df1b3 /eclass/toolchain-funcs.eclass
parentaca0af8133e724b7edf0b5c6efe12c39077a3dc9 (diff)
gentoo auto-resync : 30:07:2023 - 22:42:58
Diffstat (limited to 'eclass/toolchain-funcs.eclass')
-rw-r--r--eclass/toolchain-funcs.eclass22
1 files changed, 1 insertions, 21 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index e194342f7bb5..e28f6148ddc1 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -534,37 +534,17 @@ tc-ld-force-bfd() {
ewarn "Forcing usage of the BFD linker"
# Set up LD to point directly to bfd if it's available.
+ local ld=$(tc-getLD "$@")
# We need to extract the first word in case there are flags appended
# to its value (like multilib), bug #545218.
- local ld=$(tc-getLD "$@")
local bfd_ld="${ld%% *}.bfd"
local path_ld=$(type -P "${bfd_ld}" 2>/dev/null)
[[ -e ${path_ld} ]] && export LD=${bfd_ld}
# Set up LDFLAGS to select bfd based on the gcc / clang version.
- local fallback="true"
if tc-is-gcc || tc-is-clang ; then
export LDFLAGS="${LDFLAGS} -fuse-ld=bfd"
fi
-
- if [[ ${fallback} == "true" ]] ; then
- # TODO: Clean this up, or is it useful for when the compiler can't
- # be detected or for rubbish shims? Might be helpful for cases like
- # when porting to new linker which GCC doesn't yet recognise (less
- # of a problem for Clang as it accepts absolute paths), like was
- # the case for mold.
- #
- # <=gcc-4.7 and <=clang-3.4 require some coercion.
- # Only works if bfd exists.
- if [[ -e ${path_ld} ]] ; then
- local d="${T}/bfd-linker"
- mkdir -p "${d}"
- ln -sf "${path_ld}" "${d}"/ld
- export LDFLAGS="${LDFLAGS} -B${d}"
- else
- die "unable to locate a BFD linker"
- fi
- fi
}
# @FUNCTION: _tc-has-openmp