Boehm GC on NDS

support for the ARM toolchain
Post Reply
m4c0
Posts: 9
Joined: Wed May 27, 2009 11:46 am

Boehm GC on NDS

Post by m4c0 » Mon Jun 29, 2009 9:21 pm

I'm trying to use boehm gc with my NDS. I've compiled it with:

Code: Select all

sh ../configure --host=arm-eabi --prefix=%DEVKITPRO%/libgc --target=arm-eabi --disable-shared --disable-libtool-lock --disable-dependency-tracking --disable-threads --with-cross-host=mingw32
Works fine, except that I receive this error when compiling my ELF:

Code: Select all

.../devkitPro/libgc/lib\libgc.a(os_dep.o): In function `GC_get_main_stack_base':
...\gc-7.0\build/../os_dep.c:941: undefined reference to `__stack_base__'
.../devkitPro/libgc/lib\libgc.a(os_dep.o): In function `GC_register_data_segments':
...\gc-7.0\build/../os_dep.c:1718: undefined reference to `end'
collect2: ld returned 1 exit status
"Googling it", I found that "__stack_base__" seems to be mandatory and is defined by newlib's crt0.o (which is not used by devkitARM). How can I solve it? Is it safe to add a .S with this symbol defined? Isn't it possible to use boehm gc?

WinterMute
Site Admin
Posts: 1986
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Boehm GC on NDS

Post by WinterMute » Thu Jul 02, 2009 2:59 am

Can't say this is something anyone has ever tried before tbh, hard to say if it's worthwhile or not.

You'll need to define STACKBOTTOM & DATAEND specifically for the DS when compiling, looks like these are set in include/private/gcconfig.h

something like

Code: Select all

#ifdef NDS
       extern int _end[];
#     define DATAEND (ptr_t)(_end)
       extern int _sp_usr[];
#     define STACKBOTTOM (ptr_t)(_sp_usr)
#endif
and use sh CFLAGS=-DNDS ../configure ...
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests