I'm trying to compile a 32-bit C application on RHEL 7 64-bit using gcc 4.8. I'm getting a compiler error /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
. What do I need to do to get 32 bit apps compiled and linked?
You can have 32bit userland running on a 64bit kernel, and install support for 64bit binaries.
Linux kernel supports chroot technology that allows to run 32-bit apps in an isolated environment (sandbox) inside a 64-bit OS.
So to install the 32-bit library, you have to use an IBM-provided installer script called ibm-yum.sh. If you are an external customer, then use the yum program. Get the ibm-yum.sh script and put it on any temp dir on your system, then use it as shown in the subsequent screenshot steps.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With