Cannot create a prx

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

Moderators: cheriff, TyRaNiD

Post Reply
roby65
Posts: 52
Joined: Sun Jun 01, 2008 9:12 pm
Location: Mid Italy
Contact:

Cannot create a prx

Post by roby65 »

Hi, this is my makefile:

TARGET = platform
OBJS = intraFont.o libccc.o font.o common.o parser.o dialogs.o graphic.o libmsn/msntest/custompoll.o exceptionHandler\utility\exception.o main.o

BUILD_PRX=1

INCDIR =
CFLAGS = -O2 -G0 -Wall -g
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti -O2 -g
ASFLAGS = $(CFLAGS)

LIBS= -g -lpng -lz -lpspwlan -lpspnet -lpsphttp -lpsputility -lpspgum -lpspgu -lmsn_d -lssl_d -lcrypto_d -lm -lstdc++

LIBDIR =

EXTRA_TARGETS = EBOOT.PBP

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak



I need to debug it in psplink, but it creates an eboot and an elf instead of a prx!
Why?
m0skit0
Posts: 191
Joined: Tue Jun 02, 2009 8:58 pm

Post by m0skit0 »

A PRX is an ELF. And your PRX is "inside" the EBOOT.PBP. Comment out EXTRA_TARGETS = EBOOT.PBP and you'll get your PRX.
The Incredible Bill Gates wrote:The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
roby65
Posts: 52
Joined: Sun Jun 01, 2008 9:12 pm
Location: Mid Italy
Contact:

Post by roby65 »

m0skit0 wrote:A PRX is an ELF. And your PRX is "inside" the EBOOT.PBP. Comment out EXTRA_TARGETS = EBOOT.PBP and you'll get your PRX.
Already tried.
Doesn't work.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\roberto\Desktop\platform\o-psp-c>make
psp-gcc -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -D_PSP_FW_VERSION=150
-c -o intraFont.o intraFont.c
psp-gcc -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -D_PSP_FW_VERSION=150
-c -o libccc.o libccc.c
psp-g++ -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -I. -ID:/pspsdk/psp/sdk
/include -O2 -G0 -Wall -g -fno-exceptions -fno-rtti -O2 -g -D_PSP_FW_VERSION=150
-c -o font.o font.cpp
psp-gcc -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -D_PSP_FW_VERSION=150
-c -o common.o common.c
common.c: In function 'Platform_Core_Make_Socket':
common.c:139: warning: unused variable 'ret'
common.c: In function 'Platform_Core_Resolver':
common.c:233: warning: control reaches end of non-void function
psp-gcc -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -D_PSP_FW_VERSION=150
-c -o parser.o parser.c
parser.c: In function 'Platform_Parser_GetSessionID':
parser.c:49: warning: implicit declaration of function 'strncmp'
parser.c:58: warning: implicit declaration of function 'malloc'
parser.c:58: warning: incompatible implicit declaration of built-in function 'ma
lloc'
parser.c:71: warning: implicit declaration of function 'strcpy'
parser.c:71: warning: incompatible implicit declaration of built-in function 'st
rcpy'
parser.c: In function 'Platform_Parser_GetReturnCode':
parser.c:87: warning: implicit declaration of function 'atoi'
parser.c: In function 'Platform_Parser_GetData':
parser.c:101: warning: incompatible implicit declaration of built-in function 's
trcpy'
psp-gcc -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -D_PSP_FW_VERSION=150
-c -o dialogs.o dialogs.c
dialogs.c: In function 'Platform_Dialogs_ShowDialog':
dialogs.c:11: warning: unused variable 'temp'
psp-gcc -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -D_PSP_FW_VERSION=150
-c -o graphic.o graphic.c
graphic.c: In function 'Platform_Graphic_LoadImage':
graphic.c:113: warning: implicit declaration of function 'memalign'
graphic.c: In function 'Platform_Graphic_Render2D':
graphic.c:179: warning: control reaches end of non-void function
psp-g++ -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -I. -ID:/pspsdk/psp/sdk
/include -O2 -G0 -Wall -g -fno-exceptions -fno-rtti -O2 -g -D_PSP_FW_VERSION=150
-c -o libmsn/msntest/custompoll.o libmsn/msntest/custompoll.cpp
psp-gcc -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -D_PSP_FW_VERSION=150
-c -o exceptionHandler\utility\exception.o exceptionHandler\utility\exception.c

psp-g++ -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -I. -ID:/pspsdk/psp/sdk
/include -O2 -G0 -Wall -g -fno-exceptions -fno-rtti -O2 -g -D_PSP_FW_VERSION=150
-c -o main.o main.cpp
In file included from main.cpp:39:
libmsn\msntest\msntest.cpp: In function 'int main2()':
libmsn\msntest\msntest.cpp:320: warning: unused variable 'ret'
libmsn\msntest\msntest.cpp:267: warning: unused variable 'pass'
libmsn\msntest\msntest.cpp: In member function 'virtual void CustomCallbacks::cl
osingConnection(MSN::Connection*)':
libmsn\msntest\msntest.cpp:1100: warning: format '%d' expects type 'int', but ar
gument 2 has type 'void*'
libmsn\msntest\msntest.cpp: In member function 'virtual size_t CustomCallbacks::
getDataFromSocket(void*, char*, size_t)':
libmsn\msntest\msntest.cpp:1285: warning: unused variable 'fd'
libmsn\msntest\msntest.cpp:1288: warning: unused variable 'amountRead'
main.cpp: In function 'int main()':
main.cpp:47: warning: unused variable 'out'
graphic.h: At global scope:
graphic.h:25: warning: 'list' defined but not used
psp-gcc -I. -ID:/pspsdk/psp/sdk/include -O2 -G0 -Wall -g -D_PSP_FW_VERSION=150
-L. -LD:/pspsdk/psp/sdk/lib intraFont.o libccc.o font.o common.o parser.o dial
ogs.o graphic.o libmsn/msntest/custompoll.o exceptionHandler\utility\exception.o
main.o -g -lpng -lz -lpspwlan -lpspnet -lpsphttp -lpsputility -lpspgum -lpspgu
-lmsn_d -lssl_d -lcrypto_d -lm -lstdc++ -lpspdebug -lpspdisplay -lpspge -lpspctr
l -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputil
ity -lpspuser -lpspkernel -o platform.elf
psp-fixup-imports platform.elf

Why odes it always create a .elf?
I already tried using the elf but it doesn't work
unsigned int
Posts: 18
Joined: Thu Aug 13, 2009 11:42 pm

Post by unsigned int »

Actually the only factor that controls if a prx gets created is the BUILD_PRX=1 line as far as I know.

You could manually create it by

Code: Select all

psp-prxgen input.elf output.prx
roby65
Posts: 52
Joined: Sun Jun 01, 2008 9:12 pm
Location: Mid Italy
Contact:

Post by roby65 »

unsigned int wrote:Actually the only factor that controls if a prx gets created is the BUILD_PRX=1 line as far as I know.

You could manually create it by

Code: Select all

psp-prxgen input.elf output.prx
Already tried.
It says something about not finding the export table, or something like that.
I checked the prx template, and the only thing differents are the libs....
m0skit0
Posts: 191
Joined: Tue Jun 02, 2009 8:58 pm

Post by m0skit0 »

roby65 wrote:Why odes it always create a .elf?
Because as I said, PSP uses ELF executables, dude... And PRX are just a custom ELF type.

If you're exporting functions, make sure your exports file is set correctly.
The Incredible Bill Gates wrote:The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
roby65
Posts: 52
Joined: Sun Jun 01, 2008 9:12 pm
Location: Mid Italy
Contact:

Post by roby65 »

m0skit0 wrote:
roby65 wrote:Why odes it always create a .elf?
Because as I said, PSP uses ELF executables, dude... And PRX are just a custom ELF type.

If you're exporting functions, make sure your exports file is set correctly.
I don't export anything..... :(
I mean, i don't need to export anything, and i don't have an export file
m0skit0
Posts: 191
Joined: Tue Jun 02, 2009 8:58 pm

Post by m0skit0 »

Your ELF must at least export module_start in syslib.
The Incredible Bill Gates wrote:The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Davee
Posts: 43
Joined: Mon Jun 22, 2009 3:58 am

Post by Davee »

m0skit0 wrote:Your ELF must at least export module_start in syslib.
SDK will take care of that. I think the error he is getting is missing relocation table.
roby65
Posts: 52
Joined: Sun Jun 01, 2008 9:12 pm
Location: Mid Italy
Contact:

Post by roby65 »

Davee wrote:
m0skit0 wrote:Your ELF must at least export module_start in syslib.
SDK will take care of that. I think the error he is getting is missing relocation table.
The real strange thing is that it doesn't compile a prx by itself.
I tryed compiling it manually:

C:\Documents and Settings\roberto\Desktop\platform\o-psp-c>psp-prxgen platform.elf platform.prx
Error, found no relocation sections

Maybe there is something wrong in my code?

The only "strange" thing i can tell, is that i use some extern "C" files (main is in c++)

EDIT: I made IT! I dunno what was the problem, but now it works!
But i have another problem when debugging....
The .elf file has the debug symbols, prx has not.
Why? Maybe something wrong in makefile?


TARGET = template
OBJS = common.o graphic.o parser.o dialogs.o intraFont.o font.o libccc.o libmsn\msntest\custompoll.o exceptionHandler\utility\exception.o main.o

PSP_FW_VERSION=500
BUILD_PRX=1

INCDIR =
CFLAGS = -g -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =

LIBS = -lmsn_d -lm -lstdc++ -lssl_d -lcrypto_d -lpng -lz -lpspgum -lpspgu -lm

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

You only need the debug symbols in the elf. you use the elf file as input for ie. psp-addr2line.

Or am i wrong?

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
roby65
Posts: 52
Joined: Sun Jun 01, 2008 9:12 pm
Location: Mid Italy
Contact:

Post by roby65 »

jojojoris wrote:You only need the debug symbols in the elf. you use the elf file as input for ie. psp-addr2line.

Or am i wrong?
I need to debug line to line the prx (psplink doesn't load the elf)
Post Reply