[SLOF] FLAG is not passed correctly to the compiler

Murilo Opsfelder Araújo muriloo at linux.vnet.ibm.com
Fri Jun 23 06:51:13 AEST 2017


On 06/22/2017 05:40 PM, Segher Boessenkool wrote:
> 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.

Here are some extracts from a slof build (make qemu V=2):

gcc -m64 -mbig -mabi=elfv1 -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float -fno-strict-aliasing -mno-altivec -mabi=no-altivec -fno-stack-protector -Wall -Wmissing-prototypes -Wstrict-prototypes -I../libc/include -DCPU_PPCP7 "-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C " -I/builddir/build/BUILD/SLOF/board-qemu/include -I/builddir/build/BUILD/SLOF/include/ppcp7 -I. -I../../include  -c -o nvram.o nvram.c

gcc -m64 -mbig -mabi=elfv1 -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float -fno-strict-aliasing -mno-altivec -mabi=no-altivec -fno-stack-protector -Wall -Wmissing-prototypes -Wstrict-prototypes -I../libc/include -DCPU_PPCP7 "-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C " -I/builddir/build/BUILD/SLOF/board-qemu/include -I/builddir/build/BUILD/SLOF/include/ppcp7 -I. -I../../include  -c -o envvar.o envvar.c

gcc -m64 -mbig -mabi=elfv1 -I../libc/include -DCPU_PPCP7 -I/builddir/build/BUILD/SLOF/board-qemu/include -I. -I../../include "-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C "  -DCPU_PPCP7 -Wa,-mregnames -c bootmsg_lvl.S -o bootmsg_lvl.o

gcc -m64 -mbig -mabi=elfv1 -I../libc/include -DCPU_PPCP7 -I/builddir/build/BUILD/SLOF/board-qemu/include -I/builddir/build/BUILD/SLOF/include -I/builddir/build/BUILD/SLOF/include/ppcp7 "-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C "  -DCPU_PPCP7 -Wa,-mregnames -c hvcall.S -o hvcall.o

gcc -m64 -mbig -mabi=elfv1 -I../libc/include -DCPU_PPCP7 -I/builddir/build/BUILD/SLOF/board-qemu/include -I/builddir/build/BUILD/SLOF/include -I/builddir/build/BUILD/SLOF/include/ppcp7 "-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C "  -DCPU_PPCP7 -Wa,-mregnames -c hvcall.S -o hvcall.o

gcc -m64 -mbig -mabi=elfv1 -I../libc/include -DCPU_PPCP7 -I/builddir/build/BUILD/SLOF/board-qemu/include -I/builddir/build/BUILD/SLOF/include -I/builddir/build/BUILD/SLOF/include/ppcp7 "-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C "  -DCPU_PPCP7 -Wa,-mregnames -c hvcall.S -o hvcall.o

gcc -m64 -mbig -mabi=elfv1 -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float -fno-strict-aliasing -mno-altivec -mabi=no-altivec -fno-stack-protector -Wall -Wmissing-prototypes -Wstrict-prototypes -fno-builtin "-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C " -I/builddir/build/BUILD/SLOF/board-qemu/include -I/builddir/build/BUILD/SLOF/include -I/builddir/build/BUILD/SLOF/include/ppcp7 -I/builddir/build/BUILD/SLOF/lib/libc/include -O2  -msoft-float    -Wa,-mregnames -DRELEASE="\"mockbuild@ release 20170303\"" -DCPU_PPCP7 -Wall -c ../../llfw/boot_abort.S

There are more.

-- 
Murilo



More information about the SLOF mailing list