Ways to stop gcc from doing stuff we don't want

Robert Connolly robert at linuxfromscratch.org
Wed Sep 17 20:45:54 PDT 2008


While upgrading my desktop I added a couple new things to gcc's specs:
*cc1_options:
%{O3:%eDon't use -O3} %{march=i486:;:%{march=*:%eDon't set -march}}
This causes -O3, and -march={anything but i486}, to stop gcc, because I don't 
want to use buggy gcc optimizations.

*link_command:
%{static|Bstatic|shared|Bshareable|i|r|pie|nopie|fno-pic|fno-PIC|fno-pie|
fno-PIE:;:-pie --warn-shared-textrel --fatal-warnings }
This causes gcc to stop if 'ld' links something which is known to have 
textrel's. This one should be added to the book.

I'm in blfs, and both of these work perfectly so far.

I would like to have an option to warn about executable stack markings, but it 
doesn't exist so far. The alternative is to mark everything as nonexecstack, 
and break a small handfull of packages.

robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/hlfs-dev/attachments/20080917/f23f9454/attachment.sig>


More information about the hlfs-dev mailing list