summaryrefslogtreecommitdiff
path: root/runtime/GCCLibraries
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-29 10:05:30 +0000
committerChris Lattner <sabre@nondot.org>2003-11-29 10:05:30 +0000
commitef1835df7b082c0251005d5368d2e89f8b54227c (patch)
tree6e9292aa51aa25aa6d1615ec405a9f71bdbac05d /runtime/GCCLibraries
parenteefa3d3cfb73062a91a96a92287e88c356f1afdc (diff)
downloadllvm-ef1835df7b082c0251005d5368d2e89f8b54227c.tar.gz
llvm-ef1835df7b082c0251005d5368d2e89f8b54227c.tar.bz2
llvm-ef1835df7b082c0251005d5368d2e89f8b54227c.tar.xz
Rewrite makefile logic to build an archive instead of a .o file. This is
intended to address PR142 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10257 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/GCCLibraries')
-rw-r--r--runtime/GCCLibraries/crtend/Makefile59
-rw-r--r--runtime/GCCLibraries/crtend/comp_cxxeh.lst11
-rw-r--r--runtime/GCCLibraries/crtend/comp_genericeh.lst9
-rw-r--r--runtime/GCCLibraries/crtend/comp_main.lst3
-rw-r--r--runtime/GCCLibraries/crtend/comp_sjljeh.lst7
-rw-r--r--runtime/GCCLibraries/crtend/exported_symbol_list.lst29
6 files changed, 79 insertions, 39 deletions
diff --git a/runtime/GCCLibraries/crtend/Makefile b/runtime/GCCLibraries/crtend/Makefile
index 361bad002b..64d4d00d9f 100644
--- a/runtime/GCCLibraries/crtend/Makefile
+++ b/runtime/GCCLibraries/crtend/Makefile
@@ -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
diff --git a/runtime/GCCLibraries/crtend/comp_cxxeh.lst b/runtime/GCCLibraries/crtend/comp_cxxeh.lst
new file mode 100644
index 0000000000..e29ff96ea7
--- /dev/null
+++ b/runtime/GCCLibraries/crtend/comp_cxxeh.lst
@@ -0,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
diff --git a/runtime/GCCLibraries/crtend/comp_genericeh.lst b/runtime/GCCLibraries/crtend/comp_genericeh.lst
new file mode 100644
index 0000000000..9270648b03
--- /dev/null
+++ b/runtime/GCCLibraries/crtend/comp_genericeh.lst
@@ -0,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
diff --git a/runtime/GCCLibraries/crtend/comp_main.lst b/runtime/GCCLibraries/crtend/comp_main.lst
new file mode 100644
index 0000000000..ea953b7f92
--- /dev/null
+++ b/runtime/GCCLibraries/crtend/comp_main.lst
@@ -0,0 +1,3 @@
+__main
+llvm.global_ctors
+llvm.global_dtors
diff --git a/runtime/GCCLibraries/crtend/comp_sjljeh.lst b/runtime/GCCLibraries/crtend/comp_sjljeh.lst
new file mode 100644
index 0000000000..afcaaf0d05
--- /dev/null
+++ b/runtime/GCCLibraries/crtend/comp_sjljeh.lst
@@ -0,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
diff --git a/runtime/GCCLibraries/crtend/exported_symbol_list.lst b/runtime/GCCLibraries/crtend/exported_symbol_list.lst
deleted file mode 100644
index df12cc8a7b..0000000000
--- a/runtime/GCCLibraries/crtend/exported_symbol_list.lst
+++ /dev/null
@@ -1,29 +0,0 @@
-__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
-
-__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
-
-__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