Best GNU tools versions for KallistiOS 2.0.0

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
SiZiOUS
DC Developer
DC Developer
Posts: 404
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Fri Mar 05, 2004 2:22 pm
Location: France
Has thanked: 27 times
Been thanked: 19 times
Contact:

Best GNU tools versions for KallistiOS 2.0.0

Post by SiZiOUS »

Hello there,

Just wondering, I'm a little outdated about dc devving, what are the best versions for GNU applications for KallistiOS 2.0.0 ?

For example :
  • gcc: 4.6.2 (?)
  • gdb: ?
  • insight: ?
  • ...: ?
I'm asking because if I remember well, some recents GNU tools are incompatible with KOS. I remember patches included in the KOS package. I'm using a MinGW environment (Windows).

Thank you in advance!
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5666
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by BlueCrab »

I believe that you'd be using GCC 4.7.3, Binutils 2.23.2, and Newlib 2.0.0. I have no idea about GDB or Insight, but I'd imagine that whatever dc-chain can build should work. All the patches and such for those versions of the tools are included with the dc-chain bundled with KOS 2.0.0.
User avatar
SiZiOUS
DC Developer
DC Developer
Posts: 404
Joined: Fri Mar 05, 2004 2:22 pm
Location: France
Has thanked: 27 times
Been thanked: 19 times
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by SiZiOUS »

Hi BlueCrab,

And thank you for your very fast and perfect answer (as usual) !

But If I understand well you aren't using GDB?
How do you debug then, with the old "printf" method? Just to know

Cheers,
SiZ!
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5666
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by BlueCrab »

Yeah, I just make ample use of printf()s and other such things for debugging.
User avatar
SWAT
Insane DCEmu
Insane DCEmu
Posts: 191
Joined: Sat Jan 31, 2004 2:34 pm
Location: Russia/Novosibirsk
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by SWAT »

I'm build GDB 7.6, it's works partially.
Image
User avatar
SiZiOUS
DC Developer
DC Developer
Posts: 404
Joined: Fri Mar 05, 2004 2:22 pm
Location: France
Has thanked: 27 times
Been thanked: 19 times
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by SiZiOUS »

Hi there,

Thanks for your replies, both of you.

@SWAT, what do you want to mean by "partially" ?

@BlueCrab, just to know, for building GCC with target SH, I need to download 3 additional libraries:
  • GNU Multiple Precision Library (GMP) version 4.3.2 (or later) - Lastest is 5.1.3
  • MPFR Library version 2.4.2 (or later) - Lastest is 3.1.2
  • MPC Library version 0.8.1 (or later) - Lastest is 1.0.1
Can I use the lastest versions of libraries safely or not ?
If not, can I have the best versions number ?

Thank you :)
User avatar
SWAT
Insane DCEmu
Insane DCEmu
Posts: 191
Joined: Sat Jan 31, 2004 2:34 pm
Location: Russia/Novosibirsk
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by SWAT »

"partially" - not all commands supported. I'm tryed use this with dc-tool and lxdream. It's works in both cases.

Now dc-chain automatically download all dependencies, and it' good. Not need download anything manually.
Last edited by SWAT on Fri Dec 06, 2013 10:02 pm, edited 1 time in total.
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5666
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by BlueCrab »

SiZiOUS wrote:@BlueCrab, just to know, for building GCC with target SH, I need to download 3 additional libraries:
  • GNU Multiple Precision Library (GMP) version 4.3.2 (or later) - Lastest is 5.1.3
  • MPFR Library version 2.4.2 (or later) - Lastest is 3.1.2
  • MPC Library version 0.8.1 (or later) - Lastest is 1.0.1
Can I use the lastest versions of libraries safely or not ?
If not, can I have the best versions number ?
The latest versions should work fine. Also, as SWAT pointed out, the version of dc-chain in the Git repository automatically downloads and builds all of these for you. :wink:
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by RyoDC »

