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