Snort mailing list archives

Solaris 9 compile errors - pcap_datalink undefined symbol


From: "Jain, Siddhartha" <Siddhartha.Jain () kla-tencor com>
Date: Wed, 12 Jul 2006 16:14:52 -0700

Hi,

Warning: Long mail

I am trying to compile Snort 2.6.0 on Solaris 9 running in 32-bit mode
on a Ultra-1. Some specs:
OS
===
SunOS acetest 5.9 Generic_118558-27 sun4u sparc SUNW,Ultra-1

GCC
===
gcc (GCC) 3.3.2

libpcap
=====
SMClpcap 0.9.4

I run configure this way:
./configure --prefix=/usr/local/snort
--with-postgresql=/usr/local/pgsql/
--with-libpcap-libraries=/usr/local/lib
--with-libpcap-includes=/usr/local/include

Output
=====
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles...
no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking build system type... sparc-sun-solaris2.9
checking host system type... sparc-sun-solaris2.9
checking for a sed that does not truncate output... /usr/bin/sed
checking for egrep... egrep
checking for ld used by gcc... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking for /usr/ccs/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/ccs/bin/nm -p
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... no
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... g77
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether g77 accepts -g... yes
checking the maximum length of command line arguments... 262144
checking command to parse /usr/ccs/bin/nm -p output from gcc object...
ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... (cached) ranlib
checking for strip... strip
checking if gcc static flag works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/ccs/bin/ld) supports shared
libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... solaris2.9 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking whether the g++ linker (/usr/ccs/bin/ld) supports shared
libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/ccs/bin/ld) supports shared
libraries... yes
checking dynamic linker characteristics... solaris2.9 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for g77 option to produce PIC... -fPIC
checking if g77 PIC flag -fPIC works... yes
checking if g77 supports -c -o file.o... yes
checking whether the g77 linker (/usr/ccs/bin/ld) supports shared
libraries... yes
checking dynamic linker characteristics... solaris2.9 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking whether byte ordering is bigendian... yes
checking for sparc alignment... yes
checking for strings.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/sockio.h usability... yes
checking sys/sockio.h presence... yes
checking for sys/sockio.h... yes
checking paths.h usability... no
checking paths.h presence... no
checking for paths.h... no
checking for inet_ntoa in -lnsl... yes
checking for socket in -lsocket... yes
checking whether printf must be declared... no
checking whether fprintf must be declared... no
checking whether syslog must be declared... no
checking whether puts must be declared... no
checking whether fputs must be declared... no
checking whether fputc must be declared... no
checking whether fopen must be declared... no
checking whether fclose must be declared... no
checking whether fwrite must be declared... no
checking whether fflush must be declared... no
checking whether getopt must be declared... no
checking whether bzero must be declared... no
checking whether bcopy must be declared... no
checking whether memset must be declared... no
checking whether strtol must be declared... no
checking whether strcasecmp must be declared... no
checking whether strncasecmp must be declared... no
checking whether strerror must be declared... no
checking whether perror must be declared... no
checking whether socket must be declared... no
checking whether sendto must be declared... no
checking whether vsnprintf must be declared... no
checking whether snprintf must be declared... no
checking whether strtoul must be declared... no
checking for snprintf... yes
checking for strlcpy... yes
checking for strlcat... yes
checking for strerror... yes
checking for __FUNCTION__... yes
checking for floor in -lm... yes
checking for pcap_datalink in -lpcap... no

ERROR! Libpcap library/headers not found, go get it from
http://www.tcpdump.org
or use the --with-libpcap-* options, if you have it installed
in unusual place

Config.log
========
configure:22621: checking for pcap_datalink in -lpcap
configure:22651: gcc -o conftest -g -O2 -Wall -DBSD_COMP -D_REENTRANT
-I/usr/local/include -L/usr/local/lib conftest.c -lpcap -lm -lsocket
-lnsl >&5
Undefined first referenced
symbol in file
pcap_datalink /var/tmp//cc6eyXrY.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure:22657: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "snort"
| #define VERSION "2.6.0"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #ifdef __cplusplus
| extern "C" void std::exit (int) throw (); using std::exit;
| #endif
| #define WORDS_BIGENDIAN 1
| #define SOLARIS
| #define WORDS_MUSTALIGN
| #define HAVE_STRINGS_H 1
| #define HAVE_STRING_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_SOCKIO_H 1
| #define HAVE_LIBNSL 1
| #define HAVE_LIBSOCKET 1
| #define HAVE_SNPRINTF 1
| #define HAVE_STRLCPY 1
| #define HAVE_STRLCAT 1
| #define HAVE_STRERROR 1
| #define HAVE___FUNCTION__ 1
| #define HAVE_LIBM 1
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char pcap_datalink ();
| int
| main ()
| {
| pcap_datalink ();
| ;
| return 0;
| }
configure:22683: result: no



I snipped the code used for pcap test by the configure script and
compiled is separately. The object code came out fine but linking fails
with the same error:

acetest:/test # ld -L/usr/local/lib -I/usr/local/include -lm -lsocket
-lnsl -lpcap test.o
Undefined first referenced
symbol in file
pcap_datalink test.o
ld: fatal: Symbol referencing errors. No output written to a.out

