DontKnow
DontKnow

Reputation: 393

Compiling with glibc and running kernel that compiled with eglibc

I am using an ARM embedded system (ARM9) that running an embedded linux kernel. The kernel was compile with GCC 4.5.x with the eglibc. Is there any harm running binary which are compiled code with GCC 4.8.x or newer which uses glibc.

I've read that you're not suppose to mix and match libc for stability reason. But as far as I understand they are both ABI compatible so they shouldn't be any problem.

Some of the code that I am using requires STD11 to compile correctly and thus I can't use GCC4.5.

Upvotes: 2

Views: 414

Answers (1)

Employed Russian
Employed Russian

Reputation: 213516

The kernel was compile with GCC 4.5.x with the eglibc

The kernel build doesn't use GLIBC, so it's completely irrelevant what libc was (not) used to build the kernel.

Is there any harm running binary which are compiled code with GCC 4.8.x or newer which uses glibc.

No.

What occurs when the binary links against libc? It was linked against glibc when cross compiling but will link against eglibc that in sysroot.

In general, GLIBC and EGLIBC guarantee backward compatibility: that is, a binary linked against GLIBC-x.y will run fine against any GLIBC not older than x.y.

And EGLIBC's deviation from GLIBC is quite minimal. EGLIBC allowed for certain features to be disabled. A binary linked against EGLIBC-x.y will run just fine if at runtime it finds GLIBC that is not older than x.y (GLIBC will have features that the binary will not use (IF EGLIBC did in fact disable some features), but that's usual anyway: it's rare for a binary to use every GLIBC interface.

Upvotes: 1

Related Questions