How to use ported library in NaCl module?

谁都会走 提交于 2019-12-13 00:34:11

问题


I want to use openssl library in my NaCl module. Luckily it is ported already as in https://code.google.com/p/naclports/. However, its kind of pity but I don't know how to add the library to the toolchain. I did as instructed in the Readme file:

...nacl_sdk/pepper_33/naclports/src$ python build_tools/naclports.py install openssl Already installed 'openssl' [x86_64/newlib]

And then I tried to compile this simple C code, and the compiler complaint some errors which are because of linking problem with openssl/evp.h.

This is my Makefile: link. Please let me know how to make it run.


回答1:


NaCl actually consists of several different toolchains. naclports will build and install a given library to just one of them at time. The libraries and headers get installed directly into the toolchain so there is no need to -L or -I on the command line.

In this case you have built and installed the x86_64 newlib version of openssl. This means that you should be able to build the x86_64 newlib version of your app (add TOOLCHAIN=newlib NACL_ARCH=x86_64 to your make call).

To build all the other versions of openssh you can use the "make_all.sh" script at the top level of naclports (e.g. ./make_all.sh openssl).




回答2:


Build naclports. Look in naclports/README.rst for instructions.



来源:https://stackoverflow.com/questions/23270979/how-to-use-ported-library-in-nacl-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!