This week's experiment build gdc with tls disabled.
Johannes Pfau
nospam at example.com
Fri Dec 20 01:27:17 PST 2013
Am Fri, 20 Dec 2013 08:43:12 +0100
schrieb Jacob Carlborg <doob at me.com>:
> On 2013-12-19 18:59, David Nadlinger wrote:
>
> > That is pretty much how it is done in DMD and LDC as well. The only
> > difference is that instead of modifying the linker scripts to
> > accommodate this, we emit the ModuleInfo references to custom
> > sections. The GNU toolchain (and we are in highly system-specific
> > territory here anyway) never changes the order of custom sections,
> > which you can also verify using __attribute__((section("...))) in
> > GCC. Thus, if you emit your relevant symbols into three sections
> > like this,
>
> Does that really work reliably? As far as I remember, the trick with
> brackting sections doesn't work on Mac OS X. DMD had some problems
> with that. It basically broke on every new major release of Mac OS X,
> the linker changed all the time. If I recall correctly it either
> removed the empty sections or reordered the sections.
>
> But the dynamic linker on Mac OS X has an API to access these
> sections easily anyway.
>
Seems like the OSX linker is not based on the GNU linker and doesn't
have linker scripts either. There's some "sectorder" argument which
might be useful though.
But relying on the runtime on OSX isn't bad as there's only one runtime
anyway. On linux we have different libcs and non-standard interfaces
which isn't optimal.
More information about the D.gnu
mailing list