Age | Commit message (Collapse) | Author |
|
Pass certain environment variables, meant to convey information about
the toolchain to use, as make variables when creating a kernel config
file. The kernel build system checks for toolchain capabilities when
generating the merged config file and a valid toolchain is required to
enable some options.
OpenEmbedded has attempted, for a couple years now, to specify the
compiler by setting the CC environment variable:
https://git.openembedded.org/openembedded-core/commit/?id=ff1bdd75d50f0ebac3d599e461685ace29559a82
This was unsuccessful due to the kernel's top-level Makefile explicitly
assigning variables, such as CC, and ignoring what's present in the
environment. It is possible to override this behavior by invoking make
with the '-e' option but the make manual discourages this:
Every environment variable that make sees when it starts up is
transformed into a make variable with the same name and value.
However, an explicit assignment in the makefile, or with a command
argument, overrides the environment. (If the ā-eā flag is specified,
then values from the environment override assignments in the makefile.
See Summary of Options. But this is not recommended practice.)
A simple test case is to create a defconfig while specifying clang as
the compiler to use:
$ make CC=clang-10 defconfig
...
Create a config fragment that attempts to enable
CONFIG_INIT_STACK_ALL_PATTERN which is currently only possible to enable
when building with clang:
$ echo "CONFIG_INIT_STACK_ALL_PATTERN=y" > init-stack-all.cfg
Specify clang in the environment when running merge_config.sh and see
that the option couldn't be enabled:
$ CC=clang-10 merge_config.sh .config init-stack-all.cfg
...
Value requested for CONFIG_INIT_STACK_ALL_PATTERN not in final .config
Requested value: CONFIG_INIT_STACK_ALL_PATTERN=y
Actual value:
Note that the less secure CONFIG_INIT_STACK_NONE option is enabled,
instead:
$ grep CONFIG_INIT_STACK .config
CONFIG_INIT_STACK_NONE=y
Signed-off-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
|
|
LD often has parametes (like the sysroot), so we need to ensure it
is quoted, otherwise the parameters will be passed to make, triggering
an error.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
|
|
* since 5.4 kernel Kconfig will fail immediately when it detects
that LD points to gold linker:
scripts/Kconfig.include:39: gold linker 'i686-oe-linux-ld' not supported
* in OE we already pass bfd linker in KERNEL_LD variable to merge_config.sh
but we need to pass it also into the make call here
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
|
|
If a fragment file doesn't contain a CR at the end, two config options
may be merged on the same line in the result file, leading to misconfiguration.
This patch adds a CR after each fragment to ensure that config options
are well separated in the result file.
Bug-AGL: SPEC-1475
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
|
|
We no longer need to carry any patches to merge_config, so we
update to the 4.7-rc6 variant.
A copy is still kept out of tree, since some users of the kern tools
do not want a complete clone of the kernel, just to get merge_config.sh
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
|
|
chmod u+x merge_config.sh
Signed-off-by: Michel Thebeau <michel.thebeau@windriver.com>
|
|
In a system where the kernel source and object directories are
split we want the generated .config to be in the build directory
and not the current directory. The easiest way to support this is
to respect the O= environment variable.
Neither KBUILD_OUTPUT or O were propagating automatically to the
kernel build, so always explicitly setting O= and passing it to
the kernel build ensures that it is respected. Without this .config
always ends up in the current working directory.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
|
|
Some environments export variables to subshells and in those
environments setting 'MAKE=true' will interfere with the kernel
build system's use of that same variable. To avoid this, we can
simply rename MAKE to MAKE_FLAG.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
|
|
When debugging options that are output as not being in the final
.config file it is often useful to look at the fully concatenated
configuration file. To support this we add a debug flag that will
not cleanup the .tmp.config* file that is created. The risk of
having uncleaned .tmp.config* file is an acceptable tradeoff for
this debug assist.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
|
|
syncing the kern-tools variant of merge_config.sh to the upstream
kernel version, commit: 409f117e2d.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
|
|
In a system where the kernel source and object directories are
split we want the generated .config to be in the build directory
and not the current directory. The easiest way to support this is
to respect the O= environment variable.
Neither KBUILD_OUTPUT or O were propagating automatically to the
kernel build, so always explicitly setting O= and passing it to
the kernel build ensures that it is respected. Without this .config
always ends up in the current working directory.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
|
|
Some environments export variables to subshells and in those
environments setting 'MAKE=true' will interfere with the kernel
build system's use of that same variable. To avoid this, we can
simply rename MAKE to MAKE_FLAG.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
|
|
When debugging options that are output as not being in the final
.config file it is often useful to look at the fully concatenated
configuration file. To support this we add a debug flag that will
not cleanup the .tmp.config* file that is created. The risk of
having uncleaned .tmp.config* file is an acceptable tradeoff for
this debug assist.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
|
|
Adding merge_config.sh temporarily to the kern_tools archive. This
will migrate to the main linux kernel repository over time, but for
now kern_tools will track changes to the script, and install it for
use in the build.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
|