From 32320e89fd433cd3899d64dc5dc28710956721fd Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 2 Jun 2022 23:02:01 +0000 Subject: [PATCH] Revert "Use --dependency-file when linking elf files." This reverts commit 97d87760b47859417a83ab7e4306c19d9e685b52. Reason for revert: b/234772469 Bug: 137961579 Bug: 234772469 Change-Id: I478f5a2696e87144d0123e8872c9f8ac1d5f24b0 --- cc/builder.go | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/cc/builder.go b/cc/builder.go index 107cd58e7..525b1a14f 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -855,24 +855,13 @@ func transformObjToDynamicBinary(ctx android.ModuleContext, deps = append(deps, crtBegin...) deps = append(deps, crtEnd...) - var depFile android.WritablePath - var depFileLdFlags string - depsType := blueprint.DepsNone - if !ctx.Windows() && !ctx.Darwin() { - // lld only supports --dependency-file for elf files - depFile = outputFile.ReplaceExtension(ctx, "d") - depFileLdFlags = " -Wl,--dependency-file=" + depFile.String() - depsType = blueprint.DepsGCC - implicitOutputs = append(implicitOutputs, depFile) - } - rule := ld args := map[string]string{ "ldCmd": ldCmd, "crtBegin": strings.Join(crtBegin.Strings(), " "), "libFlags": strings.Join(libFlagsList, " "), "extraLibFlags": flags.extraLibFlags, - "ldFlags": flags.globalLdFlags + " " + flags.localLdFlags + depFileLdFlags, + "ldFlags": flags.globalLdFlags + " " + flags.localLdFlags, "crtEnd": strings.Join(crtEnd.Strings(), " "), } if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_CXX_LINKS") { @@ -883,8 +872,6 @@ func transformObjToDynamicBinary(ctx android.ModuleContext, ctx.Build(pctx, android.BuildParams{ Rule: rule, - Deps: depsType, - Depfile: depFile, Description: "link " + outputFile.Base(), Output: outputFile, ImplicitOutputs: implicitOutputs, @@ -1038,33 +1025,18 @@ func transformObjsToObj(ctx android.ModuleContext, objFiles android.Paths, ldCmd := "${config.ClangBin}/clang++" - var implicitOutputs android.WritablePaths - var depFile android.WritablePath - var depFileLdFlags string - depsType := blueprint.DepsNone - if !ctx.Windows() && !ctx.Darwin() { - // lld only supports --dependency-file for elf files - depFile = outputFile.ReplaceExtension(ctx, "d") - depFileLdFlags = " -Wl,--dependency-file=" + depFile.String() - depsType = blueprint.DepsGCC - implicitOutputs = append(implicitOutputs, depFile) - } - rule := partialLd args := map[string]string{ "ldCmd": ldCmd, - "ldFlags": flags.globalLdFlags + " " + flags.localLdFlags + depFileLdFlags, + "ldFlags": flags.globalLdFlags + " " + flags.localLdFlags, } if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_CXX_LINKS") { rule = partialLdRE args["inCommaList"] = strings.Join(objFiles.Strings(), ",") args["implicitInputs"] = strings.Join(deps.Strings(), ",") - args["implicitOutputs"] = strings.Join(implicitOutputs.Strings(), ",") } ctx.Build(pctx, android.BuildParams{ Rule: rule, - Deps: depsType, - Depfile: depFile, Description: "link " + outputFile.Base(), Output: outputFile, Inputs: objFiles,