Re: trouble building ghc-7.4 on Fedora 18 (devel) ARM

2012-05-04 Thread Jens Petersen
A late followup, just to let you know, everything is good now.

> Not sure if +d16 is actually essential on Fedora though guess it doesn't hurt.

It is... I hope llvm will make it the default for armv7 hardware fp.

So finally ghc-7.4.1 is built for Fedora ARM and working:
I also had to forward-port my pkgconfig libffi workaround for
non-native compiler archs to help the C compiler find libffi.h when
building prof libraries.

http://arm.koji.fedoraproject.org/koji/buildinfo?buildID=66294

Thanks for everyone's help and particular big kudos and karma
to those who did the heavy-lifting on the ARM port for 7.4.
Maybe someone has some proper benchmarks
but roughly going by the ghc-7.4.1 build it seems over
twice as fast as 7.0.4. :-))

Jens

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


Re: trouble building ghc-7.4 on Fedora 18 (devel) ARM

2012-04-26 Thread Jens Petersen
Thanks Joachim, Jani and Karel,

Very helpful :)

I managed to get access to a Fedora armv7hl box,
and running "ghc -v" there on an offending file I saw the argument to llc was:

llc -O3 -relocation-model=static /tmp/ghc3749_0/ghc3749_0.bc -o
/tmp/ghc3749_0/ghc3749_0.lm_s -mattr=+v7,+vfp3

which is not the expected one:  -mattr=+v7,+vfp3,+d16 [-float-abi=hard].
ie the patched line is not the one getting applied...

(It seems to me it would be better to fix llvm though?  Maybe it is
already upstream??)

Anyway sorry  it seems the reason for the above is that I
forget to run aclocal! :-(

Not sure if +d16 is actually essential on Fedora though guess it doesn't hurt.

Karel, I will try to test your patch later.

Thanks
Jens

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


Re: trouble building ghc-7.4 on Fedora 18 (devel) ARM

2012-04-25 Thread Karel Gardas


Hi,

I've just attached my fix for hard-float ABI build failure on GHC HEAD 
to the #5914.


I would be more than glad if you can attempt to merge it to 7.4.x you 
are packaging and test if it works for you on both soft and hard float 
ABI. Hard seems to be preferred these days at least on Linux...


If you keep me posted about this either by email or by adding info to 
bug above, I would really appreciate it.


Once you verify the fix is working on 7.4.x I'll push it for inclusion 
on HEAD even I'm not able to bootstrap it fully (see #6043) and from 
HEAD it will be merged hopefully to 7.4.x branch to easy your packaging 
job...


Thanks!
Karel

On 04/24/12 02:28 PM, Joachim Breitner wrote:

Hi,

Am Dienstag, den 24.04.2012, 19:50 +0900 schrieb Jens Petersen:

- debian/patches/armhf_llvm_abi: Pass -float-abi=hard to llc on armhf if
  __ARM_PCS_VFP is defined (needs to be preprocessed for this)
- debian/rules: Define __ARM_PCS_VFP on armhf for the above patch.

you might need to set __ARM_PCS_VFP. This is the code in debian/rules:


Thanks Joachim for catching this!

Hmm, perhaps I am being really stupid, but even after that
the build still fails in exactly the same way.  I am kind of stumped...

http://arm.koji.fedoraproject.org/koji/getfile?taskID=755369&name=build.log
http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=755369

(the armv5tel seems to be ok so far afaict)


no idea, but I’m CC’ing people knowing more about the ARM port (Karel
and Jani), maybe they can help you.

Greetings,
Joachim




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


Re: trouble building ghc-7.4 on Fedora 18 (devel) ARM

2012-04-24 Thread Joachim Breitner
Hi,

Am Dienstag, den 24.04.2012, 19:50 +0900 schrieb Jens Petersen:
> >- debian/patches/armhf_llvm_abi: Pass -float-abi=hard to llc on armhf if
> >  __ARM_PCS_VFP is defined (needs to be preprocessed for this)
> >- debian/rules: Define __ARM_PCS_VFP on armhf for the above patch.
> >
> > you might need to set __ARM_PCS_VFP. This is the code in debian/rules:
> 
> Thanks Joachim for catching this!
> 
> Hmm, perhaps I am being really stupid, but even after that
> the build still fails in exactly the same way.  I am kind of stumped...
> 
> http://arm.koji.fedoraproject.org/koji/getfile?taskID=755369&name=build.log
> http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=755369
> 
> (the armv5tel seems to be ok so far afaict)

no idea, but I’m CC’ing people knowing more about the ARM port (Karel
and Jani), maybe they can help you.

Greetings,
Joachim

-- 
Joachim "nomeata" Breitner
Debian Developer
  nome...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nome...@joachim-breitner.de | http://people.debian.org/~nomeata


signature.asc
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: trouble building ghc-7.4 on Fedora 18 (devel) ARM

2012-04-24 Thread Jens Petersen
>    - debian/patches/armhf_llvm_abi: Pass -float-abi=hard to llc on armhf if
>      __ARM_PCS_VFP is defined (needs to be preprocessed for this)
>    - debian/rules: Define __ARM_PCS_VFP on armhf for the above patch.
>
> you might need to set __ARM_PCS_VFP. This is the code in debian/rules:

Thanks Joachim for catching this!

Hmm, perhaps I am being really stupid, but even after that
the build still fails in exactly the same way.  I am kind of stumped...

http://arm.koji.fedoraproject.org/koji/getfile?taskID=755369&name=build.log
http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=755369

(the armv5tel seems to be ok so far afaict)

Jens

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


Re: trouble building ghc-7.4 on Fedora 18 (devel) ARM

2012-04-22 Thread Joachim Breitner
Hi Jens,

Am Sonntag, den 22.04.2012, 17:19 +0900 schrieb Jens Petersen:
> Anyway thoughts on how to proceed?

the error message looks as if you are actually building on what Debian
calls armhf, with hard floating point support. According to the Debian
changelog:

ghc (7.4.1-2) unstable; urgency=low

  [ Iain Lane ]

  * Two new patches (backported by Iulian Udrea) to fix armel build
failures. See upstream bug #5824.
- fix-ARM-s-StgCRun-clobbered-register-list-for-both-A
- fix-ARM-StgCRun-to-not-save-and-restore-r11-fp-regis
  * Use dh_autoreconf{,_clean} to autoreconf, mainly so we can have proper
clean support. 
  * armhf support (thanks to Jani Monoses):
- debian/patches/ARM-VFPv3D16: Use vfp3-d16 FPU for ARM builds.
- debian/patches/armhf_llvm_abi: Pass -float-abi=hard to llc on armhf if
  __ARM_PCS_VFP is defined (needs to be preprocessed for this)
- debian/rules: Define __ARM_PCS_VFP on armhf for the above patch.

you might need to set __ARM_PCS_VFP. This is the code in debian/rules:

ifeq (armhf,$(DEB_HOST_ARCH))
echo "SRC_HC_OPTS += -D__ARM_PCS_VFP" >> mk/build.mk
endif


It seems that these patches, or rather the fixes, were already submitted
upstream, but need more cleanup
(http://hackage.haskell.org/trac/ghc/ticket/5914)

FTR, here are the patches:
http://patch-tracker.debian.org/patch/series/view/ghc/7.4.1-2/ARM-VFPv3D16
http://patch-tracker.debian.org/patch/series/view/ghc/7.4.1-2/armhf_llvm_abi

Greetings,
Joachim

-- 
Joachim "nomeata" Breitner
Debian Developer
  nome...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nome...@joachim-breitner.de | http://people.debian.org/~nomeata


signature.asc
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


trouble building ghc-7.4 on Fedora 18 (devel) ARM

2012-04-22 Thread Jens Petersen
Hi,

I have been struggling to build ghc74 on ARM (ideally with llvm3) on
Fedora 18 (the current development tree).

After applying 4 recent ARM patches from Debian the ghc-7.4.1 build gets to:

:
"inplace/bin/ghc-stage1"   -H32m -O-package-name base-4.5.0.0
-hide-all-packages -i -ilibraries/base/.
-ilibraries/base/dist-install/build
-ilibraries/base/dist-install/build/autogen
-Ilibraries/base/dist-install/build
-Ilibraries/base/dist-install/build/autogen -Ilibraries/base/include
-optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include
-optPlibraries/base/dist-install/build/autogen/cabal_macros.h -package
ghc-prim-0.2.0.0 -package integer-gmp-0.4.0.0 -package rts-1.0
-package-name base -XHaskell98 -XCPP -O2  -no-user-package-conf
-rtsopts -odir libraries/base/dist-install/build -hidir
libraries/base/dist-install/build -stubdir
libraries/base/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c
libraries/base/dist-install/build/GHC/Event/Clock.hs -o
libraries/base/dist-install/build/GHC/Event/Clock.o
[parallel build line removed]
/usr/bin/ld: error: /tmp/ghc5703_0/ghc5703_0.o uses VFP register
arguments, libraries/base/dist-install/build/GHC/Event/Clock.o does
not
/usr/bin/ld: failed to merge target specific data of file
/tmp/ghc5703_0/ghc5703_0.o
collect2: error: ld returned 1 exit status
make[1]: *** [libraries/base/dist-install/build/GHC/Event/Clock.o] Error 1

(full build log at:
http://arm.koji.fedoraproject.org/koji/getfile?taskID=723311&name=build.log
and more details at
http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=723311)

I gather that it builds on Debian so I am not quite why it is failing on Fedora.

To see if ghc-7.4.2pre is any better I tried building
ghc-7.4.1.20120416 too (without any ARM patches),
which gets a lot further, to using llvm:

"inplace/bin/ghc-stage1"   -H32m -O-package-name array-0.4.0.0
-hide-all-packages -i -ilibraries/array/.
-ilibraries/array/dist-install/build
-ilibraries/array/dist-install/build/autogen
-Ilibraries/array/dist-install/build
-Ilibraries/array/dist-install/build/autogen -Ilibraries/array/include
   -optP-include
-optPlibraries/array/dist-install/build/autogen/cabal_macros.h
-package base-4.5.1.0  -XHaskell98 -XMultiParamTypeClasses
-XFlexibleContexts -XFlexibleInstances -XTypeSynonymInstances
-XDeriveDataTypeable -XStandaloneDeriving -XRank2Types -XMagicHash
-XUnboxedTuples -XForeignFunctionInterface -XUnliftedFFITypes -XCPP
-O2  -no-user-package-conf -rtsopts -odir
libraries/array/dist-install/build -hidir
libraries/array/dist-install/build -stubdir
libraries/array/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c
libraries/array/./Data/Array/IO/Internals.hs -o
libraries/array/dist-install/build/Data/Array/IO/Internals.o
libraries/array/Data/Array/IO/Internals.hs:2:16:
Warning: -#include and INCLUDE pragmas are deprecated: They no
longer have any effect
Instruction referencing instruction not embedded in a basic block!
  %ln2ulc = getelementptr inbounds i32* %Sp_Arg, i32 3
  %ln2uld = ptrtoint i32* %ln2ulc to i32
Instruction does not dominate all uses!
  %ln2ulc = getelementptr inbounds i32* %Sp_Arg, i32 3
  tail call cc10 void @stg_ap_ppp_fast(i32* %Base_Arg, i32* %ln2ulc,
i32* %ln2uk8, i32 %ln2uky, i32 ptrtoint
(%templatezmhaskell_LanguageziHaskellziTHziSyntax_zdfDataFunDepzuzddData_closure_struct*
@templatezmhaskell_LanguageziHaskellziTHziSyntax_zdfDataFunDepzuzddData_closure
to i32), i32 %ln2ul2, i32 %ln2ul6, i32 %SpLim_Arg) nounwind
Broken module found, compilation aborted!
0  libLLVM-3.0.so 0x4058f348
1  libLLVM-3.0.so 0x4058f7b4
2  libc.so.6  0x4150a0b0 __default_sa_restorer_v2 + 0
3  libc.so.6  0x41508c7c gsignal + 64
4  libc.so.6  0x4150a2bc abort + 432
5  libLLVM-3.0.so 0x406f88e0
6  libLLVM-3.0.so 0x406e7678
llvm::FPPassManager::runOnFunction(llvm::Function&) + 440
7  libLLVM-3.0.so 0x406e7760
llvm::FPPassManager::runOnModule(llvm::Module&) + 48
8  libLLVM-3.0.so 0x406e733c
llvm::MPPassManager::runOnModule(llvm::Module&) + 396
9  libLLVM-3.0.so 0x406e7484 llvm::PassManagerImpl::run(llvm::Module&) + 108
10 opt0x00014528 main + 2268
11 libc.so.6  0x414f2dd0 __libc_start_main + 272
Stack dump:
0.  Program arguments: opt /tmp/ghc22413_0/ghc22413_0.ll -o
/tmp/ghc22413_0/ghc22413_0.bc -O2
1.  Running pass 'Function Pass Manager' on module
'/tmp/ghc22413_0/ghc22413_0.ll'.
2.  Running pass 'Module Verifier' on function '@seuH_info'
make[1]: *** 
[libraries/template-haskell/dist-install/build/Language/Haskell/TH/Syntax.o]
Error 1

(full log at 
http://arm.koji.fedoraproject.org/koji/getfile?taskID=746853&name=build.log,
more details at http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=746853)

I haven't tried HEAD yet though the results at
http://darcs.haskell.org/ghcBuilder/builders/kgardas-linux-arm-head/index.html
are not too encouraging.

Perhaps I will try building ghc74 on ARM without llvm first, and maybe
on Fedora 17 too?

Anyway thoughts on how to proceed?

Thanks, Jens

ps There is ac