View previous topic :: View next topic |
Author |
Message |
crquan n00b
Joined: 12 Oct 2007 Posts: 12 Location: Singapore
|
Posted: Tue Jan 05, 2010 5:29 am Post subject: Correct Way to build 32bit applications under Gentoo/AMD64?? |
|
|
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 |
|
|
EzInKy Veteran
Joined: 11 Oct 2002 Posts: 1742 Location: Kentucky
|
Posted: Tue Jan 05, 2010 6:55 am Post subject: |
|
|
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 |
|
|
SLBMEH Apprentice
Joined: 16 Aug 2003 Posts: 299 Location: Pittsburgh, PA
|
Posted: Tue Jan 05, 2010 2:22 pm Post subject: |
|
|
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 |
|
|
|
|
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
|
|