commit:     2884a7d0131749f8c54c9dac3ee63ef62e4afbf1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 14 05:41:21 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jul 26 04:41:22 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2884a7d0

flag-o-matic.eclass: respect -fuse-ld in test-flags-CCLD

Closes: https://bugs.gentoo.org/832377
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/flag-o-matic.eclass | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 14dbd2bf37de..7319326c7ad8 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -574,6 +574,15 @@ _test-flag-PROG() {
                c+ld)
                        in_ext='c'
                        in_src='int main(void) { return 0; }'
+
+                       if is-ldflagq -fuse-ld=* ; then
+                               # Respect linker chosen by user so we don't
+                               # end up giving false results by checking
+                               # with default linker. bug #832377
+                               fuse_ld_value=$(get-flag -fuse-ld=*)
+                               cmdline_extra+=(${fuse_ld_value})
+                       fi
+
                        cmdline_extra+=(-xc)
                        ;;
        esac

Reply via email to