Skip to content

Commit df99320

Browse files
jmarshallpd3
authored andcommitted
Remove -specs=...redhat-hardened... from Perl options
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 objects 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. So it's easier to omit the redhat-hardened-cc1 and redhat-hardened-ld specs that set up for building a PIE executable. Fixes #1322.
1 parent 106f158 commit df99320

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ AS_IF([test "$enable_perl_filters" != "no" ], [dnl
245245
PERL_CCOPTS="`perl -MExtUtils::Embed -e ccopts | sed 's,-arch i386,,'`"
246246
PERL_LIBS="`perl -MExtUtils::Embed -e ldopts | sed 's,-arch i386,,'`"
247247
fi
248+
AS_CASE([$PERL_LIBS],
249+
[*redhat/redhat-hardened-ld*],[[
250+
PERL_CCOPTS="`echo $PERL_CCOPTS | sed 's,-specs=[a-z/]*/redhat/redhat-hardened-[a-z0-9]* *,,g'`"
251+
PERL_LIBS="`echo $PERL_LIBS | sed 's,-specs=[a-z/]*/redhat/redhat-hardened-[a-z0-9]* *,,g'`"]
252+
AC_MSG_NOTICE([removing -specs=...redhat-hardened... from Perl options])])
248253
AC_SUBST([PERL_CCOPTS])
249254
AC_SUBST([PERL_LIBS])
250255

0 commit comments

Comments
 (0)