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
>
>
<div dir="auto">Hi, LIBS is going away soon. I have a few more Meson patches including one for tcmalloc and jemalloc, I won&#39;t post them super soon though.<div dir="auto"><br></div><div dir="auto">Paolo</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il lun 7 set 2020, 21:50 Yonggang Luo &lt;<a href="mailto:luoyonggang@gmail.com">luoyonggang@gmail.com</a>&gt; ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Currently, the LIBS are not exposed to meson and meson didn&#39;t use that<br>
Use base_lib = declare_dependency(link_args: config_host[&#39;LIBS&#39;].split())<br>
to force use it<br>
<br>
<br>
Signed-off-by: Yonggang Luo &lt;<a href="mailto:luoyonggang@gmail.com" target="_blank" rel="noreferrer">luoyonggang@gmail.com</a>&gt;<br>
---<br>
 configure   | 9 +++++++++<br>
 meson.build | 5 ++++-<br>
 2 files changed, 13 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/configure b/configure<br>
index 823756f4a4..7b2f3d64b0 100755<br>
--- a/configure<br>
+++ b/configure<br>
@@ -7245,6 +7245,14 @@ if test &quot;$libxml2&quot; = &quot;yes&quot; ; then<br>
   echo &quot;LIBXML2_LIBS=$libxml2_libs&quot; &gt;&gt; $config_host_mak<br>
 fi<br>
<br>
+if test &quot;$tcmalloc&quot; = &quot;yes&quot; ; then<br>
+  echo &quot;CONFIG_TCMALLOC=y&quot; &gt;&gt; $config_host_mak<br>
+fi<br>
+<br>
+if test &quot;$jemalloc&quot; = &quot;yes&quot; ; then<br>
+  echo &quot;CONFIG_JEMALLOC=y&quot; &gt;&gt; $config_host_mak<br>
+fi<br>
+<br>
 if test &quot;$replication&quot; = &quot;yes&quot; ; then<br>
   echo &quot;CONFIG_REPLICATION=y&quot; &gt;&gt; $config_host_mak<br>
 fi<br>
@@ -7416,6 +7424,7 @@ echo &quot;PKG_CONFIG=$pkg_config_exe&quot; &gt;&gt; $config_host_mak<br>
 echo &quot;WINDRES=$windres&quot; &gt;&gt; $config_host_mak<br>
 echo &quot;CFLAGS=$CFLAGS&quot; &gt;&gt; $config_host_mak<br>
 echo &quot;CFLAGS_NOPIE=$CFLAGS_NOPIE&quot; &gt;&gt; $config_host_mak<br>
+echo &quot;LIBS=$LIBS&quot; &gt;&gt; $config_host_mak<br>
 echo &quot;QEMU_CFLAGS=$QEMU_CFLAGS&quot; &gt;&gt; $config_host_mak<br>
 echo &quot;QEMU_CXXFLAGS=$QEMU_CXXFLAGS&quot; &gt;&gt; $config_host_mak<br>
 echo &quot;QEMU_INCLUDES=$QEMU_INCLUDES&quot; &gt;&gt; $config_host_mak<br>
diff --git a/meson.build b/meson.build<br>
index 5421eca66a..6e909213ee 100644<br>
--- a/meson.build<br>
+++ b/meson.build<br>
@@ -116,6 +116,9 @@ endif<br>
 # grandfathered in from the QEMU Makefiles.<br>
 add_project_arguments(config_host[&#39;GLIB_CFLAGS&#39;].split(),<br>
                       native: false, language: [&#39;c&#39;, &#39;cpp&#39;, &#39;objc&#39;])<br>
+<br>
+base_lib = declare_dependency(link_args: config_host[&#39;LIBS&#39;].split())<br>
+<br>
 glib = declare_dependency(link_args: config_host[&#39;GLIB_LIBS&#39;].split())<br>
 gio = not_found<br>
 if &#39;CONFIG_GIO&#39; in config_host<br>
@@ -818,7 +821,7 @@ util_ss.add_all(trace_ss)<br>
 util_ss = util_ss.apply(config_all, strict: false)<br>
 libqemuutil = static_library(&#39;qemuutil&#39;,<br>
                              sources: util_ss.sources() + stub_ss.sources() + genh,<br>
-                             dependencies: [util_ss.dependencies(), m, glib, socket])<br>
+                             dependencies: [util_ss.dependencies(), m, base_lib, glib, socket])<br>
 qemuutil = declare_dependency(link_with: libqemuutil,<br>
                               sources: genh + version_res)<br>
<br>
-- <br>
2.28.0.windows.1<br>
<br>
</blockquote></div>
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)