From 5dab840e24efc133a9ad3eca1d43414599734e60 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 27 Jul 2016 10:30:21 -0700 Subject: [PATCH] Fix static+shared with generated sources Clear out the generated sources when reusing object files from the static library for the shared library to avoid linking them twice. Change-Id: Idc145f817acc93df4c3b266ac7647299399bc8eb --- cc/cc.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cc/cc.go b/cc/cc.go index 51760fca1..30228fb3f 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -2691,6 +2691,7 @@ func linkageMutator(mctx android.BottomUpMutatorContext) { // Optimize out compiling common .o files twice for static+shared libraries mctx.AddInterVariantDependency(reuseObjTag, shared, static) sharedCompiler.baseCompiler.Properties.Srcs = nil + sharedCompiler.baseCompiler.Properties.Generated_sources = nil } } } else if linker.buildStatic() {