Open DavidSpickett opened 11 months ago
@llvm/issue-subscribers-lldb
Author: David Spickett (DavidSpickett)
there's attempt to upgrade it but llvm18 on 32-bit ARM is broken for Alpine https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/61854
and there's failed tests https://github.com/llvm/llvm-project/issues/69455
This was originally reported as https://discourse.llvm.org/t/no-debug-symbols-in-armv7-alpine-linux-musleabihf/75599, I'm going to summarise my findings here.
This is using Alpine 3.19 pulled from docker hub, and when building lldb from source I am first installing the packages listed in https://git.alpinelinux.org/aports/tree/community/lldb/APKBUILD.
I tried this with installed versions 17.0.5 and built from
main
arounda9b30545448695c76ddb25a16fae613d641cfeb7
which is an 18.x.On armv7, lldb seemingly fails to deduce the program's triple from the ELF file:
It's my assumption that not detecting some form of Linux here causes problems later as we get:
Then we get an error saying the process couldn't be started.
It is possible to get the process started by specifying a slightly different triple as shown in the Discourse post, but this then loses symbols because it picks the wrong dynamic loader plugin. Again I think because we don't know this is Linux and it falls through to the Darwin loader plugin which of course finds nothing.
This does not happen on the arm64 version of the same container:
Note:
So I think in the armv7 case the plugin is being asked if it can debug
<some triple>
and that triple is not correct.LLDB does not have any specific references to musl in the source code, the most we have is a few fixes for building against it. So it's likely we're making some glibc specific choices if we're on Linux and/or treating this binary as a bare metal binary.