Skip to content

Conversation

@sandy-lcq
Copy link

Add EXTRA_LDFLAGS to support add extra ldflags

Add EXTRA_LDFLAGS to support add extra ldflags

Signed-off-by: Changqing Li <[email protected]>
@sandy-lcq sandy-lcq requested a review from a team as a code owner January 7, 2026 08:26
@kolyshkin
Copy link
Contributor

@sandy-lcq why can't you use existing EXTRA_FLAGS? E.g.

make EXTRA_FLAGS="..."

@sandy-lcq
Copy link
Author

Hi,

with the old BUILD_FLAGS := -tags "$(BUILDTAGS)" -ldflags "-X main.gitCommit=$(COMMIT) -X main.version=$(VERSION)" $(EXTRA_FLAGS)

if user want to pass some config for -ldflags, user can only pass like EXTRA_FLAGS="-ldflags -buildid=", in this way, the latter option will overrides the first "-ldflag "-X main.gitCommit=$(COMMIT) -X main.version=$(VERSION)"", unless I pass like
EXTRA_FLAGS ="-ldflags -X main.gitCommit=$(COMMIT) -X main.version=$(VERSION)" -buildid=", so I think maybe add another EXTRA_LDFLAGS is better. So user can only set EXTRA_LDFLAGS="-buildid="

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.

2 participants