commit: c4e911da66c918bd0944d1457776b82260657cd6 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Fri Jul 21 22:23:15 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Jul 21 23:23:12 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4e911da
toolchain-funcs.eclass: cleanup old gcc/clang logic in tc-ld-force-bfd Signed-off-by: Sam James <sam <AT> gentoo.org> eclass/toolchain-funcs.eclass | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 2f5ed29e875d..e194342f7bb5 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -543,25 +543,17 @@ tc-ld-force-bfd() { # Set up LDFLAGS to select bfd based on the gcc / clang version. local fallback="true" - if tc-is-gcc; then - local major=$(gcc-major-version "$@") - local minor=$(gcc-minor-version "$@") - if [[ ${major} -gt 4 ]] || [[ ${major} -eq 4 && ${minor} -ge 8 ]]; then - # gcc-4.8+ supports -fuse-ld directly. - export LDFLAGS="${LDFLAGS} -fuse-ld=bfd" - fallback="false" - fi - elif tc-is-clang; then - local major=$(clang-major-version "$@") - local minor=$(clang-minor-version "$@") - if [[ ${major} -gt 3 ]] || [[ ${major} -eq 3 && ${minor} -ge 5 ]]; then - # clang-3.5+ supports -fuse-ld directly. - export LDFLAGS="${LDFLAGS} -fuse-ld=bfd" - fallback="false" - fi + 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