mariusae / trickle

Trickle is a userland bandwidth shaper for Unix-like systems.
https://www.usenix.org/legacy/event/usenix05/tech/freenix/full_papers/eriksen/eriksen.pdf
Other
567 stars 64 forks source link

Can't compile trickle on RHEL 8.1 #27

Open canbahadir opened 4 years ago

canbahadir commented 4 years ago

I am trying to compile trickle on RHEL 8.1 . I ran ./configure, then ran make command and got following error:

`config.h:133:19: error: two or more data types in declaration specifiers

define in_addr_t unsigned long

`

I solved/ignored this error by comment out "#define in_addr_t unsigned long" lines in config.h

After that I ran make clean and make command and got another error. Couldn't find a solution for this one:

[root@localhost trickle-1.07]# make
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c trickle.c
trickle.c: In function ‘main’:
trickle.c:47:7: warning: variable ‘latency’ set but not used [-Wunused-but-set-variable]
      *latency = "0";
       ^~~~~~~
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c util.c
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c getopt.c
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c strlcat.c
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c strlcpy.c
/bin/sh ./libtool --mode=link gcc -Wall -Icompat  -g -O2  -o trickle  trickle.o util.o getopt.o strlcat.o strlcpy.o -ldl
mkdir .libs
gcc -Wall -Icompat -g -O2 -o trickle trickle.o util.o getopt.o strlcat.o strlcpy.o  -ldl
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c trickled.c
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c atomicio.c
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c print.c
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c bwstat.c
bwstat.c: In function ‘bwstat_getdelay’:
bwstat.c:151:7: warning: variable ‘initent’ set but not used [-Wunused-but-set-variable]
  uint initent;
       ^~~~~~~
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c client.c
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c conf.c
conf.c: In function ‘conf_decode_base64’:
conf.c:548:17: warning: pointer targets in passing argument 1 of ‘strcmp’ differ in signedness [-Wpointer-sign]
    if (!strcmp (buf, "=="))
                 ^~~
In file included from conf.c:55:
/usr/include/string.h:136:12: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
conf.c:564:17: warning: pointer targets in passing argument 1 of ‘strcmp’ differ in signedness [-Wpointer-sign]
     if (strcmp (buf, "="))
                 ^~~
In file included from conf.c:55:
/usr/include/string.h:136:12: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c cleanup.c
gcc -DHAVE_CONFIG_H -I. -I. -I.    -Wall -Icompat  -g -O2 -c xdr.c
xdr.c: In function ‘xdr_msg’:
xdr.c:106:25: warning: passing argument 5 of ‘xdr_union’ from incompatible pointer type [-Wincompatible-pointer-types]
        xdr_msg_discrim, _xdr_void));
                         ^~~~~~~~~
xdr.c:15:7: note: in definition of macro ‘X’
  if (!x)     \
       ^
In file included from /usr/include/rpc/rpc.h:43,
                 from xdr.c:10:
/usr/include/rpc/xdr.h:315:78: note: expected ‘xdrproc_t’ {aka ‘int (*)(struct __rpc_xdr *, ...)’} but argument is of type ‘bool_t (*)(void)’ {aka ‘int (*)(void)’}
 extern bool_t xdr_union(XDR *, enum_t *, char *, const struct xdr_discrim *, xdrproc_t);
                                                                              ^~~~~~~~~
xdr.c: In function ‘msg2xdr’:
xdr.c:116:23: warning: pointer targets in passing argument 2 of ‘xdrmem_create’ differ in signedness [-Wpointer-sign]
  xdrmem_create(&xdrs, buf, *buflen, XDR_ENCODE);
                       ^~~
In file included from /usr/include/rpc/rpc.h:43,
                 from xdr.c:10:
/usr/include/rpc/xdr.h:355:15: note: expected ‘char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
 extern void   xdrmem_create(XDR *, char *, u_int, enum xdr_op);
               ^~~~~~~~~~~~~
xdr.c: In function ‘xdr2msg’:
xdr.c:136:23: warning: pointer targets in passing argument 2 of ‘xdrmem_create’ differ in signedness [-Wpointer-sign]
  xdrmem_create(&xdrs, buf, buflen, XDR_DECODE);
                       ^~~
In file included from /usr/include/rpc/rpc.h:43,
                 from xdr.c:10:
/usr/include/rpc/xdr.h:355:15: note: expected ‘char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
 extern void   xdrmem_create(XDR *, char *, u_int, enum xdr_op);
               ^~~~~~~~~~~~~
/bin/sh ./libtool --mode=link gcc -Wall -Icompat  -g -O2  -o trickled  trickled.o atomicio.o print.o bwstat.o client.o conf.o util.o cleanup.o getopt.o xdr.o -levent  strlcat.o strlcpy.o -ldl
gcc -Wall -Icompat -g -O2 -o trickled trickled.o atomicio.o print.o bwstat.o client.o conf.o util.o cleanup.o getopt.o xdr.o strlcat.o strlcpy.o  -levent -ldl
xdr.o: In function `xdr_msg_getinfo':
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:74: undefined reference to `xdr_u_int'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:75: undefined reference to `xdr_u_int'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:76: undefined reference to `xdr_u_int'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:77: undefined reference to `xdr_u_int'
xdr.o: In function `xdr_msg_update':
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:55: undefined reference to `xdr_u_int'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:56: undefined reference to `xdr_short'
xdr.o: In function `xdr_msg_delay':
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:46: undefined reference to `xdr_int'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:47: undefined reference to `xdr_short'
xdr.o: In function `xdr_msg_delayinfo':
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:64: undefined reference to `xdr_long'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:65: undefined reference to `xdr_long'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:66: undefined reference to `xdr_int'
xdr.o: In function `xdr_msg_conf':
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:33: undefined reference to `xdr_u_int'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:34: undefined reference to `xdr_u_int'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:35: undefined reference to `xdr_int'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:36: undefined reference to `xdr_opaque'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:37: undefined reference to `xdr_u_int'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:38: undefined reference to `xdr_u_int'
xdr.o: In function `msg2xdr':
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:116: undefined reference to `xdrmem_create'
xdr.o: In function `xdr_msg':
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:104: undefined reference to `xdr_short'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:105: undefined reference to `xdr_union'
xdr.o: In function `xdr2msg':
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:136: undefined reference to `xdrmem_create'
xdr.o: In function `xdr_msg':
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:104: undefined reference to `xdr_short'
/root/rpmbuild/SOURCES/trickle-1.07/xdr.c:105: undefined reference to `xdr_union'
collect2: error: ld returned 1 exit status
make: *** [Makefile:299: trickled] Error 1
pyroclank commented 4 years ago

Same issue here with Slackware 14.2

ghost commented 4 years ago

I'm unsure if this helps, but on gentoo linux I was able to compile it after the applied PR. Any side-effects/suggestions are welcome. #28