General TC > Programming & Scripting - Unofficial

Gcc C compiling and linking for older kernel

(1/2) > >>

settimid:
Hi all!
I’m trying to set up an OpenSuse 15.4 (x64) as a cross-compiling machine for a C project.
Target(s) are tinycore, multiple versions: x86 and x64 from 3.8.4 to newest ones.

I managed to compile and run both 32bit and 64bit, static linked binary on the OpenSuse.
Runs smoothly on newer TC, but when I go to run the binary on the target machine with older tinycore 3.8 i get an error: FATAL: kernel too old

From what I understand the problem is that the glibc distributed with OpenSuse are too new, and are not compatible with the 2.6.33 kernel of the target system.
Does anyone know how to compile a binary that is compatible with an older kernel on OpenSuse? Can you point me in the right direction?

It's my first time with tc, I already find myself doing complicated things!

D.

settimid:
For who reads: there are more than one reason why I prefer to have a single recent Suse and cross-compile instead of multiple VMs, so at the moment I rule out the possibility of having several VMs to be able to compile with various kernels/glibc.

Juanito:
There is a configure switch “—enable-kernel=“ for glibc where you set the minimum kernel version to work with - I guess you will have to recompile glibc and set the appropriate kernel version.

curaga:
Replacing glibc on a big binary distro is usually trouble, the easiest path is for your host to have the oldest glibc you target.

settimid:
> Replacing glibc on a big binary distro is usually trouble

Yes, I've read this warn several times, and the route of re-compiling glibc on my build system doesn't seem the easiest!

>  the easiest path is for your host to have the oldest glibc you target.

A simply quick and dirty copy of /usr/lib/ folder from target, to /usr/lib-old/ of host build system, and my makefile pointing /usr/lib-old/libc.a etc etc when linking could be enough? If so, I'm very happy.

Navigation

[0] Message Index

[#] Next page

Go to full version