llvm.org GIT mirror llvm / 1922a11
Add compatibility version when compiling the Apple way. <rdar://problem/9600408> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132929 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 9 years ago
1 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1919 EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libprofile.exports
2020
2121 include $(LEVEL)/Makefile.common
22
23 ifeq ($(HOST_OS),Darwin)
24 # Special hack to allow libprofile_rt to have an offset version number.
25 ifdef LLVM_LTO_VERSION_OFFSET
26 LTO_LIBRARY_VERSION := $(shell expr $(LLVM_SUBMIT_VERSION) + \
27 $(LLVM_LTO_VERSION_OFFSET))
28 else
29 LTO_LIBRARY_VERSION := $(LLVM_SUBMIT_VERSION)
30 endif
31
32 # Set dylib internal version number to llvmCore submission number.
33 ifdef LLVM_SUBMIT_VERSION
34 LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
35 -Wl,$(LTO_LIBRARY_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
36 -Wl,-compatibility_version -Wl,1
37 endif
38 # Extra options to override libtool defaults.
39 LLVMLibsOptions := $(LLVMLibsOptions) \
40 -Wl,-dead_strip \
41 -Wl,-seg1addr -Wl,0xE0000000
42
43 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on
44 # command line.
45 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
46 ifneq ($(DARWIN_VERS),8)
47 LLVMLibsOptions := $(LLVMLibsOptions) \
48 -Wl,-install_name \
49 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
50 endif
51 endif