如何构建工具链PNaCl的 [英] How to build pnacl toolchain

查看:774
本文介绍了如何构建工具链PNaCl的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是做一些新的功能,工具链PNaCl的。我这样做之前,我想我应该首先成功构建工具链PNaCl的

[11/04更新]

最后,它的工作原理。一些包(野牛,byacc,弯曲)余did't安装并造成了这一问题。

[11/03更新]

我使用Ubuntu-14.04.1-桌面AMD64作为我的系统

此外,Ubuntu的12.04.5-桌面AMD64正在测试[11/03更新]

我已经按照文件一路。直到我运行toolchain_build_pnacl脚本一切顺利就好了。

所以,我在这里添加新的错误消息:

如果我使用gcc来编译运行脚本


  

toolchain_build / toolchain_build_pnacl.py --gcc --verbose --sync --clobber
  --install工具链/ linux_x86 / pnacl_newlib


那么以下错误消息


  

GCC -DHAVE_CONFIG_H -I。 -I ../../../的src / binutils的/金
  -I ../../../的src / binutils的/金-I ../../../的src / binutils的/金/../包括 - 我../../../的src / binutils的/金/../ elfcpp -DLOCALEDIR =\\/股/区域设置\\
  -DBINDIR =\\/ bin中\\-DTOOLBINDIR =\\/ ARM-PC-氯化钠/ BIN \\-DTOOLLIBDIR =\\/ ARM-PC-氯化钠/ lib目录\\-W -Wall - Wstrict的原型-Wmissing的原型-Wshadow -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS = 64 -frandom种子= yyscript.o -Wno扩展-offsetof -Wno-绝对值-Wno未使用的功能-Wno-未使用的,const-可变-Wno-不必要的内部声明-Wno未使用的,私人领域-Wno格式安全-MT yyscript.o -MD -MP -MF .deps / yyscript.Tpo -c -o yyscript.o yyscript.c yyscript.c:1:1:错误:返回类型默认为'诠释'[-Werror =返回类型] yyscript.c:1:1:错误:函数


  
  

声明不是一个原型[-Werror =严格的原型] CC1:错误:
  无法识别的命令行选项-Wno-未使用的,私人领域[-Werror]
  CC1:错误:无法识别的命令行选项
  -Wno-不必要的内部声明[-Werror] CC1:错误:
  无法识别的命令行选项-Wno-未使用const的变量
  [-Werror] CC1:错误:无法识别的命令行选项
  -Wno绝对价值[-Werror] CC1:错误:无法识别的命令行
  选项​​-Wno扩展-offsetof[-Werror] CC1:所有被警告
  视为错误使[4]:*** [yyscript.o]错误1


如果我使用默认铛运行它来编译


  

toolchain_build / toolchain_build_pnacl.py --verbose --clobber
  --install工具链/ linux_x86 / pnacl_newlib


产生那么以下错误消息


  

/家庭/ albaforia / SVN / nativeclient / THIRD_PARTY / LLVM的构建/发布+断言/斌/铛
  -DHAVE_CONFIG_H -I。 -I ../../../的src / binutils的/金-I ../../../的src / binutils的/金-I ../../../的src / binutils的/金/。 ./include -I ../../../的src / binutils的/金/../ elfcpp -DLOCALEDIR =\\/股/区域设置\\-DBINDIR =\\/ bin中\\-DTOOLBINDIR =\\/ ARM-PC-氯化钠/ BIN \\-DTOOLLIBDIR =\\/ ARM-PC-氯化钠/ lib目录\\-W -Wall -Wstrict的原型-Wmissing的原型-Wshadow -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS = 64 -frandom种子= yyscript.o -Wno扩展-offsetof -Wno-绝对值-Wno未使用的功能-Wno-未使用const的变量-Wno-不必要的内部声明-Wno未用 - 私人场-Wno格式安全-MT yyscript.o -MD -MP -MF .deps / yyscript.Tpo -c -o yyscript.o yyscript.c yyscript.c:1:1:错误:类型说明符失踪,默认为'廉政'[-Werror,-Wimplicit-INT]
      主要(){返回0;
  }产生^ ~~~ 1错误。使[4]:*** [yyscript.o]错误1



解决方案

默认情况下,PNaCl的工具链铿锵的下载二进制构建,因为谷歌的自动建设者运行的Ubuntu 12.04,并在这些系统上的GCC不能建立LLVM的最新版本。因此,有2个选择:
如果你使用Chromium的 depot_tools 来获取本机客户端源代码,你可以很容易地得到相同的编译器的副本建设者使用方法:从的父目录NATIVE_CLIENT 运行
工具/铛/脚本/ update.sh 这将下载并在目录中安装铛,其中 toolchain_build_pnacl.py 预计它。一旦安装后,它会自动由本地客户端 DEPS 如果你使用钩子 gclient 从保持最新的 depot_tools

否则,您可以使用该系统GCC编译器使用的工具链PNaCl的 - 海湾合作委员会选项。这应该在Ubuntu 14.04肯定工作作为系统我们开发的PNaCl的

顺便说一句,我已经开始另一个<一个href=\"https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/building-pnacl-components-for-distribution-packagers\"相对=nofollow>文件,对构建过程(即使它的重点不完全是你所感兴趣的东西),当然还有就是 -h一些细节 toolchain_build_pnacl.py 的标志和它的出处。

My goal is to make some new function to pnacl toolchain. Before I doing so, I think I should build the pnacl toolchain successfully first.

[11/04 Update]

Finally it works. Some package(bison, byacc, flex) I did't install and caused this problem.

[11/03 Update]

I use ubuntu-14.04.1-desktop-amd64 as my system

Also, ubuntu-12.04.5-desktop-amd64 is now testing [11/03 updated]

I've followed the step of the document all the way. Everything goes just fine until I run the toolchain_build_pnacl script

So I add the new error message here :

if I run the script using gcc to compile

toolchain_build/toolchain_build_pnacl.py --gcc --verbose --sync --clobber --install toolchain/linux_x86/pnacl_newlib

then the following error message is

gcc -DHAVE_CONFIG_H -I. -I../../../src/binutils/gold -I../../../src/binutils/gold -I../../../src/binutils/gold/../include - I../../../src/binutils/gold/../elfcpp -DLOCALEDIR="\"/share/locale\"" -DBINDIR="\"/bin\"" -DTOOLBINDIR="\"/arm-pc-nacl/bin\"" -DTOOLLIBDIR="\"/arm-pc-nacl/lib\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=yyscript.o -Wno-extended-offsetof -Wno-absolute-value -Wno-unused-function -Wno-unused-const-variable -Wno-unneeded-internal-declaration -Wno-unused-private-field -Wno-format-security -MT yyscript.o -MD -MP -MF .deps/yyscript.Tpo -c -o yyscript.o yyscript.c yyscript.c:1:1: error: return type defaults to ‘int’ [-Werror=return-type] yyscript.c:1:1: error: function

declaration isn’t a prototype [-Werror=strict-prototypes] cc1: error: unrecognized command line option "-Wno-unused-private-field" [-Werror] cc1: error: unrecognized command line option "-Wno-unneeded-internal-declaration" [-Werror] cc1: error: unrecognized command line option "-Wno-unused-const-variable" [-Werror] cc1: error: unrecognized command line option "-Wno-absolute-value" [-Werror] cc1: error: unrecognized command line option "-Wno-extended-offsetof" [-Werror] cc1: all warnings being treated as errors make[4]: *** [yyscript.o] Error 1

if I run it with default clang to compile

toolchain_build/toolchain_build_pnacl.py --verbose --clobber --install toolchain/linux_x86/pnacl_newlib

then following error message is generated

/home/albaforia/SVN/nativeclient/third_party/llvm-build/Release+Asserts/bin/clang -DHAVE_CONFIG_H -I. -I../../../src/binutils/gold -I../../../src/binutils/gold -I../../../src/binutils/gold/../include -I../../../src/binutils/gold/../elfcpp -DLOCALEDIR="\"/share/locale\"" -DBINDIR="\"/bin\"" -DTOOLBINDIR="\"/arm-pc-nacl/bin\"" -DTOOLLIBDIR="\"/arm-pc-nacl/lib\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=yyscript.o -Wno-extended-offsetof -Wno-absolute-value -Wno-unused-function -Wno-unused-const-variable -Wno-unneeded-internal-declaration -Wno-unused-private-field -Wno-format-security -MT yyscript.o -MD -MP -MF .deps/yyscript.Tpo -c -o yyscript.o yyscript.c yyscript.c:1:1: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] main() { return 0; } ^~~~ 1 error generated. make[4]: *** [yyscript.o] Error 1

解决方案

By default the PNaCl toolchain builds with a downloaded binary of clang because Google's automated builders run Ubuntu 12.04, and the gcc on those systems cannot build recent versions of LLVM. So there are 2 options: If you used Chromium's depot_tools to get the Native Client sources, you can easily get a copy of the same compiler the builders use: from the parent directory of native_client run tools/clang/scripts/update.sh which will download and install clang in the directory where toolchain_build_pnacl.py expects it. Once it is installed, it will be kept up to date automatically by Native Clients DEPS hooks if you use gclient from depot_tools.

Otherwise you can use the system gcc to compile the PNaCl toolchain using the --gcc option. This should definitely work on Ubuntu 14.04 as that the system we develop PNaCl on.

As an aside I've started another document that has a few more details on the build process (even if its focus isn't exactly what you are interested in) and of course there is the -h flag of toolchain_build_pnacl.py and its sources.

这篇关于如何构建工具链PNaCl的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