aboutsummaryrefslogtreecommitdiff
path: root/lld/MachO/DriverUtils.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-03 14:10:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-07-03 14:10:23 +0000
commit145449b1e420787bb99721a429341fa6be3adfb6 (patch)
tree1d56ae694a6de602e348dd80165cf881a36600ed /lld/MachO/DriverUtils.cpp
parentecbca9f5fb7d7613d2b94982c4825eb0d33d6842 (diff)
Diffstat (limited to 'lld/MachO/DriverUtils.cpp')
-rw-r--r--lld/MachO/DriverUtils.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/lld/MachO/DriverUtils.cpp b/lld/MachO/DriverUtils.cpp
index 83940b54486f..b52d5e851c62 100644
--- a/lld/MachO/DriverUtils.cpp
+++ b/lld/MachO/DriverUtils.cpp
@@ -87,6 +87,7 @@ InputArgList MachOOptTable::parse(ArrayRef<const char *> argv) {
// Handle -fatal_warnings early since it converts missing argument warnings
// to errors.
errorHandler().fatalWarnings = args.hasArg(OPT_fatal_warnings);
+ errorHandler().suppressWarnings = args.hasArg(OPT_w);
if (missingCount)
error(Twine(args.getArgString(missingIndex)) + ": missing argument");
@@ -204,11 +205,14 @@ Optional<StringRef> macho::resolveDylibPath(StringRef dylibPath) {
static DenseMap<CachedHashStringRef, DylibFile *> loadedDylibs;
DylibFile *macho::loadDylib(MemoryBufferRef mbref, DylibFile *umbrella,
- bool isBundleLoader) {
+ bool isBundleLoader, bool explicitlyLinked) {
CachedHashStringRef path(mbref.getBufferIdentifier());
DylibFile *&file = loadedDylibs[path];
- if (file)
+ if (file) {
+ if (explicitlyLinked)
+ file->explicitlyLinked = explicitlyLinked;
return file;
+ }
DylibFile *newFile;
file_magic magic = identify_magic(mbref.getBuffer());
@@ -219,7 +223,8 @@ DylibFile *macho::loadDylib(MemoryBufferRef mbref, DylibFile *umbrella,
": " + toString(result.takeError()));
return nullptr;
}
- file = make<DylibFile>(**result, umbrella, isBundleLoader);
+ file =
+ make<DylibFile>(**result, umbrella, isBundleLoader, explicitlyLinked);
// parseReexports() can recursively call loadDylib(). That's fine since
// we wrote the DylibFile we just loaded to the loadDylib cache via the
@@ -234,7 +239,7 @@ DylibFile *macho::loadDylib(MemoryBufferRef mbref, DylibFile *umbrella,
magic == file_magic::macho_dynamically_linked_shared_lib_stub ||
magic == file_magic::macho_executable ||
magic == file_magic::macho_bundle);
- file = make<DylibFile>(mbref, umbrella, isBundleLoader);
+ file = make<DylibFile>(mbref, umbrella, isBundleLoader, explicitlyLinked);
// parseLoadCommands() can also recursively call loadDylib(). See comment
// in previous block for why this means we must copy `file` here.