On Sat, Dec 26, 2009 at 6:24 AM, Dr. David Kirkby
<[email protected]> wrote:
> 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.

How so?   What problems involving fat binaries are you refereeing to
here?    Is this something specific, or just a vague "gut feeling"?

Thanks for the tip below about GCC spec files.  I didn't know about that.

William

>
> 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
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

-- 
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

Reply via email to