GNOME Bugzilla – Bug 536299
Fix two underlinking issues
Last modified: 2018-06-29 22:05:10 UTC
Mandriva is now using -Wl,--no-undefined as LDFLAGS. With this option, we encoutered some underlinking issues in gnucash (http://wiki.mandriva.com/en/Underlinking) Attached are two patches which made gnucash build correctly with these LDFLAGS.
Created attachment 111987 [details] [review] Patch to fix underlinking in the file back-end
Created attachment 111988 [details] [review] Patch to fix underlinking in the gnome-utils directory
Thanks for the report! Hey, only two incidents, I think that is quite good :-D > Created an attachment (id=111987) [edit] > Patch to fix underlinking in the file back-end Looks correct. > Created an attachment (id=111988) [edit] > Patch to fix underlinking in the gnome-utils directory I doubt that will work on Windows. If you have the time, please make up a patch that uses an AM_CONDITIONAL for HAVE_X11_XLIB_H and if/endif in Makefile.am. Thanks!
>> Created an attachment (id=111987) [edit] >> Patch to fix underlinking in the file back-end > > Looks correct. Actually, it should probably use $(ZLIB_LIBS) and not -lz -- but we don't even check for zlib in configure! We should do that.
Created attachment 119101 [details] [review] Add ZLIB_LIBS Frederik, does this patch work for you?
Created attachment 119691 [details] [review] Conditionally add -lX11 to gnome-utils This one is not tested yet, anyway, Frederik and Derek, would that work for you?
Not sure why you're asking me, but it looks correct by inspection. I question the original report and wonder if it's really OUR problem or a problem with a dependent library?
I am asking you because I thought you might want to have a check whether we can actually link with -lX11 and include -lX11 in yet another variable $(X11_LIBS). And no, in src/gnome-utils/gnc-gnome-utils.c, we conditionally use XSetErrorHandler(3) to log x errors with the glib logging system. Actually, I am not even sure we really need that.
Applied the first as r17683, requesting back-port. As for the other: There is a simple explanation for why "only two" issues showed up in Mandriva: Windows compiled with this option from the very beginning, which meant Andi and I had to fix all those issues already 2 years ago. The last missing libraries are those that appear only on Unix. For that reason, we could just as well add the -lX11 conditional on being not on Windows, but I have no clear opinion right now.
Committed the second as well. r17723.
2.2-branch, r17740 and r17741.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=536299. Please update any external references or bookmarks.