Alloca copy: What's _pastdata?

ARaspiK arav1025 at gmail.com
Mon Apr 2 07:57:28 UTC 2018


I'm creating a minimal DRuntime (for messing around). Right now, 
I have a very basic program that doesn't even link to the C 
runtime, and uses syscalls for everything. I'm trying to 
implement alloca so that I can parse arguments (long story), and 
so I went to druntime/src/rt/alloca.d.

Everything I found there looked OK except for _pastdata.
I saw the comment before the function declaration declaring 
_pastdata to be an extern C variable, and I defined it as such. 
DMD failed to compile, saying that it cannot load from TLS. I 
then added '__gshared' to the declaration, but DMD failed again, 
saying "Cannot directly load global variable with PIC code." Is 
there any way I can get alloca to work?


More information about the Digitalmars-d-learn mailing list