tcpdump mailing list archives

Problem (with outline solution) compiling print-sunrpc.c from tcpdump 3.9.7 (libpcap 0.9.7) on Solaris 10


From: "Jonathan Leffler" <jonathan.leffler () gmail com>
Date: Sat, 15 Sep 2007 20:01:11 -0700

Dear TCPDUMP Team,

Taking a copy of tcpdump-3.9.7.tar.gz and libpcap-0.9.7.tar.gz, I had
problems compiling the print-sunrpc.c file on a Solaris 10 machine
(E450 - Sparc), using both GCC 4.2.1 and Sun C Compiler:

C compiler: /workshop/Studio11/SUNWspro/bin/cc
cc: Sun C 5.8 2005/10/13
acomp: Sun C 5.8 2005/10/13
iropt: Sun Compiler Common 11 2005/10/13
cg: Sun Compiler Common 11 2005/10/13
ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.482


GCC gives the more succinct error message - this is a rigged build
(configuration for Sun C but with 'make CC=gcc'), but the error
message is essentially the same as in the 'configured for GCC' build.
'Black JL:' is my shell prompt on the machine 'black'.

Black JL:  make CC=gcc print-sunrpc.o
gcc -O -DHAVE_CONFIG_H  -I./missing  -D_U_="" -I. -I./../libpcap
-I/usr/local/include -I./missing -c ./print-sunrpc.c
In file included from /usr/include/rpc/rpc.h:42,
                 from ./print-sunrpc.c:34:
/usr/include/rpc/svc.h:86: error: expected specifier-qualifier-list
before 'bslabel_t'
make: *** [print-sunrpc.o] Error 1
Black JL: make print-sunrpc.o 2>&1 | sed 12q
cc -O -DHAVE_CONFIG_H  -I./missing  -D_U_="" -I. -I./../libpcap
-I/usr/local/include -I./missing -c ./print-sunrpc.c
"/usr/include/rpc/svc.h", line 86: syntax error before or at: bslabel_t
"/usr/include/rpc/svc.h", line 183: warning: unnamed struct member
"/usr/include/rpc/svc.h", line 210: warning: unnamed struct member
"/usr/include/rpc/svc.h", line 466: warning: unnamed struct member
"/usr/include/rpc/svc.h", line 606: warning: unnamed struct member
"/usr/include/rpc/svc.h", line 623: syntax error before or at: extern
"/usr/include/rpc/svc.h", line 625: member cannot be function: rpc_reg
"/usr/include/rpc/svc.h", line 637: syntax error before or at: extern
"/usr/include/rpc/svc.h", line 639: member cannot be function: svc_reg
"/usr/include/rpc/svc.h", line 648: syntax error before or at: extern
"/usr/include/rpc/svc.h", line 648: member cannot be function: svc_auth_reg
Black JL:

Without the 'sed', you get another 30 or so error messages before the
compilation terminates, none of them of any relevance.

I ended up with a successful compile (under GCC and Sun C) by hacking
config.h, denying that any of the RPC features was present:

/* define if you have getrpcbynumber() */
/* #define HAVE_GETRPCBYNUMBER 1 */

...

/* Define to 1 if you have the <rpc/rpcent.h> header file. */
/* #define HAVE_RPC_RPCENT_H 1 */

Black JL: make print-sunrpc.o
cc -O -DHAVE_CONFIG_H  -I./missing  -D_U_="" -I. -I./../libpcap
-I/usr/local/include -I./missing -c
 ./print-sunrpc.c
Black JL:

I took a quick look at the configure.in file, but couldn't immediately
see how to go about making an appropriate check for this.  I suspect
that an AC_TRY_COMPILE on some appropriate fragment might do the
trick:

#include <rpc/rpc.h>
int ok(void) { return 1; }

This would spot the problem on Solaris 10 (and the test is only needed
if you HAVE_GETRPCBYNUMBER is defined - or if it would be defined
except for this sanity test).  To the best of my knowledge, I have a
full development system on the Sun machine; it is used for some
modestly serious development work, and has many other Open Source
utilities successfully compiled on it.

If you need more information, please let me know.

(PS: I note that the README file for 3.9.7 directs email to
tcpdump-workers () tcpdump org but that mailing list no longer works - a
visit to http://www.tcpdump.org/ suggests the address used this time.)

--
Jonathan Leffler <jonathan.leffler () gmail com>  #include <disclaimer.h>
Guardian of DBD::Informix - v2007.0904 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease
to be amused."


-- 
Jonathan Leffler <jonathan.leffler () gmail com>  #include <disclaimer.h>
Guardian of DBD::Informix - v2007.0904 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease
to be amused."
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: