Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-20-2007, 11:31 AM   #1
LQ Newbie
Registered: Aug 2005
Posts: 3

Rep: Reputation: 0
building 32bit app on 64bit system

I would like to build some libraries and apps in 32bit on AMD 64bit. If that is possible what would be general procedure (options for configure script or/and gcc)?

More specific question is how to build 32bit ALSA libraries on my Suse 10.2 64bit?
Also how to build 32bit libsigc2.0 on same system?


Old 07-20-2007, 01:10 PM   #2
ReliaFree Maintainer
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,812
Blog Entries: 1

Rep: Reputation: 259Reputation: 259Reputation: 259
First, you have to have a tool chain that was built with multilib support. Since x86_64 is a multilib architecture (i.e., there is no such thing as a pure 32-bit or pure 64-bit x86_64), you should have this. Second, you will need 32-bit versions of any dependencies that you need to link against. Finally, you need to pass the -m32 flag to gcc when you build the package to create a 32-bit library or binary.

I set four environment variables. BUILD32 and BUILD64 are the gcc options. Here is the difference:
116 procs - 35 files(38M bytes) - /home/weibullguy/reliafree/source
weibullguy@weibullone for 163D11h32m $ echo $BUILD32
-m32 -mtune=athlon64 -march=athlon64 -O2 -pipe -combine

116 procs - 35 files(38M bytes) - /home/weibullguy/reliafree/source
weibullguy@weibullone for 163D11h32m $ echo $BUILD64
-m64 -mtune=athlon64 -march=athlon64 -O2 -pipe -combine
PKG_CONFIG_PATH32 and PKG_CONFIG_PATH64 are the paths for pkg-config to search for 32- an 64-bit meta files respectively. Here is the difference:
116 procs - 35 files(38M bytes) - /home/weibullguy/reliafree/source
weibullguy@weibullone for 163D11h32m $ echo $PKG_CONFIG_PATH32

116 procs - 35 files(38M bytes) - /home/weibullguy/reliafree/source
weibullguy@weibullone for 163D11h32m $ echo $PKG_CONFIG_PATH64
In general, when I configure a package, I use these to set the appropriate environment
CC="gcc ${BUILD32} PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" ./configure --blah --blah --blah
Then (usually) make and make install. Specifically for ALSA, it would be like this for the 32-bit libraries
CC="gcc ${BUILD32}" ./configure &&
make &&
su -c 'make install'
And like this for the 64-bit libraries
CC="gcc ${BUILD64}" ./configure --libdir=/usr/lib64 &&
make &&
su -c 'make install'
The 32-bit libsigc would be built like this
CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" ./configure --prefix=/usr &&
make &&
su -c 'make install'
Keep in mind that on a standards-compliant x86_64 system, 32-bit libraries live in the /lib directories while 64-bit libraries live in the /lib64 directories.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running LimeWire 32bit on a 64bit System? BiPolarPenguin Linux - Software 9 12-07-2006 12:07 PM
how do i know if system is 32bit or 64bit? greythorne SUSE / openSUSE 5 09-15-2005 08:56 AM
can 64bit processor run both 64bit and 32bit computers? DJOtaku Linux - General 4 09-08-2005 08:14 PM
32bit on 64bit paralysis Linux From Scratch 2 06-02-2005 03:19 PM
32Bit or 64Bit? bchivers Mandriva 9 05-22-2005 12:28 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration