Skip to content
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

llvm-libunwind and lldb v3.9 packages #639

Closed
am11 opened this issue Jan 1, 2017 · 3 comments
Closed

llvm-libunwind and lldb v3.9 packages #639

am11 opened this issue Jan 1, 2017 · 3 comments
Labels
package request A new package was requested

Comments

@am11
Copy link

am11 commented Jan 1, 2017

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:

git clone -b release_39 --single-branch /~https://github.com/llvm-mirror/llvm
git clone -b release_39 --single-branch /~https://github.com/llvm-mirror/clang llvm/tools/clang
git clone -b release_39 --single-branch /~https://github.com/llvm-mirror/lldb llvm/tools/lldb
git clone -b release_39 --single-branch /~https://github.com/llvm-mirror/libunwind llvm/projects/libunwind

# create build dir (as sibling of llvm dir for this example; it can be at llvm/build)
mkdir build && cd $_

# build
cmake ../llvm
cmake . --build

The package for non-gnu libunwind (one of the popular fork of the original HP libunwind) is disabled at the moment, due to elf_prstatus and elf types conflicting by adding linux/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. 👍

@vishalbiswas
Copy link
Contributor

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.

@am11
Copy link
Author

am11 commented Jan 1, 2017

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

@cydhaselton
Copy link

@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.

@Neo-Oli Neo-Oli added the package request A new package was requested label Jan 3, 2017
@ghost ghost closed this as completed Nov 10, 2019
@ghost ghost locked and limited conversation to collaborators Oct 9, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package request A new package was requested
Projects
None yet
Development

No branches or pull requests

4 participants