From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by sourceware.org (Postfix) with ESMTPS id 531C23834E26 for ; Fri, 16 Dec 2022 09:50:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 531C23834E26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-xb2f.google.com with SMTP id y135so1742078yby.12 for ; Fri, 16 Dec 2022 01:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=20njM5tPms1hw42/JiAmk+NWPmEpBzvsbK+2mFfE4ms=; b=A51xgSyMmPX1FrLOEHpTs99uNiDlqbQSxbRU8YDJZ+YYc2+BRxr0ATzABGD64qkSsR xYJYTM1QGiQbxhHhoLCjiU3vFqcprP4CpPRAfRmedHRFH0ygSXI54XNdsvNDtiAjGBlZ AB1jKx1rz4z5jNF4JZfULC+Dh8Q65zkUj8Fp7GnpN/LzqTp3hj5l4GD7AXLLTra6WZas E9edbAYXxYTtvhD+NUdJr6vZAxiysQlPol4tvsRkecAR1RQ4aKWy+ZauzPh4yZj72DK8 k6wrZM9/Ow7WXbOKYMe7LDGT9n6xUOn5HSvY0cinUaNIhr2vQyDEyyIF5zvRcHzdCLxZ Aevg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=20njM5tPms1hw42/JiAmk+NWPmEpBzvsbK+2mFfE4ms=; b=zLHWyo65AGPS3J6erYGOyj5ikSzOml3huBZO/2w9NtVK8fK6T9Vnbg7DIq0yUSSxEa drIc8nKeTp6fWFaKuPaYC4iCTQfQHNBSiCDJMEyzYLMivx3O0mO52Rm305/Po0BzwLGV Ptv52MHsLZS+saFpwgxf51VEL849sfxeaz25TmcX1FRfCxXzxQdtsKXbvdNUtGP/AXc6 XzT+1FyQ94xK9BP8yNBSk9CHLHD+3tHrsqTvSBSnL08vvgN/QgUp0MMnJa67rGJ4TeSA 9pE276O4yopj71xs58KVBcycxz0z1qo/DQ+6sZ+qHsJNS1EfUvGV4qR0qzwg+64psqkv bDmQ== X-Gm-Message-State: ANoB5pkMCz0nI+7rfDRlt8f5VmT3ZfikRKvMdMIQYu+Pac0i5nvsKxiX jZnFTfd+IvVXpPKk8/kJ/gZvDRmuKKT3URwqp/Q= X-Google-Smtp-Source: AA0mqf4fuu7E81MtvAnlHvQKpWvLNzM2bltIKQHSxvhU18DY/rMerOXYxkt2RgW9Il71yfLDjuBI7PnE16e0o7Zr3fg= X-Received: by 2002:a25:7383:0:b0:6fb:b4af:e56e with SMTP id o125-20020a257383000000b006fbb4afe56emr31405737ybc.60.1671184240626; Fri, 16 Dec 2022 01:50:40 -0800 (PST) MIME-Version: 1.0 References: <20221215062137.3128845-1-hongtao.liu@intel.com> In-Reply-To: <20221215062137.3128845-1-hongtao.liu@intel.com> From: Uros Bizjak Date: Fri, 16 Dec 2022 10:50:29 +0100 Message-ID: Subject: Re: [PATCH V2 1/2] x86: Don't add crtfastmath.o for -shared To: liuhongt Cc: gcc-patches@gcc.gnu.org, crazylht@gmail.com, hjl.tools@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On Thu, Dec 15, 2022 at 7:23 AM liuhongt wrote: > > Update in V2: > Split -shared change into a separate commit and add some documentation > for it. > Bootstrapped and regtested on x86_64-pc-linu-gnu{-m32,}. > Ok of trunk? > > Don't add crtfastmath.o for -shared to avoid changing the MXCSR register > when loading a shared library. crtfastmath.o will be used only when > building executables. > > PR target/55522 > * config/i386/gnu-user-common.h (GNU_USER_TARGET_MATHFILE_SPEC): > Don't add crtfastmath.o for -shared. > * doc/invoke.texi (-shared): Add related documentation. OK. Thanks, Uros. > --- > gcc/config/i386/gnu-user-common.h | 2 +- > gcc/doc/invoke.texi | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h > index cab9be2bfb7..9910cd64363 100644 > --- a/gcc/config/i386/gnu-user-common.h > +++ b/gcc/config/i386/gnu-user-common.h > @@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see > > /* Similar to standard GNU userspace, but adding -ffast-math support. */ > #define GNU_USER_TARGET_MATHFILE_SPEC \ > - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ > + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}} \ > %{mpc32:crtprec32.o%s} \ > %{mpc64:crtprec64.o%s} \ > %{mpc80:crtprec80.o%s}" > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > index cb40b38b73a..cba4f19f4f4 100644 > --- a/gcc/doc/invoke.texi > +++ b/gcc/doc/invoke.texi > @@ -17656,7 +17656,8 @@ needs to build supplementary stub code for constructors to work. On > multi-libbed systems, @samp{gcc -shared} must select the correct support > libraries to link against. Failing to supply the correct flags may lead > to subtle defects. Supplying them in cases where they are not necessary > -is innocuous.} > +is innocuous. For x86, crtfastmath.o will not be added when > +@option{-shared} is specified. } > > @item -shared-libgcc > @itemx -static-libgcc > -- > 2.27.0 >