Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error for 4.14 (on MIPS) #192

Open
gnought opened this issue Feb 22, 2022 · 6 comments
Open

Compile error for 4.14 (on MIPS) #192

gnought opened this issue Feb 22, 2022 · 6 comments
Assignees

Comments

@gnought
Copy link

gnought commented Feb 22, 2022

It compiles fine in master branch at 5f188b7
but we get a compile error using master branch as 6a55739

# ./configure --kdir=/tmp/kernel --ipt-bin=/tmp/vroot/sbin/iptables --ipt-lib=/tmp/vroot/lib/xtables --ipt-inc=/tmp/vroot/include --enable-natevents --enable-snmp-rules --enable-macaddress --enable-vlan --enable-direction --enable-sampler --enable-sampler=hash --enable-rand-tpl-id --enable-aggregation --enable-physdev &&     make ARCH=mips CROSS_COMPILE=$ARCH-linux-gnu- all
Module version: 2.6-4-g9ed5788
Kernel version: 4.14.54-UBNT (sources)
Kernel sources: /tmp/kernel (requested)
Checking for presence of include/linux/netfilter.h... Yes
netfilter.h uses CONFIG_NF_NAT_NEEDED... Yes
Checking for presence of include/linux/llist.h... Yes
Checking for presence of include/linux/grsecurity.h... No
Iptables binary version: 1.4.21 (detected from /tmp/vroot/sbin/iptables)
pkg-config for version 1.4.21 exists: No
Check for working gcc: Yes (gcc)
Checking for presence of xtables.h... Yes (using ipt-inc)
Iptables include flags: -I/tmp/vroot/include (user specified)
Iptables module path: /tmp/vroot/lib/xtables (user specified)
Searching for net-snmp-config... Yes /usr/bin/net-snmp-config
Searching for net-snmp agent... Yes.
Checking for DKMS... No. (It may be useful to install it.)
!
! DKMS is method of installing kernel modules, that will
! automatically recompile module after kernel upgrade.
!
! To install it under Debian simply run this:
!   root# apt-get install dkms
!
Creating Makefile.. done.

  If you need some options enabled run ./configure --help
  Now run: make all install

./gen_compat_def > compat_def.h
Test function xt_family linux/netfilter_ipv4/ip_tables.h  declared
Test struct timeval linux/ktime.h  declared
Test struct proc_ops linux/proc_fs.h  undeclared
Test function synchronize_sched linux/rcupdate.h  declared
Test function nf_bridge_info_get linux/netfilter_bridge.h  undeclared
Test struct vlan_dev_priv linux/if_vlan.h  declared
Test function put_unaligned_be24 asm/unaligned.h  undeclared
Test function totalram_pages linux/mm.h  undeclared
Test symbol totalram_pages linux/mm.h  declared
Compiling 2.6-4-g9ed5788 for kernel 4.14.54-UBNT
make -C /tmp/kernel M=/tmp/ipt-netflow modules
make[1]: Entering directory '/tmp/kernel'

  WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /tmp/ipt-netflow/ipt_NETFLOW.o
/tmp/ipt-netflow/ipt_NETFLOW.c: In function 'nf_seq_show':
/tmp/ipt-netflow/ipt_NETFLOW.c:762:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long int' [-Wformat=]
    seq_printf(seq, " Flows selected %lu, discarded %lu.",
                                       ^
/tmp/ipt-netflow/ipt_NETFLOW.c:762:54: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'long long int' [-Wformat=]
    seq_printf(seq, " Flows selected %lu, discarded %lu.",
                                                      ^
/tmp/ipt-netflow/ipt_NETFLOW.c:766:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long int' [-Wformat=]
    seq_printf(seq, " Flows selected %lu.", atomic64_read(&flows_selected));
                                       ^
/tmp/ipt-netflow/ipt_NETFLOW.c: In function 'netflow_target':
/tmp/ipt-netflow/ipt_NETFLOW.c:5307:7: error: implicit declaration of function 'nf_bridge_info_get' [-Werror=implicit-function-declaration]
   if (nf_bridge_info_get(skb) && nf_bridge_info_get(skb)->physdev) \
       ^
/tmp/ipt-netflow/ipt_NETFLOW.c:5312:3: note: in expansion of macro 'copy_dev'
   copy_dev(nf->o_ifphys, physoutdev, if_out);
   ^~~~~~~~
/tmp/ipt-netflow/ipt_NETFLOW.c:5307:57: error: invalid type argument of '->' (have 'int')
   if (nf_bridge_info_get(skb) && nf_bridge_info_get(skb)->physdev) \
                                                         ^
/tmp/ipt-netflow/ipt_NETFLOW.c:5312:3: note: in expansion of macro 'copy_dev'
   copy_dev(nf->o_ifphys, physoutdev, if_out);
   ^~~~~~~~
/tmp/ipt-netflow/ipt_NETFLOW.c:5308:46: error: invalid type argument of '->' (have 'int')
    out = resolve_snmp(nf_bridge_info_get(skb)->physdev); \
                                              ^
/tmp/ipt-netflow/ipt_NETFLOW.c:5312:3: note: in expansion of macro 'copy_dev'
   copy_dev(nf->o_ifphys, physoutdev, if_out);
   ^~~~~~~~
/tmp/ipt-netflow/ipt_NETFLOW.c:5307:57: error: invalid type argument of '->' (have 'int')
   if (nf_bridge_info_get(skb) && nf_bridge_info_get(skb)->physdev) \
                                                         ^
/tmp/ipt-netflow/ipt_NETFLOW.c:5313:3: note: in expansion of macro 'copy_dev'
   copy_dev(nf->i_ifphys, physindev, if_in);
   ^~~~~~~~
/tmp/ipt-netflow/ipt_NETFLOW.c:5308:46: error: invalid type argument of '->' (have 'int')
    out = resolve_snmp(nf_bridge_info_get(skb)->physdev); \
                                              ^
/tmp/ipt-netflow/ipt_NETFLOW.c:5313:3: note: in expansion of macro 'copy_dev'
   copy_dev(nf->i_ifphys, physindev, if_in);
   ^~~~~~~~
In file included from ./include/linux/printk.h:7:0,
                 from ./include/linux/kernel.h:14,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /tmp/ipt-netflow/ipt_NETFLOW.c:22:
/tmp/ipt-netflow/ipt_NETFLOW.c: In function 'ipt_netflow_init':
./include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
 #define KERN_SOH "\001"  /* ASCII Start Of Header */
                  ^
./include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
 #define KERN_INFO KERN_SOH "6" /* informational */
                   ^~~~~~~~
/tmp/ipt-netflow/ipt_NETFLOW.c:5626:9: note: in expansion of macro 'KERN_INFO'
  printk(KERN_INFO "ipt_NETFLOW: hashsize %u (%luK)\n", hashsize,
         ^~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:334: recipe for target '/tmp/ipt-netflow/ipt_NETFLOW.o' failed
make[2]: *** [/tmp/ipt-netflow/ipt_NETFLOW.o] Error 1
Makefile:1523: recipe for target '_module_/tmp/ipt-netflow' failed
make[1]: *** [_module_/tmp/ipt-netflow] Error 2
make[1]: Leaving directory '/tmp/kernel'
Makefile:26: recipe for target 'ipt_NETFLOW.ko' failed
make: *** [ipt_NETFLOW.ko] Error 2
@gnought
Copy link
Author

gnought commented Feb 22, 2022

Here is the kernel config. kernel_config.txt

@aabc aabc self-assigned this May 9, 2022
@aabc
Copy link
Owner

aabc commented May 9, 2022

Thanks for the report! Oh, this is MIPS!

@aabc aabc changed the title Compile error for 4.14 Compile error for 4.14 (on MIPS) May 9, 2022
@aabc
Copy link
Owner

aabc commented May 9, 2022

BTW, what distro it is?

@gnought
Copy link
Author

gnought commented May 10, 2022

Debian stretch

@aabc
Copy link
Owner

aabc commented May 10, 2022

Thanks. I wonder if I should put my effort into it. You are first mipsel user. Even if I fix cross-compiling I will be not completely sure it's working since I don't even have mipsel hardware and won't be able to fix actual bugs.

@gnought
Copy link
Author

gnought commented May 1, 2023

This issue will be fixed after applying PR #216 and #217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants