September 20, 2015 Re: Debugging D shared libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | Dne 19. 9. 2015 v 18:41 Russel Winder via Digitalmars-d-learn napsal(a): > Indeed, it works well. Well for LDC. DMD and GDC are still broken. My GDC problems are deeper that this code: Debian packages seem to have weird problems and Fedora do not package GDC. All I need to do to make your example work, is to move the calls of Runtime.initialize and Runtime.terminate to a wrapper functions called at the start and end of the main program. -- mk |
September 20, 2015 Re: Debugging D shared libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | Am Sat, 19 Sep 2015 17:41:41 +0100 schrieb Russel Winder via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com>: > On Sat, 2015-09-19 at 16:33 +0000, John Colvin via Digitalmars-d-learn wrote: > > On Saturday, 19 September 2015 at 16:15:45 UTC, Russel Winder wrote: > > > Sadly the: > > > > > > pragma(LDC_global_crt_ctor, 0) > > > void initRuntime() { > > > import core.runtime: Runtime; > > > Runtime.initialize(); > > > } > > > > > > will not compile under DMD :-( > > > > version(LDC){ /* ... */ } > > > > not that it helps make things work correctly, but at least they'll compile :) > > Indeed, it works well. Well for LDC. DMD and GDC are still broken. My GDC problems are deeper that this code: Debian packages seem to have weird problems and Fedora do not package GDC. > Have you tried using a newer GDC version? The debian jessie version probably uses the 2.064.2 frontend. I wanted to add @attribute(cctor/cdtor) support for some time now, I even wrote the code some time but didn't push it to the main repo for some reason. I'll put it on the TODO list but I can't work on this for the next 2-3 weeks. |
September 20, 2015 Re: Debugging D shared libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes Pfau | Am Sun, 20 Sep 2015 17:47:00 +0200
schrieb Johannes Pfau <nospam@example.com>:
> Am Sat, 19 Sep 2015 17:41:41 +0100
> schrieb Russel Winder via Digitalmars-d-learn
> <digitalmars-d-learn@puremagic.com>:
>
> > On Sat, 2015-09-19 at 16:33 +0000, John Colvin via Digitalmars-d-learn wrote:
> > > On Saturday, 19 September 2015 at 16:15:45 UTC, Russel Winder wrote:
> > > > Sadly the:
> > > >
> > > > pragma(LDC_global_crt_ctor, 0)
> > > > void initRuntime() {
> > > > import core.runtime: Runtime;
> > > > Runtime.initialize();
> > > > }
> > > >
> > > > will not compile under DMD :-(
> > >
> > > version(LDC){ /* ... */ }
> > >
> > > not that it helps make things work correctly, but at least they'll compile :)
> >
> > Indeed, it works well. Well for LDC. DMD and GDC are still broken. My GDC problems are deeper that this code: Debian packages seem to have weird problems and Fedora do not package GDC.
> >
>
> Have you tried using a newer GDC version? The debian jessie version probably uses the 2.064.2 frontend.
>
> I wanted to add @attribute(cctor/cdtor) support for some time now, I even wrote the code some time but didn't push it to the main repo for some reason. I'll put it on the TODO list but I can't work on this for the next 2-3 weeks.
Just realized this thread is titled "Debugging D shared libraries" ;-) GDC does not yet support shared libraries.
|
September 20, 2015 Re: Debugging D shared libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | On Saturday, 19 September 2015 at 17:02:37 UTC, Russel Winder wrote:
> English and Spanish meanings of the word are very different. In UK (not sure about Canada, USA, Australia, New Zealand, South Africa,…) it is generally a somewhat derogatory term.
In French it means "to rub down with abrasive paper".
|
September 22, 2015 Re: Debugging D shared libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes Pfau Attachments:
| On Sun, 2015-09-20 at 17:47 +0200, Johannes Pfau via Digitalmars-d -learn wrote: > Am Sat, 19 Sep 2015 17:41:41 +0100 > […] > > Have you tried using a newer GDC version? The debian jessie version probably uses the 2.064.2 frontend. Debian Jessie is far too out of date to be useful. I'm on Debian Sid (still quite old), and Fedora Rawhide (not quite so old). Sadly GDC on Debian Sid tells me 5.2.1 20150911 which may well tell Iain which DMD is being used, but I haven't a clue. :-) […] The real problem using GDC is: gdc -I. -O3 -fPIC -c -o processAll_library_d.o processAll_library_d.d /usr/include/d/core/stdc/config.d:28:3: error: static if conditional cannot be at global scope static if( (void*).sizeof > int.sizeof ) ^ I haven't had chance to sit down and see if this is reasonable or not. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder |
September 22, 2015 Re: Debugging D shared libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes Pfau Attachments:
| On Sun, 2015-09-20 at 17:49 +0200, Johannes Pfau via Digitalmars-d -learn wrote: > […] > > Just realized this thread is titled "Debugging D shared libraries" ; > -) > GDC does not yet support shared libraries. Conversely I thought it did due to the GCC toolchain thingy. I'm using DMD and LDC just now so I have no actual data. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder |
September 22, 2015 Re: Debugging D shared libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | On Tuesday, 22 September 2015 at 14:37:11 UTC, Russel Winder wrote:
> On Sun, 2015-09-20 at 17:47 +0200, Johannes Pfau via Digitalmars-d -learn wrote:
>> [...]
> […]
>> [...]
>
> Debian Jessie is far too out of date to be useful. I'm on Debian Sid
> (still quite old), and Fedora Rawhide (not quite so old).
>
> Sadly GDC on Debian Sid tells me 5.2.1 20150911 which may well tell Iain which DMD is being used, but I haven't a clue. :-)
>
> […]
>
> The real problem using GDC is:
>
> gdc -I. -O3 -fPIC -c -o processAll_library_d.o processAll_library_d.d
> /usr/include/d/core/stdc/config.d:28:3: error: static if conditional
> cannot be at global scope
> static if( (void*).sizeof > int.sizeof )
> ^
>
> I haven't had chance to sit down and see if this is reasonable or not.
seeing as it's an error in core.stdc.config, I'd say it's definitely not reasonable
|
September 22, 2015 Re: Debugging D shared libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to rom Attachments:
| On Sun, 2015-09-20 at 07:49 +0000, rom via Digitalmars-d-learn wrote: > […] > > works entirely fine. However the "parallel" code: > > > > extern(C) > > double parallel(const int n, const double delta) { > > Runtime.initialize(); > > const pi = 4.0 * delta * taskPool.reduce!"a + b"( > > map!((int i){ immutable x = (i - 0.5) * delta; return > > 1.0 / (1.0 + x * x); })(iota(1, n + 1))); > > Runtime.terminate(); > > return pi; > > } > > […] > > Isn't it simply that when doing some work asynchronously, as with task pool, work is being done in other threads than the main. All the while, you're killing the Runtime. The fact that when removing Runtime.terminate makes the code work might support that explanation. I am not sure that can be the case per se as reduce only uses threads internally, the task pool operations should be complete by the time pi is initialized. On the other hand there might be a lock contention between a quiescent default task pool and the terminate code. The code is now moved on a bit from the above, and it works sufficient for the task at hand. This isn't production code so it doesn't have to be quite as good and correct as maybe it should be. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder |
September 22, 2015 Re: Debugging D shared libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Colvin | Am Tue, 22 Sep 2015 14:40:43 +0000 schrieb John Colvin <john.loughran.colvin@gmail.com>: > On Tuesday, 22 September 2015 at 14:37:11 UTC, Russel Winder wrote: > > On Sun, 2015-09-20 at 17:47 +0200, Johannes Pfau via Digitalmars-d -learn wrote: > >> [...] > > […] > >> [...] > > > > Debian Jessie is far too out of date to be useful. I'm on > > Debian Sid > > (still quite old), and Fedora Rawhide (not quite so old). > > > > Sadly GDC on Debian Sid tells me 5.2.1 20150911 which may well tell Iain which DMD is being used, but I haven't a clue. :-) > > > > […] > > > > The real problem using GDC is: > > > > gdc -I. -O3 -fPIC -c -o processAll_library_d.o > > processAll_library_d.d > > /usr/include/d/core/stdc/config.d:28:3: error: static if > > conditional > > cannot be at global scope > > static if( (void*).sizeof > int.sizeof ) > > ^ > > > > I haven't had chance to sit down and see if this is reasonable or not. > > seeing as it's an error in core.stdc.config, I'd say it's definitely not reasonable It's indeed strange. @Russel Winder if you can reproduce this with the latest GDC* please file a bug report. Even the error message doesn't make sense: static if works fine at global scope, AFAIK. * you could use the latest binaries from http://gdcproject.org/downloads |
Copyright © 1999-2021 by the D Language Foundation