[Click] how to install click linux module

peng li hitcia at gmail.com
Fri Apr 19 10:54:30 EDT 2013


hi, when i install click, there is some err.
my system is rhel5.5, and upgrade the kerenl to 2.6.19.
i patched the src of the kernel, and compile the kernel again.
after reboot, install click, report err:
Your Linux kernel header files cause errors when included by a C++ program,
what is the reason?
regards
hci

[root at localhost click-2.0.1]# uname -a
Linux localhost.localdomain 2.6.19 #1 SMP Thu Apr 18 06:23:02 PDT 2013
x86_64 x86_64 x86_64 GNU/Linux

[root at localhost linux-2.6.19]# patch -p0 -b <
/root/Desktop/click-2.0.1/etc/linux-2.6.19.2-patch
patching file ./drivers/input/serio/i8042-ppcio.h
patching file ./drivers/media/dvb/bt8xx/bt878.h
patching file ./drivers/net/ibmveth.c
patching file ./drivers/net/wireless/rayctl.h
patching file ./drivers/video/i810/i810_main.h
patching file ./fs/file_table.c
patching file ./fs/super.c
patching file ./include/asm-alpha/core_tsunami.h
patching file ./include/asm-alpha/processor.h
patching file ./include/asm-alpha/system.h
patching file ./include/asm-arm/arch-omap/mtd-xip.h
patching file ./include/asm-arm/arch-pxa/mtd-xip.h
patching file ./include/asm-arm/system.h
patching file ./include/asm-arm26/hardirq.h
patching file ./include/asm-arm26/mmu.h
patching file ./include/asm-arm26/system.h
patching file ./include/asm-avr32/user.h
patching file ./include/asm-cris/arch-v10/io.h
patching file ./include/asm-cris/module.h
patching file ./include/asm-frv/bug.h
patching file ./include/asm-frv/fpu.h
patching file ./include/asm-frv/gdb-stub.h
patching file ./include/asm-frv/highmem.h
patching file ./include/asm-frv/module.h
patching file ./include/asm-frv/pgtable.h
patching file ./include/asm-frv/processor.h
patching file ./include/asm-frv/spr-regs.h
patching file ./include/asm-frv/system.h
patching file ./include/asm-frv/tlbflush.h
patching file ./include/asm-h8300/bitops.h
patching file ./include/asm-h8300/module.h
patching file ./include/asm-h8300/system.h
patching file ./include/asm-i386/alternative.h
patching file ./include/asm-i386/desc.h
patching file ./include/asm-i386/edac.h
patching file ./include/asm-i386/elf.h
patching file ./include/asm-i386/mach-voyager/irq_vectors.h
patching file ./include/asm-i386/module.h
patching file ./include/asm-i386/processor.h
patching file ./include/asm-i386/spinlock.h
patching file ./include/asm-i386/system.h
patching file ./include/asm-i386/tlbflush.h
patching file ./include/asm-i386/unwind.h
patching file ./include/asm-ia64/gcc_intrin.h
patching file ./include/asm-ia64/spinlock.h
patching file ./include/asm-m32r/module.h
patching file ./include/asm-m68k/module.h
patching file ./include/asm-m68k/system.h
patching file ./include/asm-m68knommu/mcfwdebug.h
patching file ./include/asm-m68knommu/system.h
patching file ./include/asm-mips/fpu.h
patching file ./include/asm-mips/io.h
patching file ./include/asm-mips/ip32/mace.h
patching file ./include/asm-mips/irq.h
patching file ./include/asm-mips/mips-boards/sim.h
patching file ./include/asm-mips/mipsregs.h
patching file ./include/asm-mips/paccess.h
patching file ./include/asm-mips/processor.h
patching file ./include/asm-mips/ptrace.h
patching file ./include/asm-mips/smp.h
patching file ./include/asm-mips/system.h
patching file ./include/asm-mips/time.h
patching file ./include/asm-mips/watch.h
patching file ./include/asm-parisc/system.h
patching file ./include/asm-powerpc/reg.h
patching file ./include/asm-ppc/system.h
patching file ./include/asm-s390/system.h
patching file ./include/asm-sh/module.h
patching file ./include/asm-sh64/module.h
patching file ./include/asm-sparc/module.h
patching file ./include/asm-sparc/system.h
patching file ./include/asm-sparc64/module.h
patching file ./include/asm-sparc64/system.h
patching file ./include/asm-um/elf-x86_64.h
patching file ./include/asm-um/module-i386.h
patching file ./include/asm-um/module-x86_64.h
patching file ./include/asm-v850/bitops.h
patching file ./include/asm-v850/system.h
patching file ./include/asm-v850/v850e_intc.h
patching file ./include/asm-x86_64/agp.h
patching file ./include/asm-x86_64/alternative.h
patching file ./include/asm-x86_64/bug.h
patching file ./include/asm-x86_64/desc.h
patching file ./include/asm-x86_64/edac.h
patching file ./include/asm-x86_64/i387.h
patching file ./include/asm-x86_64/mmu_context.h
patching file ./include/asm-x86_64/module.h
patching file ./include/asm-x86_64/processor.h
patching file ./include/asm-x86_64/spinlock.h
patching file ./include/asm-x86_64/system.h
patching file ./include/asm-x86_64/thread_info.h
patching file ./include/asm-x86_64/tlbflush.h
patching file ./include/asm-x86_64/uaccess.h
patching file ./include/asm-xtensa/module.h
patching file ./include/asm-xtensa/pgalloc.h
patching file ./include/asm-xtensa/pgtable.h
patching file ./include/asm-xtensa/processor.h
patching file ./include/asm-xtensa/system.h
patching file ./include/asm-xtensa/timex.h
patching file ./include/linux/backing-dev.h
patching file ./include/linux/compat.h
patching file ./include/linux/dqblk_v1.h
patching file ./include/linux/fs.h
patching file ./include/linux/highmem.h
patching file ./include/linux/inetdevice.h
patching file ./include/linux/kexec.h
patching file ./include/linux/ktime.h
patching file ./include/linux/linkage.h
patching file ./include/linux/list.h
patching file ./include/linux/lockdep.h
patching file ./include/linux/mempolicy.h
patching file ./include/linux/mm.h
patching file ./include/linux/netdevice.h
patching file ./include/linux/netfilter_ipv4/ip_conntrack_irc.h
patching file ./include/linux/netlink.h
patching file ./include/linux/prefetch.h
patching file ./include/linux/reiserfs_fs_sb.h
patching file ./include/linux/rtnetlink.h
Hunk #1 succeeded at 683 (offset -2 lines).
patching file ./include/linux/seccomp.h
patching file ./include/linux/security.h
patching file ./include/linux/skbuff.h
patching file ./include/linux/spinlock.h
Hunk #1 FAILED at 53.
1 out of 1 hunk FAILED -- saving rejects to file ./include/linux/spinlock.h.rej
patching file ./include/linux/spinlock_types.h
patching file ./include/linux/spinlock_types_up.h
patching file ./include/linux/stddef.h
patching file ./include/linux/sysctl.h
patching file ./include/linux/textsearch.h
patching file ./include/linux/types.h
patching file ./include/linux/unwind.h
patching file ./include/linux/wait.h
patching file ./include/net/compat.h
patching file ./include/net/neighbour.h
patching file ./include/net/pkt_cls.h
patching file ./include/net/route.h
patching file ./include/net/sock.h
patching file ./include/rdma/ib_user_verbs.h
patching file ./net/core/dev.c
patching file ./net/core/neighbour.c
patching file ./net/core/skbuff.c
patching file ./net/ipv4/arp.c
patching file ./net/ipv4/devinet.c
Hunk #1 succeeded at 1638 (offset -1 lines).
[root at localhost linux-2.6.19]#

[root at localhost click-2.0.1]# ./configure
--with-linux=/usr/src/linux-2.6.19
--with-linux-map=/boot/System.map-2.6.19 checking build system type...
x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for g++... g++
checking for gcc... (cached) gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for inline... inline
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether <new> works... yes
checking whether the C++ compiler understands constexpr... no
checking whether the C++ compiler understands static_assert... no
checking whether the C++ compiler understands #pragma interface... yes
checking how to run the C++ preprocessor... g++ -E
checking for ar... ar
checking for ld... ld
checking for nm... nm
checking for objcopy... objcopy
checking for ranlib... ranlib
checking for strip... strip
checking whether we are compiling for Linux... yes
checking for strerror... yes
checking for random... yes
checking for snprintf... yes
checking for strnlen... yes
checking for strtof... yes
checking for strtold... yes
checking for strtoul... yes
checking for tcgetpgrp... yes
checking for vsnprintf... yes
checking size of int... 4
checking size of long... 8
checking size of size_t... 8
checking size of void *... 8
checking whether char is unsigned... no
checking for inttypes.h... (cached) yes
checking whether machine is indifferent to alignment... yes
checking size of long long... 8
checking for long long... yes
checking for int64_t... yes
checking for uint64_t... yes
checking whether long and int64_t are the same type... yes
checking whether long long and int64_t are the same type... no
checking endian.h usability... yes
checking endian.h presence... yes
checking for endian.h... yes
checking endianness... 1234
checking byteswap.h usability... yes
checking byteswap.h presence... yes
checking for byteswap.h... yes
checking whether signed right shift is arithmetic... yes
checking for addressable va_list type... no
checking for __builtin_clz... yes
checking for __builtin_clzl... yes
checking for __builtin_clzll... yes
checking for __builtin_ffs... yes
checking for __builtin_ffsl... yes
checking for __builtin_ffsll... yes
checking for __sync_synchronize... yes
checking whether __sync_synchronize supports arguments... no
checking for __has_trivial_copy... no
checking for __thread storage class support... yes
checking for strings.h... (cached) yes
checking for ffs... yes
checking for ffsl... yes
checking for ffsll... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking size of struct timeval... 16
checking for struct timespec... yes
checking size of struct timespec... 16
checking whether clock_gettime is declared... yes
checking for library containing clock_gettime... -lrt
checking for clock_gettime... yes
checking termio.h usability... yes
checking termio.h presence... yes
checking for termio.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking sys/event.h usability... no
checking sys/event.h presence... no
checking for sys/event.h... no
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking whether <poll.h> is emulated... no
checking for pselect... yes
checking for sigaction... yes
checking for kqueue... no
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for dlopen... no
checking for dlopen in -ldl... yes
checking compiler flags for building loadable modules... -shared
checking for library containing gethostbyname... none required
checking for library containing connect... none required
checking whether accept() uses socklen_t... yes
checking for large file support in C library... yes
checking size of off_t... 8
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for madvise... yes
checking whether madvise is declared... yes
checking for Linux System.map... /boot/System.map-2.6.19
checking Linux version... 2.6.19
checking for Click Linux kernel extensions... yes
checking for Click Linux kernel extensions for transmit notification... no
checking for read_net_skbcount kernel extension... no
checking for strlen kernel symbol... yes
checking for tulip_interrupt_hook kernel symbol... no
checking for files_lock kernel symbol... yes
checking for files_lglock kernel symbol... no
checking for sb_lock kernel symbol... yes
checking for dev_ioctl kernel symbol... yes
checking for devinet_ioctl kernel symbol... yes
checking for inet_ioctl kernel symbol... yes
checking for inet_ctl_sock_create kernel symbol... no
checking for <linux/ktime.h>... yes
checking for atomic_set_mask... yes
checking for atomic_add_return... yes
checking for <asm/alternative.h>... yes
checking for <asm/system.h>... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking linux/if_tun.h usability... yes
checking linux/if_tun.h presence... yes
checking for linux/if_tun.h... yes
checking net/if_dl.h usability... no
checking net/if_dl.h presence... no
checking for net/if_dl.h... no
checking net/if_tap.h usability... no
checking net/if_tap.h presence... no
checking for net/if_tap.h... no
checking net/if_tun.h usability... no
checking net/if_tun.h presence... no
checking for net/if_tun.h... no
checking net/if_types.h usability... no
checking net/if_types.h presence... no
checking for net/if_types.h... no
checking net/bpf.h usability... no
checking net/bpf.h presence... no
checking for net/bpf.h... no
checking netpacket/packet.h usability... yes
checking netpacket/packet.h presence... yes
checking for netpacket/packet.h... yes
checking for pcap.h... not found
checking whether struct if_data has ifi_datalen... no
checking whether struct sockaddr_in has sin_len... no
checking expat.h usability... no
checking expat.h presence... no
checking for expat.h... no
checking for XML_ParserCreateNS in -lexpat... no
checking for Linux 2.6 compilation flags... -D__KERNEL__
-I/usr/src/linux-2.6.19/include  -include
/usr/src/linux-2.6.19/include/linux/autoconf.h -Wall -Wundef
-Wno-trigraphs -fno-strict-aliasing  -Os  -mtune=generic -m64
-mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks
-Wno-sign-compare -funit-at-a-time -mno-sse -mno-mmx -mno-sse2
-mno-3dnow -maccumulate-outgoing-args -DCONFIG_AS_CFI=1
-DCONFIG_AS_CFI_SIGNAL_FRAME=1 -fomit-frame-pointer
-fasynchronous-unwind-tables  -fno-stack-protector
-I/usr/src/linux-2.6.19/include  -include
/usr/src/linux-2.6.19/include/linux/autoconf.h
configure: making C++-safe versions of Linux kernel headers (may take a while)
checking for C++-includable kernel header files... no
checking whether long and int64_t are the same type in the Linux kernel... no
checking whether long long and int64_t are the same type in the Linux
kernel... yes
checking whether uintptr_t is defined in the Linux kernel... no
checking whether struct sk_buff has a security member... no
checking whether struct sk_buff has an fclone member... no
checking whether skb_shinfo has a tso_size member... no
checking whether skb_shinfo has a gso_size member... no
checking whether skb_shinfo has a ufo_size member... no
checking whether skb_shinfo has an ip6_frag_id member... no
checking for device polling kernel extension... no
checking whether skb_dst_drop is declared... no
checking whether skb_recycle is declared... no
checking whether skb_linearize is declared... no
checking whether netif_receive_skb has been extended... no
checking whether net_enable_timestamp is declared... no
checking whether netif_tx_lock is declared... no
checking whether netdev_get_tx_queue is declared... no
checking whether netif_tx_queue_frozen is declared... no
checking whether netdev_uses_dsa_tags is declared... no
checking whether netdev_uses_trailer_tags is declared... no
checking for netdev_rx_handler_register kernel symbol... no
checking for get_monotonic_coarse kernel symbol... no
checking for getboottime kernel symbol... no
configure: WARNING:
=========================================
Your Linux kernel header files cause errors when included by a C++ program,
so I won't try to compile the linuxmodule driver.
There are two common reasons for this error:
1. You have not applied the Linux kernel patch that comes with this
   distribution.  Apply the right patch and try again.  See the INSTALL
   file for more information.
