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/Makefile b/Makefile
index 95c02a6..5305906 100644
--- a/Makefile
+++ b/Makefile
@@ -206,10 +206,16 @@
 $(call Set,Tmp.Dependencies,$($(Tmp.SubDirKey).Dependencies))
 $(call Set,Tmp.CC,$(strip \
   $(call GetCNAVar,CC,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch))))
+$(call Set,Tmp.KERNEL_USE,$(strip \
+  $(call GetCNAVar,KERNEL_USE,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch))))
+$(call Set,Tmp.VISIBILITY_HIDDEN,$(strip \
+  $(call GetCNAVar,VISIBILITY_HIDDEN,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch))))
 $(call Set,Tmp.CFLAGS,$(strip \
   $(if $(call IsDefined,$(Tmp.Key).UniversalArchs),-arch $(Tmp.Arch),)\
-  $(if $(call streq,$($(Tmp.Key).VISIBILITY_HIDDEN),1),\
+  $(if $(call streq,$(Tmp.VISIBILITY_HIDDEN),1),\
        -fvisibility=hidden -DVISIBILITY_HIDDEN,)\
+  $(if $(call streq,$(Tmp.KERNEL_USE),1),\
+       -mkernel -DKERNEL_USE,)\
   $(call GetCNAVar,CFLAGS,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch))))
 
 $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.s $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir