Merge "Use sysprop stub regarding to the install location"
diff --git a/cc/builder.go b/cc/builder.go
index 8c8aa17..81c09b1 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -44,14 +44,14 @@
 		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 @@
 			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)
 
diff --git a/cc/config/global.go b/cc/config/global.go
index 1aa2621..a170652 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -53,13 +53,6 @@
 		"-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 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, " "))
diff --git a/java/dexpreopt_bootjars_test.go b/java/dexpreopt_bootjars_test.go
index 4a8d3cd..47110c9 100644
--- a/java/dexpreopt_bootjars_test.go
+++ b/java/dexpreopt_bootjars_test.go
@@ -87,7 +87,7 @@
 	ruleFile := "boot-foo.art"
 
 	expectedInputs := []string{
-		"dex_artjars/android/apex/com.android.art/javalib/arm64/boot.art",
+		"dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art",
 		"dex_bootjars_input/foo.jar",
 		"dex_bootjars_input/bar.jar",
 		"dex_bootjars_input/baz.jar",
diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go
index f0d82ff..0f8888a 100644
--- a/java/dexpreopt_config.go
+++ b/java/dexpreopt_config.go
@@ -89,7 +89,7 @@
 		frameworkModules := global.BootJars.CopyOf()
 		frameworkModules.RemoveList(artModules)
 
-		artSubdir := "apex/com.android.art/javalib"
+		artSubdir := "apex/art_boot_images/javalib"
 		frameworkSubdir := "system/framework"
 
 		// ART config for the primary boot image in the ART apex.