]> git.eshelyaron.com Git - emacs.git/commitdiff
Generate Seccomp filters only if we have the necessary constants.
authorPhilipp Stephani <phst@google.com>
Mon, 12 Apr 2021 07:15:59 +0000 (09:15 +0200)
committerPhilipp Stephani <phst@google.com>
Mon, 12 Apr 2021 07:15:59 +0000 (09:15 +0200)
If we're missing SECCOMP_SET_MODE_FILTER, the seccomp-filter build
fails.  Reuse the existing HAVE_SECCOMP configuration variable, which
checks for these macros.

* configure.ac (HAVE_SECCOMP): Substitute in Makefile.in.
* lib-src/Makefile.in (HAVE_SECCOMP): New variable.
(SECCOMP_FILTER): Define only if HAVE_SECCOMP.

configure.ac
lib-src/Makefile.in

index 169ffc553415c26271f041b40c1cb359352e0c21..d3647bdc2a2c1d6260f1d4a3ff7792933aca3686 100644 (file)
@@ -4188,6 +4188,7 @@ AC_CHECK_HEADERS(
     [[
     #include <linux/seccomp.h>
     ]])])
+AC_SUBST([HAVE_SECCOMP])
 
 EMACS_CHECK_MODULES([LIBSECCOMP], [libseccomp >= 2.4.0])
 AC_SUBST([HAVE_LIBSECCOMP])
index 091f4fb01998742d3f2cda68a6da37f7303afc55..923d0cf5e720ec9f717484de5d746a5284b973e2 100644 (file)
@@ -189,11 +189,13 @@ LIB_WSOCK32=@LIB_WSOCK32@
 ## Extra libraries for etags
 LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM)
 
+HAVE_SECCOMP=@HAVE_SECCOMP@
 HAVE_LIBSECCOMP=@HAVE_LIBSECCOMP@
 LIBSECCOMP_LIBS=@LIBSECCOMP_LIBS@
 LIBSECCOMP_CFLAGS=@LIBSECCOMP_CFLAGS@
 
 # Currently, we can only generate seccomp filter files for x86-64.
+ifeq ($(HAVE_SECCOMP),yes)
 ifeq ($(HAVE_LIBSECCOMP),yes)
 ifeq ($(shell uname -m),x86_64)
 # We require SECCOMP_RET_KILL_PROCESS, which is only available in
@@ -205,6 +207,7 @@ SECCOMP_FILTER=1
 endif
 endif
 endif
+endif
 
 ifeq ($(SECCOMP_FILTER),1)
 DONT_INSTALL += seccomp-filter$(EXEEXT)