Public bug reported:

Binary package hint: gcc

Ubuntu's 64-bit platform is becoming more popular, especially with
software developers. It would be great if we could have a
"gcc-x86-32-cross" meta-package to ease the learning-curve of
discovering which libraries and tools need installing to build 32-bit
executables on the 64-bit architecture.

I've just gone through this and it took almost an hour of searching,
cross-referencing, and testing to be sure I'd got it sorted.

I need to do both kernel and user-space application cross-compilation
for x86 64- and 32-bit debugging. I'm still working on ensuring the
kernel build can be done both ways (64-bit on 32-bit, and 32-bit on
64-bit).

32-bit cross-compilation needs:

$ apt-get install ia32-libs lib32gcc1 lib32stdc++6 libc6-dev-i386 gcc-
multilib

And then use the gcc flag '-m32', either added to CCFLAGS in the
Makefile or directly:

$ gcc -m32 program.c -o program

$ file program
program: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for 
GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped

$ uname -m
x86_64

** Affects: gcc-4.1 (Ubuntu)
     Importance: Wishlist
         Status: New

** Changed in: gcc-4.1 (Ubuntu)
Sourcepackagename: gcc-defaults => gcc-4.1
   Importance: Undecided => Wishlist

-- 
[Wishlist] gcc-x86-32-cross compiler meta-package
https://bugs.launchpad.net/bugs/144311
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to