https://bugs.gentoo.org/944056

--- a/gfx/graphite2/src/MozGrMalloc.h
+++ b/gfx/graphite2/src/MozGrMalloc.h
@@ -12,7 +12,7 @@

 #include "mozilla/mozalloc.h"

-#if defined(XP_LINUX) && !defined(ANDROID)
+#if defined(XP_LINUX) && !defined(_LIBCPP_VERSION)

 #define malloc moz_xmalloc
 #define calloc moz_xcalloc
