提交 ed71248f 编写于 作者: S Sergio Lopez 提交者: Derek Parker

proc/test/support: implement EnableDWZCompression

The EnableDWZCompression flag allows tests to request BuildFixture to
run "dwz" on the Fixture's resulting binary to compress/deduplicate its
DWARF sections.
上级 38307f92
......@@ -54,6 +54,7 @@ const (
LinkStrip BuildFlags = 1 << iota
EnableCGOOptimization
EnableInlining
EnableDWZCompression
)
func BuildFixture(name string, flags BuildFlags) Fixture {
......@@ -110,6 +111,15 @@ func BuildFixture(name string, flags BuildFlags) Fixture {
os.Exit(1)
}
if flags&EnableDWZCompression != 0 {
cmd := exec.Command("dwz", tmpfile)
if out, err := cmd.CombinedOutput(); err != nil {
fmt.Printf("Error running dwz on %s: %s\n", tmpfile, err)
fmt.Printf("%s\n", string(out))
os.Exit(1)
}
}
source, _ := filepath.Abs(path)
source = filepath.ToSlash(source)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册