delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/28/23:59:31

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
X-VR-Score: -30.00
X-Authority-Analysis: v=1.0 c=1 a=gqzci6Zg7iIA:10 a=NkL0bPc1UgZCM0VtGaAA:9 a=DuMH-u93eoGFOgO4b847cB3ph_IA:4 a=n4c44r6_0j-f_8pP:21 a=LhrRQzL0Em1l6H6S:21
X-CM-Score: 0.00
Message-ID: <4B11FF9C.4080703@ou.edu>
Date: Sat, 28 Nov 2009 22:59:08 -0600
From: "Stephen M. Kenton" <skenton AT ou DOT edu>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Conflict between elf.h and ELFTypes.h
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019