Explorar el Código

Move to llvm 13.0

Signed-off-by: Sean Young <sean@mess.org>
Sean Young hace 4 años
padre
commit
1695e82971

+ 4 - 4
.github/Dockerfile

@@ -8,7 +8,7 @@ RUN apt-get update -y
 RUN apt-get upgrade -y
 RUN apt-get upgrade -y
 RUN apt-get install -y libz-dev pkg-config libssl-dev git cmake ninja-build gcc g++ python3
 RUN apt-get install -y libz-dev pkg-config libssl-dev git cmake ninja-build gcc g++ python3
 
 
-RUN git clone --single-branch --branch solana-rustc/12.0-2021-04-15 \
+RUN git clone --single-branch --branch solana-rustc/13.0-2021-08-08 \
     https://github.com/solana-labs/llvm-project.git
     https://github.com/solana-labs/llvm-project.git
 
 
 WORKDIR /llvm-project
 WORKDIR /llvm-project
@@ -16,7 +16,7 @@ WORKDIR /llvm-project
 RUN cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off \
 RUN cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off \
     -DLLVM_ENABLE_PROJECTS=clang\;lld \
     -DLLVM_ENABLE_PROJECTS=clang\;lld \
     -DLLVM_TARGETS_TO_BUILD=WebAssembly\;BPF \
     -DLLVM_TARGETS_TO_BUILD=WebAssembly\;BPF \
-    -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/llvm12.0 llvm
+    -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/llvm13.0 llvm
 
 
 RUN cmake --build . --target install
 RUN cmake --build . --target install
 
 
@@ -31,6 +31,6 @@ RUN apt-get autoclean
 # Get Rust
 # Get Rust
 RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.53.0
 RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.53.0
 
 
-COPY --from=builder /llvm12.0 /llvm12.0/
+COPY --from=builder /llvm13.0 /llvm13.0/
 
 
-ENV PATH="/llvm12.0/bin:/root/.cargo/bin:${PATH}"
+ENV PATH="/llvm13.0/bin:/root/.cargo/bin:${PATH}"

+ 24 - 24
.github/workflows/build-llvm.yml

@@ -13,8 +13,8 @@ jobs:
       env:
       env:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       with:
       with:
-        tag_name: llvm12.0-1
-        release_name: LLVM Libraries v12.0 (v1)
+        tag_name: llvm13.0-1
+        release_name: LLVM Libraries v13.0 (v1)
         draft: false
         draft: false
         prerelease: false
         prerelease: false
 
 
@@ -23,17 +23,17 @@ jobs:
     runs-on: ubuntu-20.04
     runs-on: ubuntu-20.04
     needs: create
     needs: create
     steps:
     steps:
-    - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 https://github.com/solana-labs/llvm-project.git
+    - run: git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project.git
     - name: Install Ninja
     - name: Install Ninja
       uses: llvm/actions/install-ninja@main
       uses: llvm/actions/install-ninja@main
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
-        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm12.0 llvm
+        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm13.0 llvm
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
     - run: cmake --build . --target install
     - run: cmake --build . --target install
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
-    - run: tar Jcf ./llvm12.0-linux-x86-64.tar.xz ./llvm12.0/
+    - run: tar Jcf ./llvm13.0-linux-x86-64.tar.xz ./llvm13.0/
     - name: Upload Release Asset
     - name: Upload Release Asset
       id: upload-release-asset
       id: upload-release-asset
       uses: actions/upload-release-asset@v1
       uses: actions/upload-release-asset@v1
@@ -41,8 +41,8 @@ jobs:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       with:
       with:
         upload_url: ${{ needs.create.outputs.upload_url }}
         upload_url: ${{ needs.create.outputs.upload_url }}
-        asset_path: ./llvm12.0-linux-x86-64.tar.xz
-        asset_name: llvm12.0-linux-x86-64.tar.xz
+        asset_path: ./llvm13.0-linux-x86-64.tar.xz
+        asset_name: llvm13.0-linux-x86-64.tar.xz
         asset_content_type: application/x-xz
         asset_content_type: application/x-xz
 
 
   mac-arm:
   mac-arm:
@@ -51,17 +51,17 @@ jobs:
     runs-on: macos-arm
     runs-on: macos-arm
     if: ${{ github.repository_owner == 'hyperledger-labs' }}
     if: ${{ github.repository_owner == 'hyperledger-labs' }}
     steps:
     steps:
-    - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 https://github.com/solana-labs/llvm-project.git
-    - name: Install Ninja
-      uses: llvm/actions/install-ninja@main
+    - run: git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project.git
+#    - name: Install Ninja
+#      uses: llvm/actions/install-ninja@main
     - run: arch -arm64 cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
     - run: arch -arm64 cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
-        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm12.0 llvm
+        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm13.0 llvm
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
     - run: arch -arm64 cmake --build . --target install
     - run: arch -arm64 cmake --build . --target install
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
-    - run: tar Jcf ./llvm12.0-mac-arm.tar.xz ./llvm12.0/
+    - run: tar Jcf ./llvm13.0-mac-arm.tar.xz ./llvm13.0/
     - name: Upload Release Asset
     - name: Upload Release Asset
       id: upload-release-asset
       id: upload-release-asset
       uses: actions/upload-release-asset@v1
       uses: actions/upload-release-asset@v1
@@ -69,8 +69,8 @@ jobs:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       with:
       with:
         upload_url: ${{ needs.create.outputs.upload_url }}
         upload_url: ${{ needs.create.outputs.upload_url }}
-        asset_path: ./llvm12.0-mac-arm.tar.xz
-        asset_name: llvm12.0-mac-arm.tar.xz
+        asset_path: ./llvm13.0-mac-arm.tar.xz
+        asset_name: llvm13.0-mac-arm.tar.xz
         asset_content_type: application/x-xz
         asset_content_type: application/x-xz
 
 
   mac-intel:
   mac-intel:
@@ -78,17 +78,17 @@ jobs:
     needs: create
     needs: create
     runs-on: macos-latest
     runs-on: macos-latest
     steps:
     steps:
-    - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 https://github.com/solana-labs/llvm-project.git
+    - run: git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project.git
     - name: Install Ninja
     - name: Install Ninja
       uses: llvm/actions/install-ninja@main
       uses: llvm/actions/install-ninja@main
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
-        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm12.0 llvm
+        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm13.0 llvm
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
     - run: cmake --build . --target install
     - run: cmake --build . --target install
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
-    - run: tar Jcf ./llvm12.0-mac-intel.tar.xz ./llvm12.0/
+    - run: tar Jcf ./llvm13.0-mac-intel.tar.xz ./llvm13.0/
     - name: Upload Release Asset
     - name: Upload Release Asset
       id: upload-release-asset
       id: upload-release-asset
       uses: actions/upload-release-asset@v1
       uses: actions/upload-release-asset@v1
@@ -96,8 +96,8 @@ jobs:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       with:
       with:
         upload_url: ${{ needs.create.outputs.upload_url }}
         upload_url: ${{ needs.create.outputs.upload_url }}
-        asset_path: ./llvm12.0-mac-intel.tar.xz
-        asset_name: llvm12.0-mac-intel.tar.xz
+        asset_path: ./llvm13.0-mac-intel.tar.xz
+        asset_name: llvm13.0-mac-intel.tar.xz
         asset_content_type: application/x-xz
         asset_content_type: application/x-xz
 
 
   windows:
   windows:
@@ -106,7 +106,7 @@ jobs:
     runs-on: windows-latest
     runs-on: windows-latest
     steps:
     steps:
     - run: Get-Volume
     - run: Get-Volume
-    - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 https://github.com/solana-labs/llvm-project.git
+    - run: git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project.git
       # We may not have enough space to compile llvm, see https://github.com/actions/virtual-environments/issues/326
       # We may not have enough space to compile llvm, see https://github.com/actions/virtual-environments/issues/326
       working-directory: C:\
       working-directory: C:\
     - name: Setup Windows
     - name: Setup Windows
@@ -117,11 +117,11 @@ jobs:
       uses: llvm/actions/install-ninja@main
       uses: llvm/actions/install-ninja@main
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
         '-DLLVM_ENABLE_PROJECTS=clang;lld'
         '-DLLVM_ENABLE_PROJECTS=clang;lld'
-        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=C:/llvm12.0 llvm
+        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=C:/llvm13.0 llvm
       working-directory: C:\llvm-project
       working-directory: C:\llvm-project
     - run: cmake --build . --target install
     - run: cmake --build . --target install
       working-directory: C:\llvm-project
       working-directory: C:\llvm-project
-    - run: Compress-Archive -Path C:\llvm12.0 -DestinationPath C:\llvm12.0-win.zip
+    - run: Compress-Archive -Path C:\llvm13.0 -DestinationPath C:\llvm13.0-win.zip
     - name: Upload Release Asset
     - name: Upload Release Asset
       id: upload-release-asset
       id: upload-release-asset
       uses: actions/upload-release-asset@v1
       uses: actions/upload-release-asset@v1
@@ -129,6 +129,6 @@ jobs:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       with:
       with:
         upload_url: ${{ needs.create.outputs.upload_url }}
         upload_url: ${{ needs.create.outputs.upload_url }}
-        asset_path: C:\llvm12.0-win.zip
-        asset_name: llvm12.0-win.zip
+        asset_path: C:\llvm13.0-win.zip
+        asset_name: llvm13.0-win.zip
         asset_content_type: application/zip
         asset_content_type: application/zip

+ 2 - 2
.github/workflows/ci-image.yml

@@ -6,8 +6,8 @@ jobs:
     steps:
     steps:
     - name: Checkout sources
     - name: Checkout sources
       uses: actions/checkout@v1
       uses: actions/checkout@v1
-    - run: docker build .github/ -t ghcr.io/hyperledger-labs/solang:ci .
+    - run: docker build -t ghcr.io/${GITHUB_REPOSITORY}:ci .github/
     - name: Push to github container registry
     - name: Push to github container registry
       run: |
       run: |
           echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
           echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
-          docker push ghcr.io/hyperledger-labs/solang:ci
+          docker push ghcr.io/${GITHUB_REPOSITORY}:ci

+ 24 - 24
.github/workflows/release.yml

@@ -12,26 +12,26 @@ jobs:
     steps:
     steps:
     - name: Checkout sources
     - name: Checkout sources
       uses: actions/checkout@v2
       uses: actions/checkout@v2
-    - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 https://github.com/solana-labs/llvm-project.git
+    - run: git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project.git
     - name: Install Ninja
     - name: Install Ninja
       uses: llvm/actions/install-ninja@main
       uses: llvm/actions/install-ninja@main
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
-        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm12.0 llvm
+        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm13.0 llvm
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
     - run: cmake --build . --target install
     - run: cmake --build . --target install
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
-    - run: tar Jcf ./llvm12.0-linux-x86-64.tar.xz ./llvm12.0/
+    - run: tar Jcf ./llvm13.0-linux-x86-64.tar.xz ./llvm13.0/
     - name: Upload llvm
     - name: Upload llvm
       uses: svenstaro/upload-release-action@v2
       uses: svenstaro/upload-release-action@v2
       with:
       with:
         repo_token: ${{ secrets.GITHUB_TOKEN }}
         repo_token: ${{ secrets.GITHUB_TOKEN }}
-        file: llvm12.0-linux-x86-64.tar.xz
-        asset_name: llvm12.0-linux-x86-64.tar.xz
+        file: llvm13.0-linux-x86-64.tar.xz
+        asset_name: llvm13.0-linux-x86-64.tar.xz
         tag: ${{ github.ref }}
         tag: ${{ github.ref }}
     - name: Add LLVM to Path
     - name: Add LLVM to Path
-      run: echo "$(pwd)/llvm12.0/bin" >> $GITHUB_PATH
+      run: echo "$(pwd)/llvm13.0/bin" >> $GITHUB_PATH
     - name: Rust stable
     - name: Rust stable
       run: rustup default 1.53.0
       run: rustup default 1.53.0
     - name: Build
     - name: Build
@@ -52,7 +52,7 @@ jobs:
     steps:
     steps:
     - name: Checkout sources
     - name: Checkout sources
       uses: actions/checkout@v2
       uses: actions/checkout@v2
-    - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 https://github.com/solana-labs/llvm-project.git
+    - run: git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project.git
       # We may not have enough space to compile llvm, see https://github.com/actions/virtual-environments/issues/326
       # We may not have enough space to compile llvm, see https://github.com/actions/virtual-environments/issues/326
       working-directory: C:\
       working-directory: C:\
     - name: Setup Windows
     - name: Setup Windows
@@ -63,20 +63,20 @@ jobs:
       uses: llvm/actions/install-ninja@main
       uses: llvm/actions/install-ninja@main
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
         '-DLLVM_ENABLE_PROJECTS=clang;lld'
         '-DLLVM_ENABLE_PROJECTS=clang;lld'
-        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=C:/llvm12.0 llvm
+        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=C:/llvm13.0 llvm
       working-directory: C:\llvm-project
       working-directory: C:\llvm-project
     - run: cmake --build . --target install
     - run: cmake --build . --target install
       working-directory: C:\llvm-project
       working-directory: C:\llvm-project
-    - run: Compress-Archive -Path C:\llvm12.0 -DestinationPath C:\llvm12.0-win.zip
+    - run: Compress-Archive -Path C:\llvm13.0 -DestinationPath C:\llvm13.0-win.zip
     - name: Upload llvm
     - name: Upload llvm
       uses: svenstaro/upload-release-action@v2
       uses: svenstaro/upload-release-action@v2
       with:
       with:
         repo_token: ${{ secrets.GITHUB_TOKEN }}
         repo_token: ${{ secrets.GITHUB_TOKEN }}
-        file: C:\llvm12.0-win.zip
-        asset_name: llvm12.0-win.zip
+        file: C:\llvm13.0-win.zip
+        asset_name: llvm13.0-win.zip
         tag: ${{ github.ref }}
         tag: ${{ github.ref }}
     - name: Add LLVM to Path
     - name: Add LLVM to Path
-      run: echo "c:\llvm12.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
+      run: echo "c:\llvm13.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
     - name: Build
     - name: Build
       run: cargo build --release --verbose
       run: cargo build --release --verbose
     - name: Run tests
     - name: Run tests
@@ -96,26 +96,26 @@ jobs:
     steps:
     steps:
     - name: Checkout sources
     - name: Checkout sources
       uses: actions/checkout@v2
       uses: actions/checkout@v2
-    - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 https://github.com/solana-labs/llvm-project.git
+    - run: git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project.git
     - name: Install Ninja
     - name: Install Ninja
       uses: llvm/actions/install-ninja@main
       uses: llvm/actions/install-ninja@main
     - run: arch -arm64 cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
     - run: arch -arm64 cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
-        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm12.0 llvm
+        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm13.0 llvm
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
     - run: arch -arm64 cmake --build . --target install
     - run: arch -arm64 cmake --build . --target install
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
-    - run: tar Jcf ./llvm12.0-mac-arm.tar.xz ./llvm12.0/
+    - run: tar Jcf ./llvm13.0-mac-arm.tar.xz ./llvm13.0/
     - name: Upload llvm
     - name: Upload llvm
       uses: svenstaro/upload-release-action@v2
       uses: svenstaro/upload-release-action@v2
       with:
       with:
         repo_token: ${{ secrets.GITHUB_TOKEN }}
         repo_token: ${{ secrets.GITHUB_TOKEN }}
