www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - stripping binaries from LDC2

reply Arjan <arjan ask.me.to> writes:
In c++ our release builds are build `-O2 -g` and the resulting 
binaries are stripped with GNU/strip.
Is this also possible with LDC2 generated binaries for D code?
So build D code with `-O2 -g` and then strip the resulting binary?
Feb 07 2022
parent reply max haughton <maxhaton gmail.com> writes:
On Monday, 7 February 2022 at 12:16:53 UTC, Arjan wrote:
 In c++ our release builds are build `-O2 -g` and the resulting 
 binaries are stripped with GNU/strip.
 Is this also possible with LDC2 generated binaries for D code?
 So build D code with `-O2 -g` and then strip the resulting 
 binary?
Why build with debug info if you're going to strip it anyway?
Feb 07 2022
parent reply Arjan <arjan ask.me.to> writes:
On Monday, 7 February 2022 at 13:14:19 UTC, max haughton wrote:
 On Monday, 7 February 2022 at 12:16:53 UTC, Arjan wrote:
 In c++ our release builds are build `-O2 -g` and the resulting 
 binaries are stripped with GNU/strip.
 Is this also possible with LDC2 generated binaries for D code?
 So build D code with `-O2 -g` and then strip the resulting 
 binary?
Why build with debug info if you're going to strip it anyway?
The stripped release binaries are going to the client, when a problem occurs get a core dump, using the core dump + the original binary / symbol gives full debug info off site. It is common practice.
Feb 07 2022
parent max haughton <maxhaton gmail.com> writes:
On Monday, 7 February 2022 at 14:20:31 UTC, Arjan wrote:
 On Monday, 7 February 2022 at 13:14:19 UTC, max haughton wrote:
 On Monday, 7 February 2022 at 12:16:53 UTC, Arjan wrote:
 In c++ our release builds are build `-O2 -g` and the 
 resulting binaries are stripped with GNU/strip.
 Is this also possible with LDC2 generated binaries for D code?
 So build D code with `-O2 -g` and then strip the resulting 
 binary?
Why build with debug info if you're going to strip it anyway?
The stripped release binaries are going to the client, when a problem occurs get a core dump, using the core dump + the original binary / symbol gives full debug info off site. It is common practice.
Then yes, you can do that. D works in basically exactly the same way C++ does in this regard.
Feb 07 2022