summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-03-05 11:32:14 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-03-05 11:32:14 +0000
commit1e93080ca854fa89b74a3f051605ca4db2d4de89 (patch)
tree785fab52337a213c72d067ebbbdee8b0954e29d1
parent41e38925ab6b65705ce232edd9396c68bdb8fce5 (diff)
downloadbcm5719-llvm-1e93080ca854fa89b74a3f051605ca4db2d4de89.tar.gz
bcm5719-llvm-1e93080ca854fa89b74a3f051605ca4db2d4de89.zip
[llvm-objcopy] - Report "no zlib available" error properly when --compress-debug-sections is used.
If zlib is not available, and --compress-debug-sections is passed, we want to report an error. Currently, it is only reported for --compress_debug_sections= form of the option. Fixes the https://bugs.llvm.org/show_bug.cgi?id=40886. I do not think there is a way to write a test for this. Differential revision: https://reviews.llvm.org/D58909 llvm-svn: 355391
-rw-r--r--llvm/tools/llvm-objcopy/CopyConfig.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/tools/llvm-objcopy/CopyConfig.cpp b/llvm/tools/llvm-objcopy/CopyConfig.cpp
index 3972a56a06b..fb362b7f5c9 100644
--- a/llvm/tools/llvm-objcopy/CopyConfig.cpp
+++ b/llvm/tools/llvm-objcopy/CopyConfig.cpp
@@ -476,11 +476,11 @@ Expected<DriverConfig> parseObjcopyOptions(ArrayRef<const char *> ArgsArr) {
InputArgs.getLastArgValue(OBJCOPY_compress_debug_sections_eq)
.str()
.c_str());
- if (!zlib::isAvailable())
- return createStringError(
- errc::invalid_argument,
- "LLVM was not compiled with LLVM_ENABLE_ZLIB: can not compress");
}
+ if (!zlib::isAvailable())
+ return createStringError(
+ errc::invalid_argument,
+ "LLVM was not compiled with LLVM_ENABLE_ZLIB: can not compress");
}
Config.AddGnuDebugLink = InputArgs.getLastArgValue(OBJCOPY_add_gnu_debuglink);
OpenPOWER on IntegriCloud