Whamcloud - gitweb
LU-16518 build: llvm/clang support
authorTimothy Day <timday@amazon.com>
Thu, 15 Feb 2024 00:43:19 +0000 (16:43 -0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sun, 3 Mar 2024 10:17:37 +0000 (10:17 +0000)
commit06e21a6984862d8174b8eaac44c189af430bb843
tree0f18781e976d1a204764923b4d3a348981ef8035
parent66bfe243c8b28e21c7d7475c91e2c93dc11d1d39
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

Lustre-change: https://review.whamcloud.com/50063
Lustre-commit: 7f1aa5b66b247f339a9e7c25415a9a5dd272763c

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ia8654c22fa8fca7bfb96c545ac144a1d3737fa00
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54054
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
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