Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-10-2008, 10:05 AM   #1
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit linux mint 17
Posts: 216

Rep: Reputation: 15
Question why get compiler error: suffix or operands invalid for 'push' (or 'pop')

I am trying to compile a program with the current 64-bit ubuntu (8.04.1 LTS) and current "ganymede" eclipse IDE/CDT (5.0), but it generates the following strange error message on every line with "pushl %ebp" or "popl %ebp":

suffix or operands invalid for 'push'
suffix or operands invalid for 'pop'

This exact project compiles and runs fine in 32-bit fedora8 with eclipse IDE/CDT (v3.3, I believe). I suspect the problem has something to do with me trying to compile a 32-bit application on a 64-bit system - even though I have added -m32 compiler switch to tell the build-tools to generate a 32-bit application. But I'm not sure.

Here are the important background facts. Any ideas? Note: I find this error reported many, many places on a search of the internet, but none of the first couple dozen links have suggested an answer - though they all seem to involve people with a 64-bit OS.


1: Every file in the project is identical, except whatever eclipse may have done when it imported the entire project.

2: I added a -m32 switch to the compilation process to make sure the compiler and build tools understand I am trying to generate a 32-bit application.

3: The original system that contained fedora8 + eclipse + this program was running on a different motherboard, but I doubt that makes any difference, since the old motherboard had a dual-core Athlon64 CPU and the new motherboard has a quad-core Phenom64 CPU.

4: The new system contains the current 64-bit ubuntu (v8.04.1 LTS) and the current "ganymede" eclipse, both downloaded and installed just days ago.

5: The errors are being reported in MY assembly-language file, not code generated by the compiler or in some C or OpenGL library.

6: In a lame attempt to solve the problem, I made sure I had the "ia32-libs" and "gcc-multilibs" packages installed with "apt-get install", but that changed nothing.
Old 08-10-2008, 11:42 AM   #2
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,170

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
Just a suspicion, but "push" and "pop" are assembly-language commands, and it's possible that the application you're trying to compile has some assembly code sections. At the assembly language level you may need to set additional (or different) options to compile 32-bit code for a 64-bit processor. (Note: I'm just guessing here, not speaking from any experience.)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
glibc in capter 6 -- error: cannot compute suffix of object files Yoyo302 Linux From Scratch 23 05-21-2010 09:28 AM
Error: suffix or operands invalid for `push' in 64 machine arya Linux - General 1 04-19-2007 11:32 AM
configure error : cannot compute suffix of object files status1 Linux From Scratch 1 10-14-2006 11:18 AM
what does "prog7.c:11: error: invalid operands to binary %" mean hubabuba Programming 6 11-16-2004 12:13 PM
gcc: invalid operands ajacques Linux - General 1 10-25-2004 08:31 AM

All times are GMT -5. The time now is 06:37 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration