exynos-linux-stable/tools
Masahiro Yamada e8df4aafe7
BACKPORT: kbuild: support LLVM=1 to switch the default tools to Clang/LLVM
commit a0d1c951ef08ed24f35129267e3595d86f57f5d3 upstream.

As Documentation/kbuild/llvm.rst implies, building the kernel with a
full set of LLVM tools gets very verbose and unwieldy.

Provide a single switch LLVM=1 to use Clang and LLVM tools instead
of GCC and Binutils. You can pass it from the command line or as an
environment variable.

Please note LLVM=1 does not turn on the integrated assembler. You need
to pass LLVM_IAS=1 to use it. When the upstream kernel is ready for the
integrated assembler, I think we can make it default.

We discussed what we need, and we agreed to go with a simple boolean
flag that switches both target and host tools:

  https://lkml.org/lkml/2020/3/28/494
  https://lkml.org/lkml/2020/4/3/43

Some items discussed, but not adopted:

- LLVM_DIR

  When multiple versions of LLVM are installed, I just thought supporting
  LLVM_DIR=/path/to/my/llvm/bin/ might be useful.

  CC      = $(LLVM_DIR)clang
  LD      = $(LLVM_DIR)ld.lld
    ...

  However, we can handle this by modifying PATH. So, we decided to not do
  this.

- LLVM_SUFFIX

  Some distributions (e.g. Debian) package specific versions of LLVM with
  naming conventions that use the version as a suffix.

  CC      = clang$(LLVM_SUFFIX)
  LD      = ld.lld(LLVM_SUFFIX)
    ...

  will allow a user to pass LLVM_SUFFIX=-11 to use clang-11 etc.,
  but the suffixed versions in /usr/bin/ are symlinks to binaries in
  /usr/lib/llvm-#/bin/, so this can also be handled by PATH.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com> # build
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I8e0a6f5a8f240752e6f49b31d92669821a2d6e4a

Conflicts:
	Makefile

Signed-off-by: krazey <admin@krazey.de>
2023-04-30 22:09:47 +03:00
..
accounting This is the 4.9.219 stable release 2020-04-13 13:00:22 +02:00
arch x86/fpu: Finish excising 'eagerfpu' 2018-10-13 09:18:59 +02:00
build tools: build: Use HOSTLDFLAGS with fixdep 2018-08-24 13:12:39 +02:00
cgroup cgroups: fix cgroup_event_listener error handling 2013-01-08 10:00:44 -08:00
firewire tools/firewire: nosy-dump: check for allocation failure 2012-12-02 20:10:18 +01:00
gpio tools: gpio: Correctly add make dependencies for gpio_utils 2019-11-28 18:28:07 +01:00
hv Tools: hv: kvp: eliminate 'may be used uninitialized' warning 2019-09-10 10:31:02 +01:00
iio iio: iio-utils: Fix possible incorrect mask calculation 2019-08-04 09:33:38 +02:00
include This is the 4.9.213 stable release 2020-02-05 14:06:56 +00:00
kvm/kvm_stat tools: kvm_stat: Add comments 2016-05-25 16:12:06 +02:00
laptop tools: move laptops dslm tool from Documentation 2016-09-23 13:07:21 -06:00
lguest tools/lguest: Don't bork the terminal in case of wrong args 2016-09-08 08:05:24 +02:00
lib tools lib api fs: Fix gcc9 stringop-truncation compilation error 2020-02-28 15:42:29 +01:00
net tools: bpf_jit_disasm: check for klogctl failure 2016-05-08 23:32:59 -04:00
nfsd NFSD: Added fault injection script 2011-11-07 21:10:47 -05:00
objtool BACKPORT: kbuild: support LLVM=1 to switch the default tools to Clang/LLVM 2023-04-30 22:09:47 +03:00
pcmcia tools: move pcmcia crc32hash tool from Documentation 2016-09-23 13:07:27 -06:00
perf perf map: Fix off by one in strncpy() size argument 2020-04-02 17:20:41 +02:00
power cpupower: avoid multiple definition with gcc -fno-common 2020-04-02 17:20:31 +02:00
scripts tools: Let O= makes handle a relative path with -C option 2020-04-02 17:20:36 +02:00
spi Merge remote-tracking branches 'spi/topic/ti-qspi', 'spi/topic/tools', 'spi/topic/txx9' and 'spi/topic/xlp' into spi-next 2016-09-30 09:14:22 -07:00
testing rseq/selftests: Turn off timeout setting 2020-01-23 08:19:37 +01:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-05-30 07:50:43 +02:00
time tools: add script to test udelay 2014-07-23 10:16:38 -07:00
usb usbip: Fix unsafe unaligned pointer usage 2020-02-28 15:42:29 +01:00
virtio ptr_ring: fix up after recent ptr_ring changes 2018-11-10 07:42:50 -08:00
vm tools/vm/page-types.c: fix "defined but not used" warning 2018-10-10 08:53:20 +02:00
Makefile tools/gpio: add install section 2016-06-23 11:07:13 +02:00