--- a/accessible/base/RoleHGen.py	2026-11-11 12:27:02.155096038 +0530
+++ b/accessible/base/RoleHGen.py	2026-11-11 12:27:02.165851288 +0530
@@ -16,6 +16,17 @@
         "/* Roles are defined in accessible/interfaces/nsIAccessibleRole.idl */\n\n"
         "#ifndef _role_h_\n"
         "#define _role_h_\n\n"
+        "// glibc >= 2.44 defines GROUPING as a macro in <langinfo.h> (under\n"
+        "// _GNU_SOURCE), which libc++ pulls in via <locale>. Include it here and\n"
+        "// drop the macro so it cannot clobber roles::GROUPING.\n"
+        "#if defined(__has_include)\n"
+        "#  if __has_include(<langinfo.h>)\n"
+        "#    include <langinfo.h>\n"
+        "#  endif\n"
+        "#endif\n"
+        "#ifdef GROUPING\n"
+        "#  undef GROUPING\n"
+        "#endif\n\n"
         "namespace mozilla {\n"
         "namespace a11y {\n"
         "namespace roles {\n\n"
