[Issue 3274] dmd fails to emit code for templates into object file if several files are compiled at once
https://issues.dlang.org/show_bug.cgi?id=3274 Walter Bright changed: What|Removed |Added Version|1.046 |D1 --
[Issue 3274] dmd fails to emit code for templates into object file if several files are compiled at once
http://d.puremagic.com/issues/show_bug.cgi?id=3274 Martin Nowak changed: What|Removed |Added CC||c...@klickverbot.at --- Comment #5 from Martin Nowak 2013-04-07 12:04:53 PDT --- *** Issue 8769 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3274] dmd fails to emit code for templates into object file if several files are compiled at once
http://d.puremagic.com/issues/show_bug.cgi?id=3274 --- Comment #4 from Martin Nowak 2013-04-07 12:02:53 PDT --- One idea to reduce the cost of copying is partial linking. AFAIU that would allow us to generate a single temporary object containing the template/TypeInfo instantiation and link it into every object file that references it. ld -r -o combined1.o template.o module1.o mv combined1.o module1.o ld -r -o combined2.o template.o module2.o mv combined2.o module2.o http://sourceware.org/binutils/docs-2.23.1/ld/Options.html#index-partial-link-88 Though I'm not sure how portable this or an equivalent dmd backend functionality would be. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3274] dmd fails to emit code for templates into object file if several files are compiled at once
http://d.puremagic.com/issues/show_bug.cgi?id=3274 Martin Nowak changed: What|Removed |Added CC||c...@dawg.eu --- Comment #3 from Martin Nowak 2013-04-07 09:04:10 PDT --- (In reply to comment #1) > The compiler does this as a compile performance optimization. Otherwise, > template instantiations have to be done over and over, filling the object > files, and then the linker has to remove the duplicates. > It remains an incorrect optimization that just works most of the time. > The workaround for an incremental build system is straightforward - put only > one source module on a command to dmd at a time. The performance impact of this is also huge. The only reason to do this in the first place is to avoid duplicate parsing and semantic. However we can't make any assumptions how the generated object files are linked therefor each of them needs to get the required TypeInfo, templates et.al. To put this into perspective, copying is only required when building multiple object files. It is not required when building an executable, a shared library or a single object (which may contain multiple modules, i.e. -c -of). Maybe we can move the copying more to the backend so that we don't have to rerun IRgen and codegen. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3274] dmd fails to emit code for templates into object file if several files are compiled at once
http://d.puremagic.com/issues/show_bug.cgi?id=3274 jfanati...@gmx.at changed: What|Removed |Added CC||jfanati...@gmx.at --- Comment #2 from jfanati...@gmx.at 2013-04-05 04:17:13 PDT --- It seems to work correctly with DMD v2.062 at least on Fedora 64 bit. Can anyone confirm this? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3274] dmd fails to emit code for templates into object file if several files are compiled at once
http://d.puremagic.com/issues/show_bug.cgi?id=3274 Walter Bright changed: What|Removed |Added Status|REOPENED|RESOLVED CC||bugzi...@digitalmars.com Resolution||WONTFIX --- Comment #1 from Walter Bright 2011-04-04 23:17:05 PDT --- The compiler does this as a compile performance optimization. Otherwise, template instantiations have to be done over and over, filling the object files, and then the linker has to remove the duplicates. The workaround for an incremental build system is straightforward - put only one source module on a command to dmd at a time. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3274] dmd fails to emit code for templates into object file if several files are compiled at once
http://d.puremagic.com/issues/show_bug.cgi?id=3274 Brad Roberts changed: What|Removed |Added Status|RESOLVED|REOPENED CC||bra...@puremagic.com Resolution|WONTFIX | -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3274] dmd fails to emit code for templates into object file if several files are compiled at once
http://d.puremagic.com/issues/show_bug.cgi?id=3274 nfx...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution||WONTFIX -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---