shared library

2010-03-05 Thread Igor Lesik
I was able to build D runtime shared library (.so). The test app dies with segmentation fault, I am debugging it; decided to share. To reproduce my results one can load makefile from here: http://www.curoles.com/j/dso/so.mak (drop it into the runtime directory and call make -f so.mak) The

Re: shared library

2010-03-06 Thread Igor Lesik
dynamically linked with runtime shared library. Also

Re: shared library

2010-03-06 Thread Igor Lesik
dynamically linked with runtime shared library. Thanks, Igor "Igor Lesik" wrote in message news:hmujil$nt...@digitalmars.com... > Walter, Don, and All > > Function codgen() in dmd/backend/cgcod.c has lines like: > if (0 && config.flags3 & CFG3pic) > so the

gdc shared library build

2014-09-05 Thread Russel Winder via Digitalmars-d
Iain, I suspect I have failed to: a) remember something I should know; and b) discover something I should be able to find out from the webverse. However: I am trying to create a shared library. I have DMD and LDC command lines that create a shared object without reporting errors (doesn't

Shared library packaging issues

2014-11-15 Thread GreatEmerald via Digitalmars-d
I'm currently attempting to package my D project (https://github.com/GreatEmerald/libarcomage/) as a shared library for openSUSE and whatnot, but I'm running into some policy problems. First, in order to build a shared library, it has to link against libphobos2.so. libphobos2.so i

Compile a shared library

2016-04-09 Thread Nafees via Digitalmars-d
I am trying to create a shared library, I just tried to compile the code that Mono-D generates for an empty shared library. I tried to compile it, but there were errors, and this is what the compile log said: Building Solution: QScr (Debug) Building: QScr (Debug) Performing main compilation

Linux Shared Library Fun

2009-04-11 Thread jeff
So, I've been messing around with creating shared libraries in D and then dynamically loading them into another D program and calling the functions. Thus far this is very simple: just using a function that prints "hello" in the library and then the main program loads it. This whole thing works

Re: gdc shared library build

2014-09-05 Thread David Nadlinger via Digitalmars-d
On Friday, 5 September 2014 at 17:14:30 UTC, Russel Winder via Digitalmars-d wrote: I am trying to create a shared library. I have DMD and LDC command lines that create a shared object without reporting errors (doesn't mean they work though). Huh? If there are any issues with LDC s

Re: gdc shared library build

2014-09-05 Thread ketmar via Digitalmars-d
On Fri, 05 Sep 2014 18:14:20 +0100 Russel Winder via Digitalmars-d wrote: > mean they work though). Sadly GDC isn't playing ball with: gdc cannot into shared druntime and phobos yet (and shared libraries at all for that means). there was some work on it recently, but it's still not ready for publ

Re: gdc shared library build

2014-09-05 Thread Russel Winder via Digitalmars-d
On Fri, 2014-09-05 at 17:16 +, David Nadlinger via Digitalmars-d wrote: > On Friday, 5 September 2014 at 17:14:30 UTC, Russel Winder via > Digitalmars-d wrote: > > I am trying to create a shared library. I have DMD and LDC > > command lines > > that create a shared

Re: gdc shared library build

2014-09-05 Thread Russel Winder via Digitalmars-d
On Fri, 2014-09-05 at 17:16 +, David Nadlinger via Digitalmars-d wrote: > On Friday, 5 September 2014 at 17:14:30 UTC, Russel Winder via > Digitalmars-d wrote: > > I am trying to create a shared library. I have DMD and LDC > > command lines > > that create a shared

Re: gdc shared library build

2014-09-05 Thread Johannes Pfau via Digitalmars-d
Am Fri, 05 Sep 2014 18:14:20 +0100 schrieb Russel Winder via Digitalmars-d : > Thus I have to specify forcing lookup in > libphobos2.so. Is this easy? This is the easy part, but you also need a libgphobos2.so first ;-) As ketmar said this is not implemented in GDC yet. I've filed a pull request

Re: gdc shared library build

2014-09-05 Thread ketmar via Digitalmars-d
On Fri, 5 Sep 2014 20:04:46 +0200 Johannes Pfau via Digitalmars-d wrote: > * There are some unresolved bugs with PIC codegen, 2 test cases fail. and some more bugs i sent to Iain directly by e-mail. one related to PIC and one to optimizer which removes some necessary code. but i believe that thos

Re: Shared library packaging issues

2014-11-15 Thread tcak via Digitalmars-d
Well, because of this reason, I completely left D and started writing my shared library in pure C. As much as I miss the syntax of D, I needed to do this (Where are you betterC? Are you there yet?). Since it is not a big library, that wouldn't be a big problem. Anyway, I think inste

Re: Shared library packaging issues

2014-11-15 Thread Jordi Sayol via Digitalmars-d
El 15/11/14 a les 12:21, GreatEmerald via Digitalmars-d ha escrit: > Ideally, this problem would be solved by splitting libphobos2.so into its own > package. Since dmd v2.064.0, a shared phobos2 library package already exist for Debian based systems:

Re: Shared library packaging issues

2014-11-15 Thread GreatEmerald via Digitalmars-d
On Saturday, 15 November 2014 at 14:49:23 UTC, Jordi Sayol via Digitalmars-d wrote: Since dmd v2.064.0, a shared phobos2 library package already exist for Debian based systems:

Re: Shared library packaging issues

2014-11-15 Thread Jordi Sayol via Digitalmars-d
El 15/11/14 a les 18:29, GreatEmerald via Digitalmars-d ha escrit: > Nice. Now if only there were RPMs as well... If only as a template. Meanwhile there is not an RPM package for phobos 2 shared library, I think you can spread it together with your library: "/usr/lib/i386-linux-gnu/li

Re: Shared library packaging issues

2014-11-15 Thread GreatEmerald via Digitalmars-d
On Saturday, 15 November 2014 at 18:36:28 UTC, Jordi Sayol via Digitalmars-d wrote: Meanwhile there is not an RPM package for phobos 2 shared library, I think you can spread it together with your library: "/usr/lib/i386-linux-gnu/libphobos2.so.0.66.1" (for 32-bit) "/usr/lib/x

Re: Shared library packaging issues

2014-11-15 Thread Iain Buclaw via Digitalmars-d
On 15 Nov 2014 21:05, "GreatEmerald via Digitalmars-d" < digitalmars-d@puremagic.com> wrote: > > On Saturday, 15 November 2014 at 18:36:28 UTC, Jordi Sayol via Digitalmars-d wrote: >> >> >> Meanwhile there is not an RPM package for phobos 2 shared library,

Re: Shared library packaging issues

2014-11-15 Thread David Nadlinger via Digitalmars-d
On Saturday, 15 November 2014 at 21:01:49 UTC, GreatEmerald wrote: Though it does make me wonder, how do GDC and LDC handle this issue? Do they also include libphobos2 as part of the compiler? That's something entirely up to the distro packagers to get right in the case of LDC. We don't direct

Re: Shared library packaging issues

2014-11-15 Thread GreatEmerald via Digitalmars-d
On Saturday, 15 November 2014 at 22:19:07 UTC, Iain Buclaw via Digitalmars-d wrote: It's a libgphobos-dev package for gdc. Ah, so they repackage it as well. Same with LDC. Not that it helps much, given that there's also no GDC on openSUSE. Oh well.

Re: Shared library packaging issues

2014-11-16 Thread Marco Leise via Digitalmars-d
Am Sat, 15 Nov 2014 15:35:48 +0100 schrieb Jordi Sayol via Digitalmars-d : > El 15/11/14 a les 12:21, GreatEmerald via Digitalmars-d ha escrit: > > > Ideally, this problem would be solved by splitting libphobos2.so into its > > own package. > > Since dmd v2.064.0, a shared phobos2 library packa

Re: Shared library packaging issues

2014-11-17 Thread GreatEmerald via Digitalmars-d
On Monday, 17 November 2014 at 02:29:54 UTC, Marco Leise wrote: Exactly a year ago I created a poll[1] about the include path and 65% voted for "dlang" over just "d". We should stick to "/usr/include/dlang" now for a consistent experience across distributions. Compilers' import paths are less of

Re: Shared library packaging issues

2014-11-18 Thread via Digitalmars-d
On Monday, 17 November 2014 at 19:36:10 UTC, GreatEmerald wrote: But otherwise I pinged some people on openSUSE and it seems there is some interest in D, so now we have a separate project for it. That's great to hear! Duncan Mac-Vicar started work on an LDC packages, which I'm keeping up-to-d

Re: Shared library packaging issues

2014-11-18 Thread GreatEmerald via Digitalmars-d
On Tuesday, 18 November 2014 at 11:14:06 UTC, Marc Schütz wrote: That's great to hear! Duncan Mac-Vicar started work on an LDC packages, which I'm keeping up-to-date since then: https://build.opensuse.org/package/show/home:marc_schuetz:branches:home:dmacvicar/ldc I'm going to ask him, and then

