# New Ticket Created by Andy Dougherty # Please include the string: [perl #54120] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=54120 > This patch ensures that if we are using -fstack-protector, it is also propagated to lddlflags. I did not set lddlflags inside ccflags.U because that fooled the later dlsrc.U unit into thinking that lddlflags was already set. Without this patch, I was getting error messages like: Can't load '../lib/auto/File/Glob/Glob.so' for module File::Glob: ../lib/auto/File/Glob/Glob.so: undefined symbol: __stack_chk_fail_local at ../lib/XSLoader.pm line 64. (This was on Debian 4.0 on x86.) diff -r -u metaconfig/U/compline/ccflags.U metaconfig-andy/U/compline/ccflags.U --- metaconfig/U/compline/ccflags.U 2008-01-09 11:36:02.000000000 -0500 +++ metaconfig-andy/U/compline/ccflags.U 2008-05-13 09:17:36.000000000 -0400 @@ -230,7 +230,7 @@ # as that way the compiler can do the right implementation dependant # thing. (NWC) case "$gccversion" in - ?*) set stack-protector -fstack-protector 'ldflags="$ldflags -fstack-protector"' + ?*) set stack-protector -fstack-protector eval $checkccflag ;; esac @@ -377,6 +377,10 @@ case "$ccflags" in *-posix*) dflt="$dflt -posix" ;; esac + # See note above about -fstack-protector + case "$ccflags" in + *-fstack-protector*) dflt="$dflt -fstack-protector" ;; + esac ;; *) dflt="$ldflags";; esac diff -r -u metaconfig/U/perl/dlsrc.U metaconfig-andy/U/perl/dlsrc.U --- metaconfig/U/perl/dlsrc.U 2008-01-10 13:47:30.000000000 -0500 +++ metaconfig-andy/U/perl/dlsrc.U 2008-05-13 09:22:11.000000000 -0400 @@ -248,6 +248,16 @@ ''|' ') dflt='none' ;; esac + case "$ldflags" in + *-fstack-protector*) + case "$dflt" in + *-fstack-protector*) ;; # Don't add it again + *) dflt="$dflt -fstack-protector" ;; + esac + ;; + esac + + rp="Any special flags to pass to $ld to create a dynamically loaded library?" . ./myread case "$ans" in -- Andy Dougherty doughera@lafayette.eduThread Next