diff options
author | Dan Willemsen <dwillemsen@google.com> | 2015-10-20 15:21:33 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2015-10-20 16:44:55 -0700 |
commit | e65404514cfae556afb0dfab91f1d114fbb3383b (patch) | |
tree | d4016dca73a4c479a2837d88735f6d7b03be9ccd /cc/builder.go | |
parent | dd0e2c338f3b65458e130178a0f6ba270ce40fb4 (diff) | |
download | build_soong-e65404514cfae556afb0dfab91f1d114fbb3383b.tar.gz build_soong-e65404514cfae556afb0dfab91f1d114fbb3383b.tar.bz2 build_soong-e65404514cfae556afb0dfab91f1d114fbb3383b.zip |
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
Diffstat (limited to 'cc/builder.go')
-rw-r--r-- | cc/builder.go | 14 |
1 files changed, 12 insertions, 2 deletions
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, }, }) } |