public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/containerd] rawhide: Build shim as static-pie
@ 2026-06-27 18:51 Bradley G Smith
0 siblings, 0 replies; only message in thread
From: Bradley G Smith @ 2026-06-27 18:51 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/containerd
Branch : rawhide
Commit : 05640e587dc20b14b4c2b48f02e7b3fc794c3497
Author : Bradley G Smith <bradley.g.smith@gmail.com>
Date : 2026-05-21T07:32:00-07:00
Stats : +11/-7 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/containerd/c/05640e587dc20b14b4c2b48f02e7b3fc794c3497?branch=rawhide
Log:
Build shim as static-pie
- Build shim as static using static-pie to retain pie benefits and
static build.
See
https://github.com/containerd/containerd/discussions/13340#discussioncomment-16883392
for additional information.
---
diff --git a/containerd.spec b/containerd.spec
index 00b39ee..1e192ec 100644
--- a/containerd.spec
+++ b/containerd.spec
@@ -33,6 +33,7 @@ BuildRequires: make
BuildRequires: systemd-rpm-macros
BuildRequires: procps-ng
BuildRequires: git-core
+BuildRequires: glibc-static
%description
@@ -79,14 +80,17 @@ go-md2man -in "docs/man/containerd-config.toml.5.md" -out "man/containerd-config
rm man/gen-manpages
# shim explicity build with static; mimic makefile settings
-export CGO_ENABLED=0
+# export CGO_ENABLED=0
GO_BUILDTAGS="urfave_cli_no_docs no_grpc"
-GO_LDFLAGS="$GO_LDFLAGS -extldflags \"-static\" -s -w"
-go build \
- %{gobuild_baseflags} \
- -ldflags "$GO_LDFLAGS " \
- -o %{gobuilddir}/bin/containerd-shim-runc-v2 \
- %{goipath}/cmd/containerd-shim-runc-v2
+%global __golang_extldflags -static-pie
+%gobuild -o %{gobuilddir}/bin/containerd-shim-runc-v2 %{goipath}/cmd/containerd-shim-runc-v2
+
+# GO_LDFLAGS="$GO_LDFLAGS -linkmode external -extldflags \"-static-pie\" -s -w"
+# go build \
+# %%{gobuild_baseflags} \
+# -ldflags "$GO_LDFLAGS " \
+# -o %%{gobuilddir}/bin/containerd-shim-runc-v2 \
+# %%{goipath}/cmd/containerd-shim-runc-v2
#
# %%(echo -n %%{gobuild_ldflags}|sed 's/-linkmode=external //') " \
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-27 18:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-27 18:51 [rpms/containerd] rawhide: Build shim as static-pie Bradley G Smith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox