diff mbox series

[v3,2/4] meson: Fixes jemalloc and tcmalloc can not building.

Message ID 20200907195025.2308-3-luoyonggang@gmail.com
State New
Headers show
Series Misc meson fixes along test-vmstate fixes | expand

Commit Message

Yonggang Luo Sept. 7, 2020, 7:50 p.m. UTC
Currently, the LIBS are not exposed to meson and meson didn't use that
Use base_lib = declare_dependency(link_args: config_host['LIBS'].split())
to force use it


Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 configure   | 9 +++++++++
 meson.build | 5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

Comments

Paolo Bonzini Sept. 7, 2020, 8 p.m. UTC | #1
Hi, LIBS is going away soon. I have a few more Meson patches including one
for tcmalloc and jemalloc, I won't post them super soon though.

Paolo

Il lun 7 set 2020, 21:50 Yonggang Luo <luoyonggang@gmail.com> ha scritto:

> Currently, the LIBS are not exposed to meson and meson didn't use that
> Use base_lib = declare_dependency(link_args: config_host['LIBS'].split())
> to force use it
>
>
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> ---
>  configure   | 9 +++++++++
>  meson.build | 5 ++++-
>  2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 823756f4a4..7b2f3d64b0 100755
> --- a/configure
> +++ b/configure
> @@ -7245,6 +7245,14 @@ if test "$libxml2" = "yes" ; then
>    echo "LIBXML2_LIBS=$libxml2_libs" >> $config_host_mak
>  fi
>
> +if test "$tcmalloc" = "yes" ; then
> +  echo "CONFIG_TCMALLOC=y" >> $config_host_mak
> +fi
> +
> +if test "$jemalloc" = "yes" ; then
> +  echo "CONFIG_JEMALLOC=y" >> $config_host_mak
> +fi
> +
>  if test "$replication" = "yes" ; then
>    echo "CONFIG_REPLICATION=y" >> $config_host_mak
>  fi
> @@ -7416,6 +7424,7 @@ echo "PKG_CONFIG=$pkg_config_exe" >> $config_host_mak
>  echo "WINDRES=$windres" >> $config_host_mak
>  echo "CFLAGS=$CFLAGS" >> $config_host_mak
>  echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak
> +echo "LIBS=$LIBS" >> $config_host_mak
>  echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
>  echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
>  echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
> diff --git a/meson.build b/meson.build
> index 5421eca66a..6e909213ee 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -116,6 +116,9 @@ endif
>  # grandfathered in from the QEMU Makefiles.
>  add_project_arguments(config_host['GLIB_CFLAGS'].split(),
>                        native: false, language: ['c', 'cpp', 'objc'])
> +
> +base_lib = declare_dependency(link_args: config_host['LIBS'].split())
> +
>  glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split())
>  gio = not_found
>  if 'CONFIG_GIO' in config_host
> @@ -818,7 +821,7 @@ util_ss.add_all(trace_ss)
>  util_ss = util_ss.apply(config_all, strict: false)
>  libqemuutil = static_library('qemuutil',
>                               sources: util_ss.sources() +
> stub_ss.sources() + genh,
> -                             dependencies: [util_ss.dependencies(), m,
> glib, socket])
> +                             dependencies: [util_ss.dependencies(), m,
> base_lib, glib, socket])
>  qemuutil = declare_dependency(link_with: libqemuutil,
>                                sources: genh + version_res)
>
> --
> 2.28.0.windows.1
>
>
Yonggang Luo Sept. 7, 2020, 8:01 p.m. UTC | #2
On Tue, Sep 8, 2020 at 4:00 AM Paolo Bonzini <pbonzini@redhat.com> wrote:

> Hi, LIBS is going away soon. I have a few more Meson patches including one
> for tcmalloc and jemalloc, I won't post them super soon though.
>
OK, then I'll skip this

>
> Paolo
>
> Il lun 7 set 2020, 21:50 Yonggang Luo <luoyonggang@gmail.com> ha scritto:
>
>> Currently, the LIBS are not exposed to meson and meson didn't use that
>> Use base_lib = declare_dependency(link_args: config_host['LIBS'].split())
>> to force use it
>>
>>
>> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
>> ---
>>  configure   | 9 +++++++++
>>  meson.build | 5 ++++-
>>  2 files changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index 823756f4a4..7b2f3d64b0 100755
>> --- a/configure
>> +++ b/configure
>> @@ -7245,6 +7245,14 @@ if test "$libxml2" = "yes" ; then
>>    echo "LIBXML2_LIBS=$libxml2_libs" >> $config_host_mak
>>  fi
>>
>> +if test "$tcmalloc" = "yes" ; then
>> +  echo "CONFIG_TCMALLOC=y" >> $config_host_mak
>> +fi
>> +
>> +if test "$jemalloc" = "yes" ; then
>> +  echo "CONFIG_JEMALLOC=y" >> $config_host_mak
>> +fi
>> +
>>  if test "$replication" = "yes" ; then
>>    echo "CONFIG_REPLICATION=y" >> $config_host_mak
>>  fi
>> @@ -7416,6 +7424,7 @@ echo "PKG_CONFIG=$pkg_config_exe" >>
>> $config_host_mak
>>  echo "WINDRES=$windres" >> $config_host_mak
>>  echo "CFLAGS=$CFLAGS" >> $config_host_mak
>>  echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak
>> +echo "LIBS=$LIBS" >> $config_host_mak
>>  echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
>>  echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
>>  echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
>> diff --git a/meson.build b/meson.build
>> index 5421eca66a..6e909213ee 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -116,6 +116,9 @@ endif
>>  # grandfathered in from the QEMU Makefiles.
>>  add_project_arguments(config_host['GLIB_CFLAGS'].split(),
>>                        native: false, language: ['c', 'cpp', 'objc'])
>> +
>> +base_lib = declare_dependency(link_args: config_host['LIBS'].split())
>> +
>>  glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split())
>>  gio = not_found
>>  if 'CONFIG_GIO' in config_host
>> @@ -818,7 +821,7 @@ util_ss.add_all(trace_ss)
>>  util_ss = util_ss.apply(config_all, strict: false)
>>  libqemuutil = static_library('qemuutil',
>>                               sources: util_ss.sources() +
>> stub_ss.sources() + genh,
>> -                             dependencies: [util_ss.dependencies(), m,
>> glib, socket])
>> +                             dependencies: [util_ss.dependencies(), m,
>> base_lib, glib, socket])
>>  qemuutil = declare_dependency(link_with: libqemuutil,
>>                                sources: genh + version_res)
>>
>> --
>> 2.28.0.windows.1
>>
>>
diff mbox series

Patch

diff --git a/configure b/configure
index 823756f4a4..7b2f3d64b0 100755
--- a/configure
+++ b/configure
@@ -7245,6 +7245,14 @@  if test "$libxml2" = "yes" ; then
   echo "LIBXML2_LIBS=$libxml2_libs" >> $config_host_mak
 fi
 
+if test "$tcmalloc" = "yes" ; then
+  echo "CONFIG_TCMALLOC=y" >> $config_host_mak
+fi
+
+if test "$jemalloc" = "yes" ; then
+  echo "CONFIG_JEMALLOC=y" >> $config_host_mak
+fi
+
 if test "$replication" = "yes" ; then
   echo "CONFIG_REPLICATION=y" >> $config_host_mak
 fi
@@ -7416,6 +7424,7 @@  echo "PKG_CONFIG=$pkg_config_exe" >> $config_host_mak
 echo "WINDRES=$windres" >> $config_host_mak
 echo "CFLAGS=$CFLAGS" >> $config_host_mak
 echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak
+echo "LIBS=$LIBS" >> $config_host_mak
 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
 echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
 echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
diff --git a/meson.build b/meson.build
index 5421eca66a..6e909213ee 100644
--- a/meson.build
+++ b/meson.build
@@ -116,6 +116,9 @@  endif
 # grandfathered in from the QEMU Makefiles.
 add_project_arguments(config_host['GLIB_CFLAGS'].split(),
                       native: false, language: ['c', 'cpp', 'objc'])
+
+base_lib = declare_dependency(link_args: config_host['LIBS'].split())
+
 glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split())
 gio = not_found
 if 'CONFIG_GIO' in config_host
@@ -818,7 +821,7 @@  util_ss.add_all(trace_ss)
 util_ss = util_ss.apply(config_all, strict: false)
 libqemuutil = static_library('qemuutil',
                              sources: util_ss.sources() + stub_ss.sources() + genh,
-                             dependencies: [util_ss.dependencies(), m, glib, socket])
+                             dependencies: [util_ss.dependencies(), m, base_lib, glib, socket])
 qemuutil = declare_dependency(link_with: libqemuutil,
                               sources: genh + version_res)