nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1From 778cb2ed0d56614fd06d2129398799e46ff51720 Mon Sep 17 00:00:00 2001
2From: Marcin Serwin <marcin@serwin.dev>
3Date: Mon, 3 Nov 2025 22:25:10 +0100
4Subject: [PATCH] Add aarch64-linux support
5
6Signed-off-by: Marcin Serwin <marcin@serwin.dev>
7---
8 src/Etterna/Models/Misc/StageStats.cpp | 23 +++++++++++++++++++++--
9 1 file changed, 21 insertions(+), 2 deletions(-)
10
11diff --git a/src/Etterna/Models/Misc/StageStats.cpp b/src/Etterna/Models/Misc/StageStats.cpp
12index 0c70cf25ae..671717505d 100644
13--- a/src/Etterna/Models/Misc/StageStats.cpp
14+++ b/src/Etterna/Models/Misc/StageStats.cpp
15@@ -19,8 +19,9 @@
16 #include "Etterna/Singletons/GameManager.h"
17 #include "Etterna/Models/NoteData/NoteDataUtil.h"
18
19-#if !( defined(_WIN32) || defined(__APPLE__))
20- #include <cpuid.h> //We only use cpuid.h on Linux :)
21+#if !( defined(_WIN32) || defined(__APPLE__)) \
22+ && (defined(__x86_64__) || defined(__i386__))
23+ #include <cpuid.h> //We only use cpuid.h on x86 Linux :)
24 #endif
25
26 #ifdef _WIN32
27@@ -236,6 +237,8 @@ getCpuHash()
28
29 #else // !DARWIN
30
31+#if defined(__x86_64__) || defined(__i386__)
32+
33 uint16_t
34 getCpuHash()
35 {
36@@ -248,6 +251,22 @@ getCpuHash()
37
38 return hash;
39 }
40+
41+#else // !x86
42+
43+uint16_t
44+getCpuHash()
45+{
46+ // https://www.kernel.org/doc/html/v6.17/arch/arm64/cpu-feature-registers.html
47+ uint64_t midr = 0;
48+ asm("mrs %0, MIDR_EL1" : "=r"(midr));
49+
50+ // Only leave implementer, variant, and architecture bits.
51+ // See https://developer.arm.com/documentation/ddi0601/2025-09/AArch64-Registers/MIDR-EL1--Main-ID-Register?lang=en
52+ return midr >> 16;
53+}
54+
55+#endif // !x86
56 #endif // !DARWIN
57
58 std::string
59--
602.51.0
61