Skip to content
Open source toolchain for Switch development
C C++ Makefile Other
Branch: development
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
include/libtransistor Add the rest of thread_context_t. Sep 28, 2019
lib Add syscall wrappers for svcSetHardwareBreakPoint. Aug 25, 2019
mk add string encoding utility functions Oct 5, 2018
projects/example Add version to example project Jun 3, 2018
test USB for 5.0.0+ (closes #158) Oct 5, 2018
test_helpers use full path to nro file relative to the helper script Dec 19, 2017
.gitattributes gitattributes: ignore man pages in linguist Feb 16, 2018
.gitignore update .gitignore, move requirements.txt to libtransistor-base, updat… May 7, 2018
.travis.yml travis: fix doxygen Jan 7, 2019
Doxyfile Updated to include on main page Jan 10, 2018
LAYOUT.txt add LAYOUT.txt to document planned structure Nov 6, 2017
LICENSE add ISC license (close #41) Dec 12, 2017
Makefile remove support libraries, remove sdl2, and move phal implementation i… May 6, 2018 Update README Sep 29, 2018 enforce header dependency discipline by including each header file fi… Aug 22, 2018


Build Status Chat on Discord

Libtransistor is a userland library for the Nintendo Switch. Binaries should run under Mephisto, Yuzu, Ryujinx, or on hardware with any firmware version via Atmosphère.


The documentation is automatically built and can be found here:


For a more in-depth explanation, see The Guide.

Download our latest release. Choose either libtransistor_vX.X.X.tar.gz or, and extract it. The recommended place to extract these archives is into /opt/libtransistor/. Next, set the LIBTRANSISTOR_HOME environment variable to wherever you extracted the archive.

The tests_{nro,nso}.{tar.gz,zip} archives contain builds of all of the tests included with libtransistor.


If you're using a Makefile-based build system, include $(LIBTRANSISTOR_HOME)/ You will also need to provide custom linking rules. See projects/example/ for an example of how to do this.

Otherwise, specify CC_FLAGS and LD_FLAGS and such based off of


For a more in-depth explanation, see The Guide.

First, clone the repo with

git clone --recursive

Next, get a copy of libtransistor-base. You can either build it yourself, or download a pre-built release. Pick a release with a version number equal to the version of libtransistor that you are building, or the next lowest if no such version exists. If you build it yourself, copy the dist/ folder from libtransistor-base to the root of this repository's contents, so it's in the same place as this and lib and include. If you download a release, extract it into a new folder called dist.

You will need Python 3 and the python packages listed in dist/requirements.txt. You'll also need clang and lld >=5.0 (llvm linker).

You should just be able to run make. If that doesn't work, submit an issue (or pull request). This will produce a number of nro and nso files in build/test/. These are binaries for the Nintendo Switch. NRO files are relocatable shared objects suitable for use with ROhan, the Homebrew Launcher, or any other loader taking NROs. Both NRO and NSO binaries can be run under Mephisto.

Building on Fedora

Fedora does not ship recent enough clang and lld binaries. However, pre-built clang binaries from can be used.


wget -c
tar xpf clang+llvm-5.0.1-x86_64-linux-gnu-Fedora27.tar.xz
export PATH=`pwd`/clang+llvm-5.0.1-x86_64-linux-gnu-Fedora27/bin:$PATH
cd libtransistor

If some of the cmake CXX tests fail, you may need to install the necessary dependencies.

sudo dnf -y install libstdc++-devel gcc-c++.x86_64

Building on Arch Linux

You'll need to install some packages.

sudo pacman -S llvm clang lld python python-pip squashfs-tools base-devel git cmake

and you'll also need to install some python dependencies via pip.

pip install --user -r requirements.txt

Building on OSX

You will need to install squashfs:

brew install squashfs


$ ./ctu --load-nro <path-to-libtransistor>/build/test/<binary>.nro

For running the bsd test, you may want to also pass --enable-sockets. Don't pass that for anything you don't want phoning home, though.


Because Mephisto comes with a GDB stub and we produce standard ELF files before converting to NSO/NRO, we can debug libtransistor binaries very easily.

$ ./ctu --load-nro <path-to-libtransistor>/build/test/<binary>.nro --enable-gdb
[GdbStub] INFO: Starting GDB server on port 24689...
[GdbStub] INFO: Waiting for gdb to connect...
$ aarch64-none-elf-gdb 
(gdb) target remote localhost:24689
Remote debugging using localhost:24689
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x0000007100000080 in ?? ()
(gdb) add-symbol-file <path-to-libtransistor>/build/test/<binary> 0x7100000000 -s .bss 0x7100000000
add symbol table from file "<path-to-libtransistor>/build/test/<binary>" at
	.text_addr = 0x7100000000
	.bss_addr = 0x7100000000
(y or n) y
Reading symbols from <path-to-libtransistor>/build/test/<binary>
You can’t perform that action at this time.