Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/lib64/cmake/llvm/HandleLLVMStdlib.cmake b/linux-x64/clang/lib64/cmake/llvm/HandleLLVMStdlib.cmake
index f0e22d1..b67d87d 100644
--- a/linux-x64/clang/lib64/cmake/llvm/HandleLLVMStdlib.cmake
+++ b/linux-x64/clang/lib64/cmake/llvm/HandleLLVMStdlib.cmake
@@ -31,4 +31,24 @@
message(WARNING "Not sure how to specify libc++ for this compiler")
endif()
endif()
+
+ if(LLVM_STATIC_LINK_CXX_STDLIB)
+ if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
+ check_cxx_compiler_flag("-static-libstdc++"
+ CXX_COMPILER_SUPPORTS_STATIC_STDLIB)
+ check_linker_flag("-static-libstdc++" CXX_LINKER_SUPPORTS_STATIC_STDLIB)
+ if(CXX_COMPILER_SUPPORTS_STATIC_STDLIB AND
+ CXX_LINKER_SUPPORTS_STATIC_STDLIB)
+ append("-static-libstdc++"
+ CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS
+ CMAKE_MODULE_LINKER_FLAGS)
+ else()
+ message(WARNING
+ "Can't specify static linking for the C++ standard library")
+ endif()
+ else()
+ message(WARNING "Not sure how to specify static linking of C++ standard "
+ "library for this compiler")
+ endif()
+ endif()
endif()