summaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)Author
4 daysMerge patch series "kbuild: Update Makefile.extrawarn to 5.1"Tom Rini
This series from Ilias Apalodimas <ilias.apalodimas@linaro.org> largely finishes the re-sync with the Linux Kernel v5.1 kbuild system. Link: https://lore.kernel.org/r/20250627185723.342553-1-ilias.apalodimas@linaro.org
4 dayskbuild: Bump the build system to 5.1Ilias Apalodimas
Our last sync with the kernel was 5.1. Even that was a partial one as some patches from 4.x kernels were already missing making the transition to a modern kbuild infeasible. 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 Makefile[.lib/.kbuild]. Unfortunately due to sheer amount of patches this is not easy to review, but that's what we decided during a community call. One of the biggest changes is get rid of partial linking entirely and build .a archives isntead of .o. We diaviate from the kernel on that. Instead of calling a custom script to create the archive symbol table, we call ar with rcTP (isntead of rcSTP) since we want a resulting archive that's sauble with the linker. The only affected platforms are PPC ones. Unfortunately I don't have any of them around to test, but the objdump of the resulting files -- arch/powerpc/lib/built-in.[oa] looks identical. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 dayskbuild: Update Makefile.extrawarn to 5.1Ilias Apalodimas
Since we are updating our kbuild system to 5.1, add the relevant clang changes from upstream Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
5 daysMerge branch 'next'Tom Rini
2025-06-26pylibfdt: correct license information (further)Quentin Schulz
Since commit 51ec8db23280 ("pylibfdt: correct license information"), the License classifiers are gone so I assume setuptools now extract the license from the license argument to setuptools.setup() function. It's always been incorrect as far as I could tell, so let's fix this with the appropriate info from the SPDX License identifier at the top of the file. It was missing GPL-2.0-or-later and we disambiguate by using BSD-2-Clause instead of simply BSD. Fixes: 6b08fb5cc44f ("fdt: Move to setuptools") Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-06-19dtc: Add Kconfig option to pad device tree blobEric Schikschneit
This will allow arch(s) that use device tree blobs to pad the end of the device tree so they can be modified by board files at run time. This will help prevent errors such as FDT_ERR_NOSPACE from occurring. Signed-off-by: Eric Schikschneit <eric.schikschneit@novatechautomation.com> [trini: Change default order so that X86 && EFI_APP works correctly]
2025-06-11kbuild: use assignment instead of define ... endef for filechk_* rulesIlias Apalodimas
Backported from kernel commit ba97df45581f ("kbuild: use assignment instead of define ... endef for filechk_* rules") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-06-09Merge tag 'v2025.07-rc4' into nextTom Rini
Prepare v2025.07-rc4
2025-06-09pylibfdt: correct license informationHeinrich Schuchardt
Setuptools 78.1.1 shows warnings: * Pattern 'GPL' did not match any files. * Pattern 'BSD-2-Clause' did not match any files. * SetuptoolsDeprecationWarning: License classifiers are deprecated. Cf. https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Bryan Brattlof <bb@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-06-06Merge patch series "Remove as much arch/arm/dts/*.h as possible"Tom Rini
Tom Rini <trini@konsulko.com> says: Taking inspiration from Heiko's patch[1] this series goes and cleans up all of the arch/arm/dts/*.h files that can be easily removed. The big challenge I ran in to here was that for some platforms that aren't using OF_UPSTREAM were didn't have a sufficiently deep search path to find files there rather than arch/arm/dts. This also showed that only ARM had local header files to deal with. [1]: https://lore.kernel.org/u-boot/20250528090536.765499-1-heiko.thiery@gmail.com/ Link: https://lore.kernel.org/r/20250528233050.3820722-1-trini@konsulko.com
2025-06-06scripts/Makefile.lib: Rework upstream_dtsi_include to get subdirectoriesTom Rini
A problem with the logic in upstream_dtsi_include currently is that it does not list directories such as dts/upstream/src/arm/nxp/imx and so will not findi "imx6ul-pinfunc.h" for example as it is normally and correctly included without vendor sub-paths. Expand the current wildcard glob to catch these directories too. Reviewed-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2025-06-05scripts/setlocalversion: sync with linux v6.15Tom Rini
The changes upstream since the last sync at commit 5c02350fa03d ("scripts/setlocalversion: sync with linux v6.9") are e2ff1219a554 setlocalversion: add -e option 523f3dbc187a setlocalversion: work around "git describe" performance Signed-off-by: Tom Rini <trini@konsulko.com>
2025-06-02scripts/spelling.txt: Sync script with kernel v6.15Tom Rini
Keep spelling.txt in sync with the version from kernel v6.15. Reported-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Yao Zi <ziyao@disroot.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-29Merge patch series "Update kbuild"Tom Rini
Ilias Apalodimas <ilias.apalodimas@linaro.org> says: Last time the kbuild scripts were synced with the Linux kernel was on the 4.20 release. Updating directly to 6.x makes the diff difficult to read, so let's do the changes incrementally and bump to 5.1 first. Since the number of commits is big, I am splitting this in multiple series. This one includes most of the commits for Makefile.build, Makefile.lib and some from Makefile. commit eeb5687a7139649e ("kbuild: add -Werror=strict-prototypes flag unconditionally") commit 3812b8c5c5d5 ("kbuild: make -r/-R effective in top Makefile for old Make versions") commit b421b8a6cb87 ("kbuild: remove unused archmrproper") commit 1a49b2fd8f58 ("kbuild: strip whitespace in cmd_record_mcount findstring") commit 88110713ca9dfb ("kbuild: hardcode genksyms path and remove GENKSYMS variable") commit 1d8001ef358 ("kbuild: generate modules.order only when CONFIG_MODULES=y") commit 45c4372d00 ("kbuild: refactor quiet_modtag") commit b39a691617e4 commit ("kbuild: remove redundant quiet_modtag for $(obj-m)") commit 5439f09f488f ("kbuild: remove redundant 'set -e' from cmd_* defines") commit e5d289100d3a ("kbuild: remove trailing semicolon from cmd_* passed to if_changed_rule") commit 3a2429e1faf4 ("kbuild: change if_changed_rule for multi-line recipe") commit ee3e46b7efd2 ("kbuild: refactor modversions build rules") commit 4317ee3b6a5e ("kbuild: remove redundant 'set -e' from sub_cmd_record_mcount") commit 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd files") commit 898f5a009f22 ("kbuild: move archive command to scripts/Makefile.lib") commit b79c6aa6a1f1 ("kbuild: remove unnecessary in-subshell execution") commit afa974b77128 ("kbuild: add real-prereqs shorthand for $(filter-out FORCE,$^)") commit ecbd10d90e94 ("kbuild: simplify rules of data compression with size appending") commit 58156ba4468f ("kbuild: skip 'addtree' and 'flags' magic for external module build") commit 172caf1993b7 ("kbuild: remove redundant target cleaning on failure") commit f3fd4a3f3a38 ("kbuild: remove redundant 'set -e' from filechk_offsets") commit a2237fec1e06 ("kbuild: Enable dtc graph_port warning by default") commit 70523a3ce5ff ("kbuild: disable dtc simple_bus_reg warnings by default") commit e4aca4595005 ("kbuild: de-duplicate fixdep usage") Link: https://lore.kernel.org/r/20250520052153.307194-1-ilias.apalodimas@linaro.org
2025-05-29kbuild: strip whitespace in cmd_record_mcount findstringIlias Apalodimas
Backport from kernel commit 1a49b2fd8f58 ("kbuild: strip whitespace in cmd_record_mcount findstring") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: hardcode genksyms path and remove GENKSYMS variableIlias Apalodimas
Back port from kernel although it's not used since it makes diffing easier. commit 88110713ca9dfb ("kbuild: hardcode genksyms path and remove GENKSYMS variable") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: generate modules.order only when CONFIG_MODULES=yIlias Apalodimas
Backport from kernel although it is unused since it makes diffing easier. commit 1d8001ef358 ("kbuild: generate modules.order only when CONFIG_MODULES=y") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: refactor quiet_modtagIlias Apalodimas
Backport from kernel commit 45c4372d00 ("kbuild: refactor quiet_modtag") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: remove redundant quiet_modtag for $(obj-m)Ilias Apalodimas
Backported from kernel commit b39a691617e4 commit ("kbuild: remove redundant quiet_modtag for $(obj-m)") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: remove redundant 'set -e' from cmd_* definesIlias Apalodimas
Backported from kernel commit 5439f09f488f ("kbuild: remove redundant 'set -e' from cmd_* defines") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: remove trailing semicolon from cmd_* passed to if_changed_ruleIlias Apalodimas
Backport from kernel commit e5d289100d3a ("kbuild: remove trailing semicolon from cmd_* passed to if_changed_rule") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: change if_changed_rule for multi-line recipeIlias Apalodimas
Backport from kernel commit 3a2429e1faf4 ("kbuild: change if_changed_rule for multi-line recipe") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: refactor modversions build rulesIlias Apalodimas
Backport from kernel commit ee3e46b7efd2 ("kbuild: refactor modversions build rules") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: remove redundant 'set -e' from sub_cmd_record_mcountIlias Apalodimas
Back from kernel commit 4317ee3b6a5e ("kbuild: remove redundant 'set -e' from sub_cmd_record_mcount") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: let fixdep directly write to .*.cmd filesIlias Apalodimas
Backport from kernel commit 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd files") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: move archive command to scripts/Makefile.libIlias Apalodimas
Backport from kernel commit 898f5a009f22 ("kbuild: move archive command to scripts/Makefile.lib") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: remove unnecessary in-subshell executionIlias Apalodimas
Backport kernel changes commit b79c6aa6a1f1 ("kbuild: remove unnecessary in-subshell execution") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: add real-prereqs shorthand for $(filter-out FORCE, $^)Ilias Apalodimas
Backport from kernel commit afa974b77128 ("kbuild: add real-prereqs shorthand for $(filter-out FORCE,$^)") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: simplify rules of data compression with size appendingIlias Apalodimas
Backport kernel changes commit ecbd10d90e94 ("kbuild: simplify rules of data compression with size appending") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: skip 'addtree' and 'flags' magic for external module buildIlias Apalodimas
Backport from kernel commit 58156ba4468f ("kbuild: skip 'addtree' and 'flags' magic for external module build") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: remove redundant target cleaning on failureIlias Apalodimas
Bacport from the kernel commit 172caf1993b7 ("kbuild: remove redundant target cleaning on failure") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: remove redundant 'set -e' from filechk_offsetsIlias Apalodimas
Backport changes from the kernel commit f3fd4a3f3a38 ("kbuild: remove redundant 'set -e' from filechk_offsets") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: Enable dtc graph_port warning by defaultIlias Apalodimas
Backport changes from the kernel commit a2237fec1e06 ("kbuild: Enable dtc graph_port warning by default") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: disable dtc simple_bus_reg warnings by defaultIlias Apalodimas
Backport changes from the kernel commit 70523a3ce5ff ("kbuild: disable dtc simple_bus_reg warnings by default") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29kbuild: de-duplicate fixdep usageIlias Apalodimas
Backported from the linux kernel commit e4aca4595005 ("kbuild: de-duplicate fixdep usage") A lot of the kernels kbuild depend on that patch. Backport it and pull in the 'rule_as_o_S'a rule as well. This might end up being unused but it doesn't break anything and makes diffing the files easier. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29scripts/setlocalversion: Reinstate .scmversion supportMarek Vasut
The .scmversion is used by oe-core to append U-Boot version string. LOCALVERSION is not fully compatible replacement as it adds trailing "-dirty" string at the end of version string in case the U-Boot git tree contains uncommitted changes. This behavior itself is correct. However, OE builds do clone U-Boot sources from git and may apply additional patches on top, which are not tracked in U-Boot git tree, but rather in the OE metalayer git tree, which leads to the addition of "-dirty" string as well. The .scmversion used by oe-core used to replace the version string suffix fully, including the "-dirty" string. Reinstate support for the .scmversion to let OE core do exactly that as it used to do it. Fixes: 5c02350fa03d ("scripts/setlocalversion: sync with linux v6.9") Signed-off-by: Marek Vasut <marex@denx.de>
2025-05-11scripts/Makefile.lib: add PLATFORM_LIBGCC to efi linkingAdriano Cordova
Link .efi applications using libgcc Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
2025-05-05Makefile: Strip leading spaces when preprocessing generated_defconfigYao Zi
Clang's preprocessor may emit extra spaces for lines starting with '#'. Lines with these extra characters cannot be handled by Kconfig and will be ignored with warnings like, unexpected data: # CONFIG_OF_BOARD_FIXUP is not set Those options that is expected to be assigned explicitly with N will be set to the default value, messing up board configurations. Let's sed these spaces away to ensure board configurations could be correctly generated with Clang. Link: https://github.com/llvm/llvm-project/issues/78778 Fixes: 2027e99e61a ("Makefile: Run defconfig files through the C preprocessor") Reported-by: Nathaniel Hourt <I@nathaniel.land> Signed-off-by: Yao Zi <ziyao@disroot.org>
2025-04-24tools/make_pip: Use venv when invoking pipMattijs Korpershoek
Recent Ubuntu versions (24.04+) disallow pip by default when installing packages. The recommended approach is to use a virtual environment (venv) instead. Because of this, "make pip" is failing on such versions. To prepare CI container migration to Ubuntu 24.04, use a venv in the make_pip script. Note: This has been reported on [1] [1] https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/37 Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-04-11Merge patch series "Switch to using $(PHASE_) in Makefiles"Tom Rini
Tom Rini <trini@konsulko.com> says: This series switches to always using $(PHASE_) in Makefiles when building rather than $(PHASE_) or $(XPL_). It also starts on documenting this part of the build, but as a follow-up we need to rename doc/develop/spl.rst and expand on explaining things a bit. Link: https://lore.kernel.org/r/20250401225851.1125678-1-trini@konsulko.com
2025-04-11Kbuild: Always use $(PHASE_)Tom Rini
It is confusing to have both "$(PHASE_)" and "$(XPL_)" be used in our Makefiles as part of the macros to determine when to do something in our Makefiles based on what phase of the build we are in. For consistency, bring this down to a single macro and use "$(PHASE_)" only. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-04-11efi_loader: Move public cert for capsules to .rodataIlias Apalodimas
commit ddf67daac39d ("efi_capsule: Move signature from DTB to .rodata") was reverted in commit 47a25e81d35c ("Revert "efi_capsule: Move signature from DTB to .rodata"") because that's what U-Boot was usually doing -- using the DT to store configuration and data. Some of the discussions can be found here [0]. (Ab)using the device tree to store random data isn't ideal though. On top of that with new features introduced over the years, keeping the certificates in the DT has proven to be problematic. One of the reasons is that platforms might send U-Boot a DTB from the previous stage loader using a transfer list which won't contain the signatures since other loaders are not aware of internal U-Boot ABIs. On top of that QEMU creates the DTB on the fly, so adding the capsule certificate there does not work and requires users to dump it and re-create it injecting the public keys. Now that we have proper memory permissions for arm64, move the certificate to .rodata and read it from there. [0] https://lore.kernel.org/u-boot/CAPnjgZ2uM=n8Qo-a=DUkx5VW5Bzp5Xy8=Wgmrw8ESqUBK00YJQ@mail.gmail.com/ Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Tested-by: Jonathan Humphreys <j-humphreys@ti.com> # on TI sk-am62p-lp Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-A311D-CC Tested-by: Raymond Mao <raymond.mao@linaro.org>
2025-04-10dtc: introduce label relative path referencesPatrice Chotard
Since introduction of OF_UPSTREAM flag, U-Boot's dtc must be able to compile Kernel's device tree. Since kernel commit 7de129f5389b ("ARM: dts: stm32: stm32mp151a-prtt1l: Fix QSPI configuration"), label relative path references has been introduced. These label relative path references is not supported by current U-Boot dtc version 1.5.0: (see mailing list discussion [1]). In order to support such label relative patch references adds following commit from upstream DTC tree: commit 651410e54cb9 ("util: introduce xstrndup helper") commit ec7986e682cf ("dtc: introduce label relative path references") [1] https://lore.kernel.org/all/20250115144428.GZ3476@bill-the-cat/T/ Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2025-03-24Merge tag 'v2025.04-rc5' into nextTom Rini
Prepare v2025.04-rc5
2025-03-18checkpatch.pl: Report an error for CONFIG_xPL_BUILD in device treesHendrik Donner
The defines for the different build phases shouldn't be used in device trees, currently they aren't even defined for device tree pre processing, resulting in build errors. Link: https://lists.denx.de/pipermail/u-boot/2025-March/582787.html Signed-off-by: Hendrik Donner <hd@os-cillation.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2025-03-18scripts: typos in event_dump.pyHeinrich Schuchardt
%s/even spies/event spies/ %s/EFL/ELF/ Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-03-17scripts/Makefile.lib: efi: Preserve the .dynstr section as wellSam Edwards
This section is required by .dynamic and llvm-objcopy will exit with a fatal error if it is not also preserved in the output. Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2025-03-13Kconfig: Introduce CONFIG_WERRORPaul Barker
Add a new config option under "General setup" to enable the -Werror flag when building U-Boot. This is useful during development to help catch mistakes. This is based on a similar config option added to the Linux kernel by Linus in 2021 - see Linux commit 3fe617ccafd6 ("Enable '-Werror' by default for all kernel builds"). The modification of KBUILD_CFLAGS is done in Makefile.extrawarn, matching where it was moved in the kernel by Linux commit e88ca24319e4 ("kbuild: consolidate warning flags in scripts/Makefile.extrawarn"). Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2025-03-05scripts/checkpatch.pl: Upgrade IS_ENABLED_CONFIG to error for U-BootTom Rini
A problem we have today is that some instances of IS_ENABLED(FOO) have crept in to the code. This is in turn because with checkpatch.pl this is only a warning and not an error, so they were overlooked. And looking deeper, in the Linux kernel this pattern is allowed because IS_ENABLED(DEFINED_FLAG) is allowed if discouraged and a quick skim of the instances I saw in the current kernel follow this pattern. In U-Boot however, this is not allowed, so bump to an error. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-01-18Merge tag 'efi-2025-04-rc1' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request efi-2025-04-rc1 Documentation: * Correct the defconfig name in the coolpi documentation UEFI: * Carve out the biggest part of the RISC-V and ARM linker scripts for EFI binary into a common include. * Correct the values of SizeOfCode and SizeOfInitializedData in generated EFI binaries for RISC-V and ARM. * Avoid gaps between sections in EFI binaries causing a failure in secure boot. * Makefile: let clean remove capsule_in.capsule*.efi-capsule * Refactor some of the code used for launching EFI binaries.