diff --git a/config/buildSettings.mk b/config/buildSettings.mk
index 450bc75fec3644af715d8dd18dbdd612737be482..2bff6c1f6cfbf894ddd43e1d67fa7a0f3cc0c6f8 100644
--- a/config/buildSettings.mk
+++ b/config/buildSettings.mk
@@ -114,6 +114,13 @@ ifeq ($(SYSTYPE), Darwin)
   LDFLAGS  += -Wl,-rpath,"${FSLDIR}/lib"
   ARCHLIBS += -llapack -lblas -lz -lm
 
+  # Old versions of libxml++ (which is used by
+  # ciftilib) use std::auto_ptr, which has been
+  # removed from the llvm C++17 implementation.
+  # Adding this flag is a hack which allows us
+  # to continue to use std::auto_ptr.
+  ARCHCPPFLAGS += -D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
+
   # On macOS, we need to change the install
   # name of shared libs so that they can be
   # looked up according to the rpath of