www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11478] New: shared library on osx: worked in 2.062, fails in 2.063.2, still fails in 2.064

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11478

           Summary: shared library on osx: worked in 2.062, fails in
                    2.063.2, still fails in 2.064
           Product: D
           Version: D2
          Platform: All
        OS/Version: Mac OS X
            Status: NEW
          Severity: regression
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: thelastmammoth gmail.com



----
module foo;
import std.stdio;
extern(C) void foo1(){ printf("ok\n");}
----
module main2;
pragma(lib,"foo");
extern(C) void foo1();
void main(){foo1;}
----

dmd -oflibfoo.dylib -shared foo.d;
dmd -L-L. main.d
./main

--output:
2.062:
OK

2.063(and 2.063.2):
sh: line 3: 92704 Segmentation fault: 11  ./main (cf Issue 10440)

2.064
Shared libraries are not yet supported on OSX. //pull 
sh: line 3: 92736 Segmentation fault: 11  ./main


Issue 10440 was closed as 'RESOLVED FIXED' but I don't see how it addresses the
problem. I understand shared libs were not officially completely supported in
2.062 however I *was* able to build usable apps built around D plugins (with
Runtime.initialize etc), notably a REPL based on shared libs. Since upgrading
from 2.062, I can't use those.

Please revert old behavior even if behavior is partial.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 09 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11478


Andrei Alexandrescu <andrei erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |bounty
                 CC|                            |andrei erdani.com



PST ---
There are two bounties on this bug totaling $40:

https://www.bountysource.com/issues/1325892-shared-library-on-osx-worked-in-2-062-fails-in-2-063-2-still-fails-in-2-064/bounties

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 26 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11478


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/druntime/pull/679

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 30 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11478




Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/433863d4ce4856a47412a9c85bf7a06b8fedb737
fix Issue 11478 - shared library on osx

- fix incomplete support for shared libraries

https://github.com/D-Programming-Language/druntime/commit/8171553ef8e2a2ec4ee4089767110b3d4151fd74


[regression] fix Issue 11478 - shared library on osx

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11478


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 09 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11478




Commits pushed to 2.065 at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/433863d4ce4856a47412a9c85bf7a06b8fedb737
fix Issue 11478 - shared library on osx

https://github.com/D-Programming-Language/druntime/commit/8171553ef8e2a2ec4ee4089767110b3d4151fd74


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 19 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11478


Timothee Cour <timothee.cour2 gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timothee.cour2 gmail.com



18:57:02 PST ---

 Commits pushed to 2.065 at https://github.com/D-Programming-Language/druntime
 
 https://github.com/D-Programming-Language/druntime/commit/433863d4ce4856a47412a9c85bf7a06b8fedb737
 fix Issue 11478 - shared library on osx
 
 https://github.com/D-Programming-Language/druntime/commit/8171553ef8e2a2ec4ee4089767110b3d4151fd74

This still fails. it only works when adding import core.runtime inside 'foo.d' (but then still prints: Shared libraries are not yet supported on OSX -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 17 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11478





 This still fails. it only works when adding import core.runtime inside 'foo.d'
So it crashes if you don't import core.runtime? This might be an ODR problem, i.e. when statically linked into the dylib and the exe druntime can't work correctly.
 (but then still prints: 
 Shared libraries are not yet supported on OSX
It's supposed to print that, because shared libraries aren't yet supported on OSX. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 18 2014