diff mbox

FLAG is not passed correctly to the compiler

Message ID fbcf706c-2e91-2696-1ee7-fe42ae22222e@ozlabs.ru
State Superseded
Headers show

Commit Message

Alexey Kardashevskiy June 23, 2017, 5:56 a.m. UTC
On 23/06/17 07:21, Segher Boessenkool wrote:
> On Thu, Jun 22, 2017 at 05:51:13PM -0300, Murilo Opsfelder Araújo wrote:
>>> 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):
> 
> Ah, board-qemu/config is written as if it is a shell script; it is
> not, it is a makefile fragment.  Simply remove the quotes there?

Then it fails in a different place:

[vpl2 slof]$ make qemu V=2
******** Building qemu system ********
make[1]: Entering directory '/home/aik/p/slof/board-qemu'
make -C ../tools
make[2]: Entering directory '/home/aik/p/slof/tools'
gcc -W -g -Wall -W -O2 -I. -I../include -I../romfs/tools -c gen_reloc_table.c
gcc -g -Wall -W -O2 -I. -I../include -I../romfs/tools -o gen_reloc_table
gen_reloc_table.o
gcc -W -g -Wall -W -O2 -I. -I../include -I../romfs/tools -c sloffs.c
gcc -W -g -Wall -W -O2 -I. -I../include -I../romfs/tools -c
../romfs/tools/crclib.c -o crclib.o
gcc -g -Wall -W -O2 -I. -I../include -I../romfs/tools -o sloffs sloffs.o
crclib.o
make[2]: Leaving directory '/home/aik/p/slof/tools'
make -C ../romfs/tools BOARD=qemu PLATFORM= FLAG=-DRTAS_NVRAM -DBROKEN_SC1
-DDHCPARCH=0x0C TARG=ppc64
make: invalid option -- 'D'
make: invalid option -- 'D'
make: invalid option -- 'D'
make: invalid option -- 'H'
Usage: make [options] [target] ...
Options:



afaict this fixes the original issue:




Murilo, please give it a try.

In general, lib/**/Makefile could use some cleanup - they all define
ASFLAGS/CPPFLAGS/LDFLAGS, mostly identical, when it is not identical, it
feels like just by oversight than anything else.


> 
> 
> Segher
> _______________________________________________
> SLOF mailing list
> SLOF@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/slof
>

Comments

Murilo Opsfelder Araujo June 23, 2017, 12:27 p.m. UTC | #1
On 06/23/2017 02:56 AM, Alexey Kardashevskiy wrote:
[...]
> afaict this fixes the original issue:
> 
> 
> diff --git a/lib/Makefile b/lib/Makefile
> index a4d4bb2..1e8bb62 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -21,7 +21,7 @@ all:  subdirs
>  subdirs: $(SUBDIRS)
> 
>  $(SUBDIRS):
> -       $(MAKE) -C $@ $(MAKEARG)
> +       $(MAKE) -C $@ FLAG=$(FLAG) $(MAKEARG)
> 
>  # Rules for making clean:
>  clean:
> 
> 
> Murilo, please give it a try.
> 
> In general, lib/**/Makefile could use some cleanup - they all define
> ASFLAGS/CPPFLAGS/LDFLAGS, mostly identical, when it is not identical, it
> feels like just by oversight than anything else.

Alexey,

In addition to your diff, I also had to append FLAG to CFLAGS in
lib/libnet/Makefile. Then, it worked.

I sent out a v2 patch.

Thanks.
Segher Boessenkool June 23, 2017, 1:54 p.m. UTC | #2
On Fri, Jun 23, 2017 at 03:56:51PM +1000, Alexey Kardashevskiy wrote:
> On 23/06/17 07:21, Segher Boessenkool wrote:
> > On Thu, Jun 22, 2017 at 05:51:13PM -0300, Murilo Opsfelder Araújo wrote:
> >>> 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):
> > 
> > Ah, board-qemu/config is written as if it is a shell script; it is
> > not, it is a makefile fragment.  Simply remove the quotes there?
> 
> Then it fails in a different place:

> make -C ../romfs/tools BOARD=qemu PLATFORM= FLAG=-DRTAS_NVRAM -DBROKEN_SC1
> -DDHCPARCH=0x0C TARG=ppc64
> make: invalid option -- 'D'
> make: invalid option -- 'D'
> make: invalid option -- 'D'
> make: invalid option -- 'H'

Ah, because there it of course needs to be quoted, which worked as a
side effect with the original wrong quoting.  Lovely.

> afaict this fixes the original issue:
> 
> 
> diff --git a/lib/Makefile b/lib/Makefile
> index a4d4bb2..1e8bb62 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -21,7 +21,7 @@ all:  subdirs
>  subdirs: $(SUBDIRS)
> 
>  $(SUBDIRS):
> -       $(MAKE) -C $@ $(MAKEARG)
> +       $(MAKE) -C $@ FLAG=$(FLAG) $(MAKEARG)
> 
>  # Rules for making clean:
>  clean:

Ah cool.

> Murilo, please give it a try.
> 
> In general, lib/**/Makefile could use some cleanup - they all define
> ASFLAGS/CPPFLAGS/LDFLAGS, mostly identical, when it is not identical, it
> feels like just by oversight than anything else.

And most things that are "export"ed from the makefiles should not be.
And what kind of name is "FLAG", anyway ;-)


Segher
diff mbox

Patch

diff --git a/lib/Makefile b/lib/Makefile
index a4d4bb2..1e8bb62 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -21,7 +21,7 @@  all:  subdirs
 subdirs: $(SUBDIRS)

 $(SUBDIRS):
-       $(MAKE) -C $@ $(MAKEARG)
+       $(MAKE) -C $@ FLAG=$(FLAG) $(MAKEARG)

 # Rules for making clean:
 clean: