From patchwork Sun Nov 18 15:28:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jessica Clarke X-Patchwork-Id: 999511 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-490389-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=jrtc27.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ODePw7kR"; dkim=pass (1024-bit key; unprotected) header.d=jrtc27.com header.i=@jrtc27.com header.b="mcD10Kns"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42ybTY4Kfbz9s3q for ; Mon, 19 Nov 2018 02:28:32 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; q=dns; s=default; b=KOVAZ/Fv8+ok0fjt u/abU+CeCD1qUfUp4sDvxkqzXi4YqvoqnulqLkzX5czo9hT3xGj9X5fQssBq5o0a O9IP79WQzAegS6vcZc+17Nc+0pd1pafpN5gZfOuKPyxg0IuBIAUTUqpUS1ef74Nd hB+v+aQaDSnpG+SYVnJL1F/k6ro= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=default; bh=BD4qbDshnggb7nsqJegmOE xFTR0=; b=ODePw7kRpzRQZ+e6nvrPUCmU9zNIb8KmRGrGnD2AJKShh0nh79tgov KrM4eHCP6uqg3eHRuU1RU1QF4J+UY3XDGhFmMsmLXEndsKKwk+V0ZKquAE7+y0m1 ciKdH0CT2bhQ/JSGXqwwt0CvMdyku6otNNZLLkoVduIFlobzNb0co= Received: (qmail 31273 invoked by alias); 18 Nov 2018 15:28:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 31264 invoked by uid 89); 18 Nov 2018 15:28:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=specifications, HContent-Transfer-Encoding:8bit X-HELO: mail-wm1-f65.google.com Received: from mail-wm1-f65.google.com (HELO mail-wm1-f65.google.com) (209.85.128.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 18 Nov 2018 15:28:22 +0000 Received: by mail-wm1-f65.google.com with SMTP id 125so878042wmh.0 for ; Sun, 18 Nov 2018 07:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jrtc27.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H40GQBN2Gv+Bs9CuGCxZol3hco70mnHrUs/HMrufUsM=; b=mcD10KnsUi7fzxAheEU6CQAI1FVTGLZXPT3+kOq1k9Lz4GczHk35iqlG00IQaWpKwd ZZ9GTRtUJGeo7ENJTP6/Ly6lvXhwbOVHOvZBx93OZtYlV86fgDvgCtqgUm0yCf16LWB9 cofDVCsIv9f9J44oeeS1Rhd34Jfft/nejaaoE= Received: from Jamess-MacBook.local (global-184-8.nat-1.net.cam.ac.uk. [131.111.184.8]) by smtp.gmail.com with ESMTPSA id h67-v6sm36487633wma.10.2018.11.18.07.28.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Nov 2018 07:28:18 -0800 (PST) Received: by Jamess-MacBook.local (Postfix, from userid 501) id CFB852035F3584; Sun, 18 Nov 2018 15:28:17 +0000 (GMT) From: James Clarke To: gcc-patches@gcc.gnu.org Cc: James Clarke Subject: [PATCH] RISC-V: Pass -mno-relax through to assembler if supported Date: Sun, 18 Nov 2018 15:28:07 +0000 Message-Id: <20181118152807.2967-1-jrtc27@jrtc27.com> MIME-Version: 1.0 GCC will emit ".option (no)relax" in its outputted assembly, but when using it as an assembler driver, such as for preprocessed assembly, it's merely preprocessing and therefore will not generate this directive. Therefore we should pass -mno-relax on to the assembler if specified (and supported) as we do for other flags. gcc/ * configure.ac: (gcc_cv_as_riscv_mno_relax): Check if the assembler supports -mno-relax. * configure: Regenerate * config.in: Regenerate * config/riscv/riscv.h (ASM_MNO_RELAX_SPEC): Define based on HAVE_AS_MNO_RELAX_OPTION. (ASM_SPEC): Add %(asm_mno_relax_spec). (EXTRA_SPECS): Define to include $(asm_mno_relax_spec) and SUBTARGET_EXTRA_SPECS. (SUBTARGET_EXTRA_SPECS): Provide empty default value. --- gcc/config/riscv/riscv.h | 25 +++++++++++++++++++++++++ gcc/configure.ac | 8 ++++++++ 2 files changed, 33 insertions(+) diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index 13e15cc85..77d92acb2 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -55,14 +55,39 @@ along with GCC; see the file COPYING3. If not see #define TARGET_64BIT (__riscv_xlen == 64) #endif /* IN_LIBGCC2 */ +#ifdef HAVE_AS_MNO_RELAX_OPTION +#define ASM_MNO_RELAX_SPEC "%{mno-relax}" +#else +#define ASM_MNO_RELAX_SPEC "" +#endif + #undef ASM_SPEC #define ASM_SPEC "\ %(subtarget_asm_debugging_spec) \ %{" FPIE_OR_FPIC_SPEC ":-fpic} \ %{march=*} \ %{mabi=*} \ +%(asm_mno_relax_spec) \ %(subtarget_asm_spec)" +/* This macro defines names of additional specifications to put in the specs + that can be used in various specifications like CC1_SPEC. Its definition + is an initializer with a subgrouping for each command option. + + Each subgrouping contains a string constant, that defines the + specification name, and a string constant that used by the GCC driver + program. + + Do not define this macro if it does not need to do anything. */ + +#define EXTRA_SPECS \ + { "asm_mno_relax_spec", ASM_MNO_RELAX_SPEC }, \ + SUBTARGET_EXTRA_SPECS + +#ifndef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS +#endif + #define TARGET_DEFAULT_CMODEL CM_MEDLOW #define LOCAL_LABEL_PREFIX "." diff --git a/gcc/configure.ac b/gcc/configure.ac index 260d987da..4b7c0c79f 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4827,6 +4827,14 @@ pointers into PC-relative form.]) [Requesting --with-nan= requires assembler support for -mnan=]) fi ;; + + riscv*-*-*) + gcc_GAS_CHECK_FEATURE([-mno-relax option], gcc_cv_as_riscv_mno_relax,, + [-mno-relax], [.text],, + [AC_DEFINE(HAVE_AS_MNO_RELAX_OPTION, 1, + [Define if your assembler supports -mno-relax option.])]) + ;; + s390*-*-*) gcc_GAS_CHECK_FEATURE([.gnu_attribute support], gcc_cv_as_s390_gnu_attribute, [2,18,0],,