linux - How can I link to a specific glibc version? -


When I compile something on my Ubuntu Lucid 10.04 PC, then it is connected with glibc. Uses clear glibc 2.11. When I run this binary on another PC with an old PC, the command says that there is no glibc 2.11 ...

As far as I know the glibc uses the symbol version. Can I force the GCC to link against a specific symbol version?

In my concrete use, I try to compile a GCC cross toolchain for ARM.

You are correct that uses the glibc symbol version. If you are curious, then the symbol version implementation is described in glibc 2.1 and its description is an extension of Sun's symbol version scheme.

One option is to link your binary to a fixed link. This is probably the easiest option.

You can also create your binary in the Crown Build environment or glibc- new => glibc- old cross-compiler

According to the blog post, it is possible to have any symbol associated with the old, as long as it is the same .symver pseudo-session which is first The symbols used to define are given from the following example.

The following example uses the glibc realt, but it ensures that it is associated with the older version 2.2.5.

  #include & lt; Limits.h & gt; # Include & lt; Stdlib.h & gt; # Include & lt; Stdio.h & gt; __asm ​​__ ("Symver realpath, realpath @ gLIBC_2.2.5"); Int main () {char * unresolved = "/ lib64"; Four solutions [PATH_MAX + 1]; If (! Real path (unsolved, solved)) {return 1; } Printf ("% s \ n", solved); Return 0; }  

Comments