Reduce libstdc and libstdc++ version without moving build server to older OS - linux

I'm getting the following when running my closed-source app on target machine which uses older OS than mine:
./myapp: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./myapp)
./myapp: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ./myapp)
./myapp: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./myapp)
Is there any way to lower required libstdc and libstdc++ versions or bypass this check at all without moving my build server to older OS (which I find very frustrating), as well as without statical linking against libstdc (which seems to be prohibited by license)?
I have already checked Linking against an old version of libc to provide greater application coverage, but this only explains how to do that for some specifical symbol, while I need to do that for every symbol imported by my app from glibc.

To avoid these undefined symbols, you really have to compile with a different GCC version.
If you do not want to downgrade to a historic GCC version, several distributions now offer newer GCC versions for older distributions, such as SUSE with the Toolchain Module and Red Hat with Developer Toolset. These compilers provider a compatible ABI, so integration with the operating system is relatively painless.

Related

how to load the py plugin in DolphinDB

reported error message when i load the py plugin in DolphinDB,
here is my code below:
loadPlugin("/home/jwu/DolphinDB/DolphinDB_Linux64_V1.30.3/server/plugins/py/PluginPy.txt");
and error message here:
Couldn't load the dynamic library [plugins/py/libPluginPy.so]: ./libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by plugins/py/libPluginPy.so)
why
This is because the glibc version of the Linux system is too low, but the plug-in is compiled with a higher version of glibc. So you need to upgrade the glibc.

uwsgi: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55

I got this error when I ran sentry run web.
I am confused about it and tried a lot of things, such as:
https://stackoverflow.com/questions/20357033/how-to-fix-program-name-usr-lib-x86-64-linux-gnu-libstdc-so-6-version-cxx,
and
https://stackoverflow.com/questions/35392310/error-building-gcc-4-8-3-from-source-libstdc-so-6-version-cxxabi-1-3-8-not.
But it didn't work for me. The problem is still there:
uwsgi: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55)
My system runs Ubuntu 16.04.
How to solve this problem? Please help me.
From: https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_install
If you already have an older version of libstdc++ installed then the error might look like one of the following instead:
./a.out: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found
./a.out: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.8' not found
This means the linker found /usr/lib/libstdc++.so.6 but that library belongs to an older version of GCC than was used to compile and link the program a.out (or some part of it).
The gcc dynamic linker needs the new path to the newer library:
export LD_LIBRARY_PATH=${prefix}/lib:$LD_LIBRARY_PATH
i.e.:
export LD_LIBRARY_PATH=/usr/lib64/:$LD_LIBRARY_PATH
(depending on your system you may need /usr/lib/)
Find the path:
locate libstdc++.so.6
in summary: the gcc dynamic linker searches a list of preconfigured directories as described: https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_install
The shared library libstdc++.so.6 is already there we just have to point the linker to the correct location.

version `GLIBC_2.11' not found while using gcc

I have problem using gcc/g++ after I changed the machine I use,
I installed gcc-4.9.2 in my previous machine, when I moved to the new machine, I copied gcc folder to the new machine.
When I try to use I get this error :
/data/obenchek/gcc-4.9.2/bin/g++: /lib64/libc.so.6: version `GLIBC_2.11' not found (required by /data/obenchek/gcc-4.9.2/bin/g++)
I have already checked this question :
`GLIBC_2.11' not found
If it says right, the version of libc and g++ are not compatible , libc version :
/lib/libc.so.6
GNU C Library stable release version 2.4 (20090904), by Roland McGrath et al.
...
So I should reinstall gcc completely or there is a easier way to resolve this ??
I copied gcc folder to the new machine.
That's your problem: don't copy, install appropriate GCC package instead.
Most UNIX systems, including Linux, guarantee backward compatibility: a binary compiled on an older system continues to run on a newer one.
The reverse is not true: a binary compiled on a newer system often will not run on an older one. This is working "as designed".
In this particular instance, you copied GCC compiled with GLIBC-2.11 or newer to a machine that has GLIBC-2.10 or older. And that doesn't work.

Failure building Rust on linux with glibc 2.5

I am trying to build Rust for RHEL5 (Linux v2.6.18) with GNU C Library stable release version 2.5.
The pre-built bootstrap version of Rust, that is downloaded automatically when running the Rust make, is incompatible with glibc 2.5 -- I get the following error.
x86_64-unknown-linux-gnu/stage0/bin/rustc: /lib64/libc.so.6: version GLIBC_2.7' not found (required by x86_64-unknown-linux-gnu/stage0/bin/rustc)
x86_64-unknown-linux-gnu/stage0/bin/rustc: /lib64/libc.so.6: versionGLIBC_2.6' not found (required by x86_64-unknown-linux-gnu/stage0/bin/rustc)
Unfortunately, upgrading glibc is not an option for the target OS
Is there any way for me to build Rust on my platform?
You’ll need to build a newer copy of gcc and glibc first. Don’t worry, you can use it only for Rust stuff (stick it in a different directory and add that directory to LD_LIBRARY_PATH whenever running Rust things), but it does need some newer stuff.

/lib/libc.so.6: version `GLIBC_2.9' not found error while installing Qt5 on Linux

I am trying to install Qt5 on Linux but I get this errors:
[root#localhost Desktop]# ./qt-linux-opensource-1.4.0-x86-online.run
./qt-linux-opensource-1.4.0-x86-online.run: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./qt-linux-opensource-1.4.0-x86-online.run)
./qt-linux-opensource-1.4.0-x86-online.run: /lib/libc.so.6: version `GLIBC_2.9' not foundc (required by ./qt-linux-opensource-1.4.0-x86-online.run)
./qt-linux-opensource-1.4.0-x86-online.run: /lib/libc.so.6: version `GLIBC_2.10' not found (required by ./qt-linux-opensource-1.4.0-x86-online.run)
./qt-linux-opensource-1.4.0-x86-online.run: /lib/libc.so.6: version `GLIBC_2.11' not found (required by ./qt-linux-opensource-1.4.0-x86-online.run)
./qt-linux-opensource-1.4.0-x86-online.run: /lib/libc.so.6: version `GLIBC_2.7' not found (required by ./qt-linux-opensource-1.4.0-x86-online.run)
I installed this file http://download.opensuse.org/repositories/devel:/gcc/SLE-10_SDK/i586/libstdc++44-4.4.2_20100116-28.1.i586.rpm and /usr/lib/libstdc++.so.6: version GLIBCXX_3.4.11' not found error gone. But how can I fix others?
Your operating system is not officially supported. Given that, I think trying to use a pre-built binary is a fool's errand. Your best bet is building Qt 5 from source... and even then your system libraries might be too old.
I know it's possible to build Qt5 on RHEL6, and I know it's pretty much impossible on RHEL5. RHEL5 is based on Fedora 6, and RHEL6 is based on Fedora 12/13.
Fedora 7 falls in between the two, but is definitely closer to the wrong end of the scale. The primary question is what version of gstreamer you have. To build Qt Multimedia, you require gstreamer >=0.10.24. If you have that, you have at least some chance of making it work.
Don't mess with the system libraries -- just upgrade your distribution. Glibc 2.11 has been released in 2009, that's four years ago.

Resources