develooper Front page | perl.perl5.porters | Postings from November 2010

Re: [perl #79838] -fstack-protector enabled without any way to disable,even on platforms not supporting it

Thread Previous | Thread Next
Reini Urban
November 30, 2010 09:43
Re: [perl #79838] -fstack-protector enabled without any way to disable,even on platforms not supporting it
Message ID:
Andy Dougherty schrieb:
> On Mon, 29 Nov 2010, Eric Brine wrote:
>>        On Fri, 26 Nov 2010, perlbug @ plan9 . de wrote:>  so... please
>>        please please make -fstack-protector configurable somehow,
>>        >  better yet, don't override user-specified flags and/or improve
>>        the tets
>>        >  for platform support.
>> If Perl only supplements, then -fno-stack-protector should work, right? Does
>> it?
> Yes, good call.  Configure even actually already contains code to
> explicitly deal with this situation.  (Thanks, Nicholas!)  Explicitly
> adding -fno-stack-protector to ccflags will cause Configure to not add
> -fstack-protector.  This will fix the immediate problem.
> Still, I agree that a test file that made this happen automatically would
> be even better.  I just don't know what such a test might look like.

And just to add to the mix:
Using -fstack-protector twice, because it's in CCFLAGS and LDFLAGS, 
because we call the compiler and linker seperately sometimes 
(GNUMakefile vs. ExtUtils::Embed), will cause a gcc crash.

So if I fold the compiler and linker flags together with the typical 
compile+link command, I explicitly have to remove -fstack-protector from 
LDFLAGS; in B::C cc_harness.

$ perl -V:ccflags -V:ldflags
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include';
ldflags=' -Wl,--enable-auto-import -Wl,--export-all-symbols 
-Wl,--enable-auto-image-base -fstack-protector -L/usr/local/lib';

Reini Urban

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About