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

Marvin Nipper Marvin.Nipper at stream.com
Fri Nov 18 04:17:00 CET 2011



-----Original Message-----
From: syslog-ng-bounces at lists.balabit.hu [mailto:syslog-ng-bounces at lists.balabit.hu] On Behalf Of Balazs Scheidler
Sent: Thursday, November 17, 2011 1:47 PM
To: Syslog-ng users' and developers' mailing list
Subject: Re: [syslog-ng] Solaris 10 support(?) in latest versions (e.g. 3.3.2)

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?
[Marvin Nipper] 
I'm using pkg-config.
When building GLIB, I set this variable, before the configure: PKG_CONFIG=/usr/local/bin/pkg-config
And when building syslog-ng, I set these variables before running configure:
PKG_CONFIG=/usr/local/bin/pkg-config
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/local/ssl/lib/pkgconfig"

BUT... I downloaded and built the exact version of GLIB that you are using.  I then kicked off the 3.3.2 build process again.  I did NOT get the "multiply-defined" errors from before, so that seems to be resolved.  But annoyingly, I now am having what seems to be a whole new, libnet related problem.  It all starts with this stuff:
libtool: link: gcc -std=gnu99 -shared -Wl,-z -Wl,text -Wl,-h -Wl,libafsocket-not
ls.so -o .libs/libafsocket-notls.so  .libs/libafsocket_notls_la-afsocket.o .libs
/libafsocket_notls_la-afunix.o .libs/libafsocket_notls_la-afinet.o .libs/libafso
cket_notls_la-afsocket-grammar.o .libs/libafsocket_notls_la-afsocket-parser.o .l
ibs/libafsocket_notls_la-afsocket-plugin.o   -R/var/opt/packages/syslog-ng-3.3.2
/lib/.libs -R/usr/local/lib ../../lib/.libs/libsyslog-ng.so -L/usr/local/lib -L/
var/opt/packages/syslog-ng-3.3.2/lib/ivykis/lib -L/var/opt/packages/syslog-ng-3.
3.2/lib/ivykis/modules -L/var/opt/packages/syslog-ng-3.3.2/lib/ivykis/lib/.libs
-lsocket -lnsl -lnet -lpthread -lc  -pthread   -pthread^M
Text relocation remains                         referenced^M
    against symbol                  offset      in file^M
.rodata (section)                   0x7         /usr/lib/libnet.a(libnet_build_i
p.o)^M
.rodata.str1.1 (merged string section) 0xc              /usr/lib/libnet.a(libnet
_build_ip.o)^M
.rodata (section)                   0xdd        /usr/lib/libnet.a(libnet_build_i
p.o)^M
.rodata.str1.1 (merged string section) 0xe2             /usr/lib/libnet.a(libnet
_build_ip.o)^M
.rodata (section)                   0x122       /usr/lib/libnet.a(libnet_build_i
p.o)^M
.rodata.str1.1 (merged string section) 0x127            /usr/lib/libnet.a(libnet
_build_ip.o)^M


After MANY more similar lines (i.e. similar to the lines above), it eventually ends up here:
errno                               0x375       /usr/lib/libnet.a(libnet_if_addr
.o)^M
strpbrk                             0x318       /usr/lib/libnet.a(libnet_link_dl
pi.o)^M
ld: fatal: relocations remain against allocatable but non-writable sections^M
collect2: ld returned 1 exit status^M
gmake[4]: *** [libafsocket-notls.la] Error 1^M
gmake[4]: Leaving directory `/var/opt/packages/syslog-ng-3.3.2/modules/afsocket'
^M
gmake[3]: *** [all] Error 2^M
gmake[3]: Leaving directory `/var/opt/packages/syslog-ng-3.3.2/modules/afsocket'
^M
gmake[2]: *** [all-recursive] Error 1^M
gmake[2]: Leaving directory `/var/opt/packages/syslog-ng-3.3.2/modules'^M
gmake[1]: *** [all-recursive] Error 1^M
gmake[1]: Leaving directory `/var/opt/packages/syslog-ng-3.3.2'^M
gmake: *** [all] Error 2^M


I just feel like I'm going down the rabbit hole with all of this.  I really do wonder how you build your Solaris 10 components, because no matter what I do (newest version of Solaris 10, newly built GCC 4.4.2 compiler, same GLIB, etc.), I just keep stepping into a new mess.

I'm running libnet 1.1.2.1, which is the very same version that I've been using for MANY years, to build MANY versions of syslog-ng, up through 3.0.5, and it has worked flawlessly.  So why this is now going bonkers, with that same version, is beyond me??  The only other version of libnet that I've ever found was libnet 0.10.11, and I could never get that to compile on Solaris.

So... sorry for the whining.  I've just put a lot of time and effort into trying to make this work, and feel like a dog chasing its tail.  No matter what I "fix", or "upgrade", I just continue to find some "new thing" that seems to need to be changed, in order to try to make this work.  If I had never previously built syslog-ng, I might understand that, but I have built many versions over the years, with no problems, and then it just seems to have "diverged" from a codebase that seems to be usable without a serious amount of augmentation to the stock Solaris components.

Anyway... again, any and all input appreciated.  I "seem to be" closer to getting this compiled, than I have been for a very long time.  It would really be nice to see this compile clean.  THANKS, as always, for your help.


> 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


______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq


This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.



More information about the syslog-ng mailing list