Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 882373 - dev-perl/XS-Parse-Keyword fails to build on LLVM system
Summary: dev-perl/XS-Parse-Keyword fails to build on LLVM system
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal trivial (vote)
Assignee: Akinori Hattori
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-21 11:37 UTC by foearb
Modified: 2023-03-11 17:23 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
compiler-gcc-lto (file_882373.txt,452 bytes, text/plain)
2022-11-21 11:38 UTC, foearb
Details
emerge --info XS-Parse-Keyword (file_882373.txt,6.95 KB, text/plain)
2022-11-21 11:39 UTC, foearb
Details
build.log (file_882373.txt,2.06 KB, text/plain)
2022-11-21 11:40 UTC, foearb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description foearb 2022-11-21 11:37:41 UTC
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
Comment 1 foearb 2022-11-21 11:38:17 UTC
Created attachment 835493 [details]
compiler-gcc-lto
Comment 2 foearb 2022-11-21 11:39:42 UTC
Created attachment 835495 [details]
emerge --info XS-Parse-Keyword
Comment 3 foearb 2022-11-21 11:40:49 UTC
Created attachment 835497 [details]
build.log
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-22 05:34:03 UTC
Please make sure that dev-lang/perl was built with the same *FLAGS and compiler.
Comment 5 foearb 2022-11-22 13:03:52 UTC
I did, I also unmerge all dev-perl* and virtual/perl-* packages and reinstalled them, still no success.
Comment 6 Han Gao 2023-02-10 17:03:03 UTC
This bug still exists on arm64-llvm.
Comment 8 Han Gao 2023-02-11 05:31:53 UTC
I use LD=clang to pass it.
Comment 9 Larry the Git Cow gentoo-dev 2023-03-11 17:23:27 UTC
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(-)