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
|

Error building ghc on raspberry pi.

roconnor
I'm trying to build ghc-7.4.1 using ghc-7.4.1 on my raspberry pi (armv6l)
and I get the following error:

"inplace/bin/ghc-stage1"   -H32m -O    -package-name ghc-prim-0.2.0.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/dist-install/build -Ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/.    -optP-include -optPlibraries/ghc-prim/dist-install/build/autogen/cabal_macros.h -package rts-1.0  -package-name ghc-prim -XHaskell98 -XCPP -XMagicHash -XForeignFunctionInterface -XUnliftedFFITypes -XUnboxedTuples -XEmptyDataDecls -XNoImplicitPrelude -O2  -no-user-package-conf -rtsopts     -odir libraries/ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist-install/build -stubdir libraries/ghc-prim/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c libraries/ghc-prim/./GHC/Types.hs -o libraries/ghc-prim/dist-install/build/GHC/Types.o
Stack dump:
0.      Program arguments: llc -O3 -relocation-model=static /tmp/ghc6324_0/ghc6324_0.bc -o /tmp/ghc6324_0/ghc6324_0.lm_s
1.      Running pass 'Function Pass Manager' on module '/tmp/ghc6324_0/ghc6324_0.bc'.
2.      Running pass 'ARM Instruction Selection' on function '@ghczmprim_GHCziTypes_Czh_info'
/tmp/ghc6324_0/ghc6324_0.lm_s: openBinaryFile: does not exist (No such file or directory)
make[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1
make: *** [all] Error 2

Anyone have any thoughts on what might be the matter and what I can do to
fix it.  (If only openBinaryFile said which file doesn't exist.)

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

Jeremy Shaw-3
My random guess is that /tmp is mounted using tmpfs (aka a RAM drive)
and it got full. Try remounting /tmp to use the sdcard instead ?

On Wed, Jan 2, 2013 at 7:32 PM,  <[hidden email]> wrote:

> I'm trying to build ghc-7.4.1 using ghc-7.4.1 on my raspberry pi (armv6l)
> and I get the following error:
>
> "inplace/bin/ghc-stage1"   -H32m -O    -package-name ghc-prim-0.2.0.0
> -hide-all-packages -i -ilibraries/ghc-prim/.
> -ilibraries/ghc-prim/dist-install/build
> -ilibraries/ghc-prim/dist-install/build/autogen
> -Ilibraries/ghc-prim/dist-install/build
> -Ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/.
> -optP-include
> -optPlibraries/ghc-prim/dist-install/build/autogen/cabal_macros.h -package
> rts-1.0  -package-name ghc-prim -XHaskell98 -XCPP -XMagicHash
> -XForeignFunctionInterface -XUnliftedFFITypes -XUnboxedTuples
> -XEmptyDataDecls -XNoImplicitPrelude -O2  -no-user-package-conf -rtsopts
> -odir libraries/ghc-prim/dist-install/build -hidir
> libraries/ghc-prim/dist-install/build -stubdir
> libraries/ghc-prim/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c
> libraries/ghc-prim/./GHC/Types.hs -o
> libraries/ghc-prim/dist-install/build/GHC/Types.o
> Stack dump:
> 0.      Program arguments: llc -O3 -relocation-model=static
> /tmp/ghc6324_0/ghc6324_0.bc -o /tmp/ghc6324_0/ghc6324_0.lm_s 1.      Running
> pass 'Function Pass Manager' on module '/tmp/ghc6324_0/ghc6324_0.bc'.
> 2.      Running pass 'ARM Instruction Selection' on function
> '@ghczmprim_GHCziTypes_Czh_info'
> /tmp/ghc6324_0/ghc6324_0.lm_s: openBinaryFile: does not exist (No such file
> or directory)
> make[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1
> make: *** [all] Error 2
>
> Anyone have any thoughts on what might be the matter and what I can do to
> fix it.  (If only openBinaryFile said which file doesn't exist.)
>
> --
> 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
Thanks for your help, but unfortunately this isn't the issue

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       924G  584G  294G  67% /tmp

So there is pleanty of room on temp.

BTW, I also tried building it twice and I got the same error at the same
place.

On Wed, 2 Jan 2013, Jeremy Shaw wrote:

> My random guess is that /tmp is mounted using tmpfs (aka a RAM drive)
> and it got full. Try remounting /tmp to use the sdcard instead ?
>
> On Wed, Jan 2, 2013 at 7:32 PM,  <[hidden email]> wrote:
>> I'm trying to build ghc-7.4.1 using ghc-7.4.1 on my raspberry pi (armv6l)
>> and I get the following error:
>>
>> "inplace/bin/ghc-stage1"   -H32m -O    -package-name ghc-prim-0.2.0.0
>> -hide-all-packages -i -ilibraries/ghc-prim/.
>> -ilibraries/ghc-prim/dist-install/build
>> -ilibraries/ghc-prim/dist-install/build/autogen
>> -Ilibraries/ghc-prim/dist-install/build
>> -Ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/.
>> -optP-include
>> -optPlibraries/ghc-prim/dist-install/build/autogen/cabal_macros.h -package
>> rts-1.0  -package-name ghc-prim -XHaskell98 -XCPP -XMagicHash
>> -XForeignFunctionInterface -XUnliftedFFITypes -XUnboxedTuples
>> -XEmptyDataDecls -XNoImplicitPrelude -O2  -no-user-package-conf -rtsopts
>> -odir libraries/ghc-prim/dist-install/build -hidir
>> libraries/ghc-prim/dist-install/build -stubdir
>> libraries/ghc-prim/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c
>> libraries/ghc-prim/./GHC/Types.hs -o
>> libraries/ghc-prim/dist-install/build/GHC/Types.o
>> Stack dump:
>> 0.      Program arguments: llc -O3 -relocation-model=static
>> /tmp/ghc6324_0/ghc6324_0.bc -o /tmp/ghc6324_0/ghc6324_0.lm_s 1.      Running
>> pass 'Function Pass Manager' on module '/tmp/ghc6324_0/ghc6324_0.bc'.
>> 2.      Running pass 'ARM Instruction Selection' on function
>> '@ghczmprim_GHCziTypes_Czh_info'
>> /tmp/ghc6324_0/ghc6324_0.lm_s: openBinaryFile: does not exist (No such file
>> or directory)
>> make[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1
>> make: *** [all] Error 2
>>
>> Anyone have any thoughts on what might be the matter and what I can do to
>> fix it.  (If only openBinaryFile said which file doesn't exist.)
>>
>> --
>> 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
>

--
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 roconnor
Some further information it seems that llc is segfaulting:

pi@raspberrypi /tmp/ghc-7.4.1 $ llc -O3 -relocation-model=static /tmp/ghc7189_0/ghc7189_0.bc -o /tmp/ghc7189_0/ghc7189_0.lm_s
Stack dump:
0.      Program arguments: llc -O3 -relocation-model=static /tmp/ghc7189_0/ghc7189_0.bc -o /tmp/ghc7189_0/ghc7189_0.lm_s
1.      Running pass 'Function Pass Manager' on module '/tmp/ghc7189_0/ghc7189_0.bc'.
2.      Running pass 'ARM Instruction Selection' on function '@ghczmprim_GHCziTypes_Czh_info'
Segmentation fault
pi@raspberrypi /tmp/ghc-7.4.1 $ llc --version
Low Level Virtual Machine (http://llvm.org/):
   llvm version 3.0
    (Debian 3.0-10)Optimized build.
   Built Jul 26 2012 (20:20:52).
   Host: arm-unknown-linux-gnueabihf
   Host CPU: (unknown)

   Registered Targets:
     alpha    - Alpha [experimental]
     arm      - ARM
     bfin     - Analog Devices Blackfin [experimental]
     c        - C backend
     cellspu  - STI CBEA Cell SPU [experimental]
     cpp      - C++ backend
     mblaze   - MBlaze
     mips     - Mips
     mips64   - Mips64 [experimental]
     mips64el - Mips64el [experimental]
     mipsel   - Mipsel
     msp430   - MSP430 [experimental]
     ppc32    - PowerPC 32
     ppc64    - PowerPC 64
     ptx32    - PTX (32-bit) [Experimental]
     ptx64    - PTX (64-bit) [Experimental]
     sparc    - Sparc
     sparcv9  - Sparc V9
     systemz  - SystemZ
     thumb    - Thumb
     x86      - 32-bit X86: Pentium-Pro and above
     x86-64   - 64-bit X86: EM64T and AMD64
     xcore    - XCore

On Wed, 2 Jan 2013, [hidden email] wrote:

> I'm trying to build ghc-7.4.1 using ghc-7.4.1 on my raspberry pi (armv6l) and
> I get the following error:
>
> "inplace/bin/ghc-stage1"   -H32m -O    -package-name ghc-prim-0.2.0.0
> -hide-all-packages -i -ilibraries/ghc-prim/.
> -ilibraries/ghc-prim/dist-install/build
> -ilibraries/ghc-prim/dist-install/build/autogen
> -Ilibraries/ghc-prim/dist-install/build
> -Ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/.
> -optP-include
> -optPlibraries/ghc-prim/dist-install/build/autogen/cabal_macros.h -package
> rts-1.0  -package-name ghc-prim -XHaskell98 -XCPP -XMagicHash
> -XForeignFunctionInterface -XUnliftedFFITypes -XUnboxedTuples
> -XEmptyDataDecls -XNoImplicitPrelude -O2  -no-user-package-conf -rtsopts
> -odir libraries/ghc-prim/dist-install/build -hidir
> libraries/ghc-prim/dist-install/build -stubdir
> libraries/ghc-prim/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c
> libraries/ghc-prim/./GHC/Types.hs -o
> libraries/ghc-prim/dist-install/build/GHC/Types.o
> Stack dump:
> 0.      Program arguments: llc -O3 -relocation-model=static
> /tmp/ghc6324_0/ghc6324_0.bc -o /tmp/ghc6324_0/ghc6324_0.lm_s 1.      Running
> pass 'Function Pass Manager' on module '/tmp/ghc6324_0/ghc6324_0.bc'.
> 2.      Running pass 'ARM Instruction Selection' on function
> '@ghczmprim_GHCziTypes_Czh_info'
> /tmp/ghc6324_0/ghc6324_0.lm_s: openBinaryFile: does not exist (No such file
> or directory)
> make[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1
> make: *** [all] Error 2
>
> Anyone have any thoughts on what might be the matter and what I can do to fix
> it.  (If only openBinaryFile said which file doesn't exist.)
>
>

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

Thijs Alkemade-2
In reply to this post by roconnor
(Sorry, forgot to CC the list)


-------- Original Message --------
From: Thijs Alkemade <[hidden email]>
Sent: Thu Jan 03 10:31:50 CET 2013
To: [hidden email]
Subject: Re: Error building ghc on raspberry pi.

[hidden email] wrote:

>Some further information it seems that llc is segfaulting:
>
>pi@raspberrypi /tmp/ghc-7.4.1 $ llc -O3 -relocation-model=static
>/tmp/ghc7189_0/ghc7189_0.bc -o /tmp/ghc7189_0/ghc7189_0.lm_s
>Stack dump:
>0.      Program arguments: llc -O3 -relocation-model=static
>/tmp/ghc7189_0/ghc7189_0.bc -o /tmp/ghc7189_0/ghc7189_0.lm_s
>1.      Running pass 'Function Pass Manager' on module
>'/tmp/ghc7189_0/ghc7189_0.bc'.
>2.      Running pass 'ARM Instruction Selection' on function
>'@ghczmprim_GHCziTypes_Czh_info'
>Segmentation fault
>pi@raspberrypi /tmp/ghc-7.4.1 $ llc --version
>Low Level Virtual Machine (http://llvm.org/):
>   llvm version 3.0
>    (Debian 3.0-10)Optimized build.
>   Built Jul 26 2012 (20:20:52).
>   Host: arm-unknown-linux-gnueabihf
>   Host CPU: (unknown)
>
>   Registered Targets:
>     alpha    - Alpha [experimental]
>     arm      - ARM
>     bfin     - Analog Devices Blackfin [experimental]
>     c        - C backend
>     cellspu  - STI CBEA Cell SPU [experimental]
>     cpp      - C++ backend
>     mblaze   - MBlaze
>     mips     - Mips
>     mips64   - Mips64 [experimental]
>     mips64el - Mips64el [experimental]
>     mipsel   - Mipsel
>     msp430   - MSP430 [experimental]
>     ppc32    - PowerPC 32
>     ppc64    - PowerPC 64
>     ptx32    - PTX (32-bit) [Experimental]
>     ptx64    - PTX (64-bit) [Experimental]
>     sparc    - Sparc
>     sparcv9  - Sparc V9
>     systemz  - SystemZ
>     thumb    - Thumb
>     x86      - 32-bit X86: Pentium-Pro and above
>     x86-64   - 64-bit X86: EM64T and AMD64
>     xcore    - XCore
>
>On Wed, 2 Jan 2013, [hidden email] wrote:
>
>> I'm trying to build ghc-7.4.1 using ghc-7.4.1 on my raspberry pi
>(armv6l) and
>> I get the following error:
>>
>> "inplace/bin/ghc-stage1"   -H32m -O    -package-name ghc-prim-0.2.0.0
>
>> -hide-all-packages -i -ilibraries/ghc-prim/.
>> -ilibraries/ghc-prim/dist-install/build
>> -ilibraries/ghc-prim/dist-install/build/autogen
>> -Ilibraries/ghc-prim/dist-install/build
>> -Ilibraries/ghc-prim/dist-install/build/autogen
>-Ilibraries/ghc-prim/.
>> -optP-include
>> -optPlibraries/ghc-prim/dist-install/build/autogen/cabal_macros.h
>-package
>> rts-1.0  -package-name ghc-prim -XHaskell98 -XCPP -XMagicHash
>> -XForeignFunctionInterface -XUnliftedFFITypes -XUnboxedTuples
>> -XEmptyDataDecls -XNoImplicitPrelude -O2  -no-user-package-conf
>-rtsopts
>> -odir libraries/ghc-prim/dist-install/build -hidir
>> libraries/ghc-prim/dist-install/build -stubdir
>> libraries/ghc-prim/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c
>
>> libraries/ghc-prim/./GHC/Types.hs -o
>> libraries/ghc-prim/dist-install/build/GHC/Types.o
>> Stack dump:
>> 0.      Program arguments: llc -O3 -relocation-model=static
>> /tmp/ghc6324_0/ghc6324_0.bc -o /tmp/ghc6324_0/ghc6324_0.lm_s 1.    
>Running
>> pass 'Function Pass Manager' on module '/tmp/ghc6324_0/ghc6324_0.bc'.
>> 2.      Running pass 'ARM Instruction Selection' on function
>> '@ghczmprim_GHCziTypes_Czh_info'
>> /tmp/ghc6324_0/ghc6324_0.lm_s: openBinaryFile: does not exist (No
>such file
>> or directory)
>> make[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o]
>Error 1
>> make: *** [all] Error 2
>>
>> Anyone have any thoughts on what might be the matter and what I can
>do to fix
>> it.  (If only openBinaryFile said which file doesn't exist.)
>>
>>

I believe I had the same problem, which disappeared after upgrading llvm from 3.0 to 3.1, and using that instead for ./configure.

Hope this helps,
Thijs

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

Ben Gamari
In reply to this post by roconnor
[hidden email] writes:

> Some further information it seems that llc is segfaulting:
>
Where did you get your LLVM build from? Did you try running the LLVM
testsuite? IIRC, LLVM 3.0 was less than stellar on ARM.

- Ben


_______________________________________________
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 Thu, 3 Jan 2013, Thijs Alkemade wrote:

> I believe I had the same problem, which disappeared after upgrading llvm from 3.0 to 3.1, and using that instead for ./configure.
>
> Hope this helps,
> Thijs

Thanks, using LLVM 3.1 seems to have improved the siutation, but I'm
running into a new error.

Here is the error I get when trying to build GHC 7.6.1 from 7.4.1

===--- 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
/usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/longlong.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/longlong.o
/usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/popcnt.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/popcnt.o
make[1]: *** [libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o] Error 1

I get similar errors when building GHC 7.4.1 (patched with
http://hackage.haskell.org/trac/ghc/attachment/ticket/5914/0001-add-support-for-ARM-hard-float-ABI-fixes-5914.patch).

Any of you encountered this problem before?

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

Thijs Alkemade-2

Op 8 jan. 2013, om 05:16 heeft [hidden email] het volgende geschreven:

> On Thu, 3 Jan 2013, Thijs Alkemade wrote:
>
>> I believe I had the same problem, which disappeared after upgrading llvm from 3.0 to 3.1, and using that instead for ./configure.
>>
>> Hope this helps,
>> Thijs
>
> Thanks, using LLVM 3.1 seems to have improved the siutation, but I'm running into a new error.
>
> Here is the error I get when trying to build GHC 7.6.1 from 7.4.1
>
> ===--- 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
> /usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/longlong.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/longlong.o
> /usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/popcnt.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/popcnt.o
> make[1]: *** [libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o] Error 1
>
> I get similar errors when building GHC 7.4.1 (patched with http://hackage.haskell.org/trac/ghc/attachment/ticket/5914/0001-add-support-for-ARM-hard-float-ABI-fixes-5914.patch).
>
> Any of you encountered this problem before?
>

Yeah, I had a lot of these. The problem was that GHC has a lot of different "CFLAGS",
so finding the right way to pass "-float-abi=hard" to every one of them took some time, but
eventually I ended up with the following change to mk/build.mk:

ifeq "$(BuildFlavour)" "quick"

SRC_HC_OPTS        = -H64m -O0 -fasm
GhcStage1HcOpts    = -O -fasm
GhcStage2HcOpts    = -O0 -fasm
GhcLibHcOpts       = -O -fasm -optlc-float-abi=hard
SplitObjs          = NO
HADDOCK_DOCS       = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS   = NO
BUILD_DOCBOOK_PDF  = NO

endif

(Change the build flavor you are using, of course)

And I ran configure as:

LDFLAGS="-marm -mfloat-abi=hard -mfpu=vfp" CFLAGS="-marm -mfloat-abi=hard -mfpu=vfp" ./configure --with-opt=/usr/bin/opt-3.1 --with-llc=/usr/bin/llc-3.1 --with-ld=`which ld.gold`

(I switched to the gold linker, because ld was running out of RAM often.)

I did eventually finish building stage2, but the final executable segfaulted on start.
I haven't investigated much why that happened, the days it takes to rebuild it just
made me give up.

Hope this helps,
Thijs
_______________________________________________
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
Thanks for the advice;  However, it had little effect.

I now have the errors:

===--- 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/GHC/PrimopWrappers.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/GHC/PrimopWrappers.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
/usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/longlong.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/longlong.o
/usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/popcnt.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/popcnt.o
make[1]: *** [libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o] Error 1

Anyone else building GHC on a pi?

On Tue, 8 Jan 2013, Thijs Alkemade wrote:

>
> Op 8 jan. 2013, om 05:16 heeft [hidden email] het volgende geschreven:
>
>> On Thu, 3 Jan 2013, Thijs Alkemade wrote:
>>
>>> I believe I had the same problem, which disappeared after upgrading llvm from 3.0 to 3.1, and using that instead for ./configure.
>>>
>>> Hope this helps,
>>> Thijs
>>
>> Thanks, using LLVM 3.1 seems to have improved the siutation, but I'm running into a new error.
>>
>> Here is the error I get when trying to build GHC 7.6.1 from 7.4.1
>>
>> ===--- 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/cjjbits/debug.o
>> /usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/longlong.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/longlong.o
>> /usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/popcnt.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/popcnt.o
>> make[1]: *** [libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o] Error 1
>>
>> I get similar errors when building GHC 7.4.1 (patched with http://hackage.haskell.org/trac/ghc/attachment/ticket/5914/0001-add-support-for-ARM-hard-float-ABI-fixes-5914.patch).
>>
>> Any of you encountered this problem before?
>>
>
> Yeah, I had a lot of these. The problem was that GHC has a lot of different "CFLAGS",
> so finding the right way to pass "-float-abi=hard" to every one of them took some time, but
> eventually I ended up with the following change to mk/build.mk:
>
> ifeq "$(BuildFlavour)" "quick"
>
> SRC_HC_OPTS        = -H64m -O0 -fasm
> GhcStage1HcOpts    = -O -fasm
> GhcStage2HcOpts    = -O0 -fasm
> GhcLibHcOpts       = -O -fasm -optlc-float-abi=hard
> SplitObjs          = NO
> HADDOCK_DOCS       = NO
> BUILD_DOCBOOK_HTML = NO
> BUILD_DOCBOOK_PS   = NO
> BUILD_DOCBOOK_PDF  = NO
>
> endif
>
> (Change the build flavor you are using, of course)
>
> And I ran configure as:
>
> LDFLAGS="-marm -mfloat-abi=hard -mfpu=vfp" CFLAGS="-marm -mfloat-abi=hard -mfpu=vfp" ./configure --with-opt=/usr/bin/opt-3.1 --with-llc=/usr/bin/llc-3.1 --with-ld=`which ld.gold`
>
> (I switched to the gold linker, because ld was running out of RAM often.)
>
> I did eventually finish building stage2, but the final executable segfaulted on start.
> I haven't investigated much why that happened, the days it takes to rebuild it just
> made me give up.
>
> Hope this helps,
> Thijs

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

Hi,

find ghc's generated settings file. What FPU is used there?

Thanks,
Karel

On 01/ 9/13 09:47 PM, [hidden email] wrote:

> Thanks for the advice; However, it had little effect.
>
> I now have the errors:
>
> ===--- 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/GHC/PrimopWrappers.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/GHC/PrimopWrappers.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
> /usr/bin/ld: error:
> libraries/ghc-prim/dist-install/build/cbits/longlong.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/longlong.o
> /usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/popcnt.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/popcnt.o
> make[1]: ***
> [libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o] Error 1
>
> Anyone else building GHC on a pi?
>
> On Tue, 8 Jan 2013, Thijs Alkemade wrote:
>
>>
>> Op 8 jan. 2013, om 05:16 heeft [hidden email] het volgende
>> geschreven:
>>
>>> On Thu, 3 Jan 2013, Thijs Alkemade wrote:
>>>
>>>> I believe I had the same problem, which disappeared after upgrading
>>>> llvm from 3.0 to 3.1, and using that instead for ./configure.
>>>>
>>>> Hope this helps,
>>>> Thijs
>>>
>>> Thanks, using LLVM 3.1 seems to have improved the siutation, but I'm
>>> running into a new error.
>>>
>>> Here is the error I get when trying to build GHC 7.6.1 from 7.4.1
>>>
>>> ===--- 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/cjjbits/debug.o
>>> /usr/bin/ld: error:
>>> libraries/ghc-prim/dist-install/build/cbits/longlong.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/longlong.o
>>> /usr/bin/ld: error:
>>> libraries/ghc-prim/dist-install/build/cbits/popcnt.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/popcnt.o
>>> make[1]: ***
>>> [libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o] Error 1
>>>
>>> I get similar errors when building GHC 7.4.1 (patched with
>>> http://hackage.haskell.org/trac/ghc/attachment/ticket/5914/0001-add-support-for-ARM-hard-float-ABI-fixes-5914.patch).
>>>
>>>
>>> Any of you encountered this problem before?
>>>
>>
>> Yeah, I had a lot of these. The problem was that GHC has a lot of
>> different "CFLAGS",
>> so finding the right way to pass "-float-abi=hard" to every one of
>> them took some time, but
>> eventually I ended up with the following change to mk/build.mk:
>>
>> ifeq "$(BuildFlavour)" "quick"
>>
>> SRC_HC_OPTS = -H64m -O0 -fasm
>> GhcStage1HcOpts = -O -fasm
>> GhcStage2HcOpts = -O0 -fasm
>> GhcLibHcOpts = -O -fasm -optlc-float-abi=hard
>> SplitObjs = NO
>> HADDOCK_DOCS = NO
>> BUILD_DOCBOOK_HTML = NO
>> BUILD_DOCBOOK_PS = NO
>> BUILD_DOCBOOK_PDF = NO
>>
>> endif
>>
>> (Change the build flavor you are using, of course)
>>
>> And I ran configure as:
>>
>> LDFLAGS="-marm -mfloat-abi=hard -mfpu=vfp" CFLAGS="-marm
>> -mfloat-abi=hard -mfpu=vfp" ./configure --with-opt=/usr/bin/opt-3.1
>> --with-llc=/usr/bin/llc-3.1 --with-ld=`which ld.gold`
>>
>> (I switched to the gold linker, because ld was running out of RAM often.)
>>
>> I did eventually finish building stage2, but the final executable
>> segfaulted on start.
>> I haven't investigated much why that happened, the days it takes to
>> rebuild it just
>> made me give up.
>>
>> Hope this helps,
>> Thijs
>


_______________________________________________
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
This is the settingings file:

$ cat settings
[("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 = [], 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", "/home/pi/.nix-profile/bin/llc"),
  ("LLVM opt command", "/home/pi/.nix-profile/bin/opt")
  ]

On Wed, 9 Jan 2013, Karel Gardas wrote:

>
> Hi,
>
> find ghc's generated settings file. What FPU is used there?
>
> Thanks,
> Karel
>
> On 01/ 9/13 09:47 PM, [hidden email] wrote:
>> Thanks for the advice; However, it had little effect.
>>
>> I now have the errors:
>>
>> ===--- 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/GHC/PrimopWrappers.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/GHC/PrimopWrappers.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
>> /usr/bin/ld: error:
>> libraries/ghc-prim/dist-install/build/cbits/longlong.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/longlong.o
>> /usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/popcnt.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/popcnt.o
>> make[1]: ***
>> [libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o] Error 1
>>
>> Anyone else building GHC on a pi?
>>
>> On Tue, 8 Jan 2013, Thijs Alkemade wrote:
>>
>>>
>>> Op 8 jan. 2013, om 05:16 heeft [hidden email] het volgende
>>> geschreven:
>>>
>>>> On Thu, 3 Jan 2013, Thijs Alkemade wrote:
>>>>
>>>>> I believe I had the same problem, which disappeared after upgrading
>>>>> llvm from 3.0 to 3.1, and using that instead for ./configure.
>>>>>
>>>>> Hope this helps,
>>>>> Thijs
>>>>
>>>> Thanks, using LLVM 3.1 seems to have improved the siutation, but I'm
>>>> running into a new error.
>>>>
>>>> Here is the error I get when trying to build GHC 7.6.1 from 7.4.1
>>>>
>>>> ===--- 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/cjjbits/debug.o
>>>> /usr/bin/ld: error:
>>>> libraries/ghc-prim/dist-install/build/cbits/longlong.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/longlong.o
>>>> /usr/bin/ld: error:
>>>> libraries/ghc-prim/dist-install/build/cbits/popcnt.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/popcnt.o
>>>> make[1]: ***
>>>> [libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o] Error 1
>>>>
>>>> I get similar errors when building GHC 7.4.1 (patched with
>>>> http://hackage.haskell.org/trac/ghc/attachment/ticket/5914/0001-add-support-for-ARM-hard-float-ABI-fixes-5914.patch).
>>>>
>>>>
>>>> Any of you encountered this problem before?
>>>>
>>>
>>> Yeah, I had a lot of these. The problem was that GHC has a lot of
>>> different "CFLAGS",
>>> so finding the right way to pass "-float-abi=hard" to every one of
>>> them took some time, but
>>> eventually I ended up with the following change to mk/build.mk:
>>>
>>> ifeq "$(BuildFlavour)" "quick"
>>>
>>> SRC_HC_OPTS = -H64m -O0 -fasm
>>> GhcStage1HcOpts = -O -fasm
>>> GhcStage2HcOpts = -O0 -fasm
>>> GhcLibHcOpts = -O -fasm -optlc-float-abi=hard
>>> SplitObjs = NO
>>> HADDOCK_DOCS = NO
>>> BUILD_DOCBOOK_HTML = NO
>>> BUILD_DOCBOOK_PS = NO
>>> BUILD_DOCBOOK_PDF = NO
>>>
>>> endif
>>>
>>> (Change the build flavor you are using, of course)
>>>
>>> And I ran configure as:
>>>
>>> LDFLAGS="-marm -mfloat-abi=hard -mfpu=vfp" CFLAGS="-marm
>>> -mfloat-abi=hard -mfpu=vfp" ./configure --with-opt=/usr/bin/opt-3.1
>>> --with-llc=/usr/bin/llc-3.1 --with-ld=`which ld.gold`
>>>
>>> (I switched to the gold linker, because ld was running out of RAM often.)
>>>
>>> I did eventually finish building stage2, but the final executable
>>> segfaulted on start.
>>> I haven't investigated much why that happened, the days it takes to
>>> rebuild it just
>>> made me give up.
>>>
>>> Hope this helps,
>>> Thijs
>>
>

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

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

Cheers,
Karel

On 01/10/13 03:11 AM, [hidden email] wrote:

> This is the settingings file:
>
> $ cat settings
> [("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 = [], 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", "/home/pi/.nix-profile/bin/llc"),
> ("LLVM opt command", "/home/pi/.nix-profile/bin/opt")
> ]
>
> On Wed, 9 Jan 2013, Karel Gardas wrote:
>
>>
>> Hi,
>>
>> find ghc's generated settings file. What FPU is used there?
>>
>> Thanks,
>> Karel
>>
>> On 01/ 9/13 09:47 PM, [hidden email] wrote:
>>> Thanks for the advice; However, it had little effect.
>>>
>>> I now have the errors:
>>>
>>> ===--- 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/GHC/PrimopWrappers.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/GHC/PrimopWrappers.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
>>> /usr/bin/ld: error:
>>> libraries/ghc-prim/dist-install/build/cbits/longlong.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/longlong.o
>>> /usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/popcnt.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/popcnt.o
>>> make[1]: ***
>>> [libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o] Error 1
>>>
>>> Anyone else building GHC on a pi?
>>>
>>> On Tue, 8 Jan 2013, Thijs Alkemade wrote:
>>>
>>>>
>>>> Op 8 jan. 2013, om 05:16 heeft [hidden email] het volgende
>>>> geschreven:
>>>>
>>>>> On Thu, 3 Jan 2013, Thijs Alkemade wrote:
>>>>>
>>>>>> I believe I had the same problem, which disappeared after upgrading
>>>>>> llvm from 3.0 to 3.1, and using that instead for ./configure.
>>>>>>
>>>>>> Hope this helps,
>>>>>> Thijs
>>>>>
>>>>> Thanks, using LLVM 3.1 seems to have improved the siutation, but I'm
>>>>> running into a new error.
>>>>>
>>>>> Here is the error I get when trying to build GHC 7.6.1 from 7.4.1
>>>>>
>>>>> ===--- 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/cjjbits/debug.o
>>>>> /usr/bin/ld: error:
>>>>> libraries/ghc-prim/dist-install/build/cbits/longlong.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/longlong.o
>>>>> /usr/bin/ld: error:
>>>>> libraries/ghc-prim/dist-install/build/cbits/popcnt.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/popcnt.o
>>>>> make[1]: ***
>>>>> [libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o] Error 1
>>>>>
>>>>> I get similar errors when building GHC 7.4.1 (patched with
>>>>> http://hackage.haskell.org/trac/ghc/attachment/ticket/5914/0001-add-support-for-ARM-hard-float-ABI-fixes-5914.patch).
>>>>>
>>>>>
>>>>>
>>>>> Any of you encountered this problem before?
>>>>>
>>>>
>>>> Yeah, I had a lot of these. The problem was that GHC has a lot of
>>>> different "CFLAGS",
>>>> so finding the right way to pass "-float-abi=hard" to every one of
>>>> them took some time, but
>>>> eventually I ended up with the following change to mk/build.mk:
>>>>
>>>> ifeq "$(BuildFlavour)" "quick"
>>>>
>>>> SRC_HC_OPTS = -H64m -O0 -fasm
>>>> GhcStage1HcOpts = -O -fasm
>>>> GhcStage2HcOpts = -O0 -fasm
>>>> GhcLibHcOpts = -O -fasm -optlc-float-abi=hard
>>>> SplitObjs = NO
>>>> HADDOCK_DOCS = NO
>>>> BUILD_DOCBOOK_HTML = NO
>>>> BUILD_DOCBOOK_PS = NO
>>>> BUILD_DOCBOOK_PDF = NO
>>>>
>>>> endif
>>>>
>>>> (Change the build flavor you are using, of course)
>>>>
>>>> And I ran configure as:
>>>>
>>>> LDFLAGS="-marm -mfloat-abi=hard -mfpu=vfp" CFLAGS="-marm
>>>> -mfloat-abi=hard -mfpu=vfp" ./configure --with-opt=/usr/bin/opt-3.1
>>>> --with-llc=/usr/bin/llc-3.1 --with-ld=`which ld.gold`
>>>>
>>>> (I switched to the gold linker, because ld was running out of RAM
>>>> often.)
>>>>
>>>> I did eventually finish building stage2, but the final executable
>>>> segfaulted on start.
>>>> I haven't investigated much why that happened, the days it takes to
>>>> rebuild it just
>>>> made me give up.
>>>>
>>>> Hope this helps,
>>>> Thijs
>>>
>>
>


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

Add it to the GhcLibHcOpts?

> Cheers,
> 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/11/13 09:25 PM, [hidden email] wrote:

> 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...
>
> Add it to the GhcLibHcOpts?

Probably too, I'm not the expert here, just make sure you use this
option for any ghc invocation which invokes llc to get consistent vfp
usage in your object files...

Once you test it and if succeed we can hack ghc to support it.

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
Hi

I've found myself wanting to get GHC 7.4.2 (need TemplateHaskell for something) working on the rapberry pi - can you (or anyone out there) share where you are at?

My starting point is the raspian image of 2012-12-18-wheezy-raspian that has GHC 7.4.1 on it...

Neil

On 11 Jan 2013, at 20:25, [hidden email] wrote:

> 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...
>
> Add it to the GhcLibHcOpts?
>
>> Cheers,
>> 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


_______________________________________________
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
I've tried to build 6.12.3, 7.4.1, 7.4.2, and 7.6.1, with a few various
patches, and I'm stuck in the final stage with errors like:

/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

I'm rebuilding with Karel's latest suggestion now.


On Sat, 12 Jan 2013, Neil Davies wrote:

> Hi
>
> I've found myself wanting to get GHC 7.4.2 (need TemplateHaskell for something) working on the rapberry pi - can you (or anyone out there) share where you are at?
>
> My starting point is the raspian image of 2012-12-18-wheezy-raspian that has GHC 7.4.1 on it...
>
> Neil
>
> On 11 Jan 2013, at 20:25, [hidden email] wrote:
>
>> 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...
>>
>> Add it to the GhcLibHcOpts?
>>
>>> Cheers,
>>> 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
>

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

Neil Davies
If there is anything useful I can do - shout.

Given the time it takes to do each rebuild on a raspberry pi - this is real dedication!

Neil

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

> I've tried to build 6.12.3, 7.4.1, 7.4.2, and 7.6.1, with a few various patches, and I'm stuck in the final stage with errors like:
>
> /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
>
> I'm rebuilding with Karel's latest suggestion now.
>
>
> On Sat, 12 Jan 2013, Neil Davies wrote:
>
>> Hi
>>
>> I've found myself wanting to get GHC 7.4.2 (need TemplateHaskell for something) working on the rapberry pi - can you (or anyone out there) share where you are at?
>>
>> My starting point is the raspian image of 2012-12-18-wheezy-raspian that has GHC 7.4.1 on it...
>>
>> Neil
>>
>> On 11 Jan 2013, at 20:25, [hidden email] wrote:
>>
>>> 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...
>>>
>>> Add it to the GhcLibHcOpts?
>>>
>>>> Cheers,
>>>> 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
>>
>
> --
> 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.

Ben Gamari
In reply to this post by Karel Gardas
Karel Gardas <[hidden email]> writes:

> On 01/11/13 09:25 PM, [hidden email] wrote:
>> 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...
>>
>> Add it to the GhcLibHcOpts?
>
> Probably too, I'm not the expert here, just make sure you use this
> option for any ghc invocation which invokes llc to get consistent vfp
> usage in your object files...
>
I've been struggling with this class of error recently as well.

After several failed builds I arrived at the following on my Pandaboard,

    SRC_HC_OPTS = -H64m -Rghc-timing -optc-mfloat-abi=hard -optc-mcpu=cortex-a9 -optlc-float-abi=hard -optlc-mcpu=cortex-a9

I've found it's best to set both gcc and llc arguments as they tend to
disagree when you least expect it. I'm not sure whether SRC_HC_OPTS is
too large a hammer, but it seems to work for me.

Cheers,

- Ben


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

Done.  What would you like to see?

--
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 Sat, 12 Jan 2013, [hidden email] wrote:

> 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...
>
> Done.  What would you like to see?

Wait, never mind, I somehow failed to apply your option during the build.
I will try again.

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