Re: Shared library packaging issues

2014-11-18 Thread GreatEmerald via Digitalmars-d
On Monday, 17 November 2014 at 19:36:10 UTC, GreatEmerald wrote: Though I'm still a bit unsure about the whole druntime part. The official RPM doesn't include any libraries for druntime, only includes, albeit building it from source does produce a druntime library. Is it worth separating it out

Re: Shared library packaging issues

2014-11-18 Thread Marco Leise via Digitalmars-d
Am Mon, 17 Nov 2014 19:36:08 + schrieb "GreatEmerald" : > On Monday, 17 November 2014 at 02:29:54 UTC, Marco Leise wrote: > > Exactly a year ago I created a poll[1] about the include path > > and 65% voted for "dlang" over just "d". We should stick to > > "/usr/include/dlang" now for a consist

Re: Shared library packaging issues

2014-11-18 Thread GreatEmerald via Digitalmars-d
On Tuesday, 18 November 2014 at 16:26:58 UTC, Marco Leise wrote: ABI differences in source files only apply to druntime/Phobos and these imports are generally on the default import path. I was more concerned with GtkD and similar 3rd party libraries, for which you have to specify the import path.

Re: Shared library packaging issues

2014-11-18 Thread Marco Leise via Digitalmars-d
Am Tue, 18 Nov 2014 17:10:18 + schrieb "GreatEmerald" : > On Tuesday, 18 November 2014 at 16:26:58 UTC, Marco Leise wrote: > > ABI differences in source files only apply to druntime/Phobos > > and these imports are generally on the default import path. I > > was more concerned with GtkD and si

Shared Library, that is when ?

2014-04-11 Thread bioifornatics
Dear, I know vthat D community dev works hard. I would like to know when provide shared Shared Library will become a priority ? I know you could say do it ( i know … ) but my job is to package tools. Sorry … Partial shared lib give too many random bug as this one: https://github.com/ldc

DMD - issue building shared library

2016-01-17 Thread Dibyendu Majumdar via Digitalmars-d
Hi I have an existing C shared library that I am trying to link to a D shared library. The D shared library at present only has a binding (extern (C)) definition, nothing else. When I try to create the shared library using the DMD command line I get link errors. Platform is Windows 10 64

Re: Compile a shared library

2016-04-11 Thread bitwise via Digitalmars-d
On Sunday, 10 April 2016 at 05:34:24 UTC, Nafees wrote: I am trying to create a shared library, I just tried to compile the code that Mono-D generates for an empty shared library. I tried to compile it, but there were errors, and this is what the compile log said: Building Solution: QScr

Re: Linux Shared Library Fun

2009-04-11 Thread jeff
jeff wrote: So, I've been messing around with creating shared libraries in D and then dynamically loading them into another D program and calling the functions. Thus far this is very simple: just using a function that prints "hello" in the library and then the main program loads it. This whol

Build Linux shared library from DMD

2010-11-10 Thread Steve Teale
In the Apache mod_d thread I saw: gcc -shared -Wl,-soname,libhello.so.0 -o libhello.so.0.0 libhello.a Has anyone tried this with libphobos2.a?

Shared library in D on Linux

2012-04-08 Thread Timo Westkämper
} void _fini() { gc_term(); } } I get the same error. I am using dmd 2.058 on Ubuntu 11.10 (32 bit) With gdc I get different errors, but it seems even more difficult to get it working. Does anyone know what is missing to get proper shared library support working on Linux?

Creating a shared library under Linux?

2012-07-26 Thread Jens Mueller
Hi, I've read several threads that about creating shared libraries. But I could not make it work. Does anybody know how to create a shared library? I don't care which compiler I have to use to accomplish it. Jens

[phobos] New Linux phobos shared library

2013-07-08 Thread Jordi Sayol
From dmd v2.063, release zip file includes Linux phobos shared libraries. As shared libraries are needed at runtime too, we should allow to install multiple versions of phobos shared libs. at same time. If not, every program compiled against it will be forced to be recompiled every new dmd/phob

Re: Shared Library, that is when ?

2014-04-11 Thread bachmeier
On Friday, 11 April 2014 at 23:15:13 UTC, bioifornatics wrote: Dear, I know vthat D community dev works hard. I would like to know when provide shared Shared Library will become a priority ? I know you could say do it ( i know … ) but my job is to package tools. Sorry … Partial shared lib give

Re: Shared Library, that is when ?

2014-04-11 Thread bioifornatics
On Saturday, 12 April 2014 at 00:16:26 UTC, bachmeier wrote: On Friday, 11 April 2014 at 23:15:13 UTC, bioifornatics wrote: Dear, I know vthat D community dev works hard. I would like to know when provide shared Shared Library will become a priority ? I know you could say do it ( i know

Re: Shared Library, that is when ?

2014-04-13 Thread Joakim
On Saturday, 12 April 2014 at 00:53:27 UTC, bioifornatics wrote: On Saturday, 12 April 2014 at 00:16:26 UTC, bachmeier wrote: On Friday, 11 April 2014 at 23:15:13 UTC, bioifornatics wrote: Dear, I know vthat D community dev works hard. I would like to know when provide shared Shared Library

Re: Shared Library, that is when ?

2014-04-13 Thread David Nadlinger
On Sunday, 13 April 2014 at 10:00:56 UTC, Joakim wrote: This question belongs in the ldc forum then. I don't know all about how well ldc works with shared libraries on linux, but the recent ldc 0.13.0 alpha updates druntime with some better linux shared library support. The commi

Re: DMD - issue building shared library

2016-01-17 Thread bitwise via Digitalmars-d
On Sunday, 17 January 2016 at 16:10:01 UTC, Dibyendu Majumdar wrote: LINK : error LNK2001: unresolved external symbol _DllMainCRTStartup _DllMainCRTStartup: D shared libs on windows still require a DllMain. If you follow this post here[1] to create one, it should solve some of your problem.

Re: DMD - issue building shared library

2016-01-17 Thread Dibyendu Majumdar via Digitalmars-d
On Sunday, 17 January 2016 at 19:10:16 UTC, bitwise wrote: On Sunday, 17 January 2016 at 16:10:01 UTC, Dibyendu Majumdar wrote: LINK : error LNK2001: unresolved external symbol _DllMainCRTStartup _DllMainCRTStartup: D shared libs on windows still require a DllMain. If you follow this post he

Re: DMD - issue building shared library

2016-01-17 Thread bitwise via Digitalmars-d
On Sunday, 17 January 2016 at 22:12:44 UTC, Dibyendu Majumdar wrote: Presumably there is no compiler flag to auto generate this? There's no compiler flag, but you can use this: https://github.com/D-Programming-Language/druntime/blob/master/src/core/sys/windows/dll.d#L473 Bit

Re: DMD - issue building shared library

2016-01-18 Thread Dibyendu Majumdar via Digitalmars-d
On Monday, 18 January 2016 at 05:58:38 UTC, bitwise wrote: On Sunday, 17 January 2016 at 22:12:44 UTC, Dibyendu Majumdar wrote: Presumably there is no compiler flag to auto generate this? There's no compiler flag, but you can use this: https://github.com/D-Programming-Language/druntime/blob/m

Re: DMD - issue building shared library

2016-01-18 Thread Dibyendu Majumdar via Digitalmars-d
On Monday, 18 January 2016 at 23:53:45 UTC, Dibyendu Majumdar wrote: Thanks - that worked, but I had to write it this way: import std.c.windows.windows; import core.sys.windows.dll; mixin SimpleDllMain; I noticed that above modules are documented in the library reference so I assume tha

Re: DMD - issue building shared library

2016-01-18 Thread bitwise via Digitalmars-d
On Monday, 18 January 2016 at 23:55:33 UTC, Dibyendu Majumdar wrote: On Monday, 18 January 2016 at 23:53:45 UTC, Dibyendu Majumdar wrote: Thanks - that worked, but I had to write it this way: import std.c.windows.windows; import core.sys.windows.dll; mixin SimpleDllMain; I noticed that

Re: Build Linux shared library from DMD

2010-11-10 Thread Jacob Carlborg
On 2010-11-10 20:12, Steve Teale wrote: In the Apache mod_d thread I saw: gcc -shared -Wl,-soname,libhello.so.0 -o libhello.so.0.0 libhello.a Has anyone tried this with libphobos2.a? Phobos cannot currently be used as a dynamic library. DMD cannot produce correct PIC for building dynamic lib

Re: Build Linux shared library from DMD

2010-11-10 Thread JFD
> Phobos cannot currently be used as a dynamic library. DMD cannot produce > correct PIC for building dynamic libraries. GDC can build shared library (phobos works, too), but currently not DMD, it seems. Please see that other thread for more details.

Re: Shared library in D on Linux

2012-04-08 Thread Jacob Carlborg
With gdc I get different errors, but it seems even more difficult to get it working. Does anyone know what is missing to get proper shared library support working on Linux? This is what I can think of for now: * Proper initialization of TLS data * Setting up exception handling tables * Setting up module info -- /Jacob Carlborg

Re: Shared library in D on Linux

2012-04-08 Thread Ellery Newcomer
On 04/08/2012 03:45 AM, "Timo Westkämper" " wrote: extern(C) { void gc_init(); void gc_term(); void _init() { gc_init(); } void _fini() { gc_term(); } } I think you want rt_init and rt_term here.

Re: Shared library in D on Linux

2012-04-08 Thread mta`chrono
I'm interessting in the same stuff. I've a question to _tlsend and _tlsstart. What are they used for? My disputable presumption was that they point to the begin of TLS segment. What is _deh_begin and _deh_end used for?

Re: Shared library in D on Linux

2012-04-08 Thread Timo Westkämper
On Sunday, 8 April 2012 at 14:52:55 UTC, Ellery Newcomer wrote: On 04/08/2012 03:45 AM, "Timo Westkämper" " wrote: extern(C) { void gc_init(); void gc_term(); void _init() { gc_init(); } void _fini() { gc_term(); } } I think you want rt_init and rt_term here. I got now the simple exampl

Re: Shared library in D on Linux

2012-04-08 Thread Jacob Carlborg
On 2012-04-08 17:53, mta`chrono wrote: I'm interessting in the same stuff. I've a question to _tlsend and _tlsstart. What are they used for? My disputable presumption was that they point to the begin of TLS segment. Yes, exactly, the start and end of the TLS segment. What is _deh_begin and _d

Re: Shared library in D on Linux

2012-04-08 Thread Timo Westkämper
Does someone know why the lib (.a) packaging instead of objects (.o) works better in this case?

Re: Shared library in D on Linux

2012-04-08 Thread Timo Westkämper
On Sunday, 8 April 2012 at 17:59:28 UTC, Timo Westkämper wrote: Does someone know why the lib (.a) packaging instead of objects (.o) works better in this case? Didn't work after all with -lib. I mixed up outputs.

Re: Shared library in D on Linux

2012-04-09 Thread Ellery Newcomer
Well, if you're really hankering for a shared lib, try ldc. I have gotten it to compile working shared libs in the past. On 04/09/2012 01:24 AM, "Timo Westkämper" " wrote: On Sunday, 8 April 2012 at 17:59:28 UTC, Timo Westkämper wrote: Does someone know why the lib (.a) packaging instead of o

Re: Shared library in D on Linux

2012-04-09 Thread Timo Westkämper
On Monday, 9 April 2012 at 15:14:45 UTC, Ellery Newcomer wrote: Well, if you're really hankering for a shared lib, try ldc. I have gotten it to compile working shared libs in the past. On 04/09/2012 01:24 AM, "Timo Westkämper" " wrote: On Sunday, 8 April 2012 at 17:59:28 UTC, Timo Westkämper

Re: Shared library in D on Linux

2012-04-09 Thread Iain Buclaw
r script says. >  */ > > .file "tls.S" > > .globl _tlsstart >    .section .tdata,"awT",@progbits >    .align 4 >    .type   _tlsstart, @object >    .size   _tlsstart, 4 > _tlsstart: >    .long   3 > > .globl _tlsend >    .section .tcommon,"

Re: Shared library in D on Linux

2012-04-09 Thread Timo Westkämper
t:    .long   3 .globl _tlsend    .section .tcommon,"awT",@nobits    .align 4    .type   _tlsend, @object    .size   _tlsend, 4 _tlsend:    .zero   4 #endif That assembly file does nothing for shared library support. I have been meaning to finish up a solution to help support shared l

Re: Shared library in D on Linux

2012-04-09 Thread Timo Westkämper
4    .type   _tlsstart, @object    .size   _tlsstart, 4 _tlsstart:    .long   3 .globl _tlsend    .section .tcommon,"awT",@nobits    .align 4    .type   _tlsend, @object    .size   _tlsend, 4 _tlsend:    .zero   4 #endif That assembly file does nothing for shared library support. I have b

Re: Shared library in D on Linux

2012-04-09 Thread Ellery Newcomer
On 04/09/2012 03:31 PM, "Timo Westkämper" " wrote: For some reasons, the _init and _fini parts don't yet work properly. what's wrong with them? if it is a link problem, use gcc -nostartfiles. Well, I'm doing that, and it compiles and rt_init is called, but doesn't seem to be calling the mod

Re: Shared library in D on Linux

2012-04-09 Thread Jacob Carlborg
On 2012-04-09 21:59, Iain Buclaw wrote: That assembly file does nothing for shared library support. I have been meaning to finish up a solution to help support shared libs, would mean more deviation from the dmd compiler's runtime library, but that's fine. Martin Nowak was/is

Re: Shared library in D on Linux

2012-04-09 Thread Jacob Carlborg
and it compiles and rt_init is called, but doesn't seem to be calling the module constructors, so maybe that is a very bad idea. The module info (contains the module constructors) need to be setup differently when linking as a shared library. -- /Jacob Carlborg

Re: Shared library in D on Linux

2012-04-10 Thread Ellery Newcomer
On 04/10/2012 01:31 AM, Jacob Carlborg wrote: The module info (contains the module constructors) need to be setup differently when linking as a shared library. The odd thing is, when you skip _init and _fini and just do rt_init(); writeln("stuff"); rt_term(); it doesn't segfault

Re: Shared library in D on Linux

2012-04-10 Thread Jacob Carlborg
On 2012-04-10 16:21, Ellery Newcomer wrote: On 04/10/2012 01:31 AM, Jacob Carlborg wrote: The module info (contains the module constructors) need to be setup differently when linking as a shared library. The odd thing is, when you skip _init and _fini and just do rt_init(); writeln("

Re: Shared library in D on Linux

2012-04-10 Thread Ellery Newcomer
On 04/10/2012 12:04 PM, Jacob Carlborg wrote: The odd thing is, when you skip _init and _fini and just do rt_init(); writeln("stuff"); rt_term(); it doesn't segfault Are the module constructors run? they would have to be for writeln to not segfault

Re: Shared library in D on Linux

2012-04-10 Thread Jacob Carlborg
On 2012-04-10 19:12, Ellery Newcomer wrote: they would have to be for writeln to not segfault Ok, I see. -- /Jacob Carlborg

Re: Shared library in D on Linux

2012-04-10 Thread Timo Westkämper
On Tuesday, 10 April 2012 at 14:21:28 UTC, Ellery Newcomer wrote: On 04/10/2012 01:31 AM, Jacob Carlborg wrote: The module info (contains the module constructors) need to be setup differently when linking as a shared library. The odd thing is, when you skip _init and _fini and just do

Re: Shared library in D on Linux

2012-04-10 Thread Ellery Newcomer
On 04/10/2012 12:21 PM, Jacob Carlborg wrote: On 2012-04-10 19:12, Ellery Newcomer wrote: they would have to be for writeln to not segfault Ok, I see. tried using __attribute__((constructor)) instead of _init. If I'm getting this line to fail in rt.minfo.sortCtorsImpl:

Re: Shared library in D on Linux

2012-04-10 Thread Jacob Carlborg
On 2012-04-10 21:28, Ellery Newcomer wrote: tried using __attribute__((constructor)) instead of _init. If I'm getting this line to fail in rt.minfo.sortCtorsImpl: /* Internal runtime error, dependency on an uninitialized * module outside of the current module group. */ (stackidx < modules.leng

Re: Shared library in D on Linux

2012-04-10 Thread Timo Westkämper
On Tuesday, 10 April 2012 at 20:02:16 UTC, Jacob Carlborg wrote: On 2012-04-10 21:28, Ellery Newcomer wrote: tried using __attribute__((constructor)) instead of _init. If I'm getting this line to fail in rt.minfo.sortCtorsImpl: /* Internal runtime error, dependency on an uninitialized * modul

Re: Shared library in D on Linux

2012-04-11 Thread Jacob Carlborg
On 2012-04-10 22:10, "Timo Westkämper" " wrote: This might be related: https://github.com/D-Programming-Language/druntime/pull/114 I think something like this needs to be added to have shared libraries properly work: https://github.com/dawgfoto/druntime/blob/SharedRuntime/src/rt/dso.d -- /

Re: Shared library in D on Linux

2012-04-14 Thread Martin Nowak
With gdc I get different errors, but it seems even more difficult to get it working. Does anyone know what is missing to get proper shared library support working on Linux? Most prerequisites are merged now but there are still some smaller things I need to do. https://github.com

Re: Shared library in D on Linux

2012-04-14 Thread Timo Westkämper
On Saturday, 14 April 2012 at 14:48:47 UTC, Martin Nowak wrote: With gdc I get different errors, but it seems even more difficult to get it working. Does anyone know what is missing to get proper shared library support working on Linux? Most prerequisites are merged now but there are

Re: Shared library in D on Linux

2012-04-14 Thread GreatEmerald
On Sunday, 8 April 2012 at 08:45:46 UTC, Timo Westkämper wrote: dmd -g -c test.d -fPIC ld -shared -o libtest.so test.o -lrt -lphobos2 -lpthread gcc -g main.c -ldl -lpthread Hmm, wouldn't using DMD directly for the first two compilation steps do the same thing, just fast

Re: Creating a shared library under Linux?

2012-07-26 Thread Alex Rønne Petersen
On 27-07-2012 07:23, Jens Mueller wrote: Hi, I've read several threads that about creating shared libraries. But I could not make it work. Does anybody know how to create a shared library? I don't care which compiler I have to use to accomplish it. Jens Well, all three compilers

Re: Creating a shared library under Linux?

2012-07-27 Thread Jens Mueller
Alex Rønne Petersen wrote: > On 27-07-2012 07:23, Jens Mueller wrote: > >Hi, > > > >I've read several threads that about creating shared libraries. But I > >could not make it work. > >Does anybody know how to create a shared library? I don't care which

Re: Creating a shared library under Linux?

2012-07-27 Thread Alex Rønne Petersen
On 27-07-2012 09:31, Jens Mueller wrote: Alex Rønne Petersen wrote: On 27-07-2012 07:23, Jens Mueller wrote: Hi, I've read several threads that about creating shared libraries. But I could not make it work. Does anybody know how to create a shared library? I don't care which compi

Re: Creating a shared library under Linux?

2012-07-27 Thread Mike Wey
ate a shared library? I don't care which compiler I have to use to accomplish it. Jens Well, all three compilers (DMD, GDC, LDC) can create shared libraries at this point. But DMD doesn't actually ship libphobos2 (druntime+phobos) as a shared library yet, so this is not going to work

Re: Creating a shared library under Linux?

2012-07-29 Thread Jens Mueller
read several threads that about creating shared libraries. But I > >>>>could not make it work. > >>>>Does anybody know how to create a shared library? I don't care which > >>>>compiler I have to use to accomplish it. > >>>> >

Re: Creating a shared library under Linux?

2012-07-29 Thread Mike Wey
On 07/29/2012 02:34 PM, Jens Mueller wrote: Mike Wey wrote: I've successfully build GtkD as a shared library using LDC using the following steps: Compiling the source files with fPIC: ldc -O -m64 -relocation-model=pic -Isrc -c (source file) Combine all the GtkD object file into one big o

Re: [phobos] New Linux phobos shared library

2013-07-09 Thread Dicebot
On Tuesday, 9 July 2013 at 04:53:01 UTC, Jordi Sayol wrote: I propose to name the shared phobos library as "libphobos2.so.0.nn.0", where "nn" is the current dmd version. The last zero is just for bug/regression fixes. This is exactly naming scheme I am already using in my Arch Linux PKGBUILD,

Re: [phobos] New Linux phobos shared library

2013-07-09 Thread H. S. Teoh
ot;libphobos2.so.1.0.0" and its > SONAME to "libphobos2.so.1". > > Some info about Linux shared libraries: > http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html [...] +1. Shared library breakages are a royal pain in the neck. We should try to get them right

Re: [phobos] New Linux phobos shared library

2013-07-09 Thread Jordi Sayol
On 09/07/13 13:37, Dicebot wrote: > On Tuesday, 9 July 2013 at 04:53:01 UTC, Jordi Sayol wrote: >> I propose to name the shared phobos library as "libphobos2.so.0.nn.0", where >> "nn" is the current dmd version. The last zero is just for bug/regression >> fixes. > > This is exactly naming scheme

Re: [phobos] New Linux phobos shared library

2013-07-09 Thread Dicebot
On Tuesday, 9 July 2013 at 14:31:51 UTC, Jordi Sayol wrote: Programs dynamically links against SONAME, so it's more important than the real library name. What SONAME naming scheme you used in Arch Linux PKGBUILD? To my shame, default one is (.0.2) is used, completely forgot about it. Will bot

Re: [phobos] New Linux phobos shared library

2013-07-09 Thread Jordi Sayol
bos2.so.0.nn", so when phobos become >> stable we can change the library name to "libphobos2.so.1.0.0" and its >> SONAME to "libphobos2.so.1". >> >> Some info about Linux shared libraries: >> http://tldp.org/HOWTO/Program-Library-HOWTO/shared

Compiling to shared library with static dependencies

2016-12-14 Thread Tanel L via Digitalmars-d
Hello, I am very new to the D world - but serious in moving over to it after I have seen what a cool language it really is. I am trying to incorporate D into our main product as an externally loadable module. Basically I have a minimal project: ./app.d ./helpers/image.d (mir and dcv libraries

Embedding D Shared Library in WSGI Web Server

2014-11-07 Thread John McFarlane via Digitalmars-d
I posted this question a while back in D.learn [http://forum.dlang.org/thread/rbozdetvuepfeftxk...@forum.dlang.org] but figured it might be more appropriate to ask here... I've written a modest shared library in D that I'd like to call directly from a Python web server (Linux/OS

Could DRuntime be implemented as a shared library?

2017-05-31 Thread solidstate1991 via Digitalmars-d
Offloading at least the GC could enable the implementation of a per-application GC easier, as well as making development of shared libraries under Windows much easier, might even enable the offloading of Phobos into its own DLL. As an outsider, I think the biggest problem would be from the te

Re: Compiling to shared library with static dependencies

2016-12-14 Thread Relja Ljubobratovic via Digitalmars-d
On Wednesday, 14 December 2016 at 12:33:04 UTC, Tanel L wrote: Hello, Hi Tanel, I have just tried replicating the task you describe, and it worked flawlessly for me. I am very new to the D world - but serious in moving over to it after I have seen what a cool language it really is. I am tr

Re: Compiling to shared library with static dependencies

2016-12-14 Thread Tanel L via Digitalmars-d
Hi, thanks for the answer. I had tried disabling all imports, but now I created a clean new project to test this - it worked. After that I moved the compiling and linking over to DUB, with dependencies: dependency "dcv" version="0.1.7" dependency "mir" version="0.22.0" targetPath "output" t

Re: Compiling to shared library with static dependencies

2016-12-14 Thread Johan Engelen via Digitalmars-d
On Wednesday, 14 December 2016 at 12:33:04 UTC, Tanel L wrote: So I tried to compile LDC2 dynamically: cmake .. -DBUILD_SHARED=ON Have you tried `cmake .. -DBUILD_SHARED_LIBS=ON` ? -Johan

Re: Compiling to shared library with static dependencies

2016-12-14 Thread Relja Ljubobratovic via Digitalmars-d
On Wednesday, 14 December 2016 at 20:46:15 UTC, Tanel L wrote: Hi, thanks for the answer. I had tried disabling all imports, but now I created a clean new project to test this - it worked. Awesome. So LDC compile-link is ok, and also python runtime linking is good. After that I moved the

Re: Compiling to shared library with static dependencies

2016-12-14 Thread Relja Ljubobratovic via Digitalmars-d
On Wednesday, 14 December 2016 at 21:41:53 UTC, Relja Ljubobratovic wrote: use just dcv:core with imageformats[1] http://code.dlang.org/packages/imageformats

Re: Compiling to shared library with static dependencies

2016-12-14 Thread Tanel L via Digitalmars-d
First of all thanks Johan for urging me to compile it with only with that flag. It worked! Previously I tried to compile it with only BUILD_SHARED or both - and that failed. But I got it working. Thanks! More details below. On Wednesday, 14 December 2016 at 21:41:53 UTC, Relja Ljubobratovic w

Re: Compiling to shared library with static dependencies

2016-12-14 Thread Relja Ljubobratovic via Digitalmars-d
On Wednesday, 14 December 2016 at 22:17:25 UTC, Tanel L wrote: First of all thanks Johan for urging me to compile it with only with that flag. It worked! Previously I tried to compile it with only BUILD_SHARED or both - and that failed. But I got it working. Thanks! More details below. Aweso

Re: Compiling to shared library with static dependencies

2016-12-14 Thread Dominikus Dittes Scherkl via Digitalmars-d
On Wednesday, 14 December 2016 at 12:33:04 UTC, Tanel L wrote: Any ideas what to do or how to proceed? Thanks a bunch! This kind of questions is better adressed to the "Learn" forum.

Re: Problems with shared library (-fPIC) and tango

2008-12-03 Thread e-t172
rbage collector, which segfaults on collection. Fix the GC and you have your Tango shared library. I believe this is an issue with the static data segments not being represented in the way that the GC expects in a shared library. I really need to do some research to figure out how things are differe

Creating a shared library in D : undefined symbol: _deh_beg

2012-03-31 Thread Timo Westkämper
I just created a shared library in D using DMD in Ubuntu and run into the following error when trying to use it undefined symbol: _deh_beg I found this old thread where it is suggested to create a dummy main method : http://lists.puremagic.com/pipermail/digitalmars-d/2007-October/026970

  1   2   >