[llvm-commits] [compiler-rt] r100015 - in /compiler-rt/trunk: Makefile lib/int_lib.h make/lib_info.mk make/platform/clang_darwin.mk
Daniel Dunbar
daniel at zuster.org
Wed Mar 31 10:00:49 PDT 2010
Author: ddunbar
Date: Wed Mar 31 12:00:48 2010
New Revision: 100015
URL: http://llvm.org/viewvc/llvm-project?rev=100015&view=rev
Log:
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.
Modified:
compiler-rt/trunk/Makefile
compiler-rt/trunk/lib/int_lib.h
compiler-rt/trunk/make/lib_info.mk
compiler-rt/trunk/make/platform/clang_darwin.mk
Modified: compiler-rt/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/Makefile?rev=100015&r1=100014&r2=100015&view=diff
==============================================================================
--- compiler-rt/trunk/Makefile (original)
+++ compiler-rt/trunk/Makefile Wed Mar 31 12:00:48 2010
@@ -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
Modified: compiler-rt/trunk/lib/int_lib.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/int_lib.h?rev=100015&r1=100014&r2=100015&view=diff
==============================================================================
--- compiler-rt/trunk/lib/int_lib.h (original)
+++ compiler-rt/trunk/lib/int_lib.h Wed Mar 31 12:00:48 2010
@@ -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
Modified: compiler-rt/trunk/make/lib_info.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/lib_info.mk?rev=100015&r1=100014&r2=100015&view=diff
==============================================================================
--- compiler-rt/trunk/make/lib_info.mk (original)
+++ compiler-rt/trunk/make/lib_info.mk Wed Mar 31 12:00:48 2010
@@ -47,4 +47,5 @@
AvailableOptions := AR ARFLAGS \
CC CFLAGS FUNCTIONS OPTIMIZED \
RANLIB RANLIBFLAGS \
- VISIBILITY_HIDDEN
+ VISIBILITY_HIDDEN \
+ KERNEL_USE
Modified: compiler-rt/trunk/make/platform/clang_darwin.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_darwin.mk?rev=100015&r1=100014&r2=100015&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/clang_darwin.mk (original)
+++ compiler-rt/trunk/make/platform/clang_darwin.mk Wed Mar 31 12:00:48 2010
@@ -242,4 +242,6 @@
FUNCTIONS.cc_kext.x86_64 := \
$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.x86_64))
+KERNEL_USE.cc_kext := 1
+
VISIBILITY_HIDDEN := 1
More information about the llvm-commits
mailing list