16 bit cross compilation

Inge Witsoe Inge.Witsoe at q-free.com
Tue Jan 2 12:06:29 CET 2007


 

> -----Original Message-----
> From: tege at king.swox.se [mailto:tege at king.swox.se] On Behalf Of 
> Torbjorn Granlund
> Sent: 29. desember 2006 17:27
> To: Inge.Witsoe at q-free.com
> Cc: gmp-discuss at swox.com
> Subject: 16 bit cross compilation
> 
>>   - The configure script concludes that a file system is available
(probably
>>   because a stdio.h is available), and sets _GMP_H_HAVE_FILE, which leeds
to a
>>   lot of compilation errors.
> 
> Well, I don't think it is because the absense or presence of a file
system.
> If you get compilation errors, it is a bug in your stdio.h, or a bug in
GMP.

It seems like I left out some important information. What happens is that
since _GMP_H_HAVE_FILE is defined (caused by the fact that stdio.h exists),
a lot of file system related code is included when compiling GMP. The FILE
type is not defined in the msp430 compiler. This will generate a lot of
compilation errors when compiling gmp.h (see for instance function
gmp_fprintf).

I also have another problem: For test purposes I have made a 16 bit
(generic) GMP library for PC, but when running it, my test program produces
wrong results. mpn_mul_n is working fine, but mpn_tdiv_qr is not. Do you
have any tip about where I should start looking for the problem?

This is my procedure for making the 16 bit library (since I am only using
MPN functions, I am doing a few shortcuts):

Change the following files:
    gmp/mp-h.in:
        Insert "#define __GMP_SHORT_LIMB" before the mp_limb_t definition.
        Change definition of mp_limb_t and mp_limb_signed_t from int to
short int.
    gmp/gmp-h.in:
        Insert "#define __GMP_SHORT_LIMB" before the mp_limb_t definition.
        Change definition of mp_limb_t and mp_limb_signed_t from int to
short int.
    gmp/mpq/set_d.c:
        Remove line 33 ("choke me").
        Remove content of function mpq_set_d.
    gmp/extract-dbl.c:
        Remove content of function __gmp_extract_double.
Execute:
    configure --disable-shared --host=none-unknown-windows --disable-fft
    make

Inge



More information about the gmp-discuss mailing list