Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 37184 - tcpdump 3.8.1 fails to compile due to undefined ref to pcap_debug
Summary: tcpdump 3.8.1 fails to compile due to undefined ref to pcap_debug
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: PPC Porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-04 05:07 UTC by jochen
Modified: 2004-09-24 12:48 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Compile fix for x86 & sparc at least (tcpdump-3.8.1.ebuild.patch,439 bytes, patch)
2004-01-05 07:33 UTC, Gustavo Zacarias (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2004-01-04 05:07:18 UTC
tcpdump.o(.text+0x3f2): In function `main':
: undefined reference to `pcap_debug'
collect2: ld returned 1 exit status
make: *** [tcpdump] Error 1

!!! ERROR: net-analyzer/tcpdump-3.8.1 failed.
!!! Function src_compile, Line 23, Exitcode 2
!!! (no error message)

I just emerged latest libpcap (after fixing tar...)


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Wayne Cornish 2004-01-04 10:03:09 UTC
Identical problem here. (Including tar fix, then libpcap.)
Comment 2 Remy Nicolas 2004-01-04 10:13:10 UTC
same here
Comment 3 Benoit Boissinot 2004-01-04 11:32:04 UTC
The problem seems to come from
#define HAVE_PCAP_DEBUG 1 in config.h
Looks like there is a problem in the configure script.
Comment 4 Bryan Whitehead 2004-01-04 11:54:21 UTC
same problem here. :(
Comment 5 Fernando Serboncini (RETIRED) gentoo-dev 2004-01-04 16:39:19 UTC
same here
Comment 6 Jason Wever (RETIRED) gentoo-dev 2004-01-05 04:57:32 UTC
This fails on ~sparc as well as ~x86.

Does this actually work for anyone?
Comment 7 Sven Blumenstein (RETIRED) gentoo-dev 2004-01-05 06:52:24 UTC
Works if you compile libpcap with --enable-yydebug. 
Was this ebuild actually tested?
Comment 8 Gustavo Zacarias (RETIRED) gentoo-dev 2004-01-05 07:06:05 UTC
x86 people, try reducing CFLAGS just to -O2 if it's -O3, that seems to fix it.
now to test the same on sparc....
Comment 9 drumz 2004-01-05 07:32:49 UTC
I can confirm that baking -O3 to -O2 works.  It compiles, installs and functions fine.
Comment 10 Gustavo Zacarias (RETIRED) gentoo-dev 2004-01-05 07:33:14 UTC
Created attachment 23188 [details, diff]
Compile fix for x86 & sparc at least
Comment 11 Daniel Ahlberg (RETIRED) gentoo-dev 2004-01-05 07:49:56 UTC
Fixed in CVS, thanks!
Comment 12 Andy Dustman 2004-01-12 07:39:27 UTC
As of this morning, I still get this:

tcpdump.o(.text+0x409): In function `main':
: undefined reference to `pcap_debug'
collect2: ld returned 1 exit status
make: *** [tcpdump] Error 1
 
!!! ERROR: net-analyzer/tcpdump-3.8.1 failed.
!!! Function src_compile, Line 27, Exitcode 2
!!! (no error message)

Remerging libpcap didn't help either. Note that I am using -O2 to start with.

Portage 2.0.49-r20 (default-x86-1.4, gcc-3.3.2, glibc-2.3.3_pre20031222-r0, 2.6.0)
=================================================================
System uname: 2.6.0 i686 Intel(R) Pentium(R) 4 CPU 2.00GHz
Gentoo Base System version 1.4.3.12
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium3 -mcpu=pentium4 -O2 -fstack-protector -finline-functions -falign-jumps=5 -falign-loops=5 -falign-functions=64 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentium3 -mcpu=pentium4 -O2 -fstack-protector -finline-functions -falign-jumps=5 -falign-loops=5 -falign-functions=64 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache nostrip sandbox"
GENTOO_MIRRORS="ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo http://distro.ibiblio.org/gentoo http://gentoo.chem.wisc.edu/gentoo http://gentoo.oregonstate.edu "
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="X alsa apm arts avi berkdb bonobo cdr crypt cups encode esd foomaticdb gdbm gif gnome gpm gtk gtk2 gtkhtml guile i8x0 imlib innodb java jpeg kde kerberos ldap libg++ libwww mad mikmod motif mozilla mpeg mysql ncurses nls nptl oggvorbis opengl oss pam pdflib perl png python qt quicktime readline samba sdl slang spell sse ssl tcltk tcpd tetex tktcl truetype x86 xml2 xmms xv zlib"
Comment 13 Andy Dustman 2004-01-23 14:50:36 UTC
tcpdump-3.8.1 on x86 is still hosed; this bug should be reopened.
Comment 14 Andy Dustman 2004-02-11 06:30:46 UTC
It turns out -finline-functions is causing the build to fail. I guess this shouldn't be a surprise, since other people reported that -O3 caused problems, and -O3 turns on -finline-functions. The ebuild can be fixed as follows:

--- tcpdump-3.8.1.ebuild        2004-01-15 09:37:48.000000000 -0500
+++ tcpdump-3.8.1-r1.ebuild     2004-02-11 09:26:35.146081000 -0500
@@ -22,6 +22,7 @@
  
 src_compile() {
        replace-flags -O[3-9] -O2
+       filter-flags -finline-functions
  
        econf `use_with ssl crypto` `use_enable ipv6` || die
        make CCOPT="$CFLAGS" || die
Comment 15 Timothy Weiand 2004-07-04 09:35:39 UTC
I am getting this identical error:
----------------------------------
tcpdump.o(.text+0x636): In function `main':
: undefined reference to `pcap_debug'
tcpdump.o(.text+0x63a): In function `main':
: undefined reference to `pcap_debug'
collect2: ld returned 1 exit status
make: *** [tcpdump] Error 1

With these gcc flags:
---------------------
gcc -O2 -mcpu=7400 -maltivec -mabi=altivec -pipe -fomit-frame-pointer
gcc -O2 -mcpu=7450 -maltivec -mabi=altivec -pipe -fomit-frame-pointer
gcc -O2 -pipe -mcpu=750

On:
---
Linux 2.6.7-gentoo-r7 ppc 7457, altivec supported PowerBook5,2 GNU/Linux

The only abnormal things I see in compile output are:
-----------------------------------------------------
In file included from print-atm.c:41:
atmuni31.h:38:1: warning: "PPC" redefined
<built-in>:60:1: warning: this is the location of the previous definition
...
In file included from print-sunatm.c:54:
atmuni31.h:38:1: warning: "PPC" redefined
<built-in>:60:1: warning: this is the location of the previous definition

Anybody have any suggestions or thoughts?  Can I provide any more output for input?
Comment 16 dr.kaos 2004-07-07 08:18:29 UTC
Same problem here, also PPC...
Linux 2.6.7-gentoo-r6 #2 Sat Jul 3 16:18:54 EDT 2004 ppc 750FX PowerBook4,3 GNU/Linux

CFLAGS="-O3 -mcpu=750 -pipe"

tcpdump.o(.text+0x636): In function `main':
: undefined reference to `pcap_debug'
tcpdump.o(.text+0x63a): In function `main':
: undefined reference to `pcap_debug'
collect2: ld returned 1 exit status
make: *** [tcpdump] Error 1

!!! ERROR: net-analyzer/tcpdump-3.8.3-r1 failed.
!!! Function src_compile, Line 27, Exitcode 2
!!! (no error message)
Comment 17 Michal Suchanek 2004-07-15 06:21:44 UTC
works with -O1 on ppc
ie # emerge  CFLAGS="-O1 -mcpu=750 -pipe" emerge tcpdump
Comment 18 Daniel Ahlberg (RETIRED) gentoo-dev 2004-07-17 15:54:35 UTC
Does 3.8.3-r1 also suffer from this?
Comment 19 Michal Suchanek 2004-07-19 01:40:49 UTC
All three versions I have behave the same 3.8.1, 3.8.3, and 3.8.3-r1.
Comment 20 Daniel Ahlberg (RETIRED) gentoo-dev 2004-07-19 07:02:42 UTC
Reassigning to ppc for ppc related bugs.
Comment 21 Gustavo Zacarias (RETIRED) gentoo-dev 2004-08-31 14:24:16 UTC
Removing sparc that solved this some time ago...
Comment 22 Jochen Maes (RETIRED) gentoo-dev 2004-09-24 12:48:47 UTC
last version fixed it on ppc, tested with O2 and O3
and using the 2004.2 toolchain.
greetings