
I just recently noticed that GHC in ArchLinux is compiled with the LLVM backend support: $ ghc --info |grep llvm ,("Have llvm code generator","YES") However, can it be made to work on Arch? $ cat Mains.hs module Main where main = return () $ ghc --make -fllvm Mains.hs [1 of 1] Compiling Main ( Mains.hs, Mains.o ) opt: /tmp/ghc14739_0/ghc14739_0.ll:7:78: error: argument attributes invalid in function type @Main_main_closure = global %Main_main_closure_struct <{i64 ptrtoint (void (i64* noalias nocapture,i64* noalias nocapture,i64* noalias nocapture,i64 ,i64 ,i64 ,i64,i64 ,i64 ,i64 ,float ,float ,float ,float ,double ,double )* @Main_main_info to i64),i64 0,i64 0,i64 0}> /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus

I also get this error but it seems to compile with the addition of -pgmlc
and -pgmlo
On Tue, Jan 3, 2012 at 4:14 AM, Magnus Therning
I just recently noticed that GHC in ArchLinux is compiled with the LLVM backend support:
$ ghc --info |grep llvm ,("Have llvm code generator","YES")
However, can it be made to work on Arch?
$ cat Mains.hs module Main where
main = return () $ ghc --make -fllvm Mains.hs [1 of 1] Compiling Main ( Mains.hs, Mains.o ) opt: /tmp/ghc14739_0/ghc14739_0.ll:7:78: error: argument attributes invalid in function type @Main_main_closure = global %Main_main_closure_struct <{i64 ptrtoint (void (i64* noalias nocapture,i64* noalias nocapture,i64* noalias nocapture,i64 ,i64 ,i64 ,i64,i64 ,i64 ,i64 ,float ,float ,float ,float ,double ,double )* @Main_main_info to i64),i64 0,i64 0,i64 0}>
/M
-- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus
_______________________________________________ arch-haskell mailing list arch-haskell@haskell.org http://www.haskell.org/mailman/listinfo/arch-haskell

On Tue, Jan 03, 2012 at 11:37:18AM -0500, Simon Gomizelj wrote:
I also get this error but it seems to compile with the addition of -pgmlc and -pgmlo
Would you mind giving the complete command line? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. -- Alan Kay

On Tue, Jan 3, 2012 at 12:43 PM, Magnus Therning
On Tue, Jan 03, 2012 at 11:37:18AM -0500, Simon Gomizelj wrote:
I also get this error but it seems to compile with the addition of -pgmlc and -pgmlo
Would you mind giving the complete command line?
/M
ghc --make -fllvm -pgmlc -pgmlo Mains.hs -pgmlc triggers the llvm code generator while -pgmlo the llvm optimizer.

On Tue, Jan 03, 2012 at 03:44:47PM -0500, Simon Gomizelj wrote:
On Tue, Jan 3, 2012 at 12:43 PM, Magnus Therning
wrote: On Tue, Jan 03, 2012 at 11:37:18AM -0500, Simon Gomizelj wrote:
I also get this error but it seems to compile with the addition of -pgmlc and -pgmlo
Would you mind giving the complete command line?
/M
ghc --make -fllvm -pgmlc -pgmlo Mains.hs
-pgmlc triggers the llvm code generator while -pgmlo the llvm optimizer.
Interesting, that command line gives me *exactly* the same error I got before. What llvm-related packages do you have installed? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. -- Alan Kay

On Wed, Jan 4, 2012 at 02:58, Simon Gomizelj
Just llvm and clang.
I only had `llvm` installed, but adding `clang` didn't make it work; still the same error. Based on the docs for GHC it looks like `-pgmlo` and `-pgmlc` should take a command as well, no? I'm also perplexed that I'd have to first tell GHC to use LLVM, and then ask it to replace the programs used for LLVM compiling and linking. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus
participants (2)
-
Magnus Therning
-
Simon Gomizelj