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:

Jonathan Bartlett wrote:

RH9 uses an updated libstdc++ which can cause problems. Also, if you are
exporting anything but "c"-style functions declared with extern c or
whatever that is, you will NOT have compatibility at all. There is some
work for a standard C++ ABI, but it's still a little fluid.


So you're basically saying that I have to compile *all* my C++ code for Red Hat 9 (i.e. gcc 3)?


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, when different components are linked with different versions of the same DSO. Whether or not it is a good idea to rely on this feature is a different question...



Is there really no way around this?


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*? Surely the lib version issues may be resolved by passing the appropriate linker command line arguments?


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

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


there won't be compatiblity between libraries built by different versions of the compiler.

I notice that the *runtime* linker is quite happy to accept binaries from Red Hat 7.3 (gcc 2)


As long as the libraries to be linked are coherent (as in, only on libstdc++ to load), you should expect older binaries to load properly.

I'm not sure what happens if you mix binaries from the two versions (e.g. by replacing one of the DSOs without relinking the app.)


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. Just like it should. Obviously, you shouldn't need to recompile everything every time there is a new OS release. (Yeah, I know people who are accustomed to certain other major OSes expect to do that...)


- Toralf



--
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