summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-03-28 20:45:24 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-03-28 20:45:24 +0000
commit4a9c2585ab60fe9f0e40df8f2aeaf55d34ce77ee (patch)
tree208a5ccb9ac6cbb80c94645904c58e04cd6a2da2 /tools
parent0e11c017a9bd47de37eeb6a0bc495c9b0bcc5461 (diff)
downloadllvm-4a9c2585ab60fe9f0e40df8f2aeaf55d34ce77ee.tar.gz
llvm-4a9c2585ab60fe9f0e40df8f2aeaf55d34ce77ee.tar.bz2
llvm-4a9c2585ab60fe9f0e40df8f2aeaf55d34ce77ee.tar.xz
llvm-mc: error when -compress-debug-sections is requested and zlib is not linked
This is a bit of a stab in the dark, since I have zlib on my machine. Just going to bounce it off the bots & see if it sticks. Do we have some convention for negative REQUIRES: checks? Or do I just need to add a feature like I've done here? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index b2e7a81488..dfa347e764 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/tools/llvm-mc/llvm-mc.cpp
@@ -384,8 +384,13 @@ int main(int argc, char **argv) {
std::unique_ptr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, TripleName));
assert(MAI && "Unable to create target asm info!");
- if (CompressDebugSections)
+ if (CompressDebugSections) {
+ if (!zlib::isAvailable()) {
+ errs() << ProgName << ": build tools with zlib to enable -compress-debug-sections";
+ return 1;
+ }
MAI->setCompressDebugSections(true);
+ }
// FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and
// MCObjectFileInfo needs a MCContext reference in order to initialize itself.