https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123242
Bug ID: 123242
Summary: GCC build/version string included multiple times in
each binary or library
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: brechtsanders at users dot sourceforge.net
Target Milestone: ---
I release GCC/binutils binaries natively built on Windows at
https://winlibs.com/
It was brought to my attention that the version/build string (as shown by "gcc
--version" is present many times in each .exe, .dll and even .a file in my
release.
See also issue:
https://github.com/brechtsanders/winlibs_mingw/issues/10#issuecomment-3678786131
This amounts to quite some bloat of the entire toolchain.
I do strip all my binaries, but that doesn't remove it.
This issue is for MinGW-w64 specifically, but independent of language (C, C++,
...) or GCC version.
What is causing the version/build string to be included so many times in each
produced file?
How can I strip it, or prevent it from being included (e.g. using a specific
linker flag)?