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/15/13 08:56 PM, Thijs Alkemade wrote:

>
> Op 15 jan. 2013, om 18:16 heeft Karel Gardas<[hidden email]>  het volgende geschreven:
>
>> Well, if you make some board available in DMZ I'm certainly interested to run at least configure on it from GHC HEAD to see what we need to hack in order to add support for RPi into GHC HEAD.
>>
>> Unfortunately GHC HEAD is now in a wrong state w.r.t. LLVM based build, but Austin is working on this. I think I can hack support for RPi in the meantime for testing later on fixed GHC HEAD LLVM build...
>>
>> Karel
>
> This might be helpful, it's a guide to emulate a raspberry pi using qemu, which I was using to (try to) build GHC:
>
> http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/
>
> While I haven't done any real measurements, it seemed somewhat faster too on my machine.

Indeed, that may be the way. The other may be to debootstrap rasbian
into ubuntu chroot on ARMv7 machine for example. I'm curious what
configure will report then, i.e. if this will look really like ARMv6 or
ARMv7 at the end... Also 1 GHz OMAP4 is still faster in executing ARm
code than Qemu/ARM running on my Intel box... :-)

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.

Karel Gardas
In reply to this post by roconnor

Guys,

I've installed raspbian into ubuntu chroot on my panda. Now to simulate
what GHC detects on your hardware, could you be so kind and send me
output of:

uname -m
uname -r
uname -s
uname -v

this looks like a needed info for config.guess to detect machine
hardware well.

Also if you send me output of:

sh config.guess

it would be great.

Everything of course run on your rpi board!

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.

Neil Davies
In reply to this post by roconnor
I looked at that route - the issue is that the emulator only has 256M of RAM (and that's not changeable) - so there are going to be build issues with the GHC tool chain - it was then that I moved to "real" hardware.

Neil

On 15 Jan 2013, at 17:01, [hidden email] wrote:

> On Tue, 15 Jan 2013, Thijs Alkemade wrote:
>
>>
>> Op 15 jan. 2013, om 17:36 heeft [hidden email] het volgende geschreven:
>>
>>> Okay, I tried:
>>>
>>> SRC_HC_OPTS        = -H64m -Rghc-timing -optc-mfloat-abi=hard -optc-march=armv6 -optc-mfpu=vfp -optlc=-mattr=+vfp2
>>> GhcStage1HcOpts    = -O -fllvm
>>> GhcStage2HcOpts    = -O0 -fllvm
>>> GhcLibHcOpts       = -O -fllvm -optlc-float-abi=hard
>>>
>>> and I got the same error at a different build step.  I'm not sure if it is earlier or later.
>>>
>>> It seems still not everything is using the hard-float ABI.
>>>
>>> ===--- building final phase
>>> make -r --no-print-directory -f ghc.mk phase=final all
>>> HC [stage 1] utils/hsc2hs/dist-install/build/tmp/hsc2hs
>>> /usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses VFP register arguments, utils/hsc2hs/dist-install/build/Main.o does not
>>> /usr/bin/ld: failed to merge target specific data of file utils/hsc2hs/dist-install/build/Main.o
>> ...
>>
>> Did you do a `make clean` first? If not, try removing just (some of) the offending .o files, and see if rebuilding just those results in the same error.
>
> I did a make clean first I'm afarid.
>
> --
> 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


_______________________________________________
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
In reply to this post by Karel Gardas
Ok - I'll put up a machine in a DMZ sometime later today (RPi just arrived by post) .

I'll make it available on an non-standard ssh port - I suggest access via ssh-key only.

If you want to email me the appropriate line for .ssh/authorizedkeys please do. If you want to encrypt it with gpg, that's fine - use key id FF677414 ([hidden email])

Neil


On 15 Jan 2013, at 17:16, Karel Gardas <[hidden email]> wrote:


Well, if you make some board available in DMZ I'm certainly interested to run at least configure on it from GHC HEAD to see what we need to hack in order to add support for RPi into GHC HEAD.

Unfortunately GHC HEAD is now in a wrong state w.r.t. LLVM based build, but Austin is working on this. I think I can hack support for RPi in the meantime for testing later on fixed GHC HEAD LLVM build...

Karel

On 01/15/13 06:07 PM, [hidden email] wrote:
In theory we could try a couple variations of builds at the same time.
But at the moment, I'm running low on ideas on what to try.

I just got the, extensive, raspbian patches for 7.4.1 and I'm going to
browse through them when I get time (apt-get source ghc).

On Tue, 15 Jan 2013, Neil Davies wrote:

Hi - would another RPi (or even 2 from tomorrow another one arriving)
help?

I can make them accessible (i.e. in our DMZ) -

Neil

On 15 Jan 2013, at 16:36, [hidden email] wrote:

On Mon, 14 Jan 2013, Thijs Alkemade wrote:

Op 14 jan. 2013, om 17:30 heeft [hidden email] het volgende
geschreven:

On Thu, 10 Jan 2013, Karel Gardas wrote:


Hmm, are you using Raspbian? I.e. hard-float abi caught my eye in
case of ARMv6/ARM11 chip here...

I'm afraid LLVM is not well guided in your case so could you be so
kind and test if adding -optlc=-mattr=+vfp2 helps? You need to add
it to your build.mk probably and you will need to rebuild
everything again...

No change with

SRC_HC_OPTS = -H64m -Rghc-timing -optc-mfloat-abi=hard
-optc-march=armv6 -optc-mfpu=vfp -optlc=-mattr=+vfp2
GhcStage1HcOpts = -O -fllvm
GhcStage2HcOpts = -O0 -fllvm
GhcLibHcOpts = -O -fllvm

I still get the error:

===--- building final phase
make -r --no-print-directory -f ghc.mk phase=final all
LD libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o
/usr/bin/ld: error:
libraries/ghc-prim/dist-install/build/cbits/debug.o uses VFP
register arguments,
libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o does not
/usr/bin/ld: failed to merge target specific data of file
libraries/ghc-prim/dist-install/build/cbits/debug.o

I don't really understand what is going on here. The file
libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o doesn't
even exist, so when I manually run /usr/bin/ld I get:

$ /usr/bin/ld
libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o
/usr/bin/ld: cannot find
libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o: No such
file or directory

What is make really doing here?

My research suggests that this error is a symptom of trying to link
something without the hard-float ABI together with something with a
soft-float ABI. But I don't know where
libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o is
coming from.

libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o is the
output ld was asked to generate. Apparently, some of the input .o
files didn't use VFP register arguments, so ld concluded that the
output should also not use VFP register arguments. But then ld
encountered a .o file that did use VFP register arguments, and threw
an error (something in cbits, so probably built with different CFLAGS).

From your flags I'd say you miss -optlc-float-abi=hard. I had it in
GhcLibHcOpts, but I'm not sure that is the correct way to ensure it
is passed to everything exactly once.

Okay, I tried:

SRC_HC_OPTS = -H64m -Rghc-timing -optc-mfloat-abi=hard
-optc-march=armv6 -optc-mfpu=vfp -optlc=-mattr=+vfp2
GhcStage1HcOpts = -O -fllvm
GhcStage2HcOpts = -O0 -fllvm
GhcLibHcOpts = -O -fllvm -optlc-float-abi=hard

and I got the same error at a different build step. I'm not sure if
it is earlier or later.

It seems still not everything is using the hard-float ABI.

===--- building final phase
make -r --no-print-directory -f ghc.mk phase=final all
HC [stage 1] utils/hsc2hs/dist-install/build/tmp/hsc2hs
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments, utils/hsc2hs/dist-install/build/Main.o does not
/usr/bin/ld: failed to merge target specific data of file
utils/hsc2hs/dist-install/build/Main.o
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments, utils/hsc2hs/dist-install/build/HSCParser.o
does not
/usr/bin/ld: failed to merge target specific data of file
utils/hsc2hs/dist-install/build/HSCParser.o
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
utils/hsc2hs/dist-install/build/DirectCodegen.o does not
/usr/bin/ld: failed to merge target specific data of file
utils/hsc2hs/dist-install/build/DirectCodegen.o
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
utils/hsc2hs/dist-install/build/CrossCodegen.o does not
/usr/bin/ld: failed to merge target specific data of file
utils/hsc2hs/dist-install/build/CrossCodegen.o
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
utils/hsc2hs/dist-install/build/UtilsCodegen.o does not
/usr/bin/ld: failed to merge target specific data of file
utils/hsc2hs/dist-install/build/UtilsCodegen.o
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments, utils/hsc2hs/dist-install/build/Common.o does
not
/usr/bin/ld: failed to merge target specific data of file
utils/hsc2hs/dist-install/build/Common.o
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments, utils/hsc2hs/dist-install/build/C.o does not
/usr/bin/ld: failed to merge target specific data of file
utils/hsc2hs/dist-install/build/C.o
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments, utils/hsc2hs/dist-install/build/Flags.o does not
/usr/bin/ld: failed to merge target specific data of file
utils/hsc2hs/dist-install/build/Flags.o
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
utils/hsc2hs/dist-install/build/Paths_hsc2hs.o does not
/usr/bin/ld: failed to merge target specific data of file
utils/hsc2hs/dist-install/build/Paths_hsc2hs.o
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(Apply.o) does not
/usr/bin/ld: failed to merge target specific data of file
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(Apply.o)
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(Exception.o) does not
/usr/bin/ld: failed to merge target specific data of file
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(Exception.o)
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(HeapStackCheck.o) does not
/usr/bin/ld: failed to merge target specific data of file
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(HeapStackCheck.o)
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(PrimOps.o) does not
/usr/bin/ld: failed to merge target specific data of file
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(PrimOps.o)
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(StgMiscClosures.o) does not
/usr/bin/ld: failed to merge target specific data of file
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(StgMiscClosures.o)
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(StgStartup.o) does not
/usr/bin/ld: failed to merge target specific data of file
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(StgStartup.o)
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(StgStdThunks.o) does not
/usr/bin/ld: failed to merge target specific data of file
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(StgStdThunks.o)
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(Updates.o) does not
/usr/bin/ld: failed to merge target specific data of file
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(Updates.o)
/usr/bin/ld: error: utils/hsc2hs/dist-install/build/tmp/hsc2hs uses
VFP register arguments,
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(AutoApply.o) does not
/usr/bin/ld: failed to merge target specific data of file
/tmp/ghc-7.6.1b/rts/dist/build/libHSrts.a(AutoApply.o)
collect2: ld returned 1 exit status
<<ghc: 10689448 bytes, 2 GCs, 95944/95944 avg/max bytes residency (1
samples), 62M in use, 0.00 INIT (0.00 elapsed), 0.81 MUT (9.41
elapsed), 0.13 GC (0.13 elapsed) :ghc>>
make[1]: *** [utils/hsc2hs/dist-install/build/tmp/hsc2hs] Error 1
make: *** [all] Error 2

--
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





_______________________________________________
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 Wed, 16 Jan 2013, Karel Gardas wrote:

>
> Guys,
>
> I've installed raspbian into ubuntu chroot on my panda. Now to simulate what
> GHC detects on your hardware, could you be so kind and send me output of:
>
> uname -m

armv6l

> uname -r

3.6.11+

> uname -s

Linux

> uname -v

#346 PREEMPT Fri Dec 28 00:50:33 GMT 2012

> this looks like a needed info for config.guess to detect machine hardware
> well.
>
> Also if you send me output of:
>
> sh config.guess

armv6l-unknown-linux-gnueabihf

> it would be great.
>
> Everything of course run on your rpi board!
>
> Thanks,
> Karel

--
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

Good! So the patch I already provided is working fine at least w.r.t.
change in configure. I've tested it here on my raspbian chroot on
pandaboard where I've hacked config.guess to print exactly what you get
on real rpi.

Now, I'm curious if the hack in DriverPipeline.hs helps too.

Were you able to merge the patch into your GHC? And rebuild? What was
the result?

Thanks,
Karel

On 01/16/13 08:02 PM, [hidden email] wrote:

> On Wed, 16 Jan 2013, Karel Gardas wrote:
>
>>
>> Guys,
>>
>> I've installed raspbian into ubuntu chroot on my panda. Now to
>> simulate what GHC detects on your hardware, could you be so kind and
>> send me output of:
>>
>> uname -m
>
> armv6l
>
>> uname -r
>
> 3.6.11+
>
>> uname -s
>
> Linux
>
>> uname -v
>
> #346 PREEMPT Fri Dec 28 00:50:33 GMT 2012
>
>> this looks like a needed info for config.guess to detect machine
>> hardware well.
>>
>> Also if you send me output of:
>>
>> sh config.guess
>
> armv6l-unknown-linux-gnueabihf
>
>> it would be great.
>>
>> Everything of course run on your rpi board!
>>
>> 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 Wed, 16 Jan 2013, Karel Gardas wrote:

>
> Good! So the patch I already provided is working fine at least w.r.t. change
> in configure. I've tested it here on my raspbian chroot on pandaboard where
> I've hacked config.guess to print exactly what you get on real rpi.
>
> Now, I'm curious if the hack in DriverPipeline.hs helps too.
>
> Were you able to merge the patch into your GHC? And rebuild? What was the
> result?

I'm still trying to figure out the correct usage of -optlc-float-abi=hard
in mk/build.mk.  I've ben getting a lot of errors about two occurances of
the float-abi=hard flag.

> Thanks,
> Karel
>
> On 01/16/13 08:02 PM, [hidden email] wrote:
>> On Wed, 16 Jan 2013, Karel Gardas wrote:
>>
>>>
>>> Guys,
>>>
>>> I've installed raspbian into ubuntu chroot on my panda. Now to
>>> simulate what GHC detects on your hardware, could you be so kind and
>>> send me output of:
>>>
>>> uname -m
>>
>> armv6l
>>
>>> uname -r
>>
>> 3.6.11+
>>
>>> uname -s
>>
>> Linux
>>
>>> uname -v
>>
>> #346 PREEMPT Fri Dec 28 00:50:33 GMT 2012
>>
>>> this looks like a needed info for config.guess to detect machine
>>> hardware well.
>>>
>>> Also if you send me output of:
>>>
>>> sh config.guess
>>
>> armv6l-unknown-linux-gnueabihf
>>
>>> it would be great.
>>>
>>> Everything of course run on your rpi board!
>>>
>>> Thanks,
>>> Karel
>>
>

--
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/16/13 08:12 PM, [hidden email] wrote:

> On Wed, 16 Jan 2013, Karel Gardas wrote:
>
>>
>> Good! So the patch I already provided is working fine at least w.r.t.
>> change in configure. I've tested it here on my raspbian chroot on
>> pandaboard where I've hacked config.guess to print exactly what you
>> get on real rpi.
>>
>> Now, I'm curious if the hack in DriverPipeline.hs helps too.
>>
>> Were you able to merge the patch into your GHC? And rebuild? What was
>> the result?
>
> I'm still trying to figure out the correct usage of
> -optlc-float-abi=hard in mk/build.mk. I've ben getting a lot of errors
> about two occurances of the float-abi=hard flag.

You should not IMHO. My patch should solve all your issues. :-) The only
issue you may get is that your distro ghc will compile for soft-float
ABI and your compiled GHC will compile to hard-float and object files
will get mixed somewhere. But I trust your distro ghc builders that this
is not the case so both GHCs should compile using hard-float. So issue
solved, at least should be. Now I'm just waiting if you verify this or
not so I'm either able to submit the patch for inclusion or hack it more...

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 Wed, 16 Jan 2013, Karel Gardas wrote:

> On 01/16/13 08:12 PM, [hidden email] wrote:
>> On Wed, 16 Jan 2013, Karel Gardas wrote:
>>
>>>
>>> Good! So the patch I already provided is working fine at least w.r.t.
>>> change in configure. I've tested it here on my raspbian chroot on
>>> pandaboard where I've hacked config.guess to print exactly what you
>>> get on real rpi.
>>>
>>> Now, I'm curious if the hack in DriverPipeline.hs helps too.
>>>
>>> Were you able to merge the patch into your GHC? And rebuild? What was
>>> the result?
>>
>> I'm still trying to figure out the correct usage of
>> -optlc-float-abi=hard in mk/build.mk. I've ben getting a lot of errors
>> about two occurances of the float-abi=hard flag.
>
> You should not IMHO. My patch should solve all your issues. :-) The only
> issue you may get is that your distro ghc will compile for soft-float ABI and
> your compiled GHC will compile to hard-float and object files will get mixed
> somewhere. But I trust your distro ghc builders that this is not the case so
> both GHCs should compile using hard-float. So issue solved, at least should
> be. Now I'm just waiting if you verify this or not so I'm either able to
> submit the patch for inclusion or hack it more...

The first run of the stage2 compilier fails with a segfault:

   HC [stage 2] utils/ghctags/dist-install/build/Main.o
/bin/sh: line 1: 30064 Segmentation fault      "inplace/bin/ghc-stage2" -H64m -Rghc-timing -optc-mfloat-abi=hard -optc-march=armv6 -optc-mfpu=vfp -optlc=-mattr=+vfp2 -i -iutils/ghctags/. -iutils/ghctags/dist-install/build -iutils/ghctags/dist-install/build/autogen -Iutils/ghctags/dist-install/build -Iutils/ghctags/dist-install/build/autogen -package ghc -no-user-package-db -rtsopts -odir utils/ghctags/dist-install/build -hidir utils/ghctags/dist-install/build -stubdir utils/ghctags/dist-install/build -hisuf hi -osuf o -hcsuf hc -c utils/ghctags/./Main.hs -o utils/ghctags/dist-install/build/Main.o
make[1]: *** [utils/ghctags/dist-install/build/Main.o] Error 139
make: *** [all] Error 2

using

SRC_HC_OPTS        = -H64m -Rghc-timing -optc-mfloat-abi=hard -optc-march=armv6 -optc-mfpu=vfp -optlc=-mattr=+vfp2
GhcStage1HcOpts    = -O -fllvm
GhcStage2HcOpts    = -O0 -fllvm
GhcLibHcOpts       = -O -fllvm

--
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.

Austin Seipp
There have been a few of these bugs recently it seems. If you could:
use the stage1 compiler to compile a simple executable, like 'main =
return ()' or hello world or whatever.

The stage1 compiler can be located in the build directory, under
'inplace/bin/ghc-stage1'. So something like:

<GHC BUILD>/inplace/bin/ghc-stage1 -fforce-recomp hello_world.hs

Check if the output executable crashes immediately. If it does, then
it is likely a miscompilation of the runtime or libraries somewhere.
Otherwise, we'll have to narrow down another way.

If it does fail, please use GDB on the executable, and give a
backtrace from the crash (using the 'bt' command, after the program
has crashed.)

You can also try linking with the debug RTS, by passing the -debug and
-rtsopts flag to ghc-stage1. Then run again, and see if something else
was tripped. You can see all the sanity checks you can enable, if you
run the executable using './program.exe +RTS --help'. The debug flags
are named things like '-Ds' and '-Da', etc and should be passed to the
RTS.

On Thu, Jan 17, 2013 at 1:11 PM,  <[hidden email]> wrote:

