[Patch] Move Objective-C runtime flags to modern options system.
Iain Sandoe
developer@sandoe-acoustics.co.uk
Wed Nov 9 18:33:00 GMT 2011
As discussed in:
http://gcc.gnu.org/ml/gcc-patches/2011-11/msg00927.html
This puts "flag_next_runtime" into the global options structure
-- hopefully this will pave the way for extracting the information
from objects when doing LTO and making sure that it is (a) consistent
- and (b) that the correct values are set for the backend -
- this does affect Darwin where the ObjC meta-data are put into
different sections depending on the choice of runtime - thus it would
be good to be able to verify things when doing LTO.
--
In order to do this I had to address a number of bits & pieces to do
with dependencies on the flag when setting other defaults.
Essentially we have:
* runtime (gnu/next)
* abi-version
* exceptions model.
which must be consistent - the determination of this has been moved to
ObjC init
---
I am probably missing something
- but there doesn't seem to be a ready way to set the Init() value
of a flag depending on the target
- the flag_next_runtime value is used on Darwin very early during
building the includes lists
- which happens before the options_override is called () so it would
be nice to be able to do that (although I've worked around it for now).
---
I needed to deal with '-fobjc-sjlj-exceptions' and elected to remove
it -
- this is because there is only one valid exception model for each
permutation of runtime and ABI - thus the User flag is just clutter.
It is now ignored as a User flag - and the relevant selection actions
are all local to Objective C.
(yay! got rid of one exceptions-related flag :-)) ....
---
tested on i686-darwin9 (Objective-C and Objective-C++) with :
-m32/-fobjc-abi-version=0,-m32/-fobjc-abi-version=1,-m64
which exercises both GNU and NeXT runtimes for all current ABIs.
no regressions,
OK for trunk?
Iain
gcc:
* flags.h (flag_next_runtime): Remove.
* toplev.c (flag_next_runtime): Remove.
* config/darwin-c.c (darwin_register_objc_includes): Check if the
GNU runtime is explicitly selected.
* config/darwin.c (darwin_override_options): Set defaults for
Objective C runtime and ABI dependent on the target. Check for
incompatible ABI/target pairs.
* config/darwin.h (SUBTARGET_C_COMMON_OVERRIDE_OPTIONS):
Remove Objective-C flags checks.
gcc/c-family:
* c.opt (fgnu-runtime) Fill in information required to generate.
(fnext-runtime): Likewise.
(fobjc-sjlj-exceptions): Ignore and warn that it has no effect.
* c-opts.c (c_common_handle_option): Remove references to
Objective-C runtime flags.
(c_common_post_options): Remove Objective-C code adjusting
Objective-C exceptions models.
gcc/objc:
* objc-next-runtime-abi-01.c (objc_next_runtime_abi_01_init):
Handle checking and setting the exception model.
* objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise.
* objc-gnu-runtime-abi-01.c (objc_gnu_runtime_abi_01_init): Likewise.
* objc-act.h (flag_objc_sjlj_exceptions): Declare.
* objc-act.c (flag_objc_sjlj_exceptions): Define default.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 181206-move-objc-runtime-flag-to-opts.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111109/5187b081/attachment.txt>
-------------- next part --------------
More information about the Gcc-patches
mailing list