Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 585 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 46 Data Integration
- 46 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 667 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 Portuguese
Incompatible mangling between Studio 12.5 and 12.6

I am not able to link code compiled with Studio 12.6 to a shared library built with 12.5.
Seems like mangling produces different symbols on both compilers
With this code:
class A {public: A(void (*)(void*));};
Studio 12.5 exports _ZN1AC1EPFPvE
Studio 12.6 requires _ZN1AC1EPFvPvE
The difference seems like returning type is added with 12.6 but not with 12.5
Comments
-
We fixed a name-mangling bug in Studio 12.6 involving functions taking a function pointer as a parameter. This bug showed up as different functions having the same mangled name, so it had to be fixed. We also fixed a number of other bugs in name mangling.
You have two choices for dealing with this mangling difference:
1. Recompile the old code with Studio 12.6.
2. Create a weak definition of the missing mangled name that is equated to the generated mangled name.
#pragma weak "undefined_name" = "defined_name"
The quotes are part of the syntax; the pragma uses string literals.
This pragma must be in the file that provides the definition.
Note that a mangled name might depend on the memory model (-m32/-m64) or on the target architecture (SPARC or x86). In this case, it does not.
We use solution #2 in libraries that need to be linked to binaries created by old and new compilers. If you don't have a similar requirement, replacing the compiler and recompiling old binaries might be the simplest and most reliable solution. -
Thanks for the answer.
I came up with the #pragma weak solution but just wanted to make sure you are aware of this problem and in case it is true - hoping that there is a hidden option similar to -abiopt=5/6 that switches the compiler to old mangling mode.
-
For this mangling bug, there is no option to go back to the incorrect mangling.
The -compat=5 mangling has been in use since 1998, and many customers have old binaries that must be linked with new code built with newer compilers. We provided the mangle5/mangle6 option to allow customers to use the old mangling if their code didn't trigger any of the bugs.
We judged that few, if any, customers were stuck with old binaries using gcc mangling, because C++11 (the primary use) is a recent feature. In addition, gcc fixes their own mangling bugs without the option of going back, and adds mangling for new language features. It seemed impractical for us to try to draw a line between "old" and "new" gcc mangling for a binary option, and too cumbersome to provide something more fine-grained.If there were customer demand for an option to revert to incorrect gcc mangling, we would consider it.