linux/Documentation
Masahiro Yamada 62353048e2 kbuild: support LLVM=1 to switch the default tools to Clang/LLVM
commit a0d1c951ef 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>
2020-08-26 10:40:47 +02:00
..
ABI iio: improve IIO_CONCENTRATION channel type description 2020-08-19 08:16:07 +02:00
EDID
PCI
RCU
accounting
admin-guide x86/speculation: Add Ivy Bridge to affected list 2020-06-10 20:24:58 +02:00
arm
arm64 arm64: errata: Hide CTR_EL0.DIC on systems affected by Neoverse-N1 #1542419 2020-04-29 16:32:56 +02:00
block
bpf
cdrom
core-api
cpu-freq
crypto
dev-tools
devicetree dt-bindings: iio: io-channel-mux: Fix compatible string in example code 2020-08-21 13:05:23 +02:00
doc-guide
driver-api
fault-injection
fb fbdev: fix numbering of fbcon options 2020-02-24 08:36:42 +01:00
features
filesystems cifs_atomic_open(): fix double-put on late allocation failure 2020-03-18 07:17:51 +01:00
firmware-guide
firmware_class
fpga
gpu
hid
hwmon
i2c
ia64
ide
iio
infiniband
input
ioctl
isdn
kbuild kbuild: support LLVM=1 to switch the default tools to Clang/LLVM 2020-08-26 10:40:47 +02:00
kernel-hacking
leds
livepatch
locking
m68k
maintainer
media
mic
mips
misc-devices
netlabel
networking netfilter: nf_flowtable: fix documentation 2020-03-05 16:43:51 +01:00
nios2
openrisc
parisc
pcmcia
power
powerpc
process
riscv
s390
scheduler
scsi scsi: smartpqi: Update attribute name to `driver_version` 2020-01-17 19:48:27 +01:00
security
sh
sound ALSA: hda/realtek - Remove now-unnecessary XPS 13 headphone noise fixups 2020-04-17 10:50:08 +02:00
sparc
sphinx
sphinx-static
spi
target
timers
trace
translations
usb
userspace-api
virt x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit 2020-06-22 09:30:57 +02:00
virtual
vm
w1
watchdog
x86
xtensa
.gitignore
COPYING-logo
Changes
CodingStyle
DMA-API-HOWTO.txt
DMA-API.txt
DMA-ISA-LPC.txt
DMA-attributes.txt
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
Kconfig
Makefile
SubmittingPatches
atomic_bitops.txt
atomic_t.txt
bus-virt-phys-mapping.txt
conf.py
crc32.txt
debugging-modules.txt
debugging-via-ohci1394.txt
digsig.txt
docutils.conf
dontdiff
futex-requeue-pi.txt
hwspinlock.txt
index.rst
io-mapping.txt
io_ordering.txt
irqflags-tracing.txt
kobject.txt
kprobes.txt
kref.txt
logo.gif
lzo.txt lib/lzo: fix ambiguous encoding bug in lzo-rle 2020-06-17 16:40:28 +02:00
mailbox.txt
memory-barriers.txt
nommu-mmap.txt
padata.txt
percpu-rw-semaphore.txt
pi-futex.txt
preempt-locking.txt
rbtree.txt
remoteproc.txt
robust-futex-ABI.txt
robust-futexes.txt
rpmsg.txt
speculation.txt
static-keys.txt
tee.txt
this_cpu_ops.txt
unaligned-memory-access.txt
xz.txt