[uClibc 0000778]: Error during compilation of readelf in uClibc using buildroot

bugs at busybox.net bugs at busybox.net
Tue Apr 18 09:55:49 UTC 2006


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=778 
====================================================================== 
Reported By:                blurgk
Assigned To:                uClibc
====================================================================== 
Project:                    uClibc
Issue ID:                   778
Category:                   Architecture Specific
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             03-08-2006 06:24 PST
Last Modified:              04-18-2006 02:55 PDT
====================================================================== 
Summary:                    Error during compilation of readelf in uClibc using
buildroot
Description: 

Hello, I am using buildroot under cygwin and I get an error during the
compilation of readelf in uclibc about conflicting elf defines:

gcc ../utils/readelf.c -o ../utils/readelf.host -Wl,-s -O2 -Wall -include
../include/elf.h
In file included from /usr/include/elf.h:18,
                 from ../utils/readelf.c:41:
/usr/include/sys/elf32.h:38: error: conflicting types for 'Elf32_Addr'
./../include/elf.h:48: error: previous declaration of 'Elf32_Addr' was
here
/usr/include/sys/elf32.h:40: error: conflicting types for 'Elf32_Off'
./../include/elf.h:52: error: previous declaration of 'Elf32_Off' was
here
/usr/include/sys/elf32.h:42: error: conflicting types for 'Elf32_Word'
./../include/elf.h:36: error: previous declaration of 'Elf32_Word' was
here
/usr/include/sys/elf32.h:65: error: conflicting types for 'Elf32_Ehdr'
./../include/elf.h:84: error: previous declaration of 'Elf32_Ehdr' was
here
/usr/include/sys/elf32.h:83: error: conflicting types for 'Elf32_Shdr'
./../include/elf.h:380: error: previous declaration of 'Elf32_Shdr' was
here
/usr/include/sys/elf32.h:98: error: conflicting types for 'Elf32_Phdr'
./../include/elf.h:643: error: previous declaration of 'Elf32_Phdr' was
here
/usr/include/sys/elf32.h:110: error: conflicting types for 'Elf32_Dyn'
./../include/elf.h:735: error: previous declaration of 'Elf32_Dyn' was
here
/usr/include/sys/elf32.h:120: error: conflicting types for 'Elf32_Rel'
./../include/elf.h:592: error: previous declaration of 'Elf32_Rel' was
here
/usr/include/sys/elf32.h:127: error: conflicting types for 'Elf32_Rela'
./../include/elf.h:612: error: previous declaration of 'Elf32_Rela' was
here
/usr/include/sys/elf32.h:147: error: conflicting types for 'Elf32_Sym'
./../include/elf.h:483: error: previous declaration of 'Elf32_Sym' was
here
In file included from /usr/include/elf.h:19,
                 from ../utils/readelf.c:41:
