All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Update libslirp & make it a subproject
@ 2021-01-14 12:56 marcandre.lureau
  2021-01-14 12:56 ` [PATCH 1/5] build-sys: remove unused LIBS marcandre.lureau
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: marcandre.lureau @ 2021-01-14 12:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, j, Marc-André Lureau, samuel.thibault

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

Here is a few patches to update libslirp to git upstream.
Since it now supports meson subproject(), adapt the build
system to use it, and related fixes.

Marc-André Lureau (5):
  build-sys: remove unused LIBS
  build-sys: set global arguments for cflags/ldflags
  build-sys: add libvhost-user missing dependencies
  slirp: update to git master
  build-sys: make libslirp a meson subproject

 configure                             | 34 +-----------
 meson.build                           | 78 +++++----------------------
 .gitmodules                           |  6 +--
 slirp                                 |  1 -
 subprojects/libslirp                  |  1 +
 subprojects/libvhost-user/meson.build |  3 ++
 6 files changed, 20 insertions(+), 103 deletions(-)
 delete mode 160000 slirp
 create mode 160000 subprojects/libslirp

-- 
2.29.0




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

* [PATCH 1/5] build-sys: remove unused LIBS
  2021-01-14 12:56 [PATCH 0/5] Update libslirp & make it a subproject marcandre.lureau
@ 2021-01-14 12:56 ` marcandre.lureau
  2021-01-14 12:56 ` [PATCH 2/5] build-sys: set global arguments for cflags/ldflags marcandre.lureau
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: marcandre.lureau @ 2021-01-14 12:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, j, Marc-André Lureau, samuel.thibault

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Since meson switch and commit feabc71dfa58 ("configure: do not include
dependency flags in QEMU_CFLAGS and LIBS"), LIBS is unused.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/configure b/configure
index 155dda124c..64c09f7d58 100755
--- a/configure
+++ b/configure
@@ -3390,16 +3390,6 @@ else
   for pthread_lib in $PTHREADLIBS_LIST; do
     if compile_prog "" "$pthread_lib" ; then
       pthread=yes
-      found=no
-      for lib_entry in $LIBS; do
-        if test "$lib_entry" = "$pthread_lib"; then
-          found=yes
-          break
-        fi
-      done
-      if test "$found" = "no"; then
-        LIBS="$pthread_lib $LIBS"
-      fi
       break
     fi
   done
@@ -4087,28 +4077,6 @@ if compile_prog "" "" ; then
   bswap_h=yes
 fi
 
-##########################################
-# Do we need librt
-# uClibc provides 2 versions of clock_gettime(), one with realtime
-# support and one without. This means that the clock_gettime() don't
-# need -lrt. We still need it for timer_create() so we check for this
-# function in addition.
-cat > $TMPC <<EOF
-#include <signal.h>
-#include <time.h>
-int main(void) {
-  timer_create(CLOCK_REALTIME, NULL, NULL);
-  return clock_gettime(CLOCK_REALTIME, NULL);
-}
-EOF
-
-if compile_prog "" "" ; then
-  :
-# we need pthread for static linking. use previous pthread test result
-elif compile_prog "" "$pthread_lib -lrt" ; then
-  LIBS="$LIBS -lrt"
-fi
-
 # Check whether we have openpty() in either libc or libutil
 cat > $TMPC << EOF
 extern int openpty(int *am, int *as, char *name, void *termp, void *winp);
-- 
2.29.0



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

* [PATCH 2/5] build-sys: set global arguments for cflags/ldflags
  2021-01-14 12:56 [PATCH 0/5] Update libslirp & make it a subproject marcandre.lureau
  2021-01-14 12:56 ` [PATCH 1/5] build-sys: remove unused LIBS marcandre.lureau
@ 2021-01-14 12:56 ` marcandre.lureau
  2021-01-14 12:56 ` [PATCH 3/5] build-sys: add libvhost-user missing dependencies marcandre.lureau
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: marcandre.lureau @ 2021-01-14 12:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, j, Marc-André Lureau, samuel.thibault

From: Marc-André Lureau <marcandre.lureau@redhat.com>

