[lld] [LLD][COFF] Add -build-id flag to generate .buildid section. (PR #71433)
Zequan Wu via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 8 09:36:26 PST 2023
================
@@ -302,7 +302,16 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
} else if (!args.hasArg(OPT_strip_all)) {
add("-debug:dwarf");
}
- add(args.hasArg(OPT_no_build_id) ? "-build-id:no" : "-build-id");
+ if (auto *a = args.getLastArg(OPT_build_id)) {
+ StringRef v = a->getValue();
+ if (v == "none")
+ add("-build-id:no");
+ else if (v.empty())
+ add("-build-id");
+ else
+ warn("unsupported build id hashing: " + a->getSpelling());
----------------
ZequanWu wrote:
Updated to fallback to `-build-id` in unhandled case.
https://github.com/llvm/llvm-project/pull/71433
More information about the llvm-commits
mailing list