r220714 - Frontend: Define __EXCEPTIONS if -fexceptions is passed

Hans Wennborg hans at chromium.org
Fri Dec 5 10:48:20 PST 2014


It seems building with -fno-exceptions now disables objective-c exceptions.

I don't know if that is the intended behaviour, but it is different
from the previous behaviour, and breaks some of Chromium's objective-c
files  Are the meanings of these flags documented somewhere?

In Chromium's build system, -fno-exceptions seems to be interpreted as
a flag for disabling c++ exceptions only.


On Fri, Dec 5, 2014 at 12:59 AM, David Majnemer
<david.majnemer at gmail.com> wrote:
> I'm calling this fixed with r223455.
>
> On Thu, Dec 4, 2014 at 6:12 PM, Nico Weber <thakis at chromium.org> wrote:
>>
>> Possible, but
>> http://llvm.org/viewvc/llvm-project?view=revision&revision=139496 suggests
>> that at least Doug thinks that this is working as intended (that's the
>> revision that added the test that got its expectations inverted here).
>>
>> On Thu, Dec 4, 2014 at 5:00 PM, Richard Smith <richard at metafoo.co.uk>
>> wrote:
>>>
>>> This looks like a driver bug; a complete reproducer needs a Darwin
>>> triple, in order to get exceptions enabled for Obj-C by default:
>>>
>>> $ ./build/bin/clang -fno-exceptions -x objective-c++  -target
>>> x86_64-apple-darwin11 -v /dev/null
>>> [...]clang-3.6" -cc1 [...] -fexceptions [...]
>>>
>>> The issue is that -fno-exceptions has no effect in Objective-C (look at
>>> the exceptionSettings function in Driver/Tools.cpp and note that an explicit
>>> -fno-exceptions does *not* turn off ShouldUseExceptionTables; look at
>>> addExceptionArgs and note that it overrides that flag anyway if we're on
>>> Darwin).
>>>
>>> It seems pretty clear that passing -fno-exceptions to the driver should
>>> never result in a -cc1 invocation with -fexceptions enabled...
>>>
>>> On Thu, Dec 4, 2014 at 4:14 PM, Hans Wennborg <hans at chromium.org> wrote:
>>>>
>>>> On Mon, Oct 27, 2014 at 1:02 PM, David Majnemer
>>>> <david.majnemer at gmail.com> wrote:
>>>> > Author: majnemer
>>>> > Date: Mon Oct 27 15:02:19 2014
>>>> > New Revision: 220714
>>>>
>>>>
>>>> This broke Chromium:
>>>>
>>>> http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/11730/steps/compile%20%28with%20patch%29/logs/stdio
>>>>
>>>> > --- cfe/trunk/test/Preprocessor/predefined-exceptions.m (original)
>>>> > +++ cfe/trunk/test/Preprocessor/predefined-exceptions.m Mon Oct 27
>>>> > 15:02:19 2014
>>>> > @@ -1,6 +1,6 @@
>>>> >  // RUN: %clang_cc1 -x objective-c -fobjc-exceptions -fexceptions -E
>>>> > -dM %s | FileCheck -check-prefix=CHECK-OBJC-NOCXX %s
>>>> >  // CHECK-OBJC-NOCXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
>>>> > -// CHECK-OBJC-NOCXX-NOT: #define __EXCEPTIONS 1
>>>> > +// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1
>>>>
>>>> It seems this reverses the test, and does the opposite of what at
>>>> least the code I was trying to compile with -fno-exceptions expects:
>>>>
>>>> https://code.google.com/p/chromium/codesearch#chromium/src/breakpad/src/client/mac/Framework/Breakpad.mm&l=51
>>>> _______________________________________________
>>>> cfe-commits mailing list
>>>> cfe-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>
>>>
>>
>



More information about the cfe-commits mailing list