[syslog-ng] Solaris 10 support(?) in latest versions (e.g. 3.3.2)

Balazs Scheidler bazsi at balabit.hu
Thu Nov 17 21:47:04 CET 2011


On Thu, 2011-11-17 at 13:27 -0600, Marvin Nipper wrote:
> OK.  After a "day and a half" of "hoop jumping", I managed to build a gcc 4.4.2 compiler on Solaris 10.  That's definitely _not_ a straightforward effort, and I had to "pick and choose" things from a number of different sites, to get that to work correctly.
> 
> So... I have successfully used that new compiler to rebuild my working syslog-ng 3.0.5 executable, so I know that it works.  (And I completely recompiled all of the underlying components, including pkg-config, libnet, glib, eventlog, and, openssl, so that none of the original gcc 3.4.3 "stuff" would be used.)  I even validated (with ldd) that the new executable had correctly linked the new gcc components (and nothing from the old gcc 3.4.3 world).
> 
> 
> So THEN, I tried, again, to compile the syslog-ng 3.3.2 components.
> 
> The good news is that it did not abend on the previously reported TLS-related portion of the code! (a "small success"!).
> 
> 
> The bad news is that it now gets to this point in the process (obviously a really long line):
> /bin/bash ../libtool --tag=CC   --mode=link gcc -std=gnu99  -g -O2 -Wall -pthrea
> d -no-undefined -release 3.3.2 -R/usr/local/lib -o libsyslog-ng.la -rpath /usr/l
> ocal/lib afinter.lo alarms.lo apphook.lo block-ref-parser.lo center.lo cfg.lo cf
> g-lexer.lo cfg-parser.lo children.lo compat.lo control.lo dgroup.lo dnscache.lo
> driver.lo filter.lo filter-expr-parser.lo globals.lo gprocess.lo gsockaddr.lo gs
> ocket.lo logmatcher.lo logmpx.lo logmsg.lo logparser.lo logpipe.lo logprocess.lo
>  logproto.lo logqueue.lo logqueue-fifo.lo logreader.lo logrewrite.lo logsource.l
> o logstamp.lo logtransport.lo logwriter.lo mainloop.lo memtrace.lo messages.lo m
> isc.lo msg-format.lo nvtable.lo parser-expr-parser.lo persist-state.lo plugin.lo
>  pragma-parser.lo rewrite-expr-parser.lo scratch-buffers.lo serialize.lo sgroup.
> lo stats.lo str-format.lo syslog-names.lo tags.lo templates.lo timeutils.lo util
> s.lo value-pairs.lo cfg-lex.lo cfg-grammar.lo filter-expr-grammar.lo block-ref-g
> rammar.lo pragma-grammar.lo parser-expr-grammar.lo rewrite-expr-grammar.lo -lpth
> read   -ldoor -lsocket -lrt -lnsl -L/usr/local/lib -lgmodule-2.0 -lgthread-2.0 -
> lpthread -lthread -lrt -lglib-2.0   -L/usr/local/lib -levtlog   -lresolv    -ldl
>  -Wl,--whole-archive -L../lib/ivykis/lib -livykis -L../lib/ivykis/modules -livyk
> is-modules -Wl,--no-whole-archive -lpthread
> 
> 
> And then starts throwing out these errors:
> ld: fatal: symbol 'g_trash_stack_push' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/alarms.o type=FUNC);
> ld: fatal: symbol 'g_trash_stack_pop' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/alarms.o type=FUNC);
> ld: fatal: symbol 'g_trash_stack_peek' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/alarms.o type=FUNC);
> ld: fatal: symbol 'g_trash_stack_height' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/alarms.o type=FUNC);
> ld: fatal: symbol 'g_bit_nth_msf' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/alarms.o type=FUNC);
> ld: fatal: symbol 'g_bit_nth_lsf' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/alarms.o type=FUNC);
> ld: fatal: symbol 'g_bit_storage' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/alarms.o type=FUNC);
> ld: fatal: symbol 'g_trash_stack_push' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/apphook.o type=FUNC);
> ld: fatal: symbol 'g_trash_stack_pop' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/apphook.o type=FUNC);
> ld: fatal: symbol 'g_trash_stack_peek' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/apphook.o type=FUNC);
> ld: fatal: symbol 'g_trash_stack_height' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/apphook.o type=FUNC);
> ld: fatal: symbol 'g_bit_nth_msf' is multiply-defined:
> 
> 
> It issues 427 "multiply-defined" error lines, similar to the ones above, before eventually ending with this final block of output:
> ld: fatal: symbol 'g_bit_nth_lsf' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/rewrite-expr-grammar.o type=FUNC);
> ld: fatal: symbol 'g_bit_storage' is multiply-defined:
>         (file .libs/afinter.o type=FUNC; file .libs/rewrite-expr-grammar.o type=FUNC);
> ld: fatal: file processing errors. No output written to .libs/libsyslog-ng-3.3.2.so

hmm.. this seems like a glib header <> library mess, as if it was
defined in the header, and becoming part of the compiled module
everywhere where the header was included into.

This is how g_trash_stack_push() is defined in the glib headers (we're
using 2.14.6):

G_INLINE_FUNC void      g_trash_stack_push      (GTrashStack **stack_p,
                                                 gpointer      data_p);

G_INLINE_FUNC is defined as a macro in the same file, this way:

#if defined (G_HAVE_INLINE) && defined (__GNUC__) && defined (__STRICT_ANSI__)
#  undef inline
#  define inline __inline__
#elif !defined (G_HAVE_INLINE)
#  undef inline
#  if defined (G_HAVE___INLINE__)
#    define inline __inline__
#  elif defined (G_HAVE___INLINE)
#    define inline __inline
#  else /* !inline && !__inline__ && !__inline */
#    define inline  /* don't inline, then */
#  endif
#endif
#ifdef G_IMPLEMENT_INLINES
#  define G_INLINE_FUNC
#  undef  G_CAN_INLINE
#elif defined (__GNUC__) 
#  if __GNUC_PREREQ (4,2) && defined (__STDC_VERSION__) \
   && __STDC_VERSION__ >= 199901L
#    define G_INLINE_FUNC extern __inline __attribute__ ((__gnu_inline__))
#  else
#    define G_INLINE_FUNC extern __inline
#  endif
#elif defined (G_CAN_INLINE) 
#  define G_INLINE_FUNC static inline
#else /* can't inline */
#  define G_INLINE_FUNC
#endif /* !G_INLINE_FUNC */

The macros that this macro definition depends on are defined 
in glibconfig.h, usually installed in $prefix/lib/glib-2.0/include/glibconfig.h

How do you tell syslog-ng where the glib libraries are? Are 
those autodetected? are you using pkg-config?

> collect2: ld returned 1 exit status
> gmake[4]: *** [libsyslog-ng.la] Error 1
> gmake[4]: Leaving directory `/var/opt/packages/syslog-ng-3.3.2/lib'
> gmake[3]: *** [all-recursive] Error 1
> gmake[3]: Leaving directory `/var/opt/packages/syslog-ng-3.3.2/lib'
> gmake[2]: *** [all] Error 2
> gmake[2]: Leaving directory `/var/opt/packages/syslog-ng-3.3.2/lib'
> gmake[1]: *** [all-recursive] Error 1
> gmake[1]: Leaving directory `/var/opt/packages/syslog-ng-3.3.2'
> gmake: *** [all] Error 2
> 
> 
> So, once again, I'm looking for some guidance.  My system environment is mentioned in the original thread (below).  This is a "really new" Solaris 10 setup (i.e. not some "ancient" version), and now with an operational 4.x gcc compiler, and I still can't seem to make this work.
> 
> Sorry to be a pest.  I really do appreciate ALL of the assistance that has been given.

no problem, it's just getting a Solaris box up-to-speed for compiling
GNU stuff is not easy.

sunfreeware makes that easier though.

-- 
Bazsi




More information about the syslog-ng mailing list