/usr/include/sys/elf64.h:81: error: conflicting types for 'Elf64_Ehdr'
./../include/elf.h:102: error: previous declaration of 'Elf64_Ehdr' was
here
/usr/include/sys/elf64.h:99: error: conflicting types for 'Elf64_Shdr'
./../include/elf.h:394: error: previous declaration of 'Elf64_Shdr' was
here
/usr/include/sys/elf64.h:114: error: conflicting types for 'Elf64_Phdr'
./../include/elf.h:655: error: previous declaration of 'Elf64_Phdr' was
here
/usr/include/sys/elf64.h:126: error: conflicting types for 'Elf64_Dyn'
./../include/elf.h:745: error: previous declaration of 'Elf64_Dyn' was
here
/usr/include/sys/elf64.h:136: error: conflicting types for 'Elf64_Rel'
./../include/elf.h:603: error: previous declaration of 'Elf64_Rel' was
here
/usr/include/sys/elf64.h:143: error: conflicting types for 'Elf64_Rela'
./../include/elf.h:619: error: previous declaration of 'Elf64_Rela' was
here
/usr/include/sys/elf64.h:163: error: conflicting types for 'Elf64_Sym'
./../include/elf.h:493: error: previous declaration of 'Elf64_Sym' was
here
../utils/readelf.c:42:18: link.h: No such file or directory
../utils/readelf.c: In function `byteswap64_to_host':
../utils/readelf.c:56: warning: implicit declaration of function
`bswap_64'
../utils/readelf.c: At top level:
../utils/readelf.c:67: error: parse error before '*' token
../utils/readelf.c:67: error: parse error before "ElfW"
../utils/readelf.c:70: error: parse error before '*' token
../utils/readelf.c:70: warning: type defaults to `int' in declaration of
`shdr'
../utils/readelf.c:70: warning: implicit declaration of function `ElfW'
../utils/readelf.c:70: error: `Shdr' undeclared here (not in a function)
../utils/readelf.c:70: error: parse error before ')' token
../utils/readelf.c:70: error: `ehdr' undeclared here (not in a function)
../utils/readelf.c:70: warning: data definition has no type or storage
class
../utils/readelf.c:71: error: parse error before "for"
../utils/readelf.c:79: error: parse error before '*' token
../utils/readelf.c:79: error: parse error before "ElfW"
../utils/readelf.c:82: error: parse error before '*' token
../utils/readelf.c:82: warning: type defaults to `int' in declaration of
`phdr'
../utils/readelf.c:82: error: `Phdr' undeclared here (not in a function)
../utils/readelf.c:82: error: parse error before ')' token
../utils/readelf.c:82: warning: data definition has no type or storage
class
../utils/readelf.c:83: error: parse error before "for"
../utils/readelf.c:92: error: parse error before "ElfW"
../utils/readelf.c:92: warning: type defaults to `int' in declaration of
`dynp'
../utils/readelf.c:93: warning: type defaults to `int' in declaration of
`ElfW'
../utils/readelf.c:93: warning: parameter names (without types) in
function declaration
../utils/readelf.c:93: error: parse error before '*' token
../utils/readelf.c:96: error: parse error before "tx_reloc"
../utils/readelf.c:96: warning: type defaults to `int' in declaration of
`tx_reloc'
../utils/readelf.c:96: error: `pt_text' undeclared here (not in a
function)
../utils/readelf.c:96: error: initializer element is not constant
../utils/readelf.c:96: warning: data definition has no type or storage
class
../utils/readelf.c:97: error: parse error before "for"
../utils/readelf.c:108: error: parse error before '(' token
../utils/readelf.c:108: error: parse error before ')' token
../utils/readelf.c:119: warning: type defaults to `int' in declaration of
`byteswap'
../utils/readelf.c:119: warning: data definition has no type or storage
class
../utils/readelf.c:121: error: parse error before "if"
../utils/readelf.c:145: error: parse error before '(' token
../utils/readelf.c:150: warning: type defaults to `int' in declaration of
`tmp1'
../utils/readelf.c:150: warning: initialization makes integer from pointer
without a cast
../utils/readelf.c:150: warning: data definition has no type or storage
class
../utils/readelf.c:150: error: parse error before "break"
../utils/readelf.c:151: warning: type defaults to `int' in declaration of
`tmp1'
../utils/readelf.c:151: error: redefinition of 'tmp1'
../utils/readelf.c:150: error: previous definition of 'tmp1' was here
../utils/readelf.c:151: warning: initialization makes integer from pointer
without a cast
../utils/readelf.c:151: warning: data definition has no type or storage
class
../utils/readelf.c:151: error: parse error before "break"
../utils/readelf.c:152: warning: type defaults to `int' in declaration of
`tmp1'
../utils/readelf.c:152: error: redefinition of 'tmp1'
../utils/readelf.c:151: error: previous definition of 'tmp1' was here
../utils/readelf.c:152: error: redefinition of 'tmp1'
../utils/readelf.c:151: error: previous definition of 'tmp1' was here
../utils/readelf.c:152: warning: initialization makes integer from pointer
without a cast
../utils/readelf.c:152: warning: data definition has no type or storage
class
../utils/readelf.c:152: error: parse error before "break"
../utils/readelf.c:153: warning: type defaults to `int' in declaration of
`tmp1'
../utils/readelf.c:153: error: redefinition of 'tmp1'
../utils/readelf.c:152: error: previous definition of 'tmp1' was here
../utils/readelf.c:153: error: redefinition of 'tmp1'
../utils/readelf.c:151: error: previous definition of 'tmp1' was here
../utils/readelf.c:153: warning: initialization makes integer from pointer
without a cast
../utils/readelf.c:153: warning: data definition has no type or storage
class
../utils/readelf.c:153: error: parse error before "break"
../utils/readelf.c:154: warning: type defaults to `int' in declaration of
`tmp1'
../utils/readelf.c:154: error: redefinition of 'tmp1'
../utils/readelf.c:153: error: previous definition of 'tmp1' was here
../utils/readelf.c:154: error: redefinition of 'tmp1'
../utils/readelf.c:151: error: previous definition of 'tmp1' was here
../utils/readelf.c:154: warning: initialization makes integer from pointer
without a cast
../utils/readelf.c:154: warning: data definition has no type or storage
class
../utils/readelf.c:154: error: parse error before "break"
../utils/readelf.c:158: error: parse error before string constant
../utils/readelf.c:158: warning: type defaults to `int' in declaration of
`printf'
../utils/readelf.c:158: error: conflicting types for 'printf'
../utils/readelf.c:158: note: a parameter list with an ellipsis can't
match an empty parameter name list declaration
../utils/readelf.c:158: error: conflicting types for 'printf'
../utils/readelf.c:158: note: a parameter list with an ellipsis can't
match an empty parameter name list declaration
../utils/readelf.c:158: warning: data definition has no type or storage
class
../utils/readelf.c:264: error: parse error before string constant
../utils/readelf.c:264: warning: type defaults to `int' in declaration of
`printf'
../utils/readelf.c:264: warning: data definition has no type or storage
class
../utils/readelf.c:272: error: parse error before string constant
../utils/readelf.c:272: warning: type defaults to `int' in declaration of
`printf'
../utils/readelf.c:272: warning: data definition has no type or storage
class
../utils/readelf.c:280: error: parse error before string constant
../utils/readelf.c:280: warning: type defaults to `int' in declaration of
`printf'
../utils/readelf.c:280: warning: data definition has no type or storage
class
../utils/readelf.c:282: error: parse error before string constant
../utils/readelf.c:303: error: parse error before string constant
../utils/readelf.c:303: warning: type defaults to `int' in declaration of
`printf'
../utils/readelf.c:303: warning: data definition has no type or storage
class
../utils/readelf.c:305: error: parse error before string constant
../utils/readelf.c:305: warning: type defaults to `int' in declaration of
`printf'
../utils/readelf.c:305: warning: data definition has no type or storage
class
../utils/readelf.c:308: error: parse error before '(' token
../utils/readelf.c:308: warning: type defaults to `int' in declaration of
`dynamic'
../utils/readelf.c:308: error: parse error before "char"
../utils/readelf.c:312: error: parse error before string constant
../utils/readelf.c:312: warning: type defaults to `int' in declaration of
`printf'
../utils/readelf.c:312: warning: data definition has no type or storage
class
../utils/readelf.c:313: error: parse error before '->' token
../utils/readelf.c:320: error: parse error before '(' token
../utils/readelf.c:323: warning: type defaults to `int' in declaration of
`phdr'
../utils/readelf.c:323: error: conflicting types for 'phdr'
../utils/readelf.c:82: error: previous definition of 'phdr' was here
../utils/readelf.c:323: warning: implicit declaration of function
`elf_find_phdr_type'
../utils/readelf.c:323: error: initializer element is not constant
../utils/readelf.c:323: warning: data definition has no type or storage
class
../utils/readelf.c:324: error: parse error before "if"
../utils/readelf.c: In function `main':
../utils/readelf.c:336: error: `Ehdr' undeclared (first use in this
function)
../utils/readelf.c:336: error: (Each undeclared identifier is reported
only once
../utils/readelf.c:336: error: for each function it appears in.)
../utils/readelf.c:337: error: `dynsec' undeclared (first use in this
function)
../utils/readelf.c:338: error: `Dyn' undeclared (first use in this
function)
../utils/readelf.c:338: error: invalid operands to binary *
../utils/readelf.c:357: error: parse error before ')' token
../utils/readelf.c:362: warning: implicit declaration of function
`check_elf_header'
../utils/readelf.c:366: warning: implicit declaration of function
`describe_elf_hdr'
../utils/readelf.c:367: warning: implicit declaration of function
`describe_elf_interpreter'
../utils/readelf.c:369: warning: implicit declaration of function
`elf_find_section_type'
../utils/readelf.c:371: error: parse error before ')' token
../utils/readelf.c:372: warning: implicit declaration of function
`elf_find_dynamic'
../utils/readelf.c:373: warning: implicit declaration of function
`list_needed_libraries'
make[1]: *** [../utils/readelf.host] Error 1
make: *** [/usr/src/buildroot/build_arm_nofpu/staging_dir/lib/libc.a]
Error 2

In addition, running make after this error doesn't retry to build
readelf.
Attached is my buildroot configuration.
====================================================================== 

---------------------------------------------------------------------- 
 blurgk - 04-18-06 02:32  
---------------------------------------------------------------------- 
The solution to this pronlem is in this bug report, which has been closed:
http://bugs.busybox.net/view.php?id=816 

---------------------------------------------------------------------- 
 blurgk - 04-18-06 02:55  
---------------------------------------------------------------------- 
Ignore my previous message, the error is still present. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
03-08-06 06:24  blurgk         New Issue                                    
03-08-06 06:24  blurgk         Status                   new => assigned     
03-08-06 06:24  blurgk         Assigned To               => uClibc          
03-08-06 06:24  blurgk         File Added: .config                          
04-18-06 02:32  blurgk         Note Added: 0001305                          
04-18-06 02:55  blurgk         Note Added: 0001306                          
======================================================================




More information about the uClibc-cvs mailing list