[uClinux-dev] address error

John D. Charlton j.d.charlton at ieee.org
Thu Nov 1 12:04:33 EST 2001


David,

Thanks for your help.  I am able to build and run the test app which uses 
only integer operations.  The combination that works is to let the 
m68k-elf-gcc use its own choice of crt0.o and to specify the libc.a that 
comes with the uClinux-distribution.  Also, remove the -msoft-float as you 
suggested.

The original intent of the testFP.c was to test floating point.  The floating 
point is not yet working, but I suspect I need to use a later version uClibc 
or rebuild it with -DFLOATS. There are currently build problems with the 
version of uClibc in the CVS for the uCdimm platform.  I am following some of 
the leads posted in the archives for uClinux-dev and uClibc for floats.

--John

make -k 
m68k-elf-gcc -m68000 -Os -g -fomit-frame-pointer -DCONFIG_LINEO   -Dlinux 
-D__linux__ -Dunix -D__uClinux__ -DEMBED -fno-builtin -msep-data -I. -I 
/opt/uClinux/linux-2.4.x/include -I /opt/uClinux/lib/libc/include -o testFP 
testFP.c -Wl,-elf2flt -L/opt/uClinux/lib/libc 
-L/usr/local/lib/gcc-lib/m68k-elf/2.95.3/m68000/msep-data -lc -lgcc


# ./testFP
c = 9, d = 9
LIBC:PRINTF float not implementedx = # 
# 

On Wednesday 31 October 2001 22:54, you wrote:
> John,
>
> Do not use -msoft-float,  it will break your build by actually generating
> 68020 code,  the -m68000 implies soft float because it never had hard
> float ;-)
>
> Cheers,
> Davidm
>
> Jivin John D. Charlton lays it down ...
>
> > I have built and installed a new 2.4.x uClinux kernel on a uCdimm using
> > the uClinux coldfire distribution: uClinux-distribution-20010622.tar.gz
> > and the tools: m68k-elf-tools-20010716.tar.gz
> >
> > The kernel boots without error, as well as networking and all of the apps
> > that I have tried such as rdate, telnet and boa.
> >
> > When I attempt to build the following test program, it fails on execution
> > with a memory error.  I would appreciate any ideas you have on what I am
> > doing wrong.
> >
> > --John
> >
> > testFP.c:
> >
> > #include <stdio.h>
> >
> > int main(int argc, char *argv[])
> > {
> >   int a, b, c, d;
> >
> >   a = 99;
> >   b = 10;
> >   c = a % b;
> >   d = a - ((a/b) * b);
> >   printf("c = %d, d = %d\n", c, d);
> > }
> >
> >
> > make -k
> > m68k-elf-gcc -m68000 -v -Os -g -fomit-frame-pointer -DCONFIG_LINEO  
> > -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -fno-builtin -msep-data
> > -msoft-float -I. -I /opt/uClinux/linux-2.4.x/include -I
> > /opt/uClinux/lib/libc/include -o testFP testFP.c -Wl,-elf2flt
> > -nostartfiles /opt/uClinux/lib/libc/crt0.o /opt/uClinux/lib/libc/libc.a
> > -L/opt/uClinux/lib/libc
> > -L/usr/local/lib/gcc-lib/m68k-elf/2.95.3/m68000/msep-data -lgcc
> > Reading specs from /usr/local/lib/gcc-lib/m68k-elf/2.95.3/specs
> > gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from
> > http://fiddes.net/coldfire/)(-msep-data patches)
> >  /usr/local/lib/gcc-lib/m68k-elf/2.95.3/cpp0 -lang-c -v -I. -I
> > /opt/uClinux/linux-2.4.x/include -I /opt/uClinux/lib/libc/include
> > -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dmc68000 -D__embedded__ -D__mc68000__
> > -D__embedded__ -D__mc68000 -Asystem(embedded) -Amachine(mc68000)
> > -D__OPTIMIZE_SIZE__ -D__OPTIMIZE__ -g -D__PIC__ -D__pic__ -DCONFIG_LINEO
> > -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED testFP.c /tmp/cchA4UsW.i
> > GNU CPP version 2.95.3 20010315 (release)(ColdFire patches - 20010318
> > from http://fiddes.net/coldfire/)(-msep-data patches) (68k, MIT syntax)
> > #include "..." search starts here:
> > #include <...> search starts here:
> >  .
> >  /opt/uClinux/linux-2.4.x/include
> >  /opt/uClinux/lib/libc/include
> >  /usr/local/lib/gcc-lib/m68k-elf/2.95.3/include
> >  /usr/local/lib/gcc-lib/m68k-elf/2.95.3/../../../../m68k-elf/sys-include
> >  /usr/local/lib/gcc-lib/m68k-elf/2.95.3/../../../../m68k-elf/include
> > End of search list.
> > The following default directories have been omitted from the search path:
> >  /usr/local/lib/gcc-lib/m68k-elf/2.95.3/../../../../include/g++-3
> > End of omitted list.
> >  /usr/local/lib/gcc-lib/m68k-elf/2.95.3/cc1 /tmp/cchA4UsW.i -quiet
> > -dumpbase testFP.c -m68000 -msep-data -msoft-float -g -Os -version
> > -fomit-frame-pointer -fno-builtin -o /tmp/ccaVj25N.s
> > GNU C version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from
> > http://fiddes.net/coldfire/)(-msep-data patches) (m68k-elf) compiled by
> > GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).
> >  /usr/local/m68k-elf/bin/as -mno-68881 -m68000 --pcrel -o /tmp/ccvgW02F.o
> > /tmp/ccaVj25N.s
> >  /usr/local/lib/gcc-lib/m68k-elf/2.95.3/collect2 -o testFP
> > -L/opt/uClinux/lib/libc
> > -L/usr/local/lib/gcc-lib/m68k-elf/2.95.3/m68000/msep-data
> > -L/usr/local/lib/gcc-lib/m68k-elf/2.95.3 -L/usr/local/m68k-elf/lib
> > /tmp/ccvgW02F.o -elf2flt /opt/uClinux/lib/libc/crt0.o
> > /opt/uClinux/lib/libc/libc.a -lgcc -lgcc -lgcc
> >
> >
> > When I run the program, I get the following address error and reboot:
> >
> > # ./testFP
> > address error
> > PC[0014d046] SSP[00151ff0] USP[0014bf8c]     BootstrapSP[0001ff6e]
> >
> >     D0       D1       D2       D3       D4       D5       D6       D7
> > 00000000 000b52e0 000a0484 000a0418 000a0468 0014a000 00000001 00000000
> >     A0       A1       A2       A3       A4       A5       A6
> > 000b45e1 000a046a 000b4af4 000b52e9 000b47d0 000b4000 10d2f450
> > B$
> > This message resent by the uclinux-dev at uclinux.org list server
> > http://www.uClinux.org/
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/



More information about the uClinux-dev mailing list