From cf012c31e77de042e82c5fa92a5d8de39531d080 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 7 Sep 2024 12:57:46 +0200 Subject: [PATCH] Sync Zend/*_i386_sysv_elf_gas.S with upstream This is a sync with upstream already fixed in early 2024 which fixes 64-bit builds on 32-bit hosts. PHP's bundled config.guess sets the host_alias, for example, on Solaris systems to 64-bit if the compiler supports it even though the architecture is actually 32-bit. These assembly files resolve this situation in a build-system-agnostic way by including the architecture file that is supported by the compiler. --- Zend/asm/jump_i386_sysv_elf_gas.S | 6 ++++++ Zend/asm/make_i386_sysv_elf_gas.S | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Zend/asm/jump_i386_sysv_elf_gas.S b/Zend/asm/jump_i386_sysv_elf_gas.S index 47be9e77822e0..ed83717ce2b81 100644 --- a/Zend/asm/jump_i386_sysv_elf_gas.S +++ b/Zend/asm/jump_i386_sysv_elf_gas.S @@ -24,6 +24,10 @@ * * ****************************************************************************************/ +#ifdef __x86_64__ +#include "jump_x86_64_sysv_elf_gas.S" +#else + .file "jump_i386_sysv_elf_gas.S" .text .globl jump_fcontext @@ -91,3 +95,5 @@ jump_fcontext: /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits + +#endif diff --git a/Zend/asm/make_i386_sysv_elf_gas.S b/Zend/asm/make_i386_sysv_elf_gas.S index 9261e566c0d45..c6e0b36558a65 100644 --- a/Zend/asm/make_i386_sysv_elf_gas.S +++ b/Zend/asm/make_i386_sysv_elf_gas.S @@ -24,6 +24,10 @@ * * ****************************************************************************************/ +#ifdef __x86_64__ +#include "make_x86_64_sysv_elf_gas.S" +#else + .file "make_i386_sysv_elf_gas.S" .text .globl make_fcontext @@ -111,3 +115,5 @@ finish: /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits + +#endif