public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Don't add crtfastmath.o for -shared.
@ 2023-01-13  9:56 liuhongt
  2023-01-17  7:11 ` Hongtao Liu
  0 siblings, 1 reply; 2+ messages in thread
From: liuhongt @ 2023-01-13  9:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: crazylht, hjl.tools, ubizjak

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; \
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Don't add crtfastmath.o for -shared.
  2023-01-13  9:56 [PATCH] Don't add crtfastmath.o for -shared liuhongt
@ 2023-01-17  7:11 ` Hongtao Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Hongtao Liu @ 2023-01-17  7:11 UTC (permalink / raw)
  To: liuhongt; +Cc: gcc-patches, hjl.tools, ubizjak

On Fri, Jan 13, 2023 at 5:56 PM liuhongt <hongtao.liu@intel.com> wrote:
>
> 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?
>
The patches in [1],[2] are already approved, and these 2 patches just
apply them to other 3 targets, so I assume it should be ok, and i'm
going to push the patch to 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; \
> --
> 2.31.1
>


-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-17  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13  9:56 [PATCH] Don't add crtfastmath.o for -shared liuhongt
2023-01-17  7:11 ` Hongtao Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).