public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Error: suffix or operands invalid for `push'" on 64bit boxes
@ 2009-04-08 15:08 Riccardo FABBRIS
  2009-04-08 15:12 ` dan hitt
  2009-04-08 15:42 ` Bob Plantz
  0 siblings, 2 replies; 5+ messages in thread
From: Riccardo FABBRIS @ 2009-04-08 15:08 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

Hi all,
I'm newbie with programming and compiling and I need a help.
I had an error pretty common (the one written as object) installing a program on a computer, but, with the same compiler (gcc-4.1) and using the same process I didn't had it on a previous computer.
Looking on forums I understood is a problem of gcc 64 bits.
How can I change my compiler to 32 bits?
Thanks everybody
Riccardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error: suffix or operands invalid for `push'" on 64bit boxes
  2009-04-08 15:08 Error: suffix or operands invalid for `push'" on 64bit boxes Riccardo FABBRIS
@ 2009-04-08 15:12 ` dan hitt
  2009-04-08 15:42 ` Bob Plantz
  1 sibling, 0 replies; 5+ messages in thread
From: dan hitt @ 2009-04-08 15:12 UTC (permalink / raw)
  To: Riccardo FABBRIS; +Cc: gcc-help

Hi Riccardo,

It's probably useful if you specify the computer you are using
(GNU/Linux, mac, windows).

And i bet you have to install a new compiler which is built
to produce 32-bit binaries but in my amazing ignorance i don't
know if this kind of output can be controlled by a flag.

dan

On Wed, Apr 8, 2009 at 8:08 AM, Riccardo FABBRIS
<riccardo.fabbris@studenti.unipd.it> wrote:
> Hi all,
> I'm newbie with programming and compiling and I need a help.
> I had an error pretty common (the one written as object) installing a program on a computer, but, with the same compiler (gcc-4.1) and using the same process I didn't had it on a previous computer.
> Looking on forums I understood is a problem of gcc 64 bits.
> How can I change my compiler to 32 bits?
> Thanks everybody
> Riccardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error: suffix or operands invalid for `push'" on 64bit boxes
  2009-04-08 15:08 Error: suffix or operands invalid for `push'" on 64bit boxes Riccardo FABBRIS
  2009-04-08 15:12 ` dan hitt
@ 2009-04-08 15:42 ` Bob Plantz
  2009-04-08 16:09   ` Error: suffix or operands invalid for `push' Riccardo FABBRIS
  1 sibling, 1 reply; 5+ messages in thread
From: Bob Plantz @ 2009-04-08 15:42 UTC (permalink / raw)
  To: Riccardo FABBRIS; +Cc: gcc-help

Assuming that you are using an x86-64 processor, try the -m32 option for
gcc.

Bob


On Wed, 2009-04-08 at 17:08 +0200, Riccardo FABBRIS wrote:
> Hi all,
> I'm newbie with programming and compiling and I need a help.
> I had an error pretty common (the one written as object) installing a program on a computer, but, with the same compiler (gcc-4.1) and using the same process I didn't had it on a previous computer.
> Looking on forums I understood is a problem of gcc 64 bits.
> How can I change my compiler to 32 bits?
> Thanks everybody
> Riccardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error: suffix or operands invalid for `push'
  2009-04-08 15:42 ` Bob Plantz
@ 2009-04-08 16:09   ` Riccardo FABBRIS
  2009-04-08 17:27     ` Bob Plantz
  0 siblings, 1 reply; 5+ messages in thread
From: Riccardo FABBRIS @ 2009-04-08 16:09 UTC (permalink / raw)
  To: Bob Plantz; +Cc: gcc-help

[-- Attachment #1: Type: text/plain, Size: 956 bytes --]

Hi Bob,
First of all thanks for replying,
Yes, I'm using a x86-64 processor.
As said before I'm pretty ignorant: if I had to write
make
how would my command become? Do I have to change the makefile?
I tried to change
CC := gcc
with
CC:= gcc -m32
but it still not work.
Thanks and sorry my ignorance,
Riccardo

On Wed, 08 Apr 2009 08:42:20 -0700, Bob Plantz said:
> 
> Assuming that you are using an x86-64 processor, try the -m32 option for
> gcc.
> 
> Bob
> 
> 
> On Wed, 2009-04-08 at 17:08 +0200, Riccardo FABBRIS wrote:
> > Hi all,
> > I'm newbie with programming and compiling and I need a help.
> > I had an error pretty common (the one written as object) installing a 
> program on a computer, but, with the same compiler (gcc-4.1) and using the 
> same process I didn't had it on a previous computer.
> > Looking on forums I understood is a problem of gcc 64 bits.
> > How can I change my compiler to 32 bits?
> > Thanks everybody
> > Riccardo
> 
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error: suffix or operands invalid for `push'
  2009-04-08 16:09   ` Error: suffix or operands invalid for `push' Riccardo FABBRIS
@ 2009-04-08 17:27     ` Bob Plantz
  0 siblings, 0 replies; 5+ messages in thread
From: Bob Plantz @ 2009-04-08 17:27 UTC (permalink / raw)
  To: Riccardo FABBRIS; +Cc: gcc-help

Oops, I think I gave an incomplete answer. I did not read the original
problem carefully.

If the 'push' instruction gives an error message, I suspect that the
program has some assembly language code in it. Otherwise, the compiler
would generate the correct sizes (32-bit or 64-bit).

If there is some assembly language, and it is written for  32-bit, it
would have to be changed to 64-bit. I am guessing that you do not want
to do that.

So, I will assume that you want to create a 32-bit program.

The '-m32' option for gcc will tell the compiler to generate 32-bit
code.

There are a couple of possibilities to cause the assembler to do 32-bit.

1. Look in your make file for an 'as' command. That is how the assembler
it invoked. The option to cause 'as' to do 32-bit is '--32'. (Yes, there
are two dashes here.)

2. If the assembly language is embedded in C/C++ code, or it's in a '.s'
file, gcc will pass it on to the assembler. You then have to tell gcc to
pass the '--32' option on to the assembler. You do that with the gcc
option 'Wa,--32'. The 'Wa' tells gcc that you have an option for the
assembler. You need to follow that with a comma and then the option,
with no spaces.

So I think you need to both (a) give gcc the -m32 option, and (b) give
the assembler the '--32' option.

Warning: This still may not work. Your installation also needs to have
the proper 32-bit libraries installed. But if they are not installed,
the errors should come during the linking phase.

Bob


On Wed, 2009-04-08 at 18:09 +0200, Riccardo FABBRIS wrote:
> Hi Bob,
> First of all thanks for replying,
> Yes, I'm using a x86-64 processor.
> As said before I'm pretty ignorant: if I had to write
> make
> how would my command become? Do I have to change the makefile?
> I tried to change
> CC := gcc
> with
> CC:= gcc -m32
> but it still not work.
> Thanks and sorry my ignorance,
> Riccardo
> 
> On Wed, 08 Apr 2009 08:42:20 -0700, Bob Plantz said:
> > 
> > Assuming that you are using an x86-64 processor, try the -m32 option for
> > gcc.
> > 
> > Bob
> > 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-08 17:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-08 15:08 Error: suffix or operands invalid for `push'" on 64bit boxes Riccardo FABBRIS
2009-04-08 15:12 ` dan hitt
2009-04-08 15:42 ` Bob Plantz
2009-04-08 16:09   ` Error: suffix or operands invalid for `push' Riccardo FABBRIS
2009-04-08 17:27     ` Bob Plantz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).