Skip to content

Commit 6efe885

Browse files
committed
fix build warnings for Haiku.
especially linker warning about php binary having an executable stack.
1 parent d6d0a2a commit 6efe885

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ dnl supports it. This can help reduce the binary size and startup time.
206206
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
207207
[CFLAGS="$CFLAGS -fvisibility=hidden"])
208208

209+
dnl to disable executable stack on haiku due
210+
dnl to missing elf .note.GNU-stack part
209211
case $host_alias in
212+
*haiku*)
213+
LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
214+
;;
210215
*solaris*)
211216
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
212217
;;

ext/sockets/sockets.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ ZEND_DECLARE_MODULE_GLOBALS(sockets)
109109
} \
110110
} while (0)
111111
#else
112-
#define PHP_ETH_PROTO_CHECK(protocol, family) (0)
112+
#define PHP_ETH_PROTO_CHECK(protocol, family) \
113+
(void)protocol; \
114+
(void)family
113115
#endif
114116

115117
static PHP_GINIT_FUNCTION(sockets);

0 commit comments

Comments
 (0)