Can't compile 2.0.8 on Solaris 10
Moin! I am having problems compiling syslog-ng under Solaris 10 both sparc and intel. The error is as follows: /usr/sfw/bin/gcc -g -O2 -Wall -o loggen loggen.o -lpthread - lresolv -lnsl -lrt -lsocket -ldoor -lfl -lglib-2.0 -L/opt/sfw/lib - levtlog Undefined first referenced symbol in file yylex /usr/sfw/lib/gcc/sparc-sun- solaris2.10/3.4.3/../../../libfl.so ld: fatal: Symbol referencing errors. No output written to loggen Now I did search the archive and there was one message of relevance: https://lists.balabit.hu/pipermail/syslog-ng/2006-February/008455.html but the problem there was an empty cfg-lex.c which isn't the case for me: rw@bh2:~/source/syslog-ng-2.0.8$ ls -l src/cfg-lex.* -rw-r--r-- 1 rw ipeng 55895 Jan 31 12:46 src/cfg-lex.c -rw-r--r-- 1 rw ipeng 8979 Dec 18 16:25 src/cfg-lex.l -rw-rw-r-- 1 rw ipeng 51404 Mar 11 13:36 src/cfg-lex.o There is however one thing strange in an earlier stage of the compile which is: if /usr/sfw/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/ glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/sfw/include/eventlog - D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall - MT cfg-grammar.o -MD -MP -MF ".deps/cfg-grammar.Tpo" \ -c -o cfg-grammar.o `test -f 'cfg-grammar.c' || echo './'`cfg- grammar.c; \ then mv -f ".deps/cfg-grammar.Tpo" ".deps/cfg-grammar.Po"; \ else rm -f ".deps/cfg-grammar.Tpo"; exit 1; \ fi /home/bazsi/zwa/git//syslog-ng/syslog-ng--mainline--2.0/src/cfg- grammar.y: In function `yyparse': /home/bazsi/zwa/git//syslog-ng/syslog-ng--mainline--2.0/src/cfg- grammar.y:891: warning: implicit declaration of function `strdup' However including <string.h> where this is in also didn't help. Any help on getting this compiled would be appreciated. So long -Ralf
On Tue, 2008-03-11 at 13:42 +0100, Ralf Weber wrote:
Moin!
I am having problems compiling syslog-ng under Solaris 10 both sparc and intel. The error is as follows:
/usr/sfw/bin/gcc -g -O2 -Wall -o loggen loggen.o -lpthread - lresolv -lnsl -lrt -lsocket -ldoor -lfl -lglib-2.0 -L/opt/sfw/lib - levtlog Undefined first referenced symbol in file yylex /usr/sfw/lib/gcc/sparc-sun- solaris2.10/3.4.3/../../../libfl.so ld: fatal: Symbol referencing errors. No output written to loggen
Now I did search the archive and there was one message of relevance:
https://lists.balabit.hu/pipermail/syslog-ng/2006-February/008455.html
but the problem there was an empty cfg-lex.c which isn't the case for me:
rw@bh2:~/source/syslog-ng-2.0.8$ ls -l src/cfg-lex.* -rw-r--r-- 1 rw ipeng 55895 Jan 31 12:46 src/cfg-lex.c -rw-r--r-- 1 rw ipeng 8979 Dec 18 16:25 src/cfg-lex.l -rw-rw-r-- 1 rw ipeng 51404 Mar 11 13:36 src/cfg-lex.o
There is however one thing strange in an earlier stage of the compile which is:
if /usr/sfw/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/ glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/sfw/include/eventlog - D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall - MT cfg-grammar.o -MD -MP -MF ".deps/cfg-grammar.Tpo" \ -c -o cfg-grammar.o `test -f 'cfg-grammar.c' || echo './'`cfg- grammar.c; \ then mv -f ".deps/cfg-grammar.Tpo" ".deps/cfg-grammar.Po"; \ else rm -f ".deps/cfg-grammar.Tpo"; exit 1; \ fi /home/bazsi/zwa/git//syslog-ng/syslog-ng--mainline--2.0/src/cfg- grammar.y: In function `yyparse': /home/bazsi/zwa/git//syslog-ng/syslog-ng--mainline--2.0/src/cfg- grammar.y:891: warning: implicit declaration of function `strdup'
However including <string.h> where this is in also didn't help.
Any help on getting this compiled would be appreciated.
yylex() is defined by the flex library itself, not by syslog-ng. For some reason your /usr/lib/libfl.so does not do that. Can you validate that /usr/lib/libfl.so indeed comes from the GNU flex package? Can you check its contents via nm or objdump? -- Bazsi
Moin! On Mar 12, 2008, at 11:11 , Balazs Scheidler wrote:
yylex() is defined by the flex library itself, not by syslog-ng. For some reason your /usr/lib/libfl.so does not do that.
Can you validate that /usr/lib/libfl.so indeed comes from the GNU flex package? Can you check its contents via nm or objdump? Hmm /usr/lib/libfl.so doesn't exist, but /usr/sfw/lib/libfl.so does: rw@bh2:~$ nm /usr/sfw/lib/libfl.so /usr/sfw/lib/libfl.so:
[Index] Value Size Type Bind Other Shndx Name [..] [1] | 0| 0|FILE |LOCL |0 |ABS |libfl-2.5.4.so.0 [28] | 0| 0|FILE |LOCL |0 |ABS |libmain.c [33] | 0| 0|FILE |LOCL |0 |ABS |libyywrap.c [41] | 660| 32|FUNC |GLOB |0 |5 |main [24] | 0| 0|FILE |LOCL |0 |ABS |values-Xa.c [45] | 0| 0|FUNC |GLOB |0 |UNDEF |yylex [47] | 692| 8|FUNC |GLOB |0 |5 |yywrap I have no idea if this is good or bad, but it seems to originate from the flex libraries provided by Sun: rw@bh2:~$ pkgchk -l -p /usr/sfw/lib/libfl.so Pathname: /usr/sfw/lib/libfl.so Type: symbolic link Source of link: ./libfl-2.5.4.so.0 Referenced by the following packages: SUNWflexruntime Current status: installed rw@bh2:~$ pkgchk -l -p /usr/sfw/lib/libfl-2.5.4.so.0 Pathname: /usr/sfw/lib/libfl-2.5.4.so.0 Type: regular file Expected mode: 0555 Expected owner: root Expected group: bin Expected file size (bytes): 4492 Expected sum(1) of contents: 2486 Expected last modification: Jan 23 02:14:56 2005 Referenced by the following packages: SUNWflexruntime Current status: installed So long -Ralf
On Wed, 2008-03-12 at 11:48 +0100, Ralf Weber wrote:
Moin!
On Mar 12, 2008, at 11:11 , Balazs Scheidler wrote:
yylex() is defined by the flex library itself, not by syslog-ng. For some reason your /usr/lib/libfl.so does not do that.
Can you validate that /usr/lib/libfl.so indeed comes from the GNU flex package? Can you check its contents via nm or objdump? Hmm /usr/lib/libfl.so doesn't exist, but /usr/sfw/lib/libfl.so does: rw@bh2:~$ nm /usr/sfw/lib/libfl.so /usr/sfw/lib/libfl.so:
[Index] Value Size Type Bind Other Shndx Name [..] [1] | 0| 0|FILE |LOCL |0 |ABS |libfl-2.5.4.so.0 [28] | 0| 0|FILE |LOCL |0 |ABS |libmain.c [33] | 0| 0|FILE |LOCL |0 |ABS |libyywrap.c [41] | 660| 32|FUNC |GLOB |0 |5 |main [24] | 0| 0|FILE |LOCL |0 |ABS |values-Xa.c [45] | 0| 0|FUNC |GLOB |0 |UNDEF |yylex [47] | 692| 8|FUNC |GLOB |0 |5 |yywrap
I have no idea if this is good or bad, but it seems to originate from the flex libraries provided by Sun: rw@bh2:~$ pkgchk -l -p /usr/sfw/lib/libfl.so Pathname: /usr/sfw/lib/libfl.so Type: symbolic link Source of link: ./libfl-2.5.4.so.0 Referenced by the following packages: SUNWflexruntime Current status: installed
rw@bh2:~$ pkgchk -l -p /usr/sfw/lib/libfl-2.5.4.so.0 Pathname: /usr/sfw/lib/libfl-2.5.4.so.0 Type: regular file Expected mode: 0555 Expected owner: root Expected group: bin Expected file size (bytes): 4492 Expected sum(1) of contents: 2486 Expected last modification: Jan 23 02:14:56 2005 Referenced by the following packages: SUNWflexruntime Current status: installed
Hmm. this seems to be ok, although the yylex() symbol is listed as an external reference in your libfl.so file. If you have flex installed, can you please remove the cfg-lex.c file as supplied in the tarball of syslog-ng, and let the makefile regenerate it from the lex file (cfg-lex.l) during compilation? This should really fix this issue. -- Bazsi
Moin! On Mar 12, 2008, at 14:17 , Balazs Scheidler wrote:
Hmm. this seems to be ok, although the yylex() symbol is listed as an external reference in your libfl.so file.
If you have flex installed, can you please remove the cfg-lex.c file as supplied in the tarball of syslog-ng, and let the makefile regenerate it from the lex file (cfg-lex.l) during compilation? Hmm that didn't help. I do have flex installed: rw@bh2:~/source/syslog-ng-2.0.8$ which flex /usr/sfw/bin/flex
and the build also regenerated the file without problems: flex `test -f cfg-lex.l || echo './'`cfg-lex.l sed '/^#/ s|lex.yy\.c|cfg-lex.c|' lex.yy.c >cfg-lex.c rm -f lex.yy.c if /usr/sfw/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/ glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/sfw/include/eventlog - D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall - MT cfg-lex.o -MD -MP -MF ".deps/cfg-lex.Tpo" \ -c -o cfg-lex.o `test -f 'cfg-lex.c' || echo './'`cfg-lex.c; \ then mv -f ".deps/cfg-lex.Tpo" ".deps/cfg-lex.Po"; \ else rm -f ".deps/cfg-lex.Tpo"; exit 1; \ fi but it still failed with the same error: /usr/sfw/bin/gcc -g -O2 -Wall -o loggen loggen.o -lpthread - lresolv -lnsl -lrt -lsocket -ldoor -lfl -lglib-2.0 -L/opt/sfw/lib - levtlog Undefined first referenced symbol in file yylex /usr/sfw/lib/gcc/sparc-sun- solaris2.10/3.4.3/../../../libfl.so ld: fatal: Symbol referencing errors. No output written to loggen Any more ideas? So long -Ralf
Note the -L/opt/sfw/lib on the command line. If flex is indeed installed in /usr/sfw/bin, then the libraries are installed in /_*usr*_/sfw/lib. You need to check the configure and fix the library... OR add /usr/sfw/lib to your LD_LIBRARY_PATH environment variable. Ralf Weber wrote:
Moin!
On Mar 12, 2008, at 14:17 , Balazs Scheidler wrote:
Hmm. this seems to be ok, although the yylex() symbol is listed as an external reference in your libfl.so file.
If you have flex installed, can you please remove the cfg-lex.c file as supplied in the tarball of syslog-ng, and let the makefile regenerate it from the lex file (cfg-lex.l) during compilation?
Hmm that didn't help. I do have flex installed: rw@bh2:~/source/syslog-ng-2.0.8$ which flex /usr/sfw/bin/flex
and the build also regenerated the file without problems: flex `test -f cfg-lex.l || echo './'`cfg-lex.l sed '/^#/ s|lex.yy\.c|cfg-lex.c|' lex.yy.c >cfg-lex.c rm -f lex.yy.c if /usr/sfw/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/ glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/sfw/include/eventlog - D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall - MT cfg-lex.o -MD -MP -MF ".deps/cfg-lex.Tpo" \ -c -o cfg-lex.o `test -f 'cfg-lex.c' || echo './'`cfg-lex.c; \ then mv -f ".deps/cfg-lex.Tpo" ".deps/cfg-lex.Po"; \ else rm -f ".deps/cfg-lex.Tpo"; exit 1; \ fi
but it still failed with the same error:
/usr/sfw/bin/gcc -g -O2 -Wall -o loggen loggen.o -lpthread - lresolv -lnsl -lrt -lsocket -ldoor -lfl -lglib-2.0 -L/opt/sfw/lib - levtlog Undefined first referenced symbol in file yylex /usr/sfw/lib/gcc/sparc-sun- solaris2.10/3.4.3/../../../libfl.so ld: fatal: Symbol referencing errors. No output written to loggen
Any more ideas?
So long -Ralf
_______________________________________________ syslog-ng maillist - syslog-ng@lists.balabit.hu https://lists.balabit.hu/mailman/listinfo/syslog-ng Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
-- ------------------------------------------------------------------ Jerry Litteer Cyber Security Office e-mail: gll@inel.gov or Idaho National Laboratory (INL) gerald.litteer@inl.gov PO 1625 M.S. 2604 Phone: (208) 526-9117 Idaho Falls, Id. 83415-2604 FAX: (208) 526-5700
On Thu, 2008-03-13 at 14:36 +0100, Ralf Weber wrote:
Moin!
On Mar 12, 2008, at 14:17 , Balazs Scheidler wrote:
Hmm. this seems to be ok, although the yylex() symbol is listed as an external reference in your libfl.so file.
If you have flex installed, can you please remove the cfg-lex.c file as supplied in the tarball of syslog-ng, and let the makefile regenerate it from the lex file (cfg-lex.l) during compilation? Hmm that didn't help. I do have flex installed: rw@bh2:~/source/syslog-ng-2.0.8$ which flex /usr/sfw/bin/flex
and the build also regenerated the file without problems: flex `test -f cfg-lex.l || echo './'`cfg-lex.l sed '/^#/ s|lex.yy\.c|cfg-lex.c|' lex.yy.c >cfg-lex.c rm -f lex.yy.c if /usr/sfw/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/ glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/sfw/include/eventlog - D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall - MT cfg-lex.o -MD -MP -MF ".deps/cfg-lex.Tpo" \ -c -o cfg-lex.o `test -f 'cfg-lex.c' || echo './'`cfg-lex.c; \ then mv -f ".deps/cfg-lex.Tpo" ".deps/cfg-lex.Po"; \ else rm -f ".deps/cfg-lex.Tpo"; exit 1; \ fi
but it still failed with the same error:
/usr/sfw/bin/gcc -g -O2 -Wall -o loggen loggen.o -lpthread - lresolv -lnsl -lrt -lsocket -ldoor -lfl -lglib-2.0 -L/opt/sfw/lib - levtlog Undefined first referenced symbol in file yylex /usr/sfw/lib/gcc/sparc-sun- solaris2.10/3.4.3/../../../libfl.so ld: fatal: Symbol referencing errors. No output written to loggen
As it seems our local syslog-ng compilation uses this link command: gcc -m64 -Wall -o syslog-ng main.o libsyslog-ng.a -lresolv -lnsl -lsocket -ldoor -ll -L/usr/lib/amd64 -lgthread-2.0 -lglib-2.0 -L/usr/local/lib -levtlog -L/usr/local/ssl/lib -lssl -lcrypto -lsocket -lnsl -ldl -L/usr/local/lib -ldbi8 -L/usr/lib/amd64 -L/opt/zorp/lib -lzlicense -lcrypto -lglib-2.0 -lpthread -lrt This means that it is linking against libl.so and not libfl.so Related configure output: checking for flex... no checking for lex... lex checking lex output file root... lex.yy checking lex library... -ll E.g. it is not using flex, but the system supplied lex. Your problem is probably related to the fact that you use a mismatching lex/flex and libl/libfl combination. -- Bazsi
Moin! On Mar 13, 2008, at 15:17 , Balazs Scheidler wrote:
Related configure output:
checking for flex... no checking for lex... lex checking lex output file root... lex.yy checking lex library... -ll
E.g. it is not using flex, but the system supplied lex. Your problem is probably related to the fact that you use a mismatching lex/flex and libl/libfl combination. Yeah it did find flex on my system. I've disabled this and now the output is as yours and the compile works. Thanks a lot
So long -Ralf
participants (3)
-
Balazs Scheidler
-
Jerry Litteer
-
Ralf Weber