"precompiled header '%0' was ignored because '%1' is not first '-include'">;
def warn_missing_sysroot : Warning<"no such sysroot directory: '%0'">,
InGroup<DiagGroup<"missing-sysroot">>;
+def warn_debug_compression_unavailable : Warning<"cannot compress debug sections (zlib not installed)">,
+ InGroup<DiagGroup<"debug-compression-unavailable">>;
def note_drv_command_failed_diag_msg : Note<
"diagnostic msg: %0">;
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
+#include "llvm/Support/Compression.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
}
}
}
- if (CompressDebugSections)
- CmdArgs.push_back("-compress-debug-sections");
+ if (CompressDebugSections) {
+ if (llvm::zlib::isAvailable())
+ CmdArgs.push_back("-compress-debug-sections");
+ else
+ D.Diag(diag::warn_debug_compression_unavailable);
+ }
}
// Until ARM libraries are build separately, we have them all in one library
--- /dev/null
+// RUN: %clang -c %s -Wa,--compress-debug-sections 2>&1 | FileCheck %s
+// REQUIRES: nozlib
+
+// CHECK: warning: cannot compress debug sections (zlib not installed)