Skip to content

Comments

fix Issue 14828 - duplicate symbol __ModuleInfoZ#4858

Merged
WalterBright merged 1 commit intodlang:stablefrom
MartinNowak:fix14828
Aug 4, 2015
Merged

fix Issue 14828 - duplicate symbol __ModuleInfoZ#4858
WalterBright merged 1 commit intodlang:stablefrom
MartinNowak:fix14828

Conversation

@MartinNowak
Copy link
Member

  • always emit __arrayZ/__assertZ/__unittest_failZ helpers (even in release)
    to avoid linkage issues when instantiating a template of that module
    with different compiler flags
  • also fixes Issue 14748 - Removing std.stdio import causes 2x increase in "Hello, world"
    same underlying issue, some undefined helper function drag in a different
    module which happens to have weak definitions of those helpers

Issue 14828 – [REG2.067] duplicate symbol __ModuleInfoZ depending on ordering of files passed to dmd

- always emit __arrayZ/__assertZ/__unittest_failZ helpers (even in release)
  to avoid linkage issues when instantiating a template of that module
  with different compiler flags

- also fixes Issue 14748 - Removing std.stdio import causes 2x increase in "Hello, world"
  same underlying issue, some undefined helper function drag in a different
  module which happens to have weak definitions of those helpers
@WalterBright
Copy link
Member

LGTM

When making PR's that fix a bugzilla issue, please include a link to the issue, such as https://issues.dlang.org/show_bug.cgi?id=14828

@WalterBright
Copy link
Member

Also should reference other PRs that address the same issue - #3552 and #4851

@MartinNowak
Copy link
Member Author

When making PR's that fix a bugzilla issue, please include a link to the issue, such as https://issues.dlang.org/show_bug.cgi?id=14828

I usually do, it was a little late yesterday.

WalterBright added a commit that referenced this pull request Aug 4, 2015
fix Issue 14828 - duplicate symbol __ModuleInfoZ
@WalterBright WalterBright merged commit 2e15e16 into dlang:stable Aug 4, 2015
@MartinNowak MartinNowak deleted the fix14828 branch August 4, 2015 21:33
@rainers
Copy link
Member

rainers commented Aug 5, 2015

If it is actually ok to require deimos-like modules to be compiled, too, maybe we can resurrect #3958 to get proper TypeInfo for structs.

A lot of work has been done to avoid compilation of these files (by trying to guess what TypeInfo the backend will require, not completely successful so far), switching to a simpler compilation model would avoid all these complications.

@MartinNowak
Copy link
Member Author

If it is actually ok to require deimos-like modules to be compiled, too, maybe we can resurrect #3958 to get proper TypeInfo for structs.

This is not what we decided. You'll almost never need an __arrayZ or __assertZ helper in deimos (b/c there are no D arrays in C, and rarely asserts in headers), and you could still workaround needing them.

Compiling headers with zero initialized structs is quite a bummer. Let's discuss #3958 together with overhauling the template instantiation implementation (see #4784, and #4780 (comment)).

@MartinNowak MartinNowak added the Review:Needs Changelog A changelog entry needs to be added to /changelog label Aug 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review:Needs Changelog A changelog entry needs to be added to /changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants