forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cannot create a prx

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
roby65



Joined: 01 Jun 2008
Posts: 55
Location: Mid Italy

PostPosted: Thu Mar 04, 2010 8:06 am    Post subject: Cannot create a prx Reply with quote

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?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Thu Mar 04, 2010 11:09 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
roby65



Joined: 01 Jun 2008
Posts: 55
Location: Mid Italy

PostPosted: Thu Mar 04, 2010 5:14 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
unsigned int



Joined: 13 Aug 2009
Posts: 22

PostPosted: Thu Mar 04, 2010 6:50 pm    Post subject: Reply with quote

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:

psp-prxgen input.elf output.prx
Back to top
View user's profile Send private message
roby65



Joined: 01 Jun 2008
Posts: 55
Location: Mid Italy

PostPosted: Thu Mar 04, 2010 8:51 pm    Post subject: Reply with quote

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:

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....
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Thu Mar 04, 2010 10:06 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
roby65



Joined: 01 Jun 2008
Posts: 55
Location: Mid Italy

PostPosted: Thu Mar 04, 2010 10:31 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Fri Mar 05, 2010 2:40 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Davee



Joined: 22 Jun 2009
Posts: 59

PostPosted: Fri Mar 05, 2010 3:24 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
roby65



Joined: 01 Jun 2008
Posts: 55
Location: Mid Italy

PostPosted: Fri Mar 05, 2010 5:25 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Fri Mar 05, 2010 7:14 am    Post subject: Reply with quote

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:
int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
Back to top
View user's profile Send private message
roby65



Joined: 01 Jun 2008
Posts: 55
Location: Mid Italy

PostPosted: Fri Mar 05, 2010 7:21 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group