Add flags when cross-compile Linux from Windows

I’m trying to compile Photon for Linux using crosscompile, but I got this errors

The major problem is that photon is compiled with gcc but the compiler used by Unreal is clang++, so the error showed a lot of times is:

undefined symbol: std::ios_base::Init::Init()

More info:

So in theory I have to add the flags: “-Wl,–copy-dt-needed-entries” to the build line but I don’t know how to add flags to the compiler, maybe it’s in the xml config?

this is the compiler used :

version 4.22 → v13 clang-7.0.1-based

what’s the correct place to do this to compile a linux plugin from windows?

thanks.

Hello,

Yes theres no great way to add custom linker arg, the only way would be to change this file:

Engine/Source/Programs/UnrealBuildTool/Platform/Linux/LinuxToolChain.cs

And in this function:

protected virtual string GetLinkArguments(LinkEnvironment LinkEnvironment)

Add this somewhere along with the other linker flags:

results += " -Wl,--copy-dt-needed-entries";

Thanks @Brandon, do I need to recompile the engine to do that?

Nope just need to rebuild UBT with GenerateProjectFiles

Yes, I mean, you have to download the whole engine and compile it to test this?
I would like to do it with vanila (launcher) version of the engine…