#include <sys/stat.h>
#endif
-#if defined(HAVE_FRAMEWORK_HASKELLSUPPORT)
-#include <HaskellSupport/dlfcn.h>
-#elif defined(HAVE_DLFCN_H)
+#if defined(HAVE_DLFCN_H)
#include <dlfcn.h>
#endif
# if defined(openbsd_HOST_OS)
dl_libc_handle = dlopen("libc.so", RTLD_LAZY);
# endif
-# endif // RTLD_DEFAULT
+# endif /* RTLD_DEFAULT */
# endif
}
void *hdl;
char *errmsg;
+ // *** HACK
+ // If we load libHSbase_cbits_dyn.[so|dylib],
+ // then we know that we need to activate another newCAF
+ // related hack in Storage.c because we can't redirect
+ // newCAF to newDynCAF with the system dynamic linker.
+#ifdef OBJFORMAT_MACHO
+ const char *hsbase = "/libHSbase_cbits_dyn.dylib";
+#else
+ const char *hsbase = "/libHSbase_cbits_dyn.so";
+#endif
+ int namelen = strlen(dll_name);
+ int baselen = strlen(hsbase);
+ if(namelen > baselen && !strcmp(dll_name + namelen - baselen, hsbase))
+ {
+ keepCAFs = rtsTrue;
+ }
+ // *** END HACK.
+
initLinker();
hdl= dlopen(dll_name, RTLD_NOW | RTLD_GLOBAL);
/* Newline first because the interactive linker has printed "linking..." */
errorBelch("\n%s: unknown symbol `%s'", oc->fileName, symbol);
return 0;
- foundit:
+ foundit:;
}
checkProddableBlock(oc, pP);
switch (reltab_j->Type) {