d504817
--- support/configure.pl.orig	2018-11-17 17:48:40.685799971 -0700
d504817
+++ support/configure.pl	2018-11-17 17:54:51.057727807 -0700
d504817
@@ -976,6 +976,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
d504817
@@ -1005,6 +1006,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";
d504817
@@ -1668,10 +1671,15 @@ sub write_perl_specific_configuration_fi
9647ad1
       $no_warn .= " -Wno-literal-suffix";
9647ad1
    }
9647ad1
 
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;
9647ad1
    print $conf <<"---";
9647ad1
 PERL=$Config::Config{perlpath}
9647ad1
-CXXglueFLAGS=-I$Config::Config{archlibexp}/CORE $Config::Config{ccflags} -DPerlVersion=$PerlVersion $no_warn
9647ad1
-LIBperlFLAGS=-L$Config::Config{archlib}/CORE -lperl $Config::Config{ccdlflags}
9647ad1
+CXXglueFLAGS=-I$Config::Config{archlibexp}/CORE $GlueFLAGS -DPerlVersion=$PerlVersion $no_warn
9647ad1
+LIBperlFLAGS=-L$Config::Config{archlib}/CORE -lperl $PerlFLAGS
9647ad1
 ExtUtils=$Config::Config{privlib}/ExtUtils
9647ad1
 ---
9647ad1