-        file: llvm12.0-mac-arm.tar.xz
-        asset_name: llvm12.0-mac-arm.tar.xz
+        file: llvm13.0-mac-arm.tar.xz
+        asset_name: llvm13.0-mac-arm.tar.xz
         tag: ${{ github.ref }}
         tag: ${{ github.ref }}
     - name: Add LLVM to Path
     - name: Add LLVM to Path
-      run: echo "$(pwd)/llvm12.0/bin" >> $GITHUB_PATH
+      run: echo "$(pwd)/llvm13.0/bin" >> $GITHUB_PATH
     - name: Build
     - name: Build
       run: cargo build --release --verbose
       run: cargo build --release --verbose
     - name: Run tests
     - name: Run tests
@@ -134,26 +134,26 @@ jobs:
     steps:
     steps:
     - name: Checkout sources
     - name: Checkout sources
       uses: actions/checkout@v2
       uses: actions/checkout@v2
-    - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 https://github.com/solana-labs/llvm-project.git
+    - run: git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project.git
     - name: Install Ninja
     - name: Install Ninja
       uses: llvm/actions/install-ninja@main
       uses: llvm/actions/install-ninja@main
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
     - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_ENABLE_PROJECTS='clang;lld'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
         -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF'
-        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm12.0 llvm
+        -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm13.0 llvm
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
     - run: cmake --build . --target install
     - run: cmake --build . --target install
       working-directory: ./llvm-project/
       working-directory: ./llvm-project/
-    - run: tar Jcf ./llvm12.0-mac-intel.tar.xz ./llvm12.0/
+    - run: tar Jcf ./llvm13.0-mac-intel.tar.xz ./llvm13.0/
     - name: Upload llvm
     - name: Upload llvm
       uses: svenstaro/upload-release-action@v2
       uses: svenstaro/upload-release-action@v2
       with:
       with:
         repo_token: ${{ secrets.GITHUB_TOKEN }}
         repo_token: ${{ secrets.GITHUB_TOKEN }}
-        file: llvm12.0-mac-intel.tar.xz
-        asset_name: llvm12.0-mac-intel.tar.xz
+        file: llvm13.0-mac-intel.tar.xz
+        asset_name: llvm13.0-mac-intel.tar.xz
         tag: ${{ github.ref }}
         tag: ${{ github.ref }}
     - name: Add LLVM to Path
     - name: Add LLVM to Path
-      run: echo "$(pwd)/llvm12.0/bin" >> $GITHUB_PATH
+      run: echo "$(pwd)/llvm13.0/bin" >> $GITHUB_PATH
     - name: Build
     - name: Build
       run: cargo build --release --verbose
       run: cargo build --release --verbose
     - name: Run tests
     - name: Run tests

+ 8 - 8
.github/workflows/test.yml

@@ -56,11 +56,11 @@ jobs:
         # Make sure "git describe --tags" works for solang --version
         # Make sure "git describe --tags" works for solang --version
         fetch-depth: 0
         fetch-depth: 0
     - name: Download LLVM
     - name: Download LLVM
-      run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger-labs/solang/releases/download/v0.1.9/llvm12.0-win.zip
+      run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger-labs/solang/releases/download/llvm13.0-1/llvm13.0-win.zip
     - name: Extract LLVM
     - name: Extract LLVM
       run: unzip c:\llvm.zip -d c:/
       run: unzip c:\llvm.zip -d c:/
     - name: Add LLVM to Path
     - name: Add LLVM to Path
-      run: echo "c:\llvm12.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
+      run: echo "c:\llvm13.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
     # We run clippy on Linux in the lint job above, but this does not check #[cfg(windows)] items
     # We run clippy on Linux in the lint job above, but this does not check #[cfg(windows)] items
     - name: Run cargo clippy
     - name: Run cargo clippy
       run: cargo clippy --tests --bins -- -D warnings -D clippy::inconsistent-struct-constructor
       run: cargo clippy --tests --bins -- -D warnings -D clippy::inconsistent-struct-constructor
