From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 13FAC3858430 for ; Sat, 16 Apr 2022 06:34:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 13FAC3858430 Received: by mail-wr1-x436.google.com with SMTP id u3so12808026wrg.3 for ; Fri, 15 Apr 2022 23:34:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NKTbgvQqgifnv201BMgezQtUXjlsZfb1LFnvZVknvlY=; b=spIzERtGrD5sw+Dups+QKQmYjPjjzp1NVjRkQ08shrR1L891TzOl1ATNo94YpzQVzS 80N//cKVjUx3PgE/B94V8OC1JIHZ7ajNUvHFNakn32XIqx2SMsFhWE6mVgEZXLKL8zmP KfSMB7vglILxnC58g9HPvQ7dcoQrvFfLkpyEnIY1T5h+05n4mK0yIbRbQuXE6sH7pFvr Z6cJqEwfo97bRJP8SP8YKYkXhKF2JLdH1kOfOLqOzoj5WrJyRaUvXcFokt3x0PV58hnr dP9/oasrljQl4ivbI4MUuOf0DrMLCM3ZlQg0JPi3m8wx2mVjoR3Oc52OZxCzqDizhdgA T4tw== X-Gm-Message-State: AOAM530YbMV251LrVq7mM4Tf5NhgYVQWjp2GU+I9AnD5fG0k9050srrC +SutDwJ6mm8keIagnDSUyhfYj12+c4HGCuIjb5k= X-Google-Smtp-Source: ABdhPJxHGSPvvt1W+maAhwwYoyBrzgeKT5HXzksIbegmFQemHcNNc/QBMmzsh/HEEIQr/NVm/EF/IMg26y5vCUDk7g0= X-Received: by 2002:a05:6000:1888:b0:204:1a8b:2999 with SMTP id a8-20020a056000188800b002041a8b2999mr1583511wri.221.1650090851894; Fri, 15 Apr 2022 23:34:11 -0700 (PDT) MIME-Version: 1.0 References: <20220416053920.4hj6vcnqqlscile7@mattwilson.org> In-Reply-To: <20220416053920.4hj6vcnqqlscile7@mattwilson.org> From: Jonathan Wakely Date: Sat, 16 Apr 2022 07:33:57 +0100 Message-ID: Subject: Re: Error when building gcc w/ Go language on Solaris To: "Matthew R. Wilson" Cc: gcc-help X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2022 06:34:15 -0000 On Sat, 16 Apr 2022, 06:40 Matthew R. Wilson, wrote: > 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. > Just a guess, but maybe the Go build uses sed or another command like that, and relies on the POSIX-conforming version in /usr/xpg4/bin rather than the /usr/bin one. Try putting /usr/xpg4/bin in your path, just after /opt/mrwgcc/bin > >