[uClibc] [patch] building toolchain on old host distr: readelf.c misses EM _ defines

Jörg Albert JAlbert at advaoptical.de
Fri Feb 6 11:40:04 UTC 2004


Hi,

I tried to build the uClibc toolchain on a host with 
a rather old (SuSE 6.3 ?) distribution. Compiling
uClibc's utils/readelf.c for the host failed with:

---
make[3]: Entering directory
`/opt/toolchains/tmp/toolchain/build_mipsel/uClibc-0.9.21/ldso/util'
gcc -O2 -Wall -D__LDSO_LDD_SUPPORT -DUCLIBC_TARGET_PREFIX=\"/\" \
-DUCLIBC_DEVEL_PREFIX=\""/opt/toolchains/toolchain_mipsel"\" \
 
-DUCLIBC_BUILD_DIR=\"/opt/toolchains/tmp/toolchain/build_mipsel/uClibc-0.9.2
1\" \
        -DUCLIBC_LDSO=\"ld-uClibc.so.0\" -I . \
        ldd.c -o ldd
strip -x -R .note -R .comment ldd
gcc -O2 -Wall -I . readelf.c -o readelf
readelf.c: In function `describe_elf_hdr':
readelf.c:170: `EM_MIPS_RS3_LE' undeclared (first use in this function)
readelf.c:170: (Each undeclared identifier is reported only once
readelf.c:170: for each function it appears in.)
readelf.c:176: `EM_PPC64' undeclared (first use in this function) 
--

These EM_ defines are simply not contained in the /usr/include/.../elf.h.
I'd propose to put some #ifdef ...#endif around the cases in readelf.c,
see attached patch.

/Jörg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: uclibc_readelf_c.patch
Type: application/octet-stream
Size: 5844 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20040206/9077a4e2/attachment.obj 


More information about the uClibc mailing list