[commit: ghc] master: Disable thin archive support on Windows (e81d110)
git at git.haskell.org
git at git.haskell.org
Fri Apr 4 19:41:11 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/e81d110e7ddd381e53c3af4fbd261d29edd16725/ghc
>---------------------------------------------------------------
commit e81d110e7ddd381e53c3af4fbd261d29edd16725
Author: Simon Marlow <marlowsd at gmail.com>
Date: Fri Apr 4 17:02:20 2014 +0100
Disable thin archive support on Windows
>---------------------------------------------------------------
e81d110e7ddd381e53c3af4fbd261d29edd16725
rts/Linker.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/rts/Linker.c b/rts/Linker.c
index 38d7c39..bed5496 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);
More information about the ghc-commits
mailing list