[commit: ghc] master: Fix build with non-Linux ELF OSes (51bf365)
Ian Lynagh
igloo at earth.li
Wed Mar 20 21:21:45 CET 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : master
https://github.com/ghc/ghc/commit/51bf3653775ba734f7ca3de99234aba722a0c72c
>---------------------------------------------------------------
commit 51bf3653775ba734f7ca3de99234aba722a0c72c
Author: Ian Lynagh <ian at well-typed.com>
Date: Wed Mar 20 19:25:27 2013 +0000
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.
>---------------------------------------------------------------
mk/config.mk.in | 8 +++++++-
rts/ghc.mk | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/mk/config.mk.in b/mk/config.mk.in
index c818a32..275c21a 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -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"
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 09c2874..ce17b74 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -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
More information about the ghc-commits
mailing list