From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1665) id 09D9E3858D28; Mon, 11 Dec 2023 14:57:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09D9E3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702306675; bh=/1WTUAnejz2QH4RbXtVHn4jtAyshDmjv5kVHxmDj/Zs=; h=From:To:Subject:Date:From; b=WazvCXyh/koKvuWWROiHGyIGpGmfRoeOoU4EkBSaIb2QuPooT6Mj4u3qUbDssRDif +LKfiHgUFtESdDR8kb+8JZdtbLWxDaAtgBAxi5GWQGtLWNp0ooRowAM9iTSMW9B64B /UPQEkYNm3mFdwNpjo86/14Tf/yYBZBnE35U52U4= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: =?utf-8?q?Fran=C3=A7ois-Xavier_Coudert?= To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-8144] fixincludes: Update darwin_flt_eval_method for macOS 14 X-Act-Checkin: gcc X-Git-Author: Francois-Xavier Coudert X-Git-Refname: refs/heads/releases/gcc-13 X-Git-Oldrev: ca66fffad38aff5e39a2eb6c580971a20accb383 X-Git-Newrev: 87e6cc0103369f8891c3c3a516f4d93187c2c12b Message-Id: <20231211145755.09D9E3858D28@sourceware.org> Date: Mon, 11 Dec 2023 14:57:55 +0000 (GMT) List-Id: https://gcc.gnu.org/g:87e6cc0103369f8891c3c3a516f4d93187c2c12b commit r13-8144-g87e6cc0103369f8891c3c3a516f4d93187c2c12b Author: Francois-Xavier Coudert Date: Mon Dec 11 15:56:04 2023 +0100 fixincludes: Update darwin_flt_eval_method for macOS 14 On macOS 14, a guard in 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 has indeed been fixed as expected. (backport of 93f803d53b5ccaabded9d7b4512b54da81c1c616) 2023-12-11 Rainer Orth 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. Diff: --- fixincludes/fixincl.x | 8 ++++---- fixincludes/inclhack.def | 7 ++++--- fixincludes/tests/base/math.h | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 416d2c2e3a4..5e955a288d2 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed January 22, 2023 at 09:03:29 PM by AutoGen 5.18.12 + * It has been AutoGen-ed December 11, 2023 at 02:50:24 PM by AutoGen 5.18.16 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Jan 22 21:03:29 CET 2023 +/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Dec 11 14:50:24 CET 2023 * * You must regenerate it. Use the ./genfixes script. * @@ -3674,7 +3674,7 @@ tSCC* apzDarwin_Flt_Eval_MethodMachs[] = { * content selection pattern - do fix if pattern found */ tSCC zDarwin_Flt_Eval_MethodSelect0[] = - "^#if __FLT_EVAL_METHOD__ == 0$"; + "^#if __FLT_EVAL_METHOD__ == 0( \\|\\| __FLT_EVAL_METHOD__ == -1)?$"; #define DARWIN_FLT_EVAL_METHOD_TEST_CT 1 static tTestDesc aDarwin_Flt_Eval_MethodTests[] = { @@ -3685,7 +3685,7 @@ static tTestDesc aDarwin_Flt_Eval_MethodTests[] = { */ static const char* apzDarwin_Flt_Eval_MethodPatch[] = { "format", - "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16", + "%0 || __FLT_EVAL_METHOD__ == 16", (char*)NULL }; /* * * * * * * * * * * * * * * * * * * * * * * * * * diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 45e0cbc0c10..a2970fcc0a9 100644 --- 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$"; + select = "^#if __FLT_EVAL_METHOD__ == 0( \\|\\| __FLT_EVAL_METHOD__ == -1)?$"; c_fix = format; - c_fix_arg = "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16"; - test_text = "#if __FLT_EVAL_METHOD__ == 0"; + 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 index 29b67579748..7b92f29a409 100644 --- 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 */