As we want subprojects to share those arguments

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 meson.build | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/meson.build b/meson.build
index 3d889857a0..a4adf06997 100644
--- a/meson.build
+++ b/meson.build
@@ -100,12 +100,12 @@ if 'CONFIG_FUZZ' in config_host
                               native: false, language: ['c', 'cpp', 'objc'])
 endif
 
-add_project_arguments(config_host['QEMU_CFLAGS'].split(),
-                      native: false, language: ['c', 'objc'])
-add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
-                      native: false, language: 'cpp')
-add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
-                           native: false, language: ['c', 'cpp', 'objc'])
+add_global_arguments(config_host['QEMU_CFLAGS'].split(),
+                     native: false, language: ['c', 'objc'])
+add_global_arguments(config_host['QEMU_CXXFLAGS'].split(),
+                     native: false, language: 'cpp')
+add_global_link_arguments(config_host['QEMU_LDFLAGS'].split(),
+                          native: false, language: ['c', 'cpp', 'objc'])
 
 if targetos == 'linux'
   add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers',
@@ -1019,8 +1019,8 @@ if get_option('cfi')
       error('-fno-sanitize-trap=cfi-icall is not supported by the compiler')
     endif
   endif
-  add_project_arguments(cfi_flags, native: false, language: ['c', 'cpp', 'objc'])
-  add_project_link_arguments(cfi_flags, native: false, language: ['c', 'cpp', 'objc'])
+  add_global_arguments(cfi_flags, native: false, language: ['c', 'cpp', 'objc'])
+  add_global_link_arguments(cfi_flags, native: false, language: ['c', 'cpp', 'objc'])
 endif
 
 #################
-- 
2.29.0



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

* [PATCH 3/5] build-sys: add libvhost-user missing dependencies
  2021-01-14 12:56 [PATCH 0/5] Update libslirp & make it a subproject marcandre.lureau
  2021-01-14 12:56 ` [PATCH 1/5] build-sys: remove unused LIBS marcandre.lureau
  2021-01-14 12:56 ` [PATCH 2/5] build-sys: set global arguments for cflags/ldflags marcandre.lureau
@ 2021-01-14 12:56 ` marcandre.lureau
  2021-01-14 13:17   ` Philippe Mathieu-Daudé
  2021-01-14 12:56 ` [PATCH 4/5] slirp: update to git master marcandre.lureau
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: marcandre.lureau @ 2021-01-14 12:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, j, Marc-André Lureau, samuel.thibault

From: Marc-André Lureau <marcandre.lureau@redhat.com>

This help fixing static compilation issues.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 subprojects/libvhost-user/meson.build | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/subprojects/libvhost-user/meson.build b/subprojects/libvhost-user/meson.build
index c5d85c11d7..b03446e7cd 100644
--- a/subprojects/libvhost-user/meson.build
+++ b/subprojects/libvhost-user/meson.build
@@ -2,12 +2,14 @@ project('libvhost-user', 'c',
         license: 'GPL-2.0-or-later',
         default_options: ['c_std=gnu99'])
 
+threads = dependency('threads')
 glib = dependency('glib-2.0')
 inc = include_directories('../../include', '../../linux-headers')
 
 vhost_user = static_library('vhost-user',
                             files('libvhost-user.c'),
                             include_directories: inc,
+                            dependencies: threads,
                             c_args: '-D_GNU_SOURCE')
 
 executable('link-test', files('link-test.c'),
@@ -21,4 +23,5 @@ vhost_user_glib = static_library('vhost-user-glib',
                                  dependencies: glib)
 
 vhost_user_dep = declare_dependency(link_with: vhost_user_glib,
+                                    dependencies: glib,
                                     include_directories: include_directories('.'))
-- 
2.29.0



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

* [PATCH 4/5] slirp: update to git master
  2021-01-14 12:56 [PATCH 0/5] Update libslirp & make it a subproject marcandre.lureau
                   ` (2 preceding siblings ...)
  2021-01-14 12:56 ` [PATCH 3/5] build-sys: add libvhost-user missing dependencies marcandre.lureau
@ 2021-01-14 12:56 ` marcandre.lureau
  2021-01-14 12:56 ` [PATCH 5/5] build-sys: make libslirp a meson subproject marcandre.lureau
  2021-01-14 13:33 ` [PATCH 0/5] Update libslirp & make it a subproject Paolo Bonzini
  5 siblings, 0 replies; 8+ messages in thread
From: marcandre.lureau @ 2021-01-14 12:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, j, Marc-André Lureau, samuel.thibault

From: Marc-André Lureau <marcandre.lureau@redhat.com>

git cherry-diff:

Commits on bacb71f1c3ed5f40e393afd8be81bedfba13a401 branch that is not on 8f43a99191afb47ca3f3c6972f6306209f367ece branch
+ 1021b0dc38d39f1dc95a296fe3e05a24a087cdc6 disable_dns option
+ 0f94ceec752592e4ac632a24e3c64a97dd09bf4c limit vnameserver_addr to port 53
+ b57bafa852ef16b133907a13678ec69e9531f177 libslirp.h: fix SlirpConfig v3 documentation
+ 1abf18b2b5edb462797629ed47ad4515a195686e Update CHANGELOG
+ ff4ecf9b6c6542b24b4ac6ea178be9d44e159f79 Release v4.3.0
+ 21f1d933050a40d62612c6274c32de60b811d9ea changelog: post-release
+ 376187c4b14c795763d472214812826eebe7e9c2 Release v4.3.1
+ 73336e08902a7e826f7d960453df037380266186 changelog: post-release
+ 5c1c9d43be61571608e9b14615045b67b830daf5 udp, udp6, icmp: handle TTL value
+ 73ed49ab71998d4288e71e954ef6214b70f23d79 icmp, icmp6: Add icmp_forward_error and icmp6_forward_error
+ 7a4840a57ec7dbc37cca1ab96f058a9610b26950 udp, udp6, icmp, icmp6: Enable forwarding errors on Linux
+ e9b2bc19ae652a2907f247e621b2e4773bdd2aab TCPIPHDR_DELTA: Fix potential negative value
+ 39f9a363eec082f04513413046321abd04163148 .gitlab-ci: add a Coverity stage
+ 1b0093b973cfa0dc041522e5d4e6f576b2df642e sosendoob: better document what urgc is used for
+ 5b9ad89ebbb8afa50162c9156fabd5fc56291088 Add G_GNUC_PRINTF to local function slirp_vsnprintf
+ 8a808aa493980e212b4d5f5465330905c8294e59 meson: remove meson-dist script
+ 0b669b5fbe4d3c25a682a67f1059d8633c963b3d meson: support compiling as subproject
+ 9f82a47b81f2864422b82c1e40e51a2ed9c6ac32 Add DNS resolving for iOS
+ c0eac03e8ce1b9a743231f2fe21e7cb579fc9339 Remove the QEMU-special make build-system
+ 1bfd4d9368f9fa2e4f0731e1266bec05bbc83a80 socket: consume empty packets
+ 92413be68914f8cae2f5bad4bf3ab8491dcbc5d7 Release v4.4.0
+ 07e8cfac69766081871ab620d9f16a630543d302 changelog: post-release
+ 4c4e035813313d02b63fdeb920d56fb2fdc0a5b1 Remove some needless (void)casts

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 slirp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/slirp b/slirp
index 8f43a99191..bacb71f1c3 160000
--- a/slirp
+++ b/slirp
@@ -1 +1 @@
-Subproject commit 8f43a99191afb47ca3f3c6972f6306209f367ece
+Subproject commit bacb71f1c3ed5f40e393afd8be81bedfba13a401
-- 
2.29.0



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

* [PATCH 5/5] build-sys: make libslirp a meson subproject
  2021-01-14 12:56 [PATCH 0/5] Update libslirp & make it a subproject marcandre.lureau
                   ` (3 preceding siblings ...)
  2021-01-14 12:56 ` [PATCH 4/5] slirp: update to git master marcandre.lureau
@ 2021-01-14 12:56 ` marcandre.lureau
  2021-01-14 13:33 ` [PATCH 0/5] Update libslirp & make it a subproject Paolo Bonzini
  5 siblings, 0 replies; 8+ messages in thread
From: marcandre.lureau @ 2021-01-14 12:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, j, Marc-André Lureau, samuel.thibault

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Remove the manual build.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure                     |  2 +-
 meson.build                   | 62 +++--------------------------------
 .gitmodules                   |  6 ++--
 slirp => subprojects/libslirp |  0
 4 files changed, 8 insertions(+), 62 deletions(-)
 rename slirp => subprojects/libslirp (100%)

diff --git a/configure b/configure
index 64c09f7d58..e2ed041f66 100755
--- a/configure
+++ b/configure
@@ -5210,7 +5210,7 @@ case "$slirp" in
   auto | enabled | internal)
     # Simpler to always update submodule, even if not needed.
     if test -e "${source_path}/.git" && test $git_update = 'yes' ; then
-      git_submodules="${git_submodules} slirp"
+      git_submodules="${git_submodules} subprojects/libslirp"
     fi
     ;;
 esac
diff --git a/meson.build b/meson.build
index a4adf06997..5f1121d135 100644
--- a/meson.build
+++ b/meson.build
@@ -1457,7 +1457,7 @@ slirp_opt = 'disabled'
 if have_system
   slirp_opt = get_option('slirp')
   if slirp_opt in ['enabled', 'auto', 'system']
-    have_internal = fs.exists(meson.current_source_dir() / 'slirp/meson.build')
+    have_internal = fs.exists(meson.current_source_dir() / 'subprojects/libslirp/meson.build')
     slirp = dependency('slirp', static: enable_static,
                        method: 'pkg-config',
                        required: slirp_opt == 'system' or
@@ -1471,63 +1471,9 @@ if have_system
     endif
   endif
   if slirp_opt == 'internal'
-    slirp_deps = []
-    if targetos == 'windows'
-      slirp_deps = cc.find_library('iphlpapi')
-    endif
-    slirp_conf = configuration_data()
-    slirp_conf.set('SLIRP_MAJOR_VERSION', meson.project_version().split('.')[0])
-    slirp_conf.set('SLIRP_MINOR_VERSION', meson.project_version().split('.')[1])
-    slirp_conf.set('SLIRP_MICRO_VERSION', meson.project_version().split('.')[2])
-    slirp_conf.set_quoted('SLIRP_VERSION_STRING', meson.project_version())
-    slirp_cargs = ['-DG_LOG_DOMAIN="Slirp"']
-    slirp_files = [
-      'slirp/src/arp_table.c',
-      'slirp/src/bootp.c',
-      'slirp/src/cksum.c',
-      'slirp/src/dhcpv6.c',
-      'slirp/src/dnssearch.c',
-      'slirp/src/if.c',
-      'slirp/src/ip6_icmp.c',
-      'slirp/src/ip6_input.c',
-      'slirp/src/ip6_output.c',
-      'slirp/src/ip_icmp.c',
-      'slirp/src/ip_input.c',
-      'slirp/src/ip_output.c',
-      'slirp/src/mbuf.c',
-      'slirp/src/misc.c',
-      'slirp/src/ncsi.c',
-      'slirp/src/ndp_table.c',
-      'slirp/src/sbuf.c',
-      'slirp/src/slirp.c',
-      'slirp/src/socket.c',
-      'slirp/src/state.c',
-      'slirp/src/stream.c',
-      'slirp/src/tcp_input.c',
-      'slirp/src/tcp_output.c',
-      'slirp/src/tcp_subr.c',
-      'slirp/src/tcp_timer.c',
-      'slirp/src/tftp.c',
-      'slirp/src/udp.c',
-      'slirp/src/udp6.c',
-      'slirp/src/util.c',
-      'slirp/src/version.c',
-      'slirp/src/vmstate.c',
-    ]
-
-    configure_file(
-      input : 'slirp/src/libslirp-version.h.in',
-      output : 'libslirp-version.h',
-      configuration: slirp_conf)
-
-    slirp_inc = include_directories('slirp', 'slirp/src')
-    libslirp = static_library('slirp',
-                              sources: slirp_files,
-                              c_args: slirp_cargs,
-                              include_directories: slirp_inc)
-    slirp = declare_dependency(link_with: libslirp,
-                               dependencies: slirp_deps,
-                               include_directories: slirp_inc)
+    libslirp = subproject('libslirp',
+                          default_options: ['default_library=static'])
+    slirp = libslirp.get_variable('libslirp_dep')
   endif
 endif
 
diff --git a/.gitmodules b/.gitmodules
index 2bdeeacef8..80fd9c7199 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -49,9 +49,6 @@
 [submodule "roms/edk2"]
 	path = roms/edk2
 	url = https://git.qemu.org/git/edk2.git
-[submodule "slirp"]
-	path = slirp
-	url = https://git.qemu.org/git/libslirp.git
 [submodule "roms/opensbi"]
 	path = roms/opensbi
 	url = 	https://git.qemu.org/git/opensbi.git
@@ -64,3 +61,6 @@
 [submodule "roms/vbootrom"]
 	path = roms/vbootrom
 	url = https://git.qemu.org/git/vbootrom.git
+[submodule "subprojects/libslirp"]
+	path = subprojects/libslirp
+	url = https://git.qemu.org/git/libslirp.git
diff --git a/slirp b/subprojects/libslirp
similarity index 100%
rename from slirp
rename to subprojects/libslirp
-- 
2.29.0



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

* Re: [PATCH 3/5] build-sys: add libvhost-user missing dependencies
  2021-01-14 12:56 ` [PATCH 3/5] build-sys: add libvhost-user missing dependencies marcandre.lureau
@ 2021-01-14 13:17   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-14 13:17 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: pbonzini, j, samuel.thibault

On 1/14/21 1:56 PM, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> This help fixing static compilation issues.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  subprojects/libvhost-user/meson.build | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH 0/5] Update libslirp & make it a subproject
  2021-01-14 12:56 [PATCH 0/5] Update libslirp & make it a subproject marcandre.lureau
                   ` (4 preceding siblings ...)
  2021-01-14 12:56 ` [PATCH 5/5] build-sys: make libslirp a meson subproject marcandre.lureau
@ 2021-01-14 13:33 ` Paolo Bonzini
  5 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2021-01-14 13:33 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: samuel.thibault, j

On 14/01/21 13:56, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Hi,
> 
> Here is a few patches to update libslirp to git upstream.
> Since it now supports meson subproject(), adapt the build
> system to use it, and related fixes.
> 
> Marc-André Lureau (5):
>    build-sys: remove unused LIBS
>    build-sys: set global arguments for cflags/ldflags
>    build-sys: add libvhost-user missing dependencies
>    slirp: update to git master
>    build-sys: make libslirp a meson subproject
> 
>   configure                             | 34 +-----------
>   meson.build                           | 78 +++++----------------------
>   .gitmodules                           |  6 +--
>   slirp                                 |  1 -
>   subprojects/libslirp                  |  1 +
>   subprojects/libvhost-user/meson.build |  3 ++
>   6 files changed, 20 insertions(+), 103 deletions(-)
>   delete mode 160000 slirp
>   create mode 160000 subprojects/libslirp
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>



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

end of thread, other threads:[~2021-01-14 13:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 12:56 [PATCH 0/5] Update libslirp & make it a subproject marcandre.lureau
2021-01-14 12:56 ` [PATCH 1/5] build-sys: remove unused LIBS marcandre.lureau
2021-01-14 12:56 ` [PATCH 2/5] build-sys: set global arguments for cflags/ldflags marcandre.lureau
2021-01-14 12:56 ` [PATCH 3/5] build-sys: add libvhost-user missing dependencies marcandre.lureau
2021-01-14 13:17   ` Philippe Mathieu-Daudé
2021-01-14 12:56 ` [PATCH 4/5] slirp: update to git master marcandre.lureau
2021-01-14 12:56 ` [PATCH 5/5] build-sys: make libslirp a meson subproject marcandre.lureau
2021-01-14 13:33 ` [PATCH 0/5] Update libslirp & make it a subproject Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.