The Gp2x Toolchain Project Has Begun


Blah

Wanna Be Programmer
Joined
Dec 18, 2003
Messages
3,253
Age
35
Location
Oregon, USA
Website
Visit site
I have figured out this SVN stuff (actually, I downloaded a gui client :lol:), and the initial code is up. If you have no idea what I'm talking about, a toolchain is the set of tools required to build programs, in this case it is GCC and friends.

So what have we got?

The good:
* GCC is the latest version (4.1.1)
* Software Floating Point support
* Glibc 2.3.3 (this was hard to get working, if you think you can do better please help)
* I made autotools files for Zlib (its my first experience with autotools)

The bad:
* You must compile this yourself (well duh). You need gcc-4.1.1 and the other stuff required for building GCC (GNU.org has a page about this, I won't be redundant).
* Of course you need linux, or some similar POSIX OS. A Windows + Cygwin or MingW binary release may appear in the future.
* You have to checkout the code from the Subversion yourself.
* There is no script to download and build libs/software yet, for now just download Crosstool-0.43 and put the updated files in and run gp2x.sh, if you wish you can do the same with zlib and try for other libraries.
* Must compile all apps with -msoft-float or they will fail to link (the crosstool hello world fails for that reason), this is not a bug, it is the way GCC works (so that you could have software FP and hardware FP targets work with one compiler).
* This is not designed for the libs that come with GPH linux, you must link statically or include the libs with your program or elsewhere on the program media (sd card).
* This hasn't been tested much (zlib compiles, libpng compiles, hello world runs).

Where do I get it?

The GP2X Toolchain Project @ Gna.org

What else can I do?

You can join the mailing lists. Or you can email me if you want to join the project team. There are many things that need to be done, documentation, script files, libs/programs testing, etc, not just the really hard stuff.

Will I see any updates to this?

Yeah, I will have a couple days off soon, you might just see some cool stuff.

Anyway, Have a nice day :)
 
How many toolchains does a single handheld need?

What is different about this toolchain to the several other toolchains that are currently available? ooPo, Open2X, devkitGP2X, gp2xsdk...
 
Nice job :),

Getting everything to work well can be a real pain. What patches have you used above and beyond what Crosstool has for an ARM OABI target?

You may also be interested in the latest versions of the Open2x scripts (my crosstool derived ones rather the Oopo's makefile based Open2x scripts). Not really sure what they offer that yours do not other then the GCC 3 based kernel chain but they are what we are using for Open2x kernel work at the moment.

Open2x Toolchains

There are 2 main toolchains (both based on the same gLibC, soft float of course ;)) that we are using for kernel and application hackery in Open2x. I have just added the latest versions of the scripts and patches to Open2x's SVN.

You can grab the scripts by checking out [url="https://open2x.svn.sourceforge.net/open2x/trunk/toolchain-new/"]https://open2x.svn.sourceforge.net/open2x/t.../toolchain-new/
with SVN.

There are 2 very simple shell scripts that should be of interest.
  • open2x-gp2x-kernel-3.sh - The kernel chain is based on GCC 3.4.4, gLibC 2.3.6, BinUtils 2.16.1 and can be used the build the current 2.4.26 kernel straight from Open2x's SVN (The one in \trunk\kernel\linux-open2x-2.4.26_FW2-3).
  • open2x-gp2x-apps.sh - The application chain is based on GCC 4.1.1 (with various ARM patches for things like strut alignment), gLibC 2.3.6, BinUtils 2.16.1. - This can be used much like your chain (i.e. static link, library prefix or dynamic linking if you’re using an Open2x derived kernel/filesystem combo built with the above chain).
You can find pre-made versions of the tool-chains for Linux (built on Ubuntu Edgy) that I have uploaded to the Open2x site.These should end up in /opt/open2x/ (paths are in the archive).

Due to a 'feature' of the Open2x host, .BZ2 files are treated as invalid so you will need to remove the .ZIP from the end of the filename after you download a tool-chain before you can extract it.

Details for setting the toolchains up in Windows/CygWin are on to the Open2x Wiki.

Open2x Patched Development Libraries (i.e. SDL, Tremor, MAD, Zlib etc.)

If you decide to use an Open2x tool-chain the 1st thing your going to need is some libraries to ease development somewhat. The /trunk/libs module in Open2x contains a wide selection of libs used by various aspects of the project and is the official home of projects such as the hardware optimised SDL implementation for the GP2X.

In order to build the libs for the above tool-chain check out https://open2x.svn.sourceforge.net/open2x/trunk/libs/ and edit open2x-libs.sh to make sure it is pointing at the correct location of your Open2x tool-chain (it defaults to the above 4.1.1 tool-chain installed to /opt/open2x).

The all you should need to do it just run ./open2x-libs.sh from the libs dir and let it run along for half an hour or so while it builds and installs you a fairly complete libs set (well that is the theory).

Note: You will need to have autotools 1.9 installed for it all to work (I think ;)).

You can also get prebuilt library packages from the Open2x wiki.

These lib scripts and the tool-chain may well need a little more work so please feedback any issues ideally to the Open2x-devel mailing list.

I can also recomend looking at the guides on the Open2x Wiki and the toolchain pages.
 
slygamer posted on Feb 14 2007 at 03:39 AM said:
How many toolchains does a single handheld need?

What is different about this toolchain to the several other toolchains that are currently available? ooPo, Open2X, devkitGP2X, gp2xsdk...

just one thats easy to install and maintain would be awesome, the announcement and DjWillis chipping in with some tweaks looks like a great start! :ph34r:

so i hope Blah and other open2x guys can all work together to make a pinnacle toolchain.

i gave up my linux desktop to a friend working on the Digital Tipping Point video project about open souce so i had to rebuild my toolchain on my win lappy. now i'm burning everything i can off this lappy so i can dual boot into linux. i'll have my eyes on this SVN and open2x toolchains in the next few weeks as i get around to installing ubuntu.
 
Last edited by a moderator:
Could someone explain what this "news" could mean for the enduser? Faster games after compiling?
 
B)-->
b._.o._.b said:
Could someone explain what this "news" could mean for the enduser? Faster games after compiling?

Yes, please. I'd like to get educated as well :)
 
Last edited by a moderator:
B)-->
b._.o._.b said:
Could someone explain what this "news" could mean for the enduser? Faster games after compiling?

i think the point of the project is to create a central location for developers to easily grab the latest and most optimized libraries.

this could, in turn, encourage developers to work with the latest and most optimized libraries, rather than getting by with whatever toolchain they choose or managed to patch together.

so yes, "enduser" benefits B)
 
Last edited by a moderator:
DJWillis posted on Feb 14 2007 at 02:26 AM said:
Blah,

Out of interest can I ask what the reasoning behind going with glibc-2.3.3 and not a newer version was?

John

I couldn't get 2.3.6 to compile but I'll take a look at your stuff again later. I should be doing my homework :lol:.

And yes, this is meant as a central hub for people to improve and download development tools. I will be working on improving some libraries after I apply a few changes from the open2x guys and make some scripts.
 
Last edited by a moderator:
Interesting, but I'll only care when you guys gimme a straight out the box working Windows toolchain. Also, no mention of SDL? Oh well, I don't use it anymore, and as long as zlib and libpng work and that we got optimized software floats that's fine with me.

If DJWillis can get involved with it then great cause he made the only toolchain that I managed to work with.
 
SDL isn't part of it yet, I do however plan to write some new code for the SDL library.

The software floats aren't really optimized (they are optimized for IEEE accuracy, not speed), there are other implementations but this is the default GCC implementation.

For now it would seem that Open2X is a better way to go, but I'm still working on this of course.

edit: Yes, there will be an out-of-the-box Windows build later on (once the first alpha version gets out of beta and the code get freezed, this will be a while).
 
The SVN said:
Fixed stupid goof (I was having it use glibc-2.3.4 instead of glibc-2.3.3), now it won't fail on build.

Glibc-2.3.6 coming soon thanks to DjWillis.

You would have seen this, if you were on the mailing list. Exciting. Nobody is on the mailing list.
 
Last edited by a moderator:
Blah posted on Feb 15 2007 at 02:14 AM said:
The software floats aren't really optimized (they are optimized for IEEE accuracy, not speed), there are other implementations but this is the default GCC implementation.

Oh OK well, I don't think anyone really cares about accuracy wrt the IEEE specifications, it's fine if we have something as customized as possible with custom but nonetheless correctly documented specifications.
 
Last edited by a moderator:
Laurent posted on Feb 15 2007 at 03:24 PM said:
Blah posted on Feb 14 2007 at 06:48 AM said:
* GCC is the latest version (4.1.1)
Not true anymore :D

Good luck!

Not totally sure you would want to jump on 4.1.2 just yet, a lot of the ARM platform patches would need to be checked off to see what made the release and what still needs to be patched at build time.

All in all, it would seem a little early to jump to the newest :), 4.1.1 is proving to be a nice solid release for ARM Linux OABI, EABI is another matter but that is not relevant to the GP2X ;).

Blah posted on Feb 15 2007 at 12:29 AM said:
this is meant as a central hub for people to improve and download development tools. I will be working on improving some libraries after I apply a few changes from the open2x guys and make some scripts.

You may wish to checkout the Open2x SVN libs module then, you may well find a lot of the libs you would want to add are there in there GP2X specific patched up forms :). Seems a shame to double up on work.

Blah posted on Feb 15 2007 at 04:38 AM said:
The SVN posted on Feb 14 2007 at 10:08 PM said:
Could someone explain what this "news" could mean for the enduser? Faster games after compiling?

Just mark this news item as "Not relevant for end users" for now and leave it at that ;). Tool-chains, libraries and the like have been known to excite developers and better availability, usability and information can only help new potential developers get started, leading to more cool stuff coming out for end users of the GP2X I guess :D.
 
Last edited by a moderator:
Yeah, I just noticed that 4.1.2 came out. I'll try to backport the patches (after I apply the changes I picked from your setup) and see if I can get it to work. Also I'll look into glibc2.4.

About the libs, well I want to start off with a clean slate. Its smarter in my opinion to have the buildscripts download the vanilla libs rather than putting them in SVN. On the other hand, I plan to make some improvements to SDL, the first thing that comes to mind is changing input handling from straight register accessing code instead to code which makes use of the new driver module for the buttons (this should be easy). I'm also thinking about making a lib or two of my own as well as a toolchain + special libs targeted for the 940 chip.

The joypad driver module should make life easier for those with d-pad mods and those who make d-pad mods. Diagonals should work either way (the joystick is represented as axes rather than buttons) and it'll be easy for me to implement a workaround for those who don't have stick buttons.

And meanwhile I'll take a look at the mailing list howto docs.

A_SN posted on Feb 15 2007 at 12:18 AM said:
Blah posted on Feb 15 2007 at 02:14 AM said:
The software floats aren't really optimized (they are optimized for IEEE accuracy, not speed), there are other implementations but this is the default GCC implementation.

Oh OK well, I don't think anyone really cares about accuracy wrt the IEEE specifications, it's fine if we have something as customized as possible with custom but nonetheless correctly documented specifications.

Well this implementation is faster than the implementation the kernel uses when it gets an opcode error from trying to execute fp instructions on a chip which doesn't have them.
 
Last edited by a moderator:
sure, linux encourages freedom to the benefit of diversity which means strength.

but in this case it would really seem open2x and blah's toolchain could combine forces to help things along. maybe there are some basic ideas you guys don't agree on?

if nothing else i would hope that blah and some open2x folk would talk it out and see where they do and don't see eye to eye.

i joined the open2x-devel mailing list to keep up on that ... djwillis if you need a 2nd hand at blogging to keep the open2x site looking more alive i offer my penmanship :ph34r:

i'm not clear on open2x: if it's ment to be compatible with current firmware or not. if open2x developers can only write applications for people running open2x firmware, that might turn people off from the project. in such a small scene it would seem best not to split people up along those lines.
 
Dude, we are working together.

News Postings said:
gLibC 2.3.6
posted by spacecoyote, Friday 02/16/2007 at 02:39 - 0 replies

Thanks to DjWillis of The Open2x Project (http://www.open2x.org), gLibC has been updated to version 2.3.6. GCC 2.4.6 is no longer required. The bug that required the -msoft-float flag is gone.

Mailing List Up
posted by spacecoyote, Friday 02/16/2007 at 02:36 - 0 replies

The public mailing list gp2x-toolchain-digest@gna.org is now open.

Open2x is going to be a full featured firmware (actually its useful already from what I hear), stuff compiled for GPH's firmware will be compatible, developers will be able to take advantage of new features (which will make the new binaries incompatible with GPH's firmware). It would be cool if perhaps GPH could work with us to improve their firmware, we'd end up with the same end result but faster.

The Open2x project's goal however is not really to maintain a devkit for building applications. The GP2X Toolchain Project aims to produce and maintain a superior toolchain to work with now (on GPH's firmware) and in the future (on Open2x firmware?). In this way both goals can be reached faster, because DjWillis has less work to do.

Oh and now that I've looked at it, I figure I might be able to update it to GCC-4.1.2 tonight or tomorrow.
 
Last edited by a moderator:
blah, thank you for the clear cut explanation of what each project is aiming for. i wasn't trying to cut anyone down, sorry if any offense was caused.
 
Back
Top