llvm: update to LLVM 16.0.0 (#314)

* llvm-project: update to 16.0.0 release

This changes updates the `src/llvm-project` submodule to the `HEAD` of
`release/16.x`, the same commit used to [release] the LLVM 16.0.0
binaries.

[release]: https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.0

* fix: use only Clang's major version in install prefix

Due to [a change] in LLVM, Clang will expect to find the
`libclang_rt.builtins-wasm32.a` file in a path that only contains the
major version (`16`) instead of the entire version (`16.0.0`) as was
previously the case. This change modifies the `CMAKE_INSTALL_PREFIX` to
use Clang's major version only.

[a change]: https://reviews.llvm.org/D125860

* review: only use `llvm_version_major.sh`

Since the `Makefile` can get by with only knowing Clang's major version,
this change removes `llvm_version.sh` and sets `CLANG_VERSION` to use
only the major part.
pull/316/head
Andrew Brown 2 years ago committed by GitHub
parent e2666e548b
commit 46fe12f3a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,7 +37,8 @@ BASH=
endif
CLANG_VERSION=$(shell $(BASH) ./llvm_version.sh $(LLVM_PROJ_DIR))
# Only the major version is needed for Clang, see https://reviews.llvm.org/D125860.
CLANG_VERSION=$(shell $(BASH) ./llvm_version_major.sh $(LLVM_PROJ_DIR))
VERSION:=$(shell $(BASH) ./version.sh)
DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION)
@ -67,8 +68,8 @@ build/llvm.BUILT:
-DLLVM_TARGETS_TO_BUILD=WebAssembly \
-DLLVM_DEFAULT_TARGET_TRIPLE=wasm32-wasi \
-DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" \
$(if $(patsubst 9.%,,$(CLANG_VERSION)), \
$(if $(patsubst 10.%,,$(CLANG_VERSION)), \
$(if $(patsubst 9,,$(CLANG_VERSION)), \
$(if $(patsubst 10,,$(CLANG_VERSION)), \
-DDEFAULT_SYSROOT=../share/wasi-sysroot, \
-DDEFAULT_SYSROOT=$(PREFIX)/share/wasi-sysroot), \
-DDEFAULT_SYSROOT=$(PREFIX)/share/wasi-sysroot) \

@ -1,6 +0,0 @@
#/bin/bash
LLVM_PROJ_DIR=${1:-./src/llvm-project}
MAJOR=`grep "set(LLVM_VERSION_MAJOR" $LLVM_PROJ_DIR/llvm/CMakeLists.txt | awk '{print substr($2, 1, length($2) - 1)}'`
MINOR=`grep "set(LLVM_VERSION_MINOR" $LLVM_PROJ_DIR/llvm/CMakeLists.txt | awk '{print substr($2, 1, length($2) - 1)}'`
PATCH=`grep "set(LLVM_VERSION_PATCH" $LLVM_PROJ_DIR/llvm/CMakeLists.txt | awk '{print substr($2, 1, length($2) - 1)}'`
echo $MAJOR.$MINOR.$PATCH

@ -0,0 +1,4 @@
#/bin/bash
LLVM_PROJ_DIR=${1:-./src/llvm-project}
MAJOR=`grep "set(LLVM_VERSION_MAJOR" $LLVM_PROJ_DIR/llvm/CMakeLists.txt | awk '{print substr($2, 1, length($2) - 1)}'`
echo $MAJOR

@ -1 +1 @@
Subproject commit 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a
Subproject commit 08d094a0e457360ad8b94b017d2dc277e697ca76
Loading…
Cancel
Save