aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/libprofile/Makefile9
-rw-r--r--tools/lto/Makefile7
2 files changed, 15 insertions, 1 deletions
diff --git a/runtime/libprofile/Makefile b/runtime/libprofile/Makefile
index d8511495ce..1ea0895338 100644
--- a/runtime/libprofile/Makefile
+++ b/runtime/libprofile/Makefile
@@ -44,8 +44,15 @@ ifeq ($(HOST_OS),Darwin)
# command line.
DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
ifneq ($(DARWIN_VERS),8)
- LLVMLibsOptions := $(LLVMLibsOptions) \
+ LLVMLibsOptions := $(LLVMLibsOptions) \
-Wl,-install_name \
-Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
endif
+
+ # If we're doing an Apple-style build, add the LTO object path.
+ ifeq ($(RC_BUILDIT),YES)
+ TempFile = $(shell mktemp ${OBJROOT}/profile_rt-lto.XXXXXX)
+ LLVMLibsOptions := $(LLVMLibsOptions) \
+ -Wl,-object_path_lto -Wl,$(TempFile)
+ endif
endif
diff --git a/tools/lto/Makefile b/tools/lto/Makefile
index 153fa03137..3e7621f6db 100644
--- a/tools/lto/Makefile
+++ b/tools/lto/Makefile
@@ -49,4 +49,11 @@ ifeq ($(HOST_OS),Darwin)
-Wl,-install_name \
-Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
endif
+
+ # If we're doing an Apple-style build, add the LTO object path.
+ ifeq ($(RC_BUILDIT),YES)
+ TempFile = $(shell mktemp ${OBJROOT}/llvm-lto.XXXXXX)
+ LLVMLibsOptions := $(LLVMLibsOptions) \
+ -Wl,-object_path_lto -Wl,$(TempFile)
+ endif
endif