From f0484dae3ac77afef11a74637534e29a8a8dfe72 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 7 Feb 2022 16:30:23 -0800 Subject: openldap: Fix build with musl Signed-off-by: Khem Raj --- ...include-ldap_pvt_thread.h-before-redefini.patch | 54 ++++++++++++++++++++++ meta-oe/recipes-support/openldap/openldap_2.5.9.bb | 1 + 2 files changed, 55 insertions(+) create mode 100644 meta-oe/recipes-support/openldap/openldap/0001-librewrite-include-ldap_pvt_thread.h-before-redefini.patch (limited to 'meta-oe') diff --git a/meta-oe/recipes-support/openldap/openldap/0001-librewrite-include-ldap_pvt_thread.h-before-redefini.patch b/meta-oe/recipes-support/openldap/openldap/0001-librewrite-include-ldap_pvt_thread.h-before-redefini.patch new file mode 100644 index 0000000000..bcd1525b67 --- /dev/null +++ b/meta-oe/recipes-support/openldap/openldap/0001-librewrite-include-ldap_pvt_thread.h-before-redefini.patch @@ -0,0 +1,54 @@ +From 79381ab335898c9184e22dd25b544adefa9bf6c5 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 7 Feb 2022 16:26:57 -0800 +Subject: [PATCH] librewrite: include ldap_pvt_thread.h before redefining + calloc + +This helps compiling with musl, where sched.h is included by +ldap_pvt_thread.h which provides prototype for calloc() and conflicts + +/usr/include/sched.h:84:7: error: conflicting types for 'ber_memcalloc' +| void *calloc(size_t, size_t); +| ^1 +| warning and 1 error generated. +| ./rewrite-int.h:44:21: note: expanded from macro 'calloc' +| #define calloc(x,y) ber_memcalloc(x,y) +| ^ + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + libraries/librewrite/rewrite-int.h | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/libraries/librewrite/rewrite-int.h b/libraries/librewrite/rewrite-int.h +index 4481dd3..5ec226d 100644 +--- a/libraries/librewrite/rewrite-int.h ++++ b/libraries/librewrite/rewrite-int.h +@@ -40,6 +40,11 @@ + + #include + ++#ifndef NO_THREADS ++#define USE_REWRITE_LDAP_PVT_THREADS ++#include ++#endif ++ + #define malloc(x) ber_memalloc(x) + #define calloc(x,y) ber_memcalloc(x,y) + #define realloc(x,y) ber_memrealloc(x,y) +@@ -47,11 +52,6 @@ + #undef strdup + #define strdup(x) ber_strdup(x) + +-#ifndef NO_THREADS +-#define USE_REWRITE_LDAP_PVT_THREADS +-#include +-#endif +- + /* + * For details, see RATIONALE. + */ +-- +2.35.1 + diff --git a/meta-oe/recipes-support/openldap/openldap_2.5.9.bb b/meta-oe/recipes-support/openldap/openldap_2.5.9.bb index f3b8c6c987..b80bde8490 100644 --- a/meta-oe/recipes-support/openldap/openldap_2.5.9.bb +++ b/meta-oe/recipes-support/openldap/openldap_2.5.9.bb @@ -23,6 +23,7 @@ SRC_URI = "http://www.openldap.org/software/download/OpenLDAP/openldap-release/$ file://0001-ldif-filter-fix-parallel-build-failure.patch \ file://0001-build-top.mk-unset-STRIP_OPTS.patch \ file://0001-libraries-Makefile.in-ignore-the-mkdir-errors.patch \ + file://0001-librewrite-include-ldap_pvt_thread.h-before-redefini.patch \ " SRC_URI[md5sum] = "237fc2d881c27f8dd5d9f396e2865c11" -- cgit v1.2.3-54-g00ecf