[Buildroot] [PATCH/next/RFC 1/2] package/mariadb: handle missing ucontext_t

Bernd Kuhls bernd.kuhls at t-online.de
Sat Aug 25 20:44:02 UTC 2018


On some archs uclibc does not provide ucontext_t, for details see
https://git.buildroot.net/buildroot/commit/?id=f1cbfeea95e6287c7a666aafc182ffa318eff262

Mariadb uses ucontext_t optionally, its use can be disabled by the
corresponding cmake option. Instead of copying the Config.in code from
libsigsegv we shamelessly use its ARCH_SUPPORTS option while thinking
that a more general approach might be needed for ucontext_t support so
please consider this patch a RFC.

This patch fixes a build error

In file included from /home/bernd/buildroot/output/build/mariadb-10.2.17/libmariadb/plugins/pvio/pvio_socket.c:32:0:
/home/bernd/buildroot/output/build/mariadb-10.2.17/libmariadb/include/ma_context.h:62:3: error: unknown type name ‘ucontext_t’
   ucontext_t base_context;
   ^~~~~~~~~~

using this defconfig:

BR2_arcle=y
BR2_archs38=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arcle-hs38-full-2018.02-926-gb393c24.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_7=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_1=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_PACKAGE_MYSQL=y
BR2_PACKAGE_MARIADB=y
BR2_PACKAGE_MARIADB_SERVER=y

Signed-off-by: Bernd Kuhls <bernd.kuhls at t-online.de>
---
 package/mariadb/mariadb.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/mariadb/mariadb.mk b/package/mariadb/mariadb.mk
index 075582288a..7074e3510e 100644
--- a/package/mariadb/mariadb.mk
+++ b/package/mariadb/mariadb.mk
@@ -61,6 +61,11 @@ else
 MARIADB_CONF_OPTS += -DWITHOUT_SERVER=ON
 endif
 
+# hack: do we need a ucontext-specific option?
+ifeq ($(BR2_PACKAGE_LIBSIGSEGV_ARCH_SUPPORTS),)
+MARIADB_CONF_OPTS += -DHAVE_UCONTEXT_H=0
+endif
+
 MARIADB_CONF_OPTS += \
 	-DINSTALL_DOCDIR=share/doc/mariadb-$(MARIADB_VERSION) \
 	-DINSTALL_DOCREADMEDIR=share/doc/mariadb-$(MARIADB_VERSION) \
-- 
2.18.0




More information about the buildroot mailing list