Re: C++ lib compatibility between Red Hat 9 and 7.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Toralf Lund wrote:
Gordon Messmer wrote:

Yes. DSO's from 7.3 would be linked against libstdc++-libc6.2-2.so.3. DSO's from 9 would be linked against libstdc++.so.5. If you tried to link a C++ binary against both, it would end up linked against both libstdc++ versions, and no good could come of that.


Actually, I think the runtime linker will try to load all relevant versions , and make sure the correct one is used in each case

But when the compiler/linker is trying to resolve symbols, how does it know which symbol to use? The two, incompatible versions of the C++ library will provide conflicting symbols. It won't work out. You've seen that it does not.


You can either compile all of your libraries and applications on RHL9, or install the appropriate compat-* packages, including the older compiler, and compile using the older compiler set to link against the older libstdc++.


Why would I need the old *compiler*?

Because the binary interface used by C++ objects has changed. It has changed with every major release of GCC for a very long time. While C has had a well defined ABI, C++ has not (historically). C++ objects compiled by different major versions of the compiler have never been compatible.


I believe that a stable ABI has been reached, and objects compiled by the current version of GCC should be compatible with objects compiled by future versions.

Surely the lib version issues may be resolved by passing the appropriate linker command line arguments?

No, that will not be sufficient.


Until the ABI is stable (which is should be now),


Shouldn't it have been *years* ago???

Perhaps, but it was not. I am not a GCC developer, so I don't know the situation well, but I believe that only recently has there been a C++ ABI that compiler vendors have agreed on.


The last time I saw that done was when I was using RHL 5.2. I installed KDE from an older release and a version of QT for 5.2 (or something like that). The mixture of libraries simply caused the loader to go into a loop and eat CPU time


Mixing libs from various releases of Red Hat 6 and 7 generally works fine.

For C libraries, that is probably true. You can not, however, mix objects built by different major versions of the GCC C++ compiler.


Just like it should. Obviously, you shouldn't need to recompile everything every time there is a new OS release.

Has nothing to do with the OS, and everything to do with the compiler. As long as you stick with just one compiler (and libraries that it built), you should be fine.




--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux