compile a binary with statically linked openssl 1.0.1e but dynamically linked glibc, stdc++, etc. Binary should run on most servers, for example Ubuntu 11.04 or RHEL 6, CentOS 6.4.
code I want to compile depends on openssl 1.0.1e. Openssl 1.0.1e depends on glibc found in newer versions of Ubuntu (like 12.04, glibc 2.13) and doesn't compile against the one found in Ubuntu 11.04.
The binary compiled on Ubuntu 12.04 fails to run on Ubuntu 11.04 with error message:
$BINARY: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by $BINARY)
How can I compile my binary so it runs on old Ubuntus and RHEL6, CentOS 6.4?