Skip to content

Commit

Permalink
feat: support rtti and different projects for llvm build
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbaliasnikov committed Sep 12, 2024
1 parent 35cc54d commit c92b772
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/actions/build-llvm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
description: "Enable coverage."
required: false
default: 'false'
llvm-projects:
description: "LLVM projects to build. Sets up LLVM_ENABLE_PROJECTS variable."
required: false
default: ''
sanitizer:
description: 'A sanitizer to build LLVM with. Possible values are Address, Memory, MemoryWithOrigins, Undefined, Thread, DataFlow, and Address;Undefined'
required: false
Expand All @@ -28,6 +32,10 @@ inputs:
description: 'Enable Valgrind for LLVM regression tests.'
required: false
default: 'false'
enable-rtti:
description: 'Enable RTTI for LLVM.'
required: false
default: 'false'
default-target-triple:
description: 'Default target to triple build LLVM for. Possible values are `eravm`, `evm`, or leave empty for default target.'
required: false
Expand Down Expand Up @@ -79,7 +87,9 @@ runs:

- name: Install LLVM builder
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
run: cargo install compiler-llvm-builder@${{ inputs.llvm-builder-version }}
run: |
cargo install compiler-llvm-builder --git https://github.com/matter-labs/era-compiler-llvm-builder --branch aba-rtti-support
# cargo install compiler-llvm-builder@${{ inputs.llvm-builder-version }}
- name: Clone LLVM framework
if: inputs.clone-llvm == 'true'
Expand Down Expand Up @@ -152,6 +162,8 @@ runs:
[ "${{ inputs.enable-tests }}" = "true" ] && ENABLE_TESTS="--enable-tests"
[ "${{ inputs.enable-assertions }}" = "true" ] && ENABLE_ASSERTIONS="--enable-assertions"
[ "${{ inputs.enable-coverage }}" = "true" ] && ENABLE_COVERAGE="--enable-coverage"
[ "${{ inputs.llvm-projects }}" != "" ] && LLVM_PROJECTS="--llvm-projects ${{ inputs.llvm-projects }}"
[ "${{ inputs.enable-rtti }}" = "true" ] && ENABLE_RTTI="--enable-rtti"
[ "${{ inputs.extra-args }}" != "" ] && EXTRA_ARGS="--extra-args ${{ inputs.extra-args }}"
[ "${{ inputs.sanitizer }}" != "" ] && SANITIZER="--sanitizer ${{ inputs.sanitizer }}"
[ "${{ inputs.enable-valgrind }}" = "true" ] && ENABLE_VALGRIND="--enable-valgrind"
Expand All @@ -160,4 +172,4 @@ runs:
fi
zksync-llvm build --target-env ${{ inputs.target-env }} ${DEFAULT_TARGET} \
--use-ccache ${{ inputs.builder-extra-args }} ${DEBUG_ARG} ${ENABLE_TESTS} ${ENABLE_VALGRIND} ${ENABLE_ASSERTIONS} ${ENABLE_COVERAGE} ${SANITIZER} ${EXTRA_ARGS}
--use-ccache ${{ inputs.builder-extra-args }} ${DEBUG_ARG} ${ENABLE_TESTS} ${ENABLE_VALGRIND} ${ENABLE_ASSERTIONS} ${ENABLE_COVERAGE} ${LLVM_PROJECTS} ${ENABLE_RTTI} ${SANITIZER} ${EXTRA_ARGS}

0 comments on commit c92b772

Please sign in to comment.