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]

Getting closer to working cross compiler...


Hi everyone,

With the generous help of many on this list, it looks like I have a working
cross-compiler. I say working and what I mean is that now I can issue
commands like:

m68k-coff-gcc -o hello hello.c

or

m68k-coff-gcc -oformat=srec -o hello hello.c

and files are generated. In the case of the second, a file with S-records is
generated.

I am trying to get to the point where I can download S-record files to my
board and have it work.  It is probably apparent, but in the spirit of full
disclosure let me say that I have never worked in this kind of environment
before. I have recently purchased a board with an mc68332 chip on it for
hobby robotics.

I downloaded the generated S-record file (mentioned above) to the board, but
it wouldn't run like an example that came with the board. So, I'm still
missing some critical pieces. (And still missing some critical "mental maps"
related to how all this works!)

Along with the board came an implementation of gcc for Windows. (I prefer to
do my work under Unix, which is why I'm attempting to build the
cross-compiler rather than just using the one that came with the board.)

An example "hello.c" came with it. I have loaded the gcc for Windows on my
Mac (running a Windows emulator) and can compile and download the resulting
S-record file and have it work.  The directions that came with this example
say that I must have the following 3 files in the directory with my source
when I issue the gcc command. These files are:

RM_CRT0.o
rm_rom.ld
stddef.h

It is my suspicion that these files (and maybe others) need to be accessible
and in the right places...

OK, I just had an insight and although it is taking a little while to put 2
and 2 together, I just remembered that one of the suggestions from Kai
Ruottu was to edit my specs file and add a reference to bcc.ld to the *lib
section.  At that time I was doing that by rote, not understanding why.  I
can't say that I understand much more right now, but I'm guessing that the
file rm_rom.ld file should go in my /usr/local/m68k-coff/lib directory and
that I should edit the specs file to access this file rather than bcc.ld. If
anyone can confirm that or give me more correct directions, I'd appreciate
it.

If the above is correct, I still have at least two more files to deal with.
The stddef.h file does not have that much info in it and I include it here:

------------------------------
#define FALSE 0
#define TRUE  1

#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define sign(a)  ((a)<0?(-1):(1))
#define signzero(a) ((a)<0?(-1):((a)==0?(0):(1)))
#define abs(a)   ((a)<0?(-(a)):(a))
#define abslim(a,b) ((b)>(a)?(a):((b)<(-(a))?(-(a)):(b)))

#define hextochar(a) ((a)>9?((a)-10+'A'):((a)+'0'))
((a)+'0'))
------------------------------

The stddef.h file in /usr/local/lib/gcc-lib/m68k-coff/2.8.1/include/stddef.h
is much longer and does not include the function definitions that this
stddef.h file contains. So, my question: is this stddef.h file necessary and
if so, where should I put it (I know I've just set myself up for all kinds
of amusing comments, have mercy, ok?).

The last file is RM_CRT0.o.  There is also included a RM_CRT0.S which I'm
sure I can use to produce a .o file. My question is, of course, where should
the file go so that it is included appropriately when I use m68k-coff-gcc to
compile things?  Should a reference to it go into the specs file, and if so,
which section (*startfile???)?

Naturally, any help, suggestions, advice, recommendations, etc. will be
greatly appreciated.

Thanks.



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