diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 879f01e87806e..1e31fcc3d731e 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -1604,6 +1604,16 @@ static bool isTargetVariantEnvironment(const TargetInfo &TI, return false; } +#if defined(__sun__) && defined(__svr4__) +// GCC mangles std::tm as tm for binary compatibility on Solaris (Issue +// #33114). We need to match this to allow the std::put_time calls to link +// (PR #99075). +asm("_ZNKSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_" + "RSt8ios_basecPKSt2tmPKcSB_ = " + "_ZNKSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_" + "RSt8ios_basecPK2tmPKcSB_"); +#endif + /// ExpandBuiltinMacro - If an identifier token is read that is to be expanded /// as a builtin macro, handle it and return the next token as 'Tok'. void Preprocessor::ExpandBuiltinMacro(Token &Tok) {