summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2013-10-08 16:58:24 +0100
committerSimon Marlow <marlowsd@gmail.com>2013-10-11 10:37:01 +0100
commitb9c6fd72cd8a00e7c3604567fc4170a3f6421d71 (patch)
tree92fc9e9da7944dd4189ac4dbd3bf2e1241f5a1aa /rts
parent996206b15aa1d4e6d203934484b9076c4c8e1032 (diff)
downloadhaskell-b9c6fd72cd8a00e7c3604567fc4170a3f6421d71.tar.gz
Use dynamic linking only if the GHC package is compiled with -dynamic (#8376)
Diffstat (limited to 'rts')
-rw-r--r--rts/RtsUtils.c11
-rw-r--r--rts/ghc.mk1
2 files changed, 12 insertions, 0 deletions
diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c
index cb9002c361..b06b6af962 100644
--- a/rts/RtsUtils.c
+++ b/rts/RtsUtils.c
@@ -304,6 +304,17 @@ int rts_isProfiled(void)
#endif
}
+// Provides a way for Haskell programs to tell whether they're
+// dynamically-linked or not.
+int rts_isDynamic(void)
+{
+#ifdef DYNAMIC
+ return 1;
+#else
+ return 0;
+#endif
+}
+
// Used for detecting a non-empty FPU stack on x86 (see #4914)
void checkFPUStack(void)
{
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 401fe21eec..9f36811d41 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -139,6 +139,7 @@ ifneq "$$(findstring dyn, $1)" ""
ifeq "$$(HostOS_CPP)" "mingw32"
rts_dist_$1_CC_OPTS += -DCOMPILING_WINDOWS_DLL
endif
+rts_dist_$1_CC_OPTS += -DDYNAMIC
endif
ifneq "$$(findstring thr, $1)" ""