You don't need to download it by yourself or use some scripts from dc-chain folder.
Everything is much simpler.
As from official GCC wiki [http://gcc.gnu.org/wiki/InstallingGCC]:
See Installing GCC: Prequisites for the software required to build GCC. If you do not have the GMP, MPFR and MPC support libraries already installed as part of your operating system then there are two simple ways to proceed, and one difficult, error-prone way. For some reason most people choose the difficult way. The easy ways are:

If it provides sufficiently recent versions, use your OS package management system to install the support libraries in standard system locations. For Debian-based systems, including Ubuntu, you should install the packages libgmp-dev, libmpfr-dev and libmpc-dev. For RPM-based systems, including Fedora and SUSE, you should install gmp-devel, mpfr-devel and libmpc-devel (or mpc-devel on SUSE) packages. The packages will install the libraries and headers in standard system directories so they can be found automatically when building GCC.

Alternatively, after extracting the GCC source archive, simply run the ./contrib/download_prerequisites script in the GCC source directory. That will download the support libraries and create symlinks, causing them to be built automatically as part of the GCC build process. Set GRAPHITE_LOOP_OPT=yes in the script if you want to build GCC with the Graphite loop optimizations.

The difficult way, which is not recommended, is to download the sources for GMP, MPFR and MPC, then configure and install each of them in non-standard locations, then configure GCC with --with-gmp=/some/silly/path/gmp --with-mpfr=/some/silly/path/mpfr --with-mpc=/some/silly/path/mpc, then be forced to set LD_LIBRARY_PATH=/some/silly/path/gmp:/some/silly/path/mpfr:/some/silly/path/mpc/lib in your environment forever. This is silly and causes major problems for anyone who doesn't understand how dynamic linkers find libraries at runtime. Do not do this. If building GCC fails when using any of the --with-gmp or --with-mpfr or --with-mpc options then you probably shouldn't be using them.
How do I try to build a Dreamcast toolchain:
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5666
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by BlueCrab »

And that does not cover how one would build it on Cygwin, which is what most of the people around here seem to do. Yes, those packages are available in the Cygwin installer, and that's how one should install them, but at least on Cygwin it works fine if you build them yourself and install them in the default location that the scripts with the packages try to install them in.

As I said though, this is now taken care of in the Git revisions of the scripts, so it shouldn't be a sticking point anymore. They're built with GCC in effectively the same way as running that download_prerequisites script that is mentioned there.
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by RyoDC »

You know, BlueCrab, for all the times I tried, I had never been able to built dc-chain just in one sit on a Cygwin. It was always errors, something not working, manually adapting \ fixing the scripts.
How do I try to build a Dreamcast toolchain:
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5666
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by BlueCrab »

I tested the revision currently in the git repository on Cygwin, and it worked fine.
User avatar
SWAT
Insane DCEmu
Insane DCEmu
Posts: 191
Joined: Sat Jan 31, 2004 2:34 pm
Location: Russia/Novosibirsk
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by SWAT »

It's builds fine for me if I remove -j4 from makejobs variable in dc-chain Makefile.
I was getting errors in cygwin exactly because of this.
Try it and you get success 99%.
Image
User avatar
SiZiOUS
DC Developer
DC Developer
Posts: 404
Joined: Fri Mar 05, 2004 2:22 pm
Location: France
Has thanked: 27 times
Been thanked: 19 times
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by SiZiOUS »

Hi there,

I have some troubles by using MinGW environment to build the toolchain, especially the ARM toolchain.

The situation:
  • I removed -j4 from makejobs variable in dc-chain Makefile (it's required here too, if not, the make process freezes)
  • For MPC, MPFR and GMP, I downloaded these components by using the contrib/download_prerequisites tool in gcc-4.7.3 folder
  • I'm using the lastest MinGW environment and MSYS releases (gcc-4.8.1)
When make is compiling the libgcc static library for ARM the make process stops by showing the message :
couldn't commit memory for cygwin heap, Win32 error 0.

I investigated the problem, and it seems the make process has a memory leak or something: when the make.exe memory process is more than 150MB, the process stops with the error above. So I downloaded the MSYS SDK and recompiled the POSIX layer with the heap size to 1024M (was 256M by default) but the problem remains the same.

The SH toolchain worked well...

I know that nobody is using MinGW environment but I'm posting this just in case.
In the past I successfully compiled the toolchain and KOS 1.3 in the MinGW environment but this time it seems the make memory leak bug is beating me!
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5666
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by BlueCrab »

That sounds like something that should be sent in to the MinGW people as a bug report, since it is most definitely something wrong on their end. Sadly, I have no advice other than that.

I used to use MinGW for my Dreamcast stuff when I used Windows, and they were pretty receptive to my bug reports and helped me work around any issues I had.
User avatar
SWAT
Insane DCEmu
Insane DCEmu
Posts: 191
Joined: Sat Jan 31, 2004 2:34 pm
Location: Russia/Novosibirsk
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by SWAT »

Why do you need it MinGW? Because of the speed? Under cygwin all builds and runs without any problems (without -j4 of course).
Image
User avatar
SiZiOUS
DC Developer
DC Developer
Posts: 404
Joined: Fri Mar 05, 2004 2:22 pm
Location: France
Has thanked: 27 times
Been thanked: 19 times
Contact:

Re: Best GNU tools versions for KallistiOS 2.0.0

Post by SiZiOUS »

Hello,

First of all, thank you both for your answers :)

I have several reasons to use MinGW:

Rational reasons:
  • Lightweight
  • Portable
  • Native Windows binaries (no POSIX emulation)
  • Execution is faster/better than Cygwin
Irrational reasons:
  • Because I prefer MinGW instead of Cygwin (although I know that Cygwin is a good product)
I'll check with the MinGW team if they can help me or not !

See you!!
Post Reply