Q:

Android AOSP build failed on MacOS 10.14

Not sure how to classify this.  I'm trying to build AOSP from scratch under MacOS 10.14. 
I built a case-sensitive filesystem and executed these commands:
repo init -u https://android.googlesource.com/platform/manifest
repo init -b android-9.0.0_r34
repo sync
source build/envsetup.sh
lunch aosp_arm-eng
make -j4

and also edited build/soong/cc/config/x86_darwin_host.go to add 10.14 to darwinSupportedSdkVersions. 
The build failed with these errors:
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libpthread.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libpthread.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libdl.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libdl.tbd
…

[  5% 4372/76415] //external/expat:libexpat link libexpat-host.dylib [darwin x86]
FAILED: out/soong/.intermediates/external/expat/libexpat/darwin_x86_shared/libexpat-host.dylib 
prebuilts/clang/host/darwin-x86/clang-4691093/bin/clang++  @out/soong/.intermediates/external/expat/libexpat/darwin_x86_shared/libexpat-host.dylib.rsp out/soong/.intermediates/external/compiler-rt/libcompiler_rt-extras/darwin_x86_static/libcompiler_rt-extras.a out/soong/.intermediates/external/libcxx/libc++/darwin_x86_shared/libc++.dylib  -o out/soong/.intermediates/external/expat/libexpat/darwin_x86_shared/libexpat-host.dylib -dynamiclib -single_module -install_name @rpath/libexpat-host.dylib -read_only_relocs suppress -target i686-apple-darwin -B/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.8 -m32 -ldl -lpthread -lm -Wl,-rpath,@loader_path/../lib -Wl,-rpath,@loader_path/lib  -nodefaultlibs -lc -lSystem
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libdl.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libdl.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libpthread.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libpthread.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libm.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libm.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libc.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libc.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
Undefined symbols for architecture i386:
  "___bzero", referenced from:
      _lookup in xmlparse.o
  "___stack_chk_fail", referenced from:
      _XML_ParserCreateNS in xmlparse.o
      _XML_ExternalEntityParserCreate in xmlparse.o
      _externalEntityInitProcessor in xmlparse.o
      _externalParEntInitProcessor in xmlparse.o
      _startParsing in xmlparse.o
      _XML_DefaultCurrent in xmlparse.o
      _prologInitProcessor in xmlparse.o
      ...

Building for Oreo also failed, but in different ways. 
Any idea what I'm doing wrong here? 

A:

Try install Xcode 9.4 or earlier then Rebuild again. 
Hope this may help you. 
Ref: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes

The macOS 10.14 SDK no longer contains support for compiling 32-bit
  applications.  If developers need to compile for i386, Xcode 9.4 or
  earlier is required. ( 39858111)

A:

I compiled Android Oreo on macOS 10.14 successfully. 
I didn't install Xcode, only CommandLineTools(Command_Line_Tools_macOS_10.13_for_Xcode_9.3) was installed.  Command_Line_Tools_macOS_10.13_for_Xcode_9.3 is the minimum version of CommandLineTools that can be installed on macOS 10.14. 
Click here for more info: https://www.jianshu.com/p/1fba826c710e

