From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9C8C81382C5 for ; Sun, 2 May 2021 22:22:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DC611E091B; Sun, 2 May 2021 22:22:45 +0000 (UTC) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B4CD7E0917 for ; Sun, 2 May 2021 22:22:45 +0000 (UTC) Received: by mail-qk1-x72b.google.com with SMTP id v20so3471456qkv.5 for ; Sun, 02 May 2021 15:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version; bh=tDwO4o2x/hjE2X8d6HWAv72iQsfaHATtogQIISHyOKE=; b=eeVxTesvmtfKvrTJQFSGRuOv5ZzPqJ9eV7Qv2v62hKVz6F8ABcxBJVRdW+dTeLJMLN fjIgw0ZyhHsVjNhyTsyCKJ4BswRCJehQg0vgr55J+m4HA/l+F/M0LwNR7PZFNT+RZ9Pu eZ4LCOaGuLGwV/NCrlqFDAZPD5Li1R8v2MQzaM7sgR2vhwxqPQnzk6NUahzpPuOWt4DQ qvIZudKpdcnXlPc1SEVPvck6mnBUV/79I6Y6NsME6n13H47qUg3wFpjMGtPrpfkczw9A H8d5jA2UTKJxKvag7lL0iEmi02GnOWPaLLcPsbD5SgFumlvurN2NqUBBQhOjpaSr1fXR v9+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=tDwO4o2x/hjE2X8d6HWAv72iQsfaHATtogQIISHyOKE=; b=DYM9+1ZCN4bHE1AmHVvWvt3OSVhpIvwyiUdrJC0YuRhwInwsoe3ajDaFvoC3/x6Tyk Aylvmd5++Iv6rddxT7qm129tkSCtfGRsat5G5/u678SaM5WOA5v/yYX53SFcepKuQRv8 Bo5hPfWvYYiJPDYpW8BzR0DfBd29cHY7vL6/ilbRt4HCTFZ5ahXZxtcu4yqN0pjTsHVl wJa0w4g94DKrrgxOj0gyI83TYAxMsvCdsuGhJBhCWascVisgnpMBiNIT2MOmuq93fjJl hnpkHYhx+MVj63LC1wiQC3hdvWSWs1t8CEeR1DbNu8aOptwvYLHEE1GFPmp/3V80Ryc3 YSCg== X-Gm-Message-State: AOAM533QNurkTDiT24YjACh0uyGz5MErpJGFsXVrgRWjxUlUS+is9mUW EJsMBrenSPC0qA0bqsCJpoE= X-Google-Smtp-Source: ABdhPJx40hUAh8pZr0XLeuwMc4elt1xOaC8RfffiFOgz2++Qgksd1EGQKt0LV8jJww/UZrroD66/og== X-Received: by 2002:a37:a3d7:: with SMTP id m206mr7803035qke.343.1619994164885; Sun, 02 May 2021 15:22:44 -0700 (PDT) Received: from callisto (c-73-175-137-55.hsd1.pa.comcast.net. [73.175.137.55]) by smtp.gmail.com with ESMTPSA id s5sm4348707qkg.88.2021.05.02.15.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 May 2021 15:22:44 -0700 (PDT) From: fedora.dm0@gmail.com To: gentoo-dev@lists.gentoo.org Cc: toolchain@gentoo.org Subject: [gentoo-dev] [PATCH] toolchain-funcs.eclass: include riscv bitness in tc-arch Date: Sun, 02 May 2021 18:22:43 -0400 Message-ID: <871raog4i4.fsf@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain X-Archives-Salt: ec367a01-f620-4bb3-ae54-b1615a3692a6 X-Archives-Hash: 6923bc769e7c55bbb5e7e25646cbaefe This makes tc-arch identify RISC-V systems as either "riscv64" or "riscv32". It will still return "riscv" for the kernel arch or if bitness is not given in the host triplet. This fixes the expected values of cpu_family in meson projects: https://mesonbuild.com/Reference-tables.html#cpu-families Signed-off-by: David Michael --- Hi, When building systemd from Git, it now relies on the "stable" cpu_family value for riscv64[0]. Meson gets this value from tc-arch. From a quick grep, it looked like the only place that compared tc-arch output with "riscv" was toolchain.eclass, but there may be some other subtle issue I haven't encountered. Does this look okay to apply? Thanks. David [0] https://github.com/systemd/systemd/commit/a00ff2e1b596f0d08d32b8ca9cefe8aca1212604 eclass/toolchain-funcs.eclass | 10 +++++++++- eclass/toolchain.eclass | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 267cf5cfce3..5dd6dcbd658 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -687,7 +687,15 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; } echo ppc fi ;; - riscv*) echo riscv;; + riscv*) + if [[ ${type} != "kern" && ${host} == riscv32* ]] ; then + echo riscv32 + elif [[ ${type} != "kern" && ${host} == riscv64* ]] ; then + echo riscv64 + else + echo riscv + fi + ;; s390*) echo s390;; score*) echo score;; sh64*) ninj sh64 sh;; diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index f41ce22c591..b1d2e671917 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1084,7 +1084,7 @@ toolchain_src_configure() { # https://gcc.gnu.org/PR93157 [[ ${CTARGET} == powerpc64-*-musl ]] && confgcc+=( --with-abi=elfv2 ) ;; - riscv) + riscv*) # Add --with-abi flags to set default ABI confgcc+=( --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI}) ) ;; -- 2.26.3