Skip to content

Commit 7fb79f3

Browse files
committed
Add osusergo flag to static build
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 <[email protected]>
1 parent 2c632d1 commit 7fb79f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ contrib/cmd/recvtty/recvtty: $(SOURCES)
4040
$(GO) build -buildmode=pie $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
4141

4242
static: $(SOURCES)
43-
CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc .
44-
CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
43+
CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo osusergo cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc .
44+
CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo osusergo cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
4545

4646
release:
4747
script/release.sh -r release/$(VERSION) -v $(VERSION)

0 commit comments

Comments
 (0)