From patchwork Fri Jun 19 09:53:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kito Cheng X-Patchwork-Id: 1312746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=VwLNmTDl; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49pDfF5KkXz9sRk for ; Fri, 19 Jun 2020 19:53:56 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79F6A3840C23; Fri, 19 Jun 2020 09:53:52 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by sourceware.org (Postfix) with ESMTPS id 72FAB3870868 for ; Fri, 19 Jun 2020 09:53:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 72FAB3870868 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kito.cheng@sifive.com Received: by mail-pj1-x1041.google.com with SMTP id h95so4087372pje.4 for ; Fri, 19 Jun 2020 02:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=10BKRC4wO0ydojL1wB6A6Va1cfsFBlJ45mOrIh2zI/A=; b=VwLNmTDlNAWE37Jfi/qgUwLbqUR+pR0S95BPJCybtSU2GwQr/epTcnQW3MOjsA09Tj KP2W35At59w1ozeFS2IF1GkoBpROG/r7/ejLAHGuF0Hv1ehDqourqQdpT9+eeKO5yhP1 eKZnpP+O9wo5Cml8zr2bVqlmANbr2EhhBN336o8qoloyAihuPtfI1ccXNfxBrAEd1gAV 4UpVFcwgusewuWCXpE8BMUeZ5kQWGs/SX2nhVgZyr8geupZzdekvXVTeTwvdeIL9leR+ iKK3Xnlu/Kth5vUNcSL1c6mcHdwVx1TL5Q7+mTUGDWridtqpDRrqmTDILKb9EfGXpgVD WIhw== 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 :content-transfer-encoding; bh=10BKRC4wO0ydojL1wB6A6Va1cfsFBlJ45mOrIh2zI/A=; b=ucqGfbDHqirjkOg5htN9cq3GNgXOkL0uFZgqQz1SzdMdGcee5D3i0Hs6PFcACQma0P 62I+tVRvh/w1nZ72UR7LS3ZItx7XcF7lf0ozW6ByskQ2diluxWj7ODPM2e5umxdPygYd qG8qOjLDRAAYtKiG7IsMvBoPMr65rfjTL7s7CN8X+uP1gckFVku0h5vAeZPyxzpoRzR/ srrlzvndQvn381H68E60mn0SOLvElkVP3WPLf8f8TxoxQIlrgZB5D2UWOuk4r5korzYM G2iEiDt+VgY4Ufcpihyb1rYkYaUeib8A9FW9dsvAgTebDDAMn8eMvoytQls4WiZRWUz3 wbJQ== X-Gm-Message-State: AOAM532V2dgmwrxgPbt9VNgVJIOlb5ZXUKktSbUnWwtv3a0EJ6W/R5N+ 596o1OqCdVVUwJFwWu9NrlmDqCntMCM= X-Google-Smtp-Source: ABdhPJxfRN5UYYMA0q4SzDYLdgHgVe3pjT9habsOuISgRizQWFMq8WBuStMo/zFOpNeBltPi12rrNw== X-Received: by 2002:a17:90a:ce01:: with SMTP id f1mr2882298pju.69.1592560429255; Fri, 19 Jun 2020 02:53:49 -0700 (PDT) Received: from hsinchu02.internal.sifive.com (114-34-229-221.HINET-IP.hinet.net. [114.34.229.221]) by smtp.gmail.com with ESMTPSA id x20sm4721851pjr.44.2020.06.19.02.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 02:53:48 -0700 (PDT) From: Kito Cheng To: gcc-patches@gcc.gnu.org, kito.cheng@gmail.com, jimw@sifive.com Subject: [PATCH] RISC-V: Normalize arch string in driver time Date: Fri, 19 Jun 2020 17:53:45 +0800 Message-Id: <20200619095345.46238-1-kito.cheng@sifive.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-15.5 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kito Cheng Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" - Normalize arch string would help the multi-lib handling, e.g. rv64gc and rv64g_c are both valid and same arch, but latter one would confuse the detection of multi-lib, earlier normalize can resolve this issue. gcc/ChangeLog: * config/riscv/riscv.h (DRIVER_SELF_SPECS): New. --- gcc/config/riscv/riscv.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index 6119e6350620..1f2fe7e10e05 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -68,6 +68,10 @@ extern const char *riscv_expand_arch (int argc, const char **argv); %{mabi=*} \ %(subtarget_asm_spec)" +#undef DRIVER_SELF_SPECS +#define DRIVER_SELF_SPECS \ +"%{march=*:-march=%:riscv_expand_arch(%*)}" + #define TARGET_DEFAULT_CMODEL CM_MEDLOW #define LOCAL_LABEL_PREFIX "."