Message ID | e4f5799e-4fd6-72f4-0882-ec0bef2f1f62@ventanamicro.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp3785078vqi; Tue, 22 Aug 2023 10:40:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXptiEFA8eQi1M0meIE/NhYyL1lIo6Wlxhmar15BVscYKB0TgHfjyn7YT3rdGEUKZkthfz X-Received: by 2002:a17:906:8b:b0:99e:4c6:f145 with SMTP id 11-20020a170906008b00b0099e04c6f145mr9107025ejc.68.1692726018473; Tue, 22 Aug 2023 10:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692726018; cv=none; d=google.com; s=arc-20160816; b=Q3sDw+bn5RTTeGlUdBbWH7kqAWGywJMRw8Ob0kDCnBUqG5yK9pcU8mxf2kjXyeusSA GSXGageex2xOfy/VMj+SOs45QzTTz9K8cirlokY1Qi/rDZTFc1wFxOPbkDBytFpJIV3Y +PcpdeIJs3qsJyPHOwbRSmPcVG228yU+TIHZp4/K1lsTWDkw18O4sL1aHHCZO0s9uXpO z4z7Zm5jqnZv5lc9AYjQ7PrO7/4OpYVGGNc8OQzA9g431rZCeVqpXOGwVPFfdj3GtPXF x72kX3eQRpIKoGcFU4+wYH6tDw6MmXYtOedZHKRMMB6EZIAEX9jUBzVraqhE61x8OLLD QAGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:from:to :content-language:user-agent:mime-version:date:message-id :dkim-signature:dmarc-filter:delivered-to; bh=fTpNh/cf4A7/pA26AlTmhu7fyB2EcxPjpT1WuSQrjQI=; fh=XfztniJdlnJJI5goKEgZQuCSjgdXye833KYusDMmipc=; b=H7Z+rItcOGhnisuSlNQA2gD/SjenPrXnEdykzcrPY8vv+ttGVVOq8de+hPOU9n0X2w PzQTylTLP57uE7cOvM/NqWHeQUzCcPWUpNFvZ0XhPiuZ5hmQdHaqGjOvJkIL9dgNXd5m h/yevuYGDzQaTvlpoJFto+CIh5/RoiN+NYfyP6SzQ3ynCkBVHg5rp66py5zXYOX3ht/T XWvR+z0kHE8X5BXcHsVhkb3PSZMsAyDgOh4l/cU972XI8W4E/NCK8iDbiiQ7jE8UbxHm IZIi2h3S4SJKcotraC2aixHdbFhf3fqQ5Np630oxpmpnZdCrcIwuk0Twzx5Rn0fIleQ/ TtVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=ic5lMm0x; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id um11-20020a170906cf8b00b0097d7282c899si8291863ejb.534.2023.08.22.10.40.18 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 10:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=ic5lMm0x; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F33B73836EA6 for <ouuuleilei@gmail.com>; Tue, 22 Aug 2023 17:40:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 808473858D28 for <gcc-patches@gcc.gnu.org>; Tue, 22 Aug 2023 17:39:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 808473858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68a3082c771so2060861b3a.0 for <gcc-patches@gcc.gnu.org>; Tue, 22 Aug 2023 10:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1692725981; x=1693330781; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=fTpNh/cf4A7/pA26AlTmhu7fyB2EcxPjpT1WuSQrjQI=; b=ic5lMm0xpvg5xcFkQvoR7jji+QEm7ZZsRcK/TiaCRYTahL4sjeJRqJGuBhp5gIjD0M dvzg2kFAKMUzQ+bNsEYr+/H5GdqKxivPF0LCj1siT7igmxg/Xhe9IJfmoByMvNbcsKBG 4ANCn6PSA/Sv8LUH9R5NNnPuKlX+8mmEgzXDm5zRA6CcnVz74uhHG6xDT2n67x9049rn sACXeOBWl/YZwqWh+VuIqRHCtluugzuobRnSrVK5R2jGmBvoDKa+3Wrffk7IKXWBqeBg SJEHs7G+Ko1VgAhOuJcv+eqfmrNJKg1o624gKBggXm7j2LijJxEdGanSimVxEXJVh/5+ PEbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692725981; x=1693330781; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fTpNh/cf4A7/pA26AlTmhu7fyB2EcxPjpT1WuSQrjQI=; b=FAQJ7JQWCboH+BNHoQERsSo6V33iTuhm8dmZkHxvPgEMP3818H67w0t2i/PS1xt2nh PeXaOXXS4ZS4j8HoUa5pYQWTI8/aPBY4/coxoeYtO3nAFYww9LbzPZH6Ov1Ew7zJgt4g Wo2LGfd6ZaKiAqROXz05IZ2ymNWq7LNjDHnneM7i7FtJxYo8AvcJXfCVf/PUPzgD48UI l7tMLCuCgD1MfzCXwzClp9Sfrpe+rQ3X5P5I0UDM4q9+Db+qrFWfCXoSJLB693eIala1 NcIzwJT0mVPu9OFmkX3e/X47ZdaUYcpWxxYvU9gYPO8vo/I0+5dYPWuD2g98L8yv4/v8 g0Iw== X-Gm-Message-State: AOJu0YwgANGtEeDws7ELoQmmWFxH6pDhXIy8aDXXdhWzxCjEkzD3dPIe hw+bQgBeoe08FhiZhS/3+NOs4JKy+OiDLbfKZOlHkw== X-Received: by 2002:a05:6a00:1c98:b0:68a:48e7:9deb with SMTP id y24-20020a056a001c9800b0068a48e79debmr9016343pfw.2.1692725980543; Tue, 22 Aug 2023 10:39:40 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id m18-20020a637d52000000b005649cee408fsm8338326pgn.0.2023.08.22.10.39.39 for <gcc-patches@gcc.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Aug 2023 10:39:39 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------F82ARjOXPQxz2QTCrY0DlmnR" Message-ID: <e4f5799e-4fd6-72f4-0882-ec0bef2f1f62@ventanamicro.com> Date: Tue, 22 Aug 2023 11:39:38 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org> From: Jeff Law <jlaw@ventanamicro.com> Subject: [PATCH][committed] RISC-V: Add multiarch support on riscv-linux-gnu X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774951877113416561 X-GMAIL-MSGID: 1774951877113416561 |
Series |
[committed] RISC-V: Add multiarch support on riscv-linux-gnu
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Jeff Law
Aug. 22, 2023, 5:39 p.m. UTC
This adds multiarch support to the RISC-V port so that bootstraps work with Debian out-of-the-box. Without this patch the stage1 compiler is unable to find headers/libraries when building the stage1 runtime. This is functionally (and possibly textually) equivalent to Debian's fix for the same problem. gcc/ * config/riscv/t-linux: Add MULTIARCH_DIRNAME. Pushed to the trunk on Raphael's behalf. Jeff commit 47f95bc4be4eb14730ab3eaaaf8f6e71fda47690 Author: Raphael Moreira Zinsly <rzinsly@ventanamicro.com> Date: Tue Aug 22 11:37:04 2023 -0600 RISC-V: Add multiarch support on riscv-linux-gnu This adds multiarch support to the RISC-V port so that bootstraps work with Debian out-of-the-box. Without this patch the stage1 compiler is unable to find headers/libraries when building the stage1 runtime. This is functionally (and possibly textually) equivalent to Debian's fix for the same problem. gcc/ * config/riscv/t-linux: Add MULTIARCH_DIRNAME.
Comments
On Tue, 22 Aug 2023 10:39:38 PDT (-0700), Jeff Law wrote: > > This adds multiarch support to the RISC-V port so that bootstraps work > with Debian out-of-the-box. Without this patch the stage1 compiler is > unable to find headers/libraries when building the stage1 runtime. > > This is functionally (and possibly textually) equivalent to Debian's fix > for the same problem. > > gcc/ > * config/riscv/t-linux: Add MULTIARCH_DIRNAME. > > Pushed to the trunk on Raphael's behalf. > > Jeff > commit 47f95bc4be4eb14730ab3eaaaf8f6e71fda47690 > Author: Raphael Moreira Zinsly <rzinsly@ventanamicro.com> > Date: Tue Aug 22 11:37:04 2023 -0600 > > RISC-V: Add multiarch support on riscv-linux-gnu > > This adds multiarch support to the RISC-V port so that bootstraps work with > Debian out-of-the-box. Without this patch the stage1 compiler is unable to > find headers/libraries when building the stage1 runtime. > > This is functionally (and possibly textually) equivalent to Debian's fix for > the same problem. > > gcc/ > * config/riscv/t-linux: Add MULTIARCH_DIRNAME. > > diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux > index 216d2776a18..a6f64f88d25 100644 > --- a/gcc/config/riscv/t-linux > +++ b/gcc/config/riscv/t-linux > @@ -1,3 +1,5 @@ > # Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/ > MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) > MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) > + > +MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) The docs seem to suggest that we should have a multarch-compatible MULTILIB_OSDIRNAMES as we support both multilib and multiarch: @code{MULTIARCH_DIRNAME} is not used for configurations that support both multilib and multiarch. In that case, multiarch names are encoded in @code{MULTILIB_OSDIRNAMES} instead. It's not clear if "supports" there actually means "enabled", as IIUC none of the distros actually ship multilib. So maybe this can't manifest and we should fix the docs? Or maybe something like this just does it? diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux index a6f64f88d25..00e382db0f8 100644 --- a/gcc/config/riscv/t-linux +++ b/gcc/config/riscv/t-linux @@ -1,5 +1,5 @@ # Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/ MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) -MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) +MULTILIB_OSDIRNAMES := $(patsubst lib64%:rv64%-linux-gnu,$(patsubst lib32%:rv32%-linux-gnu,../lib32,$(MULTILIB_DIRNAMES))) MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) I have no idea how to test multiarch+multilib, though. Is there a way to just autoconf error that out as unsupported until someone wants it?
On 8/22/23 12:03, Palmer Dabbelt wrote: > On Tue, 22 Aug 2023 10:39:38 PDT (-0700), Jeff Law wrote: > > The docs seem to suggest that we should have a multarch-compatible > MULTILIB_OSDIRNAMES as we support both multilib and multiarch: > > @code{MULTIARCH_DIRNAME} is not used for configurations that support > both multilib and multiarch. In that case, multiarch names are encoded > in @code{MULTILIB_OSDIRNAMES} instead. > > It's not clear if "supports" there actually means "enabled", as IIUC > none of the distros actually ship multilib. So maybe this can't manifest and we > should fix the docs? Debian explicitly disables multilibs for RISC-V, Ubuntu almost certainly just follows that. Fedora and its relatives don't use multiarch. > > Or maybe something like this just does it? Maybe, but we'd really want/need to test it :-) > > diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux > index a6f64f88d25..00e382db0f8 100644 > --- a/gcc/config/riscv/t-linux > +++ b/gcc/config/riscv/t-linux > @@ -1,5 +1,5 @@ > # Only XLEN and ABI affect Linux multilib dir names, e.g. > /lib32/ilp32d/ > MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst > rv64%,lib64,$(MULTILIB_DIRNAMES))) > -MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) > +MULTILIB_OSDIRNAMES := $(patsubst lib64%:rv64%-linux-gnu,$(patsubst > lib32%:rv32%-linux-gnu,../lib32,$(MULTILIB_DIRNAMES))) > MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, > ,$(target)))-linux-gnu) > > I have no idea how to test multiarch+multilib, though. Is there a way > to just autoconf error that out as unsupported until someone wants it? I'm not sure either. It might be as simple as bootstrapping on a Debian native with a small set of rv64 multilibs. Jeff
diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux index 216d2776a18..a6f64f88d25 100644 --- a/gcc/config/riscv/t-linux +++ b/gcc/config/riscv/t-linux @@ -1,3 +1,5 @@ # Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/ MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) + +MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu)