From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC/PATCH] fs/common.mk: Fix wrong double dollar usage
Date: Tue, 12 Mar 2013 07:06:11 -0300 [thread overview]
Message-ID: <20130312100611.GD2506@localhost> (raw)
In-Reply-To: <CAAXf6LXzA2qSxq+5XRzRQUrXTHhTwYg2VA9GdTiNpPzkcNndxQ@mail.gmail.com>
Hi Thomas,
Thanks for your answer.
On Tue, Mar 12, 2013 at 10:05:04AM +0100, Thomas De Schampheleire wrote:
> Hi,
>
> On Sat, Mar 9, 2013 at 10:04 PM, Ezequiel Garcia
> <ezequiel.garcia@free-electrons.com> wrote:
> > Double dollar sign is used to put an explicit dollar sign,
> > for instance, when writing a makefile rule.
> >
> > In this case, there are some makefile conditionals where
> > makefile variables are evaluated using double dollar signs
> > instead of single dollar, which is wrong.
> >
> > In particular, this fixes a buildroot 'make' stall
> > when building with an empty device table (empty BR2_ROOTFS_DEVICE_TABLE).
> >
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > ---
> > I'm sending this as RFC because I'm new to buildroot
> > and because I'm not a makefile wizard.
> > AFAIK, this fixes a real bug in my compilation,
> > as explained in the commit message.
>
> In fact you are reverting changes made by Arnout a while back, see git
> commit 847895d29524d81b64afb059b8649a77802a469b
> http://git.buildroot.org/buildroot/commit/?id=847895d29524d81b64afb059b8649a77802a469b
> There were specific reasons to make these changes, so I don't think we
> should revert them like this.
>
> Be aware that these make targets are inside a 'define
> ROOTFS_TARGET_INTERNAL' statement, and later in the file this
> 'function' is executed with 'call'. This makes the rules for $ or $$ a
> little different than in standard make recipes.
Mmmm, I see. So it's not as easy as it seemed!
However, please note I'm *only* fixing the conditionals,
not the targets or the rules. See below.
>
> You mention a 'stall', can you elaborate more? What happens exactly?
> Can you debug this further?
>
Yes, I have. The problem is that this conditional
ifneq ($$(ROOTFS_DEVICE_TABLES),)
cat $$(ROOTFS_DEVICE_TABLES) > $$(FULL_DEVICE_TABLE)
is *never* false. However, if ROOTFS_DEVICE_TABLES is empty
the command will execute like this:
$ cat > some_file
which simply stalls (well it doesn't stall, it's waiting for EOF at stdin).
I think this is easily reproducible, just set an empty value in your
BR2_ROOTFS_DEVICE_TABLE option.
As I said in the patch I'm far from a makefile wizard, but it seems
to me that $$(ROOTFS_DEVICE_TABLES) (double dollar) is not equivalent
to $(ROOTFS_DEVICE_TABLES) (single dollar) from the perspective of the
conditional.
Thanks,
--
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
next prev parent reply other threads:[~2013-03-12 10:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-09 21:04 [Buildroot] [RFC/PATCH] fs/common.mk: Fix wrong double dollar usage Ezequiel Garcia
2013-03-12 8:30 ` Ezequiel Garcia
2013-03-12 9:05 ` Thomas De Schampheleire
2013-03-12 10:06 ` Ezequiel Garcia [this message]
2013-03-12 11:28 ` Thomas De Schampheleire
2013-03-12 12:44 ` Ezequiel Garcia
2013-03-12 13:34 ` Thomas De Schampheleire
2013-03-12 22:22 ` Arnout Vandecappelle
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=20130312100611.GD2506@localhost \
--to=ezequiel.garcia@free-electrons.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.