Android Build Fails for x86 Target

This appears to stem from the way the PhysX libs are compiled for x86 on Android.

 UnrealBuildTool: C:/UE4/UnrealEngine/Engine/Source/ThirdParty/PhysX/PhysX-3.3/lib/Android/x86/libPhysX3PROFILE.a(NpPhysics.cpp.o):NpPhysics.cpp:function physx::NpPhysics::createInstance(unsigned int, physx::PxFoundation&, physx::PxTolerancesScale const&, b
MainFrameActions: Packaging (Android (ETC1)): ool, physx::PxProfileZoneManager*): error: undefined reference to '__stack_chk_fail_local'
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: C:/UE4/UnrealEngine/Engine/Source/ThirdParty/PhysX/PhysX-3.3/lib/Android/x86/libPhysX3PROFILE.a(NpScene.cpp.o):NpScene.cpp:function void physx::shdfnd::sort<void*, physx::shdfnd::Less<void*>, physx::shdfnd::ReflectionAllocator<physx::Cm::Block<unsigned char, 256u> > >(void**, unsigned int, physx::shdfnd::Less<void*> const&, physx::shdfnd::ReflectionAllocator<physx::Cm::Block<unsigned char, 256u> > const&) [clone .isra.537]: error: undefined reference to '__stack_chk_fail_local'
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: C:/UE4/UnrealEngine/Engine/Source/ThirdParty/PhysX/PhysX-3.3/lib/Android/x86/libPhysX3PROFILE.a(NpScene.cpp.o):NpScene.cpp:function void physx::shdfnd::sort<void*, physx::shdfnd::Less<void*>, physx::shdfnd::ReflectionAllocator<physx::Cm::Block<unsigned char, 384u> > >(void**, unsigned int, physx::shdfnd::Less<void*> const&, physx::shdfnd::ReflectionAllocator<physx::Cm::Block<unsigned char, 384u> > const&) [clone .isra.540]: error: undefined reference to '__stack_chk_fail_local'
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: C:/UE4/UnrealEngine/Engine/Source/ThirdParty/PhysX/PhysX-3.3/lib/Android/x86/libPhysX3PROFILE.a(NpScene.cpp.o):NpScene.cpp:function void physx::shdfnd::sort<void*, physx::shdfnd::Less<void*>, physx::shdfnd::ReflectionAllocator<physx::Cm::B
MainFrameActions: Packaging (Android (ETC1)): lock<unsigned char, 128u> > >(void**, unsigned int, physx::shdfnd::Less<void*> const&, physx::shdfnd::ReflectionAllocator<physx::Cm::Block<unsigned char, 128u> > const&) [clone .isra.534]: error: undefined reference to '__stack_chk_fail_local'
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

hi ddiakopoulos,

Can you attach the entirety of your failed build output to this thread as a txt file?

Thanks!

hi ddiakopoulos,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.
Thank you.

this is still an issue in 8.4.3 git

I have exactly the same issue on 4.8.3 from git. Got it while trying to make an x86 Android build on Mac OS 10.10.5 with Xcode 6.4, Android ndk-r10c. Have tried adding -fstack-protector/-fno-stack-protector to AndroidToolChain.cs and rebuilding the UBT. That didn’t help at all.

For debugging I’ve added a dirty workaround with a dummy __stack_chk_fail_local in my game module and -z muldefs linker flag in AndroidToolChain.cs for x86 (don’t forget to rebuild the UBT). There’re also multiple undefined reference errors for the GearVR plugin on x86 Android. Disabling the plugin helps to build the project.

Since you added in the work around and have disabled the plugin, are you still having trouble building? If so, please provide your full as a .txt file in order for us to assist you further.

Thanks!

With a dummy __stack_chk_fail_local and disabled plugin I was able to build my project and deploy to a device. It works fine.

UE 4.18.3 has the same issue but with Play library

It’s still happening on UE 4.19, I’ve solved this error downgrading the Play Games Services to the [2.1 Version][1] replacing the android folder inside Engine\Source\ThirdParty\GooglePlay\gpg-cpp-sdk.v2.3\gpg-cpp-sdk

https://developers…com/games/services/downloads/gpg-cpp-sdk.v2.2.zip

It seems to be my problem too. Android Packaging - Clang Atomic Load 8 Error - World Creation - Unreal Engine Forums

What version do you download for UE Source 4.21.2?