Cannot find crtn.o, linking 32 bit code on 64 bit system
You are not assembling, but linking an executable, which needs OS startup files.
It seems you don't have gcc-*-multilib
installed, which contains the necessary files: http://packages.ubuntu.com/oneiric/amd64/gcc-4.6-multilib/filelist
Building a 32-bit app in 64-bit Ubuntu
You need to use link with -m32
as well.
gcc -m32 -o xgap xcmds.o utils.o gapgraph.o gaptext.o pty.o popdial.o xgap.o selfile.o -L/usr/lib32 -lXaw -lXmu -lXt -lXext -lX11 -lSM -lICE
All things considered, I think you should be able to drop the -L/usr/lib32
when using -m32
.
How to Compile 32-bit Apps on 64-bit RHEL?
To get RHEL 7 64-bit to compile gcc 4.8 32-bit programs, you'll need to do two things.
Make sure all the 32-bit gcc 4.8 development tools are completely installed:
sudo yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 ncurses-devel.i686
Compile programs using the -m32 flag
gcc pgm.c -m32 -o pgm
How to make compiler generate a elf32-x86-64 format object file?
GCC will adjust the linker command line accordingly if you invoke it as gcc -mx32
. It is more than just a compiler flag.
Related Topics
Script to Get User That Has Process with Most Memory Usage
Escaping the Exclamation Point in Grep
How to Ask Bash for the Current Options
How to Install Rpy2 via Conda Using Default R Installation
Can Someone Explain the Shell Shock Bash Code
Sed: Matching on 2 Patterns on the Same Line
How to Display Filename from a Column Using Awk
How to Set a Non-Standard Baudrate on a Serial Port Device on Linux
How to Print Formatted HTML in Linux Server
Output Stdout and Stderr to File and Screen and Stderr to File in a Limited Environment
Simple Way to Get Filesize in X86 Assembly Language
Replace Line with Space and Backslash with a String Containing Spaces
Linking a Dynamically Linked Executable with Ld
Glassfish There Is a Process Already Using the Admin Port 4848
How to Delete Files Over (N) Days Old But Leave (N) Files Regardless of Age