[SLOF] FLAG is not passed correctly to the compiler

Segher Boessenkool segher at kernel.crashing.org
Fri Jun 23 06:40:01 AEST 2017


On Thu, Jun 22, 2017 at 05:05:51PM -0300, Murilo Opsfelder Araújo wrote:
> The FLAG variable defined in board-qemu/config passes "-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C " (with the quotes) to gcc, which ends up ignoring some macro definitions (only the first RTAS_NVRAM is defined).

> $ gcc "-DFOO -DBAR" -o test test.c
> $ ./test                          
> FOO defined

And it defines FOO to the string "-DBAR", because you explicitly asked
for that!

> When quotes are removed, then both FOO and BAR macros are defined (the expected behaviour):

It is also fine if you do

FLAG="-DFOO -DBAR" ; gcc $FLAG -o test test.c

(because word splitting is done when the substitution is done).


What is the actual command that causes the problem?  It isn't clear
to me from your mail.


Segher


More information about the SLOF mailing list