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

Debian 10, kernel 4.19.0-21-amd64, ошибка сборки error: implicit declaration of function ‘__smp_processor_id’; did you mean ‘smp_processor_id’? #201

Open
Alex5252 opened this issue Jul 13, 2022 · 5 comments

Comments

@Alex5252
Copy link

Не собирается commit 40fefb2 с https://github.com/aabc/ipt-netflow на ОС Debian GNU/Linux 10 (buster), ядро 4.19.0-21-amd64, - Linux debian10 4.19.0-21-amd64 #1 SMP Debian 4.19.249-2 (2022-06-30) x86_64 GNU/Linux.
Ошибка сборки:

/usr/local/src/ipt-netflow/ipt-netflow/ipt_NETFLOW.c: In function ‘netflow_work_fn’:
/usr/local/src/ipt-netflow/ipt-netflow/ipt_NETFLOW.c:4504:11: error: implicit declaration of function ‘__smp_processor_id’; did you mean ‘smp_processor_id’? [-Werror=implicit-function-declaration]
  wk_cpu = __smp_processor_id();
           ^~~~~~~~~~~~~~~~~~
           smp_processor_id
cc1: some warnings being treated as errors

Полная сборка:

Getting source for kernel version: 4.19.0-21-amd64
Kernel headers available in /lib/modules/4.19.0-21-amd64/build
Creating symlink...
apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.6). 
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Done!
Module version: 2.6-12-g40fefb2
Kernel version: 4.19.249 (proc)
Kernel sources: /lib/modules/4.19.0-21-amd64/build (found)
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.8.2 (nf_tables) (detected from /usr/sbin/iptables)
pkg-config for version 1.8.2 (nf_tables) exists: No (reported: 1.8.2)
Check for working gcc: Yes (gcc)
Checking for presence of xtables.h... Yes
Searching for iptables-1.8.2 (nf_tables) sources..
! Can not find iptables source directory, you may try setting it with --ipt-src=
! This is not fatal error, yet. Will be just using default include dir.
Iptables include flags: none (default)
Iptables module path: /usr/lib/x86_64-linux-gnu/xtables (from libxtables.so, from binary)
Searching for net-snmp-config... No.
Searching for net-snmp agent... No.
 Assuming you don't want net-snmp agent support.
 Otherwise do:  apt-get install snmpd libsnmp-dev
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
Test member nf_ct_event_notifier.ct_event net/netfilter/nf_conntrack_ecache.h  undeclared
mv compat_def.h- compat_def.h
Compiling 2.6-12-g40fefb2 for kernel 4.19.249
make -C /lib/modules/4.19.0-21-amd64/build M=/usr/local/src/ipt-netflow/ipt-netflow modules
make[1]: Entering directory '/usr/src/linux-headers-4.19.0-21-amd64'
  CC [M]  /usr/local/src/ipt-netflow/ipt-netflow/ipt_NETFLOW.o
/usr/local/src/ipt-netflow/ipt-netflow/ipt_NETFLOW.c: In function ‘netflow_work_fn’:
/usr/local/src/ipt-netflow/ipt-netflow/ipt_NETFLOW.c:4504:11: error: implicit declaration of function ‘__smp_processor_id’; did you mean ‘smp_processor_id’? [-Werror=implicit-function-declaration]
  wk_cpu = __smp_processor_id();
           ^~~~~~~~~~~~~~~~~~
           smp_processor_id
