]> git.eshelyaron.com Git - emacs.git/commitdiff
Build Seccomp filter only if we have a 64-bit userspace (Bug#56549)
authorPhilipp Stephani <phst@google.com>
Fri, 15 Jul 2022 15:56:02 +0000 (17:56 +0200)
committerPhilipp Stephani <phst@google.com>
Fri, 15 Jul 2022 15:56:02 +0000 (17:56 +0200)
* configure.ac (SIZEOF_LONG): New variable.
* lib-src/Makefile.in (SIZEOF_LONG): New variable; added conditional.

configure.ac
lib-src/Makefile.in

index 312243a41cf3ba697a142160f352df6cfae35058..741a1a31df598954b9a1ca8b75aee4d26dcadbd8 100644 (file)
@@ -4380,6 +4380,10 @@ AC_SUBST([HAVE_LIBSECCOMP])
 AC_SUBST([LIBSECCOMP_LIBS])
 AC_SUBST([LIBSECCOMP_CFLAGS])
 
+AC_CHECK_SIZEOF([long])
+SIZEOF_LONG="$ac_cv_sizeof_long"
+AC_SUBST([SIZEOF_LONG])
+
 OLD_LIBS=$LIBS
 LIBS="$LIB_PTHREAD $LIB_MATH $LIBS"
 AC_CHECK_FUNCS(accept4 fchdir gethostname \
index 338ba0d5767a5077783ff6535c6221547f3f8c91..92487edce73a0003f43d6c8860a3886c277f8b30 100644 (file)
@@ -196,11 +196,13 @@ HAVE_SECCOMP=@HAVE_SECCOMP@
 HAVE_LIBSECCOMP=@HAVE_LIBSECCOMP@
 LIBSECCOMP_LIBS=@LIBSECCOMP_LIBS@
 LIBSECCOMP_CFLAGS=@LIBSECCOMP_CFLAGS@
+SIZEOF_LONG=@SIZEOF_LONG@
 
 # 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)
+ifeq ($(SIZEOF_LONG),8)
 # We require SECCOMP_RET_KILL_PROCESS, which is only available in
 # Linux 4.14 and later.
 ifeq ($(shell { echo 4.14; uname -r | cut -d . -f 1-2; } | \
@@ -211,6 +213,7 @@ endif
 endif
 endif
 endif
+endif
 
 ifeq ($(SECCOMP_FILTER),1)
 DONT_INSTALL += seccomp-filter$(EXEEXT)