public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Build report gcc 4.6.1 on Sparc Solaris 10
@ 2011-08-18 13:08 Wolfgang S. Kechel
  2011-08-18 16:12 ` Eric Botcazou
  2011-08-18 18:56 ` Marc Glisse
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfgang S. Kechel @ 2011-08-18 13:08 UTC (permalink / raw)
  To: gcc

Hello,

I picked up gcc-4.6.1 and startet a build process on a sparc-solaris10
box with /opt/sfw and SolStudio 12.2 installed. I am using mpc-0.9,
mpfr-3.0.1 and gmp-5.0.2 which I extracted in the gcc source directory
and created a link as stated in the installation
instruction/prerequisites. I also made sure the /usr/ucb is NOT in my path!

Here are my results:

Trying to build using the installed gcc -

ssol10% /opt/sfw/bin/gcc --version
gcc (GCC) 3.4.2
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

failed for various reasons, so I tried to use the native cc:


ssol10% /usr/bin/cc -V
cc: Sun C 5.11 SunOS_sparc 2010/08/13


I ran into huge problems, so I installed binutils 2.21.1, make-3.82 and
some other stuff like flex, bison, less all in the latest versions and
compiled with native cc. Finally the build of the multilibs failed so I
decided to give GNU as/ld from binutils a chance, so I configured with
the following command:

../configure --prefix=/usr2/gnu --enable-languages=c,c++ CC=/usr/bin/cc
--with-gnu-as --with-as=/usr2/gnu/bin/gas --with-gnu-ld
--with-ld=/usr2/gnu/bin/gld

Do not be irritated when this detects executables in
$prefix/libexec/sparc=sun-solaris2.10/bin (as, ld, nm,...) - they have
been installed there from binutils.

Doing a make stops when building in lto-plugin:
make[4]: Entering directory
`/archive/sparc-solaris/gcc-4.6.1/ssol/lto-plugin'
/bin/bash ./libtool --tag=CC --tag=disable-static --mode=compile
/usr/bin/cc -DHAVE_CONFIG_H -I. -I../../lto-plugin
-I../../lto-plugin/../include -DHAVE_CONFIG_H -Wall -Werror -g -c -o
lto-plugin.lo ../../lto-plugin/lto-plugin.c
libtool: compile: /usr/bin/cc -DHAVE_CONFIG_H -I. -I../../lto-plugin
-I../../lto-plugin/../include -DHAVE_CONFIG_H -Wall -Werror -g -c
../../lto-plugin/lto-plugin.c -KPIC -DPIC -o .libs/lto-plugin.o
cc: -W option with unknown program all

To fix this, I edited lto-plugin/Makefile - yes this is generated. I changed
AM_CFLAGS = -Wall -Werror
into
AM_CFLAGS =

Indeed, make it empty since SUN ld used by /usr/bin/cc) does not
understand these options. Restarting the make will take some time and
give another error in subdirectory gcc:
/usr/bin/cc -g -DIN_GCC -DHAVE_CONFIG_H -o cc1 c-lang.o
c-family/stub-objc.o attribs.o c-errors.o c-decl.o c-typeck.o
c-convert.o c-aux-info.o c-objc-common.o c-parser.o tree-mudflap.o
c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o
c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o
c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o
c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o
c-family/c-semantics.o c-family/c-ada-spec.o sol2-c.o \
cc1-checksum.o main.o tree-browser.o libbackend.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a ../libcpp/libcpp.a ./../intl/libintl.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a
-L/archive/sparc-solaris/gcc-4.6.1/ssol/./gmp/.libs
-L/archive/sparc-solaris/gcc-4.6.1/ssol/./mpfr/.libs
-L/archive/sparc-solaris/gcc-4.6.1/ssol/./mpc/src/.libs -lmpc -lmpfr
-lgmp -L../zlib -lz
Undefined first referenced
symbol in file
cimag
/archive/sparc-solaris/gcc-4.6.1/ssol/./mpc/src/.libs/libmpc.a(set_x.o)
creal
/archive/sparc-solaris/gcc-4.6.1/ssol/./mpc/src/.libs/libmpc.a(set_x.o)
cimagl
/archive/sparc-solaris/gcc-4.6.1/ssol/./mpc/src/.libs/libmpc.a(set_x.o)
creall
/archive/sparc-solaris/gcc-4.6.1/ssol/./mpc/src/.libs/libmpc.a(set_x.o)
ld: fatal: Symbol referencing errors. No output written to cc1
make[3]: *** [cc1] Error 2
make[3]: Leaving directory `/archive/sparc-solaris/gcc-4.6.1/ssol/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/archive/sparc-solaris/gcc-4.6.1/ssol'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/archive/sparc-solaris/gcc-4.6.1/ssol'
make: *** [all] Error 2


This can be fixed by adding '-lm' to HOST_LIBS in gcc/Makefile:

# Libraries to use on the host.
#HOST_LIBS =
HOST_LIBS = -lm

