[llvm-commits] CVS: llvm/runtime/GCCLibraries/crtend/comp_cxxeh.lst comp_genericeh.lst comp_main.lst comp_sjljeh.lst Makefile exported_symbol_list.lst

Chris Lattner lattner at cs.uiuc.edu
Sat Nov 29 04:06:03 PST 2003


Changes in directory llvm/runtime/GCCLibraries/crtend:

comp_cxxeh.lst added (r1.1)
comp_genericeh.lst added (r1.1)
comp_main.lst added (r1.1)
comp_sjljeh.lst added (r1.1)
Makefile updated: 1.8 -> 1.9
exported_symbol_list.lst (r1.1) removed

---
Log message:

Rewrite makefile logic to build an archive instead of a .o file.  This is 
intended to address PR142


---
Diffs of the changes:  (+79 -10)

Index: llvm/runtime/GCCLibraries/crtend/comp_cxxeh.lst
diff -c /dev/null llvm/runtime/GCCLibraries/crtend/comp_cxxeh.lst:1.1
*** /dev/null	Sat Nov 29 04:05:41 2003
--- llvm/runtime/GCCLibraries/crtend/comp_cxxeh.lst	Sat Nov 29 04:05:30 2003
***************
*** 0 ****
--- 1,11 ----
+ __llvm_cxxeh_allocate_exception
+ __llvm_cxxeh_free_exception
+ __llvm_cxxeh_throw
+ __llvm_cxxeh_call_terminate
+ __llvm_cxxeh_current_uncaught_exception_isa
+ __llvm_cxxeh_begin_catch
+ __llvm_cxxeh_begin_catch_if_isa
+ __llvm_cxxeh_end_catch
+ __llvm_cxxeh_rethrow
+ __llvm_cxxeh_get_last_caught
+ __llvm_cxxeh_check_eh_spec


Index: llvm/runtime/GCCLibraries/crtend/comp_genericeh.lst
diff -c /dev/null llvm/runtime/GCCLibraries/crtend/comp_genericeh.lst:1.1
*** /dev/null	Sat Nov 29 04:05:41 2003
--- llvm/runtime/GCCLibraries/crtend/comp_genericeh.lst	Sat Nov 29 04:05:30 2003
***************
*** 0 ****
--- 1,9 ----
+ __main
+ llvm.global_ctors
+ llvm.global_dtors
+ 
+ __llvm_eh_has_uncaught_exception
+ __llvm_eh_current_uncaught_exception_type
+ __llvm_eh_add_uncaught_exception
+ __llvm_eh_get_uncaught_exception
+ __llvm_eh_pop_from_uncaught_stack


Index: llvm/runtime/GCCLibraries/crtend/comp_main.lst
diff -c /dev/null llvm/runtime/GCCLibraries/crtend/comp_main.lst:1.1
*** /dev/null	Sat Nov 29 04:05:41 2003
--- llvm/runtime/GCCLibraries/crtend/comp_main.lst	Sat Nov 29 04:05:30 2003
***************
*** 0 ****
--- 1,3 ----
+ __main
+ llvm.global_ctors
+ llvm.global_dtors


Index: llvm/runtime/GCCLibraries/crtend/comp_sjljeh.lst
diff -c /dev/null llvm/runtime/GCCLibraries/crtend/comp_sjljeh.lst:1.1
*** /dev/null	Sat Nov 29 04:05:41 2003
--- llvm/runtime/GCCLibraries/crtend/comp_sjljeh.lst	Sat Nov 29 04:05:30 2003
***************
*** 0 ****
--- 1,7 ----
+ __llvm_sjljeh_throw_longjmp
+ __llvm_sjljeh_init_setjmpmap
+ __llvm_sjljeh_destroy_setjmpmap
+ __llvm_sjljeh_add_setjmp_to_map
+ __llvm_sjljeh_is_longjmp_exception
+ __llvm_sjljeh_get_longjmp_value
+ __llvm_sjljeh_try_catching_longjmp_exception


Index: llvm/runtime/GCCLibraries/crtend/Makefile
diff -u llvm/runtime/GCCLibraries/crtend/Makefile:1.8 llvm/runtime/GCCLibraries/crtend/Makefile:1.9
--- llvm/runtime/GCCLibraries/crtend/Makefile:1.8	Sat Nov 29 03:22:53 2003
+++ llvm/runtime/GCCLibraries/crtend/Makefile	Sat Nov 29 04:05:30 2003
@@ -8,25 +8,64 @@
 ##===----------------------------------------------------------------------===##
 #
 # This directory contains the C and C++ runtime libraries for the LLVM GCC
-# front-ends.
+# front-ends.  See the README.txt file for more details.
+#
+# Since this archive has strange requirements, we use almost all custom rules
+# for building it.
 #
 ##===----------------------------------------------------------------------===##
 
 LEVEL = ../../..
-BYTECODE_LIBRARY=1
 DONT_BUILD_RELINKED=1
-LIBRARYNAME=crtend
-
-Source = $(notdir $(wildcard $(SourceDir)/*.cpp $(SourceDir)/*.c)) listend.ll
 
-EXPORTED_SYMBOL_FILE = $(SourceDir)/exported_symbol_list.lst
+MainSrc      := crtend.c listend.ll
+GenericEHSrc := Exception.cpp
+SJLJEHSrc    := SJLJ-Exception.cpp
+CXXEHSrc     := C++-Exception.cpp
+Source       := $(MainSrc) $(GenericEHSrc) $(SJLJEHSrc) $(CXXEHSrc)
 
 include $(LEVEL)/Makefile.common
 
+# CRTEND_A - The result of making 'all' - the final archive file.
+CRTEND_A   = $(DESTLIBBYTECODE)/crtend.a
+all:: $(CRTEND_A)
+
+# Installation simply requires copying the archive to it's new home.
+$(LLVMGCCDIR)/bytecode-libs/crtend.a: $(CRTEND_A)
+	cp $< $@
+
+install:: $(LLVMGCCDIR)/bytecode-libs/crtend.a
+
+
+# The four components described in the README
+Components := main genericeh sjljeh cxxeh
+ComponentLibs := $(Components:%=$(BUILD_OBJ_DIR)/BytecodeObj/comp_%.bc)
+
+
+# We build crtend.a from the four components described in the README.
+$(CRTEND_A) : $(ComponentLibs)
+	$(AR) $@ $(ComponentLibs)
+
+MainObj      := $(BUILD_OBJ_DIR)/BytecodeObj/crtend.bc \
+                $(BUILD_OBJ_DIR)/BytecodeObj/listend.bc
+GenericEHObj := $(BUILD_OBJ_DIR)/BytecodeObj/Exception.bc
+SJLJEHObj    := $(BUILD_OBJ_DIR)/BytecodeObj/SJLJ-Exception.bc
+CXXEHObj     := $(BUILD_OBJ_DIR)/BytecodeObj/C++-Exception.bc
+
+# __main and ctor/dtor support component
+$(BUILD_OBJ_DIR)/BytecodeObj/comp_main.bc: $(MainObj)
+	$(LGCCLDPROG) -link-as-library -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_main.lst $(MainObj) -o $@
+
+# Generic exception handling support runtime.
+$(BUILD_OBJ_DIR)/BytecodeObj/comp_genericeh.bc: $(GenericEHObj)
+	$(LGCCLDPROG) -link-as-library -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_genericeh.lst $(GenericEHObj) -o $@
+
+# setjmp/longjmp exception handling support runtime.
+$(BUILD_OBJ_DIR)/BytecodeObj/comp_sjljeh.bc: $(SJLJEHObj)
+	$(LGCCLDPROG) -link-as-library -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_sjljeh.lst $(SJLJEHObj) -o $@
 
-$(LLVMGCCDIR)/bytecode-libs/crtend.o: $(LIBNAME_BC)
-	@cp $< $@
+# C++ exception handling support runtime.
+$(BUILD_OBJ_DIR)/BytecodeObj/comp_cxxeh.bc: $(CXXEHObj)
+	$(LGCCLDPROG) -link-as-library -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_cxxeh.lst $(CXXEHObj) -o $@
 
-install:: $(LLVMGCCDIR)/bytecode-libs/crtend.o
-	@rm $(LLVMGCCDIR)/bytecode-libs/libcrtend.bc
 





More information about the llvm-commits mailing list