[odb-users] Cross-compiling issue with ODB source code

Boris Kolpackov boris at codesynthesis.com
Fri Dec 30 01:57:27 EST 2016

Hi Wayne,

Wayne Zhang <zwmosquito at 126.com> writes:

> [...] Redhat with gcc 4.1.2, very old but I don't have root access to
> upgrade it.

BTW, the recommended way to do this on RedHat/CentOS is to install Developer
Tools (which include newer version of GCC) and use that to either build the
ODB compiler or get the pre-built packages from EPEL.

> odb: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by odb)
> [...]
> After trying in many ways ( passing "-static-libstdc++ -static-libgcc"
> to LDFLAGS, or hardcode "-Wl,-rpath" with Ubuntu libstdc++.so.6 in
> odb/libtool ) [...]

Linking statically to libstdc++ and libgcc generally helps but in your
case you have a libc incompatibility. Linking statically to libc is a bad

> I notice that odb executable and odb plugin "odb.so" in official release ( odb-2.4.0-x86_64-linux-gnu.tar.bz2 ) work quite perfectly on that
> Redhat server. [...]
> May I ask how did you do that?

To achieve this we build these packages on a very old Debian distribution
(Sarge). We link statically to libstdc++ and libgcc but not libc.

Also note that if you go this route you will have to ship the entire GCC
installation since the ODB plugin will only work with the version of GCC
it was built with. In other words, you cannot build it with GCC 4.8 and
then expect it to work with GCC 4.7 or 4.9.

One thing you could try is use GCC from the official ODB package for RH
to build a newer ODB compiler directly on RH.


More information about the odb-users mailing list