Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Makefile: do not use LDFLAGS to avoid environment contamination
Browse files Browse the repository at this point in the history
The logic of this Makefile is to use "-extldflags '-static'" if
STATIC is defined. On the other hand, LDFLAGS is the standard name.
So we should avoid using LDFLAGS to avoid build failure.

fixes #786

Signed-off-by: Chen Qi <[email protected]>
  • Loading branch information
ChenQi1989 committed May 12, 2020
1 parent 1b65736 commit 756de79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ else
endif
# go build common flags
ifdef STATIC
LDFLAGS := -extldflags '-static'
STATIC_LDFLAGS := -extldflags '-static'
else
BUILDFLAGS := -buildmode=pie
endif
Expand All @@ -102,7 +102,7 @@ AGENT_TAG := $(if $(COMMIT_NO_SHORT),$(COMMIT_NO_SHORT),dev)

$(TARGET): $(GENERATED_FILES) $(SOURCES) $(VERSION_FILE)
go build $(BUILDFLAGS) -tags "$(BUILDTAGS)" -o $@ \
-ldflags "-X main.version=$(VERSION_COMMIT) -X main.seccompSupport=$(SECCOMP) $(LDFLAGS) $(KATA_LDFLAGS)"
-ldflags "-X main.version=$(VERSION_COMMIT) -X main.seccompSupport=$(SECCOMP) $(STATIC_LDFLAGS) $(KATA_LDFLAGS)"

install: $(TARGET)
install -D $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
Expand Down

0 comments on commit 756de79

Please sign in to comment.