Bug 20463 - Compile error when configure using --param arg=value in CFLAGS
Summary: Compile error when configure using --param arg=value in CFLAGS
Status: RESOLVED DUPLICATE of bug 17248
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: 2.23
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-13 06:56 UTC by Nadal Gonzalo García Zavala
Modified: 2016-08-15 19:50 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Last reconfirmed:
fweimer: security-


Attachments
GCC Version (623 bytes, text/plain)
2016-08-13 06:56 UTC, Nadal Gonzalo García Zavala
Details
config.log (8.84 KB, text/x-log)
2016-08-13 07:03 UTC, Nadal Gonzalo García Zavala
Details
configure (2.13 KB, text/plain)
2016-08-13 07:07 UTC, Nadal Gonzalo García Zavala
Details
build (4.15 KB, text/plain)
2016-08-13 07:08 UTC, Nadal Gonzalo García Zavala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nadal Gonzalo García Zavala 2016-08-13 06:56:50 UTC
Created attachment 9431 [details]
GCC Version

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

Result error:

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.

Thanks you
Comment 1 Nadal Gonzalo García Zavala 2016-08-13 07:03:23 UTC
Created attachment 9432 [details]
config.log
Comment 2 Nadal Gonzalo García Zavala 2016-08-13 07:07:17 UTC
Created attachment 9433 [details]
configure
Comment 3 Nadal Gonzalo García Zavala 2016-08-13 07:08:15 UTC
Created attachment 9434 [details]
build
Comment 4 Andreas Schwab 2016-08-13 12:09:30 UTC
Use --param=... instead.
Comment 5 Nadal Gonzalo García Zavala 2016-08-13 23:06:37 UTC
(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.

Thanks again.
Comment 6 Carlos O'Donell 2016-08-15 16:19:11 UTC
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 ***