From 5dc0c147e9026cc06b30688537325f77d64b54eb Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Fri, 4 May 2018 23:50:36 +0800 Subject: [PATCH 1/2] meson: Don't define _POSIX_C_SOURCE when dlvsym is found FreeBSD hides declarations of non-POSIX functions when POSIX macros, such as _POSIX_C_SOURCE or _XOPEN_SOURCE, is defined. This causes test/dlwrap.c to fail to compile because it uses dlvsym and asprintf. Fixes: #169 --- test/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/meson.build b/test/meson.build index ee1a732..ea2b354 100644 --- a/test/meson.build +++ b/test/meson.build @@ -5,10 +5,13 @@ has_gles1 = gles1_dep.found() has_gles2 = gles2_dep.found() build_x11_tests = enable_x11 and x11_dep.found() -test_cflags = common_cflags + [ +test_cflags = common_cflags +if not has_dlvsym +test_cflags += [ '-D_XOPEN_SOURCE', '-D_POSIX_C_SOURCE=200809L', ] +endif # Unconditionally built tests test('header_guards', From 27b07469403af8bcbef9b24a42d4c44c5bffc846 Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Fri, 4 May 2018 23:59:22 +0800 Subject: [PATCH 2/2] dlwrap: Add FBSD_1.0 version for FreeBSD This fixes dlwrap_real_dlsym on FreeBSD, but tests still fail because we currently don't have libglvnd. --- test/dlwrap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/dlwrap.c b/test/dlwrap.c index 25e17de..c0c24c2 100644 --- a/test/dlwrap.c +++ b/test/dlwrap.c @@ -242,7 +242,8 @@ dlwrap_real_dlsym(void *handle, const char *name) "GLIBC_2.3", "GLIBC_2.2.5", "GLIBC_2.2", - "GLIBC_2.0" + "GLIBC_2.0", + "FBSD_1.0" }; int num_versions = sizeof(version) / sizeof(version[0]); int i;