[syslog-ng] Undefined symbol: yylex, 3.1beta1
Balazs Scheidler
bazsi at balabit.hu
Fri Dec 11 10:24:31 CET 2009
On Thu, 2009-12-10 at 14:12 -0600, Marvin Nipper wrote:
> I decided to try to at least build the 3.1beta1 package, to be sure
> that there were no new “compilation oddities” introduced. It seems to
> have fallen over while trying to compile the pdbtool component:
>
> gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include/glib-2.0
> -I/usr/local/lib/glib-2.0/include -I/usr/local/include/eventlog
> -I/usr/local/ssl/include -DLIBNET_LIL_ENDIAN -D_GNU_SOURCE
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT pdbtool.o
> -MD -MP -MF .deps/pdbtool.Tpo -c -o pdbtool.o pdbtool.c
> mv -f .deps/pdbtool.Tpo .deps/pdbtool.Po
> gcc -g -O2 -Wall -o pdbtool pdbtool.o libsyslog-ng.a -lpthread
> -ldoor -lsocket -lrt -lnsl -lfl -L/usr/local/lib -lglib-2.0
> -L/usr/local/lib -levtlog -L/usr/local/ssl/lib -lssl -lcrypto
> -lsocket -lnsl -ldl -lz -lsocket -lnsl -lnet -lresolv -lpthread
> Undefined first referenced
> symbol in file
> yylex /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../libfl.so
> ld: fatal: Symbol referencing errors. No output written to pdbtool
> collect2: ld returned 1 exit status
> *** Error code 1
> make: Fatal error: Command failed for target `pdbtool'
> Current working directory /var/opt/packages/syslog-ng-3.1beta1/src
> *** Error code 1
> The following command caused the error:
> failcom='exit 1'; \
> for f in x $MAKEFLAGS; do \
> case $f in \
> *=* | --[!k]*);; \
> *k*) failcom='fail=yes';; \
> esac; \
> done; \
> dot_seen=no; \
> target=`echo all-recursive | sed s/-recursive//`; \
> list='src tests doc contrib debian tgz2build'; for subdir in $list; do
> \
> echo "Making $target in $subdir"; \
> if test "$subdir" = "."; then \
> dot_seen=yes; \
> local_target="$target-am"; \
> else \
> local_target="$target"; \
> fi; \
> (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make $local_target) \
> || eval $failcom; \
> done; \
> if test "$dot_seen" = "no"; then \
> make "$target-am" || exit 1; \
> fi; test -z "$fail"
> make: Fatal error: Command failed for target `all-recursive'
> Current working directory /var/opt/packages/syslog-ng-3.1beta1
> *** Error code 1
> make: Fatal error: Command failed for target `all'
>
>
> Note that I just built 3.0.5 (today, as well), with no problems at
> all.
>
> I’m not done googling, but at least one site, seems to indicate that
> this might be a make-related issue:
> http://mail.opensolaris.org/pipermail/tools-gcc/2006-May/000121.html
>
>
> This is Solaris 10 x86, running the original (albeit patched) gcc/make
> components.
>
> Here’s the summary from the configure that preceded the make
> activities:
> syslog-ng Open Source Edition 3.1beta1 configured
> Compiler options:
> compiler : gcc
> compiler options : -g -O2 -Wall
> -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include
> -I/usr/local/include/eventlog -I/usr/local/ssl/include
> -DLIBNET_LIL_ENDIAN -D_GNU_SOURCE -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64
> linker flags : -lpthread
> prefix : /usr/local
> linking mode : dynamic
> Features:
> Sun STREAMS support : yes
> Sun Door support : yes
> Debug symbols : no
> GCC profiling : no
> Memtrace : no
> IPV6 support : yes
> spoof-source support : yes
> tcp-wrapper support : no
> SSL support : yes
> SQL support : no
> Linux capability support : no
> PCRE support : no
> Env wrapper support : no
>
>
> Not dying (or needing) to get 3.1 running. Just submitting this to
> try to sort out any compilation problems while this is all still in
> beta.
>
> APOLOGIES (in advance) if I’ve just done something moronically stupid!
>
> Let me know if there’s some other input that it would be useful to
> provide, and/or if you have any thoughts/suggestions as to what might
> be happening.
Thanks for the report, it is really appreciated.
The problem seems to be that pdbtool is linked against libfl, which
requires an external yylex symbol.
I've pushed this patch to solve this:
commit 8c7349439344abef821426c7be6f41bcdc419088
Author: Balazs Scheidler <bazsi at balabit.hu>
Date: Fri Dec 11 10:23:49 2009 +0100
pdbtool: only link against libs that are strictly necessary
flex (more precisely -lfl) caused linking problems as that requires yylex()
as a defined symbol, which pdbtool doesn't define.
Make sure that we only link against the libs that are strictly necessary to
avoid this.
Reported-By: Marvin Nipper
--
Bazsi
More information about the syslog-ng
mailing list