From: Iain Sandoe Date: Fri, 1 Nov 2019 20:47:48 +0000 (+0000) Subject: [Darwin] Fix Objective-C NeXT ABI version check diagnostics. X-Git-Tag: releases/gcc-7.5.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87b14bf0d2f961862858a2e3966c45a503957434;p=thirdparty%2Fgcc.git [Darwin] Fix Objective-C NeXT ABI version check diagnostics. 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 Backport from mainline 2019-10-09 Iain Sandoe * 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 * config/darwin.c (darwin_override_options): Adjust objective-c ABI version error messages to avoid punctuation and contracted negations. From-SVN: r277726 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cc3a2ab6c039..83c25e0b67e5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2019-11-01 Iain Sandoe + + Backport from mainline + 2019-10-09 Iain Sandoe + + * 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 + + * config/darwin.c (darwin_override_options): Adjust objective-c + ABI version error messages to avoid punctuation and contracted + negations. + 2019-11-01 Iain Sandoe Backport from mainline diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 90f12cb1f5c9..f924592f6e86 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -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