| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Device tree overlay files have the suffix dtso in source format
and dtbo in binary format. Add the necessary targets to build dtbo
files from dtso files and also dtbo.o files to include into the
barebox binary.
The overlay files shouldn't include the device tree snippets from
CONFIG_EXTERNAL_DTS_FRAGMENTS which makes it necessary to specify
these fragments as an argument to cmd_dtc.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We call lzop in two places: in gen-dtb-s to generate a compressed device
tree symbol and in Makefile.lib, which is used everywhere else.
Replace the duplication in gen-dtb-s by compressing the DT outside with
the existing cmd_lzo command. This will come in handy later when
extending gen-dtb-s to support multiple compression formats.
No functional change intended.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220713095730.1878941-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux commit faabed295cccc2aba2b67f2e7b309f2892d55004
You can use:
hostprogs-always-y += foo
as a shorthand for:
hostprogs += foo
always-y += foo
Likewise,
userprogs-always-y += foo
as a shorthand for:
userprogs += foo
always-y += foo
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
Import Linux commit 7f3a59db274c3e3d884c785e363a054110f1c266
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Starting v4.13, Linux always uses thin archive instead of relocatable
ELF to combine builtin objects.
The thin archive is basically a text file that only contains paths to
object files.
As Linux commit 98ced886dd79 mentioned, this has a lot of benefits:
- save disk space for builds
- speed-up building a little
- fix some issues when liking a giant executable (for example,
allyesconfig on ARM Linux)
- work better with dead code elimination
The last one is important for barebox because pbl highly relies on the
dead code elimination (-f{function,data}-sections and --gc-sections)
dropping symbols that are unreachable from the linker's entry point.
The dead code elimination does not work if the same symbol names are
used in the pevious incremental link mechanism because the same name
symbols all go into the same section.
Commit a83c97f2a406 ("ARM: socfpga: generate smaller images when
multiple boards are selected") worked around it by giving a dedicate
section to each of the same name symbols. This workaround can go away.
built-in.o was renamed to built-in.a since it is now an archive.
built-in-pbl.o was renamed to built-in.pbl.a for consistency.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current Linux uses the unified build command for built-in objects
and module objects. This is possible because part-of-module is set to
y when the target is being built for a module. If so, quiet_modtag is
set to [M], and modkern_cflags is set to KBUILD_CFLAGS_MODULE instead
of KBUILD_CFLAGS_KERNEL.
Currently, barebox uses a separate build command for pbl, but the
difference between cmd_cc_o_c and cmd_pbl_cc_o_c is just
"-D__PBL__ $(PBL_CPPFLAGS)".
By using the same approach as Linux, they can be unified.
Set part-of-pbl flag to y when the target is being built for pbl.
Merge cmd_as_o_S and cmd_link_o_target as well.
This also changes the shortlog style as follows:
PBLCC -> CC [P]
PBLAS -> AS [P]
PBLLD -> LD [P]
This is more consistent with the policy in the Linux build system.
In Linux, a capital letter enclosed square blackets indicates which
target the object is being built for.
CC object built for built-in
CC [M] object built for modules
CC [U] object built for userspace (proposed for Linux 5.8-rc1)
The idea behind this is we use the same compiler $(CC) for them.
Only the difference is the compiler flags. On the other hand, host
programs are compiled by a different tool, $(HOSTCC), hence the
shortlog is 'HOSTCC'.
Barebox supports module builds (it seems), but the [P] notation does
not conflict with [M] because pbl has a limited memory footprint.
We never expect pbl can support the module feature.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
The latest Linux calculates them more simply; part-of-module is set
when the target is being built for a module.
Also, rename real-objs-{y,m} to real-obj-{y,m}.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
Kbuild automatically creates the output directories for O= builds.
Previously it called mkdir too much. Linux optimized this a lot.
Let's import the outcome so it works faster.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The embedded DTBs are compiled by the chain of pattern rules as follows:
%.dts -> %.dtb -> %.dtb.S -> %.dtb.o for barebox proper
%.dts -> %.dtb -> %.dtb.S -> %.dtb.pbl.o for pbl
Barebox introduced {obj,pbl,lwl}-dtb-y syntax to put the intermediate
files into extra-y. The purposes of doing so were:
[1] prevent GNU Make from deleting the intermediate files
[2] include .*.cmd files
In contrast, Linux does not use a special syntax for embedding DTBs
into the kernel.
For example, as you see in arch/sh/boot/dts/Makefile of Linux 5.6,
obj-y += <basename>.dtb.o
... just works.
This is because scripts/Kbuild.include specifies .SECONDARY to cater
to [1], and scripts/Makefile.build adds the intermediates to 'targets'
to deal with [2].
Barebox had already imported the same code from Linux, so you can use
obj-y instead of obj-dtb-y, like Linux.
pbl-dtb-y and lwl-dtb-y are barebox-specific cases, so I added the
%.dtb.pbl.o pattern to intermediate_targets.
Going forward, please use obj-y, pbl-y, or lwl-y.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, pbl objects are output to:
<directory-path>/pbl-<basename>.o
This commit changes as follows:
<directory-path>/<basename>.pbl.o
The motivation is not only to get rid of the ugly code introduced by
commit 257abdaa36c8 ("Do not rm the path from pbl-y target"), but also
to make it easier to remove obj-dtb-y, pbl-dtb-y, lwl-dtb-y syntax in
the next commit.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The prologue of the build system is not specific to Linux or Barebox.
Paritially resync with Linux 5.7-rc4
- In Linux, $(objtree) is always '.', and $(srctree) might be relative.
I am keeping both absolute for now to avoid unexpected breakage.
- I did not resync single target for now. We need to touch
Makefile.build a lot if we want to resync it.
- 'export CDPATH=' is Barebox-only code, which was added by
commit 6cc8d0544658 ("Makefile: disable CDPATH"). Keep it.
- KBUILD_SRC no longer exists in the upstream Linux. I replaced it
with building_out_of_srctree.
- scripts/mkmakefile does not contain anything specific to Linux or
Barebox. Resync it with Linux 5.7-rc4
- scripts/tags was imported from Linux 3.6 with some cherry-picks on
top of that. Resync it with Linux 5.7-rc4
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Resync cmd, if_change, if_changed_dep, and if_changed_rule.
Clean up the users of if_changed_rule.
I deleted the modversions rule. It is dead code because barebox
does not define CONFIG_MODVERSIONS. It does not work without
scripts/genksyms/ anyway.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A couple of arch directories in Linux are biarch, that is, a single
arch/*/ directory supports both 32-bit and 64-bit.
In old days of Linux, they started as separated directories.
arm/arm64 is the exceptional case, but the other architectures were
unified.
e.g.)
arch/i386, arch/x86_64 -> arch/x86
arch/sh, arch/sh64 -> arch/sh
arch/sparc, arch/sparc64 -> arch/sparc
Linux commit 6752ed90da03 ("Kbuild: allow arch/xxx to use a different
source path") introduced SRCARCH to point to the arch directory, still
allowing to pass in the former ARCH=i386 or ARCH=x86_64.
The top Makefile in Linux converts ARCH to SRCARCH as follows:
# Additional ARCH settings for x86
ifeq ($(ARCH),i386)
SRCARCH := x86
endif
ifeq ($(ARCH),x86_64)
SRCARCH := x86
endif
So, if you follow the upstream Kbuild convention, using arch/$(SRCARCH)
is the correct way to point to the arch directory.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In old days, Linux also used to use well-known variables such CFLAGS,
CPPFLAGS, etc.
They were prefixed with KBUILD_ presumably for preventing users from
overriding them accidentally.
Rename as follows:
CFLAGS -> KBUILD_CFLAGS
AFLAGS -> KBUILD_AFLAGS
CPPFLAGS -> KBUILD_CPPFLAGS
LDFLAGS -> KBUILD_LDFLAGS
HOSTCFLAGS -> KBUILD_HOSTCFLAGS
HOSTCXXFLAGS -> KBUILD_HOSTCXXFLAGS
HOSTLDFLAGS -> KBUILD_HOSTLDFLAGS
HOST_LOADLIBES -> KBUILD_HOSTLDLIBS
HOSTCFLAGS, HOSTCXXFLAGS, HOSTLDFLAGS, HOSTLDLIBS are re-used to allow
users to pass-in additional flags to the host compiler.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
| |
I missed to sync this line in commit 421108c51da4 ("kbuild: rename
hostprogs-y/always to hostprogs/always-y").
Since then, the files in always(-y) are needlessly rebuilt.
Fixes: 421108c51da4 ("kbuild: rename hostprogs-y/always to hostprogs/always-y")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ Linux commit 5f2fb52fac15a8a8e10ce020dd532504a8abfc4e ]
In old days, the "host-progs" syntax was used for specifying host
programs. It was renamed to the current "hostprogs-y" in 2004.
It is typically useful in scripts/Makefile because it allows Kbuild to
selectively compile host programs based on the kernel configuration.
This commit renames like follows:
always -> always-y
hostprogs-y -> hostprogs
So, scripts/Makefile will look like this:
always-$(CONFIG_BUILD_BIN2C) += ...
always-$(CONFIG_KALLSYMS) += ...
...
hostprogs := $(always-y) $(always-m)
I think this makes more sense because a host program is always a host
program, irrespective of the kernel configuration. We want to specify
which ones to compile by CONFIG options, so always-y will be handier.
The "always", "hostprogs-y", "hostprogs-m" will be kept for backward
compatibility for a while.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes: 4fafb35d925e5 ("kbuild: cherry-pick changes from Linux v5.0-rc3")
The change cherry-picked from the Kernel commit 7d0ea2524202 ("kbuild: use
'else ifeq' for checksrc to improve readability") also removed the
trailing semicolons from the cmd_*checksrc lines. These were removed in
kernel commit e5d289100d ("kbuild: remove trailing semicolon from cmd_*
passed to if_changed_rule"), but seems the barebox Kbuild version is not
yet ready for this change. Without the semicolons a make C=1 build fails
with:
No such file: echo
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not synced completely.
Just cherry-picking low-hanging fruits.
0b35786d77ba kbuild: call make once for all targets when O=.. is used
5e54d5e5fbc1 kbuild: kill EXTRA_ARFLAGS
836caba77c29 kbuild: kill backward compatibility checks
3156fd0529b5 kbuild: fix some minor typoes
b8b0618cf6fa kbuild: remove extra ifdef/endif of top Makefile
16f890988114 kbuild: Remove reference to uninitialised variable
9319f4539c18 kbuild: support simultaneous "make %config" and "make all"
9d5db8949f1e scripts/Makefile.clean: clean also $(extra-m) and $(extra-)
a4954fd7724c kbuild: remove obj-n and lib-n handling
371fdc77af44 kbuild: collect shorthands into scripts/Kbuild.include
a29b82326ed4 kbuild: Remove duplicate $(cmd) definition in Makefile.clean
a1e7b7bb1ab5 Makefile: sort list of defconfig targets in make help output
34948e0bbf98 kbuild: Drop support for clean-rule
4218affdf57f kbuild: remove warning about "make depend"
9c8fa9bc08f6 kbuild: fix if_change and friends to consider argument order
39a33ff80a25 kbuild: remove cc-option-align
a7f924190924 kbuild: add %.dtb.S and %.dtb to 'targets' automatically
54a702f70589 kbuild: mark $(targets) as .SECONDARY and remove .PRECIOUS markers
9564a8cf422d Kbuild: fix # escaping in .cmd files for future Make
bd412d81b7ea kbuild: .PHONY is not a variable, but PHONY is
6916162c7308 kbuild: remove duplicated comments about PHONY
d6c6ab93e17f kbuild: remove deprecated host-progs variable
7d0ea2524202 kbuild: use 'else ifeq' for checksrc to improve readability
3f80babd9ca4 kbuild: remove unused cc-fullversion variable
bd352a739fde kbuild: remove unused baseprereq
b421b8a6cb87 kbuild: remove unused archmrproper
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux commit b23d1a241f4eb44ae55785c9b65274717c8e2c1e
(adjust commit log for barebox)
This will be needed for Barebox to switch to the compile-time
generation of lexers and parsers.
Files generated by if_changed* must be added to 'targets' to include
*.cmd files. Otherwise, they would be regenerated every time.
The build system automatically adds objects to 'targets' where
appropriate, such as obj-y, extra-y, etc. but does nothing for
intermediate files. So, each Makefile needs to add them by itself.
There are some common cases where objects are generated by chained
rules. Lexers and parsers are compiled like follows:
%.lex.o <- %.lex.c <- %.l
%.tab.o <- %.tab.c <- %.y
They are common patterns, so it is reasonable to take care of them
in the core Makefile instead of requiring each Makefile to do so.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux commit 591f66899784ae0afa13ff9a3eb5ce0a4358e48b
The variable "targets" contains object paths for which existing .*.cmd
files should be included.
scripts/Makefile.build automatically adds $(MAKECMDGOALS) to "targets"
as follows:
targets += $(extra-y) $(MAKECMDGOALS) $(always)
The $(MAKECMDGOALS) is a PHONY target in several places. PHONY targets
never create .*.cmd files.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The comment in scripts/Makefile.build says as follows:
We would rather have a list of rules like
foo.o: $(foo-objs)
but that's not so easy, so we rather make all composite objects depend
on the set of all their parts
This commit makes it possible!
For example, assume a Makefile like this
obj-m = foo.o bar.o
foo-objs := foo1.o foo2.o
bar-objs := bar1.o bar2.o
Without this patch, foo.o depends on all of
foo1.o foo2.o bar1.o bar2.o.
It looks funny that foo.o is regenerated when bar1.c is updated.
Now we can handle the dependency of foo.o and bar.o separately.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
|
|
|
|
|
|
|
| |
We had pbl_cc__o_c instead of pbl_cc_o_c. This caused all pbl object
files to be rebuilt everytime due to missing .cmd file.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
| |
Otherwise the pbl files do not get rebuilt when the CFLAGS change.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
|
|
|
|
|
|
|
|
|
|
| |
This will allow to link compiled object to the built-in-pbl.o across the source
tree that will be finally link to the pbl.
Now we compile the source %.c in pbl-%.o and provide -D__PBL__
so we can known in the source when it's compile for barebox or the pbl.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
|
|
|
|
|
|
|
| |
import from linux 3.5-rc5
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When building sandbox with ccache, one would hit warnings such as:
warning: 'struct mmsghdr' declared inside parameter list
on random files; a way to reproduce this issue is to build a simple
file doing just:
#include <sys/socket.h>
int main(void) {
return 0;
}
gcc -Wall -P -c -o foo foo.c
But actually the -P flag is only useful when generating non-C files,
such as linker scripts in the case of barebox. Removing the -P flag
from all the gcc invocations, except when generating .lds files makes
the warning go away. It turns out that this is what
linux/scripts/Makefile.build also does nowadays.
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
add missing Kconfig
|