Bug 12696 – GIT HEAD : undefined symbols when -O specified

Status
RESOLVED
Resolution
DUPLICATE
Severity
blocker
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-03T09:34:00Z
Last change time
2015-09-03T05:29:45Z
Assigned to
nobody
Creator
temtaime

Attachments

IDFilenameSummaryContent-TypeSize
1350source.ziptest caseapplication/x-zip-compressed2382
1354source2.zipmodified test caseapplication/x-zip-compressed1996

Comments

Comment #0 by temtaime — 2014-05-03T09:34:50Z
Created attachment 1350 test case Compiling test case with -O gives Error 42: Symbol Undefined _D10perfontain6matrix21__T6MЂ…ЊTfVki4Ъ1ZЂ‡’8__xopCmpFKxSЂ±ѕЂґґZi Error 42: Symbol Undefined _D10perfontain6matrix21__T6MЂ…ЊTfVki4Ъ1ZЂ‡’1ЂѓћxopEqualsFKxSЂ±ВЂґґZb Error 42: Symbol Undefined _D10perfontain6matrix21__T6MatrixTfVki4Vki1Z6Matrix8toStringMxFNaNbNiNfZAya It's dustmited from project of 14k lines. If anyone know how to reduce it more bienvenue.
Comment #1 by temtaime — 2014-05-03T17:34:09Z
Guuuuys please stop playing with linker's symbols. These regressions are annoying.
Comment #2 by dlang-bugzilla — 2014-05-05T14:13:49Z
I can't reproduce this. I had to make the following modifications (add two module statements): diff --git a/perfontain/binary.d b/perfontain/binary.d index ac4bc19..4a4ac00 100644 --- a/perfontain/binary.d +++ b/perfontain/binary.d @@ -1,3 +1,5 @@ +module perfontain.binary; + import std.range; import std.traits; diff --git a/ro/map/rom.d b/ro/map/rom.d index 40921d8..c691dbb 100644 --- a/ro/map/rom.d +++ b/ro/map/rom.d @@ -1,3 +1,5 @@ +module ro.map.rom; + import perfontain.matrix; This command works for me: rdmd -O ro\romloader.d
Comment #3 by temtaime — 2014-05-05T16:07:16Z
Created attachment 1354 modified test case
Comment #4 by temtaime — 2014-05-05T16:08:01Z
Не юзайте рдмд. Собирать отдельно. Новый тесткейс + скрипт для сборки. Спасибо!
Comment #5 by dlang-bugzilla — 2014-05-06T05:40:43Z
Is this really a regression? The second archive fails to link with DMD 2.065.0 and fails to compile with 2.064.2. In which version did this work?
Comment #6 by temtaime — 2014-05-06T16:36:54Z
Too strange it compiles ok with 065 but yes i cannot link it with 065 right now so change the state.
Comment #7 by ketmar — 2014-08-20T02:46:40Z
i just checked this with DMD 2.066 on win32, and everything works ok. it also works with current HEAD on 32-bit GNU/Linux. maybe we should close this bug?
Comment #8 by k.hara.pg — 2015-09-03T05:23:24Z
Finally reduced test case: C.d: ------------ import E; void foo() { Vector4 v; read(v); } void main() {} D.d ------------ import E; void bar() { Vector4 v; read(v); } E.d ------------ struct Matrix(T, uint M, uint N = M) { string toString() const { return ""; } int opCmp()(auto ref in Matrix v) const { return 0; } T[][] arr; auto transposed() { Matrix!(T, N, M) r1; Matrix!(T, M, 1) r2; } } alias Matrix4 = Matrix!(float, 4); alias Vector4 = Matrix!(float, 1, 4); void read(T)(T data) { foreach (it; __traits(allMembers, T)) { static if (mixin(`__traits(compiles, &data.` ~ it ~ `)`)) {} } } build.bat ------------ dmd -c C.d dmd -c D.d dmd -c E.d dmd C.obj D.obj E.obj
Comment #9 by k.hara.pg — 2015-09-03T05:29:45Z
It was a duplication of issue 7469. When the Matrix template has instantiated, its integer value parameters had caused wrong mangled names for templates in separate compilation, and it had caused link failure. If the two uint template value parameters are changed to int, the link failure had disappeared. Since 2.066, issue 7469 is properly fixed, so the problem does not happen anymore in git HEAD. *** This issue has been marked as a duplicate of issue 7469 ***