Is it arm64 supported?
Hello,
First of all thanks for this tool, it would be amazing for me to have stack traces working on Linux.
I'm trying to use it in a Raspberry pi with Ubuntu (arm64), but I am not able to print the stack trace with Backtrace.print() or forcing a crash and see the stack.
Do you think it could work?
Thanks again.
I'm afraid I don't know, I don't have any ARM64 hardware so I haven't tried it myself.
Your experience suggests that it probably doesn't work 😢
Let me know if you manage to debug what the problem might be.
Thanks for your quick answer.
I've tried the same code in Ubuntu x86_64 to discard any other kind of problems and is working as expected, so looks like something is wrong with ARM64 😞.
I'm trying to find out what's happening but my knowledges in C and debug in Linux are limited. Any suggestion is very appreciated
Many thanks!
The backtracing code is based on https://github.com/ianlancetaylor/libbacktrace - I couldn't see at a quick glance whether that supports ARM64 or not.
@rmaqueda
I fork this project to support Android armv7 aarch64 x86 x86_64 arch.
Maybe you can refer it, hope it give you some help.
https://github.com/Guang1234567/swift-backtrace
The swift-android-toolchain is here. Usage and Sample also in README.md
Snapshot:
https://github.com/Guang1234567/swift-android-architecture/blob/6542dd554a6f4b8fe622a16ec29da40b204ffe7f/todoapp/app/src/main/swift/Sources/TodoCore/TaskRepository.swift#L55

BTW, this project depends on libunwind.
So have two way to resolve it:
- Way 1:
Install the libunwind.so to ubuntu arm64 OS. Maybe you need to compile it from source code by yourself (⊙﹏⊙).
Then Fork this project and create new swift module name CUnwind like Clibunwind, and make CBacktrace depends on it.
- Way 2:
Fork this project and create new swift module name CUnwind and build it from source code by SPM directly, and make CBacktrace depends on it.
Hi @Guang1234567 thanks for the information - it's great to hear you've added ARM support in your fork! Would you be interested in contributing your changes back here in a pull request? I would be happy to merge support for Android.
Adding a +1 here. I noticed backtrace stopped working when I switched to AWS Graviton. Would be great to have arm64 support!
Adding a +1 here. I noticed backtrace stopped working when I switched to AWS Graviton. Would be great to have arm64 support!
@grahamburgsma
I fork this repo to support arm64 for android. Hope it save your time.
https://github.com/Guang1234567/swift-backtrace