Fix mac sdk build

Use the host platform "strip", and also expose "nm" and "otool" used for
toc.

Test: `m PRODUCT-sdk-sdk` on Mac
Change-Id: I7a6d127f479d3e563385ead46bc3a4b49b99776b
This commit is contained in:
Dan Willemsen 2018-06-03 16:13:40 -07:00
parent 1d2318d6cd
commit fdb20d05bc
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"
}