Crashpad Integration For Unreal Dedicated Server

Hi folks,

I’m trying to integrate crashpad as a third party plugin into the engine to potentially use at some point in the future for other projects. However I’m coming across some fundamental ABI compatibility issues when running the top level ‘make’ in the root directory

undefined symbol: base::FilePath::FilePath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by Crashpad.cpp:52 (/home/stephen/perforce/Engine/Plugins/Crashpad/Source/Crashpad/Private/Crashpad.cpp:52)
>>>               /home/stephen/perforce/Engine/Plugins/Crashpad/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/Crashpad/Crashpad.cpp.o:(InitializeCrashpad())

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)
>>> referenced by file_path.cc
>>>               base.file_path.o:(base::FilePath::FilePath(base::FilePath const&)) in archive /home/stephen/perforce/Engine/Plugins/Crashpad/lib/crashpad/out/Default/obj/third_party/mini_chromium/mini_chromium/base/libbase.a
>>> referenced by file_path.cc
>>>               base.file_path.o:(base::FilePath::FilePath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)) in archive /home/stephen/perforce/Engine/Plugins/Crashpad/lib/crashpad/out/Default/obj/third_party/mini_chromium/mini_chromium/base/libbase.a
>>> referenced by file_path.cc
>>>               base.file_path.o:(base::FilePath::FinalExtension[abi:cxx11]() const) in archive /home/stephen/perforce/Engine/Plugins/Crashpad/lib/crashpad/out/Default/obj/third_party/mini_chromium/mini_chromium/base/libbase.a       
>>> referenced 6 more times

I believe the issue is that there’s an incompatibility between the std lib that Crashpad is built with (libc++) and Unreal (I think this is also libc++). Both are built with the clang toolchain provided by UE.

The main issue I’m coming across at the moment is figuring out how we pass similar flags to crashpad as we do with Unreal. Breakpad also has a similar plugin but uses a different way to build with make under /Engine/Source/ThirdParty/Breakpad/build/Linux/BuildBreakpad.sh.

I’m sure we can do something similar with crashpad but would love a bit of help to get over the last hump.

Thanks in advance!