void-packages/srcpkgs/mold/patches/fix-arm-yield.patch
2024-05-14 15:16:37 +00:00

18 lines
751 B
Diff

Only use yield on ARM architectures that support it. Will be in next release. Taken from:
https://github.com/rui314/mold/commit/f0f61cc7ad482672a73d3bb4778430c65f01e237
https://github.com/rui314/mold/commit/4510f4af81e65544fcd02826f253d3dc9e7fae9e
diff --git a/common/common.h b/common/common.h
index c9820877789..a9a52d6c5fb 100644
--- a/common/common.h
+++ b/common/common.h
@@ -526,7 +526,9 @@ inline bool remove_prefix(std::string_view &s, std::string_view prefix) {
static inline void pause() {
#if defined(__x86_64__)
asm volatile("pause");
-#elif defined(__arm__) || defined(__aarch64__)
+#elif defined(__aarch64__)
+ asm volatile("yield");
+#elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_8A__)
asm volatile("yield");
#endif
}