> On Wed, 16 Jan 2013, Karel Gardas wrote:
>
>> On 01/16/13 08:12 PM, [hidden email] wrote:
>>>
>>> On Wed, 16 Jan 2013, Karel Gardas wrote:
>>>
>>>>
>>>> Good! So the patch I already provided is working fine at least w.r.t.
>>>> change in configure. I've tested it here on my raspbian chroot on
>>>> pandaboard where I've hacked config.guess to print exactly what you
>>>> get on real rpi.
>>>>
>>>> Now, I'm curious if the hack in DriverPipeline.hs helps too.
>>>>
>>>> Were you able to merge the patch into your GHC? And rebuild? What was
>>>> the result?
>>>
>>>
>>> I'm still trying to figure out the correct usage of
>>> -optlc-float-abi=hard in mk/build.mk. I've ben getting a lot of errors
>>> about two occurances of the float-abi=hard flag.
>>
>>
>> You should not IMHO. My patch should solve all your issues. :-) The only
>> issue you may get is that your distro ghc will compile for soft-float ABI
>> and your compiled GHC will compile to hard-float and object files will get
>> mixed somewhere. But I trust your distro ghc builders that this is not the
>> case so both GHCs should compile using hard-float. So issue solved, at least
>> should be. Now I'm just waiting if you verify this or not so I'm either able
>> to submit the patch for inclusion or hack it more...
>
>
> The first run of the stage2 compilier fails with a segfault:
>
>   HC [stage 2] utils/ghctags/dist-install/build/Main.o
> /bin/sh: line 1: 30064 Segmentation fault      "inplace/bin/ghc-stage2"
> -H64m -Rghc-timing -optc-mfloat-abi=hard -optc-march=armv6 -optc-mfpu=vfp
> -optlc=-mattr=+vfp2 -i -iutils/ghctags/. -iutils/ghctags/dist-install/build
> -iutils/ghctags/dist-install/build/autogen
> -Iutils/ghctags/dist-install/build
> -Iutils/ghctags/dist-install/build/autogen -package ghc -no-user-package-db
> -rtsopts -odir utils/ghctags/dist-install/build -hidir
> utils/ghctags/dist-install/build -stubdir utils/ghctags/dist-install/build
> -hisuf hi -osuf o -hcsuf hc -c utils/ghctags/./Main.hs -o
> utils/ghctags/dist-install/build/Main.o
> make[1]: *** [utils/ghctags/dist-install/build/Main.o] Error 139
>
> make: *** [all] Error 2
>
> using
>
>
> SRC_HC_OPTS        = -H64m -Rghc-timing -optc-mfloat-abi=hard
> -optc-march=armv6 -optc-mfpu=vfp -optlc=-mattr=+vfp2 GhcStage1HcOpts    = -O
> -fllvm GhcStage2HcOpts    = -O0 -fllvm
> GhcLibHcOpts       = -O -fllvm
>
> --
> 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



--
Regards,
Austin

_______________________________________________
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 Thu, 17 Jan 2013, Austin Seipp wrote:

> There have been a few of these bugs recently it seems. If you could:
> use the stage1 compiler to compile a simple executable, like 'main =
> return ()' or hello world or whatever.
>
> The stage1 compiler can be located in the build directory, under
> 'inplace/bin/ghc-stage1'. So something like:
>
> <GHC BUILD>/inplace/bin/ghc-stage1 -fforce-recomp hello_world.hs
>
> Check if the output executable crashes immediately. If it does, then
> it is likely a miscompilation of the runtime or libraries somewhere.
> Otherwise, we'll have to narrow down another way.

$ inplace/bin/ghc-stage1 -fforce-recomp /tmp/Main.hs
[1 of 1] Compiling Main             ( /tmp/Main.hs, /tmp/Main.o )
Linking /tmp/Main ...
$ /tmp/Main
Segmentation fault

> If it does fail, please use GDB on the executable, and give a
> backtrace from the crash (using the 'bt' command, after the program
> has crashed.)

I'll get back to you on this.

> You can also try linking with the debug RTS, by passing the -debug and
> -rtsopts flag to ghc-stage1. Then run again, and see if something else
> was tripped. You can see all the sanity checks you can enable, if you
> run the executable using './program.exe +RTS --help'. The debug flags
> are named things like '-Ds' and '-Da', etc and should be passed to the
> RTS.

--
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
On Thu, 17 Jan 2013, [hidden email] wrote:

> On Thu, 17 Jan 2013, Austin Seipp wrote:
>
>> There have been a few of these bugs recently it seems. If you could:
>> use the stage1 compiler to compile a simple executable, like 'main =
>> return ()' or hello world or whatever.
>>
>> The stage1 compiler can be located in the build directory, under
>> 'inplace/bin/ghc-stage1'. So something like:
>>
>> <GHC BUILD>/inplace/bin/ghc-stage1 -fforce-recomp hello_world.hs
>>
>> Check if the output executable crashes immediately. If it does, then
>> it is likely a miscompilation of the runtime or libraries somewhere.
>> Otherwise, we'll have to narrow down another way.
>
> $ inplace/bin/ghc-stage1 -fforce-recomp /tmp/Main.hs
> [1 of 1] Compiling Main             ( /tmp/Main.hs, /tmp/Main.o )
> Linking /tmp/Main ...
> $ /tmp/Main
> Segmentation fault
>
>> If it does fail, please use GDB on the executable, and give a
>> backtrace from the crash (using the 'bt' command, after the program
>> has crashed.)
>
> I'll get back to you on this.

