[PATCH] D113534: [lld-macho] Avoid warning on -install-name if -dylib is not provided

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 17 00:52:21 PST 2021


int3 added a comment.

> Isn't that _good_ though? Clang has hundreds of warning flags, and I think that's generally appreciated. We should still pick good defaults of course, but likely different projects will want to care about different things.

What I had in mind as the alternative was something like `--no-warn <warning name>`. Sorry, I realize now that I totally neglected to add that context 😅



================
Comment at: lld/MachO/Options.td:76
     HelpText<"Optimize output file size">;
+def warn_no_dylib_install_name: Joined<["--"], "warn-no-dylib-install-name">,
+    HelpText<"Do not warn on -install-name if -dylib is not passed (default)">,
----------------
I think `no-warn` makes a lot more sense than `warn-no` here

(btw, LLD-ELF's Options.td has a macro thing to define both the "yes" and "no" versions of a flag. We can consider that as we add more of these.


================
Comment at: lld/test/MachO/install-name.s:20
+# RUN: %lld -bundle --warn-dylib-install-name --warn-no-dylib-install-name \
+# RUN:     -o %t.bundle %t.o -install_name foo 2>&1
 # RUN: llvm-objdump --macho --all-headers %t.bundle \
----------------
either remove the redirect or check that the output lacks a warning :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113534/new/

https://reviews.llvm.org/D113534



More information about the llvm-commits mailing list