External Issue: Build and use bundled lldb with CHPL_LLVM=bundled

20244, "milthorpe", "Build and use bundled lldb with CHPL_LLVM=bundled", "2022-07-18T22:54:02Z"

Feature request: the Chapel build process for CHPL_LLVM=bundled should also build lldb, and use this bundled version when an application is run using --lldb (or --debug if #15021 is implemented).

This would ensure that the version of lldb used is consistent with the backend compiler. Otherwise, it's possible that a system version of lldb is used which is incompatible with the DWARF format produced by the Chapel compiler, as the following example shows:

milthorpe@equinox:/noback/milthorpe/chapel-1.27.0$ chpl --version
chpl version 1.27.0
  built with LLVM version 14.0.0
Copyright 2020-2022 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
milthorpe@equinox:/noback/milthorpe/chapel-1.27.0$ chpl -g examples/hello.chpl

milthorpe@equinox:/noback/milthorpe/chapel-1.27.0$ module load llvm/8.0.1 && lldb --version
lldb version 8.0.1
milthorpe@equinox:/noback/milthorpe/chapel-1.27.0$ lldb ./hello
(lldb) target create "./hello"
Current executable set to './hello' (x86_64).
(lldb) run
warning: (x86_64) /noback/milthorpe/chapel-1.27.0/hello unsupported DW_FORM value: 0x22
Process 875566 launched: '/noback/milthorpe/chapel-1.27.0/hello' (x86_64)
Hello, world!
Process 875566 exited with status = 0 (0x00000000)
(lldb) q

milthorpe@equinox:/noback/milthorpe/chapel-1.27.0$ module load llvm
llvm                            llvm-13.0.1-gcc-11.1.0-z5fbxsm  llvm-14.0.3-gcc-11.1.0-bsh5iad
llvm/13.0.1                     llvm/14.0.0
milthorpe@equinox:/noback/milthorpe/chapel-1.27.0$ module load llvm/14.0.0 && lldb --version
lldb version 14.0.0
milthorpe@equinox:/noback/milthorpe/chapel-1.27.0$ lldb ./hello
(lldb) target create "./hello"
Current executable set to '/noback/milthorpe/chapel-1.27.0/hello' (x86_64).
(lldb) run
Process 876181 launched: '/noback/milthorpe/chapel-1.27.0/hello' (x86_64)
Hello, world!
Process 876181 exited with status = 0 (0x00000000)