GNOME Bugzilla – Bug 539942
suncc can not compile gnucash without set "CFLAGS='-xO4'"
Last modified: 2018-06-29 22:06:03 UTC
I'm under Solaris, with Sun Studio 12 to build gnucash trunk code. But fails on configure time. $./autogen.sh && ./configure --enable-debug --enable-gui .... checking if unsigned long is at least as big as guint32... no configure: error: cannot continue ./configure: line 26565: exit: size: numeric argument required ./configure: line 26565: exit: size: numeric argument required If I set CFLAGS='-xO4', then it can pass $export CFLAGS='-xO4' $./autogen.sh && ./configure --enable-debug --enable-gui I'm wondering why this happen.
Check config.log?
Created attachment 113384 [details] config.log without setting "CFLAGS='-xO4'" As request, attach the config.log
If you look at the config.log you'll see the problem: configure:26301: checking if guile long_long is at least as big as gint64 configure:26400: /ws/onnv-tools-prc/SUNWspro/SS12/bin/cc -o conftest -D_REENTRANT -g -D_REENTRANT -D_PTHREADS -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include conftest.c -lm >&5 Undefined first referenced symbol in file g_atomic_pointer_get conftest.o g_once_init_enter_impl conftest.o g_string_insert_c conftest.o ld: fatal: Symbol referencing errors. No output written to conftest But the code used isn't pulling these symbols in. The program being compiled is just: | #include <glib.h> | #include <libguile/__scm.h> | int main(int argc, char *argv[]) { | return(!(sizeof(long_long) >= sizeof(gint64))); | } So something is whacked on your system. I suggest using config.log as your guide to seeing what is actually wrong and then you can work to fix it. Or you could just use GCC. ;)
Created attachment 113513 [details] [review] patch for bug #539942 Add "-lglib-2.0" will fix this problem, seems GLIB_LIBS should added to LDFLAGS for this test. Does this patch look good?
That should work. What about saving GNC_OLDLDFLAGS before and restoring it after the test, similar to OLD_CFLAGS?
Created attachment 119106 [details] [review] Temporarily add GLIB_LIBS to LDLFAGS Halton, does this patch work for you?
(In reply to comment #6) > Created an attachment (id=119106) [edit] > Temporarily add GLIB_LIBS to LDLFAGS > > Halton, does this patch work for you? > Andreas, You patch works fine on my box. Sorry for late response, I'm stopping at bug #554042, now I have patch for that also, would you take a look?
Is now solved by the patch from bug#554042. *** This bug has been marked as a duplicate of 554042 ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=539942. Please update any external references or bookmarks.