public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Bradley G Smith <bradley.g.smith@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/containerd] f44: Build shim as static-pie
Date: Sat, 27 Jun 2026 19:06:41 GMT	[thread overview]
Message-ID: <178258720155.1.14256684104138945438.rpms-containerd-05640e587dc2@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/containerd
            Branch : f44
            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=f44

            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 //') " \

                 reply	other threads:[~2026-06-27 19:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178258720155.1.14256684104138945438.rpms-containerd-05640e587dc2@fedoraproject.org \
    --to=bradley.g.smith@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox