]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: Add environment variables for userprogs flags
authorElliot Berman <quic_eberman@quicinc.com>
Tue, 1 Feb 2022 21:35:42 +0000 (13:35 -0800)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 14 Feb 2022 01:37:32 +0000 (10:37 +0900)
commit19e33559a931397cd86264d7e2d7955baac58077
tree96a786f023dd51a8037a55bfc846dacd6c24cb06
parentb17aa868c308d81d3188b095a9ff1d2f95f77544
kbuild: Add environment variables for userprogs flags

Allow additional arguments be passed to userprogs compilation.
Reproducible clang builds need to provide a sysroot and gcc path to
ensure the same toolchain is used across hosts. KCFLAGS is not currently
used for any user programs compilation, so add new USERCFLAGS and
USERLDFLAGS which serves similar purpose as HOSTCFLAGS/HOSTLDFLAGS.

Clang might detect GCC installation on hosts which have it installed
to a default location in /. With addition of these environment
variables, you can specify flags such as:

$ make USERCFLAGS=--sysroot=/path/to/sysroot

This can also be used to specify different sysroots such as musl or
bionic which may be installed on the host in paths that the compiler
may not search by default.

Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Fangrui Song <maskray@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Documentation/kbuild/kbuild.rst
Documentation/kbuild/makefiles.rst
Makefile
init/Kconfig
usr/include/Makefile