Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] make printvars: avoid invalid calls when arguments are missing
Date: Mon, 25 Feb 2019 23:00:07 +0100	[thread overview]
Message-ID: <20190225220007.GA15265@scaer> (raw)
In-Reply-To: <468427c5e6854794aa8a97373bfdaf30@ginzinger.com>

Martin, All,

On 2019-02-25 07:09 +0000, Kepplinger Martin spake thusly:
> (sorry for the horrible email format)
> 
> my patch does not break the build. In fact, it *adds* host-tar to my build (for the first time
> ever it seems because it just downloaded).
> 
> My impression is that what's *below* the $(1) expression in support/dependencies/dependencies.mk
> didn't get defined... (host-tar).
> 
> I've built successfully. Still, the kind of change doesn't look very beautiful.
> 
> Maybe there someone who sees the mistake at first sight :)

I agree with Thomas: the patch as it is, is not correct. As Thomas
explained, at the exact moment you evaluate $(1) to test if it is empty,
you are outside the macro. However, $(1) only ever makes sense in a
macro, because it is the first parameter of a macro.

So, it means the test will aways fail: $(1) is always empty outside a
macro, so   ifneq ($(1),)   is always false.

As a consequnce, as Thomas said, the two macros enclosed in the ifneq
will never be defined.

Instead, what you want is to do the test inside the macro, like:

    define suitable-host-package
    ifneq ($(1),)
    $(shell support/dependencies/check-host-$(1).sh $(2))
    endif
    endef

Or:

    try-run = $(if $(1), ...
        ...
        )

And so on...

I've marked the patch as "Changes Requested" in patchwork while waiting
for the next iteration. Thanks! :-)

Regards,
Yann E. MORIN.

> On Sat, 23 Feb 2019 17:11:08 +0100
> Martin Kepplinger <martin.kepplinger@ginzinger.com> wrote:
> 
> > diff --git a/package/Makefile.in b/package/Makefile.in
> > index dc818a2c18..f4f3864e8d 100644
> > --- a/package/Makefile.in
> > +++ b/package/Makefile.in
> > @@ -232,6 +232,7 @@ HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
> >  # Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
> >  # Exit code chooses option. "$$TMP" is can be used as temporary file and
> >  # is automatically cleaned up.
> > +ifneq ($(1),)
> 
> $(1) only makes sense inside the macro itself. Outside the macro $(1)
> does not make sense at all, and will always be empty I believe. Are you
> sure your patch is working, and does not break the build ?
> 
> Indeed, I believe the two macros you enclose in ifneq tests will in
> fact no longer be defined.
> 
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> 
> 
> 
> ________________________________________
> 
> Ginzinger electronic systems GmbH
> Gewerbegebiet Pirath 16
> 4952 Weng im Innkreis
> www.ginzinger.com
> 
> Firmenbuchnummer: FN 364958d
> Firmenbuchgericht: Ried im Innkreis
> UID-Nr.: ATU66521089
> 
> 
> Diese Nachricht ist vertraulich und darf nicht an andere Personen weitergegeben oder von diesen verwendet werden. Verst?ndigen Sie uns, wenn Sie irrt?mlich eine Mitteilung empfangen haben.
> 
> This message is confidential. It may not be disclosed to, or used by, anyone other than the addressee. If you receive this message by mistake, please advise the sender.



> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot


-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

      reply	other threads:[~2019-02-25 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-23 16:11 [Buildroot] [PATCH] make printvars: avoid invalid calls when arguments are missing Martin Kepplinger
2019-02-23 16:41 ` Thomas Petazzoni
2019-02-25  7:09   ` Kepplinger Martin
2019-02-25 22:00     ` Yann E. MORIN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190225220007.GA15265@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox