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


--- Comment #0 from thelastmammoth gmail.com 2013-11-09 00:16:01 PST ---
----
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


--- Comment #1 from Andrei Alexandrescu <andrei erdani.com> 2013-11-26 09:42:31
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


--- Comment #2 from Martin Nowak <code dawg.eu> 2013-11-30 16:51:48 PST ---
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



--- Comment #3 from github-bugzilla puremagic.com 2013-12-06 13:20:47 PST ---
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
Merge pull request #679 from dawgfoto/fix11478

[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



--- Comment #4 from github-bugzilla puremagic.com 2013-12-19 05:48:52 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
Merge pull request #679 from dawgfoto/fix11478

-- 
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


--- Comment #5 from Timothee Cour <timothee.cour2 gmail.com> 2014-02-17
18:57:02 PST ---
(In reply to comment #4)
 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
 Merge pull request #679 from dawgfoto/fix11478

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



--- Comment #6 from Martin Nowak <code dawg.eu> 2014-02-18 09:17:22 PST ---
(In reply to comment #5)
 This still fails. it only works when adding import core.runtime inside 'foo.d'

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