You are not logged in.
Hi there,
I've encountered some kernel compilation problems related to libelf today when I was trying to compile some custom kernel.
During the prepare stage of the kernel building process `make prepare` yields a lot of errors like:
/usr/include/libelf.h:46:4: error: unknown type name ‘Elf32_Word’
I've inspected this and think that this is caused by a header file in kernel tree having the same name as one header file in libelf.
In kernel tree `tools/objtool/objtool.c` includes `elf.h`, which is in kernel tree under `tools/objtool`, and `elf.h` includes `gelf.h` in system include path, `gelf.h` includes `libelf.h` in system include path, and `libelf.h` includes `elf.h`, which actually means to be the one that in system include path and this one has all the Elf* definitions in it. But apparently gcc failed to see that this one shall be the one from system, and determined that this is a looping inclusion and ignored the inclusion request, which in result causes these unknown type errors to be generated.
I have to make some dirty hacks to header files to work around this. Could anyone else reproduce this problem and confirm it as a bug or it is a configuration problem of mine?
Offline