diff --git a/Makefile b/Makefile index 761ccbb8e..63f4ca7b6 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,7 @@ BASH= endif CLANG_VERSION=$(shell $(BASH) ./llvm_version.sh $(LLVM_PROJ_DIR)) +CLANG_MAJOR_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) @@ -134,7 +135,7 @@ build/compiler-rt.BUILT: build/llvm.BUILT build/wasi-libc.BUILT -DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP)" \ -DLLVM_CONFIG_PATH=$(ROOT_DIR)/build/llvm/bin/llvm-config \ -DCOMPILER_RT_OS_DIR=wasi \ - -DCMAKE_INSTALL_PREFIX=$(PREFIX)/lib/clang/$(CLANG_VERSION)/ \ + -DCMAKE_INSTALL_PREFIX=$(PREFIX)/lib/clang/$(CLANG_MAJOR_VERSION)/ \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ $(LLVM_PROJ_DIR)/compiler-rt/lib/builtins DESTDIR=$(DESTDIR) ninja $(NINJA_FLAGS) -C build/compiler-rt install diff --git a/llvm_version_major.sh b/llvm_version_major.sh new file mode 100755 index 000000000..2e5d973ca --- /dev/null +++ b/llvm_version_major.sh @@ -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 diff --git a/src/llvm-project b/src/llvm-project index 8dfdcc7b7..434575c02 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a +Subproject commit 434575c026c81319b393f64047025b54e69e24c2 diff --git a/src/wasi-libc b/src/wasi-libc index b4814997f..8daaba387 160000 --- a/src/wasi-libc +++ b/src/wasi-libc @@ -1 +1 @@ -Subproject commit b4814997f61ee352d8c1ae397561a813fb30c701 +Subproject commit 8daaba387ce70a6088afe3916e9e16ed1c2bc630 diff --git a/version.sh b/version.sh index 35c8a908e..8e265ab7a 100755 --- a/version.sh +++ b/version.sh @@ -2,5 +2,5 @@ set -e git config --global --add safe.directory "/workspace" GIT_DESCR=$(git describe --long --candidates=999 --match='wasi-sdk-*' --dirty='+m' --abbrev=12) -GIT_PACKAGE_VERSION=$(echo $GIT_DESCR | perl -ne 'if(/^wasi-sdk-(\d+)-(\d+)-g([0-9a-f]{7,12})([+]m)?$/) { if($2 == 0) { print "$1.$2$4" } else { print "$1.$2g$3$4" } exit } else { print "could not parse git description"; exit 1 }';) +GIT_PACKAGE_VERSION=$(echo $GIT_DESCR | perl -ne 'if(/^wasi-sdk-(\d+)([+].+)?-(\d+)-g([0-9a-f]{7,12})([+]m)?$/) { if($3 == 0) { print "$1.$3$5$2" } else { print "$1.$3g$4$5$2" } exit } else { print "could not parse git description"; exit 1 }';) echo $GIT_PACKAGE_VERSION