I don't know much about gdb, but

$ /usr/bin/gdb /tmp/Main
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/Main...done.
(gdb) run
Starting program: /tmp/Main
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x003a732c in stg_returnToStackTop ()
(gdb) quit
A debugging session is active.

         Inferior 1 [process 17097] will be killed.

Quit anyway? (y or n) y

>> You can also try linking with the debug RTS, by passing the -debug and
>> -rtsopts flag to ghc-stage1. Then run again, and see if something else
>> was tripped. You can see all the sanity checks you can enable, if you
>> run the executable using './program.exe +RTS --help'. The debug flags
>> are named things like '-Ds' and '-Da', etc and should be passed to the
>> RTS.
>
>

--
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/18/13 05:49 PM, [hidden email] wrote:

> I don't know much about gdb, but
>
> $ /usr/bin/gdb /tmp/Main
> GNU gdb (GDB) 7.4.1-debian
> Copyright (C) 2012 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "arm-linux-gnueabihf".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /tmp/Main...done.
> (gdb) run
> Starting program: /tmp/Main [Thread debugging using libthread_db enabled]
> Using host libthread_db library
> "/lib/arm-linux-gnueabihf/libthread_db.so.1".
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x003a732c in stg_returnToStackTop ()

And here you need to use `bt' command to show us a call stack which
leads to crash.

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 Fri, 18 Jan 2013, Karel Gardas wrote:

> On 01/18/13 05:49 PM, [hidden email] wrote:
>> I don't know much about gdb, but
>>
>> $ /usr/bin/gdb /tmp/Main
>> GNU gdb (GDB) 7.4.1-debian
>> Copyright (C) 2012 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later
>> <http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
>> and "show warranty" for details.
>> This GDB was configured as "arm-linux-gnueabihf".
>> For bug reporting instructions, please see:
>> <http://www.gnu.org/software/gdb/bugs/>...
>> Reading symbols from /tmp/Main...done.
>> (gdb) run
>> Starting program: /tmp/Main [Thread debugging using libthread_db enabled]
>> Using host libthread_db library
>> "/lib/arm-linux-gnueabihf/libthread_db.so.1".
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x003a732c in stg_returnToStackTop ()
>
> And here you need to use `bt' command to show us a call stack which leads to
> crash.

(gdb) run
Starting program: /tmp/Main
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x003a732c in stg_returnToStackTop ()
(gdb) bt
#0  0x003a732c in stg_returnToStackTop ()
#1  0x0042f6d0 in MainCapability ()
#2  0x0042f6d0 in MainCapability ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) quit

--
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 Wed, 16 Jan 2013, Karel Gardas wrote:

> You should not IMHO. My patch should solve all your issues. :-) The only
> issue you may get is that your distro ghc will compile for soft-float ABI and
> your compiled GHC will compile to hard-float and object files will get mixed
> somewhere. But I trust your distro ghc builders that this is not the case so
> both GHCs should compile using hard-float. So issue solved, at least should
> be. Now I'm just waiting if you verify this or not so I'm either able to
> submit the patch for inclusion or hack it more...

I switched to using llvm-3.0 from rasbian, and made a lot of progress. (In
retrospect I built llvm-3.1 using nix, and it was in a completely
different toolchain than the rest of the build.  I should have known that
it wouldn't work).

I was able to complete the build of ghc-7.6.1 using Karel's patch and

./configure --with-llc=/usr/bin/llc-3.0 --with-opt=/usr/bin/opt-3.0

I was able to make binary-dist after doing

mkdir compiler/stage2/doc

However after unpacking the binary distribution and doing a make install I
get:

Installing library in /tmp/bindist/lib/ghc-7.6.1/ghc-prim-0.3.0.0
ghc-cabal: Failed to read "target arch" value "ArchARM {armISA = ARMv6,
armISAExt = [VFPv2], armABI = }"
make[1]: *** [install_packages] Error 1
make: *** [install] Error 2

And in particular the installed ghc gives the error:

$ bin/ghc
Failed to read "target arch" value "ArchARM {armISA = ARMv6, armISAExt =
[VFPv2], armABI = }"

Sounds to me like Karel's patch is almost, but not quite there.

Karel, maybe you should try deploying a binary-dist on your panda board?

--
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/20/13 07:17 PM, [hidden email] wrote:

> On Wed, 16 Jan 2013, Karel Gardas wrote:
>
>> You should not IMHO. My patch should solve all your issues. :-) The
>> only issue you may get is that your distro ghc will compile for
>> soft-float ABI and your compiled GHC will compile to hard-float and
>> object files will get mixed somewhere. But I trust your distro ghc
>> builders that this is not the case so both GHCs should compile using
>> hard-float. So issue solved, at least should be. Now I'm just waiting
>> if you verify this or not so I'm either able to submit the patch for
>> inclusion or hack it more...
>
> I switched to using llvm-3.0 from rasbian, and made a lot of progress.
> (In retrospect I built llvm-3.1 using nix, and it was in a completely
> different toolchain than the rest of the build. I should have known that
> it wouldn't work).

Ehm, building LLVM on your own is always a risky business. See my
blog[1] for more details especially find the post where I compare
quality of various LLVM builds using various optimization options...

>
> I was able to complete the build of ghc-7.6.1 using Karel's patch and
>
> ./configure --with-llc=/usr/bin/llc-3.0 --with-opt=/usr/bin/opt-3.0
>
> I was able to make binary-dist after doing
>
> mkdir compiler/stage2/doc
>
> However after unpacking the binary distribution and doing a make install
> I get:
>
> Installing library in /tmp/bindist/lib/ghc-7.6.1/ghc-prim-0.3.0.0
> ghc-cabal: Failed to read "target arch" value "ArchARM {armISA = ARMv6,
> armISAExt = [VFPv2], armABI = }"
> make[1]: *** [install_packages] Error 1
> make: *** [install] Error 2
>
> And in particular the installed ghc gives the error:
>
> $ bin/ghc
> Failed to read "target arch" value "ArchARM {armISA = ARMv6, armISAExt =
> [VFPv2], armABI = }"
>
> Sounds to me like Karel's patch is almost, but not quite there.

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}"

That's all what's needed, honestly speaking I don't know why it's
screwed on your board.

> Karel, maybe you should try deploying a binary-dist on your panda board?

Sorry? What's "binary-dist"? And why I should do that? And what exactly
do you mean by "deploying"? And on what OS? Ubuntu or Raspbian run in
Ubuntu chroot?

Karel
[1]: https://ghcarm.wordpress.com/

_______________________________________________
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 07:17 PM, [hidden email] wrote:
>> On Wed, 16 Jan 2013, Karel Gardas wrote:
>>
>>> You should not IMHO. My patch should solve all your issues. :-) The
>>> only issue you may get is that your distro ghc will compile for
>>> soft-float ABI and your compiled GHC will compile to hard-float and
>>> object files will get mixed somewhere. But I trust your distro ghc
>>> builders that this is not the case so both GHCs should compile using
>>> hard-float. So issue solved, at least should be. Now I'm just waiting
>>> if you verify this or not so I'm either able to submit the patch for
>>> inclusion or hack it more...
>>
>> I switched to using llvm-3.0 from rasbian, and made a lot of progress.
>> (In retrospect I built llvm-3.1 using nix, and it was in a completely
>> different toolchain than the rest of the build. I should have known that
>> it wouldn't work).
>
> Ehm, building LLVM on your own is always a risky business. See my blog[1] for
> more details especially find the post where I compare quality of various LLVM
> builds using various optimization options...
>
>>
>> I was able to complete the build of ghc-7.6.1 using Karel's patch and
>>
>> ./configure --with-llc=/usr/bin/llc-3.0 --with-opt=/usr/bin/opt-3.0
>>
>> I was able to make binary-dist after doing
>>
>> mkdir compiler/stage2/doc
>>
>> However after unpacking the binary distribution and doing a make install
>> I get:
>>
>> Installing library in /tmp/bindist/lib/ghc-7.6.1/ghc-prim-0.3.0.0
>> ghc-cabal: Failed to read "target arch" value "ArchARM {armISA = ARMv6,
>> armISAExt = [VFPv2], armABI = }"
>> make[1]: *** [install_packages] Error 1
>> make: *** [install] Error 2
>>
>> And in particular the installed ghc gives the error:
>>
>> $ bin/ghc
>> Failed to read "target arch" value "ArchARM {armISA = ARMv6, armISAExt =
>> [VFPv2], armABI = }"
>>
>> Sounds to me like Karel's patch is almost, but not quite there.
>
> 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}"
>
> That's all what's needed, honestly speaking I don't know why it's screwed on
> your board.
>
>> Karel, maybe you should try deploying a binary-dist on your panda board?
>
> Sorry? What's "binary-dist"? And why I should do that? And what exactly do
> you mean by "deploying"? And on what OS? Ubuntu or Raspbian run in Ubuntu
> chroot?

What I'm suggesting is that if you want to try to reproduce my corrupt
setting file error and ammend your patch for including in GHC, you should
after making ghc-7.6.1 (or whatever version you are building) do a

make binary-dist  # this will product a ghc-7.6.1-arm-unknown-linux.tar.bz2 file

extract ghc-7.6.1-arm-unknown-linux.tar.bz2 in some temporary directory.

in that extracted directory run

./configue --prefix=<some temporary directory>
make install


