Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Correct Way to build 32bit applications under Gentoo/AMD64??
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
crquan
n00b
n00b


Joined: 12 Oct 2007
Posts: 12
Location: Singapore

PostPosted: Tue Jan 05, 2010 5:29 am    Post subject: Correct Way to build 32bit applications under Gentoo/AMD64?? Reply with quote

what is the correct way to build 32bit applications under Gentoo/AMD64? (it seems the subject line has a maxlength limit)

yes, I'm using Gentoo/AMD64 as a developing environment, in a university for software research, sometimes I need to compile both 32bit and 64bit versions of an application, I write in the Makefile is:

Code:
gcc -m64 ...
gcc -m32 ...


I've already used multilib glibc&gcc, I know the normal gcc without any switch will generate 64bit versions, but how to do 32bit? I'm thinking of add extra "-m32" should do, but sometimes it doesn't, prompted header files missing or other strange errors, so what is a correct way to make a 32bit application?

Thanks,
_________________
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
Back to top
View user's profile Send private message
EzInKy
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1742
Location: Kentucky

PostPosted: Tue Jan 05, 2010 6:55 am    Post subject: Reply with quote

Cross compiling is, as you are obviously aware, possible. The surest way to create binaries that you will be certain of behaving properly in a 32bit environment though is to compile them on a 32bit system, and chroot is the perfect tool to accomplish this task with minimal fuss.
_________________
Time is what keeps everything from happening all at once.
Back to top
View user's profile Send private message
SLBMEH
Apprentice
Apprentice


Joined: 16 Aug 2003
Posts: 299
Location: Pittsburgh, PA

PostPosted: Tue Jan 05, 2010 2:22 pm    Post subject: Reply with quote

In the Arch Specific Notes chapter of the Dev Manual there is a Multilib on AMD64 section that talks about compiling 32 bit in a 64 bit env. Pretty much just as you mentioned with the 32 bit emul libs as well. It's always worked fine for me, but I normally have a chroot env set up as previously mentioned for my development projects.
_________________
Steve - Semper Fi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum