Last active
December 23, 2015 19:09
-
-
Save AlainODea/6680233 to your computer and use it in GitHub Desktop.
Partial setup of GHC Cross-compiler for Ubuntu to Illumos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 05960e888726b961ebe9c00c439f5158a46c0532 Mon Sep 17 00:00:00 2001 | |
From: Muhaimin Ahsan <[email protected]> | |
Date: Thu, 26 Sep 2013 16:33:59 -0500 | |
Subject: [PATCH] Include termios.h for solaris2 host. (Fixes #8366) | |
--- | |
System/Console/Haskeline/Backend/Posix.hsc | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
diff --git a/System/Console/Haskeline/Backend/Posix.hsc b/System/Console/Haskeline/Backend/Posix.hsc | |
index a028629..8ed9067 100644 | |
--- a/System/Console/Haskeline/Backend/Posix.hsc | |
+++ b/System/Console/Haskeline/Backend/Posix.hsc | |
@@ -48,7 +48,7 @@ import GHC.IOBase(haFD,FD) | |
import GHC.Handle (withHandle_) | |
#endif | |
-#if defined(USE_TERMIOS_H) || defined(__ANDROID__) | |
+#if defined(USE_TERMIOS_H) || defined(__ANDROID__) || defined(solaris2_HOST_OS) | |
#include <termios.h> | |
#endif | |
#include <sys/ioctl.h> | |
-- | |
1.8.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export TARGET=x86_64-sun-solaris2.11 | |
export PREFIX=$HOME/Documents/gcc/cross/$TARGET | |
export PATH=$PATH:$PREFIX/bin | |
export GCC=$PREFIX/bin/$TARGET-gcc | |
export LD=$PREFIX/bin/$TARGET-ld | |
export NM=$PREFIX/bin/$TARGET-nm | |
export OBJDUMP=$PREFIX/bin/$TARGET-objdump | |
cabal install happy alex haddock | |
sudo apt-get update | |
sudo apt-get install --assume-yes ghc libncurses5-dev \ | |
mesa-common-dev freeglut3-dev libedit-dev | |
git clone git://github.com/ghc/ghc | |
pushd ghc | |
patch -d libraries/haskeline/ -p1 < \ | |
../ghc-patches/0001-Include-termios.h-for-solaris2-host.-Fixes-8366.patch | |
cp $SYSROOT/opt/local/include/gmp.h libraries/integer-gmp/gmp/ | |
cp mk/build.mk{.sample,} | |
echo "Stage1Only = YES" >> mk/build.mk | |
./sync-all --no-dph get | |
perl boot | |
./configure \ | |
--host=x86_64-unknown-linux-gnu \ | |
--build=x86_64-unknown-linux-gnu \ | |
--target=x86_64-sun-solaris2 \ | |
--with-gcc=$GCC \ | |
--with-ld=$LD \ | |
--with-nm=$NM \ | |
--with-objdump=$OBJDUMP | |
#make -j $(nproc) | |
make | |
scp inplace/lib/bin/mkGmpDerivedConstants root@ns2:. | |
ssh root@ns2 "./mkGmpDerivedConstants" > \ | |
libraries/integer-gmp/mkGmpDerivedConstants/dist/GmpDerivedConstants.h | |
make | |
popd |
Removing -j $(nproc)
fixes the restarting make issue. Build will likely take at least the halflife of cesium now.
Configure mk/build.mk before perl boot. Otherwise it will do a default build.
Create ghc-patches directory beside cross_ghc.sh and put 0001-Include-termios.h-for-solaris2-host.-Fixes-8366.patch in there.
Latest failure log: Further along in the GHC build for SmartOS
Got past the mkGmpDerivedConstants failure by ignoring it, shipping the Solaris binary to a SmartOS box, running that, and restarting make. This is getting more Rube-Goldberg with every revision. A cleaner fix would be a Makefile patch that integrates an instance of the target system into the build process.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Okay
export CFLAGS=-m64
gets past the issue. I had to rerun./configure ...
and then make. I'm running into this error now: