public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Error when building gcc w/ Go language on Solaris
@ 2022-04-16  5:39 Matthew R. Wilson
  2022-04-16  6:33 ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: Matthew R. Wilson @ 2022-04-16  5:39 UTC (permalink / raw)
  To: gcc-help

Hello,

I am revisiting my attempts to build GCC with Go language support on
Solaris/SPARCv9.

The error I get when I make is:

/export/home/mwilson/gcc-build/gcc-11.2.0/host-sparcv9-sun-solaris2.11/gcc/gccgo -B/export/home/mwilson/gcc-build/gcc-11.2.0/host-sparcv9-sun-solaris2.11/gcc/ -B/opt/mrwgcc/sparcv9-sun-solaris2.11/bin/ -B/opt/mrwgcc/sparcv9-sun-solaris2.11/lib/ -isystem /opt/mrwgcc/sparcv9-sun-solaris2.11/include -isystem /opt/mrwgcc/sparcv9-sun-solaris2.11/sys-include   -g -O2 -I ../sparcv9-sun-solaris2.11/libgo  -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  
../.././gotools/../libgo/go/cmd/go/main.go:10:16: error: /export/home/mwilson/gcc-build/gcc-11.2.0/host-sparcv9-sun-solaris2.11/gcc/context.o exists but does not contain any Go export data

...followed by many errors about import files (starting with 'context')
not found.

This is when trying to build GCC 11.2, but I had the same problem over
many attempts to build GCC 11.1 a while ago.

(I've gotten the same error when I get this far when trying to build on
AIX/ppc64, but we'll just stay focused on Solaris here.)

It must be possible to build gccgo support on this platform, because the
latest Solaris 11.4 update includes it.

With the gcc that is included in Solaris, I can run `gcc -v` and see:

Configured with: /builds2/ulhg/mrcarson-trunk_111/components/gcc11/gcc-11.2.0/configure --prefix=/usr/gcc/11 --mandir=/usr/gcc/11/share/man --bindir=/usr/gcc/11/bin --sbindir=/usr/gcc/11/sbin --libdir=/usr/gcc/11/lib --infodir=/usr/gcc/11/share/info --libexecdir=/usr/gcc/11/lib --enable-languages=ada,c,c++,fortran,go,objc --enable-shared --enable-initfini-array --disable-rpath --with-system-zlib --with-build-config=no --without-gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --with-as=/usr/gnu/bin/as --disable-bootstrap 'BOOT_CFLAGS=-g -O2' sparcv9-sun-solaris2.11

To try to build my own from scratch, I have done the following on
Solaris 11.4.42.111.0:

1) build the latest gnu binutils and installed at prefix /opt/mrwgcc
    (building gcc w/ go seems to *require* objcopy be present)

2) renamed the binutils-provided "ld" to "gnuld" just to make sure it
isn't picked up by anything in preference to the Solaris ld. (The GCC
platform notes for Solaris recommend using the Solaris ld.)

3) Set my PATH to: /opt/mrwgcc:/usr/bin:/usr/sbin

4) configured gcc 11.2 with a similar set of options as the
Solaris-provided gcc:

./configure --prefix=/opt/mrwgcc \
	--enable-languages=c,c++,go  --enable-shared \
	--enable-initfini-array \
	--disable-rpath --with-system-zlib --with-build-config=no \
	--without-gnu-ld --with-ld=/usr/bin/ld \
	--with-gnu-as --with-as=/opt/mrwgcc/bin/as sparcv9-sun-solaris2.11

Despite using what appear to be the same options (in particular, using
the Solaris ld and not binutils ld) as the working gccgo that comes with
Solaris, I can't get my build to work. I hit that "/context.o exists but
does not contain any Go export data" error no matter what I try.

A build with only --enable-languages=c,c++ works fine.

I'm thinking there must be something else about my environment that
differs from the package build environment, but I don't know what the
magic needed to build gccgo is.

If anyone has any suggestions, I'd appreciate them.

Thanks,
Matthew


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

end of thread, other threads:[~2022-04-19 19:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-16  5:39 Error when building gcc w/ Go language on Solaris Matthew R. Wilson
2022-04-16  6:33 ` Jonathan Wakely
2022-04-16 19:24   ` Matthew R. Wilson
2022-04-16 19:41     ` Jonathan Wakely
2022-04-16 19:47       ` Marc Glisse
2022-04-16 23:17         ` Jonathan Wakely
2022-04-17  0:38       ` Ian Lance Taylor
2022-04-17  8:23         ` Jonathan Wakely
2022-04-19 13:36           ` Jonathan Wakely
2022-04-19 19:50             ` Ian Lance Taylor

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