Several Problems With The Official Sdk


Oncer

Member
Joined
Jul 24, 2006
Messages
168
Age
37
Website
Visit site
I just installed the official SDK from GPH at my Linux box (Debian unstable). Almost everything went right, and I have now a fully functional gcc for cross-compiling arm.
Only this error makes me think:
Code:
./buildgp2xtools.sh: line 259: arm-gp2x-linux-g++: command not found
Build : gcc
make: *** Keine Targets angegeben und keine »make«-Steuerdatei gefunden.  Schluss.
./buildgp2xtools.sh: line 266: arm-gp2x-linux-g++: command not found
Error : Failed building gcc
(Sorry for the German, I'm using a localized version of Linux, I hope you can figure it out)

I always wanted to port MEGAZEUX (v2.81) to the GP2X, and this is where the actual problems start. I got all the libraries needed by the game, and I also have the source code. I modified the Makefiles to use the pre-built GP2X libraries instead of my i386 ones. But I can't compile C++ code!
Code:
cd contrib/libmodplug/src && make && cd ../../..
make[1]: Entering directory `/home/simon/Projekte/gp2x/mzx281c/contrib/libmodplug/src'
arm-gp2x-linux-gcc -O2 -Wall -Ilibmodplug -I. -c fastmix.cpp -o fastmix.o
arm-gp2x-linux-gcc: fastmix.cpp: C++ compiler not installed on this system
make[1]: *** [fastmix.o] Fehler 1
make[1]: Leaving directory `/home/simon/Projekte/gp2x/mzx281c/contrib/libmodplug/src'
make: *** [subdir] Fehler 2

So, how can I compile C++ code for the GP2X? Please, help me!
 
g++ on most machines for c++.
Good luck, always like to hear of more games.
 
Yeah, and this is my problem. If you look on the first error message I posted, you'll see that the g++ arm cross-compiler somehow failed to compile.

And.. by the way, if I had the g++ cross-compiler, wouldn't I also need a cross-compiled libstdc++?

Has anyone here got C++ code working with the GP2X?
 
Yeah, it works using devkitGP2X or oopo's. I'd recommend these anyway, since the official one (IIRC) uses gcc 2.95 and both of the above use GCC4.
 
Strange. I tried devkitGP2X before (the one with the "build.sh") and it couldn't compile glibc.

Here's the error:
Code:
make[2]: *** [/home/simon/Tools/gp2x/build/glibc-2.3.5/math/s_isinf.os] Fehler 1make[2]: Leaving directory `/home/simon/Tools/gp2x/glibc-2.3.5/math'
make[1]: *** [math/subdir_lib] Fehler 2
make[1]: Leaving directory `/home/simon/Tools/gp2x/glibc-2.3.5'
make: *** [all] Fehler 2
Error building glibc

I googled about it and I found some newsgroup posts saying that glibc-2.3.5 and gcc-4.0.2 (which devkitGP2X uses) are not compatible. I also didn't find a patch for it.. where did you download devkitGP2X?

/EDIT: OK, I have found some patches now, at http://kegel.com/crosstool/crosstool-0.42/...es/glibc-2.3.5/. I installed all of the glibc-2.3.5 patches (except for the mingw one), and I'm recompiling glibc just ATM. Let's see if it works now...

/EDIT2: In the file glibc-2.3.5/sysdeps/unix/sysv/linux/arm/ioperm.c, you have to replace the following to prevent an error:
Code:
-  static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
-  static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
+  static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA,
BUS_ISA_PORT_BASE };
+  static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA,
BUS_ISA_PORT_SHIFT };
Let's see if it compiles NOW..

/EDIT3: Another error :(
This change is needed:
Code:
+@@ -357,7 +357,14 @@
 #ifdef RESOLVE

 /* Deal with an out-of-range PC24 reloc.  */
-static Elf32_Addr
+#if __GNUC__ >= 4
+  auto inline Elf32_Addr
+#else
+  static inline Elf32_Addr
+#endif
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+  __attribute ((always_inline))
+#endif
 fix_bad_pc24 (Elf32_Addr *const reloc_addr, Elf32_Addr value)
 {
   static void *fix_page;

/EDIT4:
And another error :( :(
I'm tired of messing with the sources.. and everytime compiling it from the beginning.

How the hell have you guys compiled this thing?? Is there a huge patch archive somewhere, or does it just run with the buildscript for you?
What could I've done wrong? :(

I'm going to bed now.

/EDIT5:
Forget the whole error thing. Look at my post below.

Simon
 
Download the big oopo's toolchain from the archive (http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,14,1609), comment it to keep it from compiling SDL_svg in the libs makefile, and use it. The only thing that doesn't compile is SDL_svg, and I can't think of any real reason you need that library anyway (unless you want to use vector graphics for some reason)

It automatically builds glibc and a bunch of other stuff with no needed user intervention, which I like.

EDIT: Come to think of it, I thought devkitgp2x has glibc to start with too. Could be wrong though.
 
Yes, devkitGP2X has in fact glibc included.

I just had the urge to hit myself with a big sharp and/or heavy thing... I now know the mistake I made..

See, the devkitGP2X_buildscript.tar.bz2 contains two things: the "build.sh" which downloads, patches and installs gcc, glibc, whatever. The second thing is a directory named "patches" where all the patches lie to make glibc-2.3.5 and gcc-4.0.2 work together.
I (<--dumb) unzipped the whole thing, did some other thing, then noticed that it was in the wrong Directory and moved it to a new one. Only the build.sh, not the "patches" thing. So it downloaded everything, failed to patch it and continued with many compile errors. And I didn't notice it.

So I went looking for patches, recompiling, writing down the errors, looking for other patches.. despite they were all nicely waiting on my HD. 3 hours I guess...

Argh! :angry: :blink:

Simon
 
Back
Top