Then I restarted the 'make' again and it took quite some time (hours on
my machine) I ran into another problem with mpc-.0:
libtool: compile: /archive/sparc-solaris/gcc-4.6.1/ssol/./prev-gcc/xgcc
-B/archive/sparc-solaris/gcc-4.6.1/ssol/./prev-gcc/
-B/usr2/gnu/sparc-sun-solaris2.10/bin/
-B/usr2/gnu/sparc-sun-solaris2.10/bin/
-B/usr2/gnu/sparc-sun-solaris2.10/lib/ -isystem
/usr2/gnu/sparc-sun-solaris2.10/include -isystem
/usr2/gnu/sparc-sun-solaris2.10/sys-include -DHAVE_CONFIG_H -I.
-I../../../mpc/src -I.. -I/archive/sparc-solaris/gcc-4.6.1/ssol/./gmp
-I/archive/sparc-solaris/gcc-4.6.1/mpfr -g -O2 -MT get.lo -MD -MP -MF
.deps/get.Tpo -c ../../../mpc/src/get.c -o get.o
../../../mpc/src/get.c: In function ‘mpc_get_dc’:
../../../mpc/src/get.c:33:11: error: ‘I’ undeclared (first use in this
function)
../../../mpc/src/get.c:33:11: note: each undeclared identifier is
reported only once for each function it appears in
../../../mpc/src/get.c: In function ‘mpc_get_ldc’:
../../../mpc/src/get.c:39:11: error: ‘I’ undeclared (first use in this
function)

I fixed this with a modification in /usr/include/complex.h (yes, need
root permissions):
#if !defined(__GNUC__) /* wke mod for mpc 0.9 */
#undef I
#define I _Imaginary_I
#else /* native cc */
#undef I
#define I (__extension__ 1.0iF)
#endif /* end __GNUC__ */

But I do not know if this fix may break stuff in some places.

Another restart of make yields a full build and I am able to install the
compiler and use it. it seems to generate proper result (at least for C).

In case you have further questions, do not hesitate to contact me via email.

Best regards

-- 
Wolfgang Kechel                         mailto:wolfgang.kechel@prs.de

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

* Re: Build report gcc 4.6.1 on Sparc Solaris 10
  2011-08-18 13:08 Build report gcc 4.6.1 on Sparc Solaris 10 Wolfgang S. Kechel
@ 2011-08-18 16:12 ` Eric Botcazou
  2011-08-18 18:56 ` Marc Glisse
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Botcazou @ 2011-08-18 16:12 UTC (permalink / raw)
  To: Wolfgang S. Kechel; +Cc: gcc

> I picked up gcc-4.6.1 and startet a build process on a sparc-solaris10
> box with /opt/sfw and SolStudio 12.2 installed. I am using mpc-0.9,
> mpfr-3.0.1 and gmp-5.0.2 which I extracted in the gcc source directory
> and created a link as stated in the installation
> instruction/prerequisites. I also made sure the /usr/ucb is NOT in my path!

The installation instructions for SPARC also recommend specific versions of 
the GMP, MPFR and MPC libraries.  And building with the Sun compiler is 
probably not very well tested indeed.

The compiler is known to build flawlessly on this platform with the right 
libraries and GCC as base compiler.

-- 
Eric Botcazou

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

* Re: Build report gcc 4.6.1 on Sparc Solaris 10
  2011-08-18 13:08 Build report gcc 4.6.1 on Sparc Solaris 10 Wolfgang S. Kechel
  2011-08-18 16:12 ` Eric Botcazou
@ 2011-08-18 18:56 ` Marc Glisse
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Glisse @ 2011-08-18 18:56 UTC (permalink / raw)
  To: Wolfgang S. Kechel; +Cc: gcc

On Thu, 18 Aug 2011, Wolfgang S. Kechel wrote:

> I ran into huge problems, so I installed binutils 2.21.1, make-3.82 and
> some other stuff like flex, bison, less all in the latest versions and
> compiled with native cc. Finally the build of the multilibs failed so I
> decided to give GNU as/ld from binutils a chance, so I configured with
> the following command:
>
> ../configure --prefix=/usr2/gnu --enable-languages=c,c++ CC=/usr/bin/cc
> --with-gnu-as --with-as=/usr2/gnu/bin/gas --with-gnu-ld
> --with-ld=/usr2/gnu/bin/gld

You know that the documentation recommends using the Sun linker (and on 
sparc the Sun assembler is fine), so if there are errors, you should 
report them.

> To fix this, I edited lto-plugin/Makefile - yes this is generated. I changed
> AM_CFLAGS = -Wall -Werror
> into
> AM_CFLAGS =

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49907
Already fixed on trunk, not backported (yet).

> Undefined first referenced
> symbol in file
> cimag
> /archive/sparc-solaris/gcc-4.6.1/ssol/./mpc/src/.libs/libmpc.a(set_x.o)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49908
Not fixed yet. There is also a RFE at Oracle to inline those functions.

> ../../../mpc/src/get.c: In function Β‘mpc_get_dcΒ’:
> ../../../mpc/src/get.c:33:11: error: Β‘IΒ’ undeclared (first use in this
> function)
> ../../../mpc/src/get.c:33:11: note: each undeclared identifier is
> reported only once for each function it appears in
> ../../../mpc/src/get.c: In function Β‘mpc_get_ldcΒ’:
> ../../../mpc/src/get.c:39:11: error: Β‘IΒ’ undeclared (first use in this
> function)

Strange, this is expected with gcc-3.4 (although there is a workaround 
in the development version of mpc) but not with gcc-4.6.

-- 
Marc Glisse

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

end of thread, other threads:[~2011-08-18 18:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-18 13:08 Build report gcc 4.6.1 on Sparc Solaris 10 Wolfgang S. Kechel
2011-08-18 16:12 ` Eric Botcazou
2011-08-18 18:56 ` Marc Glisse

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