Merge of b38fdfc0f9bef696420a7d02fc1441416a146527 #86173
This file contains 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
on: | |
push: | |
paths: | |
- 'clang/**' | |
- 'compiler-rt/**' | |
- 'llvm/**' | |
- 'openmp/**' | |
name: Build and upload llorgarm64linux compiler changeset build | |
jobs: | |
build_llorgarm64linux: | |
name: Build llorgarm64linux compiler | |
runs-on: ubuntu-latest | |
container: ubuntu:18.04 | |
steps: | |
- name: Prepare tools | |
run: | | |
apt-get update | |
apt-get -yq install build-essential\ | |
git\ | |
python3-pip\ | |
ninja-build\ | |
g++-7-aarch64-linux-gnu\ | |
g++-7-multilib-arm-linux-gnueabihf\ | |
binutils-arm-linux-gnueabihf\ | |
binutils-multiarch-dev\ | |
libgcc1-armhf-cross\ | |
libsfgcc1-armhf-cross\ | |
libstdc++6-armhf-cross\ | |
libstdc++-7-dev-armhf-cross | |
python3 -m pip install cmake | |
apt-get autoclean | |
- name: Checkout code | |
uses: actions/checkout@v1 | |
- name: Build llorgarm64linux compiler on ubuntu18 | |
run: | | |
builds_ws=`pwd` | |
export MY_LLVM_ROOT=${builds_ws} | |
check_rc () { | |
rc=$? | |
if [ $rc != 0 ]; then exit $rc; fi | |
} | |
### build x86 | |
cd $builds_ws | |
test -z $NCPU && NCPU=$(nproc) | |
rm -rf build | |
mkdir build; cd build | |
CC=`which gcc` CXX=`which g++` cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;openmp" $MY_LLVM_ROOT/llvm | |
make -j$NCPU llvm-tblgen clang-tblgen SHELL="bash -x" | |
check_rc | |
### build arm | |
cd $builds_ws | |
rm -rf deploy; mkdir -p deploy/linux_prod | |
rm -rf builds | |
DEPLOY_WS=${builds_ws}/deploy/linux_prod | |
git show --name-only --oneline HEAD^2 >${DEPLOY_WS}/llvm_changes 2>&1 || true | |
mkdir builds; cd builds | |
CC=aarch64-linux-gnu-gcc-7 CXX=aarch64-linux-gnu-g++-7 cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;openmp" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="AArch64" -DLLVM_BINUTILS_INCDIR=/usr/include -DCMAKE_INSTALL_PREFIX=$DEPLOY_WS -DLLVM_TABLEGEN=${builds_ws}/build/bin/llvm-tblgen -DCLANG_TABLEGEN=${builds_ws}/build/bin/clang-tblgen -DCMAKE_CROSSCOMPILING=True -DCMAKE_SYSTEM_NAME=Linux -DLIBOMPTARGET_AMDGCN_GFXLIST="" -DLLVM_TARGET_ARCH=AArch64 -DLLVM_DEFAULT_TARGET_TRIPLE=aarch64-unknown-linux-gnu ${MY_LLVM_ROOT}/llvm 2>&1 | |
ninja 2>&1 | |
check_rc | |
ninja install | |
check_rc | |
echo "Build finished successfully" | |
cd $DEPLOY_WS && rm -f sum.txt && find . -type f | xargs md5sum --binary > ../sum_Release.txt && mv ../sum_Release.txt ./sum.txt | |
tar cfz ../../llorgarm64linux.tar.xz * | |
cd ../../ | |
- name: Upload llorgarm64linux build artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: llorgarm64linux | |
path: llorgarm64linux.tar.xz |