GNOME Bugzilla – Bug 756474
glib_cv_uscore breaks cross-compile
Last modified: 2018-05-24 18:17:25 UTC
the glib configure.ac has: dnl *** check whether we need preceeding underscores AC_CACHE_CHECK([for preceeding underscore in symbols], glib_cv_uscore,[ AC_TRY_RUN([#include <dlfcn.h> int glib_underscore_test (void) { return 42; } int main() { void *f1 = (void*)0, *f2 = (void*)0, *handle; handle = dlopen ((void*)0, 0); if (handle) { f1 = dlsym (handle, "glib_underscore_test"); f2 = dlsym (handle, "_glib_underscore_test"); } return (!f2 || f1); }], [glib_cv_uscore=yes], [glib_cv_uscore=no], []) rm -f plugin.c plugin.$ac_objext plugin.lo ]) GLIB_ASSERT_SET(glib_cv_uscore) if test "x$glib_cv_uscore" = "xyes"; then G_MODULE_NEED_USCORE=1 else G_MODULE_NEED_USCORE=0 fi in the cross-compile case, this fails. it's kind of overkill considering how few targets out there actually use a prefix symbol. it should default to no here. if you want to be super paranoid, you can query gcc's __USER_LABEL_PREFIX__ define. something like: underscore_prefix=$( echo "PREFIX=__USER_LABEL_PREFIX__" \ | ${CPP-${CC-gcc} -E -P} - 2>&1 \ | ${EGREP-grep} "^PREFIX=" \ | ${SED-sed} "s:^PREFIX=::"` )
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1093.