Skip to content
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

[release/1.6] Make building static binaries simpler #7045

Merged
merged 1 commit into from
Jun 10, 2022

Conversation

kzys
Copy link
Member

@kzys kzys commented Jun 10, 2022

This commit adds STATIC makefile variable to adjust LDFLAGS and build
tags accordingly.

Fixes #5824.

Signed-off-by: Kazuyoshi Kato katokazu@amazon.com
(cherry picked from commit 00eb74a)
Signed-off-by: Kazuyoshi Kato katokazu@amazon.com

This commit adds STATIC makefile variable to adjust LDFLAGS and build
tags accordingly.

Fixes containerd#5824.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
(cherry picked from commit 00eb74a)
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kzys kzys marked this pull request as ready for review June 10, 2022 17:18
@@ -21,7 +21,9 @@ COMMANDS += containerd-shim containerd-shim-runc-v1 containerd-shim-runc-v2
# check GOOS for cross compile builds
ifeq ($(GOOS),linux)
ifneq ($(GOARCH),$(filter $(GOARCH),mips mipsle mips64 mips64le ppc64))
GO_GCFLAGS += -buildmode=pie
ifeq ($(STATIC),)
GO_GCFLAGS += -buildmode=pie
Copy link
Member

Choose a reason for hiding this comment

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

is it changing the original behavior?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. By default (without STATIC=1), containerd is building position-independent, dynamically-liked binaries.

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.

4 participants