aboutsummaryrefslogtreecommitdiff
path: root/cc/fuzz.go
diff options
context:
space:
mode:
authorMitch Phillips <mitchp@google.com>2019-08-28 16:04:36 -0700
committerMitch Phillips <mitchp@google.com>2019-09-05 13:34:44 -0700
commit4de896e1effff589f0d89c59a0ae24024dd79694 (patch)
treed7bf3af115f823c64aa41433827f582eefd7bc47 /cc/fuzz.go
parentc6de2d948262d8982a1cddcc2720c1168512872d (diff)
downloadsoong-4de896e1effff589f0d89c59a0ae24024dd79694.tar.gz
Add i386 host fuzzing support w/ cc_fuzz.
Adds the host fuzzing support back for 32-bit x86 targets, now that the toolchain has been updated to export this library. Bug: 133261679 Test: `m example_fuzzer` on a 32-bit target/cross Change-Id: I28285d531a53eebd28c9e1b733035be48696b48f
Diffstat (limited to 'cc/fuzz.go')
-rw-r--r--cc/fuzz.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/cc/fuzz.go b/cc/fuzz.go
index d44c02de6..b0fb262df 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -15,9 +15,12 @@
package cc
import (
+ "path/filepath"
+
+ "github.com/google/blueprint/proptools"
+
"android/soong/android"
"android/soong/cc/config"
- "github.com/google/blueprint/proptools"
)
func init() {
@@ -78,21 +81,14 @@ func (fuzz *fuzzBinary) linkerFlags(ctx ModuleContext, flags Flags) Flags {
}
func (fuzz *fuzzBinary) install(ctx ModuleContext, file android.Path) {
- fuzz.binaryDecorator.baseInstaller.dir = "fuzz"
- fuzz.binaryDecorator.baseInstaller.dir64 = "fuzz"
+ fuzz.binaryDecorator.baseInstaller.dir = filepath.Join("fuzz", ctx.Target().Arch.ArchType.String())
+ fuzz.binaryDecorator.baseInstaller.dir64 = filepath.Join("fuzz", ctx.Target().Arch.ArchType.String())
fuzz.binaryDecorator.baseInstaller.install(ctx, file)
}
func NewFuzz(hod android.HostOrDeviceSupported) *Module {
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()
module.sanitize.SetSanitizer(fuzzer, true)