Re: Error building ghc on raspberry pi.

2013-01-09 Thread 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 rocon...@theorem.ca 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  
``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
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Error building ghc on raspberry pi.

2013-01-09 Thread Karel Gardas


Hi,

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

Thanks,
Karel

On 01/ 9/13 09:47 PM, rocon...@theorem.ca 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 rocon...@theorem.ca 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
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


(mips64el) Cross-building GHC

2013-01-09 Thread jugree
Hello.

I would like to port GHC to mips64el. I have never tried
cross-building before. So I will probably post more questions later.

Actually, I am not sure that I am using the right term. I am going to
use my i686 machine to build GHC for mips64el. In terms of this
page(0):

B = i686-unknown-linux
H = mips64el-unknown-linux
T = mips64el-unknown-linux

Is the above correct?

What I did:

1. Downloaded this(1) tarball (on i686) and unpacked it.
2. Executed the following commands(2):

ghc-7.6.1$ cp /bin/pwd utils/ghc-pwd/ghc-pwd
ghc-7.6.1$ perl boot
ghc-7.6.1$ ./configure --enable-hc-boot --build=i686-unknown-linux
--host=mips64el-unknown-linux --target=mips64el-unknown-linux

Output:

checking for gfind... no
checking for find... /usr/bin/find
checking for sort... /usr/bin/sort
checking for ghc... /usr/bin/ghc
checking version of ghc... 6.12.1
checking build system type... i686-unknown-linux-gnu
checking host system type... mips64el-unknown-linux-gnu
checking target system type... mips64el-unknown-linux-gnu
HOST: mips64el-unknown-linux-gnu
GHC build  : i386-unknown-linux
GHC host   : mips-unknown-linux
GHC target : mips-unknown-linux
configure: Building in-tree ghc-pwd
ghc: unrecognised flags: -no-user-
Usage: For basic information, try the `--help' option.
configure: error: Building ghc-pwd failed

/ghc-7.6.1$ grep "no-user" ./*
./aclocal.m4:if ! "$WithGhc" -v0 -no-user-$GHC_PACKAGE_DB_FLAG -hidir
utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir
utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o
utils/ghc-pwd/dist-boot/ghc-pwd
./configure:if ! "$WithGhc" -v0 -no-user-$GHC_PACKAGE_DB_FLAG -hidir
utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir
utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o
utils/ghc-pwd/dist-boot/ghc-pwd

How can I fix this? I can't find any information about this option.

Thank you.

PS: I only use free software (as defined by the FSF). Can I be sure
that I won't install any non-free programs during the process?

(0) http://hackage.haskell.org/trac/ghc/wiki/CrossCompilation
(1) http://www.haskell.org/ghc/dist/7.6.1/ghc-7.6.1-src.tar.bz2
(2) http://hackage.haskell.org/trac/ghc/wiki/Building/Porting



___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: (mips64el) Cross-building GHC

2013-01-09 Thread Stephen Paul Weber

Somebody claiming to be jug...@lavabit.com wrote:

I would like to port GHC to mips64el. I have never tried
cross-building before. So I will probably post more questions later.


Awesome.  I have a MIPS-based netbook (lemote yeelong thing) and got the GHC 
port from Debian on it, but of course it's a just-barely-works build :)


--
Stephen Paul Weber, @singpolyma
See  for how I prefer to be contacted
edition right joseph


signature.asc
Description: Digital signature
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Error building ghc on raspberry pi.

2013-01-09 Thread 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, rocon...@theorem.ca 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 rocon...@theorem.ca 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-ll