-
Notifications
You must be signed in to change notification settings - Fork 696
feat(gcc): add libbacktrace-static subpackage #18458
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
Closed
Nan Liu (liunan-ms)
wants to merge
1
commit into
microsoft:4.0
from
liunan-ms:liunan/add-libbacktrace-static
+88
−2
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
base/comps/gcc/overlays/0002-libbacktrace-static.overlay.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # Azure Linux exposes GCC's internal libbacktrace as a standalone | ||
| # `libbacktrace-static` subpackage. There is no upstream package to | ||
| # import. Downstream consumers need the static library + header | ||
| # at build time, so we install them here. | ||
|
|
||
| [metadata] | ||
| category = "azl-platform-adaptation" | ||
| upstream-status = "inapplicable" | ||
|
|
||
| # Bump the manual gcc release so the new subpackage and its dependents rebuild. | ||
| [[overlays]] | ||
| description = "Bump gcc release for the added libbacktrace-static subpackage" | ||
| type = "spec-search-replace" | ||
| regex = '^%global gcc_release 7$' | ||
| replacement = "%global gcc_release 8" | ||
|
|
||
| # Declare the new subpackage right after the C++ package/description block. | ||
| [[overlays]] | ||
| description = "Declare the libbacktrace-static subpackage" | ||
| type = "spec-append-lines" | ||
| section = "%description" | ||
| package = "c++" | ||
| lines = [ | ||
| "%package -n libbacktrace-static", | ||
| "Summary: Static library for GCC's libbacktrace", | ||
| "", | ||
| "%description -n libbacktrace-static", | ||
| "This package contains GCC's static libbacktrace library and its header.", | ||
| "", | ||
| ] | ||
|
|
||
| # Install the internal libbacktrace static archive and its header. | ||
| [[overlays]] | ||
| description = "Install libbacktrace static library and header into the buildroot" | ||
| type = "spec-append-lines" | ||
| section = "%install" | ||
| lines = [ | ||
| "# Azure Linux: expose GCC's internal libbacktrace as a static library + header.", | ||
| "_azl_bt=%{_builddir}/gcc-%{version}-%{DATE}/obj-%{gcc_target_platform}/libbacktrace/.libs/libbacktrace.a", | ||
| "install -m 0644 -D \"$_azl_bt\" %{buildroot}%{_libdir}/libbacktrace.a", | ||
|
liunan-ms marked this conversation as resolved.
|
||
| "install -m 0644 -D %{_builddir}/gcc-%{version}-%{DATE}/libbacktrace/backtrace.h %{buildroot}%{_includedir}/backtrace.h", | ||
| "", | ||
| ] | ||
|
|
||
| # List the installed libbacktrace-static files. | ||
| [[overlays]] | ||
| description = "Package the libbacktrace-static files" | ||
| type = "spec-append-lines" | ||
| section = "%files" | ||
| package = "c++" | ||
| lines = [ | ||
| "%files -n libbacktrace-static", | ||
| "%{_includedir}/backtrace.h", | ||
| "%{_libdir}/libbacktrace.a", | ||
| "", | ||
| ] | ||
|
|
||
| [[overlays]] | ||
| description = "Add changelog entry for the libbacktrace-static subpackage" | ||
| type = "spec-prepend-lines" | ||
| section = "%changelog" | ||
| lines = [ | ||
| "* Fri Aug 14 2026 Nan Liu <liunan@microsoft.com> - 15.2.1-8", | ||
| "- Add libbacktrace-static subpackage exposing GCC's internal libbacktrace", | ||
| " static library and header for downstream consumers.", | ||
| "", | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question(blocking):
Did we evaluate the trade-off of building the library from https://github.com/ianlancetaylor/libbacktrace instead?
openSUSE and Debian appear to get it directly from there. (IF you notice the gcc internal copy of the library lists the same author in its copyright notice.)
(openSUSE also has a .spec for this location.)