be519eb
--- support/configure.pl.orig	2019-08-18 16:18:04.877818161 -0600
be519eb
+++ support/configure.pl	2019-08-18 16:22:18.491652323 -0600
be519eb
@@ -1000,6 +1000,7 @@ int main() {
9647ad1
    }
9647ad1
 
9647ad1
    $LDsharedFLAGS=$Config::Config{lddlflags};
9647ad1
+   $LDsharedFLAGS =~ s/ -specs=\S+redhat-hardened-cc1//g;
9647ad1
 
9647ad1
    if ($^O eq "darwin") {
9647ad1
       # MacOS magic again: remove multi-architecture options for fat binaries
be519eb
@@ -1029,6 +1030,8 @@ int main() {
9647ad1
 
9647ad1
       if ($options{callable} ne ".none.") {
9647ad1
          $LDcallableFLAGS="$LDsharedFLAGS $Config::Config{ldflags}";
9647ad1
+         $LDcallableFLAGS =~ s/ -specs=\S+redhat-hardened-ld//g;
9647ad1
+         $LDcallableFLAGS =~ s/ -Wl,-z,now//g;
9647ad1
          $LDsonameFLAGS = "-Wl,-soname,";
9647ad1
       } else {
9647ad1
          $LDcallableFLAGS="none";
be519eb
@@ -1721,10 +1724,17 @@ sub write_perl_specific_configuration_fi
be519eb
    my ($xsubpp) = grep { -e $_ } map { "$Config::Config{$_}/ExtUtils/xsubpp" } qw(privlib vendorlib);
be519eb
    my ($typemap) = grep { -e $_ } map { "$Config::Config{$_}/ExtUtils/typemap" } qw(privlib vendorlib);
9647ad1
 
be519eb
+   # Turn off the hardening flags
9647ad1
+   my $GlueFLAGS=$Config::Config{ccflags};
9647ad1
+   $GlueFLAGS =~ s/ -specs=\\S+redhat-hardened-cc1//g;
9647ad1
+   my $PerlFLAGS=$Config::Config{ccdlflags};
9647ad1
+   $PerlFLAGS =~ s/ -specs=\\S+redhat-hardened-ld//g;
9647ad1
+   $PerlFLAGS =~ s/ -Wl,-z,now//g;
be519eb
+
9647ad1
    print $conf <<"---";
9647ad1
 PERL=$Config::Config{perlpath}
d5274d9
-CXXglueFLAGS=$includePerlCore$Config::Config{archlibexp}/CORE $Config::Config{ccflags} -DPerlVersion=$PerlVersion $no_warn
9647ad1
-LIBperlFLAGS=-L$Config::Config{archlib}/CORE -lperl $Config::Config{ccdlflags}
d5274d9
+CXXglueFLAGS=$includePerlCore$Config::Config{archlibexp}/CORE $GlueFLAGS -DPerlVersion=$PerlVersion $no_warn
9647ad1
+LIBperlFLAGS=-L$Config::Config{archlib}/CORE -lperl $PerlFLAGS
be519eb
 ExtUtils_xsubpp=$xsubpp
be519eb
 ExtUtils_typemap=$typemap
9647ad1
 ---