Can I change mangling for g++ to match xlC?

306 Views Asked by At

I'm trying to compile code on aix using g++ since xlC support of c++11 is very limited.

I'm having trouble to link my code with aix shared libraries because of the different name mangling.

xlC supports name mangling replacement (-qnamemangling=v13), but IBM doesn't gave the sources, so I need to recompile using g++ (or xlclang++) with xlC name mangling.

xlC version is V16.1

Is it possible to replace the name mangling of g++ (or xlclang++) to match xlC?

Is there other alternative?

1

There are 1 best solutions below

2
Chris Bowler On

xlC and g++ are not compatible on AIX. They use different object models and standard libraries.

There is an xlclang++ compiler in XLC++ 16.1 with full C++11 support, however, it is also not interoperable with xlC because compatibility was broken with C++11. xlclang++ uses a standard library based on libc++ (LLVM) while xlC uses its own legacy libC.a library. Compatibility through C is retained so your options are recompile or rework your interfaces to non-recompiled C++ interfaces to go through a C-layer.