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 136425 - compile of ottest fails
compile of ottest fails
Status: RESOLVED DUPLICATE of bug 157536
Product: glib
Classification: Platform
Component: general
2.3.x
Other Solaris
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2004-03-07 03:42 UTC by David L. Cooper II
Modified: 2011-02-18 16:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David L. Cooper II 2004-03-07 03:42:34 UTC
Compile of ottest fails. In reviewing the Makefile, glib libraries are not
included in the link command.
Comment 1 Owen Taylor 2004-03-08 13:21:22 UTC
Can you provide the exact link error? There should be no
use of glib in that program...
Comment 2 Owen Taylor 2004-03-09 13:15:17 UTC
Please reopen from NEEDINFO when you add information.
Comment 3 David L. Cooper II 2004-03-10 02:25:36 UTC
Here are the errors:

<snip>
/bin/bash ../../libtool --mode=link cc  -g   -o ottest  ottest.o
disasm.o libpango-ot.la -L/usr/local/lib -lfontconfig  
-L/usr/local/lib -lfreetype -lz 
cc -g -o ottest ottest.o disasm.o  ./.libs/libpango-ot.a
-L/usr/local/lib /usr/local/lib/libfontconfig.so
/usr/local/lib/libexpat.so -L/usr/lib -L/usr/openwin/lib
-L/usr/local/ssl/lib /usr/local/lib/libfreetype.so -lz
-R/usr/local/lib -R/usr/local/lib
ild: (undefined symbol) g_string_insert_c -- referenced in the text
segment of ./.libs/libpango-ot.a(ftxgdef.o)
ild: (undefined symbol) g_string_insert_c -- referenced in the text
segment of ./.libs/libpango-ot.a(ftxopen.o)
ild: (undefined symbol) g_string_insert_c -- referenced in the text
segment of ./.libs/libpango-ot.a(otlbuffer.o)
ild: (undefined symbol) g_string_insert_c -- referenced in the text
segment of ./.libs/libpango-ot.a(ftxgsub.o)
ild: (undefined symbol) g_string_insert_c -- referenced in the text
segment of ./.libs/libpango-ot.a(ftxgpos.o)
ild: (undefined symbol) g_string_insert_c -- referenced in the text
segment of disasm.o
ild: (undefined symbol) g_string_insert_c -- referenced in the text
segment of ottest.o
</snip>
Comment 4 Owen Taylor 2004-03-10 19:03:33 UTC
This doens't make any sense to me at all; 

can you use 'truss' to figure out what files the
command:

cc -g -o ottest ottest.o disasm.o  ./.libs/libpango-ot.a
-L/usr/local/lib /usr/local/lib/libfontconfig.so
/usr/local/lib/libexpat.so -L/usr/lib -L/usr/openwin/lib
-L/usr/local/ssl/lib /usr/local/lib/libfreetype.so -lz
-R/usr/local/lib -R/usr/local/lib

is opening? And then maybe poke around with nm and see
which of these files references g_string_insert_c
Comment 5 David L. Cooper II 2004-03-11 01:04:35 UTC
Here's what I've figured out so far:
1. in ../opentype, disasm.c and otlbuffer.h include <glib.h>
2. <glib.h> has g_string_append_c_inline inside and G_CAN_INLINE ifdef
3. g_string_append_c_inline contains a call to g_string_insert_c

Would things clear up if G_CAN_INLINE was undef'ed?

In any event, there appears to be numerous calls to glib in libpango
so it seems that anything that links to libpango would need to link to
glib. 

Am I wrong here? It happened once before, if I recall ... ;>
Comment 6 Owen Taylor 2004-06-23 21:44:53 UTC
This is a glib configuration problem on your system then. You
seem to be generating a static copy of 
g_string_append_c_inline in every file where glib.h is included,
which is clearly highly undesirable.

You need to sort through the #ifdefs in gutil.h and figure out
why G_CAN_INLINE is being defined although you are getting copies
of functions declared inline in header files.
Comment 7 Dimitri Papadopoulos 2005-01-04 13:10:28 UTC
I can reproduce the exact same problem with glib-2.6.0 and pango-1.8.0.


I've tried the following:
$ cat > foo.c
#include <glib/gutils.h>
G_IMPLEMENT_INLINES
G_CAN_INLINE
G_INLINE_FUNC
$ 
$ c -E `pkg-config glib-2.0 --cflags-only-I` foo.c
[...]
# 2 "foo.c"
G_IMPLEMENT_INLINES
 1
 static inline
#ident "acomp: Forte Developer 7 C 5.4 Patch 111708-05 2003/04/06"
$ 


So gutils.h thinks the proper way of inlining is using "static inline" which
indeed appears to result in a static copy of g_string_append_c_inline being
generated. From gstring.h:
/* -- optimize g_strig_append_c --- */
#ifdef G_CAN_INLINE
static inline GString*
g_string_append_c_inline (GString *gstring,
[...]
  else
    g_string_insert_c (gstring, -1, c);
  return gstring;
}
#define g_string_append_c(gstr,c)       g_string_append_c_inline (gstr, c)
#endif /* G_CAN_INLINE */


Here is an example program:
$ cat > foo.c
#include <glib/gstring.h>
void foo(void) {
    GString bar;
    g_string_append_c(&bar, 'a');
}
$ 
$ cc -c `pkg-config glib-2.0 --cflags` foo.c
$ nm foo.o
[...]
[12]    |       672|     132|FUNC |LOCL |0    |2      |g_string_append_c_inline
[14]    |         0|       0|NOTY |GLOB |0    |UNDEF  |g_string_insert_c
[...]
$ 


Where should I look next?
Comment 8 Owen Taylor 2005-01-04 16:59:44 UTC
We just fixed this (missed marking this as a duplicate because of the
NEEDINFO)
Comment 9 Owen Taylor 2005-01-04 17:00:24 UTC

*** This bug has been marked as a duplicate of 157536 ***