34

Specifically:

  1. Is it assured somehow that all versions of glibc 2.x are binary compatible?

  2. If not, how can I run a binary (game) on my system which has been compiled for a different version? Can I install glibc in a different folder?

My specific problem is the compatibility between glibc 2.14 (what I have) and 2.15 (what the game wants).

I might also get a version for glibc 2.13 but I'm not sure if that will run on 2.14.

linuxbuild
  • 15,843
  • 6
  • 60
  • 87
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820

3 Answers3

34

In general, running binaries that were compiled for an older glibc version (e.g. 2.13) will run fine on a system with a newer glibc (e.g. 2.14, like your system).

Running a binary that was built for a newer glibc (e.g. 2.15, like the one that fails) on a system with an older glibc will probably not work.

In short, glibc is backward-compatible, not forward-compatible.

Kenneth Hoste
  • 2,816
  • 20
  • 14
24

There are only minor binary compatibility issues between glibc 2.14 and glibc 2.15 according to the report from the Linux upstream tracker.

The report is generated by the abi-compliance-checker and abi-tracker tools.

enter image description here

See also https://sourceware.org/glibc/wiki/Testing/ABI_checker.

linuxbuild
  • 15,843
  • 6
  • 60
  • 87
  • I don't understand the backward incompatibilities of glibc shown in ABI Laboratory reports. E.g., looking at [glibc 2.33 vs 2.34](https://abi-laboratory.pro/index.php?view=compat_report&l=glibc&v1=2.33&v2=2.34&obj=58466&kind=abi#Symbol_Problems_High), all high severity problems with symbols have to do with parameters being passed in some other register than before. When are they being passed in some other register? Aren't the System V ABI calling conventions always followed? – user_ Sep 21 '22 at 18:00
  • I also don't understand the medium severity issue. I interpret it as the function `__sched_cpucount` changing prototype, [but that doesn't seem true](https://elixir.bootlin.com/glibc/glibc-2.33/source/posix/bits/cpu-set.h#L117). What am I missing? – user_ Sep 21 '22 at 18:04
19

Please use ABI compliance checker for checking compatibility of libraries.

linuxbuild
  • 15,843
  • 6
  • 60
  • 87
BHS
  • 991
  • 3
  • 12
  • 26
  • This looks very interesting. Is there a way to generate the XML files automatically? – Aaron Digulla May 17 '13 at 10:02
  • @Aaron: In simple case, XML files contain only paths to shared objects and header files. And surely you can generate them automatically by a simple script. – linuxbuild May 20 '13 at 07:40
  • @Aaron: Also, you can use a template: `{RELPATH}/include/{RELPATH}/lib/` with additional options: `-vnum1`, `-vnum2`, `-relpath1` and `-relpath2`. – linuxbuild May 20 '13 at 07:43