Blob Blame History Raw
--- support/configure.pl.orig	2019-03-06 18:55:42.626024657 -0700
+++ support/configure.pl	2019-03-06 18:59:33.784308363 -0700
@@ -997,6 +997,7 @@ int main() {
    }
 
    $LDsharedFLAGS=$Config::Config{lddlflags};
+   $LDsharedFLAGS =~ s/ -specs=\S+redhat-hardened-cc1//g;
 
    if ($^O eq "darwin") {
       # MacOS magic again: remove multi-architecture options for fat binaries
@@ -1026,6 +1027,8 @@ int main() {
 
       if ($options{callable} ne ".none.") {
          $LDcallableFLAGS="$LDsharedFLAGS $Config::Config{ldflags}";
+         $LDcallableFLAGS =~ s/ -specs=\S+redhat-hardened-ld//g;
+         $LDcallableFLAGS =~ s/ -Wl,-z,now//g;
          $LDsonameFLAGS = "-Wl,-soname,";
       } else {
          $LDcallableFLAGS="none";
@@ -1713,11 +1716,16 @@ sub write_perl_specific_configuration_fi
 
    # Xcode 10 deeply hides perl headers at unpredictable locations, it requires a special clang option to find them
    my $includePerlCore = defined($XcodeVersion) && v_cmp($XcodeVersion, "10.0") >= 0 && $Config::Config{perlpath} eq "/usr/bin/perl" ? "-iwithsysroot " : "-I";
+   my $GlueFLAGS=$Config::Config{ccflags};
+   $GlueFLAGS =~ s/ -specs=\\S+redhat-hardened-cc1//g;
+   my $PerlFLAGS=$Config::Config{ccdlflags};
+   $PerlFLAGS =~ s/ -specs=\\S+redhat-hardened-ld//g;
+   $PerlFLAGS =~ s/ -Wl,-z,now//g;
 
    print $conf <<"---";
 PERL=$Config::Config{perlpath}
-CXXglueFLAGS=$includePerlCore$Config::Config{archlibexp}/CORE $Config::Config{ccflags} -DPerlVersion=$PerlVersion $no_warn
-LIBperlFLAGS=-L$Config::Config{archlib}/CORE -lperl $Config::Config{ccdlflags}
+CXXglueFLAGS=$includePerlCore$Config::Config{archlibexp}/CORE $GlueFLAGS -DPerlVersion=$PerlVersion $no_warn
+LIBperlFLAGS=-L$Config::Config{archlib}/CORE -lperl $PerlFLAGS
 ExtUtils=$Config::Config{privlib}/ExtUtils
 ---