> Karel
> [1]: https://ghcarm.wordpress.com/
>

--
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/20/13 07:50 PM, [hidden email] wrote:

>>> Karel, maybe you should try deploying a binary-dist on your panda board?
>>
>> Sorry? What's "binary-dist"? And why I should do that? And what
>> exactly do you mean by "deploying"? And on what OS? Ubuntu or Raspbian
>> run in Ubuntu chroot?
>
> What I'm suggesting is that if you want to try to reproduce my corrupt
> setting file error and ammend your patch for including in GHC, you
> should after making ghc-7.6.1 (or whatever version you are building) do a
>
> make binary-dist # this will product a
> ghc-7.6.1-arm-unknown-linux.tar.bz2 file
>
> extract ghc-7.6.1-arm-unknown-linux.tar.bz2 in some temporary directory.
>
> in that extracted directory run
>
> ./configue --prefix=<some temporary directory>
> make install

Aha, I understand, but could you be so kind and first verify that the
settings file you do have inside your build tree is the same exactly
like the settings file distributed with your bin dist? If not, then make
binary-dist is somehow buggy. If yes, then the configure is buggy and
its surprising you've been able to build ghc at all...

Sorry, I cannot test it here as my 7.6.1 build on ARM is already gone
due to hard-drive space constraints here as it freed space for GHC
i386/x64 solaris cross-compilation tests...

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 07:50 PM, [hidden email] wrote:
>>>> Karel, maybe you should try deploying a binary-dist on your panda board?
>>>
>>> Sorry? What's "binary-dist"? And why I should do that? And what
>>> exactly do you mean by "deploying"? And on what OS? Ubuntu or Raspbian
>>> run in Ubuntu chroot?
>>
>> What I'm suggesting is that if you want to try to reproduce my corrupt
>> setting file error and ammend your patch for including in GHC, you
>> should after making ghc-7.6.1 (or whatever version you are building) do a
>>
>> make binary-dist # this will product a
>> ghc-7.6.1-arm-unknown-linux.tar.bz2 file
>>
>> extract ghc-7.6.1-arm-unknown-linux.tar.bz2 in some temporary directory.
>>
>> in that extracted directory run
>>
>> ./configue --prefix=<some temporary directory>
>> make install
>
> Aha, I understand, but could you be so kind and first verify that the
> settings file you do have inside your build tree is the same exactly like the
> settings file distributed with your bin dist? If not, then make binary-dist
> is somehow buggy. If yes, then the configure is buggy and its surprising
> you've been able to build ghc at all...

both the settings and inplace/lib/settings are correct in my build tree.
This suggests taht binary-dist is buggy.

> Sorry, I cannot test it here as my 7.6.1 build on ARM is already gone due to
> hard-drive space constraints here as it freed space for GHC i386/x64 solaris
> cross-compilation tests...
>
> Thanks,
> Karel
>

--
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 07:17 PM, [hidden email] wrote:
>> On Wed, 16 Jan 2013, Karel Gardas wrote:
>>
>>> You should not IMHO. My patch should solve all your issues. :-) The
>>> only issue you may get is that your distro ghc will compile for
>>> soft-float ABI and your compiled GHC will compile to hard-float and
>>> object files will get mixed somewhere. But I trust your distro ghc
>>> builders that this is not the case so both GHCs should compile using
>>> hard-float. So issue solved, at least should be. Now I'm just waiting
>>> if you verify this or not so I'm either able to submit the patch for
>>> inclusion or hack it more...
>>
>> I switched to using llvm-3.0 from rasbian, and made a lot of progress.
>> (In retrospect I built llvm-3.1 using nix, and it was in a completely
>> different toolchain than the rest of the build. I should have known that
>> it wouldn't work).
>
> Ehm, building LLVM on your own is always a risky business. See my blog[1] for
> more details especially find the post where I compare quality of various LLVM
> builds using various optimization options...
>
>>
>> I was able to complete the build of ghc-7.6.1 using Karel's patch and
>>
>> ./configure --with-llc=/usr/bin/llc-3.0 --with-opt=/usr/bin/opt-3.0
>>
>> I was able to make binary-dist after doing
>>
>> mkdir compiler/stage2/doc
>>
>> However after unpacking the binary distribution and doing a make install
>> I get:
>>
>> Installing library in /tmp/bindist/lib/ghc-7.6.1/ghc-prim-0.3.0.0
>> ghc-cabal: Failed to read "target arch" value "ArchARM {armISA = ARMv6,
>> armISAExt = [VFPv2], armABI = }"
>> make[1]: *** [install_packages] Error 1
>> make: *** [install] Error 2
>>
>> And in particular the installed ghc gives the error:
>>
>> $ bin/ghc
>> Failed to read "target arch" value "ArchARM {armISA = ARMv6, armISAExt =
>> [VFPv2], armABI = }"
>>
>> Sounds to me like Karel's patch is almost, but not quite there.
>
> 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.

--
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