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

Disable systemd in static build #1579

Merged
merged 1 commit into from
Sep 11, 2017
Merged

Disable systemd in static build #1579

merged 1 commit into from
Sep 11, 2017

Conversation

yongtang
Copy link
Contributor

This fix tries to address the warnings caused by static build with go 1.9. As systemd needs dlopen/dlclose, the following warnings will be generated for static build in go 1.9:

root@f4b077232050:/go/src/github.com/opencontainers/runc# make static
CGO_ENABLED=1 go build  -tags "seccomp cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit="1c81e2a794c6e26a4c650142ae8893c47f619764" -X main.version=1.0.0-rc4+dev " -o runc .
/tmp/go-link-113476657/000007.o: In function `_cgo_a5acef59ed3f_Cfunc_dlopen':
/tmp/go-build/github.com/opencontainers/runc/vendor/github.com/coreos/pkg/dlopen/_obj/cgo-gcc-prolog:76: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

This fix disables systemd when static_build flag is on (apply_nosystemd.go is used instead).

This fix also fixes a small bug in apply_nosystemd.go for return value.

This fix is related to #1576

Signed-off-by: Yong Tang [email protected]

@thaJeztah
Copy link
Member

@crosbymichael PTAL

This fix tries to address the warnings caused by static build
with go 1.9. As systemd needs dlopen/dlclose, the following warnings
will be generated for static build in go 1.9:
```
root@f4b077232050:/go/src/github.com/opencontainers/runc# make static
CGO_ENABLED=1 go build  -tags "seccomp cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit="1c81e2a794c6e26a4c650142ae8893c47f619764" -X main.version=1.0.0-rc4+dev " -o runc .
/tmp/go-link-113476657/000007.o: In function `_cgo_a5acef59ed3f_Cfunc_dlopen':
/tmp/go-build/github.com/opencontainers/runc/vendor/github.com/coreos/pkg/dlopen/_obj/cgo-gcc-prolog:76: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
```

This fix disables systemd when `static_build` flag is on (apply_nosystemd.go
is used instead).

This fix also fixes a small bug in `apply_nosystemd.go` for return value.

Signed-off-by: Yong Tang <[email protected]>
@yongtang
Copy link
Contributor Author

@crosbymichael @thaJeztah The PR has been rebased with tests passed. Please take a look.

@crosbymichael
Copy link
Member

crosbymichael commented Sep 11, 2017

LGTM

Approved with PullApprove

@cyphar
Copy link
Member

cyphar commented Sep 11, 2017

LGTM.

Approved with PullApprove

@cyphar cyphar merged commit e9944d0 into opencontainers:master Sep 11, 2017
cyphar added a commit that referenced this pull request Sep 11, 2017
  Disable systemd in static build

LGTMs: @crosbymichael @cyphar
Closes #1579
@yongtang yongtang deleted the static-systemd branch September 11, 2017 22:05
yongtang added a commit to yongtang/docker that referenced this pull request Sep 26, 2017
This fix updates runc to 0351df1c5a66838d0c392b4ac4cf9450de844e2d

With this fix the warnings generated by netgo and dlopen by go 1.9
are addressed.

See
- opencontainers/runc#1577
- opencontainers/runc#1579

This fix is part of the efforts for go 1.9 (moby#33892)

Signed-off-by: Yong Tang <[email protected]>
andrewhsu pushed a commit to docker-archive/docker-ce that referenced this pull request Sep 27, 2017
This fix updates runc to 0351df1c5a66838d0c392b4ac4cf9450de844e2d

With this fix the warnings generated by netgo and dlopen by go 1.9
are addressed.

See
- opencontainers/runc#1577
- opencontainers/runc#1579

This fix is part of the efforts for go 1.9 (#33892)

Signed-off-by: Yong Tang <[email protected]>
Upstream-commit: e0ff1d1
Component: engine
salah-khan pushed a commit to salah-khan/moby that referenced this pull request Nov 15, 2017
This fix updates runc to 0351df1c5a66838d0c392b4ac4cf9450de844e2d

With this fix the warnings generated by netgo and dlopen by go 1.9
are addressed.

See
- opencontainers/runc#1577
- opencontainers/runc#1579

This fix is part of the efforts for go 1.9 (moby#33892)

Signed-off-by: Yong Tang <[email protected]>
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