From 8a9a3947211cd4e1ba3d5ffb66b2e6df9fccd5b8 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Fri, 12 Mar 2021 23:28:07 +0000 Subject: [PATCH] enable asm context on BSD. (#4082) only NetBSD does not support note.GNU-stack segment. --- config.m4 | 12 +++++++----- thirdparty/boost/asm/combined.S | 4 ++-- thirdparty/boost/asm/jump_arm64_aapcs_elf_gas.S | 2 ++ thirdparty/boost/asm/jump_arm_aapcs_elf_gas.S | 2 ++ thirdparty/boost/asm/jump_ppc32_sysv_elf_gas.S | 2 ++ thirdparty/boost/asm/jump_ppc64_sysv_elf_gas.S | 2 ++ thirdparty/boost/asm/jump_x86_64_sysv_elf_gas.S | 2 ++ thirdparty/boost/asm/make_arm64_aapcs_elf_gas.S | 2 ++ thirdparty/boost/asm/make_arm_aapcs_elf_gas.S | 2 ++ thirdparty/boost/asm/make_ppc32_sysv_elf_gas.S | 2 ++ thirdparty/boost/asm/make_ppc64_sysv_elf_gas.S | 2 ++ thirdparty/boost/asm/make_x86_64_sysv_elf_gas.S | 2 ++ 12 files changed, 29 insertions(+), 7 deletions(-) diff --git a/config.m4 b/config.m4 index 0be38581e67..8724227329d 100644 --- a/config.m4 +++ b/config.m4 @@ -439,6 +439,7 @@ if test "$PHP_SWOOLE" != "no"; then [cygwin*], [SW_OS="CYGWIN"], [mingw*], [SW_OS="MINGW"], [linux*], [SW_OS="LINUX"], + [*bsd*], [SW_OS="BSD"], [] ) @@ -623,6 +624,7 @@ if test "$PHP_SWOOLE" != "no"; then AS_CASE([$host_cpu], [x86_64*], [SW_CPU="x86_64"], + [amd64*], [SW_CPU="x86_64"], [x86*], [SW_CPU="x86"], [i?86*], [SW_CPU="x86"], [arm*], [SW_CPU="arm"], @@ -637,25 +639,25 @@ if test "$PHP_SWOOLE" != "no"; then if test "$SW_OS" = "MAC"; then SW_CONTEXT_ASM_FILE="combined_sysv_macho_gas.S" elif test "$SW_CPU" = "x86_64"; then - if test "$SW_OS" = "LINUX"; then + if test "$SW_OS" = "LINUX" || test "$SW_OS" = "BSD"; then SW_CONTEXT_ASM_FILE="x86_64_sysv_elf_gas.S" else SW_USE_ASM_CONTEXT="no" fi elif test "$SW_CPU" = "x86"; then - if test "$SW_OS" = "LINUX"; then + if test "$SW_OS" = "LINUX" || test "$SW_OS" = "BSD"; then SW_CONTEXT_ASM_FILE="i386_sysv_elf_gas.S" else SW_USE_ASM_CONTEXT="no" fi elif test "$SW_CPU" = "arm"; then - if test "$SW_OS" = "LINUX"; then + if test "$SW_OS" = "LINUX" || test "$SW_OS" = "BSD"; then SW_CONTEXT_ASM_FILE="arm_aapcs_elf_gas.S" else SW_USE_ASM_CONTEXT="no" fi elif test "$SW_CPU" = "arm64"; then - if test "$SW_OS" = "LINUX"; then + if test "$SW_OS" = "LINUX" || test "$SW_OS" = "BSD"; then SW_CONTEXT_ASM_FILE="arm64_aapcs_elf_gas.S" else SW_USE_ASM_CONTEXT="no" @@ -667,7 +669,7 @@ if test "$PHP_SWOOLE" != "no"; then SW_USE_ASM_CONTEXT="no" fi elif test "$SW_CPU" = "ppc64"; then - if test "$SW_OS" = "LINUX"; then + if test "$SW_OS" = "LINUX" || test "$SW_OS" = "BSD"; then SW_CONTEXT_ASM_FILE="ppc64_sysv_elf_gas.S" else SW_USE_ASM_CONTEXT="no" diff --git a/thirdparty/boost/asm/combined.S b/thirdparty/boost/asm/combined.S index cbe77512e37..35fd2098b8e 100644 --- a/thirdparty/boost/asm/combined.S +++ b/thirdparty/boost/asm/combined.S @@ -1,4 +1,4 @@ -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) #if defined(__i386__) #include "make_i386_sysv_elf_gas.S" #include "jump_i386_sysv_elf_gas.S" @@ -25,4 +25,4 @@ #include "jump_combined_sysv_macho_gas.S" #else #error "not supports" -#endif \ No newline at end of file +#endif diff --git a/thirdparty/boost/asm/jump_arm64_aapcs_elf_gas.S b/thirdparty/boost/asm/jump_arm64_aapcs_elf_gas.S index 09bd7b52259..52821a9b9eb 100644 --- a/thirdparty/boost/asm/jump_arm64_aapcs_elf_gas.S +++ b/thirdparty/boost/asm/jump_arm64_aapcs_elf_gas.S @@ -127,5 +127,7 @@ jump_fcontext: ret x4 .size jump_fcontext,.-jump_fcontext +#ifndef __NetBSD__ # Mark that we don't need executable stack. .section .note.GNU-stack,"",%progbits +#endif diff --git a/thirdparty/boost/asm/jump_arm_aapcs_elf_gas.S b/thirdparty/boost/asm/jump_arm_aapcs_elf_gas.S index 3019aeb49dc..7ad3c695ea7 100644 --- a/thirdparty/boost/asm/jump_arm_aapcs_elf_gas.S +++ b/thirdparty/boost/asm/jump_arm_aapcs_elf_gas.S @@ -89,5 +89,7 @@ jump_fcontext: pop {v1-v8,lr,pc} .size jump_fcontext,.-jump_fcontext +#ifndef __NetBSD__ @ Mark that we don't need executable stack. .section .note.GNU-stack,"",%progbits +#endif diff --git a/thirdparty/boost/asm/jump_ppc32_sysv_elf_gas.S b/thirdparty/boost/asm/jump_ppc32_sysv_elf_gas.S index d5380d50f23..f3c799237c6 100644 --- a/thirdparty/boost/asm/jump_ppc32_sysv_elf_gas.S +++ b/thirdparty/boost/asm/jump_ppc32_sysv_elf_gas.S @@ -204,5 +204,7 @@ jump_fcontext: bctr .size jump_fcontext, .-jump_fcontext +#ifndef __NetBSD__ /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits +#endif diff --git a/thirdparty/boost/asm/jump_ppc64_sysv_elf_gas.S b/thirdparty/boost/asm/jump_ppc64_sysv_elf_gas.S index 46bc3cc2c81..bd7bc9f6779 100644 --- a/thirdparty/boost/asm/jump_ppc64_sysv_elf_gas.S +++ b/thirdparty/boost/asm/jump_ppc64_sysv_elf_gas.S @@ -263,5 +263,7 @@ jump_fcontext: #endif +#ifndef __NetBSD__ /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits +#endif diff --git a/thirdparty/boost/asm/jump_x86_64_sysv_elf_gas.S b/thirdparty/boost/asm/jump_x86_64_sysv_elf_gas.S index ac555319e93..893b094be00 100644 --- a/thirdparty/boost/asm/jump_x86_64_sysv_elf_gas.S +++ b/thirdparty/boost/asm/jump_x86_64_sysv_elf_gas.S @@ -94,5 +94,7 @@ jump_fcontext: jmp *%r8 .size jump_fcontext,.-jump_fcontext +#ifndef __NetBSD__ /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits +#endif diff --git a/thirdparty/boost/asm/make_arm64_aapcs_elf_gas.S b/thirdparty/boost/asm/make_arm64_aapcs_elf_gas.S index b208ab7f39d..5fa092eef5d 100644 --- a/thirdparty/boost/asm/make_arm64_aapcs_elf_gas.S +++ b/thirdparty/boost/asm/make_arm64_aapcs_elf_gas.S @@ -81,5 +81,7 @@ finish: bl _exit .size make_fcontext,.-make_fcontext +#ifndef __NetBSD__ # Mark that we don't need executable stack. .section .note.GNU-stack,"",%progbits +#endif diff --git a/thirdparty/boost/asm/make_arm_aapcs_elf_gas.S b/thirdparty/boost/asm/make_arm_aapcs_elf_gas.S index 9877655161b..1606dbb0fd8 100644 --- a/thirdparty/boost/asm/make_arm_aapcs_elf_gas.S +++ b/thirdparty/boost/asm/make_arm_aapcs_elf_gas.S @@ -67,5 +67,7 @@ finish: bl _exit@PLT .size make_fcontext,.-make_fcontext +#ifndef __NetBSD__ @ Mark that we don't need executable stack. .section .note.GNU-stack,"",%progbits +#endif diff --git a/thirdparty/boost/asm/make_ppc32_sysv_elf_gas.S b/thirdparty/boost/asm/make_ppc32_sysv_elf_gas.S index 30ce473c9eb..043bc4ac4e1 100644 --- a/thirdparty/boost/asm/make_ppc32_sysv_elf_gas.S +++ b/thirdparty/boost/asm/make_ppc32_sysv_elf_gas.S @@ -119,5 +119,7 @@ finish: bl _exit@plt .size make_fcontext, .-make_fcontext +#ifndef __NetBSD__ /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits +#endif diff --git a/thirdparty/boost/asm/make_ppc64_sysv_elf_gas.S b/thirdparty/boost/asm/make_ppc64_sysv_elf_gas.S index b777fe69b9e..35c49442406 100644 --- a/thirdparty/boost/asm/make_ppc64_sysv_elf_gas.S +++ b/thirdparty/boost/asm/make_ppc64_sysv_elf_gas.S @@ -185,5 +185,7 @@ finish: # endif #endif +#ifndef __NetBSD__ /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits +#endif diff --git a/thirdparty/boost/asm/make_x86_64_sysv_elf_gas.S b/thirdparty/boost/asm/make_x86_64_sysv_elf_gas.S index b6878795846..335117a22ee 100644 --- a/thirdparty/boost/asm/make_x86_64_sysv_elf_gas.S +++ b/thirdparty/boost/asm/make_x86_64_sysv_elf_gas.S @@ -71,5 +71,7 @@ finish: hlt .size make_fcontext,.-make_fcontext +#ifndef __NetBSD__ /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits +#endif