Issue 18971 - [Home]I have a project that can be compiled in the debug mode with the latest DMD 2.080-1, but I report errors in release mode.
Summary: [Home]I have a project that can be compiled in the debug mode with the latest...
Status: RESOLVED DUPLICATE of issue 18234
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 enhancement
Assignee: No Owner
URL: http://dlang.org/
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-11 16:07 UTC by shove
Modified: 2020-03-21 03:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description shove 2018-06-11 16:07:50 UTC
Excuse me, what's the reason for this phenomenon?

I have a project that can be compiled in the debug mode with the latest DMD 2.080-1, but I report errors in release mode.

// release:

$ dub -b release
...
Linking...
Undefined symbols for architecture x86_64:
  "__D3std4conv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZSQCsQCr__TQCpVii10TaVQCki1TmZQDiFNaNbNiNfmZ6Result", referenced from:
      __D3std4conv__T6toImplTAyaTmZQoFNaNbNemkEQBm5ascii10LetterCaseZQBo in test.o
      __D3std4conv__T8textImplTAyaTQeThTaTaTQnTmZQBcFNaNfQBahaaQBgmZQBl in test.o
      __D3std4conv__T8textImplTAyaTQeTmTQjZQwFNaNbNfQvmQyZQBb in test.o
      __D3std4conv__T8textImplTAyaTQeTmTQjTmZQyFNaNbNfQxmQBamZQBf in test.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: linker exited with status 1
/Library/D/dmd/bin/dmd failed with exit code 1.


// ------------------------------------
// debug:

$ dub -b debug
Performing "debug" build using /Library/D/dmd/bin/dmd for x86_64.
async 0.1.11: target for configuration "library" is up to date.
crypto 0.1.4: target for configuration "library" is up to date.
buffer 0.2.4: target for configuration "library" is up to date.
dbc 1.1.0: target for configuration "library" is up to date.
szip 0.0.2: target for configuration "library" is up to date.
libserver ~master: target for configuration "library" is up to date.
test ~master: target for configuration "application" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Running ../release/test
OK!
Comment 1 basile-z 2018-06-11 16:15:49 UTC
try to add 

   "dflags-dmd": ["-allinst"],

to your DUB json or

    dflags "-allinst" platform="dmd"

to you DUB sdl and tells if the error still happen. You seem to reach a problem at least 2 other people have encountered.
Comment 2 shove 2018-06-11 16:25:33 UTC
Thank you, add "dflags-dmd": "-allinst" after compile successfully.

But the previous version of 2.080.1 did not have this problem.
Comment 3 basile-z 2018-06-11 16:30:42 UTC
Thanks for testing this.

Look at at this links for more infos:

- https://forum.dlang.org/post/depxzqipfuhnbioexdej@forum.dlang.org
- https://issues.dlang.org/show_bug.cgi?id=18234

The symbols for which there's a linkers errors looks similar. (for me too in 18234 but i didn't reported them).

What would be great is a repro case, unfortuantely it seems to happen only in bigger stuff.

*** This issue has been marked as a duplicate of issue 18234 ***