PDA

View Full Version : Problem with DevKitPSP



LDChen
July 18th, 2005, 18:31
Hello.
I tried to compile my emulator with DevKitPSP-R3 but I have some problems.
I have successfully compiled my code but I have some problems with linking.
I attached here the console output.

pspobj/bios.o: In function `HLE_console_read':
bios.c:(.text+0xcf8): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/bios.o: In function `HLE_console_write':
bios.c:(.text+0xdb0): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0xdd0): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0xe0c): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/bios.o: In function `BIOS_getchar':
bios.c:(.text+0x31a0): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/bios.o: In function `BIOS_putchar':
bios.c:(.text+0x3210): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0x3238): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
bios.c:(.text+0x3270): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
pspobj/hle_0004.o: In function `HLE_Formatted_Write':
hle_0004.c:(.text+0x74): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
hle_0004.c:(.text+0x98): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
hle_0004.c:(.text+0x100): additional relocation overflows omitted from the output
c:/devkitpsp/psp/sdk/lib\libpspdebug.a(scr_printf.o): In function `pspDebugScreenInit':
c:\projects\devkitPro\buildscripts\pspsdk-1.0+beta\sdk\debug/scr_printf.c:47: undefined reference to `sceGeEdramGetAddr'
c:\projects\devkitPro\buildscripts\pspsdk-1.0+beta\sdk\debug/scr_printf.c:48: undefined reference to `sceDisplaySetMode'
c:\projects\devkitPro\buildscripts\pspsdk-1.0+beta\sdk\debug/scr_printf.c:49: undefined reference to `sceDisplaySetFrameBuf'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(fstatr.o): In function `_fstat_r':
fstatr.c:(.text+0x20): undefined reference to `_fstat'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(makebuf.o): In function `__smakebuf':
makebuf.c:(.text+0xf0): undefined reference to `isatty'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(openr.o): In function `_open_r':
openr.c:(.text+0x24): undefined reference to `_open'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x1c): undefined reference to `_sbrk'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(writer.o): In function `_write_r':
writer.c:(.text+0x24): undefined reference to `_write'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(closer.o): In function `_close_r':
closer.c:(.text+0x1c): undefined reference to `_close'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(lseekr.o): In function `_lseek_r':
lseekr.c:(.text+0x24): undefined reference to `_lseek'
C:/DEVKIT~3/BIN/../lib/gcc/psp/3.4.4/../../../../psp/lib\libc.a(readr.o): In function `_read_r':
readr.c:(.text+0x24): undefined reference to `_read'
collect2: ld returned 1 exit status
C:\DEVKIT~3\BIN\MAKE.EXE: *** [pspfpse.elf] Error 1

The relocation errors aren't a problem, I just need to understand why the GOT overflows so easily.
The true problems are the missing functions.
Should I write the UNISTD functions myself?
The 'sce' stubs are also missing.
I'm linking with "-lc -lpspglue -lpspkernel -lpspdebug" libraries.
The stubs seem to be into "psplibc" but I can't use it because it makes conflicts with other functions into the libc.
If I use psplibc instead of libc, I have much more errors because there are many functions not implemented.
All suggestions are appreciated, thanks in advance.

Sincerely,

LDChen.

LDChen
July 20th, 2005, 09:14
Hello,
I was able to solve all compilation problems.
However, there are surely some bugs with the libraries.
For example, the getttimeofday() calls an sceKernelGettimeofday().
But this function doesn't exist: the linking phase fails because the stub is called "sceKernelLibcGettimeofday" and not "sceKernelGettimeofday".
After doing the good fixes, it worked fine.
I hope this may help other developers.

But now I have another problem.
Compiled Applications don't work into PSPE.
I tried the PSPSDK sample, I just added a PNG icon otherwise PSPE hangs without it.
I tried to run the generated EBOOT.PBP and PSPE quits.
Into STDERR.TXT I read:

load C:\temp\pspe\ms0\PSP\GAME\SDK\EBOOT.PBP
PBP format
illegal address
PC = 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
Fatal signal: Segmentation Fault (SDL Parachute Deployed)

Any suggestions?

Sincerely,

LDChen

nexis2600
July 22nd, 2005, 23:57
looks like maybe a bad pbp?

I have a 1.0 unit if you need it tested on a real psp to see if its a falt of the emulator or the file itself.

- edit -
What output files do you get from compiling? Also can you post your makefile?

I am not fully sure since I still use the old nem method but maybe i can help.

Shadow0813
June 20th, 2006, 19:28
What fixes are these, and where can I get them? I'm getting errors with functions with the sce prefix.

dalejrrocks
June 20th, 2006, 22:46
DL the latest Devkit which is 8. Or better yet use xorloser's precompiled toolchain+SDK if you are going to use precompiled stuff. You can read my tutorial "The Quick + Easy Way to Start Developing in C/C++" for help installing.

Shadow0813
June 22nd, 2006, 16:54
Oh, I've got R7. I didn't know there was much difference.

Shadow0813
June 22nd, 2006, 17:04
Now I'm getting undefined references to everything from cosf to sceKernelExitGame.

yaustar
June 22nd, 2006, 17:47
Try contacting the authors, I am sure they appreciate any of the bug reports they can get.