Message ID | 20250407080931.3926302-1-hongxu.jia@windriver.com |
---|---|
State | New |
Headers | show |
Series | barebox-tools: fix host contamination on libyaml | expand |
On Mon, 7 Apr 2025 at 10:09, hongxu via lists.openembedded.org <hongxu.jia=eng.windriver.com@lists.openembedded.org> wrote: > +Subject: [PATCH] fix host contamination on libyaml > + > +The barebox-tools uses host gcc to build dtc tools, and test the existence > +of /usr/include/yaml.h to build with/without libyaml > + > +It caused host contamination if /usr/include/yaml.h existed on host. > +| tmp/work/core2-64-wrs-linux/barebox-tools/2025.02.0/barebox-2025.02.0/scripts/ > +dtc/yamltree.c:9:10: fatal error: yaml.h: No such file or directory > +| 9 | #include <yaml.h> > + > +Explicitly define NO_YAML = 1 to disable libyaml for host dtc > + > +Upstream-Status: Inappropriate [Yocto specific] Please report this to upstream, rather than just make a new patch and mark it Inappropriate without engaging. We have barebox maintainer present and active right here, actually. Alex
Am Montag, dem 07.04.2025 um 12:27 +0200 schrieb Alexander Kanavin: > On Mon, 7 Apr 2025 at 10:09, hongxu via lists.openembedded.org > <hongxu.jia=eng.windriver.com@lists.openembedded.org> wrote: > > +Subject: [PATCH] fix host contamination on libyaml > > + > > +The barebox-tools uses host gcc to build dtc tools, and test the existence > > +of /usr/include/yaml.h to build with/without libyaml > > + > > +It caused host contamination if /usr/include/yaml.h existed on host. > > +| tmp/work/core2-64-wrs-linux/barebox-tools/2025.02.0/barebox-2025.02.0/scripts/ > > +dtc/yamltree.c:9:10: fatal error: yaml.h: No such file or directory > > +| 9 | #include <yaml.h> > > + > > +Explicitly define NO_YAML = 1 to disable libyaml for host dtc > > + > > +Upstream-Status: Inappropriate [Yocto specific] I had a quick chat with the maintainers. Since barebox actually doesn't do any dtb binding checks at the moment, it would be fine to just hard-code the -DNO_YAML (and omit the check). (If that should be needed later one can use .dtb files directly without the dts->yaml conversion, just like the kernel does: https://github.com/torvalds/linux/commit/ef8795f3f1ce ) > Please report this to upstream, rather than just make a new patch and > mark it Inappropriate without engaging. We have barebox maintainer > present and active right here, actually. Thank you Alex for CC'ing me! Regards, Enrico > Alex >
Sure, refer https://github.com/torvalds/linux/commit/ef8795f3f1ce to clean up yamltree from dtc V2 incoming //Hongxu
diff --git a/meta/recipes-bsp/barebox/barebox-tools.bb b/meta/recipes-bsp/barebox/barebox-tools.bb index 2a117bc9c08..50660bdf5c8 100644 --- a/meta/recipes-bsp/barebox/barebox-tools.bb +++ b/meta/recipes-bsp/barebox/barebox-tools.bb @@ -2,6 +2,10 @@ SUMMARY = "barebox bootloader tools" require barebox-common.inc +SRC_URI += " \ + file://0001-fix-host-contamination-on-libyaml.patch \ +" + LICENSE = "GPL-2.0-only" DEPENDS = "bison-native flex-native libusb1" @@ -17,6 +21,7 @@ EXTRA_OEMAKE = " \ CROSS_PKG_CONFIG=pkg-config \ CC='${CC}' \ LD='${LD}' \ + NO_YAML=1 \ " do_compile:class-target () { diff --git a/meta/recipes-bsp/barebox/files/0001-fix-host-contamination-on-libyaml.patch b/meta/recipes-bsp/barebox/files/0001-fix-host-contamination-on-libyaml.patch new file mode 100644 index 00000000000..e24e47a9cfc --- /dev/null +++ b/meta/recipes-bsp/barebox/files/0001-fix-host-contamination-on-libyaml.patch @@ -0,0 +1,38 @@ +From f6b529fd13af7e05bfed4471d160f1119308db2a Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Mon, 7 Apr 2025 13:13:14 +0800 +Subject: [PATCH] fix host contamination on libyaml + +The barebox-tools uses host gcc to build dtc tools, and test the existence +of /usr/include/yaml.h to build with/without libyaml + +It caused host contamination if /usr/include/yaml.h existed on host. +| tmp/work/core2-64-wrs-linux/barebox-tools/2025.02.0/barebox-2025.02.0/scripts/ +dtc/yamltree.c:9:10: fatal error: yaml.h: No such file or directory +| 9 | #include <yaml.h> + +Explicitly define NO_YAML = 1 to disable libyaml for host dtc + +Upstream-Status: Inappropriate [Yocto specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + scripts/dtc/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile +index 721e8e2b..b7bfee1b 100644 +--- a/scripts/dtc/Makefile ++++ b/scripts/dtc/Makefile +@@ -16,7 +16,7 @@ fdtget-objs += fdtget.o $(libfdt-objs) util.o + # Source files need to get at the userspace version of libfdt_env.h to compile + HOST_EXTRACFLAGS += -I$(src)/libfdt + +-ifeq ($(wildcard /usr/include/yaml.h),) ++ifeq ($(NO_YAML), 1) + ifneq ($(CHECK_DTBS),) + $(error dtc needs libyaml for DT schema validation support. \ + Install the necessary libyaml development package.) +-- +2.34.1 +
The barebox-tools uses host gcc to build dtc tools, and test the existence of /usr/include/yaml.h to build with/without libyaml It caused host contamination if /usr/include/yaml.h existed on host. | tmp/work/core2-64-wrs-linux/barebox-tools/2025.02.0/barebox-2025.02.0/scripts/ dtc/yamltree.c:9:10: fatal error: yaml.h: No such file or directory | 9 | #include <yaml.h> Explicitly define NO_YAML = 1 to disable libyaml for host dtc No regression because the host dtc was not shipped to target or native sysroot Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- meta/recipes-bsp/barebox/barebox-tools.bb | 5 +++ ...01-fix-host-contamination-on-libyaml.patch | 38 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 meta/recipes-bsp/barebox/files/0001-fix-host-contamination-on-libyaml.patch