Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error: "undefined reference to `g_abort'" #2142

Closed
Slider-Whistle opened this issue Oct 17, 2019 · 6 comments
Closed

Build error: "undefined reference to `g_abort'" #2142

Slider-Whistle opened this issue Oct 17, 2019 · 6 comments
Milestone

Comments

@Slider-Whistle
Copy link

Haven't been able to compile ibus on Slackware version 14.2, though I'm sure this isn't a consistent issue with other people. The following error appears in the make build stage:

CC unicode_parser-unicode-parser.o
unicode-parser.c: In function ‘ucd_parse_file’:
unicode-parser.c:318:13: warning: implicit declaration of function ‘g_abort’ [-Wimplicit-function-declaration]
g_abort ();
^
CCLD unicode-parser
unicode_parser-unicode-parser.o: In function ucd_parse_file': unicode-parser.c:(.text+0x573): undefined reference to g_abort'
collect2: error: ld returned 1 exit status
Makefile:928: recipe for target 'unicode-parser' failed
make[4]: *** [unicode-parser] Error 1
make[4]: Leaving directory '/tmp/SBo/ibus-1.5.21/src'
Makefile:1150: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/tmp/SBo/ibus-1.5.21/src'
Makefile:840: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/tmp/SBo/ibus-1.5.21/src'
Makefile:678: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/SBo/ibus-1.5.21'
Makefile:585: recipe for target 'all' failed
make: *** [all] Error 2

In this case I'm using the slackbuild here https://slackbuilds.org/repository/14.2/misc/ibus/ where I simply changed the version number to the latest, but it hasn't worked without it either. I got the same error from versions 1.15.9 to 1.15.21, but haven't tried anything further back as I don't want to miss out on the control-shift-u functionality.

What are the program's current dependencies? These are the current versions I've got from the outdated wiki page here https://github.com/ibus/ibus/wiki/Install :
python 2.7.16
dbus-glib 0.106
dbus-python 1.2.4
notify-python 0.1.1
iso-codes 3.67

I'm guessing that only dbus-glib is relevant, but I thought it might be helpful to list the other dependencies. I'm probably the only one who gets this error, so sorry if this is a waste of time.

@fujiwarat
Copy link
Member

g_abort() is defined in /usr/include/glib-2.0/glib/gutils.h :

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_50
#ifndef G_OS_WIN32
#  include <stdlib.h>
#  define g_abort() abort ()
#else
GLIB_AVAILABLE_IN_2_50
void g_abort (void) G_GNUC_NORETURN G_ANALYZER_NORETURN;
#endif

You could check the following test program.

% cat a.c
#include <glib.h>
int
main (int argc, char *argv[])
{
    g_abort ();
}
% gcc -o a a.c `pkg-config --cflags --libs glib-2.0`

The gcc should not output any errors.

@Slider-Whistle
Copy link
Author

Okay, there's no g_abort in my gutils.h at all. Checking my packages, it seems like my version of "glib2" is 2.46.2, rather than >=2.5.0 where it needs to be right?

Thanks for helping out with this. Stuff broke even more when I tried to upgrade it, but I think I'll be able to figure it out myelf now.

@fujiwarat
Copy link
Member

You're right. g_abort() has been available since 2.50 but I thought it was available in much old versions by mistake.
Are you able to upgrade your glib 2.46.2 to 2.50?
The latest stable glib is 2.62 and I think it's good to revise the minimum supported glib is 2.50 in ibus.

@Slider-Whistle
Copy link
Author

Slider-Whistle commented Oct 18, 2019

If I upgrade glib2, then I think I need to upgrade or recompile to continue building ibus, and I haven't tried opening that can of worms yet.

checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.16... /usr/bin/pkg-config: /lib64/libc.so.6: version GLIBC_2.28' not found (required by /usr/lib64/libglib-2.0.so.0)
no
checking for GLIB... no
./configure: line 16303: no: command not found
checking for GLIB - version >= 2.0.0... no
*** A new enough version of pkg-config was not found.
*** See http://www.freedesktop.org/software/pkgconfig/
checking for GLIB2... no
./configure: line 16661: no: command not found
configure: error: Package requirements (
glib-2.0 >= 2.46.0
) were not met:

./configure: line 16673: no: command not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GLIB2_CFLAGS
and GLIB2_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.`

There's also a bunch of other programs I'll have to recompile to make work again. You probably don't have to worry too much about making this work for me, since I'm using kind of outdated stuff in the first place.

I'll look into my options for using two versions of glib at once. Apparently, if I want to, I should be able to install the newer version of glib in its own directory, and add that directory to LD_LIBRARY_PATH when I want to use it.

@fujiwarat
Copy link
Member

I expect to use built packages built by distributions to upgrade libraries easily.
If your distro does not provide the built packages with the package dependencies, probably you might rebuild whole the GNOME desktop packages by release by yourself. glib 2.50 was released in Sep 2016 and it's still an old release.
I guess you also need to rebuild glibc and pkgconf.

@fujiwarat fujiwarat added this to the 1.5.22 milestone Oct 24, 2019
@fujiwarat
Copy link
Member

Since g_abort() is not so useful, I can replace g_abort with abort at the moment.
However the minimum supported version will be 2.50 in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants