]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
shift flag_next/gnu_runtime to modern opts system.
authorIain Sandoe <iains@gcc.gnu.org>
Wed, 30 Nov 2011 10:42:58 +0000 (10:42 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Wed, 30 Nov 2011 10:42:58 +0000 (10:42 +0000)
gcc:

* doc/tm.texi.in (NEXT_OBJC_RUNTIME): Update macro description.
* doc/tm.texi: Regenerate.
* flags.h (flag_next_runtime): Remove references.
* toplev.c: Likewise.
* defaults.h (NEXT_OBJC_RUNTIME): Provide default.
* gccspec.c (lang_specific_driver): Adjust use of NEXT_OBJC_RUNTIME.
* config/darwin.c (darwin_override_options): Provide default
Objective-C abi settings and target conflict checks.
* config/darwin.h (SUBTARGET_C_COMMON_OVERRIDE_OPTIONS): Remove unused
code. Adjust indenting.

gcc/c-family:

* c.opt (fgnu-runtime): Provide full description.
(fnext-runtime): Likewise.
* c-opts.c (OPT_fgnu_runtime, OPT_fnext_runtime) Remove.

From-SVN: r181837

12 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-opts.c
gcc/c-family/c.opt
gcc/config/darwin.c
gcc/config/darwin.h
gcc/defaults.h
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/flags.h
gcc/gccspec.c
gcc/toplev.c

index fcd13905cc3e8dc3e9c2d2023f1a733baaa28474..5091c39dd8d036305817f2e51b36b89e1fb3d2dd 100644 (file)
@@ -1,3 +1,16 @@
+2011-11-30  Iain Sandoe  <iains@gcc.gnu.org>
+
+       * doc/tm.texi.in (NEXT_OBJC_RUNTIME): Update macro description.
+       * doc/tm.texi: Regenerate.
+       * flags.h (flag_next_runtime): Remove references.
+       * toplev.c: Likewise.
+       * defaults.h (NEXT_OBJC_RUNTIME): Provide default.
+       * gccspec.c (lang_specific_driver): Adjust use of NEXT_OBJC_RUNTIME.
+       * config/darwin.c (darwin_override_options): Provide default
+       Objective-C abi settings and target conflict checks.
+       * config/darwin.h (SUBTARGET_C_COMMON_OVERRIDE_OPTIONS): Remove unused
+       code. Adjust indenting.
+
 2011-11-29  Joseph Myers  <joseph@codesourcery.com>
 
        * config/sh/sh.h (enum reg_class, REG_CLASS_NAMES)
index b53f76670bbbfe0fa87713543405e633da6874a9..075da2f43b3f26e0a2b582b5403ceb940a064e5e 100644 (file)
@@ -1,3 +1,9 @@
+2011-11-30  Iain Sandoe  <iains@gcc.gnu.org>
+
+       * c.opt (fgnu-runtime): Provide full description.
+       (fnext-runtime): Likewise.
+       * c-opts.c (OPT_fgnu_runtime, OPT_fnext_runtime) Remove.
+
 2011-11-28  Andrew MacLeod  <amacleod@redhat.com>
 
        * c-cpp-builtin.c (cpp_atomic_builtins):New.  Emit all atomic
index 465bce35de30ebd42c489143887f4000e70fa213..a08b0e80a568045703f3194366e91a82157c4ca9 100644 (file)
@@ -604,14 +604,6 @@ c_common_handle_option (size_t scode, const char *arg, int value,
       cpp_opts->extended_identifiers = value;
       break;
 
-    case OPT_fgnu_runtime:
-      flag_next_runtime = !value;
-      break;
-
-    case OPT_fnext_runtime:
-      flag_next_runtime = value;
-      break;
-
     case OPT_foperator_names:
       cpp_opts->operator_names = value;
       break;
index 0d7dc88b1ca9ae81d2fc01589bfcf246292437bf..7694794e0c66e5d0f59fa1162dd77542d5dfb8fb 100644 (file)
@@ -810,7 +810,7 @@ C++ ObjC++ Var(flag_no_gnu_keywords, 0)
 Recognize GNU-defined keywords
 
 fgnu-runtime
-ObjC ObjC++
+ObjC ObjC++ Report RejectNegative Var(flag_next_runtime,0) Init(NEXT_OBJC_RUNTIME)
 Generate code for GNU runtime environment
 
 fgnu89-inline
@@ -872,7 +872,7 @@ fnew-abi
 C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
 
 fnext-runtime
-ObjC ObjC++
+ObjC ObjC++ Report RejectNegative Var(flag_next_runtime)
 Generate code for NeXT (Apple Mac OS X) runtime environment
 
 fnil-receivers
index b1038f406601527b4f0855d4b4969ac7cb91726c..ba253dd7dbf6334e441203a67c5b7f35488dda72 100644 (file)
@@ -2942,6 +2942,33 @@ darwin_override_options (void)
       /* Earlier versions are not specifically accounted, until required.  */
     }
 
+  /* In principle, this should be c-family only.  However, we really need to
+     set sensible defaults for LTO as well, since the section selection stuff
+     should check for correctness re. the ABI.  TODO: check and provide the
+     flags (runtime & ABI) from the lto wrapper).  */
+
+  /* Unless set, force ABI=2 for NeXT and m64, 0 otherwise.  */
+  if (!global_options_set.x_flag_objc_abi)
+    global_options.x_flag_objc_abi
+       = (!flag_next_runtime)
+               ? 0
+               : (TARGET_64BIT ? 2
+                               : (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%>");
+    }
+
   /* Don't emit DWARF3/4 unless specifically selected.  This is a 
      workaround for tool bugs.  */
   if (!global_options_set.x_dwarf_strict) 
index 29a24ddc6d6214fbbbbf3d81eac09a966c9688b6..fd4590404bd6d4cc72f1561639afb954c8a216fa 100644 (file)
@@ -112,7 +112,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 /* Default to using the NeXT-style runtime, since that's what is
    pre-installed on Darwin systems.  */
 
-#define NEXT_OBJC_RUNTIME
+#define NEXT_OBJC_RUNTIME 1
 
 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
    we want to retain compatibility with older gcc versions.  */
@@ -140,20 +140,8 @@ extern GTY(()) int darwin_ms_struct;
   } while (0)
 
 #define SUBTARGET_C_COMMON_OVERRIDE_OPTIONS do {                        \
-  /* Unless set, force ABI=2 for NeXT and m64, 0 otherwise.  */                \
-  if (!global_options_set.x_flag_objc_abi)                             \
-    global_options.x_flag_objc_abi                                     \
-       = (flag_next_runtime && TARGET_64BIT) ? 2 : 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 is only"        \
-               " supported on %<-m64%> targets for"                    \
-               " %<-fnext-runtime%>");                                 \
-  /* Sort out ObjC exceptions: If the runtime is NeXT we default to    \
-     sjlj for m32 only.  */                                            \
-  if (!global_options_set.x_flag_objc_sjlj_exceptions)                 \
-    global_options.x_flag_objc_sjlj_exceptions =                       \
+    if (!global_options_set.x_flag_objc_sjlj_exceptions)               \
+      global_options.x_flag_objc_sjlj_exceptions =                     \
                                flag_next_runtime && !TARGET_64BIT;     \
     if (flag_mkernel || flag_apple_kext)                               \
       {                                                                        \
index 40e3263c9e17e9b2ecf31e451363ac171777be67..0e9e2b497ba0b332284bb8462b2e8afa0577cb23 100644 (file)
@@ -793,6 +793,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define ACCUMULATE_OUTGOING_ARGS 0
 #endif
 
+/* By default, use the GNU runtime for Objective C.  */
+#ifndef NEXT_OBJC_RUNTIME
+#define NEXT_OBJC_RUNTIME 0
+#endif
+
 /* Supply a default definition for PUSH_ARGS.  */
 #ifndef PUSH_ARGS
 #ifdef PUSH_ROUNDING
index c079ce29b7e3d0d9b3c637eb62826e0821c2ec2b..c98b93c985bcd4c35f56322ea1b85dcd79601290 100644 (file)
@@ -5351,13 +5351,18 @@ void sincosl(long double x, long double *sin, long double *cos);
 @end defmac
 
 @defmac NEXT_OBJC_RUNTIME
-Define this macro to generate code for Objective-C message sending using
-the calling convention of the NeXT system.  This calling convention
-involves passing the object, the selector and the method arguments all
-at once to the method-lookup library function.
-
-The default calling convention passes just the object and the selector
-to the lookup function, which returns a pointer to the method.
+Set this macro to 1 to use the "NeXT" Objective-C message sending conventions
+by default.  This calling convention involves passing the object, the selector
+and the method arguments all at once to the method-lookup library function.
+This is the usual setting when targeting Darwin/Mac OS X systems, which have
+the NeXT runtime installed.
+
+If the macro is set to 0, the "GNU" Objective-C message sending convention
+will be used by default.  This convention passes just the object and the
+selector to the method-lookup function, which returns a pointer to the method.
+
+In either case, it remains possible to select code-generation for the alternate
+scheme, by means of compiler command line switches.
 @end defmac
 
 @node Addressing Modes
index d03d7f656a2f2d039c3f736e4b4c1eb7af185470..d5a7d3978e3dab6b0e2d4755aa676a624f9b6fa3 100644 (file)
@@ -5289,13 +5289,18 @@ void sincosl(long double x, long double *sin, long double *cos);
 @end defmac
 
 @defmac NEXT_OBJC_RUNTIME
-Define this macro to generate code for Objective-C message sending using
-the calling convention of the NeXT system.  This calling convention
-involves passing the object, the selector and the method arguments all
-at once to the method-lookup library function.
-
-The default calling convention passes just the object and the selector
-to the lookup function, which returns a pointer to the method.
+Set this macro to 1 to use the "NeXT" Objective-C message sending conventions
+by default.  This calling convention involves passing the object, the selector
+and the method arguments all at once to the method-lookup library function.
+This is the usual setting when targeting Darwin/Mac OS X systems, which have
+the NeXT runtime installed.
+
+If the macro is set to 0, the "GNU" Objective-C message sending convention
+will be used by default.  This convention passes just the object and the
+selector to the method-lookup function, which returns a pointer to the method.
+
+In either case, it remains possible to select code-generation for the alternate
+scheme, by means of compiler command line switches.
 @end defmac
 
 @node Addressing Modes
index 8cc6670ef1b1243ad46e81cf275750e211da0e6c..9791e1b23441616939458373da4c708b21e20f33 100644 (file)
@@ -56,10 +56,6 @@ extern bool final_insns_dump_p;
 /* Nonzero means make permerror produce warnings instead of errors.  */
 
 extern int flag_permissive;
-
-/* Generate code for GNU or NeXT Objective-C runtime environment.  */
-
-extern int flag_next_runtime;
 \f
 /* Other basic status info about current function.  */
 
index 746ebf0c420b78f1812c82b0e85c1ec3e9f1f5de..e1613594fc42f91cf6a47f17fd48399ad4d31c3f 100644 (file)
@@ -33,7 +33,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options ATTRIBUTE_UN
   /* Systems which use the NeXT runtime by default should arrange
      for the shared libgcc to be used when -fgnu-runtime is passed
      through specs.  */
-#if defined(ENABLE_SHARED_LIBGCC) && ! defined(NEXT_OBJC_RUNTIME)
+#if defined(ENABLE_SHARED_LIBGCC) && ! NEXT_OBJC_RUNTIME
   unsigned int i;
 
   /* The new argument list will be contained in this.  */
index 9be910970b428be6ad7d467b0f01c2d4f4701f9f..766aa9917c325067f3a6f37435e1f3098054cb6c 100644 (file)
@@ -146,14 +146,6 @@ HOST_WIDE_INT random_seed;
 
 /* -f flags.  */
 
-/* Generate code for GNU or NeXT Objective-C runtime environment.  */
-
-#ifdef NEXT_OBJC_RUNTIME
-int flag_next_runtime = 1;
-#else
-int flag_next_runtime = 0;
-#endif
-
 /* Nonzero means make permerror produce warnings instead of errors.  */
 
 int flag_permissive = 0;