Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell 32 to 64 bit cross compilation

I only have a x86_32 machine running Linux. On this machine I coded a small Haskell program.

Now I need to provide a x86_64 Linux binary.

Which is the easiest / less painful way to achieve that?

like image 508
gerth56 Avatar asked Jul 27 '15 07:07

gerth56


1 Answers

Borrow or rent (e.g. EC2) an x86_64 machine for long enough to compile your program. The latter would cost on the order of $0.01.

If this is not possible, then assuming you have a C cross-compiler to x86_64, you can try following the directions at https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling. However, as far as I know nobody has tried this before and I would be surprised if there are no bugs lurking for the case when the compiler's Int size is smaller than the target platform's word size.

like image 170
Reid Barton Avatar answered Nov 05 '22 21:11

Reid Barton