iPhoneSimulator.platform ignores Xcode "Enable (C++|Objective-C) Exceptions" flags

Originator:landon.j.fuller
Number:rdar://16620815 Date Originated:15-Apr-2014 12:03 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Version 5.1 (5B130a)
Classification:Serious Bug Reproducible:Always
 
Summary:
If GCC_ENABLE_CPP_EXCEPTIONS is set to "no" in an Xcode project, iPhoneSimulator.platform does pass -fno-exceptions to the compiler, but *also* passes -fexceptions, re-enabling the use of exceptions.

This seems to be caused by broken compiler flag configurations in iPhoneSimulator.platform's Developer/Library/Xcode/Specifications/Native Build System.xcspec, specifically:

            {
                Name = "GCC_ENABLE_EXCEPTIONS";
                Type = Boolean;
                DefaultValue = YES;
                CommandLineFlag = "-fexceptions";
            },

Xcode 5.1 does not set "GCC_ENABLE_EXCEPTIONS", which results in this flag defaulting to YES and -fexceptions being passed to the compiler. The actual configuration values used by Xcode 5.1 are "GCC_ENABLE_CPP_EXCEPTIONS" and "GCC_ENABLE_OBJC_EXCEPTIONS".

This can be worked around by adding "GCC_ENABLE_EXCEPTIONS" as a user-defined build setting, and setting its value to "FALSE".

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!