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

Add osusergo flag to static build #1836

Merged
merged 1 commit into from
Jul 5, 2018

Conversation

kolyshkin
Copy link
Contributor

This should fix the following (very legitimate) warnings on static build:

/tmp/go-link-818454663/000019.o: In function `mygetgrouplist':
/usr/lib/go-1.10/src/os/user/getgrouplist_unix.go:15: warning: Using
'getgrouplist' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking

/tmp/go-link-818454663/000018.o: In function `mygetgrgid_r':
/usr/lib/go-1.10/src/os/user/cgo_lookup_unix.go:38: warning: Using
'getgrgid_r' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking

...

as well as segfaults in the resulting binary.

For more details, check golang/go#23265

This should fix the following (very legitimate) warnings on static
build:

> /tmp/go-link-818454663/000019.o: In function `mygetgrouplist':
> /usr/lib/go-1.10/src/os/user/getgrouplist_unix.go:15: warning: Using
> 'getgrouplist' in statically linked applications requires at runtime the
> shared libraries from the glibc version used for linking
>
> /tmp/go-link-818454663/000018.o: In function `mygetgrgid_r':
> /usr/lib/go-1.10/src/os/user/cgo_lookup_unix.go:38: warning: Using
> 'getgrgid_r' in statically linked applications requires at runtime the
> shared libraries from the glibc version used for linking
>
> ...

as well as segfaults in the resulting binary.

For more details, check golang/go#23265

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@crosbymichael
Copy link
Member

crosbymichael commented Jul 3, 2018

LGTM

Approved with PullApprove

@cyphar
Copy link
Member

cyphar commented Jul 5, 2018

Oh awesome. I didn't know that Go's stdlib actually had a way of disabling the glibc os/user implementation. I imagine it was added recently?

LGTM.

Approved with PullApprove

@cyphar cyphar merged commit 7fb79f3 into opencontainers:master Jul 5, 2018
cyphar added a commit that referenced this pull request Jul 5, 2018
  Add osusergo flag to static build

LGTMs: @crosbymichael @cyphar
Closes #1836
@thaJeztah
Copy link
Member

Yes; it's new in Go 1.11 @kolyshkin contributed that change (golang/go@62f0127)

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