[lld/mac] warn on -install_name without -dylib
authorNico Weber <thakis@chromium.org>
Tue, 9 Mar 2021 15:02:24 +0000 (10:02 -0500)
committerNico Weber <thakis@chromium.org>
Wed, 10 Mar 2021 14:05:44 +0000 (09:05 -0500)
commit6e92f468c82bac06051675fa94f72ca2789d2bc0
tree7f9e28cf97cbaf7af504629603bb3ac8f0320379
parent1aafaaca6717d2cf3084e4ba38bde63f619dca90
[lld/mac] warn on -install_name without -dylib

The flag doesn't (and shouldn't) have an effect in that case.
ld64 doesn't warn on this, but it seems like a good thing to do.
If it causes problems in practice for some reason, we can revert it.

Also add a dedicated test for install_name.

Differential Revision: https://reviews.llvm.org/D98259
lld/MachO/Driver.cpp
lld/test/MachO/install-name.s [new file with mode: 0644]