Getting started with programming again/

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.
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:

Re: Getting started with programming again/

Post by BlueCrab »

Well, I can see 3 potential reasons why that might be the case:
  • Newlib is more correct with regard to the standards, which takes up more space (most likely, IMO)
  • Some new GCC optimization pass produces more code, but with less branches or somesuch (also likely)
  • GCC is producing longer code for no particular reason
As long as it isn't option #3 above, I wouldn't be overly concerned (and its probably rather difficult to figure out exactly what is causing it). If you are concerned about binary size, try using -Os instead of -O2 (change the flags in the environ script and recompile KOS as well). -Os is the same as -O2, except it disables any optimizations that are known to increase code size.
patbier
DC Developer
DC Developer
Posts: 152
Joined: Fri Aug 29, 2003 1:25 am
Has thanked: 0
Been thanked: 0

Re: Getting started with programming again/

Post by patbier »

BlueCrab wrote:Well, I can see 3 potential reasons why that might be the case:
  • Newlib is more correct with regard to the standards, which takes up more space (most likely, IMO)
  • Some new GCC optimization pass produces more code, but with less branches or somesuch (also likely)
  • GCC is producing longer code for no particular reason
As long as it isn't option #3 above, I wouldn't be overly concerned (and its probably rather difficult to figure out exactly what is causing it). If you are concerned about binary size, try using -Os instead of -O2 (change the flags in the environ script and recompile KOS as well). -Os is the same as -O2, except it disables any optimizations that are known to increase code size.
I just tried the third point with Os, instead of O2 :


the changes : libkallisti.a is 1848 Ko (against 1949Ko with O2)
game.elf is 2559 Ko (against 2829 Ko with O2)

game.bin is 721 Ko (against 871 Ko with O2) so finally the Os is interesting !

So, it's important to see if O2 gives better performances than Os

I don't think I can easily benchmark my game.

the bin size isn't so important, but I thought the difference was due to knew functions in KOS.
Hope this helps !
ImageAlice Dreams Tournament Dreamcast fans : http://www.facebook.com/alicedreamst
In August 2015, we had to change "Dynamite Dreams" name to "Alice Dreams Tournament"
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Getting started with programming again/

Post by Chilly Willy »

10% is nothing. The new loop optimizations alone will easily explain 10% bigger code. Look at what -O2 turns on for 4.4.4: http://gcc.gnu.org/onlinedocs/gcc-4.4.4 ... ze-Options
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Has thanked: 0
Been thanked: 0
Contact:

Re: Getting started with programming again/

Post by emptythought »

I tried compiling KOS' current revision with GCC 3.4.6 but I had to use an older revision (561 at the very least).
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:

Re: Getting started with programming again/

Post by BlueCrab »

The problem likely isn't the GCC version, but rather the Newlib version, as the commit log for r662 says:
KOS as of commit 657 requires newlib 1.15.0.

* If newlib 1.15.0 is still deemed unstable, fix newlib.
Also, I severely doubt that you needed to use r561. I was still using 3.4.6 back then, I only fairly recently switched to 4.x.
Guaripolo
DCEmu Freak
DCEmu Freak
Posts: 89
Joined: Mon Jul 28, 2008 10:04 am
Has thanked: 0
Been thanked: 0

Re: Getting started with programming again/

Post by Guaripolo »

hi, i've compiled gcc 4.4.4, it works fine (thanks), but i'm getting this error in a specific project:

Code: Select all

kos-c++ -DDREAMCAST -O2 -Wall -Wextra -Wformat=2 -I/home/cabral/dreamcast/kos/../kos-ports/include/SDL  -c sources/gameobjects.cpp -o sources/gameobjects.o
In file included from sources/gameobjects.cpp:12:
sources/tiles.h:23: warning: unused parameter 'colbuffer'
sources/gameobjects.cpp: In function 'void GameObjectAnimation(int, int)':
sources/gameobjects.cpp:6071: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [sources/gameobjects.o] Error 1
in other things that i've tested it worked pretty fine. This file in particular has more than 6000 lines of code (about 200k size). ¿is it a gcc bug? Thanks in advance.
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:

Re: Getting started with programming again/

Post by BlueCrab »

Internal compiler errors are always GCC bugs.
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Has thanked: 0
Been thanked: 0
Contact:

Re: Getting started with programming again/

Post by emptythought »

@BlueCrab: Oh, revision 657. The tutorial on the wiki needs to be updated -- either a new pre-built toolchain or a note where KallistiOS is pulled from the SourceForge repository that the last version to work with our current toolchain available for download requires an older revision of KallistiOS.
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:

Re: Getting started with programming again/

Post by BlueCrab »

emptythought wrote:@BlueCrab: Oh, revision 657. The tutorial on the wiki needs to be updated -- either a new pre-built toolchain or a note where KallistiOS is pulled from the SourceForge repository that the last version to work with our current toolchain available for download requires an older revision of KallistiOS.
I've been using Newlib 1.15.0 for a long time with no issues... I guess I just figured that everyone had been using it. I don't maintain any pre-built toolchains myself, so if you want to write a note about it on any you do, then by all means, do so. Newlib 1.12.0 was put out more than 6 years ago now. In the world of open source, that's close to an eternity. I certainly wouldn't have expected it to work with KOS for as long as it did. My latest toolchain uses 1.18.0, which has been out for more than half a year now, just for anyone else's reference.

Unfortunately, I can't keep up with everything everyone else does. I'm pretty much the only person that does any active work on KOS itself these days, not to mention my other projects and my work... Its all a bit overwhelming at times trying to get other people to stay current. Hence why I've always been somewhat against pre-built toolchains, especially when we haven't had a "stable release" in a long while.

There's nothing I can do to modify the stuff on sf.net's page about the SVN repo, so the only thing I can really do is hope people look at the commit logs every once in a while to see what's going on. If people are just blindly doing "svn update" and not looking at the log, there's not much that I can do. :|
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Has thanked: 0
Been thanked: 0
Contact:

Re: Getting started with programming again/

Post by emptythought »

I can keep us up-to-date with the pre-built toolchains for GNU/Linux platforms, I have a bunch of unreleased junk on my other PC at my Mom's storage like the same as DC Dev Environment (Cygwin) only the MinGW team's installer doesn't have local package install implemented.

I'm working on dna at the moment among Wolf4SDL/DC (unfortunately I can't get a hold of the lead programmer for it to send patches in...), I just released an update to DCGnuBoy that fixes (apparently) the menu bug, I'm also getting DreamInducer updated to KOS' 1.3 API, BootDreams 2.0 amoung other projects. The latter two projects are hosted @ Google Code (TM) LINK.

Can we move KallistiOS to Google Code (TM) and clean-up the base, the support Mercurial?
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:

Re: Getting started with programming again/

Post by BlueCrab »

emptythought wrote:Can we move KallistiOS to Google Code (TM) and clean-up the base, the support Mercurial?
I don't see any reason to move to Google Code, and I have no experience with Mercurial anyway. Subversion works just fine for what we're doing, and I don't see any reason to change that.

The way I look at things is this, Mercurial is the "in style" version control system right now. In another year or two, it won't be anymore. I don't see any need to move things just to go with the whims of what's in style. (Also, what ever happened to git being the "in" thing anyway?)

Not to mention that the gamedev.allusion.net website for KOS et al is still hosted by sf.net. Plus the mailing lists, etc, etc, etc. It'd be an enormous pain to move all of that for really no gain in my eyes.
User avatar
BB Hood
DC Developer
DC Developer
Posts: 189
Joined: Fri Mar 30, 2007 12:09 am
Has thanked: 41 times
Been thanked: 10 times

Re: Getting started with programming again/

Post by BB Hood »

I am actually looking forward to DC Dev ISO R5 with the latest pre-built tool chains and latest revision of KOS. :? :) :wink:
User avatar
Neoblast
DC Developer
DC Developer
Posts: 314
Joined: Sat Dec 01, 2007 8:51 am
Has thanked: 3 times
Been thanked: 1 time

Re: Getting started with programming again/

Post by Neoblast »

BB Hood wrote:I am actually looking forward to DC Dev ISO R5 with the latest pre-built tool chains and latest revision of KOS. :? :) :wink:
Me too, are there any plans for this? r4 is good but too outdated.

Have any of you got any GCC 4 XX working? I tested some versions and tried but didn't quite get it to work 100 % as 3.4.6.
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:

Re: Getting started with programming again/

Post by BlueCrab »

Neoblast wrote:
BB Hood wrote:I am actually looking forward to DC Dev ISO R5 with the latest pre-built tool chains and latest revision of KOS. :? :) :wink:
Me too, are there any plans for this? r4 is good but too outdated.

Have any of you got any GCC 4 XX working? I tested some versions and tried but didn't quite get it to work 100 % as 3.4.6.
I've been using 4.4.0 and 4.4.4 for a while now. Just made a 4.5.1 toolchain that I haven't yet verified whether it produces working binaries or not.

Granted, I'm doing all this on Mac OS X, not Windows.
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Has thanked: 0
Been thanked: 0
Contact:

Re: Getting started with programming again/

Post by emptythought »

Neoblast wrote:
BB Hood wrote:I am actually looking forward to DC Dev ISO R5 with the latest pre-built tool chains and latest revision of KOS. :? :) :wink:
Me too, are there any plans for this? r4 is good but too outdated.

Have any of you got any GCC 4 XX working? I tested some versions and tried but didn't quite get it to work 100 % as 3.4.6.
There's no plans for it currently since I'm using Ubuntu for the time being but if I ever get onto Windows again then yes, expect an update.
User avatar
Neoblast
DC Developer
DC Developer
Posts: 314
Joined: Sat Dec 01, 2007 8:51 am
Has thanked: 3 times
Been thanked: 1 time

Re: Getting started with programming again/

Post by Neoblast »

emptythought wrote:
Neoblast wrote:
BB Hood wrote:I am actually looking forward to DC Dev ISO R5 with the latest pre-built tool chains and latest revision of KOS. :? :) :wink:
Me too, are there any plans for this? r4 is good but too outdated.

Have any of you got any GCC 4 XX working? I tested some versions and tried but didn't quite get it to work 100 % as 3.4.6.
There's no plans for it currently since I'm using Ubuntu for the time being but if I ever get onto Windows again then yes, expect an update.
A rpm/deb package would also be nice as well :)
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Getting started with programming again/

Post by Chilly Willy »

I run Xubuntu 10.4 on an older CoreDuo system, and I've been using gcc 4.4.4 with the DC for a while now. From my makefile for the toolchain:

Code: Select all

binutils_ver=2.20.1
gcc_ver=4.4.4
newlib_ver=1.18.0
That's what I used to compile the Doom port in the news forum. I haven't run across any errors (other than my own :lol: ). If someone wants an arc of the toolchain with kos and kos-ports, I could put one together. It should work on any reasonably recent linux distro, on 32 bit or 64 bit x86 (needs 32 bit compatibility libs for 64 bit system).

If you use Windows, you're on your own. I don't do windows. :wink:
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Has thanked: 0
Been thanked: 0
Contact:

Re: Getting started with programming again/

Post by emptythought »

That'd be great!

When I tried compiling my toolchain I was getting errors about BFD.
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Getting started with programming again/

Post by Chilly Willy »

I got those at some point as well - it means you're missing a dependency for compiling the toolchain. I googled for the error message - saw what libs/packages/whatever had to be installed, then recompiled, then repeated until it finally went through.
User avatar
Neoblast
DC Developer
DC Developer
Posts: 314
Joined: Sat Dec 01, 2007 8:51 am
Has thanked: 3 times
Been thanked: 1 time

Re: Getting started with programming again/

Post by Neoblast »

Chilly Willy wrote:I run Xubuntu 10.4 on an older CoreDuo system, and I've been using gcc 4.4.4 with the DC for a while now. From my makefile for the toolchain:

Code: Select all

binutils_ver=2.20.1
gcc_ver=4.4.4
newlib_ver=1.18.0
That's what I used to compile the Doom port in the news forum. I haven't run across any errors (other than my own :lol: ). If someone wants an arc of the toolchain with kos and kos-ports, I could put one together. It should work on any reasonably recent linux distro, on 32 bit or 64 bit x86 (needs 32 bit compatibility libs for 64 bit system).

If you use Windows, you're on your own. I don't do windows. :wink:
I would really like to use it, if could you pack it that'd be great :)
I never got any gcc 4.x.x to work, i got dozens or errors and installed 3.4.6 again...
Post Reply