Closed am11 closed 5 years ago
Right now, termux doesn't provide a separate llvm library package. Its all churned up into the clang package. Rust requires llvm, too. The clang package's buildscript is incomprehensible in its current state. Needs a lot of work. It would help a lot if the libs were separated.
Thanks @vishalbiswas, hope we can achieve this separation in llvm tools & projects packages (clang being one of them, instead the composite package).
For reference, see pkgsrc
packaging of these projects:
https://github.com/NetBSD/pkgsrc-wip/tree/master/llvm-git
https://github.com/NetBSD/pkgsrc-wip/tree/master/clang-git
https://github.com/NetBSD/pkgsrc-wip/tree/master/lldb-git
https://github.com/NetBSD/pkgsrc-wip/tree/master/libunwind-git (this is llvm-libunwind)
Separately, in the previous post, clang sources are required by lldb
, when building everything from source. However, we can override that requirement by setting some environment variable knob (as what pkgsrc is doing).
CoreCLR (cmake) introspection support both llvm flavors, HP unwind is preferred one. However, to support macOS and NetBSD etc., we only have llvm flavor which doesn't support unw_get_save_loc
. See https://github.com/dotnet/coreclr/issues/872 and https://github.com/dotnet/coreclr/issues/862 for context.
Also, AFAICT, Julia and Rust autoconfigs also support llvm flavored libunwind (to get unwinding work on macOS in particular).
The ask is to preferably support lldb and both kinds of libunwind libs if possible, otherwise llvm-libunwind (which is bit inferior but works cross-platform including macOS/NetBSD). Then the vendor can decide which one they want to compile against for certain {OS.arch}. :)
cc @cydhaselton for visibility
@am11 Assuming this is in regards to libunwind for hacking on the CoreCLR build, I've uploaded the modified sources for the on-device build I used for the feature-android branch: https://github.com/cydhaselton/libunwind-android.git
It's a bit hacky but should build in Termux.
LLVM has handful of projects listed at https://llvm.org/svn/llvm-project/, out of which this subset is quite instesting: https://github.com/llvm-mirror?tab=repositories
libunwind
(llvm's flavor developed by Apple) and lldb are used as dependencies for some language runtimes, in particular, .NET CoreCLR and Julia.Building llvm tools and projects are usually straightforward and can be tried out with resembling steps:
The package for
non-gnu libunwind
(one of the popular fork of the originalHP libunwind
) is disabled at the moment, due toelf_prstatus
andelf
types conflicting by addinglinux/elfcore.h
header. It can probably be fixed by including<elf.h>
header (which has proper macro redefinitions guards).If all worked out well, Termux will be providing lldb and both kinds of libunwind libs. 👍