From 302f964aa05f3b1e29a00cbce08b5d83b480c581 Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Mon, 14 Oct 2019 16:40:26 -0700 Subject: [PATCH] Do not link libc++.so statically on device. If fuzzer coverage sanitized shared libraries are not deployed - we shouldn't break users during dynamic link time. I need to think more about how we should solve this problem in earnest, but for now let's just disable static linkage of libc++ on device. Bug: 142671952 Test: Cherrypick ag/9550833 and ag/9544155, make and run the fuzz target there. Change-Id: I39dfd6ba314e7a610ef3f0b30f35383a5e3a1e4b --- cc/fuzz.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cc/fuzz.go b/cc/fuzz.go index c19fdc5b0..b8b9c7140 100644 --- a/cc/fuzz.go +++ b/cc/fuzz.go @@ -148,10 +148,14 @@ func NewFuzz(hod android.HostOrDeviceSupported) *Module { // include the STL. android.AddLoadHook(module, func(ctx android.LoadHookContext) { staticStlLinkage := struct { - Stl *string + Target struct { + Linux_glibc struct { + Stl *string + } + } }{} - staticStlLinkage.Stl = proptools.StringPtr("libc++_static") + staticStlLinkage.Target.Linux_glibc.Stl = proptools.StringPtr("libc++_static") ctx.AppendProperties(&staticStlLinkage) })