The following might be useful to some, if you want to change the behavior of
gcc
by adding options globally, irrespective of whether they given when compiling a
file. It might allow for the easier creation of a 'fat binary' which I believe
is causing problems on some platforms.
I was keen to find a way of getting gcc to display all warnings, even if -Wall
is not on the command line. I asked on the gcc mailing list how to do this and
received an answer.
You can create a 'specs' file, which enables one to change gcc's behaviour.
Create the specs file with:
gcc -dumpspecs > "<prefix>/lib/gcc/<platform>/<gcc-version>/specs"
Edit the specs file just created, and under the appropriate section (in this
case cpp for the pre-processor), and append the required option.
In my case
*cpp:
%{,assembler-with-cpp:-P} %(cpp_subtarget)
was changed to
*cpp:
%{,assembler-with-cpp:-P} %(cpp_subtarget) -Wall
Now, all compiler warnings are displayed, irrespective of whether -Wall is
added
or not.
Depending on where the option goes to (in this case the C preprocessor), it
needs to be added on a different section of the specs file. There are sections
for the assembler, linker, compiler etc.
I suspect you could force gcc to build for a specific processor - either for
your own processor to optimise performance, or for an old processor to create a
'fat binary'. I've not tried this I must admit. If a part of Sage tries to
force
the assembler to create files for processor A, and you try to force it to
create
for type B, I'm not sure what would happen.
There's more about using the specs file at
http://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html
and
http://www.mingw.org/wiki/SpecsFileHOWTO
Dave
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org