Created attachment 9431 [details]
I have obtained my custom cflags, trough a script that shows the output of gcc and -march=native when it call cc1. In these cflags, are cpu-specific options, like --param l1-cache-size=512.
When i use these cflags, i get the error below, where i see that cflags are very similar ( almost duplicated , maybe due to the $(CFLAGS) $(CPPFLAGS) like lines in Makerules and stuff ).
However, the first block of cflags, miss the --param parts, and put one before.
Here a simplification:
when running gcc -S -o ..etc
#First (missing) block of C[XX]FLAGS:
-std=gnu11 -fgnu89-inline --param -O2 -Wall -Wundef l1-cache-line-size=32 l1-cache-size=16 l2-cache-size=256
#Second (valid) block of C[XX]FLAGS:
-std=gnu11 -fgnu89-inline -O2 -Wall -Wundef --param l1-cache-line-size=32 --param l1-cache-size=16 --param l2-cache-size=256
i686-pc-linux-gnu-gcc: error: l1-cache-line-size=32: No such file or directory
i686-pc-linux-gnu-gcc: error: l1-cache-size=16: No such file or directory
i686-pc-linux-gnu-gcc: error: l2-cache-size=256: No such file or directory
Note: I now that my custom CFLAGS are some discouraged, however, the flags related to de issue ( --param ) are the same that gcc uses.
I'm replacing -march=native by gcc flags, by enable my compiler wrapper (icecream) to distribute the workload, but the same results are obtained without the wrapper.
Created attachment 9432 [details]
Created attachment 9433 [details]
Created attachment 9434 [details]
Use --param=... instead.
(In reply to Andreas Schwab from comment #4)
> Use --param=... instead.
Thanks you. Should i change the status of the bug?
Only for curiosity, how do you know this alternative syntax?. I searched without sucess.
This is bug 17248. That glibc sorts CFLAGs breaking --param ordering.
The "alternate" format which is Andreas' suggestion is discussed in the getopt man page.
A long option normally begins with '--' followed by the long option
name. If the option has a required argument, it may be written
directly after the long option name, separated by '=', or as the next
argument (i.e. separated by whitespace on the command line). If the
option has an optional argument, it must be written directly after the
long option name, separated by '=', if present (if you add the '=' but
nothing behind it, it is interpreted as if no argument was present;
this is a slight bug, see the BUGS). Long options may be abbreviated,
as long as the abbreviation is not ambiguous.
One more alternative is to set CC or CXX with the parameters you need e.g. export CC="gcc -Wl,--build-id=none --param l1-cache-line-size=32" which works because CC isn't sorted.
*** This bug has been marked as a duplicate of bug 17248 ***