Commit 51bf3653 authored by ian@well-typed.com's avatar ian@well-typed.com

Fix build with non-Linux ELF OSes

We were only setting an RPATH for the RTS DLL on Linux, but as far
as I can see we should be doing it for all ELF OSes. Hopefully this
will fix the problem where the installed ghc-pkg can't find libffi.dll
on FreeBSD.
parent 0f49dd69
......@@ -88,7 +88,13 @@ GhcDynamic=NO
# GhcProfiled=YES means compile a profiled stage-2 compiler
GhcProfiled=NO
# Soem platforms don't support shared libraries
ifeq "$(findstring $(TargetOS_CPP),linux freebsd dragonfly openbsd netbsd solaris2 kfreebsdgnu haiku linux-android)" ""
TargetElf = NO
else
TargetElf = YES
endif
# Some platforms don't support shared libraries
NoSharedLibsPlatformList =
ifeq "$(SOLARIS_BROKEN_SHLD)" "YES"
......
......@@ -194,7 +194,7 @@ $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/b
else
ifneq "$(UseSystemLibFFI)" "YES"
LIBFFI_LIBS = -Lrts/dist/build -lffi
ifeq "$$(TargetOS_CPP)" "linux"
ifeq "$$(TargetElf)" "YES"
LIBFFI_LIBS += -optl-Wl,-rpath -optl-Wl,'$$$$ORIGIN'
endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment