[Click] Compile error due to ac_cv_linuxmodule_click_skb_recycle

Shoban shoban.preeth at gmail.com
Thu Sep 20 07:16:18 EDT 2012


Configure test for ac_cv_linuxmodule_click_skb_recycle passes, even if
skb_recycle() is not declared, with just warnings.

Excerpt from config.log (https://gist.github.com/3755265)
conftest.c:141:15: warning: implicit declaration of function
'skb_recycle' [-Wimplicit-function-declaration]
conftest.c:141:29: warning: assignment makes pointer from integer
without a cast [enabled by default]

This in turn, causes a compile error for "linuxmodule/skbmgr.cc".

/root/click/linuxmodule/skbmgr.cc: In member function ‘void
RecycledSkbPool::recycle(sk_buff*)’:
/root/click/linuxmodule/skbmgr.cc:300:28: error: ‘skb_recycle’ was not
declared in this scope

I am trying build click for linux-2.6.34.12 in patchless mode.

Perhaps adding '-Werror-implicit-function-declaration' option for this
particular configure test would solve the problem.

diff --git a/configure.in b/configure.in
index 1618227..ecf319b 100644
--- a/configure.in
+++ b/configure.in
@@ -1452,6 +1452,9 @@ void f1(int64_t) { // will fail if long long and
int64_t are the same type
        AC_DEFINE([HAVE_SKB_RECYCLE], [1], [Define if you have the
skb_recycle function.])
     fi

+save_cflags="$CFLAGS"
+CFLAGS="$save_cflags -Werror-implicit-function-declaration"
+
     AC_CACHE_CHECK([whether skb_recycle returns an sk_buff],
[ac_cv_linuxmodule_click_skb_recycle],
        [AC_LANG_C
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([CLICK_LINUXMODULE_PROLOGUE()[
@@ -1462,6 +1465,8 @@ void f1(int64_t) { // will fail if long long and
int64_t are the same type
        AC_DEFINE([HAVE_CLICK_SKB_RECYCLE], [1], [Define if your Linux
kernel has Click skb_recycle.])
     fi

+CFLAGS="$save_cflags"
+
     AC_CHECK_DECL(skb_linearize, [ac_cv_skb_linearize=yes],
[ac_cv_skb_linearize=no], [CLICK_LINUXMODULE_PROLOGUE()[
 #include <linux/skbuff.h>]])
     if test $ac_cv_skb_linearize = yes; then

Thanks,
Shoban



More information about the click mailing list