Skip to content

Commit

Permalink
fex: Add FEX as submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreRH committed Jul 9, 2023
1 parent b961987 commit d14154d
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 20 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ubuntu-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
67 changes: 50 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:

Expand Down
1 change: 1 addition & 0 deletions fex
Submodule fex added at cef510

0 comments on commit d14154d

Please sign in to comment.