public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
* [PATCH] contrib/plugins/cpp: Add -fcoroutines
@ 2026-03-04  7:59 Akihiko Odaki
  2026-03-04 18:03 ` Pierrick Bouvier
  0 siblings, 1 reply; 4+ messages in thread
From: Akihiko Odaki @ 2026-03-04  7:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Pierrick Bouvier, Alexandre Iooss,
	Mahmoud Mandour, Akihiko Odaki

GCC 15.2.1 requires it:

[67/6111] Compiling C++ object contrib/plugins/libcpp.so.p/cpp.cpp.o
FAILED: contrib/plugins/libcpp.so.p/cpp.cpp.o
c++ -Icontrib/plugins/libcpp.so.p -Icontrib/plugins -I../contrib/plugins -I../include/plugins -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -fdiagnostics-color=auto -D_GLIBCXX_ASSERTIONS=1 -Wall -Winvalid-pch -Werror -O2 -g -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero -fzero-call-used-regs=used-gpr -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -fsanitize=address -fstack-protector-strong -fsanitize=undefined -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit-fallthrough=2 -Winit-self -Wmissing-format-attribute -Wredundant-decls -Wshadow=local -Wtype-limits -Wundef -Wvla -Wwrite-strings -Wno-missing-include-dirs -Wno-psabi -Wno-shift-negative-value -isystem /home/me/q/var/qemu/linux-headers -isystem linux-headers -iquote . -iquote /home/me/q/var/qemu -iquote /home/me/q/var/qemu/!
 include -iquote /home/me/q/var/qemu/host/include/aarch64 -iquote /home/me/q/var/qemu/host/include/generic -iquote /home/me/q/var/qemu/tcg/aarch64 -pthread -fPIC -MD -MQ contrib/plugins/libcpp.so.p/cpp.cpp.o -MF contrib/plugins/libcpp.so.p/cpp.cpp.o.d -o contrib/plugins/libcpp.so.p/cpp.cpp.o -c ../contrib/plugins/cpp.cpp
In file included from ../contrib/plugins/cpp.cpp:91:
/usr/include/c++/15/coroutine:43:3: error: #error "the <coroutine> header requires -fcoroutines"
   43 | # error "the <coroutine> header requires -fcoroutines"
      |   ^~~~~

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
---
 contrib/plugins/meson.build | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
index 099319e7a173..caa0fca17245 100644
--- a/contrib/plugins/meson.build
+++ b/contrib/plugins/meson.build
@@ -26,8 +26,14 @@ endif
 t = []
 if get_option('plugins')
   foreach i : contrib_plugins
+    if i == 'cpp.cpp' and cxx.has_argument('-fcoroutines')
+      cpp_args = ['-fcoroutines']
+    else
+      cpp_args = []
+    endif
+
     t += shared_module(fs.stem(i), files(i),
-                       dependencies: plugins_deps)
+                       cpp_args: cpp_args, dependencies: plugins_deps)
   endforeach
 endif
 if t.length() > 0

---
base-commit: afe653676dc6dfd49f0390239ff90b2f0052c2b8
change-id: 20260304-cpp-ddc219374e4f

Best regards,
--  
Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] contrib/plugins/cpp: Add -fcoroutines
  2026-03-04  7:59 [PATCH] contrib/plugins/cpp: Add -fcoroutines Akihiko Odaki
@ 2026-03-04 18:03 ` Pierrick Bouvier
  2026-03-05  5:27   ` Akihiko Odaki
  0 siblings, 1 reply; 4+ messages in thread
From: Pierrick Bouvier @ 2026-03-04 18:03 UTC (permalink / raw)
  To: Akihiko Odaki, qemu-devel
  Cc: Alex Bennée, Alexandre Iooss, Mahmoud Mandour

On 3/3/26 11:59 PM, Akihiko Odaki wrote:
> GCC 15.2.1 requires it:
> 
> [67/6111] Compiling C++ object contrib/plugins/libcpp.so.p/cpp.cpp.o
> FAILED: contrib/plugins/libcpp.so.p/cpp.cpp.o
> c++ -Icontrib/plugins/libcpp.so.p -Icontrib/plugins -I../contrib/plugins -I../include/plugins -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -fdiagnostics-color=auto -D_GLIBCXX_ASSERTIONS=1 -Wall -Winvalid-pch -Werror -O2 -g -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero -fzero-call-used-regs=used-gpr -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -fsanitize=address -fstack-protector-strong -fsanitize=undefined -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit-fallthrough=2 -Winit-self -Wmissing-format-attribute -Wredundant-decls -Wshadow=local -Wtype-limits -Wundef -Wvla -Wwrite-strings -Wno-missing-include-dirs -Wno-psabi -Wno-shift-negative-value -isystem /home/me/q/var/qemu/linux-headers -isystem linux-headers -iquote . -iquote /home/me/q/var/qemu -iquote /home/me/q/var/qemu/!
>   include -iquote /home/me/q/var/qemu/host/include/aarch64 -iquote /home/me/q/var/qemu/host/include/generic -iquote /home/me/q/var/qemu/tcg/aarch64 -pthread -fPIC -MD -MQ contrib/plugins/libcpp.so.p/cpp.cpp.o -MF contrib/plugins/libcpp.so.p/cpp.cpp.o.d -o contrib/plugins/libcpp.so.p/cpp.cpp.o -c ../contrib/plugins/cpp.cpp
> In file included from ../contrib/plugins/cpp.cpp:91:
> /usr/include/c++/15/coroutine:43:3: error: #error "the <coroutine> header requires -fcoroutines"
>     43 | # error "the <coroutine> header requires -fcoroutines"
>        |   ^~~~~
> 
> Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> ---
>   contrib/plugins/meson.build | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
> index 099319e7a173..caa0fca17245 100644
> --- a/contrib/plugins/meson.build
> +++ b/contrib/plugins/meson.build
> @@ -26,8 +26,14 @@ endif
>   t = []
>   if get_option('plugins')
>     foreach i : contrib_plugins
> +    if i == 'cpp.cpp' and cxx.has_argument('-fcoroutines')
> +      cpp_args = ['-fcoroutines']
> +    else
> +      cpp_args = []
> +    endif
> +
>       t += shared_module(fs.stem(i), files(i),
> -                       dependencies: plugins_deps)
> +                       cpp_args: cpp_args, dependencies: plugins_deps)
>     endforeach
>   endif
>   if t.length() > 0
> 
> ---
> base-commit: afe653676dc6dfd49f0390239ff90b2f0052c2b8
> change-id: 20260304-cpp-ddc219374e4f
> 
> Best regards,
> --
> Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> 

Hi Akihiko,

it seems like you ran into this issue:
https://lore.kernel.org/qemu-devel/875x8ft5vq.fsf@redhat.com/

You can just clean your build folder and restart from scratch.
See the thread above, it's a limitation of meson (by design) not 
updating language standard.

The best fix on our side would be to add -std=... directly in c/cxx 
flags instead of relying on default options.

Regards,
Pierrick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] contrib/plugins/cpp: Add -fcoroutines
  2026-03-04 18:03 ` Pierrick Bouvier
@ 2026-03-05  5:27   ` Akihiko Odaki
  2026-03-05  8:31     ` Pierrick Bouvier
  0 siblings, 1 reply; 4+ messages in thread
From: Akihiko Odaki @ 2026-03-05  5:27 UTC (permalink / raw)
  To: Pierrick Bouvier, qemu-devel
  Cc: Alex Bennée, Alexandre Iooss, Mahmoud Mandour

On 2026/03/05 3:03, Pierrick Bouvier wrote:
> On 3/3/26 11:59 PM, Akihiko Odaki wrote:
>> GCC 15.2.1 requires it:
>>
>> [67/6111] Compiling C++ object contrib/plugins/libcpp.so.p/cpp.cpp.o
>> FAILED: contrib/plugins/libcpp.so.p/cpp.cpp.o
>> c++ -Icontrib/plugins/libcpp.so.p -Icontrib/plugins -I../contrib/ 
>> plugins -I../include/plugins -I/usr/include/glib-2.0 -I/usr/lib64/ 
>> glib-2.0/include -I/usr/include/sysprof-6 -fdiagnostics-color=auto - 
>> D_GLIBCXX_ASSERTIONS=1 -Wall -Winvalid-pch -Werror -O2 -g - 
>> D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict- 
>> aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero -fzero-call- 
>> used-regs=used-gpr -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS - 
>> D__STDC_FORMAT_MACROS -fsanitize=address -fstack-protector-strong - 
>> fsanitize=undefined -Wempty-body -Wendif-labels -Wexpansion-to-defined 
>> -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit- 
>> fallthrough=2 -Winit-self -Wmissing-format-attribute -Wredundant-decls 
>> -Wshadow=local -Wtype-limits -Wundef -Wvla -Wwrite-strings -Wno- 
>> missing-include-dirs -Wno-psabi -Wno-shift-negative-value -isystem / 
>> home/me/q/var/qemu/linux-headers -isystem linux-headers -iquote . - 
>> iquote /home/me/q/var/qemu -iquote /home/me/q/var/qemu/!
>>   include -iquote /home/me/q/var/qemu/host/include/aarch64 -iquote / 
>> home/me/q/var/qemu/host/include/generic -iquote /home/me/q/var/qemu/ 
>> tcg/aarch64 -pthread -fPIC -MD -MQ contrib/plugins/libcpp.so.p/ 
>> cpp.cpp.o -MF contrib/plugins/libcpp.so.p/cpp.cpp.o.d -o contrib/ 
>> plugins/libcpp.so.p/cpp.cpp.o -c ../contrib/plugins/cpp.cpp
>> In file included from ../contrib/plugins/cpp.cpp:91:
>> /usr/include/c++/15/coroutine:43:3: error: #error "the <coroutine> 
>> header requires -fcoroutines"
>>     43 | # error "the <coroutine> header requires -fcoroutines"
>>        |   ^~~~~
>>
>> Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
>> ---
>>   contrib/plugins/meson.build | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
>> index 099319e7a173..caa0fca17245 100644
>> --- a/contrib/plugins/meson.build
>> +++ b/contrib/plugins/meson.build
>> @@ -26,8 +26,14 @@ endif
>>   t = []
>>   if get_option('plugins')
>>     foreach i : contrib_plugins
>> +    if i == 'cpp.cpp' and cxx.has_argument('-fcoroutines')
>> +      cpp_args = ['-fcoroutines']
>> +    else
>> +      cpp_args = []
>> +    endif
>> +
>>       t += shared_module(fs.stem(i), files(i),
>> -                       dependencies: plugins_deps)
>> +                       cpp_args: cpp_args, dependencies: plugins_deps)
>>     endforeach
>>   endif
>>   if t.length() > 0
>>
>> ---
>> base-commit: afe653676dc6dfd49f0390239ff90b2f0052c2b8
>> change-id: 20260304-cpp-ddc219374e4f
>>
>> Best regards,
>> -- 
>> Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
>>
> 
> Hi Akihiko,
> 
> it seems like you ran into this issue:
> https://lore.kernel.org/qemu-devel/875x8ft5vq.fsf@redhat.com/
> 
> You can just clean your build folder and restart from scratch.
> See the thread above, it's a limitation of meson (by design) not 
> updating language standard.
> 
> The best fix on our side would be to add -std=... directly in c/cxx 
> flags instead of relying on default options.

I withdraw this patch. Passing -fcoroutines is not a right approach when 
the default option configures the project to use a newer C++ standard.

I hope Meson and QEMU figure out a solution that improves the user 
experience.

Thank you for point out the thread.

Regards,
Akihiko Odaki


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] contrib/plugins/cpp: Add -fcoroutines
  2026-03-05  5:27   ` Akihiko Odaki
@ 2026-03-05  8:31     ` Pierrick Bouvier
  0 siblings, 0 replies; 4+ messages in thread
From: Pierrick Bouvier @ 2026-03-05  8:31 UTC (permalink / raw)
  To: Akihiko Odaki, qemu-devel
  Cc: Alex Bennée, Alexandre Iooss, Mahmoud Mandour

On 3/4/26 9:27 PM, Akihiko Odaki wrote:
> On 2026/03/05 3:03, Pierrick Bouvier wrote:
>> On 3/3/26 11:59 PM, Akihiko Odaki wrote:
>>> GCC 15.2.1 requires it:
>>>
>>> [67/6111] Compiling C++ object contrib/plugins/libcpp.so.p/cpp.cpp.o
>>> FAILED: contrib/plugins/libcpp.so.p/cpp.cpp.o
>>> c++ -Icontrib/plugins/libcpp.so.p -Icontrib/plugins -I../contrib/
>>> plugins -I../include/plugins -I/usr/include/glib-2.0 -I/usr/lib64/
>>> glib-2.0/include -I/usr/include/sysprof-6 -fdiagnostics-color=auto -
>>> D_GLIBCXX_ASSERTIONS=1 -Wall -Winvalid-pch -Werror -O2 -g -
>>> D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-
>>> aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero -fzero-call-
>>> used-regs=used-gpr -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -
>>> D__STDC_FORMAT_MACROS -fsanitize=address -fstack-protector-strong -
>>> fsanitize=undefined -Wempty-body -Wendif-labels -Wexpansion-to-defined
>>> -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit-
>>> fallthrough=2 -Winit-self -Wmissing-format-attribute -Wredundant-decls
>>> -Wshadow=local -Wtype-limits -Wundef -Wvla -Wwrite-strings -Wno-
>>> missing-include-dirs -Wno-psabi -Wno-shift-negative-value -isystem /
>>> home/me/q/var/qemu/linux-headers -isystem linux-headers -iquote . -
>>> iquote /home/me/q/var/qemu -iquote /home/me/q/var/qemu/!
>>>    include -iquote /home/me/q/var/qemu/host/include/aarch64 -iquote /
>>> home/me/q/var/qemu/host/include/generic -iquote /home/me/q/var/qemu/
>>> tcg/aarch64 -pthread -fPIC -MD -MQ contrib/plugins/libcpp.so.p/
>>> cpp.cpp.o -MF contrib/plugins/libcpp.so.p/cpp.cpp.o.d -o contrib/
>>> plugins/libcpp.so.p/cpp.cpp.o -c ../contrib/plugins/cpp.cpp
>>> In file included from ../contrib/plugins/cpp.cpp:91:
>>> /usr/include/c++/15/coroutine:43:3: error: #error "the <coroutine>
>>> header requires -fcoroutines"
>>>      43 | # error "the <coroutine> header requires -fcoroutines"
>>>         |   ^~~~~
>>>
>>> Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
>>> ---
>>>    contrib/plugins/meson.build | 8 +++++++-
>>>    1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
>>> index 099319e7a173..caa0fca17245 100644
>>> --- a/contrib/plugins/meson.build
>>> +++ b/contrib/plugins/meson.build
>>> @@ -26,8 +26,14 @@ endif
>>>    t = []
>>>    if get_option('plugins')
>>>      foreach i : contrib_plugins
>>> +    if i == 'cpp.cpp' and cxx.has_argument('-fcoroutines')
>>> +      cpp_args = ['-fcoroutines']
>>> +    else
>>> +      cpp_args = []
>>> +    endif
>>> +
>>>        t += shared_module(fs.stem(i), files(i),
>>> -                       dependencies: plugins_deps)
>>> +                       cpp_args: cpp_args, dependencies: plugins_deps)
>>>      endforeach
>>>    endif
>>>    if t.length() > 0
>>>
>>> ---
>>> base-commit: afe653676dc6dfd49f0390239ff90b2f0052c2b8
>>> change-id: 20260304-cpp-ddc219374e4f
>>>
>>> Best regards,
>>> -- 
>>> Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
>>>
>>
>> Hi Akihiko,
>>
>> it seems like you ran into this issue:
>> https://lore.kernel.org/qemu-devel/875x8ft5vq.fsf@redhat.com/
>>
>> You can just clean your build folder and restart from scratch.
>> See the thread above, it's a limitation of meson (by design) not
>> updating language standard.
>>
>> The best fix on our side would be to add -std=... directly in c/cxx
>> flags instead of relying on default options.
> 
> I withdraw this patch. Passing -fcoroutines is not a right approach when
> the default option configures the project to use a newer C++ standard.
> 
> I hope Meson and QEMU figure out a solution that improves the user
> experience.
> 
> Thank you for point out the thread.
>

Sorry for the bad experience on your side, and I hope too meson will end 
up fixing this, even though the open issues are not very encouraging.

> Regards,
> Akihiko Odaki


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-05  8:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-04  7:59 [PATCH] contrib/plugins/cpp: Add -fcoroutines Akihiko Odaki
2026-03-04 18:03 ` Pierrick Bouvier
2026-03-05  5:27   ` Akihiko Odaki
2026-03-05  8:31     ` Pierrick Bouvier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox