mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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.
This commit is contained in:
committed by
Torkel Ödegaard
parent
ce7a8dde83
commit
5affb919f2
3
build.go
3
build.go
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user