New Dreamcast toolchain build script

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

New Dreamcast toolchain build script

Post by BlueCrab »

I have created a script for use with the shell of MSYS to create a MinGW hosted cross-compiler toolchain for the Dreamcast. The script itself should work with just about any other development environment (Cygwin, Linux) but I haven't tested it on such systems. This script even builds the g++ program that never seems to compile (this step takes an enormous amount of time however, prepare to leave your computer running for a few hours). I welcome your comments on how to improve the script in the future.

Get the script from this address - http://vmudomain.tripod.com/.

Hope this helps anyone who has trouble doing this!

Note: This script requires the MSYS-DTK package along with the wget program to be installed on MSYS
Soilwork
DCEmu Freak
DCEmu Freak
Posts: 66
Joined: Sat Jul 06, 2002 7:40 am
Location: France
Has thanked: 0
Been thanked: 0
Contact:

Post by Soilwork »

BlueCrab wrote:This script even builds the g++ program that never seems to compile (this step takes an enormous amount of time however, prepare to leave your computer running for a few hours).
Hmm, does it really build g++ ? Wouldn't like to waste a couple of hours trying that new script (would be the 4th I try) if it end up failing on my pooter..
"And then... I'm glad I found true friends..."
"Avant de mourir, je suis heureux d'avoir eu des amis..."
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Post by BlueCrab »

I got it to build g++ just fine with my BAD (really) computer:
Pentium II 400 mhz
128 MB RAM
Windows 98
MinGW runtime 2.0
MSYS 1.0.8
w32api 1.5 (patched by the script)
MSYS-DTK package

Output from system:
L.J.@PROTEVA /mingw/cross/dc/sh-elf/bin
$ ./sh-elf-g++ -v
Reading specs from c:\mingw\cross\dc\sh-elf\bin\..\lib\gcc-lib\sh-elf\3.1\specs
Configured with: ../gcc-3.1/configure --prefix=/mingw/cross/dc/sh-elf --target=sh-elf --without-headers --with-newlib --enable-languages=c : (reconfigured) ../gcc-3.1/configure --prefix=/mingw/cross/dc/sh-elf --target=sh-elf --without-headers --with-newlib --enable-languages=c,c++
Thread model: single
gcc version 3.1

And it seems to compile the KOS cpp examples just fine! But remember the script is designed to run on MSYS so if you are using something else, your mileage may vary. Be forewarned however, the build of g++ does fail part of the way through, but the script expects this and attempts to continue after making two files to fix dependancy problems with gcc.

I wish you luck in getting my script to work, and please tell me any problems you have in getting it to work other than what was mentioned above!
Soilwork
DCEmu Freak
DCEmu Freak
Posts: 66
Joined: Sat Jul 06, 2002 7:40 am
Location: France
Has thanked: 0
Been thanked: 0
Contact:

Post by Soilwork »

Hi,
Thanks for the explanations. I've taken a look at your script and the comments in it before running it anyway :)
I ran it last night, and you can't imagine how disappointed I was when I got up this morning and found out that it hadn't worked :( The script couldn't find G++ in the end and aborted - I forgot to copy the error messages I got just before the end though :(

My config:
PIII 1GHz
256 MB SDRAM
Freshly formatted hard disk with no crap on it ;) (except AOL 5.0.. lol)
Cygwin, very recent and very complete version, my modem's still very hot
gcc-3.0.3
newlib-1.9.0
binutils-2.11.2

A question :
w32api 1.5 (patched by the script)
Do I have to apply the patch as well? I think I saw somewhere it was only for mingw but I m not too sure about that!

Anyway, thanks for the time you spent replying to me and good luck for your RPG ! I'll have to use C as I really seem to be cursed, C++-wise!

See you later
++
Soilwork
"And then... I'm glad I found true friends..."
"Avant de mourir, je suis heureux d'avoir eu des amis..."
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Post by BlueCrab »

I had a lot of trouble with cygwin before, that's why I used MSYS. You don't need the patch because yes, its MinGW specific. I'll have to try to debug the script in cygwin some... Sorry it didn't work out for you :cry: , maybe I'll figure out why. Now off to do some debugging.... I'll update you if I figure out what's wrong...

Edit:
Oh and BTW, if you are REALLY determined to get g++, you could download a prebuilt toolchain like the one on the develop now! section of dcemu. I used that before on cygwin, and it worked fine. Be warned, it is a VERY large download. Back to more 12:40 AM debugging....
Soilwork
DCEmu Freak
DCEmu Freak
Posts: 66
Joined: Sat Jul 06, 2002 7:40 am
Location: France
Has thanked: 0
Been thanked: 0
Contact:

Post by Soilwork »

Hey,
Thanks for the hint on the pre-built toolchain, I'm gonna download and try it soonish!
Right now I'm about to re-run your script and this time I'll copy the error messages (If I get any :mrgreen:), maybe they'll help you figure out what's wrong (and help me hehe)
See you later and thanks again
++
Soilwork
"And then... I'm glad I found true friends..."
"Avant de mourir, je suis heureux d'avoir eu des amis..."
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Post by BlueCrab »

Your welcome for the info. And please let me know what it tells you, if it's the same error I used to get with Cygwin (something abot a resource being unavailable) I will have to assume that it is Cygwin. Thanks for your help in advance!
Synlor
Official DCEMU Stalker
Official DCEMU Stalker
Posts: 1604
Joined: Tue Apr 23, 2002 6:26 pm
Location: South Dakota
Has thanked: 0
Been thanked: 0
Contact:

Post by Synlor »

i think some of the problems may be memory. right click on cygwin.bat, and select properties. click the memory tab. change the initial environment to 4096. that fixed a lot of problems i had a long time ago, the first time i made the toolchain
Image
Thanks to Digital Chaos, GoldbergWWE, and ace for the avatar, sig, and badge!
http://devcast.dcemulation.com
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Post by BlueCrab »

Thanks for the tip, now back to debugging!
Soilwork
DCEmu Freak
DCEmu Freak
Posts: 66
Joined: Sat Jul 06, 2002 7:40 am
Location: France
Has thanked: 0
Been thanked: 0
Contact:

Post by Soilwork »

Hiya,
Here are the error messages I get at the end.
make[5]: Entering directory `/install/build-sh4-gcc/sh-elf/ml/libstdc++-v3'
make[5]: *** No rule to make target `all'. Stop.
make[5]: Leaving directory `/install/build-sh4-gcc/sh-elf/ml/libstdc++-v3'
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory `/install/build-sh4-gcc/sh-elf/libstdc++-v3'
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory `/install/build-sh4-gcc/sh-elf/libstdc++-v3'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/install/build-sh4-gcc/sh-elf/libstdc++-v3'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory `/install/build-sh4-gcc/sh-elf/libstdc++-v3'
make: *** [all-target-libstdc++-v3] Error 2
Build of gcc with c++ support failed!
Aborting script
and thanks for the tip corta!
++
Soilwork
"And then... I'm glad I found true friends..."
"Avant de mourir, je suis heureux d'avoir eu des amis..."
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Post by BlueCrab »

That's odd... mine seems to have messed up at a different directory than yours :? :? :? Here's what I ended up with:
make[5]: Entering directory `/home/L.J./build-sh4-gcc/sh-elf/m4-single-only/libs
tdc++-v3'
make[5]: *** No rule to make target `all'. Stop.
make[5]: Leaving directory `/home/L.J./build-sh4-gcc/sh-elf/m4-single-only/libst
dc++-v3'
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory `/home/L.J./build-sh4-gcc/sh-elf/libstdc++-v3'
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory `/home/L.J./build-sh4-gcc/sh-elf/libstdc++-v3'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/L.J./build-sh4-gcc/sh-elf/libstdc++-v3'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory `/home/L.J./build-sh4-gcc/sh-elf/libstdc++-v3'
make: *** [all-target-libstdc++-v3] Error 2

Now I'm really confused :? :? :? :?
Soilwork
DCEmu Freak
DCEmu Freak
Posts: 66
Joined: Sat Jul 06, 2002 7:40 am
Location: France
Has thanked: 0
Been thanked: 0
Contact:

Post by Soilwork »

Wish I could help but I know nothing about make and makefiles :( I'm actually wondering if I'll ever be able to write my own makefiles or if I'll always take the sample ones and modify them to match my files.
It could be worse, though, if I had to modify my filenames to match the makefiles :lol:, calling all my source files 'firstexample.c' :mrgreen: But I'm not that bad :wink: lol
"And then... I'm glad I found true friends..."
"Avant de mourir, je suis heureux d'avoir eu des amis..."
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Post by BlueCrab »

Hey don't feel bad about taking the example makefiles and changing them, all of the Dreamcast related makefiles in my RPG project are modified forms of one of the KOS example makefiles (I don't remember which one!).
Anyway, back on topic, it seems after the doing the tip that corta gave, doing a make clean, and then starting the script again, that it will actually build on my computer's copy of Cygwin (at least it hasn't messed up yet!)! Now hopefully it will actually finish without error....
Soilwork
DCEmu Freak
DCEmu Freak
Posts: 66
Joined: Sat Jul 06, 2002 7:40 am
Location: France
Has thanked: 0
Been thanked: 0
Contact:

Post by Soilwork »

So, did it work ? I tried it again with Corta's tip but it failed at the exact same place.
So I downloaded the pre-built toolchain. But I had a problem with it too.. When I extracted the archive, I had 2 corrupted files :(
! C:\Tmp\SH4-Arm-Tools\sh4_arm_tools_win32.rar: Le CRC a ?chou? dans dc\sh-elf\sh-elf\lib\ml\libiberty.a. Le fichier est corrompu
! C:\Tmp\SH4-Arm-Tools\sh4_arm_tools_win32.rar: Le CRC a ?chou? dans dc\sh-elf\sh-elf\lib\ml\m2\libc.a. Le fichier est corrompu
However it seemed to work just fine when I tried to make kos (I haven't tried to run the examples but I didn't get any error message - except for the conio/adventure bit).
And I even have a working G++ ;)

++
Soilwork
PS: How is your RPG progressing?
"And then... I'm glad I found true friends..."
"Avant de mourir, je suis heureux d'avoir eu des amis..."
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Post by BlueCrab »

Well I wish you luck, and sorry I haven't responded but I was on vacation for the past week without internet access (I did however have my dreamcast, just no internet access). And to answer your question about my RPG, not very well b/c I've been gone! Well back to work on it! 8)
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5661
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Post by BlueCrab »

Anyone who has used my script on MinGW/MSYS, previous to 9:15 PM EDT August 19, 2002 needs to run it again with the dc_kos command to fix genromfs. The version I previously had available did not work at all, this one does. Sorry for any inconvenience.
Post Reply