[CMake] Cannot cross-compile for aarch64 architecture

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

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
NeverMine17
Posts: 5
Joined: Tue May 23, 2017 10:40 am

[CMake] Cannot cross-compile for aarch64 architecture

Post by NeverMine17 »

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.
User avatar
Rachael
Admin
Posts: 13107
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

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

Post by Rachael »

This is not a bug.
NeverMine17
Posts: 5
Joined: Tue May 23, 2017 10:40 am

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

Post by NeverMine17 »

Sorry for posting in the wrong place.
So, do you have any comments on this?
derkternerks
Posts: 2
Joined: Fri Jul 28, 2017 2:13 am

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

Post by derkternerks »

Bumping this because I have the same problem. Where can this be cross-posted if this is not the proper forum?
User avatar
Rachael
Admin
Posts: 13107
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

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

Post by Rachael »

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.
_mental_
 
 
Posts: 3787
Joined: Sun Aug 07, 2011 4:32 am

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

Post by _mental_ »

Native build creates ImportExecutables.cmake file. Its full path should be specified as a value of IMPORT_EXECUTABLES variable.
Blzut3
 
 
Posts: 3098
Joined: Wed Nov 24, 2004 12:59 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support

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

Post by Blzut3 »

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.

Return to “Technical Issues”