[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 0/8] Linux user for 5.2 patches
From: |
Laurent Vivier |
Subject: |
Re: [PULL 0/8] Linux user for 5.2 patches |
Date: |
Tue, 1 Sep 2020 16:40:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
Le 01/09/2020 à 15:54, Filip Bozuta a écrit :
>
> On 1.9.20. 15:06, Peter Maydell wrote:
>> On Mon, 31 Aug 2020 at 12:08, Laurent Vivier <laurent@vivier.eu> wrote:
>>> The following changes since commit
>>> 39335fab59e11cfda9b7cf63929825db2dd3a3e0:
>>>
>>> Merge remote-tracking branch
>>> 'remotes/vivier2/tags/linux-user-for-5.2-pull-=
>>> request' into staging (2020-08-28 22:30:11 +0100)
>>>
>>> are available in the Git repository at:
>>>
>>> git://github.com/vivier/qemu.git tags/linux-user-for-5.2-pull-request
>>>
>>> for you to fetch changes up to d6676fc62a52e020df32abf927c2e7183781a2e3:
>>>
>>> linux-user: Add support for btrfs ioctls used to scrub a
>>> filesystem (2020-0=
>>> 8-29 10:14:52 +0200)
>>>
>>> ----------------------------------------------------------------
>>> Add btrfs support
>> Fails to build with clang, I'm afraid:
>>
>> In file included from ../../linux-user/syscall.c:4561:
>> ../../linux-user/syscall_types.h:485:33: error: implicit conversion
>> from enumeration type 'enum btrfs_dev_stat_values' to different
>> enumeration type 'argtype' (aka 'enum argtype')
>> [-Werror,-Wenum-conversion]
>> MK_ARRAY(TYPE_ULONGLONG, BTRFS_DEV_STAT_VALUES_MAX), /* values */
>> ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> /home/petmay01/linaro/qemu-for-merges/include/exec/user/thunk.h:45:42:
>> note: expanded from macro 'MK_ARRAY'
>> #define MK_ARRAY(type, size) TYPE_ARRAY, size, type
>> ^~~~
>> ../../linux-user/syscall.c:4559:79: note: expanded from macro 'STRUCT'
>> #define STRUCT(name, ...) static const argtype struct_ ## name ##
>> _def[] = { __VA_ARGS__, TYPE_NULL };
>>
>> ~ ^~~~~~~~~~~
>> 1 error generated.
>
> There seems to be a problem because 'BTRFS_DEV_STAT_VALUES_MAX' is not a
> predefined value but an enum value from from 'enum btrfs_dev_stat_values':
>
> https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/btrfs.h#L668
>
>
> The build problem arises probably when 'thunk_convert()' tries to
> convert this enum value to the thunk enum values 'argtype'. I will see
> about finding a work around for this or maybe use a STRUCT_SPECIAL() for
> 'struct btrfs_ioctl_get_dev_stats' to define an explicit converting
> function.
>
> Just curious, on what linux distro are you building on? I didn't come
> accross this build issue on my system.
You can reproduce the problem by using clang rather than gcc (at least
on Fedora 32):
.../configure ... --cc=clang ...
Compiling C object libqemu-aarch64_be-linux-user.fa.p/linux-user_syscall.c.o
In file included from.../qemu/linux-user/syscall.c:4561:
.../qemu/linux-user/syscall_types.h:485:33: error: implicit conversion
from enumeration type 'enum btrfs_dev_stat_values' to different
enumeration type 'argtype' (aka 'enum argtype') [-Werror,-Wenum-conversion]
MK_ARRAY(TYPE_ULONGLONG, BTRFS_DEV_STAT_VALUES_MAX), /* values */
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../qemu/include/exec/user/thunk.h:45:42: note: expanded from macro
'MK_ARRAY'
#define MK_ARRAY(type, size) TYPE_ARRAY, size, type
^~~~
..../qemu/linux-user/syscall.c:4559:79: note: expanded from macro 'STRUCT'
#define STRUCT(name, ...) static const argtype struct_ ## name ## _def[]
= { __VA_ARGS__, TYPE_NULL };
~ ^~~~~~~~~~~
1 error generated.
Thanks,
Laurent