aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2019-10-09 18:48:38 +0000
committerIain Sandoe <iains@gcc.gnu.org>2019-10-09 18:48:38 +0000
commitdee1497cbb3dacdbc73474340b9e73de72f09140 (patch)
tree6117584ee5d6985f678caab2f8ff376624a23ef8
parenta0e887be6147edcd14a5b95af17456d0a01575d4 (diff)
downloadgcc-dee1497cbb3dacdbc73474340b9e73de72f09140.zip
gcc-dee1497cbb3dacdbc73474340b9e73de72f09140.tar.gz
gcc-dee1497cbb3dacdbc73474340b9e73de72f09140.tar.bz2
[Darwin] Improve Objective-C NeXT ABI version check.
We were missing a check for the case that user's ABI was > 2 and the codegen was for 64 bit. gcc/ChangeLog: 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. From-SVN: r276768
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/darwin.c21
2 files changed, 16 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e66d065..ecbe825 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
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.
+
+2019-10-09 Iain Sandoe <iain@sandoe.co.uk>
+
* config/darwin.c (machopic_indirect_data_reference): Set flag to
indicate that the new symbol is an indirection.
(machopic_indirect_call_target): Likewise.
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 35d0444..f490f62 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -3114,18 +3114,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%> must be greater"
- " than or equal to 2 for %<-m64%> targets"
- " with %<-fnext-runtime%>");
- if (!TARGET_64BIT && global_options.x_flag_objc_abi >= 2)
- error_at (UNKNOWN_LOCATION, "%<-fobjc-abi-version%> %d is not"
- " supported on %<-m32%> targets with"
- " %<-fnext-runtime%>",
- global_options.x_flag_objc_abi);
+ 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