www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - LDC Dll support

reply Benjamin Thaut <code benjamin-thaut.de> writes:
How far is the dll support of LDC?
Does the -shared option of the compiler actually work for the x86 mingw 
or x64 msvc versions of ldc?
If it does work, what does -shared do? Does it always export all symbols 
or only those annoted with the "export" attribute?

Kind Regards
Benjamin Thaut
Nov 22 2014
parent reply "Kai Nacke" <kai redstar.de> writes:
On Saturday, 22 November 2014 at 11:03:03 UTC, Benjamin Thaut 
wrote:
 How far is the dll support of LDC?
 Does the -shared option of the compiler actually work for the 
 x86 mingw or x64 msvc versions of ldc?
 If it does work, what does -shared do? Does it always export 
 all symbols or only those annoted with the "export" attribute?

 Kind Regards
 Benjamin Thaut
Hi Benjamin, I never tried to build a dll with x86 mingw compiler - I have to check this. The x64 msvc compiler is currently not able to build a dll - some support code is still missing. Regards, Kai
Nov 24 2014
parent reply Benjamin Thaut <code benjamin-thaut.de> writes:
Am 24.11.2014 21:19, schrieb Kai Nacke:
 On Saturday, 22 November 2014 at 11:03:03 UTC, Benjamin Thaut wrote:
 How far is the dll support of LDC?
 Does the -shared option of the compiler actually work for the x86
 mingw or x64 msvc versions of ldc?
 If it does work, what does -shared do? Does it always export all
 symbols or only those annoted with the "export" attribute?

 Kind Regards
 Benjamin Thaut
Hi Benjamin, I never tried to build a dll with x86 mingw compiler - I have to check this. The x64 msvc compiler is currently not able to build a dll - some support code is still missing. Regards, Kai
That is unfortunate. Then I will have no choice to implemented propper DLL support in the reference compiler ;-) In case you ever try to get it working within ldc I strongly recommend that you ignore the "export" protection level, as it is horribly broken in may ways (see http://wiki.dlang.org/DIP45). Or wait until I'm done implementing DIP45 and its actually accepted into the master branch of dmd. Kind Regards Benjamin Thaut
Nov 25 2014
parent "Kagamin" <spam here.lot> writes:
On Tuesday, 25 November 2014 at 20:26:45 UTC, Benjamin Thaut 
wrote:
 In case you ever try to get it working within ldc I strongly 
 recommend that you ignore the "export" protection level, as it 
 is horribly broken in may ways (see 
 http://wiki.dlang.org/DIP45).
What you refer to is probably only an organizational issue for libraries, which are to be built as both static and dynamic, it doesn't apply to code, which is only to be built as dynamic.
Dec 03 2014