Skip to content

dolphin-arm64: Use the arm64 msvc mkspec#23

Open
JoshuaVandaele wants to merge 1 commit into
dolphin-emu:masterfrom
JoshuaVandaele:master
Open

dolphin-arm64: Use the arm64 msvc mkspec#23
JoshuaVandaele wants to merge 1 commit into
dolphin-emu:masterfrom
JoshuaVandaele:master

Conversation

@JoshuaVandaele
Copy link
Copy Markdown

@JoshuaVandaele JoshuaVandaele commented Nov 20, 2025

Some files are missing for Qt6 to cross-compile from x64 to arm64 using CMake.
The only modified file is dolphin-arm64.yml, the rest of the diff is me recompiling.
Part of dolphin-emu/dolphin#14475
The qsc examples have been updated here dolphin-emu/qsc#2

@JosJuice
Copy link
Copy Markdown
Member

What's going on with the line endings in the headers? Is that LF -> CRLF or CRLF -> LF?

@JoshuaVandaele
Copy link
Copy Markdown
Author

JoshuaVandaele commented Nov 22, 2025

What's going on with the line endings in the headers? Is that LF -> CRLF or CRLF -> LF?

Apparently carriage returns were added. Those files were pulled by qsc, so I'm not sure if I should change that?

edit: For consistency sake, I've matched the line endings

@JosJuice
Copy link
Copy Markdown
Member

I guess whoever committed this last might have had automatic line ending conversion enabled in git? I don't know which line ending we would prefer here, though.

@Dentomologist
Copy link
Copy Markdown

I'm not sure if thedolphin-arm64.yml in qsc is used to generate this one or if it's purely an example, but either way it'd be good to update that one too.

JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Dec 10, 2025
This introduces a CMakePresets file for both Linux and Windows that replace the old CMakeSettings.
It adds presets for **Debug** and **Release** profiles for both **x64** and **ARM64** architectures, and can be used using Visual Studio's built-in CMakePresets support, or Visual Studio Code's CMake Tools extension.

They can also be used from the command line, like so:

x64/Linux:
Configure: `cmake --preset unix-release-x64`
Build: `cmake --build --preset unix-build-release-x64`
ARM64/Windows:
Configure: `cmake --preset windows-release-arm64`
Build: `cmake --build --preset windows-build-release-arm64`

**Cross-compiling**

On Windows, the Visual Studio generator automatically takes care of selecting the cross-compiler if required.

On Linux, the Ninja generator is used. To cross-compile you need to install a cross-compiler and (optionally) a sysroot of the target system.
Here is an example to compile from x64 to ARM64 with a sysroot:

- `cmake --preset unix-release-arm64 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_SYSROOT=/opt/sysroots/aarch64-linux-gnu`
- `cmake --build --preset unix-build-release-arm64`

You will need a sysroot to link against Qt, since we do not vendor it in on platforms other than Windows.

A `CMakeUserPresets.json` file may be created locally at the root of the project to further customize your presets.
For example, here are the user presets I used to test this PR on Arch Linux with a generic Arch Linux ARM sysroot:

```json
{
  "version": 9,
  "include": ["CMakePresets.json"],
  "configurePresets": [
    {
      "name": "gcc-debug-arm64",
      "inherits": "unix-debug-arm64",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "aarch64-linux-gnu-gcc",
        "CMAKE_CXX_COMPILER": "aarch64-linux-gnu-g++",
        "CMAKE_EXE_LINKER_FLAGS": "-L/opt/sysroots/ArchLinuxARM/lib",
        "CMAKE_SYSROOT": "/opt/sysroots/ArchLinuxARM"
      }
    },
    {
      "name": "clang-debug-arm64",
      "inherits": "unix-debug-arm64",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "clang",
        "CMAKE_CXX_COMPILER": "clang++",
        "CMAKE_C_FLAGS": "-target aarch64-linux-gnu",
        "CMAKE_CXX_FLAGS": "-target aarch64-linux-gnu",
        "CMAKE_SYSROOT": "/opt/sysroots/ArchLinuxARM"
      }
    }
  ],
  "buildPresets": [
    {
      "name": "gcc-build-debug-arm64",
      "configurePreset": "gcc-debug-arm64"
    },
    {
      "name": "clang-build-debug-arm64",
      "configurePreset": "clang-debug-arm64"
    }
  ]
}

```

This allows the `clang-debug-arm64` and `gcc-debug-arm64` configure presets, as well as the `clang-build-debug-arm64` and `gcc-build-debug-arm64` build presets to work.

This should also make it trival to cross-compile from Linux to FreeBSD and vice-versa, however this is untested.

**Unified Build Layout**

This also unites the Windows and Linux CMake builds **which is a breaking change!**

- They now both share the same output directories under `build/<ARCHITECTURE>`
- Linux builds now also have the `Sys` and `Languages` folder automatically copied over
- Binaries are now always "relocatable", removing the need for the LINUX_LOCAL_DEV option to exist

---

Depends on:

- dolphin-emu#14176
- dolphin-emu#14173
- dolphin-emu/ext-win-qt#23
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Dec 10, 2025
This introduces a CMakePresets file for both Linux and Windows that replace the old CMakeSettings.
It adds presets for **Debug** and **Release** profiles for both **x64** and **ARM64** architectures, and can be used using Visual Studio's built-in CMakePresets support, or Visual Studio Code's CMake Tools extension.

They can also be used from the command line, like so:

x64/Linux:
Configure: `cmake --preset unix-release-x64`
Build: `cmake --build --preset unix-build-release-x64`
ARM64/Windows:
Configure: `cmake --preset windows-release-arm64`
Build: `cmake --build --preset windows-build-release-arm64`

**Cross-compiling**

On Windows, the Visual Studio generator automatically takes care of selecting the cross-compiler if required.

On Linux, the Ninja generator is used. To cross-compile you need to install a cross-compiler and (optionally) a sysroot of the target system.
Here is an example to compile from x64 to ARM64 with a sysroot:

- `cmake --preset unix-release-arm64 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_SYSROOT=/opt/sysroots/aarch64-linux-gnu`
- `cmake --build --preset unix-build-release-arm64`

You will need a sysroot to link against Qt, since we do not vendor it in on platforms other than Windows.

A `CMakeUserPresets.json` file may be created locally at the root of the project to further customize your presets.
For example, here are the user presets I used to test this PR on Arch Linux with a generic Arch Linux ARM sysroot:

```json
{
  "version": 9,
  "include": ["CMakePresets.json"],
  "configurePresets": [
    {
      "name": "gcc-debug-arm64",
      "inherits": "unix-debug-arm64",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "aarch64-linux-gnu-gcc",
        "CMAKE_CXX_COMPILER": "aarch64-linux-gnu-g++",
        "CMAKE_EXE_LINKER_FLAGS": "-L/opt/sysroots/ArchLinuxARM/lib",
        "CMAKE_SYSROOT": "/opt/sysroots/ArchLinuxARM"
      }
    },
    {
      "name": "clang-debug-arm64",
      "inherits": "unix-debug-arm64",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "clang",
        "CMAKE_CXX_COMPILER": "clang++",
        "CMAKE_C_FLAGS": "-target aarch64-linux-gnu",
        "CMAKE_CXX_FLAGS": "-target aarch64-linux-gnu",
        "CMAKE_SYSROOT": "/opt/sysroots/ArchLinuxARM"
      }
    }
  ],
  "buildPresets": [
    {
      "name": "gcc-build-debug-arm64",
      "configurePreset": "gcc-debug-arm64"
    },
    {
      "name": "clang-build-debug-arm64",
      "configurePreset": "clang-debug-arm64"
    }
  ]
}

```

This allows the `clang-debug-arm64` and `gcc-debug-arm64` configure presets, as well as the `clang-build-debug-arm64` and `gcc-build-debug-arm64` build presets to work.

This should also make it trival to cross-compile from Linux to FreeBSD and vice-versa, however this is untested.

**Unified Build Layout**

This also unites the Windows and Linux CMake builds **which is a breaking change!**

- They now both share the same output directories under `build/<ARCHITECTURE>`
- Linux builds now also have the `Sys` and `Languages` folder automatically copied over
- Binaries are now always "relocatable", removing the need for the LINUX_LOCAL_DEV option to exist

---

Depends on:

- dolphin-emu#14176
- dolphin-emu#14173
- dolphin-emu/ext-win-qt#23
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Dec 10, 2025
This introduces a CMakePresets file for both Linux and Windows that replace the old CMakeSettings.
It adds presets for **Debug** and **Release** profiles for both **x64** and **ARM64** architectures, and can be used using Visual Studio's built-in CMakePresets support, or Visual Studio Code's CMake Tools extension.

They can also be used from the command line, like so:

x64/Linux:
Configure: `cmake --preset unix-release-x64`
Build: `cmake --build --preset unix-build-release-x64`
ARM64/Windows:
Configure: `cmake --preset windows-release-arm64`
Build: `cmake --build --preset windows-build-release-arm64`

**Cross-compiling**

On Windows, the Visual Studio generator automatically takes care of selecting the cross-compiler if required.

On Linux, the Ninja generator is used. To cross-compile you need to install a cross-compiler and (optionally) a sysroot of the target system.
Here is an example to compile from x64 to ARM64 with a sysroot:

- `cmake --preset unix-release-arm64 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_SYSROOT=/opt/sysroots/aarch64-linux-gnu`
- `cmake --build --preset unix-build-release-arm64`

You will need a sysroot to link against Qt, since we do not vendor it in on platforms other than Windows.

A `CMakeUserPresets.json` file may be created locally at the root of the project to further customize your presets.
For example, here are the user presets I used to test this PR on Arch Linux with a generic Arch Linux ARM sysroot:

```json
{
  "version": 9,
  "include": ["CMakePresets.json"],
  "configurePresets": [
    {
      "name": "gcc-debug-arm64",
      "inherits": "unix-debug-arm64",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "aarch64-linux-gnu-gcc",
        "CMAKE_CXX_COMPILER": "aarch64-linux-gnu-g++",
        "CMAKE_EXE_LINKER_FLAGS": "-L/opt/sysroots/ArchLinuxARM/lib",
        "CMAKE_SYSROOT": "/opt/sysroots/ArchLinuxARM"
      }
    },
    {
      "name": "clang-debug-arm64",
      "inherits": "unix-debug-arm64",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "clang",
        "CMAKE_CXX_COMPILER": "clang++",
        "CMAKE_C_FLAGS": "-target aarch64-linux-gnu",
        "CMAKE_CXX_FLAGS": "-target aarch64-linux-gnu",
        "CMAKE_SYSROOT": "/opt/sysroots/ArchLinuxARM"
      }
    }
  ],
  "buildPresets": [
    {
      "name": "gcc-build-debug-arm64",
      "configurePreset": "gcc-debug-arm64"
    },
    {
      "name": "clang-build-debug-arm64",
      "configurePreset": "clang-debug-arm64"
    }
  ]
}

```

This allows the `clang-debug-arm64` and `gcc-debug-arm64` configure presets, as well as the `clang-build-debug-arm64` and `gcc-build-debug-arm64` build presets to work.

This should also make it trival to cross-compile from Linux to FreeBSD and vice-versa, however this is untested.

**Unified Build Layout**

This also unites the Windows and Linux CMake builds **which is a breaking change!**

- They now both share the same output directories under `build/<ARCHITECTURE>`
- Linux builds now also have the `Sys` and `Languages` folder automatically copied over
- Binaries are now always "relocatable", removing the need for the LINUX_LOCAL_DEV option to exist

---

Depends on:

- dolphin-emu#14176
- dolphin-emu#14173
- dolphin-emu/ext-win-qt#23
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Dec 11, 2025
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Dec 11, 2025
@cscd98
Copy link
Copy Markdown

cscd98 commented Dec 11, 2025

On a related note, there does seem to be an issue with cross compiling as the QT version provided with ming (as of current it is 6.10.1.0) is much newer than the code we have here which is 6.5.1, as it complains about some missing symbols, I haven't looked into this in detail yet as I simply copied over the newer DLLS to resolve the issue so I could run my ming compiled Dolphin binary.

JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Dec 22, 2025
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Dec 30, 2025
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Dec 31, 2025
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Jan 4, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Jan 4, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Jan 7, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Jan 10, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Jan 12, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Jan 18, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Jan 26, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Jan 26, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Jan 29, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Apr 2, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request Apr 12, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request May 1, 2026
JoshuaVandaele added a commit to JoshuaVandaele/dolphin that referenced this pull request May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants