gcc - Ok to use newer (or both) libstdc++ on 32-bit Centos 6? -
our legacy product ships on 32-bit centos 6.6, has gcc 4.4.7 built in. however, large app crashes glibc corruption. recompiling gcc 4.8 , addresssanitizer finds "global-buffer-overflow" , crashes. however, compiling gcc 4.9 seems fix things: no glibc corruption , no addresssanitizer errors.
the problem the app requires libstdc++.so.6.0.20
, no longer works stock centos 6 libstdc++.so.6.0.13
(glibcxx_blahblah
not found, etc)
so what's best approach?
- replace stock
/usr/lib/libstdc++
new one? - package new
libstdc++.so.6.0.20
our app (in private directory) , modify/etc/ld.so.conf.d
load private/new library before system copies.
in #1, file owned package, might again overwritten future update. also, existing programs break if /usr/lib
version updated? read lot on abi compatibility complex subject.
thanks feedback.
your problem minor interaction other software.
so, avoid replacing stock version of library.
moreover, there possibly interractions other software using /etc/ld.so.conf.
so, best way avoid interaction other sotfware to:
- either statically link libstdc++ 6.0.20 legacy product or app (you need sources, or @ least independent objects files, that, may not possible);
- or install libstdc++.so.6.0.20 in specific directory, /usr/local/my-own-version-for-my-app/lib, , instead of publishing directory ld.so.conf, use :
- a ld_library_path env var set /usr/local/my-own-version-for-my-app/lib:$ld_library_path, before launching app:
- or set ld_preload env var way: ld_preload=/usr/local/my-own-version-for-my-app/lib/libstdc++.so.6.0.20, before launching app.
this means writting:
% export ld_library_path=/usr/local/my-own-version-for-my-app/lib:$ld_library_path % ./launch_my_app
or:
% export ld_preload=/usr/local/my-own-version-for-my-app/lib/libstdc++.so.6.0.20 % ./launch_my_app
Comments
Post a Comment