So the recent post about DS development was ample kick in the bum for me to relook over my attempts to get devkitpro working on FreeBSD. Where we last left off, there was an issue in the last stage of the linker. Since devkitARM-r23b uses gcc 4.3.0 and my arm-eabi gcc compiler is 4.2.1, I suspected that the version difference was fucking it up.
Quickly checking the release notes, I found that the first step down was devkitARM-r21, which is built with gcc 4.2.3, so I moved the old devkitARM over and untar’d the new one. Or, I guess, moved the new one and untar’d the old one (fucking semantics). Anyway, then I had to go through the usual procedure to strip out the version of gcc it comes with and use my shit –
- rm ./bin/arm-eabi-*
- brandelf -t linux ./bin/*
- For each binary in ./arm-eabi/bin, remove it and replace it with a symlink to the corresponding tool on my system.
Then hacked in some hard-coded paths to the appropriate shit (I think I tried last time to dick around with LDFLAGS to get these into the search path, but couldn’t figure out how to do it. Might go back and look at it later to clean shit up since hard-coding paths is fail) –
$ diff --from ./arm-eabi/lib/ds_arm9.specs.old ./arm-eabi/lib/ds_arm9.specs
8c8
< %(old_link) -T ds_arm9.ld%s
---
> %(old_link) -T /usr/local/devkitPro/devkitARM/arm-eabi/lib/ds_arm9.ld%s
11c11
< ds_arm9_crt0%O%s crti%O%s crtbegin%O%s
---
> /usr/local/devkitPro/devkitARM/arm-eabi/lib/ds_arm9_crt0%O%s crti%O%s crtbegin%O%s
And that’s basically where I left off last time. With this configuration (r21 of devkitARM) I get a much more palatable error –
/usr/local/libexec/gcc/arm-eabi/4.2.3/ld: cannot find -lsysbase
A quick find shows that this library is located in ./arm-eabi/lib (which was not in the search path in the command), which is easily fixed by tweaking the LDFLAGS (which should be set the project’s Makefile) –
LDFLAGS = -v -specs=$(DEVKITARM)/arm-eabi/lib/ds_arm9.specs \
-L$(DEVKITARM)/arm-eabi/lib -g $(ARCH) \
-Wl,-Map,$(notdir $*.map)
With that in, the 16bit_color_bmp compiles and produces binaries! Unfortunately, I don’t have my hardware on my (and there are no emulators for FreeBSD LOL!) so I won’t actually be able to test them until I get home. I imagine that they’ll work, and if they do then FUCK YEAH SEAKING.
Update: the binary runs fine on the hardware. I want to compile the rest of the examples with my hacked toolchain (and clean up the hacks a bit so it works with their vanilla makefiles, I guess). After that, I’m not sure if I want to set up a debugging environment, say “fuck it” and just start coding something, or rig up a framework to develop on the DS in Haskell (kekeke).
9 comments