Windows build broken
Simon Marlow
marlowsd at gmail.com
Fri Apr 4 16:05:25 UTC 2014
Sorry, probably my fault. I've attached a patch that should fix it,
which should get you going while I validate.
Cheers,
Simon
On 04/04/2014 16:14, Simon Peyton Jones wrote:
> Can someone fix this? This is breakage on Windows. It was fine yesterday.
>
> Simon
>
> cc1.exe: warnings being treated as errors
>
> rts\Linker.c: In function 'loadArchive':
>
> rts\Linker.c:2631:17:
>
> error: passing argument 1 of 'strlen' from incompatible pointer type
>
> c:\code\head\inplace\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h:49:40:
> note: expected 'const char *' but argument is of type 'pathchar *'
>
> rts\Linker.c:2632:17:
>
> error: passing argument 2 of 'strcpy' from incompatible pointer type
>
> c:\code\head\inplace\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h:45:39:
> note: expected 'const char *' but argument is of type 'pathchar *'
>
> rts\Linker.c:2638:21:
>
> error: passing argument 1 of 'strlen' from incompatible pointer type
>
> c:\code\head\inplace\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h:49:40:
> note: expected 'const char *' but argument is of type 'pathchar *'
>
> rts\Linker.c:2643:17:
>
> error: passing argument 1 of '_wfopen' from incompatible pointer type
>
> c:\code\head\inplace\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h:593:39:
> note: expected 'const wchar_t *' but argument is of type 'char *'
>
> rts/ghc.mk:233: recipe for target 'rts/dist/build/Linker.o' failed
>
> make[1]: *** [rts/dist/build/Linker.o] Error 1
>
> make[1]: *** Waiting for unfinished jobs....
>
> Makefile:64: recipe for target 'all' failed
>
> make: *** [all] Error 2
>
> HEAD (master)$
>
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
>
-------------- next part --------------
>From f65e9fe435a72ac3de1487a3e5a24b347c1a809b Mon Sep 17 00:00:00 2001
From: Simon Marlow <marlowsd at gmail.com>
Date: Fri, 4 Apr 2014 17:02:20 +0100
Subject: [PATCH] Disable thin archive support on Windows
---
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);
--
1.7.9.5
More information about the ghc-devs
mailing list