Unable to build GCC 11.1 with Go support on Solaris sparcv9

Matthew R. Wilson mwilson@mattwilson.org
Sun May 23 20:07:34 GMT 2021


Hello,

I am trying to build GCC 11.1.0 with the Go language enabled on Solaris
11.4 on Sparc.

The important error message seems to be this one:

../.././gotools/../libgo/go/cmd/go/main.go:10:16: error: /export/home/mwilson/gcc111build/gcc-11.1.0/host-sparcv9-sun-solaris2.11/gcc/context.o exists but does not contain any Go export data
    10 |         "context"

This is when make is running:

gmake[2]: Entering directory '/export/home/mwilson/gcc111build/gcc-11.1.0/host-sparcv9-sun-solaris2.11/gotools'
/export/home/mwilson/gcc111build/gcc-11.1.0/host-sparcv9-sun-solaris2.11/gcc/gccgo -B/export/home/mwilson/gcc111build/gcc-11.1.0/host-sparcv9-sun-solaris2.11/gcc/ -B/opt/gcc111/sparcv9-sun-solaris2.11/bin/ -B/opt/gcc111/sparcv9-sun-solaris2.11/lib/ -isystem /opt/gcc111/sparcv9-sun-solaris2.11/include -isystem /opt/gcc111/sparcv9-sun-solaris2.11/sys-include   -g -O2 -I ../sparcv9-sun-solaris2.11/libgo -static-libstdc++ -static-libgcc  -L ../sparcv9-sun-solaris2.11/libgo -L ../sparcv9-sun-solaris2.11/libgo/.libs -o go ../.././gotools/../libgo/go/cmd/go/alldocs.go ../.././gotools/../libgo/go/cmd/go/go11.go ../.././gotools/../libgo/go/cmd/go/main.go ../sparcv9-sun-solaris2.11/libgo/libgotool.a

Additional Information
----------------------

Configured with:
OBJCOPY=/opt/gcc111/bin/objcopy; export OBJCOPY
./configure --build=sparcv9-sun-solaris2.11 \
   --prefix=/opt/gcc111 \
   --enable-languages=c,c++,go

The objcopy at /opt/gcc111/bin/objcopy was freshly built from binutils
2.36.1. The existing GCC version on the system is 7.3.0.

I originally tried building without binutils/objcopy available, as it is
not documented as a required component for building on solaris/sparc64.
However, that leads to errors; it is apparently an undocumented
requirement when you include Go language support. (See:
<https://gcc.gnu.org/legacy-ml/gcc-help/2013-10/msg00100.html>)

So I built binutils and put it at the beginning of my path.
The build fails early when using the binutils ld instead of the system
ld.

Getting rid of all GNU binutils components except objcopy gets through
the C and C++ builds successfully, but then we are left with the error
above when it's working on Go.

objdump -h on the .../host-sparcv9-sun-solaris2.11/gcc/context.o file
shows:

file format elf64-sparc-sol2

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
   0 .text         00000074  0000000000000000  0000000000000000  00000150  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
   1 .bss          00000008  0000000000000000  0000000000000000  000001c8  2**3
                   ALLOC
   2 .debug_frame  00000068  0000000000000000  0000000000000000  000001c8  2**3
                   CONTENTS, RELOC, READONLY, DEBUGGING
   3 .eh_frame     00000058  0000000000000000  0000000000000000  00000230  2**3
                   CONTENTS, ALLOC, LOAD, RELOC, DATA
   4 .debug_info   00008674  0000000000000000  0000000000000000  00000288  2**0
                   CONTENTS, RELOC, READONLY, DEBUGGING
   5 .debug_abbrev 00000577  0000000000000000  0000000000000000  000088fc  2**0
                   CONTENTS, READONLY, DEBUGGING
   6 .debug_loclists 0000005a  0000000000000000  0000000000000000  00008e73  2**0
                   CONTENTS, RELOC, READONLY, DEBUGGING
   7 .debug_aranges 00000030  0000000000000000  0000000000000000  00008ecd  2**0
                   CONTENTS, RELOC, READONLY, DEBUGGING
   8 .debug_line   00000727  0000000000000000  0000000000000000  00008efd  2**0
                   CONTENTS, RELOC, READONLY, DEBUGGING
   9 .debug_str    000000e4  0000000000000000  0000000000000000  00009624  2**0
                   CONTENTS, READONLY, DEBUGGING
  10 .comment      00000059  0000000000000000  0000000000000000  0000a408  2**0
                   CONTENTS, READONLY

Has anyone successfully built GCC with --enable-languages=c,c++,go on
Solaris on Sparc and can let me know the set of prerequisites that
works?

Thanks,
Matthew



More information about the Gcc-help mailing list