cc1: some warnings being treated as errors
make[4]: *** [/usr/src/linux-headers-4.19.0-21-common/scripts/Makefile.build:315: /usr/local/src/ipt-netflow/ipt-netflow/ipt_NETFLOW.o] Error 1
make[3]: *** [/usr/src/linux-headers-4.19.0-21-common/Makefile:1561: _module_/usr/local/src/ipt-netflow/ipt-netflow] Error 2
make[2]: *** [Makefile:146: sub-make] Error 2
make[1]: *** [Makefile:8: all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.19.0-21-amd64'
make: *** [Makefile:27: ipt_NETFLOW.ko] Error 2

На ядре Linux debian10 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux модуль собирается без ошибок.

@Alex5252
Copy link
Author

Взял Debian GNU/Linux 11 (bullseye) с ядром 5.10.0-13-amd64 поставил ipt-netflow с dkms - установилось без проблем. Далее обновилось через dkms, на ядро 5.10.0-16-amd64.
Корректная сборка на Debian GNU/Linux 11 (bullseye):

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  linux-image-5.10.0-16-amd64
The following packages will be upgraded:
  linux-image-amd64
1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/53.8 MB of archives.
After this operation, 302 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Reading changelogs... Done
Selecting previously unselected package linux-image-5.10.0-16-amd64.
(Reading database ... 73542 files and directories currently installed.)
Preparing to unpack .../linux-image-5.10.0-16-amd64_5.10.127-1_amd64.deb ...
Unpacking linux-image-5.10.0-16-amd64 (5.10.127-1) ...
Preparing to unpack .../linux-image-amd64_5.10.127-1_amd64.deb ...
Unpacking linux-image-amd64 (5.10.127-1) over (5.10.106-1) ...
Setting up linux-image-5.10.0-16-amd64 (5.10.127-1) ...
I: /vmlinuz is now a symlink to boot/vmlinuz-5.10.0-16-amd64
I: /initrd.img is now a symlink to boot/initrd.img-5.10.0-16-amd64
/etc/kernel/postinst.d/dkms:
dkms: running auto installation service for kernel 5.10.0-16-amd64:
Kernel preparation unnecessary for this kernel.  Skipping...

Running the pre_build script:
Module version: 2.6-12-g40fefb2-dirty
Kernel version: 5.10.106 (proc)
Kernel sources: /lib/modules/5.10.0-16-amd64/build (dkms)
! Warning: proc kernel version (5.10.106) and dkms version of kernel source (5.10.127) doesn't match!
!   You may try to specify only kernel source tree with --kdir=/lib/modules/5.10.0-16-amd64/build
!   and configure will pick up version properly.
! Assuming you want to build for 5.10.127
Checking for presence of include/linux/netfilter.h... No
Checking for presence of include/linux/llist.h... No
Checking for presence of include/linux/grsecurity.h... No
Iptables binary version: 1.8.7 (nf_tables) (detected from /sbin/iptables)
pkg-config for version 1.8.7 (nf_tables) exists: No (reported: 1.8.7)
Check for working gcc: Yes (gcc-10)
Checking for presence of xtables.h... Yes
Searching for iptables-1.8.7 (nf_tables) sources..
! Can not find iptables source directory, you may try setting it with --ipt-src=
! This is not fatal error, yet. Will be just using default include dir.
Iptables include flags: none (default)
Iptables module path: /usr/lib/debug/.dwz/x86_64-linux-gnu/iptables.debug (from binary)
Searching for net-snmp-config... No.
Searching for net-snmp agent... No.
 Assuming you don't want net-snmp agent support.
 Otherwise do:  apt-get install snmpd libsnmp-dev
Checking for DKMS... Yes.
Creating Makefile.. done.

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


Building module:
cleaning build area...
make -j2 KERNELRELEASE=5.10.0-16-amd64 ipt_NETFLOW.ko..............
cleaning build area...

DKMS: build completed.

ipt_NETFLOW.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.10.0-16-amd64/updates/dkms/

depmod...

DKMS: install completed.
.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.10.0-16-amd64
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.0-16-amd64
Found initrd image: /boot/initrd.img-5.10.0-16-amd64
Found linux image: /boot/vmlinuz-5.10.0-13-amd64
Found initrd image: /boot/initrd.img-5.10.0-13-amd64
done
Setting up linux-image-amd64 (5.10.127-1) ...```

@Alex5252
Copy link
Author

Модуль на Debian 10, собрался с коммитом 6a55739 с ядром kernel 4.19.0-21-amd64.

@wan-github
Copy link

wan-github commented Aug 2, 2022

Operating System: Debian GNU/Linux 9 (stretch) Kernel: Linux 4.9.0-17-amd64 не собирается
ошибка сборки
/root/ipt-netflow/ipt_NETFLOW.c:4504:11: error: implicit declaration of function ‘__smp_processor_id’ [-Werror=implicit-function-declaration] wk_cpu = __smp_processor_id();

@kalamlacki
Copy link

@gnought
Copy link

gnought commented May 1, 2023

This issue will be fixed after applying PR #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

4 participants