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.
This commit is contained in:
parent
38307f92d4
commit
ed71248f9b
@ -54,6 +54,7 @@ const (
|
|||||||
LinkStrip BuildFlags = 1 << iota
|
LinkStrip BuildFlags = 1 << iota
|
||||||
EnableCGOOptimization
|
EnableCGOOptimization
|
||||||
EnableInlining
|
EnableInlining
|
||||||
|
EnableDWZCompression
|
||||||
)
|
)
|
||||||
|
|
||||||
func BuildFixture(name string, flags BuildFlags) Fixture {
|
func BuildFixture(name string, flags BuildFlags) Fixture {
|
||||||
@ -110,6 +111,15 @@ func BuildFixture(name string, flags BuildFlags) Fixture {
|
|||||||
os.Exit(1)
|
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.Abs(path)
|
||||||
source = filepath.ToSlash(source)
|
source = filepath.ToSlash(source)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user