Unable to cross-compile for Linux-ARM

Cross-compiling with clang 3.5 doesn’t work. Here is tht output at link time for CrashReportClient-Linux-Development ; UE4Game will do the same.

1>  [24/24] Link CrashReportClient-Linux-Development
1>  D:/Unreal/UnrealEngine-release/UnrealEngine-release/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/lib/Linux/arm-unknown-linux-gnueabihf/libSDL2.a(SDL_rpivideo.c.o): In function `RPI_CreateWindow':
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpivideo.c:256: undefined reference to `vc_dispmanx_update_start'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpivideo.c:257: undefined reference to `vc_dispmanx_element_add'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpivideo.c:260: undefined reference to `vc_dispmanx_update_submit_sync'
1>  D:/Unreal/UnrealEngine-release/UnrealEngine-release/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/lib/Linux/arm-unknown-linux-gnueabihf/libSDL2.a(SDL_rpivideo.c.o): In function `RPI_VideoInit':
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpivideo.c:151: undefined reference to `bcm_host_init'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpivideo.c:155: undefined reference to `graphics_get_display_size'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpivideo.c:178: undefined reference to `vc_dispmanx_display_open'
1>  D:/Unreal/UnrealEngine-release/UnrealEngine-release/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/lib/Linux/arm-unknown-linux-gnueabihf/libSDL2.a(SDL_rpimouse.c.o): In function `RPI_WarpMouseGlobal':
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:231: undefined reference to `vc_dispmanx_update_start'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:233: undefined reference to `vc_dispmanx_rect_set'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:234: undefined reference to `vc_dispmanx_element_change_attributes'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:246: undefined reference to `vc_dispmanx_update_submit'
1>  D:/Unreal/UnrealEngine-release/UnrealEngine-release/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/lib/Linux/arm-unknown-linux-gnueabihf/libSDL2.a(SDL_rpimouse.c.o): In function `RPI_FreeCursor':
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:192: undefined reference to `vc_dispmanx_update_start'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:194: undefined reference to `vc_dispmanx_element_remove'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:196: undefined reference to `vc_dispmanx_update_submit_sync'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:201: undefined reference to `vc_dispmanx_resource_delete'
1>  D:/Unreal/UnrealEngine-release/UnrealEngine-release/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/lib/Linux/arm-unknown-linux-gnueabihf/libSDL2.a(SDL_rpimouse.c.o): In function `RPI_ShowCursor':
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:155: undefined reference to `vc_dispmanx_rect_set'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:156: undefined reference to `vc_dispmanx_rect_set'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:158: undefined reference to `vc_dispmanx_update_start'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:161: undefined reference to `vc_dispmanx_element_add'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:172: undefined reference to `vc_dispmanx_update_submit_sync'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:123: undefined reference to `vc_dispmanx_update_start'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:125: undefined reference to `vc_dispmanx_element_remove'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:127: undefined reference to `vc_dispmanx_update_submit_sync'
1>  D:/Unreal/UnrealEngine-release/UnrealEngine-release/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/lib/Linux/arm-unknown-linux-gnueabihf/libSDL2.a(SDL_rpimouse.c.o): In function `RPI_CreateCursor':
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:81: undefined reference to `vc_dispmanx_resource_create'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:83: undefined reference to `vc_dispmanx_rect_set'
1>  /home/rcl/build/2015-05-01/SDL-gui-backend/src/video/raspberry/SDL_rpimouse.c:90: undefined reference to `vc_dispmanx_resource_write_data'

I have no idea where this RPi stuff comes from, Iam not targetting Raspberry at all.

Hey -

You may want to check the wiki page for compiling on Linux (A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums) There is a specific section at the bottom of the page dealing with additional steps for Linux-ARM.

Cheers

Hi ,

Unfortunately I am already following this guide. The first “Setup” step fails, I can’t even build the engine in the first place.

I have reset my working dir, reinstalled dependencies, removed the project files and rebuilt from scratch, but nothing changes. Can you try to reproduce the issue ?

Hey -

I tried to setup cross-compile as well. I did not get the same errors you posted however it did not complete successfully. I have entered a report about this (Ue-19887) for further investigation.

Cheers

Hi Dough, thanks for the update.

For the record I tried reproducing the process with clean source builds on the latest releases from Github :

  • 4.8.3 fails with the issue described ;
  • 4.9.0 fails with a different error.

Here is the build log for 4.9.3 when building UnrealPak.

1>  [4/12] Compile Module.Json.cpp
1>  In file included from F:\UnrealEngine-4.9.0-preview-3\Engine\Intermediate\Build\Linux\x86_64-unknown-linux-gnu\UnrealPak\Development\PakFile\Module.PakFile.cpp:2:
1>  In file included from F:\UnrealEngine-4.9.0-preview-3\Engine\Source\Runtime\PakFile\Private\IPlatformFilePak.cpp:3:
1>  In file included from F:\UnrealEngine-4.9.0-preview-3\Engine\Source\Runtime\PakFile\Private/PakFilePrivatePCH.h:5:
1>  In file included from Runtime/Core/Public\Core.h:16:
1>Runtime/Core/Public/HAL\PlatformIncludes.h(5,10): fatal error : 'new' file not found

The same thing happens with UE4.

1>  [4/203] Compile UdpMessaging.generated.cpp
1>  In file included from F:\UnrealEngine-4.9.0-preview-3\Engine\Intermediate\Build\Linux\x86_64-unknown-linux-gnu\UE4\Development\Renderer\RendererPrivate.h:4:
1>  In file included from F:\UnrealEngine-4.9.0-preview-3\Engine\Source\Runtime\Renderer\Private\RendererPrivate.h:10:
1>  In file included from Runtime/Engine/Public\Engine.h:9:
1>  In file included from Runtime/Core/Public\Core.h:16:
1>Runtime/Core/Public/HAL\PlatformIncludes.h(5,10): fatal error : 'new' file not found

I’m currently evaulating the Unreal Engine for projects on Linux-ARM ; is this target supported ?

Thanks,

The two different errors are yielded by the same toolchain - the 3.5 cross clang linked on the Wiki. I have 4.8.3 and 4.9 P3 installed from source in a folder and they use the exact same setup, both were downloaded this morning.

I will try your commit ASAP.

The “new” file error looks unrelated, please make sure that you are using ARM cross toolchain as the sysroot will be different.

I fixed the ARM builds in this commit (applicable to 4.9.x and 4.8.x, but it’s unclear whether it is going to be merged to these branches): https://github.com/EpicGames/UnrealEngine/commit/929c1047523829cf9d16be05e78f246034590589 - you can cherry pick it to your repo.

Regarding Linux ARM support: we provide libraries and the cross-toolchain that make compilation possible with only slight changes; however, we do not CIS nor test ARM Linux builds.

You might have not changed DefaultArchitecture in UEBuildLinux.cs for 4.9 then, and it is still trying to pass -target x86_64…

Actually I’m pretty sure I did since I had the file opened side by side for both UE versions, but I will confirm tomorrow when I’m back at work.

Thank you for your support.

You’re welcome. Judging by your logs (where intermediate directory is named “x86_64-unknown-linux-gnu”) UEBuildLinux.cs was not switched to ARM; that switch + the commit should get it built.

My mistake then. Thanks a lot for the quick fix !

I can confirm that the patch fixes the build issues.