Bug 26889 - selected_int_kind.inc broken, causing failure
Summary: selected_int_kind.inc broken, causing failure
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.0.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-27 17:22 UTC by Quanah Gibson-Mount
Modified: 2006-08-15 18:23 UTC (History)
4 users (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
selected_int_kind.f90 (775 bytes, text/plain)
2006-03-28 20:59 UTC, Quanah Gibson-Mount
Details
selected_int_kind.inc (69 bytes, text/plain)
2006-03-29 22:12 UTC, Quanah Gibson-Mount
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Quanah Gibson-Mount 2006-03-27 17:22:39 UTC
I'm using GMP 4.2 and MPFR 2.2.0, both built with gcc-4.0.2.

When I go to build gcc-4.0.3, I get the following error:

/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_59/gcc/gfortran -B/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_59/gcc/ -B/usr/pubsw/sparc-sun-solaris2.9/bin/ -B/usr/pubsw/sparc-sun-solaris2.9/lib/ -isystem /usr/pubsw/sparc-sun-solaris2.9/include -isystem /usr/pubsw/sparc-sun-solaris2.9/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring -c ../../../../gcc-4.0.3/libgfortran/intrinsics/selected_int_kind.f90  -fPIC -DPIC -o .libs/selected_int_kind.o
ld.so.1: f951: fatal: /afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_59/gcc/f951: object requires TLS, but TLS failed to initialize
gfortran: Internal error: Killed (program f951)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Quanah Gibson-Mount 2006-03-27 17:23:14 UTC
change to fortran, instead of libfortran.
Comment 2 Quanah Gibson-Mount 2006-03-27 19:23:17 UTC
On Solaris 8, the build fails also, except with the following error:

/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/gfortran -B/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/ -B/usr/pubsw/sparc-sun-solaris2.8/bin/ -B/usr/pubsw/sparc-sun-solaris2.8/lib/ -isystem /usr/pubsw/sparc-sun-solaris2.8/include -isystem /usr/pubsw/sparc-sun-solaris2.8/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring -c ../../../../gcc-4.0.3/libgfortran/intrinsics/selected_int_kind.f90  -fPIC -DPIC -o .libs/selected_int_kind.o
<built-in>:0: internal compiler error: Segmentation Fault
Comment 3 Eric Botcazou 2006-03-27 20:15:00 UTC
Very likely a GMP/MFPR problem, try to disable TLS support in the library.
Comment 4 Quanah Gibson-Mount 2006-03-27 20:48:11 UTC
Disable TLS support in *which* library?

GMP, MPFR, or libfortran?

There are no options in the configure for GMP or MPFR referring to TLS/SSL.

--Quanah
Comment 5 Eric Botcazou 2006-03-27 21:00:45 UTC
> Disable TLS support in *which* library?

GMP/MPFR.

> There are no options in the configure for GMP or MPFR referring to TLS/SSL.

Did you build gcc-4.0.2 with Fortran support?  If so, could you try building 4.0.3 with the same version of GMP/MPFR as with 4.0.2?  In the meantime, I'll try to reproduce the problem.
Comment 6 Quanah Gibson-Mount 2006-03-27 22:09:45 UTC
I don't see a way to disable "TLS" support in GMP or MPFR, but I'll keep poking.

I didn't build gcc 4.0.2 with Fortran support because I needed to build gcc to build GMP and MPFR. ;)

Building gcc 4.0.1 also fails for me, but with an entirely different error and location.  I'll open a separate bug on that.
Comment 7 Eric Botcazou 2006-03-27 22:19:35 UTC
> I didn't build gcc 4.0.2 with Fortran support because I needed to build gcc to
> build GMP and MPFR. ;)

Of course. :-)  I just rebuild 4.0.3 with 4.0.2 on SPARC/Solaris 8:

gax% CC=gcc40 /home/eric/svn/gcc-4_0-branch/configure --prefix=/opt/build/eric/local/gcc-4_0-branch --with-gmp=/opt/build/eric/local --with-mpfr=/opt/build/eric/local --with-local-prefix=/opt/build/eric/local --enable-languages=c,f95

gax% gcc/xgcc -v
Using built-in specs.
Target: sparc-sun-solaris2.8
Configured with: /home/eric/svn/gcc-4_0-branch/configure --prefix=/opt/build/eric/local/gcc-4_0-branch --with-gmp=/opt/build/eric/local --with-mpfr=/opt/build/eric/local --with-local-prefix=/opt/build/eric/local --enable-languages=c,f95
Thread model: posix
gcc version 4.0.3

> Building gcc 4.0.1 also fails for me, but with an entirely different error and
> location.  I'll open a separate bug on that.

Really weird.  GCC 4.0.x is known to build without a hitch on SPARC/Solaris.  Please specify the exact configure line and the exact make line.
Comment 8 Quanah Gibson-Mount 2006-03-27 22:27:36 UTC
sorry, I meant 4.1.0, and you answered that well enough. ;)

*how* do I build gmp/mpfr without TLS? I don't see any configure options that make sense for this...

I'll note that GMP was built with ABI=32 in my case.

Comment 9 Eric Botcazou 2006-03-27 22:32:35 UTC
> I'll note that GMP was built with ABI=32 in my case.

I'd recommend to configure it as specified in the instructions:
  http://gcc.gnu.org/install/specific.html#sparc-sun-solaris2

And you also need to make sure the resulting library is visible from the dynamic linker, i.e. 'ldd f951' should not have unresolved references.
Comment 10 Quanah Gibson-Mount 2006-03-28 01:59:48 UTC
I rebuilt gmp with:

    --build=sparc-sun-solaris2.8

and then rebuilt MPFR, and then rebuilt gcc 4.0.3.  On Solaris 8, it is still dying, with:

/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/gfortran -B/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/ -B/usr/pubsw/sparc-sun-solaris2.8/bin/ -B/usr/pubsw/sparc-sun-solaris2.8/lib/ -isystem /usr/pubsw/sparc-sun-solaris2.8/include -isystem /usr/pubsw/sparc-sun-solaris2.8/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring -c ../../../../gcc-4.0.3/libgfortran/intrinsics/selected_int_kind.f90  -fPIC -DPIC -o .libs/selected_int_kind.o
<built-in>:0: internal compiler error: Segmentation Fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [selected_int_kind.lo] Error 1
make[2]: Leaving directory `/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/sparc-sun-solaris2.8/libgfortran'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/sparc-sun-solaris2.8/libgfortran'
make: *** [all-target-libgfortran] Error 2


ldd shows no issues with f951 or gfortran:

solaris8-build:/afs/ir/src/pubsw/languages/gcc-4.0.3> ldd ../gcc-build/sun4x_58/gcc/gfortran
        libintl.so.3 =>  /usr/pubsw/lib/libintl.so.3
        libiconv.so.2 =>         /usr/pubsw/lib/libiconv.so.2
        libc.so.1 =>     /usr/lib/libc.so.1
        libgcc_s.so.1 =>         /usr/pubsw/lib/libgcc_s.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        /usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1
solaris8-build:/afs/ir/src/pubsw/languages/gcc-4.0.3> ldd ../gcc-build/sun4x_58/gcc/f951
        libgmp.so.3 =>   /usr/pubsw/lib/libgmp.so.3
        libintl.so.3 =>  /usr/pubsw/lib/libintl.so.3
        libiconv.so.2 =>         /usr/pubsw/lib/libiconv.so.2
        libc.so.1 =>     /usr/lib/libc.so.1
        libgcc_s.so.1 =>         /usr/pubsw/lib/libgcc_s.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        /usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1

I'm guessing Solaris 9 will still fail, too.  It just hasn't gotten as far as Solaris 8 yet.
Comment 11 Eric Botcazou 2006-03-28 06:33:07 UTC
> I rebuilt gmp with:
> 
>     --build=sparc-sun-solaris2.8
> 
> and then rebuilt MPFR, and then rebuilt gcc 4.0.3.  On Solaris 8, it is still
> dying, with:

Please post the exact configure line and command line.
Comment 12 Quanah Gibson-Mount 2006-03-28 07:21:52 UTC
For GMP (4.1.4 and 4.2, I've tried both versions):

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.52.  Invocation command line was

  $ ../../configure --datadir=${prefix}/lib --libexecdir=${prefix}/lib --sharedstatedir=${prefix}/lib --prefix=/usr/pubsw --build=sparc-sun-solaris2.8



For MPFR:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by MPFR configure 2.2.0, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ ../../configure --datadir=${prefix}/lib --libexecdir=${prefix}/lib --sharedstatedir=${prefix}/lib --prefix=/usr/pubsw --enable-thread-safe --with-gnu-ld --with-gmp=/usr/pubsw



For GCC:

# The gcc driver likes to know the arguments it was configured with.
TOPLEVEL_CONFIGURE_ARGUMENTS=../../gcc-4.0.3/configure --datadir=$${prefix}/lib --libexecdir=$${prefix}/lib --sharedstatedir=$${prefix}/lib --prefix=/usr/pub
sw --enable-threads --with-gnu-as --with-as=/usr/pubsw/bin/as --with-gnu-ld --with-ld=/usr/pubsw/bin/ld --with-libintl-prefix=/usr/pubsw --with-libiconv-prefix=/usr/pubsw --enable-libada --enable-languages=c,c++,f95,java,objc,ada



--Quanah

Comment 13 Eric Botcazou 2006-03-28 07:24:09 UTC
And the command line for the compiler?
Comment 14 Quanah Gibson-Mount 2006-03-28 07:26:25 UTC
For building GCC, I execute:

cd ../gcc-build/@sys && make CFLAGS='-O' \
    LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' 2>&1 | tee -a makeLOG


(@sys is an AFS thing, it translates to sun4x_58 or sun4x_59 in this case, depending on the OS).
Comment 15 Eric Botcazou 2006-03-28 07:28:27 UTC
> For building GCC, I execute:
> 
> cd ../gcc-build/@sys && make CFLAGS='-O' \
>     LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' 2>&1 | tee
> -a makeLOG

Use 'make bootstrap' instead of 'make'.
Comment 16 Quanah Gibson-Mount 2006-03-28 07:33:33 UTC
I will try "make bootstrap", but I note:

"make" worked fine with gcc-3.4.x, gcc-3.3.x, gcc-2.9x etc.

And for i386 and amd64 it worked just fine, too, for gcc 4.0.3 with these same versions of GMP and MPFR to build fortran.

Is this a solaris specific issue?
Comment 17 Eric Botcazou 2006-03-28 07:46:22 UTC
> "make" worked fine with gcc-3.4.x, gcc-3.3.x, gcc-2.9x etc.

Yes, but it's wrong up to (and including) 4.1.x.  We only guarantee that the compiler correctly compiles itself ("bootstraps"), not that it is correctly compiled by other compilers at random optimization levels.

> Is this a solaris specific issue?

No, this has always been documented:

@section Building a native compiler

For a native build issue the command @samp{make bootstrap}.  This
will build the entire GCC system, which includes the following steps:

@itemize @bullet
@item
Build host tools necessary to build the compiler such as texinfo, bison,
gperf.

@item
Build target tools for use by the compiler such as binutils (bfd,
binutils, gas, gprof, ld, and opcodes)
if they have been individually linked
or moved into the top level GCC source tree before configuring.

@item
Perform a 3-stage bootstrap of the compiler.

@item
Perform a comparison test of the stage2 and stage3 compilers.

@item
Build runtime libraries using the stage3 compiler from the previous step.

@end itemize
Comment 18 Quanah Gibson-Mount 2006-03-28 19:23:55 UTC
Unsuprisingly,the build still fails after changing it to use "make boostrap" in the same exact way:

/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/gfortran -B/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/ -B/usr/pubsw/sparc-sun-solaris2.8/bin/ -B/usr/pubsw/sparc-sun-solaris2.8/lib/ -isystem /usr/pubsw/sparc-sun-solaris2.8/include -isystem /usr/pubsw/sparc-sun-solaris2.8/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring -c ../../../../gcc-4.0.3/libgfortran/intrinsics/selected_int_kind.f90  -fPIC -DPIC -o .libs/selected_int_kind.o
<built-in>:0: internal compiler error: Segmentation Fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[3]: *** [selected_int_kind.lo] Error 1
make[3]: Leaving directory `/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/sparc-sun-solaris2.8/libgfortran'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/sparc-sun-solaris2.8/libgfortran'
make[1]: *** [all-target-libgfortran] Error 2
make[1]: Leaving directory `/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58'
make: *** [bootstrap] Error 2
Comment 19 kargls 2006-03-28 20:18:17 UTC
(In reply to comment #18)
> Unsuprisingly,the build still fails after changing it to
> use "make boostrap" in the same exact way:
> 
> ../../../../gcc-4.0.3/libgfortran/intrinsics/selected_int_kind.f90  -fPIC

I've scanned this thread and I have a few comments.

1) GMP/MPFR are used only by the gfortran compiler (ie not the runtime
   library).  To avoid the TLS problems, you need only build and install
   the static libraries for GMP/MPFR.

2) You really, really, really want to use at least the 4.1 tree for 
   gfortran.  There are literally 100s of bugs fixed in 4.1 and beyond
   that will never be backported to 4.0.3.



Comment 20 Eric Botcazou 2006-03-28 20:31:31 UTC
> Unsuprisingly,the build still fails after changing it to use "make boostrap"
> in the same exact way:

Maybe "unsurprisingly", but this eliminates a whole category of problems.  Could you remove --with-libintl-prefix=/usr/pubsw --with-libiconv-prefix=/usr/pubsw from the configure line and add --disable-nls instead?
Comment 21 Eric Botcazou 2006-03-28 20:41:22 UTC
> /afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/gfortran
> -B/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/
> -B/usr/pubsw/sparc-sun-solaris2.8/bin/ -B/usr/pubsw/sparc-sun-solaris2.8/lib/
> -isystem /usr/pubsw/sparc-sun-solaris2.8/include -isystem
> /usr/pubsw/sparc-sun-solaris2.8/sys-include -I . -Wall -fno-repack-arrays
> -fno-underscoring -c
> ../../../../gcc-4.0.3/libgfortran/intrinsics/selected_int_kind.f90  -fPIC -DPIC

Could you attach this selected_int_kind.f90 file to the Bugzilla PR?
Comment 22 Quanah Gibson-Mount 2006-03-28 20:56:06 UTC
I can look at only building GMP static, rather than static & shared.

I have a build of 4.1 happening on Solaris 9 at the moment after fixing the ksh issue.

--Quanah
Comment 23 Quanah Gibson-Mount 2006-03-28 20:59:11 UTC
Created attachment 11144 [details]
selected_int_kind.f90

selected_int_kind.f90 (it is just what is shipped with the gcc-4.0.3 source...)
Comment 24 Quanah Gibson-Mount 2006-03-28 20:59:54 UTC
I will look at removing the libintl/libiconv bits, but in the past gcc failed to find them without adding those flags.
Comment 25 Eric Botcazou 2006-03-28 21:03:27 UTC
> selected_int_kind.f90 (it is just what is shipped with the gcc-4.0.3 source...)

Except that it is generated on the fly by mk-sic-ink.sh...
Comment 26 Eric Botcazou 2006-03-28 21:07:02 UTC
> Except that it is generated on the fly by mk-sic-ink.sh...

Sorry, I was talking about selected_int_kind.inc... Could you attach this one?
Comment 27 Quanah Gibson-Mount 2006-03-29 01:47:09 UTC
I'll try the flags and get the attachment to you tomorrow.  Today is my birthday, and my wife doesn't really want me on the computer much. ;)

So far, gcc 4.1.0 looks to be building without issue.
Comment 28 Quanah Gibson-Mount 2006-03-29 22:12:47 UTC
Created attachment 11160 [details]
selected_int_kind.inc

Here's the selected_int_kind.inc file generated on Solaris 8 with gcc 4.0.3.
Comment 29 Eric Botcazou 2006-03-30 06:20:22 UTC
> Here's the selected_int_kind.inc file generated on Solaris 8 with gcc 4.0.3.

Thanks.  Victory, at last something obviously broken. :-)  The file reads:

  integer, parameter :: c = 0
  type (int_info), parameter :: int_infos(c) = (/ &

while it should read:

  integer, parameter :: c = 4
  type (int_info), parameter :: int_infos(c) = (/ &
    int_info (1, range(0_1)), &
    int_info (2, range(0_2)), &
    int_info (4, range(0_4)), &
    int_info (8, range(0_8)) /)

so again the Fortran compiler either doesn't work or is not correctly invoked.


In the $objdir/sparc-sun-solaris2.8/libgfortran directory, delete the file (selected_int_kind.inc) and type 'gmake selected_int_kind.inc'.  You should see something like:

/bin/ksh /home/eric/svn/gcc-4_0-branch/libgfortran/mk-sik-inc.sh '/opt/build/eric/gcc-4_0-branch/gcc/gfortran -B/opt/build/eric/gcc-4_0-branch/gcc/ -B/opt/build/eric/local/gcc-4_0-branch/sparc-sun-solaris2.8/bin/ -B/opt/build/eric/local/gcc-4_0-branch/sparc-sun-solaris2.8/lib/ -isystem /opt/build/eric/local/gcc-4_0-branch/sparc-sun-solaris2.8/include -isystem /opt/build/eric/local/gcc-4_0-branch/sparc-sun-solaris2.8/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring-g -O2' > selected_int_kind.inc

Could you try to re-play the script mk-sik-inc.sh by hand and find out when things start to go awry?
Comment 30 Quanah Gibson-Mount 2006-03-30 16:48:10 UTC
Here is what happens when I run it by hand:

solaris8-build:/afs/ir/src/pubsw/languages/gcc-build/sun4x_58/sparc-sun-solaris2.8/libgfortran> /bin/ksh ../../../../gcc-4.0.3/libgfortran/mk-sik-inc.sh '/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/gfortran -B/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/ -B/usr/pubsw/sparc-sun-solaris2.8/bin/ -B/usr/pubsw/sparc-sun-solaris2.8/lib/ -isystem /usr/pubsw/sparc-sun-solaris2.8/include -isystem /usr/pubsw/sparc-sun-solaris2.8/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring '
  integer, parameter :: c = 0
  type (int_info), parameter :: int_infos(c) = (/ &


No errors or anything... It just spits out the broken bits.
Comment 31 Eric Botcazou 2006-03-30 16:52:44 UTC
> No errors or anything... It just spits out the broken bits.

OK.  Could you then break apart the script and run the various pieces manually?
Comment 32 Quanah Gibson-Mount 2006-03-30 17:10:14 UTC
Okay, I created the following file (as is generated by the script):

solaris8-build:/tmp> cat /tmp/q1.f90
  integer (kind=1) :: x
  end


Then ran the build command on it as is done by the script:

/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/gfortran -B/afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/ -B/usr/pubsw/sparc-sun-solaris2.8/bin/ -B/usr/pubsw/sparc-sun-solaris2.8/lib/ -isystem /usr/pubsw/sparc-sun-solaris2.8/include -isystem /usr/pubsw/sparc-sun-solaris2.8/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring /tmp/q1.f90


and I get:

<built-in>:0: internal compiler error: Segmentation Fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


so the compiler is completely flailing on this. :(
Comment 33 Quanah Gibson-Mount 2006-03-30 17:17:17 UTC
GDB shows:

GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.8"...
(gdb) run
Starting program: /afs/ir.stanford.edu/src/pubsw/languages/gcc-build/sun4x_58/gcc/f951

Program received signal SIGSEGV, Segmentation fault.
0x0035c398 in mpfr_set_default_prec ()
(gdb) bt
#0  0x0035c398 in mpfr_set_default_prec ()
#1  0x0001496c in gfc_arith_init_1 () at ../../../gcc-4.0.3/gcc/fortran/arith.c:180
#2  0x0003e730 in gfc_init_1 () at ../../../gcc-4.0.3/gcc/fortran/misc.c:287
#3  0x0005d7d4 in gfc_init () at ../../../gcc-4.0.3/gcc/fortran/f95-lang.c:292
#4  0x00281514 in toplev_main (argc=Variable "argc" is not available.
) at ../../../gcc-4.0.3/gcc/toplev.c:2019
#5  0x000118d4 in .nope ()
#6  0x000118d4 in .nope ()
Comment 34 Eric Botcazou 2006-03-30 17:35:25 UTC
> Program received signal SIGSEGV, Segmentation fault.
> 0x0035c398 in mpfr_set_default_prec ()
> (gdb) bt
> #0  0x0035c398 in mpfr_set_default_prec ()

OK.  Could you ditch MPFR 2.2.0 entirely and use the MPFR library bundled with GMP 4.2?  The configure line for GMP is on the Solaris build instructions page.
Comment 35 Quanah Gibson-Mount 2006-03-30 17:40:01 UTC
From the GMP 4.2 NEWS file:

  Mis-features:
  * mpfr is gone, and will from now on be released only separately.  Please see
    www.mpfr.org.

Comment 36 Quanah Gibson-Mount 2006-03-30 17:48:57 UTC
Just to note, if I haven't already, I was able to build gcc 4.0.3 with GMP 4.2 and MPFR 2.2.0 on i386 and amd64 without a problem (including fortran), so this seems to be a problem specific to Solaris 8/9.
Comment 37 Eric Botcazou 2006-03-30 18:48:48 UTC
> From the GMP 4.2 NEWS file:
> 
>   Mis-features:
>   * mpfr is gone, and will from now on be released only separately.  Please see
>     www.mpfr.org.

Grumpf... Could you downgrade to 4.1.x then?
Comment 38 Quanah Gibson-Mount 2006-03-30 21:18:18 UTC
Yeah, I'll give that a shot next week (i'm now in a freeze period).

I've also been poking at MPFR.  There are apparently 10 or more patches now for 2.2.0, that may resolve the issues, too.  I'll look at that.  I've rebuilt it, and ran the "check" area for mpfr, and 115/117 tests fail, so I'm guessing there are some serious issues there with MPFR.  I've also subscribed to their list, because I can see that until MPFR is no longer busted, gcc isn't going to be working. ;)
Comment 39 Eric Botcazou 2006-03-31 09:53:04 UTC
> I've also been poking at MPFR.  There are apparently 10 or more patches now for
> 2.2.0, that may resolve the issues, too.  I'll look at that.  I've rebuilt it,
> and ran the "check" area for mpfr, and 115/117 tests fail.

I cannot reproduce that: MPFR 2.2.0 is clean (117/117 tests OK ) if configured with './configure --build=sparc-sun-solaris2.8 --with-gmp=/opt/build/eric/local' against GMP 4.1.3 and built by GCC 4.0.2 with 'gmake' on the Solaris 8 box.
GMP 4.1.3 was configured with './configure --build=sparc-sun-solaris2.8' and built by GCC 4.0.2 with 'gmake'.
Comment 40 Eric Botcazou 2006-03-31 10:54:20 UTC
This is the build with GMP 4.1.3 and MPFR 2.2.0:

gax% gcc/xgcc -v
Using built-in specs.
Target: sparc-sun-solaris2.8
Configured with: /home/eric/svn/gcc-4_0-branch/configure --prefix=/opt/build/eric/local/gcc-4_0-branch --with-gmp=/opt/build/eric/local2 --with-mpfr=/opt/build/eric/local2 --with-local-prefix=/opt/build/eric/local2 --enable-languages=c,f95
Thread model: posix
gcc version 4.0.3
Comment 41 Francois-Xavier Coudert 2006-05-19 16:51:08 UTC
I'm puzzled by this PR and PR 26893: what is the status on those reports? Did you reproduce this on a given platform, with *known good* GMP and MPFR and with a gfortran >= 4.1 ?

Otherwise, I supposed we might close both: I do regularly build on gfortran on sparc-sun-solaris2.9, with no problem. Note that it doesn't mean we can't work on resolving the issue, reopening a PR if the reporter has time to investigate further.
Comment 42 Quanah Gibson-Mount 2006-05-19 17:09:10 UTC
I will be working on this after the students leave, starting in June.  Please keep this ticket open.

I note that the versions of GMP & MPFR I'm using work *fine* on linux, so I consider them "known good".  They only don't work with Solaris.
Comment 43 Andrew Pinski 2006-08-15 18:16:07 UTC
No feedback in 3 months and gfortran is known to build just fine on sparc-solaris (using working GMP).
Comment 44 Quanah Gibson-Mount 2006-08-15 18:23:04 UTC
This entire problem stems from having:

--enable-thread-safe

when building MPFR on Solaris.  I finally got gcc 4.0.3 to build gfortran for me last week after fixing that configure line to MPFR.