Fix test suite C++ test with GCC 5.1 dual ABI#5686
Conversation
|
IIRC @ibuclaw also had a pull request for this issue? |
|
I don't see anything relevant on https://github.com/dlang/dmd/pulls/ibuclaw |
|
I was thinking of #5262 but it seems that has already been merged and probably wasn't meant to fix this problem. |
|
Maybe #5261 ? |
|
You have a great explanation for this in the opening comment. But the code just contains the #define. Please add the explanation as a comment! |
GCC 5.1 introduced new implementations of std::string and std::list: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html This causes e.g. std::string to be actually defined as std::__cxx11::string. On machines with GCC 5.1, this manifests as a linker error when running the cppa.d / cppb.cpp test: cppa.o: In function `_D4cppa6test14FZv': cppa.d:(.text._D4cppa6test14FZv+0x11): undefined reference to `foo14a(std::string*)' cppa.d:(.text._D4cppa6test14FZv+0x18): undefined reference to `foo14b(std::basic_string<int, std::char_traits<int>, std::allocator<int> >*)' cppa.d:(.text._D4cppa6test14FZv+0x3a): undefined reference to `foo14f(std::char_traits<char>*, std::string*, std::string*)' cppa.o: In function `_D4cppa7testeh3FZv': cppa.d:(.text._D4cppa7testeh3FZv+0x19): undefined reference to `throwle()' collect2: error: ld returned 1 exit status --- errorlevel 1 When the .cpp file is compiled with g++ 5.3.0, the actual function signatures in the cppb.o object file are: foo14a(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) foo14b(std::__cxx11::basic_string<int, std::char_traits<int>, std::allocator<int> >*) foo14f(std::char_traits<char>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) Fortunately, it is easily possible to disable the new feature by defining _GLIBCXX_USE_CXX11_ABI as 0 before including any standard headers.
b0db8a7 to
a1f74ff
Compare
|
OK, I copied the commit message as a comment before the |
|
Auto-merge toggled on |
|
Nope, I hadn't addressed the C++-11 problem. Maybe we can discuss a compromise between supporting the current compiler and supporting legacy at dconf. Because this is also hurting overall gdb experience too. I honestly have half a mind in support of using something similar to |
|
If at all it would need to be |
|
BTW, it took me 15m. to figure out that stable tests fail on some auto-testers b/c of this, and another 30m. to find this PR. |
Fix test suite C++ test with GCC 5.1 dual ABI
GCC 5.1 introduced new implementations of std::string and std::list:
https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
This causes e.g.
std::stringto be actually defined asstd::__cxx11::string.On machines with GCC 5.1, this manifests as a linker error when running the
cppa.d/cppb.cpptest:When the .cpp file is compiled with g++ 5.3.0, the actual function signatures in the cppb.o object file are:
Fortunately, it is easily possible to disable the new feature by defining
_GLIBCXX_USE_CXX11_ABIas 0 before including any standard headers.