I tried `-undefined suppress` without `-flat_namespace`.
lld printed `'-undefined suppress' only valid with '-flat_namespace'`
followed by many many screenfuls of error messages about undefined
symbols, making the original diag hard to see.
This is probably the common case when using `-undefined`, so let's
just abort the link immediately when there's an invalid `-undefined`
arg.
Differential Revision: https://reviews.llvm.org/D139559
(treatment == UndefinedSymbolTreatment::warning ||
treatment == UndefinedSymbolTreatment::suppress)) {
if (treatment == UndefinedSymbolTreatment::warning)
- error("'-undefined warning' only valid with '-flat_namespace'");
+ fatal("'-undefined warning' only valid with '-flat_namespace'");
else
- error("'-undefined suppress' only valid with '-flat_namespace'");
+ fatal("'-undefined suppress' only valid with '-flat_namespace'");
treatment = UndefinedSymbolTreatment::error;
}
return treatment;
# ERROR-NEXT: >>> referenced by
# INVAL-WARNING: error: '-undefined warning' only valid with '-flat_namespace'
-# INVAL-WARNING-NEXT: error: undefined symbol: _bar
+# INVAL-WARNING-NOT: error: undefined symbol: _bar
# INVAL-SUPPRESS: error: '-undefined suppress' only valid with '-flat_namespace'
-# INVAL-SUPPRESS-NEXT: error: undefined symbol: _bar
+# INVAL-SUPPRESS-NOT: error: undefined symbol: _bar
# WARNING: warning: undefined symbol: _bar
# WARNING-NEXT: >>> referenced by