All of 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
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ 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] 13+ messages in thread

end of thread, other threads:[~2026-09-25 14:43 UTC | newest]

Thread overview: 13+ 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
2026-09-16  6:51 ` Peter Korsgaard
2026-09-25 14:43 ` Raphaël Mélotte 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.