summaryrefslogtreecommitdiff
path: root/rts/Linker.c
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-10-13 14:42:52 +0100
committerIan Lynagh <ian@well-typed.com>2012-10-13 14:42:52 +0100
commit83f5c6c69ceeff6cb6ca8d56dfad79c5e126a130 (patch)
tree209f955cb914892e6dc47fcf11a7a32083e4f9dc /rts/Linker.c
parent5c43947b6917c6b67896d0358da0179b4385ad0e (diff)
downloadhaskell-83f5c6c69ceeff6cb6ca8d56dfad79c5e126a130.tar.gz
When dynamic-by-default, don't use the GHCi linker
We instead link objects into a temporary DLL and dlopen that
Diffstat (limited to 'rts/Linker.c')
-rw-r--r--rts/Linker.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 64d60f23d0..4ae9193a11 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -137,6 +137,16 @@
#include <sys/tls.h>
#endif
+// Defining this as 'int' rather than 'const int' means that we don't get
+// warnings like
+// error: function might be possible candidate for attribute ‘noreturn’
+// from gcc:
+#ifdef DYNAMIC_BY_DEFAULT
+int dynamicByDefault = 1;
+#else
+int dynamicByDefault = 0;
+#endif
+
/* Hash table mapping symbol names to Symbol */
static /*Str*/HashTable *symhash;
@@ -2044,6 +2054,10 @@ loadArchive( pathchar *path )
IF_DEBUG(linker, debugBelch("loadArchive: start\n"));
IF_DEBUG(linker, debugBelch("loadArchive: Loading archive `%" PATH_FMT" '\n", path));
+ if (dynamicByDefault) {
+ barf("loadArchive called, but using dynlibs by default (%s)", path);
+ }
+
gnuFileIndex = NULL;
gnuFileIndexSize = 0;
@@ -2435,6 +2449,10 @@ loadObj( pathchar *path )
#endif
IF_DEBUG(linker, debugBelch("loadObj %" PATH_FMT "\n", path));
+ if (dynamicByDefault) {
+ barf("loadObj called, but using dynlibs by default (%s)", path);
+ }
+
initLinker();
/* debugBelch("loadObj %s\n", path ); */