[PATCH v2 15/16] objtool/powerpc: Enable objtool to be built on ppc

Randy Dunlap rdunlap at infradead.org
Sat Feb 4 19:30:16 AEDT 2023



On 2/4/23 00:21, Randy Dunlap wrote:
> 
> 
> On 2/4/23 00:19, Randy Dunlap wrote:
>> Hi--
>>
>> On 8/29/22 23:41, Christophe Leroy wrote:
>>>
>>>
>>> Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit :
>>>> This patch adds [stub] implementations for required
>>>> functions, inorder to enable objtool build on powerpc.
>>>
>>> Not all powerpc it seems, see below
>>>
>>
>> When cross-compiling PPC32 (on x86_64), I get 3600+ of these:
>>
>> /bin/sh: line 1: ./tools/objtool/objtool: No such file or directory
>> /bin/sh: line 1: ./tools/objtool/objtool: No such file or directory
>> /bin/sh: line 1: ./tools/objtool/objtool: No such file or directory
>>
>> Is there some way that objtool should work when cross-compiling?
>>
> 
> Oops. Its build failed. I seem to be missing header file(s)
> and possibly a library.
> I'll check on those...
> 

It's complaining about libelf.h but I have that, so I don't know where
it is looking other than /usr/include/libelf.h, which exists.
Maybe the tool isn't setup (ready) for cross-compiling?


Here's the build output for objtool:

<stdin>:1:10: fatal error: libelf.h: No such file or directory
compilation terminated.
elf.c: In function ‘read_sections’:
elf.c:273:9: error: ‘elf_getshnum’ is deprecated [-Werror=deprecated-declarations]
  273 |         if (elf_getshdrnum(elf->elf, &sections_nr)) {
      |         ^~
In file included from /usr/include/gelf.h:32,
                 from /work/lnx/next/linux-next-20230203/tools/objtool/include/objtool/elf.h:10,
                 from elf.c:22:
/usr/include/libelf.h:310:12: note: declared here
  310 | extern int elf_getshnum (Elf *__elf, size_t *__dst)
      |            ^~~~~~~~~~~~
elf.c:278:9: error: ‘elf_getshstrndx’ is deprecated [-Werror=deprecated-declarations]
  278 |         if (elf_getshdrstrndx(elf->elf, &shstrndx)) {
      |         ^~
/usr/include/libelf.h:322:12: note: declared here
  322 | extern int elf_getshstrndx (Elf *__elf, size_t *__dst)
      |            ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[4]: *** [/work/lnx/next/linux-next-20230203/tools/build/Makefile.build:96: /work/lnx/next/linux-next-20230203/PPC32/tools/objtool/elf.o] Error 1

make[3]: *** [Makefile:66: /work/lnx/next/linux-next-20230203/PPC32/tools/objtool/objtool-in.o] Error 2


Thanks.
-- 
~Randy


More information about the Linuxppc-dev mailing list