Linker problems with arm-wince, need help/info

pedro alves pedro.alves at domatica.pt
Tue Jun 20 15:51:41 PDT 2006


Chad J wrote:
> Pedro Alves wrote:
>> One more thing.
>> There is usually a #define USER_LABEL_PREFIX "_" or #define 
>> USER_LABEL_PREFIX ""
>> in gcc/config/$arch/someheader.h. In cegcc it is defined as 
>> USER_LABEL_PREFIX "".
>> Maybe that isn't being used in the D frontend and an '_' is preppended 
>> unconditionally?
>>
> 
> This seems to have saved the day!
> 
> In gcc/config/arm/wince-pe.h I added this code:
> 
> #undef  LIB_SPEC
> #define LIB_SPEC \
>   { "%{staticlibs:-lgcc -lstdc++ -lsupc++ -lc -lm -lwinsock} 
> %{!staticlibs:-lcdll -lcdllimp} -lcoredll" }
> 
> // solve underscoring problems when linking
> #undef  USER_LABEL_PREFIX
> #define USER_LABEL_PREFIX ""
> 
> The LIB_SPEC stuff makes it link to the newlib libraries and such 
> without the need of an external specfile - this saves anyone who wants 
> to build this from having to do a bunch of xgcc trickery to get the 
> thing to eat a specfile.
> 
> Apparently I'm not out of the woods yet though.  There are unresolved 
> references still.  The linker's error output is attached.  It seems to 
> be all Phobos stuff - it's calling functions that I don't think exist on 
> WinCE.  For some reason those functions must be defined in the headers 
> while not actually being implemented.  These are things like 
> GetCurrentDirectory, which shouldn't exist since WinCE doesn't have the 
> concept of a current working dir (AFAIK).  If I'm wrong about this, do 
> let me know before I get too far in extending parts of phobos.
> 
> I'm probably going to try cegcc newlib now.  Hopefully it can fill in 
> some of those undefined references.
> 

Most of those undefined references you will be able to fix by switching 
from ascii to wide versions. Like CreateFileA -> CreateFileW, since 
wince is fully unicode (only).

And, the cegcc runtime has a notion of current directory. :)
I'm waiting for you at our mailing list ;)


> Thanks for the massive help Pedro!  Your intervention just saved me many 
> hours of pain and frustration :)
> Thank you too David, for the initial help and your work on GDC!
> 
> 

Thank you too, for making D possible in Windows CE. I will try D when
you have this working ;) I have been reading these newsgroups for ages,
but never really tried D.

Cheers,
Pedro Alves



More information about the D.gnu mailing list