Skip to content

Commit 46fe12f

Browse files
authored
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.
1 parent e2666e5 commit 46fe12f

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ BASH=
3737

3838
endif
3939

40-
CLANG_VERSION=$(shell $(BASH) ./llvm_version.sh $(LLVM_PROJ_DIR))
40+
# Only the major version is needed for Clang, see https://reviews.llvm.org/D125860.
41+
CLANG_VERSION=$(shell $(BASH) ./llvm_version_major.sh $(LLVM_PROJ_DIR))
4142
VERSION:=$(shell $(BASH) ./version.sh)
4243
DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION)
4344

@@ -67,8 +68,8 @@ build/llvm.BUILT:
6768
-DLLVM_TARGETS_TO_BUILD=WebAssembly \
6869
-DLLVM_DEFAULT_TARGET_TRIPLE=wasm32-wasi \
6970
-DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" \
70-
$(if $(patsubst 9.%,,$(CLANG_VERSION)), \
71-
$(if $(patsubst 10.%,,$(CLANG_VERSION)), \
71+
$(if $(patsubst 9,,$(CLANG_VERSION)), \
72+
$(if $(patsubst 10,,$(CLANG_VERSION)), \
7273
-DDEFAULT_SYSROOT=../share/wasi-sysroot, \
7374
-DDEFAULT_SYSROOT=$(PREFIX)/share/wasi-sysroot), \
7475
-DDEFAULT_SYSROOT=$(PREFIX)/share/wasi-sysroot) \

llvm_version.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

llvm_version_major.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#/bin/bash
2+
LLVM_PROJ_DIR=${1:-./src/llvm-project}
3+
MAJOR=`grep "set(LLVM_VERSION_MAJOR" $LLVM_PROJ_DIR/llvm/CMakeLists.txt | awk '{print substr($2, 1, length($2) - 1)}'`
4+
echo $MAJOR

src/llvm-project

0 commit comments

Comments
 (0)