[cc_fuzz] Statically link libcxx.
Statically links libcxx in order to not require shared library deployment during packing of fuzz targets. Test: m example_fuzzer && ldd $ANDROID_HOST_OUT/fuzz/example_fuzzer. Note that the ldd results don't include libc++.so. Bug: 139880425 Change-Id: I86d1945768de53217d54cb762392c20714494416
This commit is contained in:
parent
bdefa541d9
commit
d0bd16d9d1
12
cc/fuzz.go
12
cc/fuzz.go
|
@ -17,6 +17,7 @@ package cc
|
|||
import (
|
||||
"android/soong/android"
|
||||
"android/soong/cc/config"
|
||||
"github.com/google/blueprint/proptools"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -120,5 +121,16 @@ func NewFuzz(hod android.HostOrDeviceSupported) *Module {
|
|||
ctx.AppendProperties(&disableDarwinAndLinuxBionic)
|
||||
})
|
||||
|
||||
// Statically link the STL. This allows fuzz target deployment to not have to
|
||||
// include the STL.
|
||||
android.AddLoadHook(module, func(ctx android.LoadHookContext) {
|
||||
staticStlLinkage := struct {
|
||||
Stl *string
|
||||
}{}
|
||||
|
||||
staticStlLinkage.Stl = proptools.StringPtr("libc++_static")
|
||||
ctx.AppendProperties(&staticStlLinkage)
|
||||
})
|
||||
|
||||
return module
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue