@Afkil,
I have successfully cross compiled my working branch of LLVM with CMAKE.
Change this
SET(CMAKE_SYSTEM_NAME AmigaOS)
to this
SET(CMAKE_SYSTEM_NAME Generic)
I handled the flags this way.
SET(CMAKE_CXX_FLAGS_INIT, "-mcrt=clib2 -athread=native")
SET(CMAKE_C_FLAGS_INIT, "-mcrt=clib2")
I did not require setting as they all got picked up or set by CMAKE interrogating ppc-amigaos-gcc
SET(CMAKE_MAKE_PROGRAM make)
SET(CMAKE_ASM_COMPILER ppc-amigaos-as)
Originally I started with a toolchain file but was able to get it all working with just defines on configuration of the variables.
For C++ I am using the latest build due to need of fixes for std library. Your mileage may vary depending on what you are trying to build.
Here is invocation of CMAKE for LLVM
Quote:
cmake -DCMAKE_SYSTEM_NAME="Generic" \
-DCMAKE_SYSTEM_PROCESSOR="PowerPC" \
-DLLVM_HOST_TRIPLE="ppc-amigaos-unknown" \
-DCMAKE_C_COMPILER="/opt/adtools/bin/ppc-amigaos-gcc" \
-DCMAKE_CXX_COMPILER="/opt/adtools/bin/ppc-amigaos-g++" \
-DCROSS_TOOLCHAIN_FLAGS_NATIVE:STRING="-DCMAKE_C_COMPILER=gcc;-DCMAKE_CXX_COMPILER=g++" \
-DCMAKE_CXX_FLAGS_INIT="-mcrt=clib2 -athread=native" -DCMAKE_C_FLAGS_INIT="-mcrt=clib2" -DUNIX=1 \
-DCMAKE_INSTALL_PREFIX="/opt/adtools/llvm" \
-DLLVM_DEFAULT_TARGET_TRIPLE="ppc-amigaos-unknown" \
-DLLVM_TARGET_ARCH="PowerPC" \
-DLLVM_TARGETS_TO_BUILD="PowerPC" \
-DLLVM_ENABLE_THREADS=OFF \
-DLLVM_BUILD_EXAMPLES=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DCMAKE_BUILD_TYPE="Release" \
/home/dstastny/projects/repos/llvm-project/llvm-project/llvm
Regards
Doug