Using LDC to compile D code for the PSP (Playstation Portable)

pineapple meapineapple at gmail.com
Mon Sep 7 22:47:44 UTC 2020


On Monday, 7 September 2020 at 22:33:52 UTC, kinke wrote:
> Seems like you're looking for `-mabi=eabi`, according to 
> https://github.com/ldc-developers/ldc/blob/032b492bcbc77625866e4a86b3cbc990a74bfb7a/driver/targetmachine.cpp#L106-L118.

Aha, thank you. That option wasn't showing up with --help but it 
was exactly what I needed

Getting some new errors now, though I'm not sure how LDC's object 
file output could be connected to them. But the same errors don't 
occur when linking with a main file written in C, of course, so 
it must be related somehow.

     e:\Sync\Projects\psp\test>make clean & make
     rm -f test.prx test.elf src/module.o src/main.o PARAM.SFO 
EBOOT.PBP EBOOT.PBP
     psp-gcc -I. -IC:/pspsdk/psp/sdk/include -G0 -Wall -std=c99 
-IC:/pspsdk/psp/include -IC:/pspsdk/lib/gcc/psp/8.2.0/include 
-BC:/pspsdk/lib/gcc/psp/8.2.0 -BC:/pspsdk/psp/lib 
-D_PSP_FW_VERSION=500   -c -o src/module.o src/module.c
     psp-gcc -I. -IC:/pspsdk/psp/sdk/include -G0 -Wall -std=c99 
-IC:/pspsdk/psp/include -IC:/pspsdk/lib/gcc/psp/8.2.0/include 
-BC:/pspsdk/lib/gcc/psp/8.2.0 -BC:/pspsdk/psp/lib -I. 
-IC:/pspsdk/psp/sdk/include -G0 -Wall -std=c99 
-IC:/pspsdk/psp/include -IC:/pspsdk/lib/gcc/psp/8.2.0/include 
-BC:/pspsdk/lib/gcc/psp/8.2.0 -BC:/pspsdk/psp/lib  -o src/main.o 
src/main.s
     psp-ld: Dwarf Error: found dwarf version '4', this reader 
only handles version 2 information.
     C:/pspsdk/psp/lib/crt0.o: In function `_main':
     (.text+0x44): undefined reference to `strlen'
     C:/pspsdk/psp/lib/crt0.o: In function `_main':
     (.text+0x90): undefined reference to `atexit'
     C:/pspsdk/psp/lib/crt0.o: In function `_main':
     (.text+0xa4): undefined reference to `exit'
     C:/pspsdk/psp/lib/crt0.o: In function `_start':
     (.text+0x1b4): undefined reference to `sceKernelCreateThread'
     C:/pspsdk/psp/lib/crt0.o: In function `_start':
     (.text+0x1c4): undefined reference to `sceKernelStartThread'
     make: *** [src/main.o] Error 1



More information about the digitalmars-d-ldc mailing list