Cross-compiling bug in the LLVM backend driver

Stephen Paul Weber <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <20121212144040.GA2161@singpolyma-svelti>
The LLVM backend driver currently assumes that we are targeting the same 
architecture as LLVM is defaultly set to target.  The hack solution is:

diff --git a/compiler/main/DriverPipeline.hs
b/compiler/main/DriverPipeline.hs
index fd5694f..80a7b99 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1331,9 +1331,9 @@ runPhase LlvmOpt input_fn dflags
  output_fn <- phaseOutputFilename LlvmLlc

  io $ SysTools.runLlvmOpt dflags
  ([ SysTools.FileOption "" input_fn,
  SysTools.Option "-o",
- SysTools.FileOption "" output_fn
+ SysTools.FileOption "" output_fn, SysTools.Option "-mtriple=arm-unknown-nto-qnx8.0.0eabi"]
  ++ optFlag
  ++ [SysTools.Option tbaa]
  ++ map SysTools.Option lo_opts)

And this is exactly the tripl as passed to / detected by GHC's `./configure` 
script, so to my mind the nicest solution would be to preserve that target 
triple from `./configure` and always pass it through to LLVM.

Thoughts?

-- 
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJQyJdnAAoJENEcKRHOUZzebukQAJxQH7Zk6421PhOJBOBw5lfq
5iZ/FMlEh4XHyI0+zD6jD/bUDmL6rrBhUctv9ktzxRIyG7yXzYxFjBevuSmTo5zD
9r2d6ESS263HDHlyegfzEYcq3saXkj+cJyr+QG3AwUqZd6wuP2Ya8De4nmBmg7Q4
IdVGkcx6JSXhlC7evDRTCBeNHxQP6IDq9BbqcbPeIWrgmn5GjYZmwxcYVp/cSnve
YJNmYE/HwuJsINqWlvXZBZtgwFSakFSLve0lMZKwBccVySYMAoRFvm7yik1rH3Df
8c1SeaRjos3YKshEL3r7uQnv3Tj+E2z3x3AVQuUtBGQtnclF8gM1NDpauIvhs4kI
Ohi9aHKXPICfIN9qhFVpOeqm6ibF6GVbWMBiIMN9aFnm2VOdTzhy9XZYNzSPCLyd
pyzpX2XBHi8CIWkJy4nhHOpitMoTWLarAo2Zju0+vOKsIlpVo2GsMM3bWyi4OKZQ
8FqJuPGRSAkqnYMf7E36Ul60NXtzb0N0ttQWw8mIyTssaA/diLzUn28wkkOXRoee
xp/zIy6TzZ9JO8MTCIhIiIKnRYlXGneuUCyWO5lCs0pXc5M3M9YLCD1PeGaH/bOk
W3pDVg/55Y2Z9y7Vtj8EfUsIhRxnULlS9qDDUIRuLX1YHvxUR4ah9bw6t5Awo5tz
200l3umoatogbtZZpk/d
=Vh7A
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.