From ef19a444b3945c11a99ffac1512c39e5cbf8efd8 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Tue, 9 Aug 2016 17:58:00 +0000 Subject: [PATCH] re PR bootstrap/72833 (error in fortran/parse.c (unexpected_eof) on Mac OS X 10.7) 2016-08-09 Bernd Edlinger PR bootstrap/72833 * fixincl.tpl (version-compare): Fix generation with autogen 5.18. * inclhack.def (darwin_longjmp_noreturn): New fix. * fixincl.x: Regenerated. * tests/base/i386/setjmp.h [DARWIN_LONGJMP_NORETURN_CHECK]: new test. From-SVN: r239301 --- fixincludes/ChangeLog | 8 ++++ fixincludes/fixincl.tpl | 2 +- fixincludes/fixincl.x | 64 +++++++++++++++++++++++++--- fixincludes/inclhack.def | 15 +++++++ fixincludes/tests/base/i386/setjmp.h | 14 ++++++ 5 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 fixincludes/tests/base/i386/setjmp.h diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index 0ab2118ca67..b9430b71d4a 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,11 @@ +2016-08-09 Bernd Edlinger + + PR bootstrap/72833 + * fixincl.tpl (version-compare): Fix generation with autogen 5.18. + * inclhack.def (darwin_longjmp_noreturn): New fix. + * fixincl.x: Regenerated. + * tests/base/i386/setjmp.h [DARWIN_LONGJMP_NORETURN_CHECK]: new test. + 2016-08-01 Muhammad Bilal * fixinc.in: Use --parents option to make LIB directory. diff --git a/fixincludes/fixincl.tpl b/fixincludes/fixincl.tpl index 5096a8246f3..3d70cabc7fd 100644 --- a/fixincludes/fixincl.tpl +++ b/fixincludes/fixincl.tpl @@ -1,7 +1,7 @@ [= AutoGen5 Template -*- Mode: C -*- x=fixincl.x =] [= - (if (version-compare >= autogen-version "5.18") + (if (version-compare >= autogen-version "5.18.1") (dne "-D" " * " "/* ") (dne " * " "/* ") ) =] */ diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index c79a6e4fb2c..6cd1b608b6a 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -1,12 +1,12 @@ /* -*- buffer-read-only: t -*- vi: set ro: - * + * * DO NOT EDIT THIS FILE (fixincl.x) - * - * It has been AutoGen-ed June 10, 2016 at 12:56:52 PM by AutoGen 5.18.3 + * + * It has been AutoGen-ed August 8, 2016 at 08:46:37 PM by AutoGen 5.18 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Jun 10 12:56:52 UTC 2016 +/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Aug 8 20:46:37 CEST 2016 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 235 fixup descriptions. + * This file contains 236 fixup descriptions. * * See README for more information. * @@ -2697,6 +2697,50 @@ static const char* apzDarwin_Gcc4_BreakagePatch[] = { "((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Darwin_Longjmp_Noreturn fix + */ +tSCC zDarwin_Longjmp_NoreturnName[] = + "darwin_longjmp_noreturn"; + +/* + * File name selection pattern + */ +tSCC zDarwin_Longjmp_NoreturnList[] = + "i386/setjmp.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzDarwin_Longjmp_NoreturnMachs[] = { + "*-*-darwin*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zDarwin_Longjmp_NoreturnSelect0[] = + "(.*longjmp\\(.*jmp_buf.*[^)]+\\));"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zDarwin_Longjmp_NoreturnBypass0[] = + "__dead2"; + +#define DARWIN_LONGJMP_NORETURN_TEST_CT 2 +static tTestDesc aDarwin_Longjmp_NoreturnTests[] = { + { TT_NEGREP, zDarwin_Longjmp_NoreturnBypass0, (regex_t*)NULL }, + { TT_EGREP, zDarwin_Longjmp_NoreturnSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Darwin_Longjmp_Noreturn + */ +static const char* apzDarwin_Longjmp_NoreturnPatch[] = { + "format", + "%1 __attribute__ ((__noreturn__));", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Darwin_Private_Extern fix @@ -9633,9 +9677,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 272 +#define REGEX_COUNT 274 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 235 +#define FIX_COUNT 236 /* * Enumerate the fixes @@ -9703,6 +9747,7 @@ typedef enum { DARWIN_9_LONG_DOUBLE_FUNCS_2_FIXIDX, DARWIN_EXTERNC_FIXIDX, DARWIN_GCC4_BREAKAGE_FIXIDX, + DARWIN_LONGJMP_NORETURN_FIXIDX, DARWIN_PRIVATE_EXTERN_FIXIDX, DARWIN_STDINT_1_FIXIDX, DARWIN_STDINT_2_FIXIDX, @@ -10189,6 +10234,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { DARWIN_GCC4_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aDarwin_Gcc4_BreakageTests, apzDarwin_Gcc4_BreakagePatch, 0 }, + { zDarwin_Longjmp_NoreturnName, zDarwin_Longjmp_NoreturnList, + apzDarwin_Longjmp_NoreturnMachs, + DARWIN_LONGJMP_NORETURN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aDarwin_Longjmp_NoreturnTests, apzDarwin_Longjmp_NoreturnPatch, 0 }, + { zDarwin_Private_ExternName, zDarwin_Private_ExternList, apzDarwin_Private_ExternMachs, DARWIN_PRIVATE_EXTERN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 8adb07678bc..2f758802831 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -1394,6 +1394,21 @@ fix = { "(__GNUC_MINOR__ >= 1)\n"; }; +/* + * Before Mac OS X 10.8 doesn't mark longjump noreturn. + */ +fix = { + hackname = darwin_longjmp_noreturn; + mach = "*-*-darwin*"; + files = "i386/setjmp.h"; + bypass = "__dead2"; + select = "(.*longjmp\\(.*jmp_buf.*[^)]+\\));"; + c_fix = format; + c_fix_arg = "%1 __attribute__ ((__noreturn__));"; + + test_text = "void siglongjmp(sigjmp_buf, int);"; +}; + /* * __private_extern__ doesn't exist in FSF GCC. Even if it did, * why would you ever put it in a system header file? diff --git a/fixincludes/tests/base/i386/setjmp.h b/fixincludes/tests/base/i386/setjmp.h new file mode 100644 index 00000000000..3fd30258500 --- /dev/null +++ b/fixincludes/tests/base/i386/setjmp.h @@ -0,0 +1,14 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/i386/setjmp.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( DARWIN_LONGJMP_NORETURN_CHECK ) +void siglongjmp(sigjmp_buf, int) __attribute__ ((__noreturn__)); +#endif /* DARWIN_LONGJMP_NORETURN_CHECK */ -- 2.30.2