forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
114 lines (99 loc) · 4.57 KB
/
release-stable.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Create Stable Release
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
# for release create
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt install llvm
- name: Fetch toolchain headers
uses: actions/checkout@v3
with:
repository: OpenOrbis/OpenOrbis-PS4-Toolchain
path: OpenOrbis-PS4-Toolchain
- name: Fetch musl
run: curl -sL https://github.com/OpenOrbis/musl/releases/latest/download/musl.tar.gz | tar xz -C ./OpenOrbis-PS4-Toolchain
- name: Build compiler-rt
run: |
mkdir compiler-rt/build && cd compiler-rt/build
cmake -DCMAKE_C_COMPILER="clang" \
-DCMAKE_CXX_COMPILER="clang++" \
-DCMAKE_C_FLAGS="-fPIC -DPS4 -D_LIBUNWIND_IS_BAREMETAL=1" \
-DCMAKE_CXX_FLAGS="-fPIC -DPS4 -D_LIBUNWIND_IS_BAREMETAL=1" \
-DLLVM_PATH="../../llvm" -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE="x86_64-scei-ps4" \
-DCOMPILER_RT_BAREMETAL_BUILD=YES -DCOMPILER_RT_BUILD_BUILTINS=ON \
-DCOMPILER_RT_BUILD_CRT=OFF -DCOMPILER_RT_BUILD_SANITIZERS=OFF \
-DCOMPILER_RT_BUILD_XRAY=OFF -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
-DCOMPILER_RT_BUILD_PROFILE=OFF ..
make
- name: Build libunwind
run: |
mkdir libunwind/build && cd libunwind/build
cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" \
-DCMAKE_C_FLAGS="-fPIC -DPS4 -D_LIBUNWIND_IS_BAREMETAL=1" \
-DCMAKE_CXX_FLAGS="-fPIC -DPS4 -D_LIBUNWIND_IS_BAREMETAL=1" \
-DLLVM_PATH="../../llvm" -DLIBUNWIND_USE_COMPILER_RT=YES \
-DLIBUNWIND_BUILD_32_BITS=NO -DLIBUNWIND_ENABLE_STATIC=ON \
-DLIBUNWIND_USE_COMPILER_RT=YES -DLIBUNWIND_ENABLE_SHARED=OFF ..
make
- name: Build libcxxabi
run: |
mkdir libcxxabi/build && cd libcxxabi/build
cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" \
-DCMAKE_C_FLAGS="-fPIC -DPS4 -D_LIBUNWIND_IS_BAREMETAL=1 \
-I${{ github.workspace }}/OpenOrbis-PS4-Toolchain/include" -DCMAKE_CXX_FLAGS="-fPIC -DPS4 \
-D_LIBUNWIND_IS_BAREMETAL=1 -I${{ github.workspace }}/OpenOrbis-PS4-Toolchain/include" \
-DLLVM_PATH="../../llvm" -DLIBCXXABI_ENABLE_SHARED=NO \
-DLIBCXXABI_ENABLE_STATIC=YES -DLIBCXXABI_ENABLE_EXCEPTIONS=YES \
-DLIBCXXABI_USE_COMPILER_RT=YES -DLIBCXXABI_USE_LLVM_UNWINDER=YES \
-DLIBCXXABI_LIBUNWIND_PATH="../../libunwind" -DLIBCXXABI_LIBCXX_INCLUDES="../../libcxx/include" \
-DLIBCXXABI_ENABLE_PIC=YES ..
make
- name: Build libcxx
run: |
mkdir out
mkdir libcxx/build && cd libcxx/build
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DLIBCXX_HAS_MUSL_LIBC=1 -DLIBCXX_HAS_GCC_S_LIB=0 -DLIBCXX_ENABLE_THREADS=1 \
-DLIBCXX_HAS_THREAD_API_PTHREAD=1 -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_CXX_ABI_INCLUDE_PATHS="../../libcxxabi/include" \
-DLIBCXX_CXX_ABI_LIBRARY_PATH="../../libcxxabi/build/lib" -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON -DLIBCXX_ENABLE_SHARED=OFF \
-DLLVM_PATH="../../llvm" -DCMAKE_C_FLAGS="-DPS4 -fPIC" -DCMAKE_CXX_FLAGS="-DPS4 -fPIC" -DCMAKE_INSTALL_PREFIX="../../out" ..
cmake -DCMAKE_SYSROOT="${{ github.workspace }}/OpenOrbis-PS4-Toolchain" ..
make
make install
- name: Copy libs and headers
run: |
mkdir -p release/lib
mkdir -p release/include
cp -r compiler-rt/build/lib/linux/* release/lib/
cp -r libcxx/build/lib/* release/lib/
cp -r libcxxabi/build/lib/* release/lib/
cp -r libunwind/build/lib/* release/lib/
cp -r out/include/* release/include/
rm -rf release/lib/abi
- name: Create master libc++ archive
working-directory: release/lib
run: |
echo "CREATE libc++M.a" > mri.txt
echo "ADDLIB libunwind.a" >> mri.txt
echo "ADDLIB libc++abi.a" >> mri.txt
echo "ADDLIB libc++.a" >> mri.txt
echo "SAVE" >> mri.txt
echo "END" >> mri.txt
llvm-ar -M < mri.txt && rm mri.txt && rm libc++.a && mv libc++M.a libc++.a
- name: Create tarball
working-directory: release
run: tar -czf libcxx-full.tar.gz lib/* include/*
- name: Create Release
working-directory: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create release-${{ GITHUB.SHA }} libcxx-full.tar.gz --target ${{ GITHUB.SHA }} -t "Automated Release ${{ GITHUB.SHA }}"