Skip to content

Makefile: add EXTRA_LDFLAGS - #803

Merged
thaJeztah merged 1 commit into
opencontainers:masterfrom
sandy-lcq:master
Mar 16, 2026
Merged

Makefile: add EXTRA_LDFLAGS#803
thaJeztah merged 1 commit into
opencontainers:masterfrom
sandy-lcq:master

Conversation

@sandy-lcq

Copy link
Copy Markdown

Add EXTRA_LDFLAGS to support add extra ldflags

Add EXTRA_LDFLAGS to support add extra ldflags
Signed-off-by: Changqing Li <changqing.li@windriver.com>
@sandy-lcq
sandy-lcq requested a review from a team as a code ownerJanuary 7, 2026 08:26
@kolyshkin

Copy link
Copy Markdown
Contributor

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

make EXTRA_FLAGS="..."

@sandy-lcq

Copy link
Copy Markdown
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="

@kolyshkinkolyshkin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@thaJeztahthaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
thaJeztah merged commit 8a4db57 into opencontainers:masterMar 16, 2026
9 checks passed
Sign up for freeto 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.

3 participants

@sandy-lcq@kolyshkin@thaJeztah