From d67be22400949464e5379055447e7202b0daaf4f Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Wed, 16 Sep 2015 15:19:33 -0700 Subject: [PATCH] Port LOCAL_NO_LIBGCC from make Change-Id: Iba400de882547654b2a5184d420e38113d7545ee --- cc/cc.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cc/cc.go b/cc/cc.go index ba3dd2843..3aa068e82 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -274,6 +274,9 @@ type CCBaseProperties struct { // compiling crt or libc. Nocrt bool `android:"arch_variant"` + // don't link in libgcc.a + No_libgcc bool + // don't insert default compiler flags into asflags, cflags, // cppflags, conlyflags, ldflags, or include_dirs No_default_compiler_flags bool @@ -927,7 +930,10 @@ func (c *CCLinked) depNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDe if ctx.Device() { // libgcc and libatomic have to be last on the command line - depNames.LateStaticLibs = append(depNames.LateStaticLibs, "libgcov", "libatomic", "libgcc") + depNames.LateStaticLibs = append(depNames.LateStaticLibs, "libgcov", "libatomic") + if !c.Properties.No_libgcc { + depNames.LateStaticLibs = append(depNames.LateStaticLibs, "libgcc") + } if !c.static() { depNames.SharedLibs = append(depNames.SharedLibs, c.systemSharedLibs(ctx)...)