]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Darwin] Fix Objective-C NeXT ABI version check diagnostics.
authorIain Sandoe <iain@sandoe.co.uk>
Fri, 1 Nov 2019 20:47:48 +0000 (20:47 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Fri, 1 Nov 2019 20:47:48 +0000 (20:47 +0000)
This fixes build errors when used with newer GCC and corrects a mistake
in the checking of ABI versions.

276768 We were missing a check for the case that user's ABI was > 2 and the
codegen was for 64 bit.

276635 Fix some format-related build warnings.

This fixes two error messages to avoid punctuation and contracted
negations.

gcc/

2019-11-01  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2019-10-09  Iain Sandoe  <iain@sandoe.co.uk>

* config/darwin.c (darwin_override_options): Make the check for
Objective-C ABI version more specific for 64bit code.

Backport from mainline
2019-10-06  Iain Sandoe  <iain@sandoe.co.uk>

* config/darwin.c (darwin_override_options): Adjust objective-c
ABI version error messages to avoid punctuation and contracted
negations.

From-SVN: r277726

gcc/ChangeLog
gcc/config/darwin.c

index cc3a2ab6c03975c72e3235961fc3ee53d1e297c9..83c25e0b67e52a436601163944594bc003530f19 100644 (file)
@@ -1,3 +1,18 @@
+2019-11-01  Iain Sandoe  <iain@sandoe.co.uk>
+
+       Backport from mainline
+       2019-10-09  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * config/darwin.c (darwin_override_options): Make the check for
+       Objective-C ABI version more specific for 64bit code.
+
+       Backport from mainline
+       2019-10-06  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * config/darwin.c (darwin_override_options): Adjust objective-c
+       ABI version error messages to avoid punctuation and contracted
+       negations.
+
 2019-11-01  Iain Sandoe  <iain@sandoe.co.uk>
 
        Backport from mainline
index 90f12cb1f5c9c3ca862a730199a3958d0bfef996..f924592f6e86d432e67fc44b233f8b3846e1fafc 100644 (file)
@@ -3199,17 +3199,19 @@ darwin_override_options (void)
                                : (generating_for_darwin_version >= 9) ? 1
                                                                       : 0);
 
-  /* Objective-C family ABI 2 is only valid for next/m64 at present.  */
   if (global_options_set.x_flag_objc_abi && flag_next_runtime)
     {
-      if (TARGET_64BIT && global_options.x_flag_objc_abi < 2)
-       error_at (UNKNOWN_LOCATION, "%<-fobjc-abi-version%> >= 2 must be"
-                                   " used for %<-m64%> targets with"
-                                   " %<-fnext-runtime%>");
-      if (!TARGET_64BIT && global_options.x_flag_objc_abi >= 2)
-       error_at (UNKNOWN_LOCATION, "%<-fobjc-abi-version%> >= 2 is not"
-                                   " supported on %<-m32%> targets with"
-                                   " %<-fnext-runtime%>");
+      if (TARGET_64BIT && global_options.x_flag_objc_abi != 2)
+       /* The Objective-C family ABI 2 is the only valid version NeXT/m64.  */
+       error_at (UNKNOWN_LOCATION,
+                 "%<-fobjc-abi-version%> 2 must be used for 64 bit targets"
+                 " with %<-fnext-runtime%>");
+      else if (!TARGET_64BIT && global_options.x_flag_objc_abi >= 2)
+       /* ABI versions 0 and 1 are the only valid versions NeXT/m32.  */
+       error_at (UNKNOWN_LOCATION,
+                 "%<-fobjc-abi-version%> %d is not supported for 32 bit"
+                 " targets with %<-fnext-runtime%>",
+                 global_options.x_flag_objc_abi);
     }
 
   /* Don't emit DWARF3/4 unless specifically selected.  This is a