Skip to content

build: add SENTRY_LIBUNWIND_SYSTEM option#1753

Merged
jpnurmi merged 3 commits into
masterfrom
jpnurmi/build/libunwind-system
May 27, 2026
Merged

build: add SENTRY_LIBUNWIND_SYSTEM option#1753
jpnurmi merged 3 commits into
masterfrom
jpnurmi/build/libunwind-system

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented May 26, 2026

Add SENTRY_LIBUNWIND_SYSTEM as a Linux-only opt-in for using system libunwind via pkg-config instead of the vendored copy.

Verified with the Alpine CI builds:

-- Checking for module 'libunwind'
--   Found libunwind, version 1.8.1

Close: #1714

Copy link
Copy Markdown
Contributor

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

Copy link
Copy Markdown
Collaborator

@supervacuus supervacuus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but it requires clear documentation under compile options in the README.

In this proposed setup, there is a dramatic asymmetry that this documentation should highlight:

  • The vendored libunwind will always be built as a static archive and either linked into the resulting shared library or colocated with the other resulting static artifacts as output. This is what most Native SDK consumers will expect.
  • when SENTRY_LIBUNWIND_SYSTEM=On, the decision of what kind of library artifact will be included is entirely deferred to the host distribution/sysroot/package manager. This path only considers SENTRY_BUILD_SHARED_LIBS in terms of how it makes an artifact available to a consuming CMake project, not in terms of how contained the resulting deployable install will be. The latter will have to be solved externally (either via a package manager configuration or through a very careful setup of packages on the build and target machines).

The latter, besides being different from the former, is also in stark contrast to what we had before we vendored libunwind as the default unwinder on Linux.

This is neither good nor bad, but it requires clear documentation of expectations, since it is now part of the build and package contract. The story is entirely different for users who can configure their build from within a source-level package manager like conan or vcpkg, and those who build and deploy against binary distro packages.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 27, 2026

NATIVE-187

Comment thread README.md Outdated
@jpnurmi jpnurmi merged commit b068815 into master May 27, 2026
64 of 65 checks passed
@jpnurmi jpnurmi deleted the jpnurmi/build/libunwind-system branch May 27, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Add option to consume unvendored libunwind

3 participants