Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#3858 closed discussion (fixed)

G++ Application Binary Interface (ABI)

Reported by: Rüdiger Franke Owned by: Rüdiger Franke
Priority: high Milestone:
Component: Cpp Run-time Version:
Keywords: Cc:

Description (last modified by Rüdiger Franke)

Gcc 5 introduced a new C++ ABI to conform with the 2011 standard, in particular for strings and lists. This causes linker errors when mixing the old and the new ABI.

6f37672/OMCompiler introduced the compiler flag

-D_GLIBCXX_USE_CXX11_ABI=0

to be able to already use gcc5 on systems that still were based on gcc4 and the old ABI.

Meanwhile gcc5 is becoming the standard compiler and recent binary distributions of boost 1.58 finally require the new ABI. f0613dd/OMCompiler accounts for this.

The change works on systems with the old ABI and on systems with the new ABI, provided the default system compiler is used for the Cpp runtime.

Linker errors can generally be avoided when using the same compiler for boost and for the Cpp runtime.

Change History (6)

comment:1 by Rüdiger Franke, 9 years ago

Description: modified (diff)

comment:2 by Rüdiger Franke, 9 years ago

Owner: changed from somebody to Rüdiger Franke
Status: newassigned

ade6473/OMCompiler re-introduces the use of the old ABI for FMI export. This is possible because FMUs don't link against boost libs. It is needed as libstdc++ of cross compilation targets might not be upgraded to the new ABI yet.

Consider Debian 8 Jessie as example:

  • use gcc 4.9 as system compiler with old ABI
  • boost libs and cross compilation targets use old ABI as well --> f0613dd/OMCompiler

Consider Ubuntu 16.04 Xenial LTS as example:

  • use gcc 5.3 as system compiler with new ABI per default
  • regular libstdc++ has been upgraded and contains both: old and new ABI
  • boost libs have been upgraded and require the new ABI --> f0613dd/OMCompiler
  • libstdc++ of mingw32 target has not been upgraded yet and requires the old ABI --> ade6473/OMCompiler


comment:3 by Rüdiger Franke, 9 years ago

Resolution: fixed
Status: assignedclosed

comment:4 by Martin Sjölund, 9 years ago

An alternative would be to use -static-libstdc++ -static-libgcc, I suppose.

in reply to:  4 comment:5 by Rüdiger Franke, 9 years ago

Replying to sjoelund.se:

An alternative would be to use -static-libstdc++ -static-libgcc, I suppose.

We do link C++ FMUs with these static libs already, in order to minimize dependencies in the target system. Nevertheless the i686-w64-mingw32 target requires the old ABI under Xenial -- somehow Canonical forgot to recompile these packages when upgrading to gcc 5.3.

comment:6 by Martin Sjölund, 7 years ago

Milestone: 1.10.0

Milestone deleted

Note: See TracTickets for help on using tickets.