I was tinkering with cross compiling the Linux kernel on Cygwin 1.7 and go a new error since the last time. The kernel compression now uses some more elf definitions for x86 which are in elf.h on Linux but in ELFTypes.h on Cygwin 1.7. You cannot include both because there is a conflict between elf.h and ELFTypes.h. This is in addition to the non-x86 elf definitions used on Linux by scripts/mod/modpost which are not available in the elf.h on Cygwin.

FYI - Steve

$ gcc -o test test.c
In file included from test.c:2:
/usr/include/ELFTypes.h:25: error: conflicting types for 'Elf32_Addr'
/usr/include/sys/elf32.h:38: error: previous declaration of 'Elf32_Addr' was here
/usr/include/ELFTypes.h:27: error: conflicting types for 'Elf32_Off'
/usr/include/sys/elf32.h:40: error: previous declaration of 'Elf32_Off' was here
/usr/include/ELFTypes.h:28: error: conflicting types for 'Elf32_Sword'
/usr/include/sys/elf32.h:41: error: previous declaration of 'Elf32_Sword' was here
/usr/include/ELFTypes.h:29: error: conflicting types for 'Elf32_Word'
/usr/include/sys/elf32.h:42: error: previous declaration of 'Elf32_Word' was here

$ grep Elf32_Addr /usr/include/sys/elf32.h
typedef u_int32_t       Elf32_Addr;
      Elf32_Addr      e_entry;        /* Entry point. */
      Elf32_Addr      sh_addr;        /* Address in memory image. */
Elf32_Addr p_vaddr; /* Virtual address in memory image. */
      Elf32_Addr      p_paddr;        /* Physical address (not used). */
       Elf32_Addr      d_ptr;  /* Address value. */
      Elf32_Addr      r_offset;       /* Location to be relocated. */
      Elf32_Addr      r_offset;       /* Location to be relocated. */
      Elf32_Addr      st_value;       /* Symbol value. */

$ grep Elf32_Addr /usr/include/elf.h /usr/include/ELFTypes.h
/usr/include/ELFTypes.h:typedef unsigned long  Elf32_Addr;
/usr/include/ELFTypes.h:    Elf32_Addr    e_entry;
/usr/include/ELFTypes.h:    Elf32_Addr sh_addr;
/usr/include/ELFTypes.h:    Elf32_Addr p_vaddr;
/usr/include/ELFTypes.h:    Elf32_Addr p_paddr;
/usr/include/ELFTypes.h:    Elf32_Addr    st_value;
/usr/include/ELFTypes.h:    Elf32_Addr r_offset;
/usr/include/ELFTypes.h:    Elf32_Addr  r_offset;
/usr/include/ELFTypes.h:    Elf32_Addr d_ptr;




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to