https://github.com/lzcunt created https://github.com/llvm/llvm-project/pull/225654
Pretty much all users of mlibc targets currently vendor this or similar patches and having it upstream would be useful. >From 5f5e7edf1969cbec97b3af9f67509c75404bf235 Mon Sep 17 00:00:00 2001 From: lzcunt <[email protected]> Date: Wed, 23 Sep 2026 12:18:59 +0300 Subject: [PATCH] [clang][mlibc] Predefine `__mlibc__` for mlibc targets --- clang/lib/Basic/Targets/OSTargets.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h index fb5c17cefc004e..36354668de69cb 100644 --- a/clang/lib/Basic/Targets/OSTargets.h +++ b/clang/lib/Basic/Targets/OSTargets.h @@ -396,6 +396,9 @@ class LLVM_LIBRARY_VISIBILITY LinuxTargetInfo : public OSTargetInfo<Target> { } else { Builder.defineMacro("__gnu_linux__"); } + if (Triple.getEnvironmentName() == "mlibc") { + Builder.defineMacro("__mlibc__"); + } if (Opts.POSIXThreads) Builder.defineMacro("_REENTRANT"); if (Opts.CPlusPlus) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
