public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] fixincludes: Update darwin_flt_eval_method for macOS 14
@ 2023-08-16 19:20 Rainer Orth
  2023-08-16 19:25 ` Iain Sandoe
  2023-08-16 19:27 ` Bruce Korb
  0 siblings, 2 replies; 3+ messages in thread
From: Rainer Orth @ 2023-08-16 19:20 UTC (permalink / raw)
  To: gcc-patches; +Cc: Bruce Korb, Iain Sandoe

[-- Attachment #1: Type: text/plain, Size: 1282 bytes --]

On macOS 14, a guard in <math.h> changed:

-- MacOSX13.3.sdk/usr/include/math.h	2023-04-19 01:54:44
+++ MacOSX14.0.sdk/usr/include/math.h	2023-08-01 08:42:43
@@ -22,0 +23 @@
+
@@ -43 +44 @@
-#if __FLT_EVAL_METHOD__ == 0
+#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1
@@ -49 +50 @@
-#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1
+#elif __FLT_EVAL_METHOD__ == 2

Therefore the darwin_flt_eval_method fixincludes fix doesn't match any
longer, leading to a large number of testsuite failures like

/private/var/gcc/regression/master/14-gcc/build/gcc/include-fixed/math.h:69:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__."  

where __FLT_EVAL_METHOD__ = 16.

This patch adjusts the fix to allow for both forms.

Tested with make check in fixincludes on x86_64-apple-darwin23.0.0 and
verifying that <math.h> has indeed been fixed as expected.

Ok for trunk?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2023-08-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	fixincludes:
	* inclhack.def (darwin_flt_eval_method): Handle macOS 14 guard
	variant.
	* fixincl.x: Regenerate.
	* tests/base/math.h [DARWIN_FLT_EVAL_METHOD_CHECK]: Update test.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: darwin23-fixincludes-flt_eval_method.patch --]
[-- Type: text/x-patch, Size: 1284 bytes --]

# HG changeset patch
# Parent  e7f5115ad4125cf69230cd511f1887327f1b3d4b
fixincludes: Update darwin_flt_eval_method for macOS 14

diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -1819,10 +1819,11 @@ fix = {
     hackname  = darwin_flt_eval_method;
     mach      = "*-*-darwin*";
     files     = math.h;
-    select    = "^#if __FLT_EVAL_METHOD__ == 0$";
-    c_fix     = format;
-    c_fix_arg = "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16";
-    test_text = "#if __FLT_EVAL_METHOD__ == 0";
+    select    = "^#if __FLT_EVAL_METHOD__ == 0( \\|\\| __FLT_EVAL_METHOD__ == -1)?$";
+    c_fix     = format;
+    c_fix_arg = "%0 || __FLT_EVAL_METHOD__ == 16";
+    test_text = "#if __FLT_EVAL_METHOD__ == 0\n"
+		"#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1";
 };
 
 /*
diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h
--- a/fixincludes/tests/base/math.h
+++ b/fixincludes/tests/base/math.h
@@ -32,6 +32,7 @@
 
 #if defined( DARWIN_FLT_EVAL_METHOD_CHECK )
 #if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16
+#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1 || __FLT_EVAL_METHOD__ == 16
 #endif  /* DARWIN_FLT_EVAL_METHOD_CHECK */
 
 

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

* Re: [PATCH] fixincludes: Update darwin_flt_eval_method for macOS 14
  2023-08-16 19:20 [PATCH] fixincludes: Update darwin_flt_eval_method for macOS 14 Rainer Orth
@ 2023-08-16 19:25 ` Iain Sandoe
  2023-08-16 19:27 ` Bruce Korb
  1 sibling, 0 replies; 3+ messages in thread
From: Iain Sandoe @ 2023-08-16 19:25 UTC (permalink / raw)
  To: Rainer Orth; +Cc: GCC Patches, Bruce Korb

Hi Rainer,

> On 16 Aug 2023, at 20:20, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
> 
> On macOS 14, a guard in <math.h> changed:
> 
> -- MacOSX13.3.sdk/usr/include/math.h	2023-04-19 01:54:44
> +++ MacOSX14.0.sdk/usr/include/math.h	2023-08-01 08:42:43
> @@ -22,0 +23 @@
> +
> @@ -43 +44 @@
> -#if __FLT_EVAL_METHOD__ == 0
> +#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1
> @@ -49 +50 @@
> -#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1
> +#elif __FLT_EVAL_METHOD__ == 2
> 
> Therefore the darwin_flt_eval_method fixincludes fix doesn't match any
> longer, leading to a large number of testsuite failures like
> 
> /private/var/gcc/regression/master/14-gcc/build/gcc/include-fixed/math.h:69:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__."  
> 
> where __FLT_EVAL_METHOD__ = 16.
> 
> This patch adjusts the fix to allow for both forms.
> 
> Tested with make check in fixincludes on x86_64-apple-darwin23.0.0 and
> verifying that <math.h> has indeed been fixed as expected.
> 
> Ok for trunk?

Yes, thanks (and I suppose subsequent backports are in order)

===

Hopefully Alex's has_feature/extension patch will be approved and I will post my
availability one - and we can start to retire some of these fixincludes.

Iain


> 
> 	Rainer
> 
> -- 
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
> 
> 
> 2023-08-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 
> 	fixincludes:
> 	* inclhack.def (darwin_flt_eval_method): Handle macOS 14 guard
> 	variant.
> 	* fixincl.x: Regenerate.
> 	* tests/base/math.h [DARWIN_FLT_EVAL_METHOD_CHECK]: Update test.
> 
> # HG changeset patch
> # Parent  e7f5115ad4125cf69230cd511f1887327f1b3d4b
> fixincludes: Update darwin_flt_eval_method for macOS 14
> 
> diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
> --- a/fixincludes/inclhack.def
> +++ b/fixincludes/inclhack.def
> @@ -1819,10 +1819,11 @@ fix = {
>     hackname  = darwin_flt_eval_method;
>     mach      = "*-*-darwin*";
>     files     = math.h;
> -    select    = "^#if __FLT_EVAL_METHOD__ == 0$";
> -    c_fix     = format;
> -    c_fix_arg = "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16";
> -    test_text = "#if __FLT_EVAL_METHOD__ == 0";
> +    select    = "^#if __FLT_EVAL_METHOD__ == 0( \\|\\| __FLT_EVAL_METHOD__ == -1)?$";
> +    c_fix     = format;
> +    c_fix_arg = "%0 || __FLT_EVAL_METHOD__ == 16";
> +    test_text = "#if __FLT_EVAL_METHOD__ == 0\n"
> +		"#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1";
> };
> 
> /*
> diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h
> --- a/fixincludes/tests/base/math.h
> +++ b/fixincludes/tests/base/math.h
> @@ -32,6 +32,7 @@
> 
> #if defined( DARWIN_FLT_EVAL_METHOD_CHECK )
> #if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16
> +#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1 || __FLT_EVAL_METHOD__ == 16
> #endif  /* DARWIN_FLT_EVAL_METHOD_CHECK */
> 
> 


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

* Re: [PATCH] fixincludes: Update darwin_flt_eval_method for macOS 14
  2023-08-16 19:20 [PATCH] fixincludes: Update darwin_flt_eval_method for macOS 14 Rainer Orth
  2023-08-16 19:25 ` Iain Sandoe
@ 2023-08-16 19:27 ` Bruce Korb
  1 sibling, 0 replies; 3+ messages in thread
From: Bruce Korb @ 2023-08-16 19:27 UTC (permalink / raw)
  To: Rainer Orth, gcc-patches; +Cc: Iain Sandoe

Looks reasonable to me!

On 8/16/23 12:20, Rainer Orth wrote:
> On macOS 14, a guard in <math.h> changed:
> 
> -- MacOSX13.3.sdk/usr/include/math.h	2023-04-19 01:54:44
> +++ MacOSX14.0.sdk/usr/include/math.h	2023-08-01 08:42:43
> @@ -22,0 +23 @@
> +
> @@ -43 +44 @@
> -#if __FLT_EVAL_METHOD__ == 0
> +#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1
> @@ -49 +50 @@
> -#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1
> +#elif __FLT_EVAL_METHOD__ == 2
> 
> Therefore the darwin_flt_eval_method fixincludes fix doesn't match any
> longer, leading to a large number of testsuite failures like
> 
> /private/var/gcc/regression/master/14-gcc/build/gcc/include-fixed/math.h:69:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__."
> 
> where __FLT_EVAL_METHOD__ = 16.
> 
> This patch adjusts the fix to allow for both forms.
> 
> Tested with make check in fixincludes on x86_64-apple-darwin23.0.0 and
> verifying that <math.h> has indeed been fixed as expected.
> 
> Ok for trunk?
> 
> 	Rainer
> 

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

end of thread, other threads:[~2023-08-16 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-16 19:20 [PATCH] fixincludes: Update darwin_flt_eval_method for macOS 14 Rainer Orth
2023-08-16 19:25 ` Iain Sandoe
2023-08-16 19:27 ` Bruce Korb

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).