bignums, gmp, bytestring, .. ?

Peter Tanski p.tanski at gmail.com
Wed Nov 22 20:35:40 EST 2006


On Nov 19, 2006, at 3:20 PM, Jeremy Shaw wrote:
> At Sun, 19 Nov 2006 13:46:10 -0500, Peter Tanski wrote:
>> What is the problem building GMP for PalmOS?  According to the GMP
>> install documentation, it supports ARM and Motorola's m68k
>> processors, so you would not be using generic C code.  You are
>> probably also using PRC-Tools, correct?
>
> Yes. I can not get past the configure step. I tried to build gmp 4.2.1
> with prc tools 2.3. I ran configure with these options:
>
> ./configure --build=i386-linux-gnu --host=m68k-palmos
>
> But, all the test programs (conftest.c) fail to link because they use
> 'main ()', but palmos expects 'PilotMain ()'. I hack the configure
> script and changed all occurances of 'main ()' to 'PilotMain ()', but
> then it failed beacuse the test programs could not find
> MemoryMgr.h. So I invoked configure with:
>
> CFLAGS=-I=/root/n-heptane/projects/haskell/palmos/sdk-5r3/ 
> include/ ./configure --build=i386-linux-gnu --host=m68k-palmos
>
> But now it fails to find working compiler with this error (from  
> config.log):
>
> configure:7756: checking build system compiler m68k-palmos-gcc -I=/ 
> root/n-heptane/projects/haskell/palmos/sdk-5r3/include/
> configure:7769: m68k-palmos-gcc -I=/root/n-heptane/projects/haskell/ 
> palmos/sdk-5r3/include/  conftest.c
> /usr/lib/gcc-lib/m68k-palmos/2.95.3-kgpd/libgcc.a(_exit.o)(.text 
> +0x10): In function `exit':
> libgcc2.c: undefined reference to `_cleanup'
> /usr/lib/gcc-lib/m68k-palmos/2.95.3-kgpd/libgcc.a(_exit.o)(.text 
> +0x16):libgcc2.c: undefined reference to `_exit'
> collect2: ld returned 1 exit status

Did you set LDFLAGS to point to the prc-tools directory and set the  
first available 'ld' executable to the prc-tools 'ld'?  I would help  
more but I am using darwinports to build prc-tools (I have not  
experience with prc-tools or PalmOS) and it fails to build (partly  
because Apple gcc 4.0.1 defaults to a dynamic C++ library, so  
prebinding fails... there is an easy workaround so once I get enough  
CPU-time to rebuild it I will try poking around some more.

> And, around this time, my interest in running yhi on PalmOS starts to
> wane.

Awww... to my knowledge, that would be the first Haskell  
implementation for PalmOS :)  As I mentioned in a prior email, there  
is a Haskell arbitrary precision number library (BigFloat, at http:// 
bignum.sourceforge.net/).  You might adapt it for Integer and add it  
to Yhc if nothing else works.  I'm not crazy about BigFloat's  
performance, though.

Cheers,
Pete


More information about the Glasgow-haskell-users mailing list