Permalink
Browse files

Fix flags to compile Skia on macOS which fixes exception handling

On Clang/macOS we cannot mix projects compiled with -fno-rtti that use
std::__throw_bad_weak_ptr() function and expect to catch
std::runtime_error as an std::exception in our project (compiled with
-frtti).

Real fix to crash in c59f03a and other
crash like moving a layer below to the background, and maybe a lot of
other cases where exceptions are used.

Example of this bug: https://gist.github.com/dacap/7ddffbe401eb42620de397e47edfcc76
  • Loading branch information...
dacap committed Apr 28, 2018
1 parent 41b97cd commit 160209cb2587a631bf863950e9c2025c72ba3294
Showing with 1 addition and 8 deletions.
  1. +1 −1 INSTALL.md
  2. +0 −7 src/app/job.cpp
View
@@ -301,7 +301,7 @@ several minutes to finish:
cd skia
git checkout aseprite-m67
python tools/git-sync-deps
gn gen out/Release --args="is_official_build=true skia_use_system_expat=false skia_use_system_icu=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false"
gn gen out/Release --args="is_official_build=true skia_use_system_expat=false skia_use_system_icu=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false extra_cflags_cc=[\"-frtti\"]"
ninja -C out/Release
After this you should have all Skia libraries compiled. When you
View
@@ -94,13 +94,6 @@ void Job::startJob()
catch (const std::exception& ex) {
Console::showException(ex);
}
// TODO This is required by Clang to show the
// std::runtime_error() from base/file_handle.cpp library. I
// don't get this, it looks like a Clang bug, because this
// should be caught by the std::exception case.
catch (const std::runtime_error& ex) {
Console::showException(ex);
}
catch (...) {
Console console;
console.printf("Unknown error performing the task");

0 comments on commit 160209c

Please sign in to comment.