suppress build-id
i'm unable to suppress the generation of the .buildid section and COFF debug directory when linking a binary without debug info.
i would've hoped for --build-id=none however the mingw frontend explicitly disallows[1] this option. when digging in i found a possible toggle[2] from this commit[3] which maybe if i could set config->debug to false all would be well. omitting -g or passing -g0 didn't do the trick. have i missed something or is build-id forced?
1: https://github.com/llvm/llvm-project/blob/c0f0d50653e16145beee474a3d0d602596502dde/lld/MinGW/Options.td#L167 2: https://github.com/llvm/llvm-project/blob/c0f0d50653e16145beee474a3d0d602596502dde/lld/COFF/Writer.cpp#L2000 3: https://github.com/llvm/llvm-project/commit/3c046af5a931055470d23cceaaae3d9903dfe2a9
i'm unable to suppress the generation of the
.buildidsection and COFF debug directory when linking a binary without debug info.
i would've hoped for
--build-id=nonehowever the mingw frontend explicitly disallows[1] this option.
It's not so much "explicitly disallows", as it only knows about the plain --build-id form without any parameters.
If GNU ld supports --build-id=none, I guess we could add support for that too. What other valid parameter values are there, other than none?
when digging in i found a possible toggle[2] from this commit[3] which maybe if i could set
config->debugto false all would be well. omitting-gor passing-g0didn't do the trick. have i missed something or is build-id forced?
If you link with -s or -S for producing stripped output, then config->debug is set to false, and you get no build ID.
If you link with
-sor-Sfor producing stripped output, thenconfig->debugis set to false, and you get no build ID.
thank you! this indeed removed .buildid section and debug directory.
If GNU ld supports
--build-id=none, I guess we could add support for that too. What other valid parameter values are there, other thannone?
fast, md5, sha1/tree, uuid, hex-string, none as seen here: https://github.com/llvm/llvm-project/blob/c0f0d50653e16145beee474a3d0d602596502dde/lld/ELF/Driver.cpp#L850