[SLOF] FLAG is not passed correctly to the compiler

Segher Boessenkool segher at kernel.crashing.org
Fri Jun 23 23:54:05 AEST 2017


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


More information about the SLOF mailing list