1691 Commits

Author SHA1 Message Date
David Lechner
726d11289f scripts/Makefile.autoconf: use abs_srctree for out-of-tree symlink
Replace usage of $(srctree) with $(abs_srctree) when creating a symlink
to include/asm/arch in out of tree builds.

When building_out_of_srctree is true, $(srctree) is just "..", so the
created symlink was broken, for example:

    build-mt8365_evk/include/asm/arch -> ../arch/arm/include/asm/arch-mediatek

Which would resolve to a non-existent path:

    build-mt8365_evk/include/asm/arch/arm/include/asm/arch-mediatek

To fix, we need to use the absolute path to the source tree since we
don't know where the build tree is located relative to the source tree.

Fixes: bd3f9ee679b4 ("kbuild: Bump the build system to 6.1")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Tested-by: Sean Anderson <sean.anderson@linux.dev>
2026-01-06 14:42:48 -06:00
Kuan-Wei Chiu
eea1c6ec4e checkpatch: Add check for space indentation in Kconfig
U-Boot requires Kconfig options to be indented with tabs, whereas Linux
allows spaces. Add a U-Boot specific check to warn when spaces are used
for indentation in Kconfig files.

To ensure this check is executed, move the u_boot_line() invocation in
process() to occur before the valid source file check. Previously,
Kconfig files were skipped by the file extension filter before the
U-Boot specific checks could run.

Example warning:

WARNING: Kconfig indentation should use tabs
+    bool

Link: https://lore.kernel.org/u-boot/20251222162026.GA847766@bill-the-cat/
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-01-06 13:04:03 -06:00
Marek Vasut
6cdd7597a2 kbuild: Produce diff between base DT and U-Boot augmented DT if DEVICE_TREE_DEBUG=1
In case DEVICE_TREE_DEBUG is set, produce a diff between the base DT and
DT with U-Boot extras, to show how much does the U-Boot DT differ from
the base DT. This is particularly useful together with OF_UPSTREAM, to
minimize the diff between upstream DTs and U-Boot DTs.

This requires DTC 1.7.2 which does not resolve phandles when used in
the 'dtc -I dts -O dts ...' mode. With older DTC, the diff is full of
churn due to the resolved phandles.

Example usage:
$ make r8a779g3_sparrowhawk_defconfig && make DEVICE_TREE_DEBUG=1
$ cat ./dts/upstream/src/arm64/renesas/r8a779g3-sparrow-hawk.dtb.diff

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2026-01-05 09:02:19 -06:00
Marek Vasut
0535e46d55 scripts/dtc: Update to upstream version v1.7.2-35-g52f07dcca47c
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-05 09:01:59 -06:00
Sughosh Ganu
bd3f9ee679 kbuild: Bump the build system to 6.1
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
2026-01-02 10:28:14 -06:00
Tom Rini
6d04828b45 dm: Remove pre-schema tag support
Support for using "u-boot,dm-..." rather than "bootph-..." has been
deprecated since February 2023. Any platforms using this have had a
console message saying to migrate by 2023.07. Go and remove all support
here now, for the v2026.01 release.

The results of this change that aren't clear from the above are that we
still have a checkpatch.pl error message, and document in
doc/develop/spl.rst that they have been migrated since 2023. We also
change the key2dtsi.py tool to use the correct bootph phase rather than
the legacy phase.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-11-10 11:30:56 -06:00
James Hilliard
951c5a2964 Makefile: pass KEYDIR when set to sunxi-spl.bin mkimage
Currently we pass this for u-boot-spl.kwb targets, however when
building sunxi-spl.bin in the TOC0 format we may also need to
specify a KEYDIR, as such we should also pass this when set
to mkimage for the sunxi-spl.bin target.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2025-10-27 00:44:53 +00:00
Kory Maincent
ddde9ac63d scripts/checkpatch.pl: Resync with v6.17
This resyncs us with the version found in v6.17 of the Linux kernel with
the following exceptions:
- Keep our u-boot specific tests / code area.
- Keep the location of our checkpatch.rst
- Change the "use strscpy" test as we don't have that to strlcpy
- Keep debug/printf in the list for $logFunctions
- Keep checks to "env" files
- Keep our tests for strncpy/strncat

This also syncs the spdxcheck.py tool and all the associated
documentation.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
[trini: Keep our strlcpy/cat check]
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-10-08 17:18:36 -06:00
Tom Rini
40888b1e4c scripts: checkpatch.pl: Extend some checks to "env" files
In order for the U-Boot specific tests we've added (along with the long
line test) to be run on ".env" files as well, we need to update the line
in the process function that starts to limit the file extensions that we
test on.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-09-26 16:47:06 -06:00
Javier Tia
1b5a8ff3fd Lindent: Remove wrapper around indent tool
The Linux kernel has not maintained the same script since 2017-11-01,
and with clang-format included in U-Boot, it is not required anymore.

Signed-off-by: Javier Tia <javier.tia@linaro.org>
2025-09-16 13:45:00 -06:00
Tom Rini
123cd77122 pylibfdt: setup.py: Drop license_files
On more recent versions of setuptools the warning about not being able
to find the files specified in license_files has re-appeared. This is
because as best I can tell, it can't and won't look in $(srctree) but
rather only subdirectories of scripts/dtc/pylibfdt. Since we already
provide both SPDX tags and a license field with the SPDX contents, let
us just drop license_files as it's not mandatory.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-08-07 11:16:12 -06:00
Philip Molloy
007610da2c Makefile: Remove expansion of undefined variable
The U-Boot environment was previously stored in the boot loader stream
using ldr, but it has been replaced by the default environment built
into the U-Boot executable or an environment on external storage

Fixes: ea3310e8aafa ("Blackfin: Remove")

Signed-off-by: Philip Molloy <philip.molloy@analog.com>
Reviewed-by: Greg Malysa <malysagreg@gmail.com>
2025-08-04 18:23:16 -06:00
Tom Rini
9be6c5f967 Merge patch series "kbuild: Update Makefile.extrawarn to 5.1"
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
2025-07-08 13:10:12 -06:00
Ilias Apalodimas
5f520875bd kbuild: Bump the build system to 5.1
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>
2025-07-08 13:10:03 -06:00
Ilias Apalodimas
22595e7430 kbuild: Update Makefile.extrawarn to 5.1
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>
2025-07-08 13:10:02 -06:00
Tom Rini
6d0b8874fd Merge branch 'next' 2025-07-07 14:10:59 -06:00
Quentin Schulz
5f732b4bb0 pylibfdt: correct license information (further)
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-26 12:10:58 -06:00
Eric Schikschneit
5ba5cbf5a2 dtc: Add Kconfig option to pad device tree blob
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-19 19:00:09 -06:00
Ilias Apalodimas
a76fb6981f kbuild: use assignment instead of define ... endef for filechk_* rules
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-11 16:21:36 -06:00
Tom Rini
59d00e20fc Prepare v2025.07-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmhHWBoACgkQFHw5/5Y0
 tyxXAQv/T9LMNIwewuJ3EsJavypFdXb1p33PmbRELYK8S96CpTBBJXCoDAc6+Xfu
 ilUES9Weml8Ott+L3CbJTUtohLRfrWZGW6cx8/nYOhhUFWDqkCdpWGnEFPM0Basp
 lyBBxzqxPH5TbUQPUnhJ/2n1LclaF7tehn7GwDQUdQRsAc3fsJr+4Yx+TjeY30YQ
 CcYC+AvJ/M0ev2EmHNsZZGY9xJi67KdHLHNx6cEJ714BZihIu4EShVk7yvI9zM7O
 /hd4S10VGqHltB1KCRfnbfSD68rzS2h2TI4QZg3Ye8ldU+ZCFeTeNhBgO89VMoh9
 2HhQxxvfGDyuUsmoThUHZGvdq2EmRcyIKjRteQzFhrJr2Gk905vdpIGQdej8EG1x
 w6okxdFOWEOXTMShHv72Gcx8PzTVFtTUcYYge7N85rVirZpZmBKvaFzBCfrZ6gEh
 x0n7o5LaZwc1jm8yuPiWZcCKi0Ve4AIXBjweQRXJ/A6Y0Z/vEYYybPKMRRTuNpSy
 OyXQK8/y
 =uKu6
 -----END PGP SIGNATURE-----

Merge tag 'v2025.07-rc4' into next

Prepare v2025.07-rc4
2025-06-09 16:28:28 -06:00
Heinrich Schuchardt
51ec8db232 pylibfdt: correct license information
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-09 14:07:21 -06:00
Tom Rini
e96b6c0c18 Merge patch series "Remove as much arch/arm/dts/*.h as possible"
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-06 13:54:42 -06:00
Tom Rini
c9b452acd9 scripts/Makefile.lib: Rework upstream_dtsi_include to get subdirectories
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-06 13:54:10 -06:00
Tom Rini
ef0eec3fa9 scripts/setlocalversion: sync with linux v6.15
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-05 16:57:35 -06:00
Tom Rini
afb3ab64cb scripts/spelling.txt: Sync script with kernel v6.15
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-06-02 10:26:04 -06:00
Tom Rini
6b749d09c0 Merge patch series "Update kbuild"
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-29 18:43:15 -06:00
Ilias Apalodimas
25ab30f1c4 kbuild: strip whitespace in cmd_record_mcount findstring
Backport from kernel
commit 1a49b2fd8f58 ("kbuild: strip whitespace in cmd_record_mcount findstring")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29 18:42:38 -06:00
Ilias Apalodimas
bb08767f12 kbuild: hardcode genksyms path and remove GENKSYMS variable
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-29 18:42:38 -06:00
Ilias Apalodimas
1a59e6d3ba kbuild: generate modules.order only when CONFIG_MODULES=y
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-29 18:42:38 -06:00
Ilias Apalodimas
88067ffc0c kbuild: refactor quiet_modtag
Backport from kernel
commit 45c4372d00 ("kbuild: refactor quiet_modtag")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29 18:42:37 -06:00
Ilias Apalodimas
47b6ab9737 kbuild: remove redundant quiet_modtag for $(obj-m)
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-29 18:42:37 -06:00
Ilias Apalodimas
919bd66ca8 kbuild: remove redundant 'set -e' from cmd_* defines
Backported from kernel
commit 5439f09f488f ("kbuild: remove redundant 'set -e' from cmd_* defines")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29 18:42:37 -06:00
Ilias Apalodimas
82f75d890d kbuild: remove trailing semicolon from cmd_* passed to if_changed_rule
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-29 18:42:37 -06:00
Ilias Apalodimas
daf8f5af4c kbuild: change if_changed_rule for multi-line recipe
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-29 18:42:37 -06:00
Ilias Apalodimas
3679f24373 kbuild: refactor modversions build rules
Backport from kernel
commit ee3e46b7efd2 ("kbuild: refactor modversions build rules")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29 18:42:37 -06:00
Ilias Apalodimas
2c180949ec kbuild: remove redundant 'set -e' from sub_cmd_record_mcount
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-29 18:42:37 -06:00
Ilias Apalodimas
cc571e29a8 kbuild: let fixdep directly write to .*.cmd files
Backport from kernel
commit 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd files")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29 18:42:37 -06:00
Ilias Apalodimas
47a4770c7a kbuild: move archive command to scripts/Makefile.lib
Backport from kernel
commit 898f5a009f22 ("kbuild: move archive command to scripts/Makefile.lib")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29 18:42:37 -06:00
Ilias Apalodimas
603a4ade16 kbuild: remove unnecessary in-subshell execution
Backport kernel changes

commit b79c6aa6a1f1 ("kbuild: remove unnecessary in-subshell execution")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29 18:42:37 -06:00
Ilias Apalodimas
a73c41c398 kbuild: add real-prereqs shorthand for $(filter-out FORCE, $^)
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-29 18:42:37 -06:00
Ilias Apalodimas
39160c5fbf kbuild: simplify rules of data compression with size appending
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-29 18:42:37 -06:00
Ilias Apalodimas
3d21332c2f kbuild: skip 'addtree' and 'flags' magic for external module build
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-29 18:42:37 -06:00
Ilias Apalodimas
cfccf25100 kbuild: remove redundant target cleaning on failure
Bacport from the kernel

commit 172caf1993b7 ("kbuild: remove redundant target cleaning on failure")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29 18:42:37 -06:00
Ilias Apalodimas
14795eba8b kbuild: remove redundant 'set -e' from filechk_offsets
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-29 18:42:37 -06:00
Ilias Apalodimas
1ecfa813bb kbuild: Enable dtc graph_port warning by default
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-29 18:42:37 -06:00
Ilias Apalodimas
31811fbb6b kbuild: disable dtc simple_bus_reg warnings by default
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-29 18:42:37 -06:00
Ilias Apalodimas
afba83ad89 kbuild: de-duplicate fixdep usage
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-29 18:42:37 -06:00
Marek Vasut
93905ab6e7 scripts/setlocalversion: Reinstate .scmversion support
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-29 11:29:20 -06:00
Adriano Cordova
43d43241d1 scripts/Makefile.lib: add PLATFORM_LIBGCC to efi linking
Link .efi applications using libgcc

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
2025-05-11 13:30:31 +02:00
Yao Zi
252cd20530 Makefile: Strip leading spaces when preprocessing generated_defconfig
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-05-05 14:17:23 -06:00