[cfe-dev] solaris-specific mangling for g++ compat

James Y Knight via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 13 10:34:24 PDT 2017


So, uh, why did solaris's stdlib.h header move these four types in the
first place? It sounds like there was some code in the system header that
conditionally put them into either the global namespace, or into the std
namespace, dependent on the value of __cplusplus, yet all C++ compilers
ever used on solaris were setting __cplusplus to the version where they
were in the global namespace.

So...I'm rather confused, then, as to why this mangling change was made in
gcc in the first place, instead of just modifying the system header to not
do that. Surely it'd have been saner to move the definitions back to the
global namespace unconditionally? (And, I think that could even still be
done?)

For comparison, on linux glibc, tm, div_t, ldiv_t, and lconv are all just
defined in :: and imported into std:: with using...


On Thu, Jul 13, 2017 at 12:56 PM, Fedor Sergeev via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Greetings folks,
>
> I just filed a bug on clang mangling:
>   https://bugs.llvm.org/show_bug.cgi?id=33767
>
> which is not clang's bug per se, but rather a bug-incompatibility
> with gcc on Solaris (more details in bug report).
>
> gcc deliberately chose to diverge from mangling as specified by C++ ABI
> in order to keep binary compatibility
> (see https://gcc.gnu.org/ml/gcc-patches/2011-08/msg00834.html
>  for discussion of that patch).
>
> When clang on Solaris links with libstdc++ this binary compatibility
> issue kicks in.
>
> I wonder would the patch doing Solaris-only hack to the mangling
> to maintain gcc binary compatibility be welcome here?
> Unconditionally or under some flag?
>
> regards,
>   Fedor.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170713/4fcefd6b/attachment.html>


More information about the cfe-dev mailing list