GP32 Devkitarm And Gpsdk_eabi Linking Problems


kidchaos2k6

Still Fresh
Joined
Dec 26, 2005
Messages
52
Hi,

Well, here i am again... By some chances of destiny im having some time to spare with gp32 coding again... and i have decided a new direction after failures in any other ways: This time im trying to work from scratch using the latest GPSDK_EABI posted by DJWillis some time ago and the latest dkarm that the devkitpro updater installed on my machine (yesterday february 7th in the evening).. I will try to make the tests on visual studio 6 and on dkarm at the same time...

By now a clean "void GpMain (void * arg){}" compiles on VC6, but i cannot compile this on dkarm, see make result and such below:

unsigned int HEAPSTART;
unsigned int HEAPEND;

int main (int arg_len, char * arg_v)
{
}

arm-eabi-g++ -marm -march=armv4t -mtune=arm920t -mapcs -fomit-frame-pointer -f short-enums -ffast-math -fshort-double -mstructure-size-boundary=32 -mno-thumb-i nterwork -IGPSDK_EABI/include -Wno-multichar -c src/gpstrtp/gpstartup.cpp -o obj/gpstartup.o

arm-eabi-gcc -Wl,--strip-debug -o SDLtest.elf obj/gpstartup.o -specs=gp32_gpsdk.specs -Wl,-Map,SDLtest.map -LGPSDK_EABI/lib -lgpgraphic -lgpgraphic16 -lgpmem -lgpos -lgpstdlib -lgpstdio -lgpsound -lgpg_ex01 -lgpfont -lgpfont16
GPSDK_EABI/lib\libgpstdlib.a(asm_gpstdlib.o): In function `GpGraphicModeSet':
(.text+0xd0): undefined reference to `_gp_os_res_lock'
GPSDK_EABI/lib\libgpstdlib.a(asm_gpstdlib.o): In function `GpGraphicModeSet':
(.text+0xf0): undefined reference to `_gp_os_res_unlock'
GPSDK_EABI/lib\libgpstdlib.a(asm_gpstdlib.o): In function `GpLcdLock':
(.text+0x194): undefined reference to `_gp_os_res_lock'
GPSDK_EABI/lib\libgpstdlib.a(asm_gpstdlib.o): In function `GpLcdUnlock':
(.text+0x1b4): undefined reference to `_gp_os_res_unlock'
GPSDK_EABI/lib\libgpstdlib.a(gpstdlib.o): In function `_system_timer_init':
gpstdlib.c:(.text+0x180): undefined reference to `_GPOSTickISR'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/lib\li bsysbase.a(sbrk.o): In function `_sbrk':
(.text+0x7c): undefined reference to `__end__'
collect2: ld returned 1 exit status
make: *** [SDLtest.elf] Error 1


during the last year i have managed to understand better the tricks of the makefiles... so i dont think its a problem of these, by the way trying to compile the example ex000 of the EABI_GPSDK i got this error too:

arm-eabi-gcc -Wl,--strip-debug -o ex000.elf ../../gpstartup.o gpmain.o -specs=gp32_gpsdk.specs -Wl,-Map,ex000.map -L../../lib -lgpgraphic -lgpgraphic16 -lgpmem -lgpos -lgpstdlib -lgpstdio -lgpsound -lgpg_ex01 -lgpfont -lgpfont16
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/lib\libsysbase.a(sbrk.o): In function `_sbrk':
(.text+0x7c): undefined reference to `__end__'
collect2: ld returned 1 exit status
make: *** [ex000.elf] Error 1


As usual, i will appreciatte any help

Regards

@B^)>
 
kidchaos2k6 posted on Feb 8 2007 at 11:01 PM said:
...

c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/lib\libsysbase.a(sbrk.o): In function `_sbrk':
(.text+0x7c): undefined reference to `__end__'
collect2: ld returned 1 exit status
make: *** [ex000.elf] Error 1

...

Same error with all my projects when I try to compile and link them with the new devkitarm_r20.
It works fine with r19b.
I think this kind of problems occured with r18 too.

Thor
 
Last edited by a moderator:
Part of the problem it's solved...

For the record this is what Wintermute told me:

> This one is related to some recent changes I made in the libgloss
> patches. Some users were having problems with malloc not working when a
> variable named end was used so I added underscores. Unfortunately I
> neglected to update the gp32 linkscripts with the new name.
>
> You can edit the linkscripts ( gp32.ld and gp32_gpsdk.ld found in <path
> to devkitARM>/arm-eabi/lib> ) to fix this.
>
> find the line that says
>
> end = __bss_end;
>
> change it to
>
> __end__ = __bss_end;

AND on the next line (this is for dumbs like me):

/*PROVIDE (end = end);*/

changed to

PROVIDE (end = __end__);

Ill check the other problems which may be on my makefile...

Regards,


@B^)>
 
:)

and the other part also,

it seemed that the GPSDK libs required the GpPredefinedStackGet function to be defined somewhere inside my code (gpstartup.c)...

Sorry for the common mistake...

Regards
 
Back
Top