diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2025-04-07 23:10:44 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-04-10 11:05:35 +0100 |
commit | e7f14cfbac56c1e545e4e28111831a57b126276c (patch) | |
tree | e754bf49c15fba8023d3d77eb39dba704820819b | |
parent | 8308864fd1a0583f5d1e2b97b1d06869a59c333a (diff) | |
download | poky-e7f14cfbac56c1e545e4e28111831a57b126276c.tar.gz |
barebox-tools: clean up yamltree from dtc
Refer Linux commit [dt-bindings: kbuild: Use DTB files for validation][1],
clean up yamltree from dtc to avoid compile failure while include <yaml.h>
in non-standard path
| 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>
Since barebox actually doesn't do any dtb binding checks at the moment, just
remove the test of /usr/include/yaml.h, hard-code the -DNO_YAML and remove
yamltree.c from DTC_SOURCE
[1] https://github.com/torvalds/linux/commit/ef8795f3f1ce
(From OE-Core rev: 9eed65e4b527ae461b3993c455f129a80d0c2416)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-bsp/barebox/barebox-tools.bb | 4 | ||||
-rw-r--r-- | meta/recipes-bsp/barebox/files/0001-scripts-dtc-clean-up-yamltree-from-dtc.patch | 60 |
2 files changed, 64 insertions, 0 deletions
diff --git a/meta/recipes-bsp/barebox/barebox-tools.bb b/meta/recipes-bsp/barebox/barebox-tools.bb index 2a117bc9c0..f6395beb7c 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" | |||
2 | 2 | ||
3 | require barebox-common.inc | 3 | require barebox-common.inc |
4 | 4 | ||
5 | SRC_URI += " \ | ||
6 | file://0001-scripts-dtc-clean-up-yamltree-from-dtc.patch \ | ||
7 | " | ||
8 | |||
5 | LICENSE = "GPL-2.0-only" | 9 | LICENSE = "GPL-2.0-only" |
6 | 10 | ||
7 | DEPENDS = "bison-native flex-native libusb1" | 11 | DEPENDS = "bison-native flex-native libusb1" |
diff --git a/meta/recipes-bsp/barebox/files/0001-scripts-dtc-clean-up-yamltree-from-dtc.patch b/meta/recipes-bsp/barebox/files/0001-scripts-dtc-clean-up-yamltree-from-dtc.patch new file mode 100644 index 0000000000..fdab21ef72 --- /dev/null +++ b/meta/recipes-bsp/barebox/files/0001-scripts-dtc-clean-up-yamltree-from-dtc.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From 77afd065dc58e2f57066ef7f392c571f8136723d Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Mon, 7 Apr 2025 14:45:27 +0000 | ||
4 | Subject: [PATCH] scripts/dtc: clean up yamltree from dtc | ||
5 | |||
6 | Refer Linux commit [dt-bindings: kbuild: Use DTB files for validation][1], | ||
7 | clean up yamltree from dtc to avoid compile failure while include <yaml.h> | ||
8 | in non-standard path | ||
9 | |||
10 | Since barebox actually doesn't do any dtb binding checks at the moment, just | ||
11 | remove the test of /usr/include/yaml.h, hard-code the -DNO_YAML and remove | ||
12 | yamltree.c from DTC_SOURCE | ||
13 | |||
14 | [1] https://github.com/torvalds/linux/commit/ef8795f3f1ce | ||
15 | |||
16 | Upstream-Status: Submitted [https://github.com/barebox/barebox/pull/37] | ||
17 | |||
18 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
19 | --- | ||
20 | scripts/dtc/Makefile | 9 --------- | ||
21 | scripts/dtc/update-dtc-source.sh | 2 +- | ||
22 | 2 files changed, 1 insertion(+), 10 deletions(-) | ||
23 | |||
24 | diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile | ||
25 | index 721e8e2b..da00319f 100644 | ||
26 | --- a/scripts/dtc/Makefile | ||
27 | +++ b/scripts/dtc/Makefile | ||
28 | @@ -16,16 +16,7 @@ fdtget-objs += fdtget.o $(libfdt-objs) util.o | ||
29 | # Source files need to get at the userspace version of libfdt_env.h to compile | ||
30 | HOST_EXTRACFLAGS += -I$(src)/libfdt | ||
31 | |||
32 | -ifeq ($(wildcard /usr/include/yaml.h),) | ||
33 | -ifneq ($(CHECK_DTBS),) | ||
34 | -$(error dtc needs libyaml for DT schema validation support. \ | ||
35 | - Install the necessary libyaml development package.) | ||
36 | -endif | ||
37 | HOST_EXTRACFLAGS += -DNO_YAML | ||
38 | -else | ||
39 | -dtc-objs += yamltree.o | ||
40 | -HOSTLDLIBS_dtc := -lyaml | ||
41 | -endif | ||
42 | |||
43 | # Generated files need one more search path to include headers in source tree | ||
44 | HOSTCFLAGS_dtc-lexer.lex.o := -I$(src) | ||
45 | diff --git a/scripts/dtc/update-dtc-source.sh b/scripts/dtc/update-dtc-source.sh | ||
46 | index 141d3629..8aa5cd66 100755 | ||
47 | --- a/scripts/dtc/update-dtc-source.sh | ||
48 | +++ b/scripts/dtc/update-dtc-source.sh | ||
49 | @@ -31,7 +31,7 @@ DTC_UPSTREAM_PATH=`pwd`/../dtc | ||
50 | DTC_LINUX_PATH=`pwd`/scripts/dtc | ||
51 | |||
52 | DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c \ | ||
53 | - srcpos.h treesource.c util.c util.h version_gen.h yamltree.c Makefile.dtc \ | ||
54 | + srcpos.h treesource.c util.c util.h version_gen.h Makefile.dtc \ | ||
55 | dtc-lexer.l dtc-parser.y fdtget.c" | ||
56 | LIBFDT_SOURCE="Makefile.libfdt fdt.c fdt.h fdt_addresses.c fdt_empty_tree.c \ | ||
57 | fdt_overlay.c fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c \ | ||
58 | -- | ||
59 | 2.48.1 | ||
60 | |||