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

Vincent Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 17 11:04:49 PST 2021


thevinster marked 2 inline comments as done.
thevinster added inline comments.


================
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)">,
----------------
thakis wrote:
> int3 wrote:
> > 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.
> `--warn-no` kind of matches clang's `-Wno`, which seems vaguely nice to me. But no strong preference.
> 
> `no-warn` kind of matches ld64's various `-warn_no_` flags, which also seems vaguely nice :)
I'll switch to `no-warn` as an effort to be more coupled with ld64's variation. 


================
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 \
----------------
int3 wrote:
> either remove the redirect or check that the output lacks a warning :)
I think the combination of %lld and the fact that the command didn't fail is enough signal to know 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