Whamcloud - gitweb
LU-16518 build: llvm/clang support 63/50063/16
authorTimothy Day <timday@amazon.com>
Sat, 18 Feb 2023 03:49:34 +0000 (03:49 +0000)
committerOleg Drokin <green@whamcloud.com>
Sat, 8 Jul 2023 22:34:11 +0000 (22:34 +0000)
commit7f1aa5b66b247f339a9e7c25415a9a5dd272763c
tree4968a81fbfe6c13f010464497bd3d614c9947613
parente3e91ea95fd96a5eafc598e3812390b4cbac05c3
LU-16518 build: llvm/clang support

Other projects, notably Linux, have build support for LLVM and
Clang via special environment variables. This is implemented
for Lustre, in the style of:

https://www.kernel.org/doc/html/latest/kbuild/llvm.html

Instances in which GCC is explicitly called are replaced by the
use of $CC. The proper environment variables as passed to make
invocations as needed.

All checks which influence global compiler and toolchain settings
are collected in 'config/lustre-toolchain.m4'.

A configure option is added to disable the strict error flags that
are passes to the C compiler by default. CFLAGS and EXTRA_CFLAGS
are made to work in the typical way. Having fine grained control
over compiler options makes experimenting with Clang smoother.

Some compile checks in 'lustre-core.m4' have been improved by using
unused variables and explicitly setting the compile flag to be used
during the test.

This also sets the execute bit on autogen.sh.

Tested with:
Linux (mainline) - 5.15.94
openZFS - 2.1.99
Lustre (latest master) - 2.15.55
CentOS - 8.5
Clang (default on CentOS) - 12.0.1

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ia8654c22fa8fca7bfb96c545ac144a1d3737fa00
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50063
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
autogen.sh [changed mode: 0644->0755]
config/lustre-build-linux.m4
config/lustre-build.m4
config/lustre-toolchain.m4 [new file with mode: 0644]
configure.ac
lustre/autoconf/lustre-core.m4
lustre/tests/Makefile.am