[CentOS] Generate 32bit programs on x86_64 architecture?

Aleksandar Milivojevic

alex at milivojevic.org
Thu Nov 17 04:48:46 UTC 2005


Michael Ubell wrote:
> I'm trying to run purify on CentOS on an Intel Pentium 4/630
> processor.  Purify does not like the 64bit code.  Is there
> some way to compile and run programs so that they are
> only using the 32 bit model?
> 
> I tried gcc -m32 but then the system libraries come
> up missing.

Yup, -m32 is the correct option.  What you are missing are 32-bit 
development packages.  Check for and install (and I mean install, not 
update, you want to have both i386 and x86_64 development packages) i386 
versions of glibc-devel and libgcc.  Depending on what you are trying to 
compile, you might need other i386 development packages.  As you'll 
notice, x86_64 distribution contains both i386 and x86_64 versions of 
almost all libraries, however only i386 runtime gets installed by 
default, you must add development parts for i386 manually.  For example, 
to compile C++ stuff, you'll need i386 libstdc++-devel.  Esiest way to 
find out what you need to install is to locate 64-bit version of library 
that you probably already have installed, and then do for example rpm 
-qf /usr/lib64/libwhatever.so and see what package it belongs to 
(probably whatever-devel), and install i386 version of it.



More information about the CentOS mailing list