android_kernel_motorola_sm6375/scripts
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Masahiro Yamada aff7958cac
kbuild: add infrastructure to build userspace programs
Kbuild supports the infrastructure to build host programs, but there
was no support to build userspace programs for the target architecture
(i.e. the same architecture as the kernel).

Sam Ravnborg worked on this in 2014 (https://lkml.org/lkml/2014/7/13/154),
but it was not merged. One problem at that time was, there was no good way
to know whether $(CC) can link standalone programs. In fact, pre-built
kernel.org toolchains [1] are often used for building the kernel, but they
do not provide libc.

Now, we can handle this cleanly because the compiler capability is
evaluated at the Kconfig time. If $(CC) cannot link standalone programs,
the relevant options are hidden by 'depends on CC_CAN_LINK'.

The implementation just mimics scripts/Makefile.host

The userspace programs are compiled with the same flags as the host
programs. In addition, it uses -m32 or -m64 if it is found in
$(KBUILD_CFLAGS).

This new syntax has two usecases.

- Sample programs

  Several userspace programs under samples/ include UAPI headers
  installed in usr/include. Most of them were previously built for
  the host architecture just to use the 'hostprogs' syntax.

  However, 'make headers' always works for the target architecture.
  This caused the arch mismatch in cross-compiling. To fix this
  distortion, sample code should be built for the target architecture.

- Bpfilter

  net/bpfilter/Makefile compiles bpfilter_umh as the user mode helper,
  and embeds it into the kernel. Currently, it overrides HOSTCC with
  CC to use the 'hostprogs' syntax. This hack should go away.

[1]: https://mirrors.edge.kernel.org/pub/tools/crosstool/
Change-Id: I2776c85673b212541b359fa1cfa168785018299c
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
2025-09-28 10:00:32 +02:00
..
atomic
basic
coccinelle
dtc Merge android11-5.4.180+ (598165f) into msm-5.4 2022-04-21 10:51:21 +05:30
gcc-plugins kbuild: add -Wall to KBUILD_HOSTCXXFLAGS 2025-09-28 10:00:32 +02:00
gdb Revert "PM: domains: Fix up terminology with parent/child" 2023-06-16 09:26:26 +00:00
genksyms genksyms: fix memory leak when the same symbol is read from *.symref file 2025-03-13 12:43:00 +01:00
gki
kconfig Merge tag 'ASB-2025-08-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-09-01 13:17:46 +03:00
ksymoops
mod Merge tag 'LA.UM.9.14.r1-25800-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4 into android13-5.4-lahaina 2025-02-14 02:42:56 +02:00
package
selinux selinux: Chain up tool resolving errors in install_policy.sh 2025-04-10 14:29:39 +02:00
tracing ftrace/scripts: Update the instructions for ftrace-bisect.sh 2023-02-06 07:52:44 +01:00
.gitignore
adjust_autoksyms.sh
asn1_compiler.c ASN.1: Fix check for strdup() success 2023-04-26 11:24:06 +02:00
bin2c.c
bloat-o-meter
bootgraph.pl
bpf_helpers_doc.py scripts/bpf: Fix xdp_md forward declaration typo 2024-03-01 13:13:38 +01:00
build-all.py
cc-can-link.sh
check-config-debug-exemptions
check-config-perf-exemptions
check-config.py
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl Merge android11-5.4.259+ (70db018) into msm-5.4 2024-01-31 01:01:26 -08:00
checkstack.pl
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck
config kbuild: fix argument parsing in scripts/config 2025-06-04 14:32:31 +02:00
conmakehash.c
const_structs.checkpatch
decode_stacktrace.sh
decodecode
depmod.sh
diffconfig
documentation-file-ref-check
export_report.pl
extract-cert.c Merge tag 'ASB-2023-02-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2023-02-08 18:28:38 +02:00
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line scripts/faddr2line: Fix regression in name resolution on ppc64le 2022-12-08 11:23:02 +01:00
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-plugin.sh
gcc-version.sh
gcc-x86_32-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-08-19 05:33:53 +02:00
gcc-x86_64-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-08-19 05:33:53 +02:00
gen_autoksyms.sh
gen_compile_commands.py
gen_ksymdeps.sh
generate_initcall_order.pl
get_abi.pl
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh
insert-sys-cert.c
kallsyms.c
Kbuild.include Merge tag 'ASB-2025-09-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-09-12 18:48:05 +03:00
Kconfig.include UPSTREAM: kbuild: Add support for 'as-instr' to be used in Kconfig files 2022-11-14 03:04:02 +02:00
kernel-doc
ld-version.sh
leaking_addresses.pl leaking_addresses: Always print a trailing newline 2021-11-17 09:48:31 +01:00
Lindent
link-vmlinux.sh Merge android11-5.4.274 (564901b) into msm-5.4 2024-07-24 20:38:43 -07:00
Makefile
Makefile.asm-generic
Makefile.build kbuild: add infrastructure to build userspace programs 2025-09-28 10:00:32 +02:00
Makefile.clean kbuild: add infrastructure to build userspace programs 2025-09-28 10:00:32 +02:00
Makefile.dtbinst
Makefile.dtbo
Makefile.extrawarn kbuild: Move -Wenum-enum-conversion to W=2 2025-03-13 12:43:09 +01:00
Makefile.gcc-plugins gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file 2022-08-25 11:18:31 +02:00
Makefile.headersinst
Makefile.host kbuild: use -MMD instead of -MD to exclude system headers from dependency 2025-07-17 18:24:51 +02:00
Makefile.kasan
Makefile.kcov
Makefile.lib Merge tag 'ASB-2025-09-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-09-12 18:48:05 +03:00
Makefile.modbuiltin
Makefile.modfinal
Makefile.modinst
Makefile.modpost This is the 5.4.212 stable release 2022-09-21 12:34:35 +02:00
Makefile.modsign
Makefile.package
Makefile.ubsan
Makefile.userprogs kbuild: add infrastructure to build userspace programs 2025-09-28 10:00:32 +02:00
makelst
markup_oops.pl
mkcompile_h Merge 5.4.287 into android11-5.4-lts 2024-12-16 10:50:16 +00:00
mkmakefile
mksysmap mksysmap: Fix the mismatch of 'L0' symbols in System.map 2022-09-28 11:03:59 +02:00
mkuboot.sh
module-common.lds
module-lto.lds
modules-check.sh
namespace.pl
nsdeps
objdiff
parse-maintainers.pl
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c This is the 5.4.244 stable release 2023-06-20 11:07:18 +00:00
recordmcount.h
recordmcount.pl recordmcount.pl: fix typo in s390 mcount regex 2022-01-05 12:37:44 +01:00
setlocalversion ANDROID: setlocalversion: make KMI_GENERATION optional 2021-11-17 22:45:14 +00:00
show_delta
sign-file.c sign-file: Fix incorrect return values check 2023-12-20 15:41:17 +01:00
sortextable.c
sortextable.h
spdxcheck-test.sh
spdxcheck.py
spelling.txt
sphinx-pre-install
split-man.pl
stackdelta
stackusage
subarch.include
tags.sh scripts/tags.sh: Resolve gtags empty index generation 2023-07-27 08:37:03 +02:00
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh