AOSP make bison fail on macOS High Sierra Xcode 9

308 views
Skip to first unread message

ilias koletsis

unread,
Jan 6, 2018, 8:06:24 PM1/6/18
to Android Building
Hi, I am newbie in AOSP and I am trying to follow the book of Roger Ye "Android System Programming".

I use a MacBook pro with 2,5GHz Intel Core i7, 16GB RAM, 500GB hard disk. 
Recently I've upgraded to macOS High Sierra and XCode 9  

Following the book's instructions, I've downloaded android-7.1.1_r4 using repo and synced it successfully. 
When it's time to build I fail with message"

FAILED: /bin/bash -c "prebuilts/misc/darwin-x86/bison/bison -d  --defines=out/host/darwin-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_y.h -o out/host/darwin-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_y.cpp system/tools/aidl/aidl_language_y.yy"

/bin/bash: prebuilts/misc/darwin-x86/bison/bison: No such file or directory

[  0% 19/33193] Lex: aidl <= system/tools/aidl/aidl_language_l.ll

ninja: build stopped: subcommand failed.

make: *** [ninja_wrapper] Error 1


#### make failed to build some targets (36 seconds) ####


I tried to follow the instructions of other threads in Google Groups about the same issue. 

For example some guys suggested to "export USE_NINJA=false" then I encounter several errors like:


external/libcxx/include/cmath error declaration conflicts with target of using declaration already in scope

fatal error: too many errors emitted, stopping now [-ferror-limit=]

20 errors generated.

ninja: build stopped: subcommand failed.

make: *** [ninja_wrapper] Error 1


#### make failed to build some targets (35 seconds) ####

Other people suggest this 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/

then I tried to build and I get the 1st error mentioned above. 

Any suggestions? do I miss something in the precess?
 

jianfen...@technicolor.com

unread,
Feb 1, 2018, 10:06:10 AM2/1/18
to Android Building
I have resolved the problem by downloading bison 2.7 source codes from bision website, compiling it and replace prebuilds/misc/darwin-x86/bison/bison by the output.

在 2018年1月7日星期日 UTC+8上午9:06:24,ilias koletsis写道:
Reply all
Reply to author
Forward
0 new messages