This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Some successes... and a question


Hi all,

With the help of many suggestions, I have moved a couple of steps forward in
my quest to build a cross development system where the target is m68k-coff.

With the latest suggestions re: where to put include files so the
newlib-1.8.2 would compile, I am happy to say that it did compile and was
installed!

(While my ultimate aim is to develop code for the 68332, and thus may need
to tackle gcc-2.95.x, I am still trying to get through an entire cross dev.
system for the m68k-coff - I am learning much!)

After the install of newlib, I think I've got all the pieces in place:

1. binutils was made and installed with the target being m68k-coff
2. gcc 2.8.1 was made and installed with the same target
3. newlib-1.8.2 was made and installed with the same target

So, now I'm ready to compile a simple program, like hello.c, shown here:

<mbp@mp1> more hello.c
#include <stdio.h>

main()
{
        printf("Hello, world\n");
}

When I issue the following command:

<mbp@mp1> m68k-coff-gcc -bm68k-coff -v -o hello hello.c

I get the following (sorry for the way things wrap!!!):

It seems like there is trouble with crt0.o (and an associated file crt0.S)
and some undefined references.

I'm wondering if either the newlib build or install didn't work properly, of
if I've got some other problem.

Can anyone give me some hints as to what I might look at to solve these
problems.

Many thanks!

******* Output from above command ************

Reading specs from /usr/local/lib/gcc-lib/m68k-coff/2.8.1/specs
gcc version 2.8.1
 /usr/local/lib/gcc-lib/m68k-coff/2.8.1/cpp -lang-c -v -undef -D__GNUC__=2
-D__GNUC_MINOR__=8 -Dmc6800
0 -D__embedded__ -D__mc68000__ -D__embedded__ -D__mc68000 -Asystem(embedded)
-Amachine(mc68000) -D__HA
VE_68881__ -Dmc68020 -D__mc68020 -D__mc68020__ hello.c /var/tmp/cc016847.i
GNU CPP version 2.8.1 (68k, Motorola syntax)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc-lib/m68k-coff/2.8.1/include
 /usr/local/m68k-coff/include
End of search list.
 /usr/local/lib/gcc-lib/m68k-coff/2.8.1/cc1 /var/tmp/cc016847.i -quiet
-dumpbase hello.c -version -o /
var/tmp/cc016847.s
GNU C version 2.8.1 (m68k-coff) compiled by GNU C version 2.8.1.
 /usr/local/m68k-coff/bin/as -mc68020 -o /var/tmp/cc0168471.o
/var/tmp/cc016847.s
 /usr/local/m68k-coff/bin/ld -o hello /usr/local/m68k-coff/lib/crt0.o
-L/usr/local/lib/gcc-lib/m68k-coff/2.8.1 -L/usr/local/m68k-coff/lib
/var/tmp/cc0168471.o -lgcc -lgcc
/usr/local/m68k-coff/lib/crt0.o:../../../../newlib-1.8.2/libgloss/m68k/crt0.
S:16: undefined reference
to `hardware_init_hook'
/usr/local/m68k-coff/lib/crt0.o(.text+0x48):../../../../newlib-1.8.2/libglos
s/m68k/crt0.S: undefined reference to `software_init_hook'
/usr/local/m68k-coff/lib/crt0.o(.text+0x58):../../../../newlib-1.8.2/libglos
s/m68k/crt0.S: undefined reference to `__FINI_SECTION__'
/usr/local/m68k-coff/lib/crt0.o(.text+0x5e):../../../../newlib-1.8.2/libglos
s/m68k/crt0.S: undefined reference to `atexit'
/usr/local/m68k-coff/lib/crt0.o(.text+0x64):../../../../newlib-1.8.2/libglos
s/m68k/crt0.S: undefined reference to `__INIT_SECTION__'
/var/tmp/cc0168471.o(.text+0x1e):hello.c: undefined reference to `printf'
/usr/local/lib/gcc-lib/m68k-coff/2.8.1/libgcc.a(_exit.o): In function
`exit':
/h/crossgcc/build-gcc/../gnu-2.8.1/gcc/libgcc2.c(.text+0x12): undefined
reference to `_cleanup'
/h/crossgcc/build-gcc/../gnu-2.8.1/gcc/libgcc2.c(.text+0x1a): undefined
reference to `_exit'


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]