Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Issue 1774002: Breakpad: Fix build with new clang versions.

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 5 months ago by thakis
Modified:
9 years, 5 months ago
Reviewers:
Mark Mentovai
CC:
google-breakpad-dev_googlegroups.com, hans_chromium.org
Base URL:
http://google-breakpad.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Breakpad: Fix build with new clang versions.

gcc has a single exception setting for all languages. Saying -fno-exceptions
in gcc disables exceptions and cleanups for cc files, but has no effect for mm
files.

In clang, -fno-exceptions only disables c++ exceptions, but keeps objective-c
exceptions and cleanups enabled.

http://llvm.org/viewvc/llvm-project?view=revision&revision=220714 changed
__EXCEPTIONS to be defined for clang when cleanups are enabled, independent of
if c++ exceptions are enabled. (This was necessary to have clang work with
glibc which looks at __EXCEPTIONS to decide if cleanups are enabled.)

Breakpad tried to use __EXCEPTIONS to figure out if c++ exceptions are enabled.
In cc files, this works: -fno-exceptions will disable c++ exceptions and
cleanups. But in mm files, -fno-exceptions will disable c++ exceptions and
objective-c exceptions will still be enabled, and so cleanups must run and hence
__EXCEPTIONS is defined.

To make things work with both old and new compilers, do the try/catch hack in
mm files either if __EXCEPTIONS is not defined (for old compilers) or if the
compiler is clang and __has_feature(cxx_exceptions) isn't set (which will work
for new clangs too, and which cleanly maps to if c++ exceptions are enabled).

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M src/client/ios/Breakpad.mm View 1 chunk +1 line, -1 line 0 comments Download
M src/client/mac/Framework/Breakpad.mm View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4
thakis
9 years, 5 months ago #1
Mark Mentovai
LGTM
9 years, 5 months ago #2
thakis
Thanks! Can you land this for me? I'm not a breakpad committer. On Dec 10, ...
9 years, 5 months ago #3
Mark Mentovai
9 years, 5 months ago #4
Sure thing, committed r1409.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted