RE: Window build broken

2015-11-19 Thread Simon Peyton Jones
I’m afraid I am not familiar enough with ld to offer a proper fix, but to get 
you working again:



In rules/build-package-way.mk<https://phabricator.haskell.org/D1242#790afd03> 
on line 154, remove the “$(if $(filter YES,$(LdIsGNULd)),-T 
$$($1_$2_LD_SCRIPT))” bit.

Yay.  That worked!   I can build again.

Could you possibly

· Push that change, so that Windows builds work again.

· Open a ticket for a full fix.  Presumably that bit of code was there 
for a reason, so there’s still an action outstanding.

Thanks!!

Simon

From: loneti...@gmail.com [mailto:loneti...@gmail.com]
Sent: 18 November 2015 22:41
To: Simon Peyton Jones <simo...@microsoft.com>; David Macek 
<david.mace...@gmail.com>; ghc-devs@haskell.org
Subject: RE: Window build broken



>  Perhaps it is.  Should I blow it away and re-install?



I’d hold on that this. I have just tried building myself and also hit it.



Taking a closer look, it seems that the .o file being produces isn’t an object 
file but an image file. It contains the standard image headers and a PE 
signature.



GHC is doing the right thing in error out here. I think this is coming from 
D1242, there’s a linker script in there driver/utils/merge_sections.ld that’s 
causing ld on windows to output an image file instead of an object file.



I’m afraid I am not familiar enough with ld to offer a proper fix, but to get 
you working again:



In rules/build-package-way.mk<https://phabricator.haskell.org/D1242#790afd03> 
on line 154, remove the “$(if $(filter YES,$(LdIsGNULd)),-T 
$$($1_$2_LD_SCRIPT))” bit.



That should get It working again.



Regards,

Tamar



From: Simon Peyton Jones
Sent: Wednesday, November 18, 2015 14:39
To: Tamar Christina;David Macek;ghc-devs@haskell.org
Subject: RE: Window build broken


|  Presumably Simon didn't change this. Maybe the msys2 install is broken?

Perhaps it is.  Should I blow it away and re-install?

One other difficulty is that (before my machine change) I tried to follow the 
instructions on 
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows to install 
64-bit msys2; but I had a series of problems that Ben G was unable to get to 
the bottom of.  Particularly I could not run bash from emacs; the emacs shell 
window never got as far as a prompt.  So I backed off.  As far as I know that 
is still broken.

I think I have not tried the "32-bit msys2 installer" on that page.  Maybe that 
should be my next step?

Regardless, it's hard to see how any of this concerns the error message I was 
getting.  As lonetiger said, it looks very similar to 
https://ghc.haskell.org/trac/ghc/ticket/10437

What next?

Simon

|  -Original Message-
|  From: Tamar Christina [mailto:loneti...@gmail.com]
|  Sent: 18 November 2015 09:14
|  To: David Macek; Simon Peyton Jones; 
ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>
|  Subject: RE: Window build broken
|
|  Hmm,
|
|  Presumably Simon didn't change this. Maybe the msys2 install is broken?
|
|  TamarFrom: David Macek
|  Sent: ‎18/‎11/‎2015 09:35
|  To: Simon Peyton Jones; loneti...@gmail.com<mailto:loneti...@gmail.com>; 
ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>
|  Subject: Re: Window build broken
|  On 18. 11. 2015 9:29, Simon Peyton Jones wrote:
|  > It’s msys2.  I don’t have Cygwin on this machine.  I have no idea where
|  that prompt comes from, but I agree it’s suspicious.
|
|  Looks like your /etc/fstab is wrong. There should be a line like this one,
|  that removes the `cygdrive` prefix from Windows drive/letter
|  mounts:
|
|  none / cygdrive binary,posix=0,noacl,user 0 0
|
|  --
|  David Macek


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Window build broken

2015-11-18 Thread Matej Borovec
I'm getting similar error on my 32-bit Windows 10:

GHCi, version 7.11.20151114: http://www.haskell.org/ghc/  :? for help
ghc.exe: C:\ghc-8.0_git\usr\local\lib\ghc-prim-0.5.0.0\HSghc-prim-0.5.0.0.o: 
Not x86 PEi386
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.11.20151114 for i386-unknown-mingw32):
  loadObj 
"C:\\ghc-8.0_git\\usr\\local\\lib\\ghc-prim-0.5.0.0\\HSghc-prim-0.5.0.0.o": 
failed

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

And running `file lib\ghc-prim-0.5.0.0\HSghc-prim-0.5.0.0.o` I get:

lib\ghc-prim-0.5.0.0\HSghc-prim-0.5.0.0.o: PE Unknown PE signature 0x342f Intel 
80386 (stripped to external PDB), for MS Windows


-Original Message- 
From: Simon Peyton Jones 
Sent: Wednesday, November 18, 2015 12:25 AM 
To: David Macek ; ghc-devs@haskell.org 
Subject: RE: Window build broken 

It says this:

bash$ file libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.0.0.o 
libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.0.0.o: PE Unknown PE 
signature 0x742e x86-64 (stripped to external PDB), for MS Windows

| -Original Message-
| From: David Macek [mailto:david.mace...@gmail.com]
| Sent: 17 November 2015 22:45
| To: Simon Peyton Jones <simo...@microsoft.com>; ghc-devs@haskell.org
| Subject: Re: Window build broken
| 
| On 17. 11. 2015 23:31, Simon Peyton Jones wrote:
| > Sigh.  My Windows build is broken.  See below.  Any ideas?  The stage2
| complier in non-interactive mode works ok. It’s just ghci fails.  What does
| “Not x86_64 PEi386” mean?  What can I do to fix?
| 
| Maybe it's obvious and you already checked, but could it be that the object
| file is for a different architecture? What does `file` say about it?
| 
| --
| David Macek

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Window build broken

2015-11-18 Thread Tamar Christina
Hmm,

Presumably Simon didn't change this. Maybe the msys2 install is broken?

TamarFrom: David Macek
Sent: ‎18/‎11/‎2015 09:35
To: Simon Peyton Jones; loneti...@gmail.com; ghc-devs@haskell.org
Subject: Re: Window build broken
On 18. 11. 2015 9:29, Simon Peyton Jones wrote:
> It’s msys2.  I don’t have Cygwin on this machine.  I have no idea where that 
> prompt comes from, but I agree it’s suspicious.

Looks like your /etc/fstab is wrong. There should be a line like this
one, that removes the `cygdrive` prefix from Windows drive/letter
mounts:

none / cygdrive binary,posix=0,noacl,user 0 0

-- 
David Macek
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Window build broken

2015-11-18 Thread Simon Peyton Jones
I’m happy to do experiments to help narrow it down, but I haven’t the foggiest 
idea where to start, and am utterly stalled on GHC

Thanks

Simon

From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of 
loneti...@gmail.com
Sent: 17 November 2015 23:51
To: Ryan Scott; ghc-devs@haskell.org
Subject: RE: Window build broken

Well the error is correct, it’s just checking against the machine type in the 
PE spec:

IMAGE_FILE_MACHINE_AMD64

0x8664

x64


So somewhere along the line an invalid PE file was generated (or for the wrong 
architecture).

From: Ryan Scott
Sent: Wednesday, November 18, 2015 00:44
To: ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>
Subject: Re: Window build broken


Wow, I happened to try building GHC on Windows for the first time ever
today, and I also experienced this error :)

Interestingly, someone reported a very similar error to this on Trac,
but for GHC 7.8.3 [1]. Here's where the error message comes from [2]
in Linker.c:

static int verifyCOFFHeader
(COFF_header *hdr, pathchar *fileName)
{
  if (hdr->Machine != 0x8664) {
errorBelch("%" PATH_FMT ": Not x86_64 PEi386", fileName);
return 0;
  }
  ...
}

Ryan S.
-
[1] https://ghc.haskell.org/trac/ghc/ticket/10437
[2] 
https://github.com/ghc/ghc/blob/233d1312bf15940fca5feca6884f965e7944b555/rts/Linker.c#L3355
___
ghc-devs mailing list
ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Window build broken

2015-11-18 Thread Simon Peyton Jones
It’s msys2.  I don’t have Cygwin on this machine.  I have no idea where that 
prompt comes from, but I agree it’s suspicious.

Simon

From: loneti...@gmail.com [mailto:loneti...@gmail.com]
Sent: 17 November 2015 23:44
To: Simon Peyton Jones; David Macek; ghc-devs@haskell.org
Subject: RE: Window build broken

Hi Simon,

I’m wondering what environment you’re coming in, is it msys2? The prompt you 
showed earlier

/cygdrive/c/code/HEAD-1$
Looks like cygwin.

Tamar

From: Simon Peyton Jones
Sent: Wednesday, November 18, 2015 00:25
To: David Macek;ghc-devs@haskell.org
Subject: RE: Window build broken


It says this:

bash$ file libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.0.0.o
libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.0.0.o: PE Unknown PE 
signature 0x742e x86-64 (stripped to external PDB), for MS Windows

| -Original Message-
| From: David Macek [mailto:david.mace...@gmail.com]
| Sent: 17 November 2015 22:45
| To: Simon Peyton Jones <simo...@microsoft.com<mailto:simo...@microsoft.com>>; 
ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>
| Subject: Re: Window build broken
|
| On 17. 11. 2015 23:31, Simon Peyton Jones wrote:
| > Sigh.  My Windows build is broken.  See below.  Any ideas?  The stage2
| complier in non-interactive mode works ok. It’s just ghci fails.  What does
| “Not x86_64 PEi386” mean?  What can I do to fix?
|
| Maybe it's obvious and you already checked, but could it be that the object
| file is for a different architecture? What does `file` say about it?
|
| --
| David Macek

___
ghc-devs mailing list
ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Window build broken

2015-11-18 Thread David Macek
On 18. 11. 2015 9:29, Simon Peyton Jones wrote:
> It’s msys2.  I don’t have Cygwin on this machine.  I have no idea where that 
> prompt comes from, but I agree it’s suspicious. 

Looks like your /etc/fstab is wrong. There should be a line like this one, that 
removes the `cygdrive` prefix from Windows drive/letter mounts:

none / cygdrive binary,posix=0,noacl,user 0 0

-- 
David Macek



smime.p7s
Description: S/MIME Cryptographic Signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Window build broken

2015-11-18 Thread lonetiger

➢  Perhaps it is.  Should I blow it away and re-install?

I’d hold on that this. I have just tried building myself and also hit it.

Taking a closer look, it seems that the .o file being produces isn’t an object 
file but an image file. It contains the standard image headers and a PE 
signature.

GHC is doing the right thing in error out here. I think this is coming from 
D1242, there’s a linker script in there driver/utils/merge_sections.ld that’s 
causing ld on windows to output an image file instead of an object file.

I’m afraid I am not familiar enough with ld to offer a proper fix, but to get 
you working again:

In rules/build-package-way.mk on line 154, remove the “$(if $(filter 
YES,$(LdIsGNULd)),-T $$($1_$2_LD_SCRIPT))” bit.

That should get It working again.

Regards,
Tamar


From: Simon Peyton Jones
Sent: Wednesday, November 18, 2015 14:39
To: Tamar Christina;David Macek;ghc-devs@haskell.org
Subject: RE: Window build broken


|  Presumably Simon didn't change this. Maybe the msys2 install is broken?

Perhaps it is.  Should I blow it away and re-install?

One other difficulty is that (before my machine change) I tried to follow the 
instructions on 
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows to install 
64-bit msys2; but I had a series of problems that Ben G was unable to get to 
the bottom of.  Particularly I could not run bash from emacs; the emacs shell 
window never got as far as a prompt.  So I backed off.  As far as I know that 
is still broken.

I think I have not tried the "32-bit msys2 installer" on that page.  Maybe that 
should be my next step?

Regardless, it's hard to see how any of this concerns the error message I was 
getting.  As lonetiger said, it looks very similar to 
https://ghc.haskell.org/trac/ghc/ticket/10437

What next?

Simon

|  -Original Message-
|  From: Tamar Christina [mailto:loneti...@gmail.com]
|  Sent: 18 November 2015 09:14
|  To: David Macek; Simon Peyton Jones; ghc-devs@haskell.org
|  Subject: RE: Window build broken
|  
|  Hmm,
|  
|  Presumably Simon didn't change this. Maybe the msys2 install is broken?
|  
|  TamarFrom: David Macek
|  Sent: ‎18/‎11/‎2015 09:35
|  To: Simon Peyton Jones; loneti...@gmail.com; ghc-devs@haskell.org
|  Subject: Re: Window build broken
|  On 18. 11. 2015 9:29, Simon Peyton Jones wrote:
|  > It’s msys2.  I don’t have Cygwin on this machine.  I have no idea where
|  that prompt comes from, but I agree it’s suspicious.
|  
|  Looks like your /etc/fstab is wrong. There should be a line like this one,
|  that removes the `cygdrive` prefix from Windows drive/letter
|  mounts:
|  
|  none / cygdrive binary,posix=0,noacl,user 0 0
|  
|  --
|  David Macek


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Window build broken

2015-11-17 Thread Simon Peyton Jones
It says this:

bash$ file libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.0.0.o 
libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.0.0.o: PE Unknown PE 
signature 0x742e x86-64 (stripped to external PDB), for MS Windows

| -Original Message-
| From: David Macek [mailto:david.mace...@gmail.com]
| Sent: 17 November 2015 22:45
| To: Simon Peyton Jones <simo...@microsoft.com>; ghc-devs@haskell.org
| Subject: Re: Window build broken
| 
| On 17. 11. 2015 23:31, Simon Peyton Jones wrote:
| > Sigh.  My Windows build is broken.  See below.  Any ideas?  The stage2
| complier in non-interactive mode works ok. It’s just ghci fails.  What does
| “Not x86_64 PEi386” mean?  What can I do to fix?
| 
| Maybe it's obvious and you already checked, but could it be that the object
| file is for a different architecture? What does `file` say about it?
| 
| --
| David Macek

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Window build broken

2015-11-17 Thread David Macek
On 17. 11. 2015 23:31, Simon Peyton Jones wrote:
> Sigh.  My Windows build is broken.  See below.  Any ideas?  The stage2 
> complier in non-interactive mode works ok. It’s just ghci fails.  What does 
> “Not x86_64 PEi386” mean?  What can I do to fix?

Maybe it's obvious and you already checked, but could it be that the object 
file is for a different architecture? What does `file` say about it?

-- 
David Macek



smime.p7s
Description: S/MIME Cryptographic Signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Window build broken

2015-11-17 Thread Ben Gamari
Simon Peyton Jones  writes:

> Sigh. My Windows build is broken. See below. Any ideas? The stage2
> complier in non-interactive mode works ok. It’s just ghci fails. What
> does “Not x86_64 PEi386” mean? What can I do to fix?
> 
> I should say that my laptop broke so this is a new Windows machine,
> presumably with a slightly different config…
>
Hmm, very interesting. I hope this isn't the result of acce37f38bc3,
which directly touched the Windows linker. Do you have this commit by
any chance?

I'll try to reproduce tomorrow.

Cheers,

- Ben


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Window build broken

2015-11-17 Thread lonetiger
Hi Simon,

I’m wondering what environment you’re coming in, is it msys2? The prompt you 
showed earlier
/cygdrive/c/code/HEAD-1$
Looks like cygwin.

Tamar

From: Simon Peyton Jones
Sent: Wednesday, November 18, 2015 00:25
To: David Macek;ghc-devs@haskell.org
Subject: RE: Window build broken


It says this:

bash$ file libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.0.0.o 
libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.0.0.o: PE Unknown PE 
signature 0x742e x86-64 (stripped to external PDB), for MS Windows

| -Original Message-
| From: David Macek [mailto:david.mace...@gmail.com]
| Sent: 17 November 2015 22:45
| To: Simon Peyton Jones <simo...@microsoft.com>; ghc-devs@haskell.org
| Subject: Re: Window build broken
| 
| On 17. 11. 2015 23:31, Simon Peyton Jones wrote:
| > Sigh.  My Windows build is broken.  See below.  Any ideas?  The stage2
| complier in non-interactive mode works ok. It’s just ghci fails.  What does
| “Not x86_64 PEi386” mean?  What can I do to fix?
| 
| Maybe it's obvious and you already checked, but could it be that the object
| file is for a different architecture? What does `file` say about it?
| 
| --
| David Macek

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Window build broken

2015-11-17 Thread Ryan Scott
Wow, I happened to try building GHC on Windows for the first time ever
today, and I also experienced this error :)

Interestingly, someone reported a very similar error to this on Trac,
but for GHC 7.8.3 [1]. Here's where the error message comes from [2]
in Linker.c:

static int verifyCOFFHeader
(COFF_header *hdr, pathchar *fileName)
{
  if (hdr->Machine != 0x8664) {
errorBelch("%" PATH_FMT ": Not x86_64 PEi386", fileName);
return 0;
  }
  ...
}

Ryan S.
-
[1] https://ghc.haskell.org/trac/ghc/ticket/10437
[2] 
https://github.com/ghc/ghc/blob/233d1312bf15940fca5feca6884f965e7944b555/rts/Linker.c#L3355
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Window build broken

2015-11-17 Thread lonetiger
Well the error is correct, it’s just checking against the machine type in the 
PE spec:

IMAGE_FILE_MACHINE_AMD64
0x8664
x64
So somewhere along the line an invalid PE file was generated (or for the wrong 
architecture).

From: Ryan Scott
Sent: Wednesday, November 18, 2015 00:44
To: ghc-devs@haskell.org
Subject: Re: Window build broken


Wow, I happened to try building GHC on Windows for the first time ever
today, and I also experienced this error :)

Interestingly, someone reported a very similar error to this on Trac,
but for GHC 7.8.3 [1]. Here's where the error message comes from [2]
in Linker.c:

static int verifyCOFFHeader
(COFF_header *hdr, pathchar *fileName)
{
  if (hdr->Machine != 0x8664) {
errorBelch("%" PATH_FMT ": Not x86_64 PEi386", fileName);
return 0;
  }
  ...
}

Ryan S.
-
[1] https://ghc.haskell.org/trac/ghc/ticket/10437
[2] 
https://github.com/ghc/ghc/blob/233d1312bf15940fca5feca6884f965e7944b555/rts/Linker.c#L3355
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs