Revert "Add -fdebug-compilation-dir option"

Revert submission 1461902-debug-compilation-dir

Reason for revert: "-Xclang" isn't being uniformly respected everywhere. For example, in ".S" compilations, when I pass `-Xclang -fdebug-compilation-dir=.", the assembler seems to be ignoring it and then inserting the `pwd` into the command, however when I pass "-fdebug-compilation-dir=.", it strips out the path to the current working directory.
This indicates that we need to update re-client's input processor so that we can pass -fdebug-compilation-dir=. without "-Xclang" and then remove `PWD` setting.
I'll followup with a patch to add -fdebug-compilation-dir.

Reverted Changes:
Ib0f271e55:Add -fdebug-compilation-dir option
Ifa0592af5:Remove env-var-allowlist

Change-Id: I12fa0bf2fb4975ac3d1bffaf1358331548abc339
This commit is contained in:
Kousik Kumar 2020-10-20 05:52:49 +00:00
parent d9052d177c
commit d207cbed65
2 changed files with 7 additions and 10 deletions

View File

@ -44,14 +44,14 @@ var (
blueprint.RuleParams{
Depfile: "${out}.d",
Deps: blueprint.DepsGCC,
Command: "${config.CcWrapper}$ccCmd -c $cFlags -MD -MF ${out}.d -o $out $in",
Command: "$relPwd ${config.CcWrapper}$ccCmd -c $cFlags -MD -MF ${out}.d -o $out $in",
CommandDeps: []string{"$ccCmd"},
},
"ccCmd", "cFlags")
ccNoDeps = pctx.AndroidStaticRule("ccNoDeps",
blueprint.RuleParams{
Command: "$ccCmd -c $cFlags -o $out $in",
Command: "$relPwd $ccCmd -c $cFlags -o $out $in",
CommandDeps: []string{"$ccCmd"},
},
"ccCmd", "cFlags")
@ -220,7 +220,7 @@ var (
Labels: map[string]string{"type": "abi-dump", "tool": "header-abi-dumper"},
ExecStrategy: "${config.REAbiDumperExecStrategy}",
Platform: map[string]string{
remoteexec.PoolKey: "${config.RECXXPool}",
remoteexec.PoolKey: "${config.RECXXPool}",
},
}, []string{"cFlags", "exportDirs"}, nil)

View File

@ -53,13 +53,6 @@ var (
"-Werror=pragma-pack",
"-Werror=pragma-pack-suspicious-include",
"-Werror=unreachable-code-loop-increment",
// -fdebug-compilation-dir=. is used to make both the action command line and the output
// independent of the working directory of the action.
// Using cc1 flags since RBE's input processor does not yet have the updated version
// of LLVM that promotes the cc1 flag to driver level flag.
// See: https://reviews.llvm.org/D63387
"-Xclang,-fdebug-compilation-dir,.",
}
commonGlobalConlyflags = []string{}
@ -157,6 +150,10 @@ var (
var pctx = android.NewPackageContext("android/soong/cc/config")
func init() {
if android.BuildOs == android.Linux {
commonGlobalCflags = append(commonGlobalCflags, "-fdebug-prefix-map=/proc/self/cwd=")
}
pctx.StaticVariable("CommonGlobalConlyflags", strings.Join(commonGlobalConlyflags, " "))
pctx.StaticVariable("DeviceGlobalCppflags", strings.Join(deviceGlobalCppflags, " "))
pctx.StaticVariable("DeviceGlobalLdflags", strings.Join(deviceGlobalLdflags, " "))