From 0a0311759babb267c087482bfde9614544c51e0d Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 5 Oct 2012 00:22:46 +0000 Subject: Use -object_path_lto when linking executables if building Apple style. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165282 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.rules | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'Makefile.rules') diff --git a/Makefile.rules b/Makefile.rules index 030955b..a52bb80 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -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 -- cgit v1.1