From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Alexey Neyman <stilor@att.net>
Cc: buildroot@busybox.net
Subject: Re: [Buildroot] [PATCH] package/qemu: filter out long make options
Date: Sat, 7 Aug 2021 23:01:13 +0200 [thread overview]
Message-ID: <20210807210113.GF27036@scaer> (raw)
In-Reply-To: <20210807191507.700901-1-stilor@att.net>
Alexey, All,
On 2021-08-07 12:15 -0700, Alexey Neyman spake thusly:
> Since qemu started using ninja, they have the following fragment in the
> Makefile:
>
> MAKE.n = $(findstring n,$(firstword $(MAKEFLAGS)))
> NINJAFLAGS = ... $(if $(MAKE.n), -n) ...
>
> Buildroot's generated makefile in the O= directory invokes make in the
> base buildroot with --no-print-directory. However, make's placement of
> the --no-print-directory in MAKEFLAGS varies between the versions of
> the host make; make 4.3 places that at the end while make 3.82 places
> it at the beginning. As a result, if building on a system with an older
> host make, qemu's makefile invokes `ninja -n` which does not generate
> any outputs.
>
> To reproduce, on a CentOS 7 machine or docker image:
> mkdir /tmp/br-build && cd /tmp/br-build
> make -C ~/buildroot pc_x86_64_bios_defconfig O=`pwd`
> make menuconfig # Switch to glibc, enable "QEMU" and "QEMU tools"
> make all # Build succeeds
> find target -name qemu-img # No binary has been built
>
> Pick up the fix commited in Qemu upstream.
>
> Signed-off-by: Alexey Neyman <stilor@att.net>
Applied to master, thanks.
Regards,
Yann E. MORIN.
> ---
> .../0004-Makefile-ignore-long-options.patch | 41 +++++++++++++++++++
> 1 file changed, 41 insertions(+)
> create mode 100644 package/qemu/0004-Makefile-ignore-long-options.patch
>
> diff --git a/package/qemu/0004-Makefile-ignore-long-options.patch b/package/qemu/0004-Makefile-ignore-long-options.patch
> new file mode 100644
> index 0000000000..2d14b70c03
> --- /dev/null
> +++ b/package/qemu/0004-Makefile-ignore-long-options.patch
> @@ -0,0 +1,41 @@
> +From 14833e24dea49303ebc2464813601054b6cdfcac Mon Sep 17 00:00:00 2001
> +From: Alexey Neyman <stilor@att.net>
> +Date: Wed, 21 Jul 2021 19:08:46 -0700
> +Subject: [PATCH] Makefile: ignore long options
> +
> +When searching for options like -n in MAKEFLAGS, current code may result
> +in a false positive match when make is invoked with long options like
> +--no-print-directory. This has been observed with certain versions of
> +host make (e.g. 3.82) while building the Qemu package in buildroot.
> +
> +Filter out such long options before searching for one-character options.
> +
> +Signed-off-by: Alexey Neyman <stilor@att.net>
> +Message-Id: <20210722020846.3678817-1-stilor@att.net>
> +Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> +---
> + Makefile | 8 +++++---
> + 1 file changed, 5 insertions(+), 3 deletions(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 6c36330eef..401c623a65 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -129,9 +129,11 @@ endif
> + # 4. Rules to bridge to other makefiles
> +
> + ifneq ($(NINJA),)
> +-MAKE.n = $(findstring n,$(firstword $(MAKEFLAGS)))
> +-MAKE.k = $(findstring k,$(firstword $(MAKEFLAGS)))
> +-MAKE.q = $(findstring q,$(firstword $(MAKEFLAGS)))
> ++# Filter out long options to avoid flags like --no-print-directory which
> ++# may result in false positive match for MAKE.n
> ++MAKE.n = $(findstring n,$(firstword $(filter-out --%,$(MAKEFLAGS))))
> ++MAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS))))
> ++MAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS))))
> + MAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
> + NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \
> + $(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS)))) \
> +--
> +2.27.0
> +
> --
> 2.27.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@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. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
prev parent reply other threads:[~2021-08-07 21:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210721194605.1552794-1-stilor.ref@att.net>
2021-07-21 19:46 ` [Buildroot] [PATCH 0/2] Fix qemu package build Alexey Neyman
2021-07-21 19:46 ` [Buildroot] [PATCH 1/2] package/qemu: do not use deprecated option Alexey Neyman
2021-07-24 20:41 ` Yann E. MORIN
2021-07-21 19:46 ` [Buildroot] [PATCH 2/2] package/qemu: filter out long make options Alexey Neyman
2021-07-21 20:15 ` Thomas Petazzoni
2021-07-21 22:18 ` Alexey Neyman
2021-07-23 22:26 ` Thomas Petazzoni
2021-08-07 19:15 ` [Buildroot] [PATCH] " Alexey Neyman
2021-08-07 21:01 ` 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=20210807210113.GF27036@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
--cc=stilor@att.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