Add new build option KERNEL_USE, which compiles with -mkernel and gets propogated to CFLAGS. Use this to call panic() instead of abort() when enabled.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@100015 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/int_lib.h b/lib/int_lib.h
index f6c2dd4..912a12f 100644
--- a/lib/int_lib.h
+++ b/lib/int_lib.h
@@ -23,7 +23,14 @@
 #include "endianness.h"
 #include <math.h>
 
+/* If compiling for kernel use, call panic() instead of abort(). */
+#ifdef KERNEL_USE
+extern void panic (const char *, ...);
+#define compilerrt_abort() \
+  panic("%s:%d: abort in %s", __FILE__, __LINE__, __FUNCTION__)
+#else
 #define compilerrt_abort() abort()
+#endif
 
 #if !defined(INFINITY) && defined(HUGE_VAL)
 #define INFINITY HUGE_VAL