Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
66 user(s) are online (55 user(s) are browsing Forums)

Members: 0
Guests: 66

more...

Headlines

Report message:*
 

Re: Cmake and adtools

Subject: Re: Cmake and adtools
by DStastny on 2021/8/26 15:43:21

@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




Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project