Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue 14828 - duplicate symbol __ModuleInfoZ #4858

Merged
merged 1 commit into from Aug 4, 2015

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 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
Needs Changelog A changelog entry needs to be added to /changelog
Projects
None yet
3 participants