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=723311name=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=746853name=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 actually a 

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


Re: default instance for IsString

2012-04-22 Thread Greg Weber
so how can I update the documentation? I asked some of the most
experienced Haskell users at the Hackathon about this, and looked
through any documentation I could find and there was nothing
indicating I could do what you sent in your last message.

On Sun, Apr 22, 2012 at 8:15 AM, Markus Läll markus.l...@gmail.com wrote:
 The core of it is in the GHC docs' overloaded strings section [1].

 It could be clearer though -- reading about defaulting in the reports,
 in the type defaulting section of GHC docs and in [1] can be a bit
 confusing.

 [1] 
 http://www.haskell.org/ghc/docs/latest/html/users_guide/type-class-extensions.html#overloaded-strings

 On Sun, Apr 22, 2012 at 4:54 PM, Greg Weber g...@gregweber.info wrote:
 Thanks Markus, I think you have saved the day!
 Even after googling for this extension and searching in the manual I
 am still coming up pretty blank.
 Is there somewhere I missed where this is documented or somewhere I
 can contribute documentation?

 On Sun, Apr 22, 2012 at 4:47 AM, Markus Läll markus.l...@gmail.com wrote:
 ExtendedDefaultRules



 --
 Markus Läll

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


Re: default instance for IsString

2012-04-22 Thread Brent Yorgey
I do not think this is a bug.  Since type classes are open, GHC does
not do any reasoning of the form X is the only instance in scope, so
I will pick that one.  Other instances could be added at any time
(perhaps in other modules).  In this particular instance, GHC has no
reason to choose the Text instance other than the fact that it is the
only instance in scope -- that is, type inference is not enough to
determine that the Text instance should be chosen.

However, I do agree that it would be nice to have a mechanism for
specifying default instances for arbitrary (user-defined) type
classes.

-Brent

On Sat, Apr 21, 2012 at 09:55:32PM -0700, Greg Weber wrote:
 This is a better demonstration of the issue. I am going to open a GHC
 bug report, as I can't see how this behavior is desirable.
 
 
 {-# LANGUAGE OverloadedStrings #-}
 import Data.Text as T
 
 classNoDefault a  where noDefault :: a - Text
 instance NoDefault T.Text where noDefault = id
 
 main = print (noDefault Hello!)
 
 default.hs:7:15:
 Ambiguous type variable `a0' in the constraints:
   (NoDefault a0) arising from a use of `noDefault'
  at default.hs:7:15-23
   (Data.String.IsString a0) arising from the literal `Hello!'
 at default.hs:7:25-32
 Probable fix: add a type signature that fixes these type variable(s)
 In the first argument of `print', namely `(noDefault Hello!)'
 In the expression: print (noDefault Hello!)
 In an equation for `main': main = print (noDefault Hello!)
 
 
 On Sat, Apr 21, 2012 at 7:51 PM, Greg Weber g...@gregweber.info wrote:
  my actual use case looks more like this:
 
  {-# LANGUAGE OverloadedStrings #-}
  {-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
 
  import Data.Text as T
 
  class ShowT a where
    showT :: a - String
 
  instance ShowT T.Text where
    showT = show
 
  instance ShowT String where
    showT = show
 
  main = print (showT Hello!)
 
     Ambiguous type variable `a0' in the constraints:
       (ShowT a0) arising from a use of `showT' at default.hs:16:15-19
       (Data.String.IsString a0) arising from the literal `Hello!'
 
 
  So I actually want to define a default instance for a typeclass I
  define that uses isString instances.
 
 
 
  On Sat, Apr 21, 2012 at 6:24 PM, Daniel Peebles pumpkin...@gmail.com 
  wrote:
  I think it'll be hard to do that without putting Text in base, which I'm 
  not
  sure anyone wants to do.
 
  Dan
 
  On Sat, Apr 21, 2012 at 8:20 PM, Greg Weber g...@gregweber.info wrote:
 
  I would like to default IsString to use the Text instance to avoid
  ambiguous type errors.
  I see defaulting capability is available for Num. Is there any way to
  do this for IsString?
 
  Thanks,
  Greg Weber
 
  ___
  Glasgow-haskell-users mailing list
  Glasgow-haskell-users@haskell.org
  http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 
 
 
 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 

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


Re: default instance for IsString

2012-04-22 Thread Johan Tibell
On Sun, Apr 22, 2012 at 10:37 AM, Brent Yorgey byor...@seas.upenn.edu wrote:
 I do not think this is a bug.  Since type classes are open, GHC does
 not do any reasoning of the form X is the only instance in scope, so
 I will pick that one.  Other instances could be added at any time
 (perhaps in other modules).  In this particular instance, GHC has no
 reason to choose the Text instance other than the fact that it is the
 only instance in scope -- that is, type inference is not enough to
 determine that the Text instance should be chosen.

 However, I do agree that it would be nice to have a mechanism for
 specifying default instances for arbitrary (user-defined) type
 classes.

Couldn't we make a special case for IsString, like we do for Num,
given it's special syntactic association with OverloadedStrings?

-- Johan

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


RE: default instance for IsString

2012-04-22 Thread Simon Peyton-Jones
|  Couldn't we make a special case for IsString, like we do for Num,
|  given it's special syntactic association with OverloadedStrings?

Maybe so. It's open to anyone to make a concrete proposal.  See
  http://hackage.haskell.org/trac/ghc/ticket/6030
which may be the same issue.

Simon

|  -Original Message-
|  From: glasgow-haskell-users-boun...@haskell.org 
[mailto:glasgow-haskell-users-
|  boun...@haskell.org] On Behalf Of Johan Tibell
|  Sent: 22 April 2012 18:51
|  To: Brent Yorgey
|  Cc: glasgow-haskell-users@haskell.org
|  Subject: Re: default instance for IsString
|  
|  On Sun, Apr 22, 2012 at 10:37 AM, Brent Yorgey byor...@seas.upenn.edu
|  wrote:
|   I do not think this is a bug.  Since type classes are open, GHC does
|   not do any reasoning of the form X is the only instance in scope, so
|   I will pick that one.  Other instances could be added at any time
|   (perhaps in other modules).  In this particular instance, GHC has no
|   reason to choose the Text instance other than the fact that it is the
|   only instance in scope -- that is, type inference is not enough to
|   determine that the Text instance should be chosen.
|  
|   However, I do agree that it would be nice to have a mechanism for
|   specifying default instances for arbitrary (user-defined) type
|   classes.
|  
|  Couldn't we make a special case for IsString, like we do for Num,
|  given it's special syntactic association with OverloadedStrings?
|  
|  -- Johan
|  
|  ___
|  Glasgow-haskell-users mailing list
|  Glasgow-haskell-users@haskell.org
|  http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



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


Re: default instance for IsString

2012-04-22 Thread Jeremy Shaw
I have often wished for something like:

{-# LANGUAGE StringLiteralsAs Text #-}

where all string literals like:

 f = foo

would be translated to:

 f = (fromString foo :: Text)

I find that OverloadedStrings is too general and causes ambiguous type
errors. Additionally, I seldom find that I have more than one type of
string literal per file. Things tend to be all String, all Text, etc.
So, if I could just pick a concrete type for all the string literals
in my file, I would be happy.

- jeremy



On Sat, Apr 21, 2012 at 7:20 PM, Greg Weber g...@gregweber.info wrote:
 I would like to default IsString to use the Text instance to avoid
 ambiguous type errors.
 I see defaulting capability is available for Num. Is there any way to
 do this for IsString?

 Thanks,
 Greg Weber

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

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


Re: default instance for IsString

2012-04-22 Thread Greg Weber
Sorry, someone responded on haskell-cafe and the message didn't get
sent here. You can default a String. So this compiles just fine:

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExtendedDefaultRules #-}
import Data.Text as T
default (T.Text)

classNoDefault a  where noDefault :: a - Text
instance NoDefault T.Text where noDefault = id

main = print (noDefault Hello!)

On Sun, Apr 22, 2012 at 1:57 PM, Jeremy Shaw jer...@n-heptane.com wrote:
 I have often wished for something like:

 {-# LANGUAGE StringLiteralsAs Text #-}

 where all string literals like:

 f = foo

 would be translated to:

 f = (fromString foo :: Text)

 I find that OverloadedStrings is too general and causes ambiguous type
 errors. Additionally, I seldom find that I have more than one type of
 string literal per file. Things tend to be all String, all Text, etc.
 So, if I could just pick a concrete type for all the string literals
 in my file, I would be happy.

 - jeremy



 On Sat, Apr 21, 2012 at 7:20 PM, Greg Weber g...@gregweber.info wrote:
 I would like to default IsString to use the Text instance to avoid
 ambiguous type errors.
 I see defaulting capability is available for Num. Is there any way to
 do this for IsString?

 Thanks,
 Greg Weber

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

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


Re: Records in Haskell: Explicit Classy Records

2012-04-22 Thread AntC
Matthew Farkas-Dyck strake888 at gmail.com writes:

 I made another proposal for records in Haskell, meant to solve just
 the namespace problem, and no more.
 http://hackage.haskell.org/trac/ghc/wiki/Records/ExplicitClassyRecords
 

Thanks Matthew, I'm finding your wiki too sketchy to follow.

What name(s) does your proposal generate? And what type(s) do they have?

For record access, how does the compiler resolve to the right definition or 
instance from the context of use?

It seems you aren't making any proposal about record updating. So the acid 
test is how do you expect this to be treated:
 e{ x = True }
{* `e` is some arbitrary expression, possibly denoting a record type;
   `x` one of those names for which you've solved the namespace problem*}

AntC





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