Não é possível construir libdwarf

1

Eu baixei a versão mais atualizada do libdwarf no arquivo. Extraia os arquivos e execute o seguinte comando

cd dwarf-2013-02-07/libdwarf

./configure --enable-shared

make

Eu recebi o seguinte erro de compilação. Eu não sei porque. Eu tentei muitas outras versões e recebi o mesmo erro.

cd libdwarf && make
make[1]: Entering directory '/home/lihao/Downloads/dwarf-20151114/libdwarf'
echo "do nothing " none
do nothing  none
gcc  -g -O2 -I. -I.      -c -o dwarf_elf_access.o dwarf_elf_access.c
dwarf_elf_access.c: In function ‘dwarf_elf_object_access_internals_init’:
dwarf_elf_access.c:238:21: warning: assignment makes pointer from integer without a cast [enabled by default]
     if ((ehdr_ident = elf_getident(elf, NULL)) == NULL) {
                     ^
dwarf_elf_access.c:267:21: warning: assignment makes pointer from integer without a cast [enabled by default]
         obj->ehdr32 = elf32_getehdr(elf);
                     ^
dwarf_elf_access.c: In function ‘dwarf_elf_object_access_get_section_info’:
dwarf_elf_access.c:349:5: error: unknown type name ‘Elf_Scn’
     Elf_Scn *scn = 0;
     ^
dwarf_elf_access.c:352:9: warning: assignment makes pointer from integer without a cast [enabled by default]
     scn = elf_getscn(obj->elf, section_index);
         ^
dwarf_elf_access.c:385:17: warning: assignment makes pointer from integer without a cast [enabled by default]
     if ((shdr32 = elf32_getshdr(scn)) == NULL) {
                 ^
dwarf_elf_access.c:398:19: warning: assignment makes pointer from integer without a cast [enabled by default]
     ret_scn->name = elf_strptr(obj->elf, obj->ehdr32->e_shstrndx,
                   ^
dwarf_elf_access.c: In function ‘dwarf_elf_object_access_load_section’:
dwarf_elf_access.c:1215:9: error: unknown type name ‘Elf_Scn’
         Elf_Scn *scn = 0;
         ^
dwarf_elf_access.c:1216:9: error: unknown type name ‘Elf_Data’
         Elf_Data *data = 0;
         ^
dwarf_elf_access.c:1218:13: warning: assignment makes pointer from integer without a cast [enabled by default]
         scn = elf_getscn(obj->elf, section_index);
             ^
dwarf_elf_access.c:1230:14: warning: assignment makes pointer from integer without a cast [enabled by default]
         data = elf_getdata(scn, NULL);
              ^
dwarf_elf_access.c:1235:29: error: request for member ‘d_buf’ in something not a structure or union
         *section_data = data->d_buf;
                             ^
make[1]: *** [dwarf_elf_access.o] Error 1
make[1]: Leaving directory '/home/lihao/Downloads/dwarf-20151114/libdwarf'
make: *** [basic] Error 2
    
por Hao Li 29.03.2016 / 20:26

1 resposta

2

Você está perdendo uma dependência, tente adicionar o seguinte:

sudo apt-get install libelf-dev

E então tudo ficará bem. Eu testei isso em Trusty Tahr ...

    
por andrew.46 30.03.2016 / 08:50