Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Building for an outdated x86_64 Linux target machine
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
fabalthazar
n00b
n00b


Joined: 26 May 2015
Posts: 28
Location: France

PostPosted: Fri Nov 15, 2024 2:53 pm    Post subject: Building for an outdated x86_64 Linux target machine Reply with quote

Hi,

I am designing a C++ app to run on an outdated embedded Linux system (GCC 9, binutils 2.34, kernel 5.4, glibc 2.31) that I cannot change.

The app built with the up-to-date toolchain from my host PC refuses to run on the target because of Glibc versions incompatibilities.

My first approach was to generate a toolchain with crossdev with fixed outdated tools versions. This works quite good except the toolchain refuses to be multilib and I would like it to be.

Code:

$ sudo crossdev --portage "--buildpkg" --binutils "=2.34-r2" --gcc "=10.5.0" --kernel "=5.4-r2" --libc "=2.31-r7" --target x86_64-yocto231-linux-gnu


Another approach was to install specific tools in dedicated slots but glibc is not slotted...

Any advice for setting up such an "isolated" toolchain or dev environment?

Thanks!
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9612
Location: beyond the rim

PostPosted: Fri Nov 15, 2024 4:09 pm    Post subject: Reply with quote

The easiest option would probably be setup a full chroot that mirrors your target environment and build your app within that.

If glibc is the only issue that prevents you from using your regular toolchain then (in theory) you should be able to link against the symbols of the same version as your target glibc (see https://stackoverflow.com/questions/2856438/how-can-i-link-to-a-specific-glibc-version). However messing with symbol versioning usually results in total chaos in my experience as it basically only used by glibc and documentation/support is sparse.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum