blueberryfields
blueberryfields

Reputation: 50328

Is it possible to compile a 64 bit executable on a 32 bit system under Ubuntu?

And, if it is possible, can you please point me to an example of this?

Upvotes: 0

Views: 148

Answers (2)

user571138
user571138

Reputation:

What you are looking for is cross compilation. http://en.wikipedia.org/wiki/Cross_compiler#GCC_and_cross_compilation

As Tomas said, you need the libs of the target machine installed and assuming you are using gcc you will need to use the "-b machine" option, and probably a few other options also (man gcc, and spend a lot of time reading!).

This can be a real pain to get right, so i would ask whether it is really necessary?

Upvotes: 2

Tomas
Tomas

Reputation: 340

No, it isn't possible because you need specific x86_64 libraries that can't be used in a 32 bit system.

Believe it or not, you can build 32 bit binaries in a 64 bit system.

You should check this https://wiki.archlinux.org/index.php/Arch64_FAQ#Can_I_build_32-bit_packages_for_i686_inside_Arch64.3F and http://www.linuxquestions.org/questions/linux-hardware-18/compiling-64-bit-kernel-in-32-bit-linux-240183/

Is not ubuntu specific, but is similar.

Upvotes: -1

Related Questions