From 74331e527005c1cee03d7be0d2f9df4ae07d1708 Mon Sep 17 00:00:00 2001
From: Mick Jordan <mick.jordan@oracle.com>
Date: Thu, 6 Oct 2016 12:31:47 -0700
Subject: [PATCH] use '$ORIGIN' for libR rpath on Linux

---
 com.oracle.truffle.r.native/fficall/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/com.oracle.truffle.r.native/fficall/Makefile b/com.oracle.truffle.r.native/fficall/Makefile
index 414f1c4d75..58b03709a5 100644
--- a/com.oracle.truffle.r.native/fficall/Makefile
+++ b/com.oracle.truffle.r.native/fficall/Makefile
@@ -56,7 +56,7 @@ ifeq ($(OS_NAME),Darwin)
 # check if we captured libpcre/libz, rpath those in libR
 	mx rupdatelib $(FASTR_LIB_DIR)
 else
-	$(DYLIB_LD) $(DYLIB_LDFLAGS) -Wl,-rpath,$(FASTR_LIB_DIR) -o $(R_LIB) $(wildcard lib/*.o) -L$(FASTR_LIB_DIR) -lRblas -lRlapack  -lpcre -lz
+	$(DYLIB_LD) $(DYLIB_LDFLAGS) -Wl,-rpath,'$$ORIGIN' -o $(R_LIB) $(wildcard lib/*.o) -L$(FASTR_LIB_DIR) -lRblas -lRlapack  -lpcre -lz
 endif
 
 objs:
-- 
GitLab