Bug 12896 - gmp-4.2.1 and gcc-3.3.2 won't compile with gcc-3.3.1 on sparc
Summary: gmp-4.2.1 and gcc-3.3.2 won't compile with gcc-3.3.1 on sparc
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-04 16:36 UTC by Carlos Andres VILLEGAS VINUEZA
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: sparc-sun-solaris2.9
Target: sparc-sun-solaris2.9
Build: sparc-sun-solaris2.9
Known to work:
Known to fail:
Last reconfirmed:


Attachments
mpn.tgz (23.11 KB, application/x-gzip)
2003-11-04 21:20 UTC, Carlos Andres VILLEGAS VINUEZA
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Andres VILLEGAS VINUEZA 2003-11-04 16:36:31 UTC
The compiler seems to work fine for most software, however while trying to 
compile gmp-4.2.1 I got some errors mentioning "sparclite". After some googling
around I found this:

http://lists.debian.org/debian-gcc/2002/debian-gcc-200212/msg00075.html

Although it's not the same problem (I couldn't reproduce it with that simple
program), but the proposed workaround worked well (adding -Wa,-Av9b to the 
CFLAGS and LDFLAGS). After doing that gmp compiled without a problem.

Before reporting the bug, I decided to download and compile gcc-3.3.2 and see
if that worked better. But I actually couldn't compile it, I didn't try the 
workaround above for gcc, since I don't want to have a potentially broken gcc, 
I can try it if you think it would be helpful (to see if it compiles or not).

The error for gcc is:

Making all in include
: make ; exec true "AR_FLAGS=rc"  "CC_FOR_BUILD=gcc"  "CFLAGS=-O2 -g -O2  -m64" 
 "CXXFLAGS=-g -O2  -m64"  "CFLAGS_FOR_BUILD="  "CFLAGS_FOR_TARGET=-O2 -g -O2"  "
INSTALL=/bin/sh /home/sysadm/src/gcc/gcc-3.3.2/install-sh -c"  "INSTALL_DATA=/bi
n/sh /home/sysadm/src/gcc/gcc-3.3.2/install-sh -c -m 644"  "INSTALL_PROGRAM=/bin
/sh /home/sysadm/src/gcc/gcc-3.3.2/install-sh -c"  "INSTALL_SCRIPT=/bin/sh /home
/sysadm/src/gcc/gcc-3.3.2/install-sh -c"  "LDFLAGS=-m64"  "LIBCFLAGS=-O2 -g -O2 
 -m64"  "LIBCFLAGS_FOR_TARGET=-O2 -g -O2"  "MAKE=make"  "MAKEINFO=makeinfo "  "P
