projects/guix·blob javascript-team · refs

62 lines · 2.2 KiB

1Upstream status: https://github.com/gnustep/libobjc2/pull/429
2and https://github.com/gnustep/libobjc2/pull/352
3
4Fixes test compilation and crashes on i686-linux with newer clang.
5
6From e4b159a815bb9ee22e4aaee40b57119f0b380a31 Mon Sep 17 00:00:00 2001
7From: Dariqq <[email protected]>
8Date: Thu, 8 Oct 2026 10:02:26 +0000
9Subject: [PATCH] Use caller-saved register in x86-32 block trampoline.
10
11Replace ebx register with ecx. This fixes crashes on x86-32 when
12optimisations are enabled.
13
14Co-authored-by: David Chisnall <[email protected]>
15---
16 block_trampolines.S | 8 ++++----
17 1 file changed, 4 insertions(+), 4 deletions(-)
18
19diff --git a/block_trampolines.S b/block_trampolines.S
20index 2f9f11b..a2d0677 100644
21--- a/block_trampolines.S
22+++ b/block_trampolines.S
23@@ -60,10 +60,10 @@
24 call 1f # Store the instruction pointer on the stack
25 1:
26 pop %eax # Load the old instruction pointer
27- mov \arg0(%esp), %ebx # Load the self parameter
28- mov %ebx, \arg1(%esp) # Store self as the second argument
29- mov -0x1005(%eax), %ebx # Load the block pointer to %ebx
30- mov %ebx, \arg0(%esp) # Store the block pointer in the first argument
31+ mov \arg0(%esp), %ecx # Load the self parameter
32+ mov %ecx, \arg1(%esp) # Store self as the second argument
33+ mov -0x1005(%eax), %ecx # Load the block pointer to %ecx
34+ mov %ecx, \arg0(%esp) # Store the block pointer in the first argument
35 jmp *-0x1001(%eax) # Call the block function
36 .endm
37 // All arguments on i386 are passed on the stack. These values are stack
38--
392.54.0
40
41From 0548300e2f1cc4752965b6d1fe3c0de122a7fffe Mon Sep 17 00:00:00 2001
42From: Hugo Melder <[email protected]>
43Date: Wed, 1 Oct 2025 12:43:53 +0200
44Subject: [PATCH 3/3] Test/FastPathAlloc: fix compilation error
45
46---
47 Test/FastPathAlloc.m | 2 +-
48 1 file changed, 1 insertion(+), 1 deletion(-)
49
50diff --git a/Test/FastPathAlloc.m b/Test/FastPathAlloc.m
51index 340a8dd3..f1eb6244 100644
52--- a/Test/FastPathAlloc.m
53+++ b/Test/FastPathAlloc.m
54@@ -96,7 +96,7 @@ + (instancetype)alloc
55 @implementation ShouldInitSubclassed
56 + (instancetype) alloc
57 {
58- return [ShouldInit alloc];
59+ return (ShouldInitSubclassed *)[ShouldInit alloc];
60 }
61 @end
62