From d14154d6aaacea5b52ef40d1235964fd41731f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Zwing?= Date: Sun, 9 Jul 2023 12:39:56 +0200 Subject: [PATCH] fex: Add FEX as submodule --- .github/workflows/ubuntu-x86_64.yml | 4 +- .gitmodules | 4 ++ README.md | 67 +++++++++++++++++++++-------- fex | 1 + 4 files changed, 56 insertions(+), 20 deletions(-) create mode 160000 fex diff --git a/.github/workflows/ubuntu-x86_64.yml b/.github/workflows/ubuntu-x86_64.yml index 91fcfec6..5dbfa93f 100644 --- a/.github/workflows/ubuntu-x86_64.yml +++ b/.github/workflows/ubuntu-x86_64.yml @@ -29,12 +29,10 @@ jobs: mkdir -p wine/build cd wine/build ../configure --enable-win64 --with-mingw --enable-archs=i386,x86_64,arm --without-x --without-fontconfig - make -j$(nproc) -C dlls/gdi32 + make -j$(nproc) -C dlls/fexcore make -j$(nproc) -C dlls/msacm32 make -j$(nproc) -C dlls/ntdll - make -j$(nproc) -C dlls/win32u make -j$(nproc) -C dlls/wow64 - make -j$(nproc) -C dlls/wow64win make -j$(nproc) -C dlls/wowarmhw make -j$(nproc) -C dlls/xtajit make -j$(nproc) -C programs/wineboot diff --git a/.gitmodules b/.gitmodules index 736a60fb..17ebcf6c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,3 +6,7 @@ path = qemu url = https://github.com/AndreRH/qemu.git branch = wow +[submodule "fex"] + path = fex + url = https://github.com/AndreRH/FEX.git + branch = wow diff --git a/README.md b/README.md index bce1403e..d9d06dae 100644 --- a/README.md +++ b/README.md @@ -19,63 +19,89 @@ While the overall stability was improved, expect crashes. Emulator integrations: - [QEMU](https://gitlab.com/qemu-project/qemu): Mostly done, though needs fixes for stability and CriticalSection -- [FEX](https://github.com/FEX-Emu/FEX): WIP 80%, not part of this repository yet, but available as [preview](https://www.patreon.com/posts/previews-82611984) :point_left: +- [FEX](https://github.com/FEX-Emu/FEX): Mostly done, though needs fixes for invalidation and exceptions - [Blink](https://github.com/jart/blink): started, not part of this repository yet - [hex-emu](https://gitlab.com/hex-emu/hex-emu): not started yet - [Box32](https://news.itsfoss.com/box86-creator-ptitseb/): doesn't exist yet (Box32 will translate i386 to ARM64. It's what we'll need, because with WoW64 we only can emulate 32-bit architectures, but require the emulator in our 64-bit address space) -### 3) How to build +### 3) Preview +A paid [preview](https://www.patreon.com/posts/previews-82611984) is available with following features coming soon: + +- Wine 8.12 based +- Updated FEX + +### 4) How to build First make sure you have the submodules set up: ```bash $ git submodule update --init ``` -#### 3.1) QEMU +#### 4.1) QEMU To build QEMU as a library you need: - The dependencies to build QEMU (in particular glib) - About 1GB of disk space -Build it like: +Build it like (from the Hangover repository): ```bash -$ mkdir build -$ cd build +$ mkdir -p qemu/build +$ cd qemu/build $ ../configure --target-list=arm-linux-user,i386-linux-user -$ make +$ make -j$(nproc) ``` In case the compiler complains about something in linux-user/ioctls.h remove the corresponding line and run make again. Place resulting libraries (build/libqemu-arm.so and/or build/libqemu-i386.so) in /opt (default) or set HOLIB to the full path of the resulting library. -#### 3.2) Wine +#### 4.2) FEX +To build FEXCore from FEX you need: + +- The dependencies to [build](https://wiki.fex-emu.com/index.php/Development:Setting_up_FEX) FEX +- About 1.5GB of disk space + +Build it like (from the Hangover repository): +```bash +$ mkdir -p fex/build +$ cd fex/build +$ CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_LTO=True -DENABLE_LLD=True -DBUILD_TESTS=False -DENABLE_ASSERTIONS=False .. +$ make -j$(nproc) FEXCore_shared +``` + +On x86-64 you might need to add "-DENABLE_X86_HOST_DEBUG=True" to the cmake call. + +Place resulting library (Build/External/FEXCore/Source/libFEXCore.so) in /opt (default) or set HOLIB to the full path of the resulting library. + +#### 4.3) Wine To build Hangover Wine you need: - The dependencies to [build](https://wiki.winehq.org/Building_Wine#Satisfying_Build_Dependencies) a 64 bit Wine - [llvm-mingw](https://github.com/mstorsjo/llvm-mingw) for PE cross-compilation (downlaod & unpack a release, but don't use the .zip files, they are for Windows) - About 5GB of disk space -on x86-64: +on x86-64 (from the Hangover repository): ```bash $ mkdir -p wine/build $ cd wine/build $ export PATH=/path/to/llvm-mingw/bin:$PATH $ ../configure --enable-win64 --disable-tests --with-mingw --enable-archs=i386,x86_64,arm $ make -j$(nproc) +$ sudo make install ``` -on ARM64: +on ARM64 (from the Hangover repository): ```bash $ mkdir -p wine/build $ cd wine/build $ export PATH=/path/to/llvm-mingw/bin:$PATH $ ../configure --disable-tests --with-mingw --enable-archs=i386,aarch64,arm $ make -j$(nproc) +$ sudo make install ``` -### 4) Running +### 5) Running You can add the following environment variables: * HODLL to select the emulator dll: @@ -86,22 +112,29 @@ You can add the following environment variables: * HOLIB to set full path of the library, e.g. HOLIB=/path/to/libqemu-i386.so * QEMU_LOG to set QEMU log channels, find some options [here.](https://github.com/AndreRH/qemu/blob/v5.2.0/util/log.c#L297) -#### 4.1) QEMU +#### 5.1) QEMU Until the critical section issue is solved it is highly recomended to limit execution to 1 core with "taskset -c 1" for Qemu emulation: ```bash -$ HODLL=xtajit.dll taskset -c 1 ./wine your_x86_application.exe -$ HODLL=wowarmhw.dll taskset -c 1 ./wine your_arm_application.exe +$ HODLL=xtajit.dll taskset -c 1 wine your_x86_application.exe +$ HODLL=wowarmhw.dll taskset -c 1 wine your_arm_application.exe +``` + +#### 5.2) FEX +fexcore.dll currently is the default for i386 emulation, so it's simply: + +```bash +$ wine your_x86_application.exe ``` -### 5) Todo +### 6) Todo * Get more applications running * QMEU: Investigate CriticalSection issues (just timing?) -* Integrate other emulators than QEMU +* FEX: Fix invalidation and exceptions (maybe as PE module) -### 6) Financial Contributors +### 7) Financial Contributors Become a financial contributor and help me sustain this project: diff --git a/fex b/fex new file mode 160000 index 00000000..cef51011 --- /dev/null +++ b/fex @@ -0,0 +1 @@ +Subproject commit cef510116f2861cd850856202799d0bae0e82469