Make throws link errors over glib2 when compiling syslog-ng 3.0.1
Hello all, I know that the issue of rewriting syslog messages is a recurring debate here on the list :-) but I'm trying to get 3.0.1 up and running as we need to strip out some info to protect the privacy of our users (there, good cause flag set). I'm having a go under Cygwin and configure runs fine, but make dies on me in a flurry of messages (see below). I'm not much of a devhead, but these seem to be glib2 issue to me. Yet I'm a but stumped on how to beat some sense into it, and any pointer would be hugely appreciated. Thanks in advance, Joost tail of configure output: syslog-ng Open Source Edition 3.0.1 configured Compiler options: compiler : gcc compiler options : -g -O2 -Wall -I/usr/include/glib-2.0 -I/usr/lib /glib-2.0/include -I/usr/include/eventlog -D_GNU_SOURCE -D_LARGEFILE_SOU RCE -D_FILE_OFFSET_BITS=64 linker flags : prefix : /usr/local Features: Sun STREAMS support : no Sun Door support : no Debug symbols : no GCC profiling : no Memtrace : no IPV6 support : no spoof-source support : no tcp-wrapper support : no SSL support : yes SQL support : no Linux capability support : no PCRE support : no Env wrapper support : no the part where make goes of the rails: gcc -g -O2 -Wall -o syslog-ng.exe main.o libsyslog-ng.a -Wl,-Bstatic -lfl -lglib-2.0 -lintl -liconv -levtlog -lssl -lcrypto -Wl,-Bdynamic -ld l /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcrypto.a(cryptlib.o):cryptlib.c:(. text+0x260): multiple definition of `_DllMain@12' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libglib-2.0.a(gutils.o):gutils.c:(.te xt+0x2c0): first defined here main.o: In function `main_loop_wakeup': /download/syslog-ng-3.0.1/src/main.c:119: undefined reference to `__imp__g_threa ds_got_initialized' /download/syslog-ng-3.0.1/src/main.c:119: undefined reference to `__imp__g_threa d_use_default_impl' /download/syslog-ng-3.0.1/src/main.c:119: undefined reference to `__imp__g_threa d_functions_for_glib_use' /download/syslog-ng-3.0.1/src/main.c:122: undefined reference to `__imp__g_threa ds_got_initialized' /download/syslog-ng-3.0.1/src/main.c:122: undefined reference to `__imp__g_threa d_use_default_impl' /download/syslog-ng-3.0.1/src/main.c:122: undefined reference to `__imp__g_threa d_functions_for_glib_use' main.o: In function `main_loop_run': /download/syslog-ng-3.0.1/src/main.c:195: undefined reference to `__imp__g_threa ds_got_initialized' /download/syslog-ng-3.0.1/src/main.c:195: undefined reference to `__imp__g_threa d_use_default_impl' /download/syslog-ng-3.0.1/src/main.c:195: undefined reference to `__imp__g_threa d_functions_for_glib_use' /download/syslog-ng-3.0.1/src/main.c:198: undefined reference to `__imp__g_threa ds_got_initialized' /download/syslog-ng-3.0.1/src/main.c:198: undefined reference to `__imp__g_threa d_use_default_impl' /download/syslog-ng-3.0.1/src/main.c:198: undefined reference to `__imp__g_threa d_functions_for_glib_use' libsyslog-ng.a(messages.o): In function `msg_event_create': /download/syslog-ng-3.0.1/src/messages.c:140: undefined reference to `__imp__g_t hreads_got_initialized' /download/syslog-ng-3.0.1/src/messages.c:140: undefined reference to `__imp__g_t hread_use_default_impl' /download/syslog-ng-3.0.1/src/messages.c:140: undefined reference to `__imp__g_t hread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/messages.c:149: undefined reference to `__imp__g_t hreads_got_initialized' /download/syslog-ng-3.0.1/src/messages.c:149: undefined reference to `__imp__g_t hread_use_default_impl' /download/syslog-ng-3.0.1/src/messages.c:149: undefined reference to `__imp__g_t hread_functions_for_glib_use' libsyslog-ng.a(messages.o): In function `msg_event_send': /download/syslog-ng-3.0.1/src/messages.c:167: undefined reference to `__imp__g_t hreads_got_initialized' /download/syslog-ng-3.0.1/src/messages.c:167: undefined reference to `__imp__g_t hread_use_default_impl' /download/syslog-ng-3.0.1/src/messages.c:167: undefined reference to `__imp__g_t hread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/messages.c:169: undefined reference to `__imp__g_t hreads_got_initialized' /download/syslog-ng-3.0.1/src/messages.c:169: undefined reference to `__imp__g_t hread_use_default_impl' /download/syslog-ng-3.0.1/src/messages.c:169: undefined reference to `__imp__g_t hread_functions_for_glib_use' libsyslog-ng.a(timeutils.o): In function `cached_mktime': /download/syslog-ng-3.0.1/src/timeutils.c:77: undefined reference to `__imp__g_t hreads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:77: undefined reference to `__imp__g_t hread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:77: undefined reference to `__imp__g_t hread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:77: undefined reference to `__imp__g_t hreads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:92: undefined reference to `__imp__g_t hreads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:92: undefined reference to `__imp__g_t hread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:92: undefined reference to `__imp__g_t hread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:92: undefined reference to `__imp__g_t hreads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:95: undefined reference to `__imp__g_t hread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:95: undefined reference to `__imp__g_t hread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:90: undefined reference to `__imp__g_t hread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:90: undefined reference to `__imp__g_t hread_functions_for_glib_use' libsyslog-ng.a(timeutils.o): In function `cached_localtime': /download/syslog-ng-3.0.1/src/timeutils.c:105: undefined reference to `__imp__g_ threads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:105: undefined reference to `__imp__g_ thread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:105: undefined reference to `__imp__g_ thread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:112: undefined reference to `__imp__g_ threads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:114: undefined reference to `__imp__g_ threads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:114: undefined reference to `__imp__g_ thread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:114: undefined reference to `__imp__g_ thread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:114: undefined reference to `__imp__g_ threads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:117: undefined reference to `__imp__g_ thread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:117: undefined reference to `__imp__g_ thread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:112: undefined reference to `__imp__g_ thread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:112: undefined reference to `__imp__g_ thread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:109: undefined reference to `__imp__g_ threads_got_initialized' libsyslog-ng.a(timeutils.o): In function `get_local_timezone_ofs': /download/syslog-ng-3.0.1/src/timeutils.c:134: undefined reference to `__imp__g_ threads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:134: undefined reference to `__imp__g_ thread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:134: undefined reference to `__imp__g_ thread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:134: undefined reference to `__imp__g_ threads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:144: undefined reference to `__imp__g_ thread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:144: undefined reference to `__imp__g_ thread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:165: undefined reference to `__imp__g_ threads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:165: undefined reference to `__imp__g_ thread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:165: undefined reference to `__imp__g_ thread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:165: undefined reference to `__imp__g_ threads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:169: undefined reference to `__imp__g_ thread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:169: undefined reference to `__imp__g_ thread_functions_for_glib_use' libsyslog-ng.a(timeutils.o): In function `clean_time_cache': /download/syslog-ng-3.0.1/src/timeutils.c:177: undefined reference to `__imp__g_ threads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:177: undefined reference to `__imp__g_ thread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:177: undefined reference to `__imp__g_ thread_functions_for_glib_use' /download/syslog-ng-3.0.1/src/timeutils.c:177: undefined reference to `__imp__g_ threads_got_initialized' /download/syslog-ng-3.0.1/src/timeutils.c:179: undefined reference to `__imp__g_ thread_use_default_impl' /download/syslog-ng-3.0.1/src/timeutils.c:179: undefined reference to `__imp__g_ thread_functions_for_glib_use' libsyslog-ng.a(radix.o): In function `r_parser_string': /download/syslog-ng-3.0.1/src/radix.c:42: undefined reference to `__imp__g_ascii _table' libsyslog-ng.a(radix.o): In function `r_parser_ipv4': /download/syslog-ng-3.0.1/src/radix.c:108: undefined reference to `__imp__g_asci i_table' libsyslog-ng.a(radix.o): In function `r_parser_number': /download/syslog-ng-3.0.1/src/radix.c:135: undefined reference to `__imp__g_asci i_table' /download/syslog-ng-3.0.1/src/radix.c:135: undefined reference to `__imp__g_asci i_table' collect2: ld returned 1 exit status make[2]: *** [syslog-ng.exe] Error 1 make[2]: Leaving directory `/download/syslog-ng-3.0.1/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/download/syslog-ng-3.0.1' make: *** [all] Error 2
On Wed, 2009-01-14 at 08:51 +0100, Joost De Cock wrote:
Hello all,
I know that the issue of rewriting syslog messages is a recurring debate here on the list :-) but I'm trying to get 3.0.1 up and running as we need to strip out some info to protect the privacy of our users (there, good cause flag set).
I'm having a go under Cygwin and configure runs fine, but make dies on me in a flurry of messages (see below). I'm not much of a devhead, but these seem to be glib2 issue to me. Yet I'm a but stumped on how to beat some sense into it, and any pointer would be hugely appreciated.
Thanks in advance, Joost
tail of configure output:
syslog-ng Open Source Edition 3.0.1 configured Compiler options: compiler : gcc compiler options : -g -O2 -Wall -I/usr/include/glib-2.0 -I/usr/lib /glib-2.0/include -I/usr/include/eventlog -D_GNU_SOURCE -D_LARGEFILE_SOU RCE -D_FILE_OFFSET_BITS=64 linker flags : prefix : /usr/local Features: Sun STREAMS support : no Sun Door support : no Debug symbols : no GCC profiling : no Memtrace : no IPV6 support : no spoof-source support : no tcp-wrapper support : no SSL support : yes SQL support : no Linux capability support : no PCRE support : no Env wrapper support : no
the part where make goes of the rails:
gcc -g -O2 -Wall -o syslog-ng.exe main.o libsyslog-ng.a -Wl,-Bstatic -lfl -lglib-2.0 -lintl -liconv -levtlog -lssl -lcrypto -Wl,-Bdynamic -ld l
hmm.. syslog-ng decides to be threaded/non-threaded based on the --enable-sql setting (e.g. if SQL destinations are enabled, syslog-ng becomes threaded). As it seems your glib is missing threading related symbols: __imp__g_thread_use_default_impl, however syslog-ng should not be threaded at all. hmm...hmm.. the above variable is defined inside glib and not in gthread, and still the linking phase does not find it. Maybe it is a consequence of this error message: /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcrypto.a(cryptlib.o):cryptlib.c:(. text+0x260): multiple definition of `_DllMain@12' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libglib-2.0.a(gutils.o):gutils.c:(.te xt+0x2c0): first defined here and this causes glib to be dropped from the link. can you attempt configure syslog-ng using --enable-dynamic-linking ? Checking out the glib source, glib does not seem to be prepared to be used in static linking, but I may be wrong here. -- Bazsi
Balazs Scheidler schreef:
On Wed, 2009-01-14 at 08:51 +0100, Joost De Cock wrote:
<snip>
hmm.. syslog-ng decides to be threaded/non-threaded based on the --enable-sql setting (e.g. if SQL destinations are enabled, syslog-ng becomes threaded).
As it seems your glib is missing threading related symbols: __imp__g_thread_use_default_impl, however syslog-ng should not be threaded at all.
hmm...hmm.. the above variable is defined inside glib and not in gthread, and still the linking phase does not find it.
Maybe it is a consequence of this error message:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcrypto.a(cryptlib.o):cryptlib.c:(. text+0x260): multiple definition of `_DllMain@12' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libglib-2.0.a(gutils.o):gutils.c:(.te xt+0x2c0): first defined here
and this causes glib to be dropped from the link. can you attempt configure syslog-ng using --enable-dynamic-linking ? Checking out the glib source, glib does not seem to be prepared to be used in static linking, but I may be wrong here.
*hmmpff* => That was a hug! Works perfectly. You are the best : ) Joost PS: Proof: $ ./syslog-ng.exe -V syslog-ng 3.0.1 Revision: ssh+git://bazsi@git.balabit//var/scm/git/syslog-ng/syslog-ng-ose--main line--3.0#master#93a342dae3a2b0cb15811d0c34ea7f58b3fba14e Compile-Date: Jan 14 2009 13:35:35 Enable-Threads: off Enable-Debug: off Enable-GProf: off Enable-Memtrace: off Enable-Sun-STREAMS: off Enable-Sun-Door: off Enable-IPv6: off Enable-Spoof-Source: off Enable-TCP-Wrapper: off Enable-SSL: off Enable-SQL: off Enable-Linux-Caps: off Enable-Pcre: off
participants (2)
-
Balazs Scheidler
-
Joost De Cock