2 Commits

Author SHA1 Message Date
97b3d4f2c8 set go optimization flag 2022-05-18 14:32:50 +02:00
65d6e7e135 make findpkgfiles fallback to srcinfo 2022-05-18 14:27:54 +02:00
2 changed files with 12 additions and 4 deletions

View File

@@ -698,13 +698,19 @@ func (p *ProtoPackage) findPkgFiles() error {
return err
}
if p.DbPackage == nil {
return fmt.Errorf("unable to find Pkgfiles without dbpakg present")
if p.DbPackage == nil && p.Srcinfo == nil {
return fmt.Errorf("unable to find pkgfiles without dbpkg or srcinfo present")
}
var realPkgs []string
for _, realPkg := range p.DbPackage.Packages {
realPkgs = append(realPkgs, realPkg)
if p.DbPackage != nil {
for _, realPkg := range p.DbPackage.Packages {
realPkgs = append(realPkgs, realPkg)
}
} else {
for _, realPkg := range p.Srcinfo.Packages {
realPkgs = append(realPkgs, realPkg.Pkgname)
}
}
var fPkg []string

View File

@@ -726,6 +726,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 -fdevirtualize-at-ltrans")
makepkgStr = strings.ReplaceAll(makepkgStr, "#MAKEFLAGS=\"-j2\"", "MAKEFLAGS=\"-j"+strconv.Itoa(conf.Build.Makej)+"\"")