0

[libunwind] Build with -funwind-tables

This adds the -funwind-tables flag when compiling libunwind. This allows
unwinding past, eg. _Unwind_RaiseException.
The upstream cmake build adds it when it is supported, and generation of
unwind tables is already done for all the libunwind C++ code since
it compiles with exceptions enabled.

Also pass -fexceptions to the C code on Fuchsia only to work around
https://bugs.llvm.org/show_bug.cgi?id=45875.

Bug: 1078588
Change-Id: Id821f143c12e7e1e376eea534be52c6cd8504465
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218273
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774598}
This commit is contained in:
Ambre Williams
2020-06-03 13:27:59 +00:00
committed by Commit Bot
parent 2f1818e848
commit d20e971be2

@ -11,7 +11,18 @@ config("libunwind_config") {
# ValueAsBitPattern in Unwind-EHABI.cpp is only used on Debug builds.
"-Wno-unused-function",
# libunwind expects to be compiled with unwind tables so it can
# unwind its own frames.
"-funwind-tables",
]
if (is_fuchsia) {
# Workaround for https://bugs.llvm.org/show_bug.cgi?id=45875:
# compiling the C code with -fexceptions ensures that accurate
# unwinding information is generated for _Unwind_RaiseException.
cflags_c = [ "-fexceptions" ]
}
}
source_set("libunwind") {