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]

Re: Getting Closer


Hi Kai,

Continuing from earlier, I am working on your suggestion to see if I can
find what is different between the windows version and the unix version.

>From before, I worked out a sequence of commands that will successfully
compile 'hello.c' on the unix system and produce an S-record file.

Here is the sequence:

-----------------------------------------------------------------
#!/bin/sh

FN=hello

echo "Producing $FN.o..."
m68k-coff-gcc -m68332 -c $FN.c

echo "Producing rm_crt0.o from rm_crt.S..."
m68k-coff-gcc -m68332 -c rm_crt0.S

echo "Producing $FN.cof using ld..."
m68k-coff-ld -o $FN.cof \
  -L/usr/local/lib/gcc-lib/m68k-coff/2.8.1 \
  -L/usr/local/m68k-coff/lib \
   $FN.o -lc -lbcc -lgcc -T rm_rom.ld -M > $FN.map

echo "Producing S-record output..."
m68k-coff-objcopy -O srec $FN.cof $FN.txt

tr -d '\r' < $FN.txt > $FN.s19
cp $FN.s19 /hfs
finderinfo -C MUMM -T TEXT /hfs/$FN.s19

echo "New output is in /hfs/$FN.s19"
-----------------------------------------------------------------

I am not anywhere where I can download the S-record file to see if it works,
but past experience leads me to believe it won't - but I will try it.

The next step I thought worth taking is to bring over the libc.a, libbcc.a
and libgcc.a from the windows side and use them as arguments to the linker.
I did that and put them in the directory that the hello.c file is in and
here is the ld command which I used:

m68k-coff-ld -v -o $FN.cof \
  -L. \
   $FN.o -lc -lbcc -lgcc -T rm_rom.ld -M > $FN.map

Where $FN is 'hello'.  When I execute that command, I get:

./libc.a(exit.o)(.text+0x52):exit.c: undefined reference to `_exit'
./libc.a(sbrkr.o)(.text+0x12):sbrkr.c: undefined reference to `sbrk'
./libc.a(makebuf.o)(.text+0xdc):makebuf.c: undefined reference to `isatty'
./libc.a(readr.o)(.text+0x1a):readr.c: undefined reference to `read'
./libc.a(lseekr.o)(.text+0x1a):lseekr.c: undefined reference to `lseek'
./libc.a(writer.o)(.text+0x1a):writer.c: undefined reference to `write'
./libc.a(closer.o)(.text+0x12):closer.c: undefined reference to `close'
./libc.a(fstatr.o)(.text+0x16):fstatr.c: undefined reference to `fstat'

This seems odd since all of these are declared in the libbcc.a library in
the directory. Here is the output from ar:

m68k-coff-ar tv libbcc.a
rw-rw-r-- 500/500   4440 Aug 13 22:23 1999 fstat.o
rw-rw-r-- 500/500   2212 Aug 13 22:23 1999 getpid.o
rw-rw-r-- 500/500   2234 Aug 13 22:23 1999 isatty.o
rw-rw-r-- 500/500   2322 Aug 13 22:23 1999 kill.o
rw-rw-r-- 500/500   2610 Aug 13 22:23 1999 putnum.o
rw-rw-r-- 500/500   6510 Aug 13 22:23 1999 stat.o
rw-rw-r-- 500/500   4318 Aug 13 22:23 1999 unlink.o
rw-rw-r-- 500/500   5546 Aug 13 22:23 1999 lseek.o
rw-rw-r-- 500/500   4484 Aug 13 22:23 1999 sbrk.o
rw-rw-r-- 500/500   2232 Aug 13 22:23 1999 close.o
rw-rw-r-- 500/500   4360 Aug 13 22:23 1999 open.o
rw-rw-r-- 500/500   2396 Aug 13 22:23 1999 print.o
rw-rw-r-- 500/500   2876 Aug 13 22:23 1999 read.o
rw-rw-r-- 500/500   2532 Aug 13 22:23 1999 write.o
rw-rw-r-- 500/500   1507 Aug 13 22:23 1999 cpu32bug.o


Changing the order of libbcc.a and libc.a does not seem to make a
difference.

I don't quite know where to go from here. Do you have any suggestions?

In the meantime, I will check what libs the windows version is calling. As
you suggest, this might give us a clue...




------
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]