-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crosstool-NG compiled libraries compatibility problem #8025
Comments
Yes. You need to use our compilers. |
I updated my repo with a new test set: HelloWold2.h, HelloWorld2.cpp, HelloWorld2Imp.cpp and Main2.cpp. These test files are self contained and have no dependency with libprotobuf. The following test shows there are linking problems in each combination: native lib + crosstool-NG compiler, or crosstool-NG compiled lib + native compiler.
|
Ah, ok, CentOS7 system compilers do not even support the new C++11 ABI since they are version 4.8.5 only. You can read more about this at: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html If you want to do this mixing (but you should use our compilers instead, there are about 8 years of toolchain development work between the 4 series and 7 series of compilers) then you need to do the following:
This small string optimization you are missing is just one example of why you should prefer newer toolchains. Without SSO, for a small |
And just to be clear, we use the C++11 ABI in all of our C++ libraries. This is something that standards compliance forces. We also support C++14 and 17 and that's not possible without adopting the new ABI. |
Thanks. I see. |
As I posted an issue at here crosstool-NG libraries are incompatible with CentOS 7 GNU linker!?, I find crosstool-NG compiler and CentOS 7.4.1708 native g++ compiler generate different symbols in some cases and fail to link to each other compiled libaries!
I create a minimal program to reproduce the problem:
https://github.com/MrMYHuang/HelloWorld
Please install Anaconda 3 5.0.1 64-bit on /opt/anaconda3 on CentOS 7.4.1708 64-bit first and install crosstool-NG compiler and libprotobuf:
Then, the following shows that the crosstool-NG compiled libprotobuf can be linked with crosstool-NG compiled libHelloWorld:
However, if we compile libHelloWorld with CentOS 7 native compiler, it will fail to link to libprotobuf:
Actually,
nm -S libHelloWorld.so |grep fixed
shows the compiled symbols of the variable fixed_address_empty_string are different!:_ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx11E
vs
_ZN6google8protobuf8internal26fixed_address_empty_stringE
This incompatibility problem makes me fail to compile caffe on CentOS 7... Is there any solution?
The text was updated successfully, but these errors were encountered: