Bug 53731 - [4.7] Bootstrap fails for libgfortran on Solaris 10 x86 with error "Where has __float128 gone?"
Summary: [4.7] Bootstrap fails for libgfortran on Solaris 10 x86 with error "Where has...
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.7.2
: P3 major
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-20 12:04 UTC by Martin
Modified: 2017-03-16 00:05 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.7.0, 4.7.1, 4.7.2
Last reconfirmed:


Attachments
Details (1.95 KB, text/plain)
2012-06-20 12:04 UTC, Martin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2012-06-20 12:04:52 UTC
Created attachment 27665 [details]
Details

GCC 4.7.1 fails to bootstrap on Solaris 10 due to a linker / multilib problem affecting the configure script.

In file included from ./kinds.h:75:0,
                 from /opt/SP/build/gcc/gcc-4.7.1/libgfortran/libgfortran.h:232,
                 from /opt/SP/build/gcc/gcc-4.7.1/libgfortran/fmain.c:4:
/opt/SP/build/gcc/gcc-4.7.1/libgfortran/kinds-override.h:40:5: error: #error "Where has __float128 gone?"
gmake[6]: *** [fmain.lo] Error 1
gmake[6]: Leaving directory `/opt/SP/build/gcc/gcc-4.7.1-build/i386-pc-solaris2.10/amd64/libgfortran'

Root cause is that the check for __float128 in the configure script fails since the linker does not use the 64bit libgcc due to a wrong LD_LIBRARY_PATH definition passed to the configure script (see attachment).

configure:24967: checking whether we have a usable __float128 type
configure:25054: /opt/SP/build/gcc/gcc-4.7.1-build/./gcc/xgcc -B/opt/SP/build/gcc/gcc-4.7.1-build/./gcc/ -B/opt/SP/gcc/g
cc-4.7.1/i386-pc-solaris2.10/bin/ -B/opt/SP/gcc/gcc-4.7.1/i386-pc-solaris2.10/lib/ -isystem /opt/SP/gcc/gcc-4.7.1/i386-p
c-solaris2.10/include -isystem /opt/SP/gcc/gcc-4.7.1/i386-pc-solaris2.10/sys-include  -m64 -o conftest -std=gnu99 -g -O2
 -march=core2 -mfpmath=sse -msse3 -mno-ssse3 -mno-avx -I/opt/SP/gcc/gcc-4.7.1/include -I/opt/SP/gcc/current/include -I/u
sr/sfw/include   conftest.c  >&5
ld: warning: file /opt/SP/gcc/current/lib/gcc/platform/current//libgcc.a(_divtc3.o): wrong ELF class: ELFCLASS32
Undefined                       first referenced
 symbol                             in file
__divtc3                            /var/tmp//cc6TdICW.o
__divtf3                            /var/tmp//cc6TdICW.o
__multf3                            /var/tmp//cc6TdICW.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: error: ld returned 1 exit status


One workaround is to add MULTISUBDIR to the HOST_LIB_PATH_gcc in the Makefile. I patched ./Makefile.in and the build works, although I don't know if this is the right way to achieve this...

@@ -629,7 +629,7 @@ HOST_LIB_PATH = $(HOST_LIB_PATH_bfd)$(HO

 # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
 @if gcc
-HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(MULTISUBDIR)$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(MULTISUBDIR)$(GCC_SHLIB_SUBDIR):
+HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR):
 @endif gcc
Comment 1 Martin 2012-06-28 14:14:49 UTC
Just realized the diff output is in the wrong order, sorry.
Comment 2 Martin 2013-02-21 10:53:07 UTC
Ping?
Bug still exists in 4.7.2, workaround stays the same:

--- gcc-4.7.2_unpatched/Makefile.tpl    2012-08-06 16:34:27.000000000 +0200
+++ gcc-4.7.2_patched/Makefile.tpl      2013-02-21 12:11:44.817759549 +0100
@@ -555,7 +555,7 @@ HOST_LIB_PATH = [+ FOR host_modules +][+

 # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
 @if gcc
-HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR):
+HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(MULTISUBDIR)$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(MULTISUBDIR)$(GCC_SHLIB_SUBDIR):
 @endif gcc

 [+ FOR host_modules +][+ IF lib_path +]


--- gcc-4.7.2_unpatched/Makefile.in     2012-08-06 16:34:27.000000000 +0200
+++ gcc-4.7.2_patched/Makefile.in       2013-02-21 12:11:44.817793304 +0100
@@ -629,7 +629,7 @@ HOST_LIB_PATH = $(HOST_LIB_PATH_bfd)$(HO

 # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
 @if gcc
-HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR):
+HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(MULTISUBDIR)$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(MULTISUBDIR)$(GCC_SHLIB_SUBDIR):
 @endif gcc
Comment 3 Martin Sebor 2017-03-16 00:05:34 UTC
GCC 4.7 is no longer maintained.  Current trunk of GCC 7.0 has been reported to successfully bootstrap on Solaris 11 (https://gcc.gnu.org/ml/gcc-testresults/2017-03/msg01380.html) and Solaris 12 (https://gcc.gnu.org/ml/gcc-testresults/2017-03/msg01377.html).  There are no recent reports for older Solaris and I'm not sure it's supported/maintained there.  Please try a more recent GCC (ideally on newer Solaris if you can).  I'm closing this as won't fix due to 4 years with no activity.