Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5 1/4] package/xen: fix build error when BR2_PACKAGE_XEN_TOOLS not enabled
@ 2026-08-26  6:46 Neal Frager via buildroot
  2026-08-26  6:46 ` [Buildroot] [PATCH v5 2/4] package/xen: add custom version support Neal Frager via buildroot
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Neal Frager via buildroot @ 2026-08-26  6:46 UTC (permalink / raw)
  To: buildroot
  Cc: alistair, stefano.stabellini, ibai.erkiaga-elorza, luca.ceresoli,
	micheal.saleab, yann.morin, matthew.l.weber3, brandon.maier,
	john.ernberg, brian.j.wood2, ju.o, stewart.hildebrand,
	thomas.petazzoni, romain.naour, michal.simek, romain.naour,
	Neal Frager

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 3825 bytes --]

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>
---
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
-- 
2.25.1


[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v5 2/4] package/xen: add custom version support
  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 ` 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
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Neal Frager via buildroot @ 2026-08-26  6:46 UTC (permalink / raw)
  To: buildroot
  Cc: alistair, stefano.stabellini, ibai.erkiaga-elorza, luca.ceresoli,
	micheal.saleab, yann.morin, matthew.l.weber3, Matthew Weber,
	brandon.maier, john.ernberg, brian.j.wood2, ju.o,
	stewart.hildebrand, thomas.petazzoni, romain.naour, michal.simek,
	romain.naour, Neal Frager

Add the ability to configure specific Xen versions while leaving the default
version unchanged to avoid breaking any builds already using Xen 4.21.1.

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_CUSTOM_VERSION=y
BR2_PACKAGE_XEN_CUSTOM_VERSION_VALUE="4.22.0"

Add to package/xen/xen.hash:
sha256  b2a14ca369e3cf26f123a455b1603f3962ae9fcee0b8640a9cc33879de198223  xen-4.22.0.tar.gz

Signed-off-by: Neal Frager <neal.frager@amd.com>
Tested-by: Matthew Weber <mathew.l.weber3@boeing.com>
Prior test details: https://gist.github.com/matthew-l-weber/c17f14a3793ccee440a383e4177ff3db
Reviewed-by: John Ernberg <john.ernberg@actia.se>
Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
V1->V2:
- rebased to updated master branch
- removed the line move of the XEN_SITE definition
V2->V4:
- merged into new patch series as the second patch
V4->V5:
- added custom version test to commit message
---
 package/xen/Config.in | 25 +++++++++++++++++++++++++
 package/xen/xen.mk    |  2 +-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/package/xen/Config.in b/package/xen/Config.in
index d63a3f6002..e50b232f0a 100644
--- a/package/xen/Config.in
+++ b/package/xen/Config.in
@@ -10,6 +10,31 @@ config BR2_PACKAGE_XEN
 
 if BR2_PACKAGE_XEN
 
+choice
+	prompt "Xen Version"
+	help
+	  Select the specific Xen version you want to use
+
+config BR2_PACKAGE_XEN_LATEST_VERSION
+	bool "4.21.1"
+
+config BR2_PACKAGE_XEN_CUSTOM_VERSION
+	bool "Custom version"
+	help
+	  This option allows to use a specific official version
+
+endchoice
+
+config BR2_PACKAGE_XEN_CUSTOM_VERSION_VALUE
+	string "Xen version"
+	depends on BR2_PACKAGE_XEN_CUSTOM_VERSION
+
+config BR2_PACKAGE_XEN_VERSION
+	string
+	default "4.21.1"	if BR2_PACKAGE_XEN_LATEST_VERSION
+	default BR2_PACKAGE_XEN_CUSTOM_VERSION_VALUE \
+				if BR2_PACKAGE_XEN_CUSTOM_VERSION
+
 config BR2_PACKAGE_XEN_HYPERVISOR
 	bool "Xen hypervisor"
 	help
diff --git a/package/xen/xen.mk b/package/xen/xen.mk
index bddfdbba38..4e953edeea 100644
--- a/package/xen/xen.mk
+++ b/package/xen/xen.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-XEN_VERSION = 4.21.1
+XEN_VERSION = $(call qstrip,$(BR2_PACKAGE_XEN_VERSION))
 XEN_SITE = https://downloads.xenproject.org/release/xen/$(XEN_VERSION)
 XEN_SELINUX_MODULES = systemd udev xen
 XEN_LICENSE = GPL-2.0
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v5 3/4] package/xen: add custom tarball support
  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-26  6:46 ` 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
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 11+ messages in thread
From: Neal Frager via buildroot @ 2026-08-26  6:46 UTC (permalink / raw)
  To: buildroot
  Cc: alistair, stefano.stabellini, ibai.erkiaga-elorza, luca.ceresoli,
	micheal.saleab, yann.morin, matthew.l.weber3, Matthew Weber,
	brandon.maier, john.ernberg, brian.j.wood2, ju.o,
	stewart.hildebrand, thomas.petazzoni, romain.naour, michal.simek,
	romain.naour, Neal Frager

Add support for custom tarballs such as tarballs from vendor Xen trees.

To test this feature, use the following configs to test latest release of the
Xilinx Xen vendor tree.

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_CUSTOM_TARBALL=y
BR2_PACKAGE_XEN_CUSTOM_TARBALL_LOCATION="$(call github,Xilinx,xen,xlnx-rebase-v4.21_2026.1)/xlnx-rebase-v4.21_2026.1.tar.gz"

Add to package/xen/xen.hash:
sha256  03498f51b8daae70c429ace4bde6e2be679b3a0ac28b886c7335c022feef6100  xlnx-rebase-v4.21_2026.1.tar.gz

Signed-off-by: Neal Frager <neal.frager@amd.com>
Tested-by: Matthew Weber <mathew.l.weber3@boeing.com>
Prior test details: https://gist.github.com/matthew-l-weber/c17f14a3793ccee440a383e4177ff3db
Reviewed-by: John Ernberg <john.ernberg@actia.se>
---
V1->V2:
- rebased to updated master branch
- added the line move of the XEN_SITE definition
V2->V4:
- merged into new patch series as the third patch
V4->V5:
- removed unnecessary BR_NO_CHECK_HASH_FOR
---
 package/xen/Config.in | 11 +++++++++++
 package/xen/xen.mk    | 17 ++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/package/xen/Config.in b/package/xen/Config.in
index e50b232f0a..3726504334 100644
--- a/package/xen/Config.in
+++ b/package/xen/Config.in
@@ -23,8 +23,18 @@ config BR2_PACKAGE_XEN_CUSTOM_VERSION
 	help
 	  This option allows to use a specific official version
 
+config BR2_PACKAGE_XEN_CUSTOM_TARBALL
+	bool "Custom tarball"
+
 endchoice
 
+if BR2_PACKAGE_XEN_CUSTOM_TARBALL
+
+config BR2_PACKAGE_XEN_CUSTOM_TARBALL_LOCATION
+	string "URL of custom Xen tarball"
+
+endif
+
 config BR2_PACKAGE_XEN_CUSTOM_VERSION_VALUE
 	string "Xen version"
 	depends on BR2_PACKAGE_XEN_CUSTOM_VERSION
@@ -34,6 +44,7 @@ config BR2_PACKAGE_XEN_VERSION
 	default "4.21.1"	if BR2_PACKAGE_XEN_LATEST_VERSION
 	default BR2_PACKAGE_XEN_CUSTOM_VERSION_VALUE \
 				if BR2_PACKAGE_XEN_CUSTOM_VERSION
+	default "custom"	if BR2_PACKAGE_XEN_CUSTOM_TARBALL
 
 config BR2_PACKAGE_XEN_HYPERVISOR
 	bool "Xen hypervisor"
diff --git a/package/xen/xen.mk b/package/xen/xen.mk
index 4e953edeea..473f0e23fa 100644
--- a/package/xen/xen.mk
+++ b/package/xen/xen.mk
@@ -5,7 +5,6 @@
 ################################################################################
 
 XEN_VERSION = $(call qstrip,$(BR2_PACKAGE_XEN_VERSION))
-XEN_SITE = https://downloads.xenproject.org/release/xen/$(XEN_VERSION)
 XEN_SELINUX_MODULES = systemd udev xen
 XEN_LICENSE = GPL-2.0
 XEN_LICENSE_FILES = COPYING LICENSES/GPL-2.0
@@ -19,6 +18,16 @@ XEN_DEPENDENCIES = \
 	host-python3 \
 	host-python-distlib
 
+ifeq ($(BR2_PACKAGE_XEN_CUSTOM_TARBALL),y)
+# Handle custom Xen tarballs as specified by the configuration
+XEN_TARBALL = $(call qstrip,$(BR2_PACKAGE_XEN_CUSTOM_TARBALL_LOCATION))
+XEN_SITE = $(patsubst %/,%,$(dir $(XEN_TARBALL)))
+XEN_SOURCE = $(notdir $(XEN_TARBALL))
+else
+# Handle stable official Xen versions
+XEN_SITE = https://downloads.xenproject.org/release/xen/$(XEN_VERSION)
+endif
+
 # Calculate XEN_ARCH
 ifeq ($(ARCH),aarch64)
 XEN_ARCH = arm64
@@ -91,4 +100,10 @@ XEN_INSTALL_TARGET = NO
 XEN_CONF_OPTS += --disable-tools
 endif
 
+ifeq ($(BR2_PACKAGE_XEN_CUSTOM_TARBALL),y)
+ifeq ($(call qstrip,$(BR2_PACKAGE_XEN_CUSTOM_TARBALL_LOCATION)),)
+$(error No tarball location specified. Please check BR2_PACKAGE_XEN_CUSTOM_TARBALL_LOCATION)
+endif
+endif
+
 $(eval $(autotools-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v5 4/4] package/xen: add custom git support
  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-26  6:46 ` [Buildroot] [PATCH v5 3/4] package/xen: add custom tarball support Neal Frager via buildroot
@ 2026-08-26  6:46 ` 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
  4 siblings, 1 reply; 11+ messages in thread
From: Neal Frager via buildroot @ 2026-08-26  6:46 UTC (permalink / raw)
  To: buildroot
  Cc: alistair, stefano.stabellini, ibai.erkiaga-elorza, luca.ceresoli,
	micheal.saleab, yann.morin, matthew.l.weber3, Matthew Weber,
	brandon.maier, john.ernberg, brian.j.wood2, ju.o,
	stewart.hildebrand, thomas.petazzoni, romain.naour, michal.simek,
	romain.naour, Neal Frager

For completeness, add custom git support to match the capabilities of other
packages such as Linux, uboot or ATF.

To test this feature, use the following configs to test latest release of the
Xilinx Xen vendor tree.

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_CUSTOM_GIT=y
BR2_PACKAGE_XEN_CUSTOM_REPO_URL="https://github.com/Xilinx/xen.git"
BR2_PACKAGE_XEN_CUSTOM_REPO_VERSION="xlnx-rebase-v4.21_2026.1"

Add to package/xen/xen.hash:
sha256  e8016e81627fe3b4fca5463723428606cd3750c7fd76a3cfaa0b0d0e7cd9b32b  xen-xlnx-rebase-v4.21_2026.1-git4.tar.gz

Signed-off-by: Neal Frager <neal.frager@amd.com>
Tested-by: Matthew Weber <mathew.l.weber3@boeing.com>
Prior test details: https://gist.github.com/matthew-l-weber/c17f14a3793ccee440a383e4177ff3db
Reviewed-by: John Ernberg <john.ernberg@actia.se>
Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
Tested-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
Tested on VEK385 Evaluation Board
---
V1->V2:
- rebased to updated master branch
V2->V4:
- merged into new patch series as the fourth patch
V4->V5:
- updated commit message to use release tag name for test
- added error message in case no version specified
---
 package/xen/Config.in | 18 ++++++++++++++++++
 package/xen/xen.mk    | 12 ++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/package/xen/Config.in b/package/xen/Config.in
index 3726504334..eb58c6928f 100644
--- a/package/xen/Config.in
+++ b/package/xen/Config.in
@@ -26,6 +26,9 @@ config BR2_PACKAGE_XEN_CUSTOM_VERSION
 config BR2_PACKAGE_XEN_CUSTOM_TARBALL
 	bool "Custom tarball"
 
+config BR2_PACKAGE_XEN_CUSTOM_GIT
+	bool "Custom Git repository"
+
 endchoice
 
 if BR2_PACKAGE_XEN_CUSTOM_TARBALL
@@ -45,6 +48,21 @@ config BR2_PACKAGE_XEN_VERSION
 	default BR2_PACKAGE_XEN_CUSTOM_VERSION_VALUE \
 				if BR2_PACKAGE_XEN_CUSTOM_VERSION
 	default "custom"	if BR2_PACKAGE_XEN_CUSTOM_TARBALL
+	default BR2_PACKAGE_XEN_CUSTOM_REPO_VERSION \
+				if BR2_PACKAGE_XEN_CUSTOM_GIT
+
+if BR2_PACKAGE_XEN_CUSTOM_GIT
+
+config BR2_PACKAGE_XEN_CUSTOM_REPO_URL
+	string "URL of custom repository"
+
+config BR2_PACKAGE_XEN_CUSTOM_REPO_VERSION
+	string "Custom repository version"
+	help
+	  Revision to use in the typical format used by Git
+	  E.G. a sha id, a tag, ..
+
+endif
 
 config BR2_PACKAGE_XEN_HYPERVISOR
 	bool "Xen hypervisor"
diff --git a/package/xen/xen.mk b/package/xen/xen.mk
index 473f0e23fa..4ecf56ab49 100644
--- a/package/xen/xen.mk
+++ b/package/xen/xen.mk
@@ -23,6 +23,9 @@ ifeq ($(BR2_PACKAGE_XEN_CUSTOM_TARBALL),y)
 XEN_TARBALL = $(call qstrip,$(BR2_PACKAGE_XEN_CUSTOM_TARBALL_LOCATION))
 XEN_SITE = $(patsubst %/,%,$(dir $(XEN_TARBALL)))
 XEN_SOURCE = $(notdir $(XEN_TARBALL))
+else ifeq ($(BR2_PACKAGE_XEN_CUSTOM_GIT),y)
+XEN_SITE = $(call qstrip,$(BR2_PACKAGE_XEN_CUSTOM_REPO_URL))
+XEN_SITE_METHOD = git
 else
 # Handle stable official Xen versions
 XEN_SITE = https://downloads.xenproject.org/release/xen/$(XEN_VERSION)
@@ -106,4 +109,13 @@ $(error No tarball location specified. Please check BR2_PACKAGE_XEN_CUSTOM_TARBA
 endif
 endif
 
+ifeq ($(BR2_PACKAGE_XEN_CUSTOM_GIT),y)
+ifeq ($(call qstrip,$(BR2_PACKAGE_XEN_CUSTOM_REPO_URL)),)
+$(error No repository specified. Please check BR2_PACKAGE_XEN_CUSTOM_REPO_URL)
+endif
+ifeq ($(call qstrip,$(BR2_PACKAGE_XEN_CUSTOM_REPO_VERSION)),)
+$(error No version specified. Please check BR2_PACKAGE_XEN_CUSTOM_REPO_VERSION)
+endif
+endif
+
 $(eval $(autotools-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 1/4] package/xen: fix build error when BR2_PACKAGE_XEN_TOOLS not enabled
  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
                   ` (2 preceding siblings ...)
  2026-08-26  6:46 ` [Buildroot] [PATCH v5 4/4] package/xen: add custom git support Neal Frager via buildroot
@ 2026-08-27  0:43 ` Matthew Weber
  2026-08-28 10:36 ` Stewart Hildebrand via buildroot
  4 siblings, 0 replies; 11+ messages in thread
From: Matthew Weber @ 2026-08-27  0:43 UTC (permalink / raw)
  To: Neal Frager
  Cc: buildroot, alistair, stefano.stabellini, ibai.erkiaga-elorza,
	luca.ceresoli, micheal.saleab, yann.morin, matthew.l.weber3,
	brandon.maier, john.ernberg, brian.j.wood2, ju.o,
	stewart.hildebrand, thomas.petazzoni, romain.naour, michal.simek,
	romain.naour

Neal,

On Wed, Aug 26, 2026 at 1:47 AM Neal Frager via buildroot
<buildroot@buildroot.org> wrote:
>
> 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?

Ran through these sequences (test 1 covered this patch, make  xen-patch)
https://gist.github.com/matthew-l-weber/23101490a6e95a8b0f445e14ec22d9d5

Tested-by: Matt Weber <matt@thewebers.ws>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 2/4] package/xen: add custom version support
  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
  0 siblings, 0 replies; 11+ messages in thread
From: Matthew Weber @ 2026-08-27  0:45 UTC (permalink / raw)
  To: Neal Frager
  Cc: buildroot, alistair, stefano.stabellini, ibai.erkiaga-elorza,
	luca.ceresoli, micheal.saleab, yann.morin, matthew.l.weber3,
	Matthew Weber, brandon.maier, john.ernberg, brian.j.wood2, ju.o,
	stewart.hildebrand, thomas.petazzoni, romain.naour, michal.simek,
	romain.naour

Neal,

On Wed, Aug 26, 2026 at 1:47 AM Neal Frager via buildroot
<buildroot@buildroot.org> wrote:
>
> Add the ability to configure specific Xen versions while leaving the default
> version unchanged to avoid breaking any builds already using Xen 4.21.1.
>
> 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_CUSTOM_VERSION=y
> BR2_PACKAGE_XEN_CUSTOM_VERSION_VALUE="4.22.0"
>
> Add to package/xen/xen.hash:
> sha256  b2a14ca369e3cf26f123a455b1603f3962ae9fcee0b8640a9cc33879de198223  xen-4.22.0.tar.gz
>
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> Tested-by: Matthew Weber <mathew.l.weber3@boeing.com>
> Prior test details: https://gist.github.com/matthew-l-weber/c17f14a3793ccee440a383e4177ff3db
> Reviewed-by: John Ernberg <john.ernberg@actia.se>
> Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> ---
> V1->V2:
> - rebased to updated master branch
> - removed the line move of the XEN_SITE definition
> V2->V4:
> - merged into new patch series as the second patch
> V4->V5:
> - added custom version test to commit message

Ran through these sequences (test 1&2 covered this patch, make
xen-source with BR2_PACKAGE_XEN_CUSTOM_VERSION)
https://gist.github.com/matthew-l-weber/23101490a6e95a8b0f445e14ec22d9d5

Tested-by: Matt Weber <matt@thewebers.ws>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 3/4] package/xen: add custom tarball support
  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
  1 sibling, 0 replies; 11+ messages in thread
From: Matthew Weber @ 2026-08-27  0:46 UTC (permalink / raw)
  To: Neal Frager
  Cc: buildroot, alistair, stefano.stabellini, ibai.erkiaga-elorza,
	luca.ceresoli, micheal.saleab, yann.morin, matthew.l.weber3,
	Matthew Weber, brandon.maier, john.ernberg, brian.j.wood2, ju.o,
	stewart.hildebrand, thomas.petazzoni, romain.naour, michal.simek,
	romain.naour

Neal,

On Wed, Aug 26, 2026 at 1:47 AM Neal Frager via buildroot
<buildroot@buildroot.org> wrote:
>
> Add support for custom tarballs such as tarballs from vendor Xen trees.
>
> To test this feature, use the following configs to test latest release of the
> Xilinx Xen vendor tree.
>
> 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_CUSTOM_TARBALL=y
> BR2_PACKAGE_XEN_CUSTOM_TARBALL_LOCATION="$(call github,Xilinx,xen,xlnx-rebase-v4.21_2026.1)/xlnx-rebase-v4.21_2026.1.tar.gz"
>
> Add to package/xen/xen.hash:
> sha256  03498f51b8daae70c429ace4bde6e2be679b3a0ac28b886c7335c022feef6100  xlnx-rebase-v4.21_2026.1.tar.gz
>
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> Tested-by: Matthew Weber <mathew.l.weber3@boeing.com>
> Prior test details: https://gist.github.com/matthew-l-weber/c17f14a3793ccee440a383e4177ff3db
> Reviewed-by: John Ernberg <john.ernberg@actia.se>
> ---
> V1->V2:
> - rebased to updated master branch
> - added the line move of the XEN_SITE definition
> V2->V4:
> - merged into new patch series as the third patch
> V4->V5:
> - removed unnecessary BR_NO_CHECK_HASH_FOR


Ran through these sequences (test 3 covered this patch, make
xen-source with BR2_PACKAGE_XEN_CUSTOM_TARBALL)
https://gist.github.com/matthew-l-weber/23101490a6e95a8b0f445e14ec22d9d5

Tested-by: Matt Weber <matt@thewebers.ws>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 4/4] package/xen: add custom git support
  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
  0 siblings, 0 replies; 11+ messages in thread
From: Matthew Weber @ 2026-08-27  0:47 UTC (permalink / raw)
  To: Neal Frager
  Cc: buildroot, alistair, stefano.stabellini, ibai.erkiaga-elorza,
	luca.ceresoli, micheal.saleab, yann.morin, matthew.l.weber3,
	Matthew Weber, brandon.maier, john.ernberg, brian.j.wood2, ju.o,
	stewart.hildebrand, thomas.petazzoni, romain.naour, michal.simek,
	romain.naour

Neal,

On Wed, Aug 26, 2026 at 1:47 AM Neal Frager via buildroot
<buildroot@buildroot.org> wrote:
>
> For completeness, add custom git support to match the capabilities of other
> packages such as Linux, uboot or ATF.
>
> To test this feature, use the following configs to test latest release of the
> Xilinx Xen vendor tree.
>
> 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_CUSTOM_GIT=y
> BR2_PACKAGE_XEN_CUSTOM_REPO_URL="https://github.com/Xilinx/xen.git"
> BR2_PACKAGE_XEN_CUSTOM_REPO_VERSION="xlnx-rebase-v4.21_2026.1"
>
> Add to package/xen/xen.hash:
> sha256  e8016e81627fe3b4fca5463723428606cd3750c7fd76a3cfaa0b0d0e7cd9b32b  xen-xlnx-rebase-v4.21_2026.1-git4.tar.gz
>
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> Tested-by: Matthew Weber <mathew.l.weber3@boeing.com>
> Prior test details: https://gist.github.com/matthew-l-weber/c17f14a3793ccee440a383e4177ff3db
> Reviewed-by: John Ernberg <john.ernberg@actia.se>
> Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> Tested-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> Tested on VEK385 Evaluation Board
> ---
> V1->V2:
> - rebased to updated master branch
> V2->V4:
> - merged into new patch series as the fourth patch
> V4->V5:
> - updated commit message to use release tag name for test
> - added error message in case no version specified


Ran through these sequences (test 4 covered this patch, make
xen-source with BR2_PACKAGE_XEN_CUSTOM_GIT)
https://gist.github.com/matthew-l-weber/23101490a6e95a8b0f445e14ec22d9d5

Tested-by: Matt Weber <matt@thewebers.ws>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 1/4] package/xen: fix build error when BR2_PACKAGE_XEN_TOOLS not enabled
  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
                   ` (3 preceding siblings ...)
  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
  4 siblings, 1 reply; 11+ messages in thread
From: Stewart Hildebrand via buildroot @ 2026-08-28 10:36 UTC (permalink / raw)
  To: Neal Frager, buildroot
  Cc: alistair, stefano.stabellini, ibai.erkiaga-elorza, luca.ceresoli,
	micheal.saleab, yann.morin, matthew.l.weber3, brandon.maier,
	john.ernberg, brian.j.wood2, ju.o, thomas.petazzoni, romain.naour,
	michal.simek, romain.naour

On 8/26/26 08:46, Neal Frager wrote:
> 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>

Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>

Thank you for this. I just want to provide a few more details for future
reference.

__XEN_INTERFACE_VERSION__ being defined is a side-effect of including either
xen.git/xen/include/public/xen.h (via #include <xen/xen.h>) or
qemu.git/include/hw/xen/xen.h (via #include "hw/xen/xen.h"). In Qemu, we could
have considered changing the check in xen_native.h to
#if defined(__XEN_PUBLIC_XEN_H__) || defined(QEMU_HW_XEN_H)
Then we'd be checking for the header inclusion directly instead of relying on a
side-effect, and that would also allow passing -D__XEN_INTERFACE_VERSION__=...
as buildroot was doing. But this approach is not strictly necessary IMO, and it
would be better to find a solution without maintaining a patch for qemu.

For context, when building Xen tools, we define __XEN_INTERFACE_VERSION__ on the
command line via CFLAGS - see xen.git/tools/Rules.mk:
CFLAGS += -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__

Xen tools has a build target for qemu
(xen.git/tools/Makefile:subdir-all-qemu-xen-dir), and it typically invokes the
qemu build with a fresh set of CFLAGS, i.e. the -D__XEN_INTERFACE_VERSION__=...
should be dropped. However, buildroot somehow propagates the
-D__XEN_INTERFACE_VERSION__=... when building qemu-xen, hence triggering the
include order assertion in qemu.git/include/hw/xen/xen_native.h.

So the fix herein is to undo the __XEN_INTERFACE_VERSION__ define on the command
line when building qemu. Thus, __XEN_INTERFACE_VERSION__ will be defined in the
usual manner when including the appropriate header.

> ---
> 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 3/4] package/xen: add custom tarball support
  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
  1 sibling, 0 replies; 11+ messages in thread
From: Stewart Hildebrand via buildroot @ 2026-08-28 10:45 UTC (permalink / raw)
  To: Neal Frager, buildroot
  Cc: alistair, stefano.stabellini, ibai.erkiaga-elorza, luca.ceresoli,
	micheal.saleab, yann.morin, matthew.l.weber3, Matthew Weber,
	brandon.maier, john.ernberg, brian.j.wood2, ju.o,
	thomas.petazzoni, romain.naour, michal.simek, romain.naour

On 8/26/26 08:46, Neal Frager via buildroot wrote:
> Add support for custom tarballs such as tarballs from vendor Xen trees.
> 
> To test this feature, use the following configs to test latest release of the
> Xilinx Xen vendor tree.
> 
> 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_CUSTOM_TARBALL=y
> BR2_PACKAGE_XEN_CUSTOM_TARBALL_LOCATION="$(call github,Xilinx,xen,xlnx-rebase-v4.21_2026.1)/xlnx-rebase-v4.21_2026.1.tar.gz"
> 
> Add to package/xen/xen.hash:
> sha256  03498f51b8daae70c429ace4bde6e2be679b3a0ac28b886c7335c022feef6100  xlnx-rebase-v4.21_2026.1.tar.gz
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> Tested-by: Matthew Weber <mathew.l.weber3@boeing.com>
> Prior test details: https://gist.github.com/matthew-l-weber/c17f14a3793ccee440a383e4177ff3db
> Reviewed-by: John Ernberg <john.ernberg@actia.se>
Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 1/4] package/xen: fix build error when BR2_PACKAGE_XEN_TOOLS not enabled
  2026-08-28 10:36 ` Stewart Hildebrand via buildroot
@ 2026-09-11  5:21   ` Frager, Neal via buildroot
  0 siblings, 0 replies; 11+ messages in thread
From: Frager, Neal via buildroot @ 2026-09-11  5:21 UTC (permalink / raw)
  To: buildroot@buildroot.org, arnout@rnout.be,
	thomas.petazzoni@bootlin.com, ju.o@free.fr, peter@korsgaard.com
  Cc: luca.ceresoli@bootlin.com, Simek, Michal,
	brandon.maier@collins.com, romain.naour@smile.fr,
	romain.naour@gmail.com, Erkiaga Elorza, Ibai,
	yann.morin@orange.com, alistair@alistair23.me,
	brian.j.wood2@boeing.com, matthew.l.weber3@boeing.com,
	Stabellini, Stefano, Saleab, Micheal, john.ernberg@actia.se,
	Hildebrand, Stewart

AMD General

Hello Buildroot Maintainers,

> 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>

> Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>

> Thank you for this. I just want to provide a few more details for future
> reference.

> __XEN_INTERFACE_VERSION__ being defined is a side-effect of including either
> xen.git/xen/include/public/xen.h (via #include <xen/xen.h>) or
> qemu.git/include/hw/xen/xen.h (via #include "hw/xen/xen.h"). In Qemu, we could
> have considered changing the check in xen_native.h to
> #if defined(__XEN_PUBLIC_XEN_H__) || defined(QEMU_HW_XEN_H)
> Then we'd be checking for the header inclusion directly instead of relying on a
> side-effect, and that would also allow passing -D__XEN_INTERFACE_VERSION__=...
> as buildroot was doing. But this approach is not strictly necessary IMO, and it
> would be better to find a solution without maintaining a patch for qemu.

> For context, when building Xen tools, we define __XEN_INTERFACE_VERSION__ on the
> command line via CFLAGS - see xen.git/tools/Rules.mk:
> CFLAGS += -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__

> Xen tools has a build target for qemu
> (xen.git/tools/Makefile:subdir-all-qemu-xen-dir), and it typically invokes the
> qemu build with a fresh set of CFLAGS, i.e. the -D__XEN_INTERFACE_VERSION__=...
> should be dropped. However, buildroot somehow propagates the
> -D__XEN_INTERFACE_VERSION__=... when building qemu-xen, hence triggering the
> include order assertion in qemu.git/include/hw/xen/xen_native.h.

> So the fix herein is to undo the __XEN_INTERFACE_VERSION__ define on the command
> line when building qemu. Thus, __XEN_INTERFACE_VERSION__ will be defined in the
> usual manner when including the appropriate header.

> ---
> 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

Just a friendly reminder to have a look at this patch series.  At a minimum,
it would be good to apply the first patch of the series as soon as possible
because it fixes a build issue when building XEN without building the
tools 'BR2_PACKAGE_XEN_TOOLS'.

Patches 2-4 are adding new functionality, so I am ok if we want to spend
more time reviewing them.

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-09-11  5:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox