qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] hw/core/loader-fit.c:105:41: error: expected expression


From: Programmingkid
Subject: Re: [Qemu-devel] hw/core/loader-fit.c:105:41: error: expected expression
Date: Wed, 26 Jul 2017 12:46:13 -0400

> On Jul 26, 2017, at 6:24 AM, Peter Maydell <address@hidden> wrote:
> 
> On 26 July 2017 at 06:15, Programmingkid <address@hidden> wrote:
>> 
>>> On Jul 26, 2017, at 12:13 AM, Philippe Mathieu-Daudé <address@hidden> wrote:
>>> 
>>> Hi John,
>>> 
>>> On 07/25/2017 07:55 PM, Programmingkid wrote:
>>>> While compiling the mips64el-softmmu target I encountered these errors:
>>>>  CC      hw/display/g364fb.o
>>>> hw/core/loader-fit.c:105:41: error: expected expression
>>>>        *addr = fdt32_to_cpu(*(fdt32_t *)prop);
>>>>                                        ^
>>>> hw/core/loader-fit.c:105:32: error: use of undeclared identifier 'fdt32_t'
>>> 
>>> It seems you are missing the libfdt headers, so indeed you found bug.
> 
> Configure requires libfdt to exist to enable mips64el-softmmu,
> so something is going wrong with our configure test compared
> to how QEMU itself is being built.
> 
>> That appears to help make things move past the loader-fit.c file. Here are 
>> the new errors:
>> 
>>  CC      hw/core/loader-fit.o
>>  CC      hw/dma/rc4030.o
>>  CC      hw/ide/via.o
>> hw/core/loader-fit.c:105:41: error: expected expression
>>        *addr = fdt32_to_cpu(*(fdt32_t *)prop);
>>                                        ^
> 
> ...this is still failing on loader-fit.c in the same way.
> 
>>> And also the ./configure output, I'm interested by:
>>> 
>>> "fdt support       no”
>> 
>> Actually it was "fdt support       yes”.
> 
> Configure thinks the fdt headers are available…

They appear to be available. The dtc/libfdt folder does have the files QEMU 
uses. 

> 
>> ./configure --target-list=mips64el-softmmu
>> Install prefix    /usr/local
>> BIOS directory    /usr/local/share/qemu
>> binary directory  /usr/local/bin
>> library directory /usr/local/lib
>> module directory  /usr/local/lib/qemu
>> libexec directory /usr/local/libexec
>> include directory /usr/local/include
>> config directory  /usr/local/etc
>> local state directory   /usr/local/var
>> Manual directory  /usr/local/share/man
>> ELF interp prefix /usr/gnemul/qemu-%M
>> Source path       /Users/john/Documents/Development/Projects/Qemu/qemu-git
>> C compiler        cc
>> Host C compiler   cc
>> C++ compiler      c++
>> Objective-C compiler clang
>> ARFLAGS           rv
>> CFLAGS            -O2 -g
>> QEMU_CFLAGS       -I/usr/local/Cellar/pixman/0.34.0/include/pixman-1 
>> -I$(SRC_PATH)/dtc/libfdt -D_REENTRANT -I/usr/local/Cellar/glib/2.46.2/include
> 
> ...and it's put our local copy of libfdt on the include path.
> 
> The fdt32_t type that the compiler is complaining
> about ought to be defined in the header in
> dtc/libfdt/libfdt_env.h.

The fdt32_t type is not there. Here is the full libfdt_env.h file:

#ifndef _LIBFDT_ENV_H
#define _LIBFDT_ENV_H

#include <stddef.h>
#include <stdint.h>
#include <string.h>

#define _B(n)   ((unsigned long long)((uint8_t *)&x)[n])
static inline uint32_t fdt32_to_cpu(uint32_t x)
{
        return (_B(0) << 24) | (_B(1) << 16) | (_B(2) << 8) | _B(3);
}
#define cpu_to_fdt32(x) fdt32_to_cpu(x)

static inline uint64_t fdt64_to_cpu(uint64_t x)
{
        return (_B(0) << 56) | (_B(1) << 48) | (_B(2) << 40) | (_B(3) << 32)
                | (_B(4) << 24) | (_B(5) << 16) | (_B(6) << 8) | _B(7);
}
#define cpu_to_fdt64(x) fdt64_to_cpu(x)
#undef _B

#endif /* _LIBFDT_ENV_H */


> I wonder if you have an old copy of that submodule;
> if so then "git submodule update" ought to fix it.

I’m not sure how to obtain the version of libfdt. I did see a file called 
version.lds.
At the top of this file is this text: "LIBFDT_1.2 {"
So maybe I am using version 1.2. Perhaps the configure test should declare a 
variable
of the fdt32_t type in the test code.

After doing a git submodule update qemu-system-mips64el compiled successfully. 
Thank you.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]