feat(gcc): add libbacktrace-static subpackage - #18458
Conversation
66d09c5 to
f669149
Compare
There was a problem hiding this comment.
Pull request overview
Adds a GCC libbacktrace-static RPM for downstream build consumers.
Changes:
- Adds overlays defining and installing the subpackage.
- Bumps GCC’s release and regenerates its spec.
- Refreshes the GCC lock fingerprint.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
base/comps/gcc/overlays/0002-libbacktrace-static.overlay.toml |
Defines the GCC customization. |
specs/g/gcc/gcc.spec |
Contains the rendered packaging changes. |
locks/gcc.lock |
Refreshes the component fingerprint. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
base/comps/gcc/overlays/0002-libbacktrace-static.overlay.toml:40
- The validation only installs the RPM and checks that these files exist; it does not exercise the new package's actual consumer contract. A static-library smoke test should compile, link, and run a minimal
backtrace_create_stateconsumer against-lbacktrace(or rebuild the intended Boost target) in the clean mock chroot so missing link requirements or an unusable archive are caught before merge.
"install -m 0644 -D \"$_azl_bt\" %{buildroot}%{_libdir}/libbacktrace.a",
Expose GCC's internal libbacktrace static library (libbacktrace.a) and its header (backtrace.h) as a new libbacktrace-static subpackage
f669149 to
6f02a9f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
base/comps/gcc/overlays/0002-libbacktrace-static.overlay.toml:41
- The exported libbacktrace interface is incomplete. GCC generates
backtrace-supported.h, and upstream documents it for users to inspectBACKTRACE_SUPPORTED, thread support, and related capabilities; many consumers include it alongsidebacktrace.h. Installing onlybacktrace.hmakes those consumers fail to build despite this package being installed. Install the generated header from the libbacktrace object directory as well.
"install -m 0644 -D %{_builddir}/gcc-%{version}-%{DATE}/libbacktrace/backtrace.h %{buildroot}%{_includedir}/backtrace.h",
base/comps/gcc/overlays/0002-libbacktrace-static.overlay.toml:54
- The generated
backtrace-supported.hmust also be owned bylibbacktrace-static; otherwise adding it during%installwill leave it outside the package manifest (and future stricter unpackaged-file checks would fail).
"%files -n libbacktrace-static",
"%{_includedir}/backtrace.h",
"%{_libdir}/libbacktrace.a",
| @@ -0,0 +1,67 @@ | |||
| # Azure Linux exposes GCC's internal libbacktrace as a standalone | |||
There was a problem hiding this comment.
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.)
Summary
Upstream GCC builds libbacktrace for internal use only and deliberately does not install the static archive or header. This PR adds a new
libbacktrace-staticsubpackage togcc, exposing GCC's internal libbacktrace static library (libbacktrace.a) and its public header(backtrace.h).Changes
base/comps/gcc/overlays/0002-libbacktrace-static.overlay.toml(single file-level
[metadata],category = azl-platform-adaptation):gcc_release(7 → 8) so the new subpackage and itsdependents rebuild.
%package -n libbacktrace-static+%description.%install: locate the builtlibbacktrace.ain the obj tree and install itplus
backtrace.hinto the buildroot.%files -n libbacktrace-static.%changelogentry.specs/g/gcc/gcc.specand refreshedlocks/gcc.lock.The resulting
libbacktrace-staticRPM ships exactly:with no runtime dependencies.
Validation
All steps performed against the Azure Linux 4.0 stage2 mock environment
(
x86_64).Render the spec and confirm the overlays applied:
Build the component:
azldev comp build -p gcc # -> base/out/rpms/rpm-base/libbacktrace-static-15.2.1-8.azl4.x86_64.rpmInspect the produced RPM:
Install with
tdnfin the 4.0 chroot and verify the files land:Result:
Compile + link + run smoke test (proves the archive is usable and
correct-arch, not just installable — a wrong-arch or corrupt
.afails at the-lbacktracelink or at runtime):Result:
Confirms: the header compiles,
-lbacktracelinks the static archive directlyinto the binary (no
DT_NEEDEDfor libbacktrace), and the resulting programruns and exercises the libbacktrace API successfully.