From: Richard Vaughn on
On a 64-bit Scientific Linux 5.4 machine, I get the following
when I try to compile the basic "Hello world" program:

[root]# g++ -Wall hello.cc -o hello
/tmp/ccglIDXK.s: Assembler messages:
/tmp/ccglIDXK.s:10: Error: suffix or operands invalid for `push'
/tmp/ccglIDXK.s:38: Error: suffix or operands invalid for `push'
/tmp/ccglIDXK.s:55: Error: suffix or operands invalid for `push'
/tmp/ccglIDXK.s:79: Error: suffix or operands invalid for `push'
/tmp/ccglIDXK.s:81: Error: suffix or operands invalid for `push'
/tmp/ccglIDXK.s:85: Error: suffix or operands invalid for `push'
/tmp/ccglIDXK.s:94: Error: suffix or operands invalid for `pop'
/tmp/ccglIDXK.s:95: Error: suffix or operands invalid for `pop'

Contents of hello.cc:
#include <iostream>

int
main ()
{
std::cout << "Hello, world!\n";
return 0;
}

Same program compiles/runs fine on 32-bit Scientific Linux 5.4.

Is there an Assembler issue re 64-bit v. 32-bit?

Thanks,
-Richard Vaughn
From: Robert Heller on
At Wed, 24 Mar 2010 07:37:18 -0700 (PDT) Richard Vaughn <rvaughn9(a)gmail.com> wrote:

>
> On a 64-bit Scientific Linux 5.4 machine, I get the following
> when I try to compile the basic "Hello world" program:
>
> [root]# g++ -Wall hello.cc -o hello
> /tmp/ccglIDXK.s: Assembler messages:
> /tmp/ccglIDXK.s:10: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:38: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:55: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:79: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:81: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:85: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:94: Error: suffix or operands invalid for `pop'
> /tmp/ccglIDXK.s:95: Error: suffix or operands invalid for `pop'
>
> Contents of hello.cc:
> #include <iostream>
>
> int
> main ()
> {
> std::cout << "Hello, world!\n";
> return 0;
> }
>
> Same program compiles/runs fine on 32-bit Scientific Linux 5.4.
>
> Is there an Assembler issue re 64-bit v. 32-bit?

Compiles and runs fine on a 64-bit CentOS 5.4 system:

sauron.deepsoft.com% cat >hello.cc
#include <iostream>

int
main ()
{
std::cout << "Hello, world!\n";
return 0;
}
heller has logged on pts/2 from :0.0 at 24-Mar-2010 11:08.
sauron.deepsoft.com% g++ -Wall hello.cc -o hello
sauron.deepsoft.com% ./hello
Hello, world!
sauron.deepsoft.com% uname -a
Linux sauron.deepsoft.com 2.6.18-164.15.1.el5xen #1 SMP Wed Mar 17
12:04:23 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
sauron.deepsoft.com% g++ -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)
sauron.deepsoft.com% rpm -q binutils
binutils-2.17.50.0.6-12.el5
sauron.deepsoft.com% ld -v
GNU ld version 2.17.50.0.6-12.el5 20061020
sauron.deepsoft.com% as -v
GNU assembler version 2.17.50.0.6-12.el5 (x86_64-redhat-linux) using BFD
version 2.17.50.0.6-12.el5 20061020


>
> Thanks,
> -Richard Vaughn
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Download the Model Railroad System
http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
heller(a)deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/

From: Darrell Stec on
Richard Vaughn wrote:

