Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/dtc: bump version to 1.8.1 and switch to meson build
@ 2026-08-05 14:17 Philippe MONTCHO
  2026-08-07 17:41 ` Julien Olivain via buildroot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Philippe MONTCHO @ 2026-08-05 14:17 UTC (permalink / raw)
  To: buildroot; +Cc: Philippe MONTCHO

Release note:
https://github.com/dgibson/dtc/releases/tag/v1.8.1

- This commit also removes 0002-fix-discarded-const-qualifiers.patch,
since it has been merged in v1.8.0 already

- upstream dtc warns that Makefile-based builds are deprecated in
favor of Meson after version was updated. So we migrate to Meson build.

Signed-off-by: Philippe MONTCHO <philippemontcho@gmail.com>
---
 .../0002-fix-discarded-const-qualifiers.patch | 88 -------------------
 package/dtc/dtc.hash                          |  4 +-
 package/dtc/dtc.mk                            | 52 ++++-------
 3 files changed, 17 insertions(+), 127 deletions(-)
 delete mode 100644 package/dtc/0002-fix-discarded-const-qualifiers.patch

diff --git a/package/dtc/0002-fix-discarded-const-qualifiers.patch b/package/dtc/0002-fix-discarded-const-qualifiers.patch
deleted file mode 100644
index 95db886389..0000000000
--- a/package/dtc/0002-fix-discarded-const-qualifiers.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 9a1c801a1a3c102bf95c5339c9e985b26b823a21 Mon Sep 17 00:00:00 2001
-From: Stephen Gallagher <sgallagh@redhat.com>
-Date: Tue, 6 Jan 2026 14:19:30 -0500
-Subject: Fix discarded const qualifiers
-
-It's unsafe to implicitly discard the const qualifier on a pointer. In
-overlay_fixup_phandle(), this was probably just an oversight, and making
-the "sep" variable a const char * is sufficient to fix it.
-
-In create_node(), however, the "p" variable is directly modifying the
-buffer pointed to by "const char* node_name". To fix this, we need to
-actually make a duplicate of the buffer and operate on that instead.
-
-This introduces a malloc()/free()  and an unbounded strdup() into the
-operation, but fdtput isn't a long-running service and the node_name
-argument comes directly from argv, so this shouldn't introduce a
-significant performance impact.
-
-Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
-Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-Upstream: https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=9a1c801a1a3c102bf95c5339c9e985b26b823a21
-Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
-
----
- fdtput.c             | 8 +++++---
- libfdt/fdt_overlay.c | 3 ++-
- meson.build          | 1 +
- 3 files changed, 8 insertions(+), 4 deletions(-)
-
-diff --git a/fdtput.c b/fdtput.c
-index 05f2b93..fdb581a 100644
---- a/fdtput.c
-+++ b/fdtput.c
-@@ -254,19 +254,21 @@ static int create_paths(char **blob, const char *in_path)
- static int create_node(char **blob, const char *node_name)
- {
- 	int node = 0;
--	char *p;
-+	const char *p;
-+	char *path = NULL;
- 
- 	p = strrchr(node_name, '/');
- 	if (!p) {
- 		report_error(node_name, -1, -FDT_ERR_BADPATH);
- 		return -1;
- 	}
--	*p = '\0';
- 
- 	*blob = realloc_node(*blob, p + 1);
- 
- 	if (p > node_name) {
--		node = fdt_path_offset(*blob, node_name);
-+		path = xstrndup(node_name, (size_t)(p - node_name));
-+		node = fdt_path_offset(*blob, path);
-+		free(path);
- 		if (node < 0) {
- 			report_error(node_name, -1, node);
- 			return -1;
-diff --git a/libfdt/fdt_overlay.c b/libfdt/fdt_overlay.c
-index e6b9eb6..51a3859 100644
---- a/libfdt/fdt_overlay.c
-+++ b/libfdt/fdt_overlay.c
-@@ -407,7 +407,8 @@ static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off,
- 		const char *fixup_str = value;
- 		uint32_t path_len, name_len;
- 		uint32_t fixup_len;
--		char *sep, *endptr;
-+		const char *sep;
-+		char *endptr;
- 		int poffset, ret;
- 
- 		fixup_end = memchr(value, '\0', len);
-diff --git a/meson.build b/meson.build
-index 66b44e8..501b706 100644
---- a/meson.build
-+++ b/meson.build
-@@ -18,6 +18,7 @@ add_project_arguments(
-     '-Wshadow',
-     '-Wsuggest-attribute=format',
-     '-Wwrite-strings',
-+    '-Wdiscarded-qualifiers',
-   ]),
-   language: 'c'
- )
--- 
-cgit 1.2.3-korg
-
-
diff --git a/package/dtc/dtc.hash b/package/dtc/dtc.hash
index f05e902df0..391d63bc10 100644
--- a/package/dtc/dtc.hash
+++ b/package/dtc/dtc.hash
@@ -1,7 +1,7 @@
 # from https://www.kernel.org/pub/software/utils/dtc/sha256sums.asc
-sha256  92d8ca769805ae1f176204230438fe52808f4e1c7944053c9eec0e649b237539  dtc-1.7.2.tar.xz
+sha256  23526015a6f1550e0541a53fe7acea1b5a11e3697cdf3a3bdc076abc38f6045d  dtc-1.8.1.tar.xz
 
 # Hash for license files
-sha256  78e1e1ce5728a990d59c7de61d4741c49185d5129daf783b386380a214328d68  README.license
+sha256  8a516adc332c25503be9de4a511f9fce45370761a67046811b1c5a5268f2327a  README.license
 sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  GPL
 sha256  6313108c23efffa36948f8b2cff1560a5935373b527b0e1a837cc77e6ed1bacd  BSD-2-Clause
diff --git a/package/dtc/dtc.mk b/package/dtc/dtc.mk
index 5b810c6e65..bc4c264a61 100644
--- a/package/dtc/dtc.mk
+++ b/package/dtc/dtc.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-DTC_VERSION = 1.7.2
+DTC_VERSION = 1.8.1
 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)
@@ -14,24 +14,25 @@ DTC_INSTALL_STAGING = YES
 DTC_DEPENDENCIES = host-bison host-flex host-pkgconf
 HOST_DTC_DEPENDENCIES = host-bison host-flex host-pkgconf
 
-DTC_MAKE_OPTS = \
-	PREFIX=/usr \
-	NO_PYTHON=1 \
-	NO_VALGRIND=1
+DTC_CONF_OPTS = \
+	--prefix=/usr \
+	-Dpython=disabled \
+	-Dvalgrind=disabled \
+	-Dtests=false
 
 # For the host, we install headers in a special subdirectory to avoid
 # conflicts with the in-kernel libfdt copy.
-HOST_DTC_MAKE_OPTS = \
-	PREFIX=$(HOST_DIR) \
-	INCLUDEDIR=$(HOST_DIR)/include/libfdt \
-	NO_PYTHON=1 \
-	NO_VALGRIND=1 \
-	NO_YAML=1
+HOST_DTC_CONF_OPTS = \
+	--prefix=$(HOST_DIR) \
+	--includedir=$(HOST_DIR)/include/libfdt \
+	-Dpython=disabled \
+	-Dvalgrind=disabled \
+	-Dyaml=disabled
 
 ifeq ($(BR2_PACKAGE_LIBYAML),y)
 DTC_DEPENDENCIES += libyaml
 else
-DTC_MAKE_OPTS += NO_YAML=1
+DTC_CONF_OPTS += -Dyaml=disabled
 endif
 
 define DTC_POST_INSTALL_TARGET_RM_DTDIFF
@@ -52,28 +53,5 @@ DTC_INSTALL_GOAL = install-lib
 
 endif # $(BR2_PACKAGE_DTC_PROGRAMS) != y
 
-define DTC_BUILD_CMDS
-	$(TARGET_CONFIGURE_OPTS) $(MAKE) EXTRA_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) $(DTC_MAKE_OPTS) install-lib \
-		install-includes
-endef
-
-define DTC_INSTALL_TARGET_CMDS
-	$(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) EXTRA_CFLAGS="$(HOST_CFLAGS) -fPIC" -C $(@D) $(HOST_DTC_MAKE_OPTS)
-endef
-
-define HOST_DTC_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HOST_DTC_MAKE_OPTS) install
-endef
-
-$(eval $(generic-package))
-$(eval $(host-generic-package))
+$(eval $(meson-package))
+$(eval $(host-meson-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-13 13:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 14:17 [Buildroot] [PATCH 1/1] package/dtc: bump version to 1.8.1 and switch to meson build Philippe MONTCHO
2026-08-07 17:41 ` Julien Olivain via buildroot
2026-08-07 20:02 ` Fiona Klute via buildroot
2026-08-08  7:13   ` Julien Olivain via buildroot
2026-08-10  8:30     ` Philippe MONTCHO
2026-08-13 13:08 ` [Buildroot] [PATCH v2 " Philippe MONTCHO

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox