Closed Philanatidae closed 3 years ago
It appears this is an issue when building for arm64
for M1 chips. In backward.hpp
, with the population of the error address (if-else chain beginning on line 4153), __aarch64__
is defined since an ARM chip is being compiled. However, the error address is not uctx->uc_mcontext.pc
for macOS. It is instead uctx->uc_mcontext->__ss.__pc
. Adding a conditional for __APPLE__
and using uctx->uc_mcontext->__ss.__pc
fixes the issue.
I've only tested compiling for Apple Silicon currently, I'll verify that this works in a Universal 2 binary and then I'll make a pull request.
Thank you! A new architecture, this is exciting :)
On Sat, 2 Jan 2021, 18:27 Phil, notifications@github.com wrote:
It appears this is an issue when building for arm64 for M1 chips. In backward.hpp, with the population of the error address (if-else chain beginning on line 4153), aarch64 https://github.com/bombela/backward-cpp/blob/27a89004a86fe2a665f041c198c7fbab7489e278/backward.hpp#L4159 is defined since an ARM chip is being compiled. However, the error address is not uctx->uc_mcontext.pc for macOS. It is instead uctx->uc_mcontext->ss.pc. Adding a conditional for APPLE and using uctx->uc_mcontext->ss.pc fixes the issue.
I've only tested compiling for Apple Silicon currently, I'll verify that this works in a Universal 2 binary and then I'll make a pull request.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bombela/backward-cpp/issues/200#issuecomment-753557907, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABUZDGWDPWPTOMNVOOJCRLSX7IZRANCNFSM4VROVSAA .
When attempting to add Backward to my C++ project on macOS, compilation fails with this error:
I'm able to reproduce this with a simple "Hello World" project. I'm unsure if this is caused by compiling on Big Sur or an issue compiling for the M1 chip (I'm running a 2020 Mac mini). I haven't dived too deep into this but wanted to report an issue to see if anybody has run into the same problem or knows of a solution. I pulled the latest from
master
.