Can't compile psp toolchain on OSX.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
daxtsu
Posts: 10
Joined: Sat Aug 02, 2008 12:03 pm

Can't compile psp toolchain on OSX.

Post by daxtsu »

I'm on a Macbook Pro 1,1(1.83Ghz core duo, 2gb ram, 80gb hdd) running Leopard 10.5.4. When I run the toolchain.sh file, it won't compile the toolchain, giving an error:

Code: Select all

checking whether the C compiler (gcc -g -O2  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
make: *** [configure-binutils] Error 1
make: *** Waiting for unfinished jobs....
But I have Apple's gcc already installed, and it works[tested a simple hello world console app in Xcode], so WTF is wrong?

Here's a pastebin showing all the output for those who are interested.
http://pastebin.ca/1090397
daxtsu
Posts: 10
Joined: Sat Aug 02, 2008 12:03 pm

Post by daxtsu »

I used Macports to install everything but autogen:

daxs-macbook-pro-15:~ dax$ sudo port install autogen
Password:
---> Building autogen with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_autogen/work/autogen-5.9.3" && make all " returned error 2
Command output: test -f ${top_srcdir}/VERSION || die "error ${top_srcdir}/VERSION file missing"
eval `egrep '^AG_[A-Z_]*=' ${top_srcdir}/VERSION` 2> /dev/null
echo $AG_VERSION

echo
echo ShElL-OuTpUt-HaS-bEeN-cOmPlEtEd - 2
CLOSING SHELL SERVER - command failure:

if test ! -d "${top_srcdir}"; then
echo "NOTICE: Setting top_srcdir to .." >&2
top_srcdir=..
fi
test -f ${top_srcdir}/VERSION || die "error ${top_srcdir}/VERSION file missing"
eval `egrep '^AG_[A-Z_]*=' ${top_srcdir}/VERSION` 2> /dev/null
echo $AG_VERSION
FSM Error: in state 6 (need_value), event 8 (;) is invalid
invalid transition: in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_autogen/work/autogen-5.9.3/agen5/opts.def on line 63
token in error: `;'

[[...<error-text>]]

#ifndef XML2AG
include = <<- _END_INCLUDE
#include "autogen.

Likely causes: a mismatched quote, a value that needs quoting,
or a missing semi-colon
make[2]: *** [xmlopts.h] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.


Any idea? =s
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

It should compile without the autogen port install anyway. (I think I had trouble with that one too)

Wally
daxtsu
Posts: 10
Joined: Sat Aug 02, 2008 12:03 pm

Post by daxtsu »

Any other ideas as to why the toolchain won't compile? Everything else is set correctly according to the tutorial. :(
a_noob
Posts: 97
Joined: Sun Sep 17, 2006 8:33 am
Location: _start: jr 0xDEADBEEF

Post by a_noob »

Aha you are inluck i just fixed all the bugs and compiled the toolchain and all the psplibraries flawlessly and just uploaded them 34.5mb download ;)

Have fun deving mate.


http://www.psp-programming.com/forums/i ... 579.0.html

Code: Select all

.øOº'ºOø.
'ºOo.oOº'
daxtsu
Posts: 10
Joined: Sat Aug 02, 2008 12:03 pm

Post by daxtsu »

Now I'm having another problem. I compiled the hello world sample(elf_template), and I don't see any text on the screen; it's just black. I'm using the above poster's already compiled SDK. I had a similar problem when I was downgrading my psp from OFW as well. Could the two be linked?
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

How does the firmware you are running on your psp affect your psp sdk install?

Jim
a_noob
Posts: 97
Joined: Sun Sep 17, 2006 8:33 am
Location: _start: jr 0xDEADBEEF

Post by a_noob »

I know the pspsdk i uploaded is 100% functional. So you did something wrong. Also I dont think the pspsdk samples have been updated to work properly under the 3.xx kernel, so that may be your problem.

Code: Select all

.øOº'ºOø.
'ºOo.oOº'
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

They work fine (except for a few very specific hack ones), but always best to be 100% sure and build any sample with: make BUILD_PRX=1 for > 3.0 kernels
daxtsu
Posts: 10
Joined: Sat Aug 02, 2008 12:03 pm

Post by daxtsu »

Here's what I'm trying to execute on my Slim, and am on Firmware 3.90 M33-3:

Code: Select all

/*
 * PSP Software Development Kit - http&#58;//www.pspdev.org
 * -----------------------------------------------------------------------
 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
 *
 * main.c - Basic ELF template
 *
 * Copyright &#40;c&#41; 2005 Marcus R. Brown <[email protected]>
 * Copyright &#40;c&#41; 2005 James Forshaw <[email protected]>
 * Copyright &#40;c&#41; 2005 John Kelley <[email protected]>
 *
 * $Id&#58; main.c 1888 2006-05-01 08&#58;47&#58;04Z tyranid $
 * $HeadURL$
 */
#include <pspkernel.h>
#include <pspdebug.h>

#define printf pspDebugScreenPrintf

/* Define the module info section */
PSP_MODULE_INFO&#40;"template", 0, 1, 0&#41;;
PSP_HEAP_SIZE_KB&#40;10000&#41;;

/* Define the main thread's attribute value &#40;optional&#41; */
PSP_MAIN_THREAD_ATTR&#40;THREAD_ATTR_USER | THREAD_ATTR_VFPU&#41;;

int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
	pspDebugScreenInit&#40;&#41;;

	pspDebugScreenPrintf&#40;"Hello World\n"&#41;;

	return 0;
&#125;

Makefile:

Code: Select all

BUILD_PRX = 1
PSP_FW_VERSION = 390
TARGET = template
OBJS = main.o

INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Template

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak

Just a black screen with a crash about 10-20 seconds later, resulting in a powerdown. No errors.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You need a delay to read any text, and NEVER exit via return.

Code: Select all

    sceKernelDelayThread&#40;3*1000*1000&#41;;
    sceKernelExitGame&#40;&#41;;

    return 0;   /* never reaches here, again, just to suppress warning */
daxtsu
Posts: 10
Joined: Sat Aug 02, 2008 12:03 pm

Post by daxtsu »

This just doesn't seem to want to work for me ~_~

Code: Select all

/*
 * PSP Software Development Kit - http&#58;//www.pspdev.org
 * -----------------------------------------------------------------------
 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
 *
 * main.c - Basic ELF template
 *
 * Copyright &#40;c&#41; 2005 Marcus R. Brown <[email protected]>
 * Copyright &#40;c&#41; 2005 James Forshaw <[email protected]>
 * Copyright &#40;c&#41; 2005 John Kelley <[email protected]>
 *
 * $Id&#58; main.c 1888 2006-05-01 08&#58;47&#58;04Z tyranid $
 * $HeadURL$
 */
#include <pspkernel.h>
#include <pspdebug.h>

#define printf pspDebugScreenPrintf

/* Define the module info section */
PSP_MODULE_INFO&#40;"template", 0, 1, 0&#41;;
PSP_HEAP_SIZE_KB&#40;10000&#41;;

/* Define the main thread's attribute value &#40;optional&#41; */
PSP_MAIN_THREAD_ATTR&#40;THREAD_ATTR_USER | THREAD_ATTR_VFPU&#41;;

int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
	pspDebugScreenInit&#40;&#41;;

	pspDebugScreenPrintf&#40;"Hello World\n"&#41;;
	
	sceKernelDelayThread&#40;3*1000*1000&#41;;
	sceKernelExitGame&#40;&#41;;

	return 0;
&#125;
It still just has a black screen with a crash. No makefile changes. What could I be missing here? Argh.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

TyRaNiD wrote:They work fine (except for a few very specific hack ones), but always best to be 100% sure and build any sample with: make BUILD_PRX=1 for > 3.0 kernels

Read what TyRaNiD said, its almost fool proof!
daxtsu
Posts: 10
Joined: Sat Aug 02, 2008 12:03 pm

Post by daxtsu »

I already have that in my makefile, do I need to run the PRX or something instead? :S

Code: Select all

BUILD_PRX = 1
PSP_FW_VERSION = 390
TARGET = template
OBJS = main.o

INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Template

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

No. The difference is the EBOOT has the prx instead of the elf inside. You always run the EBOOT (unless using psplink). If you're getting this error while trying to use psplink, try not using psplink. Just run the EBOOT on the PSP and see what happens.
daxtsu
Posts: 10
Joined: Sat Aug 02, 2008 12:03 pm

Post by daxtsu »

I haven't used PSPLink any this whole time, just fyi. :P
daxtsu
Posts: 10
Joined: Sat Aug 02, 2008 12:03 pm

Post by daxtsu »

Anyone else? Should I post the compiled Eboot for you all to test? :S

http://www.mediafire.com/?njqxeji3ztl Source + binaries
daxtsu
Posts: 10
Joined: Sat Aug 02, 2008 12:03 pm

Post by daxtsu »

Well for whatever reason, that compiler the other guy posted was pumping out bad eboots, so I put together a Linux VM for myself with the toolchain installed and it runs now. So I'm happy.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

daxtsu wrote:Well for whatever reason, that compiler the other guy posted was pumping out bad eboots, so I put together a Linux VM for myself with the toolchain installed and it runs now. So I'm happy.
That's the best way to do it on Windows as well. :D
Post Reply