commit:     6eb964b504c3aef2192403cbf383ae75d46990ff
Author:     Alfred Persson Forsberg <cat <AT> catcream <DOT> org>
AuthorDate: Thu Mar  9 00:21:37 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 11 17:23:20 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6eb964b5

perl-module.eclass: Fix linking with ld.lld

If LD is not specified then CCLD will be used as the linker.
Setting CCLD to CC makes it correctly use LDFLAGS.

Bug: https://bugs.gentoo.org/261375
Closes: https://bugs.gentoo.org/882373
Closes: https://bugs.gentoo.org/894608
Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org>
Closes: https://github.com/gentoo/gentoo/pull/30009
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/perl-module.eclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
index d4f6bdc5191e..867c15225789 100644
--- a/eclass/perl-module.eclass
+++ b/eclass/perl-module.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: perl-module.eclass
@@ -21,11 +21,11 @@
 
 case ${EAPI} in
        7)
-               inherit multiprocessing perl-functions
+               inherit multiprocessing perl-functions toolchain-funcs
                PERL_EXPF="src_prepare src_configure src_compile src_test 
src_install"
                ;;
        8)
-               inherit multiprocessing perl-functions readme.gentoo-r1
+               inherit multiprocessing perl-functions readme.gentoo-r1 
toolchain-funcs
                PERL_EXPF="src_prepare src_configure src_compile src_test 
src_install"
                ;;
        *)
@@ -209,6 +209,10 @@ perl-module_src_prepare() {
 perl-module_src_configure() {
        debug-print-function ${FUNCNAME} "$@"
 
+       # Perl runs LD with LDFLAGS
+       export CCLD=$(tc-getCC)
+       unset LD
+
        perl_check_env
 
        perl_set_version

Reply via email to