X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fllvm-shlib%2FMakefile;h=9498a27d77b9efd5f313d02c9f27aef2ff7f8256;hb=566fb9fe3ed767be7218fb1608ec6a284067d3b0;hp=52381304bb93e0acb41f3e002ebdad53613dec9e;hpb=59a430f68f962464f0564b51741e2aea148c617c;p=oota-llvm.git diff --git a/tools/llvm-shlib/Makefile b/tools/llvm-shlib/Makefile index 52381304bb9..9498a27d77b 100644 --- a/tools/llvm-shlib/Makefile +++ b/tools/llvm-shlib/Makefile @@ -7,32 +7,34 @@ # ##===----------------------------------------------------------------------===## -LEVEL = ../.. +LEVEL := ../.. LIBRARYNAME = LLVM-$(LLVMVersion) -NO_BUILD_ARCHIVE = 1 -LINK_LIBS_IN_SHARED = 1 -SHARED_LIBRARY = 1 +NO_BUILD_ARCHIVE := 1 +LINK_LIBS_IN_SHARED := 1 +SHARED_LIBRARY := 1 include $(LEVEL)/Makefile.config ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) - EXPORTED_SYMBOL_FILE = $(ObjDir)/$(LIBRARYNAME).exports + EXPORTED_SYMBOL_FILE = $(ObjDir)/$(LIBRARYNAME).exports + ifeq (1,$(ENABLE_EMBED_STDCXX)) # It is needed to force static-stdc++.a linked. - # FIXME: It should be omitted when configure detects system's stdc++.dll. SHLIB_FRAG_NAMES += stdc++.a.o + endif endif include $(LEVEL)/Makefile.common # Include all archives in libLLVM.(so|dylib) except the ones that have -# their own dynamic libraries. +# their own dynamic libraries and TableGen. Archives := $(wildcard $(LibDir)/libLLVM*.a) SharedLibraries := $(wildcard $(LibDir)/libLLVM*$(SHLIBEXT)) -IncludeInLibLlvm := $(filter-out $(basename $(SharedLibraries)).a, $(Archives)) +ExcludeFromLibLlvm := $(basename $(SharedLibraries)).a %/libLLVMTableGen.a +IncludeInLibLlvm := $(filter-out $(ExcludeFromLibLlvm), $(Archives)) LLVMLibsOptions := $(IncludeInLibLlvm:$(LibDir)/lib%.a=-l%) LLVMLibsPaths := $(IncludeInLibLlvm) @@ -49,8 +51,7 @@ ifeq ($(HOST_OS),Darwin) LLVMLibsOptions := $(LLVMLibsOptions) -all_load # extra options to override libtool defaults LLVMLibsOptions := $(LLVMLibsOptions) \ - -Wl,-dead_strip \ - -Wl,-seg1addr -Wl,0xE0000000 + -Wl,-dead_strip # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') @@ -61,14 +62,27 @@ ifeq ($(HOST_OS),Darwin) endif endif -ifeq ($(HOST_OS), Linux) +ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD OpenBSD GNU Bitrig)) # Include everything from the .a's into the shared library. LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \ -Wl,--no-whole-archive +endif + +ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD GNU)) + # Add soname to the library. + LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT) +endif + +ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD)) # Don't allow unresolved symbols. LLVMLibsOptions += -Wl,--no-undefined endif +ifeq ($(HOST_OS),SunOS) + # add -z allextract ahead of other libraries on Solaris + LLVMLibsOptions := -Wl,-z -Wl,allextract $(LLVMLibsOptions) +endif + ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) SHLIB_STUBS := $(addprefix $(ObjDir)/, $(SHLIB_FRAG_NAMES))