stack-protector flag invalid on newer gcc?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

stack-protector flag invalid on newer gcc?

Post by earlz »

Hi, this is my version of gcc

Code: Select all

Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)
This is on a server, so I can't just build and install a different gcc..

Anyway I get

Code: Select all

cc1: error: unrecognized command line option "-fno-stack-protector"
Although this flag works perfectly fine with my older gcc on my workstation

Code: Select all

Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd4.5/3.3.5/specs
Configured with:
Thread model: single
gcc version 3.3.5 (propolice)
is there like a new -fno-stack-protector flag or something? or is my gcc just heavily patched to include "new" features(newer than what is on my server)

I really do not know how to detect if that flag works and if so then use it(I expect that would take some autoconf crap.. which I don't feel like dealing with)
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: stack-protector flag invalid on newer gcc?

Post by Brynet-Inc »

As I've mentioned to you a couple times off the forum, OpenBSD's version of GCC is customized.. see gcc-local(1).

The stack protector was originally a 3rd party patch called "ProPolice", newer versions of GCC/binutils include something similar.. but it's not enabled by default.

http://en.wikipedia.org/wiki/Buffer_ove ... oPolice.29
http://www.research.ibm.com/trl/projects/security/ssp/

You really should be building a cross-compiler on both your remote system and your home systems, it's not that hard..

http://wiki.osdev.org/GCC_Cross-Compiler
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: stack-protector flag invalid on newer gcc?

Post by bewing »

That is, if you have a big enough local user diskspace quota.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: stack-protector flag invalid on newer gcc?

Post by earlz »

bewing wrote:That is, if you have a big enough local user diskspace quota.
Well I have 100G of space.. I was just too lazy to build a cross-compiler..

If I really must build a cross-compiler though, I'd rather just take PCC and use it, as it is much smaller and light weight, and my OS has support for it(I regularly build with both PCC and GCC on my workstation.. I like building with PCC as it is like 10 seconds faster)
Post Reply