Fix Windows builders after 244601f4720d9cda6e81ea1908f3ce905a4bcb0e
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Tue, 15 Jun 2021 08:47:29 +0000 (09:47 +0100)
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Tue, 15 Jun 2021 08:47:29 +0000 (09:47 +0100)
Apparently __builtin_abort() is not supported when targetting Windows.
This should fix the following builder errors:
clang_rt.builtins-x86_64.lib(int_util.c.obj) : error LNK2019: unresolved
external symbol __builtin_abort referenced in function __compilerrt_abort_impl

compiler-rt/lib/builtins/int_util.c

index e70a6fa..bbb735c 100644 (file)
@@ -41,6 +41,10 @@ void __compilerrt_abort_impl(const char *file, int line, const char *function) {
 
 #else
 
+#ifdef _WIN32
+#include <stdlib.h>
+#endif
+
 #ifndef _WIN32
 __attribute__((weak))
 __attribute__((visibility("hidden")))
@@ -49,6 +53,8 @@ void __compilerrt_abort_impl(const char *file, int line, const char *function) {
 #if !__STDC_HOSTED__
   // Avoid depending on libc when compiling with -ffreestanding.
   __builtin_trap();
+#elif defined(_WIN32)
+  abort();
 #else
   __builtin_abort();
 #endif