Always generate PDB for Windows executable
Test: NA Bug: 350154912 Change-Id: I0a4ebfb62643eb2c8d2b20992e728bcb8b5219a9
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"slices"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -910,6 +911,16 @@ func transformObjToDynamicBinary(ctx android.ModuleContext,
|
|||||||
"ldFlags": flags.globalLdFlags + " " + flags.localLdFlags,
|
"ldFlags": flags.globalLdFlags + " " + flags.localLdFlags,
|
||||||
"crtEnd": strings.Join(crtEnd.Strings(), " "),
|
"crtEnd": strings.Join(crtEnd.Strings(), " "),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// On Windows, we always generate a PDB file
|
||||||
|
// --strip-debug is needed to also keep COFF symbols which are needed when
|
||||||
|
// we patch binaries with symbol_inject.
|
||||||
|
if ctx.Windows() {
|
||||||
|
pdb := outputFile.ReplaceExtension(ctx, "pdb")
|
||||||
|
args["ldFlags"] = args["ldFlags"] + " -Wl,--strip-debug -Wl,--pdb=" + pdb.String() + " "
|
||||||
|
implicitOutputs = append(slices.Clone(implicitOutputs), pdb)
|
||||||
|
}
|
||||||
|
|
||||||
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_CXX_LINKS") {
|
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_CXX_LINKS") {
|
||||||
rule = ldRE
|
rule = ldRE
|
||||||
args["implicitOutputs"] = strings.Join(implicitOutputs.Strings(), ",")
|
args["implicitOutputs"] = strings.Join(implicitOutputs.Strings(), ",")
|
||||||
|
@@ -43,6 +43,10 @@ var (
|
|||||||
"-mno-ms-bitfields",
|
"-mno-ms-bitfields",
|
||||||
|
|
||||||
"--sysroot ${WindowsGccRoot}/${WindowsGccTriple}",
|
"--sysroot ${WindowsGccRoot}/${WindowsGccTriple}",
|
||||||
|
|
||||||
|
// Windows flags to generate PDB
|
||||||
|
"-g",
|
||||||
|
"-gcodeview",
|
||||||
}
|
}
|
||||||
|
|
||||||
windowsIncludeFlags = []string{
|
windowsIncludeFlags = []string{
|
||||||
|
Reference in New Issue
Block a user