So I ran the linking with truss. Truss shows that the linker does find
libpcap.so 
---snip-----
open("/usr/local/lib/libpcap.so", O_RDONLY)     = 4
lseek(4, 0, SEEK_END)                           = 1496
mmap(0x00000000, 1496, PROT_READ, MAP_PRIVATE, 4, 0) = 0xFF120000
fstat(4, 0xFFBFF4D0)                            = 0
close(4)                                        = 0
open("test.o", O_RDONLY)                        = 4
brk(0x00025C88)                                 = 0
brk(0x00027C88)                                 = 0
lseek(4, 0, SEEK_END)                           = 628
mmap(0x00000000, 628, PROT_READ, MAP_PRIVATE, 4, 0) = 0xFF110000
fstat(4, 0xFFBFFA50)                            = 0
close(4)                                        = 0
open("/usr/local/lib/libc.so.1", O_RDONLY)      Err#2 ENOENT
open("/usr/local/lib/libc.so.1", O_RDONLY)      Err#2 ENOENT
open("/usr/ccs/lib/libc.so.1", O_RDONLY)        Err#2 ENOENT
open("/lib/libc.so.1", O_RDONLY)                = 4
lseek(4, 0, SEEK_END)                           = 867448
mmap(0x00000000, 867448, PROT_READ, MAP_PRIVATE, 4, 0) = 0xFEF00000
fstat(4, 0xFFBFF588)                            = 0
mmap(0x00000000, 425984, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEE90000
close(4)                                        = 0
open("/usr/local/lib/libdl.so.1", O_RDONLY)     Err#2 ENOENT
open("/usr/ccs/lib/libdl.so.1", O_RDONLY)       Err#2 ENOENT
open("/lib/libdl.so.1", O_RDONLY)               = 4
lseek(4, 0, SEEK_END)                           = 3984
mmap(0x00000000, 3984, PROT_READ, MAP_PRIVATE, 4, 0) = 0xFF3A0000
fstat(4, 0xFFBFF588)                            = 0
close(4)                                        = 0
open("/usr/local/lib/libmp.so.2", O_RDONLY)     Err#2 ENOENT
open("/usr/ccs/lib/libmp.so.2", O_RDONLY)       Err#2 ENOENT
open("/lib/libmp.so.2", O_RDONLY)               = 4
lseek(4, 0, SEEK_END)                           = 21676
mmap(0x00000000, 21676, PROT_READ, MAP_PRIVATE, 4, 0) = 0xFF350000
fstat(4, 0xFFBFF588)                            = 0
brk(0x00027C88)                                 = 0
brk(0x00029C88)                                 = 0
close(4)                                        = 0
open("/usr/local/lib/libresolv.so.2", O_RDONLY) Err#2 ENOENT
open("/usr/local/lib/libresolv.so.2", O_RDONLY) Err#2 ENOENT
open("/usr/ccs/lib/libresolv.so.2", O_RDONLY)   Err#2 ENOENT
open("/lib/libresolv.so.2", O_RDONLY)           = 4
lseek(4, 0, SEEK_END)                           = 316504
mmap(0x00000000, 316504, PROT_READ, MAP_PRIVATE, 4, 0) = 0xFEE30000
fstat(4, 0xFFBFF588)                            = 0
close(4)                                        = 0
brk(0x00029C88)                                 = 0
brk(0x0002BC88)                                 = 0
fstat64(2, 0xFFBFF7A0)                          = 0
write(2, 0x000116D4, 0)                         = 0
Undefinedwrite(2, " U n d e f i n e d", 9)              = 9
                        write(2, "\t\t\t", 3)
= 3
first referencedwrite(2, " f i r s t   r e f e r e".., 16)      = 16

 write(2, "\n  ", 2)                            = 2
symbolwrite(2, " s y m b o l", 6)                       = 6
                            write(2, "    \t\t\t        ", 9)
= 9
in filewrite(2, " i n   f i l e", 7)                    = 7

write(2, "\n", 1)                               = 1
write(2, 0x000116D4, 0)                         = 0
pcap_datalinkwrite(2, " p c a p _ d a t a l i n".., 13) = 13
                    write(2, "                        ".., 20)  = 20
   write(2, "      ", 3)                                = 3
test.owrite(2, " t e s t . o", 6)                       = 6

write(2, "\n", 1)                               = 1
ld: write(2, " l d :  ", 4)                             = 4
fatal: write(2, " f a t a l :  ", 7)                    = 7
Symbol referencing errors. No output written to write(2, " S y m b o l
r e f e r".., 48)      = 48
a.outwrite(2, " a . o u t", 5)                  = 5

write(2, "\n", 1)                               = 1
unlink("a.out")                                 = 0
_exit(1)
acetest:/test # gcc -g -02 -Wall test.o -o test
gcc: unrecognized option `-02'
Undefined                       first referenced
 symbol                             in file
pcap_datalink                       test.o
ld: fatal: Symbol referencing errors. No output written to test
collect2: ld returned 1 exit status
---snip-----

Any pointers to what could be the problem?



Thanks & Regards,

- Siddhartha Jain


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users


Current thread: