Error building ghc on raspberry pi.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
71 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

Karel Gardas
On 01/20/13 08:27 PM, [hidden email] wrote:

>> Looks like you do have corrupted settings file. Recover it by adding
>> "HARD" following "armABI = ", so result should be:
>>
>> ArchARM {armISA = ARMv6, armISAExt = [VFPv2], armABI = HARD}"
>
> Okay, I patched the settings filed generted by ./configure in the
> binary-dist and rank make install which completed. However,
>
> pi@raspberrypi /tmp/bindist $ bin/ghc --make Main.hs
> [1 of 1] Compiling Main ( Main.hs, Main.o )
> Linking Main ...
> pi@raspberrypi /tmp/bindist $ ./Main
> Segmentation fault
> pi@raspberrypi /tmp/bindist $ cat Main.hs
> main = putStrLn "Hello World."
>
> Damn it. So close. I don't know how make install succeded without
> segfaulting.

Sigh! Go back to your build tree and try the same thing with
inplace/bin/ghc-stage2 and let us know if this works or not. BTW: What's
in Main.hs?

Thanks!
Karel


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

roconnor
On Sun, 20 Jan 2013, Karel Gardas wrote:

> On 01/20/13 08:27 PM, [hidden email] wrote:
>>> Looks like you do have corrupted settings file. Recover it by adding
>>> "HARD" following "armABI = ", so result should be:
>>>
>>> ArchARM {armISA = ARMv6, armISAExt = [VFPv2], armABI = HARD}"
>>
>> Okay, I patched the settings filed generted by ./configure in the
>> binary-dist and rank make install which completed. However,
>>
>> pi@raspberrypi /tmp/bindist $ bin/ghc --make Main.hs
>> [1 of 1] Compiling Main ( Main.hs, Main.o )
>> Linking Main ...
>> pi@raspberrypi /tmp/bindist $ ./Main
>> Segmentation fault
>> pi@raspberrypi /tmp/bindist $ cat Main.hs
>> main = putStrLn "Hello World."
>>
>> Damn it. So close. I don't know how make install succeded without
>> segfaulting.
>
> Sigh! Go back to your build tree and try the same thing with
> inplace/bin/ghc-stage2 and let us know if this works or not. BTW: What's in
> Main.hs?

pi@raspberrypi /tmp $ ghc-7.6.1c/inplace/bin/ghc-stage2 Main.hs
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking Main ...
pi@raspberrypi /tmp $ ./Main
Hello World.

The stage2 compiler works fine inplace.

--
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

roconnor
In reply to this post by Karel Gardas
On Sun, 20 Jan 2013, Karel Gardas wrote:

> On 01/20/13 08:27 PM, [hidden email] wrote:
>>> Looks like you do have corrupted settings file. Recover it by adding
>>> "HARD" following "armABI = ", so result should be:
>>>
>>> ArchARM {armISA = ARMv6, armISAExt = [VFPv2], armABI = HARD}"
>>
>> Okay, I patched the settings filed generted by ./configure in the
>> binary-dist and rank make install which completed. However,
>>
>> pi@raspberrypi /tmp/bindist $ bin/ghc --make Main.hs
>> [1 of 1] Compiling Main ( Main.hs, Main.o )
>> Linking Main ...
>> pi@raspberrypi /tmp/bindist $ ./Main
>> Segmentation fault
>> pi@raspberrypi /tmp/bindist $ cat Main.hs
>> main = putStrLn "Hello World."
>>
>> Damn it. So close. I don't know how make install succeded without
>> segfaulting.
>
> Sigh! Go back to your build tree and try the same thing with
> inplace/bin/ghc-stage2 and let us know if this works or not. BTW: What's in
> Main.hs?

Main.hs is

main = putStrLn "Hello World."

--
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

Karel Gardas
In reply to this post by roconnor
On 01/21/13 12:49 AM, [hidden email] wrote:

> On Sun, 20 Jan 2013, Karel Gardas wrote:
>
>>> Okay, I patched the settings filed generted by ./configure in the
>>> binary-dist and rank make install which completed. However,
>>>
>>> pi@raspberrypi /tmp/bindist $ bin/ghc --make Main.hs
>>> [1 of 1] Compiling Main ( Main.hs, Main.o )
>>> Linking Main ...
>>> pi@raspberrypi /tmp/bindist $ ./Main
>>> Segmentation fault
>>> pi@raspberrypi /tmp/bindist $ cat Main.hs
>>> main = putStrLn "Hello World."
>>>
>>> Damn it. So close. I don't know how make install succeded without
>>> segfaulting.
>>
>> Sigh! Go back to your build tree and try the same thing with
>> inplace/bin/ghc-stage2 and let us know if this works or not. BTW:
>> What's in Main.hs?
>
> pi@raspberrypi /tmp $ ghc-7.6.1c/inplace/bin/ghc-stage2 Main.hs
> [1 of 1] Compiling Main ( Main.hs, Main.o )
> Linking Main ...
> pi@raspberrypi /tmp $ ./Main
> Hello World.
>
> The stage2 compiler works fine inplace.

OK, so binary-dist not only corrupted your settings file, but also
somehow your compiler. Nice to see you are able to get working compiler
on your RPi board. Congratulations! :-)

Karel


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

roconnor
On Mon, 21 Jan 2013, Karel Gardas wrote:

> On 01/21/13 12:49 AM, [hidden email] wrote:
>> On Sun, 20 Jan 2013, Karel Gardas wrote:
>>
>>>> Okay, I patched the settings filed generted by ./configure in the
>>>> binary-dist and rank make install which completed. However,
>>>>
>>>> pi@raspberrypi /tmp/bindist $ bin/ghc --make Main.hs
>>>> [1 of 1] Compiling Main ( Main.hs, Main.o )
>>>> Linking Main ...
>>>> pi@raspberrypi /tmp/bindist $ ./Main
>>>> Segmentation fault
>>>> pi@raspberrypi /tmp/bindist $ cat Main.hs
>>>> main = putStrLn "Hello World."
>>>>
>>>> Damn it. So close. I don't know how make install succeded without
>>>> segfaulting.
>>>
>>> Sigh! Go back to your build tree and try the same thing with
>>> inplace/bin/ghc-stage2 and let us know if this works or not. BTW:
>>> What's in Main.hs?
>>
>> pi@raspberrypi /tmp $ ghc-7.6.1c/inplace/bin/ghc-stage2 Main.hs
>> [1 of 1] Compiling Main ( Main.hs, Main.o )
>> Linking Main ...
>> pi@raspberrypi /tmp $ ./Main
>> Hello World.
>>
>> The stage2 compiler works fine inplace.
>
> OK, so binary-dist not only corrupted your settings file, but also somehow
> your compiler. Nice to see you are able to get working compiler on your RPi
> board. Congratulations! :-)

Thanks. :)

So the binary-dist has a settings.in file.  It is the configure step in
the binary-dist that generates the corrupt settings file.

I'll try to poke around to see where and why the stage2 compiler
and the binary-dist compiler differ.

--
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

Karel Gardas
On 01/21/13 04:43 PM, [hidden email] wrote:
> So the binary-dist has a settings.in file. It is the configure step in
> the binary-dist that generates the corrupt settings file.

Perhaps you've forgotten to regenerate bin-dist configure as you did
with build tree configure after applying my patch?

> I'll try to poke around to see where and why the stage2 compiler and the
> binary-dist compiler differ.

Please post your findings here, I'm really curious what is the culprit
here...

Karel



_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

Simon Marlow-7
FYI, I created a wiki page for cross-compiling to Raspberry Pi:

http://hackage.haskell.org/trac/ghc/wiki/Building/Preparation/RaspberryPi

I have an unregisterised build using LLVM working now (it just worked,
modulo the tiny fix for #7622).

Cheers,
        Simon

On 21/01/13 16:06, Karel Gardas wrote:

> On 01/21/13 04:43 PM, [hidden email] wrote:
>> So the binary-dist has a settings.in file. It is the configure step in
>> the binary-dist that generates the corrupt settings file.
>
> Perhaps you've forgotten to regenerate bin-dist configure as you did
> with build tree configure after applying my patch?
>
>> I'll try to poke around to see where and why the stage2 compiler and the
>> binary-dist compiler differ.
>
> Please post your findings here, I'm really curious what is the culprit
> here...
>
> Karel
>
>
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

Neil Davies
Simon

Looking at the wiki - I take it that the stage 1 compiler can now be used as "native" compiler on the RPi? (last line of entry)?

Neil

On 25 Jan 2013, at 10:46, Simon Marlow <[hidden email]> wrote:

> FYI, I created a wiki page for cross-compiling to Raspberry Pi:
>
> http://hackage.haskell.org/trac/ghc/wiki/Building/Preparation/RaspberryPi
>
> I have an unregisterised build using LLVM working now (it just worked, modulo the tiny fix for #7622).
>
> Cheers,
> Simon
>
> On 21/01/13 16:06, Karel Gardas wrote:
>> On 01/21/13 04:43 PM, [hidden email] wrote:
>>> So the binary-dist has a settings.in file. It is the configure step in
>>> the binary-dist that generates the corrupt settings file.
>>
>> Perhaps you've forgotten to regenerate bin-dist configure as you did
>> with build tree configure after applying my patch?
>>
>>> I'll try to poke around to see where and why the stage2 compiler and the
>>> binary-dist compiler differ.
>>
>> Please post your findings here, I'm really curious what is the culprit
>> here...
>>
>> Karel
>>
>>
>>
>> _______________________________________________
>> Glasgow-haskell-users mailing list
>> [hidden email]
>> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

Simon Marlow-7
On 25/01/13 11:23, Neil Davies wrote:
> Simon
>
> Looking at the wiki - I take it that the stage 1 compiler can now be used as "native" compiler on the RPi? (last line of entry)?

Do you mean the stage 2 compiler?  If so yes - in principle.  But in
practice the binary-dist machinery doesn't work properly for
cross-compilers yet, so it's hard to install it on the RPi.  If you have
a shared network filesystem then perhaps 'make install' works, or if you
copy the build tree to your RPi at the same location as your build
machine, then maybe it will work.

Cheers,
        Simon



> Neil
>
> On 25 Jan 2013, at 10:46, Simon Marlow <[hidden email]> wrote:
>
>> FYI, I created a wiki page for cross-compiling to Raspberry Pi:
>>
>> http://hackage.haskell.org/trac/ghc/wiki/Building/Preparation/RaspberryPi
>>
>> I have an unregisterised build using LLVM working now (it just worked, modulo the tiny fix for #7622).
>>
>> Cheers,
>> Simon
>>
>> On 21/01/13 16:06, Karel Gardas wrote:
>>> On 01/21/13 04:43 PM, [hidden email] wrote:
>>>> So the binary-dist has a settings.in file. It is the configure step in
>>>> the binary-dist that generates the corrupt settings file.
>>>
>>> Perhaps you've forgotten to regenerate bin-dist configure as you did
>>> with build tree configure after applying my patch?
>>>
>>>> I'll try to poke around to see where and why the stage2 compiler and the
>>>> binary-dist compiler differ.
>>>
>>> Please post your findings here, I'm really curious what is the culprit
>>> here...
>>>
>>> Karel
>>>
>>>
>>>
>>> _______________________________________________
>>> Glasgow-haskell-users mailing list
>>> [hidden email]
>>> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>>
>>
>> _______________________________________________
>> Glasgow-haskell-users mailing list
>> [hidden email]
>> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

Neil Davies
That's good to hear - we've got AFS and the dev-RPi's are using it…

Neil
On 25 Jan 2013, at 12:20, Simon Marlow <[hidden email]> wrote:

> On 25/01/13 11:23, Neil Davies wrote:
>> Simon
>>
>> Looking at the wiki - I take it that the stage 1 compiler can now be used as "native" compiler on the RPi? (last line of entry)?
>
> Do you mean the stage 2 compiler?  If so yes - in principle.  But in practice the binary-dist machinery doesn't work properly for cross-compilers yet, so it's hard to install it on the RPi.  If you have a shared network filesystem then perhaps 'make install' works, or if you copy the build tree to your RPi at the same location as your build machine, then maybe it will work.
>
> Cheers,
> Simon
>
>
>
>> Neil
>>
>> On 25 Jan 2013, at 10:46, Simon Marlow <[hidden email]> wrote:
>>
>>> FYI, I created a wiki page for cross-compiling to Raspberry Pi:
>>>
>>> http://hackage.haskell.org/trac/ghc/wiki/Building/Preparation/RaspberryPi
>>>
>>> I have an unregisterised build using LLVM working now (it just worked, modulo the tiny fix for #7622).
>>>
>>> Cheers,
>>> Simon
>>>
>>> On 21/01/13 16:06, Karel Gardas wrote:
>>>> On 01/21/13 04:43 PM, [hidden email] wrote:
>>>>> So the binary-dist has a settings.in file. It is the configure step in
>>>>> the binary-dist that generates the corrupt settings file.
>>>>
>>>> Perhaps you've forgotten to regenerate bin-dist configure as you did
>>>> with build tree configure after applying my patch?
>>>>
>>>>> I'll try to poke around to see where and why the stage2 compiler and the
>>>>> binary-dist compiler differ.
>>>>
>>>> Please post your findings here, I'm really curious what is the culprit
>>>> here...
>>>>
>>>> Karel
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Glasgow-haskell-users mailing list
>>>> [hidden email]
>>>> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>>>
>>>
>>> _______________________________________________
>>> Glasgow-haskell-users mailing list
>>> [hidden email]
>>> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>>
>


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building ghc on raspberry pi.

roconnor
In reply to this post by roconnor
On Mon, 21 Jan 2013, [hidden email] wrote:

> On Mon, 21 Jan 2013, Karel Gardas wrote:
>
>> On 01/21/13 12:49 AM, [hidden email] wrote:
>>> On Sun, 20 Jan 2013, Karel Gardas wrote:
>>>
>>>>> Okay, I patched the settings filed generted by ./configure in the
>>>>> binary-dist and rank make install which completed. However,
>>>>>
>>>>> pi@raspberrypi /tmp/bindist $ bin/ghc --make Main.hs
>>>>> [1 of 1] Compiling Main ( Main.hs, Main.o )
>>>>> Linking Main ...
>>>>> pi@raspberrypi /tmp/bindist $ ./Main
>>>>> Segmentation fault
>>>>> pi@raspberrypi /tmp/bindist $ cat Main.hs
>>>>> main = putStrLn "Hello World."
>>>>>
>>>>> Damn it. So close. I don't know how make install succeded without
>>>>> segfaulting.
>>>>
>>>> Sigh! Go back to your build tree and try the same thing with
>>>> inplace/bin/ghc-stage2 and let us know if this works or not. BTW:
>>>> What's in Main.hs?
>>>
>>> pi@raspberrypi /tmp $ ghc-7.6.1c/inplace/bin/ghc-stage2 Main.hs
>>> [1 of 1] Compiling Main ( Main.hs, Main.o )
>>> Linking Main ...
>>> pi@raspberrypi /tmp $ ./Main
>>> Hello World.
>>>
>>> The stage2 compiler works fine inplace.
>>
>> OK, so binary-dist not only corrupted your settings file, but also somehow
>> your compiler. Nice to see you are able to get working compiler on your RPi
>> board. Congratulations! :-)
>
> Thanks. :)
>
> So the binary-dist has a settings.in file.  It is the configure step in the
> binary-dist that generates the corrupt settings file.
>
> I'll try to poke around to see where and why the stage2 compiler and the
> binary-dist compiler differ.

I replaced the lib/ghc-7.6.1/settings built from the binary-dist which
read:

[("GCC extra via C opts", " -fwrapv"),
  ("C compiler command", "/usr/bin/gcc"),
  ("C compiler flags", " -fno-stack-protector "),
  ("ar command", "/usr/bin/ar"),
  ("ar flags", "q"),
  ("ar supports at file", "@ArSupportsAtFile@"),
  ("touch command", "touch"),
  ("dllwrap command", "/bin/false"),
  ("windres command", "/bin/false"),
  ("perl command", "/usr/bin/perl"),
  ("target os", "OSLinux"),
  ("target arch", "ArchARM {armISA = ARMv6, armISAExt = [VFPv2], armABI = HARD}"),
  ("target word size", "4"),
  ("target has GNU nonexec stack", "False"),
  ("target has .ident directive", "True"),
  ("target has subsections via symbols", "False"),
  ("LLVM llc command", "llc"),
  ("LLVM opt command", "opt")
  ]

With the settings file from the build:

[("GCC extra via C opts", " -fwrapv"),
  ("C compiler command", "/usr/bin/gcc"),
  ("C compiler flags", " -fno-stack-protector  -Wl,--hash-size=31 -Wl,--reduce-memory-overheads"),
  ("ar command", "/usr/bin/ar"),
  ("ar flags", "q"),
  ("ar supports at file", "YES"),
  ("touch command", "touch"),
  ("dllwrap command", "/bin/false"),
  ("windres command", "/bin/false"),
  ("perl command", "/usr/bin/perl"),
  ("target os", "OSLinux"),
  ("target arch", "ArchARM {armISA = ARMv6, armISAExt = [VFPv2], armABI = HARD}"),
  ("target word size", "4"),
  ("target has GNU nonexec stack", "False"),
  ("target has .ident directive", "True"),
  ("target has subsections via symbols", "False"),
  ("LLVM llc command", "/usr/bin/llc-3.0"),
  ("LLVM opt command", "/usr/bin/opt-3.0")
  ]

and now ghc builds executables that do not segfault!

It seem that the configure program in the binary-dist needs some patching.

--
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
1234