[lld] [LLD][COFF] Add -build-id flag to generate .buildid section. (PR #71433)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 01:20:44 PST 2023


================
@@ -196,7 +196,8 @@ defm guard_longjmp : B<"guard-longjmp",
   "Do not enable Control Flow Guard long jump hardening">;
 defm error_limit:
   EqLong<"error-limit", "Maximum number of errors to emit before stopping (0 = no limit)">;
-defm build_id: B<"build-id", "Generate build ID", "Do not Generate build ID">;
+def build_id: J<"build-id=">, HelpText<"Generate build ID note (pass none to disable)">, 
----------------
mstorsjo wrote:

This no longer will match the argumentless form `--build-id`. Looking at ELF/Options.td for examples, they've handled it like this:
```
def build_id: J<"build-id=">, HelpText<"Generate build ID note">,
  MetaVarName<"[fast,md5,sha1,uuid,0x<hexstring>]">;
def : F<"build-id">, Alias<build_id>, AliasArgs<["fast"]>, HelpText<"Alias for --build-id=fast">;
```
As long as we don't really implement the other options, we probably don't want to implement it with an alias with the argument `fast` though; that makes the code simpler, but makes it harder to warn if that is passed explicitly.

https://github.com/llvm/llvm-project/pull/71433


More information about the llvm-commits mailing list