On Monday, 12 November 2012 at 08:31:32 UTC, Johannes Pfau wrote:
Am Sun, 11 Nov 2012 17:38:08 -0800
schrieb Dan Olson <zans.is.for.c...@yahoo.com>:



Even a simple D module with just a extern(C) function depends on something in druntime, so I have to get part of that to build first.


_Dmodule_ref?
You can just declare it as extern(C) __gshared void* _Dmodule_ref; (But
IIRC you have to compile with -nophoboslib to make it work)
It's used by the runtime/compiler to setup the ModuleInfos but you
don't have to initialize it, it just needs to be declared.

Module initialization code seems to use _Dmodule_ref to make some kind of linked list of module constructors even when we do not have any. I disabled module stuff from d-glue.cc:2828. The only unresolved reference I get now is __aeabi_unwind_cpp_pr1, which is found in libgcc.a. This library may not be searched by default in cross compilers, but has to be given separately.

In arm compiler it should be checked in gcc sources that the right library for the target processor is generated (Cortex libraries for example are not generated by default) The file is in one in gcc-source/gcc/config/arm/t-* . If the library is there it has to be checked that the linker finds the right one. Command gcc -print-libgcc-file-name tells the library name and gcc -print-multi-lib tells the available libraries

I have now a minimum libdruntime library for arm-eabi. If there are any other unresolved symbols, please let us know.

Reply via email to