After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756474 - glib_cv_uscore breaks cross-compile
glib_cv_uscore breaks cross-compile
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: build
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-10-13 02:14 UTC by Mike Frysinger
Modified: 2018-05-24 18:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mike Frysinger 2015-10-13 02:14:28 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=::"`
)
Comment 1 GNOME Infrastructure Team 2018-05-24 18:17:25 UTC
-- 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.