From 69b4360e881e575ee574c1f131c86d3b5007442f Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 9 Jul 2023 10:48:01 +0100 Subject: [PATCH] zend_gdb disable gdb detection for FreeBSD < 11. ref PR: https://github.com/php/php-src/pull/11599. Close GH-11646 --- NEWS | 1 + Zend/zend_gdb.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 5d6640f8e31..bee47234fbc 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ PHP NEWS . Fixed oss-fuzz #60011 (Mis-compilation of by-reference nullsafe operator). (ilutov) . Fixed use-of-uninitialized-value with ??= on assert. (ilutov) + . Fixed build for FreeBSD before the 11.0 releases. (David Carlier) - Curl: . Fix crash when an invalid callback function is passed to diff --git a/Zend/zend_gdb.c b/Zend/zend_gdb.c index 02afb6bc6f7..7719053eae7 100644 --- a/Zend/zend_gdb.c +++ b/Zend/zend_gdb.c @@ -25,7 +25,7 @@ #include #include -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) && __FreeBSD_version >= 1100000 # include # include #endif @@ -142,7 +142,7 @@ ZEND_API bool zend_gdb_present(void) close(fd); } -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) && __FreeBSD_version >= 1100000 struct kinfo_proc *proc = kinfo_getproc(getpid()); if (proc) {