<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.fex-emu.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=D</id>
	<title>FEX-Emu Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.fex-emu.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=D"/>
	<link rel="alternate" type="text/html" href="https://wiki.fex-emu.com/index.php/Special:Contributions/D"/>
	<updated>2026-04-08T05:41:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.fex-emu.com/index.php?title=Development:Setting_up_FEX&amp;diff=1111</id>
		<title>Development:Setting up FEX</title>
		<link rel="alternate" type="text/html" href="https://wiki.fex-emu.com/index.php?title=Development:Setting_up_FEX&amp;diff=1111"/>
		<updated>2024-09-24T15:20:16Z</updated>

		<summary type="html">&lt;p&gt;D: Update version of libstdc++ from 10 to 12, as 10 is no longer available in the Debian repositories. Additionally, limit ninja to 4 threads, as any more may lead to a &amp;quot;Too many open files&amp;quot; error.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]]&lt;br /&gt;
== Build dependencies ==&lt;br /&gt;
=== Debian/Ubuntu dependencies ===&lt;br /&gt;
* git&lt;br /&gt;
* cmake&lt;br /&gt;
* ninja-build&lt;br /&gt;
* pkgconf&lt;br /&gt;
* ccache (Recommended if you're rebuilding constantly)&lt;br /&gt;
* clang&lt;br /&gt;
* llvm&lt;br /&gt;
* lld (For ThinLTO)&lt;br /&gt;
* binfmt-support (For AArch64 binfmt_misc support)&lt;br /&gt;
* libssl-dev&lt;br /&gt;
* python-setuptools (For build scripts)&lt;br /&gt;
* g++-x86-64-linux-gnu (For building thunks)&lt;br /&gt;
* libgcc-XX-dev-i386-cross (For building thunks, version should match your g++-x86-64-linux-gnu package)&lt;br /&gt;
* libgcc-XX-dev-amd64-cross (For building thunks, version should match your g++-x86-64-linux-gnu package)&lt;br /&gt;
* nasm (only if building tests)&lt;br /&gt;
* python3-clang (for struct verifier)&lt;br /&gt;
* libstdc++-12-dev-i386-cross (for struct verifier)&lt;br /&gt;
* libstdc++-12-dev-amd64-cross (for struct verifier)&lt;br /&gt;
* libstdc++-12-dev-arm64-cross (for struct verifier)&lt;br /&gt;
* squashfs-tools (For squashfs rootfs support)&lt;br /&gt;
* squashfuse (For mounting the squashfs)&lt;br /&gt;
* libc-bin or glibc-tools (For unittests, needs catchsegv from this)&lt;br /&gt;
* libc6-dev-i386-amd64-cross (For FEXLinuxTests)&lt;br /&gt;
* lib32stdc++-XX-dev-amd64-cross (For FEXLinuxTests, version should match your g++-x86-64-linux-gnu package)&lt;br /&gt;
* qtdeclarative5-dev (For GUI)&lt;br /&gt;
* qml-module-qtquick-controls (For GUI)&lt;br /&gt;
* qml-module-qtquick-controls2 (For GUI)&lt;br /&gt;
* qml-module-qtquick-dialogs (For GUI)&lt;br /&gt;
&lt;br /&gt;
=== Gentoo dependencies ===&lt;br /&gt;
* dev-vcs/git&lt;br /&gt;
* cmake&lt;br /&gt;
* ninja&lt;br /&gt;
* ccache&lt;br /&gt;
* clang&lt;br /&gt;
* lld&lt;br /&gt;
* nasm&lt;br /&gt;
&lt;br /&gt;
'''Use gubbins'''&lt;br /&gt;
* &amp;gt;=media-libs/libglvnd-1.3.4 X&lt;br /&gt;
&lt;br /&gt;
=== Fedora dependencies ===&lt;br /&gt;
* git&lt;br /&gt;
* cmake&lt;br /&gt;
* ninja-build&lt;br /&gt;
* pkg-config&lt;br /&gt;
* ccache&lt;br /&gt;
* clang&lt;br /&gt;
* lld&lt;br /&gt;
* llvm&lt;br /&gt;
* llvm-devel&lt;br /&gt;
* openssl-devel&lt;br /&gt;
* nasm&lt;br /&gt;
* python3-clang&lt;br /&gt;
* python3-setuptools&lt;br /&gt;
* squashfs-tools&lt;br /&gt;
* squashfuse&lt;br /&gt;
* erofs-fuse&lt;br /&gt;
* erofs-utils&lt;br /&gt;
&lt;br /&gt;
== Build Configuration ==&lt;br /&gt;
* Ensure release mode is enabled&lt;br /&gt;
* Disable test building&lt;br /&gt;
* Enable LTO in a release build&lt;br /&gt;
* Enable LLD to make LTO builds faster&lt;br /&gt;
&lt;br /&gt;
  git clone --recurse-submodules https://github.com/FEX-Emu/FEX.git&lt;br /&gt;
  cd FEX&lt;br /&gt;
  mkdir Build&lt;br /&gt;
  cd Build&lt;br /&gt;
  CC=clang CXX=clang++ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_LINKER=lld -DENABLE_LTO=True -DBUILD_TESTS=False -DENABLE_ASSERTIONS=False -G Ninja ..&lt;br /&gt;
  ninja&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
  sudo ninja install -j4&lt;br /&gt;
&lt;br /&gt;
You can install a binfmt_misc handler for both 32bit and 64bit x86 execution directly from the environment.&lt;br /&gt;
If you already have box86's 32bit binfmt_misc handler installed then make sure to uninstall their's first.&lt;br /&gt;
Make sure to have run install prior to this, otherwise binfmt_misc will install an old handler even if the executable has been updated.&lt;br /&gt;
&lt;br /&gt;
  sudo ninja binfmt_misc_32&lt;br /&gt;
  sudo ninja binfmt_misc_64&lt;br /&gt;
&lt;br /&gt;
=== Quirks ===&lt;br /&gt;
&lt;br /&gt;
==== binfmt_misc problems ====&lt;br /&gt;
* Double check that binfmt_misc has worked&lt;br /&gt;
** `ls /usr/share/binfmts/FEX*` should return files&lt;br /&gt;
** `ls /var/lib/binfmts/FEX*` should return files&lt;br /&gt;
** `/proc/sys/fs/binfmt_misc/status` should exist&lt;br /&gt;
*** If it doesn't exist then make sure your kernel has `CONFIG_BINFMT_MISC=y`&lt;br /&gt;
*** If it still doesn't exist then make sure systemd isn't disabling it `systemctl enable binfmt-support`&lt;br /&gt;
&lt;br /&gt;
==== DESTDIR quirks ====&lt;br /&gt;
* When using DESTDIR, make sure the path is absolute instead of relative&lt;br /&gt;
** FEX's thunks use subprojects because it needs to cross-compile&lt;br /&gt;
** If DESTDIR is relative then the install paths of the subprojects go to the wrong location&lt;br /&gt;
** Using $(pwd)/install works well&lt;br /&gt;
&lt;br /&gt;
== Runtime Configuration ==&lt;br /&gt;
FEXConfig is the application to use for runtime configuration setup.&lt;br /&gt;
&lt;br /&gt;
CTLR+S saves the configuration.&lt;br /&gt;
&lt;br /&gt;
=== Things to ensure to set ===&lt;br /&gt;
On AArch64 host, a rootfs path is mandatory, while it is optional on x86-64 host&lt;br /&gt;
&lt;br /&gt;
* Core: JIT&lt;br /&gt;
* RootFS&lt;br /&gt;
* Silent Logging (Useful to get FEX information spam out of the way)&lt;br /&gt;
* Block Size (500 is a good default. Optimization passes may break things though)&lt;br /&gt;
&lt;br /&gt;
More Details at: Follow the instructions [[Development:Configuring_FEX|here]]&lt;br /&gt;
&lt;br /&gt;
== RootFS generation ==&lt;br /&gt;
AArch64 hosts require a rootfs for running applications. FEX provides various x86 images that can be installed through [[Development:Setting_up_RootFS#Quick_Setup_with_FEXRootFSFetcher|FEXRootFSFetcher]]&lt;br /&gt;
&lt;br /&gt;
For more detailed instructions see [[Development:Setting_up_RootFS]]&lt;br /&gt;
&lt;br /&gt;
== Installing Thunks ==&lt;br /&gt;
Only if you want&lt;br /&gt;
&lt;br /&gt;
Follow the instructions [[Development:Setting_up_Thunks|here]]&lt;br /&gt;
&lt;br /&gt;
Additional details here: https://github.com/FEX-Emu/FEX/blob/main/ThunkLibs/README.md&lt;br /&gt;
&lt;br /&gt;
== Binaries ==&lt;br /&gt;
* FEXLoader&lt;br /&gt;
** This is useful for development purposes but is generally recommended against using.&lt;br /&gt;
** Allows passing arguments to FEX for configuration purposes, which can break under some execve situations&lt;br /&gt;
* FEXInterpreter&lt;br /&gt;
** This is a hardlink to FEXLoader which refuses to treat arguments as configuration options&lt;br /&gt;
** Is recommended to use over FEXLoader; Using FEXConfig to set configuration&lt;br /&gt;
** Requires being a hardlink or executable copy, execve logic sees through a softlink&lt;br /&gt;
** Is the executable used for binfmt_misc for interpreters&lt;br /&gt;
* FEXConfig&lt;br /&gt;
** Used for setting configuration options from a GUI&lt;br /&gt;
** Written using Dear ImGui&lt;br /&gt;
** Can load/save global configuration and application configuration files&lt;br /&gt;
** Application configuration files are compared against the executable filename&lt;br /&gt;
* FEXBash&lt;br /&gt;
** Can be useful for starting a bash instance that is running under emulation&lt;br /&gt;
** It's not a chroot! Don't use sudo inside of this environment!&lt;br /&gt;
* FEXMountDaemon&lt;br /&gt;
** This is a mount daemon that will run in the background when you are using a squashfs based rootfs&lt;br /&gt;
** Usually one one instance open at any given moment&lt;br /&gt;
** It usually closes when the FEXInterpreter exits, but not always. See the problems section in setting up a rootfs&lt;br /&gt;
*** Has a ten second timeout window in case a another instance of FEX opens and uses it.&lt;br /&gt;
&lt;br /&gt;
=== Debug binaries ===&lt;br /&gt;
* TestHarnessRunner&lt;br /&gt;
** Used for running FEX's ASM unit tests&lt;br /&gt;
** Runs some binary in a host x86_64 host environment or FEX and checks results&lt;br /&gt;
** Useful for quickly creating ASM based unit tests&lt;br /&gt;
* IRLoader&lt;br /&gt;
** Used for running FEX's IR based unit tests&lt;br /&gt;
** Only runs through FEX and checks the results&lt;br /&gt;
** Minimal number of tests&lt;br /&gt;
* UnitTestGenerator&lt;br /&gt;
** This is supposed to be an x86-64 instruction generator&lt;br /&gt;
** Has an understanding of x86-64 instruction encoding format&lt;br /&gt;
** Generates hundreds of thousands of instructions&lt;br /&gt;
** Used to be used with a lockstep runner to ensure correct behaviour&lt;br /&gt;
** Largely unsupported, avoiding undefined behaviour is difficult and FEX doesn't need to match undefined behaviour&lt;br /&gt;
** Lockstep hostrunner wasn't ever made to be bug free, hard to support&lt;br /&gt;
** Doesn't ensure correct behaviour on AArch64 device&lt;/div&gt;</summary>
		<author><name>D</name></author>
	</entry>
	<entry>
		<id>https://wiki.fex-emu.com/index.php?title=Development:Setting_up_FEX&amp;diff=1109</id>
		<title>Development:Setting up FEX</title>
		<link rel="alternate" type="text/html" href="https://wiki.fex-emu.com/index.php?title=Development:Setting_up_FEX&amp;diff=1109"/>
		<updated>2024-09-24T03:26:50Z</updated>

		<summary type="html">&lt;p&gt;D: Update build dependencies to add Qt5.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]]&lt;br /&gt;
== Build dependencies ==&lt;br /&gt;
=== Debian/Ubuntu dependencies ===&lt;br /&gt;
* git&lt;br /&gt;
* cmake&lt;br /&gt;
* ninja-build&lt;br /&gt;
* pkgconf&lt;br /&gt;
* ccache (Recommended if you're rebuilding constantly)&lt;br /&gt;
* clang&lt;br /&gt;
* llvm&lt;br /&gt;
* lld (For ThinLTO)&lt;br /&gt;
* binfmt-support (For AArch64 binfmt_misc support)&lt;br /&gt;
* qtdeclarative5-dev (For GUI)&lt;br /&gt;
* qml-module-qtquick-controls (For GUI)&lt;br /&gt;
* qml-module-qtquick-controls2 (For GUI)&lt;br /&gt;
* qml-module-qtquick-dialogs (For GUI)&lt;br /&gt;
* libssl-dev&lt;br /&gt;
* python-setuptools (For build scripts)&lt;br /&gt;
* g++-x86-64-linux-gnu (For building thunks)&lt;br /&gt;
* libgcc-XX-dev-i386-cross (For building thunks, version should match your g++-x86-64-linux-gnu package)&lt;br /&gt;
* libgcc-XX-dev-amd64-cross (For building thunks, version should match your g++-x86-64-linux-gnu package)&lt;br /&gt;
* nasm (only if building tests)&lt;br /&gt;
* python3-clang (for struct verifier)&lt;br /&gt;
* libstdc++-10-dev-i386-cross (for struct verifier)&lt;br /&gt;
* libstdc++-10-dev-amd64-cross (for struct verifier)&lt;br /&gt;
* libstdc++-10-dev-arm64-cross (for struct verifier)&lt;br /&gt;
* squashfs-tools (For squashfs rootfs support)&lt;br /&gt;
* squashfuse (For mounting the squashfs)&lt;br /&gt;
* libc-bin or glibc-tools (For unittests, needs catchsegv from this)&lt;br /&gt;
* libc6-dev-i386-amd64-cross (For FEXLinuxTests)&lt;br /&gt;
* lib32stdc++-XX-dev-amd64-cross (For FEXLinuxTests, version should match your g++-x86-64-linux-gnu package)&lt;br /&gt;
* qtdeclarative5-dev&lt;br /&gt;
* qml-module-qtquick-controls&lt;br /&gt;
* qml-module-qtquick-controls2&lt;br /&gt;
* qml-module-qtquick-dialogs&lt;br /&gt;
&lt;br /&gt;
=== Gentoo dependencies ===&lt;br /&gt;
* dev-vcs/git&lt;br /&gt;
* cmake&lt;br /&gt;
* ninja&lt;br /&gt;
* ccache&lt;br /&gt;
* clang&lt;br /&gt;
* lld&lt;br /&gt;
* nasm&lt;br /&gt;
&lt;br /&gt;
'''Use gubbins'''&lt;br /&gt;
* &amp;gt;=media-libs/libglvnd-1.3.4 X&lt;br /&gt;
&lt;br /&gt;
=== Fedora dependencies ===&lt;br /&gt;
* git&lt;br /&gt;
* cmake&lt;br /&gt;
* ninja-build&lt;br /&gt;
* pkg-config&lt;br /&gt;
* ccache&lt;br /&gt;
* clang&lt;br /&gt;
* lld&lt;br /&gt;
* llvm&lt;br /&gt;
* llvm-devel&lt;br /&gt;
* openssl-devel&lt;br /&gt;
* nasm&lt;br /&gt;
* python3-clang&lt;br /&gt;
* python3-setuptools&lt;br /&gt;
* squashfs-tools&lt;br /&gt;
* squashfuse&lt;br /&gt;
* erofs-fuse&lt;br /&gt;
* erofs-utils&lt;br /&gt;
&lt;br /&gt;
== Build Configuration ==&lt;br /&gt;
* Ensure release mode is enabled&lt;br /&gt;
* Disable test building&lt;br /&gt;
* Enable LTO in a release build&lt;br /&gt;
* Enable LLD to make LTO builds faster&lt;br /&gt;
&lt;br /&gt;
  git clone --recurse-submodules https://github.com/FEX-Emu/FEX.git&lt;br /&gt;
  cd FEX&lt;br /&gt;
  mkdir Build&lt;br /&gt;
  cd Build&lt;br /&gt;
  CC=clang CXX=clang++ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_LINKER=lld -DENABLE_LTO=True -DBUILD_TESTS=False -DENABLE_ASSERTIONS=False -G Ninja ..&lt;br /&gt;
  ninja&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
  sudo ninja install&lt;br /&gt;
&lt;br /&gt;
You can install a binfmt_misc handler for both 32bit and 64bit x86 execution directly from the environment.&lt;br /&gt;
If you already have box86's 32bit binfmt_misc handler installed then make sure to uninstall their's first.&lt;br /&gt;
Make sure to have run install prior to this, otherwise binfmt_misc will install an old handler even if the executable has been updated.&lt;br /&gt;
&lt;br /&gt;
  sudo ninja binfmt_misc_32&lt;br /&gt;
  sudo ninja binfmt_misc_64&lt;br /&gt;
&lt;br /&gt;
=== Quirks ===&lt;br /&gt;
&lt;br /&gt;
==== binfmt_misc problems ====&lt;br /&gt;
* Double check that binfmt_misc has worked&lt;br /&gt;
** `ls /usr/share/binfmts/FEX*` should return files&lt;br /&gt;
** `ls /var/lib/binfmts/FEX*` should return files&lt;br /&gt;
** `/proc/sys/fs/binfmt_misc/status` should exist&lt;br /&gt;
*** If it doesn't exist then make sure your kernel has `CONFIG_BINFMT_MISC=y`&lt;br /&gt;
*** If it still doesn't exist then make sure systemd isn't disabling it `systemctl enable binfmt-support`&lt;br /&gt;
&lt;br /&gt;
==== DESTDIR quirks ====&lt;br /&gt;
* When using DESTDIR, make sure the path is absolute instead of relative&lt;br /&gt;
** FEX's thunks use subprojects because it needs to cross-compile&lt;br /&gt;
** If DESTDIR is relative then the install paths of the subprojects go to the wrong location&lt;br /&gt;
** Using $(pwd)/install works well&lt;br /&gt;
&lt;br /&gt;
== Runtime Configuration ==&lt;br /&gt;
FEXConfig is the application to use for runtime configuration setup.&lt;br /&gt;
&lt;br /&gt;
CTLR+S saves the configuration.&lt;br /&gt;
&lt;br /&gt;
=== Things to ensure to set ===&lt;br /&gt;
On AArch64 host, a rootfs path is mandatory, while it is optional on x86-64 host&lt;br /&gt;
&lt;br /&gt;
* Core: JIT&lt;br /&gt;
* RootFS&lt;br /&gt;
* Silent Logging (Useful to get FEX information spam out of the way)&lt;br /&gt;
* Block Size (500 is a good default. Optimization passes may break things though)&lt;br /&gt;
&lt;br /&gt;
More Details at: Follow the instructions [[Development:Configuring_FEX|here]]&lt;br /&gt;
&lt;br /&gt;
== RootFS generation ==&lt;br /&gt;
AArch64 hosts require a rootfs for running applications. FEX provides various x86 images that can be installed through [[Development:Setting_up_RootFS#Quick_Setup_with_FEXRootFSFetcher|FEXRootFSFetcher]]&lt;br /&gt;
&lt;br /&gt;
For more detailed instructions see [[Development:Setting_up_RootFS]]&lt;br /&gt;
&lt;br /&gt;
== Installing Thunks ==&lt;br /&gt;
Only if you want&lt;br /&gt;
&lt;br /&gt;
Follow the instructions [[Development:Setting_up_Thunks|here]]&lt;br /&gt;
&lt;br /&gt;
Additional details here: https://github.com/FEX-Emu/FEX/blob/main/ThunkLibs/README.md&lt;br /&gt;
&lt;br /&gt;
== Binaries ==&lt;br /&gt;
* FEXLoader&lt;br /&gt;
** This is useful for development purposes but is generally recommended against using.&lt;br /&gt;
** Allows passing arguments to FEX for configuration purposes, which can break under some execve situations&lt;br /&gt;
* FEXInterpreter&lt;br /&gt;
** This is a hardlink to FEXLoader which refuses to treat arguments as configuration options&lt;br /&gt;
** Is recommended to use over FEXLoader; Using FEXConfig to set configuration&lt;br /&gt;
** Requires being a hardlink or executable copy, execve logic sees through a softlink&lt;br /&gt;
** Is the executable used for binfmt_misc for interpreters&lt;br /&gt;
* FEXConfig&lt;br /&gt;
** Used for setting configuration options from a GUI&lt;br /&gt;
** Written using Dear ImGui&lt;br /&gt;
** Can load/save global configuration and application configuration files&lt;br /&gt;
** Application configuration files are compared against the executable filename&lt;br /&gt;
* FEXBash&lt;br /&gt;
** Can be useful for starting a bash instance that is running under emulation&lt;br /&gt;
** It's not a chroot! Don't use sudo inside of this environment!&lt;br /&gt;
* FEXMountDaemon&lt;br /&gt;
** This is a mount daemon that will run in the background when you are using a squashfs based rootfs&lt;br /&gt;
** Usually one one instance open at any given moment&lt;br /&gt;
** It usually closes when the FEXInterpreter exits, but not always. See the problems section in setting up a rootfs&lt;br /&gt;
*** Has a ten second timeout window in case a another instance of FEX opens and uses it.&lt;br /&gt;
&lt;br /&gt;
=== Debug binaries ===&lt;br /&gt;
* TestHarnessRunner&lt;br /&gt;
** Used for running FEX's ASM unit tests&lt;br /&gt;
** Runs some binary in a host x86_64 host environment or FEX and checks results&lt;br /&gt;
** Useful for quickly creating ASM based unit tests&lt;br /&gt;
* IRLoader&lt;br /&gt;
** Used for running FEX's IR based unit tests&lt;br /&gt;
** Only runs through FEX and checks the results&lt;br /&gt;
** Minimal number of tests&lt;br /&gt;
* UnitTestGenerator&lt;br /&gt;
** This is supposed to be an x86-64 instruction generator&lt;br /&gt;
** Has an understanding of x86-64 instruction encoding format&lt;br /&gt;
** Generates hundreds of thousands of instructions&lt;br /&gt;
** Used to be used with a lockstep runner to ensure correct behaviour&lt;br /&gt;
** Largely unsupported, avoiding undefined behaviour is difficult and FEX doesn't need to match undefined behaviour&lt;br /&gt;
** Lockstep hostrunner wasn't ever made to be bug free, hard to support&lt;br /&gt;
** Doesn't ensure correct behaviour on AArch64 device&lt;/div&gt;</summary>
		<author><name>D</name></author>
	</entry>
</feed>