All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 1/4] package/xen: fix build error when BR2_PACKAGE_XEN_TOOLS not enabled
@ 2026-08-03 14:51 Neal Frager via buildroot
  2026-08-03 14:51 ` [Buildroot] [PATCH v4 2/4] package/xen: add custom version support Neal Frager via buildroot
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Neal Frager via buildroot @ 2026-08-03 14:51 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: 5183 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 the part that modifies the qemu-xen
sources is correctly moved to a patch in the qemu-xen package.

Move this:
 #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

 /*

to:
package/qemu-xen/0001-Update-linker-flags.patch

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: John Ernberg <john.ernberg@actia.se>
---
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
---
 .../qemu-xen/0001-Update-linker-flags.patch   | 35 +++++++++++++++++++
 package/xen/0002-Update-linker-flags.patch    | 16 +--------
 2 files changed, 36 insertions(+), 15 deletions(-)
 create mode 100644 package/qemu-xen/0001-Update-linker-flags.patch

diff --git a/package/qemu-xen/0001-Update-linker-flags.patch b/package/qemu-xen/0001-Update-linker-flags.patch
new file mode 100644
index 0000000000..8162a149ed
--- /dev/null
+++ b/package/qemu-xen/0001-Update-linker-flags.patch
@@ -0,0 +1,35 @@
+From 2ba2eef5b11d81b801265ae92df91571c19cc8a3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
+Date: Tue, 30 Sep 2025 11:39:54 +0200
+Subject: [PATCH] Update linker flags
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The -I$(XEN_ROOT)/tools/include added to QEMU's extra-cflags causes
+__XEN_INTERFACE_VERSION__ to be defined before xen_native.h is included,
+triggering an include-order assertion. Downgrade to a warning since the
+version is consistent in cross-compile.
+Ref: https://github.com/qemu/qemu/commit/e2abfe5ec6
+
+Upstream: Buildroot specific. This is a temporary patch for an intermediate bump.
+Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
+---
+ include/hw/xen/xen_native.h |  2 +-
+ 1 file changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/include/hw/xen/xen_native.h b/include/hw/xen/xen_native.h
+index 6bcc83ba..2590904e 100644
+--- a/include/hw/xen/xen_native.h
++++ b/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/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
 
-- 
2.43.0


[-- 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] 14+ messages in thread

end of thread, other threads:[~2026-08-26  6:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 14:51 [Buildroot] [PATCH v4 1/4] package/xen: fix build error when BR2_PACKAGE_XEN_TOOLS not enabled Neal Frager via buildroot
2026-08-03 14:51 ` [Buildroot] [PATCH v4 2/4] package/xen: add custom version support Neal Frager via buildroot
2026-08-03 15:21   ` [Buildroot] [EXTERNAL] " Weber (US), Matthew L via buildroot
2026-08-03 15:39     ` Frager, Neal via buildroot
2026-08-03 16:52       ` Weber (US), Matthew L via buildroot
2026-08-24 12:41   ` [Buildroot] " Stewart Hildebrand via buildroot
2026-08-24 13:15     ` Frager, Neal via buildroot
2026-08-03 14:51 ` [Buildroot] [PATCH v4 3/4] package/xen: add custom tarball support Neal Frager via buildroot
2026-08-25  8:37   ` Stewart Hildebrand via buildroot
2026-08-26  6:19     ` Frager, Neal via buildroot
2026-08-03 14:51 ` [Buildroot] [PATCH v4 4/4] package/xen: add custom git support Neal Frager via buildroot
2026-08-25 14:20   ` Stewart Hildebrand via buildroot
2026-08-24 10:41 ` [Buildroot] [PATCH v4 1/4] package/xen: fix build error when BR2_PACKAGE_XEN_TOOLS not enabled Stewart Hildebrand via buildroot
2026-08-26  5:14   ` Frager, Neal via buildroot

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.