Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade LLVM to 14.0 #3641

Merged
merged 5 commits into from
Mar 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ jobs:
- build: linux-x64
os: ubuntu-20.04
artifact_name: 'wasmer-linux-amd64'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-linux-amd64.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_linux'
use_sccache: true
use_llvm: true
build_wasm: true
- build: macos-x64
os: macos-11
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-darwin-amd64.tar.xz'
artifact_name: 'wasmer-darwin-amd64'
cross_compilation_artifact_name: 'cross_compiled_from_mac'
use_sccache: true
Expand All @@ -67,15 +67,15 @@ jobs:
- build: windows-x64
os: windows-2019
artifact_name: 'wasmer-windows-amd64'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-windows-amd64.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_win'
use_sccache: true
use_llvm: true
build_wasm: false
- build: linux-musl-x64
os: ubuntu-latest
artifact_name: 'wasmer-linux-musl-amd64'
#llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz'
#llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-linux-amd64.tar.xz'
container: alpine:latest
use_sccache: false
use_llvm: false
Expand Down Expand Up @@ -115,7 +115,8 @@ jobs:
mkdir -p ${LLVM_DIR}
curl --proto '=https' --tlsv1.2 -sSf "${{ matrix.llvm_url }}" -L -o - | tar xJv -C ${LLVM_DIR}
echo "${LLVM_DIR}/bin" >> $GITHUB_PATH
echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV
echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH
echo "LLVM_SYS_140_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV
env:
LLVM_DIR: .llvm
- name: Set up dependencies for Mac OS
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
sudo apt install -y libtinfo5
- name: Install LLVM (Linux)
run: |
curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -L -o /opt/llvm.tar.xz
curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o /opt/llvm.tar.xz
mkdir -p /opt/llvm-12
tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-12
echo '/opt/llvm-12/bin' >> $GITHUB_PATH
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
build: linux-x64,
os: ubuntu-22.04,
target: x86_64-unknown-linux-gnu,
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz'
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz'
},
{
build: linux-musl,
Expand All @@ -215,7 +215,7 @@ jobs:
build: macos-x64,
os: macos-11,
target: x86_64-apple-darwin,
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz'
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-x86_64-apple-darwin.tar.xz'
},
{
build: macos-arm,
Expand All @@ -226,7 +226,7 @@ jobs:
build: windows-x64,
os: windows-2019,
target: x86_64-pc-windows-msvc,
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-windows-amd64.tar.xz'
},
{
build: windows-gnu,
Expand Down Expand Up @@ -313,7 +313,8 @@ jobs:
tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR}
echo "ENABLE_LLVM=1" >> $GITHUB_ENV
echo "${LLVM_DIR}/bin" >> $GITHUB_PATH
echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV
echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH
echo "LLVM_SYS_140_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV
env:
LLVM_DIR: .llvm
- name: Setup Rust target
Expand Down Expand Up @@ -436,19 +437,19 @@ jobs:
build: linux-x64,
os: ubuntu-22.04,
target: x86_64-unknown-linux-gnu,
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz'
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz'
},
{
build: macos-x64,
os: macos-11,
target: x86_64-apple-darwin,
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz'
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-x86_64-apple-darwin.tar.xz'
},
{
build: windows-x64,
os: windows-2019,
target: x86_64-pc-windows-msvc,
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-windows-amd64.tar.xz'
},
{
build: linux-musl,
Expand Down Expand Up @@ -542,11 +543,11 @@ jobs:
- build: linux-x64
os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz'
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz'
- build: macos-x64
os: macos-11
target: x86_64-apple-darwin
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz'
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-x86_64-apple-darwin.tar.xz'
# we only build the integration-test CLI, we don't run tests
- build: macos-arm
os: macos-11
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ A comprehensive CI test suite will be run by a Wasmer team member after the PR h

`Didn't find usable system-wide LLVM`

Building Wasmer with the LLVM backend requires LLVM to be installed
Building Wasmer with the LLVM backend requires LLVM 14 or better to be installed
On debian family you need `sudo apt install llvm14 libclang-common-14-dev libpolly-14-dev`
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,21 @@ else ifeq ($(ENABLE_LLVM), 1)
LLVM_VERSION := $(shell llvm-config --version)
compilers += llvm
# … or try to autodetect LLVM from `llvm-config-<version>`.
else ifneq (, $(shell which llvm-config-13 2>/dev/null))
LLVM_VERSION := $(shell llvm-config-13 --version)
else ifneq (, $(shell which llvm-config-14 2>/dev/null))
LLVM_VERSION := $(shell llvm-config-14 --version)
compilers += llvm
# need force LLVM_SYS_120_PREFIX, or llvm_sys will not build in the case
export LLVM_SYS_120_PREFIX = $(shell llvm-config-13 --prefix)
else ifneq (, $(shell which llvm-config-12 2>/dev/null))
LLVM_VERSION := $(shell llvm-config-12 --version)
# need force LLVM_SYS_140_PREFIX, or llvm_sys will not build in the case
export LLVM_SYS_140_PREFIX = $(shell llvm-config-14 --prefix)
else ifneq (, $(shell which llvm-config-15 2>/dev/null))
LLVM_VERSION := $(shell llvm-config-15 --version)
compilers += llvm
# … otherwise, we try to autodetect LLVM from `llvm-config`
# need force LLVM_SYS_140_PREFIX, or llvm_sys will not build in the case
export LLVM_SYS_140_PREFIX = $(shell llvm-config-15 --prefix)
else ifneq (, $(shell which llvm-config 2>/dev/null))
LLVM_VERSION := $(shell llvm-config --version)
ifneq (, $(findstring 13,$(LLVM_VERSION)))
ifneq (, $(findstring 15,$(LLVM_VERSION)))
compilers += llvm
else ifneq (, $(findstring 12,$(LLVM_VERSION)))
else ifneq (, $(findstring 14,$(LLVM_VERSION)))
compilers += llvm
endif
endif
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler-llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rayon = "1.5"
package = "inkwell"
version = "0.1.1"
default-features = false
features = ["llvm12-0", "target-x86", "target-aarch64"]
features = ["llvm14-0", "target-x86", "target-aarch64"]

[build-dependencies]
cc = "1.0"
Expand Down