GNOME Bugzilla – Bug 675743
configure check for libelf always defines HAVE_LIBELF
Last modified: 2018-05-24 14:13:18 UTC
Created attachment 213733 [details] [review] glib-2.32.2-solaris-libelf.patch The configure check for libelf unintentionally always defines LIBELF when no pkg-config entry for libelf is available, such as when using the host-provided libelf on Solaris or FreeBSD. As a result, even though the configure checks properly detected the found libelf is not sufficient, the code still tries to use it, with compilation errors as result. The trivial patch attached avoids the default action of AC_SEARCH_LIB to define HAVE_LIBELF.
Review of attachment 213733 [details] [review]: ok
Reopening. Bug is still (or again?) present in 2.32.3. The configure check has changed slightly by saving and restoring LIBS, but the real problem is that AC_SEARCH_LIB defines HAVE_LIBELF as default action. commit http://git.gnome.org/browse/glib/commit/?id=431d3adacdd640141f83a6c3496760adc6aba5eb seems to have been overridden, or on a different branch.
This should be fixed for 2.32.4; http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=7fe1f97a128be5f48dcd1232250e96bd581a35c1 But it isn't released yet.
(In reply to comment #3) > This should be fixed for 2.32.4; > http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=7fe1f97a128be5f48dcd1232250e96bd581a35c1 > > But it isn't released yet. That commit is in 2.32.3, and doesn't fix the issue (HAVE_LIBELF being defined). Solaris HAS a libelf, but it doesn't have e.g. elf_getshdrstrndx, still HAVE_LIBELF is defined because elf_begin exists. My original patch, and the one committed as http://git.gnome.org/browse/glib/commit/?id=431d3adacdd640141f83a6c3496760adc6aba5eb make sure HAVE_LIBELF isn't defined AND nothing added to LIBS.
Review of attachment 213733 [details] [review]: This change is in master already
-- 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/546.