Consider the following additional specs file, test.specs: *cpp: + -I testing Using that to preprocess a trivial C++ file (containing just an empty main()) produces the following output (Note that "-I testing" is missing): ****************** [cppbug]$ cpp -v -specs=test.specs t.cc Reading specs from /share/local/lang/gcc401-sol8/bin/../lib/gcc/sparc-sun-solaris2.8/4.0.1/specs Reading specs from test.specs Target: sparc-sun-solaris2.8 Configured with: ../../gcc-4.0.1/configure --prefix=/usr/local/lang/gcc401-sol8 --enable-shared --with-local-prefix=/opt/local --enable-cpp --enable-threads=posix --with-gnu-ld --with-ld=/usr/local/lang/gcc401-sol8/bin/ld --with-gnu-as --with-as=/usr/local/lang/gcc401-sol8/bin/as --disable-nls --disable-multilib --enable-languages=c,c++ --enable-c99 Thread model: posix gcc version 4.0.1 /share/local/lang/gcc401-sol8/bin/../libexec/gcc/sparc-sun-solaris2.8/4.0.1/cc1plus -E -quiet -v -iprefix /share/local/lang/gcc401-sol8/bin/../lib/gcc/sparc-sun-solaris2.8/4.0.1/ t.cc -mcpu=v7 ... (rest of output omitted) ***************** For C preprocessing, the -I option is added properly (the last line): ***************** [cppbug]$ cpp -v -specs=test.specs t.c Reading specs from /share/local/lang/gcc401-sol8/bin/../lib/gcc/sparc-sun-solaris2.8/4.0.1/specs Reading specs from test.specs Target: sparc-sun-solaris2.8 Configured with: ../../gcc-4.0.1/configure --prefix=/usr/local/lang/gcc401-sol8 --enable-shared --with-local-prefix=/opt/local --enable-cpp --enable-threads=posix --with-gnu-ld --with-ld=/usr/local/lang/gcc401-sol8/bin/ld --with-gnu-as --with-as=/usr/local/lang/gcc401-sol8/bin/as --disable-nls --disable-multilib --enable-languages=c,c++ --enable-c99 Thread model: posix gcc version 4.0.1 /share/local/lang/gcc401-sol8/bin/../libexec/gcc/sparc-sun-solaris2.8/4.0.1/cc1 -E -quiet -v -iprefix /share/local/lang/gcc401-sol8/bin/../lib/gcc/sparc-sun-solaris2.8/4.0.1/ -idirafter /opt/local/include -I testing t.c -mcpu=v7 **************** My linux (i686-pc-linux-gnu) build properly addes the options from *cpp in both cases. This bug does not only affect the cpp command but also normal C ja C++ compilations in the sun environment.
SPECs are really internal to GCC.
Subject: Re: *cpp specs file options are sometimes ignored in Sun builds pinskia at gcc dot gnu dot org wrote: >------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-12 13:31 ------- >SPECs are really internal to GCC. > > > ? I am not sure I understand you reply. We have to provide additional system-wide compiler flags for gcc (-I include paths, linker options etc.). We are using the specs file for that purpose, and I understood from the documentation that this is still possible in 4.0.1 by using the -dumpspecs option to get a copy of the internal specs file, and then modify that. Is there something wrong with this approach?
You can set env variables per user. See <http://gcc.gnu.org/onlinedocs/gcc-4.0.1/gcc/Environment-Variables.html#Environment- Variables>
(In reply to comment #3) > You can set env variables per user. Are you saying that specs files and specs options are not supported in current gcc and that they should not be used for any purpose?
(In reply to comment #4) > (In reply to comment #3) > > You can set env variables per user. > > Are you saying that specs files and specs options are not supported in current > gcc and that they should not be used for any purpose? No what I am saying is that they are not designed for what you are doing.
Indeed.