summaryrefslogtreecommitdiff
path: root/scripts/dtc/Makefile
AgeCommit message (Collapse)Author
8 daysscripts/dtc: Fix pkg-config behavior under sysrootGreg Malysa
When building with a toolchain that uses a modified sysroot (such as a Yocto-generated SDK) that does not include libyaml, on a host that does have libyaml, building dtc will fail with errors like: HOSTLD scripts/dtc/dtc /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: scripts/dtc/yamltree.o: in function `yaml_propval_int': yamltree.c:(.text+0x167): undefined reference to `yaml_sequence_start_event_initialize' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: yamltree.c:(.text+0x172): undefined reference to `yaml_emitter_emit' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: yamltree.c:(.text+0x1e8): undefined reference to `yaml_scalar_event_initialize' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: yamltree.c:(.text+0x1f5): undefined reference to `yaml_emitter_emit' (... rest of errors truncated ...) This happens because the test looks for the file in the default path but uses pkg-config, which is affected by changing sysroot, to determine the correct linker arguments. This does not happen when building entirely within yocto, as pseudo will intercept and rewrite the file path when trying to test for /usr/include/yaml.h to match the sysroot and thus generate consistent behavior. This commit adds the PKG_CONFIG_SYSROOT_DIR prefix to the file path in order to test against the same conditions that are used to resolve the build flags for libyaml. In linux commit ef8795f3f1c ("dt-bindings: kbuild: Use DTB files for validation"), including yaml is disabled again anyway because of other problems that it causes, so this problem can also be addressed by partially backporting that commit instead and simply disabling the yaml support. Fixes: 0535e46d55d7 ("scripts/dtc: Update to upstream version v1.7.2-35-g52f07dcca47c") Signed-off-by: Greg Malysa <malysagreg@gmail.com>
2026-01-05scripts/dtc: Update to upstream version v1.7.2-35-g52f07dcca47cMarek Vasut
Synchronize local copy of DTC with Linux 6.17 . This includes the following picked and squashed commits from Linux kernel. The squash was necessary, since the DTC here contains changes which were also part of DTC in Linux alraedy, and the squash helped resolve those without going back and forth with the changes. The following commits from Linux are picked: 8f324cd712df7 # scripts/dtc: consolidate include path options in Makefile b5b3d9b63b0ee # scripts/dtc: Add yamltree.c to dtc sources 7d97a76f226d6 # scripts/dtc: Update to upstream version v1.4.7-14-gc86da84d30e4 ea6f243be74e5 # scripts/dtc: Update to upstream version v1.4.7-57-gf267e674d145 02d435d4eccd8 # scripts/dtc: Update to upstream version v1.5.0-23-g87963ee20693 6e321b7637396 # scripts/dtc: Update to upstream version v1.5.0-30-g702c1b6c0e73 9f19ec91a7a35 # scripts/dtc: dtx_diff - add color output support 8287d642f38d1 # scripts/dtc: Update to upstream version v1.5.1-22-gc40aeb60b47a 4c52deef9225d # scripts/dtc: Revert "yamltree: Ensure consistent bracketing of properties with phandles" 5d3827e1452ed # scripts/dtc: Remove unused makefile fragments 40dd266887654 # scripts/dtc: Update to upstream version v1.6.0-2-g87a656ae5ff9 8d4cf6b6acb59 # scripts/dtc: use pkg-config to include <yaml.h> in non-standard path b9bf9ace5ae90 # scripts/dtc: Update to upstream version v1.6.0-11-g9d7888cbf19c 69a883b6f5ac0 # scripts/dtc: dtx_diff - make help text formatting consistent 8f829108b8aed # scripts/dtc: only append to HOST_EXTRACFLAGS instead of overwriting b39b4342ac495 # scripts/dtc: Update to upstream version v1.6.0-31-gcbca977ea121 93c6424c486b3 # scripts: dtc: Fetch fdtoverlay.c from external DTC project 0dd574a1d75c3 # scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9 ec38b5df8a231 # scripts: dtc: Build fdtoverlay tool a0c8c431411f5 # scripts: dtc: Remove the unused fdtdump.c file e7dc653d4e890 # scripts/dtc: Add missing fdtoverlay to gitignore d2bf5d2e3f09c # scripts/dtc: Update to upstream version v1.6.1-19-g0a3a9d3449c8 a60878f5532d0 # scripts/dtc: dtx_diff: remove broken example from help text 8b739d8658a9b # scripts/dtc: Call pkg-config POSIXly correct b6eeafa67df00 # scripts/dtc: Update to upstream version v1.6.1-63-g55778a03df61 f96cc4c787588 # scripts/dtc: Update to upstream version v1.6.1-66-gabbd523bae6e 09ab9c092ef2b # scripts/dtc: Update to upstream version v1.7.0-93-g1df7b047fe43 ded8a5a498f2d # scripts/dtc: Update to upstream version v1.7.0-95-gbcd02b523429 ee6ff6fca7e71 # scripts/dtc: Update to upstream version v1.7.2-35-g52f07dcca47c This also includes forward port of U-Boot commit e8c2d25845c7 ("libfdt: Revert 6dcb8ba4 from upstream libfdt") to avoid binary size growth. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2026-01-02kbuild: Bump the build system to 6.1Sughosh Ganu
Our last sync with the kernel was 5.1. We are so out of sync now, that tracking the patches and backporting them one by one makes little sense and it's going to take ages. This is an attempt to sync up Makefiles to 6.1. Unfortunately due to sheer amount of patches this is not easy to review, but that's what we decided during a community call for the bump to 5.1, so we are following the same guidelines here. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>a #rebased on -next
2023-09-22Allow Python packages to be droppedSimon Glass
When building in a portage chroot, we do not have the environment needed to build pylibfdt. It is instead build as a separate package. Provide a build option to tell U-Boot to skip this part of the build. We still need it to use binman, etc. but don't need it to build its dependencies. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [s/build bytes/builds bytes in tools.rst] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2020-04-10kconfig / kbuild: Re-sync with Linux 4.19Tom Rini
Align Kconfig and Kbuild logic to Linux 4.19 release with minimal impact on files outside of this scope. Our previous Kconfig sync was done by commit 5972ff077e0f ("kconfig / kbuild: re-sync with Linux 4.18"). In this particular re-sync in order to keep clang support working a number of related changes needed to be pulled in that had been missed previously. Not all of these changes we easily traceable and so have been omitted from the list below. The imported Linux commits are: [From prior to v4.18] 9f3f1fd29976 kbuild: Add __cc-option macro d7f14c66c273 kbuild: Enable Large File Support for hostprogs 6d79a7b424a5 kbuild: suppress warnings from 'getconf LFS_*' 24403874316a Shared library support 86a9df597cdd kbuild: fix linker feature test macros when cross compiling with Clang 0294e6f4a000 kbuild: simplify ld-option implementation [From v4.18 to v4.19] 96f14fe738b6 kbuild: Rename HOSTCFLAGS to KBUILD_HOSTCFLAGS 10844aebf448 kbuild: Rename HOSTCXXFLAGS to KBUILD_HOSTCXXFLAGS b90a368000ab kbuild: Rename HOSTLDFLAGS to KBUILD_HOSTLDFLAGS 8377bd2b9ee1 kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS f92d19e0ef9b kbuild: Use HOST*FLAGS options from the command line 4ab3b80159d4 kconfig: check for pkg-config on make {menu,n,g,x}config 693359f7ac90 kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE f60b992e30ff kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags) 2fb9279f2c3e kbuild: change ld_flags to contain LDFLAGS_$(@F) c931d34ea085 arm64: build with baremetal linker target instead of Linux when available 5accd7f3360e kconfig: handle format string before calling conf_message_callback() a2ff4040151a kconfig: rename file_write_dep and move it to confdata.c 0608182ad542 kconfig: split out useful helpers in confdata.c adc18acf42a1 kconfig: remove unneeded directory generation from local*config 79123b1389cc kconfig: create directories needed for syncconfig by itself 16952b77d8b5 kconfig: make syncconfig update .config regardless of sym_change_count d6c6ab93e17f kbuild: remove deprecated host-progs variable 56869d45e364 kconfig: fix the rule of mainmenu_stmt symbol c151272d1687 kconfig: remove unused sym_get_env_prop() function 1880861226c1 kconfig: remove P_ENV property type e3fd9b5384f3 scripts/dtc: consolidate include path options in Makefile 4bf6a9af0e91 kconfig: add build-only configurator targets f1575595d156 kconfig: error out when seeing recursive dependency 5e8c5299d315 kconfig: report recursive dependency involving 'imply' f498926c47aa kconfig: improve the recursive dependency report 98a4afbfafd2 kconfig: fix "Can't open ..." in parallel build 9a9ddcf47831 kconfig: suppress "configuration written to .config" for syncconfig 87a32e624037 kbuild: pass LDFLAGS to recordmcount.pl d503ac531a52 kbuild: rename LDFLAGS to KBUILD_LDFLAGS 217c3e019675 disable stringop truncation warnings for now bc8d2e20a3eb kconfig: remove a spurious self-assignment fd65465b7016 kconfig: do not require pkg-config on make {menu,n}config 5a4630aadb9a ftrace: Build with CPPFLAGS to get -Qunused-arguments Note that this adds new cleanup work to do in that we should adapt the shared library support we have to what is now upstream. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
2018-05-31scripts/dtc: Re-sync with Linux 4.17-rc4Eugeniu Rosca
To achieve a DTC state (more or less) equivalent to Linux 4.17-rc4, backport the DTC-specific part from below Linux commits: b23d1a241f4eb4 ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically") 9a8dfb394c0467 ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile") 59889300274569 (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore") e039139be8c251 ("scripts/dtc: generate lexer and parser during build instead of shipping") b24413180f5600 ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license") With this commit, the diff between Linux and U-boot common DTC files is: $ git diff --stat --diff-filter=M v4.17-rc4 <this-commit> -- scripts/dtc scripts/dtc/.gitignore | 2 +- scripts/dtc/Makefile | 3 +++ The delta is coming from U-boot commits: * v2017.11 de163ecedb8a ("scripts: dtc: Add .gitignore") * v2018.01 15b97f5c5e6d ("pylibfdt: move pylibfdt to scripts/dtc/pylibfdt and refactor makefile") Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-11-17pylibfdt: compile pylibfdt only when dtoc/binman is necessaryMasahiro Yamada
Currently, pylibfdt is always compiled if swig is installed on your machine. It is really annoying because most of targets (excepts x86, sunxi, rockchip) do not use dtoc or binman. "checkbinman" and "checkdtoc" are wrong. It is odd that the final build stage checks if we have built necessary tools. If your platform depends on dtoc/binman, you must be able to build pylibfdt. If swig is not installed, it should fail immediately. I added PYLIBFDT, DTOC, BINMAN entries to Kconfig. They should be property select:ed by platforms that need them. Kbuild will descend into scripts/dtc/pylibfdt/ only when CONFIG_PYLIBFDT is enabled. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-17pylibfdt: move pylibfdt to scripts/dtc/pylibfdt and refactor makefileMasahiro Yamada
The pylibfdt is used by dtoc (and, indirectly by binman), but there is no reason why it must be generated in the tools/ directory. Recently, U-Boot switched over to the bundled DTC, and the directory structure under scripts/dtc/ now mirrors the upstream DTC project. So, scripts/dtc/pylibfdt is the best location. I also rewrote the Makefile in a cleaner Kbuild style. The scripts from the upstream have been moved as follows: lib/libfdt/pylibfdt/setup.py -> scripts/dtc/pylibfdt/setup.py lib/libfdt/pylibfdt/libfdt.i -> scripts/dtc/pylibfdt/libfdt.i_shipped The .i_shipped is coped to .i during building because the .i must be located in the objtree when we build it out of tree. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-09-23scripts/dtc: Update to upstream version v1.4.3Tom Rini
Using the update-dtc-source.sh script from Linux v4.14-rc1 import the portions of dtc that we require. We bring in update-dtc-source.sh and scripts/dtc/Makefile from Linux v4.14-rc1. Rework DTC_FLAGS handling to not require a test. Signed-off-by: Tom Rini <trini@konsulko.com>