ICFLAG="  "PICFLAG_FOR_TARGET="  "SHELL=/bin/sh"  "EXPECT=expect"  "RUNTEST=runt
est"  "RUNTESTFLAGS="  "exec_prefix=/usr/local/encap/gcc-3.3.2"  "infodir=/usr/l
ocal/encap/gcc-3.3.2/info"  "libdir=/usr/local/encap/gcc-3.3.2/lib"  "prefix=/us
r/local/encap/gcc-3.3.2"  "tooldir=/usr/local/encap/gcc-3.3.2/sparc-sun-solaris2
.9"  "AR=ar"  "AS=/usr/ccs/bin/as"  "CC=/home/sysadm/src/gcc/gcc-obj/gcc/xgcc -B
/home/sysadm/src/gcc/gcc-obj/gcc/ -B/usr/local/encap/gcc-3.3.2/sparc-sun-solaris
2.9/bin/ -B/usr/local/encap/gcc-3.3.2/sparc-sun-solaris2.9/lib/ -isystem /usr/lo
cal/encap/gcc-3.3.2/sparc-sun-solaris2.9/include  -m64"  "CXX=/home/sysadm/src/g
cc/gcc-obj/gcc/g++ -B/home/sysadm/src/gcc/gcc-obj/gcc/ -nostdinc++ -nostdinc++ -
I/home/sysadm/src/gcc/gcc-obj/sparc-sun-solaris2.9/sparcv9/libstdc++-v3/include/
sparc-sun-solaris2.9 -I/home/sysadm/src/gcc/gcc-obj/sparc-sun-solaris2.9/sparcv9
/libstdc++-v3/include -I/home/sysadm/src/gcc/gcc-3.3.2/libstdc++-v3/libsupc++ -I
/home/sysadm/src/gcc/gcc-3.3.2/libstdc++-v3/libio -I/home/sysadm/src/gcc/gcc-3.3
.2/libstdc++-v3/include/backward -I/home/sysadm/src/gcc/gcc-3.3.2/libstdc++-v3/t
estsuite -L/home/sysadm/src/gcc/gcc-obj/sparc-sun-solaris2.9/sparcv9/libstdc++-v
3/src -L/home/sysadm/src/gcc/gcc-obj/sparc-sun-solaris2.9/sparcv9/libstdc++-v3/s
rc/.libs -B/usr/local/encap/gcc-3.3.2/sparc-sun-solaris2.9/bin/ -B/usr/local/enc
ap/gcc-3.3.2/sparc-sun-solaris2.9/lib/ -isystem /usr/local/encap/gcc-3.3.2/sparc
-sun-solaris2.9/include  -m64"  "LD=/usr/ccs/bin/ld"  "LIBCFLAGS=-O2 -g -O2  -m6
4"  "NM=/usr/ccs/bin/nm"  "PICFLAG="  "RANLIB=true"  "DESTDIR=" DO=all multi-do
mksh: Fatal error in reader: = missing from replacement macro reference
Current working directory /home/sysadm/src/gcc/gcc-obj/sparc-sun-solaris2.9/libj
ava
*** Error code 1
make: Fatal error: Command failed for target `all-target-libjava'

The configure options for gmp were "--prefix=/usr/local/encap/gmp-4.2.1 
--enable-cxx" and for gcc they were "--prefix=/usr/local/encap/gcc-3.3.2"
both running from an "object directory" instead of the source dir.

Please let me know if there is anything else you need.

Carlos
Comment 1 Carlos Andres VILLEGAS VINUEZA 2003-11-04 17:16:34 UTC
hmmm... sorry, I didn't review what I did before sending it, here are a few 
corrections and additions:

- APOLOGY: I tagged it as java subsystem, while the initial gmp problem has 
nothing to do with that, the java subsystem problem is on the 3.3.2 version of 
gcc, I should have sent two reports instead of 1.
- CORRECTION: the gmp version that manifests problems is 4.1.2 (the latest, 
instead of the unexistent 4.2.1 that I mentioned consistently...)
- ADDITION: The gmp errors are:
(a lot of similar messages removed):
tmp-add_n.s:168: Error: Architecture mismatch on "ldx".
tmp-add_n.s:168:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:171: Error: Architecture mismatch on "srlx".
tmp-add_n.s:171:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:173: Error: Architecture mismatch on "stx".
tmp-add_n.s:173:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:178: Error: Architecture mismatch on "bge,pt %icc,.Loop".
tmp-add_n.s:178:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:185: Error: Architecture mismatch on "srlx".
tmp-add_n.s:185:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:187: Error: Architecture mismatch on "stx".
tmp-add_n.s:187:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:193: Error: Architecture mismatch on "srlx".
tmp-add_n.s:193:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:195: Error: Architecture mismatch on "stx".
tmp-add_n.s:195:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:202: Error: Architecture mismatch on "srlx".
tmp-add_n.s:202:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:204: Error: Architecture mismatch on "stx".
tmp-add_n.s:204:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:210: Error: Architecture mismatch on "srlx".
tmp-add_n.s:210:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:211: Error: Architecture mismatch on "stx".
tmp-add_n.s:211:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:214: Error: Architecture mismatch on "bz,pn %icc,.Lret".
tmp-add_n.s:214:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:217: Error: Architecture mismatch on "ldx".
tmp-add_n.s:217:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:219: Error: Architecture mismatch on "ldx".
tmp-add_n.s:219:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:228: Error: Architecture mismatch on "stx".
tmp-add_n.s:228:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:230: Error: Architecture mismatch on "bnz,pt %icc,.Loop0".
tmp-add_n.s:230:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
tmp-add_n.s:231: Error: Architecture mismatch on "srlx".
tmp-add_n.s:231:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
*** Error code 1
make: Fatal error: Command failed for target `add_n.lo'
Current working directory /tmp/src/gmp/gmp-4.1.2/mpn
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /tmp/src/gmp/gmp-4.1.2
*** Error code 1
make: Fatal error: Command failed for target `all'

Carlos
Comment 2 Eric Botcazou 2003-11-04 18:10:19 UTC
1. We need a preprocessed testcase for the problem with gmp.
   See http://gcc.gnu.org/bugs.html

2. Make sure to strictly follow the build instructions for SPARC/Solaris.
   See http://gcc.gnu.org/install/specific.html

Thanks.
Comment 3 Carlos Andres VILLEGAS VINUEZA 2003-11-04 21:19:55 UTC
Subject: Re:  gmp-4.2.1 and gcc-3.3.2 won't compile with gcc-3.3.1 on sparc

On Tue, Nov 04, 2003 at 06:10:21PM -0000, ebotcazou at gcc dot gnu dot org wrote:
> 1. We need a preprocessed testcase for the problem with gmp.
>    See http://gcc.gnu.org/bugs.html

I'm attaching the resulting .i files in a compressed tarball from gmp 4.1.2
created like so:

export CFLAGS="-save-temps"
export LDFLAGS="-save-temps"
# unpack distro, create build dir...
../../gmp-4.1.2/configure --prefix=/usr/local/encap/gmp-4.1.2
make

gcc version used to compile:

$ gcc -v
Reading specs from /usr/local/bin/../lib/gcc-lib/sparc-sun-solaris2.9/3.3.1/specs
Configured with: ../configure --prefix=/usr/local/encap/gcc-3.3.1 --with-gnu-as=/usr/local/bin/as --with-gnu-ld=/usr/local/bin/ld --disable-nls
Thread model: posix
gcc version 3.3.1

The error message is:

(several lines similar to the first one, and then the rest)
tmp-add_n.s:231:  (Requires v9|v9a|v9b; requested architecture is sparclite.)
*** Error code 1
make: Fatal error: Command failed for target `add_n.lo'
Current working directory /tmp/src/gmp/gmp-4.1.2/mpn
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /tmp/src/gmp/gmp-4.1.2
*** Error code 1
make: Fatal error: Command failed for target `all'


> 2. Make sure to strictly follow the build instructions for SPARC/Solaris.
>    See http://gcc.gnu.org/install/specific.html

We have previously compiled gcc in the same fashion as now, I didn't see
any additional things that are required for our setting in there.

This is the information for the gcc failure:

Executed commands:

export CFLAGS="-save-temps"
export LDFLAGS="-save-temps"
# unpack distro, create build dir...
../../gcc-3.3.2/configure --prefix=/usr/local/encap/gcc-3.3.2 --with-gnu-as=/usr/local/bin/as --with-gnu-ld=/usr/local/bin/ld --disable-nls
make

Same gcc version as above used to compile.

The error I get is the following:

(A few couple of hours of output removed :) )
creating ./config.status
creating Makefile
creating config.h
mksh: Fatal error in reader: = missing from replacement macro reference
Current working directory /tmp/src/gcc/gcc-3.3.2/sparc-sun-solaris2.9/libjava
*** Error code 1
make: Fatal error: Command failed for target `all-target-libjava'

There were no .i files created ??? I did a find (same as for gmp).

Carlos

PS: the attached tarball is called mpn.tgz, since the .i files were in
the directory by that name.

Comment 4 Carlos Andres VILLEGAS VINUEZA 2003-11-04 21:20:01 UTC
Created attachment 5057 [details]
mpn.tgz
Comment 5 Andrew Pinski 2003-11-05 00:47:13 UTC
Two things, the way you build GCC is by "make bootstap" rather than just make and you still do not 
read <http://gcc.gnu.org/install/specific.html#*-*-solaris2*> at all, if you follow the directions 
bootstrapping will work.

As for gmp, can you provide the invocation of gcc when compiling fails?
Comment 6 Carlos Andres VILLEGAS VINUEZA 2003-11-05 18:01:41 UTC
Subject: Re:  gmp-4.2.1 and gcc-3.3.2 won't compile with gcc-3.3.1 on sparc

On Wed, Nov 05, 2003 at 12:47:15AM -0000, pinskia at gcc dot gnu dot org wrote:
> 
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-05 00:47 -------
> Two things, the way you build GCC is by "make bootstap" rather than just make and you still do not 
> read <http://gcc.gnu.org/install/specific.html#*-*-solaris2*> at all, if you follow the directions 
> bootstrapping will work.

Sorry about that, I'm following some installation notes for the previous
version, and they seem to have some errors. Please consider the "gcc" part
fixed, I'll really test it out properly, and if problems arise again I'll
open a new bugreport for that.

> As for gmp, can you provide the invocation of gcc when compiling fails?

The exact invocation that produced those .i files is:

gcc -c -DHAVE_CONFIG_H -I. -I../../../gmp-4.1.2/mpn -I.. -D__GMP_WITHIN_GMP -I../../../gmp-4.1.2 -DOPERATION_add_n -save-temps tmp-add_n.s -fPIC -DPIC -o add_n.o

Carlos

Comment 7 Andrew Pinski 2003-11-05 18:18:27 UTC
Not our bug as the file is an asm file which causing problems: tmp-add_n.s.