1
0
forked from ALHP/ALHP.GO

Merge pull request 'set go optimization flag' (#121) from RubenKelevra/ALHP.GO:feat/optimize_go_builds into master

Reviewed-on: https://git.harting.dev/ALHP/ALHP.GO/pulls/121
This commit is contained in:
2022-06-15 11:39:16 +02:00

View File

@@ -732,6 +732,8 @@ func setupMakepkg(march string) error {
makepkgStr = strings.ReplaceAll(makepkgStr, " check ", " !check ")
}
makepkgStr = strings.ReplaceAll(makepkgStr, " color ", " !color ")
// set Go optimization flag
makepkgStr = strings.ReplaceAll(makepkgStr, "LDFLAGS=", "GOAMD64="+march[len(march)-2:]+\nLDFLAGS=")
// Add align-functions=32, see https://github.com/InBetweenNames/gentooLTO/issues/164 for more
makepkgStr = strings.ReplaceAll(makepkgStr, "-O2", "-O3 -falign-functions=32 -mpclmul")
makepkgStr = strings.ReplaceAll(makepkgStr, "#MAKEFLAGS=\"-j2\"", "MAKEFLAGS=\"-j"+strconv.Itoa(conf.Build.Makej)+"\"")