embedded D?

kenny funisher at gmail.com
Mon Aug 20 09:50:21 PDT 2007


quick background... I wanted to do some fast network socket stuff using libowfat... so I converted the h file and stuff... good stuff, then I remembered it was linked against dietlibc, not glibc. So, instead of converting to Tango (which is what I should have done), I added the necessary symbols to dietlibc for the GC to work, and converted phobos over.

I now have a bunch of code that I don't know what to do with... (I ended up converting/linking libowfat against glibc).

Would anyone be interested in an embedded D project? I would obviously maintain it and develop it, if there was interest. I have D phobos linked against dietlibc already. Once the gc is separate, I think I can get D producing 32K executables, dynamically linked against dietlibc + phobos or tango (leaning more toward tango).

At the moment, phobos + dietlibc only accounts for about 300KB extra, so it would actually be a very small installation (less than 1MB) compared to the monstrosity of glibc. dietlibc is a bit slower in a few functions though. One of the most often complaints I hear about D is it's executable size (because of statically linking phobos). Perhaps this can help

L3 phobos # dmd -gc -c test.d && gcc -static -nostdlib -L /usr/diet/lib-i386/ /usr/diet/lib-i386/start.o -o test test.o dmain2.o libphobos2.a -lpthread -D__dietlibc__ /usr/diet/lib-i386/libc.a -lgcc -lm -lowfat /usr/diet/lib-i386/libc.a
L3 phobos # ldd test
        not a dynamic executable
L3 phobos # ls -l test
-rwxr-xr-x 1 root root 390302 Aug 20 18:40 test
L3 phobos # strip test
L3 phobos # ls -l test
-rwxr-xr-x 1 root root 279296 Aug 20 18:41 test

Ideas? Opinions? I know I wasted my time, but I want to make something useful out of it :) This would also allow D (assuming gdc support) to create small executables for ARM, alpha, sparc, s390, ppc, and mips.



More information about the Digitalmars-d mailing list