dev-perl/XS-Parse-Keyword failes to build with LLVM with the following error message: --- ld.lld: error: unknown argument '-pipe' ld.lld: error: unknown argument '-flto=thin' ld.lld: error: unknown argument '-fno-strict-aliasing' ld.lld: error: unknown argument '-Wl,-O1' ld.lld: error: unknown argument '-Wl,--as-needed' ld.lld: error: unknown argument '-fuse-ld=lld' ld.lld: error: unknown argument '-rtlib=compiler-rt' ld.lld: error: unknown argument '-Wl,--as-needed' ld.lld: error: unknown emulation: arch=native --- So ld.ldd complains about all of my CFLAGS normally passed to Clang. Secondly changing the environment to a GCC based environment changes the output error to the following: --- cc1: error: unrecognized argument to ‘-flto=’ option: ‘thin’ cc1: error: unrecognized argument to ‘-flto=’ option: ‘thin’ --- So it seems like the CFLAGS set in my *compiler-gcc-lto* environment do not override the ones set by the llvm-profile. I have looked into the perl-module.eclass but I don't understand the build process completly, but I tried to run the compilation commands manually: --- ebuild `equery w XS-Parse-Keyword` clean prepare cd /var/tmp/portage/dev-perl/XS-Parse-Keyword-0.250.0/work/XS-Parse-Keyword-0.250 perl Build.PL ./Build build --- Compiles with all my CFLAGS. I guess I'm not doing something done by the perl-module.eclass
Created attachment 835493 [details] compiler-gcc-lto
Created attachment 835495 [details] emerge --info XS-Parse-Keyword
Created attachment 835497 [details] build.log
Please make sure that dev-lang/perl was built with the same *FLAGS and compiler.
I did, I also unmerge all dev-perl* and virtual/perl-* packages and reinstalled them, still no success.
This bug still exists on arm64-llvm.
https://github.com/gentoo/gentoo/blob/master/profiles/features/llvm/make.defaults#L10 use LD to override linker
I use LD=clang to pass it.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6eb964b504c3aef2192403cbf383ae75d46990ff commit 6eb964b504c3aef2192403cbf383ae75d46990ff Author: Alfred Persson Forsberg <cat@catcream.org> AuthorDate: 2023-03-09 00:21:37 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-03-11 17:23:20 +0000 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@catcream.org> Closes: https://github.com/gentoo/gentoo/pull/30009 Signed-off-by: Sam James <sam@gentoo.org> eclass/perl-module.eclass | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)