From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by sourceware.org (Postfix) with ESMTPS id 9961C3858D1E for ; Sun, 17 Apr 2022 00:39:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9961C3858D1E Received: by mail-lf1-x133.google.com with SMTP id x33so19408994lfu.1 for ; Sat, 16 Apr 2022 17:39:05 -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=UJ7804oeGJGW/xUzlNrs3bBaZRiLsa1LfSicKeU0C70=; b=dAHo0wKBlmPHZ4WNDapwgKpPJzzEi0/9wpVf6wFyh3+boi9qgzlMvSggX8nLDPzNIn EvLA6kfCQVDiyecWEOYhXIS36Be7N++2rubgx1ZMtT00j/V0EC4ebqW+PqZXlg+ynIn5 NSxpqPffdyFyJZ+Vuz76YdPd5Rn3bdHsEgcUcw+MWAR1eGgtrXVOZQkQz1cbHf4EOYJe lZoXB766gHPAbswmQk9dOLcPm9/9dV39OPOur7XlA8802T6ErJtSXEK6Yhlz8KTPJiA8 XufPB2GuQflDrXfJCEFOxMMM1ygZGXIyhx5y0BhRlkyZmS/tEnUcv6zngFMXz+2A3iR8 BJkg== X-Gm-Message-State: AOAM532OaLoDfZ0ytVx7u/ZRQSk9xjFBOYC6rqR1HN4iYb1g+F8EhvBm c6bVItTEC/eSVsisFkXqgsiIQyrP28IZTkW87B3CCA== X-Google-Smtp-Source: ABdhPJzgIPxZjRf4TTl259I1gJu0xCKBEnQ5dqv25EyECaDeLx/ZKHwpzL9oZFe0jTz5nYO32WzfEDE3orNYxkOdy9k= X-Received: by 2002:a05:6512:78:b0:46b:c2d0:8134 with SMTP id i24-20020a056512007800b0046bc2d08134mr3868052lfo.686.1650155943553; Sat, 16 Apr 2022 17:39:03 -0700 (PDT) MIME-Version: 1.0 References: <20220416053920.4hj6vcnqqlscile7@mattwilson.org> <20220416192445.dxuftlrblkhctmir@mattwilson.org> In-Reply-To: From: Ian Lance Taylor Date: Sat, 16 Apr 2022 17:38:52 -0700 Message-ID: Subject: Re: Error when building gcc w/ Go language on Solaris To: Jonathan Wakely Cc: "Matthew R. Wilson" , gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_SPF_WL autolearn=no 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: Sun, 17 Apr 2022 00:39:07 -0000 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. It's true that the Go build requires objcopy. It's interesting that the error message refers to context.o. At that point in the build there should be context.gox in the libgo build directory, and the compiler should find that one first. And even if content.gox doesn't exist for some reason, the context.o file should contain export data in the ".go_export" section. So I'm puzzled. Ian