Skip to content

Commit

Permalink
enable asm context on BSD. (#4082)
Browse files Browse the repository at this point in the history
only NetBSD does not support note.GNU-stack segment.
  • Loading branch information
devnexen authored Mar 12, 2021
1 parent cf36f69 commit 8a9a394
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 7 deletions.
12 changes: 7 additions & 5 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
[]
)

Expand Down Expand Up @@ -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"],
Expand All @@ -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"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/boost/asm/combined.S
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -25,4 +25,4 @@
#include "jump_combined_sysv_macho_gas.S"
#else
#error "not supports"
#endif
#endif
2 changes: 2 additions & 0 deletions thirdparty/boost/asm/jump_arm64_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions thirdparty/boost/asm/jump_arm_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions thirdparty/boost/asm/jump_ppc32_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions thirdparty/boost/asm/jump_ppc64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,7 @@ jump_fcontext:
#endif


#ifndef __NetBSD__
/* Mark that we don't need executable stack. */
.section .note.GNU-stack,"",%progbits
#endif
2 changes: 2 additions & 0 deletions thirdparty/boost/asm/jump_x86_64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions thirdparty/boost/asm/make_arm64_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions thirdparty/boost/asm/make_arm_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions thirdparty/boost/asm/make_ppc32_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions thirdparty/boost/asm/make_ppc64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,7 @@ finish:
# endif
#endif

#ifndef __NetBSD__
/* Mark that we don't need executable stack. */
.section .note.GNU-stack,"",%progbits
#endif
2 changes: 2 additions & 0 deletions thirdparty/boost/asm/make_x86_64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8a9a394

Please sign in to comment.