samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
634 stars 241 forks source link

Remove -specs=...redhat-hardened... from Perl options #2138

Closed jmarshall closed 3 months ago

jmarshall commented 3 months ago

As encountered in #1322, Red Hat's ExtUtils::Embed returns CLAGS & LDFLAGS that produce a PIE position-independent executable. However libhts.a and the rest of bcftools's *.o files are not compiled as PIC, so linking fails as these other object files use relocations that are invalid for PIE.

While bcftools could link against libhts.so and compile the rest of its objects with -fpic, the logistics are non-trivial. And frankly it's not really reasonable for ExtUtils::Embed to insist that other applications follow Perl/Red Hat's policy re PIE. So it's easier to omit the redhat-hardened-cc1 and redhat-hardened-ld specs that set up for building a PIE executable, and there is already precedent in configure.ac to filter undesired options out of the ExtUtils::Embed output.

pd3 commented 3 months ago

Thank you