Bump buildroot to 2019.02
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
From 9619c8619c37b9aea98100bcc15c51a5642e877e Mon Sep 17 00:00:00 2001
|
||||
From: Greg Kurz <groug@kaod.org>
|
||||
Date: Thu, 30 Aug 2018 12:01:59 +0200
|
||||
Subject: [PATCH] Kill bogus TYPE_BLOB marker type
|
||||
|
||||
Since commit 32b9c6130762 "Preserve datatype markers when emitting dts
|
||||
format", we no longer try to guess the value type. Instead, we reuse
|
||||
the type of the datatype markers when they are present, if the type
|
||||
is either TYPE_UINT* or TYPE_STRING.
|
||||
|
||||
This causes 'dtc -I fs' to crash:
|
||||
|
||||
Starting program: /root/dtc -q -f -O dts -I fs /proc/device-tree
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
|
||||
Program received signal SIGSEGV, Segmentation fault.
|
||||
__strlen_power8 () at ../sysdeps/powerpc/powerpc64/power8/strlen.S:47
|
||||
47 ld r12,0(r4) /* Load doubleword from memory. */
|
||||
(gdb) bt
|
||||
#0 __strlen_power8 () at ../sysdeps/powerpc/powerpc64/power8/strlen.S:47
|
||||
#1 0x00007ffff7de3d10 in __GI__IO_fputs (str=<optimized out>,
|
||||
fp=<optimized out>) at iofputs.c:33
|
||||
#2 0x000000001000c7a0 in write_propval (prop=0x100525e0,
|
||||
f=0x7ffff7f718a0 <_IO_2_1_stdout_>) at treesource.c:245
|
||||
|
||||
The offending line is:
|
||||
|
||||
fprintf(f, "%s", delim_start[emit_type]);
|
||||
|
||||
where emit_type is TYPE_BLOB and:
|
||||
|
||||
static const char *delim_start[] = {
|
||||
[TYPE_UINT8] = "[",
|
||||
[TYPE_UINT16] = "/bits/ 16 <",
|
||||
[TYPE_UINT32] = "<",
|
||||
[TYPE_UINT64] = "/bits/ 64 <",
|
||||
[TYPE_STRING] = "",
|
||||
};
|
||||
|
||||
/* Data blobs */
|
||||
enum markertype {
|
||||
TYPE_NONE,
|
||||
REF_PHANDLE,
|
||||
REF_PATH,
|
||||
LABEL,
|
||||
TYPE_UINT8,
|
||||
TYPE_UINT16,
|
||||
TYPE_UINT32,
|
||||
TYPE_UINT64,
|
||||
TYPE_BLOB,
|
||||
TYPE_STRING,
|
||||
};
|
||||
|
||||
Because TYPE_BLOB < TYPE_STRING and delim_start[] is a static array,
|
||||
delim_start[emit_type] is 0x0. The glibc usually prints out "(null)"
|
||||
when one passes 0x0 to %s, but it seems to call fputs() internally if
|
||||
the format is exactly "%s", hence the crash.
|
||||
|
||||
TYPE_BLOB basically means the data comes from a file and we don't know
|
||||
its type. We don't care for the former, and the latter is TYPE_NONE.
|
||||
|
||||
So let's drop TYPE_BLOB completely and use TYPE_NONE instead when reading
|
||||
the file. Then, try to guess the data type at emission time, like the
|
||||
code already does for refs and labels.
|
||||
|
||||
Instead of adding yet another check for TYPE_NONE, an helper is introduced
|
||||
to check if the data marker has type information, ie, >= TYPE_UINT8.
|
||||
|
||||
Fixes: 32b9c61307629ac76c6ac0bead6f926d579b3d2c
|
||||
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
|
||||
Signed-off-by: Greg Kurz <groug@kaod.org>
|
||||
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
||||
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
||||
---
|
||||
data.c | 2 +-
|
||||
dtc.h | 1 -
|
||||
treesource.c | 9 +++++++--
|
||||
3 files changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/data.c b/data.c
|
||||
index accdfaef6668..4a204145cc7b 100644
|
||||
--- a/data.c
|
||||
+++ b/data.c
|
||||
@@ -95,7 +95,7 @@ struct data data_copy_file(FILE *f, size_t maxlen)
|
||||
{
|
||||
struct data d = empty_data;
|
||||
|
||||
- d = data_add_marker(d, TYPE_BLOB, NULL);
|
||||
+ d = data_add_marker(d, TYPE_NONE, NULL);
|
||||
while (!feof(f) && (d.len < maxlen)) {
|
||||
size_t chunksize, ret;
|
||||
|
||||
diff --git a/dtc.h b/dtc.h
|
||||
index 303c2a6a73b7..51c03ef64dbe 100644
|
||||
--- a/dtc.h
|
||||
+++ b/dtc.h
|
||||
@@ -82,7 +82,6 @@ enum markertype {
|
||||
TYPE_UINT16,
|
||||
TYPE_UINT32,
|
||||
TYPE_UINT64,
|
||||
- TYPE_BLOB,
|
||||
TYPE_STRING,
|
||||
};
|
||||
extern const char *markername(enum markertype markertype);
|
||||
diff --git a/treesource.c b/treesource.c
|
||||
index f99544d72344..53e62036ad0e 100644
|
||||
--- a/treesource.c
|
||||
+++ b/treesource.c
|
||||
@@ -133,9 +133,14 @@ static void write_propval_int(FILE *f, const char *p, size_t len, size_t width)
|
||||
}
|
||||
}
|
||||
|
||||
+static bool has_data_type_information(struct marker *m)
|
||||
+{
|
||||
+ return m->type >= TYPE_UINT8;
|
||||
+}
|
||||
+
|
||||
static struct marker *next_type_marker(struct marker *m)
|
||||
{
|
||||
- while (m && (m->type == LABEL || m->type == REF_PHANDLE || m->type == REF_PATH))
|
||||
+ while (m && !has_data_type_information(m))
|
||||
m = m->next;
|
||||
return m;
|
||||
}
|
||||
@@ -225,7 +230,7 @@ static void write_propval(FILE *f, struct property *prop)
|
||||
size_t chunk_len;
|
||||
const char *p = &prop->val.val[m->offset];
|
||||
|
||||
- if (m->type < TYPE_UINT8)
|
||||
+ if (!has_data_type_information(m))
|
||||
continue;
|
||||
|
||||
chunk_len = type_marker_length(m);
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
From 086283ed7f1886de05407bc75dd4c070c78a6f50 Mon Sep 17 00:00:00 2001
|
||||
From: Lothar Felten <lothar.felten@gmail.com>
|
||||
Date: Mon, 8 Oct 2018 13:29:44 +0200
|
||||
Subject: [PATCH] Fix include guards for older kernel/u-boot sources
|
||||
|
||||
Linux kernels before 4.17 and U-Boot versions before 2018.07 use libfdt
|
||||
include guards with leading underscores.
|
||||
|
||||
Those have been removed in dtc-1.4.7.
|
||||
|
||||
This patch handles both include guard types and allows the compilation
|
||||
of older Linux kernel and u-boot sources.
|
||||
|
||||
Signed-off-by: Lothar Felten <lothar.felten@gmail.com>
|
||||
[ThomasDS: also update fdt.h which has the same issue, seen on U-Boot
|
||||
2011.03]
|
||||
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
---
|
||||
libfdt/fdt.h | 4 ++++
|
||||
libfdt/libfdt.h | 4 ++++
|
||||
libfdt/libfdt_env.h | 4 ++++
|
||||
3 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/libfdt/fdt.h b/libfdt/fdt.h
|
||||
index 74961f9..2904f48 100644
|
||||
--- a/libfdt/fdt.h
|
||||
+++ b/libfdt/fdt.h
|
||||
@@ -1,3 +1,7 @@
|
||||
+#ifdef _FDT_H
|
||||
+#warning "Please consider updating your kernel and/or u-boot version"
|
||||
+#define FDT_H
|
||||
+#endif
|
||||
#ifndef FDT_H
|
||||
#define FDT_H
|
||||
/*
|
||||
diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
|
||||
index 830b77e..bef4566 100644
|
||||
--- a/libfdt/libfdt.h
|
||||
+++ b/libfdt/libfdt.h
|
||||
@@ -1,3 +1,7 @@
|
||||
+#ifdef _LIBFDT_H
|
||||
+#warning "Please consider updating your kernel and/or u-boot version"
|
||||
+#define LIBFDT_H
|
||||
+#endif
|
||||
#ifndef LIBFDT_H
|
||||
#define LIBFDT_H
|
||||
/*
|
||||
diff --git a/libfdt/libfdt_env.h b/libfdt/libfdt_env.h
|
||||
index eb20538..6a61e6a 100644
|
||||
--- a/libfdt/libfdt_env.h
|
||||
+++ b/libfdt/libfdt_env.h
|
||||
@@ -1,3 +1,7 @@
|
||||
+#ifdef _LIBFDT_ENV_H
|
||||
+#warning "Please consider updating your kernel and/or u-boot version"
|
||||
+#define LIBFDT_ENV_H
|
||||
+#endif
|
||||
#ifndef LIBFDT_ENV_H
|
||||
#define LIBFDT_ENV_H
|
||||
/*
|
||||
--
|
||||
2.19.2
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
From 5277449e5fd13a2f3778ed3380ba157cb9d4ea55 Mon Sep 17 00:00:00 2001
|
||||
From: Rob Herring <robh@kernel.org>
|
||||
Date: Thu, 20 Sep 2018 14:30:03 -0700
|
||||
Subject: [PATCH] checks: fix simple-bus compatible matching
|
||||
|
||||
Since commit 7975f6422260 ("Fix widespread incorrect use of strneq(),
|
||||
replace with new strprefixeq()") simple-bus checks have been silently
|
||||
skipped. The problem was 'end - str' is one more than the string length
|
||||
and the strnlen in strprefixeq fails. This can't be fixed simply by
|
||||
subtracting one as it is possible to have multiple '\0' at the end of
|
||||
the property. Fix this by making the 'compatible' property string list
|
||||
check a dependency, and then we can assume the property is null
|
||||
terminated and we can just use streq() for comparisons.
|
||||
|
||||
Add some tests so the problem doesn't happen again.
|
||||
|
||||
Fixes: 7975f6422260 ("Fix widespread incorrect use of strneq(), replace with new strprefixeq()")
|
||||
Reported-by: Kumar Gala <kumar.gala@linaro.org>
|
||||
Signed-off-by: Rob Herring <robh@kernel.org>
|
||||
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
||||
[Backport from upstream commit e84742aa7b934cd6603e3a64f8c0966f683c5711]
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
checks.c | 5 +++--
|
||||
tests/run_tests.sh | 4 ++++
|
||||
tests/unit-addr-simple-bus-compatible.dts | 18 ++++++++++++++++++
|
||||
tests/unit-addr-simple-bus-reg-mismatch.dts | 18 ++++++++++++++++++
|
||||
4 files changed, 43 insertions(+), 2 deletions(-)
|
||||
create mode 100644 tests/unit-addr-simple-bus-compatible.dts
|
||||
create mode 100644 tests/unit-addr-simple-bus-reg-mismatch.dts
|
||||
|
||||
diff --git a/checks.c b/checks.c
|
||||
index a2cc103..acf91c3 100644
|
||||
--- a/checks.c
|
||||
+++ b/checks.c
|
||||
@@ -910,7 +910,7 @@ static bool node_is_compatible(struct node *node, const char *compat)
|
||||
|
||||
for (str = prop->val.val, end = str + prop->val.len; str < end;
|
||||
str += strnlen(str, end - str) + 1) {
|
||||
- if (strprefixeq(str, end - str, compat))
|
||||
+ if (streq(str, compat))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -921,7 +921,8 @@ static void check_simple_bus_bridge(struct check *c, struct dt_info *dti, struct
|
||||
if (node_is_compatible(node, "simple-bus"))
|
||||
node->bus = &simple_bus;
|
||||
}
|
||||
-WARNING(simple_bus_bridge, check_simple_bus_bridge, NULL, &addr_size_cells);
|
||||
+WARNING(simple_bus_bridge, check_simple_bus_bridge, NULL,
|
||||
+ &addr_size_cells, &compatible_is_string_list);
|
||||
|
||||
static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct node *node)
|
||||
{
|
||||
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
|
||||
index 7348c9c..c4354d2 100755
|
||||
--- a/tests/run_tests.sh
|
||||
+++ b/tests/run_tests.sh
|
||||
@@ -652,6 +652,10 @@ dtc_tests () {
|
||||
check_tests pci-bridge-bad1.dts pci_bridge
|
||||
check_tests pci-bridge-bad2.dts pci_bridge
|
||||
|
||||
+ check_tests unit-addr-simple-bus-reg-mismatch.dts simple_bus_reg
|
||||
+ check_tests unit-addr-simple-bus-compatible.dts simple_bus_reg
|
||||
+
|
||||
+
|
||||
# Check warning options
|
||||
run_sh_test dtc-checkfails.sh address_cells_is_cell interrupt_cells_is_cell -n size_cells_is_cell -- -Wno_size_cells_is_cell -I dts -O dtb bad-ncells.dts
|
||||
run_sh_test dtc-fails.sh -n test-warn-output.test.dtb -I dts -O dtb bad-ncells.dts
|
||||
diff --git a/tests/unit-addr-simple-bus-compatible.dts b/tests/unit-addr-simple-bus-compatible.dts
|
||||
new file mode 100644
|
||||
index 0000000..c8f9341
|
||||
--- /dev/null
|
||||
+++ b/tests/unit-addr-simple-bus-compatible.dts
|
||||
@@ -0,0 +1,18 @@
|
||||
+/dts-v1/;
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ bus@10000000 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ compatible = "foo-bus", "simple-bus";
|
||||
+ ranges = <0x0 0x10000000 0x10000>;
|
||||
+
|
||||
+ node@100 {
|
||||
+ reg = <0x1000 1>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+};
|
||||
diff --git a/tests/unit-addr-simple-bus-reg-mismatch.dts b/tests/unit-addr-simple-bus-reg-mismatch.dts
|
||||
new file mode 100644
|
||||
index 0000000..2823377
|
||||
--- /dev/null
|
||||
+++ b/tests/unit-addr-simple-bus-reg-mismatch.dts
|
||||
@@ -0,0 +1,18 @@
|
||||
+/dts-v1/;
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ bus@10000000 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ compatible = "simple-bus";
|
||||
+ ranges = <0x0 0x10000000 0x10000>;
|
||||
+
|
||||
+ node@100 {
|
||||
+ reg = <0x1000 1>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+};
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# from https://www.kernel.org/pub/software/utils/dtc/sha256sums.asc
|
||||
sha256 470731d5c015b160d26a96645dbb1c7337d6e7b8c98244612002b66bedf6cffb dtc-1.4.4.tar.xz
|
||||
sha256 6643e8f00ff86350f465bb54b2185058b5b1b7bac01a0842c81a52b86589cde7 dtc-1.4.7.tar.xz
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
DTC_VERSION = 1.4.4
|
||||
DTC_VERSION = 1.4.7
|
||||
DTC_SOURCE = dtc-$(DTC_VERSION).tar.xz
|
||||
DTC_SITE = https://www.kernel.org/pub/software/utils/dtc
|
||||
DTC_LICENSE = GPL-2.0+ or BSD-2-Clause (library)
|
||||
@@ -13,6 +13,14 @@ DTC_INSTALL_STAGING = YES
|
||||
DTC_DEPENDENCIES = host-bison host-flex
|
||||
HOST_DTC_DEPENDENCIES = host-bison host-flex
|
||||
|
||||
DTC_MAKE_OPTS = \
|
||||
PREFIX=/usr \
|
||||
NO_PYTHON=1
|
||||
|
||||
HOST_DTC_MAKE_OPTS = \
|
||||
PREFIX=$(HOST_DIR) \
|
||||
NO_PYTHON=1
|
||||
|
||||
define DTC_POST_INSTALL_TARGET_RM_DTDIFF
|
||||
rm -f $(TARGET_DIR)/usr/bin/dtdiff
|
||||
endef
|
||||
@@ -32,26 +40,26 @@ DTC_INSTALL_GOAL = install-lib
|
||||
endif # $(BR2_PACKAGE_DTC_PROGRAMS) != y
|
||||
|
||||
define DTC_BUILD_CMDS
|
||||
$(TARGET_CONFIGURE_OPTS) $(MAKE) CFLAGS="$(TARGET_CFLAGS) -fPIC" -C $(@D) PREFIX=/usr
|
||||
$(TARGET_CONFIGURE_OPTS) $(MAKE) CFLAGS="$(TARGET_CFLAGS) -fPIC" -C $(@D) $(DTC_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
# For staging, only the library is needed
|
||||
define DTC_INSTALL_STAGING_CMDS
|
||||
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) PREFIX=/usr install-lib \
|
||||
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) $(DTC_MAKE_OPTS) install-lib \
|
||||
install-includes
|
||||
endef
|
||||
|
||||
define DTC_INSTALL_TARGET_CMDS
|
||||
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) PREFIX=/usr $(DTC_INSTALL_GOAL)
|
||||
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) $(DTC_MAKE_OPTS) $(DTC_INSTALL_GOAL)
|
||||
endef
|
||||
|
||||
# host build
|
||||
define HOST_DTC_BUILD_CMDS
|
||||
$(HOST_CONFIGURE_OPTS) $(MAKE) CFLAGS="$(HOST_CFLAGS) -fPIC" -C $(@D) PREFIX=$(HOST_DIR)
|
||||
$(HOST_CONFIGURE_OPTS) $(MAKE) CFLAGS="$(HOST_CFLAGS) -fPIC" -C $(@D) $(HOST_DTC_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
define HOST_DTC_INSTALL_CMDS
|
||||
$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install
|
||||
$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HOST_DTC_MAKE_OPTS) install
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
||||
Reference in New Issue
Block a user