Skip to contentSkip to conversation

buildsys: Move seccomp cflags/libs to per object

PATCH In review Fam Zheng 3 participants 4 messages Sep 7, 2017 – Sep 8, 2017 Kbuild

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 buildsys: Move seccomp cflags/libs to per object

Like many other libraries, libseccomp cflags and libs should only apply to the building of necessary objects. Do so in the usual way with the help of per object variables.

---
 Makefile.objs | 2 ++
 configure     | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
Makefile.objs +2 -0
index 24a4ea08b8..d9cf7ad791 100644
@@ -70,6 +70,8 @@ common-obj-y += backends/
 common-obj-y += chardev/
 
 common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
+qemu-seccomp.o-cflags := $(SECCOMP_CFLAGS)
+qemu-seccomp.o-libs := $(SECCOMP_LIBS)
 
 common-obj-$(CONFIG_FDT) += device_tree.o
 
configure +4 -2
index fb7e34a901..fb81a0189b 100755
@@ -2052,8 +2052,8 @@ if test "$seccomp" != "no" ; then
 
     if test "$libseccomp_minver" != "" &&
        $pkg_config --atleast-version=$libseccomp_minver libseccomp ; then
-        libs_softmmu="$libs_softmmu $($pkg_config --libs libseccomp)"
-        QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags libseccomp)"
+        seccomp_cflags="$($pkg_config --cflags libseccomp)"
+        seccomp_libs="$($pkg_config --libs libseccomp)"
         seccomp="yes"
     else
         if test "$seccomp" = "yes" ; then
@@ -5875,6 +5875,8 @@ fi
 
 if test "$seccomp" = "yes"; then
   echo "CONFIG_SECCOMP=y" >> $config_host_mak
+  echo "SECCOMP_CFLAGS=$seccomp_cflags" >> $config_host_mak
+  echo "SECCOMP_LIBS=$seccomp_libs" >> $config_host_mak
 fi
 
 # XXX: suppress that
Signature · 1 line
2.13.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Fam Zheng

Like many other libraries, libseccomp cflags and libs should only apply to the building of necessary objects. Do so in the usual way with the help of per object variables.

Quoted 43 lines
---
  Makefile.objs | 2 ++
  configure     | 6 ++++--
  2 files changed, 6 insertions(+), 2 deletions(-)
Makefile.objs +2 -0
index 24a4ea08b8..d9cf7ad791 100644
@@ -70,6 +70,8 @@ common-obj-y += backends/
  common-obj-y += chardev/
 
  common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
+qemu-seccomp.o-cflags := $(SECCOMP_CFLAGS)
+qemu-seccomp.o-libs := $(SECCOMP_LIBS)
 
  common-obj-$(CONFIG_FDT) += device_tree.o
 
configure +4 -2
index fb7e34a901..fb81a0189b 100755
@@ -2052,8 +2052,8 @@ if test "$seccomp" != "no" ; then
 
      if test "$libseccomp_minver" != "" &&
         $pkg_config --atleast-version=$libseccomp_minver libseccomp ; then
-        libs_softmmu="$libs_softmmu $($pkg_config --libs libseccomp)"
-        QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags libseccomp)"
+        seccomp_cflags="$($pkg_config --cflags libseccomp)"
+        seccomp_libs="$($pkg_config --libs libseccomp)"
          seccomp="yes"
      else
          if test "$seccomp" = "yes" ; then
@@ -5875,6 +5875,8 @@ fi
 
  if test "$seccomp" = "yes"; then
    echo "CONFIG_SECCOMP=y" >> $config_host_mak
+  echo "SECCOMP_CFLAGS=$seccomp_cflags" >> $config_host_mak
+  echo "SECCOMP_LIBS=$seccomp_libs" >> $config_host_mak
  fi
 
  # XXX: suppress that
Acked-by on v1 1/1
#2 lore raw
In reply to Fam Zheng
Quoted 5 lines · Fam Zheng

Like many other libraries, libseccomp cflags and libs should only apply to the building of necessary objects. Do so in the usual way with the help of per object variables.

I'll include in the next pull request. Thanks for the patch.

Quoted 46 lines
---
 Makefile.objs | 2 ++
 configure     | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
Makefile.objs +2 -0
index 24a4ea08b8..d9cf7ad791 100644
@@ -70,6 +70,8 @@ common-obj-y += backends/
 common-obj-y += chardev/
 
 common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
+qemu-seccomp.o-cflags := $(SECCOMP_CFLAGS)
+qemu-seccomp.o-libs := $(SECCOMP_LIBS)
 
 common-obj-$(CONFIG_FDT) += device_tree.o
 
configure +4 -2
index fb7e34a901..fb81a0189b 100755
@@ -2052,8 +2052,8 @@ if test "$seccomp" != "no" ; then
 
     if test "$libseccomp_minver" != "" &&
        $pkg_config --atleast-version=$libseccomp_minver libseccomp ; then
-        libs_softmmu="$libs_softmmu $($pkg_config --libs libseccomp)"
-        QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags libseccomp)"
+        seccomp_cflags="$($pkg_config --cflags libseccomp)"
+        seccomp_libs="$($pkg_config --libs libseccomp)"
         seccomp="yes"
     else
         if test "$seccomp" = "yes" ; then
@@ -5875,6 +5875,8 @@ fi
 
 if test "$seccomp" = "yes"; then
   echo "CONFIG_SECCOMP=y" >> $config_host_mak
+  echo "SECCOMP_CFLAGS=$seccomp_cflags" >> $config_host_mak
+  echo "SECCOMP_LIBS=$seccomp_libs" >> $config_host_mak
 fi
 
 # XXX: suppress that
Signature · 1 line
2.13.5
Signature · 2 lines
Eduardo Otubo
Senior Software Engineer @ RedHat
author
#3 lore raw
Quoted 8 lines · Eduardo Otubo
Quoted 5 lines · Fam Zheng

Like many other libraries, libseccomp cflags and libs should only apply to the building of necessary objects. Do so in the usual way with the help of per object variables.

I'll include in the next pull request. Thanks for the patch.

Great, thanks!

Fam