Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 756337

Summary: dev-lang/perl: ExtUtils::MakeMaker incorrectly uses build host cflags
Product: Gentoo Linux Reporter: phkb <phkbphkbphkb>
Component: Current packagesAssignee: Gentoo Perl team <perl>
Status: RESOLVED DUPLICATE    
Severity: normal CC: esigra, jstein, kfm, mgorny, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 261375    
Attachments: irssi build.log
Makefile generated by MakeMaker

Description phkb 2020-11-24 15:00:23 UTC
Some packages using MakeMaker (some perl modules, irssi) to generate makefiles. The generated makefiles contains CFLAGS that were used to build perl. This is wrong for two reasons:

1) When building in another root for another machine, this will incorrectly use the build machine's CFLAGS. I'll attach to this bug an example of this, in which I build irssi on a machine with CFLAGS="-march=skylake" for a target machine with CFLAGS="-march=ivybridge".

2) When changing CFLAGS, one has to rebuild perl for the change to be taken into account for MakeMaker packages. Initially I had "-march=native" on my build machine. When I decided to build packages for other machines, I changed every make.conf so that the -march flag is the actual architecture, to make things easier. Thus, I had no -march=native anywhere anymore, yet irssi and perl modules where still using that, which was confusing. It turned out that I didn't rebuild perl, so it was still using my old CFLAGS.
Comment 1 phkb 2020-11-24 15:04:38 UTC
Created attachment 674731 [details]
irssi build.log

Note that in the src/perl/common subdirectory, the compiler commands contain both -march=ivybridge and -march=skylake.
Comment 2 phkb 2020-11-24 15:08:19 UTC
Created attachment 674734 [details]
Makefile generated by MakeMaker

Lines containing hardcoded perl build flags are:
- line 40, in LDDLFLAGS
- line 311, in OPTIMIZE
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-04-12 07:31:27 UTC
*** Bug 782406 has been marked as a duplicate of this bug. ***
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2021-05-13 11:26:44 UTC
No surprise.

*** This bug has been marked as a duplicate of bug 261375 ***