From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel@nongnu.org,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Alexandre Iooss" <erdnaxe@crans.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Mahmoud Mandour" <ma.mandourr@gmail.com>,
"Brad Smith" <brad@comstyle.com>
Subject: Re: [PATCH v2 1/2] meson: build contrib/plugins with meson
Date: Mon, 21 Oct 2024 08:53:20 -0700 [thread overview]
Message-ID: <439aa9b5-7ca8-4ebf-be5a-a104de2f0f77@linaro.org> (raw)
In-Reply-To: <87y12hokwp.fsf@draig.linaro.org>
On 10/21/24 02:38, Alex Bennée wrote:
> Pierrick Bouvier <pierrick.bouvier@linaro.org> writes:
>
>> Tried to unify this meson.build with tests/tcg/plugins/meson.build but
>> the resulting modules are not output in the right directory.
>>
>> Originally proposed by Anton Kochkov, thank you!
>>
>> Solves: https://gitlab.com/qemu-project/qemu/-/issues/1710
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> ---
>> meson.build | 4 ++++
>> contrib/plugins/meson.build | 23 +++++++++++++++++++++++
>> 2 files changed, 27 insertions(+)
>> create mode 100644 contrib/plugins/meson.build
>>
>> diff --git a/meson.build b/meson.build
>> index ceee6b22c8d..b18c2a54ab5 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -3655,6 +3655,10 @@ subdir('accel')
>> subdir('plugins')
>> subdir('ebpf')
>>
>> +if 'CONFIG_TCG' in config_all_accel
>> + subdir('contrib/plugins')
>> +endif
>> +
>> common_user_inc = []
>>
>> subdir('common-user')
>> diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
>> new file mode 100644
>> index 00000000000..a0e026d25e2
>> --- /dev/null
>> +++ b/contrib/plugins/meson.build
>> @@ -0,0 +1,23 @@
>> +t = []
>> +if get_option('plugins')
>> + foreach i : ['cache', 'drcov', 'execlog', 'hotblocks', 'hotpages', 'howvec',
>> + 'hwprofile', 'ips', 'lockstep', 'stoptrigger']
>> + if host_os == 'windows'
>> + t += shared_module(i, files(i + '.c') + 'win32_linker.c',
>> + include_directories: '../../include/qemu',
>> + link_depends: [win32_qemu_plugin_api_lib],
>> + link_args: ['-Lplugins', '-lqemu_plugin_api'],
>> + dependencies: glib)
>> +
>> + else
>> + t += shared_module(i, files(i + '.c'),
>> + include_directories: '../../include/qemu',
>> + dependencies: glib)
>
> I was trying to work out where the include dirs come from to make sure
> Brad's fix (see Zu4063fjfHC5hHUl@humpty.home.comstyle.com) also applies.
In the meson.build, I don't think we need such a fix, as it does the
right thing out of the box.
Ideally, we should remove the Makefile to avoid having to maintain it
when we'll introduce other deps/plugins in the future.
Users who want to compile out of tree can still get the compilation
command from ninja, and adapt it to their needs.
> It does but:
>
> ➜ make contrib/plugins/libexeclog.so V=1
> /usr/bin/ninja -v -j1 -d keepdepfile contrib/plugins/libexeclog.so | cat
> [1/2] cc -m64 -Icontrib/plugins/libexeclog.so.p -Icontrib/plugins -I../../contrib/plugins -I../../include/qemu -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fdiagnostics-color=auto -Wall -Winvalid-pch -Werror -std=gnu11 -O2 -g -fstack-protector-strong -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit-fallthrough=2 -Winit-self -Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -Wshadow=local -Wstrict-prototypes -Wtype-limits -Wundef -Wvla -Wwrite-strings -Wno-missing-include-dirs -Wno-psabi -Wno-shift-negative-value -isystem /home/alex/lsrc/qemu.git/linux-headers -isystem linux-headers -iquote . -iquote /home/alex/lsrc/qemu.git -iquote /home/alex/lsrc/qemu.git/include -iquote /home/alex/lsrc/qemu.git/host/include/x86_64 -iquote /home/alex/lsrc/qemu.git/host/include/generic -iquote /home/alex/lsrc/qemu.git/tcg/i386 -pthread -mcx16 -mpopcnt -mneeded -mmovbe -mabm -mbmi -mbmi2 -mfma -mf16c -mavx2 -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 -fPIC -MD -MQ contrib/plugins/libexeclog.so.p/execlog.c.o -MF contrib/plugins/libexeclog.so.p/execlog.c.o.d -o contrib/plugins/libexeclog.so.p/execlog.c.o -c ../../contrib/plugins/execlog.c
> [2/2] cc -m64 -o contrib/plugins/libexeclog.so contrib/plugins/libexeclog.so.p/execlog.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -fstack-protector-strong -Wl,-z,relro -Wl,-z,now -Wl,--start-group /usr/lib/x86_64-linux-gnu/libglib-2.0.so /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so -Wl,--end-group -pthread
>
> I'm not sure why we see "-Icontrib/plugins -I../../contrib/plugins".
> It's probably a harmless redundancy but I'm curious as to where the path
> comes from, any idea?
>
>> + endif
>> + endforeach
>> +endif
>> +if t.length() > 0
>> + alias_target('contrib-plugins', t)
>> +else
>> + run_target('contrib-plugins', command: find_program('true'))
>> +endif
>
next prev parent reply other threads:[~2024-10-21 15:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 20:48 [PATCH v2 0/2] build contrib/plugins using meson Pierrick Bouvier
2024-09-25 20:48 ` [PATCH v2 1/2] meson: build contrib/plugins with meson Pierrick Bouvier
2024-10-21 9:38 ` Alex Bennée
2024-10-21 15:45 ` Pierrick Bouvier
2024-10-21 15:53 ` Pierrick Bouvier [this message]
2024-09-25 20:48 ` [PATCH v2 2/2] contrib/plugins: remove Makefile for contrib/plugins Pierrick Bouvier
2024-10-09 22:13 ` [PATCH v2 0/2] build contrib/plugins using meson Pierrick Bouvier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=439aa9b5-7ca8-4ebf-be5a-a104de2f0f77@linaro.org \
--to=pierrick.bouvier@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=brad@comstyle.com \
--cc=erdnaxe@crans.org \
--cc=ma.mandourr@gmail.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).