我正在考虑使用 Google 的 Native Client SDK,因此我下载了该工具进行安装,安装了pepper_46
,并尝试构建“入门”项目,然后得到了以下回应。
rob@asmodeus:~/Downloads/nacl_sdk/pepper_46/getting_started$ make serve
make -C part1 all
make[1]: Entering directory '/home/rob/Downloads/nacl_sdk/pepper_46/getting_started/part1'
/home/rob/Downloads/nacl_sdk/pepper_46/toolchain/linux_pnacl/bin/pnacl-clang++ -o hello_tutorial.bc hello_tutorial.cc -O2 -I/home/rob/Downloads/nacl_sdk/pepper_46/include -L/home/rob/Downloads/nacl_sdk/pepper_46/lib/pnacl/Release -lppapi_cpp -lppapi
[Errno 8] Exec format error
Command was: /home/rob/Downloads/nacl_sdk/pepper_46/toolchain/linux_pnacl/bin/clang \
--driver-mode=g++ \
-emit-llvm \
-c -O2 \
-fno-vectorize \
-fno-slp-vectorize \
-fno-common \
-nostdinc \
-target \
le32-unknown-nacl \
-I/home/rob/Downloads/nacl_sdk/pepper_46/include \
-isystem \
/home/rob/Downloads/nacl_sdk/pepper_46/toolchain/linux_pnacl/le32-nacl/usr/include \
-isystem \
/home/rob/Downloads/nacl_sdk/pepper_46/toolchain/linux_pnacl/lib/clang/3.7.0/include \
-isystem \
/home/rob/Downloads/nacl_sdk/pepper_46/toolchain/linux_pnacl/le32-nacl/include/c++/v1 \
-isystem \
/home/rob/Downloads/nacl_sdk/pepper_46/toolchain/linux_pnacl/le32-nacl/include \
-isystem \
/home/rob/Downloads/nacl_sdk/pepper_46/toolchain/linux_pnacl/sdk/include \
-xc++ \
hello_tutorial.cc \
-o /home/rob/Downloads/nacl_sdk/pepper_46/getting_started/part1/hello_tutorial.bc---hello_tutorial.cc---.po
Makefile:50: recipe for target 'hello_tutorial.bc' failed
make[1]: *** [hello_tutorial.bc] Error 1
make[1]: Leaving directory '/home/rob/Downloads/nacl_sdk/pepper_46/getting_started/part1'
Makefile:54: recipe for target 'part1_ALL_TARGET' failed
make: *** [part1_ALL_TARGET] Error 2
rob@asmodeus:~/Downloads/nacl_sdk/pepper_46/getting_started$
据我所知,相关部分是[Errno 8] Exec format error
和Command was: /home/rob/.../bin/clang
。经过一番调查,我发现了这一点。
rob@asmodeus:~/Downloads/nacl_sdk/pepper_46/toolchain/linux_pnacl/bin$ file clang
clang: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=a828789c24cefbb485103da1bf609d35e447dda2, stripped
rob@asmodeus:~/Downloads/nacl_sdk/pepper_46/toolchain/linux_pnacl/bin$
令人担心的是“x86-64”,因为我的系统是普通的 x86 系统!Google 的 SDK 安装页面说明它支持 x86-32,但没有说明如何安装,而且我找不到 32 位二进制文件或安装它们的方法。我该如何获取这些文件的 32 位版本?
答案1
经过进一步研究后,我发现尽管 Google 确实声明支持 NaCl 的 x86-32,但他们并不支持 SDK。