1*03ce13f7SAndroid Build Coastguard WorkerSubzero Documentation 2*03ce13f7SAndroid Build Coastguard Worker===================== 3*03ce13f7SAndroid Build Coastguard Worker 4*03ce13f7SAndroid Build Coastguard WorkerSubzero is a JIT compiler used as a back-end for [Reactor](Reactor.md). It originates from Chrome's [Portable Native Client](https://developer.chrome.com/native-client) project. Its authoritative repository is at [https://chromium.googlesource.com/native_client/pnacl-subzero/](https://chromium.googlesource.com/native_client/pnacl-subzero/). 5*03ce13f7SAndroid Build Coastguard Worker 6*03ce13f7SAndroid Build Coastguard WorkerSubzero for SwiftShader 7*03ce13f7SAndroid Build Coastguard Worker----------------------- 8*03ce13f7SAndroid Build Coastguard Worker 9*03ce13f7SAndroid Build Coastguard WorkerSwiftShader contains a fork of the Subzero source code (at the time of writing they are in sync). It is an alternative JIT compiler back-end, with LLVM still being the default for CMake builds. To build SwiftShader with Subzero instead of LLVM, specify -DREACTOR_BACKEND=Subzero in your CMake command (or change LLVM to Subzero in the CMake GUI). For Chrome builds that use the BUILD.gn files, Subzero is the default as it produces significantly smaller binaries than with LLVM. 10*03ce13f7SAndroid Build Coastguard Worker 11*03ce13f7SAndroid Build Coastguard WorkerSubzero Development 12*03ce13f7SAndroid Build Coastguard Worker------------------- 13*03ce13f7SAndroid Build Coastguard Worker 14*03ce13f7SAndroid Build Coastguard WorkerDevelopment on Subzero itself requires setting up the NaCl environment on a Linux system to be able to run its unit tests: 15*03ce13f7SAndroid Build Coastguard Worker 16*03ce13f7SAndroid Build Coastguard Worker* Install Chrome's [depot_tools](http://dev.chromium.org/developers/how-tos/install-depot-tools). 17*03ce13f7SAndroid Build Coastguard Worker* Run `mkdir nacl && cd nacl && fetch nacl` ([ref](http://www.chromium.org/nativeclient/how-tos/how-to-use-git-svn-with-native-client)). 18*03ce13f7SAndroid Build Coastguard Worker* Run `native_client/toolchain_build/toolchain_build_pnacl.py --verbose --sync --clobber --install toolchain/linux_x86/pnacl_newlib_raw` ([ref](https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/developing-pnacl#TOC-TL-DR-for-checking-out-PNaCl-sources-building-and-testing)). 19*03ce13f7SAndroid Build Coastguard Worker* Run all unit tests with `make -f Makefile.standalone check` ([ref](https://chromium.googlesource.com/native_client/pnacl-subzero/+/master/docs/README.rst)). 20