Remove "-Wl,-seg1addr -Wl,0xE0000000" from link options.
[oota-llvm.git] / runtime / libprofile / Makefile
1 ##===- runtime/libprofile/Makefile -------------------------*- Makefile -*-===##
2 #
3 #                     The LLVM Compiler Infrastructure
4 #
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
7 #
8 ##===----------------------------------------------------------------------===##
9
10 LEVEL = ../..
11 include $(LEVEL)/Makefile.config
12
13 ifneq ($(strip $(LLVMCC)),)
14 BYTECODE_LIBRARY = 1
15 endif
16 LIBRARYNAME = profile_rt
17 LINK_LIBS_IN_SHARED = 1
18 SHARED_LIBRARY = 1
19
20 # Build and install this archive.                                                                                                                  
21 BUILD_ARCHIVE = 1
22 override NO_INSTALL_ARCHIVES =
23
24 include $(LEVEL)/Makefile.common
25
26 ifeq ($(HOST_OS),Darwin)
27     # Special hack to allow libprofile_rt to have an offset version number.
28     PROFILE_RT_LIBRARY_VERSION := $(LLVM_SUBMIT_VERSION)
29
30     # Set dylib internal version number to llvmCore submission number.
31     ifdef LLVM_SUBMIT_VERSION
32         LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
33                         -Wl,$(PROFILE_RT_LIBRARY_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
34                         -Wl,-compatibility_version -Wl,1
35     endif
36     # Extra options to override libtool defaults.
37     LLVMLibsOptions    := $(LLVMLibsOptions)  \
38                          -Wl,-dead_strip
39
40     # Mac OS X 10.4 and earlier tools do not allow a second -install_name on
41     # command line.
42     DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
43     ifneq ($(DARWIN_VERS),8)
44        LLVMLibsOptions    := $(LLVMLibsOptions) \
45                             -Wl,-install_name \
46                             -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
47     endif
48
49     # If we're doing an Apple-style build, add the LTO object path.
50     ifeq ($(RC_XBS),YES)
51        TempFile           := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/profile_rt-lto.XXXXXX)
52        LLVMLibsOptions    := $(LLVMLibsOptions) \
53                              -Wl,-object_path_lto -Wl,$(TempFile)
54     endif
55 endif