Commit 5affb919 by jelle van der Waa Committed by Torkel Ödegaard

Build: Allow extending of LDFLAGS in build.go (#18954)

Allow extending LDFALGS by setting LDFLAGS to be able to pass
-zrelro,-znow for Arch Linux packaging
to get full relro.
parent ce7a8dde
......@@ -528,6 +528,9 @@ func ldflags() string {
b.WriteString(fmt.Sprintf(" -X main.commit=%s", getGitSha()))
b.WriteString(fmt.Sprintf(" -X main.buildstamp=%d", buildStamp()))
b.WriteString(fmt.Sprintf(" -X main.buildBranch=%s", getGitBranch()))
if v := os.Getenv("LDFLAGS"); v != "" {
b.WriteString(fmt.Sprintf(" -extldflags=%s", v))
}
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