方案一
cd external/bison
touch patch-high-sierra.patch
vim patch-high-sierra.patch
With format string strictness, High Sierra also enforces that %n isn't used
in dynamic format strings, but we should just disable its use on darwin in
general.
--- lib/vasnprintf.c.orig 2017-06-22 15:19:15.000000000 -0700
+++ lib/vasnprintf.c 2017-06-22 15:20:20.000000000 -0700
@@ -4869,7 +4869,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
#endif
*fbp = dp->conversion;
#if USE_SNPRINTF
-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# 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';
patch -p0 < patch-high-sierra.patch
mm
cp ./out/host/darwin-x86/obj/EXECUTABLES/bison_intermediates/bison ./prebuilts/misc/darwin-x86/bison/bison
情形2
编译报错可能会遇到dexdump2和dex2oat被编译成32bit的,导致报错为bad cpu这个错误
art/build/Android.common.mk
,他这个地方有一个判断,看注释mac os不支持最低4g内存申请在64位进程中。
ifneq ($(HOST_OS),darwin)
ART_HOST_SUPPORTED_ARCH := x86 x86_64
else
# Mac OS doesn't support low-4GB allocation in a 64-bit process. So we won't be able to create
# our heaps.
ART_HOST_SUPPORTED_ARCH := x86_64
ART_MULTILIB_OVERRIDE_host := 64
endif
情景三
- Pre-compiled bison tool issues
make: prebuilts/misc/darwin-x86/bison/bison: Bad CPU type in executable make: *** [out/host/darwin-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 1 make: *** Waiting for unfinished jobs...
Solution:
Replace the bison with our system through a soft link rm prebuilts/misc/darwin-x86/bison/bison
jiangshenghuadeMacBook-Pro:firefly_rk3288_adnroid5.1 jshh$ which bison
/usr/bin/bison
ln -s /usr/bin/bison prebuilts/misc/darwin-x86/bison/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)