From a42746beb68dfc5d046ce22791a0f111b05e3c7f Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 26 Jun 2025 12:29:12 +0200 Subject: [PATCH] Fixed implicit declaration of GNU extension gettid Fixes current compilation error (found on Ubuntu 24): ``` 23:16:48 log.c:637:21: error: implicit declaration of function 'gettid'; did you mean 'getgid'? [-Wimplicit-function-declaration] 23:16:48 637 | pid_t tid = gettid(); 23:16:48 | ^~~~~~ 23:16:48 | getgid ``` Ticket: ENT-13084 Signed-off-by: Lars Erik Wik --- deps-packaging/apache/debian/rules | 4 ++++ .../apache/fixed-implicit-decl-gettid.patch | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 deps-packaging/apache/fixed-implicit-decl-gettid.patch diff --git a/deps-packaging/apache/debian/rules b/deps-packaging/apache/debian/rules index d76a3e604..f87909918 100755 --- a/deps-packaging/apache/debian/rules +++ b/deps-packaging/apache/debian/rules @@ -14,6 +14,10 @@ build-stamp: dh_testdir patch -p0 < $(CURDIR)/apachectl.patch + + # Fixed implicit declaration of GNU extension gettid() (See ENT-13084) + patch -p1 < $(CURDIR)/fixed-implicit-decl-gettid.patch + ./configure \ --prefix=$(PREFIX)/httpd \ --enable-so \ diff --git a/deps-packaging/apache/fixed-implicit-decl-gettid.patch b/deps-packaging/apache/fixed-implicit-decl-gettid.patch new file mode 100644 index 000000000..d83535339 --- /dev/null +++ b/deps-packaging/apache/fixed-implicit-decl-gettid.patch @@ -0,0 +1,19 @@ +diff -ruN httpd-2.4.63/server/log.c httpd-2.4.63-modified/server/log.c +--- httpd-2.4.63/server/log.c 2024-06-21 16:31:54.000000000 +0200 ++++ httpd-2.4.63-modified/server/log.c 2025-06-26 15:58:03.168415807 +0200 +@@ -633,11 +633,11 @@ + #endif + #if defined(HAVE_GETTID) || defined(HAVE_SYS_GETTID) + if (arg && *arg == 'g') { +-#ifdef HAVE_GETTID +- pid_t tid = gettid(); +-#else ++// #ifdef HAVE_GETTID ++// pid_t tid = gettid(); ++// #else + pid_t tid = syscall(SYS_gettid); +-#endif ++// #endif + if (tid == -1) + return 0; + return apr_snprintf(buf, buflen, "%"APR_PID_T_FMT, tid);