Merge "Add i386 host fuzzing support w/ cc_fuzz."
This commit is contained in:
16
cc/fuzz.go
16
cc/fuzz.go
@@ -15,9 +15,12 @@
|
|||||||
package cc
|
package cc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/google/blueprint/proptools"
|
||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
"android/soong/cc/config"
|
"android/soong/cc/config"
|
||||||
"github.com/google/blueprint/proptools"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -78,21 +81,14 @@ func (fuzz *fuzzBinary) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (fuzz *fuzzBinary) install(ctx ModuleContext, file android.Path) {
|
func (fuzz *fuzzBinary) install(ctx ModuleContext, file android.Path) {
|
||||||
fuzz.binaryDecorator.baseInstaller.dir = "fuzz"
|
fuzz.binaryDecorator.baseInstaller.dir = filepath.Join("fuzz", ctx.Target().Arch.ArchType.String())
|
||||||
fuzz.binaryDecorator.baseInstaller.dir64 = "fuzz"
|
fuzz.binaryDecorator.baseInstaller.dir64 = filepath.Join("fuzz", ctx.Target().Arch.ArchType.String())
|
||||||
fuzz.binaryDecorator.baseInstaller.install(ctx, file)
|
fuzz.binaryDecorator.baseInstaller.install(ctx, file)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewFuzz(hod android.HostOrDeviceSupported) *Module {
|
func NewFuzz(hod android.HostOrDeviceSupported) *Module {
|
||||||
module, binary := NewBinary(hod)
|
module, binary := NewBinary(hod)
|
||||||
|
|
||||||
// TODO(mitchp): The toolchain does not currently export the x86 (32-bit)
|
|
||||||
// variant of libFuzzer for host. There is no way to only disable the host
|
|
||||||
// 32-bit variant, so we specify cc_fuzz targets as 64-bit only. This doesn't
|
|
||||||
// hurt anyone, as cc_fuzz is mostly for experimental targets as of this
|
|
||||||
// moment.
|
|
||||||
module.multilib = "64"
|
|
||||||
|
|
||||||
binary.baseInstaller = NewFuzzInstaller()
|
binary.baseInstaller = NewFuzzInstaller()
|
||||||
module.sanitize.SetSanitizer(fuzzer, true)
|
module.sanitize.SetSanitizer(fuzzer, true)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user