This setup will use the vlink linker included with the XP SDK package since it makes possible the ability to convert different object formats to a single format at the end of the link along with supporting ELF and the Jaguar's GPU. If you're an entrenched SLN user you're on your own.
After that install the m68k ELF GCC cross-compiler for Windows from here:
http://gnutoolchains.com/m68k-elf/
To start you off I've included a zip of the entire directory I used. It includes everything needed to work with this for either ELF or standard Jaguar bjl/emulator a.out output with the change of practically only a single Makefile line. Later you can of course take these files and cannibalize them to your hearts delight. Linker scripts are available in the Hello2 download for converting back and forth if that's all you need. (JagELFLS for converting everything to ELF and JagbinLS for converting everything to standard a.out bin)
Once you get this setup wherever you wish( for instance mine was in my gcc m68k elf folder) you can choose which type of build you want. In the makefile are two lines, one of which will be remarked out( # ).
Code: Select all
jag : $(OFILES)
vlink -brawbin1 -EB -TJagbinls $(OFILES) $(LINKEROPT) -o jag.bin
# vlink -t -n -EB -belf32m68k -TJagElfls $(OFILES) $(LINKEROPT) -o jagElf.bin
Debugging using gdb and Skunkboard
If you have a skunkboard and wish to debug with GCC you can enable debugging '-g' in the compiler line and swap out the remarked out line with the unremarked line.
Code: Select all
jag : $(OFILES)
vlink -t -n -EB -belf32m68k -TJagElfls $(OFILES) $(LINKEROPT) -o jagElf.bin
#vlink -brawbin1 -EB -TJagbinls $(OFILES) $(LINKEROPT) -o jag.bin
Code: Select all
m68k-elf-gcc-4.8.0 -c -m68000 -s -DJAGUAR -O2 -o jag.o jag.c
Make sure to prepare the proper makefile spacing for the first vlink line and its ready to make a debug capable ELF file for the Skunkboard to upload and step through.
Beyond that if you dont have a skunkboard you can still use the GCC for C++ theoretically on the Jag or Java?? or whatever else GCC may support. In theory. Nothing beyond standard C has been tested.
After downloading the 'Hello2' directory then typing 'make clean' and then 'make' you should see something like this:
Code: Select all
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
c:\stuff\m68k-elf\hello2>make clean
Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
del *.o
del *.bin
c:\stuff\m68k-elf\hello2>make
Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
smac -fb startup.s
startup.s[82]: Warning: GPU/DSP code outside of absolute section
m68k-elf-gcc-4.8.0 -c -m68000 -s -DJAGUAR -O2 -o jag.o jag.c
vlink -brawbin1 -EB -TJagbinls startup.o jag.o -L/jaguar/lib -lvbcc -o
jag.bin
c:\stuff\m68k-elf\hello2>
http://www.youtube.com/watch?v=BFKp00xROcU
This is showing a quick way to get up and running fast with GCC using the Belboz SDKs since all the setpaths will be done for vlink, smac, the Jaguar libs and GCC etc by the respective install programs so your system will just know where to find everything right away. Of course this setup is kinda cluttery and will drive some people nuts. This is just a quick proof of concept and in no way the most elegant solution. Beyond this you're on your own setting up your own dev enviroment with its own unique setpaths and arrangements more to your individual tastes.
For using standard C without ELF it is strongly recommended you use the basic vbcc compiler setup. Since the proceeding post after this one outlines the object file NAMES differences between a.out and ELF compilers I do not know if there would be some kind of issue with converting ELF to a.out on a regular basis. Proceed at your own risk. (I think it will probably be fine as I would suspect that vlink will take care of the object names differences issue but just a word of caution and something to be aware of.)
NOTE: As of the time of this posting the GCC was at 4.8.0 and the makefile calls that version. If by the time you read this and install it there is a new version then you will need to update the makefile line to reflect the change.
Please let me know if anything in these instructions is unclear or any problems are run into.
Thanks once again to..
Tursi for his patience...
Frank Wille for his awesome linker and his patience... lots of patience. Poor bastard.
Belboz for the original SDKs and getting Mr. Wille to make his linker compatible with the Jaguar in the first place.
And for the rest of you for bearing with me through my learning experiences.
That lion dude is awesome.