[Haskell-iPhone] Hey Stephen - more on cross compiling
Stephen Blackheath [to GHC-iPhone]
likeliest.complexions.stephen at blacksapphire.com
Mon Jan 14 04:58:30 CET 2013
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
>>
More information about the iPhone
mailing list