From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 03F623858D32; Mon, 23 Jan 2023 12:34:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03F623858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674477287; bh=j8FQfbrwUSdbhEbqeFnv2Hc2GRaTJ5XSOgrW72SdSSQ=; h=From:To:Subject:Date:From; b=EL3RB9ALM4v6l7xRY9C/7HTPS08xq0OUaI9PDWI+8xWN8AiVp1jR+yN9WzX6n6VGm hPu9smEMe0/RewZSfnTOD0iUdxpUmjyhkQ3EzRv6VsqhN0gBZZvpAOfA8DpozZQgSo OvAr+7vKe4Y6pbrA81NFZ9628T4d4iZNXC7HVSJM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5305] sparc: Don't add crtfastmath.o for -shared X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: 55a2d8096a799c682922b03bef7c0d4e4c1c8d7b X-Git-Newrev: 054e407b7f68f714c024d8a9c983fdd53ceead2b Message-Id: <20230123123447.03F623858D32@sourceware.org> Date: Mon, 23 Jan 2023 12:34:47 +0000 (GMT) List-Id: https://gcc.gnu.org/g:054e407b7f68f714c024d8a9c983fdd53ceead2b commit r13-5305-g054e407b7f68f714c024d8a9c983fdd53ceead2b Author: Richard Biener Date: Fri Jan 13 08:54:33 2023 +0100 sparc: Don't add crtfastmath.o for -shared Don't add crtfastmath.o for -shared to avoid altering the FP environment when loading a shared library. PR target/55522 * config/sparc/freebsd.h (ENDFILE_SPEC): Don't add crtfastmath.o for -shared. * config/sparc/linux.h (ENDFILE_SPEC): Likewise. * config/sparc/linux64.h (ENDFILE_SPEC): Likewise. * config/sparc/sp-elf.h (ENDFILE_SPEC): Likewise. * config/sparc/sp64-elf.h (ENDFILE_SPEC): Likewise. Diff: --- gcc/config/sparc/freebsd.h | 2 +- gcc/config/sparc/linux.h | 2 +- gcc/config/sparc/linux64.h | 2 +- gcc/config/sparc/sp-elf.h | 2 +- gcc/config/sparc/sp64-elf.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h index b1ae4ba40d2..f77203c9f0a 100644 --- a/gcc/config/sparc/freebsd.h +++ b/gcc/config/sparc/freebsd.h @@ -127,7 +127,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} " \ + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}} " \ FBSD_ENDFILE_SPEC /* We use GNU ld so undefine this so that attribute((init_priority)) works. */ diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h index a1144da3f56..0e33b3cac2c 100644 --- a/gcc/config/sparc/linux.h +++ b/gcc/config/sparc/linux.h @@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see #undef ENDFILE_SPEC #define ENDFILE_SPEC \ GNU_USER_TARGET_ENDFILE_SPEC \ - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}}" /* -mcpu=native handling only makes sense with compiler running on a SPARC chip. */ diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h index 80aa703c8d1..f1cc0a19e49 100644 --- a/gcc/config/sparc/linux64.h +++ b/gcc/config/sparc/linux64.h @@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see #undef ENDFILE_SPEC #define ENDFILE_SPEC \ GNU_USER_TARGET_ENDFILE_SPEC \ - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}}" /* The default code model. */ #undef SPARC_DEFAULT_CMODEL diff --git a/gcc/config/sparc/sp-elf.h b/gcc/config/sparc/sp-elf.h index fdd5c57e1fa..0d6a9af5dfe 100644 --- a/gcc/config/sparc/sp-elf.h +++ b/gcc/config/sparc/sp-elf.h @@ -32,7 +32,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} \ + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}} \ crtend.o%s crtn.o%s" /* Don't set the target flags, this is done by the linker script */ diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h index 1f476cdf5f3..11c95046448 100644 --- a/gcc/config/sparc/sp64-elf.h +++ b/gcc/config/sparc/sp64-elf.h @@ -44,7 +44,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} \ + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}} \ crtend.o%s crtn.o%s" /* Use the default (for now). */