January 11, 2013
On 2013-01-11 01:28, Martin Nowak wrote:
>> Could you quickly summarize the current state of your related work?
>
> Please have a look at my other post in this thread.
> http://forum.dlang.org/post/50EF5875.1060009@dawg.eu
>

I think we need to start tracking these issues in bugzilla.

-- 
/Jacob Carlborg
January 11, 2013
On 2013-01-11 07:26, F i L wrote:

> Wait.. this was a bit unclear, but it sounded like you just said D's DLL
> issues where fixed awhile ago.. Is D2 capable of correctly loading DLLs?
> What's the situation with Linux?

I'm pretty sure that when he says "DLL" he means DLL on Windows. So the situation is that we cannot correctly use D shared libraries on Posix.

-- 
/Jacob Carlborg
January 11, 2013
On 2013-01-11 00:54, Rob T wrote:

> OK so these functions are not yet portable as stated in the
> documentation, and currently only work for Windows (the docs should be
> updated to state this).

Yes, please file a bug report. Either to fix the documentation or implement the functions for Posix. The Posix functions can be implemented to only work for C shared libraries.

> I'm using Linux, so that means I have to use the usual dlopen, dlclose
> and dlsym? If so, this is at least a start, and I can safely load C
> shared libs as plugins.

Yes.

-- 
/Jacob Carlborg
January 11, 2013
On 2013-01-11 01:10, Martin Nowak wrote:

> Right this is the same state on POSIX and of 2.061 all shared libraries
> produced by dmd try to call a weakly linked `_d_dso_registry` upon
> loading/unloading to pass EH and ModuleInfo tables.
> https://github.com/D-Programming-Language/dmd/pull/1043/files#L0R3112

This code seems to only be fore ELF targets. This is not needed on Mac OS X, right? Bracketed sections are not needed on Mac OS X.

> The current state of:
> https://github.com/dawgfoto/druntime/tree/SharedRuntime
> https://github.com/dawgfoto/phobos/tree/SharedRuntime
> is here:
> http://forum.dlang.org/post/op.wcrffp2asqugbd@localhost
>
> Some unsolved issues remain:
> http://forum.dlang.org/post/mailman.2052.1325532031.24802.digitalmars-d@puremagic.com

Thanks for the update. This looks interesting.

-- 
/Jacob Carlborg
January 11, 2013
On 1/10/2013 11:44 PM, Jacob Carlborg wrote:
> On 2013-01-11 07:26, F i L wrote:
>
>> Wait.. this was a bit unclear, but it sounded like you just said D's DLL
>> issues where fixed awhile ago.. Is D2 capable of correctly loading DLLs?
>> What's the situation with Linux?
>
> I'm pretty sure that when he says "DLL" he means DLL on Windows. So the
> situation is that we cannot correctly use D shared libraries on Posix.


"DLL" is Windows
"shared library" is Linux/OSX/FreeBSD

January 11, 2013
On 2013-01-11 09:21, Walter Bright wrote:

> "DLL" is Windows
> "shared library" is Linux/OSX/FreeBSD

Some people have a tendency to mix the terms. I like to call it "dynamic library" on all platforms.

-- 
/Jacob Carlborg
January 11, 2013
On Thursday, 10 January 2013 at 07:35:54 UTC, Rob T wrote:
> http://dlang.org/phobos/core_runtime.html#.Runtime.loadLibrary
>
> I want to load shared libraries during runtime as plug-in's, but the consensus seemed to indicate that DMD is not yet ready for this. I wonder if these functions provide any useful plug-in support or not?
>
> Thanks!
>
> --rt

Speaking of which,

Anyone else finds themself desiring a "loadSymbol( void * whateverReturnedByLoadLib, string name )" function?

Phil
January 11, 2013
On Friday, 11 January 2013 at 15:34:33 UTC, Phil Lavoie wrote:
> On Thursday, 10 January 2013 at 07:35:54 UTC, Rob T wrote:
>> http://dlang.org/phobos/core_runtime.html#.Runtime.loadLibrary
>>
>> I want to load shared libraries during runtime as plug-in's, but the consensus seemed to indicate that DMD is not yet ready for this. I wonder if these functions provide any useful plug-in support or not?
>>
>> Thanks!
>>
>> --rt
>
> Speaking of which,
>
> Anyone else finds themself desiring a "loadSymbol( void * whateverReturnedByLoadLib, string name )" function?
>
> Phil

it's not a desire, it's must have! O_o
January 11, 2013
On Friday, 11 January 2013 at 15:36:29 UTC, evilrat wrote:
> On Friday, 11 January 2013 at 15:34:33 UTC, Phil Lavoie wrote:
>> On Thursday, 10 January 2013 at 07:35:54 UTC, Rob T wrote:
>>> http://dlang.org/phobos/core_runtime.html#.Runtime.loadLibrary
>>>
>>> I want to load shared libraries during runtime as plug-in's, but the consensus seemed to indicate that DMD is not yet ready for this. I wonder if these functions provide any useful plug-in support or not?
>>>
>>> Thanks!
>>>
>>> --rt
>>
>> Speaking of which,
>>
>> Anyone else finds themself desiring a "loadSymbol( void * whateverReturnedByLoadLib, string name )" function?
>>
>> Phil
>
> it's not a desire, it's must have! O_o
+1
January 11, 2013
On Friday, 11 January 2013 at 02:13:51 UTC, evilrat wrote:
> On Thursday, 10 January 2013 at 23:54:41 UTC, Rob T wrote:
>>
>> OK so these functions are not yet portable as stated in the documentation, and currently only work for Windows (the docs should be updated to state this).
>>
>> I'm using Linux, so that means I have to use the usual dlopen, dlclose and dlsym? If so, this is at least a start, and I can safely load C shared libs as plugins.
>>
>> BTW, where's the portable version of dlsym? Was the omission an oversight, or left out for a reason?
>>
>> --rt
>
> a "portable" version with what we already know commented in
> http://pastebin.com/rz5xPy8W

Thanks for that! I'll make use of that for my C plugins.

--rt