[CMake] Cannot cross-compile for aarch64 architecture

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE? Did your computer break? Ask here.

Moderator: GZDoom Developers

[CMake] Cannot cross-compile for aarch64 architecture

Postby NeverMine17 » Mon Jul 17, 2017 11:37 am

So after TONS of tries of fixing the error myself, i gave up.
CMake seems to be angry at variable called: `IMPORT_EXECUTABLES`.

Log is at https://pastebin.com/hCeXzvZp .

Version of GZDoom: g3.1.0

I'm very new at CMake so any help will be appreciated.
NeverMine17
 
Joined: 23 May 2017

Re: [CMake] Cannot cross-compile for aarch64 architecture

Postby Rachael » Mon Jul 17, 2017 12:18 pm

This is not a bug.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: [CMake] Cannot cross-compile for aarch64 architecture

Postby NeverMine17 » Mon Jul 17, 2017 1:15 pm

Sorry for posting in the wrong place.
So, do you have any comments on this?
NeverMine17
 
Joined: 23 May 2017

Re: [CMake] Cannot cross-compile for aarch64 architecture

Postby derkternerks » Sat Aug 25, 2018 7:48 pm

Bumping this because I have the same problem. Where can this be cross-posted if this is not the proper forum?
derkternerks
 
Joined: 28 Jul 2017

Re: [CMake] Cannot cross-compile for aarch64 architecture

Postby Rachael » Sat Aug 25, 2018 11:33 pm

I moved it to the correct forum already. This really is the best place for it.

I've never done a cross-compile so I can't help you, I am sorry. As far as I know it's not officially supported - someone (maybe Randi?) added in the definitions in CMake for it, but did not provide any documentation.

All I can tell you is, you have to compile for your host platform first, in order to get the dependency tools (updaterevision, zipdir, etc) first.

Alternatively, you can just run QEMU with binfmt support (usually supported by most Debian distros) and edit the CMake files to force GCC to target your desired platform directly.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: [CMake] Cannot cross-compile for aarch64 architecture

Postby _mental_ » Sat Aug 25, 2018 11:38 pm

Native build creates ImportExecutables.cmake file. Its full path should be specified as a value of IMPORT_EXECUTABLES variable.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: [CMake] Cannot cross-compile for aarch64 architecture

Postby Blzut3 » Mon Aug 27, 2018 11:01 pm

Rachael wrote:someone

I did. It was for building PowerPC binaries on x86 Macs without needing to produce universal binaries (which comes with a lot of limitations since build systems aren't really cut out for that kind of thing). To that end it actually is documented here. Since GZDoom no longer supports that I can't say that the cross compiling feature has ever been tested against anything.

As it so happens I just set up a script to capture how to cross compile on ECWolf so here's the general idea on how to use it to compile with MinGW on Linux (you can find Android in that file as well). For Linux to Linux just with a different arch you should be able to get away with just setting the C and C++ compilers, turning on FORCE_CROSSCOMPILE, and supplying IMPORT_EXECUTABLES but you may have to do more. The main thing to look out for is system include contamination which can be somewhat influenced by CMAKE_FIND_ROOT_PATH. Basically check the advanced options in CMake and make sure that all the INCLUDE_DIR variables are what you expect them to be.

Officially what CMake recommends is building out a toolchain file, and your distro might provide one for its cross compilers.
Blzut3
Pronounced: B-l-zut
 
 
 
Joined: 24 Nov 2004
Github ID: Blzut3
Operating System: Debian-like Linux (Debian, Ubuntu, Mint, etc) 64-bit
Graphics Processor: ATI/AMD with Vulkan Support


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 1 guest