From patchwork Fri Jan 13 09:56:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liuhongt X-Patchwork-Id: 43127 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp180542wrt; Fri, 13 Jan 2023 01:57:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXuSTidIXheuaWbowgW+UOUMbhQRalAdcjmrMOe4AP4QN97A2iIFzZLv4B8jQzHAkN+OD3XK X-Received: by 2002:a17:906:5db2:b0:7c0:8c83:79b8 with SMTP id n18-20020a1709065db200b007c08c8379b8mr2982136ejv.53.1673603858966; Fri, 13 Jan 2023 01:57:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673603858; cv=none; d=google.com; s=arc-20160816; b=N2qoVDplVmx/SuDXK3GthK6L68F8BcwneSZdXZ8a8Imee1bIIKdoBS1btqBe7ag+Dn x0jOquoO1nIvRkF3b0jCAOVyXGBwErO2dJWba19xYTFRRjTuXTRRIshaAhZW0RQJ3VzD hmIrPbR+pcszeVtXXKYPlHFaa0hLuyRhbDV2DxQHnHSzl0mFli+ONh7RzwBUGr3q9J9I 1mk6xVpbVRGKJlwWaYiGv+2vO+vTsfkGKInhR5m/NKvBonRG6u32acBA00XU73Y2tO36 Dczah2vIRLfO2wOpujVYGD6Vfkr09zNopLmIpeHC80LWa/zYcRgoMyaVwSnyFu6R+FCb TAYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=YkyYzSiWsKi8ddu7r4/XkZLDXVe+d59nUTtYXKTEx0A=; b=YJBkkQNQclH9faA5Edh3xlA1O5Ash90Dhn+x4WpPpSF+9T6U8e7Fv2FFd1lAd4Cimz LYmwCGCJHnxPBVDG2QvGfS/D2nbnjeDrY20nhKKg8RRF2/WCIHVA1DGbjkZQUDVpPSCY voOQpoM/Mp3E+W1E+qpCNT75j2qCk1JPy34GIrKTJjwSiIQo3T5A9PcVkdejFyE84EAm PKNoJRn201gPCKyWH0PhAM1uY5anFb0Z+4/4gmZ+R1RevA4x04s1mfWTXdNX4AOat75v PvOh0QOxRI4kN4QR19LNX/quQ0i5MreNSq5aXlyCmc2Amgz9EZrsgq0nKpWVDxf+LY0P Gtqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=NstGjO+r; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id oz19-20020a1709077d9300b0085738d104fcsi11768981ejc.213.2023.01.13.01.57.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 01:57:38 -0800 (PST) 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=@gcc.gnu.org header.s=default header.b=NstGjO+r; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 08A803854386 for ; Fri, 13 Jan 2023 09:57:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08A803854386 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673603858; bh=YkyYzSiWsKi8ddu7r4/XkZLDXVe+d59nUTtYXKTEx0A=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=NstGjO+rmC6PsfRrb/nPuFkRyhIzMPMben39PDe3bU4YxSuG/LkTp932lJUzArzbF amPxX92ht70R1DSC6Pkg9RrXlEmqzr95UT6IPjFCmxWOzts4qKT9htMtiJY9xptGxd pSl3HcmCyBKzK2o4Zzkr6IrErQHJ1rs+vLbOum/M= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by sourceware.org (Postfix) with ESMTPS id D189A3858D32 for ; Fri, 13 Jan 2023 09:56:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D189A3858D32 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="304338389" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="304338389" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 01:56:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="986943229" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="986943229" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga005.fm.intel.com with ESMTP; 13 Jan 2023 01:56:51 -0800 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 383501005686; Fri, 13 Jan 2023 17:56:51 +0800 (CST) To: gcc-patches@gcc.gnu.org Cc: crazylht@gmail.com, hjl.tools@gmail.com, ubizjak@gmail.com Subject: [PATCH] Don't add crtfastmath.o for -shared. Date: Fri, 13 Jan 2023 17:56:51 +0800 Message-Id: <20230113095651.1367699-1-hongtao.liu@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: liuhongt via Gcc-patches From: liuhongt Reply-To: liuhongt Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754900840272098459?= X-GMAIL-MSGID: =?utf-8?q?1754900840272098459?= Patches [1] and [2] fixed PR55522 for x86-linux but left all other x86 targets unfixed (x86-cygwin, x86-darwin and x86-mingw32). This patch applies a similar change to other specs using crtfastmath.o. Ok for trunk? [1] https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608528.html [2] https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608529.html gcc/ChangeLog: PR target/55522 * config/i386/cygwin.h (ENDFILE_SPEC): Link crtfastmath.o whenever -mdaz-ftz is specified. Don't link crtfastmath.o when -share or -mno-daz-ftz is specified. * config/i386/darwin.h (ENDFILE_SPEC): Ditto. * config/i386/mingw32.h (ENDFILE_SPEC): Ditto. --- gcc/config/i386/cygwin.h | 2 +- gcc/config/i386/darwin.h | 2 +- gcc/config/i386/mingw32.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h index 0a604d65b32..d795ee1e3c5 100644 --- a/gcc/config/i386/cygwin.h +++ b/gcc/config/i386/cygwin.h @@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see #undef ENDFILE_SPEC #define ENDFILE_SPEC \ - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}\ + "%{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{!shared:%{!mno-daz-ftz:crtfastmath.o%s}}} \ %{!shared:%:if-exists(default-manifest.o%s)}\ %{fvtable-verify=none:%s; \ fvtable-verify=preinit:vtv_end.o%s; \ diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h index 5bcb7111114..ac198db0d9c 100644 --- a/gcc/config/i386/darwin.h +++ b/gcc/config/i386/darwin.h @@ -110,7 +110,7 @@ along with GCC; see the file COPYING3. If not see #undef ENDFILE_SPEC #define ENDFILE_SPEC \ - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ + "%{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{!shared:%{!mno-daz-ftz:crtfastmath.o%s}}} \ %{mpc32:crtprec32.o%s} \ %{mpc64:crtprec64.o%s} \ %{mpc80:crtprec80.o%s}" TM_DESTRUCTOR diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h index 19a98c3d995..4e5b486a3da 100644 --- a/gcc/config/i386/mingw32.h +++ b/gcc/config/i386/mingw32.h @@ -196,7 +196,7 @@ along with GCC; see the file COPYING3. If not see #undef ENDFILE_SPEC #define ENDFILE_SPEC \ - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ + "%{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{!shared:%{!mno-daz-ftz:crtfastmath.o%s}}} \ %{!shared:%:if-exists(default-manifest.o%s)}\ %{fvtable-verify=none:%s; \ fvtable-verify=preinit:vtv_end.o%s; \