From patchwork Wed Mar 30 14:34:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Westover X-Patchwork-Id: 12795880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0763C433EF for ; Wed, 30 Mar 2022 14:34:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346897AbiC3OgX (ORCPT ); Wed, 30 Mar 2022 10:36:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244899AbiC3OgX (ORCPT ); Wed, 30 Mar 2022 10:36:23 -0400 Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E79A641F87; Wed, 30 Mar 2022 07:34:36 -0700 (PDT) Received: by mail-qv1-xf2f.google.com with SMTP id kd21so14038839qvb.6; Wed, 30 Mar 2022 07:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language; bh=+lg9JnSYDKfs8RkjbzmPWemG+ehaocfcpwkWEPttL1Y=; b=Xi7ED40WCZZM57sQoCmOcrfcy5V+dWCMP5Y1btyV3QlE3hekvLO6635KtKM730FOsc s+MKoDk8y49qKePca7iED4ybfBH7v0+Qed+2LVH2H5GNXbtO+vt0FJN3L9PcZLnjMgRU v+YTjNzAFS5JOwV6taikosttbLfLJXCSt4pB36Uueed02JoASgYeRL/VbHCTAfyCjSpg ITli02fpVsDUAcf/cDLn+GibUa23I98ncq1hJWRIwoX2l8HIMojdCOgPI7nLnXwdGT+B ok3dprIRyLaEObHWDOL1LI1FfUT/r5LhxPRwSOKCqmIbIhfWTrqZIUTh5P978IbED4IJ I7ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language; bh=+lg9JnSYDKfs8RkjbzmPWemG+ehaocfcpwkWEPttL1Y=; b=2KLc5+x7DtiFLTJr/qY7W5aM6k4IrIFTy0+TmD4loejcy5CwInLiJ0lJ5hiMc5RyBd N4mO66gyUk+WwsxsFlx6LxSGjKiUlkgpFPq0uyxCqzni96NxoV7VC0GfNfAPPltsakZu M02BvmKEkaI6iiK7wIgvbn0jDnxfHej38MKDmr2za0YuqrzRGs7m4uotCAhHbSyfp2bv y0McOnDbCRolPlQO1ks415n8o9b0URRw5Ns1xcdqJcIHrDR+veDu+/fuQS+hgH7tQDo/ +ZNcTvTJncuppPqEMZ/r75KTMsiz7fddOK4rd46bZKr7oIjRTUBuuXQJD6kVL+VWhi1g eF3A== X-Gm-Message-State: AOAM5322rGoQWLlUGQbXFjhPq77TyKA8F9ytrKml0BvB7AzFT8q3uPv4 bK2Er7oEu4SyZZF8K+EKbP2QPnOhMpm6bAZA X-Google-Smtp-Source: ABdhPJyXH2hATliNrToMa3h7CAXz4q1HIaXy50CvB1yU7t+X6ZOY97mDeYMVnBsbp2TwLvpz3ISNrw== X-Received: by 2002:a05:6214:765:b0:443:5e47:4573 with SMTP id f5-20020a056214076500b004435e474573mr12959979qvz.79.1648650875702; Wed, 30 Mar 2022 07:34:35 -0700 (PDT) Received: from [192.168.1.115] (cable-217-24.sssnet.com. [24.140.217.24]) by smtp.gmail.com with ESMTPSA id s131-20020a37a989000000b0067d2e3c51e8sm10930810qke.58.2022.03.30.07.34.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Mar 2022 07:34:34 -0700 (PDT) Message-ID: <479c5c98-0e0d-072d-dae1-f91629989e46@gmail.com> Date: Wed, 30 Mar 2022 10:34:32 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 From: Ben Westover Subject: [PATCH] riscv: Set SRCARCH to riscv if ARCH is riscv64 or riscv32 To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, masahiroy@kernel.org, michal.lkml@markovi.net, ndesaulniers@google.com Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org When riscv64 or riscv32 are used as the value for ARCH during compilation, like in tools that get the ARCH value from uname, set SRCARCH to riscv instead of failing because the riscv64 and riscv32 targets don't exist. Signed-off-by: Ben Westover --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index c28c5d91e5c8..315c364bf2ba 100644 --- a/Makefile +++ b/Makefile @@ -408,6 +408,14 @@ ifeq ($(ARCH),parisc64) SRCARCH := parisc endif +# Additional ARCH settings for riscv +ifeq ($(ARCH),riscv32) + SRCARCH := riscv +endif +ifeq ($(ARCH),riscv64) + SRCARCH := riscv +endif + export cross_compiling := ifneq ($(SRCARCH),$(SUBARCH)) cross_compiling := 1