--- a/git-compat-util.h.orig
+++ b/git-compat-util.h
@@ -619,7 +619,7 @@
  * Help Clang; GCC generates the same instructions for both variants on
  * x64 and aarch64.
  */
-#ifdef __clang__
+#if defined(__clang__) && __has_builtin(__builtin_add_overflow)
 #define st_add_overflow __builtin_add_overflow
 #else
 static inline bool st_add_overflow(size_t a, size_t b, size_t *out)
