digitalmars.D - D runtime in os x dylib
- John Colvin (49/49) Jun 23 2012 There seems to be a problem with starting the d runtime in a d
- Jacob Carlborg (4/7) Jun 24 2012 Dynamic libraries aren't properly working yet. It's being worked on.
- John Colvin (4/12) Jun 24 2012 I see that now, managed to dig up some old bug reports and
- Jacob Carlborg (5/7) Jun 24 2012 I'm not sure of the time frame for this but Martin Nowak is working on t...
- John Colvin (3/11) Jun 24 2012 Hmm, nothing in the last 3 months. Looks like i may have to
- Jacob Carlborg (7/9) Jun 25 2012 I'm not entirely sure but maybe you're having this problem:
- John Colvin (49/57) Jun 25 2012 I'm having a nightmare getting the runtime to compile, with
- Jacob Carlborg (4/62) Jun 25 2012 Are you using the latest sources of DMD?
- John Colvin (2/3) Jun 26 2012 Yes I am.
- John Colvin (3/6) Jun 26 2012 sorry, my mistake, i replaced the wrong dmd file. It compiles
- Jacob Carlborg (4/12) Jun 27 2012 Good, is that working any better ?
- John Colvin (3/15) Jun 28 2012 Yes, it appears the bug is fixed in the current druntime. Thanks
- Martin Nowak (3/10) Jun 25 2012 Right, it looks like that bug.
There seems to be a problem with starting the d runtime in a d dylib loaded in a c program. Whenever I call Runtime.initialize() i get a segfault. C code: #include <stdio.h> #include <dlfcn.h> int main() { void *library; int (*fptr)(); library = dlopen("testlib.dylib", RTLD_LAZY); if(library == NULL) puts("couldn't load the library"); else { *(void **)(&fptr) = dlsym(library,"number"); if(fptr == NULL) { puts("couldn't load function"); } else { printf("the result is %d\n",(*fptr)()); } } return(0); } compiled with gcc, no flags. d code: import core.runtime; extern(C) int number() { Runtime.initialize(); return(4); } compiled with dmd -shared Backtrace: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 0x000000010003de28 in __tls_get_addr () (gdb) bt D4core7runtime7Runtime10initializeFDFC6object9ThrowableZvZb () All compilation and debugging done in OS X 10.7 Note: if the Runtime.initialize(); line is commented out, the library is loaded and runs correctly.
Jun 23 2012
On 2012-06-23 22:54, John Colvin wrote:There seems to be a problem with starting the d runtime in a d dylib loaded in a c program. Whenever I call Runtime.initialize() i get a segfault.Dynamic libraries aren't properly working yet. It's being worked on. -- /Jacob Carlborg
Jun 24 2012
On Sunday, 24 June 2012 at 09:59:18 UTC, Jacob Carlborg wrote:On 2012-06-23 22:54, John Colvin wrote:I see that now, managed to dig up some old bug reports and threads. Is there any timeframe for this or is it on the back burner so to speak?There seems to be a problem with starting the d runtime in a d dylib loaded in a c program. Whenever I call Runtime.initialize() i get a segfault.Dynamic libraries aren't properly working yet. It's being worked on.
Jun 24 2012
On 2012-06-24 13:47, John Colvin wrote:I see that now, managed to dig up some old bug reports and threads. Is there any timeframe for this or is it on the back burner so to speak?I'm not sure of the time frame for this but Martin Nowak is working on this: https://github.com/dawgfoto/druntime/commits/SharedRuntime -- /Jacob Carlborg
Jun 24 2012
Hmm, nothing in the last 3 months. Looks like i may have to abandon os x for development at least for the near future. On Sunday, 24 June 2012 at 12:41:15 UTC, Jacob Carlborg wrote:On 2012-06-24 13:47, John Colvin wrote:I see that now, managed to dig up some old bug reports and threads. Is there any timeframe for this or is it on the back burner so to speak?I'm not sure of the time frame for this but Martin Nowak is working on this: https://github.com/dawgfoto/druntime/commits/SharedRuntime
Jun 24 2012
On 2012-06-24 16:39, John Colvin wrote:Hmm, nothing in the last 3 months. Looks like i may have to abandon os x for development at least for the near future.I'm not entirely sure but maybe you're having this problem: http://d.puremagic.com/issues/show_bug.cgi?id=7995 Pull the latest source code from github and try that if you're using a release. -- /Jacob Carlborg
Jun 25 2012
On Monday, 25 June 2012 at 12:17:03 UTC, Jacob Carlborg wrote:On 2012-06-24 16:39, John Colvin wrote:I'm having a nightmare getting the runtime to compile, with MODEL=64 I get a load of these: src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not void[32LU] src/core/simd.d(52): Error: template instance core.simd.Vector!(void[32LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not double[4LU] src/core/simd.d(53): Error: template instance core.simd.Vector!(double[4LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not float[8LU] src/core/simd.d(54): Error: template instance core.simd.Vector!(float[8LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not byte[32LU] src/core/simd.d(55): Error: template instance core.simd.Vector!(byte[32LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not ubyte[32LU] src/core/simd.d(56): Error: template instance core.simd.Vector!(ubyte[32LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not short[16LU] src/core/simd.d(57): Error: template instance core.simd.Vector!(short[16LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not ushort[16LU] src/core/simd.d(58): Error: template instance core.simd.Vector!(ushort[16LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not int[8LU] src/core/simd.d(59): Error: template instance core.simd.Vector!(int[8LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not uint[8LU] src/core/simd.d(60): Error: template instance core.simd.Vector!(uint[8LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not long[4LU] src/core/simd.d(61): Error: template instance core.simd.Vector!(long[4LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not ulong[4LU] src/core/simd.d(62): Error: template instance core.simd.Vector!(ulong[4LU]) error instantiating I tried MODEL=32 just in case and got the same but with "u" insteal of "LU"Hmm, nothing in the last 3 months. Looks like i may have to abandon os x for development at least for the near future.I'm not entirely sure but maybe you're having this problem: http://d.puremagic.com/issues/show_bug.cgi?id=7995 Pull the latest source code from github and try that if you're using a release.
Jun 25 2012
On 2012-06-25 18:26, John Colvin wrote:On Monday, 25 June 2012 at 12:17:03 UTC, Jacob Carlborg wrote:Are you using the latest sources of DMD? -- /Jacob CarlborgOn 2012-06-24 16:39, John Colvin wrote:I'm having a nightmare getting the runtime to compile, with MODEL=64 I get a load of these: src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not void[32LU] src/core/simd.d(52): Error: template instance core.simd.Vector!(void[32LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not double[4LU] src/core/simd.d(53): Error: template instance core.simd.Vector!(double[4LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not float[8LU] src/core/simd.d(54): Error: template instance core.simd.Vector!(float[8LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not byte[32LU] src/core/simd.d(55): Error: template instance core.simd.Vector!(byte[32LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not ubyte[32LU] src/core/simd.d(56): Error: template instance core.simd.Vector!(ubyte[32LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not short[16LU] src/core/simd.d(57): Error: template instance core.simd.Vector!(short[16LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not ushort[16LU] src/core/simd.d(58): Error: template instance core.simd.Vector!(ushort[16LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not int[8LU] src/core/simd.d(59): Error: template instance core.simd.Vector!(int[8LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not uint[8LU] src/core/simd.d(60): Error: template instance core.simd.Vector!(uint[8LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not long[4LU] src/core/simd.d(61): Error: template instance core.simd.Vector!(long[4LU]) error instantiating src/core/simd.d(35): Error: base type of __vector must be a 16 byte static array, not ulong[4LU] src/core/simd.d(62): Error: template instance core.simd.Vector!(ulong[4LU]) error instantiating I tried MODEL=32 just in case and got the same but with "u" insteal of "LU"Hmm, nothing in the last 3 months. Looks like i may have to abandon os x for development at least for the near future.I'm not entirely sure but maybe you're having this problem: http://d.puremagic.com/issues/show_bug.cgi?id=7995 Pull the latest source code from github and try that if you're using a release.
Jun 25 2012
On Monday, 25 June 2012 at 18:55:22 UTC, Jacob Carlborg wrote:Are you using the latest sources of DMD?Yes I am.
Jun 26 2012
On Tuesday, 26 June 2012 at 18:31:34 UTC, John Colvin wrote:On Monday, 25 June 2012 at 18:55:22 UTC, Jacob Carlborg wrote:sorry, my mistake, i replaced the wrong dmd file. It compiles fine with the up to date dmd.Are you using the latest sources of DMD?Yes I am.
Jun 26 2012
On 2012-06-27 02:35, John Colvin wrote:On Tuesday, 26 June 2012 at 18:31:34 UTC, John Colvin wrote:Good, is that working any better ? -- /Jacob CarlborgOn Monday, 25 June 2012 at 18:55:22 UTC, Jacob Carlborg wrote:sorry, my mistake, i replaced the wrong dmd file. It compiles fine with the up to date dmd.Are you using the latest sources of DMD?Yes I am.
Jun 27 2012
On Wednesday, 27 June 2012 at 10:15:37 UTC, Jacob Carlborg wrote:On 2012-06-27 02:35, John Colvin wrote:Yes, it appears the bug is fixed in the current druntime. Thanks for your help.On Tuesday, 26 June 2012 at 18:31:34 UTC, John Colvin wrote:Good, is that working any better ?On Monday, 25 June 2012 at 18:55:22 UTC, Jacob Carlborg wrote:sorry, my mistake, i replaced the wrong dmd file. It compiles fine with the up to date dmd.Are you using the latest sources of DMD?Yes I am.
Jun 28 2012
On Mon, 25 Jun 2012 14:17:01 +0200, Jacob Carlborg <doob me.com> wrote:On 2012-06-24 16:39, John Colvin wrote:Right, it looks like that bug. Statically linking phobos into a dylib should work otherwise.Hmm, nothing in the last 3 months. Looks like i may have to abandon os x for development at least for the near future.I'm not entirely sure but maybe you're having this problem: http://d.puremagic.com/issues/show_bug.cgi?id=7995 Pull the latest source code from github and try that if you're using a release.
Jun 25 2012