@@ -84,11 +84,11 @@ jobs:
         # Make sure "git describe --tags" works for solang --version
         # Make sure "git describe --tags" works for solang --version
         fetch-depth: 0
         fetch-depth: 0
     - name: Download LLVM
     - name: Download LLVM
-      run: wget -q -O llvm12.0-mac-arm.tar.xz https://github.com/hyperledger-labs/solang/releases/download/v0.1.9/llvm12.0-mac-arm.tar.xz
+      run: wget -q -O llvm13.0-mac-arm.tar.xz https://github.com/hyperledger-labs/solang/releases/download/llvm13.0-1/llvm13.0-mac-arm.tar.xz
     - name: Extract LLVM
     - name: Extract LLVM
-      run: tar Jxf llvm12.0-mac-arm.tar.xz
+      run: tar Jxf llvm13.0-mac-arm.tar.xz
     - name: Add LLVM to Path
     - name: Add LLVM to Path
-      run: echo "$(pwd)/llvm12.0/bin" >> $GITHUB_PATH
+      run: echo "$(pwd)/llvm13.0/bin" >> $GITHUB_PATH
     - name: Build
     - name: Build
       run: cargo build --verbose
       run: cargo build --verbose
     - name: Run tests
     - name: Run tests
@@ -108,11 +108,11 @@ jobs:
         # Make sure "git describe --tags" works for solang --version
         # Make sure "git describe --tags" works for solang --version
         fetch-depth: 0
         fetch-depth: 0
     - name: Download LLVM
     - name: Download LLVM
-      run: wget -q -O llvm12.0-mac-intel.tar.xz https://github.com/hyperledger-labs/solang/releases/download/v0.1.9/llvm12.0-mac-intel.tar.xz
+      run: wget -q -O llvm13.0-mac-intel.tar.xz https://github.com/hyperledger-labs/solang/releases/download/llvm13.0-1/llvm13.0-mac-intel.tar.xz
     - name: Extract LLVM
     - name: Extract LLVM
-      run: tar Jxf llvm12.0-mac-intel.tar.xz
+      run: tar Jxf llvm13.0-mac-intel.tar.xz
     - name: Add LLVM to Path
     - name: Add LLVM to Path
-      run: echo "$(pwd)/llvm12.0/bin" >> $GITHUB_PATH
+      run: echo "$(pwd)/llvm13.0/bin" >> $GITHUB_PATH
     - name: Build
     - name: Build
       run: cargo build --verbose
       run: cargo build --verbose
     - name: Run tests
     - name: Run tests

+ 5 - 0
CHANGELOG.md

@@ -2,6 +2,11 @@
 All notable changes to [Solang](https://github.com/hyperledger-labs/solang/)
 All notable changes to [Solang](https://github.com/hyperledger-labs/solang/)
 will be documented here.
 will be documented here.
 
 
+## [Unreleased]
+
+### Changed
+- Solang now uses LLVM 13.0, based on the [Solana LLVM tree](https://github.com/solana-labs/llvm-project/)
+
 ## [0.1.9]
 ## [0.1.9]
 
 
 ### Added
 ### Added

+ 1 - 1
Cargo.toml

@@ -28,7 +28,7 @@ tiny-keccak = { version = "2.0", features = ["keccak"] }
 serde_json = "1.0"
 serde_json = "1.0"
 serde = "1.0"
 serde = "1.0"
 serde_derive = { version = "1.0" }
 serde_derive = { version = "1.0" }
-inkwell = { version = "^0.1.0-beta.3", features = ["target-webassembly", "target-bpf", "no-libffi-linking", "llvm12-0"] }
+inkwell = { version = "^0.1.0-beta.3", features = ["target-webassembly", "target-bpf", "no-libffi-linking", "llvm13-0"] }
 blake2-rfc = "0.2.18"
 blake2-rfc = "0.2.18"
 phf = { version = "0.10", features = ["macros"] }
 phf = { version = "0.10", features = ["macros"] }
 unicode-xid = "0.2.0"
 unicode-xid = "0.2.0"

+ 5 - 5
docs/installing.rst

@@ -76,7 +76,7 @@ Installing LLVM on Linux
 ________________________
 ________________________
 
 
 A pre-built version of llvm, specifically configured for Solang, is available at
 A pre-built version of llvm, specifically configured for Solang, is available at
-`<https://github.com/hyperledger-labs/solang/releases/download/v0.1.9/llvm12.0-linux-x86-64.tar.xz>`_.
+`<https://github.com/hyperledger-labs/solang/releases/download/llvm13.0-1/llvm13.0-linux-x86-64.tar.xz>`_.
 After downloading, untar the file in a terminal and add it to your path.
 After downloading, untar the file in a terminal and add it to your path.
 
 
 .. code-block:: bash
 .. code-block:: bash
@@ -88,7 +88,7 @@ Installing LLVM on Windows
 __________________________
 __________________________
 
 
 A pre-built version of llvm, specifically configured for Solang, is available at
 A pre-built version of llvm, specifically configured for Solang, is available at
-`<https://github.com/hyperledger-labs/solang/releases/download/v0.1.9/llvm12.0-win.zip>`_.
+`<https://github.com/hyperledger-labs/solang/releases/download/llvm13.0-1/llvm13.0-win.zip>`_.
 
 
 After unzipping the file, add the bin directory to your path.
 After unzipping the file, add the bin directory to your path.
 
 
@@ -100,8 +100,8 @@ Installing LLVM on Mac
 ______________________
 ______________________
 
 
 A pre-built version of llvm for intel macs, is available at
 A pre-built version of llvm for intel macs, is available at
-`<https://github.com/hyperledger-labs/solang/releases/download/v0.1.9/llvm12.0-mac-intel.tar.xz>`_ and for arm macs there is
-`<https://github.com/hyperledger-labs/solang/releases/download/v0.1.9/llvm12.0-mac-arm.tar.xz>`_. After downloading,
+`<https://github.com/hyperledger-labs/solang/releases/download/llvm13.0-1/llvm13.0-mac-intel.tar.xz>`_ and for arm macs there is
+`<https://github.com/hyperledger-labs/solang/releases/download/llvm13.0-1/llvm13.0-mac-arm.tar.xz>`_. After downloading,
 untar the file in a terminal and add it to your path like so:
 untar the file in a terminal and add it to your path like so:
 
 
 .. code-block:: bash
 .. code-block:: bash
@@ -120,7 +120,7 @@ you may need to consult. First if all clone our llvm repository:
 
 
 .. code-block:: bash
 .. code-block:: bash
 
 
-	git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 https://github.com/solana-labs/llvm-project
+	git clone --depth 1 --branch solana-rustc/13.0-2021-08-08 https://github.com/solana-labs/llvm-project
 	cd llvm-project
 	cd llvm-project
 
 
 Now run cmake to create the makefiles. Replace the *installdir* argument to ``CMAKE_INSTALL_PREFIX`` with with a directory where you would like to have llvm installed, and then run the build:
 Now run cmake to create the makefiles. Replace the *installdir* argument to ``CMAKE_INSTALL_PREFIX`` with with a directory where you would like to have llvm installed, and then run the build:

+ 1 - 0
src/emit/substrate.rs

@@ -2951,6 +2951,7 @@ impl<'a> TargetRuntime<'a> for SubstrateTarget {
             true,
             true,
             false,
             false,
             None,
             None,
+            false,
         );
         );
 
 
         let callable = CallableValue::try_from(asm).unwrap();
         let callable = CallableValue::try_from(asm).unwrap();