Linux build produces invalid .so: Fix backport for 5.5?

This question was created in reference to: [Linux build produces invalid .so: symbol lookup error from Landscape [Content removed]

James Singer mentions that “While 5.5 has some fixes for linking/relinking, it looks like there’s even more coming in the next release.” -- are there shelves or changelists / git commits for these fixes? We’ve upgraded to 5.5, and would love to adopt any 5.6 or 5.7 fixes to Linux linking that might help this situation. Thank you!

[Attachment Removed]

Hi Jorgen,

Are you hitting any specific issues after upgrading to 5.5? There’s obviously been a fair number of changes since 5.5 on this topic. You should be able to track most of these down by looking at the history of LinuxToolChain.cs. Please reach out if there are specific issues we can look into.

Best regards.

[Attachment Removed]

Hi Jorgen,

Nice find, that does appear like a strong candidate for a potential cause.

Best regards.

[Attachment Removed]

Intermittently on CI, our build of a Program target produces an executable that seemingly fails to look up a symbol at runtime:

/home/ubuntu/work/Main-Generic/SpiritCrossing/Binaries/Linux/SpiritCrossingProgram-Linux-DebugGame: symbol lookup error: /home/ubuntu/work/Main-Generic/SpiritCrossing/Binaries/Linux/SpiritCrossingProgram-Linux-DebugGame: undefined symbol: _ZNK25FThreadSafeStaticStatBase7DoSetupEPKcPKDsS1_S1_S3_bbN13EStatDataType4TypeEbbN22FGenericPlatformMemory20EMemoryCounterRegionE

Unclear why this is happening. (We just migrated the building of this tool to UBT, so it’s a new problem.)

[Attachment Removed]

I am testing a potential fix. It looks like we copied our target from Engine/Source/Programs/BlankProgram/BlankProgram.Target.cs. This has the snippet:

		bool bDebugOrDevelopment = Target.Configuration == UnrealTargetConfiguration.Debug || Target.Configuration == UnrealTargetConfiguration.Development;
		bBuildWithEditorOnlyData = Target.Platform.IsInGroup(UnrealPlatformGroup.Desktop) && bDebugOrDevelopment;

I think the issue we’re hitting is that the Core .so built with DebugGame was not getting WITH_EDITORONLY_DATA, and the Core .so built with Development was getting WITH_EDITORONLY_DATA, and if these got mismatched (even though they had the same name), it would cause linker errors. Hopefully that’s all it was.

[Attachment Removed]