> On a 64-bit Scientific Linux 5.4 machine, I get the following
> when I try to compile the basic "Hello world" program:
>
> [root]# g++ -Wall hello.cc -o hello
> /tmp/ccglIDXK.s: Assembler messages:
> /tmp/ccglIDXK.s:10: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:38: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:55: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:79: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:81: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:85: Error: suffix or operands invalid for `push'
> /tmp/ccglIDXK.s:94: Error: suffix or operands invalid for `pop'
> /tmp/ccglIDXK.s:95: Error: suffix or operands invalid for `pop'
>
> Contents of hello.cc:
> #include <iostream>
>
> int
> main ()
> {
> std::cout << "Hello, world!\n";
> return 0;
> }
>
> Same program compiles/runs fine on 32-bit Scientific Linux 5.4.
>
> Is there an Assembler issue re 64-bit v. 32-bit?
>
> Thanks,
> -Richard Vaughn

The difference could be whether or not you have all the header, source and
development files installed.

--
Later,
Darrell
From: Richard Vaughn on
On Robert Heller's 64-bit centOS machine (above):
"g++ -v" provides:
Target: x86_64-redhat-linux
host=x86_64-redhat-linux

On my 64-bit ScientificLinux machine:
"g++ -v" provides:
Target: i386-redhat-linux
host=i386-redhat-linux

gcc versions are identical (gcc version 4.1.2 20080704 (Red Hat
4.1.2-46) ).

Outputs of "rpm -q binutils", "ld -v" and "as -v" commands are also
identical.

So.... why does my g++ have a Target/host *not* as x86_64?
And is that the problem?
And if so, how to proceed?

Thanks,
-Richard

On Mar 24, 11:45 am, Darrell Stec <dars...(a)neo.rr.com> wrote:
> Richard Vaughn wrote:
> > On a 64-bit Scientific Linux 5.4 machine, I get the following
> > when I try to compile the basic "Hello world" program:
>
> > [root]# g++ -Wall hello.cc -o hello
> > /tmp/ccglIDXK.s: Assembler messages:
> > /tmp/ccglIDXK.s:10: Error: suffix or operands invalid for `push'
> > /tmp/ccglIDXK.s:38: Error: suffix or operands invalid for `push'
> > /tmp/ccglIDXK.s:55: Error: suffix or operands invalid for `push'
> > /tmp/ccglIDXK.s:79: Error: suffix or operands invalid for `push'
> > /tmp/ccglIDXK.s:81: Error: suffix or operands invalid for `push'
> > /tmp/ccglIDXK.s:85: Error: suffix or operands invalid for `push'
> > /tmp/ccglIDXK.s:94: Error: suffix or operands invalid for `pop'
> > /tmp/ccglIDXK.s:95: Error: suffix or operands invalid for `pop'
>
> > Contents of hello.cc:
> > #include <iostream>
>
> > int
> > main ()
> > {
> >   std::cout << "Hello, world!\n";
> >   return 0;
> > }
>
> > Same program compiles/runs fine on 32-bit Scientific Linux 5.4.
>
> > Is there an Assembler issue re 64-bit v. 32-bit?
>
> > Thanks,
> > -Richard Vaughn
>
> The difference could be whether or not you have all the header, source and
> development files installed.
>
> --
> Later,
> Darrell

From: Robert Heller on
At Wed, 24 Mar 2010 08:58:41 -0700 (PDT) Richard Vaughn <rvaughn9(a)gmail.com> wrote:

>
> On Robert Heller's 64-bit centOS machine (above):
> "g++ -v" provides:
> Target: x86_64-redhat-linux
> host=3Dx86_64-redhat-linux
>
> On my 64-bit ScientificLinux machine:
> "g++ -v" provides:
> Target: i386-redhat-linux
> host=3Di386-redhat-linux
>
> gcc versions are identical (gcc version 4.1.2 20080704 (Red Hat
> 4.1.2-46) ).
>
> Outputs of "rpm -q binutils", "ld -v" and "as -v" commands are also
> identical.
>
> So.... why does my g++ have a Target/host *not* as x86_64?
> And is that the problem?

Probably.

> And if so, how to proceed?

What does 'uname -a' show? Do you *really* have a 64-bit system
installed? Or have you installed the 32-bit system on a 64-bit
processor? If it really is a 64-bit system (as shown by 'uname -a'), it
appears that you have the *32-bit* compiler installed and the 64-bit
binutils installed. This is probably not good. You probably shoud
uninstall the 32-bit compiler(s) and install the 64-bit ones.

>
> Thanks,
> -Richard
>
> On Mar 24, 11:45=A0am, Darrell Stec <dars...(a)neo.rr.com> wrote:
> > Richard Vaughn wrote:
> > > On a 64-bit Scientific Linux 5.4 machine, I get the following
> > > when I try to compile the basic "Hello world" program:
> >
> > > [root]# g++ -Wall hello.cc -o hello
> > > /tmp/ccglIDXK.s: Assembler messages:
> > > /tmp/ccglIDXK.s:10: Error: suffix or operands invalid for `push'
> > > /tmp/ccglIDXK.s:38: Error: suffix or operands invalid for `push'
> > > /tmp/ccglIDXK.s:55: Error: suffix or operands invalid for `push'
> > > /tmp/ccglIDXK.s:79: Error: suffix or operands invalid for `push'
> > > /tmp/ccglIDXK.s:81: Error: suffix or operands invalid for `push'
> > > /tmp/ccglIDXK.s:85: Error: suffix or operands invalid for `push'
> > > /tmp/ccglIDXK.s:94: Error: suffix or operands invalid for `pop'
> > > /tmp/ccglIDXK.s:95: Error: suffix or operands invalid for `pop'
> >
> > > Contents of hello.cc:
> > > #include <iostream>
> >
> > > int
> > > main ()
> > > {
> > > =A0 std::cout << "Hello, world!\n";
> > > =A0 return 0;
> > > }
> >
> > > Same program compiles/runs fine on 32-bit Scientific Linux 5.4.
> >
> > > Is there an Assembler issue re 64-bit v. 32-bit?
> >
> > > Thanks,
> > > -Richard Vaughn
> >
> > The difference could be whether or not you have all the header, source an=
> d
> > development files installed.
> >
> > --
> > Later,
> > Darrell
>
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Download the Model Railroad System
http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
heller(a)deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/