From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 8DB483858D32 for ; Fri, 13 Jan 2023 10:49:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8DB483858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=foss.arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 623BCFEC; Fri, 13 Jan 2023 02:50:19 -0800 (PST) Received: from [10.2.78.76] (e126323.cambridge.arm.com [10.2.78.76]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 928753F587; Fri, 13 Jan 2023 02:49:36 -0800 (PST) Message-ID: Date: Fri, 13 Jan 2023 10:49:34 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 1/9] aarch64: Don't add crtfastmath.o for -shared Content-Language: en-GB To: Richard Biener , gcc-patches@gcc.gnu.org Cc: richard.sandiford@arm.com References: <20230113075953.34CCB13913@imap2.suse-dmz.suse.de> From: Richard Earnshaw In-Reply-To: <20230113075953.34CCB13913@imap2.suse-dmz.suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3495.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,NICE_REPLY_A,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 List-Id: On 13/01/2023 07:59, Richard Biener via Gcc-patches wrote: > Don't add crtfastmath.o for -shared to avoid altering the FP > environment when loading a shared library. > > PR target/55522 > * config/aarch64/aarch64-elf-raw.h (ENDFILE_SPEC): Don't add > crtfastmath.o for -shared. > * config/aarch64/aarch64-freebsd.h (GNU_USER_TARGET_MATHFILE_SPEC): > Likewise. > * config/aarch64/aarch64-linux.h (GNU_USER_TARGET_MATHFILE_SPEC): > Likewise. > --- > gcc/config/aarch64/aarch64-elf-raw.h | 2 +- > gcc/config/aarch64/aarch64-freebsd.h | 2 +- > gcc/config/aarch64/aarch64-linux.h | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > OK. R. > diff --git a/gcc/config/aarch64/aarch64-elf-raw.h b/gcc/config/aarch64/aarch64-elf-raw.h > index d4d820a9d54..fa5b4527ea0 100644 > --- a/gcc/config/aarch64/aarch64-elf-raw.h > +++ b/gcc/config/aarch64/aarch64-elf-raw.h > @@ -25,7 +25,7 @@ > #define STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s" > #define ENDFILE_SPEC \ > " crtend%O%s crtn%O%s " \ > - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" > + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}}" > > #ifndef LINK_SPEC > #define LINK_SPEC "%{h*} \ > diff --git a/gcc/config/aarch64/aarch64-freebsd.h b/gcc/config/aarch64/aarch64-freebsd.h > index 13beb3781b6..2cf9cf6f046 100644 > --- a/gcc/config/aarch64/aarch64-freebsd.h > +++ b/gcc/config/aarch64/aarch64-freebsd.h > @@ -50,7 +50,7 @@ > #define LINK_SPEC FBSD_TARGET_LINK_SPEC AARCH64_ERRATA_LINK_SPEC > > #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}}" > > #undef ENDFILE_SPEC > #define ENDFILE_SPEC \ > diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h > index 5e4553d79f5..61ed4067fc5 100644 > --- a/gcc/config/aarch64/aarch64-linux.h > +++ b/gcc/config/aarch64/aarch64-linux.h > @@ -50,7 +50,7 @@ > #define LINK_SPEC LINUX_TARGET_LINK_SPEC AARCH64_ERRATA_LINK_SPEC > > #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}}" > > #undef ENDFILE_SPEC > #define ENDFILE_SPEC \