简体   繁体   English

Mac非法指令:4

[英]Mac Illegal instruction : 4

I am building AOSP(Android Open Source Project) on MAC from doc and everything works fine although there is some problem which I can google to solve. 我正在使用doc在MAC上构建AOSP(Android开源项目),一切正常,尽管我可以谷歌解决一些问题。

When I execute make , I got an error: 当我执行make ,我收到一个错误:

Yacc: aidl <= frameworks/base/tools/aidl/aidl_language_y.y Yacc:aidl <= frameworks / base / tools / aidl / aidl_language_y.y

prebuilts/misc/darwin-x86/bison/bison -d -o out/host/darwin-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y prebuilts / misc / darwin-x86 / bison / bison -d -o out / host / darwin-x86 / obj / EXECUTABLES / aidl_intermediates / aidl_language_y.cpp frameworks / base / tools / aidl / aidl_language_y.y

make: *** [out/host/darwin-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Illegal instruction: 4 make:*** [out / host / darwin-x86 / obj / EXECUTABLES / aidl_intermediates / aidl_language_y.cpp]非法指令:4

I have googled too much and I tried to install bison but it does not work for me. 我用Google搜索了太多,我试图安装bison但它对我不起作用。

Environment: 环境:

Mac SDK : 10.11
Mac OS  : 10.13
Android : 6.0.1
JDK     : 1.7
XCode   : 8.3
make    : 3.81

Can anyone help me ? 谁能帮我 ? Thanks in advance. 提前致谢。

UPDATE UPDATE

I also tried to downgrade XCode to 7.3.1 but it does not still work. 我还尝试将XCode降级到7.3.1,但它仍然无法正常工作。

UPDATE for compatibility 更新兼容性

file prebuilts/misc/darwin-x86/bison/bison
output : prebuilts/misc/darwin-x86/bison/bison: Mach-O executable i386 输出: prebuilts/misc/darwin-x86/bison/bison: Mach-O executable i386

uname -a
output: root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64 输出: root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64

I had the same problem. 我有同样的问题。 The bison executable was broken, so I installed bison with homebrew: 野牛可执行文件坏了,所以我用自制软件安装了野牛:

brew install bison

And then 接着

sudo find / -name bison

Which gave me the path to the bison installation: /usr/bin/bison I removed the bison file from the AOSP: 这给了我野牛安装的路径:/ usr / bin / bison我从AOSP中删除了野牛文件:

sudo rm /Volumes/android/prebuilts/misc/darwin-x86/bison/bison

(Volumes/android/ is my working directory, the directory with aosp). (Volumes / android /是我的工作目录,带有aosp的目录)。 Then I created a symbolic link to the bison installed with homebrew: 然后我创建了一个与自制软件安装的野牛的符号链接:

sudo ln -s /usr/bin/bison /Volumes/android/prebuilts/misc/darwin-x86/bison/bison

https://groups.google.com/d/msg/android-building/D1-c5lZ9Oco/V9yPowRdCAAJ https://groups.google.com/d/msg/android-building/D1-c5lZ9Oco/V9yPowRdCAAJ

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM