Bug 15149 – [REG2.068.1] Linker error with separate compilation

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-03T21:41:00Z
Last change time
2015-10-14T15:05:47Z
Keywords
link-failure, pull
Assigned to
nobody
Creator
yazan.dabain

Attachments

IDFilenameSummaryContent-TypeSize
1554test.reduced.zipDustmited test case.application/x-zip-compressed1034

Comments

Comment #0 by yazan.dabain — 2015-10-03T21:41:41Z
File structure: a.d b.d ---- a.d ---- import std.algorithm; import b; void main() { int[] foo; setUnion(fun()[], foo); } ---- b.d ---- module b; auto fun() { import std.container; return redBlackTree!int; } ------------------ Compiling using `dmd -c a.d && dmd -c b.d && dmd *.o` succeeds except for linker error: a.o: In function `_D3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnion9__xtoHashFNbNeKxS3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnionZm': a.d:(.text._D3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnion9__xtoHashFNbNeKxS3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnionZm+0x18): undefined reference to `_D95TypeInfo_xS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5Range6__initZ' a.d:(.text._D3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnion9__xtoHashFNbNeKxS3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnionZm+0x1f): undefined reference to `_D95TypeInfo_xS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5Range6__initZ' collect2: error: ld returned 1 exit status --- errorlevel 1 Linker error happens with 2.068.2 but does not happen with 2.067.1.
Comment #1 by bugzilla — 2015-10-04T03:29:27Z
If you compile with -allinst dmd switch, does it work?
Comment #2 by yazan.dabain — 2015-10-04T05:30:52Z
It does compile with -allinst as a workaround. This is a reduction of a project with multiple dependencies built using dub. My current workaround is using `dub --combined` to disable separate compilation. It is not blocking me but it is a regression.
Comment #3 by k.hara.pg — 2015-10-06T12:29:11Z
Happens from 2.068.1. The link-failure reproduces with -g switch in win32.
Comment #4 by k.hara.pg — 2015-10-06T13:14:04Z
Created attachment 1554 Dustmited test case.
Comment #5 by k.hara.pg — 2015-10-07T01:43:22Z
Comment #6 by github-bugzilla — 2015-10-07T10:04:58Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/1f59030b3af81efe67139ecb0c7d3f6e2312d5a7 fix Issue 15149 - Linker error with separate compilation https://github.com/D-Programming-Language/dmd/commit/95d076460c87a252edbbcc8d995061391738bd51 Merge pull request #5166 from 9rnsr/fix15149 [REG2.068.1] Issue 15149 - Linker error with separate compilation
Comment #7 by github-bugzilla — 2015-10-14T15:05:47Z