Placing variable/array in a particular section

Johannes Pfau via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 5 03:16:09 PDT 2015


Am Sat, 04 Apr 2015 10:38:44 +0000
schrieb "Jens Bauer" <doctor at who.no>:

> On Saturday, 4 April 2015 at 02:57:22 UTC, Rikki Cattermole wrote:
> > On 4/04/2015 3:08 a.m., Jens Bauer wrote:
> >>> src/start.d:7:10: error: module attribute is in file 
> >>> 'gcc/attribute.d' which cannot be read
> >>>   import gcc.attribute;
> >>>          ^
> >>
> >> Uhm, it seems that druntime is required for that; 
> >> unfortunately it's not
> >> ported to the Cortex-M platform.
> >> I found the attribute.d file and tried a quick copy-and-paste, 
> >> but no luck there.
> 
> Correction: minlibd *is* a druntime port; just a minimal one.
> However, I'm not sure this feature is supported yet.
> Timo Sintonen did a lot of great work; perhaps getting this 
> detail supported might not require much sweat. ;)
> 
> > Yeah, contact the GDC guys, they should be able to help you.
> > Either the GDC newsgroup or as an issue on the compiler's 
> > project.
> 
> A-ha! I just discovered this page...
> <http://www.digitalmars.com/NewsGroup.html>
> 
> > Atleast at this point, keep an open mind. Think of what you are 
> > doing as testing the current state :)
> 
> I will, though my impression until now, is that the compiler is 
> quite mature.
> (I accept that there will always be some minor issues when moving 
> to a new system, but that does not drag down the quality of the 
> compiler).

It's possible to use gcc.attribute with custom mini-runtimes. You need
the gcc/attribute.d file but you can simply copy/paste it from
druntime[1], there are no dependencies. I'll push support for the
section attribute in 1~2 hours. (waiting for the testsuite ;-)

[1]
https://github.com/D-Programming-GDC/GDC/blob/master/libphobos/libdruntime/gcc/attribute.d


More information about the Digitalmars-d-learn mailing list