What must be recompiled to run a x32 ABI application?
Asked Answered
T

1

7

Can I compile an application with the new x32 ABI, and then run it in a normal kernel? What about the runtime C library? Is there any form of interoperability with precompiled x86/x86_64 libraries?

Tense answered 27/4, 2013 at 13:27 Comment(0)
H
5

Nope. x32 needs its own set of libraries, just like x86 and x86-64 do. Just like you cannot run x86 binaries on systems that only provide x86-64 libs, x32 binaries won't work on systems providing only x86 and/or x86-64 libraries. Like x86 and x86-64, x32 is its own architecture.

Support must also be enabled in the kernel, of course. A kernel that was built without x32 support enabled won't be able to run x32 binaries.

Heresy answered 27/4, 2013 at 14:33 Comment(4)
But you can have your x86-64, x86 and x32 libraries all existing side-by-side though, right? Just as a 64/32 bit user space will have the directories /lib32, /lib64, /usr/lib32, /usr/lib64, etc? Thanks!Desmonddesmoulins
@DanielSantos Yes. It's an architecture just like the other two. I'd wager that on a multilib system, the libs would be in /usr/libx32, unless the system's native arch is actual x32, in which case they could be in /usr/lib.Heresy
If system has x86-64 and x32 libraries, how does it decide which to use? Do you have to recompile all applications to use x32 libraries to save RAM?Berndt
@Berndt Yes. This is determined at compile and link time. With GCC, the option that selects this is "-m". "-m32" uses x86, "-m64" uses x86-64, and "-mx32" uses x32.Heresy

© 2022 - 2024 — McMap. All rights reserved.