From 205cb9c7233f7e82ca570b199f01ccad4fa219c1 Mon Sep 17 00:00:00 2001 From: RJ Sampson Date: Sat, 9 Nov 2024 19:26:15 -0700 Subject: [PATCH] feat: Add runtimes for LLVM 19 Adds runtimes for LLVM 19 Signed-off-by: RJ Sampson --- llvm-runtimes-19.yaml | 186 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 llvm-runtimes-19.yaml diff --git a/llvm-runtimes-19.yaml b/llvm-runtimes-19.yaml new file mode 100644 index 00000000000..58fbd67427a --- /dev/null +++ b/llvm-runtimes-19.yaml @@ -0,0 +1,186 @@ +package: + name: llvm-runtimes-19 + version: 19.1.3 + epoch: 0 + description: LLVM runtimes + copyright: + - license: Apache-2.0 + dependencies: + provides: + - llvm-runtimes=${{package.full-version}} + +var-transforms: + - from: ${{package.version}} + match: ^(\d+).* + replace: $1 + to: major-version + +environment: + contents: + packages: + - build-base + - busybox + - ca-certificates-bundle + - clang-${{vars.major-version}} + - linux-headers + - llvm-${{vars.major-version}}-dev + - python3 + environment: + CC: "clang" + CXX: "clang++" + +pipeline: + - name: Fetch source for LLVM runtimes + uses: fetch + with: + expected-sha512: 0abaf158b373892d5afc184158600df17a0797547ad7238ca9018d6fcdd7310b0db803d158daa82a2e04bd42d9daebaa2c3e4b9024c0fa2df72a88596575df5c + uri: https://github.com/llvm/llvm-project/releases/download/llvmorg-${{package.version}}/llvm-project-${{package.version}}.src.tar.xz + + - name: Configure LLVM runtimes + uses: cmake/configure + with: + opts: | + -Wno-dev -S runtimes \ + -DLLVM_ENABLE_RUNTIMES="libunwind;libcxx;libcxxabi" \ + -DCMAKE_BUILD_TYPE=Rel \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIBUNWIND_HAS_NODEFAULTLIBS_FLAG=OFF \ + -DCMAKE_VERBOSE_MAKEFILE=ON + + - name: Build LLVM runtimes + uses: cmake/build + + - name: Install LLVM runtimes + uses: cmake/install + + - name: Install libunwind headers + runs: | + mkdir -p "${{targets.contextdir}}"/usr/include/mach-o + cp libunwind/include/*.h "${{targets.contextdir}}"/usr/include/ + cp libunwind/include/mach-o/*.h "${{targets.contextdir}}"/usr/include/mach-o + + - name: Strip LLVM runtimes + uses: strip + +subpackages: + - name: llvm-libc++-${{vars.major-version}} + description: LLVM libc++ ${{vars.major-version}} + dependencies: + provides: + - llvm-libc++=${{package.full-version}} + pipeline: + - name: Split libc++ + runs: | + mkdir -p ${{targets.contextdir}}/usr/lib + mv ${{targets.destdir}}/usr/lib/libc++*.so.* ${{targets.contextdir}}/usr/lib + + - name: llvm-libc++-${{vars.major-version}}-static + description: Static library for LLVM libc++ ${{vars.major-version}} + dependencies: + provides: + - llvm-libc++-static=${{package.full-version}} + pipeline: + - name: Split libc++ static library + runs: | + mkdir -p ${{targets.contextdir}}/usr/lib + mv ${{targets.destdir}}/usr/lib/libc++*.a ${{targets.contextdir}}/usr/lib + + - name: llvm-libc++-${{vars.major-version}}-dev + description: Development files for LLVM libc++ ${{vars.major-version}} + dependencies: + provides: + - llvm-libc++-dev=${{package.full-version}} + runtime: + - llvm-libc++-${{vars.major-version}} + - llvm-libc++-${{vars.major-version}}-static + pipeline: + - name: Split libc++ development files + runs: | + mkdir -p ${{targets.contextdir}}/usr/lib + mkdir -p ${{targets.contextdir}}/usr/include + mv ${{targets.destdir}}/usr/lib/libc++*.so ${{targets.contextdir}}/usr/lib + mv ${{targets.destdir}}/usr/include/c++ ${{targets.contextdir}}/usr/include + test: + pipeline: + - uses: test/pkgconf + + - name: llvm-compiler-rt-${{vars.major-version}} + description: Compiler runtime for LLVM ${{vars.major-version}} + dependencies: + provides: + - llvm-compiler-rt=${{package.full-version}} + pipeline: + - name: Configure LLVM runtimes + uses: cmake/configure + with: + opts: | + -Wno-dev -S runtimes \ + -DLLVM_ENABLE_RUNTIMES="compiler-rt" \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \ + -DCMAKE_BUILD_TYPE=Rel \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCOMPILER_RT_INCLUDE_TESTS=OFF \ + -DCOMPILER_RT_BUILD_SANITIZERS=ON \ + -DCOMPILER_RT_INSTALL_PATH="/usr/lib/llvm-${{vars.major-version}}/lib/clang/${{vars.major-version}}" \ + -DCOMPILER_RT_BUILD_GWP_ASAN=OFF \ + -DCMAKE_VERBOSE_MAKEFILE=ON + - name: Build compiler runtime + uses: cmake/build + - name: Install compiler runtime + uses: cmake/install + - name: Link triplet to clang lib + runs: | + clangrt="$(clang -print-runtime-dir)" + mkdir -p "${{targets.contextdir}}/${clangrt%/*}" + ln -s "${clangrt##*/}" "${{targets.contextdir}}/${clangrt%/*}/linux" + - name: Strip compiler runtime + uses: strip + + - name: llvm-libunwind-${{vars.major-version}} + description: LLVM libunwind ${{vars.major-version}} + dependencies: + provides: + - llvm-libunwind=${{package.full-version}} + pipeline: + - name: Split libunwind + runs: | + mkdir -p ${{targets.contextdir}}/usr/lib + mv ${{targets.destdir}}/usr/lib/libunwind.so.* ${{targets.contextdir}}/usr/lib + + - name: llvm-libunwind-${{vars.major-version}}-static + description: Static library for LLVM libunwind ${{vars.major-version}} + dependencies: + provides: + - llvm-libunwind-static=${{package.full-version}} + pipeline: + - name: Split libunwind static library + runs: | + mkdir -p ${{targets.contextdir}}/usr/lib + mv ${{targets.destdir}}/usr/lib/libunwind.a ${{targets.contextdir}}/usr/lib + + - name: llvm-libunwind-${{vars.major-version}}-dev + description: Development files for LLVM libunwind ${{vars.major-version}} + dependencies: + provides: + - llvm-libunwind-dev=${{package.full-version}} + runtime: + - llvm-libunwind-${{vars.major-version}} + - llvm-libunwind-${{vars.major-version}}-static + pipeline: + - name: Split libunwind development files + runs: | + mkdir -p ${{targets.contextdir}}/usr/lib + mkdir -p ${{targets.contextdir}}/usr/include + mv ${{targets.destdir}}/usr/lib/libunwind.so ${{targets.contextdir}}/usr/lib + mv ${{targets.destdir}}/usr/include ${{targets.contextdir}}/usr + test: + pipeline: + - uses: test/pkgconf + +update: + enabled: true + github: + identifier: llvm/llvm-project + strip-prefix: llvmorg- + tag-filter: llvmorg-19 + use-tag: true