diff --git a/llvm/utils/release/aarch64-redhat-linux.cmake b/llvm/utils/release/aarch64-redhat-linux.cmake new file mode 100644 --- /dev/null +++ b/llvm/utils/release/aarch64-redhat-linux.cmake @@ -0,0 +1,14 @@ +set(CMAKE_SYSTEM_NAME Linux) + +set(TRIPLE "aarch64-redhat-linux") + +set(COMMON_COMPILE_FLAGS "-target ${TRIPLE} --sysroot=/usr/${TRIPLE}/") +set(COMMON_LINK_FLAGS "-fuse-ld=lld") + +set(CMAKE_CXX_FLAGS ${COMMON_COMPILE_FLAGS}) +set(CMAKE_C_FLAGS ${COMMON_COMPILE_FLAGS}) +set(CMAKE_EXE_LINKER_FLAGS ${COMMON_LINK_FLAGS}) +set(CMAKE_MODULE_LINKER_FLAGS ${COMMON_LINK_FLAGS}) +set(CMAKE_SHARED_LINKER_FLAGS ${COMMON_LINK_FLAGS}) + +set(LLVM_HOST_TRIPLE ${TRIPLE} CACHE STRING "Host on which LLVM binaries will run") diff --git a/llvm/utils/release/test-release.sh b/llvm/utils/release/test-release.sh --- a/llvm/utils/release/test-release.sh +++ b/llvm/utils/release/test-release.sh @@ -9,6 +9,8 @@ # # Download, build, and test the release candidate for an LLVM release. # +# dnf install -y file clang ninja-build cmake chrpath +# CXX=/usr/lib64/ccache/clang++ ./test-release.sh -no-libunwind -no-lldb -no-polly -no-mlir -no-flang -release 16.0.0 -final -toolchain-file `pwd`/aarch64-redhat-linux.cmake -triple arch64-redhat-linux -use-ninja #===------------------------------------------------------------------------===# System=`uname -s` @@ -46,6 +48,7 @@ ExtraConfigureFlags="" ExportBranch="" git_ref="" +toolchain_file="" do_bolt="no" if [ "$System" = "Linux" ]; then @@ -87,6 +90,7 @@ echo " -no-mlir Disable check-out & build MLIR" echo " -no-flang Disable check-out & build Flang" echo " -silent-log Don't output build logs to stdout" + echo " -toolchain-file FILE Path to toolchain file to use for cross-compiling stage3." } while [ $# -gt 0 ]; do @@ -199,6 +203,20 @@ ;; -silent-log ) do_silent_log="yes" + ;; + -toolchain-file ) + shift + toolchain_file="$1" + do_compare="no" + # Disable libunwind build due to configure error: + # Compiler doesn't support generation of unwind tables if exception support + # is disabled. Building libunwind DSO with runtime dependency on C++ ABI + # library is not supported. + do_libunwind="no" + # --sysroot option is not passed to libcxxabi builds. + do_libcxxabi="no" + do_libs="no" + ;; -help | --help | -h | --h | -\? ) usage @@ -421,6 +439,9 @@ runtime_list="$runtimes" fi + if [ "$Phase" -eq "3" ] && [ -n "$toolchain_file" ]; then + ExtraConfigureFlags="$ExtraConfigureFlags -DCMAKE_TOOLCHAIN_FILE=$toolchain_file" + fi echo "# Using C compiler: $c_compiler" echo "# Using C++ compiler: $cxx_compiler" @@ -660,7 +681,10 @@ c_compiler=$llvmCore_phase3_destdir/usr/local/bin/clang cxx_compiler=$llvmCore_phase3_destdir/usr/local/bin/clang++ echo "# Testing - built with clang" - test_llvmCore 3 $Flavor $llvmCore_phase3_objdir + # Disable tests if we are cross-compiling + if [ -z "$toolchain_file" ]; then + test_llvmCore 3 $Flavor $llvmCore_phase3_objdir + fi ######################################################################## # Compare .o files between Phase2 and Phase3 and report which ones