Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Raphaël Mélotte via buildroot" <buildroot@buildroot.org>
To: buildroot@buildroot.org, Neal Frager <neal.frager@amd.com>
Cc: "Raphaël Mélotte" <raphael.melotte@mind.be>
Subject: Re: [Buildroot] [PATCH v5 1/4] package/xen: fix build error when BR2_PACKAGE_XEN_TOOLS not enabled
Date: Fri, 25 Sep 2026 16:43:39 +0200	[thread overview]
Message-ID: <20260925144342.4095021-1-raphael.melotte@mind.be> (raw)
In-Reply-To: <20260826064649.292291-1-neal.frager@amd.com>

In reply of:
> The 0002-Update-linker-flags.patch assumes that the qemu-xen files are included
> in the xen source tree. However, if BR2_PACKAGE_XEN_TOOLS is not enabled, the
> qemu-xen dependency will not be handled and the patch will fail to apply with
> the following error.
> 
> Fixes: build error below
> Applying 0002-Update-linker-flags.patch using patch:
> patching file tools/Makefile
> Hunk #1 succeeded at 36 (offset -1 lines).
> Hunk #2 succeeded at 185 (offset -8 lines).
> can't find file to patch at input line 76
> Perhaps you used the wrong -p or --strip option?
> The text leading up to this was:
> --------------------------
> |diff --git a/tools/qemu-xen/include/hw/xen/xen_native.h b/tools/qemu-xen/include/hw/xen/xen_native.h
> |index 6bcc83ba..2590904e 100644
> |--- a/tools/qemu-xen/include/hw/xen/xen_native.h
> |+++ b/tools/qemu-xen/include/hw/xen/xen_native.h
> --------------------------
> No file to patch.  Skipping patch.
> 1 out of 1 hunk ignored
> make: *** [package/pkg-generic.mk:239: output/build/xen-4.21.1/.stamp_patched] Error 1
> 
> To avoid making BR2_PACKAGE_XEN_TOOLS a required option, fix the
> 0002-Update-linker-flags.patch so that modifying source from the qemu-xen
> package is no longer included.
> 
> Instead of patching qemu-xen, a better solution is undefining the
> __XEN_INTERFACE_VERSION__ from the qemu-xen package.
> 
> To test:
> BR2_aarch64=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y
> BR2_PACKAGE_XEN=y
>  # BR2_PACKAGE_XEN_TOOLS is not set
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> Tested-by: Matt Weber <matt@thewebers.ws>

Applied to 2026.08.x. Thanks

> ---
> V1->V2:
> - changed method to modify patches instead of xen.mk
> V2->V3:
> - removed text from commit message which appears as start of patch
> V3->V4:
> - merged into patch series as the first patch
> V4->V5:
> - removed qemu-xen patch
> - undefined __XEN_INTERFACE_VERSION__ from qemu-xen
> ---
>  package/xen/0002-Update-linker-flags.patch | 16 +---------------
>  package/xen/xen.mk                         |  3 ++-
>  2 files changed, 3 insertions(+), 16 deletions(-)
> 
> diff --git a/package/xen/0002-Update-linker-flags.patch b/package/xen/0002-Update-linker-flags.patch
> index ac02722781..3ba678cd9b 100644
> --- a/package/xen/0002-Update-linker-flags.patch
> +++ b/package/xen/0002-Update-linker-flags.patch
> @@ -16,8 +16,7 @@ Upstream: Buildroot specific. This is a temporary patch for an intermediate bump
>  Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
>  ---
>   tools/Makefile                              | 29 ++++++++++++++++++++-
> - tools/qemu-xen/include/hw/xen/xen_native.h |  2 +-
> - 2 files changed, 29 insertions(+), 2 deletions(-)
> + 1 file changed, 28 insertions(+), 1 deletions(-)
>  
>  diff --git a/tools/Makefile b/tools/Makefile
>  index a9a3196e..5d289651 100644
> @@ -69,19 +68,6 @@ index a9a3196e..5d289651 100644
>   		--bindir=$(LIBEXEC_BIN) \
>   		--datadir=$(SHAREDIR)/qemu-xen \
>   		--localstatedir=$(localstatedir) \
> -diff --git a/tools/qemu-xen/include/hw/xen/xen_native.h b/tools/qemu-xen/include/hw/xen/xen_native.h
> -index 6bcc83ba..2590904e 100644
> ---- a/tools/qemu-xen/include/hw/xen/xen_native.h
> -+++ b/tools/qemu-xen/include/hw/xen/xen_native.h
> -@@ -2,7 +2,7 @@
> - #define QEMU_HW_XEN_NATIVE_H
> - 
> - #ifdef __XEN_INTERFACE_VERSION__
> --#error In Xen native files, include xen_native.h before other Xen headers
> -+#warning In Xen native files, include xen_native.h before other Xen headers
> - #endif
> - 
> - /*
>  -- 
>  2.51.0
>  
> diff --git a/package/xen/xen.mk b/package/xen/xen.mk
> index 75252d1123..bddfdbba38 100644
> --- a/package/xen/xen.mk
> +++ b/package/xen/xen.mk
> @@ -40,7 +40,8 @@ XEN_MAKE_ENV = \
>  	CROSS_COMPILE=$(TARGET_CROSS) \
>  	HOST_EXTRACFLAGS="-Wno-error" \
>  	XEN_HAS_CHECKPOLICY=n \
> -	$(TARGET_CONFIGURE_OPTS)
> +	$(TARGET_CONFIGURE_OPTS) \
> +	EXTRA_CFLAGS_QEMU_XEN="-U__XEN_INTERFACE_VERSION__"
>  
>  ifeq ($(BR2_PACKAGE_XEN_HYPERVISOR),y)
>  XEN_MAKE_OPTS += dist-xen
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2026-09-25 14:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26  6:46 [Buildroot] [PATCH v5 1/4] package/xen: fix build error when BR2_PACKAGE_XEN_TOOLS not enabled Neal Frager via buildroot
2026-08-26  6:46 ` [Buildroot] [PATCH v5 2/4] package/xen: add custom version support Neal Frager via buildroot
2026-08-27  0:45   ` Matthew Weber
2026-08-26  6:46 ` [Buildroot] [PATCH v5 3/4] package/xen: add custom tarball support Neal Frager via buildroot
2026-08-27  0:46   ` Matthew Weber
2026-08-28 10:45   ` Stewart Hildebrand via buildroot
2026-08-26  6:46 ` [Buildroot] [PATCH v5 4/4] package/xen: add custom git support Neal Frager via buildroot
2026-08-27  0:47   ` Matthew Weber
2026-08-27  0:43 ` [Buildroot] [PATCH v5 1/4] package/xen: fix build error when BR2_PACKAGE_XEN_TOOLS not enabled Matthew Weber
2026-08-28 10:36 ` Stewart Hildebrand via buildroot
2026-09-11  5:21   ` Frager, Neal via buildroot
2026-09-16  6:51 ` Peter Korsgaard
2026-09-25 14:43 ` Raphaël Mélotte via buildroot [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=20260925144342.4095021-1-raphael.melotte@mind.be \
    --to=buildroot@buildroot.org \
    --cc=neal.frager@amd.com \
    --cc=raphael.melotte@mind.be \
    /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