Re: [native-client-discuss] Problems when building native client SDK and compiling the trusted code base

87 views
Skip to first unread message
Message has been deleted

Derek Schuff

unread,
Nov 10, 2015, 12:26:26 PM11/10/15
to Native-Client-Discuss
Instead of directly cloning the repo, try the following to get the sources:
First get the Chromium depot_tools tool: https://www.chromium.org/developers/how-tos/install-depot-tools
Then use the command 'fetch nacl' which will clone the native_client git repo, and also clone a couple of other repositories that nacl depends on. When you want to update you can do 'git pull' in the native_client repo, and then run 'gclient sync' which will keep the dependencies up to date. Notable among the dependencies that gclient manages is a binary build of the untrusted toolchain mentioned in the error message you pasted.

On Tue, Nov 10, 2015 at 9:20 AM min xu <pic...@gmail.com> wrote:
Hi,

I have checked out the native_client src from git clone https://chromium.googlesource.com/native_client/src/native_client

Then, I run following commands to build the toolchain:
$ cd native_client/tools
$ make SDKLOC=/my/path/to/sdk
Everything seems fine.

When I try to compile the trusted sel_ldr, 
$ cd ..
$ ./scons --mode=opt-linux sel_ldr
there comes an exception:
Exception: Cannot find a toolchain for x86-32 in /my/path/to/native_client/toolchain/linux_x86/pnacl_newlib_raw:
  File "/home/xum/Documents/sgx-transparency/native_client/SConstruct", line 2980:
    RANDOM_LIBS = ['nacl_random_private'],
  File "/home/xum/Documents/sgx-transparency/third_party/scons-2.0.1/engine/SCons/Environment.py", line 1317:
    apply_tools(clone, tools, toolpath)
  File "/home/xum/Documents/sgx-transparency/third_party/scons-2.0.1/engine/SCons/Environment.py", line 105:
    env.Tool(tool)
  File "/home/xum/Documents/sgx-transparency/third_party/scons-2.0.1/engine/SCons/Environment.py", line 1694:
    tool(self)
  File "/home/xum/Documents/sgx-transparency/third_party/scons-2.0.1/engine/SCons/Tool/__init__.py", line 180:
    self.generate(env, *args, **kw)
  File "/home/xum/Documents/sgx-transparency/native_client/site_scons/site_tools/naclsdk.py", line 702:
    _SetEnvForNativeSdk(env, root)
  File "/home/xum/Documents/sgx-transparency/native_client/site_scons/site_tools/naclsdk.py", line 110:
    (env['TARGET_FULLARCH'], sdk_path))

Anyone has any idea on how to resolve this issue?

Thanks.
Min

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

min xu

unread,
Nov 10, 2015, 8:02:13 PM11/10/15
to Native-Client-Discuss, dsc...@google.com
Thank you, Derek! It's very helpful.

Now I have compiled the toolchain from native_client/src/tools:
make clean build-with-newlib -j16
I compiled sel_ldr and irt_core.nexe as well.
scons --mode=opt-linux sel_ldr
scons build_bin
scons build_lib

One thing that confuses me now is how I can compile a NaCl module using the NaCl toolchain. I remember the correct way to do this is like this:
./my/path/to/nacl-gcc -g -O2 -m32 -I/my/path/to/include -L/my/path/to/lib -o hello_world.nexe hello_world.c -lppapi
However, I cannot find the headers of ppapi. Neither are the library of ppapi.  Do I miss something?

Thanks!
Min
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.

Victor Khimenko

unread,
Nov 11, 2015, 2:19:27 AM11/11/15
to Native Client Discuss, Derek Schuff
On Wed, Nov 11, 2015 at 2:02 AM, min xu <pic...@gmail.com> wrote:
Thank you, Derek! It's very helpful.

Now I have compiled the toolchain from native_client/src/tools:
make clean build-with-newlib -j16
I compiled sel_ldr and irt_core.nexe as well.
scons --mode=opt-linux sel_ldr
scons build_bin
scons build_lib

One thing that confuses me now is how I can compile a NaCl module using the NaCl toolchain. I remember the correct way to do this is like this:
./my/path/to/nacl-gcc -g -O2 -m32 -I/my/path/to/include -L/my/path/to/lib -o hello_world.nexe hello_world.c -lppapi
However, I cannot find the headers of ppapi. Neither are the library of ppapi.  Do I miss something?

Yes. NaCl by itself does not provide a PPAPI. PPAPI is part of Chrome and as such the appropriate parts are only built as part of Chromium build process. Some years ago NaCl SDK included complex dance which pulled Chromium sources to built SDK and then Chrome pulled these back, but these were eliminated years ago. Today you need to build NaCl SDK from Chromium sources to get a PPAPI headers and libraries.
 
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages