This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: does -fstack-protector work for gcc 4.1 on Darwin 8?
- From: Richard Henderson <rth at redhat dot com>
- To: Jack Howarth <howarth at bromo dot msbb dot uc dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 3 Aug 2005 20:48:51 -0700
- Subject: Re: does -fstack-protector work for gcc 4.1 on Darwin 8?
- References: <20050804013913.DE1101DC06D@bromo.msbb.uc.edu>
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~