[CMake] Problem compiling commander-genius (cross compiling)

Don Hinton hintonda at gmail.com
Fri Feb 9 23:51:04 EST 2018


On Fri, Feb 9, 2018 at 12:52 AM, AmigaBlitter <amiblit at gmail.com> wrote:

>
> Hello everyone,
>
> i'm new to this forum.
>
> I'm trying to port Commander-Genius
> (https://github.com/gerstrong/Commander-Genius) to an exotic platform -
> AmigaOS 4.1 PPC.
>
> I created a toolchain file to specify what compiler i'm using as follow:
>
> ToolChain files
> # this one is important
> SET(CMAKE_SYSTEM_NAME AmigaOS)
> #this one not so much
> SET(CMAKE_SYSTEM_VERSION 1)
>
> # specify the cross compiler
> SET(CMAKE_C_COMPILER
> /usr/local/amiga/adtools-ppc-uwin64-20170623-404/bin/ppc-amigaos-gcc)
> SET(CMAKE_CXX_COMPILER
> /usr/local/amiga/adtools-ppc-uwin64-20170623-404/bin/ppc-amigaos-g++)
>
> # where is the target environment
> SET(CMAKE_FIND_ROOT_PATH  /usr/local/amiga/adtools-ppc-
> uwin64-20170623-404)
>

Try setting CMAKE_SYSROOT instead of CMAKE_FIND_ROOT_PATH.  The find_*()
functions check CMAKE_SYSROOT first if set, and cmake will also pass
"--sysroot=${CMAKE_SYSROOT}" for you.  With clang, I also set
CMAKE_<lang>_COMPILER_TARGET for each language I need, e.g., C, CXX, and
ASM, but that's probably not necessary with gcc.

hth...
don


>
> # search for programs in the build host directories
> SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
> # for libraries and headers in the target directories
> SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
> SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
>
> Issuing cmake -DCMAKE_TOOLCHAIN_FILE=./Toolchain-ppc-amigaos.cmake
> -DUSE_SDL2=yes
>
> Compilations starts, but at the end i get some messages as follow:
> usr/bin/ld: /SDK/local/newlib/lib/libSDL2.so: Relocations in generic ELF
> (EM: 20)
>
> Could someone give me an hint?
>
> Kind regards
>
>
>
>
> --
> Sent from: http://cmake.3232098.n2.nabble.com/
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180209/c33447ae/attachment.html>


More information about the CMake mailing list