build aosp on Mac OS 10.13 failed

3,333 views
Skip to first unread message

Hunter Aaron

unread,
Oct 15, 2017, 8:52:24 PM10/15/17
to Android Building
There is the log when I built android-8.0.0_r17 on high sierra:

[ 3% 2279/59686] yacc out/soong/.inte.../system/tools/aidl/aidl_language_y.cpp

FAILED: out/soong/.intermediates/system/tools/aidl/libaidl-common/darwin_x8664static/gen/yacc/system/tools/aidl/aidl_language_y.cpp out/soong/.intermediates/system/tools/aidl/libaidl-common/darwin_x8664static/gen/yacc/system/tools/aidl/aidl_language_y.h

BISON_PKGDATADIR=external/bison/data prebuilts/misc/darwin-x86/bison/bison -d --defines=out/soong/.intermediates/system/tools/aidl/libaidl-common/darwin_x8664static/gen/yacc/system/tools/aidl/aidl_language_y.h -o out/soong/.intermediates/system/tools/aidl/libaidl-common/darwin_x8664static/gen/yacc/system/tools/aidl/aidl_language_y.cpp system/tools/aidl/aidl_language_y.yy

[ 3% 2282/59686] lex out/soong/.inter.../system/tools/aidl/aidl_language_l.cpp

ninja: build stopped: subcommand failed.

14:03:54 ninja failed with: exit status 1

make: *** [run_soong_ui] Error 1


I  google a log,but still can not solve.And I  also had tried to build android-7.1.2,it also failed with similar log.

Has anyone built successfully on Mac OS high sierra?

close...@gmail.com

unread,
Nov 9, 2017, 10:03:29 AM11/9/17
to Android Building
I have a similar problem.Have you solved it now?

在 2017年10月16日星期一 UTC+8上午8:52:24,Hunter Aaron写道:

Monil Patel

unread,
Nov 12, 2017, 11:58:41 PM11/12/17
to Android Building
I have tried building but failed too. I get stuck because there is an issue with libcxx cstdlib.h and other header files clashing with xcode build tools header files.

external/libcxx/include/cstdlib:134:9: note: using declaration
using ::abs;
^
external/libcxx/include/cstdlib:161:44: error: declaration conflicts with target of using declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:117:44: note: target of using declaration
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
^
external/libcxx/include/cstdlib:134:9: note: using declaration
using ::abs;
^
external/libcxx/include/cstdlib:164:42: error: declaration conflicts with target of using declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}

Lee Fuller

unread,
Nov 13, 2017, 11:07:14 AM11/13/17
to Android Building
I have the same issue since upgrading to High Sierra.

Has anyone found a resolution yet?

Thanks

Pradeep Gannavarapu

unread,
Nov 15, 2017, 12:34:30 PM11/15/17
to Android Building
I am also having the same issue while building in Mac os...

Biking Wong

unread,
Nov 18, 2017, 9:02:11 PM11/18/17
to Android Building
Same issue on macos high sierra

zhao boliang

unread,
Nov 19, 2017, 3:17:10 PM11/19/17
to Android Building
Same issue on macos high sierra

在 2017年10月16日星期一 UTC+8上午8:52:24,Hunter Aaron写道:
There is the log when I built android-8.0.0_r17 on high sierra:

Eric Williams

unread,
Nov 22, 2017, 1:33:49 PM11/22/17
to Android Building
Same issue here...

吴成云

unread,
Nov 23, 2017, 9:01:30 AM11/23/17
to Android Building
I have some issue , do you find some way to fix this?

在 2017年11月13日星期一 UTC+8下午12:58:41,Monil Patel写道:

Houlian Wang

unread,
Dec 1, 2017, 2:38:07 PM12/1/17
to Android Building
I also have this problem,so I used this method to solved it

1)sudo port install bison
2)  sudo find / -name bison
3)  sudo rm  /<android_code_path>/prebuilts/misc/darwin-x86/bison/bison
4)   sudo ln -s /usr/local/bin/bison /Volumes/android/code/prebuilts/misc/darwin-x86/bison/bison
bless with you
在 2017年11月23日星期四 UTC+8下午10:01:30,吴成云写道:
Message has been deleted

