diff options
author | Christiaan Baaj <christiaan.baaij@gmail.com> | 2014-01-28 08:24:55 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-01-28 08:24:55 -0600 |
commit | f7be53ac9dac85b83e7fe5ecede01b98a572ba48 (patch) | |
tree | ddf358efae5f9ba93ef9dd7e252311399417b00c /rts/ghc.mk | |
parent | 943f22a4c959a2d0c0e47fc40c2163ef7760b6d9 (diff) | |
download | haskell-f7be53ac9dac85b83e7fe5ecede01b98a572ba48.tar.gz |
Fix inplace dynamic linking on OS X (#8266)
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'rts/ghc.mk')
-rw-r--r-- | rts/ghc.mk | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rts/ghc.mk b/rts/ghc.mk index 1e0b6def87..3929adbee9 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -117,7 +117,7 @@ else rts/dist/build/lib$(LIBFFI_NAME)$(soext): libffi/build/inst/lib/lib$(LIBFFI_NAME)$(soext) cp libffi/build/inst/lib/lib$(LIBFFI_NAME)$(soext)* rts/dist/build ifeq "$(TargetOS_CPP)" "darwin" - install_name_tool -id @rpath/rts-$(rts_VERSION)/lib$(LIBFFI_NAME)$(soext) rts/dist/build/lib$(LIBFFI_NAME)$(soext) + install_name_tool -id @rpath/lib$(LIBFFI_NAME)$(soext) rts/dist/build/lib$(LIBFFI_NAME)$(soext) endif endif endif @@ -197,6 +197,9 @@ LIBFFI_LIBS = -Lrts/dist/build -l$$(LIBFFI_NAME) ifeq "$$(TargetElf)" "YES" LIBFFI_LIBS += -optl-Wl,-rpath -optl-Wl,'$$$$ORIGIN' -optl-Wl,-zorigin endif +ifeq "$(TargetOS_CPP)" "darwin" +LIBFFI_LIBS += -optl-Wl,-rpath -optl-Wl,@loader_path +endif else # flags will be taken care of in rts/dist/libs.depend @@ -207,7 +210,6 @@ $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/dist/libs.depend $$( "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \ -no-auto-link-packages $$(LIBFFI_LIBS) `cat rts/dist/libs.depend` $$(rts_$1_OBJS) \ $$(rts_$1_DTRACE_OBJS) -o $$@ - $(call relative-dynlib-references,rts,dist,1,$1) endif else $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) |