Force PIE on bootgen with explicit compiler/linker flags, not just the CMake property #15234
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (C) 2023-2026 Advanced Micro Devices, Inc. | |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| name: Compile across platforms | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [assigned, opened, synchronize, reopened] | |
| workflow_dispatch: | |
| merge_group: | |
| schedule: | |
| # Runs at midnight (00:00) every day | |
| - cron: '0 0 * * *' | |
| defaults: | |
| run: | |
| # force bash for windows | |
| shell: bash | |
| env: | |
| # Run apt package manager in the CI in non-interactive mode. | |
| # Otherwise, on Ubuntu 20.04 the installation of tzdata asking question | |
| DEBIAN_FRONTEND: noninteractive | |
| concurrency: | |
| # A PR number if a pull request and otherwise the commit hash. This cancels | |
| # queued and in-progress runs for the same PR (presubmit) or commit | |
| # (postsubmit). | |
| group: ci-build-test-multi-cpp-linux-${{ github.event.number || github.sha }}-${{ github.event_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-repo: | |
| name: ${{ matrix.OS }} ${{ matrix.COMPILER }} assert=${{ matrix.ENABLE_ASSERTIONS }} rtti=${{ matrix.ENABLE_RTTI }} | |
| runs-on: ${{ matrix.OS }} | |
| strategy: | |
| # Run all the test even if there are some which fail | |
| fail-fast: false | |
| # Run the tests on the Cartesian product of the following | |
| matrix: | |
| OS: [ ubuntu-22.04, ubuntu-24.04 ] | |
| COMPILER: [ llvm, gcc ] | |
| ENABLE_ASSERTIONS: [ ON, OFF ] | |
| ENABLE_RTTI: [ ON, OFF ] | |
| include: | |
| - OS: windows-2022 | |
| COMPILER: msvc | |
| ENABLE_ASSERTIONS: ON | |
| ENABLE_RTTI: ON | |
| - OS: windows-2022 | |
| COMPILER: msvc | |
| ENABLE_ASSERTIONS: ON | |
| ENABLE_RTTI: OFF | |
| - OS: windows-2022 | |
| COMPILER: msvc | |
| ENABLE_ASSERTIONS: OFF | |
| ENABLE_RTTI: ON | |
| - OS: windows-2022 | |
| COMPILER: msvc | |
| ENABLE_ASSERTIONS: OFF | |
| ENABLE_RTTI: OFF | |
| steps: | |
| # Clone the repo and its submodules. Do shallow clone to save clone | |
| # time. | |
| - name: Get the project repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 2 | |
| submodules: "true" | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Python packages | |
| run: | | |
| python -m pip install --upgrade pip | |
| python utils/mlir_aie_wheels/vendor_eudsl.py \ | |
| --requirements python/requirements.txt \ | |
| --install-non-eudsl | |
| pip install -r python/requirements_notebook.txt | |
| python -m pip install --require-hashes -r python/requirements_dev.lock | |
| - name: Setup Cpp | |
| uses: aminya/setup-cpp@8170d66c458f4a045220b7b0966c10940bb2a15d # v1.8.1 | |
| with: | |
| compiler: ${{ matrix.COMPILER }} | |
| vcvarsall: ${{ contains(matrix.OS, 'windows') }} | |
| cmake: true | |
| ninja: true | |
| cppcheck: false | |
| clangtidy: false | |
| clangformat: false | |
| - uses: ./.github/actions/setup_ccache | |
| id: setup_ccache | |
| with: | |
| MATRIX_OS: ${{ matrix.OS }} | |
| MATRIX_ARCH: x86 | |
| EXTRA_KEY: compile-and-test-assert=${{ matrix.ENABLE_ASSERTIONS }}-rtti=${{ matrix.ENABLE_RTTI }} | |
| - name: Get MLIR | |
| id: mlir-wheels | |
| run: | | |
| VERSION=$(utils/clone-llvm.sh --get-wheel-version) | |
| if [ x"${{ matrix.ENABLE_RTTI }}" == x"OFF" ]; then | |
| WHEEL=mlir_no_rtti | |
| else | |
| WHEEL=mlir | |
| fi | |
| for attempt in 1 2 3; do | |
| rm -f "$WHEEL"-*.whl | |
| if pip -q download $WHEEL==$VERSION \ | |
| -f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro; then | |
| break | |
| fi | |
| if [ "$attempt" -eq 3 ]; then | |
| echo "Failed to download MLIR wheel after ${attempt} attempts" >&2 | |
| exit 1 | |
| fi | |
| sleep $((attempt * 5)) | |
| done | |
| unzip -q "$WHEEL"-*.whl | |
| # Build the repo test target in release mode to build and test. | |
| - name: Build and test | |
| run: | | |
| if [ x"${{ matrix.ENABLE_RTTI }}" == x"OFF" ]; then | |
| WHEEL=mlir_no_rtti | |
| else | |
| WHEEL=mlir | |
| fi | |
| mkdir -p build_release/install | |
| cd build_release | |
| if [ x"${{ contains(matrix.OS, 'windows') }}" == x"true" ]; then | |
| LLVM_EXTERNAL_LIT="$(where lit)" | |
| else | |
| LLVM_EXTERNAL_LIT="$(which lit)" | |
| fi | |
| cmake .. \ | |
| -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
| -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \ | |
| -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \ | |
| -DCMAKE_C_VISIBILITY_PRESET=hidden \ | |
| -DCMAKE_CXX_VISIBILITY_PRESET=hidden \ | |
| -DCMAKE_INSTALL_PREFIX=$PWD/install \ | |
| -DAIE_COMPILER=NONE \ | |
| -DAIE_LINKER=NONE \ | |
| -DAIE_ENABLE_PYTHON_PASSES=OFF \ | |
| -DHOST_COMPILER=NONE \ | |
| -DLLVM_ENABLE_ASSERTIONS=${{ matrix.ENABLE_ASSERTIONS }} \ | |
| -DLLVM_ENABLE_RTTI=${{ matrix.ENABLE_RTTI }} \ | |
| -DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \ | |
| -DMLIR_DIR=$PWD/../$WHEEL/lib/cmake/mlir \ | |
| -DLLVM_DIR=$PWD/../$WHEEL/lib/cmake/llvm \ | |
| -DLLVM_EXTERNAL_LIT="$LLVM_EXTERNAL_LIT" | |
| ninja | |
| # tests hang/fail on windows | |
| if [ x"${{ contains(matrix.OS, 'windows') }}" == x"false" ]; then | |
| ninja check-aie | |
| ninja check-reference-designs | |
| ninja check-programming-guide | |
| fi |