This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: does -fstack-protector work for gcc 4.1 on Darwin 8?


On Wed, Aug 03, 2005 at 09:39:13PM -0400, Jack Howarth wrote:
>     Do you think I should be able to build gcc itself with the
> -fstack-protector flag and what is the most appropriate way to
> achieve that (ie brute force using a CFLAG or some configure
> flag)?

Considering that I don't think that self-building with 
-fstack-protector will ever be common, I don't think we
ought to spend too many brain cells on this.

The only way to bootstrap with -fstack-protector without
existing support in libc is to use a top-level bootstrap.

That said, I don't think this really addresses what you
want to accomplish...

> I am interested in doing this so that I can have a 
> libgfortran built with -fstack-protector to try to track down
> a potential stack corruption problem. Thanks in advance for any
> advice.

This should be as simple as 

  make all-gcc
  make all-target-libssp
  make CFLAGS_FOR_TARGET='-O -g -fstack-protector-all' all-target-libgfortran

and then explicitly build your test program with -fstack-protector-all
so that the right libraries get linked in.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]