LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   XEN problem with libelf-tools.c during compilation (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/xen-problem-with-libelf-tools-c-during-compilation-4175446765/)

zoox 01-22-2013 11:42 AM

XEN problem with libelf-tools.c during compilation
 
Hi,
I am trying install XEN 4.2.1 on Slackware 14, I am getting an error message during compilation. I have already installed libelf.

Code:

In function 'elf_access_unsigned':
../../xen/common/libelf/libelf-tools.c:45:28: error: '__w.__l[1]' may be used uninitialized in this function [-Werror=uninitialized]
../../xen/common/libelf/libelf-tools.c: In function 'elf_access_signed':
../../xen/common/libelf/libelf-tools.c:73:28: error: '__w.__l[1]' may be used uninitialized in this function [-Werror=uninitialized]
cc1: all warnings being treated as errors
make[5]: *** [libelf-tools.o] Error 1
make[5]: Leaving directory `/home/download/App/xen-4.2.1/tools/libxc'
make[4]: *** [build] Error 2
make[4]: Leaving directory `/home/download/App/xen-4.2.1/tools/libxc'
make[3]: *** [subdir-install-libxc] Error 2
make[3]: Leaving directory `/home/download/App/xen-4.2.1/tools'
make[2]: *** [subdirs-install] Error 2
make[2]: Leaving directory `/home/download/App/xen-4.2.1/tools'
make[1]: *** [install-tools] Error 2
make[1]: Leaving directory `/home/download/App/xen-4.2.1'
make: *** [world] Error 2

part of libelf-tools.c (line 45 and 73 are underlined)
Code:

uint64_t elf_access_unsigned(struct elf_binary * elf, const void *ptr,
                            uint64_t offset, size_t size)
{
    int need_swap = elf_swap(elf);
    const uint8_t *u8;
    const uint16_t *u16;
    const uint32_t *u32;
    const uint64_t *u64;

    switch ( size )
    {
    case 1:
        u8 = ptr + offset;
        return *u8;
    case 2:
        u16 = ptr + offset;
        return need_swap ? bswap_16(*u16) : *u16;
    case 4:
        u32 = ptr + offset;
        return need_swap ? bswap_32(*u32) : *u32;
    case 8:
        u64 = ptr + offset;
        return need_swap ? bswap_64(*u64) : *u64; 
    default:
        return 0;
    }
}

int64_t elf_access_signed(struct elf_binary *elf, const void *ptr,
                          uint64_t offset, size_t size)
{
    int need_swap = elf_swap(elf);
    const int8_t *s8;
    const int16_t *s16;
    const int32_t *s32;
    const int64_t *s64;

    switch ( size )
    {
    case 1:
        s8 = ptr + offset;
        return *s8;
    case 2:
        s16 = ptr + offset;
        return need_swap ? bswap_16(*s16) : *s16;
    case 4:
        s32 = ptr + offset;
        return need_swap ? bswap_32(*s32) : *s32;
    case 8:
        s64 = ptr + offset;
        return need_swap ? bswap_64(*s64) : *s64; 
    default:
        return 0;
    }

Does someone know how to solve this problem?
Thank you


All times are GMT -5. The time now is 06:24 PM.