summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2014-04-04 17:02:20 +0100
committerSimon Marlow <marlowsd@gmail.com>2014-04-04 17:12:46 +0100
commite81d110e7ddd381e53c3af4fbd261d29edd16725 (patch)
treeccdc0ccf4d6291710821bccd2764f3dcf51f6901
parentee1343712bb7854ef5b7180b1e600ac61be4ca13 (diff)
downloadhaskell-e81d110e7ddd381e53c3af4fbd261d29edd16725.tar.gz
Disable thin archive support on Windows
-rw-r--r--rts/Linker.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 38d7c39184..bed5496656 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -2379,9 +2379,12 @@ loadArchive( pathchar *path )
if (n != 8)
barf("loadArchive: Failed reading header from `%s'", path);
if (strncmp(tmp, "!<arch>\n", 8) == 0) {}
+#if !defined(mingw32_HOST_OS)
+ /* See Note [thin archives on Windows] */
else if (strncmp(tmp, "!<thin>\n", 8) == 0) {
isThin = 1;
}
+#endif
#if defined(darwin_HOST_OS)
/* Not a standard archive, look for a fat archive magic number: */
else if (ntohl(*(uint32_t *)tmp) == FAT_MAGIC) {
@@ -2622,6 +2625,14 @@ loadArchive( pathchar *path )
image = stgMallocBytes(memberSize, "loadArchive(image)");
#endif
+#if !defined(mingw32_HOST_OS)
+ /*
+ * Note [thin archives on Windows]
+ * This doesn't compile on Windows because it assumes
+ * char* pathnames, and we use wchar_t* on Windows. It's
+ * not trivial to fix, so I'm leaving it disabled on
+ * Windows for now --SDM
+ */
if (isThin) {
FILE *member;
char *pathCopy, *dirName, *memberPath;
@@ -2653,7 +2664,9 @@ loadArchive( pathchar *path )
stgFree(memberPath);
stgFree(pathCopy);
}
- else {
+ else
+#endif
+ {
n = fread ( image, 1, memberSize, f );
if (n != memberSize) {
barf("loadArchive: error whilst reading `%s'", path);