[lld-macho] Silence XAR deprecation warning
authorKeith Smiley <keithbsmiley@gmail.com>
Wed, 19 Jan 2022 21:34:04 +0000 (13:34 -0800)
committerKeith Smiley <keithbsmiley@gmail.com>
Wed, 19 Jan 2022 21:51:55 +0000 (13:51 -0800)
If you're building this on macOS 12.x+ this produces a deprecation
warning. I'm not sure what this means for the bitcode format going
forward, but it seems safe to silence for now.

Do we need to worry about GCC for this?

Differential Revision: https://reviews.llvm.org/D117718

lld/MachO/SyntheticSections.cpp

index 23e9086..7e4b83e 100644 (file)
@@ -1283,7 +1283,10 @@ void BitcodeBundleSection::finalize() {
   using namespace llvm::sys::fs;
   CHECK_EC(createTemporaryFile("bitcode-bundle", "xar", xarPath));
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
   xar_t xar(xar_open(xarPath.data(), O_RDWR));
+#pragma clang diagnostic pop
   if (!xar)
     fatal("failed to open XAR temporary file at " + xarPath);
   CHECK_EC(xar_opt_set(xar, XAR_OPT_COMPRESSION, XAR_OPT_VAL_NONE));