forked from ALHP/ALHP.GO
Compare commits
1 Commits
feat/rust_
...
feat/optim
Author | SHA1 | Date | |
---|---|---|---|
97b3d4f2c8 |
6
utils.go
6
utils.go
@@ -726,15 +726,13 @@ func setupMakepkg(march string) error {
|
|||||||
makepkgStr = strings.ReplaceAll(makepkgStr, " check ", " !check ")
|
makepkgStr = strings.ReplaceAll(makepkgStr, " check ", " !check ")
|
||||||
}
|
}
|
||||||
makepkgStr = strings.ReplaceAll(makepkgStr, " color ", " !color ")
|
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
|
// Add align-functions=32, see https://github.com/InBetweenNames/gentooLTO/issues/164 for more
|
||||||
makepkgStr = strings.ReplaceAll(makepkgStr, "-O2", "-O3 -falign-functions=32 -mpclmul -fdevirtualize-at-ltrans")
|
makepkgStr = strings.ReplaceAll(makepkgStr, "-O2", "-O3 -falign-functions=32 -mpclmul -fdevirtualize-at-ltrans")
|
||||||
makepkgStr = strings.ReplaceAll(makepkgStr, "#MAKEFLAGS=\"-j2\"", "MAKEFLAGS=\"-j"+strconv.Itoa(conf.Build.Makej)+"\"")
|
makepkgStr = strings.ReplaceAll(makepkgStr, "#MAKEFLAGS=\"-j2\"", "MAKEFLAGS=\"-j"+strconv.Itoa(conf.Build.Makej)+"\"")
|
||||||
makepkgStr = reMarch.ReplaceAllString(makepkgStr, "${1}"+march)
|
makepkgStr = reMarch.ReplaceAllString(makepkgStr, "${1}"+march)
|
||||||
makepkgStr = strings.ReplaceAll(makepkgStr, "#PACKAGER=\"John Doe <john@doe.com>\"", "PACKAGER=\"ALHP "+march+" <alhp@harting.dev>\"")
|
makepkgStr = strings.ReplaceAll(makepkgStr, "#PACKAGER=\"John Doe <john@doe.com>\"", "PACKAGER=\"ALHP "+march+" <alhp@harting.dev>\"")
|
||||||
// enable rust flags and patch them
|
|
||||||
makepkgStr = strings.ReplaceAll(makepkgStr, "#RUSTFLAGS=", "RUSTFLAGS=")
|
|
||||||
makepkgStr = strings.ReplaceAll(makepkgStr, "-C opt-level=2", "-C opt-level=3")
|
|
||||||
makepkgStr = strings.ReplaceAll(makepkgStr, "-C opt-level=3", "-C opt-level=3 -C target-cpu="+march+" -C lto=fat -C codegen-units=1 -C strip=symbols -C linker-plugin-lto")
|
|
||||||
|
|
||||||
// write makepkg
|
// write makepkg
|
||||||
err = os.WriteFile(lMakepkg, []byte(makepkgStr), 0644)
|
err = os.WriteFile(lMakepkg, []byte(makepkgStr), 0644)
|
||||||
|
Reference in New Issue
Block a user