By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,120 Members | 1,799 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,120 IT Pros & Developers. It's quick & easy.

How to compile 32 bit application on 64 bit machine?

P: n/a
Hello All,

I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.
Can somebody tell me how I can compile a .c file for 32 bit on a 64
bit machine.

Thanks in advance
-Vittal
Nov 13 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Vittal <vs*********@yahoo.com> wrote:
Hello All,

I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.
Can somebody tell me how I can compile a .c file for 32 bit on a 64
bit machine.


Wrong newsgroup! Post in a group that discusses programming on your
platform/system or even the GNU compiler collection (gnu.gcc).
--
Z (Zo**********@daimlerchrysler.com)
"LISP is worth learning for the profound enlightenment experience
you will have when you finally get it; that experience will make you
a better programmer for the rest of your days." -- Eric S. Raymond
Nov 13 '05 #2

P: n/a
On 10 Jul 2003 23:07:50 -0700,
Vittal <vs*********@yahoo.com> wrote:
Hello All,

I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.


The newsgroup comp.lang.c is for the discussion of the C language; not
for discussion of compiler options. You should probably ask your
question on gnu.gcc.help, where people discuss gcc.

Martien
--
|
Martien Verbruggen | We are born naked, wet and hungry. Then
| things get worse.
|
Nov 13 '05 #3

P: n/a
vs*********@yahoo.com (Vittal) wrote in message news:<f9**************************@posting.google. com>...
Hello All,

I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.
Can somebody tell me how I can compile a .c file for 32 bit on a 64
bit machine.


Off topic. Probably some compiler option - a switch or a pragma or
something. What does your documentation say?
Nov 13 '05 #4

P: n/a
In <f9**************************@posting.google.com > vs*********@yahoo.com (Vittal) writes:
I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.
Can somebody tell me how I can compile a .c file for 32 bit on a 64
bit machine.


Without knowing what 64-bit Linux machine you have (Alpha, SPARC, Itanium,
whatever) there is no meaningful way of answering your question. On some
platforms, it's simply a matter of choosing the sizes of certain C types
and using the appropriate libraries, on others, a second gcc installation
is needed, because a completely different instruction set must be used
in the generated code (e.g. on Itanium).

Go to a newsgroup dedicated to Linux on your hardware platform: it is the
only place on Usenet that can provide the information you're looking for.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 13 '05 #5

P: n/a
Sorry for dragging you all to a off topic and thanks for redirecting
me to a correct group.

Thanks
-Vittal
Martien Verbruggen <mg**@tradingpost.com.au> wrote in message news:<sl*****************@martien.heliotrope.home> ...
On 10 Jul 2003 23:07:50 -0700,
Vittal <vs*********@yahoo.com> wrote:
Hello All,

I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.


The newsgroup comp.lang.c is for the discussion of the C language; not
for discussion of compiler options. You should probably ask your
question on gnu.gcc.help, where people discuss gcc.

Martien

Nov 13 '05 #6

P: n/a
Sorry for not providing all details.

I am using Itanium Linux 64 bit machine and I have GCC 3.2.2 installed in it.

$ uname -a
Linux titanin 2.4.9-18smp #1 SMP Tue Dec 11 12:59:00 EST 2001 ia64 unknown

Any further help on this issue is greatly appreciated.

Thanks
-Vittal

Da*****@cern.ch (Dan Pop) wrote in message news:<be**********@sunnews.cern.ch>...
In <f9**************************@posting.google.com > vs*********@yahoo.com (Vittal) writes:
I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.
Can somebody tell me how I can compile a .c file for 32 bit on a 64
bit machine.


Without knowing what 64-bit Linux machine you have (Alpha, SPARC, Itanium,
whatever) there is no meaningful way of answering your question. On some
platforms, it's simply a matter of choosing the sizes of certain C types
and using the appropriate libraries, on others, a second gcc installation
is needed, because a completely different instruction set must be used
in the generated code (e.g. on Itanium).

Go to a newsgroup dedicated to Linux on your hardware platform: it is the
only place on Usenet that can provide the information you're looking for.

Dan

Nov 13 '05 #7

P: n/a
Vittal wrote:
Sorry for not providing all details.

I am using Itanium Linux 64 bit machine and I have GCC 3.2.2 installed in it.

$ uname -a
Linux titanin 2.4.9-18smp #1 SMP Tue Dec 11 12:59:00 EST 2001 ia64 unknown

Any further help on this issue is greatly appreciated.


Hmm? ia64 is a superset of ia32 is it not? So to compile ia32 just use
"-march=i386" when you build. E.g.

gcc -march=i386 foo.c -o foo

Not having access to a ia64 port of GCC I can't say if this will work
but if it truly is a superset than logically GCC for ia64 should be able
to limit itself to ia32 [via -march].

Failing that you could always build a cross-compiler [see the gcc folks
for info on doing that].

Tom

Nov 13 '05 #8

P: n/a
In article <cO********************@news02.bloor.is.net.cable. rogers.com>,
to********@iahu.ca says...
I am using Itanium Linux 64 bit machine and I have GCC 3.2.2 installed in it.

$ uname -a
Linux titanin 2.4.9-18smp #1 SMP Tue Dec 11 12:59:00 EST 2001 ia64 unknown

Any further help on this issue is greatly appreciated.


Hmm? ia64 is a superset of ia32 is it not?


Not even close. Opteron is a much closer match to your description than
Itanium ever hoped to be. This is a prime example of why answering
OT questions is a bad idea. This and everything downstream is bogus.

--
Randy Howard
(remove the obvious bits from my address to reply.)
"Most of the drivers nowadays are a bit like Eddie Irvine, who if
he was half as fast as he thought he was, would be moderate."
-- Sir Stirling Moss
Nov 13 '05 #9

P: n/a
Randy Howard wrote:
In article <cO********************@news02.bloor.is.net.cable. rogers.com>,
to********@iahu.ca says...
I am using Itanium Linux 64 bit machine and I have GCC 3.2.2 installed in it.

$ uname -a
Linux titanin 2.4.9-18smp #1 SMP Tue Dec 11 12:59:00 EST 2001 ia64 unknown

Any further help on this issue is greatly appreciated.


Hmm? ia64 is a superset of ia32 is it not?

Not even close. Opteron is a much closer match to your description than
Itanium ever hoped to be. This is a prime example of why answering
OT questions is a bad idea. This and everything downstream is bogus.


My last suggestion was valid. A cross-compiler would natively target
the ia32.

And in the meantime AMD r0x0rz

Lameass second-hand 64-bit processors.... I'll stick with my thermal
nuclear XP 2400+ thank ya :-)

Tom

Nov 13 '05 #10

P: n/a
> we don't care, its not a C question. its an implementation question.
Than guiding correctly some guys are very much showing how much genious they are...
May be its not C question.If not interested just don't answer, just ignore...!!

'Words' reflect your attitude.

-Calvin
Mark McIntyre <ma**********@spamcop.net> wrote in message news:<dd********************************@4ax.com>. ..
On 14 Jul 2003 11:24:40 -0700, in comp.lang.c , vs*********@yahoo.com
(Vittal) wrote:
Sorry for not providing all details.


Are you also sorry for
a) top posting
b) not READING Dan's quite correct response:

" Go to a newsgroup dedicated to Linux on your hardware platform: it
is the only place on Usenet that can provide the information you're
looking for."
I am using Itanium Linux 64 bit machine and I have GCC 3.2.2 installed in it.


we don't care, its not a C question. its an implementation question.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Nov 13 '05 #11

P: n/a
On 15 Jul 2003 03:04:35 -0700, in comp.lang.c ,
un*********@rediffmail.com (Unix Calvin) wrote:

(quoting me, and inexplicably also including my entire post lower
down)
we don't care, its not a C question. its an implementation question.
Than guiding correctly some guys are very much showing how much genious they are...
Not sure what you're trying to say here, but in my post I pointed out
that you had already been redirected to the right place, and that
you'd ignored that redirection. Thats rude
May be its not C question.If not interested just don't answer, just ignore...!!
Whether I'm interested or not is irrelevant. The point is, you posted
in the wrong place, I advised you of that, which I believe is the
correct thing to do. Otherwise you'd just keep asking and asking.
'Words' reflect your attitude.


Perhaps you should consider that you posted 'words' yourself, even
after twice being advised you were in the wrong place.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 13 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.