Sandboxing Flag Option in 3.5 version

31 views
Skip to first unread message

post4e...@gmail.com

unread,
Feb 23, 2015, 8:58:31 AM2/23/15
to native-cli...@googlegroups.com
Background:
I am using PNaCl as a platform for non-chrome usage

I have few example snippets which works with CLANG 3.4 and CLANG 3.5 to generate .ll file for corresponding .c files.
in the same way, Instead of 3.4 pnacl-llc when i tried to use the version 3.5 of pnacl-llc it throws the below ERROR.

pnacl-llc: Unknown command line argument '-sfi-data'.  Try: './bin/pnacl-llc -help'
pnacl-llc: Did you mean '-stats'?
pnacl-llc: Unknown command line argument '-sfi-load'.  Try: './bin/pnacl-llc -help'
pnacl-llc: Did you mean '-soft-float'?
pnacl-llc: Unknown command line argument '-sfi-stack'.  Try: './bin/pnacl-llc -help'
pnacl-llc: Did you mean '-asan-stack'?
pnacl-llc: Unknown command line argument '-sfi-store'.  Try: './bin/pnacl-llc -help'
pnacl-llc: Did you mean '-filetype'?

Then tried to have a look at the available options in the 3.5 version and i failed to spot the equivalent flags to set sand-boxing which was present in 3.4 version

root@mypc:/home/mypcuser/all-toolchain/pnacl_toolchain/pnacl_newlib# ./bin/pnacl-llc -O0 -sfi-data -sfi-load -sfi-stack -sfi-store -march=arm -mtriple=armv7a-none-nacl-gnueabisf test.ll -o test.s

works on pnacl-llc 3.4 but not 3.5.

it will of great help if you could let me know the equivalent flags fo the above 3.4 flags on 3.5...  Thanks in advance..

-Pradeep

Derek Schuff

unread,
Feb 23, 2015, 12:47:50 PM2/23/15
to native-cli...@googlegroups.com
Hi Pradeep,
The -sfi-foo flags were removed around the time we updated from 3.4 to 3.5. When using a triple with 'nacl' as the OS, the SFI sandboxing (data, load, store, stack and branch) is always on, and otherwise it is always off. It sounds like you don't actually want to select just a subset of it, but just want the default behavior for nacl, correct?

--
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.

post4e...@gmail.com

unread,
Feb 24, 2015, 4:14:56 AM2/24/15
to native-cli...@googlegroups.com, dsc...@google.com
Thanks for the response Derek...

I would also like to use the combination of different flags :) as well not only the default behaviour. is there a way to achieve this?

-Pradeep


On Monday, February 23, 2015 at 11:17:50 PM UTC+5:30, Derek Schuff wrote:
Hi Pradeep,
The -sfi-foo flags were removed around the time we updated from 3.4 to 3.5. When using a triple with 'nacl' as the OS, the SFI sandboxing (data, load, store, stack and branch) is always on, and otherwise it is always off. It sounds like you don't actually want to select just a subset of it, but just want the default behavior for nacl, correct?

On Mon Feb 23 2015 at 5:58:35 AM <post4e...@gmail.com> wrote:
Background:
I am using PNaCl as a platform for non-chrome usage

I have few example snippets which works with CLANG 3.4 and CLANG 3.5 to generate .ll file for corresponding .c files.
in the same way, Instead of 3.4 pnacl-llc when i tried to use the version 3.5 of pnacl-llc it throws the below ERROR.

pnacl-llc: Unknown command line argument '-sfi-data'.  Try: './bin/pnacl-llc -help'
pnacl-llc: Did you mean '-stats'?
pnacl-llc: Unknown command line argument '-sfi-load'.  Try: './bin/pnacl-llc -help'
pnacl-llc: Did you mean '-soft-float'?
pnacl-llc: Unknown command line argument '-sfi-stack'.  Try: './bin/pnacl-llc -help'
pnacl-llc: Did you mean '-asan-stack'?
pnacl-llc: Unknown command line argument '-sfi-store'.  Try: './bin/pnacl-llc -help'
pnacl-llc: Did you mean '-filetype'?

Then tried to have a look at the available options in the 3.5 version and i failed to spot the equivalent flags to set sand-boxing which was present in 3.4 version

root@mypc:/home/mypcuser/all-toolchain/pnacl_toolchain/pnacl_newlib# ./bin/pnacl-llc -O0 -sfi-data -sfi-load -sfi-stack -sfi-store -march=arm -mtriple=armv7a-none-nacl-gnueabisf test.ll -o test.s

works on pnacl-llc 3.4 but not 3.5.

it will of great help if you could let me know the equivalent flags fo the above 3.4 flags on 3.5...  Thanks in advance..

-Pradeep

--
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-discuss+unsub...@googlegroups.com.

Derek Schuff

unread,
Feb 24, 2015, 12:54:03 PM2/24/15
to post4e...@gmail.com, native-cli...@googlegroups.com
On Tue Feb 24 2015 at 1:14:57 AM <post4e...@gmail.com> wrote:
Thanks for the response Derek...

I would also like to use the combination of different flags :) as well not only the default behaviour. is there a way to achieve this?

-Pradeep

Not without modifying the LLVM source.
Don't forget however that if you change the code generation options, the code you generate will not validate and sel_ldr will refuse to load it unless you also disable the validator. So if you really do want a system where you use different code generation, you'll also have to change the validator.

post4e...@gmail.com

unread,
Feb 27, 2015, 5:31:49 AM2/27/15
to native-cli...@googlegroups.com, post4e...@gmail.com, dsc...@google.com
Hi..

Could you please post the option for -mtriple= to translate without sand-boxing checks?

thanks,
Pradeep

Derek Schuff

unread,
Feb 27, 2015, 11:47:29 AM2/27/15
to post4e...@gmail.com, native-cli...@googlegroups.com
The sandboxing is controlled by the os portion of the triple. So e.g. armv7-unknown-nacl-gnueabihf gives you sandboxing while armv7-unknown-linux-gnueabihf does not.
Reply all
Reply to author
Forward
0 new messages