[Buildroot] [PATCH] open2300: fix build failure

Samuel Martin s.martin49 at gmail.com
Thu Feb 6 20:40:12 UTC 2014


Hi Thomas,


On Thu, Feb 6, 2014 at 10:05 AM, Thomas Petazzoni <
thomas.petazzoni at free-electrons.com> wrote:

> Dear Samuel Martin,
>
> On Wed,  5 Feb 2014 22:09:22 +0100, Samuel Martin wrote:
>
> > +- allow to extend CFLAGS and CC_LDFLAGS
>
> [...]
>
> > +-CFLAGS = -Wall -O3 -DVERSION=\"$(VERSION)\"
> > +-CC_LDFLAGS = -lm
> > +-CC_WINFLAG =
> > ++CFLAGS += -Wall -O3 -DVERSION=\"$(VERSION)\"
> > ++CC_LDFLAGS += -lm
> > ++CC_WINFLAG =
>
> This doesn't allow to extend CFLAGS if the CFLAGS is passed on the
> right hand side of the "make" call.
>
> I.e, with your patch, if you do:
>
>         make CFLAGS=-something
>
> Then the CFLAGS will only contain "-something", not "-something -Wall
> -O3 -DVERSION...". However, with your patch, it works if you do:
>
>         CFLAGS=-something make
>
> In Buildroot, we indeed often do $(TARGET_CONFIGURE_OPTS) $(MAKE),
> which means CFLAGS is passed on the left side of make. But this
> specific package does not do this:
>
>         $(MAKE) CC=... LD=... -C $(@D)
>
> So it doesn't pass CFLAGS, so there is no problem for now, but if it
> started to pass CFLAGS on the right side of make, then your patch
> wouldn't work.
>
> Instead, if you want it to work in all cases, it should be:
>
> override CFLAGS += -Wall -O3 ...
>

I did know all these fine details. Thanks a lot for the explanation.
I'll fix it and repost shortly.

Regards,

-- 
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140206/b5009e3b/attachment.html>


More information about the buildroot mailing list