Commit fc228200 by Arve Knudsen Committed by GitHub

Build: Fix building when $LDFLAGS is set (#19509)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent 4181b30b
...@@ -529,7 +529,7 @@ func ldflags() string { ...@@ -529,7 +529,7 @@ func ldflags() string {
b.WriteString(fmt.Sprintf(" -X main.buildstamp=%d", buildStamp())) b.WriteString(fmt.Sprintf(" -X main.buildstamp=%d", buildStamp()))
b.WriteString(fmt.Sprintf(" -X main.buildBranch=%s", getGitBranch())) b.WriteString(fmt.Sprintf(" -X main.buildBranch=%s", getGitBranch()))
if v := os.Getenv("LDFLAGS"); v != "" { if v := os.Getenv("LDFLAGS"); v != "" {
b.WriteString(fmt.Sprintf(" -extldflags=%s", v)) b.WriteString(fmt.Sprintf(" -extldflags \"%s\"", v))
} }
return b.String() return b.String()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment