This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++98/C++11 ABI compatibility for gcc-4.7
- From: PaweÅ Sikora <pluto at agmk dot net>
- To: gcc at gcc dot gnu dot org
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, James Y Knight <foom at fuhm dot net>, jyasskin at googlers dot com
- Date: Thu, 14 Jun 2012 22:33:11 +0200
- Subject: Re: C++98/C++11 ABI compatibility for gcc-4.7
- References: <684e2daa82dfe58f3c0ca7898a646503.squirrel@fuhm.net> <CAH6eHdTEx0jgZWZJ8+RRhOEnD9zUXfLUPX30nhH8Zh6aYsE1Tg@mail.gmail.com> <CAH6eHdTMhoLvmoWZSCg3+1Gj1Z9p+EE=wwcvW86ubp9z9Ko3KQ@mail.gmail.com>
On Thursday 31 of May 2012 22:58:32 Jonathan Wakely wrote:
> On 31 May 2012 22:39, Jonathan Wakely wrote:
> > On 31 May 2012 22:35, James Y Knight wrote:
> >> I understand that the ABI changes generally cannot be avoided, but a lot
> >> of pain for a lot of people could be avoided by making things fail
> >> obviously with a link error, instead of sometimes, arbitrarily, if you're
> >> lucky, you'll get a segfault at runtime.
> >
> > Do you have any suggestions for how to do that?
>
> ... *without* breaking the current ABI, because if we weren't trying
> to keep it stable it would be much easier.
>
> If you want to you can configure with
> --enable-symvers=gnu-versioned-namespace and test that mode, which
> would allow everything to be put in something like std::__cxx2011::__8
> for -std=c++11 mode, but AFAICT only one person seems to be trying
> that option out and giving feedback on it.
the versioned namespace doesn't solve all problems. if you put c++11/std::list
in the e.g., std::__8 namespace then you trig a nice linker error for incompatible objects
that passes std::list as a function argument but std::list used as a return type
won't be catched (return type is not mangled in function symbol).
from the others side, someone can use -frecord-gcc-switches to detect mixed '-std=...'
after final linking and report error in such cases.