Merge "Fix mac sdk build"

This commit is contained in:
Treehugger Robot
2018-06-05 00:47:16 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 3 deletions

View File

@@ -312,14 +312,17 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
ctx.Strict(makePrefix+"CC", gccCmd(toolchain, "gcc"))
ctx.Strict(makePrefix+"CXX", gccCmd(toolchain, "g++"))
ctx.Strict(makePrefix+"STRIP", gccCmd(toolchain, "strip"))
if target.Os == android.Darwin {
ctx.Strict(makePrefix+"AR", "${config.MacArPath}")
ctx.Strict(makePrefix+"NM", "${config.MacToolPath}/nm")
ctx.Strict(makePrefix+"OTOOL", "${config.MacToolPath}/otool")
ctx.Strict(makePrefix+"STRIP", "${config.MacStripPath}")
} else {
ctx.Strict(makePrefix+"AR", "${config.ClangBin}/llvm-ar")
ctx.Strict(makePrefix+"READELF", gccCmd(toolchain, "readelf"))
ctx.Strict(makePrefix+"NM", gccCmd(toolchain, "nm"))
ctx.Strict(makePrefix+"STRIP", gccCmd(toolchain, "strip"))
}
if target.Os == android.Windows {

View File

@@ -39,8 +39,8 @@ do_elf() {
}
do_macho() {
otool -l "${infile}" | grep LC_ID_DYLIB -A 5 > "${outfile}.tmp"
nm -gP "${infile}" | cut -f1-2 -d" " | grep -v 'U$' >> "${outfile}.tmp"
"${CROSS_COMPILE}/otool" -l "${infile}" | grep LC_ID_DYLIB -A 5 > "${outfile}.tmp"
"${CROSS_COMPILE}/nm" -gP "${infile}" | cut -f1-2 -d" " | grep -v 'U$' >> "${outfile}.tmp"
}