-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Cannot resolve symbols from binary linked with LLD #1196
Comments
@pirama-arumuga-nainar any ideas? I haven't had a chance to test with the latest LLD yet. |
Hello, I have the same issue on armeabi-v7a. However, I don't get this issue on arm64-v8a. Environment Details
I made the sample in case you need to recheck it. Link is here |
Thanks. I'll check that against a more up to date toolchain tomorrow. You could try the canary if you want, but I think the master branch is fairly behind what we'll actually be shipping in r22. |
Although you could try downloading the LLD from https://android.googlesource.com/platform/prebuilts/clang/host/windows-x86/+/refs/heads/master/clang-r383902/ and replacing the LLD that's in your NDK with that. I think r22 will have something slightly newer, but that's what I'll test tomorrow since I don't have anything newer yet :) |
It looks like the toolchain we have is going to need further updates, so waiting for the new new one before trying the above. |
Ended up cherry-picking to the toolchain rather than a full update, and this is still broken with that version:
Going to leave this triaged here for the moment. Could be that we need another toolchain update, could be that this is broken upstream, could be a bug in ndk-stack. We need to know more before we can actually ship lld as the default, I think. |
https://github.com/DanAlbert/lld-stack-dump-bug is the repro case from the original post, updated slightly to accommodate the changes I'm making to master today and to set the linker from the command line rather than CMakeLists.txt in case the issue was the toolchain file not knowing (it wasn't, but had to check). |
Seems this is http://b/109657296 (thanks a bunch to @pirama-arumuga-nainar for all the help debugging!). If I add The fix for the driver that was needed for this never got sent, so we'll patch the build systems and document the problem for now and get the fix in for r23. |
https://android-review.googlesource.com/c/platform/ndk/+/1350672 is the fix for r22. Still need to write the driver patch. @mikaheli @Seal2002 you should be able to fix this locally for old NDK versions as well. Just make sure |
Okay, we can't actually lift this into the driver until the old linkers are gone. The driver doesn't know what linker its using and neither gold nor bfd accept that argument. LLD doesn't know what version of Android it's targeting, so we can't make the fix there either. This is just going to be a build system fix until we've removed the old linkers. Filed #1294 to track that. @jomof fyi you'll want to make this fix in VS as well. See the updated doc in the patch in the previous comment for more info. |
Issue: android/ndk#1196 This is a port of the fix from NDK master: https://android-review.googlesource.com/c/platform/ndk/+/1350672 Quoting description from the original fix: > The unwinder used for crash handling on Android devices prior to API 29 cannot > correctly unwind binaries built with `-Wl,--rosegment`. This flag is enabled by > default when using LLD, so if using LLD and targeting devices older than API 29 > you must pass `-Wl,--no-rosegment` when linking for correct stack traces in logcat. ref:3e66526bf1f6bd39b04f067de173c9ca090e5f13
Issue: android/ndk#1196 This is a port of the fix from NDK master: https://android-review.googlesource.com/c/platform/ndk/+/1350672 Quoting description from the original fix: > The unwinder used for crash handling on Android devices prior to API 29 cannot > correctly unwind binaries built with `-Wl,--rosegment`. This flag is enabled by > default when using LLD, so if using LLD and targeting devices older than API 29 > you must pass `-Wl,--no-rosegment` when linking for correct stack traces in logcat. ref:3e66526bf1f6bd39b04f067de173c9ca090e5f13
Issue: android/ndk#1196 This is a port of the fix from NDK master: https://android-review.googlesource.com/c/platform/ndk/+/1350672 Quoting description from the original fix: > The unwinder used for crash handling on Android devices prior to API 29 cannot > correctly unwind binaries built with `-Wl,--rosegment`. This flag is enabled by > default when using LLD, so if using LLD and targeting devices older than API 29 > you must pass `-Wl,--no-rosegment` when linking for correct stack traces in logcat. ref:3e66526bf1f6bd39b04f067de173c9ca090e5f13
Description
Cannot resolve symbols (crash location) from crash dump from binary that is linked with
-fuse=lld
. I'm usingndk-stack
to resolve symbols from crash dump. When using current default linker from ndk, things work fine.Here is small example to reproduce:
Structure:
application/application.cpp
application/CMakeLists.txt
build_and_run.sh
Output crash dumps:
Default linker
LLD linker
Environment Details
The text was updated successfully, but these errors were encountered: