From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id E36C43858C83 for ; Tue, 19 Apr 2022 13:36:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E36C43858C83 Received: by mail-wr1-x431.google.com with SMTP id k22so22478316wrd.2 for ; Tue, 19 Apr 2022 06:36:14 -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=WVU6AOTo1zsOX78ohNgFUtH4M/Zefy8+2gMtmXvmhMk=; b=fs4L9obZMjEEGxblr4iltSFvGGG8e7G41cvPYklXzueZJQsHvq3B/IgJieDcOam+ok FvNgBBOPTtvOKwkrl7TSDyfZlxIFq2pq8oxRqWUqQqyUPby+xcJjLfDkj+EIjW4Qbamm aPIlz2xXgyiNCjlEOigk3xOd5gg8BJrzPjjqKWC/VdaR4WcIP/2/FR8D7hjutIH7pg7a 5zxOE5W8DnoyUzpMNFuVs9KFbcWQ4Itm91BDt2c2N0+3SVo6Q8wD+cjOvGw0hNAcWDua I4j1wdI1I4M8O7vJzkp72osm8ZkCxKPRS/37pckD6xEDT6w8J7X86bXdCjjymAwOQgmf GTjg== X-Gm-Message-State: AOAM532v3cxjPxmNbtKhbDCSxM0U6oyQfUAUAPNLccXQcBtPyI7RFL1i oAeQmS9X9H93pZ6KaZsMXjcuMSGdwBg5JZrxjkU= X-Google-Smtp-Source: ABdhPJykKyFnPqKqrRXMdrHZCcw2XFmJ5ysGvnYD3iYyv6CmChCV/Mh1FMtOlT/O6DruDXsxhvbT/aKBLGZy1vcxYMs= X-Received: by 2002:a5d:6d08:0:b0:20a:88bf:6d6e with SMTP id e8-20020a5d6d08000000b0020a88bf6d6emr10666447wrq.152.1650375373587; Tue, 19 Apr 2022 06:36:13 -0700 (PDT) MIME-Version: 1.0 References: <20220416053920.4hj6vcnqqlscile7@mattwilson.org> <20220416192445.dxuftlrblkhctmir@mattwilson.org> In-Reply-To: From: Jonathan Wakely Date: Tue, 19 Apr 2022 14:36:02 +0100 Message-ID: Subject: Re: Error when building gcc w/ Go language on Solaris To: Ian Lance Taylor Cc: "Matthew R. Wilson" , gcc-help Content-Type: multipart/mixed; boundary="000000000000e3b17d05dd01f53c" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 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: Tue, 19 Apr 2022 13:36:17 -0000 --000000000000e3b17d05dd01f53c Content-Type: text/plain; charset="UTF-8" On Sun, 17 Apr 2022 at 09:23, Jonathan Wakely wrote: > > > > On Sun, 17 Apr 2022, 01:39 Ian Lance Taylor, wrote: >> >> On Sat, Apr 16, 2022 at 12:42 PM Jonathan Wakely via Gcc-help >> wrote: >> > >> > On Sat, 16 Apr 2022, 20:24 Matthew R. Wilson, >> > wrote: >> > >> > > On 04.16.2022 07:33, Jonathan Wakely wrote: >> > > >On Sat, 16 Apr 2022, 06:40 Matthew R. Wilson, >> > > >wrote: >> > > > >> > > >> I am revisiting my attempts to build GCC with Go language support on >> > > >> Solaris/SPARCv9. >> > > >> >> > > >> The error I get when I make is: >> > > >> ../.././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 >> > > >> >> > > >> 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 >> > > > >> > > >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 >> > > >> > > Aha! What a great guess -- that fixed it! Thank you so much! >> > > >> > >> > Great! We should document this, if we don't already. And even better would >> > be if the build failed with a clear error mentioning the need for POSIX sed >> > (or whichever command it was). >> >> I'm happy to fix the POSIX sed requirement if we can find out where it comes in. >> >> I can't seem to access any Solaris systems at the moment so I can't >> recreate it myself. > > > > We have a couple in the GCC compiler farm. I'll look into it on Tuesday. The 'check-tail' target in libgo/Makefile.am does: ... | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum This doesn't work with Solaris sed (and is documented by Autoconf as being non-portable). The $ needs to be outside the back-reference expression: ... | sed -n -e 's/.* \(version.*\)$$/\1/p'` >> libgo.sum This should be OK to change, because the $ is just an anchor and doesn't need to be captured. More significantly, I see errors like: /export/home/jwakely/src/gcc/libgo/match.sh: line 114: ((: go1.13 : syntax error: invalid arithmetic operator (error token is ".13 ") That script uses \+ in a sed script, which is not supported by POSIX sed, because it's not in the BRE grammar. That seems to be the cause of the match.sh errors. The attached patch fixes it. --000000000000e3b17d05dd01f53c Content-Type: text/plain; charset="US-ASCII"; name="patch.txt" Content-Disposition: attachment; filename="patch.txt" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l266uu830 ZGlmZiAtLWdpdCBhL2xpYmdvL21hdGNoLnNoIGIvbGliZ28vbWF0Y2guc2gKaW5kZXggMTM5ZDBj ZGJlNjQuLjdlZDU4N2ZmNzk0IDEwMDc1NQotLS0gYS9saWJnby9tYXRjaC5zaAorKysgYi9saWJn by9tYXRjaC5zaApAQCAtMTAwLDcgKzEwMCw3IEBAIGZpCiAKIGdvYnVpbGQoKSB7CiAgICAgbGlu ZT0kKGVjaG8gIiQxIiB8IHNlZCAtZSAnc3wvL2dvOmJ1aWxkIHx8JykKLSAgICBsaW5lPSQoZWNo byAiJGxpbmUiIHwgc2VkIC1lICdzL2dvMVwuWzAtOV1cKy8xL2cnIC1lICdzL2dvZXhwZXJpbWVu dFwuL2dvZXhwZXJpbWVudC8nKQorICAgIGxpbmU9JChlY2hvICIkbGluZSIgfCBzZWQgLWUgJ3Mv Z28xXC5bMC05XVswLTldKi8xL2cnIC1lICdzL2dvZXhwZXJpbWVudFwuL2dvZXhwZXJpbWVudC8n KQogICAgIGxpbmU9IiAkbGluZSAiCiAgICAgd3JhcD0nWyAoKSEmfF0nCiAgICAgZm9yIG9uZXMg aW4gJGdvYXJjaCAkZ29vcyAkY2dvdGFnICRjbWRsaW5ldGFnIGdjY2dvIGdvZXhwZXJpbWVudGZp ZWxkdHJhY2s7IGRvCg== --000000000000e3b17d05dd01f53c--