Use -object_path_lto when linking executables if building Apple style.

llvm-svn: 165282
This commit is contained in:
Bill Wendling 2012-10-05 00:22:46 +00:00
parent dc78f3e7a9
commit 65e8419086
1 changed files with 15 additions and 11 deletions

View File

@ -631,19 +631,23 @@ endif
# Adjust linker flags for building an executable
ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
ifneq ($(HOST_OS), Darwin)
ifdef TOOLNAME
LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
ifdef EXAMPLE_TOOL
LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
else
LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
ifneq ($(HOST_OS), Darwin)
ifdef TOOLNAME
LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
ifdef EXAMPLE_TOOL
LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
else
LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
endif
endif
endif
else
ifneq ($(DARWIN_MAJVERS),4)
LD.Flags += $(RPATH) -Wl,@executable_path/../lib
endif
ifneq ($(DARWIN_MAJVERS),4)
LD.Flags += $(RPATH) -Wl,@executable_path/../lib
endif
ifeq ($(RC_BUILDIT),YES)
TempFile := $(shell mktemp ${OBJROOT}/llvm-lto.XXXXXX)
LD.Flags += -Wl,-object_path_lto -Wl,$(TempFile)
endif
endif
endif