Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/scripts/download-bundled/boost-context.arm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
diff --git a/Zend/asm/jump_arm_aapcs_elf_gas.S b/Zend/asm/jump_arm_aapcs_elf_gas.S
index 4415a541fd3..647ae9f45ad 100644
--- a/Zend/asm/jump_arm_aapcs_elf_gas.S
+++ b/Zend/asm/jump_arm_aapcs_elf_gas.S
@@ -50,7 +50,7 @@ jump_fcontext:
push {lr}
@ save hidden,V1-V8,LR

- #if __ARM_ARCH >= 7
+ #if !defined(__ARM_ARCH_6M__)

push {a1,v1-v8,lr}

@@ -102,7 +102,7 @@ jump_fcontext:
add sp, sp, #64

@ restore hidden,V1-V8,LR
- #if __ARM_ARCH >= 7
+ #if !defined(__ARM_ARCH_6M__)
pop {a4,v1-v8,lr}
#else

diff --git a/Zend/asm/make_arm_aapcs_elf_gas.S b/Zend/asm/make_arm_aapcs_elf_gas.S
index 2367c75a6a7..b5cf0c8fa09 100644
--- a/Zend/asm/make_arm_aapcs_elf_gas.S
+++ b/Zend/asm/make_arm_aapcs_elf_gas.S
@@ -48,7 +48,7 @@
make_fcontext:
@ shift address in A1 to lower 16 byte boundary

- #if __ARM_ARCH >= 7
+ #if !defined(__ARM_ARCH_6M__)
bic a1, a1, #15
#else
lsrs a1, a1, #4
@@ -56,7 +56,7 @@ make_fcontext:
#endif

@ reserve space for context-data on context-stack
- #if __ARM_ARCH >= 7
+ #if !defined(__ARM_ARCH_6M__)
sub a1, a1, #124
#else
subs a1, #124
@@ -66,7 +66,7 @@ make_fcontext:
str a3, [a1, #104]

@ compute address of returned transfer_t
- #if __ARM_ARCH >= 7
+ #if !defined(__ARM_ARCH_6M__)
add a2, a1, #108
#else
mov a2, a1
@@ -77,7 +77,7 @@ make_fcontext:


@ compute abs address of label finish
- #if __ARM_ARCH >= 7
+ #if !defined(__ARM_ARCH_6M__)
adr a2, finish
#else
ldr a2, =finish
@@ -93,7 +93,7 @@ make_fcontext:

finish:
@ exit code is zero
- #if __ARM_ARCH >=7
+ #if !defined(__ARM_ARCH_6M__)
mov a1, #0
#else
movs r3, #0
6 changes: 6 additions & 0 deletions .github/scripts/download-bundled/boost-context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ mv make_x86_64_ms_pe_gas.asm make_x86_64_ms_pe_gas.S
# add extra files
git restore LICENSE
git restore save_xmm_x86_64_ms_masm.asm # added in GH-18352, not an upstream boost.context file

# patch customized files
# gates the Cortex-M0 (ARMv6-M) fallback in the ARM fcontext assembly on
# __ARM_ARCH_6M__ instead of __ARM_ARCH < 7, which also matched classic ARMv6
# and emitted a DT_TEXTREL there; drop once fixed upstream in boost.context
git apply -v ../../.github/scripts/download-bundled/boost-context.arm.patch
4 changes: 2 additions & 2 deletions Zend/asm/jump_arm_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jump_fcontext:
push {lr}
@ save hidden,V1-V8,LR

#if __ARM_ARCH >= 7
#if !defined(__ARM_ARCH_6M__)

push {a1,v1-v8,lr}

Expand Down Expand Up @@ -102,7 +102,7 @@ jump_fcontext:
add sp, sp, #64

@ restore hidden,V1-V8,LR
#if __ARM_ARCH >= 7
#if !defined(__ARM_ARCH_6M__)
pop {a4,v1-v8,lr}
#else

Expand Down
10 changes: 5 additions & 5 deletions Zend/asm/make_arm_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
make_fcontext:
@ shift address in A1 to lower 16 byte boundary

#if __ARM_ARCH >= 7
#if !defined(__ARM_ARCH_6M__)
bic a1, a1, #15
#else
lsrs a1, a1, #4
lsls a1, a1, #4
#endif

@ reserve space for context-data on context-stack
#if __ARM_ARCH >= 7
#if !defined(__ARM_ARCH_6M__)
sub a1, a1, #124
#else
subs a1, #124
Expand All @@ -66,7 +66,7 @@ make_fcontext:
str a3, [a1, #104]

@ compute address of returned transfer_t
#if __ARM_ARCH >= 7
#if !defined(__ARM_ARCH_6M__)
add a2, a1, #108
#else
mov a2, a1
Expand All @@ -77,7 +77,7 @@ make_fcontext:


@ compute abs address of label finish
#if __ARM_ARCH >= 7
#if !defined(__ARM_ARCH_6M__)
adr a2, finish
#else
ldr a2, =finish
Expand All @@ -93,7 +93,7 @@ make_fcontext:

finish:
@ exit code is zero
#if __ARM_ARCH >=7
#if !defined(__ARM_ARCH_6M__)
mov a1, #0
#else
movs r3, #0
Expand Down
Loading