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
This commit is contained in:
Chris Lattner 2003-11-29 10:05:30 +00:00
parent eefa3d3cfb
commit ef1835df7b
6 changed files with 79 additions and 39 deletions

View File

@ -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)
$(LLVMGCCDIR)/bytecode-libs/crtend.o: $(LIBNAME_BC)
@cp $< $@
# 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 $@
# 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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,3 @@
__main
llvm.global_ctors
llvm.global_dtors

View File

@ -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

View File

@ -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