# uname -a
SunOS opensolaris 5.11 snv_101b i86pc i386 i86pc Solaris

# /usr/share/src/gcc_build/gcc/xgcc -v
Using built-in specs.
Target: i386-pc-solaris2.11
Configured with: ../gcc_trunk/configure
--enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --enable-multilib
--enable-shared --disable-static --enable-decimal-float -enable-nls
Thread model: posix
gcc version 4.4.0 20090101 (experimental) (GCC) 

I installed http://ftp.gnu.org/gnu/binutils/binutils-2.19.tar.bz2 and
I am aware of the ./configure arguments usually used on OpenSolaris.


The "Bug":

The file gcc/config/i386/sol2-10.h uses "USE_GAS" in an "#ifdef" (on
line 27) but since "USE_GAS" does not get defined the "#else" is taken.

That results in "-xarch=" being used in an argument for "as".

The file gcc/config/i386/sol2-10.h says:
/* binutils' GNU as understands --32 and --64, but the native Solaris
   assembler requires -xarch=generic or -xarch=generic64 instead.  */


The OpenSolaris (2008.11) man page for "as" (dated 2004-10-28) says:

 Target SPARC options:
    [-Av6|-Av7|-Av8|-Asparclet|-Asparclite
     -Av8plus|-Av8plusa|-Av9|-Av9a]
    [-xarch=v8plus|-xarch=v8plusa] [-bump]
    [-32|-64]

 Target i386 options:
    [--32|--64] [-n]



There seem to be a few incorrect assumptions that have come together
to cause us to make assumptions about what was originally intended and
how best to fix it.

The file "gcc/config/i386/sol2-10.h" uses the term "native Solaris 
assembler" but it is very unlikely that someone would use Sun Studio's 
assembler with "xgcc", they might use "Sun's supplied GNU as" (if that 
is what is meant by the term "native Solaris assembler") with xgcc
(but not if they just finished installing binutils 2.19) but "as"
does not accept "-xarch" (for the x86 platform).

The term "native Solaris assembler" is confusing since it is common
to use "GNU as" for GNU programs (especially xgcc), perhaps it is a
mis-thought confusion of the so-called "native Solaris linker" which
is Sun's modified version of GNU's "ld". Sun has a recommended linker
to use for linking but the assembler (or compiler) is not so restricted.

The "#ifdef" seems only helpful for the "sparc" platform and not
useful for the "x86" the author seems willing to set "-xarch=generic"
and "-xarch=generic64" but ought to use "--32" or "--64" instead.


If we leave things as they currently are the build breaks here:
----------
Running configure in multilib subdir amd64
pwd: /usr/share/src/gcc_build/i386-pc-solaris2.11
mkdir amd64
configure: creating cache ./config.cache
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking for gawk... gawk
checking build system type... i386-pc-solaris2.11
checking host system type... i386-pc-solaris2.11
checking for i386-pc-solaris2.11-ar... /usr/local/i386-pc-solaris2.11/bin/ar
checking for i386-pc-solaris2.11-lipo... lipo
checking for i386-pc-solaris2.11-nm... /usr/share/src/gcc_build/./gcc/nm
checking for i386-pc-solaris2.11-ranlib...
/usr/local/i386-pc-solaris2.11/bin/ranlib
checking for i386-pc-solaris2.11-strip...
/usr/local/i386-pc-solaris2.11/bin/strip
checking whether ln -s works... yes
checking for i386-pc-solaris2.11-gcc... /usr/share/src/gcc_build/./gcc/xgcc
-B/usr/share/src/gcc_build/./gcc/ -B/usr/local/i386-pc-solaris2.11/bin/
-B/usr/local/i386-pc-solaris2.11/lib/ -isystem
/usr/local/i386-pc-solaris2.11/include -isystem
/usr/local/i386-pc-solaris2.11/sys-include  -m64
checking for suffix of object files... configure: error: in
`/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
gmake[2]: *** [configure-stage1-target-libgcc] Error 1
gmake[2]: Leaving directory `/usr/share/src/gcc_build'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/usr/share/src/gcc_build'
gmake: *** [all] Error 2
u...@opensolaris:/usr/share/src/gcc_build#
----------

If I change "#ifndef USE_GAS" to "#ifndef USE_GAS" then I can compile 
past that point -- investigating the correct fix, back soon ...

Rob


-- 
           Summary: gcc 4.4.0 20090101 - gcc/config/i386/sol2-10.h uses
                    "USE_GAS" which is undefined
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rob1weld at aol dot com
 GCC build triplet: i386-pc-solaris2.11
  GCC host triplet: i386-pc-solaris2.11
GCC target triplet: i386-pc-solaris2.11


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38693

Reply via email to