GNU MP - PPC 440 build observation
morten simonsen
ms at protelevision.com
Tue Nov 29 04:05:56 CET 2011
Thanks for the advice, I did find an aliasing compiler difference between the GCC for my host environment and the GCC used for the crosscompilation to target.
The forcing into memory is due to a preallocated and preinitialized stack of "mpf_t" working variables.
Regretfully I still seem to have issues - tried a small program on target:
#include "stdio.h"
#include <stdarg.h>
#include <syslog.h>
#include <gmp.h>
void ka_test() {
syslog(LOG_ERR,"%s llets startup ...",__FILE__);
mpf_t tmp1,tmp2;
double r=2.5;
double i=1.234;
mpf_init(tmp1);
mpf_init(tmp2);
syslog(LOG_ERR,"tmp1:%f(%f) re:%f im:%f",mpf_get_d(tmp1),mpf_get_d(tmp2),r,i);
mpf_set_d(tmp1,r);
syslog(LOG_ERR,"tmp2:%f(%f) re:%f im:%f",mpf_get_d(tmp1),mpf_get_d(tmp2),r,i);
mpf_set_d(tmp2,i);
syslog(LOG_ERR,"tmp3:%f(%f) re:%f im:%f",mpf_get_d(tmp1),mpf_get_d(tmp2),r,i);
mpf_clear(tmp1);
mpf_clear(tmp2);
}
int main(int ac, char *av[])
{
ka_test();
}
Which yield the following output:
/tmp # ./ka_test
ka_test: ka_test.c llets startup ...
ka_test: tmp1:0.000000(0.000000) re:2.500000 im:1.234000
ka_test: tmp2:2.500000(2.500000) re:2.500000 im:1.234000
extract-dbl.c:56: GNU MP assertion failed: d >= 0.0
ka_test: /usr/lib/libdebug.so [0xffdeff4]
ka_test: [0x100380]
ka_test: [0x1e1d]
ka_test: /lib/libc.so.6(abort+0xdc) [0xfec0adc]
ka_test: ./ka_test [0x100010c8]
ka_test: ./ka_test [0x10001148]
ka_test: ./ka_test [0x100008c0]
ka_test: ./ka_test [0x10000614]
ka_test: /lib/libc.so.6 [0xfea989c]
ka_test: /lib/libc.so.6 [0xfea99ac]
ka_test: I'm dying with signal 6 (code -6) for address 0x0x131 at pc
0xfebf3d0
ka_test: Starting gdbsever on port 7900 for this process 305
Attached; pid = 305
Listening on port 7900
This gives an assertion and the mpf_set_d(tmp1,r) seems to end up assigning r to tmp2 as well.
Any ideas as to what can cause such observation?
Thanks, br
Morten
More information about the gmp-discuss
mailing list