Bug 11478 – shared library on osx: worked in 2.062, fails in 2.063.2, still fails in 2.064

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
Mac OS X
Creation time
2013-11-09T00:16:00Z
Last change time
2014-02-18T09:17:22Z
Keywords
bounty, pull
Assigned to
code
Creator
thelastmammoth

Comments

Comment #0 by thelastmammoth — 2013-11-09T00:16:01Z
---- 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.
Comment #1 by andrei — 2013-11-26T09:42:31Z
Comment #2 by code — 2013-11-30T16:51:48Z
Comment #3 by github-bugzilla — 2013-12-06T13:20:47Z
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
Comment #4 by github-bugzilla — 2013-12-19T05:48:52Z
Comment #5 by timothee.cour2 — 2014-02-17T18:57:02Z
(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
Comment #6 by code — 2014-02-18T09:17:22Z
(In reply to comment #5) > 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.