Re: gcc-4.1.1: default enabled stack-protector does not work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, 2007-01-08 at 22:01 +0100, Steffen Wendzel wrote: 
> Hi,
> 
> I compiled my gcc-4.1.1 with
> 
> ./configure --prefix=/usr --enable-stack-protector-all \
> --enable-shared --enable-threads=poxis --enable-__cxa_atexit \
> --disable-checking --with-gnu-ld --verbose --target=i486-hardened-linux
> --host=i486-hardened-linux --enable-libstdcpp
> 
> My gcc -v sais:
> Using built-in specs.
> Target: i486-hardenedlinux
> Configured wit: ../gcc-4.1.1/configure --prefix=/usr --enable-stack-protector-all
> --enable-shared --enable-threads=poxis --enable-__cxa_atexit --disable-checking
> --with-gnu-ld --verbose --target=i486-hardened-linux --host=i486-hardened-linux
> --enable-libstdcpp
> Thread model: posix
> gcc version 4.1.1
> 
> My problem is, that my gcc does not enable -fstack-protector-all by default (but
> I used --enable-stack-protector-all):
> 
> $ cat conftest.c
> #include <stdio.h>
> int main() {
>      printf("%i\n", __SSP_ALL__);
>      return 0;
> }
> $ gcc -o conftest conftest.c
> conftest.c: In function 'main':
> conftest.c:3: error: '__SSP_ALL__' undeclared (first use in this function)
> ...
> $ gcc -o conftest -fstack-protector-all conftest.c
> $ ./conftest
> 2
> 
> I don't understand why I need to enable -fstack-protector-all by hand.
> 
AFAIK turn on -fstack-protector by default is a specific patch named
gcc-ssp-default applied by default to Ubuntu. ( see:
https://wiki.ubuntu.com/GccSsp )

Also Debian distributes gcc source package (like gcc-4.1-source.deb)
with gcc-ssp-on patch, but it isn't applied by default to binary
package.

But in the oficial gcc distribution --enable-stack-protector-all I think
that it hasn't any effect.

Regards,
Álvaro


> regards
> --Steffen
> 


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux