[Issue 14828] duplicate symbol __ModuleInfoZ depending on ordering of files passed to dmd
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Jul 30 19:03:31 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14828
Kenji Hara <k.hara.pg at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #1534|0 |1
is obsolete| |
--- Comment #12 from Kenji Hara <k.hara.pg at gmail.com> ---
Created attachment 1538
--> https://issues.dlang.org/attachment.cgi?id=1538&action=edit
A little updated test case
OK, I understand the issue mechanism. It's obvious from the list files of
libproj.lib and out.obj. (`make genlist`)
With the `make a1f` command, the last link for out.exe will pull foo2.obj in
the lib file, because:
The instantiated function _D5stdio12__T7writelnZ7writelnFNaNbNiNfAyaZv uses
_D5stdio7__arrayZ for array bounds check, but it's stored in foo2.obj in the
lib.
By that, the symbol _D4foo212__ModuleInfoZ in lib will also linked because it's
in foo2.obj.
On the other hand, out.obj also contains _D4foo212__ModuleInfoZ, then they
conflicts each other.
----
The essential fix I think is: when the lib file is compiled, the helper
functions
(__array, etc) of non-root modules (e.g. stdio) should be separated their own
obj file.
--
More information about the Digitalmars-d-bugs
mailing list