diff options
author | Tom Hughes <tomhughes@chromium.org> | 2022-08-25 10:35:39 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-10-10 17:49:07 +0000 |
commit | b6826411d184bc52d2afe9f4a5d369baca8e68f1 (patch) | |
tree | 284d76caab6f2b2a06fe94a3e7cb4700874abc66 /Makefile.toolchain | |
parent | 85090d0d30c8569de4709f52580ce98dbb0217c6 (diff) | |
download | chrome-ec-b6826411d184bc52d2afe9f4a5d369baca8e68f1.tar.gz |
core/cortex-m: Disable C++ exceptions
__exidx_start and __exidx_end indicate the start and end of the
exception index table, which is described in more detail in "Exception
Handling ABI for ARM Architecture":
https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/ehabi32/ehabi32.rst#54the-object-producer-interface
__exidx_start and __exidx_end are referenced in libunwind, so they need
to be defined. If __exidx_start and __exidx_end are equal, libunwind
will interpret the exception index table as empty, which means the
exception can not be caught, and std::terminate() is called, which is
what we want. The test in https://crrev.com/c/3932262 verifies this
behavior.
See
https://github.com/llvm/llvm-project/blob/b3c5da73b71908c59b12ef0feadfde56bad222b5/libunwind/src/AddressSpace.hpp#L515-L522
BRANCH=none
BUG=b:234181908
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I8551ca94fce16ec34770f9204282af14667e7c43
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3857943
Reviewed-by: Andrea Grandi <agrandi@google.com>
Diffstat (limited to 'Makefile.toolchain')
-rw-r--r-- | Makefile.toolchain | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Makefile.toolchain b/Makefile.toolchain index fe7bfd7a83..8286be1e7c 100644 --- a/Makefile.toolchain +++ b/Makefile.toolchain @@ -115,6 +115,8 @@ C_WARN = -Wstrict-prototypes -Wdeclaration-after-statement -Wno-pointer-sign COMMON_WARN = -Wall -Wundef -Werror-implicit-function-declaration \ -Wno-trigraphs -Wno-format-security -Wno-address-of-packed-member \ -fno-common -fno-strict-aliasing -fno-strict-overflow +# See https://www.chromium.org/chromium-os/build/c-exception-support +COMMON_WARN+=-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables ifndef ALLOW_WARNINGS COMMON_WARN+=-Werror |