diff options
Diffstat (limited to 'poky/meta/recipes-kernel/dtc')
4 files changed, 75 insertions, 0 deletions
diff --git a/poky/meta/recipes-kernel/dtc/dtc.inc b/poky/meta/recipes-kernel/dtc/dtc.inc index 0650e3c82..5da6c24fb 100644 --- a/poky/meta/recipes-kernel/dtc/dtc.inc +++ b/poky/meta/recipes-kernel/dtc/dtc.inc @@ -7,7 +7,9 @@ DEPENDS = "flex-native bison-native" SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \ file://make_install.patch \ + file://0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch \ " + UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" EXTRA_OEMAKE='NO_PYTHON=1 PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}"' diff --git a/poky/meta/recipes-kernel/dtc/dtc/0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch b/poky/meta/recipes-kernel/dtc/dtc/0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch new file mode 100644 index 000000000..a2deb12d4 --- /dev/null +++ b/poky/meta/recipes-kernel/dtc/dtc/0001-dtc-Fix-Makefile-to-add-CFLAGS-not-override.patch @@ -0,0 +1,36 @@ +From f0119060ef1b9bd80e2cae487df1e4aedffb0e9b Mon Sep 17 00:00:00 2001 +From: Oleksiy Obitotskyy <oobitots@cisco.com> +Date: Fri, 22 Jan 2021 09:12:48 +0200 +Subject: [PATCH] dtc: Fix Makefile to add CFLAGS not override + +Makefile override CFLAGS not extend them, so some of them +missing. Sources builds out of kernel tree and probably not all +options could be used (?). We need at least -fmacro-prefix-map/ +debug-prefix-map to eliminate absolute path in binaries. + +Upstream-Status: Pending +Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com> +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 35d936f..b5b13cf 100644 +--- a/Makefile ++++ b/Makefile +@@ -20,10 +20,10 @@ CONFIG_LOCALVERSION = + # See libfdt_internal.h for details + ASSUME_MASK ?= 0 + +-CPPFLAGS = -I libfdt -I . -DFDT_ASSUME_MASK=$(ASSUME_MASK) ++CPPFLAGS += -I libfdt -I . -DFDT_ASSUME_MASK=$(ASSUME_MASK) + WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \ + -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow +-CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) $(EXTRA_CFLAGS) ++CFLAGS += -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) $(EXTRA_CFLAGS) + + BISON = bison + LEX = flex +-- +2.25.1 + diff --git a/poky/meta/recipes-kernel/dtc/dtc/0001-fdtdump-Fix-gcc11-warning.patch b/poky/meta/recipes-kernel/dtc/dtc/0001-fdtdump-Fix-gcc11-warning.patch new file mode 100644 index 000000000..ec825cbf7 --- /dev/null +++ b/poky/meta/recipes-kernel/dtc/dtc/0001-fdtdump-Fix-gcc11-warning.patch @@ -0,0 +1,35 @@ +From 4827e0db6c4f7dea7f4094f49d3bb48ef6dfdc2d Mon Sep 17 00:00:00 2001 +From: David Gibson <david@gibson.dropbear.id.au> +Date: Wed, 6 Jan 2021 14:52:26 +1100 +Subject: [PATCH] fdtdump: Fix gcc11 warning + +In one place, fdtdump abuses fdt_set_magic(), passing it just a small char +array instead of the full fdt header it expects. That's relying on the +fact that in fact fdt_set_magic() will only actually access the first 4 +bytes of the buffer. + +This trips a new warning in GCC 11 - and it's entirely possible it was +always UB. So, don't do that. + +Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/dtc/dtc.git/patch/?id=ca16a723fa9dde9c5da80dba567f48715000e77c] +Signed-off-by: David Gibson <david@gibson.dropbear.id.au> +--- + fdtdump.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fdtdump.c b/fdtdump.c +index 9613bef..d9fb374 100644 +--- a/fdtdump.c ++++ b/fdtdump.c +@@ -217,7 +217,7 @@ int main(int argc, char *argv[]) + char *p = buf; + char *endp = buf + len; + +- fdt_set_magic(smagic, FDT_MAGIC); ++ fdt32_st(smagic, FDT_MAGIC); + + /* poor man's memmem */ + while ((endp - p) >= FDT_MAGIC_SIZE) { +-- +2.30.1 + diff --git a/poky/meta/recipes-kernel/dtc/dtc_1.6.0.bb b/poky/meta/recipes-kernel/dtc/dtc_1.6.0.bb index 92df70d9f..a40713785 100644 --- a/poky/meta/recipes-kernel/dtc/dtc_1.6.0.bb +++ b/poky/meta/recipes-kernel/dtc/dtc_1.6.0.bb @@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ SRCREV = "2525da3dba9beceb96651dc2986581871dbeca30" +SRC_URI += "file://0001-fdtdump-Fix-gcc11-warning.patch" + S = "${WORKDIR}/git" BBCLASSEXTEND = "native nativesdk" |