public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* 64 bit library doesn't build using makefile
@ 2007-06-05  8:05 Prasad Athawale
  2007-06-05  8:24 ` Brian Dessent
  0 siblings, 1 reply; 3+ messages in thread
From: Prasad Athawale @ 2007-06-05  8:05 UTC (permalink / raw)
  To: gcc-help

Hi All!

I have a library that builds perfectly fine using the m32 option on an
AMD x86_64 machine. The output is a 32 bit library as expected
(confirmed with the file command).

But when I change the option to m64, the library fails to build with the output:

gcc -fPIC -g -Wall -m64   -I../../include/internal -I. -I../../include
-c -osample.o sample.c
/tmp/ccqkJFT6.s: Assembler messages:
/tmp/ccqkJFT6.s:28: Error: suffix or operands invalid for `push'
/tmp/ccqkJFT6.s:30: Error: suffix or operands invalid for `movq'
/tmp/ccqkJFT6.s:34: Error: `-8(%rbp)' is not a valid 32 bit base/index
expression

The make file tries to build both static and dynamic libraries - using
ar, ranlib and g++.

If I do each of the steps manually - with the exact same commands on
the command line, the library gets built fine, and the file command
indeed indicates it's a valid 64-bit library.

Here are the gcc & g++ settings:
gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.4/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk
--host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)

g++ -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.4/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk
--host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)


My questions are:

1) Am I using a version known to have some bugs when compiling with
the m64 option ?
2) What settings could play a role in preventing a makefile from
building the library, but still allow individual commands to be
successful ?
3) Any other tips etc ?

Thanks for your time!

Prasad

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

* Re: 64 bit library doesn't build using makefile
  2007-06-05  8:05 64 bit library doesn't build using makefile Prasad Athawale
@ 2007-06-05  8:24 ` Brian Dessent
  2007-06-05 21:41   ` Prasad Athawale
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Dessent @ 2007-06-05  8:24 UTC (permalink / raw)
  To: Prasad Athawale; +Cc: gcc-help

Prasad Athawale wrote:

> gcc -fPIC -g -Wall -m64   -I../../include/internal -I. -I../../include
> -c -osample.o sample.c
> /tmp/ccqkJFT6.s: Assembler messages:
> /tmp/ccqkJFT6.s:28: Error: suffix or operands invalid for `push'
> /tmp/ccqkJFT6.s:30: Error: suffix or operands invalid for `movq'
> /tmp/ccqkJFT6.s:34: Error: `-8(%rbp)' is not a valid 32 bit base/index
> expression

As the error message indicates, these are from the assembler (as) which
is a separate program that is invoked by (but not a part of) gcc.  And
it appears that it's a version of gas that wasn't built with 64 bit
support.

> If I do each of the steps manually - with the exact same commands on
> the command line, the library gets built fine, and the file command
> indeed indicates it's a valid 64-bit library.

If you are indeed invoking the exact same commands as the Makefile but
getting different results, then it could be an environmental difference.
For example, perhaps PATH or some other variable is set differently in
the Makefile, resulting in a different/older version of the assembler
being called.

You could add -v to both the failing and the succeeding commands, and
you will explicitly see the invocation of the various sub-processes:
cc1, as, collect2, etc.  This should tell you if the same assembler is
being called in both cases, or if there is some other difference in 'as'
invocation between the failing and suceeding.

Brian

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

* Re: 64 bit library doesn't build using makefile
  2007-06-05  8:24 ` Brian Dessent
@ 2007-06-05 21:41   ` Prasad Athawale
  0 siblings, 0 replies; 3+ messages in thread
From: Prasad Athawale @ 2007-06-05 21:41 UTC (permalink / raw)
  To: gcc-help

Thanks for the prompt reply Brian! I tried out what you suggested, and
indeed a different assembler was being invoked when running through
the make files.

The reason why the problem was not being seen on the console is, the
build machine's environment got modified, and I had an older console
open. The moment I refreshed my console, I was seeing the same error
on the console as well.

I've since tracked down the erring entry in the environment, and fixed it.

Many thanks for pointing me in the right direction!

Prasad


On 6/5/07, Brian Dessent <brian@dessent.net> wrote:
> Prasad Athawale wrote:
>
> > gcc -fPIC -g -Wall -m64   -I../../include/internal -I. -I../../include
> > -c -osample.o sample.c
> > /tmp/ccqkJFT6.s: Assembler messages:
> > /tmp/ccqkJFT6.s:28: Error: suffix or operands invalid for `push'
> > /tmp/ccqkJFT6.s:30: Error: suffix or operands invalid for `movq'
> > /tmp/ccqkJFT6.s:34: Error: `-8(%rbp)' is not a valid 32 bit base/index
> > expression
>
> As the error message indicates, these are from the assembler (as) which
> is a separate program that is invoked by (but not a part of) gcc.  And
> it appears that it's a version of gas that wasn't built with 64 bit
> support.
>
> > If I do each of the steps manually - with the exact same commands on
> > the command line, the library gets built fine, and the file command
> > indeed indicates it's a valid 64-bit library.
>
> If you are indeed invoking the exact same commands as the Makefile but
> getting different results, then it could be an environmental difference.
> For example, perhaps PATH or some other variable is set differently in
> the Makefile, resulting in a different/older version of the assembler
> being called.
>
> You could add -v to both the failing and the succeeding commands, and
> you will explicitly see the invocation of the various sub-processes:
> cc1, as, collect2, etc.  This should tell you if the same assembler is
> being called in both cases, or if there is some other difference in 'as'
> invocation between the failing and suceeding.
>
> Brian
>

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

end of thread, other threads:[~2007-06-05 21:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-05  8:05 64 bit library doesn't build using makefile Prasad Athawale
2007-06-05  8:24 ` Brian Dessent
2007-06-05 21:41   ` Prasad Athawale

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