2018-05-06 21:58:06 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2014-02-04 08:24:27 +00:00
|
|
|
# Backward compatibility
|
|
|
|
asflags-y += $(EXTRA_AFLAGS)
|
|
|
|
ccflags-y += $(EXTRA_CFLAGS)
|
|
|
|
cppflags-y += $(EXTRA_CPPFLAGS)
|
|
|
|
ldflags-y += $(EXTRA_LDFLAGS)
|
|
|
|
|
|
|
|
#
|
|
|
|
# flags that take effect in sub directories
|
|
|
|
export KBUILD_SUBDIR_ASFLAGS := $(KBUILD_SUBDIR_ASFLAGS) $(subdir-asflags-y)
|
|
|
|
export KBUILD_SUBDIR_CCFLAGS := $(KBUILD_SUBDIR_CCFLAGS) $(subdir-ccflags-y)
|
|
|
|
|
|
|
|
# Figure out what we need to build from the various variables
|
|
|
|
# ===========================================================================
|
|
|
|
|
|
|
|
# When an object is listed to be built compiled-in and modular,
|
|
|
|
# only build the compiled-in version
|
|
|
|
|
|
|
|
obj-m := $(filter-out $(obj-y),$(obj-m))
|
|
|
|
|
|
|
|
# Libraries are always collected in one lib file.
|
|
|
|
# Filter out objects already built-in
|
|
|
|
|
|
|
|
lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
|
|
|
|
|
|
|
|
|
|
|
|
# Handle objects in subdirs
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# o if we encounter foo/ in $(obj-y), replace it by foo/built-in.o
|
|
|
|
# and add the directory to the list of dirs to descend into: $(subdir-y)
|
2014-06-16 09:56:38 +00:00
|
|
|
# o if we encounter foo/ in $(obj-m), remove it from $(obj-m)
|
2014-02-04 08:24:27 +00:00
|
|
|
# and add the directory to the list of dirs to descend into: $(subdir-m)
|
|
|
|
|
|
|
|
# Determine modorder.
|
|
|
|
# Unfortunately, we don't have information about ordering between -y
|
|
|
|
# and -m subdirs. Just put -y's first.
|
|
|
|
modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko))
|
|
|
|
|
|
|
|
__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
|
|
|
|
subdir-y += $(__subdir-y)
|
|
|
|
__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
|
|
|
|
subdir-m += $(__subdir-m)
|
|
|
|
obj-y := $(patsubst %/, %/built-in.o, $(obj-y))
|
|
|
|
obj-m := $(filter-out %/, $(obj-m))
|
|
|
|
|
|
|
|
# Subdirectories we need to descend into
|
|
|
|
|
|
|
|
subdir-ym := $(sort $(subdir-y) $(subdir-m))
|
|
|
|
|
2014-06-16 09:56:38 +00:00
|
|
|
# if $(foo-objs) exists, foo.o is a composite object
|
2014-02-04 08:24:27 +00:00
|
|
|
multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
|
|
|
|
multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
|
|
|
|
multi-used := $(multi-used-y) $(multi-used-m)
|
|
|
|
single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m)))
|
|
|
|
|
|
|
|
# Build list of the parts of our composite objects, our composite
|
|
|
|
# objects depend on those (obviously)
|
|
|
|
multi-objs-y := $(foreach m, $(multi-used-y), $($(m:.o=-objs)) $($(m:.o=-y)))
|
|
|
|
multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)) $($(m:.o=-y)))
|
|
|
|
|
|
|
|
# $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to
|
|
|
|
# tell kbuild to descend
|
|
|
|
subdir-obj-y := $(filter %/built-in.o, $(obj-y))
|
|
|
|
|
|
|
|
# Replace multi-part objects by their individual parts, look at local dir only
|
|
|
|
real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y)
|
|
|
|
real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
|
|
|
|
|
|
|
|
# Add subdir path
|
|
|
|
|
|
|
|
extra-y := $(addprefix $(obj)/,$(extra-y))
|
|
|
|
always := $(addprefix $(obj)/,$(always))
|
|
|
|
targets := $(addprefix $(obj)/,$(targets))
|
|
|
|
modorder := $(addprefix $(obj)/,$(modorder))
|
|
|
|
obj-y := $(addprefix $(obj)/,$(obj-y))
|
|
|
|
obj-m := $(addprefix $(obj)/,$(obj-m))
|
|
|
|
lib-y := $(addprefix $(obj)/,$(lib-y))
|
|
|
|
subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y))
|
|
|
|
real-objs-y := $(addprefix $(obj)/,$(real-objs-y))
|
|
|
|
real-objs-m := $(addprefix $(obj)/,$(real-objs-m))
|
|
|
|
single-used-m := $(addprefix $(obj)/,$(single-used-m))
|
|
|
|
multi-used-y := $(addprefix $(obj)/,$(multi-used-y))
|
|
|
|
multi-used-m := $(addprefix $(obj)/,$(multi-used-m))
|
|
|
|
multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y))
|
|
|
|
multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m))
|
|
|
|
subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
|
|
|
|
|
|
|
|
# These flags are needed for modversions and compiling, so we define them here
|
|
|
|
# already
|
2014-06-16 09:56:38 +00:00
|
|
|
# $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will
|
2014-02-04 08:24:27 +00:00
|
|
|
# end up in (or would, if it gets compiled in)
|
|
|
|
# Note: Files that end up in two or more modules are compiled without the
|
|
|
|
# KBUILD_MODNAME definition. The reason is that any made-up name would
|
|
|
|
# differ in different configs.
|
2020-04-17 07:21:36 +00:00
|
|
|
name-fix = $(squote)$(quote)$(subst $(comma),_,$(subst -,_,$1))$(quote)$(squote)
|
|
|
|
basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))
|
2014-02-04 08:24:27 +00:00
|
|
|
modname_flags = $(if $(filter 1,$(words $(modname))),\
|
2020-04-17 07:21:36 +00:00
|
|
|
-DKBUILD_MODNAME=$(call name-fix,$(modname)))
|
2014-02-04 08:24:27 +00:00
|
|
|
|
2014-03-05 07:59:40 +00:00
|
|
|
orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \
|
2014-02-04 08:24:27 +00:00
|
|
|
$(ccflags-y) $(CFLAGS_$(basetarget).o)
|
|
|
|
_c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))
|
2015-07-31 15:31:18 +00:00
|
|
|
orig_a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
|
2014-02-04 08:24:27 +00:00
|
|
|
$(asflags-y) $(AFLAGS_$(basetarget).o)
|
2015-07-31 15:31:18 +00:00
|
|
|
_a_flags = $(filter-out $(AFLAGS_REMOVE_$(basetarget).o), $(orig_a_flags))
|
2014-03-05 07:59:40 +00:00
|
|
|
_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
|
2014-02-04 08:24:27 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Enable gcov profiling flags for a file, directory or for all files depending
|
|
|
|
# on variables GCOV_PROFILE_obj.o, GCOV_PROFILE and CONFIG_GCOV_PROFILE_ALL
|
|
|
|
# (in this order)
|
|
|
|
#
|
|
|
|
ifeq ($(CONFIG_GCOV_KERNEL),y)
|
|
|
|
_c_flags += $(if $(patsubst n%,, \
|
|
|
|
$(GCOV_PROFILE_$(basetarget).o)$(GCOV_PROFILE)$(CONFIG_GCOV_PROFILE_ALL)), \
|
|
|
|
$(CFLAGS_GCOV))
|
|
|
|
endif
|
|
|
|
|
2015-07-04 16:56:55 +00:00
|
|
|
#
|
|
|
|
# Enable address sanitizer flags for kernel except some files or directories
|
|
|
|
# we don't want to check (depends on variables KASAN_SANITIZE_obj.o, KASAN_SANITIZE)
|
|
|
|
#
|
|
|
|
ifeq ($(CONFIG_KASAN),y)
|
|
|
|
_c_flags += $(if $(patsubst n%,, \
|
|
|
|
$(KASAN_SANITIZE_$(basetarget).o)$(KASAN_SANITIZE)y), \
|
|
|
|
$(CFLAGS_KASAN))
|
|
|
|
endif
|
|
|
|
|
2014-02-04 08:24:27 +00:00
|
|
|
# If building the kernel in a separate objtree expand all occurrences
|
|
|
|
# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
|
|
|
|
|
|
|
|
ifeq ($(KBUILD_SRC),)
|
|
|
|
__c_flags = $(_c_flags)
|
|
|
|
__a_flags = $(_a_flags)
|
|
|
|
__cpp_flags = $(_cpp_flags)
|
|
|
|
else
|
|
|
|
|
|
|
|
# -I$(obj) locates generated .h files
|
|
|
|
# $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files
|
|
|
|
# and locates generated .h files
|
|
|
|
# FIXME: Replace both with specific CFLAGS* statements in the makefiles
|
2020-03-11 22:11:17 +00:00
|
|
|
__c_flags = $(if $(obj),$(call addtree,-I$(src)) -I$(obj)) \
|
|
|
|
$(call flags,_c_flags)
|
|
|
|
__a_flags = $(call flags,_a_flags)
|
|
|
|
__cpp_flags = $(call flags,_cpp_flags)
|
2014-02-04 08:24:27 +00:00
|
|
|
endif
|
|
|
|
|
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-04 08:24:28 +00:00
|
|
|
# Modified for U-Boot: LINUXINCLUDE -> UBOOTINCLUDE
|
|
|
|
c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \
|
2014-02-04 08:24:27 +00:00
|
|
|
$(__c_flags) $(modkern_cflags) \
|
2020-04-17 07:21:36 +00:00
|
|
|
$(basename_flags) $(modname_flags)
|
2014-02-04 08:24:27 +00:00
|
|
|
|
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-04 08:24:28 +00:00
|
|
|
a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \
|
2014-02-04 08:24:27 +00:00
|
|
|
$(__a_flags) $(modkern_aflags)
|
|
|
|
|
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-04 08:24:28 +00:00
|
|
|
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \
|
2014-02-04 08:24:27 +00:00
|
|
|
$(__cpp_flags)
|
|
|
|
|
2020-03-27 15:46:27 +00:00
|
|
|
ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
|
2014-02-04 08:24:27 +00:00
|
|
|
|
2016-11-26 03:15:59 +00:00
|
|
|
# Try these files in order to find the U-Boot-specific .dtsi include file
|
2017-11-13 04:52:05 +00:00
|
|
|
u_boot_dtsi_options = $(strip $(wildcard $(dir $<)$(basename $(notdir $<))-u-boot.dtsi) \
|
2017-05-24 15:04:03 +00:00
|
|
|
$(wildcard $(dir $<)$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi) \
|
|
|
|
$(wildcard $(dir $<)$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi) \
|
|
|
|
$(wildcard $(dir $<)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
|
2017-11-13 04:52:05 +00:00
|
|
|
$(wildcard $(dir $<)u-boot.dtsi))
|
|
|
|
|
|
|
|
u_boot_dtsi_options_raw = $(warning Automatic .dtsi inclusion: options: \
|
|
|
|
$(dir $<)$(basename $(notdir $<))-u-boot.dtsi \
|
|
|
|
$(dir $<)$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi \
|
|
|
|
$(dir $<)$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi \
|
|
|
|
$(dir $<)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi \
|
|
|
|
$(dir $<)u-boot.dtsi ... \
|
|
|
|
found: $(if $(u_boot_dtsi_options),"$(u_boot_dtsi_options)",nothing!))
|
2016-11-26 03:15:59 +00:00
|
|
|
|
|
|
|
# Uncomment for debugging
|
2017-11-13 04:52:05 +00:00
|
|
|
# This shows all the files that were considered and the one that we chose.
|
2021-12-17 03:59:23 +00:00
|
|
|
ifdef DEVICE_TREE_DEBUG
|
|
|
|
u_boot_dtsi_options_debug = $(warning $(u_boot_dtsi_options_raw))
|
|
|
|
endif
|
2016-11-26 03:15:59 +00:00
|
|
|
|
|
|
|
# We use the first match
|
2017-11-13 04:52:05 +00:00
|
|
|
u_boot_dtsi = $(strip $(u_boot_dtsi_options_debug) \
|
|
|
|
$(notdir $(firstword $(u_boot_dtsi_options))))
|
2016-11-26 03:15:59 +00:00
|
|
|
|
2014-02-05 02:28:25 +00:00
|
|
|
# Modified for U-Boot
|
2014-02-04 08:24:27 +00:00
|
|
|
dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \
|
2022-03-30 09:30:04 +00:00
|
|
|
$(UBOOTINCLUDE) \
|
2014-02-05 02:28:25 +00:00
|
|
|
-I$(srctree)/arch/$(ARCH)/dts \
|
2014-06-12 05:29:44 +00:00
|
|
|
-I$(srctree)/arch/$(ARCH)/dts/include \
|
2016-11-26 03:15:58 +00:00
|
|
|
-I$(srctree)/include \
|
|
|
|
-D__ASSEMBLY__ \
|
2014-02-04 08:24:27 +00:00
|
|
|
-undef -D__DTS__
|
|
|
|
|
|
|
|
# Finds the multi-part object the current object will be linked into
|
|
|
|
modname-multi = $(sort $(foreach m,$(multi-used),\
|
|
|
|
$(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=))))
|
|
|
|
|
2014-10-30 02:06:10 +00:00
|
|
|
# Useful for describing the dependency of composite objects
|
|
|
|
# Usage:
|
|
|
|
# $(call multi_depend, multi_used_targets, suffix_to_remove, suffix_to_add)
|
|
|
|
define multi_depend
|
|
|
|
$(foreach m, $(notdir $1), \
|
|
|
|
$(eval $(obj)/$m: \
|
|
|
|
$(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))
|
|
|
|
endef
|
|
|
|
|
2014-02-04 08:24:27 +00:00
|
|
|
# LEX
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
quiet_cmd_flex = LEX $@
|
kconfig: re-sync with Linux 4.17-rc4
Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.
Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
re-sync with Linux 4.10") and it achieved almost perfect alignment with
a few (intended) exceptions, caused by below U-boot commits:
[A] v2015.04 5f9eb2207500 ("kbuild: remove scripts/multiconfig.sh")
[B] v2015.07 20c20826efab ("Kconfig: Enable usage of escape char '\' in string values")
[C] v2016.01 da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags")
[D] v2016.03 5b8031ccb4ed ("Add more SPDX-License-Identifier tags")
[E] v2016.03 192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.")
Here is the list of Kconfig commits which followed the v4.10 alignment:
[F] v2018.01 0931ed3c0d0f ("kconfig/symbol.c: use correct pointer type argument for sizeof")
[G] v2018.03 1414e09b4f25 ("kconfig: revert change that was not needed for -Wformat-security")
[H] v2018.05 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")
Commit [F] was subsequently applied to Linux kernel as commit [I]
with the same patch id, so it won't contribute to further misalignment.
[I] v4.15-rc1 88127dae6ed9 ("kconfig/symbol.c: use correct pointer type argument for sizeof")
Commit [G] is a Kconfig-specific revert of commit [E].
Commit [H] relocated and reformatted the license doing no functional change.
In summary, the only functional change that makes U-boot Kconfig
diverge from Linux Kconfig is commit [B]. After a brief analysis,
the purpose of [B] seems to be placing "\n" literals in string symbols
like CONFIG_AUTOBOOT_PROMPT="autoboot in %d seconds\n" in order to pass
them directly to printf and expect correct output at runtime. Currently,
Linux doesn't seem to have this requirement, so for the moment [B] looks
like a U-boot specific feature/fix. From point of view of further Kconfig
alignment and backporting efforts, it is highly desired that commits
like [B] are propagated to Linux and any Kconfig fixes/features are
contributed to Linux kernel first. This specific Kconfig re-sync just
keeps [B] in place.
Contrary to 4.10 Kconfig re-sync (which achieves zero non-kconfig
changes), 4.17-rc4 re-sync does some amount of updates in Kbuild
(striving to keep them at minimum), due to a number of reasons:
* Kbuild is affected by the removal of Kconfig "*shipped" files and now
requires flex and bison pre-installed on the host.
* PYTHON{2,3} variables are defined in top-level Makefile as
prerequisite for running the newly developed Kconfig unit tests.
* silentoldconfig becomes an "internal implementation detail" deprecated
for external use, being renamed to syncconfig.
The exact non-kconfig files touched by this commit are:
$ git show --format="" --stat -- ':!scripts/kconfig'
.gitignore | 2 ++
Makefile | 9 +++++++--
scripts/Makefile.build | 11 +++++++++++
scripts/Makefile.lib | 41 ++++++++++++-----------------------------
The imported Linux commits touching the above files are:
c054be10ffdbd5 ("remove gperf left-overs from build system")
73a4f6dbe70a1b ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ("kbuild: prepare to remove C files pre-generated by flex and bison")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
911a91c39cabcb H ("kconfig: rename silentoldconfig to syncconfig")
59889300274569 (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e H ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 H ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
e9781b52d4e0e3 H ("kbuild: add PYTHON2 and PYTHON3 variables")
The commits marked with 'H' are assessed as "hard" (build will fail)
prerequisites and the rest of them are assessed as "soft" prerequisites
for the re-sync. In spite of relatively high number of non-H commits,
they belong to this Kconfig update topic-wise and decrease the number of
cherry pick conflicts for many commits in this series. Additional effort
can be put in eliminating the soft prerequisites, if really needed.
The commits which contributed to this Kconfig re-sync are listed below.
Whenever a conflict resolution has been performed (mostly by hand, but
sometimes automatically by git), it is revealed by the '!' sign in the
second column, which means a patch id mismatch between Linux and U-boot
commits:
9be3213b14d44f ("gconfig: remove misleading parentheses around a condition")
ff85a1a80e0034 ("kconfig: Check for libncurses before menuconfig")
ad8181060788c8 ("kconfig: fix sparse warnings in nconfig")
cb77f0d623ff33 ! ("scripts: Switch to more portable Perl shebang")
bb3290d91695bb ! ("Remove gperf usage from toolchain")
c054be10ffdbd5 ("remove gperf left-overs from build system")
b24413180f5600 ! ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license")
9059a3493efea6 ! ("kconfig: fix relational operators for bool and tristate symbols")
2c37e08464a850 ("kconfig: Warn if choice default is not in choice")
33ca1a24866373 ("kconfig: Document the 'menu' struct")
52aede4ba5efd1 ("kconfig: Document the 'symbol' struct")
c873443430ebd1 ("kconfig: Sync zconf.y with zconf.tab.c_shipped")
9a826842ff2fbd ("kconfig: Rename menu_check_dep() to rewrite_m()")
fa8cedaef814ce ("kconfig: Clarify expression rewriting")
f77850d3fe0c96 ("kconfig: Clean up modules handling and fix crash")
e3b03bf29d6b99 ("kconfig: display recursive dependency resolution hint just once")
73a4f6dbe70a1b ! ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ! ("kbuild: prepare to remove C files pre-generated by flex and bison")
29c833061c1d8c ("kconfig: generate lexer and parser during build instead of shipping")
26e47a3c11a25c ("kconfig: Don't leak symbol names during parsing")
24161a6711c945 ("kconfig: Don't leak 'source' filenames during parsing")
bc28fe1d5ede88 ("kconfig: Don't leak 'option' arguments during parsing")
0724a7c32a54e3 ("kconfig: Don't leak main menus during parsing")
ae7440ef0c8013 ("kconfig: Fix automatic menu creation mem leak")
5b1374b3b3c2fc ("kconfig: Fix expr_free() E_NOT leak")
7cf33f88e29410 ("kconfig: Fix choice symbol expression leak")
05cccce580456d ("kconfig: Document automatic submenu creation code")
0735f7e5def2ab ("kconfig: Document important expression functions")
df60f4b92d3d0b ("kconfig: Remove menu_end_entry()")
b92d804a51796b ("kconfig: drop 'boolean' keyword")
6479f327dea60d ("kconfig: Warn if there is more than one help text")
52e58a3caeba5d ("kconfig: make input_mode static")
5a3dc717b3c785 ("kconfig: make xfgets() really static")
84dd95d4f87a0d ("kconfig: make conf_unsaved a local variable of conf_read()")
765f4cdef6f80d ("kconfig: use default 'yy' prefix for lexer and parser")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ! ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
3e41ba05b6d60c ("kconfig: Document SYMBOL_OPTIONAL logic")
d3465af60f4471 ("kconfig: Clarify choice dependency propagation")
9d1a9e8bc18bea ("kconfig: Document 'if' flattening logic")
b53688014e3325 ("kconfig: Clarify menu and 'if' dependency propagation")
d0fd0428ecf04b ("kconfig: fix make xconfig when gettext is missing")
312ee68752faaa ("kconfig: announce removal of oldnoconfig if used")
1ccb27143360bd ("kconfig: make "Selected by:" and "Implied by:" readable")
cedd55d49dee94 ! ("kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help")
1b9eda2e4892cb ("kconfig: Warn if help text is blank")
cb67ab2cd2b8ab ("kconfig: do not write choice values when their dependency becomes n")
4f208f392103e8 ("kconfig: show '?' prompt even if no help text is available")
cd58a91def2acc ("kconfig: remove 'config*' pattern from .gitignnore")
d2a04648a5dbc3 ("kconfig: remove check_stdin()")
f3ff6fb5db68bc ("kconfig: echo stdin to stdout if either is redirected")
9e3e10c725360b ("kconfig: send error messages to stderr")
d717f24d8c6808 ("kconfig: add xrealloc() helper")
523ca58b7db2e3 ("kconfig: remove const qualifier from sym_expand_string_value()")
cd81fc82b93fa4 ("kconfig: add xstrdup() helper")
f4bc1eefc1608e ("kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list")
bf0bbdcf100322 ("kconfig: Don't leak choice names during parsing")
1a90ce36c6eff6 ("kconfig: Update ncurses package names for menuconfig")
5ae6fcc4bb82bd ("kconfig: fix line number in recursive inclusion error message")
07a422bb213adb ! ("kbuild: restore autoksyms.h touch to the top Makefile")
9a47ceec543bfb ("kconfig: clean-up reverse dependency help implementation")
d9119b5925a03b ("kconfig: Print reverse dependencies in groups")
f467c5640c29ad ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols")
59a80b5e892dde ("kconfig: do not call check_conf() for olddefconfig")
4bb3a5b085cd6f ("kconfig: remove unneeded input_mode test in conf()")
99f0b6578bab44 ("kconfig: remove redundant input_mode test for check_conf() loop")
2aad9b89621386 ("kconfig: hide irrelevant sub-menus for oldconfig")
81d2bc2273052e ("kconfig: invoke oldconfig instead of silentoldconfig from local*config")
911a91c39cabcb ! ("kconfig: rename silentoldconfig to syncconfig")
2a61625835c7c8 ! ("kconfig: remove redundant streamline_config.pl prerequisite")
022a4bf6b59dfd ("kconfig: tests: add framework for Kconfig unit testing")
1903c511905984 ("kconfig: tests: add basic choice tests")
49ac3c0c3aa3b7 ("kconfig: tests: test automatic submenu creation")
b76960c0f6b25d ("kconfig: tests: test if new symbols in choice are asked")
930c429a656fdb ("kconfig: tests: check unneeded "is not set" with unmet dependency")
ee236610653ede ("kconfig: tests: check visibility of tristate choice values in y choice")
beaaddb625400e ("kconfig: tests: test defconfig when two choices interact")
3e4888c2e3d77d ("kconfig: tests: test randconfig for choice in choice")
29c434f367ea7b ("kconfig: tests: test if recursive dependencies are detected")
e2c75e7667c737 ("kconfig: tests: test if recursive inclusion is detected")
f622f827958162 ("kconfig: warn unmet direct dependency of tristate symbols selected by y")
f8f69dc0b4e070 ("kconfig: make unmet dependency warnings readable")
26561514cc9def ("kconfig: do not include both curses.h and ncurses.h for nconfig")
32a94b8b0c3e5a ("kconfig: remove duplicated file name and lineno of recursive inclusion")
379a8eb8eb1a55 ("kconfig: detect recursive inclusion earlier")
18492685e479fd ("kconfig: use yylineno option instead of manual lineno increments")
59889300274569 ! (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ! ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e ! ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 ! ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
17baab68d337a0 ("kconfig: extend output of 'listnewconfig'")
e9781b52d4e0e3 ! ("kbuild: add PYTHON2 and PYTHON3 variables")
The current Kconfig update generates below build-time warnings:
YACC scripts/dtc/dtc-parser.tab.h
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
YACC scripts/dtc/dtc-parser.tab.c
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
This seems to happen because the Kbuild updates apparently didn't make
room for both "*shipped"-based builds and flex/bison-based builds. A
similar problem has been reported for genksyms parser in v4.17-rc1
commit 833e622459432e ("genksyms: generate lexer and parser during build
instead of shipping"). I have figured out empirically that the warnings
are healed after updating the in-tree U-boot DTC to upstream v1.4.6-9,
same as done by Linux v4.17-rc1 commit 9130ba88464032 ("scripts/dtc:
Update to upstream version v1.4.6-9-gaadd0b65c987"). Whether fixing the
DTC-related yacc warnings should be done together with the Kconfig
re-sync, I would like to hear from community.
My testing was limited to:
- make defconfig all
- make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
- comparing .config before and after the re-sync
- running the newly imported Kconfig unit tests as seen below:
$ make testconfig
Tested-by: Petr Vorel <petr.vorel@gmail.com>
============================= test session starts =============================
scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED [ 7%]
scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED [ 14%]
scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED [ 21%]
scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED [ 28%]
scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED [ 35%]
scripts/kconfig/tests/choice/__init__.py::test_allno PASSED [ 42%]
scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED [ 50%]
scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED [ 57%]
scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED [ 64%]
scripts/kconfig/tests/inter_choice/__init__.py::test PASSED [ 71%]
scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED [ 78%]
scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED [ 85%]
scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED [ 92%]
scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED [100%]
========================== 14 passed in 0.34 seconds ==========================
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Petr Vorel <petr.vorel@gmail.com>
2018-05-19 12:13:50 +00:00
|
|
|
cmd_flex = $(LEX) -o$@ -L $<
|
2014-02-04 08:24:27 +00:00
|
|
|
|
kconfig: re-sync with Linux 4.17-rc4
Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.
Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
re-sync with Linux 4.10") and it achieved almost perfect alignment with
a few (intended) exceptions, caused by below U-boot commits:
[A] v2015.04 5f9eb2207500 ("kbuild: remove scripts/multiconfig.sh")
[B] v2015.07 20c20826efab ("Kconfig: Enable usage of escape char '\' in string values")
[C] v2016.01 da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags")
[D] v2016.03 5b8031ccb4ed ("Add more SPDX-License-Identifier tags")
[E] v2016.03 192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.")
Here is the list of Kconfig commits which followed the v4.10 alignment:
[F] v2018.01 0931ed3c0d0f ("kconfig/symbol.c: use correct pointer type argument for sizeof")
[G] v2018.03 1414e09b4f25 ("kconfig: revert change that was not needed for -Wformat-security")
[H] v2018.05 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")
Commit [F] was subsequently applied to Linux kernel as commit [I]
with the same patch id, so it won't contribute to further misalignment.
[I] v4.15-rc1 88127dae6ed9 ("kconfig/symbol.c: use correct pointer type argument for sizeof")
Commit [G] is a Kconfig-specific revert of commit [E].
Commit [H] relocated and reformatted the license doing no functional change.
In summary, the only functional change that makes U-boot Kconfig
diverge from Linux Kconfig is commit [B]. After a brief analysis,
the purpose of [B] seems to be placing "\n" literals in string symbols
like CONFIG_AUTOBOOT_PROMPT="autoboot in %d seconds\n" in order to pass
them directly to printf and expect correct output at runtime. Currently,
Linux doesn't seem to have this requirement, so for the moment [B] looks
like a U-boot specific feature/fix. From point of view of further Kconfig
alignment and backporting efforts, it is highly desired that commits
like [B] are propagated to Linux and any Kconfig fixes/features are
contributed to Linux kernel first. This specific Kconfig re-sync just
keeps [B] in place.
Contrary to 4.10 Kconfig re-sync (which achieves zero non-kconfig
changes), 4.17-rc4 re-sync does some amount of updates in Kbuild
(striving to keep them at minimum), due to a number of reasons:
* Kbuild is affected by the removal of Kconfig "*shipped" files and now
requires flex and bison pre-installed on the host.
* PYTHON{2,3} variables are defined in top-level Makefile as
prerequisite for running the newly developed Kconfig unit tests.
* silentoldconfig becomes an "internal implementation detail" deprecated
for external use, being renamed to syncconfig.
The exact non-kconfig files touched by this commit are:
$ git show --format="" --stat -- ':!scripts/kconfig'
.gitignore | 2 ++
Makefile | 9 +++++++--
scripts/Makefile.build | 11 +++++++++++
scripts/Makefile.lib | 41 ++++++++++++-----------------------------
The imported Linux commits touching the above files are:
c054be10ffdbd5 ("remove gperf left-overs from build system")
73a4f6dbe70a1b ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ("kbuild: prepare to remove C files pre-generated by flex and bison")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
911a91c39cabcb H ("kconfig: rename silentoldconfig to syncconfig")
59889300274569 (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e H ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 H ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
e9781b52d4e0e3 H ("kbuild: add PYTHON2 and PYTHON3 variables")
The commits marked with 'H' are assessed as "hard" (build will fail)
prerequisites and the rest of them are assessed as "soft" prerequisites
for the re-sync. In spite of relatively high number of non-H commits,
they belong to this Kconfig update topic-wise and decrease the number of
cherry pick conflicts for many commits in this series. Additional effort
can be put in eliminating the soft prerequisites, if really needed.
The commits which contributed to this Kconfig re-sync are listed below.
Whenever a conflict resolution has been performed (mostly by hand, but
sometimes automatically by git), it is revealed by the '!' sign in the
second column, which means a patch id mismatch between Linux and U-boot
commits:
9be3213b14d44f ("gconfig: remove misleading parentheses around a condition")
ff85a1a80e0034 ("kconfig: Check for libncurses before menuconfig")
ad8181060788c8 ("kconfig: fix sparse warnings in nconfig")
cb77f0d623ff33 ! ("scripts: Switch to more portable Perl shebang")
bb3290d91695bb ! ("Remove gperf usage from toolchain")
c054be10ffdbd5 ("remove gperf left-overs from build system")
b24413180f5600 ! ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license")
9059a3493efea6 ! ("kconfig: fix relational operators for bool and tristate symbols")
2c37e08464a850 ("kconfig: Warn if choice default is not in choice")
33ca1a24866373 ("kconfig: Document the 'menu' struct")
52aede4ba5efd1 ("kconfig: Document the 'symbol' struct")
c873443430ebd1 ("kconfig: Sync zconf.y with zconf.tab.c_shipped")
9a826842ff2fbd ("kconfig: Rename menu_check_dep() to rewrite_m()")
fa8cedaef814ce ("kconfig: Clarify expression rewriting")
f77850d3fe0c96 ("kconfig: Clean up modules handling and fix crash")
e3b03bf29d6b99 ("kconfig: display recursive dependency resolution hint just once")
73a4f6dbe70a1b ! ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ! ("kbuild: prepare to remove C files pre-generated by flex and bison")
29c833061c1d8c ("kconfig: generate lexer and parser during build instead of shipping")
26e47a3c11a25c ("kconfig: Don't leak symbol names during parsing")
24161a6711c945 ("kconfig: Don't leak 'source' filenames during parsing")
bc28fe1d5ede88 ("kconfig: Don't leak 'option' arguments during parsing")
0724a7c32a54e3 ("kconfig: Don't leak main menus during parsing")
ae7440ef0c8013 ("kconfig: Fix automatic menu creation mem leak")
5b1374b3b3c2fc ("kconfig: Fix expr_free() E_NOT leak")
7cf33f88e29410 ("kconfig: Fix choice symbol expression leak")
05cccce580456d ("kconfig: Document automatic submenu creation code")
0735f7e5def2ab ("kconfig: Document important expression functions")
df60f4b92d3d0b ("kconfig: Remove menu_end_entry()")
b92d804a51796b ("kconfig: drop 'boolean' keyword")
6479f327dea60d ("kconfig: Warn if there is more than one help text")
52e58a3caeba5d ("kconfig: make input_mode static")
5a3dc717b3c785 ("kconfig: make xfgets() really static")
84dd95d4f87a0d ("kconfig: make conf_unsaved a local variable of conf_read()")
765f4cdef6f80d ("kconfig: use default 'yy' prefix for lexer and parser")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ! ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
3e41ba05b6d60c ("kconfig: Document SYMBOL_OPTIONAL logic")
d3465af60f4471 ("kconfig: Clarify choice dependency propagation")
9d1a9e8bc18bea ("kconfig: Document 'if' flattening logic")
b53688014e3325 ("kconfig: Clarify menu and 'if' dependency propagation")
d0fd0428ecf04b ("kconfig: fix make xconfig when gettext is missing")
312ee68752faaa ("kconfig: announce removal of oldnoconfig if used")
1ccb27143360bd ("kconfig: make "Selected by:" and "Implied by:" readable")
cedd55d49dee94 ! ("kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help")
1b9eda2e4892cb ("kconfig: Warn if help text is blank")
cb67ab2cd2b8ab ("kconfig: do not write choice values when their dependency becomes n")
4f208f392103e8 ("kconfig: show '?' prompt even if no help text is available")
cd58a91def2acc ("kconfig: remove 'config*' pattern from .gitignnore")
d2a04648a5dbc3 ("kconfig: remove check_stdin()")
f3ff6fb5db68bc ("kconfig: echo stdin to stdout if either is redirected")
9e3e10c725360b ("kconfig: send error messages to stderr")
d717f24d8c6808 ("kconfig: add xrealloc() helper")
523ca58b7db2e3 ("kconfig: remove const qualifier from sym_expand_string_value()")
cd81fc82b93fa4 ("kconfig: add xstrdup() helper")
f4bc1eefc1608e ("kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list")
bf0bbdcf100322 ("kconfig: Don't leak choice names during parsing")
1a90ce36c6eff6 ("kconfig: Update ncurses package names for menuconfig")
5ae6fcc4bb82bd ("kconfig: fix line number in recursive inclusion error message")
07a422bb213adb ! ("kbuild: restore autoksyms.h touch to the top Makefile")
9a47ceec543bfb ("kconfig: clean-up reverse dependency help implementation")
d9119b5925a03b ("kconfig: Print reverse dependencies in groups")
f467c5640c29ad ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols")
59a80b5e892dde ("kconfig: do not call check_conf() for olddefconfig")
4bb3a5b085cd6f ("kconfig: remove unneeded input_mode test in conf()")
99f0b6578bab44 ("kconfig: remove redundant input_mode test for check_conf() loop")
2aad9b89621386 ("kconfig: hide irrelevant sub-menus for oldconfig")
81d2bc2273052e ("kconfig: invoke oldconfig instead of silentoldconfig from local*config")
911a91c39cabcb ! ("kconfig: rename silentoldconfig to syncconfig")
2a61625835c7c8 ! ("kconfig: remove redundant streamline_config.pl prerequisite")
022a4bf6b59dfd ("kconfig: tests: add framework for Kconfig unit testing")
1903c511905984 ("kconfig: tests: add basic choice tests")
49ac3c0c3aa3b7 ("kconfig: tests: test automatic submenu creation")
b76960c0f6b25d ("kconfig: tests: test if new symbols in choice are asked")
930c429a656fdb ("kconfig: tests: check unneeded "is not set" with unmet dependency")
ee236610653ede ("kconfig: tests: check visibility of tristate choice values in y choice")
beaaddb625400e ("kconfig: tests: test defconfig when two choices interact")
3e4888c2e3d77d ("kconfig: tests: test randconfig for choice in choice")
29c434f367ea7b ("kconfig: tests: test if recursive dependencies are detected")
e2c75e7667c737 ("kconfig: tests: test if recursive inclusion is detected")
f622f827958162 ("kconfig: warn unmet direct dependency of tristate symbols selected by y")
f8f69dc0b4e070 ("kconfig: make unmet dependency warnings readable")
26561514cc9def ("kconfig: do not include both curses.h and ncurses.h for nconfig")
32a94b8b0c3e5a ("kconfig: remove duplicated file name and lineno of recursive inclusion")
379a8eb8eb1a55 ("kconfig: detect recursive inclusion earlier")
18492685e479fd ("kconfig: use yylineno option instead of manual lineno increments")
59889300274569 ! (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ! ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e ! ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 ! ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
17baab68d337a0 ("kconfig: extend output of 'listnewconfig'")
e9781b52d4e0e3 ! ("kbuild: add PYTHON2 and PYTHON3 variables")
The current Kconfig update generates below build-time warnings:
YACC scripts/dtc/dtc-parser.tab.h
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
YACC scripts/dtc/dtc-parser.tab.c
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
This seems to happen because the Kbuild updates apparently didn't make
room for both "*shipped"-based builds and flex/bison-based builds. A
similar problem has been reported for genksyms parser in v4.17-rc1
commit 833e622459432e ("genksyms: generate lexer and parser during build
instead of shipping"). I have figured out empirically that the warnings
are healed after updating the in-tree U-boot DTC to upstream v1.4.6-9,
same as done by Linux v4.17-rc1 commit 9130ba88464032 ("scripts/dtc:
Update to upstream version v1.4.6-9-gaadd0b65c987"). Whether fixing the
DTC-related yacc warnings should be done together with the Kconfig
re-sync, I would like to hear from community.
My testing was limited to:
- make defconfig all
- make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
- comparing .config before and after the re-sync
- running the newly imported Kconfig unit tests as seen below:
$ make testconfig
Tested-by: Petr Vorel <petr.vorel@gmail.com>
============================= test session starts =============================
scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED [ 7%]
scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED [ 14%]
scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED [ 21%]
scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED [ 28%]
scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED [ 35%]
scripts/kconfig/tests/choice/__init__.py::test_allno PASSED [ 42%]
scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED [ 50%]
scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED [ 57%]
scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED [ 64%]
scripts/kconfig/tests/inter_choice/__init__.py::test PASSED [ 71%]
scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED [ 78%]
scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED [ 85%]
scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED [ 92%]
scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED [100%]
========================== 14 passed in 0.34 seconds ==========================
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Petr Vorel <petr.vorel@gmail.com>
2018-05-19 12:13:50 +00:00
|
|
|
$(obj)/%.lex.c: $(src)/%.l FORCE
|
|
|
|
$(call if_changed,flex)
|
2014-02-04 08:24:27 +00:00
|
|
|
|
|
|
|
# YACC
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
quiet_cmd_bison = YACC $@
|
kconfig: re-sync with Linux 4.17-rc4
Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.
Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
re-sync with Linux 4.10") and it achieved almost perfect alignment with
a few (intended) exceptions, caused by below U-boot commits:
[A] v2015.04 5f9eb2207500 ("kbuild: remove scripts/multiconfig.sh")
[B] v2015.07 20c20826efab ("Kconfig: Enable usage of escape char '\' in string values")
[C] v2016.01 da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags")
[D] v2016.03 5b8031ccb4ed ("Add more SPDX-License-Identifier tags")
[E] v2016.03 192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.")
Here is the list of Kconfig commits which followed the v4.10 alignment:
[F] v2018.01 0931ed3c0d0f ("kconfig/symbol.c: use correct pointer type argument for sizeof")
[G] v2018.03 1414e09b4f25 ("kconfig: revert change that was not needed for -Wformat-security")
[H] v2018.05 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")
Commit [F] was subsequently applied to Linux kernel as commit [I]
with the same patch id, so it won't contribute to further misalignment.
[I] v4.15-rc1 88127dae6ed9 ("kconfig/symbol.c: use correct pointer type argument for sizeof")
Commit [G] is a Kconfig-specific revert of commit [E].
Commit [H] relocated and reformatted the license doing no functional change.
In summary, the only functional change that makes U-boot Kconfig
diverge from Linux Kconfig is commit [B]. After a brief analysis,
the purpose of [B] seems to be placing "\n" literals in string symbols
like CONFIG_AUTOBOOT_PROMPT="autoboot in %d seconds\n" in order to pass
them directly to printf and expect correct output at runtime. Currently,
Linux doesn't seem to have this requirement, so for the moment [B] looks
like a U-boot specific feature/fix. From point of view of further Kconfig
alignment and backporting efforts, it is highly desired that commits
like [B] are propagated to Linux and any Kconfig fixes/features are
contributed to Linux kernel first. This specific Kconfig re-sync just
keeps [B] in place.
Contrary to 4.10 Kconfig re-sync (which achieves zero non-kconfig
changes), 4.17-rc4 re-sync does some amount of updates in Kbuild
(striving to keep them at minimum), due to a number of reasons:
* Kbuild is affected by the removal of Kconfig "*shipped" files and now
requires flex and bison pre-installed on the host.
* PYTHON{2,3} variables are defined in top-level Makefile as
prerequisite for running the newly developed Kconfig unit tests.
* silentoldconfig becomes an "internal implementation detail" deprecated
for external use, being renamed to syncconfig.
The exact non-kconfig files touched by this commit are:
$ git show --format="" --stat -- ':!scripts/kconfig'
.gitignore | 2 ++
Makefile | 9 +++++++--
scripts/Makefile.build | 11 +++++++++++
scripts/Makefile.lib | 41 ++++++++++++-----------------------------
The imported Linux commits touching the above files are:
c054be10ffdbd5 ("remove gperf left-overs from build system")
73a4f6dbe70a1b ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ("kbuild: prepare to remove C files pre-generated by flex and bison")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
911a91c39cabcb H ("kconfig: rename silentoldconfig to syncconfig")
59889300274569 (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e H ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 H ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
e9781b52d4e0e3 H ("kbuild: add PYTHON2 and PYTHON3 variables")
The commits marked with 'H' are assessed as "hard" (build will fail)
prerequisites and the rest of them are assessed as "soft" prerequisites
for the re-sync. In spite of relatively high number of non-H commits,
they belong to this Kconfig update topic-wise and decrease the number of
cherry pick conflicts for many commits in this series. Additional effort
can be put in eliminating the soft prerequisites, if really needed.
The commits which contributed to this Kconfig re-sync are listed below.
Whenever a conflict resolution has been performed (mostly by hand, but
sometimes automatically by git), it is revealed by the '!' sign in the
second column, which means a patch id mismatch between Linux and U-boot
commits:
9be3213b14d44f ("gconfig: remove misleading parentheses around a condition")
ff85a1a80e0034 ("kconfig: Check for libncurses before menuconfig")
ad8181060788c8 ("kconfig: fix sparse warnings in nconfig")
cb77f0d623ff33 ! ("scripts: Switch to more portable Perl shebang")
bb3290d91695bb ! ("Remove gperf usage from toolchain")
c054be10ffdbd5 ("remove gperf left-overs from build system")
b24413180f5600 ! ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license")
9059a3493efea6 ! ("kconfig: fix relational operators for bool and tristate symbols")
2c37e08464a850 ("kconfig: Warn if choice default is not in choice")
33ca1a24866373 ("kconfig: Document the 'menu' struct")
52aede4ba5efd1 ("kconfig: Document the 'symbol' struct")
c873443430ebd1 ("kconfig: Sync zconf.y with zconf.tab.c_shipped")
9a826842ff2fbd ("kconfig: Rename menu_check_dep() to rewrite_m()")
fa8cedaef814ce ("kconfig: Clarify expression rewriting")
f77850d3fe0c96 ("kconfig: Clean up modules handling and fix crash")
e3b03bf29d6b99 ("kconfig: display recursive dependency resolution hint just once")
73a4f6dbe70a1b ! ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ! ("kbuild: prepare to remove C files pre-generated by flex and bison")
29c833061c1d8c ("kconfig: generate lexer and parser during build instead of shipping")
26e47a3c11a25c ("kconfig: Don't leak symbol names during parsing")
24161a6711c945 ("kconfig: Don't leak 'source' filenames during parsing")
bc28fe1d5ede88 ("kconfig: Don't leak 'option' arguments during parsing")
0724a7c32a54e3 ("kconfig: Don't leak main menus during parsing")
ae7440ef0c8013 ("kconfig: Fix automatic menu creation mem leak")
5b1374b3b3c2fc ("kconfig: Fix expr_free() E_NOT leak")
7cf33f88e29410 ("kconfig: Fix choice symbol expression leak")
05cccce580456d ("kconfig: Document automatic submenu creation code")
0735f7e5def2ab ("kconfig: Document important expression functions")
df60f4b92d3d0b ("kconfig: Remove menu_end_entry()")
b92d804a51796b ("kconfig: drop 'boolean' keyword")
6479f327dea60d ("kconfig: Warn if there is more than one help text")
52e58a3caeba5d ("kconfig: make input_mode static")
5a3dc717b3c785 ("kconfig: make xfgets() really static")
84dd95d4f87a0d ("kconfig: make conf_unsaved a local variable of conf_read()")
765f4cdef6f80d ("kconfig: use default 'yy' prefix for lexer and parser")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ! ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
3e41ba05b6d60c ("kconfig: Document SYMBOL_OPTIONAL logic")
d3465af60f4471 ("kconfig: Clarify choice dependency propagation")
9d1a9e8bc18bea ("kconfig: Document 'if' flattening logic")
b53688014e3325 ("kconfig: Clarify menu and 'if' dependency propagation")
d0fd0428ecf04b ("kconfig: fix make xconfig when gettext is missing")
312ee68752faaa ("kconfig: announce removal of oldnoconfig if used")
1ccb27143360bd ("kconfig: make "Selected by:" and "Implied by:" readable")
cedd55d49dee94 ! ("kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help")
1b9eda2e4892cb ("kconfig: Warn if help text is blank")
cb67ab2cd2b8ab ("kconfig: do not write choice values when their dependency becomes n")
4f208f392103e8 ("kconfig: show '?' prompt even if no help text is available")
cd58a91def2acc ("kconfig: remove 'config*' pattern from .gitignnore")
d2a04648a5dbc3 ("kconfig: remove check_stdin()")
f3ff6fb5db68bc ("kconfig: echo stdin to stdout if either is redirected")
9e3e10c725360b ("kconfig: send error messages to stderr")
d717f24d8c6808 ("kconfig: add xrealloc() helper")
523ca58b7db2e3 ("kconfig: remove const qualifier from sym_expand_string_value()")
cd81fc82b93fa4 ("kconfig: add xstrdup() helper")
f4bc1eefc1608e ("kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list")
bf0bbdcf100322 ("kconfig: Don't leak choice names during parsing")
1a90ce36c6eff6 ("kconfig: Update ncurses package names for menuconfig")
5ae6fcc4bb82bd ("kconfig: fix line number in recursive inclusion error message")
07a422bb213adb ! ("kbuild: restore autoksyms.h touch to the top Makefile")
9a47ceec543bfb ("kconfig: clean-up reverse dependency help implementation")
d9119b5925a03b ("kconfig: Print reverse dependencies in groups")
f467c5640c29ad ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols")
59a80b5e892dde ("kconfig: do not call check_conf() for olddefconfig")
4bb3a5b085cd6f ("kconfig: remove unneeded input_mode test in conf()")
99f0b6578bab44 ("kconfig: remove redundant input_mode test for check_conf() loop")
2aad9b89621386 ("kconfig: hide irrelevant sub-menus for oldconfig")
81d2bc2273052e ("kconfig: invoke oldconfig instead of silentoldconfig from local*config")
911a91c39cabcb ! ("kconfig: rename silentoldconfig to syncconfig")
2a61625835c7c8 ! ("kconfig: remove redundant streamline_config.pl prerequisite")
022a4bf6b59dfd ("kconfig: tests: add framework for Kconfig unit testing")
1903c511905984 ("kconfig: tests: add basic choice tests")
49ac3c0c3aa3b7 ("kconfig: tests: test automatic submenu creation")
b76960c0f6b25d ("kconfig: tests: test if new symbols in choice are asked")
930c429a656fdb ("kconfig: tests: check unneeded "is not set" with unmet dependency")
ee236610653ede ("kconfig: tests: check visibility of tristate choice values in y choice")
beaaddb625400e ("kconfig: tests: test defconfig when two choices interact")
3e4888c2e3d77d ("kconfig: tests: test randconfig for choice in choice")
29c434f367ea7b ("kconfig: tests: test if recursive dependencies are detected")
e2c75e7667c737 ("kconfig: tests: test if recursive inclusion is detected")
f622f827958162 ("kconfig: warn unmet direct dependency of tristate symbols selected by y")
f8f69dc0b4e070 ("kconfig: make unmet dependency warnings readable")
26561514cc9def ("kconfig: do not include both curses.h and ncurses.h for nconfig")
32a94b8b0c3e5a ("kconfig: remove duplicated file name and lineno of recursive inclusion")
379a8eb8eb1a55 ("kconfig: detect recursive inclusion earlier")
18492685e479fd ("kconfig: use yylineno option instead of manual lineno increments")
59889300274569 ! (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ! ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e ! ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 ! ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
17baab68d337a0 ("kconfig: extend output of 'listnewconfig'")
e9781b52d4e0e3 ! ("kbuild: add PYTHON2 and PYTHON3 variables")
The current Kconfig update generates below build-time warnings:
YACC scripts/dtc/dtc-parser.tab.h
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
YACC scripts/dtc/dtc-parser.tab.c
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
This seems to happen because the Kbuild updates apparently didn't make
room for both "*shipped"-based builds and flex/bison-based builds. A
similar problem has been reported for genksyms parser in v4.17-rc1
commit 833e622459432e ("genksyms: generate lexer and parser during build
instead of shipping"). I have figured out empirically that the warnings
are healed after updating the in-tree U-boot DTC to upstream v1.4.6-9,
same as done by Linux v4.17-rc1 commit 9130ba88464032 ("scripts/dtc:
Update to upstream version v1.4.6-9-gaadd0b65c987"). Whether fixing the
DTC-related yacc warnings should be done together with the Kconfig
re-sync, I would like to hear from community.
My testing was limited to:
- make defconfig all
- make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
- comparing .config before and after the re-sync
- running the newly imported Kconfig unit tests as seen below:
$ make testconfig
Tested-by: Petr Vorel <petr.vorel@gmail.com>
============================= test session starts =============================
scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED [ 7%]
scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED [ 14%]
scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED [ 21%]
scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED [ 28%]
scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED [ 35%]
scripts/kconfig/tests/choice/__init__.py::test_allno PASSED [ 42%]
scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED [ 50%]
scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED [ 57%]
scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED [ 64%]
scripts/kconfig/tests/inter_choice/__init__.py::test PASSED [ 71%]
scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED [ 78%]
scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED [ 85%]
scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED [ 92%]
scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED [100%]
========================== 14 passed in 0.34 seconds ==========================
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Petr Vorel <petr.vorel@gmail.com>
2018-05-19 12:13:50 +00:00
|
|
|
cmd_bison = $(YACC) -o$@ -t -l $<
|
2014-02-04 08:24:27 +00:00
|
|
|
|
kconfig: re-sync with Linux 4.17-rc4
Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.
Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
re-sync with Linux 4.10") and it achieved almost perfect alignment with
a few (intended) exceptions, caused by below U-boot commits:
[A] v2015.04 5f9eb2207500 ("kbuild: remove scripts/multiconfig.sh")
[B] v2015.07 20c20826efab ("Kconfig: Enable usage of escape char '\' in string values")
[C] v2016.01 da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags")
[D] v2016.03 5b8031ccb4ed ("Add more SPDX-License-Identifier tags")
[E] v2016.03 192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.")
Here is the list of Kconfig commits which followed the v4.10 alignment:
[F] v2018.01 0931ed3c0d0f ("kconfig/symbol.c: use correct pointer type argument for sizeof")
[G] v2018.03 1414e09b4f25 ("kconfig: revert change that was not needed for -Wformat-security")
[H] v2018.05 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")
Commit [F] was subsequently applied to Linux kernel as commit [I]
with the same patch id, so it won't contribute to further misalignment.
[I] v4.15-rc1 88127dae6ed9 ("kconfig/symbol.c: use correct pointer type argument for sizeof")
Commit [G] is a Kconfig-specific revert of commit [E].
Commit [H] relocated and reformatted the license doing no functional change.
In summary, the only functional change that makes U-boot Kconfig
diverge from Linux Kconfig is commit [B]. After a brief analysis,
the purpose of [B] seems to be placing "\n" literals in string symbols
like CONFIG_AUTOBOOT_PROMPT="autoboot in %d seconds\n" in order to pass
them directly to printf and expect correct output at runtime. Currently,
Linux doesn't seem to have this requirement, so for the moment [B] looks
like a U-boot specific feature/fix. From point of view of further Kconfig
alignment and backporting efforts, it is highly desired that commits
like [B] are propagated to Linux and any Kconfig fixes/features are
contributed to Linux kernel first. This specific Kconfig re-sync just
keeps [B] in place.
Contrary to 4.10 Kconfig re-sync (which achieves zero non-kconfig
changes), 4.17-rc4 re-sync does some amount of updates in Kbuild
(striving to keep them at minimum), due to a number of reasons:
* Kbuild is affected by the removal of Kconfig "*shipped" files and now
requires flex and bison pre-installed on the host.
* PYTHON{2,3} variables are defined in top-level Makefile as
prerequisite for running the newly developed Kconfig unit tests.
* silentoldconfig becomes an "internal implementation detail" deprecated
for external use, being renamed to syncconfig.
The exact non-kconfig files touched by this commit are:
$ git show --format="" --stat -- ':!scripts/kconfig'
.gitignore | 2 ++
Makefile | 9 +++++++--
scripts/Makefile.build | 11 +++++++++++
scripts/Makefile.lib | 41 ++++++++++++-----------------------------
The imported Linux commits touching the above files are:
c054be10ffdbd5 ("remove gperf left-overs from build system")
73a4f6dbe70a1b ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ("kbuild: prepare to remove C files pre-generated by flex and bison")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
911a91c39cabcb H ("kconfig: rename silentoldconfig to syncconfig")
59889300274569 (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e H ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 H ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
e9781b52d4e0e3 H ("kbuild: add PYTHON2 and PYTHON3 variables")
The commits marked with 'H' are assessed as "hard" (build will fail)
prerequisites and the rest of them are assessed as "soft" prerequisites
for the re-sync. In spite of relatively high number of non-H commits,
they belong to this Kconfig update topic-wise and decrease the number of
cherry pick conflicts for many commits in this series. Additional effort
can be put in eliminating the soft prerequisites, if really needed.
The commits which contributed to this Kconfig re-sync are listed below.
Whenever a conflict resolution has been performed (mostly by hand, but
sometimes automatically by git), it is revealed by the '!' sign in the
second column, which means a patch id mismatch between Linux and U-boot
commits:
9be3213b14d44f ("gconfig: remove misleading parentheses around a condition")
ff85a1a80e0034 ("kconfig: Check for libncurses before menuconfig")
ad8181060788c8 ("kconfig: fix sparse warnings in nconfig")
cb77f0d623ff33 ! ("scripts: Switch to more portable Perl shebang")
bb3290d91695bb ! ("Remove gperf usage from toolchain")
c054be10ffdbd5 ("remove gperf left-overs from build system")
b24413180f5600 ! ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license")
9059a3493efea6 ! ("kconfig: fix relational operators for bool and tristate symbols")
2c37e08464a850 ("kconfig: Warn if choice default is not in choice")
33ca1a24866373 ("kconfig: Document the 'menu' struct")
52aede4ba5efd1 ("kconfig: Document the 'symbol' struct")
c873443430ebd1 ("kconfig: Sync zconf.y with zconf.tab.c_shipped")
9a826842ff2fbd ("kconfig: Rename menu_check_dep() to rewrite_m()")
fa8cedaef814ce ("kconfig: Clarify expression rewriting")
f77850d3fe0c96 ("kconfig: Clean up modules handling and fix crash")
e3b03bf29d6b99 ("kconfig: display recursive dependency resolution hint just once")
73a4f6dbe70a1b ! ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ! ("kbuild: prepare to remove C files pre-generated by flex and bison")
29c833061c1d8c ("kconfig: generate lexer and parser during build instead of shipping")
26e47a3c11a25c ("kconfig: Don't leak symbol names during parsing")
24161a6711c945 ("kconfig: Don't leak 'source' filenames during parsing")
bc28fe1d5ede88 ("kconfig: Don't leak 'option' arguments during parsing")
0724a7c32a54e3 ("kconfig: Don't leak main menus during parsing")
ae7440ef0c8013 ("kconfig: Fix automatic menu creation mem leak")
5b1374b3b3c2fc ("kconfig: Fix expr_free() E_NOT leak")
7cf33f88e29410 ("kconfig: Fix choice symbol expression leak")
05cccce580456d ("kconfig: Document automatic submenu creation code")
0735f7e5def2ab ("kconfig: Document important expression functions")
df60f4b92d3d0b ("kconfig: Remove menu_end_entry()")
b92d804a51796b ("kconfig: drop 'boolean' keyword")
6479f327dea60d ("kconfig: Warn if there is more than one help text")
52e58a3caeba5d ("kconfig: make input_mode static")
5a3dc717b3c785 ("kconfig: make xfgets() really static")
84dd95d4f87a0d ("kconfig: make conf_unsaved a local variable of conf_read()")
765f4cdef6f80d ("kconfig: use default 'yy' prefix for lexer and parser")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ! ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
3e41ba05b6d60c ("kconfig: Document SYMBOL_OPTIONAL logic")
d3465af60f4471 ("kconfig: Clarify choice dependency propagation")
9d1a9e8bc18bea ("kconfig: Document 'if' flattening logic")
b53688014e3325 ("kconfig: Clarify menu and 'if' dependency propagation")
d0fd0428ecf04b ("kconfig: fix make xconfig when gettext is missing")
312ee68752faaa ("kconfig: announce removal of oldnoconfig if used")
1ccb27143360bd ("kconfig: make "Selected by:" and "Implied by:" readable")
cedd55d49dee94 ! ("kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help")
1b9eda2e4892cb ("kconfig: Warn if help text is blank")
cb67ab2cd2b8ab ("kconfig: do not write choice values when their dependency becomes n")
4f208f392103e8 ("kconfig: show '?' prompt even if no help text is available")
cd58a91def2acc ("kconfig: remove 'config*' pattern from .gitignnore")
d2a04648a5dbc3 ("kconfig: remove check_stdin()")
f3ff6fb5db68bc ("kconfig: echo stdin to stdout if either is redirected")
9e3e10c725360b ("kconfig: send error messages to stderr")
d717f24d8c6808 ("kconfig: add xrealloc() helper")
523ca58b7db2e3 ("kconfig: remove const qualifier from sym_expand_string_value()")
cd81fc82b93fa4 ("kconfig: add xstrdup() helper")
f4bc1eefc1608e ("kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list")
bf0bbdcf100322 ("kconfig: Don't leak choice names during parsing")
1a90ce36c6eff6 ("kconfig: Update ncurses package names for menuconfig")
5ae6fcc4bb82bd ("kconfig: fix line number in recursive inclusion error message")
07a422bb213adb ! ("kbuild: restore autoksyms.h touch to the top Makefile")
9a47ceec543bfb ("kconfig: clean-up reverse dependency help implementation")
d9119b5925a03b ("kconfig: Print reverse dependencies in groups")
f467c5640c29ad ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols")
59a80b5e892dde ("kconfig: do not call check_conf() for olddefconfig")
4bb3a5b085cd6f ("kconfig: remove unneeded input_mode test in conf()")
99f0b6578bab44 ("kconfig: remove redundant input_mode test for check_conf() loop")
2aad9b89621386 ("kconfig: hide irrelevant sub-menus for oldconfig")
81d2bc2273052e ("kconfig: invoke oldconfig instead of silentoldconfig from local*config")
911a91c39cabcb ! ("kconfig: rename silentoldconfig to syncconfig")
2a61625835c7c8 ! ("kconfig: remove redundant streamline_config.pl prerequisite")
022a4bf6b59dfd ("kconfig: tests: add framework for Kconfig unit testing")
1903c511905984 ("kconfig: tests: add basic choice tests")
49ac3c0c3aa3b7 ("kconfig: tests: test automatic submenu creation")
b76960c0f6b25d ("kconfig: tests: test if new symbols in choice are asked")
930c429a656fdb ("kconfig: tests: check unneeded "is not set" with unmet dependency")
ee236610653ede ("kconfig: tests: check visibility of tristate choice values in y choice")
beaaddb625400e ("kconfig: tests: test defconfig when two choices interact")
3e4888c2e3d77d ("kconfig: tests: test randconfig for choice in choice")
29c434f367ea7b ("kconfig: tests: test if recursive dependencies are detected")
e2c75e7667c737 ("kconfig: tests: test if recursive inclusion is detected")
f622f827958162 ("kconfig: warn unmet direct dependency of tristate symbols selected by y")
f8f69dc0b4e070 ("kconfig: make unmet dependency warnings readable")
26561514cc9def ("kconfig: do not include both curses.h and ncurses.h for nconfig")
32a94b8b0c3e5a ("kconfig: remove duplicated file name and lineno of recursive inclusion")
379a8eb8eb1a55 ("kconfig: detect recursive inclusion earlier")
18492685e479fd ("kconfig: use yylineno option instead of manual lineno increments")
59889300274569 ! (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ! ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e ! ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 ! ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
17baab68d337a0 ("kconfig: extend output of 'listnewconfig'")
e9781b52d4e0e3 ! ("kbuild: add PYTHON2 and PYTHON3 variables")
The current Kconfig update generates below build-time warnings:
YACC scripts/dtc/dtc-parser.tab.h
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
YACC scripts/dtc/dtc-parser.tab.c
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
This seems to happen because the Kbuild updates apparently didn't make
room for both "*shipped"-based builds and flex/bison-based builds. A
similar problem has been reported for genksyms parser in v4.17-rc1
commit 833e622459432e ("genksyms: generate lexer and parser during build
instead of shipping"). I have figured out empirically that the warnings
are healed after updating the in-tree U-boot DTC to upstream v1.4.6-9,
same as done by Linux v4.17-rc1 commit 9130ba88464032 ("scripts/dtc:
Update to upstream version v1.4.6-9-gaadd0b65c987"). Whether fixing the
DTC-related yacc warnings should be done together with the Kconfig
re-sync, I would like to hear from community.
My testing was limited to:
- make defconfig all
- make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
- comparing .config before and after the re-sync
- running the newly imported Kconfig unit tests as seen below:
$ make testconfig
Tested-by: Petr Vorel <petr.vorel@gmail.com>
============================= test session starts =============================
scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED [ 7%]
scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED [ 14%]
scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED [ 21%]
scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED [ 28%]
scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED [ 35%]
scripts/kconfig/tests/choice/__init__.py::test_allno PASSED [ 42%]
scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED [ 50%]
scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED [ 57%]
scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED [ 64%]
scripts/kconfig/tests/inter_choice/__init__.py::test PASSED [ 71%]
scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED [ 78%]
scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED [ 85%]
scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED [ 92%]
scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED [100%]
========================== 14 passed in 0.34 seconds ==========================
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Petr Vorel <petr.vorel@gmail.com>
2018-05-19 12:13:50 +00:00
|
|
|
$(obj)/%.tab.c: $(src)/%.y FORCE
|
|
|
|
$(call if_changed,bison)
|
2014-02-04 08:24:27 +00:00
|
|
|
|
|
|
|
quiet_cmd_bison_h = YACC $@
|
kconfig: re-sync with Linux 4.17-rc4
Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.
Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
re-sync with Linux 4.10") and it achieved almost perfect alignment with
a few (intended) exceptions, caused by below U-boot commits:
[A] v2015.04 5f9eb2207500 ("kbuild: remove scripts/multiconfig.sh")
[B] v2015.07 20c20826efab ("Kconfig: Enable usage of escape char '\' in string values")
[C] v2016.01 da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags")
[D] v2016.03 5b8031ccb4ed ("Add more SPDX-License-Identifier tags")
[E] v2016.03 192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.")
Here is the list of Kconfig commits which followed the v4.10 alignment:
[F] v2018.01 0931ed3c0d0f ("kconfig/symbol.c: use correct pointer type argument for sizeof")
[G] v2018.03 1414e09b4f25 ("kconfig: revert change that was not needed for -Wformat-security")
[H] v2018.05 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")
Commit [F] was subsequently applied to Linux kernel as commit [I]
with the same patch id, so it won't contribute to further misalignment.
[I] v4.15-rc1 88127dae6ed9 ("kconfig/symbol.c: use correct pointer type argument for sizeof")
Commit [G] is a Kconfig-specific revert of commit [E].
Commit [H] relocated and reformatted the license doing no functional change.
In summary, the only functional change that makes U-boot Kconfig
diverge from Linux Kconfig is commit [B]. After a brief analysis,
the purpose of [B] seems to be placing "\n" literals in string symbols
like CONFIG_AUTOBOOT_PROMPT="autoboot in %d seconds\n" in order to pass
them directly to printf and expect correct output at runtime. Currently,
Linux doesn't seem to have this requirement, so for the moment [B] looks
like a U-boot specific feature/fix. From point of view of further Kconfig
alignment and backporting efforts, it is highly desired that commits
like [B] are propagated to Linux and any Kconfig fixes/features are
contributed to Linux kernel first. This specific Kconfig re-sync just
keeps [B] in place.
Contrary to 4.10 Kconfig re-sync (which achieves zero non-kconfig
changes), 4.17-rc4 re-sync does some amount of updates in Kbuild
(striving to keep them at minimum), due to a number of reasons:
* Kbuild is affected by the removal of Kconfig "*shipped" files and now
requires flex and bison pre-installed on the host.
* PYTHON{2,3} variables are defined in top-level Makefile as
prerequisite for running the newly developed Kconfig unit tests.
* silentoldconfig becomes an "internal implementation detail" deprecated
for external use, being renamed to syncconfig.
The exact non-kconfig files touched by this commit are:
$ git show --format="" --stat -- ':!scripts/kconfig'
.gitignore | 2 ++
Makefile | 9 +++++++--
scripts/Makefile.build | 11 +++++++++++
scripts/Makefile.lib | 41 ++++++++++++-----------------------------
The imported Linux commits touching the above files are:
c054be10ffdbd5 ("remove gperf left-overs from build system")
73a4f6dbe70a1b ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ("kbuild: prepare to remove C files pre-generated by flex and bison")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
911a91c39cabcb H ("kconfig: rename silentoldconfig to syncconfig")
59889300274569 (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e H ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 H ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
e9781b52d4e0e3 H ("kbuild: add PYTHON2 and PYTHON3 variables")
The commits marked with 'H' are assessed as "hard" (build will fail)
prerequisites and the rest of them are assessed as "soft" prerequisites
for the re-sync. In spite of relatively high number of non-H commits,
they belong to this Kconfig update topic-wise and decrease the number of
cherry pick conflicts for many commits in this series. Additional effort
can be put in eliminating the soft prerequisites, if really needed.
The commits which contributed to this Kconfig re-sync are listed below.
Whenever a conflict resolution has been performed (mostly by hand, but
sometimes automatically by git), it is revealed by the '!' sign in the
second column, which means a patch id mismatch between Linux and U-boot
commits:
9be3213b14d44f ("gconfig: remove misleading parentheses around a condition")
ff85a1a80e0034 ("kconfig: Check for libncurses before menuconfig")
ad8181060788c8 ("kconfig: fix sparse warnings in nconfig")
cb77f0d623ff33 ! ("scripts: Switch to more portable Perl shebang")
bb3290d91695bb ! ("Remove gperf usage from toolchain")
c054be10ffdbd5 ("remove gperf left-overs from build system")
b24413180f5600 ! ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license")
9059a3493efea6 ! ("kconfig: fix relational operators for bool and tristate symbols")
2c37e08464a850 ("kconfig: Warn if choice default is not in choice")
33ca1a24866373 ("kconfig: Document the 'menu' struct")
52aede4ba5efd1 ("kconfig: Document the 'symbol' struct")
c873443430ebd1 ("kconfig: Sync zconf.y with zconf.tab.c_shipped")
9a826842ff2fbd ("kconfig: Rename menu_check_dep() to rewrite_m()")
fa8cedaef814ce ("kconfig: Clarify expression rewriting")
f77850d3fe0c96 ("kconfig: Clean up modules handling and fix crash")
e3b03bf29d6b99 ("kconfig: display recursive dependency resolution hint just once")
73a4f6dbe70a1b ! ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ! ("kbuild: prepare to remove C files pre-generated by flex and bison")
29c833061c1d8c ("kconfig: generate lexer and parser during build instead of shipping")
26e47a3c11a25c ("kconfig: Don't leak symbol names during parsing")
24161a6711c945 ("kconfig: Don't leak 'source' filenames during parsing")
bc28fe1d5ede88 ("kconfig: Don't leak 'option' arguments during parsing")
0724a7c32a54e3 ("kconfig: Don't leak main menus during parsing")
ae7440ef0c8013 ("kconfig: Fix automatic menu creation mem leak")
5b1374b3b3c2fc ("kconfig: Fix expr_free() E_NOT leak")
7cf33f88e29410 ("kconfig: Fix choice symbol expression leak")
05cccce580456d ("kconfig: Document automatic submenu creation code")
0735f7e5def2ab ("kconfig: Document important expression functions")
df60f4b92d3d0b ("kconfig: Remove menu_end_entry()")
b92d804a51796b ("kconfig: drop 'boolean' keyword")
6479f327dea60d ("kconfig: Warn if there is more than one help text")
52e58a3caeba5d ("kconfig: make input_mode static")
5a3dc717b3c785 ("kconfig: make xfgets() really static")
84dd95d4f87a0d ("kconfig: make conf_unsaved a local variable of conf_read()")
765f4cdef6f80d ("kconfig: use default 'yy' prefix for lexer and parser")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ! ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
3e41ba05b6d60c ("kconfig: Document SYMBOL_OPTIONAL logic")
d3465af60f4471 ("kconfig: Clarify choice dependency propagation")
9d1a9e8bc18bea ("kconfig: Document 'if' flattening logic")
b53688014e3325 ("kconfig: Clarify menu and 'if' dependency propagation")
d0fd0428ecf04b ("kconfig: fix make xconfig when gettext is missing")
312ee68752faaa ("kconfig: announce removal of oldnoconfig if used")
1ccb27143360bd ("kconfig: make "Selected by:" and "Implied by:" readable")
cedd55d49dee94 ! ("kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help")
1b9eda2e4892cb ("kconfig: Warn if help text is blank")
cb67ab2cd2b8ab ("kconfig: do not write choice values when their dependency becomes n")
4f208f392103e8 ("kconfig: show '?' prompt even if no help text is available")
cd58a91def2acc ("kconfig: remove 'config*' pattern from .gitignnore")
d2a04648a5dbc3 ("kconfig: remove check_stdin()")
f3ff6fb5db68bc ("kconfig: echo stdin to stdout if either is redirected")
9e3e10c725360b ("kconfig: send error messages to stderr")
d717f24d8c6808 ("kconfig: add xrealloc() helper")
523ca58b7db2e3 ("kconfig: remove const qualifier from sym_expand_string_value()")
cd81fc82b93fa4 ("kconfig: add xstrdup() helper")
f4bc1eefc1608e ("kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list")
bf0bbdcf100322 ("kconfig: Don't leak choice names during parsing")
1a90ce36c6eff6 ("kconfig: Update ncurses package names for menuconfig")
5ae6fcc4bb82bd ("kconfig: fix line number in recursive inclusion error message")
07a422bb213adb ! ("kbuild: restore autoksyms.h touch to the top Makefile")
9a47ceec543bfb ("kconfig: clean-up reverse dependency help implementation")
d9119b5925a03b ("kconfig: Print reverse dependencies in groups")
f467c5640c29ad ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols")
59a80b5e892dde ("kconfig: do not call check_conf() for olddefconfig")
4bb3a5b085cd6f ("kconfig: remove unneeded input_mode test in conf()")
99f0b6578bab44 ("kconfig: remove redundant input_mode test for check_conf() loop")
2aad9b89621386 ("kconfig: hide irrelevant sub-menus for oldconfig")
81d2bc2273052e ("kconfig: invoke oldconfig instead of silentoldconfig from local*config")
911a91c39cabcb ! ("kconfig: rename silentoldconfig to syncconfig")
2a61625835c7c8 ! ("kconfig: remove redundant streamline_config.pl prerequisite")
022a4bf6b59dfd ("kconfig: tests: add framework for Kconfig unit testing")
1903c511905984 ("kconfig: tests: add basic choice tests")
49ac3c0c3aa3b7 ("kconfig: tests: test automatic submenu creation")
b76960c0f6b25d ("kconfig: tests: test if new symbols in choice are asked")
930c429a656fdb ("kconfig: tests: check unneeded "is not set" with unmet dependency")
ee236610653ede ("kconfig: tests: check visibility of tristate choice values in y choice")
beaaddb625400e ("kconfig: tests: test defconfig when two choices interact")
3e4888c2e3d77d ("kconfig: tests: test randconfig for choice in choice")
29c434f367ea7b ("kconfig: tests: test if recursive dependencies are detected")
e2c75e7667c737 ("kconfig: tests: test if recursive inclusion is detected")
f622f827958162 ("kconfig: warn unmet direct dependency of tristate symbols selected by y")
f8f69dc0b4e070 ("kconfig: make unmet dependency warnings readable")
26561514cc9def ("kconfig: do not include both curses.h and ncurses.h for nconfig")
32a94b8b0c3e5a ("kconfig: remove duplicated file name and lineno of recursive inclusion")
379a8eb8eb1a55 ("kconfig: detect recursive inclusion earlier")
18492685e479fd ("kconfig: use yylineno option instead of manual lineno increments")
59889300274569 ! (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ! ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e ! ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 ! ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
17baab68d337a0 ("kconfig: extend output of 'listnewconfig'")
e9781b52d4e0e3 ! ("kbuild: add PYTHON2 and PYTHON3 variables")
The current Kconfig update generates below build-time warnings:
YACC scripts/dtc/dtc-parser.tab.h
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
YACC scripts/dtc/dtc-parser.tab.c
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
This seems to happen because the Kbuild updates apparently didn't make
room for both "*shipped"-based builds and flex/bison-based builds. A
similar problem has been reported for genksyms parser in v4.17-rc1
commit 833e622459432e ("genksyms: generate lexer and parser during build
instead of shipping"). I have figured out empirically that the warnings
are healed after updating the in-tree U-boot DTC to upstream v1.4.6-9,
same as done by Linux v4.17-rc1 commit 9130ba88464032 ("scripts/dtc:
Update to upstream version v1.4.6-9-gaadd0b65c987"). Whether fixing the
DTC-related yacc warnings should be done together with the Kconfig
re-sync, I would like to hear from community.
My testing was limited to:
- make defconfig all
- make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
- comparing .config before and after the re-sync
- running the newly imported Kconfig unit tests as seen below:
$ make testconfig
Tested-by: Petr Vorel <petr.vorel@gmail.com>
============================= test session starts =============================
scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED [ 7%]
scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED [ 14%]
scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED [ 21%]
scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED [ 28%]
scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED [ 35%]
scripts/kconfig/tests/choice/__init__.py::test_allno PASSED [ 42%]
scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED [ 50%]
scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED [ 57%]
scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED [ 64%]
scripts/kconfig/tests/inter_choice/__init__.py::test PASSED [ 71%]
scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED [ 78%]
scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED [ 85%]
scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED [ 92%]
scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED [100%]
========================== 14 passed in 0.34 seconds ==========================
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Petr Vorel <petr.vorel@gmail.com>
2018-05-19 12:13:50 +00:00
|
|
|
cmd_bison_h = $(YACC) -o/dev/null --defines=$@ -t -l $<
|
2014-02-04 08:24:27 +00:00
|
|
|
|
kconfig: re-sync with Linux 4.17-rc4
Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.
Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
re-sync with Linux 4.10") and it achieved almost perfect alignment with
a few (intended) exceptions, caused by below U-boot commits:
[A] v2015.04 5f9eb2207500 ("kbuild: remove scripts/multiconfig.sh")
[B] v2015.07 20c20826efab ("Kconfig: Enable usage of escape char '\' in string values")
[C] v2016.01 da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags")
[D] v2016.03 5b8031ccb4ed ("Add more SPDX-License-Identifier tags")
[E] v2016.03 192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.")
Here is the list of Kconfig commits which followed the v4.10 alignment:
[F] v2018.01 0931ed3c0d0f ("kconfig/symbol.c: use correct pointer type argument for sizeof")
[G] v2018.03 1414e09b4f25 ("kconfig: revert change that was not needed for -Wformat-security")
[H] v2018.05 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")
Commit [F] was subsequently applied to Linux kernel as commit [I]
with the same patch id, so it won't contribute to further misalignment.
[I] v4.15-rc1 88127dae6ed9 ("kconfig/symbol.c: use correct pointer type argument for sizeof")
Commit [G] is a Kconfig-specific revert of commit [E].
Commit [H] relocated and reformatted the license doing no functional change.
In summary, the only functional change that makes U-boot Kconfig
diverge from Linux Kconfig is commit [B]. After a brief analysis,
the purpose of [B] seems to be placing "\n" literals in string symbols
like CONFIG_AUTOBOOT_PROMPT="autoboot in %d seconds\n" in order to pass
them directly to printf and expect correct output at runtime. Currently,
Linux doesn't seem to have this requirement, so for the moment [B] looks
like a U-boot specific feature/fix. From point of view of further Kconfig
alignment and backporting efforts, it is highly desired that commits
like [B] are propagated to Linux and any Kconfig fixes/features are
contributed to Linux kernel first. This specific Kconfig re-sync just
keeps [B] in place.
Contrary to 4.10 Kconfig re-sync (which achieves zero non-kconfig
changes), 4.17-rc4 re-sync does some amount of updates in Kbuild
(striving to keep them at minimum), due to a number of reasons:
* Kbuild is affected by the removal of Kconfig "*shipped" files and now
requires flex and bison pre-installed on the host.
* PYTHON{2,3} variables are defined in top-level Makefile as
prerequisite for running the newly developed Kconfig unit tests.
* silentoldconfig becomes an "internal implementation detail" deprecated
for external use, being renamed to syncconfig.
The exact non-kconfig files touched by this commit are:
$ git show --format="" --stat -- ':!scripts/kconfig'
.gitignore | 2 ++
Makefile | 9 +++++++--
scripts/Makefile.build | 11 +++++++++++
scripts/Makefile.lib | 41 ++++++++++++-----------------------------
The imported Linux commits touching the above files are:
c054be10ffdbd5 ("remove gperf left-overs from build system")
73a4f6dbe70a1b ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ("kbuild: prepare to remove C files pre-generated by flex and bison")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
911a91c39cabcb H ("kconfig: rename silentoldconfig to syncconfig")
59889300274569 (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e H ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 H ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
e9781b52d4e0e3 H ("kbuild: add PYTHON2 and PYTHON3 variables")
The commits marked with 'H' are assessed as "hard" (build will fail)
prerequisites and the rest of them are assessed as "soft" prerequisites
for the re-sync. In spite of relatively high number of non-H commits,
they belong to this Kconfig update topic-wise and decrease the number of
cherry pick conflicts for many commits in this series. Additional effort
can be put in eliminating the soft prerequisites, if really needed.
The commits which contributed to this Kconfig re-sync are listed below.
Whenever a conflict resolution has been performed (mostly by hand, but
sometimes automatically by git), it is revealed by the '!' sign in the
second column, which means a patch id mismatch between Linux and U-boot
commits:
9be3213b14d44f ("gconfig: remove misleading parentheses around a condition")
ff85a1a80e0034 ("kconfig: Check for libncurses before menuconfig")
ad8181060788c8 ("kconfig: fix sparse warnings in nconfig")
cb77f0d623ff33 ! ("scripts: Switch to more portable Perl shebang")
bb3290d91695bb ! ("Remove gperf usage from toolchain")
c054be10ffdbd5 ("remove gperf left-overs from build system")
b24413180f5600 ! ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license")
9059a3493efea6 ! ("kconfig: fix relational operators for bool and tristate symbols")
2c37e08464a850 ("kconfig: Warn if choice default is not in choice")
33ca1a24866373 ("kconfig: Document the 'menu' struct")
52aede4ba5efd1 ("kconfig: Document the 'symbol' struct")
c873443430ebd1 ("kconfig: Sync zconf.y with zconf.tab.c_shipped")
9a826842ff2fbd ("kconfig: Rename menu_check_dep() to rewrite_m()")
fa8cedaef814ce ("kconfig: Clarify expression rewriting")
f77850d3fe0c96 ("kconfig: Clean up modules handling and fix crash")
e3b03bf29d6b99 ("kconfig: display recursive dependency resolution hint just once")
73a4f6dbe70a1b ! ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ! ("kbuild: prepare to remove C files pre-generated by flex and bison")
29c833061c1d8c ("kconfig: generate lexer and parser during build instead of shipping")
26e47a3c11a25c ("kconfig: Don't leak symbol names during parsing")
24161a6711c945 ("kconfig: Don't leak 'source' filenames during parsing")
bc28fe1d5ede88 ("kconfig: Don't leak 'option' arguments during parsing")
0724a7c32a54e3 ("kconfig: Don't leak main menus during parsing")
ae7440ef0c8013 ("kconfig: Fix automatic menu creation mem leak")
5b1374b3b3c2fc ("kconfig: Fix expr_free() E_NOT leak")
7cf33f88e29410 ("kconfig: Fix choice symbol expression leak")
05cccce580456d ("kconfig: Document automatic submenu creation code")
0735f7e5def2ab ("kconfig: Document important expression functions")
df60f4b92d3d0b ("kconfig: Remove menu_end_entry()")
b92d804a51796b ("kconfig: drop 'boolean' keyword")
6479f327dea60d ("kconfig: Warn if there is more than one help text")
52e58a3caeba5d ("kconfig: make input_mode static")
5a3dc717b3c785 ("kconfig: make xfgets() really static")
84dd95d4f87a0d ("kconfig: make conf_unsaved a local variable of conf_read()")
765f4cdef6f80d ("kconfig: use default 'yy' prefix for lexer and parser")
eea199b445f64c ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0 ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ! ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
3e41ba05b6d60c ("kconfig: Document SYMBOL_OPTIONAL logic")
d3465af60f4471 ("kconfig: Clarify choice dependency propagation")
9d1a9e8bc18bea ("kconfig: Document 'if' flattening logic")
b53688014e3325 ("kconfig: Clarify menu and 'if' dependency propagation")
d0fd0428ecf04b ("kconfig: fix make xconfig when gettext is missing")
312ee68752faaa ("kconfig: announce removal of oldnoconfig if used")
1ccb27143360bd ("kconfig: make "Selected by:" and "Implied by:" readable")
cedd55d49dee94 ! ("kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help")
1b9eda2e4892cb ("kconfig: Warn if help text is blank")
cb67ab2cd2b8ab ("kconfig: do not write choice values when their dependency becomes n")
4f208f392103e8 ("kconfig: show '?' prompt even if no help text is available")
cd58a91def2acc ("kconfig: remove 'config*' pattern from .gitignnore")
d2a04648a5dbc3 ("kconfig: remove check_stdin()")
f3ff6fb5db68bc ("kconfig: echo stdin to stdout if either is redirected")
9e3e10c725360b ("kconfig: send error messages to stderr")
d717f24d8c6808 ("kconfig: add xrealloc() helper")
523ca58b7db2e3 ("kconfig: remove const qualifier from sym_expand_string_value()")
cd81fc82b93fa4 ("kconfig: add xstrdup() helper")
f4bc1eefc1608e ("kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list")
bf0bbdcf100322 ("kconfig: Don't leak choice names during parsing")
1a90ce36c6eff6 ("kconfig: Update ncurses package names for menuconfig")
5ae6fcc4bb82bd ("kconfig: fix line number in recursive inclusion error message")
07a422bb213adb ! ("kbuild: restore autoksyms.h touch to the top Makefile")
9a47ceec543bfb ("kconfig: clean-up reverse dependency help implementation")
d9119b5925a03b ("kconfig: Print reverse dependencies in groups")
f467c5640c29ad ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols")
59a80b5e892dde ("kconfig: do not call check_conf() for olddefconfig")
4bb3a5b085cd6f ("kconfig: remove unneeded input_mode test in conf()")
99f0b6578bab44 ("kconfig: remove redundant input_mode test for check_conf() loop")
2aad9b89621386 ("kconfig: hide irrelevant sub-menus for oldconfig")
81d2bc2273052e ("kconfig: invoke oldconfig instead of silentoldconfig from local*config")
911a91c39cabcb ! ("kconfig: rename silentoldconfig to syncconfig")
2a61625835c7c8 ! ("kconfig: remove redundant streamline_config.pl prerequisite")
022a4bf6b59dfd ("kconfig: tests: add framework for Kconfig unit testing")
1903c511905984 ("kconfig: tests: add basic choice tests")
49ac3c0c3aa3b7 ("kconfig: tests: test automatic submenu creation")
b76960c0f6b25d ("kconfig: tests: test if new symbols in choice are asked")
930c429a656fdb ("kconfig: tests: check unneeded "is not set" with unmet dependency")
ee236610653ede ("kconfig: tests: check visibility of tristate choice values in y choice")
beaaddb625400e ("kconfig: tests: test defconfig when two choices interact")
3e4888c2e3d77d ("kconfig: tests: test randconfig for choice in choice")
29c434f367ea7b ("kconfig: tests: test if recursive dependencies are detected")
e2c75e7667c737 ("kconfig: tests: test if recursive inclusion is detected")
f622f827958162 ("kconfig: warn unmet direct dependency of tristate symbols selected by y")
f8f69dc0b4e070 ("kconfig: make unmet dependency warnings readable")
26561514cc9def ("kconfig: do not include both curses.h and ncurses.h for nconfig")
32a94b8b0c3e5a ("kconfig: remove duplicated file name and lineno of recursive inclusion")
379a8eb8eb1a55 ("kconfig: detect recursive inclusion earlier")
18492685e479fd ("kconfig: use yylineno option instead of manual lineno increments")
59889300274569 ! (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ! ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e ! ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 ! ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
17baab68d337a0 ("kconfig: extend output of 'listnewconfig'")
e9781b52d4e0e3 ! ("kbuild: add PYTHON2 and PYTHON3 variables")
The current Kconfig update generates below build-time warnings:
YACC scripts/dtc/dtc-parser.tab.h
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
YACC scripts/dtc/dtc-parser.tab.c
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
This seems to happen because the Kbuild updates apparently didn't make
room for both "*shipped"-based builds and flex/bison-based builds. A
similar problem has been reported for genksyms parser in v4.17-rc1
commit 833e622459432e ("genksyms: generate lexer and parser during build
instead of shipping"). I have figured out empirically that the warnings
are healed after updating the in-tree U-boot DTC to upstream v1.4.6-9,
same as done by Linux v4.17-rc1 commit 9130ba88464032 ("scripts/dtc:
Update to upstream version v1.4.6-9-gaadd0b65c987"). Whether fixing the
DTC-related yacc warnings should be done together with the Kconfig
re-sync, I would like to hear from community.
My testing was limited to:
- make defconfig all
- make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
- comparing .config before and after the re-sync
- running the newly imported Kconfig unit tests as seen below:
$ make testconfig
Tested-by: Petr Vorel <petr.vorel@gmail.com>
============================= test session starts =============================
scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED [ 7%]
scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED [ 14%]
scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED [ 21%]
scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED [ 28%]
scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED [ 35%]
scripts/kconfig/tests/choice/__init__.py::test_allno PASSED [ 42%]
scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED [ 50%]
scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED [ 57%]
scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED [ 64%]
scripts/kconfig/tests/inter_choice/__init__.py::test PASSED [ 71%]
scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED [ 78%]
scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED [ 85%]
scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED [ 92%]
scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED [100%]
========================== 14 passed in 0.34 seconds ==========================
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Petr Vorel <petr.vorel@gmail.com>
2018-05-19 12:13:50 +00:00
|
|
|
$(obj)/%.tab.h: $(src)/%.y FORCE
|
|
|
|
$(call if_changed,bison_h)
|
2014-02-04 08:24:27 +00:00
|
|
|
|
|
|
|
# Shipped files
|
|
|
|
# ===========================================================================
|
|
|
|
|
|
|
|
quiet_cmd_shipped = SHIPPED $@
|
|
|
|
cmd_shipped = cat $< > $@
|
|
|
|
|
|
|
|
$(obj)/%: $(src)/%_shipped
|
|
|
|
$(call cmd,shipped)
|
|
|
|
|
|
|
|
# Commands useful for building a boot image
|
|
|
|
# ===========================================================================
|
2014-06-16 09:56:38 +00:00
|
|
|
#
|
2014-02-04 08:24:27 +00:00
|
|
|
# Use as following:
|
|
|
|
#
|
|
|
|
# target: source(s) FORCE
|
|
|
|
# $(if_changed,ld/objcopy/gzip)
|
|
|
|
#
|
|
|
|
# and add target to extra-y so that we know we have to
|
|
|
|
# read in the saved command line
|
|
|
|
|
|
|
|
# Linking
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
quiet_cmd_ld = LD $@
|
2020-03-27 15:46:27 +00:00
|
|
|
cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@
|
2014-02-04 08:24:27 +00:00
|
|
|
|
|
|
|
# Objcopy
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
quiet_cmd_objcopy = OBJCOPY $@
|
|
|
|
cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
|
|
|
|
|
|
|
|
# Gzip
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
quiet_cmd_gzip = GZIP $@
|
|
|
|
cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \
|
|
|
|
(rm -f $@ ; false)
|
|
|
|
|
|
|
|
# DTC
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
2020-02-24 17:50:33 +00:00
|
|
|
# Disable noisy checks by default
|
|
|
|
ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
|
|
|
|
DTC_FLAGS += -Wno-unit_address_vs_reg \
|
|
|
|
-Wno-unit_address_format \
|
|
|
|
-Wno-avoid_unnecessary_addr_size \
|
|
|
|
-Wno-alias_paths \
|
2020-03-11 22:11:17 +00:00
|
|
|
-Wno-graph_child_address \
|
|
|
|
-Wno-graph_port \
|
|
|
|
-Wno-unique_unit_address \
|
2020-02-24 17:50:35 +00:00
|
|
|
-Wno-simple_bus_reg \
|
2020-02-24 17:50:33 +00:00
|
|
|
-Wno-pci_device_reg
|
2020-02-24 17:50:34 +00:00
|
|
|
|
|
|
|
# U-Boot specific disables
|
|
|
|
DTC_FLAGS += -Wno-pci_bridge \
|
|
|
|
-Wno-pci_device_bus_num
|
2020-02-24 17:50:33 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(findstring 2,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
|
|
|
|
DTC_FLAGS += -Wnode_name_chars_strict \
|
|
|
|
-Wproperty_name_chars_strict
|
|
|
|
endif
|
|
|
|
|
|
|
|
DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
|
|
|
|
|
2014-02-04 08:24:27 +00:00
|
|
|
# Generate an assembly file to wrap the output of the device tree compiler
|
|
|
|
quiet_cmd_dt_S_dtb= DTB $@
|
2014-02-05 02:28:25 +00:00
|
|
|
# Modified for U-Boot
|
2014-02-04 08:24:27 +00:00
|
|
|
cmd_dt_S_dtb= \
|
|
|
|
( \
|
|
|
|
echo '.section .dtb.init.rodata,"a"'; \
|
2014-11-15 01:18:19 +00:00
|
|
|
echo '.balign 16'; \
|
2016-07-05 08:26:35 +00:00
|
|
|
echo '.global __dtb_$(subst -,_,$(*F))_begin'; \
|
|
|
|
echo '__dtb_$(subst -,_,$(*F))_begin:'; \
|
2014-02-04 08:24:27 +00:00
|
|
|
echo '.incbin "$<" '; \
|
2016-07-05 08:26:35 +00:00
|
|
|
echo '__dtb_$(subst -,_,$(*F))_end:'; \
|
|
|
|
echo '.global __dtb_$(subst -,_,$(*F))_end'; \
|
2014-11-15 01:18:19 +00:00
|
|
|
echo '.balign 16'; \
|
2014-02-04 08:24:27 +00:00
|
|
|
) > $@
|
|
|
|
|
|
|
|
$(obj)/%.dtb.S: $(obj)/%.dtb
|
|
|
|
$(call cmd,dt_S_dtb)
|
|
|
|
|
2020-07-22 12:58:25 +00:00
|
|
|
ifeq ($(CONFIG_OF_LIBFDT_OVERLAY),y)
|
2019-10-22 14:39:16 +00:00
|
|
|
DTC_FLAGS += -@
|
|
|
|
endif
|
|
|
|
|
2014-02-04 08:24:27 +00:00
|
|
|
quiet_cmd_dtc = DTC $@
|
2014-02-05 02:28:25 +00:00
|
|
|
# Modified for U-Boot
|
2017-05-17 18:06:08 +00:00
|
|
|
# Bring in any U-Boot-specific include at the end of the file
|
introduce CONFIG_DEVICE_TREE_INCLUDES
The build system already automatically looks for and includes an
in-tree *-u-boot.dtsi when building the control .dtb. However, there
are some things that are awkward to maintain in such an in-tree file,
most notably the metadata associated to public keys used for verified
boot.
The only "official" API to get that metadata into the .dtb is via
mkimage, as a side effect of building an actual signed image. But
there are multiple problems with that. First of all, the final U-Boot
(be it U-Boot proper or an SPL) image is built based on a binary
image, the .dtb, and possibly some other binary artifacts. So
modifying the .dtb after the build requires the meta-buildsystem
(Yocto, buildroot, whatnot) to know about and repeat some of the steps
that are already known to and handled by U-Boot's build system,
resulting in needless duplication of code. It's also somewhat annoying
and inconsistent to have a .dtb file in the build folder which is not
generated by the command listed in the corresponding .cmd file (that
of course applies to any generated file).
So the contents of the /signature node really needs to be baked into
the .dtb file when it is first created, which means providing the
relevant data in the form of a .dtsi file. One could in theory put
that data into the *-u-boot.dtsi file, but it's more convenient to be
able to provide it externally: For example, when developing for a
customer, it's common to use a set of dummy keys for development,
while the consultants do not (and should not) have access to the
actual keys used in production. For such a setup, it's easier if the
keys used are chosen via the meta-buildsystem and the path(s) patched
in during the configure step. And of course, nothing prevents anybody
from having DEVICE_TREE_INCLUDES point at files maintained in git, or
for that matter from including the public key metadata in the
*-u-boot.dtsi directly and ignore this feature.
There are other uses for this, e.g. in combination with ENV_IMPORT_FDT
it can be used for providing the contents of the /config/environment
node, so I don't want to tie this exclusively to use for verified
boot.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Fix doc formatting error (make htmldocs)
Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-21 13:52:51 +00:00
|
|
|
# And finally any custom .dtsi fragments specified with CONFIG_DEVICE_TREE_INCLUDES
|
2015-07-04 16:56:55 +00:00
|
|
|
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
|
2018-09-19 02:35:57 +00:00
|
|
|
(cat $<; $(if $(u_boot_dtsi),echo '$(pound)include "$(u_boot_dtsi)"')) > $(pre-tmp); \
|
introduce CONFIG_DEVICE_TREE_INCLUDES
The build system already automatically looks for and includes an
in-tree *-u-boot.dtsi when building the control .dtb. However, there
are some things that are awkward to maintain in such an in-tree file,
most notably the metadata associated to public keys used for verified
boot.
The only "official" API to get that metadata into the .dtb is via
mkimage, as a side effect of building an actual signed image. But
there are multiple problems with that. First of all, the final U-Boot
(be it U-Boot proper or an SPL) image is built based on a binary
image, the .dtb, and possibly some other binary artifacts. So
modifying the .dtb after the build requires the meta-buildsystem
(Yocto, buildroot, whatnot) to know about and repeat some of the steps
that are already known to and handled by U-Boot's build system,
resulting in needless duplication of code. It's also somewhat annoying
and inconsistent to have a .dtb file in the build folder which is not
generated by the command listed in the corresponding .cmd file (that
of course applies to any generated file).
So the contents of the /signature node really needs to be baked into
the .dtb file when it is first created, which means providing the
relevant data in the form of a .dtsi file. One could in theory put
that data into the *-u-boot.dtsi file, but it's more convenient to be
able to provide it externally: For example, when developing for a
customer, it's common to use a set of dummy keys for development,
while the consultants do not (and should not) have access to the
actual keys used in production. For such a setup, it's easier if the
keys used are chosen via the meta-buildsystem and the path(s) patched
in during the configure step. And of course, nothing prevents anybody
from having DEVICE_TREE_INCLUDES point at files maintained in git, or
for that matter from including the public key metadata in the
*-u-boot.dtsi directly and ignore this feature.
There are other uses for this, e.g. in combination with ENV_IMPORT_FDT
it can be used for providing the contents of the /config/environment
node, so I don't want to tie this exclusively to use for verified
boot.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Fix doc formatting error (make htmldocs)
Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-21 13:52:51 +00:00
|
|
|
$(foreach f,$(subst $(quote),,$(CONFIG_DEVICE_TREE_INCLUDES)), \
|
|
|
|
echo '$(pound)include "$(f)"' >> $(pre-tmp);) \
|
2021-06-17 22:07:25 +00:00
|
|
|
$(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \
|
2015-04-06 13:46:44 +00:00
|
|
|
$(DTC) -O dtb -o $@ -b 0 \
|
2014-02-04 08:24:27 +00:00
|
|
|
-i $(dir $<) $(DTC_FLAGS) \
|
fdt: Show the preprocessed .dts file on error
When device-tree compilation fails it is sometimes tricky to see which
line is broken, since the input file to dtc is a pre-processed version
of the device tree.
Add a line that points to the file that needs to be checked:
When the error is in the main .dts file, output is something like this:
output: 'Error: arch/x86/dts/.chromebook_coral.dtb.pre.tmp:478.46-47
syntax error
FATAL ERROR: Unable to parse input tree
but in fact looking at that file shows nothing useful:
PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_157, UP_20K, DEEP, NF1, HIZCRX1, DISPUPD)
Instead we need to look at the preprocessed file, which shows:
163 ((1U << 30) | (1 << 10)) ((0xb << 10) | PAD_CFG1_IOSSTATE_HIZCRX1)
Here it is clear that PAD_CFG1_IOSSTATE_HIZCRX1 is not defined and so is
not being resolved by the preprocessor.
This commit adds an additional useful message:
Check arch/x86/dts/.chromebook_coral.dtb.dts.tmp for errors
Note that if the error is reported in an included file, such as
u-boot.dtsi then the output is the following:
Error: arch/x86/dts/u-boot.dtsi:137.14-15 syntax error
FATAL ERROR: Unable to parse input tree
But again, if the error is due to a preprocessor failure, like this:
filename = CONFIG_IFW_INPUT_FILE;
then you can't tell what the problem is by looking at the source. All you
see is the original code:
intel-ifwi {
filename = CONFIG_IFW_INPUT_FILE;
...
};
};
intel-fsp-m {
filename = CONFIG_FSP_FILE_M;
};
Everything looks fine. But looking at the output of the preprocessor:
intel-ifwi {
filename = CONFIG_IFW_INPUT_FILE;
...
};
intel-fsp-m {
filename = "fsp_m.bin";
};
This shows that the filename (normally "fitimage.bin") has not been
inserted the preprocess, leading to the realisation that the value should
be CONFIG_IFWI_INPUT_FILE.
If the above does not make sense, I encourage people to try introducing
errors in the device tree preprocessed values.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-12-07 04:41:44 +00:00
|
|
|
-d $(depfile).dtc.tmp $(dtc-tmp) || \
|
|
|
|
(echo "Check $(shell pwd)/$(pre-tmp) for errors" && false) \
|
|
|
|
; \
|
2021-02-13 10:06:32 +00:00
|
|
|
sed "s:$(pre-tmp):$(<):" $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
|
2014-02-04 08:24:27 +00:00
|
|
|
|
|
|
|
$(obj)/%.dtb: $(src)/%.dts FORCE
|
|
|
|
$(call if_changed_dep,dtc)
|
|
|
|
|
2017-10-11 14:56:10 +00:00
|
|
|
pre-tmp = $(subst $(comma),_,$(dot-target).pre.tmp)
|
2014-02-04 08:24:27 +00:00
|
|
|
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
|
|
|
|
|
2017-09-04 20:12:20 +00:00
|
|
|
# DTCO
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
quiet_cmd_dtco = DTCO $@
|
|
|
|
# Rule for objects only; does not put specific u-boot include at the end
|
|
|
|
# No generation of assembly file either
|
|
|
|
# Modified for U-Boot
|
|
|
|
cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \
|
2019-02-11 13:51:02 +00:00
|
|
|
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
|
2017-09-04 20:12:20 +00:00
|
|
|
$(DTC) -@ -O dtb -o $@ -b 0 \
|
|
|
|
-i $(dir $<) $(DTC_FLAGS) \
|
|
|
|
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
|
|
|
|
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
|
|
|
|
|
|
|
|
$(obj)/%.dtbo: $(src)/%.dts FORCE
|
|
|
|
$(call if_changed_dep,dtco)
|
|
|
|
|
2016-01-15 01:10:35 +00:00
|
|
|
# Fonts
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# Generate an assembly file to wrap the font data
|
|
|
|
quiet_cmd_S_ttf= TTF $@
|
|
|
|
# Modified for U-Boot
|
|
|
|
cmd_S_ttf= \
|
|
|
|
( \
|
|
|
|
echo '.section .rodata.ttf.init,"a"'; \
|
|
|
|
echo '.balign 16'; \
|
|
|
|
echo '.global __ttf_$(*F)_begin'; \
|
|
|
|
echo '__ttf_$(*F)_begin:'; \
|
|
|
|
echo '.incbin "$<" '; \
|
|
|
|
echo '__ttf_$(*F)_end:'; \
|
|
|
|
echo '.global __ttf_$(*F)_end'; \
|
|
|
|
echo '.balign 16'; \
|
|
|
|
) > $@
|
|
|
|
|
|
|
|
$(obj)/%.S: $(src)/%.ttf
|
|
|
|
$(call cmd,S_ttf)
|
|
|
|
|
2021-11-19 20:24:03 +00:00
|
|
|
# Splash logos
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# Generate an assembly file to wrap the splash data
|
|
|
|
quiet_cmd_S_splash= TTF $@
|
|
|
|
# Modified for U-Boot
|
|
|
|
cmd_S_splash= \
|
|
|
|
( \
|
|
|
|
echo '.section .rodata.splash.init,"a"'; \
|
|
|
|
echo '.balign 16'; \
|
|
|
|
echo '.global __splash_$(*F)_begin'; \
|
|
|
|
echo '__splash_$(*F)_begin:'; \
|
|
|
|
echo '.incbin "$<" '; \
|
|
|
|
echo '__splash_$(*F)_end:'; \
|
|
|
|
echo '.global __splash_$(*F)_end'; \
|
|
|
|
echo '.balign 16'; \
|
|
|
|
) > $@
|
|
|
|
|
|
|
|
$(obj)/%.S: $(src)/%.bmp
|
|
|
|
$(call cmd,S_splash)
|
|
|
|
|
2017-09-05 14:07:17 +00:00
|
|
|
# EFI applications
|
|
|
|
# A Makefile target *.efi is built as EFI application.
|
|
|
|
# A Makefile target *_efi.S wraps *.efi as built-in EFI application.
|
2016-11-07 15:47:08 +00:00
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# Generate an assembly file to wrap the EFI app
|
2017-09-05 14:07:17 +00:00
|
|
|
cmd_S_efi= \
|
|
|
|
( \
|
|
|
|
echo '.section .rodata.$*.init,"a"'; \
|
|
|
|
echo '.balign 16'; \
|
|
|
|
echo '.global __efi_$*_begin'; \
|
|
|
|
echo '__efi_$*_begin:'; \
|
|
|
|
echo '.incbin "$<" '; \
|
|
|
|
echo '__efi_$*_end:'; \
|
|
|
|
echo '.global __efi_$*_end'; \
|
|
|
|
echo '.balign 16'; \
|
2016-11-07 15:47:08 +00:00
|
|
|
) > $@
|
|
|
|
|
|
|
|
$(obj)/%_efi.S: $(obj)/%.efi
|
|
|
|
$(call cmd,S_efi)
|
|
|
|
|
2017-01-06 22:23:59 +00:00
|
|
|
quiet_cmd_efi_objcopy = OBJCOPY $@
|
|
|
|
cmd_efi_objcopy = $(OBJCOPY) -j .header -j .text -j .sdata -j .data -j \
|
|
|
|
.dynamic -j .dynsym -j .rel* -j .rela* -j .reloc \
|
2016-11-07 15:47:08 +00:00
|
|
|
$(if $(EFI_TARGET),$(EFI_TARGET),-O binary) $^ $@
|
|
|
|
|
2017-09-05 14:07:17 +00:00
|
|
|
$(obj)/%.efi: $(obj)/%_efi.so
|
2017-01-06 22:23:59 +00:00
|
|
|
$(call cmd,efi_objcopy)
|
|
|
|
|
|
|
|
quiet_cmd_efi_ld = LD $@
|
2022-07-12 06:11:53 +00:00
|
|
|
cmd_efi_ld = $(LD) -nostdlib -zexecstack -znocombreloc -T $(EFI_LDS_PATH) \
|
|
|
|
-shared -Bsymbolic -znorelro -s $^ -o $@
|
2017-01-06 22:23:59 +00:00
|
|
|
|
2016-11-07 15:47:08 +00:00
|
|
|
EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS)
|
|
|
|
|
2019-07-22 05:59:23 +00:00
|
|
|
$(obj)/efi_crt0.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_CRT0:.o=.S) FORCE
|
2018-06-02 17:00:41 +00:00
|
|
|
$(call if_changed_dep,as_o_S)
|
|
|
|
|
|
|
|
$(obj)/efi_reloc.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_RELOC:.o=.c) $(recordmcount_source) FORCE
|
|
|
|
$(call cmd,force_checksrc)
|
|
|
|
$(call if_changed_rule,cc_o_c)
|
|
|
|
|
2019-03-11 21:04:51 +00:00
|
|
|
$(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o
|
2017-01-06 22:23:59 +00:00
|
|
|
$(call cmd,efi_ld)
|
2016-11-07 15:47:08 +00:00
|
|
|
|
2020-05-04 12:38:29 +00:00
|
|
|
targets += $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o
|
|
|
|
|
2021-05-20 11:24:03 +00:00
|
|
|
CFLAGS_REMOVE_efi_reloc.o := $(LTO_CFLAGS)
|
|
|
|
CFLAGS_REMOVE_efi_freestanding.o := $(LTO_CFLAGS)
|
|
|
|
|
x86: Generate a valid ACPI table
Implement write_acpi_table() to create a minimal working ACPI table.
This includes writing FACS, XSDT, RSDP, FADT, MCFG, MADT, DSDT & SSDT
ACPI table entries.
Use a Kconfig option GENERATE_ACPI_TABLE to tell U-Boot whether we need
actually write the APCI table just like we did for PIRQ routing, MP table
and SFI tables. With ACPI table existence, linux kernel gets control of
power management, thermal management, configuration management and
monitoring in hardware.
Signed-off-by: Saket Sinha <saket.sinha89@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tidied up whitespace and aligned some tabs:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-22 06:50:55 +00:00
|
|
|
# ACPI
|
|
|
|
# ---------------------------------------------------------------------------
|
2019-07-28 20:16:28 +00:00
|
|
|
#
|
|
|
|
# This first sends the file (typically dsdt.asl) through the preprocessor
|
|
|
|
# resolve includes and any CONFIG options used. This produces dsdt.asl.tmp
|
|
|
|
# which is pure ASL code. The Intel ASL (ACPI (Advanced Configuration and Power
|
|
|
|
# Interface) Source Language compiler (iasl) then converts this ASL code into a
|
|
|
|
# C file containing the hex data to build into U-Boot. This file is called
|
2022-02-22 13:54:39 +00:00
|
|
|
# dsdt_generated.hex (despite us setting the prefix to .../dsdt_generated.asl.tmp)
|
|
|
|
# so must be renamed to dsdt_generated.c for consumption by the build system.
|
2019-07-28 20:16:28 +00:00
|
|
|
ASL_TMP = $(patsubst %.c,%.asl.tmp,$@)
|
|
|
|
|
2016-05-07 14:46:16 +00:00
|
|
|
quiet_cmd_acpi_c_asl= ASL $<
|
x86: Generate a valid ACPI table
Implement write_acpi_table() to create a minimal working ACPI table.
This includes writing FACS, XSDT, RSDP, FADT, MCFG, MADT, DSDT & SSDT
ACPI table entries.
Use a Kconfig option GENERATE_ACPI_TABLE to tell U-Boot whether we need
actually write the APCI table just like we did for PIRQ routing, MP table
and SFI tables. With ACPI table existence, linux kernel gets control of
power management, thermal management, configuration management and
monitoring in hardware.
Signed-off-by: Saket Sinha <saket.sinha89@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tidied up whitespace and aligned some tabs:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-22 06:50:55 +00:00
|
|
|
cmd_acpi_c_asl= \
|
2020-04-08 22:57:37 +00:00
|
|
|
$(CPP) -x assembler-with-cpp -D__ASSEMBLY__ -D__ACPI__ \
|
|
|
|
-P $(UBOOTINCLUDE) -o $(ASL_TMP) $< && \
|
2021-12-01 16:02:44 +00:00
|
|
|
iasl -p $@ -I $(srctree)/board/$(BOARDDIR) -tc $(ASL_TMP) \
|
|
|
|
$(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
|
2019-07-28 20:16:28 +00:00
|
|
|
mv $(patsubst %.c,%.hex,$@) $@
|
x86: Generate a valid ACPI table
Implement write_acpi_table() to create a minimal working ACPI table.
This includes writing FACS, XSDT, RSDP, FADT, MCFG, MADT, DSDT & SSDT
ACPI table entries.
Use a Kconfig option GENERATE_ACPI_TABLE to tell U-Boot whether we need
actually write the APCI table just like we did for PIRQ routing, MP table
and SFI tables. With ACPI table existence, linux kernel gets control of
power management, thermal management, configuration management and
monitoring in hardware.
Signed-off-by: Saket Sinha <saket.sinha89@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tidied up whitespace and aligned some tabs:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-22 06:50:55 +00:00
|
|
|
|
2022-02-22 13:54:39 +00:00
|
|
|
$(obj)/dsdt_generated.c: $(src)/dsdt.asl
|
x86: Generate a valid ACPI table
Implement write_acpi_table() to create a minimal working ACPI table.
This includes writing FACS, XSDT, RSDP, FADT, MCFG, MADT, DSDT & SSDT
ACPI table entries.
Use a Kconfig option GENERATE_ACPI_TABLE to tell U-Boot whether we need
actually write the APCI table just like we did for PIRQ routing, MP table
and SFI tables. With ACPI table existence, linux kernel gets control of
power management, thermal management, configuration management and
monitoring in hardware.
Signed-off-by: Saket Sinha <saket.sinha89@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tidied up whitespace and aligned some tabs:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-22 06:50:55 +00:00
|
|
|
$(call cmd,acpi_c_asl)
|
2022-02-22 13:54:39 +00:00
|
|
|
$(Q)sed -i -e "s,dsdt_generated_aml_code,AmlCode," $@
|
x86: Generate a valid ACPI table
Implement write_acpi_table() to create a minimal working ACPI table.
This includes writing FACS, XSDT, RSDP, FADT, MCFG, MADT, DSDT & SSDT
ACPI table entries.
Use a Kconfig option GENERATE_ACPI_TABLE to tell U-Boot whether we need
actually write the APCI table just like we did for PIRQ routing, MP table
and SFI tables. With ACPI table existence, linux kernel gets control of
power management, thermal management, configuration management and
monitoring in hardware.
Signed-off-by: Saket Sinha <saket.sinha89@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tidied up whitespace and aligned some tabs:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-22 06:50:55 +00:00
|
|
|
|
2014-02-04 08:24:27 +00:00
|
|
|
# Bzip2
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# Bzip2 and LZMA do not include size in file... so we have to fake that;
|
|
|
|
# append the size as a 32-bit littleendian number as gzip does.
|
|
|
|
size_append = printf $(shell \
|
|
|
|
dec_size=0; \
|
|
|
|
for F in $1; do \
|
|
|
|
fsize=$$(stat -c "%s" $$F); \
|
|
|
|
dec_size=$$(expr $$dec_size + $$fsize); \
|
|
|
|
done; \
|
|
|
|
printf "%08x\n" $$dec_size | \
|
|
|
|
sed 's/\(..\)/\1 /g' | { \
|
|
|
|
read ch0 ch1 ch2 ch3; \
|
|
|
|
for ch in $$ch3 $$ch2 $$ch1 $$ch0; do \
|
|
|
|
printf '%s%03o' '\\' $$((0x$$ch)); \
|
|
|
|
done; \
|
|
|
|
} \
|
|
|
|
)
|
|
|
|
|
|
|
|
quiet_cmd_bzip2 = BZIP2 $@
|
|
|
|
cmd_bzip2 = (cat $(filter-out FORCE,$^) | \
|
|
|
|
bzip2 -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
|
|
|
|
(rm -f $@ ; false)
|
|
|
|
|
|
|
|
# Lzma
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
quiet_cmd_lzma = LZMA $@
|
|
|
|
cmd_lzma = (cat $(filter-out FORCE,$^) | \
|
|
|
|
lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
|
|
|
|
(rm -f $@ ; false)
|
|
|
|
|
|
|
|
quiet_cmd_lzo = LZO $@
|
|
|
|
cmd_lzo = (cat $(filter-out FORCE,$^) | \
|
|
|
|
lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
|
|
|
|
(rm -f $@ ; false)
|
|
|
|
|
|
|
|
quiet_cmd_lz4 = LZ4 $@
|
|
|
|
cmd_lz4 = (cat $(filter-out FORCE,$^) | \
|
|
|
|
lz4c -l -c1 stdin stdout && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
|
|
|
|
(rm -f $@ ; false)
|
|
|
|
|
|
|
|
# U-Boot mkimage
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
MKIMAGE := $(srctree)/scripts/mkuboot.sh
|
|
|
|
|
|
|
|
# SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces
|
|
|
|
# the number of overrides in arch makefiles
|
|
|
|
UIMAGE_ARCH ?= $(SRCARCH)
|
|
|
|
UIMAGE_COMPRESSION ?= $(if $(2),$(2),none)
|
|
|
|
UIMAGE_OPTS-y ?=
|
|
|
|
UIMAGE_TYPE ?= kernel
|
|
|
|
UIMAGE_LOADADDR ?= arch_must_set_this
|
|
|
|
UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR)
|
|
|
|
UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)'
|
|
|
|
UIMAGE_IN ?= $<
|
|
|
|
UIMAGE_OUT ?= $@
|
|
|
|
|
|
|
|
quiet_cmd_uimage = UIMAGE $(UIMAGE_OUT)
|
|
|
|
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \
|
|
|
|
-C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \
|
|
|
|
-T $(UIMAGE_TYPE) \
|
|
|
|
-a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \
|
|
|
|
-n $(UIMAGE_NAME) -d $(UIMAGE_IN) $(UIMAGE_OUT)
|
|
|
|
|
|
|
|
# XZ
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# Use xzkern to compress the kernel image and xzmisc to compress other things.
|
|
|
|
#
|
|
|
|
# xzkern uses a big LZMA2 dictionary since it doesn't increase memory usage
|
|
|
|
# of the kernel decompressor. A BCJ filter is used if it is available for
|
|
|
|
# the target architecture. xzkern also appends uncompressed size of the data
|
|
|
|
# using size_append. The .xz format has the size information available at
|
|
|
|
# the end of the file too, but it's in more complex format and it's good to
|
|
|
|
# avoid changing the part of the boot code that reads the uncompressed size.
|
|
|
|
# Note that the bytes added by size_append will make the xz tool think that
|
|
|
|
# the file is corrupt. This is expected.
|
|
|
|
#
|
|
|
|
# xzmisc doesn't use size_append, so it can be used to create normal .xz
|
|
|
|
# files. xzmisc uses smaller LZMA2 dictionary than xzkern, because a very
|
|
|
|
# big dictionary would increase the memory usage too much in the multi-call
|
|
|
|
# decompression mode. A BCJ filter isn't used either.
|
|
|
|
quiet_cmd_xzkern = XZKERN $@
|
|
|
|
cmd_xzkern = (cat $(filter-out FORCE,$^) | \
|
|
|
|
sh $(srctree)/scripts/xz_wrap.sh && \
|
|
|
|
$(call size_append, $(filter-out FORCE,$^))) > $@ || \
|
|
|
|
(rm -f $@ ; false)
|
|
|
|
|
|
|
|
quiet_cmd_xzmisc = XZMISC $@
|
|
|
|
cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
|
|
|
|
xz --check=crc32 --lzma2=dict=1MiB) > $@ || \
|
|
|
|
(rm -f $@ ; false)
|
2014-06-04 01:12:21 +00:00
|
|
|
|
|
|
|
# Additional commands for U-Boot
|
|
|
|
#
|
2022-05-11 09:36:07 +00:00
|
|
|
# bin2c
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
quiet_cmd_bin2c = BIN2C $@
|
|
|
|
cmd_bin2c = $(objtree)/scripts/bin2c $2 < $< > $@
|
|
|
|
|
2014-06-04 01:12:21 +00:00
|
|
|
# mkimage
|
|
|
|
# ---------------------------------------------------------------------------
|
2016-11-06 15:37:58 +00:00
|
|
|
MKIMAGEOUTPUT ?= /dev/null
|
2014-06-04 01:12:21 +00:00
|
|
|
quiet_cmd_mkimage = MKIMAGE $@
|
|
|
|
cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
|
Makefile: always preserve output for images that can contain HAB Blocks
The current makefile logic disables creation of the
SPL.log/u-boot-ivt.img.log etc. files when V=1 is given on the command
line, the rationale presumably being that the user wants and gets the
information on the console.
However, from general principles, I don't think a higher V= level
should affect which build artifacts get generated (and certainly
shouldn't produce fewer). Concretely, it's also a problem that when
doing a V=1 build in a terminal, the relevant HAB blocks lines easily
drown in all the other V=1 output.
Moreover, build systems such as Yocto by default pass V=1, so in that
case the information gets hidden away in the do_compile log file, making
it nigh impossible to create a recipe for creating signed U-boot images
- I don't want to disable V=1, because having verbose output in the log
file is valuable when things go wrong, but OTOH trying to go digging in
the do_compile log file (and getting exactly the right lines) is not
pleasant to even think about.
So change the logic so that for V=0, the mkimage output is redirected
to MKIMAGEOUTPUT (which is also the current behaviour), while for any
other value of V, we _additionally_ write the information to make's
stdout, whatever that might be.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Tested-by: Breno Lima <breno.lima@nxp.com>
2018-03-23 11:08:02 +00:00
|
|
|
>$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
|
2018-02-14 05:44:36 +00:00
|
|
|
|
|
|
|
# fdtgrep
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# Pass the original device tree file through fdtgrep twice. The first pass
|
|
|
|
# removes any unwanted nodes (i.e. those which don't have the
|
|
|
|
# 'u-boot,dm-pre-reloc' property and thus are not needed by SPL. The second
|
|
|
|
# pass removes various unused properties from the remaining nodes.
|
|
|
|
# The output is typically a much smaller device tree file.
|
2022-04-30 06:56:52 +00:00
|
|
|
ifeq ($(CONFIG_VPL_BUILD),y)
|
|
|
|
fdtgrep_props := -b u-boot,dm-pre-reloc -b u-boot,dm-vpl
|
|
|
|
else
|
2018-02-14 05:44:36 +00:00
|
|
|
ifeq ($(CONFIG_TPL_BUILD),y)
|
|
|
|
fdtgrep_props := -b u-boot,dm-pre-reloc -b u-boot,dm-tpl
|
|
|
|
else
|
|
|
|
fdtgrep_props := -b u-boot,dm-pre-reloc -b u-boot,dm-spl
|
|
|
|
endif
|
2022-04-30 06:56:52 +00:00
|
|
|
endif
|
2018-02-14 05:44:36 +00:00
|
|
|
quiet_cmd_fdtgrep = FDTGREP $@
|
|
|
|
cmd_fdtgrep = $(objtree)/tools/fdtgrep $(fdtgrep_props) -RT $< \
|
|
|
|
-n /chosen -n /config -O dtb | \
|
|
|
|
$(objtree)/tools/fdtgrep -r -O dtb - -o $@ \
|
2019-02-11 11:49:57 +00:00
|
|
|
-P u-boot,dm-pre-reloc -P u-boot,dm-spl -P u-boot,dm-tpl \
|
2022-04-30 06:56:52 +00:00
|
|
|
-P u-boot,dm-vpl \
|
2018-02-14 05:44:36 +00:00
|
|
|
$(addprefix -P ,$(subst $\",,$(CONFIG_OF_SPL_REMOVE_PROPS)))
|
2020-01-12 14:57:42 +00:00
|
|
|
|
|
|
|
# fdt_rm_props
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# Pass the original device tree file through fdtgrep. This removes various
|
|
|
|
# unused properties. The output is typically a smaller device tree file.
|
|
|
|
quiet_cmd_fdt_rm_props = FDTGREP $@
|
|
|
|
cmd_fdt_rm_props = cat $< | $(objtree)/tools/fdtgrep -r -O dtb - -o $@ \
|
|
|
|
$(addprefix -P ,$(subst $\",,$(CONFIG_OF_REMOVE_PROPS)))
|
2020-04-17 07:21:36 +00:00
|
|
|
|
|
|
|
# ASM offsets
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# Default sed regexp - multiline due to syntax constraints
|
|
|
|
define sed-offsets
|
|
|
|
"s:[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\":\1:; \
|
|
|
|
/^->/{s:->#\(.*\):/* \1 */:; \
|
|
|
|
s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
|
|
|
|
s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
|
|
|
|
s:->::; p;}"
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Use filechk to avoid rebuilds when a header changes, but the resulting file
|
|
|
|
# does not
|
|
|
|
define filechk_offsets
|
|
|
|
(set -e; \
|
|
|
|
echo "#ifndef $2"; \
|
|
|
|
echo "#define $2"; \
|
|
|
|
echo "/*"; \
|
|
|
|
echo " * DO NOT MODIFY."; \
|
|
|
|
echo " *"; \
|
|
|
|
echo " * This file was generated by Kbuild"; \
|
|
|
|
echo " */"; \
|
|
|
|
echo ""; \
|
|
|
|
sed -ne $(sed-offsets); \
|
|
|
|
echo ""; \
|
|
|
|
echo "#endif" )
|
|
|
|
endef
|