王晓辉

unread,
Dec 2, 2017, 3:14:37 PM12/2/17
to Android Building
i have same error ,has solve ?


在 2017年10月16日星期一 UTC+8上午8:52:24,Hunter Aaron写道:
There is the log when I built android-8.0.0_r17 on high sierra:

Hunter Aaron

unread,
Dec 2, 2017, 3:14:37 PM12/2/17
to Android Building


在 2017年11月13日星期一 UTC+8下午12:58:41,Monil Patel写道:
I have tried building but failed too. I get stuck because there is an issue with libcxx cstdlib.h and other header files clashing with xcode build tools header files.

Leland Takamine

unread,
Dec 9, 2017, 12:18:22 PM12/9/17
to Android Building
I patched this commit but am still seeing the same error.

On Friday, December 1, 2017 at 11:38:07 AM UTC-8, Aaron Gascoigne wrote:


On Sunday, October 15, 2017 at 8:52:24 PM UTC-4, Hunter Aaron wrote:

Leland Takamine

unread,
Dec 9, 2017, 12:18:22 PM12/9/17
to Android Building
I was able to fix this issue with the following steps:

  • Patch bison fix for High Sierra and build bison:

    • cd /Volumes/AOSP/external/bison

    • git cherry-pick c0c852bd6fe462b148475476d9124fd740eba160

    • mm

  • Replace prebuilt bison binary with patched binary

    • cp /Volumes/AOSP/out/host/darwin-x86/bin/bison /Volumes/AOSP/prebuilts/misc/darwin-x86/bison/

  • Build

Hunter Aaron

unread,
Dec 10, 2017, 2:51:46 AM12/10/17
to Android Building
It works.Thanks so much.

在 2017年12月10日星期日 UTC+8上午1:18:22,Leland Takamine写道:
Message has been deleted

Siyamed Sinir

unread,
Jan 4, 2018, 10:30:16 PM1/4/18
to Android Building
This was still the case for Jan 4 master checkout. make clean and make did fail.
Applying the bison fix described below fixed it. (mm bison and copy it)

zhao boliang

unread,
Feb 5, 2018, 10:31:37 AM2/5/18
to Android Building
built successfully !!

mac :10.13.3 (17D47)
xcode:  Version 8.3.3 (8E3004b)
android : android-7.1.2_r8

    • Patch bison fix for High Sierra and build bison:

      • cd /Volumes/AOSP/external/bison

      • git cherry-pick c0c852bd6fe462b148475476d9124fd740eba160

      • make bison

    • Replace prebuilt bison binary with patched binary

      • cp /Volumes/AOSP/out/host/darwin-x86/bin/bison /Volumes/AOSP/prebuilts/misc/darwin-x86/bison/

    • Build


      在 2017年11月20日星期一 UTC+8上午4:17:10,zhao boliang写道:

      Uki D. Lucas

      unread,
      Mar 15, 2018, 7:15:00 PM3/15/18
      to Android Building
      I have applied the code, but it does not fix the problem:


      AOSP $ head -4876 /Volumes/REPO/AOSP/external/bison/lib/vasnprintf.c | tail -4

      # if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
       fbp
      [1] = '%';
       fbp
      [2] = 'n';
       fbp
      [3] = '\0';


      Running:
      • Mac High Sierra 10.03
      • APFS (Case Sensitive) Volume
      • AOSP revision="refs/tags/android-8.1.0_r9"
      ERROR:

      FAILED: out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_arm_armv7-a_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.cpp out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_arm_armv7-a_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.h

      BISON_PKGDATADIR
      =external/bison/data prebuilts/misc/darwin-x86/bison/bison -d  --defines=out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_arm_armv7-a_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.h -o out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_arm_armv7-a_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.cpp frameworks/compile/mclinker/lib/Script/ScriptParser.yy

      [  0% 553/67107] //external/protobuf:libprotobuf-cpp-lite clang++ src/google/protobuf/extension_set.cc [darwin]

      ninja
      : build stopped: subcommand failed.

      11:11:13 ninja failed with: exit status 1

      #### failed to build some targets (31 seconds) ###
      Reply all
      Reply to author
      Forward
      0 new messages