diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-03-28 20:45:24 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-03-28 20:45:24 +0000 |
commit | 9b620b451af331c8d0bc456ffadc2cbf97941ca1 (patch) | |
tree | c72b464f2dd3053a67faa11197014321f5071059 /llvm/tools/llvm-mc/llvm-mc.cpp | |
parent | 5e91ef63269aab4f154f82d1aa26ead9c657a304 (diff) | |
download | bcm5719-llvm-9b620b451af331c8d0bc456ffadc2cbf97941ca1.tar.gz bcm5719-llvm-9b620b451af331c8d0bc456ffadc2cbf97941ca1.zip |
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?
llvm-svn: 205050
Diffstat (limited to 'llvm/tools/llvm-mc/llvm-mc.cpp')
-rw-r--r-- | llvm/tools/llvm-mc/llvm-mc.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index b2e7a81488d..dfa347e764a 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/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. |