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?

phuclv
  • 37,963
  • 15
  • 156
  • 475
Lorenzo Pistone
  • 5,028
  • 3
  • 34
  • 65

1 Answers1

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.

Nikos C.
  • 50,738
  • 9
  • 71
  • 96
  • 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! – Daniel Santos Apr 27 '13 at 14:53
  • 2
    @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. – Nikos C. Apr 27 '13 at 15:50
  • 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? – jarno Jan 24 '16 at 13:26
  • @jarno 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. – Nikos C. Jan 25 '16 at 04:54