Thread overview
[Issue 17326] 2.072 gc changes totally broke 32 bit Windows DLLs
Apr 14, 2017
Walter Bright
[Issue 17326] 2.072 gc changes broke 32 bit Windows DLLs
Apr 14, 2017
Walter Bright
Apr 14, 2017
Walter Bright
Apr 15, 2017
Rainer Schuetze
Apr 18, 2017
Walter Bright
Oct 07, 2017
Walter Bright
Oct 07, 2017
Rainer Schuetze
Oct 07, 2017
Rainer Schuetze
Feb 28, 2018
Rainer Schuetze
April 14, 2017
https://issues.dlang.org/show_bug.cgi?id=17326

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
The PR that broke it all:

https://github.com/dlang/druntime/pull/1581

--
April 14, 2017
https://issues.dlang.org/show_bug.cgi?id=17326

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|2.072 gc changes totally    |2.072 gc changes broke 32
                   |broke 32 bit Windows DLLs   |bit Windows DLLs

--
April 14, 2017
https://issues.dlang.org/show_bug.cgi?id=17326

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |dll

--
April 15, 2017
https://issues.dlang.org/show_bug.cgi?id=17326

Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario@gmx.de

--- Comment #2 from Rainer Schuetze <r.sagitario@gmx.de> ---
DLLs with clear separation of ownership work fine (e.g. Visual D is a DLL).

As said repeatedly, the GC proxy mechanism is no good but for very simple use cases. Threads need to be shared, too, so the GC can stop and analyze them. Anything happening in a destructor needs to be executed against the correct runtime library, including the C runtime.

Despite that, the proxy mechanism is still there, you can use it as shown in https://wiki.dlang.org/Win32_DLLs_in_D#D_code_calling_D_code_in_DLLs: export gc_setProxy by the DLL and use Runtime.loadLibrary instead of LoadLibraryA to load it.

It's unfortunate that gcstub/gc.d has not been updated (or better removed). You can now select something similar by embedding

  extern(C) __gshared string[] rt_options = [ "gcopt=gc:manual" ]

into the binary. See http://dlang.org/spec/garbage.html#gc_config

--
April 18, 2017
https://issues.dlang.org/show_bug.cgi?id=17326

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
The problem is I cannot get the DLL test cases into the autotester test suite, which is why DLL support regularly breaks.

--
October 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17326

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
Coming up again:

http://www.digitalmars.com/d/archives/digitalmars/D/learn/DLL_hell_S_96980.html

--
October 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17326

--- Comment #5 from Rainer Schuetze <r.sagitario@gmx.de> ---
That's why I've been saying for years that https://wiki.dlang.org/Win32_DLLs_in_D#D_code_calling_D_code_in_DLLs needs a big red warning that it doesn't work but in very simple cases.

--
October 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17326

wererogue@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wererogue@gmail.com

--- Comment #6 from wererogue@gmail.com ---
I'd be lovely to have a doc on how it should be used in the complex cases - if it works at all :/

--
October 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17326

--- Comment #7 from Rainer Schuetze <r.sagitario@gmx.de> ---
Benjamin Thaut has prototyped it and showed it at Dconf
http://dconf.org/2016/talks/thaut.html.
Development seems to have stalled at the moment, though. Latest version should
be this: https://github.com/Ingrater/dmd/tree/DllSupportD2

--
February 28, 2018
https://issues.dlang.org/show_bug.cgi?id=17326

Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Rainer Schuetze <r.sagitario@gmx.de> ---
gcstub has been removed, so I guess we can close this.

--