Re: How to run mips version nexe in mips operation

142 views
Skip to first unread message

Andrey Khalyavin

unread,
Mar 1, 2013, 2:30:30 AM3/1/13
to native-cli...@googlegroups.com
You need sel_ldr for mips architecture. We don't provide it in SDK, you have to compile it from source.

-- Andrey Khalyavin

heh...@gmail.com

unread,
Mar 4, 2013, 7:59:52 PM3/4/13
to native-cli...@googlegroups.com
Thanks for your reply. You said "you have to compile it from source", What is source? 
I downloaded source code of nacl sdk and compiled it. In folder "native_client/tests/", each item conatians source that you said?

在 2013年3月1日星期五UTC+8下午3时30分30秒,Andrey Khalyavin写道:

Victor Khimenko

unread,
Mar 5, 2013, 1:48:44 AM3/5/13
to Native Client Discuss, Petar Jovanovic

On Tue, Mar 5, 2013 at 4:59 AM, <heh...@gmail.com> wrote:
Thanks for your reply. You said "you have to compile it from source", What is source? 

It's somewhere in the repo, I don't know details. It may surprise you, but NaCl is a "true" open source project. In particular MIPS port is not done by Google. We accept patches from the MIPS guys (CCed) and try to keep this code from being "obviously broken" (that is: when code in the repo is refactored we apply the same changes everywhere and MIPS support code is not an exception), but that's it.
 
I downloaded source code of nacl sdk and compiled it. In folder "native_client/tests/", each item conatians source that you said?

I'm not sure if SDK currently supports MIPS at all or not. Hopefully Petar will point you to some relevant documentation.

Petar Jovanovic

unread,
Mar 5, 2013, 8:19:31 PM3/5/13
to Native-Client-Discuss
I missed this email in the first place, so sorry for a delay in
replying.
In short, the steps to get MIPS running are not complex at all.

#1 checkout native client project

#2 build MIPS toolchain

To do this, simply run

$ tools/trusted_cross_toolchains/trusted-toolchain-
creator.mipsel.squeeze.sh trusted_sdk

from the root directory.
This input parameter to the script will soon be replaced with
"nacl_sdk"
(https://codereview.chromium.org/12315003/)
Hopefully the prebuilt toolchain will be available for a download, so
not
everyone has a pleasure to cross-compile gcc.

#3 apply the missing patches

Even they are still in review, it should fine for you to get the
current
versions.
Sel_ldr, validator and many other pieces are already integrated, but
the
changes for scons and the tests are missing. So, go, pick and apply:

https://codereview.chromium.org/12256018/
https://codereview.chromium.org/12460003/

#4 build native client

pnacl/build.sh all
pnacl/build.sh sdk newlib

#5 use it
Scons is a nice way to run a test, so to run hello-world for instance,
you can do:

$ ./scons --mode=nacl,opt-linux platform=mips32 -k --verbose pp=1
run_hello_world_test

You can use run.py as well, just give it path to nexe, in this case
that is:

$ ./run.py scons-out/nacl-mips32-pnacl-clang/obj/tests/hello_world/
hello_world.nexe

Hope this answers your questions.

Regards,
Petar
Message has been deleted
Message has been deleted
Message has been deleted

Hu song

unread,
Apr 1, 2013, 11:01:58 PM4/1/13
to native-cli...@googlegroups.com
Thanks for your answers. I aslo another question.
Currently, mips type nexe flle that is generated via translating from pexe can run well from run.py.

If I want to generate nexe from .c file directly (like "<NACL_SDK_ROOT>/toolchain/win_x86_newlib/bin/i686-nacl-gcc hello_world.c -o hello_world_x86_32.nexe -m32 -g -O0 -lppapi"). Follow above steps I can't find foler like "toolchain/linux_mips32_newlib" foler which contains compile tools. How to generate nacl compile tools (like mips32_nacl_gcc) ?

Derek Schuff

unread,
Apr 2, 2013, 11:58:21 AM4/2/13
to native-cli...@googlegroups.com
There is no mips32-nacl-gcc; pnacl is currently the only way to create
MIPS nexes. You can generate native MIPS .o files and .nexe files with
the pnacl toolchain, e.g. by adding the -arch, --pnacl-allow-translate
and/or --pnacl-allow-native flags to pnacl-clang instead of directly
using the pnacl-translate script, although in general it doesn't
really buy you anything useful for MIPS.
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
Message has been deleted
0 new messages