我尝试按照以下步骤为Android构建V8。
1.安装depot_tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
第3步成功构建并获得了库。 虽然4失败,因为无法找到一些标准标题。
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found
#include_next <stdio.h>
^
In file included from ../src/api.cc:5:
In file included from .././src/api.h:8:
In file included from .././include/v8-testing.h:8:
In file included from ../include/v8.h:20:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found
#include_next <stdio.h>
^
In file included from ../src/asmjs/asm-wasm-builder.cc:5:
In file included from .././src/v8.h:8:
In file included from .././include/v8.h:20:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found
#include_next <stdio.h>
^
In file included from ../src/asmjs/typing-asm.cc:5:
In file included from .././src/asmjs/typing-asm.h:8:
In file included from .././src/allocation.h:8:
In file included from .././src/globals.h:11:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ostream:138:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ios:215:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/iosfwd:90:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found
#include_next <wchar.h>
^
In file included from ../src/accessors.cc:5:
In file included from .././src/accessors.h:8:
In file included from .././include/v8.h:20:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found
#include_next <stdio.h>In file included from
../src/assembler.cc: ^35
:
In file included from .././src/assembler.h:38:
In file included from .././src/allocation.h:8:
In file included from .././src/globals.h:11:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ostream:138:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ios:215:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/iosfwd:90:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found
#include_next <wchar.h>
^In file included from
../src/arguments.cc:5:
In file included from .././src/arguments.h:8:
In file included from .././src/allocation.h:8:
In file included from .././src/globals.h:11:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ostream:138:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ios:215:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/iosfwd:90:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found
#include_next <wchar.h>
^
In file included from ../src/api-experimental.cc:9:
In file included from .././src/api-experimental.h:8:
In file included from .././src/handles.h:8:
In file included from .././include/v8.h:20:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found
#include_next <stdio.h>
^
In file included from ../src/address-map.cc:5:
In file included from .././src/address-map.h:8:
In file included from .././src/assert-scope.h:9:
In file included from .././src/base/macros.h:8:
In file included from .././src/base/compiler-specific.h:8:
.././include/v8config.h:14:11: fatal error: 'TargetConditionals.h' file not found
# include <TargetConditionals.h>
^
In file included from ../src/allocation.cc:5:
In file included from .././src/allocation.h:8:
In file included from .././src/globals.hIn file included from :../src/asmjs/asm-types.cc11::
5In file included from :
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ostreamIn file included from :.././src/v8.h138::
8In file included from :
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/iosIn file included from :.././include/v8.h215::
20In file included from :
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/iosfwd:/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/stdio.h90::
108:15/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/wchar.h:: 119:15:fatal error : fatal error'stdio.h': file 'wchar.h'not filefound not
found
#include_next <stdio.h>
^
#include_next <wchar.h>
^
In file included from ../src/assert-scope.ccIn file included from ../src/ast/ast-expression-rewriter.cc:5:
In file included from .././src/ast/ast.h:8:
In file included from .././src/ast/ast-value-factory.h:31:
In file included from .././src/api.h:8:
In file included from .././include/v8-testing.h:8:
In file included from ../include/v8.h:20:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found
#include_next <stdio.h>
^
:5:
In file included from .././src/assert-scope.h:9:
In file included from .././src/base/macros.h:8:
In file included from .././src/base/compiler-specific.h:8:
.././include/v8config.h:14:11: fatal error: 'TargetConditionals.h' file not foundIn file included from
../src/api-arguments.cc:5:
In file included from .././src/api-arguments.h:8:
In file included from .././src/api.h:8:
In file included from .././include/v8-testing.h:8:
In file included from ../include/v8.h:20:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' # include <TargetConditionals.h>file
not ^found
#include_next <stdio.h>
^In file included from
../src/asmjs/asm-js.cc:5:
In file included from .././src/asmjs/asm-js.h:9:
In file included from .././src/allocation.h:8:
In file included from .././src/globals.h:11:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ostream:138:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ios:215:
In file included from /Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/iosfwd:90:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found
#include_next <wchar.h>
^
In file included from ../src/allocation-site-scopes.cc:5:
In file included from .././src/allocation-site-scopes.h:8:
In file included from .././src/ast/ast.h:8:
In file included from .././src/ast/ast-value-factory.h:31:
In file included from .././src/api.h:8:
In file included from .././include/v8-testing.h:8:
In file included from ../include/v8.h:20:
/Users/philip/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found
#include_next <stdio.h>
^
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/allocation.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/asmjs/asm-types.o] Error 1
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/address-map.o] Error 1
1 error generated.
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/arguments.o] Error 1
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/api-natives.o] Error 1
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/api-arguments.o] Error 1
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/api-experimental.o] Error 1
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/allocation-site-scopes.o] Error 1
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/ast/ast-expression-rewriter.o] Error 1
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/assert-scope.o] Error 1
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/accessors.o] Error 1
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/asmjs/asm-js.o] Error 1
1 error generated.
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/asmjs/asm-wasm-builder.o] Error 1
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/asmjs/typing-asm.o] Error 1
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/assembler.o] Error 1
1 error generated.
make[2]: *** [/Users/philip/v8/out/android_arm.release/obj.host/v8_base/src/api.o] Error 1
make[1]: *** [android_arm.release] Error 2
make: *** [android_arm.release] Error 2
答案 0 :(得分:0)
请勿使用 -j 参数。
可选参数:
-j 指定并行构建进程的数量。将其(大致)设置为您的机器具有的CPU核心数。 GYP / make 基于V8的构建还支持distcc,因此可以使用-j100或者编译 所以,只要你有足够的机器。
但现在编译器说,他找不到TargetConditionals.h
.././include/v8config.h:14:11: fatal error: 'TargetConditionals.h' file not found
答案 1 :(得分:0)
你应该安装xcode命令行工具。
1.install xcode。
2.run命令“xcode-select --install”。
3.make android_arm.release -j16 android_ndk_root = [ndk的完整路径]