diff mbox

[fixincludes] Fix PR bootstrap/72833

Message ID AM4PR0701MB21624904B3A14A86C8967895E41C0@AM4PR0701MB2162.eurprd07.prod.outlook.com
State New
Headers show

Commit Message

Bernd Edlinger Aug. 9, 2016, 12:17 p.m. UTC
Hi!

Due to my recent cleanup of special_function_p the darwin bootstrap is
currently broken because the longjmp function misses the noreturn
attribute.  Therefore I revived an old solaris_longjmp_noreturn
fixinclude rule.

See the attached patch.

Boot-strap on i686-apple-darwin11 and x86_64-apple-darwin11 was
successful.

Is it OK for trunk?


Thanks
Bernd.

Comments

Bruce Korb Aug. 9, 2016, 4:28 p.m. UTC | #1
Index: fixincludes/fixincl.tpl

===================================================================

--- fixincludes/fixincl.tpl     (revision 239193)

+++ fixincludes/fixincl.tpl     (working copy)

@@ -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 " * " "/* ") ) =]

Was this causing a problem?  If so, then it all looks good to me.  I
had thought the "-D" was implemented in 5.18, but that was long, long
ago now.

On Tue, Aug 9, 2016 at 5:17 AM, Bernd Edlinger
<bernd.edlinger@hotmail.de> wrote:
> Hi!
>
> Due to my recent cleanup of special_function_p the darwin bootstrap is
> currently broken because the longjmp function misses the noreturn
> attribute.  Therefore I revived an old solaris_longjmp_noreturn
> fixinclude rule.
>
> See the attached patch.
>
> Boot-strap on i686-apple-darwin11 and x86_64-apple-darwin11 was
> successful.
>
> Is it OK for trunk?
>
>
> Thanks
> Bernd.
Bernd Edlinger Aug. 9, 2016, 5 p.m. UTC | #2
On 08/09/16 18:28, Bruce Korb wrote:
> Index: fixincludes/fixincl.tpl

>

> ===================================================================

>

> --- fixincludes/fixincl.tpl     (revision 239193)

>

> +++ fixincludes/fixincl.tpl     (working copy)

>

> @@ -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 " * " "/* ") ) =]

>

> Was this causing a problem?  If so, then it all looks good to me.  I

> had thought the "-D" was implemented in 5.18, but that was long, long

> ago now.

>


Yes. I was surprised that genfixes generated a bogus fixincl.x
there was no warning, but the result did not compile in the end.

You can see the result as the first obsoleted patch in the PR 72833.

I use autogen 5.18 from Ubuntu 14.04.


Thanks
Bernd.

> On Tue, Aug 9, 2016 at 5:17 AM, Bernd Edlinger

> <bernd.edlinger@hotmail.de> wrote:

>> Hi!

>>

>> Due to my recent cleanup of special_function_p the darwin bootstrap is

>> currently broken because the longjmp function misses the noreturn

>> attribute.  Therefore I revived an old solaris_longjmp_noreturn

>> fixinclude rule.

>>

>> See the attached patch.

>>

>> Boot-strap on i686-apple-darwin11 and x86_64-apple-darwin11 was

>> successful.

>>

>> Is it OK for trunk?

>>

>>

>> Thanks

>> Bernd.
diff mbox

Patch

2016-08-09  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	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.

Index: fixincludes/fixincl.tpl
===================================================================
--- fixincludes/fixincl.tpl	(revision 239193)
+++ fixincludes/fixincl.tpl	(working copy)
@@ -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 " * " "/* ") ) =]
  */
Index: fixincludes/fixincl.x
===================================================================
--- fixincludes/fixincl.x	(revision 239193)
+++ fixincludes/fixincl.x	(working copy)
@@ -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.
  *
@@ -2699,6 +2699,50 @@ 
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  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
  */
 tSCC zDarwin_Private_ExternName[] =
@@ -9633,9 +9677,9 @@ 
  *
  *  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 @@ 
     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 @@ 
      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,
Index: fixincludes/inclhack.def
===================================================================
--- fixincludes/inclhack.def	(revision 239193)
+++ fixincludes/inclhack.def	(working copy)
@@ -1395,6 +1395,21 @@ 
 };
 
 /*
+ *  Before Mac OS X 10.8 <i386/setjmp.h> 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?
  */
Index: fixincludes/tests/base/i386/setjmp.h
===================================================================
--- fixincludes/tests/base/i386/setjmp.h	(revision 0)
+++ fixincludes/tests/base/i386/setjmp.h	(working copy)
@@ -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 */