gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > problem compiling libFB

#112993 - thing - Fri Dec 22, 2006 6:47 am

Hello,

I'm new to NDS development (which means I'm a noob) and I'm trying to recompile Dragonming's libFB and its 'sample1' for the devkitARM 19b but I'm getting problems. Using the supplied Makefile, libFB compiles with flag '-fPIC' for position independent code, but that makes the linker crash when compiling 'sample1' with message:


Code:
arm-eabi-g++ -MMD -MP -MF /home/Abe/nds/projects/libFB_sample1/build/arm9.d -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/home/Abe/nds/projects/libFB_sample1/include -I/home/Abe/nds/projects/libFB_sample1/build -Ic:/util/nds/devkitPro/libfb/include -Ic:/util/nds/devkitPro/libnds/include -Ic:/util/nds/devkitPro/libfb/include -Ic:/util/nds/devkitPro/libnds/include -I/home/Abe/nds/projects/libFB_sample1/build -DARM9 -fno-rtti -fno-exceptions -c /home/Abe/nds/projects/libFB_sample1/source/arm9.cpp -o arm9.o

linking libFB_sample1.elf
c:/util/nds/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: error: no memory region specified for loadable section `.rel.dyn'


If I remove '-fPIC' from libFB makefile, 'sample1' compiles fine, but doesn't run appropriately on dualis nor no$gba (sorry, my gear to run homebrew on my NDS is on its way). The precompiled 'sample1.nds' from Dragonmind's website runs fine on both emulators, though...

I couldn't find anything similar to this in this forum, which makes me think that I'm asking something trivial (sorry if that's the case).

Any ideas to help me get past this error will be greatly appreciated.

Thanks a lot,
Thing.

#113004 - OOPMan - Fri Dec 22, 2006 8:31 am

Some kind of devkitPro version clash maybe?

Possibly DragonMinded was working with an older version of dkp...
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#113007 - chishm - Fri Dec 22, 2006 9:51 am

It is a DKP problem, mainly the link scripts. In fact, I ran across this exact same error a few hours ago. To fix it, you'll need to edit the file ds_arm9.ld . Find the line that says:
Code:
   .got            : { *(.got.plt) *(.got) } >ewram = 0
and change it to
Code:
   .got            : { *(.got.plt) *(.got) *(.rel.got) } >ewram = 0

I'm not entirely sure that this will fix it completely, but at least you'll be able to link it.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#113092 - thing - Fri Dec 22, 2006 11:27 pm

Quote:
I'm not entirely sure that this will fix it completely, but at least you'll be able to link it.


Chishm, your trick makes the linker work, that's great! I would never get it fixed as linking libraries is waaay too advanced for me...

Quote:
I'm not entirely sure that this will fix it completely, but at least you'll be able to link it.


Well, seems to be working... :)

Anyway, I've noticed that libFB 'sample1' source code has problems, the included 'font_kartika_14.h' is making the sample crash. I've replaced it with 'font_arial_9.h' (from 'fonts.zip' also downloadable from Dragonmind's website) and now the sample is alright. It requires a few tweaks to adjust the text boxes with the new font size, but that's easy.

Thanks for all the help... Now if I could find documentation for libFB... ;)

Season's Greetings to you all!
Thing