Fix compiling with libc++ but not linking with libc++.
@@ -110,6 +110,18 @@ static inline T* new_zeroed()
return static_cast<T*>(calloc(sizeof(T), 1));
}
+#ifdef _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_NAMESPACE_STD
+/**
+ * If we're compiling with libc++, we need to instantiate the vector base class
+ * to avoid linker errors. Libc++ defines the functions that throw exceptions
+ * in the headers but makes them extern templates to avoid code duplication in
+ * the slow paths.
+ */
+template class __attribute__((visibility("hidden"))) __vector_base_common<true>;
+_LIBCPP_END_NAMESPACE_STD
+#endif
+
static inline struct arc_tls* getARCThreadData(void)
{
