Re: Building an external x86_64 module from an x86 (32-bit) machine?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Randy,

> AFAIK, it's just a matter of having a 64-bit compiler available.
> Most 32-bit distros that I know of just have a 32-bit compiler available,
> so you would need a "cross-compiler" for 64-bit code generation on a
> 32-bit host, whereas on a 64-bit host, gcc can build 32-bit code or
> 64-bit code.  But I'm no expert on this.

In fact, with the x86 architecture, the same (recent) gcc compiler
and/or ld (both 32-bit or 64-bit binaries) support both 32-bit and
64-bit code generation and linking, without requiring a separate cross
compiling toolchain. I tracked that feature a few days ago to some
(two or three years old) welcome addition to the gcc toolchain.

All it takes is using the -m32 or -m64 parm, such as in
$ gcc -m64 -o nldplug64 main.c

At worst, it's just a matter of having the right includes and libs
available in the compile and link paths (compiling to 64-bit userland
from a 32-bit debian, adding the libc6-amd64.deb, libc6-dev-amd64.deb
and possibly g++4.4-multilib.deb packages might definitly help in that
matter). But the point is that x86 gcc and ld now inherently support
dual-bitness, no extra cross-compiler required.

OTOH, I think Arnaud is very right and there is something I didn't do
(and should have). I did the config, but didn't do any prepare, and
that looks like a very good clue.
I'll post the results back here if/when I find the right trick(s).  /PhA.
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux