![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Gentoo Gentoo Linux is a versatile and fast, completely free Linux distribution geared towards developers and network professionals. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SCO 5.0.6 application compatibility w/ Linux? | stay0ut | SCO | 8 | 05-02-2008 12:42 PM |
| confused X86_64 and AIX | eternalflame | Linux | 2 | 04-03-2008 04:21 AM |
| LD_PRELOAD on x86_64 gives error from ld.so | Manish Mukherje | Linux | 0 | 03-22-2008 04:48 PM |
| Compiling Apple Top on Linux | blahblah | Linux | 0 | 05-24-2005 02:21 PM |
| compiling linux driver to run on HPUX | hilbi | HP-UX | 4 | 11-07-2002 10:54 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
compiling 32 bit application on 64 bit linux(x86_64)
hi all,
i have a 64 bit linux machine. $uname -a Linux SVRDELLD30 2.6.9-42.ELsmp #1 SMP Tue Aug 15 10:35:26 BST 2006 x86_64 x86_64 x86_64 GNU/Linux here by default gcc creates 64 bit executable. but for some reason i want to create 32bit executable. first i want to create 32 bit object files(.o files) and then i want to link those object files. Please suggest me suitable gcc options. Thanks and Regards, uttam hoode |
|
||||
|
Just for the sake of saying so: You know you shouldn't be installing from source on RPM based distros, right? The proper way to do this for them is to create RPMs. If you're going to be running them on multiple platforms, just create a src.rpm, then "rpmbuild --rebuild thepackage" on each platform you need, or "rpmbuild --rebuild --target i386 thepackage" from your 64-bit system.
Next, why would you want to create 32-bit objects on a 64-bit platform? Wouldn't it make more sense to create them on a 32-bit platform? If you don't want to go through the hassle of setting up a 32 bit system, just use the installation CD for Gentoo as that should have everything you need. Also, if you're going to insist on installing things from source, I'd recommend you just go ahead and switch to Gentoo anyway. To answer your question: Doesn't gcc create 32-bit when you do "--target=i386"? |
|
||||
|
Quote:
I've generally found that compilers on 64 bit systems build 32 bit code by default and require additional switches to produce 64 bit code. The linkers are normally able to work out what memory model the code is and will reject attempts to link code with differing models. |
|
||||
|
The gcc switch "-m32" can be used to generate 32-bit object files.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|