2. Your Linux configuration enables some functionality that is not yet
   covered by our patches.  Turn off this functionality and try again,
   or fix the error and tell us how you did it.  See the config.log file
   for more detailed information on the error.
=========================================
checking for a BSD-compatible install... /usr/bin/install -c
checking whether install accepts -C... yes
checking for GNU make... make
checking for working autoconf... missing
checking for perl5... no
checking for perl... perl
checking for gawk... gawk
checking for grep that handles long lines and -e... (cached) /bin/grep
checking for egrep... (cached) /bin/grep -E
checking for md5sum... md5sum
checking for working makeinfo... missing
checking for working texi2dvi... missing
checking for install-info... /sbin/install-info
checking for working install-info... found
checking for working pod2man... found
configure: creating ./config.status
config.status: creating Makefile
config.status: creating click-buildtool
config.status: creating click-compile
config.status: creating config.mk
config.status: creating installch
config.status: creating tools/Makefile
config.status: creating tools/lib/Makefile
config.status: creating doc/Makefile
config.status: creating etc/libclick/Makefile
config.status: creating etc/pkg-config.mk
config.status: creating bsdmodule/Makefile
config.status: creating linuxmodule/Makefile
config.status: creating ns/Makefile
config.status: creating userlevel/Makefile
config.status: creating tools/click-align/Makefile
config.status: creating tools/click-check/Makefile
config.status: creating tools/click-combine/Makefile
config.status: creating tools/click-devirtualize/Makefile
config.status: creating tools/click-fastclassifier/Makefile
config.status: creating tools/click-flatten/Makefile
config.status: creating tools/click-mkmindriver/Makefile
config.status: creating tools/click-pretty/Makefile
config.status: creating tools/click-undead/Makefile
config.status: creating tools/click-xform/Makefile
config.status: creating tools/click2xml/Makefile
config.status: creating tools/click-install/Makefile
config.status: creating include/click/config.h
config.status: include/click/config.h is unchanged
config.status: creating include/click/pathvars.h
config.status: creating include/click/config-bsdmodule.h
config.status: include/click/config-bsdmodule.h is unchanged
config.status: creating include/click/config-linuxmodule.h
config.status: include/click/config-linuxmodule.h is unchanged
config.status: creating include/click/config-ns.h
config.status: include/click/config-ns.h is unchanged
config.status: creating include/click/config-userlevel.h
config.status: include/click/config-userlevel.h is unchanged
config.status: executing default-1 commands
[root at localhost linuxmodule]#


[root at localhost linuxmodule]# make
make -C /usr/src/kernels/linux-2.6.19
M=/root/Desktop/click-2.0.1/linuxmodule  modules
make[1]: Entering directory `/usr/src/kernels/linux-2.6.19'
  CC [M] in_cksum.o
In file included from
/root/Desktop/click-2.0.1/include/click-linuxmodule/include0/linux/sched.h:64,
                 from
/root/Desktop/click-2.0.1/include/click-linuxmodule/include0/asm/uaccess.h:14,
                 from
/root/Desktop/click-2.0.1/include/click-linuxmodule/include0/net/checksum.h:30,
                 from
/root/Desktop/click-2.0.1/linuxmodule/../include/clicknet/ip.h:8,
                 from /root/Desktop/click-2.0.1/linuxmodule/../lib/in_cksum.c:8:
/root/Desktop/click-2.0.1/include/click-linuxmodule/include0/asm/semaphore.h:3:1:
error: unterminated #ifndef
In file included from
/root/Desktop/click-2.0.1/include/click-linuxmodule/include0/asm/mmu.h:10,
                 from
/root/Desktop/click-2.0.1/include/click-linuxmodule/include0/linux/sched.h:67,
                 from
/root/Desktop/click-2.0.1/include/click-linuxmodule/include0/asm/uaccess.h:14,
                 from
/root/Desktop/click-2.0.1/include/click-linuxmodule/include0/net/checksum.h:30,
                 from
/root/Desktop/click-2.0.1/linuxmodule/../include/clicknet/ip.h:8,
                 from /root/Desktop/click-2.0.1/linuxmodule/../lib/in_cksum.c:8:
/root/Desktop/click-2.0.1/include/click-linuxmodule/include0/asm/semaphore.h:3:1:
error: unterminated #ifndef
make[2]: *** [/root/Desktop/click-2.0.1/linuxmodule/in_cksum.o] Error 1
make[1]: *** [_module_/root/Desktop/click-2.0.1/linuxmodule] Error 2
make[1]: Leaving directory `/usr/src/kernels/linux-2.6.19'
make: *** [all] Error 2
[root at localhost linuxmodule]#

[root at localhost click-2.0.1]# g++ -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)
[root at localhost click-2.0.1]# gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)
[root at localhost click-2.0.1]# make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-redhat-linux-gnu

[root at localhost click-2.0.1]# ./configure
--with-linux=/lib/module/src/2.6.9/include
also reports err.


More information about the click mailing list