<br><font size=2 face="sans-serif">Hi Balazs,</font>
<br>
<br><font size=2 face="sans-serif">Thanks for your expert advise. I have
successfully compiled syslog-ng-2.1.3 with --enable-static-linking option.
I were using old version of gcc (3.2.3) which causing compilation (make)
fail. I upgraded my gcc to 4.1.2 to get rid of compilation errors.</font>
<br>
<br><font size=2 face="sans-serif">Though it is working fine till now,
I have faced some error messages on standard video output while doing 'make'.
I am not sure if this will impact new build syslog-ng application in terms
of created problem in logging features.</font>
<br>
<br><font size=2 face="sans-serif">I am here pasting the error output:</font>
<br>
<br><font size=2 face="sans-serif">*************************************************</font>
<br><font size=2 face="sans-serif">macros.c: In function âresult_appendâ:</font>
<br><font size=2 face="sans-serif">macros.c:137: warning: pointer targets
in passing argument 2 of âg_string_append_lenâ differ in signedness</font>
<br><font size=2 face="sans-serif">macros.c: In function âlog_macro_expandâ:</font>
<br><font size=2 face="sans-serif">macros.c:149: warning: pointer targets
in passing argument 2 of âresult_appendâ differ in signedness</font>
<br><font size=2 face="sans-serif">macros.c:218: warning: pointer targets
in passing argument 2 of âresult_appendâ differ in signedness</font>
<br><font size=2 face="sans-serif">macros.c:238: warning: pointer targets
in passing argument 2 of âresult_appendâ differ in signedness</font>
<br><font size=2 face="sans-serif">macros.c:246: warning: pointer targets
in passing argument 2 of âresult_appendâ differ in signedness</font>
<br><font size=2 face="sans-serif">macros.c:268: warning: pointer targets
in passing argument 2 of âresult_appendâ differ in signedness</font>
<br><font size=2 face="sans-serif">macros.c:413: warning: pointer targets
in passing argument 2 of âresult_appendâ differ in signedness</font>
<br><font size=2 face="sans-serif">macros.c:432: warning: pointer targets
in passing argument 2 of âresult_appendâ differ in signedness</font>
<br><font size=2 face="sans-serif">macros.c:450: warning: pointer targets
in passing argument 2 of âresult_appendâ differ in signedness</font>
<br><font size=2 face="sans-serif">filter.c: In function âfilter_netmask_evalâ:</font>
<br><font size=2 face="sans-serif">filter.c:452: warning: âaddr.s_addrâ
may be used uninitialized in this function</font>
<br><font size=2 face="sans-serif">logmsg.c: In function âlog_msg_parseâ:</font>
<br><font size=2 face="sans-serif">logmsg.c:151: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:216: warning: pointer targets
in passing argument 2 of âg_string_assign_lenâ differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:224: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:242: warning: pointer targets
in passing argument 1 of âstrlenâ differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:283: warning: pointer targets
in passing argument 2 of âg_string_assign_lenâ differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:309: warning: pointer targets
in passing argument 2 of âg_string_assign_lenâ differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:335: warning: pointer targets
in passing argument 2 of âg_string_assign_lenâ differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:394: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:398: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:429: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:463: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:474: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:486: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:499: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:520: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:525: warning: pointer targets
in assignment differ in signedness</font>
<br><font size=2 face="sans-serif">logmsg.c:530: warning: pointer targets
in passing argument 2 of âg_string_assign_lenâ differ in signedness</font>
<br><font size=2 face="sans-serif">main.o(.text+0x133): In function `setup_creds':</font>
<br><font size=2 face="sans-serif">/home/soetest1/syslog-ng-2.1.3/src/main.c:324:
Using 'initgroups' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">libsyslog-ng.a(misc.o)(.text+0xc4):
In function `resolve_group':</font>
<br><font size=2 face="sans-serif">/home/soetest1/syslog-ng-2.1.3/src/misc.c:283:
Using 'getgrnam' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">libsyslog-ng.a(misc.o)(.text+0x144):
In function `resolve_user':</font>
<br><font size=2 face="sans-serif">/home/soetest1/syslog-ng-2.1.3/src/misc.c:258:
Using 'getpwnam' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">/usr/local/lib/libglib-2.0.a(gutils.o)(.text+0xbd8):
In function `g_get_any_init_do':</font>
<br><font size=2 face="sans-serif">/home/soetest1/glib-2.16.0/glib/gutils.c:1646:
Using 'getpwuid' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">/usr/local/lib/libglib-2.0.a(gutils.o)(.text+0xbc8):/home/soetest1/glib-2.16.0/glib/gutils.c:1645:
Using 'setpwent' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">/usr/local/lib/libglib-2.0.a(gutils.o)(.text+0xbe3):/home/soetest1/glib-2.16.0/glib/gutils.c:1647:
Using 'endpwent' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">/usr/local/lib/libglib-2.0.a(gutils.o)(.text+0x9d1):/home/soetest1/glib-2.16.0/glib/gutils.c:1589:
Using 'getpwnam_r' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">/usr/local/lib/libglib-2.0.a(gutils.o)(.text+0xa10):/home/soetest1/glib-2.16.0/glib/gutils.c:1595:
Using 'getpwuid_r' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">libsyslog-ng.a(afinet.o)(.text+0xcbb):
In function `afinet_resolve_name':</font>
<br><font size=2 face="sans-serif">/home/soetest1/syslog-ng-2.1.3/src/afinet.c:103:
Using 'getaddrinfo' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">libsyslog-ng.a(misc.o)(.text+0x50a):
In function `resolve_hostname':</font>
<br><font size=2 face="sans-serif">/home/soetest1/syslog-ng-2.1.3/src/misc.c:166:
Using 'gethostbyaddr' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">libsyslog-ng.a(misc.o)(.text+0x464):
In function `getlonghostname':</font>
<br><font size=2 face="sans-serif">/home/soetest1/syslog-ng-2.1.3/src/misc.c:71:
Using 'gethostbyname' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">/usr/local/lib/libnet.a(libnet_resolve.o)(.text+0x4dc):
In function `libnet_name2addr6':</font>
<br><font size=2 face="sans-serif">: Using 'gethostbyname2' in statically
linked applications requires at runtime the shared libraries from the glibc
version used for linking</font>
<br><font size=2 face="sans-serif">libsyslog-ng.a(afinet.o)(.text+0x6bb):
In function `afinet_set_port':</font>
<br><font size=2 face="sans-serif">/home/soetest1/syslog-ng-2.1.3/src/afinet.c:58:
Using 'getservbyname' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">loggen.o(.text+0x6cc): In function `main':</font>
<br><font size=2 face="sans-serif">/home/soetest1/syslog-ng-2.1.3/tests/loggen/loggen.c:236:
Using 'getaddrinfo' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking</font>
<br><font size=2 face="sans-serif">************************************************</font>
<br>
<br><font size=2 face="sans-serif">Grateful if anybody put their comment
on this.</font>
<br>
<br>
<br><font size=2 face="sans-serif">With Regards,<br>
Chanchal Verma</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Balazs Scheidler <bazsi@balabit.hu></b>
</font>
<p><font size=1 face="sans-serif">01/12/2009 08:44 PM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Chanchal Verma/GIS/CSC@CSC</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: Fw: [syslog-ng] Error encountered
while building syslog-ng-2.1.3 on
RHEL3</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>add -lnsl to the end of your linking command.<br>
<br>
On Mon, 2009-01-12 at 19:37 +0530, Chanchal Verma wrote:<br>
> <br>
> Hi Bazsi, <br>
> <br>
> Could you please help me is resolving error message coming to<br>
> syslog-ng, when I am trying to build is with --enable-static-linking?
<br>
> <br>
> Please refer to mail tail for detail. <br>
> <br>
> <br>
> With Regards,<br>
> Chanchal Verma<br>
> <br>
> ----- Forwarded by Chanchal Verma/GIS/CSC on 01/12/2009 07:35 PM<br>
> ----- <br>
> Chanchal Verma/GIS/CSC@CSC <br>
> Sent by:<br>
> syslog-ng-bounces@lists.balabit.hu <br>
> <br>
> 01/09/2009 07:25 PM <br>
> Please respond to<br>
> "Syslog-ng users' and developers'<br>
> mailing list"<br>
> <syslog-ng@lists.balabit.hu><br>
> <br>
> <br>
> <br>
> <br>
> To<br>
> Kostyantyn<br>
> Gushtin<br>
> <kgushtin@n-ix.com.ua>, syslog-ng@lists.balabit.hu <br>
> cc<br>
> <br>
> Subject<br>
> Re: [syslog-ng]<br>
> Error encountered<br>
> while building<br>
> syslog-ng-2.1.3<br>
> on<br>
> RHEL3<br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> Hi Kostyantyn, <br>
> <br>
> I have checked that all required static libraries (.a) are available<br>
> at /usr/lib location. I also created linked at /usr/local/lib for
all<br>
> requried libraries. It is giving same error messages. <br>
> Following libraries are checked available at /usr/lib:<br>
> <br>
> libnsl.a <br>
> librt.a <br>
> libfl.a <br>
> libevtlog.a (Created linked<br>
> from /opt/soe/local/syslog-ng-2.1.3/eventlog/lib/libevtlog.a)<br>
> libnet.a <br>
> libwrap.a <br>
> <br>
> Here below is error messages: <br>
> <br>
> -----------------------------------------------------------<br>
> Here below is error messge: <br>
> <br>
> Compilation option: <br>
> [champ@ankit-lin syslog-ng-2.1.3]# ./configure<br>
> --enable-static-linking --prefix=/opt/soe/local/syslog-ng-2.1.3
<br>
> <br>
> Make works fine uptill (Pasted last few lines):<br>
> .. <br>
> .. <br>
> if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/glib-2.0<br>
> -I/usr/local/lib/glib-2.0/include -I/opt/soe/local/<br>
> syslog-ng-2.1.3/eventlog/include/eventlog -D_BSD_SOURCE<br>
> -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -D_GNU_SOUR<br>
> CE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT<br>
> globals.o -MD -MP -MF ".deps/globals.Tpo" \ <br>
> -c -o globals.o `test -f 'globals.c' || echo './'`globals.c;
\<br>
> then mv -f ".deps/globals.Tpo" ".deps/globals.Po";
\ <br>
> else rm -f ".deps/globals.Tpo"; exit 1; \<br>
> fi <br>
> rm -f libsyslog-ng.a <br>
> ar cru libsyslog-ng.a misc.o utils.o messages.o syslog-names.o cfg.o<br>
> cfg-lex.o cfg-grammar.o macros.o filter.o logmsg.o l <br>
> ogpipe.o logsource.o driver.o sgroup.o dgroup.o center.o templates.o<br>
> logreader.o logwriter.o affile.o afstreams.o afuser. <br>
> o afprog.o afsocket.o afunix.o afinet.o afinter.o children.o stats.o<br>
> gsockaddr.o fdwrite.o fdread.o memtrace.o dnscache.o <br>
> apphook.o serialize.o logqueue.o afsql.o alarms.o globals.o<br>
> ranlib libsyslog-ng.a <br>
> if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/glib-2.0<br>
> -I/usr/local/lib/glib-2.0/include -I/opt/soe/local/<br>
> syslog-ng-2.1.3/eventlog/include/eventlog -D_BSD_SOURCE<br>
> -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -D_GNU_SOUR<br>
> CE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT
main.o<br>
> -MD -MP -MF ".deps/main.Tpo" \ <br>
> -c -o main.o `test -f 'main.c' || echo './'`main.c; \<br>
> then mv -f ".deps/main.Tpo" ".deps/main.Po"; \<br>
> else rm -f ".deps/main.Tpo"; exit 1; \ <br>
> fi <br>
> gcc -g -O2 -Wall -o syslog-ng main.o libsyslog-ng.a
-static -lnsl<br>
> -lrt -lfl -L/usr/local/lib -lglib-2.0 -L/opt/soe<br>
> /local/syslog-ng-2.1.3/eventlog/lib -levtlog -lnet -lwrap<br>
> make[2]: Leaving directory `/home/soetest1/syslog-ng-2.1.3/src'<br>
> make[1]: Leaving directory `/home/soetest1/syslog-ng-2.1.3'<br>
> <br>
> Showing error message on standard output device:<br>
> <br>
> main.o(.text+0x5ec): In function `setup_creds': <br>
> /home/soetest1/syslog-ng-2.1.3/src/main.c:324: Using 'initgroups'
in<br>
> statically linked applications requires at runtime t <br>
> he shared libraries from the glibc version used for linking<br>
> libsyslog-ng.a(misc.o)(.text+0x44d): In function `resolve_group':<br>
> /home/soetest1/syslog-ng-2.1.3/src/misc.c:283: Using 'getgrnam' in<br>
> statically linked applications requires at runtime the <br>
> shared libraries from the glibc version used for linking<br>
> /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libwrap.a(options.o)(.text+0x53c):
In function `group_option': <br>
> : Using 'endgrent' in statically linked applications requires at<br>
> runtime the shared libraries from the glibc version used <br>
> for linking <br>
> libsyslog-ng.a(misc.o)(.text+0x3ed): In function `resolve_user':<br>
> /home/soetest1/syslog-ng-2.1.3/src/misc.c:258: Using 'getpwnam' in<br>
> statically linked applications requires at runtime the <br>
> shared libraries from the glibc version used for linking<br>
> /usr/local/lib/libglib-2.0.a(gutils.o)(.text+0xbd8): In function<br>
> `g_get_any_init_do':<br>
> /home/soetest1/glib-2.16.0/glib/gutils.c:1646: Using 'getpwuid' in<br>
> statically linked applications requires at runtime the <br>
> shared libraries from the glibc version used for linking<br>
> /usr/local/lib/libglib-2.0.a(gutils.o)(.text<br>
> +0xbc8):/home/soetest1/glib-2.16.0/glib/gutils.c:1645: Using<br>
> 'setpwent' in st <br>
> atically linked applications requires at runtime the shared libraries<br>
> from the glibc version used for linking <br>
> /usr/local/lib/libglib-2.0.a(gutils.o)(.text<br>
> +0xbe3):/home/soetest1/glib-2.16.0/glib/gutils.c:1647: Using<br>
> 'endpwent' in st <br>
> atically linked applications requires at runtime the shared libraries<br>
> from the glibc version used for linking <br>
> /usr/local/lib/libglib-2.0.a(gutils.o)(.text<br>
> +0x9d1):/home/soetest1/glib-2.16.0/glib/gutils.c:1589: Using<br>
> 'getpwnam_r' in <br>
> statically linked applications requires at runtime the shared<br>
> libraries from the glibc version used for linking <br>
> /usr/local/lib/libglib-2.0.a(gutils.o)(.text<br>
> +0xa10):/home/soetest1/glib-2.16.0/glib/gutils.c:1595: Using<br>
> 'getpwuid_r' in <br>
> statically linked applications requires at runtime the shared<br>
> libraries from the glibc version used for linking <br>
> libsyslog-ng.a(afinet.o)(.text+0x163): In function<br>
> `afinet_resolve_name':<br>
> /home/soetest1/syslog-ng-2.1.3/src/afinet.c:103: Using 'getaddrinfo'<br>
> in statically linked applications requires at runtim <br>
> e the shared libraries from the glibc version used for linking<br>
> libsyslog-ng.a(misc.o)(.text+0x1d1): In function `resolve_hostname':<br>
> /home/soetest1/syslog-ng-2.1.3/src/misc.c:166: Using 'gethostbyaddr'<br>
> in statically linked applications requires at runtim <br>
> e the shared libraries from the glibc version used for linking<br>
> libsyslog-ng.a(misc.o)(.text+0xbd): In function `getlonghostname':<br>
> /home/soetest1/syslog-ng-2.1.3/src/misc.c:71: Using 'gethostbyname'
in<br>
> statically linked applications requires at runtime<br>
> the shared libraries from the glibc version used for linking<br>
> /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libnet.a(libnet_resolve.o)(.text+0x4dc):
In function `libnet_name2addr6 <br>
> ': <br>
> : Using 'gethostbyname2' in statically linked applications requires
at<br>
> runtime the shared libraries from the glibc versio<br>
> n used for linking <br>
> libsyslog-ng.a(afinet.o)(.text+0xb2): In function `afinet_set_port':<br>
> /home/soetest1/syslog-ng-2.1.3/src/afinet.c:58: Using 'getservbyname'<br>
> in statically linked applications requires at runti <br>
> me the shared libraries from the glibc version used for linking<br>
> /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libwrap.a(hosts_access.o)(.text+0x862):
In function `host_match': <br>
> : undefined reference to `yp_get_default_domain' <br>
> collect2: ld returned 1 exit status <br>
> make[2]: *** [syslog-ng] Error 1 <br>
> make[1]: *** [all-recursive] Error 1 <br>
> make: *** [all] Error 2 <br>
> ----------------------------------------------------<br>
> <br>
> With Regards,<br>
> Chanchal Verma<br>
> <br>
> <br>
> Kostyantyn Gushtin<br>
> <kgushtin@n-ix.com.ua> <br>
> <br>
> 01/09/2009 06:08 PM <br>
> <br>
> <br>
> <br>
> To<br>
> Chanchal<br>
> Verma/GIS/CSC@CSC <br>
> cc<br>
> <br>
> Subject<br>
> Re: [syslog-ng]<br>
> Error encountered<br>
> while building<br>
> syslog-ng-2.1.3<br>
> on RHEL3<br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> Chanchal Verma wrote: <br>
> <br>
> Hi Kostyantyn, <br>
> <br>
> Yes my compilation with --enable-dynamic-linking option works fine.
I<br>
> am facing problem while doing static compilation. I have followed
the<br>
> given steps but still getting error while doing 'make'. <br>
> I am not sure how to use 'glib' option for compilation, I have<br>
> libglib-2.0.a in '/usr/lib'. <br>
> Now you really have problems with glibc :) . glib is just abstraction<br>
> (on unix systems it use glibc). <br>
> gcc -g -O2 -Wall -o syslog-ng main.o libsyslog-ng.a
-static -lnsl<br>
> -lrt -lfl -L/usr/local/lib -lglib-2.0 -L/opt/soe<br>
> /local/syslog-ng-2.1.3/eventlog/lib -levtlog -lnet -lwrap<br>
> make[2]: Leaving directory `/home/soetest1/syslog-ng-2.1.3/src'<br>
> make[1]: Leaving directory `/home/soetest1/syslog-ng-2.1.3'<br>
> <br>
> From this command line you can retrieve info which static libraries<br>
> you need (some of them are glibc libraries, some not ).<br>
> So you must have thous libraries : libnsl.a (I saw linker error<br>
> message that it can't find this library), librt.a, libfl.a,<br>
> libevtlog.a, libnet.a, libwrap.a . Maybe you need to install<br>
> glibc-devel package and/or others that contains such libraries.<br>
> <br>
> -- <br>
> Kostyantyn Gushtin <br>
> Software engineer<br>
> N-iX LLC<br>
> Solutions for Your success<br>
> http://www.n-ix.com______________________________________________________________________________<br>
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng<br>
> Documentation:<br>
> http://www.balabit.com/support/documentation/?product=syslog-ng<br>
> FAQ: http://www.campin.net/syslog-ng/faq.html<br>
> <br>
-- <br>
Bazsi<br>
<br>
</tt></font>
<br>