Error on compiling PSP SDK under Mac OS X Leopard

A place to post legitimate, console-related project recruitment or commercial employment opportunities.
Post Reply
User avatar
monkeyjpeg
Posts: 5
Joined: Fri Feb 01, 2008 7:13 am
Location: Zürich

Error on compiling PSP SDK under Mac OS X Leopard

Post by monkeyjpeg »

Hi everybody

First: I'm a noob when it comes to PSP-Dev, so please have a bit of patience :-|

I tried to compile/install the PSP-SDK on my PowerBook G4 under Mac OS X Leopard (10.5.1) mostly with the help of these two forum entries:
  1. HOWTO: Compile the SDK on OSX - Consolidated Info
  2. Mac OS X toolchain script patches for Leopard and Tiger
But after a while i got stuck with the following error message:
  • gcc -c -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I./../intl -I../../gcc/../libcpp/include -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I./../intl -I../../gcc/../libcpp/include ../../gcc/config/rs6000/host-darwin.c -o host-ppc-darwin.o
    ../../gcc/config/rs6000/host-darwin.c:38: warning: 'struct sigaltstack' declared inside parameter list
    ../../gcc/config/rs6000/host-darwin.c:38: warning: its scope is only this definition or declaration, which is probably not what you want
    ../../gcc/config/rs6000/host-darwin.c:38: error: conflicting types for 'sigaltstack'
    /usr/include/signal.h:89: error: previous declaration of 'sigaltstack' was here
    ../../gcc/config/rs6000/host-darwin.c: In function 'segv_handler':
    ../../gcc/config/rs6000/host-darwin.c:71: error: 'struct __darwin_mcontext' has no member named 'ss'
    ../../gcc/config/rs6000/host-darwin.c:120: error: 'struct __darwin_mcontext' has no member named 'es'
    ../../gcc/config/rs6000/host-darwin.c:120: error: 'struct __darwin_mcontext' has no member named 'ss'
    ../../gcc/config/rs6000/host-darwin.c: In function 'darwin_rs6000_extra_signals':
    ../../gcc/config/rs6000/host-darwin.c:134: warning: passing argument 1 of 'sigaltstack' from incompatible pointer type
    make[2]: *** [host-ppc-darwin.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    make[1]: *** [all-gcc] Error 2
    make: *** [all] Error 2
    ../scripts/002-gcc-4.1.0-stage1.sh: Failed.
Since i have no experience with the PSP-SDK and it's installation i'm going to list everything i did in sorted order:
  • I had Apple Dev Tools (3.0) already installed (from Leopard Install DVD)
  • I built Fink 0.8.1 Full from source with the help of this Fink Docu
  • I ran "fink selfupdate"
  • I ran "sudo fink -y install autogen autoconf2.5 automake1.8 libtool make svn-client wget sdl libtool14"
  • I changed fink.config to allow unstable trees (main and crypto) since there seems no stable version of autogen available
  • I ran "sudo fink -y install autogen autoconf2.5 automake1.8 libtool make svn-client wget sdl libtool14" again
  • I set up Environment Variables, made a directory and chmoded it as described in the first forum entry mentioned above
  • I checked out the psptoolchain script from subversion: "svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain"
  • I applied the patch as described in the second forum entry mentioned above
  • I installed readline and libusb via Fink: "fink install readline" and "fink install libusb"
  • I ran ./toolchain.sh which went into the Error above
The last bit: Here is a list of all packages that are installed via fink (generated with "fink list -i")

Ok, hope that's enough info to solve the problem ;-)

Many thanks for any help
monkeyJPEG
Katzen kann man nicht dressieren.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

tried updating GCC on the OS itself?

I dont use fink though, I use macports
User avatar
monkeyjpeg
Posts: 5
Joined: Fri Feb 01, 2008 7:13 am
Location: Zürich

second trial on building psp toolchain

Post by monkeyjpeg »

I guess i got the newest gcc from apple ->

Code: Select all

2alPowerBook:osx 2al$ gcc --version
powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

2alPowerBook:osx 2al$
And by the way to be honest: i wouldn't know how to update gcc (via macports, newer Apple DevTools or how would one do that "by hand" ?)



What ever... I did a second trial:

I got rid of fink and built everthing needed with macports (except for "autogen" which won't compile via macports).

I tried to compile the toolchain first WITHOUT the osx-patches this is the errorlog:

Code: Select all

...
checking whether declaration is required for sbrk... no
checking whether declaration is required for environ... yes
checking whether declaration is required for errno... no
updating cache ./config.cache
configure: creating ./config.status
config.status: creating .gdbinit
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating po/Makefile.in
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing default commands
../scripts/001-binutils-2.16.1.sh: Failed.
ERROR: Could not run the toolchain script.
And then again WITH the OS-X-Patches:

Code: Select all

gcc -c   -g -O2  -DIN_GCC -DCROSS_COMPILE  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute    -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I./../intl -I../../gcc/../libcpp/include     -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I./../intl -I../../gcc/../libcpp/include  ../../gcc/config/rs6000/host-darwin.c -o host-ppc-darwin.o
../../gcc/config/rs6000/host-darwin.c:38: warning: ‘struct sigaltstack’ declared inside parameter list
../../gcc/config/rs6000/host-darwin.c:38: warning: its scope is only this definition or declaration, which is probably not what you want
../../gcc/config/rs6000/host-darwin.c:38: error: conflicting types for ‘sigaltstack’
/usr/include/signal.h:89: error: previous declaration of ‘sigaltstack’ was here
../../gcc/config/rs6000/host-darwin.c: In function ‘segv_handler’:
../../gcc/config/rs6000/host-darwin.c:71: error: ‘struct __darwin_mcontext’ has no member named ‘ss’
../../gcc/config/rs6000/host-darwin.c:120: error: ‘struct __darwin_mcontext’ has no member named ‘es’
../../gcc/config/rs6000/host-darwin.c:120: error: ‘struct __darwin_mcontext’ has no member named ‘ss’
../../gcc/config/rs6000/host-darwin.c: In function ‘darwin_rs6000_extra_signals’:
../../gcc/config/rs6000/host-darwin.c:134: warning: passing argument 1 of ‘sigaltstack’ from incompatible pointer type
make[2]: *** [host-ppc-darwin.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-gcc] Error 2
make: *** [all] Error 2
../scripts/002-gcc-4.1.0-stage1.sh: Failed.
2alPowerBook:osx 2al$ 
which seems to be the same error as before.

So binutils build fine, but my leopard kitty doesn't like stage-1 of building the PSP-gcc.

Wally4000: Did you build that toolchain without any problems ? And if so what Patches (for the toolchain) did you use ?

Am i the only one having problems or does just noboby dare to ask ?

Here is again a list of installed software (but this time with macports not fink)

p.s.: Thanks for the anwser Wally4000
Katzen kann man nicht dressieren.
cloudpjff7
Posts: 7
Joined: Thu Jan 03, 2008 10:24 am

Post by cloudpjff7 »

That is the same exact error I get running the toolchain script under macports. Any answers on how to solve this. Perhaps the psp gcc doesn't work under leopard?
User avatar
monkeyjpeg
Posts: 5
Joined: Fri Feb 01, 2008 7:13 am
Location: Zürich

Post by monkeyjpeg »

The existing gcc + libs (from Mac DevTools) obviously don't work for building the psp toolchain. As Wally4000 said it may helps updating gcc.

I found a newer version of gcc via macports but did'nt try it yet.
You may try it yourself....
(have a look at Porticus. It's a graphical front end for macports. While it isn't very usefull for installing macports or selfupdating (you better use the commandline for that), it does a good job when it comes to searching for macports, displaying information about certain macports and browse your installed macports)

For the instance i'm using a psp toolchain build i made on a winxp machine with the help of cygwin which runs fine.

So i'm writing code on my mac and use ssh and scp to send it to the PC, compile it there and copy the compiler's result back to the mac.

It's a bit complicated but at least not as complicated as trying to get the damn toolchain running on the mac.

I'm still hoping someone could give me a "working" way of getting the toolchain build under Mac OS X Leopard until then i will try it find a solution by my self. (i.e. i'll have a try on Wally4000's hint somewhen in the coming days or as soon i now enough about gcc, unix handling and macports).
Katzen kann man nicht dressieren.
bit188
Posts: 6
Joined: Mon Aug 18, 2008 8:08 am

Post by bit188 »

Hey,

I am also on a Mac using 10.5; after some research, I've found that the problem is specific to PPC Macs running Leopard (are we lucky or what)?

I'm in the middle of trying the solution for myself, but apparently this should solve the issue (note: you will either need to know how to edit the shell script yourself or patch and compile GCC on your own-- if you need help, I could possibly give instructions or upload the script later tonight).

Alright, I should probably explain the "MACOSX_DEPLOYMENT_TARGET" setting. Essentially, this tells the compiler what version of OS X to compile for. Turns out that this version of GCC will break when compiled for Leopard, so you'll have to override the default and compile for Tiger, using the option "MACOSX_DEPLOYMENT_TARGET=10.4 make" instead of just "make."

Like I said, I haven't tried this yet; I will try in a bit and let you know the results. If you need help, just reply to my post. :D
User avatar
monkeyjpeg
Posts: 5
Joined: Fri Feb 01, 2008 7:13 am
Location: Zürich

Post by monkeyjpeg »

Oh... psp... well thanks for the answer and any help... but i guess i not needing it anymore. after two months desperately trying and failing to produce anything useful for the psp except for some boring mini applications, a deep hate emerged against it. Two days later i decided to sell the damn psp instead of losing any more time with it.

There were several problems i was facing with it:
1. not much useful information on the whole psp programming topic was available (or at least i couldn't find it) so the tiniest little thing needed massive time investment.

2. existing developers are not really sharing knowledge (again: or i couldn't find it): same result as above

3. these two problems are also reflected in the existing apps one can download. there are very little applications which are really useful or enough free of bugs and developed to a degree which makes them ready for day to day usage. nearly everything is experimental, a proof of concept or a discontinued project without available sources, docs, etc.
the working apps often miss a intuitive control interface (which is mostly caused by the limited possibility of input e.g. the buttons)

there are of course some cool apps but the over all experience of the psp (especially the app development) simply doesn't render out to be pleasant enough for a hobby.

i now bought an iphone (doom me or not, i don't care :-) with the money from the sold psp, which is a lot more fun, since i'm not really interested in gaming. the app diversity is wide, the os is unix (kind of) which is beautifully hacked and there's even a free well documented SDK, (if you don't mind the limitations) and a very good open source toolchain (if you mind the SDK limitations).

in spite of my reply, please keep up helping. somebody else is definitely going to need it.

thanks
monkeyjpeg
Katzen kann man nicht dressieren.
bit188
Posts: 6
Joined: Mon Aug 18, 2008 8:08 am

Post by bit188 »

Hah hah, alright. I understand.

Anyways: for anyone else, that certainly did the trick-- well, at least for GCC. Now I'm having some issues with the "004-newlib-1.15.0.sh" script, but I will try and resolve that as well.

I know it's all convoluted and screwy and broken and stuff. It really sucks that there's no support for PPC PSP programmers!

I think it's completely unfair that you need to know UNIX and/or OS X in and out to get this stupid thing working. It's great for those of us who have all that knowledge and everything, but most people just want to develop apps and games and be a part of the homebrew community; their problems should not be with installing the program. They should only have to worry about *their* code-- it's the toolchain programmer's job to ensure that the application's code is up to shape for the user.

In light of these circumstances, I fully plan on providing a working script and files in one package for those of us on PPC Macs. I may even provide a binary file in the future.

Expect that soon; for now, though, I need to get these kinks worked out. :/
Post Reply