Skip to contentSkip to conversation

postfix: Fix build failures with glibc 2.30

PATCH New Khem Raj 1 participant 4 messages Jul 27, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 postfix: Fix build failures with glibc 2.30

---
 ...ure-with-glibc-2.30-due-to-dropped-R.patch | 37 +++++++++++++++++++
 .../recipes-daemons/postfix/postfix.inc       | 11 ------
 .../recipes-daemons/postfix/postfix_3.4.5.bb  | 18 +++++++--
 3 files changed, 51 insertions(+), 15 deletions(-)
 create mode 100644 meta-networking/recipes-daemons/postfix/files/0001-Fixed-build-failure-with-glibc-2.30-due-to-dropped-R.patch
meta-networking/recipes-daemons/postfix/files/0001-Fixed-build-failure-with-glibc-2.30-due-to-dropped-R.patch new file +37 -0
new file mode 100644
index 0000000000..22adaff729
@@ -0,0 +1,37 @@
+From 8b3792830f4930fee7fbb00c854d9766f2b74dca Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 27 Jul 2019 11:35:38 -0700
+Subject: [PATCH] Fixed build failure with glibc 2.30 due to dropped
+ RES_INSECURE1/2 macros
+
+see [1]
+
+[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=333221862ecbebde60dd16e7ca17d26444e62f50
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/dns/dns_str_resflags.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/dns/dns_str_resflags.c b/src/dns/dns_str_resflags.c
+index 5f2cce5..df32345 100644
+--- a/src/dns/dns_str_resflags.c
++++ b/src/dns/dns_str_resflags.c
+@@ -60,10 +60,16 @@ static const LONG_NAME_MASK resflag_table[] = {
+     "RES_DEFNAMES", RES_DEFNAMES,
+     "RES_STAYOPEN", RES_STAYOPEN,
+     "RES_DNSRCH", RES_DNSRCH,
++#ifdef RES_INSECURE1
+     "RES_INSECURE1", RES_INSECURE1,
++#endif
++#ifdef RES_INSECURE2
+     "RES_INSECURE2", RES_INSECURE2,
++#endif
+     "RES_NOALIASES", RES_NOALIASES,
++#ifdef RES_USE_INET6
+     "RES_USE_INET6", RES_USE_INET6,
++#endif
+ #ifdef RES_ROTATE
+     "RES_ROTATE", RES_ROTATE,
+ #endif
meta-networking/recipes-daemons/postfix/postfix.inc +0 -11
index 94379412f9..7781005336 100644
@@ -14,17 +14,6 @@ DEPENDS = "db icu libpcre libnsl2 openssl postfix-native \
 LICENSE = "IPL-1.0 | EPL-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=b181651ad99a7dc4cc8c4ce2f491ed1a"
 
-SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \
-    file://makedefs.patch \
-    file://install.patch \
-    file://main.cf \
-    file://postfix \
-    file://internal_recipient \
-    file://postfix.service \
-    file://aliasesdb \
-    file://check_hostname.sh \
-"
-
 S = "${WORKDIR}/postfix-${PV}"
 
 CLEANBROKEN = "1"
meta-networking/recipes-daemons/postfix/postfix_3.4.5.bb +14 -4
index 3ce8055539..189baea5c3 100644
@@ -1,9 +1,19 @@
 require postfix.inc
 
-SRC_URI += "file://0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch \
-            file://postfix-install.patch \
-            file://icu-config.patch \
-            file://0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch \
+SRC_URI += "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \
+           file://makedefs.patch \
+           file://install.patch \
+           file://main.cf \
+           file://postfix \
+           file://internal_recipient \
+           file://postfix.service \
+           file://aliasesdb \
+           file://check_hostname.sh \
+           file://0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch \
+           file://postfix-install.patch \
+           file://icu-config.patch \
+           file://0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch \
+           file://0001-Fixed-build-failure-with-glibc-2.30-due-to-dropped-R.patch \
            "
 SRC_URI[md5sum] = "093109941095390562166de766d4720d"
 SRC_URI[sha256sum] = "8b2ba54f9d2a049582a0ed3ee2dbe96ba57e278feea9cb4f80e1a61844e6319f"
Signature · 1 line
2.22.0
author
#1 lore raw

PATCH 2/4 snort: Fix build with glibc 2.30

---
 ...deck-for-gettid-API-during-configure.patch | 48 +++++++++++++++++++
 .../snort/snort_2.9.14.bb                     |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 meta-networking/recipes-connectivity/snort/snort/0001-chdeck-for-gettid-API-during-configure.patch
meta-networking/recipes-connectivity/snort/snort/0001-chdeck-for-gettid-API-during-configure.patch new file +48 -0
new file mode 100644
index 0000000000..eff610de7c
@@ -0,0 +1,48 @@
+From c45ab69f9428e4d2fc1146301a4546bb2b42c9ae Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 27 Jul 2019 00:25:58 -0700
+Subject: [PATCH] chdeck for gettid API during configure
+
+glibc 2.30 added gettid syscall wrapper
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ configure.in | 2 +-
+ src/util.h   | 2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 000bb91..d79e6d0 100644
+--- a/configure.in
++++ b/configure.in
+@@ -256,7 +256,7 @@ SN_CHECK_DECLS(printf fprintf syslog puts fputs fputc fopen  \
+            strcasecmp strncasecmp strerror perror socket sendto   \
+            vsnprintf snprintf strtoul)
+ 
+-AC_CHECK_FUNCS([sigaction strlcpy strlcat strerror vswprintf wprintf memrchr inet_ntop])
++AC_CHECK_FUNCS([sigaction strlcpy strlcat strerror vswprintf wprintf memrchr inet_ntop gettid])
+ 
+ AC_CHECK_FUNC([snprintf],[have_snprintf="yes"],[have_snprintf="no"])
+ AM_CONDITIONAL(BUILD_SNPRINTF, test "x$have_snprintf" != "xyes")
+diff --git a/src/util.h b/src/util.h
+index 6880906..c310b83 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -374,6 +374,7 @@ static inline int IsEmptyStr(const char *str)
+     return 0;
+ }
+ 
++#if !HAVE_GETTID
+ static inline pid_t gettid(void)
+ {
+ #if defined(LINUX) && defined(SYS_gettid)
+@@ -382,5 +383,6 @@ static inline pid_t gettid(void)
+     return getpid();
+ #endif
+ }
++#endif
+ 
+ #endif /*__UTIL_H__*/
+-- 
+2.22.0
+
meta-networking/recipes-connectivity/snort/snort_2.9.14.bb +1 -0
index b11890c490..6ead49bb61 100644
@@ -12,6 +12,7 @@ SRC_URI = "https://www.snort.org/downloads/archive/snort/${BP}.tar.gz \
     file://fix-host-contamination-when-enable-static-daq.patch \
     file://disable-run-test-program-while-cross-compiling.patch \
     file://configure.in-disable-tirpc-checking-for-fedora.patch \
+    file://0001-chdeck-for-gettid-API-during-configure.patch \
 "
 
 SRC_URI[md5sum] = "d1689c7ccaaa7bfcfa83b5bff6b8f9b8"
Signature · 1 line
2.22.0
author
#2 lore raw

PATCH 3/4 opensaf: Add configure time check to detect gettid API in libc

In reply to Khem Raj

Also fixes build with glibc 2.30

---
 ...-configure-time-check-for-gettid-API.patch | 67 +++++++++++++++++++
 .../opensaf/opensaf_5.19.03.bb                |  1 +
 2 files changed, 68 insertions(+)
 create mode 100644 meta-networking/recipes-daemons/opensaf/opensaf/0001-Add-configure-time-check-for-gettid-API.patch
meta-networking/recipes-daemons/opensaf/opensaf/0001-Add-configure-time-check-for-gettid-API.patch new file +67 -0
new file mode 100644
index 0000000000..2b03b1800a
@@ -0,0 +1,67 @@
+From 91c7362834ccd88d1432b3e6c5c51748b72b10ad Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 27 Jul 2019 07:21:16 -0700
+Subject: [PATCH] Add configure time check for gettid API
+
+glibc 2.30 has added syscalls wrapper for gettid
+it should now be checked during configure if C library provides
+this API then do not define local function
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ configure.ac         | 4 ++++
+ src/base/logtrace.cc | 3 +++
+ src/osaf/config.h.in | 3 +++
+ 3 files changed, 10 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 22ab936..90f3da4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -480,6 +480,10 @@ fi
+ 
+ AC_SUBST([localstatedir])
+ 
++#############################################
++# Checks for functions.
++#############################################
++AC_CHECK_FUNCS([ gettid ])
+ 
+ #############################################
+ # Checks for programs.
+diff --git a/src/base/logtrace.cc b/src/base/logtrace.cc
+index 8908c1f..fe87e8d 100644
+--- a/src/base/logtrace.cc
++++ b/src/base/logtrace.cc
+@@ -31,6 +31,7 @@
+ #include "base/logtrace_client.h"
+ #include "base/logtrace_buffer.h"
+ #include "base/ncsgl_defs.h"
++#include "osaf/config.h"
+ 
+ namespace global {
+ 
+@@ -58,7 +59,9 @@ std::once_flag init_flag;
+ thread_local LogTraceBuffer gl_thread_buffer{gl_local_thread_trace,
+   global::thread_trace_buffer_size};
+ 
++#ifndef HAVE_GETTID
+ static pid_t gettid() { return syscall(SYS_gettid); }
++#endif
+ 
+ /**
+  * USR2 signal handler to enable/disable trace (toggle)
+diff --git a/src/osaf/config.h.in b/src/osaf/config.h.in
+index d1f6d1a..0a3f27d 100644
+--- a/src/osaf/config.h.in
++++ b/src/osaf/config.h.in
+@@ -18,6 +18,9 @@
+ /* Define if experimental code is enabled */
+ #undef HAVE_EXPERIMENTAL
+ 
++/* Define to 1 if you have the `gettid' function. */
++#undef HAVE_GETTID
++
+ /* SAHPI_INTERFACE_VERSION == A01 */
+ #undef HAVE_HPI_A01
+ 
meta-networking/recipes-daemons/opensaf/opensaf_5.19.03.bb +1 -0
index 0cccebdfcd..505c087f17 100644
@@ -24,6 +24,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
            file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \
            file://0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch \
            file://0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch \
+           file://0001-Add-configure-time-check-for-gettid-API.patch \
            "
 SRC_URI[md5sum] = "4dd1497ccd82d275735853bf0db5c510"
 SRC_URI[sha256sum] = "de42c8dd850990716ca494ca598165cc7a23b5b7f2bc21af5d71a3d971ddd595"
Signature · 1 line
2.22.0
author
#3 lore raw

PATCH 4/4 ypbind-mt: Fix build with glibc 2.30

In reply to Khem Raj
---
 ...-configure-time-check-for-gettid-API.patch | 45 +++++++++++++++++++
 .../recipes-support/nis/ypbind-mt_2.6.bb      |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta-networking/recipes-support/nis/ypbind-mt/0001-Add-configure-time-check-for-gettid-API.patch
meta-networking/recipes-support/nis/ypbind-mt/0001-Add-configure-time-check-for-gettid-API.patch new file +45 -0
new file mode 100644
index 0000000000..9484d0b007
@@ -0,0 +1,45 @@
+From 25d5daf30aa2dc451ba528712f668036d8506054 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 27 Jul 2019 07:50:26 -0700
+Subject: [PATCH] Add configure time check for gettid API
+
+glibc 2.30 has added this syscalls wrapper
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ configure.ac  | 1 +
+ src/log_msg.c | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 9e32a4a..6d1067b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -33,6 +33,7 @@ if test -n "$TIRPC_LIBS"; then
+   AC_DEFINE(HAVE_TIRPC, 1, [Define to 1 if TIRPC is available])
+ fi
+ 
++AC_CHECK_FUNCS(gettid)
+ dnl The difficult part: could we reconfigure NSS or must we use DNS ?
+ AC_CHECK_FUNCS(__nss_configure_lookup)
+ if eval "test \"`echo '$ac_cv_func___nss_configure_lookup'`\" != yes"; then
+diff --git a/src/log_msg.c b/src/log_msg.c
+index 49f0905..37da311 100644
+--- a/src/log_msg.c
++++ b/src/log_msg.c
+@@ -26,6 +26,7 @@
+ #include "log_msg.h"
+ 
+ #include <sys/syscall.h>
++#if !HAVE_GETTID
+ #ifdef __NR_gettid
+ static pid_t
+ gettid (void)
+@@ -39,6 +40,7 @@ gettid (void)
+     return getpid ();
+ }
+ #endif
++#endif
+ 
+ int debug_flag = 0;
+ int logfile_flag = 0;
meta-networking/recipes-support/nis/ypbind-mt_2.6.bb +1 -0
index 1a64e6c2e1..4f7f8aa3ef 100644
@@ -32,6 +32,7 @@ SRC_URI = "https://github.com/thkukuk/ypbind-mt/releases/download/v${PV}/${BPN}-
            file://ypbind.init \
            file://ypbind.service \
            file://0001-dns_hosts-Fix-build-with-musl.patch \
+           file://0001-Add-configure-time-check-for-gettid-API.patch \
            "
 SRC_URI[md5sum] = "7cf89641fdc128d0919207e4b7caaf1d"
 SRC_URI[sha256sum] = "0696c0263c4fd48a4ff2ce6c109f05f37aab0f71646d81cb22c7c28591bf80eb"
Signature · 1 line
2.22.0