ICE due to unsupported target

Timo Sintonen t.sintonen at luukku.com
Sat Mar 8 00:09:28 PST 2014


On Saturday, 8 March 2014 at 07:52:10 UTC, Mike wrote:
> I'm getting an ICE in d-target.cc/critsecsize when I create a 
> synchronized block.  Looking at the source code, it's pretty 
> obvious why - my target (ARM Cortex-M bare metal) isn't any of 
> the ones listed:
>
> if (global.params.isWindows)
>   ...
> else if (global.params.isLinux)
>   ...
> else if (global.params.isFreeBSD)
>   ...
> else if (global.params.isOpenBSD)
>   ...
> else if (global.params.isOSX)
>   ...
> else if (global.params.isSolaris)
>   ...
>
> gcc_unreachable();  //ARM cortex-M (ARM Thumb): Ouch!
>
> Interestingly, it only lists OSs, not CPU architectures.  If I 
> look at the Param struct in mars.h, it seems there is no 
> parameter that suits my target.
>
> I may be able to submit a pull request to change this (at least 
> partially), but I'm looking for advice on how to add support 
> for my target.
>
> * Does GDC/DMD need a new isARMThumb/isBareMetal/isWhatever 
> param?
> * Should critsecsize return sizeof(target's size_t) if not 
> otherwise specified instead of calling gcc_unreachable()?
>
> I realize there is a broader problem here than support for 
> synchronized.  What's the correct way to go about adding 
> support for my target platform.
>
> Thanks,
> Mike

Why do you need synchronized? Are you building some kind of 
multithreading library?



More information about the D.gnu mailing list