public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bob Plantz <plantz@cds1.net>
To: Riccardo FABBRIS <riccardo.fabbris@studenti.unipd.it>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Error: suffix or operands invalid for `push'
Date: Wed, 08 Apr 2009 17:27:00 -0000	[thread overview]
Message-ID: <1239211601.6209.21.camel@bob-desktop.local> (raw)
In-Reply-To: <20090408160914.B71702B084@list.cineca.com>

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
> > 

  reply	other threads:[~2009-04-08 17:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]
2011-06-02 20:14 asura10
2011-06-02 20:26 ` Ian Lance Taylor
2011-06-02 20:32 ` asura10
2011-06-03  5:46   ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1239211601.6209.21.camel@bob-desktop.local \
    --to=plantz@cds1.net \
    --cc=gcc-help@gcc.gnu.org \
    --cc=riccardo.fabbris@studenti.unipd.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).