This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
gcc-4.1.1: default enabled stack-protector does not work
- From: Steffen Wendzel <cdp_xe at gmx dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 8 Jan 2007 22:01:15 +0100
- Subject: gcc-4.1.1: default enabled stack-protector does not work
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.
regards
--Steffen