Cross-compiling for Linux with AWS binaries results in standard library errors

Hi all, I’ve been pulling my hair out over this for the past week or two. I got the aws sdk binaries build from source to work on Windows after a lot of trial and errors. Currently attempting to get cross-platform working for Linux via Clang for the same project, the aws binaries used is compiled natively on Linux (Ubuntu) on a different machine.

I kept getting standard library errors like below when it’s reading the binaries from Linux, it’s compiled using gcc11 using c++17:

UATHelper: Packaging (Linux): ld.lld: error: undefined symbol: std::ios_base::Init::Init()
UATHelper: Packaging (Linux): >>> referenced by EventHeader.cpp
UATHelper: Packaging (Linux): >>>               EventHeader.cpp.o:(_GLOBAL__sub_I_EventHeader.cpp) in archive C:/Repos/r-d-unreal/Plugins/AWSLoader/Source/AWSSDK/Binaries/Linux/libaws-cpp-sdk-core.a
UATHelper: Packaging (Linux): >>> referenced by EventStreamErrors.cpp
UATHelper: Packaging (Linux): >>>               EventStreamErrors.cpp.o:(_GLOBAL__sub_I_EventStreamErrors.cpp) in archive C:/Repos/r-d-unreal/Plugins/AWSLoader/Source/AWSSDK/Binaries/Linux/libaws-cpp-sdk-core.a
UATHelper: Packaging (Linux): >>> referenced by EventDecoderStream.cpp
UATHelper: Packaging (Linux): >>>               EventDecoderStream.cpp.o:(_GLOBAL__sub_I_EventDecoderStream.cpp) in archive C:/Repos/r-d-unreal/Plugins/AWSLoader/Source/AWSSDK/Binaries/Linux/libaws-cpp-sdk-core.a
UATHelper: Packaging (Linux): >>> referenced 34 more times
UATHelper: Packaging (Linux): ld.lld: error: undefined symbol: std::basic_ios<char, std::char_traits<char>>::init(std::basic_streambuf<char, std::char_traits<char>>*)
UATHelper: Packaging (Linux): >>> referenced by EventDecoderStream.cpp
UATHelper: Packaging (Linux): >>>               EventDecoderStream.cpp.o:(Aws::Utils::Event::EventDecoderStream::EventDecoderStream(Aws::Utils::Event::EventStreamDecoder&, unsigned long)) in archive C:/Repos/r-d-unreal/Plugins/AWSLoader/Source/AWSSDK/Binaries/Linux/libaws-cpp-sdk-core.a
UATHelper: Packaging (Linux): >>> referenced by EventDecoderStream.cpp
UATHelper: Packaging (Linux): >>>               EventDecoderStream.cpp.o:(Aws::Utils::Event::EventDecoderStream::EventDecoderStream(Aws::Utils::Event::EventStreamDecoder&, unsigned long)) in archive C:/Repos/r-d-unreal/Plugins/AWSLoader/Source/AWSSDK/Binaries/Linux/libaws-cpp-sdk-core.a
UATHelper: Packaging (Linux): >>> referenced by EventDecoderStream.cpp
UATHelper: Packaging (Linux): >>>               EventDecoderStream.cpp.o:(Aws::Utils::Event::EventDecoderStream::EventDecoderStream(Aws::Utils::Event::EventStreamDecoder&, unsigned long)) in archive C:/Repos/r-d-unreal/Plugins/AWSLoader/Source/AWSSDK/Binaries/Linux/libaws-cpp-sdk-core.a
UATHelper: Packaging (Linux): >>> referenced 1737 more times

Here’s the cmake command that I used to compile the binaries:

cmake ../aws-sdk-cpp -DCUSTOM_MEMORY_MANAGEMENT=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="core;s3;sqs;logs;monitoring" -DBUILD_SHARED_LIBS=ON -DAUTORUN_UNIT_TESTS=OFF -DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16 -DCMAKE_CXX_STANDARD=17 -DCMAKE_PREFIX_PATH=../aws-sdk-cpp -DCMAKE_INSTALL_PREFIX=../aws-sdk-build/install

The error I suspect have to do with mismatching gcc versions between the bundled library that comes with UE’s version of clang-16 vs what I used to compile, which is gcc11. However, the version of gcc that bundled with clang-16 is 4.8.5 from the looks of it? Which is released in 2015, AWS’s minimum version requirement for gcc is 4.9. I hope that I’m mistaken and it’s actually a newer version that’s bundled with UE’s release?

If anyone’s got any advice or insight on how to deal with this, please let me know. Thanks a lot in advance.

Here’s a log file containing the errors, please let me know if you guys need more info:
ue_aws_cross_compile_error_logs.txt (292.9 KB)