[lttng-dev] [PATCH] Port: Add glib checks for cross compilation

Michael Jeanson mjeanson at efficios.com
Tue Aug 8 19:19:12 UTC 2017

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
 configure.ac | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/configure.ac b/configure.ac
index b9bb6b4..6625b58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -626,6 +626,30 @@ AC_SUBST(AM_CPPFLAGS)
 # Add glib to global link libs
+# Check that the current size_t matches the size that glib thinks it should
+# be. This catches problems on multi-arch where people try to do a 32-bit
+# build while pointing at 64-bit glib headers. This is a common error because
+# glib.h is not platform specific but it includes glibconfig.h which is and
+# is usually installed in a non-standard path.
+#include <glib.h>
+#include <unistd.h>
+  ], [dnl
+  ])
+  AC_MSG_ERROR([dnl
+sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T. You probably need to set
+PKG_CONFIG_LIBDIR to point to the right pkg-config files for your build
+  ])
 # Abuse autoconf's AC_ARG_PROGRAM output variable 'program_transform_name'
 # to rename babeltrace.bin to babeltrace at install time.

More information about the lttng-dev mailing list