[Click] compile errors

Eddie Kohler kohler at CS.UCLA.EDU
Tue Apr 27 18:44:31 EDT 2004


Hi Remo,

On Apr 27, 2004, at 3:40 PM, Remo Strotkamp wrote:
>  #1 for userland click on an alignement picky machine, the compile 
> fails
>     for elements/userlevel/fromfile.cc for line:
>              memcpy(buffer, chunk, sizeof(*ph));
>
>    which is not really surprising as ph doesn't seem to be defined
>    anywhere. I got it to compile by inserting the following line right
>    before the offending one (WARNING: I don't know if that's the right
>     thing to do AT ALL, but it makes it compile and I don't plan to use
>    FromFile....)
>
>              const fake_pcap_pkthdr *ph;

Thanks for reporting this bug!  We've fixed it in CVS.  (The right fix
is to use 'size' instead of 'sizeof(*ph)'.)

>  #2  when crosscompiling the kernel (had quite some rejects with the 
>      different patches (click, click-wifi, arm, xscale,....) the
>      click-wifi module wouldn't compile. The reason here seemed to have
>      been that the drivers/net/wifi/click-wifi.c is missing an #include
>      <linux/init.h> line...
>      (but that might be due to the patch rejects and me not cleaning up
>       the mess properly )
>
>
>  while trying to configure the click router, the scrip tells me that I 
> need to apply the provided patches, even though I did. Anybody any
>  ideas where that one's coming from?

It looks like you need to patch

>  /usr/local/arm/src/linux-2.4.19/include/asm/proc/pgalloc.h: In 
> function `pte_t*
>     pte_alloc_one(mm_struct*, long unsigned int)':
>  /usr/local/arm/src/linux-2.4.19/include/asm/proc/pgalloc.h:25: invalid
>     conversion from `void*' to `pte_t*'

this line by adding an explicit "(pte_t *)" cache before the call
to 'kmem_cache_alloc'.

The Click patches implement several cleanups to kernel sources, but
we've only cleaned up files we've needed in the past.  When you port
to a new architecture, you may need to:

1. Introduce explicit casts from 'void *' (as above).  C++ doesn't
    allow implicit casts from void*.

2. Change "::" in asm statements to ": :".  It looks like your second
    error is of this type, but in my patched 2.4.20 kernel, the line
    has been patched correctly.  Maybe it's not in our 2.4.19 patch?

3. Fix "const" bugs and pointer cast bugs (i.e. where function A is
    declared to return 'const unsigned char *' but it actually returns
    'const char *').

Anyway, what would help us the most would be for you to fix the problems
you're seeing now, then report the complete list when you're done.

Thanks!!
Eddie


>
>  thanks a lot in advance
>
>  remo
>
>  here's the offending configure command:
>
>  ./configure   --host=arm-linux --enable-tools=mixed --enable-grid \
>       --enable-local --with-linux=/usr/local/arm/src/linux-2.4.19/
>
>
>  here's the relevant part of the config.log file:
>
>
>
>  configure:9161: checking for C++-includable kernel header files
>  configure:9189: arm-linux-g++ -w -W -Wall -fno-exceptions -fno-rtti  
> -c -g -O2  -D__KERNEL__ -I/usr/local/arm/src/linux-2.4.19//include 
> conftest.cc >&5
>  configure:9192: $? = 0
>  configure:9195: test -s conftest.o
>  configure:9198: $? = 0
>  configure:9209: result: yes
>  configure:9214: checking whether -fpermissive is required
>  configure:9254: arm-linux-g++ -w -W -Wall -fno-exceptions -fno-rtti  
> -o conftest -g -O2  -D__KERNEL__ 
> -I/usr/local/arm/src/linux-2.4.19//include  conftest.cc  >&5
>  In file included from 
> /usr/local/arm/src/linux-2.4.19/include/linux/rwsem.h:19,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/asm/semaphore.h:10,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/fs.h:200,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/capability.h:17,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/binfmts.h:5,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/sched.h:9,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/skbuff.h:19,
>                   from configure:9296:
>  /usr/local/arm/src/linux-2.4.19/include/asm/system.h:39: parse error 
> before
>     string constant
>  In file included from 
> /usr/local/arm/src/linux-2.4.19/include/asm/pgalloc.h:30,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/highmem.h:5,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/skbuff.h:27,
>                   from configure:9296:
>  /usr/local/arm/src/linux-2.4.19/include/asm/proc/pgalloc.h: In 
> function `pte_t*
>     pte_alloc_one(mm_struct*, long unsigned int)':
>  /usr/local/arm/src/linux-2.4.19/include/asm/proc/pgalloc.h:25: invalid
>     conversion from `void*' to `pte_t*'
>  configure:9257: $? = 1
>  configure: failed program was:
>  | #line 9225 "configure"
>  | /* confdefs.h.  */
>  |
>  | #define PACKAGE_NAME ""
>  | #define PACKAGE_TARNAME ""
>  | #define PACKAGE_VERSION ""
>  | #define PACKAGE_STRING ""
>  | #define PACKAGE_BUGREPORT ""
>  | #define CLICK_VERSION "1.4pre1"
>  | #if defined(__cplusplus) && !defined(__KERNEL__)
>  | #include <stdlib.h>
>  | #endif
>  | #define HAVE_NEW_HDR 1
>  | #define LINUX_SRCDIR "/usr/local/arm/src/linux-2.4.19/"
>  | #define FREEBSD_INCLUDEDIR "/usr/include"
>  | #define NUM_CLICK_CPUS 1
>  | #define HAVE_STRERROR 1
>  | #define HAVE_SNPRINTF 1
>  | #define HAVE_STRTOUL 1
>  | #define HAVE_TCGETPGRP 1
>  | #define HAVE_VSNPRINTF 1
>  | #define STDC_HEADERS 1
>  | #define HAVE_SYS_TYPES_H 1
>  | #define HAVE_SYS_STAT_H 1
>  | #define HAVE_STDLIB_H 1
>  | #define HAVE_STRING_H 1
>  | #define HAVE_MEMORY_H 1
>  | #define HAVE_STRINGS_H 1
>  | #define HAVE_INTTYPES_H 1
>  | #define HAVE_STDINT_H 1
>  | #define HAVE_UNISTD_H 1
>  | #define HAVE_INTTYPES_H 1
>  | #define HAVE_INT64_TYPES 1
>  | #define HAVE_ENDIAN_H 1
>  | #define CLICK_BYTE_ORDER 1234
>  | #define HAVE_BYTESWAP_H 1
>  | #define HAVE_ADDRESSABLE_VA_LIST 1
>  | #define HAVE_UNISTD_H 1
>  | #define HAVE_TERMIO_H 1
>  | #define HAVE_POLL_H 1
>  | #define HAVE_NETDB_H 1
>  | #define HAVE_DLFCN_H 1
>  | #define HAVE_DYNAMIC_LINKING 1
>  | #define HAVE_DLFCN_H 1
>  | #define HAVE_LARGE_FILE_SUPPORT 1
>  | #define SIZEOF_OFF_T 4
>  | #define HAVE_SYS_MMAN_H 1
>  | #define HAVE_STDLIB_H 1
>  | #define HAVE_UNISTD_H 1
>  | #define HAVE_GETPAGESIZE 1
>  | #define HAVE_MADVISE 1
>  | #define HAVE_CLICKFS 1
>  | #define HAVE_CLICK_KERNEL 1
>  | #define HAVE_LINUX_STRLEN_EXPOSED 1
>  | #define HAVE_LINUX_POLLING 1
>  | #define HAVE_STRIDE_SCHED 1
>  | #define HAVE_LINUX_IF_TUN_H 1
>  | #define HAVE_PCAP 1
>  | #define HAVE_USERLEVEL_DRIVER 1
>  | /* end confdefs.h.  */
>  | #define MODULE
>  | #define _FEATURES_H
>  | #define new xxx_new
>  | #define this xxx_this
>  | #define delete xxx_delete
>  | #define class xxx_class
>  | #define virtual xxx_virtual
>  | #define typename xxx_typename
>  | #define private xxx_private
>  | #define protected xxx_protected
>  | #define public xxx_public
>  | #define namespace xxx_namespace
>  | #include <linux/skbuff.h>
>  | int
>  | main ()
>  | {
>  |
>  |   ;
>  |   return 0;
>  | }
>  configure:9274: result: yes
>  configure:9279: checking whether -fpermissive is allowed
>  configure:9319: arm-linux-g++ -w -W -Wall -fno-exceptions -fno-rtti  
> -fpermissive -o conftest -g -O2  -D__KERNEL__ 
> -I/usr/local/arm/src/linux-2.4.19//include  conftest.cc  >&5
>  In file included from 
> /usr/local/arm/src/linux-2.4.19/include/linux/rwsem.h:19,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/asm/semaphore.h:10,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/fs.h:200,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/capability.h:17,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/binfmts.h:5,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/sched.h:9,
>                   from 
> /usr/local/arm/src/linux-2.4.19/include/linux/skbuff.h:19,
>                   from configure:9361:
>  /usr/local/arm/src/linux-2.4.19/include/asm/system.h:39: parse error 
> before
>     string constant
>  configure:9322: $? = 1
>  configure: failed program was:
>  | #line 9290 "configure"
>  | /* confdefs.h.  */
>  |
>  | #define PACKAGE_NAME ""
>  | #define PACKAGE_TARNAME ""
>  | #define PACKAGE_VERSION ""
>  | #define PACKAGE_STRING ""
>  | #define PACKAGE_BUGREPORT ""
>  | #define CLICK_VERSION "1.4pre1"
>  | #if defined(__cplusplus) && !defined(__KERNEL__)
>  | #include <stdlib.h>
>  | #endif
>  | #define HAVE_NEW_HDR 1
>  | #define LINUX_SRCDIR "/usr/local/arm/src/linux-2.4.19/"
>  | #define FREEBSD_INCLUDEDIR "/usr/include"
>  | #define NUM_CLICK_CPUS 1
>  | #define HAVE_STRERROR 1
>  | #define HAVE_SNPRINTF 1
>  | #define HAVE_STRTOUL 1
>  | #define HAVE_TCGETPGRP 1
>  | #define HAVE_VSNPRINTF 1
>  | #define STDC_HEADERS 1
>  | #define HAVE_SYS_TYPES_H 1
>  | #define HAVE_SYS_STAT_H 1
>  | #define HAVE_STDLIB_H 1
>  | #define HAVE_STRING_H 1
>  | #define HAVE_MEMORY_H 1
>  | #define HAVE_STRINGS_H 1
>  | #define HAVE_INTTYPES_H 1
>  | #define HAVE_STDINT_H 1
>  | #define HAVE_UNISTD_H 1
>  | #define HAVE_INTTYPES_H 1
>  | #define HAVE_INT64_TYPES 1
>  | #define HAVE_ENDIAN_H 1
>  | #define CLICK_BYTE_ORDER 1234
>  | #define HAVE_BYTESWAP_H 1
>  | #define HAVE_ADDRESSABLE_VA_LIST 1
>  | #define HAVE_UNISTD_H 1
>  | #define HAVE_TERMIO_H 1
>  | #define HAVE_POLL_H 1
>  | #define HAVE_NETDB_H 1
>  | #define HAVE_DLFCN_H 1
>  | #define HAVE_DYNAMIC_LINKING 1
>  | #define HAVE_DLFCN_H 1
>  | #define HAVE_LARGE_FILE_SUPPORT 1
>  | #define SIZEOF_OFF_T 4
>  | #define HAVE_SYS_MMAN_H 1
>  | #define HAVE_STDLIB_H 1
>  | #define HAVE_UNISTD_H 1
>  | #define HAVE_GETPAGESIZE 1
>  | #define HAVE_MADVISE 1
>  | #define HAVE_CLICKFS 1
>  | #define HAVE_CLICK_KERNEL 1
>  | #define HAVE_LINUX_STRLEN_EXPOSED 1
>  | #define HAVE_LINUX_POLLING 1
>  | #define HAVE_STRIDE_SCHED 1
>  | #define HAVE_LINUX_IF_TUN_H 1
>  | #define HAVE_PCAP 1
>  | #define HAVE_USERLEVEL_DRIVER 1
>  | /* end confdefs.h.  */
>  | #define MODULE
>  | #define _FEATURES_H
>  | #define new xxx_new
>  | #define this xxx_this
>  | #define delete xxx_delete
>  | #define class xxx_class
>  | #define virtual xxx_virtual
>  | #define typename xxx_typename
>  | #define private xxx_private
>  | #define protected xxx_protected
>  | #define public xxx_public
>  | #define namespace xxx_namespace
>  | #include <linux/skbuff.h>
>  | int
>  | main ()
>  | {
>  |
>  |   ;
>  |   return 0;
>  | }
>  configure:9339: result: no
>  configure:9368: WARNING:
>  =========================================
>
>  Your header files must be patched before a C++ program
>  can include them. Apply the patch that came with this distribution
>  if you want to compile Click as a Linux module.
>
>  =========================================
>
>
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click



More information about the click mailing list