Stephen, Gabor Greif had some cross-compiler changes checked in to mainline recently (see email below), so you should be able to get started with your Blackberry port. I'll re-do GHC-iOS against the latest master. Steve On 20/11/12 09:53, Gabor Greif wrote:> Hi Stephen,
Ian merged the functionality (mostly?) to mainline 7.7. That means my old branch (cross-compiler-alienless) is obsolete now. Phew.
Though I did not yet have a chance to test it. I'd suggest that you simply "./configure" with --target=ios --build=macos --host=macos (substitute correct triples) and report the results.
I believe --with-gcc=<cross-gcc> is enough. Possibly 'nm' must be around that correctly lists the symbols created by <cross-gcc>.
That is all I know. The MacBook Pro I have access to unfortunately miscompiles the stage-2 GHC in a normal setup (no cross involved), so I am thoroughly stumped :-(
Best luck anyway,
cheers,
Gabor
On 18/11/12 05:07, Stephen Paul Weber wrote:
Hello all,
I'm interested in getting a GHC cross-compiler going for the new QNX-based BlackBerry 10 OS launching in the new year, but the documentation on GHC as cross-compiler http://hackage.haskell.org/trac/ghc/wiki/CrossCompilation is pretty sparse and contradictory. You guys seem to be doing it. How complex is it? Where should I start looking for information about the configuration I'll need in the build system, etc? Do I need to know a lot about autotools hacking to get anywhere?
Thanks,
Somebody claiming to be Stephen Blackheath [to GHC-iPhone] wrote:
Gabor Greif had some cross-compiler changes checked in to mainline recently (see email below), so you should be able to get started with your Blackberry port. I'll re-do GHC-iOS against the latest master. On 20/11/12 09:53, Gabor Greif wrote:
Though I did not yet have a chance to test it. I'd suggest that you simply "./configure" with --target=ios --build=macos --host=macos (substitute correct triples) and report the results.
I believe --with-gcc=<cross-gcc> is enough. Possibly 'nm' must be around that correctly lists the symbols created by <cross-gcc>.
First test. I had to edit aclocal.m4: - dragonfly|osf1|hpux|linuxaout|freebsd2|cygwin32|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix) + dragonfly|osf1|hpux|linuxaout|freebsd2|cygwin32|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|nto-qnx) @@ $2="freebsd" ;; + nto-qnx*) + $2="nto-qnx" + ;; Then `perl boot` and run: ./configure --target=i486-pc-nto-qnx8.0.0 --build=i686-linux-gnu --host=i686-linux-gnu --with-gcc=/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc Success! It says http://pastie.org/5403570. I try to run `make` and it says http://pastie.org/5403589. Am I missing a step? Thanks for all the help so far :) -- Stephen Paul Weber, @singpolyma See http://singpolyma.net for how I prefer to be contacted edition right joseph
Stephen, In ARM we don't have ghci support. Some parts of the build require it, particularly dph. In GHC-iOS I commented out the last four lines of 'packages' that pertain to dph. The top-level ghc.mk may also contain other tweaks. Steve On 20/11/12 12:02, Stephen Paul Weber wrote:
Somebody claiming to be Stephen Blackheath [to GHC-iPhone] wrote:
Gabor Greif had some cross-compiler changes checked in to mainline recently (see email below), so you should be able to get started with your Blackberry port. I'll re-do GHC-iOS against the latest master. On 20/11/12 09:53, Gabor Greif wrote:
Though I did not yet have a chance to test it. I'd suggest that you simply "./configure" with --target=ios --build=macos --host=macos (substitute correct triples) and report the results.
I believe --with-gcc=<cross-gcc> is enough. Possibly 'nm' must be around that correctly lists the symbols created by <cross-gcc>.
First test. I had to edit aclocal.m4:
- dragonfly|osf1|hpux|linuxaout|freebsd2|cygwin32|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix)
+ dragonfly|osf1|hpux|linuxaout|freebsd2|cygwin32|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|nto-qnx)
@@ $2="freebsd" ;; + nto-qnx*) + $2="nto-qnx" + ;;
Then `perl boot` and run:
./configure --target=i486-pc-nto-qnx8.0.0 --build=i686-linux-gnu --host=i686-linux-gnu --with-gcc=/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc
Success! It says http://pastie.org/5403570. I try to run `make` and it says http://pastie.org/5403589. Am I missing a step?
Thanks for all the help so far :)
Somebody claiming to be Stephen Blackheath [to GHC-iPhone] wrote:
In ARM we don't have ghci support. Some parts of the build require it, particularly dph. In GHC-iOS I commented out the last four lines of 'packages' that pertain to dph. The top-level ghc.mk may also contain other tweaks.
Cool. I did that, and now I get: CROSS_COMPILE="i486-pc-nto-qnx8.0.0-" "inplace/bin/ghc-cabal" configure --with-ghc="/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/inplace/bin/ghc-stage1" --with-ghc-pkg="/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/inplace/bin/ghc-pkg" --enable-library-vanilla --disable-library-profiling --disable-shared --disable-library-for-ghci --configure-option=CFLAGS=" -fno-stack-protector " --configure-option=LDFLAGS=" -Wl,--hash-size=31 -Wl,--reduce-memory-overheads " --configure-option=CPPFLAGS=" " --with-gcc="/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc" --configure-option=--with-cc="/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc" --with-ar="/usr/bin/ar" --with-ranlib="true" -- dist-install libraries/integer-gmp Configuring integer-gmp-0.5.0.0... configure: WARNING: unrecognized options: --with-compiler, --with-gcc checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for gcc... /home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in `/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/libraries/integer-gmp': configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details make[1]: *** [libraries/integer-gmp/dist-install/package-data.mk] Error 1 make: *** [all] Error 2 I can maybe disable integer-gmp, but it seems like it should be able to build, no? -- Stephen Paul Weber, @singpolyma See http://singpolyma.net for how I prefer to be contacted edition right joseph
Stephen, Use the non-gmp version of integer, which is done by adding this line to mk/build.mk INTEGER_LIBRARY = integer-simple Steve On 20/11/12 12:42, Stephen Paul Weber wrote:
Somebody claiming to be Stephen Blackheath [to GHC-iPhone] wrote:
In ARM we don't have ghci support. Some parts of the build require it, particularly dph. In GHC-iOS I commented out the last four lines of 'packages' that pertain to dph. The top-level ghc.mk may also contain other tweaks.
Cool. I did that, and now I get:
CROSS_COMPILE="i486-pc-nto-qnx8.0.0-" "inplace/bin/ghc-cabal" configure --with-ghc="/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/inplace/bin/ghc-stage1" --with-ghc-pkg="/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/inplace/bin/ghc-pkg" --enable-library-vanilla --disable-library-profiling --disable-shared --disable-library-for-ghci --configure-option=CFLAGS=" -fno-stack-protector " --configure-option=LDFLAGS=" -Wl,--hash-size=31 -Wl,--reduce-memory-overheads " --configure-option=CPPFLAGS=" " --with-gcc="/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc" --configure-option=--with-cc="/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc" --with-ar="/usr/bin/ar" --with-ranlib="true" -- dist-install libraries/integer-gmp Configuring integer-gmp-0.5.0.0... configure: WARNING: unrecognized options: --with-compiler, --with-gcc checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for gcc... /home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc
checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in `/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/libraries/integer-gmp':
configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details make[1]: *** [libraries/integer-gmp/dist-install/package-data.mk] Error 1 make: *** [all] Error 2
I can maybe disable integer-gmp, but it seems like it should be able to build, no?
Somebody claiming to be Stephen Blackheath [to GHC-iPhone] wrote:
Use the non-gmp version of integer, which is done by adding this line to mk/build.mk
INTEGER_LIBRARY = integer-simple
Right, I'm trying this now, which is what I meant by:
I can maybe disable integer-gmp
But it seems like maybe the configure flags are just not all being passed through to integer-gmp, so maybe it could work as well. Not sure what the tradeoffs are? -- Stephen Paul Weber, @singpolyma See http://singpolyma.net for how I prefer to be contacted edition right joseph
Somebody claiming to be Stephen Paul Weber wrote:
But it seems like maybe the configure flags are just not all being passed through to integer-gmp, so maybe it could work as well. Not sure what the tradeoffs are?
Seems like it's not just integer-gmp that isn't being passed the configure flags: CROSS_COMPILE="i486-pc-nto-qnx8.0.0-" "inplace/bin/ghc-cabal" configure --with-ghc="/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/inplace/bin/ghc-stage1" --with-ghc-pkg="/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/inplace/bin/ghc-pkg" --flags=integer-simple --enable-library-vanilla --disable-library-profiling --disable-shared --disable-library-for-ghci --configure-option=CFLAGS=" -fno-stack-protector " --configure-option=LDFLAGS=" -Wl,--hash-size=31 -Wl,--reduce-memory-overheads " --configure-option=CPPFLAGS=" " --with-gcc="/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc" --configure-option=--with-cc="/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc" --with-ar="/usr/bin/ar" --with-ranlib="true" -- dist-install libraries/base Configuring base-4.6.0.0... configure: WARNING: unrecognized options: --with-compiler, --with-gcc checking for gcc... /home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in `/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/libraries/base': configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details make[1]: *** [libraries/base/dist-install/package-data.mk] Error 1 make: *** [all] Error 2 -- Stephen Paul Weber, @singpolyma See http://singpolyma.net for how I prefer to be contacted edition right joseph
Somebody claiming to be Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
But it seems like maybe the configure flags are just not all being passed through to integer-gmp, so maybe it could work as well. Not sure what the tradeoffs are?
Seems like it's not just integer-gmp that isn't being passed the configure flags:
I tried running the configure step on base by hand, passing in the build and target flags, and that succeeded, but now when I run make I get: CROSS_COMPILE="i486-pc-nto-qnx8.0.0-" "inplace/bin/ghc-cabal" configure --with-ghc="/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/inplace/bin/ghc-stage1" --with-ghc-pkg="/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/inplace/bin/ghc-pkg" --enable-library-vanilla --disable-library-profiling --disable-shared --disable-library-for-ghci --configure-option=CFLAGS=" -fno-stack-protector " --configure-option=LDFLAGS=" -Wl,--hash-size=31 -Wl,--reduce-memory-overheads " --configure-option=CPPFLAGS=" " --with-gcc="/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc" --configure-option=--with-cc="/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc" --with-ar="/usr/bin/ar" --with-ranlib="true" -- dist-install libraries/filepath Configuring filepath-1.3.0.1... ghc-cabal: At least the following dependencies are missing: base >=2 && <5 make[1]: *** [libraries/filepath/dist-install/package-data.mk] Error 1 make: *** [all] Error 2 So, that didn't work out quite right. I also tried making just in the directory for base and I get the same thing. -- Stephen Paul Weber, @singpolyma See http://singpolyma.net for how I prefer to be contacted edition right joseph
Stephen, I can't tell you what that error means off the top of my head. Here (attached) are the ghc-ios patches as they were in June 2012. Large amounts of it you can skip because it's iOS specific (and nowhere near fit to be integrated yet). Most of the stuff that's relevant to you will be in makefiles. Hopefully you'll find some clues there. Some of it is radical stuff like adding of a new define called WhatLocalGccIsCalled. Gabor and Ian have probably solved the same problem differently. Another example is where I made alien work in more places, but Ian is (rightly) trying to phase alien out. But it sounds like Ian is not finished yet, so some parts of my patch might be helpful. This is not the complete patch set. I have also made minor patches to base, unix and hsc2hs, and a few changes to Cabal to allow run-time selection of your toolchain. lukexi has offered to help with the Cabal changes, so I've cc'ed him in. Steve On 20/11/12 15:41, Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
But it seems like maybe the configure flags are just not all being passed through to integer-gmp, so maybe it could work as well. Not sure what the tradeoffs are?
Seems like it's not just integer-gmp that isn't being passed the configure flags:
I tried running the configure step on base by hand, passing in the build and target flags, and that succeeded, but now when I run make I get:
CROSS_COMPILE="i486-pc-nto-qnx8.0.0-" "inplace/bin/ghc-cabal" configure --with-ghc="/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/inplace/bin/ghc-stage1" --with-ghc-pkg="/home/singpolyma/src/ghc-7.7.20121119-src/ghc-7.7.20121119/inplace/bin/ghc-pkg" --enable-library-vanilla --disable-library-profiling --disable-shared --disable-library-for-ghci --configure-option=CFLAGS=" -fno-stack-protector " --configure-option=LDFLAGS=" -Wl,--hash-size=31 -Wl,--reduce-memory-overheads " --configure-option=CPPFLAGS=" " --with-gcc="/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc" --configure-option=--with-cc="/home/singpolyma/bbndk/host_10_0_9_52/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc" --with-ar="/usr/bin/ar" --with-ranlib="true" -- dist-install libraries/filepath Configuring filepath-1.3.0.1... ghc-cabal: At least the following dependencies are missing: base >=2 && <5 make[1]: *** [libraries/filepath/dist-install/package-data.mk] Error 1 make: *** [all] Error 2
So, that didn't work out quite right. I also tried making just in the directory for base and I get the same thing.
Somebody claiming to be Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
But it seems like maybe the configure flags are just not all being passed through to integer-gmp, so maybe it could work as well. Not sure what the tradeoffs are?
Seems like it's not just integer-gmp that isn't being passed the configure flags:
Sorry for being so noisy :) More progress (ish): I added this to rules/build-package-data.mk : $1_$2_CONFIGURE_OPTS += --configure-option=--target=i486-pc-nto-qnx8.0.0 --configure-option=--host=i686-linux-gnu And it got much further. Then there was a hiccup in the unix library, but I'm pretty sure that was a QNX thing, so I patched that in what seemed a sensible way. Then I got a weird error about test_array not being constant in libraries/base/System/CPUTime.hsc, so I hacked that on line 190 to #if 0 Then, maybe related to that hack, maybe not, I got: ghc-stage1: panic! (the 'impossible' happened) (GHC version 7.7.20121119 for i386-unknown-nto-qnx): expectJust initTcInteractive but on the next run that did not happen again. I now get: libraries/base/Foreign/C/Types.hs:164:405: Not in scope: type constructor or class `HTYPE_DOUBLE' libraries/base/Foreign/C/Types.hs:164:478: Not in scope: type constructor or class `HTYPE_DOUBLE' libraries/base/Foreign/C/Types.hs:164:557: Not in scope: type constructor or class `HTYPE_DOUBLE' make[1]: *** [libraries/base/dist-install/build/Foreign/C/Types.o] Error 1 make: *** [all] Error 2 So I hack ./libraries/base/include/HsBaseConfig.h to use Double for HTYPE_DOUBLE and Float for HTYPE_FLOAT And... I have a stage1 build! I have compiled and tested a hello world app on my BB10 simulator. So, it would be nice to clean some of this up, and I'm not sure I made all the right choices, but it is minimally worked :D -- Stephen Paul Weber, @singpolyma See http://singpolyma.net for how I prefer to be contacted edition right joseph
Hi there - This is an answer to an email of two months ago. The proper fix for this issue:
libraries/base/Foreign/C/Types.hs:164:405: Not in scope: type constructor or class `HTYPE_DOUBLE'
libraries/base/Foreign/C/Types.hs:164:478: Not in scope: type constructor or class `HTYPE_DOUBLE'
Is this patch to libraries/base: diff --git a/aclocal.m4 b/aclocal.m4 index 6e9801f..306bc48 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -125,9 +125,8 @@ AC_DEFUN([FPTOOLS_CHECK_HTYPE_ELSE],[ AC_MSG_CHECKING(Haskell type for $1) AC_CACHE_VAL(AC_CV_NAME,[ AC_CV_NAME_supported=yes - FP_COMPUTE_INT([HTYPE_IS_INTEGRAL], - [(($1)((int)(($1)1.4))) == (($1)1.4)], - [FPTOOLS_HTYPE_INCLUDES],[AC_CV_NAME_supported=no]) + if test "$1" = "float" ; then HTYPE_IS_INTEGRAL=0; fi + if test "$1" = "double" ; then HTYPE_IS_INTEGRAL=0; fi if test "$AC_CV_NAME_supported" = "yes" then if test "$HTYPE_IS_INTEGRAL" -eq 0 You might need to type this, also: cd libraries/base autoreconf The original test doesn't work in cross-compiler mode. Steve On 20/11/12 16:33, Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
But it seems like maybe the configure flags are just not all being passed through to integer-gmp, so maybe it could work as well. Not sure what the tradeoffs are?
Seems like it's not just integer-gmp that isn't being passed the configure flags:
Sorry for being so noisy :) More progress (ish):
I added this to rules/build-package-data.mk :
$1_$2_CONFIGURE_OPTS += --configure-option=--target=i486-pc-nto-qnx8.0.0 --configure-option=--host=i686-linux-gnu
And it got much further. Then there was a hiccup in the unix library, but I'm pretty sure that was a QNX thing, so I patched that in what seemed a sensible way.
Then I got a weird error about test_array not being constant in libraries/base/System/CPUTime.hsc, so I hacked that on line 190 to #if 0
Then, maybe related to that hack, maybe not, I got:
ghc-stage1: panic! (the 'impossible' happened) (GHC version 7.7.20121119 for i386-unknown-nto-qnx): expectJust initTcInteractive
but on the next run that did not happen again. I now get:
libraries/base/Foreign/C/Types.hs:164:405: Not in scope: type constructor or class `HTYPE_DOUBLE'
libraries/base/Foreign/C/Types.hs:164:478: Not in scope: type constructor or class `HTYPE_DOUBLE'
libraries/base/Foreign/C/Types.hs:164:557: Not in scope: type constructor or class `HTYPE_DOUBLE' make[1]: *** [libraries/base/dist-install/build/Foreign/C/Types.o] Error 1 make: *** [all] Error 2
So I hack ./libraries/base/include/HsBaseConfig.h to use Double for HTYPE_DOUBLE and Float for HTYPE_FLOAT
And... I have a stage1 build! I have compiled and tested a hello world app on my BB10 simulator. So, it would be nice to clean some of this up, and I'm not sure I made all the right choices, but it is minimally worked :D
CORRECTION diff --git a/aclocal.m4 b/aclocal.m4 index 6e9801f..cf56a80 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -125,9 +125,9 @@ AC_DEFUN([FPTOOLS_CHECK_HTYPE_ELSE],[ AC_MSG_CHECKING(Haskell type for $1) AC_CACHE_VAL(AC_CV_NAME,[ AC_CV_NAME_supported=yes - FP_COMPUTE_INT([HTYPE_IS_INTEGRAL], - [(($1)((int)(($1)1.4))) == (($1)1.4)], - [FPTOOLS_HTYPE_INCLUDES],[AC_CV_NAME_supported=no]) + HTYPE_IS_INTEGRAL=1 + if test "$1" = "float" ; then HTYPE_IS_INTEGRAL=0; fi + if test "$1" = "double" ; then HTYPE_IS_INTEGRAL=0; fi if test "$AC_CV_NAME_supported" = "yes" then if test "$HTYPE_IS_INTEGRAL" -eq 0 On 14/01/13 16:51, Stephen Blackheath [to GHC-iPhone] wrote:
Hi there -
This is an answer to an email of two months ago. The proper fix for this issue:
libraries/base/Foreign/C/Types.hs:164:405: Not in scope: type constructor or class `HTYPE_DOUBLE'
libraries/base/Foreign/C/Types.hs:164:478: Not in scope: type constructor or class `HTYPE_DOUBLE'
Is this patch to libraries/base:
diff --git a/aclocal.m4 b/aclocal.m4 index 6e9801f..306bc48 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -125,9 +125,8 @@ AC_DEFUN([FPTOOLS_CHECK_HTYPE_ELSE],[ AC_MSG_CHECKING(Haskell type for $1) AC_CACHE_VAL(AC_CV_NAME,[ AC_CV_NAME_supported=yes - FP_COMPUTE_INT([HTYPE_IS_INTEGRAL], - [(($1)((int)(($1)1.4))) == (($1)1.4)], - [FPTOOLS_HTYPE_INCLUDES],[AC_CV_NAME_supported=no]) + if test "$1" = "float" ; then HTYPE_IS_INTEGRAL=0; fi + if test "$1" = "double" ; then HTYPE_IS_INTEGRAL=0; fi if test "$AC_CV_NAME_supported" = "yes" then if test "$HTYPE_IS_INTEGRAL" -eq 0
You might need to type this, also:
cd libraries/base autoreconf
The original test doesn't work in cross-compiler mode.
Steve
On 20/11/12 16:33, Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
Somebody claiming to be Stephen Paul Weber wrote:
But it seems like maybe the configure flags are just not all being passed through to integer-gmp, so maybe it could work as well. Not sure what the tradeoffs are?
Seems like it's not just integer-gmp that isn't being passed the configure flags:
Sorry for being so noisy :) More progress (ish):
I added this to rules/build-package-data.mk :
$1_$2_CONFIGURE_OPTS += --configure-option=--target=i486-pc-nto-qnx8.0.0 --configure-option=--host=i686-linux-gnu
And it got much further. Then there was a hiccup in the unix library, but I'm pretty sure that was a QNX thing, so I patched that in what seemed a sensible way.
Then I got a weird error about test_array not being constant in libraries/base/System/CPUTime.hsc, so I hacked that on line 190 to #if 0
Then, maybe related to that hack, maybe not, I got:
ghc-stage1: panic! (the 'impossible' happened) (GHC version 7.7.20121119 for i386-unknown-nto-qnx): expectJust initTcInteractive
but on the next run that did not happen again. I now get:
libraries/base/Foreign/C/Types.hs:164:405: Not in scope: type constructor or class `HTYPE_DOUBLE'
libraries/base/Foreign/C/Types.hs:164:478: Not in scope: type constructor or class `HTYPE_DOUBLE'
libraries/base/Foreign/C/Types.hs:164:557: Not in scope: type constructor or class `HTYPE_DOUBLE' make[1]: *** [libraries/base/dist-install/build/Foreign/C/Types.o] Error 1 make: *** [all] Error 2
So I hack ./libraries/base/include/HsBaseConfig.h to use Double for HTYPE_DOUBLE and Float for HTYPE_FLOAT
And... I have a stage1 build! I have compiled and tested a hello world app on my BB10 simulator. So, it would be nice to clean some of this up, and I'm not sure I made all the right choices, but it is minimally worked :D
Somebody claiming to be Stephen Blackheath [to GHC-iPhone] wrote:
This is an answer to an email of two months ago. The proper fix for this
The original test doesn't work in cross-compiler mode.
I came to this conclusion also. There is a ticket on GHC trac about this with a proposed patch from me. Can you comment on it confirming it and attach your patch as another option? If you can't find it, I will email a link tomorrow. -- Stephen Paul Weber, @singpolyma See http://singpolyma.net for how I prefer to be contacted edition right joseph
Stephen, http://hackage.haskell.org/trac/ghc/ticket/7569 I decided that your patch is better, so I've put a note on there to endorse your one. It works for me on cross-compiling to Linux. Steve On 14/01/13 17:26, Stephen Paul Weber wrote:
Somebody claiming to be Stephen Blackheath [to GHC-iPhone] wrote:
This is an answer to an email of two months ago. The proper fix for this The original test doesn't work in cross-compiler mode.
I came to this conclusion also. There is a ticket on GHC trac about this with a proposed patch from me. Can you comment on it confirming it and attach your patch as another option?
If you can't find it, I will email a link tomorrow.
participants (2)
-
Stephen Blackheath [to GHC-iPhone] -
Stephen Paul Weber