From e65404514cfae556afb0dfab91f1d114fbb3383b Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 20 Oct 2015 15:21:33 -0700 Subject: Updates from make Contains equivalent changes for: 561b4c1 Set mcpu targets based on cpu variant. 6a66a88 Stop encoding absolute paths in symbols 63e3b02 Enable color output from gcc and clang eb3e3fa Use exported includes for libc++. 3a0a891 Link libgtest_main before libgtest Change-Id: I45a06c02e9af1d40f0c52f1e6a20d6cd382a27fb --- cc/builder.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'cc/builder.go') diff --git a/cc/builder.go b/cc/builder.go index 9c9bddd8..f2170823 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -44,10 +44,10 @@ var ( blueprint.RuleParams{ Depfile: "${out}.d", Deps: blueprint.DepsGCC, - Command: "$ccCmd -c $cFlags -MD -MF ${out}.d -o $out $in", + Command: "$relPwd $ccCmd -c $cFlags -MD -MF ${out}.d -o $out $in", Description: "cc $out", }, - "ccCmd", "cFlags") + "relPwd", "ccCmd", "cFlags") ld = pctx.StaticRule("ld", blueprint.RuleParams{ @@ -128,6 +128,15 @@ func TransformSourceToObj(ctx common.AndroidModuleContext, subdir string, srcFil srcRoot := ctx.AConfig().SrcDir() intermediatesRoot := ctx.AConfig().IntermediatesDir() + // We run gcc/clang with PWD=/proc/self/cwd to remove $TOP from the + // debug output. That way two builds in two different directories will + // create the same output. + relPwd := "PWD=/proc/self/cwd" + if ctx.Darwin() { + // /proc doesn't exist on Darwin + relPwd = "" + } + objFiles = make([]string, len(srcFiles)) objDir := common.ModuleObjDir(ctx) if subdir != "" { @@ -200,6 +209,7 @@ func TransformSourceToObj(ctx common.AndroidModuleContext, subdir string, srcFil Args: map[string]string{ "cFlags": moduleCflags, "ccCmd": ccCmd, + "relPwd": relPwd, }, }) } -- cgit v1.2.3