D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16796 - Linker error on big file + -gc switch generated by jtransc
Summary: Linker error on big file + -gc switch generated by jtransc
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: tools (show other issues)
Version: D2
Hardware: x86 Windows
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-26 17:55 UTC by Carlos Ballesteros Velasco
Modified: 2020-06-05 16:42 UTC (History)
1 user (show)

See Also:


Attachments
program.d in 7zip (366.18 KB, application/x-7z-compressed)
2016-11-26 17:55 UTC, Carlos Ballesteros Velasco
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Carlos Ballesteros Velasco 2016-11-26 17:55:31 UTC
Created attachment 1623 [details]
program.d in 7zip

I have create a target generating D for my project jtransc: https://github.com/jtransc/jtransc
So it allows to convert Java/Kotlin/Scala AOT into D and generate native executables.
In complex programs, the generated D file is pretty big. And in order to get comprehensive stacktraces in debug builds I have to add -gc. The big test suite including most of the java standard library generates a ~6MB d file. Without the -gc switch DMD works just fine and generates the executable.

dmd --version
DMD32 D Compiler v2.072.0

dmd -gc program.d
Error: linker exited with status 482878712
Comment 1 anonymous4 2016-11-28 09:40:37 UTC
As a workaround, try microsoft linker with -m32mscoff compiler switch
https://dlang.org/dmd-windows.html#switch-m32mscoff

dmd -gc -m32mscoff program.d
Comment 2 Mathias LANG 2020-06-05 16:42:51 UTC
Closing, as:
- If there's an issue, it's an OPTLINK issue, not a tools one;
- The referenced project has been archived so following up will not happen;
- `-gc` is gone now, one should use `-g`;
- A workaround (using mscoff) exists;