diff --git a/CHANGELOG b/CHANGELOG index 0ee34df..3cbf8a9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,20 @@ libseccomp: Releases =============================================================================== https://github.com/seccomp/libseccomp + +* Version 2.3.3 - January 10, 2018 +- Updated the syscall table for Linux v4.15-rc7 + +* Version 2.3.2 - February 27, 2017 +- Achieved full compliance with the CII Best Practices program +- Added Travis CI builds to the GitHub repository +- Added code coverage reporting with the "--enable-code-coverage" configure + flag and added Coveralls to the GitHub repository +- Updated the syscall tables to match Linux v4.10-rc6+ +- Support for building with Python v3.x +- Allow rules with the -1 syscall if the SCMP\_FLTATR\_API\_TSKIP attribute is + set to true +- Several small documentation fixes * Version 2.3.1 - April 20, 2016 - Fixed a problem with 32-bit x86 socket syscalls on some systems diff --git a/CREDITS b/CREDITS index 77173e5..a39c0bf 100644 --- a/CREDITS +++ b/CREDITS @@ -1,5 +1,5 @@ libseccomp: Contributors -=============================================================================== +======================================================================== https://github.com/seccomp/libseccomp Andrew Jones @@ -9,14 +9,21 @@ Brian Cain Colin Walters Corey Bryant +David Drysdale Eduardo Otubo Eric Paris Heiko Carstens +Helge Deller Jake Edge Jan Engelhardt Jan Willeke +Jay Guo +Jiannan Guo Joe MacDonald +Justin Cormack Kees Cook +Kyle R. Conway +Luca Bruno Marcin Juszkiewicz Marcus Meissner Markos Chandras @@ -26,6 +33,9 @@ Mike Strosaker Paul Moore Serge Hallyn +Tobias Klauser Thiago Marcos P. Santos +valoq Vicente Olivert Riera Vitaly Vi Shukela +Vladimir Rutsky diff --git a/Makefile.am b/Makefile.am index a81b6fa..91ba36e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ pkgconfdir = ${libdir}/pkgconfig pkgconf_DATA = libseccomp.pc -EXTRA_DIST = CHANGELOG CREDITS LICENSE README SUBMITTING_PATCHES +EXTRA_DIST = CHANGELOG CREDITS LICENSE README.md SUBMITTING_PATCHES # support silent builds AM_MAKEFLAGS_0 = --quiet --no-print-directory @@ -36,6 +36,9 @@ check-syntax: @./tools/check-syntax + +check-code-coverage: check-build + ${MAKE} ${AM_MAKEFLAGS} -C tests check-code-coverage if COVERITY coverity-build: clean diff --git a/Makefile.in b/Makefile.in index c73b7eb..ab7543f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -33,7 +33,17 @@ # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -97,25 +107,15 @@ build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/configure.h.in $(srcdir)/libseccomp.pc.in README \ - build-aux/ar-lib build-aux/compile build-aux/config.guess \ - build-aux/config.sub build-aux/depcomp build-aux/install-sh \ - build-aux/missing build-aux/ltmain.sh \ - $(top_srcdir)/build-aux/ar-lib $(top_srcdir)/build-aux/compile \ - $(top_srcdir)/build-aux/config.guess \ - $(top_srcdir)/build-aux/config.sub \ - $(top_srcdir)/build-aux/install-sh \ - $(top_srcdir)/build-aux/ltmain.sh \ - $(top_srcdir)/build-aux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -208,6 +208,16 @@ CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configure.h.in \ + $(srcdir)/libseccomp.pc.in $(top_srcdir)/build-aux/ar-lib \ + $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/missing build-aux/ar-lib \ + build-aux/compile build-aux/config.guess build-aux/config.sub \ + build-aux/install-sh build-aux/ltmain.sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -264,6 +274,12 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -278,12 +294,15 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -377,7 +396,7 @@ SUBDIRS = include src tools tests doc pkgconfdir = ${libdir}/pkgconfig pkgconf_DATA = libseccomp.pc -EXTRA_DIST = CHANGELOG CREDITS LICENSE README SUBMITTING_PATCHES +EXTRA_DIST = CHANGELOG CREDITS LICENSE README.md SUBMITTING_PATCHES # support silent builds AM_MAKEFLAGS_0 = --quiet --no-print-directory @@ -403,7 +422,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -641,7 +659,7 @@ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir @@ -657,17 +675,17 @@ $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -685,7 +703,7 @@ distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -695,23 +713,23 @@ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=.. --prefix="$$dc_install_base" \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -892,6 +910,8 @@ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-pkgconfDATA +.PRECIOUS: Makefile + check-build: all ${MAKE} ${AM_MAKEFLAGS} -C src check-build @@ -899,6 +919,9 @@ check-syntax: @./tools/check-syntax + +check-code-coverage: check-build + ${MAKE} ${AM_MAKEFLAGS} -C tests check-code-coverage @COVERITY_TRUE@coverity-build: clean @COVERITY_TRUE@ cov-build --dir cov-int ${MAKE} ${AM_MAKEFLAGS} check-build diff --git a/README b/README deleted file mode 100644 index 6987b5f..0000000 --- a/README +++ /dev/null @@ -1,65 +0,0 @@ -libseccomp: An Enhanced Seccomp (mode 2) Helper Library -=============================================================================== -https://github.com/seccomp/libseccomp - -The libseccomp library provides an easy to use, platform independent, interface -to the Linux Kernel's syscall filtering mechanism. The libseccomp API is -designed to abstract away the underlying BPF based syscall filter language and -present a more conventional function-call based filtering interface that should -be familiar to, and easily adopted by, application developers. - -* Online Resources - -The library source repository currently lives on GitHub at the following URL: - - -> https://github.com/seccomp/libseccomp - -The project mailing list is currently hosted on Google Groups at the URL below, -please note that a Google account is not required to subscribe to the mailing -list. - - -> https://groups.google.com/forum/#!forum/libseccomp - -> https://groups.google.com/forum/#!forum/libseccomp/join - -* Documentation - -The "doc/" directory contains all of the currently available documentation, -mostly in the form of manpages. The top level directory also contains a README -file (this file) as well as the LICENSE, CREDITS, SUBMITTING_PATCHES, and -CHANGELOG files. - -Those who are interested in contributing to the the project are encouraged to -read the SUBMITTING_PATCHES in the top level directory. - -* Building and Installing the Library - -If you are building the libseccomp library from an official release tarball, -you should follow the familiar three step process used by most autotools based -applications: - - # ./configure - # make [V=0|1] - # make install - -However, if you are building the library from sources retrieved from the source -repository you may need to run the autogen.sh script before running configure. -In both cases, running "./configure -h" will display a list of build-time -configuration options. - -* Testing the Library - -There are a number of tests located in the "tests/" directory and a make target -which can be used to help automate their execution. If you want to run the -standard regression tests you can execute the following after building the -library: - - # make check - -Be warned that the test run can take a while to run and produces a lot of -output. - -* Other Useful Tools - -The "tools/" directory includes a number of tools which may be helpful in the -development of the library, or applications using the library. Not all of -these tools are installed by default. diff --git a/README.md b/README.md new file mode 100644 index 0000000..173b8c8 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +An Enhanced Seccomp (seccomp-bpf) Helper Library +=============================================================================== +https://github.com/seccomp/libseccomp + +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/608/badge)](https://bestpractices.coreinfrastructure.org/projects/608) +[![Build Status](https://travis-ci.org/seccomp/libseccomp.svg?branch=release-2.3)](https://travis-ci.org/seccomp/libseccomp) +[![Coverage Status](https://coveralls.io/repos/github/seccomp/libseccomp/badge.svg?branch=release-2.3)](https://coveralls.io/github/seccomp/libseccomp?branch=release-2.3) + +The libseccomp library provides an easy to use, platform independent, interface +to the Linux Kernel's syscall filtering mechanism. The libseccomp API is +designed to abstract away the underlying BPF based syscall filter language and +present a more conventional function-call based filtering interface that should +be familiar to, and easily adopted by, application developers. + +## Online Resources + +The library source repository currently lives on GitHub at the following URL: + +* https://github.com/seccomp/libseccomp + +The project mailing list is currently hosted on Google Groups at the URL below, +please note that a Google account is not required to subscribe to the mailing +list. + +* https://groups.google.com/forum/#!forum/libseccomp +* https://groups.google.com/forum/#!forum/libseccomp/join + +## Documentation + +The "doc/" directory contains all of the currently available documentation, +mostly in the form of manpages. The top level directory also contains a README +file (this file) as well as the LICENSE, CREDITS, SUBMITTING_PATCHES, and +CHANGELOG files. + +Those who are interested in contributing to the the project are encouraged to +read the SUBMITTING_PATCHES in the top level directory. + +## Building and Installing the Library + +If you are building the libseccomp library from an official release tarball, +you should follow the familiar three step process used by most autotools based +applications: + + # ./configure + # make [V=0|1] + # make install + +However, if you are building the library from sources retrieved from the source +repository you may need to run the autogen.sh script before running configure. +In both cases, running "./configure -h" will display a list of build-time +configuration options. + +## Testing the Library + +There are a number of tests located in the "tests/" directory and a make target +which can be used to help automate their execution. If you want to run the +standard regression tests you can execute the following after building the +library: + + # make check + +Be warned that the test run can take a while to run and produces a lot of +output. + +## Developer Tools + +The "tools/" directory includes a number of tools which may be helpful in the +development of the library, or applications using the library. Not all of +these tools are installed by default. + +## Bug and Vulnerability Reporting + +Problems with the libseccomp library can be reported using the GitHub issue +tracking system or the mailing list. Those who wish to privately report +potential vulnerabilities can send mail to paul@paul-moore.com. diff --git a/aclocal.m4 b/aclocal.m4 index 95aeaaf..16f08c2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14.1], [], +m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,12 +51,12 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14.1])dnl +[AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -118,7 +118,7 @@ # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -163,15 +163,14 @@ # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -202,7 +201,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -393,7 +392,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -469,7 +468,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -559,8 +558,8 @@ # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -633,7 +632,11 @@ END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further @@ -662,7 +665,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -673,7 +676,7 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -683,7 +686,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -704,7 +707,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -754,7 +757,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -793,7 +796,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -822,7 +825,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -869,7 +872,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -888,7 +891,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -969,7 +972,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1029,7 +1032,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1057,7 +1060,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1076,7 +1079,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1207,6 +1210,7 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([m4/ax_code_coverage.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff --git a/build-aux/ar-lib b/build-aux/ar-lib index fe2301e..05094d3 100755 --- a/build-aux/ar-lib +++ b/build-aux/ar-lib @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2012-03-01.08; # UTC -# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Copyright (C) 2010-2017 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify diff --git a/build-aux/compile b/build-aux/compile index 531136b..2ab71e4 100755 --- a/build-aux/compile +++ b/build-aux/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -255,7 +255,8 @@ echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -342,6 +343,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/config.guess b/build-aux/config.guess index 6f790d6..2193702 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. - -timestamp='2015-12-14' +# Copyright 1992-2017 Free Software Foundation, Inc. + +timestamp='2017-05-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -186,9 +186,12 @@ *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. + # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -237,6 +240,10 @@ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -268,42 +275,42 @@ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -376,16 +383,16 @@ exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -410,7 +417,7 @@ exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} @@ -635,13 +642,13 @@ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi @@ -680,11 +687,11 @@ exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build @@ -697,12 +704,12 @@ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -807,14 +814,14 @@ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -830,10 +837,11 @@ UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -896,7 +904,7 @@ exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix @@ -919,7 +927,7 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) @@ -993,6 +1001,9 @@ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; @@ -1025,6 +1036,9 @@ ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; @@ -1044,18 +1058,7 @@ echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - eval $set_cc_for_build - X86_64_ABI= - # If there is a compiler, see if it is configured for 32-bit objects. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_X32 >/dev/null - then - X86_64_ABI=x32 - fi - fi - echo ${UNAME_MACHINE}-pc-linux-${LIBC}${X86_64_ABI} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1283,6 +1286,9 @@ SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1296,15 +1302,22 @@ UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then @@ -1320,7 +1333,7 @@ exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi @@ -1329,14 +1342,17 @@ *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) + NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; - NSR-?:NONSTOP_KERNEL:*:*) + NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1351,7 +1367,7 @@ # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" @@ -1393,7 +1409,7 @@ echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos @@ -1412,18 +1428,17 @@ cat >&2 < in order to provide the needed -information to handle your system. + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp diff --git a/build-aux/config.sub b/build-aux/config.sub index a16cc4d..40ea5df 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. - -timestamp='2015-12-14' +# Copyright 1992-2017 Free Software Foundation, Inc. + +timestamp='2017-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -67,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +117,7 @@ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -258,12 +258,12 @@ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx | dvp \ + | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia64 \ + | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ @@ -301,6 +301,7 @@ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ @@ -314,6 +315,7 @@ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ + | wasm32 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -387,7 +389,7 @@ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ @@ -428,6 +430,7 @@ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ @@ -444,6 +447,7 @@ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -642,6 +646,14 @@ dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd @@ -827,24 +839,6 @@ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint - ;; - mipsEE* | ee | ps2) - basic_machine=mips64r5900el-scei - case $os in - -linux*) - ;; - *) - os=-elf - ;; - esac - ;; - iop) - basic_machine=mipsel-scei - os=-irx - ;; - dvp) - basic_machine=dvp-scei - os=-elf ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` @@ -956,6 +950,9 @@ nsr-tandem) basic_machine=nsr-tandem ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -1040,7 +1037,7 @@ ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) @@ -1050,7 +1047,7 @@ ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) @@ -1250,6 +1247,9 @@ vxworks29k) basic_machine=a29k-wrs os=-vxworks + ;; + wasm32) + basic_machine=wasm32-unknown ;; w65*) basic_machine=w65-wdc @@ -1400,24 +1400,24 @@ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos*) + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1549,6 +1549,8 @@ ;; -nacl*) ;; + -ios) + ;; -none) ;; *) @@ -1643,6 +1645,9 @@ ;; sparc-* | *-sun) os=-sunos4.1.1 + ;; + pru-*) + os=-elf ;; *-be) os=-beos diff --git a/build-aux/depcomp b/build-aux/depcomp index 4ebd5b3..b39f98f 100755 --- a/build-aux/depcomp +++ b/build-aux/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2013-05-30.07; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -786,6 +786,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/install-sh b/build-aux/install-sh index 377bb86..0360b79 100755 --- a/build-aux/install-sh +++ b/build-aux/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2016-01-11.22; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,45 +122,56 @@ -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) no_target_directory=true;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. @@ -208,6 +204,15 @@ fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -223,16 +228,16 @@ *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -269,41 +274,15 @@ # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi @@ -314,74 +293,74 @@ if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -391,53 +370,51 @@ # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - - eval "$initialize_posix_glob" oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -472,15 +449,12 @@ # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -493,24 +467,24 @@ # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 @@ -522,6 +496,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh index b2549ee..857338f 100644 --- a/build-aux/ltmain.sh +++ b/build-aux/ltmain.sh @@ -1,12 +1,12 @@ #! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 - -# libtool (GNU libtool) 2.4.6 +## by inline-source v2016-02-21.11 + +# libtool (GNU libtool) 2.4.6.40-6ca5-dirty # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.4.6.40-6ca5-dirty +package_revision=2.4.6.40 ## ------ ## @@ -64,34 +64,25 @@ # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-10-04.22; # UTC +scriptversion=2017-04-19.12; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2017 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 3 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# ## ------ ## @@ -140,9 +131,6 @@ fi" done -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - # Make sure IFS has a sensible default sp=' ' nl=' @@ -158,6 +146,26 @@ } fi + +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS ## ------------------------- ## @@ -259,7 +267,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +303,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -580,16 +588,16 @@ { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,132 +1099,199 @@ } -# func_quote ARG -# -------------- -# Aesthetically quote one ARG, store the result into $func_quote_result. Note -# that we keep attention to performance here (so far O(N) complexity as long as -# func_append is O(1)). -func_quote () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_result=$1 - - case $func_quote_result in - *[\\\`\"\$]*) - case $func_quote_result in - *[\[\*\?]*) - func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` - return 0 - ;; - esac - - func_quote_old_IFS=$IFS - for _G_char in '\' '`' '"' '$' - do - # STATE($1) PREV($2) SEPARATOR($3) - set start "" "" - func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy - IFS=$_G_char - for _G_part in $func_quote_result + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break + fi + + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + case $func_quote_portable_result in + *[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' do - case $1 in - quote) - func_append func_quote_result "$3$2" - set quote "$_G_part" "\\$_G_char" - ;; - start) - set first "" "" - func_quote_result= - ;; - first) - set quote "$_G_part" "" - ;; - esac + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done done - IFS=$func_quote_old_IFS - done + IFS=$func_quote_portable_old_IFS + ;; + *) ;; + esac + break + done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" ;; - *) ;; esac } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () -{ - $debug_cmd - - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - func_quote "$1" - _G_unquoted_arg=$func_quote_result - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" - fi - - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result ;; *) - _G_quoted_arg=$_G_unquoted_arg - ;; + printf -v func_quotefast_eval_result %q "$1" + ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi + + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; + esac + + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result + ;; + esac +} + + +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" else - func_append func_quote_for_eval_result "$_G_quoted_arg" + func_append func_quote_result "$func_quote_arg_result" fi shift done -} - - -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd - - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; - esac - - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" - ;; - esac - - func_quote_for_expand_result=$_G_arg } @@ -1262,8 +1337,8 @@ _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1288,8 +1363,8 @@ _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1416,30 +1491,26 @@ # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2017 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 3 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# + +# Set a version string for this script. +scriptversion=2016-03-06.01; # UTC ## ------ ## @@ -1462,7 +1533,7 @@ # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1474,7 +1545,7 @@ # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1523,8 +1594,8 @@ ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1557,19 +1628,38 @@ # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1579,22 +1669,19 @@ case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1604,10 +1691,18 @@ ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1617,9 +1712,8 @@ # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1628,25 +1722,36 @@ # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -1657,15 +1762,24 @@ # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. + + +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} # func_options [ARG]... @@ -1677,17 +1791,27 @@ { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} - - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} - - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + _G_options_quoted=false + + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done + + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1696,9 +1820,8 @@ # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1709,9 +1832,7 @@ opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -1723,25 +1844,32 @@ { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1751,7 +1879,10 @@ ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1804,15 +1935,24 @@ shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -1829,12 +1969,10 @@ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -1890,8 +2028,8 @@ # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1906,8 +2044,9 @@ func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1985,31 +2124,44 @@ # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^# Written by / { - s|^# || - p - } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -2024,7 +2176,7 @@ # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.6.40-6ca5-dirty' # func_echo ARG... @@ -2115,12 +2267,12 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname (GNU libtool) 2.4.6.40-6ca5-dirty automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . -GNU libtool home page: . +GNU libtool home page: . General help using GNU software: ." exit 0 } @@ -2171,7 +2323,7 @@ # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ + func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2317,6 +2469,8 @@ nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2340,11 +2494,16 @@ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi } func_add_hook func_options_prep libtool_options_prep @@ -2356,9 +2515,12 @@ { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2433,15 +2595,20 @@ func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options libtool_parse_options @@ -2498,8 +2665,8 @@ } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -3465,8 +3632,8 @@ esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3539,8 +3706,8 @@ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -4143,8 +4310,8 @@ case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4154,8 +4321,8 @@ # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4212,12 +4379,12 @@ esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4228,8 +4395,8 @@ if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4525,8 +4692,8 @@ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -5305,8 +5472,8 @@ if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - func_quote "$ECHO" - qECHO=$func_quote_result + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5316,7 +5483,7 @@ \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -6659,9 +6826,9 @@ while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -7259,9 +7426,9 @@ save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7275,10 +7442,10 @@ save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7302,8 +7469,8 @@ # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7328,8 +7495,8 @@ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7350,15 +7517,15 @@ continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7478,8 +7645,8 @@ *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg @@ -9985,8 +10152,8 @@ for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10079,8 +10246,8 @@ eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10554,12 +10721,13 @@ elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done - func_quote "(cd `pwd`; $relink_command)" - relink_command=$func_quote_result + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. @@ -10799,14 +10967,15 @@ elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - func_quote "$relink_command" - relink_command=$func_quote_result + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi diff --git a/build-aux/missing b/build-aux/missing index db98974..c6e3795 100755 --- a/build-aux/missing +++ b/build-aux/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -210,6 +210,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/configure b/configure index 21b0b14..179c840 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libseccomp 2.3.1. +# Generated by GNU Autoconf 2.69 for libseccomp 2.3.3. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='libseccomp' PACKAGE_TARNAME='libseccomp' -PACKAGE_VERSION='2.3.1' -PACKAGE_STRING='libseccomp 2.3.1' +PACKAGE_VERSION='2.3.3' +PACKAGE_STRING='libseccomp 2.3.3' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -633,6 +633,18 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +CODE_COVERAGE_RULES +CODE_COVERAGE_LDFLAGS +CODE_COVERAGE_LIBS +CODE_COVERAGE_CXXFLAGS +CODE_COVERAGE_CFLAGS +CODE_COVERAGE_CPPFLAGS +GENHTML +LCOV +GCOV +CODE_COVERAGE_ENABLED +CODE_COVERAGE_ENABLED_FALSE +CODE_COVERAGE_ENABLED_TRUE COVERITY_FALSE COVERITY_TRUE have_coverity @@ -772,6 +784,8 @@ with_sysroot enable_libtool_lock enable_python +with_gcov +enable_code_coverage ' ac_precious_vars='build_alias host_alias @@ -1323,7 +1337,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libseccomp 2.3.1 to adapt to many kinds of systems. +\`configure' configures libseccomp 2.3.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1393,7 +1407,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libseccomp 2.3.1:";; + short | recursive ) echo "Configuration of libseccomp 2.3.3:";; esac cat <<\_ACEOF @@ -1413,6 +1427,7 @@ optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-python build the python bindings, requires cython + --enable-code-coverage Whether to enable code coverage support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1425,6 +1440,7 @@ --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). + --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). Some influential environment variables: CC C compiler command @@ -1504,7 +1520,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libseccomp configure 2.3.1 +libseccomp configure 2.3.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1782,7 +1798,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libseccomp $as_me 2.3.1, which was +It was created by libseccomp $as_me 2.3.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2166,7 +2182,7 @@ -am__api_version='1.14' +am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2338,8 +2354,8 @@ ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -2358,7 +2374,7 @@ $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -2652,7 +2668,7 @@ # Define the identity of the package. PACKAGE='libseccomp' - VERSION='2.3.1' + VERSION='2.3.3' cat >>confdefs.h <<_ACEOF @@ -2686,8 +2702,8 @@ # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -2829,6 +2845,7 @@ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -4051,8 +4068,8 @@ -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.6.40-6ca5-dirty' +macro_revision='2.4.6.40' @@ -5714,12 +5731,28 @@ fi : ${AR=ar} -: ${AR_FLAGS=cru} - - - - - + + + + + + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. @@ -7438,8 +7471,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -9200,6 +9233,7 @@ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -9417,7 +9451,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10054,6 +10088,7 @@ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -10862,14 +10897,7 @@ *) objformat=elf ;; esac fi - # Handle Gentoo/FreeBSD as it was Linux - case $host_vendor in - gentoo) - version_type=linux ;; - *) - version_type=freebsd-$objformat ;; - esac - + version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' @@ -10880,12 +10908,6 @@ freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes - ;; - linux) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - need_lib_prefix=no - need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH @@ -12010,30 +12032,41 @@ old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +if test -z "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac + ;; + esac + fi fi @@ -12323,6 +12356,377 @@ COVERITY_TRUE='#' COVERITY_FALSE= fi + + + + + + # allow to override gcov location + +# Check whether --with-gcov was given. +if test "${with_gcov+set}" = set; then : + withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov +else + _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 +$as_echo_n "checking whether to build with code coverage support... " >&6; } + # Check whether --enable-code-coverage was given. +if test "${enable_code_coverage+set}" = set; then : + enableval=$enable_code_coverage; +else + enable_code_coverage=no +fi + + + if test x$enable_code_coverage = xyes; then + CODE_COVERAGE_ENABLED_TRUE= + CODE_COVERAGE_ENABLED_FALSE='#' +else + CODE_COVERAGE_ENABLED_TRUE='#' + CODE_COVERAGE_ENABLED_FALSE= +fi + + CODE_COVERAGE_ENABLED=$enable_code_coverage + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 +$as_echo "$enable_code_coverage" >&6; } + + if test "$enable_code_coverage" = "yes" ; then : + + # check for gcov + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. +set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GCOV+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GCOV"; then + ac_cv_prog_GCOV="$GCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GCOV=$ac_cv_prog_GCOV +if test -n "$GCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 +$as_echo "$GCOV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_GCOV"; then + ac_ct_GCOV=$GCOV + # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. +set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_GCOV+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_GCOV"; then + ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV +if test -n "$ac_ct_GCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 +$as_echo "$ac_ct_GCOV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_GCOV" = x; then + GCOV=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + GCOV=$ac_ct_GCOV + fi +else + GCOV="$ac_cv_prog_GCOV" +fi + + if test "X$GCOV" = "X:"; then : + as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 +fi + + + if test "$GCC" = "no" ; then : + + as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 + +fi + + # Extract the first word of "lcov", so it can be a program name with args. +set dummy lcov; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LCOV+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LCOV"; then + ac_cv_prog_LCOV="$LCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LCOV="lcov" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LCOV=$ac_cv_prog_LCOV +if test -n "$LCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 +$as_echo "$LCOV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "genhtml", so it can be a program name with args. +set dummy genhtml; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GENHTML+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GENHTML"; then + ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GENHTML="genhtml" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GENHTML=$ac_cv_prog_GENHTML +if test -n "$GENHTML"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 +$as_echo "$GENHTML" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + if test -z "$LCOV" ; then : + + as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 + +fi + + if test -z "$GENHTML" ; then : + + as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 + +fi + + CODE_COVERAGE_CPPFLAGS="-DNDEBUG" + CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_LIBS="-lgcov" + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" + + + + + + + + CODE_COVERAGE_RULES_CHECK=' + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture +' + CODE_COVERAGE_RULES_CAPTURE=' + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" +' + CODE_COVERAGE_RULES_CLEAN=' +clean: code-coverage-clean +distclean: code-coverage-clean +code-coverage-clean: + -$(LCOV) --directory $(top_builddir) -z + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete +' + +else + + CODE_COVERAGE_RULES_CHECK=' + @echo "Need to reconfigure with --enable-code-coverage" +' + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" + CODE_COVERAGE_RULES_CLEAN='' + +fi + +CODE_COVERAGE_RULES=' +# Code coverage +# +# Optional: +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. +# Multiple directories may be specified, separated by whitespace. +# (Default: $(top_builddir)) +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated +# by lcov for code coverage. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage +# reports to be created. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, +# set to 0 to disable it and leave empty to stay with the default. +# (Default: empty) +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov +# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov +# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the +# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov +# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering +# lcov instance. (Default: empty) +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov +# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the +# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml +# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore +# +# The generated report will be titled using the $(PACKAGE_NAME) and +# $(PACKAGE_VERSION). In order to add the current git hash to the title, +# use the git-version-gen script, available online. + +# Optional variables +CODE_COVERAGE_DIRECTORY ?= $(top_builddir) +CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info +CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage +CODE_COVERAGE_BRANCH_COVERAGE ?= +CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ +--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" +CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= +CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ +$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ +--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) +CODE_COVERAGE_IGNORE_PATTERN ?= + +code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) +code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ + $(CODE_COVERAGE_OUTPUT_FILE); +code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) +code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ + $(CODE_COVERAGE_IGNORE_PATTERN); +code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) +code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); +code_coverage_quiet = $(code_coverage_quiet_$(V)) +code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) +code_coverage_quiet_0 = --quiet + +# sanitizes the test-name: replaces with underscores: dashes and dots +code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) + +# Use recursive makes in order to ignore errors during check +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' + +# Capture code coverage data +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' + +# Hook rule executed before code-coverage-capture, overridable by the user +code-coverage-capture-hook: + +'"$CODE_COVERAGE_RULES_CLEAN"' + +GITIGNOREFILES ?= +GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) + +A''M_DISTCHECK_CONFIGURE_FLAGS ?= +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage + +.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean +' + + + ac_config_files="$ac_config_files libseccomp.pc include/seccomp.h" @@ -12472,6 +12876,10 @@ as_fn_error $? "conditional \"COVERITY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then + as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -12869,7 +13277,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libseccomp $as_me 2.3.1, which was +This file was extended by libseccomp $as_me 2.3.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12935,7 +13343,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libseccomp config.status 2.3.1 +libseccomp config.status 2.3.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -13106,6 +13514,7 @@ DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -13234,7 +13643,6 @@ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -14206,8 +14614,11 @@ # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec diff --git a/configure.ac b/configure.ac index 5e6447a..424f06a 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ dnl #### dnl libseccomp defines dnl #### -AC_INIT([libseccomp], [2.3.1]) +AC_INIT([libseccomp], [2.3.3]) dnl #### dnl autoconf configuration @@ -125,6 +125,12 @@ AM_CONDITIONAL(COVERITY, test "$have_coverity" = yes) dnl #### +dnl code coverage checks +dnl -> https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html +dnl #### +AX_CODE_COVERAGE + +dnl #### dnl version dependent files dnl #### AC_CONFIG_FILES([ diff --git a/doc/Makefile.in b/doc/Makefile.in index 625b4e6..8538e68 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,7 +32,17 @@ # along with this library; if not, see . # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -96,15 +106,14 @@ build_triplet = @build@ host_triplet = @host@ subdir = doc -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(dist_man1_MANS) $(dist_man3_MANS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/configure.h CONFIG_CLEAN_FILES = @@ -161,6 +170,8 @@ NROFF = nroff MANS = $(dist_man1_MANS) $(dist_man3_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(dist_man1_MANS) $(dist_man3_MANS) \ + $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -176,6 +187,12 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -190,12 +207,15 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -329,7 +349,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -592,6 +611,8 @@ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 uninstall-man3 +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/doc/man/man3/seccomp_arch_add.3 b/doc/man/man3/seccomp_arch_add.3 index 13d0dc3..f8f5a08 100644 --- a/doc/man/man3/seccomp_arch_add.3 +++ b/doc/man/man3/seccomp_arch_add.3 @@ -128,4 +128,4 @@ .\" ////////////////////////////////////////////////////////////////////////// .BR seccomp_init (3), .BR seccomp_reset (3), -.BR seccom_merge (3) +.BR seccomp_merge (3) diff --git a/doc/man/man3/seccomp_attr_set.3 b/doc/man/man3/seccomp_attr_set.3 index 806b223..4658ed3 100644 --- a/doc/man/man3/seccomp_attr_set.3 +++ b/doc/man/man3/seccomp_attr_set.3 @@ -76,6 +76,15 @@ error being returned. Defaults to off ( .I value == 0). +.TP +.B SCMP_FLTATR_ATL_TSKIP +A flag to specify if libseccomp should allow filter rules to be created for +the -1 syscall. The -1 syscall value can be used by tracer programs to skip +specific syscall invocations, see +.BR seccomp (2) +for more information. Defaults to off ( +.I value +== 0). .\" ////////////////////////////////////////////////////////////////////////// .SH RETURN VALUE .\" ////////////////////////////////////////////////////////////////////////// @@ -129,4 +138,5 @@ .\" ////////////////////////////////////////////////////////////////////////// .BR seccomp_init (3), .BR seccomp_reset (3), -.BR seccomp_load (3) +.BR seccomp_load (3), +.BR seccomp (2) diff --git a/doc/man/man3/seccomp_rule_add.3 b/doc/man/man3/seccomp_rule_add.3 index 876b517..70d7eaf 100644 --- a/doc/man/man3/seccomp_rule_add.3 +++ b/doc/man/man3/seccomp_rule_add.3 @@ -53,8 +53,8 @@ and .BR seccomp_rule_add_array () functions will make a "best effort" to add the rule as specified, but may alter -the rule slightly due to architecture specifics, e.g. socket and ipc functions -on x86. The +the rule slightly due to architecture specifics (e.g. internal rewriting of +multiplexed syscalls, like socket and ipc functions on x86). The .BR seccomp_rule_add_exact () and .BR seccomp_rule_add_exact_array () @@ -90,6 +90,14 @@ .BR SCMP_SYS () macro instead. See the EXAMPLES section below. .P +Starting with Linux v4.8, there may be a need to create a rule with a syscall +value of -1 to allow tracing programs to skip a syscall invocation; in order +to create a rule with a -1 syscall value it is necessary to first set the +.B SCMP_FLTATR_API_TSKIP +attribute. See +.BR seccomp_attr_set (3) +for more information. +.P The filter context .I ctx is the value returned by the call to @@ -100,18 +108,17 @@ values are as follows: .TP .B SCMP_ACT_KILL -The thread will be killed by the kernel when it calls a syscall that does not -match any of the configured seccomp filter rules. +The thread will be killed by the kernel when it calls a syscall that matches +the filter rule. .TP .B SCMP_ACT_TRAP -The thread will throw a SIGSYS signal when it calls a syscall that does not -match any of the configured seccomp filter rules. +The thread will throw a SIGSYS signal when it calls a syscall that matches the +filter rule. .TP .B SCMP_ACT_ERRNO(uint16_t errno) The thread will receive a return value of .I errno -when it calls a syscall that does not match any of the configured seccomp filter -rules. +when it calls a syscall that matches the filter rule. .TP .B SCMP_ACT_TRACE(uint16_t msg_num) If the thread is being traced and the tracing process specified the @@ -128,7 +135,7 @@ .TP .B SCMP_ACT_ALLOW The seccomp filter will have no effect on the thread calling the syscall if it -does not match any of the configured seccomp filter rules. +matches the filter rule. .P Valid comparison .I op @@ -291,5 +298,7 @@ .\" ////////////////////////////////////////////////////////////////////////// .SH SEE ALSO .\" ////////////////////////////////////////////////////////////////////////// +.BR seccomp_syscall_resolve_name_rewrite (3), .BR seccomp_syscall_priority (3), -.BR seccomp_load (3) +.BR seccomp_load (3), +.BR seccomp_attr_set (3) diff --git a/doc/man/man3/seccomp_syscall_resolve_name.3 b/doc/man/man3/seccomp_syscall_resolve_name.3 index 670fcd2..3c0f789 100644 --- a/doc/man/man3/seccomp_syscall_resolve_name.3 +++ b/doc/man/man3/seccomp_syscall_resolve_name.3 @@ -30,7 +30,12 @@ functions resolve the commonly used syscall name to the syscall number used by the kernel and the rest of the libseccomp API, with .BR seccomp_syscall_resolve_name_rewrite() -rewriting the syscall number for architectures that modify the syscall. The +rewriting the syscall number for architectures that modify the syscall. Syscall +rewriting typically happens in case of a multiplexed syscall, like +.BR socketcall (2) +or +.BR ipc (2) +on x86. .BR seccomp_syscall_resolve_num_arch() function resolves the syscall number used by the kernel to the commonly used syscall name. @@ -100,6 +105,15 @@ .SH NOTES .\" ////////////////////////////////////////////////////////////////////////// .P +In case of bare syscalls implemented on top of a multiplexed syscall, +.BR seccomp_syscall_resolve_name() +and +.BR seccomp_syscall_resolve_name_arch() +can be used to verify if a bare syscall is implemented for a specific +architecture, while +.BR seccomp_syscall_resolve_name_rewrite() +can be used to determine the underlying multiplexed syscall. +.P While the seccomp filter can be generated independent of the kernel, kernel support is required to load and enforce the seccomp filter generated by libseccomp. diff --git a/include/Makefile.in b/include/Makefile.in index 56efabb..91da9a5 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -33,7 +33,17 @@ # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -97,15 +107,15 @@ build_triplet = @build@ host_triplet = @host@ subdir = include -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/seccomp.h.in $(include_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ + $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/configure.h CONFIG_CLEAN_FILES = seccomp.h @@ -177,6 +187,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/seccomp.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -192,6 +203,12 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -206,12 +223,15 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -317,7 +337,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -566,6 +585,8 @@ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-includeHEADERS +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/include/seccomp.h b/include/seccomp.h index 0e27119..a089d15 100644 --- a/include/seccomp.h +++ b/include/seccomp.h @@ -37,7 +37,7 @@ #define SCMP_VER_MAJOR 2 #define SCMP_VER_MINOR 3 -#define SCMP_VER_MICRO 1 +#define SCMP_VER_MICRO 3 struct scmp_version { unsigned int major; @@ -63,6 +63,7 @@ SCMP_FLTATR_ACT_BADARCH = 2, /**< bad architecture action */ SCMP_FLTATR_CTL_NNP = 3, /**< set NO_NEW_PRIVS on filter load */ SCMP_FLTATR_CTL_TSYNC = 4, /**< sync threads on filter load */ + SCMP_FLTATR_API_TSKIP = 5, /**< allow rules with a -1 syscall */ _SCMP_FLTATR_MAX, }; @@ -1603,6 +1604,40 @@ #define __NR_userfaultfd __PNR_userfaultfd #endif /* __NR_userfaultfd */ +#define __PNR_pkey_mprotect -10201 +#ifndef __NR_pkey_mprotect +#define __NR_pkey_mprotect __PNR_pkey_mprotect +#endif /* __NR_pkey_mprotect */ + +#define __PNR_pkey_alloc -10202 +#ifndef __NR_pkey_alloc +#define __NR_pkey_alloc __PNR_pkey_alloc +#endif /* __NR_pkey_alloc */ + +#define __PNR_pkey_free -10203 +#ifndef __NR_pkey_free +#define __NR_pkey_free __PNR_pkey_free +#endif /* __NR_pkey_free */ + +#define __PNR_get_tls -10204 +#ifndef __NR_get_tls +#ifdef __ARM_NR_get_tls +#define __NR_get_tls __ARM_NR_get_tls +#else +#define __NR_get_tls __PNR_get_tls +#endif +#endif /* __NR_get_tls */ + +#define __PNR_s390_guarded_storage -10205 +#ifndef __NR_s390_guarded_storage +#define __NR_s390_guarded_storage __PNR_s390_guarded_storage +#endif /* __NR_s390_guarded_storage */ + +#define __PNR_s390_sthyi -10206 +#ifndef __NR_s390_sthyi +#define __NR_s390_sthyi __PNR_s390_sthyi +#endif /* __NR_s390_sthyi */ + #ifdef __cplusplus } #endif diff --git a/include/seccomp.h.in b/include/seccomp.h.in index 6bf6751..cc01a66 100644 --- a/include/seccomp.h.in +++ b/include/seccomp.h.in @@ -63,6 +63,7 @@ SCMP_FLTATR_ACT_BADARCH = 2, /**< bad architecture action */ SCMP_FLTATR_CTL_NNP = 3, /**< set NO_NEW_PRIVS on filter load */ SCMP_FLTATR_CTL_TSYNC = 4, /**< sync threads on filter load */ + SCMP_FLTATR_API_TSKIP = 5, /**< allow rules with a -1 syscall */ _SCMP_FLTATR_MAX, }; @@ -1603,6 +1604,40 @@ #define __NR_userfaultfd __PNR_userfaultfd #endif /* __NR_userfaultfd */ +#define __PNR_pkey_mprotect -10201 +#ifndef __NR_pkey_mprotect +#define __NR_pkey_mprotect __PNR_pkey_mprotect +#endif /* __NR_pkey_mprotect */ + +#define __PNR_pkey_alloc -10202 +#ifndef __NR_pkey_alloc +#define __NR_pkey_alloc __PNR_pkey_alloc +#endif /* __NR_pkey_alloc */ + +#define __PNR_pkey_free -10203 +#ifndef __NR_pkey_free +#define __NR_pkey_free __PNR_pkey_free +#endif /* __NR_pkey_free */ + +#define __PNR_get_tls -10204 +#ifndef __NR_get_tls +#ifdef __ARM_NR_get_tls +#define __NR_get_tls __ARM_NR_get_tls +#else +#define __NR_get_tls __PNR_get_tls +#endif +#endif /* __NR_get_tls */ + +#define __PNR_s390_guarded_storage -10205 +#ifndef __NR_s390_guarded_storage +#define __NR_s390_guarded_storage __PNR_s390_guarded_storage +#endif /* __NR_s390_guarded_storage */ + +#define __PNR_s390_sthyi -10206 +#ifndef __NR_s390_sthyi +#define __NR_s390_sthyi __PNR_s390_sthyi +#endif /* __NR_s390_sthyi */ + #ifdef __cplusplus } #endif diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4 new file mode 100644 index 0000000..a257469 --- /dev/null +++ b/m4/ax_code_coverage.m4 @@ -0,0 +1,264 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CODE_COVERAGE() +# +# DESCRIPTION +# +# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, +# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included +# in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every +# build target (program or library) which should be built with code +# coverage support. Also defines CODE_COVERAGE_RULES which should be +# substituted in your Makefile; and $enable_code_coverage which can be +# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined +# and substituted, and corresponds to the value of the +# --enable-code-coverage option, which defaults to being disabled. +# +# Test also for gcov program and create GCOV variable that could be +# substituted. +# +# Note that all optimisation flags in CFLAGS must be disabled when code +# coverage is enabled. +# +# Usage example: +# +# configure.ac: +# +# AX_CODE_COVERAGE +# +# Makefile.am: +# +# @CODE_COVERAGE_RULES@ +# my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ... +# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... +# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... +# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... +# +# This results in a "check-code-coverage" rule being added to any +# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module +# has been configured with --enable-code-coverage). Running `make +# check-code-coverage` in that directory will run the module's test suite +# (`make check`) and build a code coverage report detailing the code which +# was touched, then print the URI for the report. +# +# In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined +# instead of CODE_COVERAGE_LIBS. They are both still defined, but use of +# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is +# deprecated. They have the same value. +# +# This code was derived from Makefile.decl in GLib, originally licenced +# under LGPLv2.1+. +# +# LICENSE +# +# Copyright (c) 2012, 2016 Philip Withnall +# Copyright (c) 2012 Xan Lopez +# Copyright (c) 2012 Christian Persch +# Copyright (c) 2012 Paolo Borelli +# Copyright (c) 2012 Dan Winship +# Copyright (c) 2015 Bastien ROUCARIES +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or (at +# your option) any later version. +# +# This library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +#serial 20 + +AC_DEFUN([AX_CODE_COVERAGE],[ + dnl Check for --enable-code-coverage + AC_REQUIRE([AC_PROG_SED]) + + # allow to override gcov location + AC_ARG_WITH([gcov], + [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])], + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov], + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov]) + + AC_MSG_CHECKING([whether to build with code coverage support]) + AC_ARG_ENABLE([code-coverage], + AS_HELP_STRING([--enable-code-coverage], + [Whether to enable code coverage support]),, + enable_code_coverage=no) + + AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes]) + AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage]) + AC_MSG_RESULT($enable_code_coverage) + + AS_IF([ test "$enable_code_coverage" = "yes" ], [ + # check for gcov + AC_CHECK_TOOL([GCOV], + [$_AX_CODE_COVERAGE_GCOV_PROG_WITH], + [:]) + AS_IF([test "X$GCOV" = "X:"], + [AC_MSG_ERROR([gcov is needed to do coverage])]) + AC_SUBST([GCOV]) + + dnl Check if gcc is being used + AS_IF([ test "$GCC" = "no" ], [ + AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) + ]) + + AC_CHECK_PROG([LCOV], [lcov], [lcov]) + AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) + + AS_IF([ test -z "$LCOV" ], [ + AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed]) + ]) + + AS_IF([ test -z "$GENHTML" ], [ + AC_MSG_ERROR([Could not find genhtml from the lcov package]) + ]) + + dnl Build the code coverage flags + dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility + CODE_COVERAGE_CPPFLAGS="-DNDEBUG" + CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_LIBS="-lgcov" + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" + + AC_SUBST([CODE_COVERAGE_CPPFLAGS]) + AC_SUBST([CODE_COVERAGE_CFLAGS]) + AC_SUBST([CODE_COVERAGE_CXXFLAGS]) + AC_SUBST([CODE_COVERAGE_LIBS]) + AC_SUBST([CODE_COVERAGE_LDFLAGS]) + + [CODE_COVERAGE_RULES_CHECK=' + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture +'] + [CODE_COVERAGE_RULES_CAPTURE=' + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" +'] + [CODE_COVERAGE_RULES_CLEAN=' +clean: code-coverage-clean +distclean: code-coverage-clean +code-coverage-clean: + -$(LCOV) --directory $(top_builddir) -z + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete +'] + ], [ + [CODE_COVERAGE_RULES_CHECK=' + @echo "Need to reconfigure with --enable-code-coverage" +'] + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" + CODE_COVERAGE_RULES_CLEAN='' + ]) + +[CODE_COVERAGE_RULES=' +# Code coverage +# +# Optional: +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. +# Multiple directories may be specified, separated by whitespace. +# (Default: $(top_builddir)) +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated +# by lcov for code coverage. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage +# reports to be created. (Default: +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, +# set to 0 to disable it and leave empty to stay with the default. +# (Default: empty) +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov +# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov +# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the +# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov +# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering +# lcov instance. (Default: empty) +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov +# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the +# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml +# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore +# +# The generated report will be titled using the $(PACKAGE_NAME) and +# $(PACKAGE_VERSION). In order to add the current git hash to the title, +# use the git-version-gen script, available online. + +# Optional variables +CODE_COVERAGE_DIRECTORY ?= $(top_builddir) +CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info +CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage +CODE_COVERAGE_BRANCH_COVERAGE ?= +CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ +--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) +CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" +CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) +CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= +CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) +CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ +$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ +--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) +CODE_COVERAGE_IGNORE_PATTERN ?= + +code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) +code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ + $(CODE_COVERAGE_OUTPUT_FILE); +code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) +code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ + $(CODE_COVERAGE_IGNORE_PATTERN); +code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) +code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); +code_coverage_quiet = $(code_coverage_quiet_$(V)) +code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) +code_coverage_quiet_0 = --quiet + +# sanitizes the test-name: replaces with underscores: dashes and dots +code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) + +# Use recursive makes in order to ignore errors during check +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' + +# Capture code coverage data +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' + +# Hook rule executed before code-coverage-capture, overridable by the user +code-coverage-capture-hook: + +'"$CODE_COVERAGE_RULES_CLEAN"' + +GITIGNOREFILES ?= +GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) + +A''M_DISTCHECK_CONFIGURE_FLAGS ?= +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage + +.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean +'] + + AC_SUBST([CODE_COVERAGE_RULES]) + m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])]) +]) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index da4a4f6..597c604 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -1,6 +1,6 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2017 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -1042,8 +1042,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1493,9 +1493,22 @@ m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -2207,26 +2220,35 @@ striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2666,14 +2688,7 @@ *) objformat=elf ;; esac fi - # Handle Gentoo/FreeBSD as it was Linux - case $host_vendor in - gentoo) - version_type=linux ;; - *) - version_type=freebsd-$objformat ;; - esac - + version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' @@ -2684,12 +2699,6 @@ freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes - ;; - linux) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - need_lib_prefix=no - need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH @@ -4932,7 +4941,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -5169,6 +5178,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5386,7 +5396,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5874,6 +5884,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6743,6 +6754,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 index 94b0829..621bd18 100644 --- a/m4/ltoptions.m4 +++ b/m4/ltoptions.m4 @@ -1,6 +1,6 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2009, 2011-2017 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 index 48bc934..ab69a6b 100644 --- a/m4/ltsugar.m4 +++ b/m4/ltsugar.m4 @@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2017 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 index fa04b52..8250ea4 100644 --- a/m4/ltversion.m4 +++ b/m4/ltversion.m4 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2017 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4219 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.6.40-6ca5-dirty]) +m4_define([LT_PACKAGE_REVISION], [2.4.6.40]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.6.40-6ca5-dirty' +macro_revision='2.4.6.40' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 index c6b26f8..9919d4d 100644 --- a/m4/lt~obsolete.m4 +++ b/m4/lt~obsolete.m4 @@ -1,6 +1,6 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007, 2009, 2011-2017 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # diff --git a/src/Makefile.am b/src/Makefile.am index c2d805e..604d57d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,9 +53,11 @@ arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ALL} libseccomp_la_SOURCES = ${SOURCES_ALL} -libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} -I${top_builddir}/include -libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CFLAGS} -fPIC -DPIC -fvisibility=hidden -libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${LDFLAGS} \ +libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} ${CODE_COVERAGE_CPPFLAGS} \ + -I${top_builddir}/include +libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS} ${CFLAGS} \ + -fPIC -DPIC -fvisibility=hidden +libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${CODE_COVERAGE_LDFLAGS} ${LDFLAGS} \ -version-number ${VERSION_MAJOR}:${VERSION_MINOR}:${VERSION_MICRO} check-build: diff --git a/src/Makefile.in b/src/Makefile.in index 1fb7a20..a4e3008 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -33,7 +33,17 @@ # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -101,15 +111,14 @@ check_PROGRAMS = arch-syscall-check$(EXEEXT) \ arch-syscall-dump$(EXEEXT) subdir = src -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/configure.h CONFIG_CLEAN_FILES = @@ -298,6 +307,8 @@ fi; \ } DIST_SUBDIRS = . python +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -338,6 +349,12 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -352,12 +369,15 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -472,9 +492,13 @@ arch_syscall_dump_SOURCES = arch-syscall-dump.c ${SOURCES_ALL} arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ALL} libseccomp_la_SOURCES = ${SOURCES_ALL} -libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} -I${top_builddir}/include -libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CFLAGS} -fPIC -DPIC -fvisibility=hidden -libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${LDFLAGS} \ +libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} ${CODE_COVERAGE_CPPFLAGS} \ + -I${top_builddir}/include + +libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS} ${CFLAGS} \ + -fPIC -DPIC -fvisibility=hidden + +libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${CODE_COVERAGE_LDFLAGS} ${LDFLAGS} \ -version-number ${VERSION_MAJOR}:${VERSION_MINOR}:${VERSION_MICRO} all: all-recursive @@ -493,7 +517,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -1261,6 +1284,8 @@ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-libLTLIBRARIES +.PRECIOUS: Makefile + check-build: ${MAKE} ${AM_MAKEFLAGS} ${check_PROGRAMS} diff --git a/src/api.c b/src/api.c index 7d5b1ec..6dfee15 100644 --- a/src/api.c +++ b/src/api.c @@ -65,8 +65,11 @@ * syscall appears valid, negative values on failure. * */ -static int _syscall_valid(int syscall) -{ +static int _syscall_valid(const struct db_filter_col *col, int syscall) +{ + /* syscall -1 is used by tracers to skip the syscall */ + if (col->attr.api_tskip && syscall == -1) + return 0; if (syscall <= -1 && syscall >= -99) return -EINVAL; return 0; @@ -311,7 +314,7 @@ { struct db_filter_col *col = (struct db_filter_col *)ctx; - if (db_col_valid(col) || _syscall_valid(syscall)) + if (db_col_valid(col) || _syscall_valid(col, syscall)) return -EINVAL; return db_col_syscall_priority(col, syscall, priority); @@ -331,7 +334,7 @@ if (arg_cnt > 0 && arg_array == NULL) return -EINVAL; - if (db_col_valid(col) || _syscall_valid(syscall)) + if (db_col_valid(col) || _syscall_valid(col, syscall)) return -EINVAL; rc = db_action_valid(action); @@ -380,7 +383,7 @@ if (arg_cnt > 0 && arg_array == NULL) return -EINVAL; - if (db_col_valid(col) || _syscall_valid(syscall)) + if (db_col_valid(col) || _syscall_valid(col, syscall)) return -EINVAL; rc = db_action_valid(action); diff --git a/src/arch-aarch64-syscalls.c b/src/arch-aarch64-syscalls.c index 357f290..406df70 100644 --- a/src/arch-aarch64-syscalls.c +++ b/src/arch-aarch64-syscalls.c @@ -26,7 +26,7 @@ #include "arch.h" #include "arch-aarch64.h" -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", __PNR__newselect }, @@ -122,6 +122,7 @@ { "get_mempolicy", 236 }, { "get_robust_list", 100 }, { "get_thread_area", __PNR_get_thread_area }, + { "get_tls", __PNR_get_tls }, { "getcpu", 168 }, { "getcwd", 17 }, { "getdents", __PNR_getdents }, @@ -254,11 +255,15 @@ { "pipe", __PNR_pipe }, { "pipe2", 59 }, { "pivot_root", 41 }, + { "pkey_alloc", 289 }, + { "pkey_free", 290 }, + { "pkey_mprotect", 288 }, { "poll", __PNR_poll }, { "ppoll", 73 }, { "prctl", 167 }, { "pread64", 67 }, { "preadv", 69 }, + { "preadv2", 286 }, { "prlimit64", 261 }, { "process_vm_readv", 270 }, { "process_vm_writev", 271 }, @@ -269,6 +274,7 @@ { "putpmsg", __PNR_putpmsg }, { "pwrite64", 68 }, { "pwritev", 70 }, + { "pwritev2", 287 }, { "query_module", __PNR_query_module }, { "quotactl", 60 }, { "read", 63 }, @@ -299,9 +305,11 @@ { "rt_sigtimedwait", 137 }, { "rt_tgsigqueueinfo", 240 }, { "rtas", __PNR_rtas }, + { "s390_guarded_storage", __PNR_s390_guarded_storage }, { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, { "s390_runtime_instr", __PNR_s390_runtime_instr }, + { "s390_sthyi", __PNR_s390_sthyi }, { "sched_get_priority_max", 125 }, { "sched_get_priority_min", 126 }, { "sched_getaffinity", 123 }, @@ -387,6 +395,7 @@ { "stat64", __PNR_stat64 }, { "statfs", 43 }, { "statfs64", __PNR_statfs64 }, + { "statx", 291 }, { "stime", __PNR_stime }, { "stty", __PNR_stty }, { "subpage_prot", __PNR_subpage_prot }, @@ -502,15 +511,15 @@ /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *aarch64_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *aarch64_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return aarch64_syscall_table[spot].name; + return &aarch64_syscall_table[spot]; } diff --git a/src/arch-aarch64.h b/src/arch-aarch64.h index ddfb111..cde11cf 100644 --- a/src/arch-aarch64.h +++ b/src/arch-aarch64.h @@ -32,5 +32,6 @@ int aarch64_syscall_resolve_name(const char *name); const char *aarch64_syscall_resolve_num(int num); -const char *aarch64_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *aarch64_syscall_iterate(unsigned int spot); + #endif diff --git a/src/arch-arm-syscalls.c b/src/arch-arm-syscalls.c index d1349a1..e3fdc55 100644 --- a/src/arch-arm-syscalls.c +++ b/src/arch-arm-syscalls.c @@ -37,7 +37,7 @@ #define __SCMP_NR_BASE __SCMP_NR_OABI_SYSCALL_BASE #endif -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def arm_syscall_table[] = { \ /* NOTE: arm_sync_file_range() and sync_file_range2() share values */ { "_llseek", (__SCMP_NR_BASE + 140) }, @@ -134,6 +134,7 @@ { "get_mempolicy", (__SCMP_NR_BASE + 320) }, { "get_robust_list", (__SCMP_NR_BASE + 339) }, { "get_thread_area", __PNR_get_thread_area }, + { "get_tls", (__SCMP_NR_BASE + (__SCMP_ARM_NR_BASE + 6)) }, { "getcpu", (__SCMP_NR_BASE + 345) }, { "getcwd", (__SCMP_NR_BASE + 183) }, { "getdents", (__SCMP_NR_BASE + 141) }, @@ -266,11 +267,15 @@ { "pipe", (__SCMP_NR_BASE + 42) }, { "pipe2", (__SCMP_NR_BASE + 359) }, { "pivot_root", (__SCMP_NR_BASE + 218) }, + { "pkey_alloc", (__SCMP_NR_BASE + 395) }, + { "pkey_free", (__SCMP_NR_BASE + 396) }, + { "pkey_mprotect", (__SCMP_NR_BASE + 394) }, { "poll", (__SCMP_NR_BASE + 168) }, { "ppoll", (__SCMP_NR_BASE + 336) }, { "prctl", (__SCMP_NR_BASE + 172) }, { "pread64", (__SCMP_NR_BASE + 180) }, { "preadv", (__SCMP_NR_BASE + 361) }, + { "preadv2", (__SCMP_NR_BASE + 392) }, { "prlimit64", (__SCMP_NR_BASE + 369) }, { "process_vm_readv", (__SCMP_NR_BASE + 376) }, { "process_vm_writev", (__SCMP_NR_BASE + 377) }, @@ -281,6 +286,7 @@ { "putpmsg", __PNR_putpmsg }, { "pwrite64", (__SCMP_NR_BASE + 181) }, { "pwritev", (__SCMP_NR_BASE + 362) }, + { "pwritev2", (__SCMP_NR_BASE + 393) }, { "query_module", __PNR_query_module }, { "quotactl", (__SCMP_NR_BASE + 131) }, { "read", (__SCMP_NR_BASE + 3) }, @@ -311,9 +317,11 @@ { "rt_sigtimedwait", (__SCMP_NR_BASE + 177) }, { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 363) }, { "rtas", __PNR_rtas }, + { "s390_guarded_storage", __PNR_s390_guarded_storage }, { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, { "s390_runtime_instr", __PNR_s390_runtime_instr }, + { "s390_sthyi", __PNR_s390_sthyi }, { "sched_get_priority_max", (__SCMP_NR_BASE + 159) }, { "sched_get_priority_min", (__SCMP_NR_BASE + 160) }, { "sched_getaffinity", (__SCMP_NR_BASE + 242) }, @@ -399,6 +407,7 @@ { "stat64", (__SCMP_NR_BASE + 195) }, { "statfs", (__SCMP_NR_BASE + 99) }, { "statfs64", (__SCMP_NR_BASE + 266) }, + { "statx", (__SCMP_NR_BASE + 397) }, { "stime", __PNR_stime }, { "stty", __PNR_stty }, { "subpage_prot", __PNR_subpage_prot }, @@ -513,15 +522,15 @@ } /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *arm_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *arm_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return arm_syscall_table[spot].name; + return &arm_syscall_table[spot]; } diff --git a/src/arch-arm.h b/src/arch-arm.h index 22466e6..9f675d8 100644 --- a/src/arch-arm.h +++ b/src/arch-arm.h @@ -32,6 +32,6 @@ int arm_syscall_resolve_name(const char *name); const char *arm_syscall_resolve_num(int num); -const char *arm_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *arm_syscall_iterate(unsigned int spot); #endif diff --git a/src/arch-mips-syscalls.c b/src/arch-mips-syscalls.c index 2cd86cd..2dee53f 100644 --- a/src/arch-mips-syscalls.c +++ b/src/arch-mips-syscalls.c @@ -30,7 +30,7 @@ /* O32 ABI */ #define __SCMP_NR_BASE 4000 -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def mips_syscall_table[] = { \ { "_llseek", (__SCMP_NR_BASE + 140) }, { "_newselect", (__SCMP_NR_BASE + 142) }, @@ -126,6 +126,7 @@ { "get_mempolicy", (__SCMP_NR_BASE + 269) }, { "get_robust_list", (__SCMP_NR_BASE + 310) }, { "get_thread_area", __PNR_get_thread_area }, + { "get_tls", __PNR_get_tls }, { "getcpu", (__SCMP_NR_BASE + 312) }, { "getcwd", (__SCMP_NR_BASE + 203) }, { "getdents", (__SCMP_NR_BASE + 141) }, @@ -258,11 +259,15 @@ { "pipe", (__SCMP_NR_BASE + 42) }, { "pipe2", (__SCMP_NR_BASE + 328) }, { "pivot_root", (__SCMP_NR_BASE + 216) }, + { "pkey_alloc", (__SCMP_NR_BASE + 364) }, + { "pkey_free", (__SCMP_NR_BASE + 365) }, + { "pkey_mprotect", (__SCMP_NR_BASE + 363) }, { "poll", (__SCMP_NR_BASE + 188) }, { "ppoll", (__SCMP_NR_BASE + 302) }, { "prctl", (__SCMP_NR_BASE + 192) }, { "pread64", (__SCMP_NR_BASE + 200) }, { "preadv", (__SCMP_NR_BASE + 330) }, + { "preadv2", (__SCMP_NR_BASE + 361) }, { "prlimit64", (__SCMP_NR_BASE + 338) }, { "process_vm_readv", (__SCMP_NR_BASE + 345) }, { "process_vm_writev", (__SCMP_NR_BASE + 346) }, @@ -273,6 +278,7 @@ { "putpmsg", (__SCMP_NR_BASE + 209) }, { "pwrite64", (__SCMP_NR_BASE + 201) }, { "pwritev", (__SCMP_NR_BASE + 331) }, + { "pwritev2", (__SCMP_NR_BASE + 362) }, { "query_module", (__SCMP_NR_BASE + 187) }, { "quotactl", (__SCMP_NR_BASE + 131) }, { "read", (__SCMP_NR_BASE + 3) }, @@ -303,9 +309,11 @@ { "rt_sigtimedwait", (__SCMP_NR_BASE + 197) }, { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 332) }, { "rtas", __PNR_rtas }, + { "s390_guarded_storage", __PNR_s390_guarded_storage }, { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, { "s390_runtime_instr", __PNR_s390_runtime_instr }, + { "s390_sthyi", __PNR_s390_sthyi }, { "sched_get_priority_max", (__SCMP_NR_BASE + 163) }, { "sched_get_priority_min", (__SCMP_NR_BASE + 164) }, { "sched_getaffinity", (__SCMP_NR_BASE + 240) }, @@ -391,6 +399,7 @@ { "stat64", (__SCMP_NR_BASE + 213) }, { "statfs", (__SCMP_NR_BASE + 99) }, { "statfs64", (__SCMP_NR_BASE + 255) }, + { "statx", (__SCMP_NR_BASE + 366) }, { "stime", (__SCMP_NR_BASE + 25) }, { "stty", (__SCMP_NR_BASE + 31) }, { "subpage_prot", __PNR_subpage_prot }, @@ -505,15 +514,15 @@ } /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *mips_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *mips_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return mips_syscall_table[spot].name; + return &mips_syscall_table[spot]; } diff --git a/src/arch-mips.h b/src/arch-mips.h index cce1a17..51f86ce 100644 --- a/src/arch-mips.h +++ b/src/arch-mips.h @@ -34,6 +34,6 @@ int mips_syscall_resolve_name(const char *name); const char *mips_syscall_resolve_num(int num); -const char *mips_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *mips_syscall_iterate(unsigned int spot); #endif diff --git a/src/arch-mips64-syscalls.c b/src/arch-mips64-syscalls.c index 80db447..97c6874 100644 --- a/src/arch-mips64-syscalls.c +++ b/src/arch-mips64-syscalls.c @@ -30,7 +30,7 @@ /* 64 ABI */ #define __SCMP_NR_BASE 5000 -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def mips64_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", (__SCMP_NR_BASE + 22) }, @@ -126,6 +126,7 @@ { "get_mempolicy", (__SCMP_NR_BASE + 228) }, { "get_robust_list", (__SCMP_NR_BASE + 269) }, { "get_thread_area", __PNR_get_thread_area }, + { "get_tls", __PNR_get_tls }, { "getcpu", (__SCMP_NR_BASE + 271) }, { "getcwd", (__SCMP_NR_BASE + 77) }, { "getdents", (__SCMP_NR_BASE + 76) }, @@ -258,11 +259,15 @@ { "pipe", (__SCMP_NR_BASE + 21) }, { "pipe2", (__SCMP_NR_BASE + 287) }, { "pivot_root", (__SCMP_NR_BASE + 151) }, + { "pkey_alloc", (__SCMP_NR_BASE + 324) }, + { "pkey_free", (__SCMP_NR_BASE + 325) }, + { "pkey_mprotect", (__SCMP_NR_BASE + 323) }, { "poll", (__SCMP_NR_BASE + 7) }, { "ppoll", (__SCMP_NR_BASE + 261) }, { "prctl", (__SCMP_NR_BASE + 153) }, { "pread64", (__SCMP_NR_BASE + 16) }, { "preadv", (__SCMP_NR_BASE + 289) }, + { "preadv2", (__SCMP_NR_BASE + 321) }, { "prlimit64", (__SCMP_NR_BASE + 297) }, { "process_vm_readv", (__SCMP_NR_BASE + 304) }, { "process_vm_writev", (__SCMP_NR_BASE + 305) }, @@ -273,6 +278,7 @@ { "putpmsg", (__SCMP_NR_BASE + 175) }, { "pwrite64", (__SCMP_NR_BASE + 17) }, { "pwritev", (__SCMP_NR_BASE + 290) }, + { "pwritev2", (__SCMP_NR_BASE + 322) }, { "query_module", (__SCMP_NR_BASE + 171) }, { "quotactl", (__SCMP_NR_BASE + 172) }, { "read", (__SCMP_NR_BASE + 0) }, @@ -303,9 +309,11 @@ { "rt_sigtimedwait", (__SCMP_NR_BASE + 126) }, { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 291) }, { "rtas", __PNR_rtas }, + { "s390_guarded_storage", __PNR_s390_guarded_storage }, { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, { "s390_runtime_instr", __PNR_s390_runtime_instr }, + { "s390_sthyi", __PNR_s390_sthyi }, { "sched_get_priority_max", (__SCMP_NR_BASE + 143) }, { "sched_get_priority_min", (__SCMP_NR_BASE + 144) }, { "sched_getaffinity", (__SCMP_NR_BASE + 196) }, @@ -391,6 +399,7 @@ { "stat64", __PNR_stat64 }, { "statfs", (__SCMP_NR_BASE + 134) }, { "statfs64", __PNR_statfs64 }, + { "statx", (__SCMP_NR_BASE + 326) }, { "stime", __PNR_stime }, { "stty", __PNR_stty }, { "subpage_prot", __PNR_subpage_prot }, @@ -505,15 +514,15 @@ } /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *mips64_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *mips64_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return mips64_syscall_table[spot].name; + return &mips64_syscall_table[spot]; } diff --git a/src/arch-mips64.h b/src/arch-mips64.h index 47a6a5a..7f231ce 100644 --- a/src/arch-mips64.h +++ b/src/arch-mips64.h @@ -34,6 +34,6 @@ int mips64_syscall_resolve_name(const char *name); const char *mips64_syscall_resolve_num(int num); -const char *mips64_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *mips64_syscall_iterate(unsigned int spot); #endifdiff --git a/src/arch-mips64n32-syscalls.c b/src/arch-mips64n32-syscalls.c index 5cf03d2..a22d643 100644 --- a/src/arch-mips64n32-syscalls.c +++ b/src/arch-mips64n32-syscalls.c @@ -30,7 +30,7 @@ /* N32 ABI */ #define __SCMP_NR_BASE 6000 -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", (__SCMP_NR_BASE + 22) }, @@ -126,6 +126,7 @@ { "get_mempolicy", (__SCMP_NR_BASE + 232) }, { "get_robust_list", (__SCMP_NR_BASE + 273) }, { "get_thread_area", __PNR_get_thread_area }, + { "get_tls", __PNR_get_tls }, { "getcpu", (__SCMP_NR_BASE + 275) }, { "getcwd", (__SCMP_NR_BASE + 77) }, { "getdents", (__SCMP_NR_BASE + 76) }, @@ -258,11 +259,15 @@ { "pipe", (__SCMP_NR_BASE + 21) }, { "pipe2", (__SCMP_NR_BASE + 291) }, { "pivot_root", (__SCMP_NR_BASE + 151) }, + { "pkey_alloc", (__SCMP_NR_BASE + 328) }, + { "pkey_free", (__SCMP_NR_BASE + 329) }, + { "pkey_mprotect", (__SCMP_NR_BASE + 327) }, { "poll", (__SCMP_NR_BASE + 7) }, { "ppoll", (__SCMP_NR_BASE + 265) }, { "prctl", (__SCMP_NR_BASE + 153) }, { "pread64", (__SCMP_NR_BASE + 16) }, { "preadv", (__SCMP_NR_BASE + 293) }, + { "preadv2", (__SCMP_NR_BASE + 325) }, { "prlimit64", (__SCMP_NR_BASE + 302) }, { "process_vm_readv", (__SCMP_NR_BASE + 309) }, { "process_vm_writev", (__SCMP_NR_BASE + 310) }, @@ -273,6 +278,7 @@ { "putpmsg", (__SCMP_NR_BASE + 175) }, { "pwrite64", (__SCMP_NR_BASE + 17) }, { "pwritev", (__SCMP_NR_BASE + 294) }, + { "pwritev2", (__SCMP_NR_BASE + 326) }, { "query_module", (__SCMP_NR_BASE + 171) }, { "quotactl", (__SCMP_NR_BASE + 172) }, { "read", (__SCMP_NR_BASE + 0) }, @@ -303,9 +309,11 @@ { "rt_sigtimedwait", (__SCMP_NR_BASE + 126) }, { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 295) }, { "rtas", __PNR_rtas }, + { "s390_guarded_storage", __PNR_s390_guarded_storage }, { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, { "s390_runtime_instr", __PNR_s390_runtime_instr }, + { "s390_sthyi", __PNR_s390_sthyi }, { "sched_get_priority_max", (__SCMP_NR_BASE + 143) }, { "sched_get_priority_min", (__SCMP_NR_BASE + 144) }, { "sched_getaffinity", (__SCMP_NR_BASE + 196) }, @@ -391,6 +399,7 @@ { "stat64", __PNR_stat64 }, { "statfs", (__SCMP_NR_BASE + 134) }, { "statfs64", (__SCMP_NR_BASE + 217) }, + { "statx", (__SCMP_NR_BASE + 330) }, { "stime", __PNR_stime }, { "stty", __PNR_stty }, { "subpage_prot", __PNR_subpage_prot }, @@ -505,15 +514,15 @@ } /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *mips64n32_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *mips64n32_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return mips64n32_syscall_table[spot].name; + return &mips64n32_syscall_table[spot]; } diff --git a/src/arch-mips64n32.h b/src/arch-mips64n32.h index db676cf..fd7e542 100644 --- a/src/arch-mips64n32.h +++ b/src/arch-mips64n32.h @@ -34,6 +34,6 @@ int mips64n32_syscall_resolve_name(const char *name); const char *mips64n32_syscall_resolve_num(int num); -const char *mips64n32_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *mips64n32_syscall_iterate(unsigned int spot); #endif diff --git a/src/arch-ppc-syscalls.c b/src/arch-ppc-syscalls.c index 2bd8a36..7ff7fca 100644 --- a/src/arch-ppc-syscalls.c +++ b/src/arch-ppc-syscalls.c @@ -27,7 +27,7 @@ #include "arch.h" #include "arch-ppc.h" -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def ppc_syscall_table[] = { \ { "_llseek", 140 }, { "_newselect", 142 }, @@ -123,6 +123,7 @@ { "get_mempolicy", 260 }, { "get_robust_list", 299 }, { "get_thread_area", __PNR_get_thread_area }, + { "get_tls", __PNR_get_tls }, { "getcpu", 302 }, { "getcwd", 182 }, { "getdents", 141 }, @@ -177,7 +178,7 @@ { "ioprio_set", 273 }, { "ipc", 117 }, { "kcmp", 354 }, - { "kexec_file_load", __PNR_kexec_file_load }, + { "kexec_file_load", 382 }, { "kexec_load", 268 }, { "keyctl", 271 }, { "kill", 37 }, @@ -255,11 +256,15 @@ { "pipe", 42 }, { "pipe2", 317 }, { "pivot_root", 203 }, + { "pkey_alloc", __PNR_pkey_alloc }, + { "pkey_free", __PNR_pkey_free }, + { "pkey_mprotect", __PNR_pkey_mprotect }, { "poll", 167 }, { "ppoll", 281 }, { "prctl", 171 }, { "pread64", 179 }, { "preadv", 320 }, + { "preadv2", 380 }, { "prlimit64", 325 }, { "process_vm_readv", 351 }, { "process_vm_writev", 352 }, @@ -270,6 +275,7 @@ { "putpmsg", 188 }, { "pwrite64", 180 }, { "pwritev", 321 }, + { "pwritev2", 381 }, { "query_module", 166 }, { "quotactl", 131 }, { "read", 3 }, @@ -300,9 +306,11 @@ { "rt_sigtimedwait", 176 }, { "rt_tgsigqueueinfo", 322 }, { "rtas", 255 }, + { "s390_guarded_storage", __PNR_s390_guarded_storage }, { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, { "s390_runtime_instr", __PNR_s390_runtime_instr }, + { "s390_sthyi", __PNR_s390_sthyi }, { "sched_get_priority_max", 159 }, { "sched_get_priority_min", 160 }, { "sched_getaffinity", 223 }, @@ -388,6 +396,7 @@ { "stat64", 195 }, { "statfs", 99 }, { "statfs64", 252 }, + { "statx", 383}, { "stime", 25 }, { "stty", 31 }, { "subpage_prot", 310 }, @@ -502,15 +511,15 @@ } /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *ppc_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *ppc_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return ppc_syscall_table[spot].name; + return &ppc_syscall_table[spot]; } diff --git a/src/arch-ppc.h b/src/arch-ppc.h index 627a168..0b5ffa5 100644 --- a/src/arch-ppc.h +++ b/src/arch-ppc.h @@ -33,6 +33,6 @@ int ppc_syscall_resolve_name(const char *name); const char *ppc_syscall_resolve_num(int num); -const char *ppc_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *ppc_syscall_iterate(unsigned int spot); #endif diff --git a/src/arch-ppc64-syscalls.c b/src/arch-ppc64-syscalls.c index 73621a1..ee094bc 100644 --- a/src/arch-ppc64-syscalls.c +++ b/src/arch-ppc64-syscalls.c @@ -27,7 +27,7 @@ #include "arch.h" #include "arch-ppc64.h" -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "_llseek", 140 }, { "_newselect", 142 }, @@ -123,6 +123,7 @@ { "get_mempolicy", 260 }, { "get_robust_list", 299 }, { "get_thread_area", __PNR_get_thread_area }, + { "get_tls", __PNR_get_tls }, { "getcpu", 302 }, { "getcwd", 182 }, { "getdents", 141 }, @@ -177,7 +178,7 @@ { "ioprio_set", 273 }, { "ipc", 117 }, { "kcmp", 354 }, - { "kexec_file_load", __PNR_kexec_file_load }, + { "kexec_file_load", 382 }, { "kexec_load", 268 }, { "keyctl", 271 }, { "kill", 37 }, @@ -255,11 +256,15 @@ { "pipe", 42 }, { "pipe2", 317 }, { "pivot_root", 203 }, + { "pkey_alloc", __PNR_pkey_alloc }, + { "pkey_free", __PNR_pkey_free }, + { "pkey_mprotect", __PNR_pkey_mprotect }, { "poll", 167 }, { "ppoll", 281 }, { "prctl", 171 }, { "pread64", 179 }, { "preadv", 320 }, + { "preadv2", 380 }, { "prlimit64", 325 }, { "process_vm_readv", 351 }, { "process_vm_writev", 352 }, @@ -270,6 +275,7 @@ { "putpmsg", 188 }, { "pwrite64", 180 }, { "pwritev", 321 }, + { "pwritev2", 381 }, { "query_module", 166 }, { "quotactl", 131 }, { "read", 3 }, @@ -300,9 +306,11 @@ { "rt_sigtimedwait", 176 }, { "rt_tgsigqueueinfo", 322 }, { "rtas", 255 }, + { "s390_guarded_storage", __PNR_s390_guarded_storage }, { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, { "s390_runtime_instr", __PNR_s390_runtime_instr }, + { "s390_sthyi", __PNR_s390_sthyi }, { "sched_get_priority_max", 159 }, { "sched_get_priority_min", 160 }, { "sched_getaffinity", 223 }, @@ -388,6 +396,7 @@ { "stat64", __PNR_stat64 }, { "statfs", 99 }, { "statfs64", 252 }, + { "statx", 383}, { "stime", 25 }, { "stty", 31 }, { "subpage_prot", 310 }, @@ -502,15 +511,15 @@ } /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *ppc64_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *ppc64_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return ppc64_syscall_table[spot].name; + return &ppc64_syscall_table[spot]; } diff --git a/src/arch-ppc64.h b/src/arch-ppc64.h index 60efb17..beb24f7 100644 --- a/src/arch-ppc64.h +++ b/src/arch-ppc64.h @@ -34,6 +34,6 @@ int ppc64_syscall_resolve_name(const char *name); const char *ppc64_syscall_resolve_num(int num); -const char *ppc64_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *ppc64_syscall_iterate(unsigned int spot); #endif diff --git a/src/arch-s390-syscalls.c b/src/arch-s390-syscalls.c index a04673a..6024eaf 100644 --- a/src/arch-s390-syscalls.c +++ b/src/arch-s390-syscalls.c @@ -10,7 +10,7 @@ #include "arch.h" #include "arch-s390.h" -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def s390_syscall_table[] = { \ { "_llseek", 140 }, { "_newselect", 142 }, @@ -106,6 +106,7 @@ { "get_mempolicy", 269 }, { "get_robust_list", 305 }, { "get_thread_area", __PNR_get_thread_area }, + { "get_tls", __PNR_get_tls }, { "getcpu", 311 }, { "getcwd", 183 }, { "getdents", 141 }, @@ -238,11 +239,15 @@ { "pipe", 42 }, { "pipe2", 325 }, { "pivot_root", 217 }, + { "pkey_alloc", __PNR_pkey_alloc }, + { "pkey_free", __PNR_pkey_free }, + { "pkey_mprotect", __PNR_pkey_mprotect }, { "poll", 168 }, { "ppoll", 302 }, { "prctl", 172 }, { "pread64", 180 }, { "preadv", 328 }, + { "preadv2", 376 }, { "prlimit64", 334 }, { "process_vm_readv", 340 }, { "process_vm_writev", 341 }, @@ -253,6 +258,7 @@ { "putpmsg", 189 }, { "pwrite64", 181 }, { "pwritev", 329 }, + { "pwritev2", 377 }, { "query_module", 167 }, { "quotactl", 131 }, { "read", 3 }, @@ -283,9 +289,11 @@ { "rt_sigtimedwait", 177 }, { "rt_tgsigqueueinfo", 330 }, { "rtas", __PNR_rtas }, + { "s390_guarded_storage", 378 }, { "s390_pci_mmio_read", 353 }, { "s390_pci_mmio_write", 352 }, { "s390_runtime_instr", 342 }, + { "s390_sthyi", 380 }, { "sched_get_priority_max", 159 }, { "sched_get_priority_min", 160 }, { "sched_getaffinity", 240 }, @@ -371,6 +379,7 @@ { "stat64", 195 }, { "statfs", 99 }, { "statfs64", 265 }, + { "statx", 379 }, { "stime", 25 }, { "stty", __PNR_stty }, { "subpage_prot", __PNR_subpage_prot }, @@ -567,16 +576,17 @@ return NULL; } + /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *s390_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *s390_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return s390_syscall_table[spot].name; + return &s390_syscall_table[spot]; } diff --git a/src/arch-s390.c b/src/arch-s390.c index 2e79670..0d83e97 100644 --- a/src/arch-s390.c +++ b/src/arch-s390.c @@ -209,7 +209,6 @@ { int rc; unsigned int iter; - size_t args_size; int sys = rule->syscall; int sys_a, sys_b; struct db_api_rule_list *rule_a, *rule_b; @@ -219,7 +218,7 @@ (359 to 373) : direct socket syscalls, Linux 4.3+ */ /* strict check for the multiplexed socket syscalls */ - for (iter = 0; iter < rule->args_cnt; iter++) { + for (iter = 0; iter < ARG_COUNT_MAX; iter++) { if ((rule->args[iter].valid != 0) && (strict)) return -EINVAL; } @@ -249,19 +248,9 @@ } else { /* need two rules, dup the first and link together */ rule_a = rule; - rule_b = malloc(sizeof(*rule_b)); + rule_b = db_rule_dup(rule_a); if (rule_b == NULL) return -ENOMEM; - args_size = sizeof(*rule_b->args) * rule_a->args_cnt; - rule_b->args = malloc(args_size); - if (rule_b->args == NULL) { - free(rule_b); - return -ENOMEM; - } - rule_b->action = rule_a->action; - rule_b->syscall = rule_a->syscall; - rule_b->args_cnt = rule_a->args_cnt; - memcpy(rule_b->args, rule_a->args, args_size); rule_b->prev = rule_a; rule_b->next = NULL; rule_a->next = rule_b; diff --git a/src/arch-s390.h b/src/arch-s390.h index 899c952..3d41f5f 100644 --- a/src/arch-s390.h +++ b/src/arch-s390.h @@ -20,7 +20,7 @@ int s390_syscall_resolve_name(const char *name); const char *s390_syscall_resolve_num(int num); -const char *s390_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *s390_syscall_iterate(unsigned int spot); int s390_syscall_rewrite(int *syscall); diff --git a/src/arch-s390x-syscalls.c b/src/arch-s390x-syscalls.c index 9825c63..74d1e57 100644 --- a/src/arch-s390x-syscalls.c +++ b/src/arch-s390x-syscalls.c @@ -10,7 +10,7 @@ #include "arch.h" #include "arch-s390x.h" -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def s390x_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", __PNR__newselect }, @@ -106,6 +106,7 @@ { "get_mempolicy", 269 }, { "get_robust_list", 305 }, { "get_thread_area", __PNR_get_thread_area }, + { "get_tls", __PNR_get_tls }, { "getcpu", 311 }, { "getcwd", 183 }, { "getdents", 141 }, @@ -238,11 +239,15 @@ { "pipe", 42 }, { "pipe2", 325 }, { "pivot_root", 217 }, + { "pkey_alloc", __PNR_pkey_alloc }, + { "pkey_free", __PNR_pkey_free }, + { "pkey_mprotect", __PNR_pkey_mprotect }, { "poll", 168 }, { "ppoll", 302 }, { "prctl", 172 }, { "pread64", 180 }, { "preadv", 328 }, + { "preadv2", 376 }, { "prlimit64", 334 }, { "process_vm_readv", 340 }, { "process_vm_writev", 341 }, @@ -253,6 +258,7 @@ { "putpmsg", 189 }, { "pwrite64", 181 }, { "pwritev", 329 }, + { "pwritev2", 377 }, { "query_module", 167 }, { "quotactl", 131 }, { "read", 3 }, @@ -283,9 +289,11 @@ { "rt_sigtimedwait", 177 }, { "rt_tgsigqueueinfo", 330 }, { "rtas", __PNR_rtas }, + { "s390_guarded_storage", 378 }, { "s390_pci_mmio_read", 353 }, { "s390_pci_mmio_write", 352 }, { "s390_runtime_instr", 342 }, + { "s390_sthyi", 380 }, { "sched_get_priority_max", 159 }, { "sched_get_priority_min", 160 }, { "sched_getaffinity", 240 }, @@ -371,6 +379,7 @@ { "stat64", __PNR_stat64 }, { "statfs", 99 }, { "statfs64", 265 }, + { "statx", 379 }, { "stime", __PNR_stime }, { "stty", __PNR_stty }, { "subpage_prot", __PNR_subpage_prot }, @@ -569,15 +578,15 @@ } /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *s390x_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *s390x_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return s390x_syscall_table[spot].name; + return &s390x_syscall_table[spot]; } diff --git a/src/arch-s390x.c b/src/arch-s390x.c index 4de1a1b..fcfd5e5 100644 --- a/src/arch-s390x.c +++ b/src/arch-s390x.c @@ -209,7 +209,6 @@ { int rc; unsigned int iter; - size_t args_size; int sys = rule->syscall; int sys_a, sys_b; struct db_api_rule_list *rule_a, *rule_b; @@ -219,7 +218,7 @@ (359 to 373) : direct socket syscalls, Linux 4.3+ */ /* strict check for the multiplexed socket syscalls */ - for (iter = 0; iter < rule->args_cnt; iter++) { + for (iter = 0; iter < ARG_COUNT_MAX; iter++) { if ((rule->args[iter].valid != 0) && (strict)) return -EINVAL; } @@ -249,19 +248,9 @@ } else { /* need two rules, dup the first and link together */ rule_a = rule; - rule_b = malloc(sizeof(*rule_b)); + rule_b = db_rule_dup(rule_a); if (rule_b == NULL) return -ENOMEM; - args_size = sizeof(*rule_b->args) * rule_a->args_cnt; - rule_b->args = malloc(args_size); - if (rule_b->args == NULL) { - free(rule_b); - return -ENOMEM; - } - rule_b->action = rule_a->action; - rule_b->syscall = rule_a->syscall; - rule_b->args_cnt = rule_a->args_cnt; - memcpy(rule_b->args, rule_a->args, args_size); rule_b->prev = rule_a; rule_b->next = NULL; rule_a->next = rule_b; diff --git a/src/arch-s390x.h b/src/arch-s390x.h index 2857d7f..37bed67 100644 --- a/src/arch-s390x.h +++ b/src/arch-s390x.h @@ -23,7 +23,7 @@ int s390x_syscall_resolve_name(const char *name); const char *s390x_syscall_resolve_num(int num); -const char *s390x_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *s390x_syscall_iterate(unsigned int spot); int s390x_syscall_rewrite(int *syscall); diff --git a/src/arch-syscall-check.c b/src/arch-syscall-check.c index 71ec0b5..87d7f5c 100644 --- a/src/arch-syscall-check.c +++ b/src/arch-syscall-check.c @@ -49,9 +49,9 @@ * */ void syscall_check(char *str_miss, const char *syscall, - const char *arch_name, const char *arch_sys) + const char *arch_name, const struct arch_syscall_def *sys) { - if (strcmp(syscall, arch_sys)) { + if (strcmp(syscall, sys->name)) { if (str_miss[0] != '\0') strcat(str_miss, ","); strcat(str_miss, arch_name); @@ -75,40 +75,42 @@ int i_ppc64 = 0; int i_s390 = 0; int i_s390x = 0; + char str_miss[256]; const char *sys_name; - char str_miss[256]; + const struct arch_syscall_def *sys; do { str_miss[0] = '\0'; - sys_name = x86_syscall_iterate_name(i_x86); - if (sys_name == NULL) { + sys = x86_syscall_iterate(i_x86); + if (sys == NULL || sys->name == NULL) { printf("FAULT\n"); return 1; } + sys_name = sys->name; /* check each arch using x86 as the reference */ syscall_check(str_miss, sys_name, "x86_64", - x86_64_syscall_iterate_name(i_x86_64)); + x86_64_syscall_iterate(i_x86_64)); syscall_check(str_miss, sys_name, "x32", - x32_syscall_iterate_name(i_x32)); + x32_syscall_iterate(i_x32)); syscall_check(str_miss, sys_name, "arm", - arm_syscall_iterate_name(i_arm)); + arm_syscall_iterate(i_arm)); syscall_check(str_miss, sys_name, "aarch64", - aarch64_syscall_iterate_name(i_aarch64)); + aarch64_syscall_iterate(i_aarch64)); syscall_check(str_miss, sys_name, "mips", - mips_syscall_iterate_name(i_mips)); + mips_syscall_iterate(i_mips)); syscall_check(str_miss, sys_name, "mips64", - mips64_syscall_iterate_name(i_mips64)); + mips64_syscall_iterate(i_mips64)); syscall_check(str_miss, sys_name, "mips64n32", - mips64n32_syscall_iterate_name(i_mips64n32)); + mips64n32_syscall_iterate(i_mips64n32)); syscall_check(str_miss, sys_name, "ppc", - ppc_syscall_iterate_name(i_ppc)); + ppc_syscall_iterate(i_ppc)); syscall_check(str_miss, sys_name, "ppc64", - ppc64_syscall_iterate_name(i_ppc64)); + ppc64_syscall_iterate(i_ppc64)); syscall_check(str_miss, sys_name, "s390", - s390_syscall_iterate_name(i_s390)); + s390_syscall_iterate(i_s390)); syscall_check(str_miss, sys_name, "s390x", - s390x_syscall_iterate_name(i_s390x)); + s390x_syscall_iterate(i_s390x)); /* output the results */ printf("%s: ", sys_name); @@ -119,29 +121,29 @@ printf("OK\n"); /* next */ - if (x86_syscall_iterate_name(i_x86 + 1)) + if (x86_syscall_iterate(i_x86 + 1)->name) i_x86++; - if (!x86_64_syscall_iterate_name(++i_x86_64)) + if (!x86_64_syscall_iterate(++i_x86_64)->name) i_x86_64 = -1; - if (!x32_syscall_iterate_name(++i_x32)) + if (!x32_syscall_iterate(++i_x32)->name) i_x32 = -1; - if (!arm_syscall_iterate_name(++i_arm)) + if (!arm_syscall_iterate(++i_arm)->name) i_arm = -1; - if (!aarch64_syscall_iterate_name(++i_aarch64)) + if (!aarch64_syscall_iterate(++i_aarch64)->name) i_aarch64 = -1; - if (!mips_syscall_iterate_name(++i_mips)) + if (!mips_syscall_iterate(++i_mips)->name) i_mips = -1; - if (!mips64_syscall_iterate_name(++i_mips64)) + if (!mips64_syscall_iterate(++i_mips64)->name) i_mips64 = -1; - if (!mips64n32_syscall_iterate_name(++i_mips64n32)) + if (!mips64n32_syscall_iterate(++i_mips64n32)->name) i_mips64n32 = -1; - if (!ppc_syscall_iterate_name(++i_ppc)) + if (!ppc_syscall_iterate(++i_ppc)->name) i_ppc = -1; - if (!ppc64_syscall_iterate_name(++i_ppc64)) + if (!ppc64_syscall_iterate(++i_ppc64)->name) i_ppc64 = -1; - if (!s390_syscall_iterate_name(++i_s390)) + if (!s390_syscall_iterate(++i_s390)->name) i_s390 = -1; - if (!s390x_syscall_iterate_name(++i_s390x)) + if (!s390x_syscall_iterate(++i_s390x)->name) i_s390x = -1; } while (i_x86_64 >= 0 && i_x32 >= 0 && i_arm >= 0 && i_aarch64 >= 0 && @@ -150,63 +152,53 @@ i_s390 >= 0 && i_s390x >= 0); /* check for any leftovers */ - sys_name = x86_syscall_iterate_name(i_x86 + 1); - if (sys_name) { - printf("%s: ERROR, x86 has additional syscalls\n", sys_name); + sys = x86_syscall_iterate(i_x86 + 1); + if (sys->name) { + printf("ERROR, x86 has additional syscalls\n"); return 1; } if (i_x86_64 >= 0) { - printf("%s: ERROR, x86_64 has additional syscalls\n", - x86_64_syscall_iterate_name(i_x86_64)); + printf("ERROR, x86_64 has additional syscalls\n"); return 1; } if (i_x32 >= 0) { - printf("%s: ERROR, x32 has additional syscalls\n", - x32_syscall_iterate_name(i_x32)); + printf("ERROR, x32 has additional syscalls\n"); return 1; } if (i_arm >= 0) { - printf("%s: ERROR, arm has additional syscalls\n", - arm_syscall_iterate_name(i_arm)); + printf("ERROR, arm has additional syscalls\n"); return 1; } if (i_aarch64 >= 0) { - printf("%s: ERROR, aarch64 has additional syscalls\n", - aarch64_syscall_iterate_name(i_aarch64)); + printf("ERROR, aarch64 has additional syscalls\n"); return 1; } if (i_mips >= 0) { - printf("%s: ERROR, mips has additional syscalls\n", - mips_syscall_iterate_name(i_mips)); + printf("ERROR, mips has additional syscalls\n"); return 1; } if (i_mips64 >= 0) { - printf("%s: ERROR, mips64 has additional syscalls\n", - mips64_syscall_iterate_name(i_mips64)); + printf("ERROR, mips64 has additional syscalls\n"); return 1; } if (i_mips64n32 >= 0) { - printf("%s: ERROR, mips64n32 has additional syscalls\n", - mips64n32_syscall_iterate_name(i_mips64n32)); + printf("ERROR, mips64n32 has additional syscalls\n"); return 1; } if (i_ppc >= 0) { - printf("%s: ERROR, ppc has additional syscalls\n", - ppc_syscall_iterate_name(i_ppc)); + printf("ERROR, ppc has additional syscalls\n"); + return 1; } if (i_ppc64 >= 0) { - printf("%s: ERROR, ppc64 has additional syscalls\n", - ppc64_syscall_iterate_name(i_ppc64)); + printf("ERROR, ppc64 has additional syscalls\n"); return 1; } if (i_s390 >= 0) { - printf("%s: ERROR, s390 has additional syscalls\n", - s390_syscall_iterate_name(i_s390)); + printf("ERROR, s390 has additional syscalls\n"); return 1; } if (i_s390x >= 0) { - printf("%s: ERROR, s390x has additional syscalls\n", - s390x_syscall_iterate_name(i_s390x)); + printf("ERROR, s390x has additional syscalls\n"); return 1; } diff --git a/src/arch-syscall-dump.c b/src/arch-syscall-dump.c index 636fd9a..2747dcf 100644 --- a/src/arch-syscall-dump.c +++ b/src/arch-syscall-dump.c @@ -65,8 +65,7 @@ const struct arch_def *arch = arch_def_native; int offset = 0; int iter; - int sys_num; - const char *sys_name; + const struct arch_syscall_def *sys; /* parse the command line */ while ((opt = getopt(argc, argv, "a:o:h")) > 0) { @@ -90,61 +89,62 @@ do { switch (arch->token) { case SCMP_ARCH_X86: - sys_name = x86_syscall_iterate_name(iter); + sys = x86_syscall_iterate(iter); break; case SCMP_ARCH_X86_64: - sys_name = x86_64_syscall_iterate_name(iter); + sys = x86_64_syscall_iterate(iter); break; case SCMP_ARCH_X32: - sys_name = x32_syscall_iterate_name(iter); + sys = x32_syscall_iterate(iter); break; case SCMP_ARCH_ARM: - sys_name = arm_syscall_iterate_name(iter); + sys = arm_syscall_iterate(iter); break; case SCMP_ARCH_AARCH64: - sys_name = aarch64_syscall_iterate_name(iter); + sys = aarch64_syscall_iterate(iter); break; case SCMP_ARCH_MIPS: case SCMP_ARCH_MIPSEL: - sys_name = mips_syscall_iterate_name(iter); + sys = mips_syscall_iterate(iter); break; case SCMP_ARCH_MIPS64: case SCMP_ARCH_MIPSEL64: - sys_name = mips64_syscall_iterate_name(iter); + sys = mips64_syscall_iterate(iter); break; case SCMP_ARCH_MIPS64N32: case SCMP_ARCH_MIPSEL64N32: - sys_name = mips64n32_syscall_iterate_name(iter); + sys = mips64n32_syscall_iterate(iter); break; case SCMP_ARCH_PPC: - sys_name = ppc_syscall_iterate_name(iter); + sys = ppc_syscall_iterate(iter); break; case SCMP_ARCH_PPC64: case SCMP_ARCH_PPC64LE: - sys_name = ppc64_syscall_iterate_name(iter); + sys = ppc64_syscall_iterate(iter); break; case SCMP_ARCH_S390: - sys_name = s390_syscall_iterate_name(iter); + sys = s390_syscall_iterate(iter); break; case SCMP_ARCH_S390X: - sys_name = s390x_syscall_iterate_name(iter); + sys = s390x_syscall_iterate(iter); break; default: /* invalid arch */ exit_usage(argv[0]); } - if (sys_name != NULL) { - sys_num = arch_syscall_resolve_name(arch, sys_name); + if (sys->name != NULL) { + int sys_num = sys->num; + if (offset > 0 && sys_num > 0) sys_num -= offset; /* output the results */ - printf("%s\t%d\n", sys_name, sys_num); + printf("%s\t%d\n", sys->name, sys_num); /* next */ iter++; } - } while (sys_name != NULL); + } while (sys->name != NULL); return 0; } diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate index 2a83098..97c3378 100755 --- a/src/arch-syscall-validate +++ b/src/arch-syscall-validate @@ -84,7 +84,7 @@ [[ -z $1 ]] && return [[ -n $2 ]] && offset_str="-o $2" - $LIB_SYS_DUMP -a $1 $offset_str | sed -e '/[^\t]\+\t-[0-9]\+/d' + $LIB_SYS_DUMP -a $1 $offset_str | sed -e '/[^\t]\+\t-[0-9]\+/d' | sort } # @@ -166,22 +166,13 @@ # Dump the architecture's syscall table to stdout. # function dump_sys_arm() { - # NOTE: arm_sync_file_range() and sync_file_range2() share values - gcc -E -dM -D__ARM_EABI__ $1/arch/arm/include/uapi/asm/unistd.h | \ - grep "^#define __\(ARM_\)*NR_" | \ - grep -v "^#define __NR_OABI_SYSCALL_BASE" | \ - grep -v "^#define __NR_SYSCALL_BASE" | \ - grep -v "^#define __ARM_NR_BASE" | \ - sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+(__NR_SYSCALL_BASE[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t\2/;s/#define[ \t]\+__ARM_NR_\([^ \t]\+\)[ \t]\+(__ARM_NR_BASE[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t983040 + \2/' | \ - while read line; do \ - if echo "$line" | grep -q "+"; then \ - echo "$line" | awk '{ print $1"\t"$2+$4 }'; \ - else \ - echo "$line"; \ - fi; \ - done | \ - sed -e '/#define __NR_sync_file_range2[ \t]\+__NR_arm_sync_file_range/d' | \ - sort + cat $1/arch/arm/tools/syscall.tbl | grep -v "^#" | \ + sed -ne "/[0-9]\+[ \t]\+\(common\|eabi\)/p" | \ + awk '{ print $3"\t"$1 }' | sort | (cat -; \ + (cat $1/arch/arm/include/uapi/asm/unistd.h | \ + grep "^#define __ARM_NR_" | grep -v "^#define __ARM_NR_BASE" | \ + sed -e 's/#define __ARM_NR_\([a-z0-9_]*\)[ \t]\+(__ARM_NR_BASE+\(.*\))/\1 983040 + \2/' | \ + awk '{ print $1"\t"$2+$4 }')) | sort } # @@ -203,7 +194,9 @@ # Dump the architecture's syscall table to stdout. # function dump_sys_aarch64() { - gcc -E -dM -I$1/include/uapi -D__BITS_PER_LONG=64 $1/include/uapi/asm-generic/unistd.h | \ + gcc -E -dM -I$1/include/uapi \ + -D__BITS_PER_LONG=64 -D__ARCH_WANT_RENAMEAT \ + $1/include/uapi/asm-generic/unistd.h | \ grep "^#define __NR_" | \ sed -e '/__NR_syscalls/d' | \ sed -e '/__NR_arch_specific_syscall/d' | \ diff --git a/src/arch-x32-syscalls.c b/src/arch-x32-syscalls.c index 80dd38b..8a6cd64 100644 --- a/src/arch-x32-syscalls.c +++ b/src/arch-x32-syscalls.c @@ -26,7 +26,7 @@ #include "arch.h" #include "arch-x32.h" -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def x32_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", __PNR__newselect }, @@ -122,6 +122,7 @@ { "get_mempolicy", (X32_SYSCALL_BIT + 239) }, { "get_robust_list", (X32_SYSCALL_BIT + 531) }, { "get_thread_area", __PNR_get_thread_area }, + { "get_tls", __PNR_get_tls }, { "getcpu", (X32_SYSCALL_BIT + 309) }, { "getcwd", (X32_SYSCALL_BIT + 79) }, { "getdents", (X32_SYSCALL_BIT + 78) }, @@ -254,11 +255,15 @@ { "pipe", (X32_SYSCALL_BIT + 22) }, { "pipe2", (X32_SYSCALL_BIT + 293) }, { "pivot_root", (X32_SYSCALL_BIT + 155) }, + { "pkey_alloc", (X32_SYSCALL_BIT + 330) }, + { "pkey_free", (X32_SYSCALL_BIT + 331) }, + { "pkey_mprotect", (X32_SYSCALL_BIT + 329) }, { "poll", (X32_SYSCALL_BIT + 7) }, { "ppoll", (X32_SYSCALL_BIT + 271) }, { "prctl", (X32_SYSCALL_BIT + 157) }, { "pread64", (X32_SYSCALL_BIT + 17) }, { "preadv", (X32_SYSCALL_BIT + 534) }, + { "preadv2", (X32_SYSCALL_BIT + 546) }, { "prlimit64", (X32_SYSCALL_BIT + 302) }, { "process_vm_readv", (X32_SYSCALL_BIT + 539) }, { "process_vm_writev", (X32_SYSCALL_BIT + 540) }, @@ -269,6 +274,7 @@ { "putpmsg", (X32_SYSCALL_BIT + 182) }, { "pwrite64", (X32_SYSCALL_BIT + 18) }, { "pwritev", (X32_SYSCALL_BIT + 535) }, + { "pwritev2", (X32_SYSCALL_BIT + 547) }, { "query_module", __PNR_query_module }, { "quotactl", (X32_SYSCALL_BIT + 179) }, { "read", (X32_SYSCALL_BIT + 0) }, @@ -299,9 +305,11 @@ { "rt_sigtimedwait", (X32_SYSCALL_BIT + 523) }, { "rt_tgsigqueueinfo", (X32_SYSCALL_BIT + 536) }, { "rtas", __PNR_rtas }, + { "s390_guarded_storage", __PNR_s390_guarded_storage }, { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, { "s390_runtime_instr", __PNR_s390_runtime_instr }, + { "s390_sthyi", __PNR_s390_sthyi }, { "sched_get_priority_max", (X32_SYSCALL_BIT + 146) }, { "sched_get_priority_min", (X32_SYSCALL_BIT + 147) }, { "sched_getaffinity", (X32_SYSCALL_BIT + 204) }, @@ -387,6 +395,7 @@ { "stat64", __PNR_stat64 }, { "statfs", (X32_SYSCALL_BIT + 137) }, { "statfs64", __PNR_statfs64 }, + { "statx", (X32_SYSCALL_BIT + 332) }, { "stime", __PNR_stime }, { "stty", __PNR_stty }, { "subpage_prot", __PNR_subpage_prot }, @@ -501,15 +510,15 @@ } /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *x32_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *x32_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return x32_syscall_table[spot].name; + return &x32_syscall_table[spot]; } diff --git a/src/arch-x32.h b/src/arch-x32.h index 13d9aab..d166c3c 100644 --- a/src/arch-x32.h +++ b/src/arch-x32.h @@ -34,6 +34,6 @@ int x32_syscall_resolve_name(const char *name); const char *x32_syscall_resolve_num(int num); -const char *x32_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *x32_syscall_iterate(unsigned int spot); #endif diff --git a/src/arch-x86-syscalls.c b/src/arch-x86-syscalls.c index 58e0597..abce705 100644 --- a/src/arch-x86-syscalls.c +++ b/src/arch-x86-syscalls.c @@ -26,7 +26,7 @@ #include "arch.h" #include "arch-x86.h" -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def x86_syscall_table[] = { \ { "_llseek", 140 }, { "_newselect", 142 }, @@ -41,7 +41,7 @@ { "alarm", 27 }, { "arm_fadvise64_64", __PNR_arm_fadvise64_64 }, { "arm_sync_file_range", __PNR_arm_sync_file_range }, - { "arch_prctl", __PNR_arch_prctl }, + { "arch_prctl", 384 }, { "bdflush", 134 }, { "bind", 361 }, { "bpf", 357 }, @@ -122,6 +122,7 @@ { "get_mempolicy", 275 }, { "get_robust_list", 312 }, { "get_thread_area", 244 }, + { "get_tls", __PNR_get_tls }, { "getcpu", 318 }, { "getcwd", 183 }, { "getdents", 141 }, @@ -254,11 +255,15 @@ { "pipe", 42 }, { "pipe2", 331 }, { "pivot_root", 217 }, + { "pkey_alloc", 381 }, + { "pkey_free", 382 }, + { "pkey_mprotect", 380 }, { "poll", 168 }, { "ppoll", 309 }, { "prctl", 172 }, { "pread64", 180 }, { "preadv", 333 }, + { "preadv2", 378 }, { "prlimit64", 340 }, { "process_vm_readv", 347 }, { "process_vm_writev", 348 }, @@ -269,6 +274,7 @@ { "putpmsg", 189 }, { "pwrite64", 181 }, { "pwritev", 334 }, + { "pwritev2", 379 }, { "query_module", 167 }, { "quotactl", 131 }, { "read", 3 }, @@ -299,9 +305,11 @@ { "rt_sigtimedwait", 177 }, { "rt_tgsigqueueinfo", 335 }, { "rtas", __PNR_rtas }, + { "s390_guarded_storage", __PNR_s390_guarded_storage }, { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, { "s390_runtime_instr", __PNR_s390_runtime_instr }, + { "s390_sthyi", __PNR_s390_sthyi }, { "sched_get_priority_max", 159 }, { "sched_get_priority_min", 160 }, { "sched_getaffinity", 242 }, @@ -387,6 +395,7 @@ { "stat64", 195 }, { "statfs", 99 }, { "statfs64", 268 }, + { "statx", 383 }, { "stime", 25 }, { "stty", 31 }, { "subpage_prot", __PNR_subpage_prot }, @@ -585,15 +594,15 @@ } /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *x86_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *x86_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return x86_syscall_table[spot].name; + return &x86_syscall_table[spot]; } diff --git a/src/arch-x86.c b/src/arch-x86.c index 8542079..39c2f09 100644 --- a/src/arch-x86.c +++ b/src/arch-x86.c @@ -225,7 +225,6 @@ { int rc; unsigned int iter; - size_t args_size; int sys = rule->syscall; int sys_a, sys_b; struct db_api_rule_list *rule_a, *rule_b; @@ -235,7 +234,7 @@ (359 to 373) : direct socket syscalls, Linux 4.3+ */ /* strict check for the multiplexed socket syscalls */ - for (iter = 0; iter < rule->args_cnt; iter++) { + for (iter = 0; iter < ARG_COUNT_MAX; iter++) { if ((rule->args[iter].valid != 0) && (strict)) return -EINVAL; } @@ -265,19 +264,9 @@ } else { /* need two rules, dup the first and link together */ rule_a = rule; - rule_b = malloc(sizeof(*rule_b)); + rule_b = db_rule_dup(rule_a); if (rule_b == NULL) return -ENOMEM; - args_size = sizeof(*rule_b->args) * rule_a->args_cnt; - rule_b->args = malloc(args_size); - if (rule_b->args == NULL) { - free(rule_b); - return -ENOMEM; - } - rule_b->action = rule_a->action; - rule_b->syscall = rule_a->syscall; - rule_b->args_cnt = rule_a->args_cnt; - memcpy(rule_b->args, rule_a->args, args_size); rule_b->prev = rule_a; rule_b->next = NULL; rule_a->next = rule_b; diff --git a/src/arch-x86.h b/src/arch-x86.h index 89635b2..f8d7b4e 100644 --- a/src/arch-x86.h +++ b/src/arch-x86.h @@ -33,7 +33,7 @@ int x86_syscall_resolve_name(const char *name); const char *x86_syscall_resolve_num(int num); -const char *x86_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *x86_syscall_iterate(unsigned int spot); int x86_syscall_rewrite(int *syscall); diff --git a/src/arch-x86_64-syscalls.c b/src/arch-x86_64-syscalls.c index 2dd9818..203dafa 100644 --- a/src/arch-x86_64-syscalls.c +++ b/src/arch-x86_64-syscalls.c @@ -26,7 +26,7 @@ #include "arch.h" #include "arch-x86_64.h" -/* NOTE: based on Linux 4.5-rc4 */ +/* NOTE: based on Linux 4.15-rc7 */ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", __PNR__newselect }, @@ -122,6 +122,7 @@ { "get_mempolicy", 239 }, { "get_robust_list", 274 }, { "get_thread_area", 211 }, + { "get_tls", __PNR_get_tls }, { "getcpu", 309 }, { "getcwd", 79 }, { "getdents", 78 }, @@ -254,11 +255,15 @@ { "pipe", 22 }, { "pipe2", 293 }, { "pivot_root", 155 }, + { "pkey_alloc", 330 }, + { "pkey_free", 331 }, + { "pkey_mprotect", 329 }, { "poll", 7 }, { "ppoll", 271 }, { "prctl", 157 }, { "pread64", 17 }, { "preadv", 295 }, + { "preadv2", 327 }, { "prlimit64", 302 }, { "process_vm_readv", 310 }, { "process_vm_writev", 311 }, @@ -269,6 +274,7 @@ { "putpmsg", 182 }, { "pwrite64", 18 }, { "pwritev", 296 }, + { "pwritev2", 328 }, { "query_module", 178 }, { "quotactl", 179 }, { "read", 0 }, @@ -299,9 +305,11 @@ { "rt_sigtimedwait", 128 }, { "rt_tgsigqueueinfo", 297 }, { "rtas", __PNR_rtas }, + { "s390_guarded_storage", __PNR_s390_guarded_storage }, { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, { "s390_runtime_instr", __PNR_s390_runtime_instr }, + { "s390_sthyi", __PNR_s390_sthyi }, { "sched_get_priority_max", 146 }, { "sched_get_priority_min", 147 }, { "sched_getaffinity", 204 }, @@ -387,6 +395,7 @@ { "stat64", __PNR_stat64 }, { "statfs", 137 }, { "statfs64", __PNR_statfs64 }, + { "statx", 332 }, { "stime", __PNR_stime }, { "stty", __PNR_stty }, { "subpage_prot", __PNR_subpage_prot }, @@ -501,16 +510,16 @@ } /** - * Iterate through the syscall table and return the syscall name + * Iterate through the syscall table and return the syscall mapping * @param spot the offset into the syscall table * - * Return the syscall name at position @spot or NULL on failure. This function - * should only ever be used internally by libseccomp. + * Return the syscall mapping at position @spot or NULL on failure. This + * function should only ever be used internally by libseccomp. * */ -const char *x86_64_syscall_iterate_name(unsigned int spot) +const struct arch_syscall_def *x86_64_syscall_iterate(unsigned int spot) { /* XXX - no safety checks here */ - return x86_64_syscall_table[spot].name; + return &x86_64_syscall_table[spot]; } diff --git a/src/arch-x86_64.h b/src/arch-x86_64.h index dc09c63..c770d75 100644 --- a/src/arch-x86_64.h +++ b/src/arch-x86_64.h @@ -32,6 +32,6 @@ int x86_64_syscall_resolve_name(const char *name); const char *x86_64_syscall_resolve_num(int num); -const char *x86_64_syscall_iterate_name(unsigned int spot); +const struct arch_syscall_def *x86_64_syscall_iterate(unsigned int spot); #endif diff --git a/src/arch.c b/src/arch.c index 0f24d1c..e05a7f2 100644 --- a/src/arch.c +++ b/src/arch.c @@ -44,8 +44,6 @@ #include "arch-s390x.h" #include "db.h" #include "system.h" - -#define default_arg_count_max 6 #define default_arg_offset(x) (offsetof(struct seccomp_data, args[x])) @@ -200,19 +198,6 @@ } /** - * Determine the maximum number of syscall arguments - * @param arch the architecture definition - * - * Determine the maximum number of syscall arguments for the given architecture. - * Returns the number of arguments on success, negative values on failure. - * - */ -int arch_arg_count_max(const struct arch_def *arch) -{ - return (arch_valid(arch->token) == 0 ? default_arg_count_max : -EDOM); -} - -/** * Determine the argument offset for the lower 32 bits * @param arch the architecture definition * @param arg the argument number @@ -332,6 +317,10 @@ int sc_num; const char *sc_name; + /* special handling for syscall -1 */ + if (*syscall == -1) + return 0; + if (arch->token != arch_def_native->token) { sc_name = arch_syscall_resolve_num(arch_def_native, *syscall); if (sc_name == NULL) @@ -362,10 +351,10 @@ { int sys = *syscall; - if (sys >= 0) { + if (sys >= -1) { /* we shouldn't be here - no rewrite needed */ return 0; - } else if (sys < 0 && sys > -100) { + } else if (sys < -1 && sys > -100) { /* reserved values */ return -EINVAL; } else if (sys <= -100 && sys > -10000) { @@ -401,15 +390,10 @@ */ int arch_filter_rule_add(struct db_filter_col *col, struct db_filter *db, bool strict, uint32_t action, int syscall, - unsigned int chain_len, struct db_api_arg *chain) + struct db_api_arg *chain) { int rc; - size_t chain_size = sizeof(*chain) * chain_len; struct db_api_rule_list *rule, *rule_tail; - - /* ensure we aren't using any reserved syscall values */ - if (syscall < 0 && syscall > -100) - return -EINVAL; /* translate the syscall */ rc = arch_syscall_translate(db->arch, &syscall); @@ -420,22 +404,16 @@ rule = malloc(sizeof(*rule)); if (rule == NULL) return -ENOMEM; - rule->args = malloc(chain_size); - if (rule->args == NULL) { - free(rule); - return -ENOMEM; - } rule->action = action; rule->syscall = syscall; - rule->args_cnt = chain_len; - memcpy(rule->args, chain, chain_size); + memcpy(rule->args, chain, sizeof(*chain) * ARG_COUNT_MAX); rule->prev = NULL; rule->next = NULL; /* add the new rule to the existing filter */ - if (db->arch->rule_add == NULL) { - /* negative syscalls require a db->arch->rule_add() function */ - if (syscall < 0 && strict) { + if (syscall == -1 || db->arch->rule_add == NULL) { + /* syscalls < -1 require a db->arch->rule_add() function */ + if (syscall < -1 && strict) { rc = -EDOM; goto rule_add_failure; } @@ -466,7 +444,6 @@ do { rule_tail = rule; rule = rule->next; - free(rule_tail->args); free(rule_tail); } while (rule); return rc; diff --git a/src/arch.h b/src/arch.h index 7f15cf5..63f0d7f 100644 --- a/src/arch.h +++ b/src/arch.h @@ -60,20 +60,7 @@ /* arch_def for the current architecture */ extern const struct arch_def *arch_def_native; -/* NOTE: Syscall mappings can be found by running the following commands - * on the specific architecture's include file: - * # gcc -E -dM | grep '__NR_' - * where in many cases is /usr/include/asm/unistd.h, however, - * depending on the architecture you may need to use a different header. - * Further, you can automatically format this list for use as a struct - * initializer with the following command: - * # gcc -E -dM | grep '__NR_' | \ - * sed -e 's/#define[ \t]\+__NR_//' | sort | \ - * sed -e 's/\([^ \t]\+\)\([ \t]\+\)\([0-9]\+\)/\t{ \"\1\", \3 },/' - * Finally, when creating a table/array of this structure, the final - * sentinel entry should be "{ NULL, __NR_SCMP_ERROR }"; see the existing - * tables as an example. - */ +/* syscall name/num mapping */ struct arch_syscall_def { const char *name; unsigned int num; @@ -90,8 +77,6 @@ const struct arch_def *arch_def_lookup(uint32_t token); const struct arch_def *arch_def_lookup_name(const char *arch_name); -int arch_arg_count_max(const struct arch_def *arch); - int arch_arg_offset_lo(const struct arch_def *arch, unsigned int arg); int arch_arg_offset_hi(const struct arch_def *arch, unsigned int arg); int arch_arg_offset(const struct arch_def *arch, unsigned int arg); @@ -104,6 +89,6 @@ int arch_filter_rule_add(struct db_filter_col *col, struct db_filter *db, bool strict, uint32_t action, int syscall, - unsigned int chain_len, struct db_api_arg *chain); + struct db_api_arg *chain); #endif diff --git a/src/db.c b/src/db.c index 1a85b1f..8960fcd 100644 --- a/src/db.c +++ b/src/db.c @@ -381,7 +381,6 @@ r_iter = db->rules; while (r_iter != NULL) { db->rules = r_iter->next; - free(r_iter->args); free(r_iter); r_iter = db->rules; } @@ -513,6 +512,29 @@ } /** + * Duplicate an existing filter rule + * @param src the rule to duplicate + * + * This function makes an exact copy of the given rule, but does not add it + * to any lists. Returns a pointer to the new rule on success, NULL on + * failure. + * + */ +struct db_api_rule_list *db_rule_dup(const struct db_api_rule_list *src) +{ + struct db_api_rule_list *dest; + + dest = malloc(sizeof(*dest)); + if (dest == NULL) + return NULL; + memcpy(dest, src, sizeof(*dest)); + dest->prev = NULL; + dest->next = NULL; + + return dest; +} + +/** * Free and reset the seccomp filter collection * @param col the seccomp filter collection * @param def_action the default filter action @@ -548,6 +570,7 @@ col->attr.act_badarch = SCMP_ACT_KILL; col->attr.nnp_enable = 1; col->attr.tsync_enable = 0; + col->attr.api_tskip = 0; /* set the state */ col->state = _DB_STA_VALID; @@ -771,6 +794,9 @@ break; case SCMP_FLTATR_CTL_TSYNC: *value = col->attr.tsync_enable; + break; + case SCMP_FLTATR_API_TSKIP: + *value = col->attr.api_tskip; break; default: rc = -EEXIST; @@ -819,6 +845,9 @@ /* unsupported */ rc = -EOPNOTSUPP; break; + case SCMP_FLTATR_API_TSKIP: + col->attr.api_tskip = (value ? 1 : 0); + break; default: rc = -EEXIST; break; @@ -989,10 +1018,9 @@ static struct db_sys_list *_db_rule_gen_64(const struct arch_def *arch, uint32_t action, unsigned int syscall, - struct db_api_arg *chain) + const struct db_api_arg *chain) { unsigned int iter; - int chain_len_max; struct db_sys_list *s_new; struct db_arg_chain_tree *c_iter_hi = NULL, *c_iter_lo = NULL; struct db_arg_chain_tree *c_prev_hi = NULL, *c_prev_lo = NULL; @@ -1005,10 +1033,7 @@ s_new->num = syscall; s_new->valid = true; /* run through the argument chain */ - chain_len_max = arch_arg_count_max(arch); - if (chain_len_max < 0) - goto gen_64_failure; - for (iter = 0; iter < chain_len_max; iter++) { + for (iter = 0; iter < ARG_COUNT_MAX; iter++) { if (chain[iter].valid == 0) continue; @@ -1129,10 +1154,9 @@ static struct db_sys_list *_db_rule_gen_32(const struct arch_def *arch, uint32_t action, unsigned int syscall, - struct db_api_arg *chain) + const struct db_api_arg *chain) { unsigned int iter; - int chain_len_max; struct db_sys_list *s_new; struct db_arg_chain_tree *c_iter = NULL, *c_prev = NULL; bool tf_flag; @@ -1144,10 +1168,7 @@ s_new->num = syscall; s_new->valid = true; /* run through the argument chain */ - chain_len_max = arch_arg_count_max(arch); - if (chain_len_max < 0) - goto gen_32_failure; - for (iter = 0; iter < chain_len_max; iter++) { + for (iter = 0; iter < ARG_COUNT_MAX; iter++) { if (chain[iter].valid == 0) continue; @@ -1238,7 +1259,7 @@ int rc = -ENOMEM; int syscall = rule->syscall; uint32_t action = rule->action; - struct db_api_arg *chain = rule->args; + const struct db_api_arg *chain = rule->args; struct db_sys_list *s_new, *s_iter, *s_prev = NULL; struct db_arg_chain_tree *c_iter = NULL, *c_prev = NULL; struct db_arg_chain_tree *ec_iter; @@ -1520,9 +1541,10 @@ if (rc_tmp < 0) goto priority_failure; - /* if this is a pseudo syscall (syscall < 0) then we need to - * rewrite the syscall for some arch specific reason */ - if (sc_tmp < 0) { + /* if this is a pseudo syscall then we need to rewrite the + * syscall for some arch specific reason, don't forget the + * special handling for syscall -1 */ + if (sc_tmp < -1) { /* we set this as a strict op - we don't really care * since priorities are a "best effort" thing - as we * want to catch the -EDOM error and bail on this @@ -1568,15 +1590,13 @@ { int rc = 0, rc_tmp; unsigned int iter; - unsigned int chain_len; unsigned int arg_num; size_t chain_size; struct db_api_arg *chain = NULL; struct scmp_arg_cmp arg_data; /* collect the arguments for the filter rule */ - chain_len = ARG_COUNT_MAX; - chain_size = sizeof(*chain) * chain_len; + chain_size = sizeof(*chain) * ARG_COUNT_MAX; chain = malloc(chain_size); if (chain == NULL) return -ENOMEM; @@ -1584,7 +1604,7 @@ for (iter = 0; iter < arg_cnt; iter++) { arg_data = arg_array[iter]; arg_num = arg_data.arg; - if (arg_num < chain_len && chain[arg_num].valid == 0) { + if (arg_num < ARG_COUNT_MAX && chain[arg_num].valid == 0) { chain[arg_num].valid = 1; chain[arg_num].arg = arg_num; chain[arg_num].op = arg_data.op; @@ -1616,8 +1636,7 @@ for (iter = 0; iter < col->filter_cnt; iter++) { rc_tmp = arch_filter_rule_add(col, col->filters[iter], strict, - action, syscall, - chain_len, chain); + action, syscall, chain); if (rc == 0 && rc_tmp < 0) rc = rc_tmp; } @@ -1639,7 +1658,6 @@ int db_col_transaction_start(struct db_filter_col *col) { unsigned int iter; - size_t args_size; struct db_filter_snap *snap; struct db_filter *filter_o, *filter_s; struct db_api_rule_list *rule_o, *rule_s; @@ -1673,19 +1691,9 @@ continue; do { /* copy the rule */ - rule_s = malloc(sizeof(*rule_s)); + rule_s = db_rule_dup(rule_o); if (rule_s == NULL) goto trans_start_failure; - args_size = sizeof(*rule_s->args) * rule_o->args_cnt; - rule_s->args = malloc(args_size); - if (rule_s->args == NULL) { - free(rule_s); - goto trans_start_failure; - } - rule_s->action = rule_o->action; - rule_s->syscall = rule_o->syscall; - rule_s->args_cnt = rule_o->args_cnt; - memcpy(rule_s->args, rule_o->args, args_size); if (filter_s->rules != NULL) { rule_s->prev = filter_s->rules->prev; rule_s->next = filter_s->rules; diff --git a/src/db.h b/src/db.h index 1f67b5d..c4ad549 100644 --- a/src/db.h +++ b/src/db.h @@ -43,8 +43,7 @@ struct db_api_rule_list { uint32_t action; int syscall; - struct db_api_arg *args; - unsigned int args_cnt; + struct db_api_arg args[ARG_COUNT_MAX]; struct db_api_rule_list *prev, *next; }; @@ -138,6 +137,8 @@ uint32_t nnp_enable; /* SECCOMP_FILTER_FLAG_TSYNC related attributes */ uint32_t tsync_enable; + /* allow rules with a -1 syscall value */ + uint32_t api_tskip; }; struct db_filter { @@ -189,6 +190,8 @@ int db_action_valid(uint32_t action); +struct db_api_rule_list *db_rule_dup(const struct db_api_rule_list *src); + struct db_filter_col *db_col_init(uint32_t def_action); int db_col_reset(struct db_filter_col *col, uint32_t def_action); void db_col_release(struct db_filter_col *col); diff --git a/src/gen_bpf.c b/src/gen_bpf.c index 2418a1a..01dcdac 100644 --- a/src/gen_bpf.c +++ b/src/gen_bpf.c @@ -1353,13 +1353,32 @@ /* filter out x32 */ _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_JMP + BPF_JGE), - _BPF_JMP_HSH(state->bad_arch_hsh), + _BPF_JMP_NO, _BPF_JMP_NO, _BPF_K(state->arch, X32_SYSCALL_BIT)); if (b_head != NULL) instr.jf = _BPF_JMP_HSH(b_head->hash); else instr.jf = _BPF_JMP_HSH(state->def_hsh); + b_new = _blk_append(state, b_new, &instr); + if (b_new == NULL) + goto arch_failure; + /* NOTE: starting with Linux v4.8 the seccomp filters + * are processed both when the syscall is + * initially executed as well as after any + * tracing processes finish so we need to make + * sure we don't trap the -1 syscall which + * tracers can use to skip the syscall, see + * seccomp(2) for more information */ + _BPF_INSTR(instr, + _BPF_OP(state->arch, BPF_JMP + BPF_JEQ), + _BPF_JMP_NO, + _BPF_JMP_HSH(state->bad_arch_hsh), + _BPF_K(state->arch, -1)); + if (b_head != NULL) + instr.jt = _BPF_JMP_HSH(b_head->hash); + else + instr.jt = _BPF_JMP_HSH(state->def_hsh); blk_cnt++; } else if (state->arch->token == SCMP_ARCH_X32) { /* filter out x86_64 */ diff --git a/src/python/Makefile.in b/src/python/Makefile.in index be670fa..1afca56 100644 --- a/src/python/Makefile.in +++ b/src/python/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,7 +32,17 @@ # along with this library; if not, see . # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -96,14 +106,14 @@ build_triplet = @build@ host_triplet = @host@ subdir = src/python -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/configure.h CONFIG_CLEAN_FILES = @@ -128,6 +138,7 @@ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -143,6 +154,12 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -157,12 +174,15 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -283,7 +303,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/python/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/python/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -459,6 +478,8 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am +.PRECIOUS: Makefile + all-local: build diff --git a/src/python/libseccomp.pxd b/src/python/libseccomp.pxd index 15c94f8..235b859 100644 --- a/src/python/libseccomp.pxd +++ b/src/python/libseccomp.pxd @@ -54,6 +54,7 @@ SCMP_FLTATR_ACT_BADARCH SCMP_FLTATR_CTL_NNP SCMP_FLTATR_CTL_TSYNC + SCMP_FLTATR_API_TSKIP cdef enum scmp_compare: SCMP_CMP_NE diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx index c87bc3f..a0d5768 100644 --- a/src/python/seccomp.pyx +++ b/src/python/seccomp.pyx @@ -1,7 +1,7 @@ # # Seccomp Library Python Bindings # -# Copyright (c) 2012,2013 Red Hat +# Copyright (c) 2012,2013,2017 Red Hat # Author: Paul Moore # @@ -68,12 +68,30 @@ f.load() """ __author__ = 'Paul Moore ' -__date__ = "7 January 2013" - +__date__ = "3 February 2017" + +from cpython.version cimport PY_MAJOR_VERSION from libc.stdint cimport uint32_t import errno cimport libseccomp + +def c_str(string): + """ Convert a Python string to a C string. + + Arguments: + string - the Python string + + Description: + Convert the Python string into a form usable by C taking into consideration + the Python major version, e.g. Python 2.x or Python 3.x. + See http://docs.cython.org/en/latest/src/tutorial/strings.html for more + information. + """ + if PY_MAJOR_VERSION < 3: + return string + else: + return bytes(string, "ascii") KILL = libseccomp.SCMP_ACT_KILL TRAP = libseccomp.SCMP_ACT_TRAP @@ -121,7 +139,8 @@ cdef char *ret_str if isinstance(syscall, basestring): - return libseccomp.seccomp_syscall_resolve_name_rewrite(arch, syscall) + return libseccomp.seccomp_syscall_resolve_name_rewrite(arch, + c_str(syscall)) elif isinstance(syscall, int): ret_str = libseccomp.seccomp_syscall_resolve_num_arch(arch, syscall) if ret_str is NULL: @@ -218,7 +237,7 @@ else: self._token = 0; elif isinstance(arch, basestring): - self._token = libseccomp.seccomp_arch_resolve_name(arch) + self._token = libseccomp.seccomp_arch_resolve_name(c_str(arch)) else: raise TypeError("Architecture must be an int or str type") if self._token == 0: @@ -246,6 +265,7 @@ ACT_BADARCH = libseccomp.SCMP_FLTATR_ACT_BADARCH CTL_NNP = libseccomp.SCMP_FLTATR_CTL_NNP CTL_TSYNC = libseccomp.SCMP_FLTATR_CTL_TSYNC + API_TSKIP = libseccomp.SCMP_FLTATR_API_TSKIP cdef class Arg: """ Python object representing a SyscallFilter syscall argument. diff --git a/tests/15-basic-resolver.py b/tests/15-basic-resolver.py index 12c4d7d..3ce3389 100755 --- a/tests/15-basic-resolver.py +++ b/tests/15-basic-resolver.py @@ -41,11 +41,11 @@ sys_num = resolve_syscall(Arch(), "open") sys_name = resolve_syscall(Arch(), sys_num) - if (sys_name != "open"): + if (sys_name != b"open"): raise RuntimeError("Test failure") sys_num = resolve_syscall(Arch(), "read") sys_name = resolve_syscall(Arch(), sys_num) - if (sys_name != "read"): + if (sys_name != b"read"): raise RuntimeError("Test failure") test() diff --git a/tests/20-live-basic_die.py b/tests/20-live-basic_die.py index 389a50f..26013f6 100755 --- a/tests/20-live-basic_die.py +++ b/tests/20-live-basic_die.py @@ -33,6 +33,7 @@ if action == TRAP: util.install_trap() f = SyscallFilter(action) + f.add_rule(ALLOW, "getpid") f.add_rule(ALLOW, "rt_sigreturn") f.add_rule(ALLOW, "sigreturn") f.add_rule(ALLOW, "exit_group") diff --git a/tests/21-live-basic_allow.py b/tests/21-live-basic_allow.py index b6703de..3bf5317 100755 --- a/tests/21-live-basic_allow.py +++ b/tests/21-live-basic_allow.py @@ -47,9 +47,11 @@ f.add_rule(ALLOW, "rt_sigaction") f.add_rule(ALLOW, "rt_sigreturn") f.add_rule(ALLOW, "sigreturn") + f.add_rule(ALLOW, "sigaltstack") f.add_rule(ALLOW, "brk") f.add_rule(ALLOW, "exit_group") f.load() + try: util.write_file("/dev/null") except OSError as ex: diff --git a/tests/24-live-arg_allow.py b/tests/24-live-arg_allow.py index 019c8a8..3226584 100755 --- a/tests/24-live-arg_allow.py +++ b/tests/24-live-arg_allow.py @@ -35,7 +35,7 @@ quit(1) util.install_trap() - fd = os.open("/dev/null", os.O_WRONLY|os.O_CREAT, 0600) + fd = os.open("/dev/null", os.O_WRONLY|os.O_CREAT) f = SyscallFilter(TRAP) # NOTE: additional syscalls required for python @@ -43,12 +43,13 @@ f.add_rule(ALLOW, "close") f.add_rule(ALLOW, "rt_sigaction") f.add_rule(ALLOW, "rt_sigreturn") + f.add_rule(ALLOW, "sigaltstack") f.add_rule(ALLOW, "exit_group") f.add_rule(ALLOW, "brk") f.load() try: - if not os.write(fd, "testing") == len("testing"): + if not os.write(fd, b"testing") == len("testing"): raise IOError("failed to write the full test string") quit(160) except OSError as ex: diff --git a/tests/32-live-tsync_allow.py b/tests/32-live-tsync_allow.py index a59b1a3..da8d4cb 100755 --- a/tests/32-live-tsync_allow.py +++ b/tests/32-live-tsync_allow.py @@ -48,6 +48,7 @@ f.add_rule(ALLOW, "rt_sigaction") f.add_rule(ALLOW, "rt_sigreturn") f.add_rule(ALLOW, "sigreturn") + f.add_rule(ALLOW, "sigaltstack") f.add_rule(ALLOW, "brk") f.add_rule(ALLOW, "exit_group") f.load() diff --git a/tests/35-sim-negative_one.c b/tests/35-sim-negative_one.c new file mode 100644 index 0000000..7406307 --- /dev/null +++ b/tests/35-sim-negative_one.c @@ -0,0 +1,78 @@ +/** + * Seccomp Library test program + * + * Copyright (c) 2017 Red Hat + * Author: Paul Moore + */ + +/* + * This library is free software; you can redistribute it and/or modify it + * under the terms of version 2.1 of the GNU Lesser General Public License as + * published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, see . + */ + +/* + * Just like mode 1 seccomp we allow 4 syscalls: + * read, write, exit, and rt_sigreturn + */ + +#include +#include + +#include + +#include "util.h" + +int main(int argc, char *argv[]) +{ + int rc; + struct util_options opts; + scmp_filter_ctx ctx = NULL; + + rc = util_getopt(argc, argv, &opts); + if (rc < 0) + goto out; + + ctx = seccomp_init(SCMP_ACT_KILL); + if (ctx == NULL) + return ENOMEM; + + rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE); + if (rc != 0) + goto out; + + rc = seccomp_arch_add(ctx, SCMP_ARCH_X86); + if (rc != 0) + goto out; + rc = seccomp_arch_add(ctx, SCMP_ARCH_X86_64); + if (rc != 0) + goto out; + + rc = seccomp_attr_set(ctx, SCMP_FLTATR_API_TSKIP, 1); + if (rc != 0) + goto out; + + rc = seccomp_syscall_priority(ctx, -1, 100); + if (rc != 0) + goto out; + + rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, -1, 0); + if (rc != 0) + goto out; + + rc = util_filter_output(&opts, ctx); + if (rc) + goto out; + +out: + seccomp_release(ctx); + return (rc < 0 ? -rc : rc); +} diff --git a/tests/35-sim-negative_one.py b/tests/35-sim-negative_one.py new file mode 100755 index 0000000..d94fda5 --- /dev/null +++ b/tests/35-sim-negative_one.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python + +# +# Seccomp Library test program +# +# Copyright (c) 2017 Red Hat +# Author: Paul Moore +# + +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of version 2.1 of the GNU Lesser General Public License as +# published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +# for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, see . +# + +import argparse +import sys + +import util + +from seccomp import * + +def test(args): + f = SyscallFilter(KILL) + f.remove_arch(Arch()) + f.add_arch(Arch("x86")) + f.add_arch(Arch("x86_64")) + f.set_attr(Attr.API_TSKIP, 1) + f.syscall_priority(-1, 100) + f.add_rule(ALLOW, -1) + return f + +args = util.get_opt() +ctx = test(args) +util.filter_output(args, ctx) + +# kate: syntax python; +# kate: indent-mode python; space-indent on; indent-width 4; mixedindent off; diff --git a/tests/35-sim-negative_one.tests b/tests/35-sim-negative_one.tests new file mode 100644 index 0000000..7d929de --- /dev/null +++ b/tests/35-sim-negative_one.tests @@ -0,0 +1,18 @@ +# +# libseccomp regression test automation data +# +# Copyright (c) 2017 Red Hat +# Author: Paul Moore +# + +test type: bpf-sim + +# Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result +35-sim-negative_one +x86 -1 N N N N N N ALLOW +35-sim-negative_one +x86_64 -1 N N N N N N ALLOW +35-sim-negative_one +x32 -1 N N N N N N ALLOW + +test type: bpf-valgrind + +# Testname +35-sim-negative_one diff --git a/tests/Makefile.am b/tests/Makefile.am index ee4e41b..9bc3308 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,8 +16,17 @@ # along with this library; if not, see . # -AM_LDFLAGS = -static -LDADD = util.la ../src/libseccomp.la +@CODE_COVERAGE_RULES@ + +if CODE_COVERAGE_ENABLED +DBG_STATIC = +else +DBG_STATIC = -static +endif + +AM_LDFLAGS = ${DBG_STATIC} + +LDADD = util.la ../src/libseccomp.la ${CODE_COVERAGE_LIBS} check_LTLIBRARIES = util.la util_la_SOURCES = util.c util.h @@ -61,7 +70,8 @@ 30-sim-socket_syscalls \ 31-basic-version_check \ 32-live-tsync_allow \ - 33-sim-socket_syscalls_be + 33-sim-socket_syscalls_be \ + 35-sim-negative_one EXTRA_DIST_TESTPYTHON = \ util.py \ @@ -97,7 +107,8 @@ 30-sim-socket_syscalls.py \ 31-basic-version_check.py \ 32-live-tsync_allow.py \ - 33-sim-socket_syscalls_be.py + 33-sim-socket_syscalls_be.py \ + 35-sim-negative_one.py EXTRA_DIST_TESTCFGS = \ 01-sim-allow.tests \ @@ -132,7 +143,8 @@ 30-sim-socket_syscalls.tests \ 31-basic-version_check.tests \ 32-live-tsync_allow.tests \ - 33-sim-socket_syscalls_be.tests + 33-sim-socket_syscalls_be.tests \ + 35-sim-negative_one.tests EXTRA_DIST_TESTSCRIPTS = regression testdiff testgen diff --git a/tests/Makefile.in b/tests/Makefile.in index 8ecd9b4..46d417a 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,7 +32,17 @@ # along with this library; if not, see . # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -116,18 +126,18 @@ 27-sim-bpf_blk_state$(EXEEXT) 28-sim-arch_x86$(EXEEXT) \ 29-sim-pseudo_syscall$(EXEEXT) 30-sim-socket_syscalls$(EXEEXT) \ 31-basic-version_check$(EXEEXT) 32-live-tsync_allow$(EXEEXT) \ - 33-sim-socket_syscalls_be$(EXEEXT) + 33-sim-socket_syscalls_be$(EXEEXT) \ + 35-sim-negative_one$(EXEEXT) EXTRA_PROGRAMS = 00-test$(EXEEXT) subdir = tests -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/configure.h CONFIG_CLEAN_FILES = @@ -145,147 +155,184 @@ nodist_00_test_OBJECTS = 00-test.$(OBJEXT) 00_test_OBJECTS = $(nodist_00_test_OBJECTS) 00_test_LDADD = $(LDADD) -00_test_DEPENDENCIES = util.la ../src/libseccomp.la +am__DEPENDENCIES_1 = +00_test_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 01_sim_allow_SOURCES = 01-sim-allow.c 01_sim_allow_OBJECTS = 01-sim-allow.$(OBJEXT) 01_sim_allow_LDADD = $(LDADD) -01_sim_allow_DEPENDENCIES = util.la ../src/libseccomp.la +01_sim_allow_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 02_sim_basic_SOURCES = 02-sim-basic.c 02_sim_basic_OBJECTS = 02-sim-basic.$(OBJEXT) 02_sim_basic_LDADD = $(LDADD) -02_sim_basic_DEPENDENCIES = util.la ../src/libseccomp.la +02_sim_basic_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 03_sim_basic_chains_SOURCES = 03-sim-basic_chains.c 03_sim_basic_chains_OBJECTS = 03-sim-basic_chains.$(OBJEXT) 03_sim_basic_chains_LDADD = $(LDADD) -03_sim_basic_chains_DEPENDENCIES = util.la ../src/libseccomp.la +03_sim_basic_chains_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 04_sim_multilevel_chains_SOURCES = 04-sim-multilevel_chains.c 04_sim_multilevel_chains_OBJECTS = 04-sim-multilevel_chains.$(OBJEXT) 04_sim_multilevel_chains_LDADD = $(LDADD) -04_sim_multilevel_chains_DEPENDENCIES = util.la ../src/libseccomp.la +04_sim_multilevel_chains_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 05_sim_long_jumps_SOURCES = 05-sim-long_jumps.c 05_sim_long_jumps_OBJECTS = 05-sim-long_jumps.$(OBJEXT) 05_sim_long_jumps_LDADD = $(LDADD) -05_sim_long_jumps_DEPENDENCIES = util.la ../src/libseccomp.la +05_sim_long_jumps_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 06_sim_actions_SOURCES = 06-sim-actions.c 06_sim_actions_OBJECTS = 06-sim-actions.$(OBJEXT) 06_sim_actions_LDADD = $(LDADD) -06_sim_actions_DEPENDENCIES = util.la ../src/libseccomp.la +06_sim_actions_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 07_sim_db_bug_looping_SOURCES = 07-sim-db_bug_looping.c 07_sim_db_bug_looping_OBJECTS = 07-sim-db_bug_looping.$(OBJEXT) 07_sim_db_bug_looping_LDADD = $(LDADD) -07_sim_db_bug_looping_DEPENDENCIES = util.la ../src/libseccomp.la +07_sim_db_bug_looping_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 08_sim_subtree_checks_SOURCES = 08-sim-subtree_checks.c 08_sim_subtree_checks_OBJECTS = 08-sim-subtree_checks.$(OBJEXT) 08_sim_subtree_checks_LDADD = $(LDADD) -08_sim_subtree_checks_DEPENDENCIES = util.la ../src/libseccomp.la +08_sim_subtree_checks_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 09_sim_syscall_priority_pre_SOURCES = 09-sim-syscall_priority_pre.c 09_sim_syscall_priority_pre_OBJECTS = \ 09-sim-syscall_priority_pre.$(OBJEXT) 09_sim_syscall_priority_pre_LDADD = $(LDADD) 09_sim_syscall_priority_pre_DEPENDENCIES = util.la \ - ../src/libseccomp.la + ../src/libseccomp.la $(am__DEPENDENCIES_1) 10_sim_syscall_priority_post_SOURCES = 10-sim-syscall_priority_post.c 10_sim_syscall_priority_post_OBJECTS = \ 10-sim-syscall_priority_post.$(OBJEXT) 10_sim_syscall_priority_post_LDADD = $(LDADD) 10_sim_syscall_priority_post_DEPENDENCIES = util.la \ - ../src/libseccomp.la + ../src/libseccomp.la $(am__DEPENDENCIES_1) 11_basic_basic_errors_SOURCES = 11-basic-basic_errors.c 11_basic_basic_errors_OBJECTS = 11-basic-basic_errors.$(OBJEXT) 11_basic_basic_errors_LDADD = $(LDADD) -11_basic_basic_errors_DEPENDENCIES = util.la ../src/libseccomp.la +11_basic_basic_errors_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 12_sim_basic_masked_ops_SOURCES = 12-sim-basic_masked_ops.c 12_sim_basic_masked_ops_OBJECTS = 12-sim-basic_masked_ops.$(OBJEXT) 12_sim_basic_masked_ops_LDADD = $(LDADD) -12_sim_basic_masked_ops_DEPENDENCIES = util.la ../src/libseccomp.la +12_sim_basic_masked_ops_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 13_basic_attrs_SOURCES = 13-basic-attrs.c 13_basic_attrs_OBJECTS = 13-basic-attrs.$(OBJEXT) 13_basic_attrs_LDADD = $(LDADD) -13_basic_attrs_DEPENDENCIES = util.la ../src/libseccomp.la +13_basic_attrs_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 14_sim_reset_SOURCES = 14-sim-reset.c 14_sim_reset_OBJECTS = 14-sim-reset.$(OBJEXT) 14_sim_reset_LDADD = $(LDADD) -14_sim_reset_DEPENDENCIES = util.la ../src/libseccomp.la +14_sim_reset_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 15_basic_resolver_SOURCES = 15-basic-resolver.c 15_basic_resolver_OBJECTS = 15-basic-resolver.$(OBJEXT) 15_basic_resolver_LDADD = $(LDADD) -15_basic_resolver_DEPENDENCIES = util.la ../src/libseccomp.la +15_basic_resolver_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 16_sim_arch_basic_SOURCES = 16-sim-arch_basic.c 16_sim_arch_basic_OBJECTS = 16-sim-arch_basic.$(OBJEXT) 16_sim_arch_basic_LDADD = $(LDADD) -16_sim_arch_basic_DEPENDENCIES = util.la ../src/libseccomp.la +16_sim_arch_basic_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 17_sim_arch_merge_SOURCES = 17-sim-arch_merge.c 17_sim_arch_merge_OBJECTS = 17-sim-arch_merge.$(OBJEXT) 17_sim_arch_merge_LDADD = $(LDADD) -17_sim_arch_merge_DEPENDENCIES = util.la ../src/libseccomp.la +17_sim_arch_merge_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 18_sim_basic_whitelist_SOURCES = 18-sim-basic_whitelist.c 18_sim_basic_whitelist_OBJECTS = 18-sim-basic_whitelist.$(OBJEXT) 18_sim_basic_whitelist_LDADD = $(LDADD) -18_sim_basic_whitelist_DEPENDENCIES = util.la ../src/libseccomp.la +18_sim_basic_whitelist_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 19_sim_missing_syscalls_SOURCES = 19-sim-missing_syscalls.c 19_sim_missing_syscalls_OBJECTS = 19-sim-missing_syscalls.$(OBJEXT) 19_sim_missing_syscalls_LDADD = $(LDADD) -19_sim_missing_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la +19_sim_missing_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 20_live_basic_die_SOURCES = 20-live-basic_die.c 20_live_basic_die_OBJECTS = 20-live-basic_die.$(OBJEXT) 20_live_basic_die_LDADD = $(LDADD) -20_live_basic_die_DEPENDENCIES = util.la ../src/libseccomp.la +20_live_basic_die_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 21_live_basic_allow_SOURCES = 21-live-basic_allow.c 21_live_basic_allow_OBJECTS = 21-live-basic_allow.$(OBJEXT) 21_live_basic_allow_LDADD = $(LDADD) -21_live_basic_allow_DEPENDENCIES = util.la ../src/libseccomp.la +21_live_basic_allow_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 22_sim_basic_chains_array_SOURCES = 22-sim-basic_chains_array.c 22_sim_basic_chains_array_OBJECTS = \ 22-sim-basic_chains_array.$(OBJEXT) 22_sim_basic_chains_array_LDADD = $(LDADD) -22_sim_basic_chains_array_DEPENDENCIES = util.la ../src/libseccomp.la +22_sim_basic_chains_array_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 23_sim_arch_all_le_basic_SOURCES = 23-sim-arch_all_le_basic.c 23_sim_arch_all_le_basic_OBJECTS = 23-sim-arch_all_le_basic.$(OBJEXT) 23_sim_arch_all_le_basic_LDADD = $(LDADD) -23_sim_arch_all_le_basic_DEPENDENCIES = util.la ../src/libseccomp.la +23_sim_arch_all_le_basic_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 24_live_arg_allow_SOURCES = 24-live-arg_allow.c 24_live_arg_allow_OBJECTS = 24-live-arg_allow.$(OBJEXT) 24_live_arg_allow_LDADD = $(LDADD) -24_live_arg_allow_DEPENDENCIES = util.la ../src/libseccomp.la +24_live_arg_allow_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 25_sim_multilevel_chains_adv_SOURCES = 25-sim-multilevel_chains_adv.c 25_sim_multilevel_chains_adv_OBJECTS = \ 25-sim-multilevel_chains_adv.$(OBJEXT) 25_sim_multilevel_chains_adv_LDADD = $(LDADD) 25_sim_multilevel_chains_adv_DEPENDENCIES = util.la \ - ../src/libseccomp.la + ../src/libseccomp.la $(am__DEPENDENCIES_1) 26_sim_arch_all_be_basic_SOURCES = 26-sim-arch_all_be_basic.c 26_sim_arch_all_be_basic_OBJECTS = 26-sim-arch_all_be_basic.$(OBJEXT) 26_sim_arch_all_be_basic_LDADD = $(LDADD) -26_sim_arch_all_be_basic_DEPENDENCIES = util.la ../src/libseccomp.la +26_sim_arch_all_be_basic_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 27_sim_bpf_blk_state_SOURCES = 27-sim-bpf_blk_state.c 27_sim_bpf_blk_state_OBJECTS = 27-sim-bpf_blk_state.$(OBJEXT) 27_sim_bpf_blk_state_LDADD = $(LDADD) -27_sim_bpf_blk_state_DEPENDENCIES = util.la ../src/libseccomp.la +27_sim_bpf_blk_state_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 28_sim_arch_x86_SOURCES = 28-sim-arch_x86.c 28_sim_arch_x86_OBJECTS = 28-sim-arch_x86.$(OBJEXT) 28_sim_arch_x86_LDADD = $(LDADD) -28_sim_arch_x86_DEPENDENCIES = util.la ../src/libseccomp.la +28_sim_arch_x86_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 29_sim_pseudo_syscall_SOURCES = 29-sim-pseudo_syscall.c 29_sim_pseudo_syscall_OBJECTS = 29-sim-pseudo_syscall.$(OBJEXT) 29_sim_pseudo_syscall_LDADD = $(LDADD) -29_sim_pseudo_syscall_DEPENDENCIES = util.la ../src/libseccomp.la +29_sim_pseudo_syscall_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 30_sim_socket_syscalls_SOURCES = 30-sim-socket_syscalls.c 30_sim_socket_syscalls_OBJECTS = 30-sim-socket_syscalls.$(OBJEXT) 30_sim_socket_syscalls_LDADD = $(LDADD) -30_sim_socket_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la +30_sim_socket_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 31_basic_version_check_SOURCES = 31-basic-version_check.c 31_basic_version_check_OBJECTS = 31-basic-version_check.$(OBJEXT) 31_basic_version_check_LDADD = $(LDADD) -31_basic_version_check_DEPENDENCIES = util.la ../src/libseccomp.la +31_basic_version_check_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 32_live_tsync_allow_SOURCES = 32-live-tsync_allow.c 32_live_tsync_allow_OBJECTS = 32-live-tsync_allow.$(OBJEXT) 32_live_tsync_allow_LDADD = $(LDADD) -32_live_tsync_allow_DEPENDENCIES = util.la ../src/libseccomp.la +32_live_tsync_allow_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) 33_sim_socket_syscalls_be_SOURCES = 33-sim-socket_syscalls_be.c 33_sim_socket_syscalls_be_OBJECTS = \ 33-sim-socket_syscalls_be.$(OBJEXT) 33_sim_socket_syscalls_be_LDADD = $(LDADD) -33_sim_socket_syscalls_be_DEPENDENCIES = util.la ../src/libseccomp.la +33_sim_socket_syscalls_be_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) +35_sim_negative_one_SOURCES = 35-sim-negative_one.c +35_sim_negative_one_OBJECTS = 35-sim-negative_one.$(OBJEXT) +35_sim_negative_one_LDADD = $(LDADD) +35_sim_negative_one_DEPENDENCIES = util.la ../src/libseccomp.la \ + $(am__DEPENDENCIES_1) miniseq_SOURCES = miniseq.c miniseq_OBJECTS = miniseq.$(OBJEXT) miniseq_DEPENDENCIES = @@ -338,7 +385,8 @@ 26-sim-arch_all_be_basic.c 27-sim-bpf_blk_state.c \ 28-sim-arch_x86.c 29-sim-pseudo_syscall.c \ 30-sim-socket_syscalls.c 31-basic-version_check.c \ - 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c miniseq.c + 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c \ + 35-sim-negative_one.c miniseq.c DIST_SOURCES = $(util_la_SOURCES) 01-sim-allow.c 02-sim-basic.c \ 03-sim-basic_chains.c 04-sim-multilevel_chains.c \ 05-sim-long_jumps.c 06-sim-actions.c 07-sim-db_bug_looping.c \ @@ -353,7 +401,8 @@ 26-sim-arch_all_be_basic.c 27-sim-bpf_blk_state.c \ 28-sim-arch_x86.c 29-sim-pseudo_syscall.c \ 30-sim-socket_syscalls.c 31-basic-version_check.c \ - 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c miniseq.c + 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c \ + 35-sim-negative_one.c miniseq.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -400,13 +449,15 @@ std=''; \ fi; \ } +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AM_LDFLAGS = -static +AM_LDFLAGS = ${DBG_STATIC} AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -415,6 +466,12 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -429,12 +486,15 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -524,7 +584,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -LDADD = util.la ../src/libseccomp.la +@CODE_COVERAGE_ENABLED_FALSE@DBG_STATIC = -static +@CODE_COVERAGE_ENABLED_TRUE@DBG_STATIC = +LDADD = util.la ../src/libseccomp.la ${CODE_COVERAGE_LIBS} check_LTLIBRARIES = util.la util_la_SOURCES = util.c util.h util_la_LDFLAGS = -module @@ -564,7 +626,8 @@ 30-sim-socket_syscalls.py \ 31-basic-version_check.py \ 32-live-tsync_allow.py \ - 33-sim-socket_syscalls_be.py + 33-sim-socket_syscalls_be.py \ + 35-sim-negative_one.py EXTRA_DIST_TESTCFGS = \ 01-sim-allow.tests \ @@ -599,7 +662,8 @@ 30-sim-socket_syscalls.tests \ 31-basic-version_check.tests \ 32-live-tsync_allow.tests \ - 33-sim-socket_syscalls_be.tests + 33-sim-socket_syscalls_be.tests \ + 35-sim-negative_one.tests EXTRA_DIST_TESTSCRIPTS = regression testdiff testgen EXTRA_DIST_TESTVALGRIND = valgrind_test.supp @@ -626,7 +690,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -803,6 +866,10 @@ 33-sim-socket_syscalls_be$(EXEEXT): $(33_sim_socket_syscalls_be_OBJECTS) $(33_sim_socket_syscalls_be_DEPENDENCIES) $(EXTRA_33_sim_socket_syscalls_be_DEPENDENCIES) @rm -f 33-sim-socket_syscalls_be$(EXEEXT) $(AM_V_CCLD)$(LINK) $(33_sim_socket_syscalls_be_OBJECTS) $(33_sim_socket_syscalls_be_LDADD) $(LIBS) + +35-sim-negative_one$(EXEEXT): $(35_sim_negative_one_OBJECTS) $(35_sim_negative_one_DEPENDENCIES) $(EXTRA_35_sim_negative_one_DEPENDENCIES) + @rm -f 35-sim-negative_one$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(35_sim_negative_one_OBJECTS) $(35_sim_negative_one_LDADD) $(LIBS) miniseq$(EXEEXT): $(miniseq_OBJECTS) $(miniseq_DEPENDENCIES) $(EXTRA_miniseq_DEPENDENCIES) @rm -f miniseq$(EXEEXT) @@ -848,6 +915,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/31-basic-version_check.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/32-live-tsync_allow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/33-sim-socket_syscalls_be.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/35-sim-negative_one.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miniseq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ @@ -1180,6 +1248,10 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am +.PRECIOUS: Makefile + + +@CODE_COVERAGE_RULES@ check-build: ${MAKE} ${AM_MAKEFLAGS} ${check_PROGRAMS} diff --git a/tests/miniseq.c b/tests/miniseq.c index 7addc70..120fdb2 100644 --- a/tests/miniseq.c +++ b/tests/miniseq.c @@ -50,8 +50,9 @@ if (get_number(argv[1], &first) || get_number(argv[2], &last)) return 1; - for (cur = first; cur <= last; cur++) - printf("%" PRIu64 "\n", cur); + for (cur = first; cur != last; cur++) + printf("%" PRId64 "\n", cur); + printf("%" PRId64 "\n", cur); return 0; } diff --git a/tests/regression b/tests/regression index 53d26b2..10890cc 100755 --- a/tests/regression +++ b/tests/regression @@ -82,6 +82,7 @@ -s SINGLE_TEST specifies individual test number to be run -t [TEMP_DIR] specifies directory to create temporary files in -T [TEST_TYPE] only run tests matching the specified type + can also be set via LIBSECCOMP_TSTCFG_TYPE env variable -v specifies that verbose output be provided EOF } @@ -278,6 +279,10 @@ local line=($3) local testname=${line[0]} local stress_count=${line[1]} + + # check for stress count configuration via environment variables + [[ -n $LIBSECCOMP_TSTCFG_STRESSCNT ]] && \ + stress_count=$LIBSECCOMP_TSTCFG_STRESSCNT for i in $(get_seq 1 $stress_count); do local sys=$(generate_random_data) @@ -470,7 +475,7 @@ # get low and high syscall values and convert them to numbers low_syscall=$(get_range $LOW "${line[2]}") - if [[ ! $low_syscall =~ ^[0-9]+$ ]]; then + if [[ ! $low_syscall =~ ^\-?[0-9]+$ ]]; then low_syscall=$($GLBL_SYS_RESOLVER -a $simarch -t \ $low_syscall) if [[ $? -ne 0 ]]; then @@ -481,7 +486,7 @@ fi fi high_syscall=$(get_range $HIGH "${line[2]}") - if [[ ! $high_syscall =~ ^[0-9]+$ ]]; then + if [[ ! $high_syscall =~ ^\-?[0-9]+$ ]]; then high_syscall=$($GLBL_SYS_RESOLVER -a $simarch -t \ $high_syscall) if [[ $? -ne 0 ]]; then @@ -961,6 +966,9 @@ single_list=() fi +# check for configuration via environment variables +[[ -z $type && -n $LIBSECCOMP_TSTCFG_TYPE ]] && type=$LIBSECCOMP_TSTCFG_TYPE + # open log file for append (default to stdout) if [[ -n $logfile ]]; then logfd=3 diff --git a/tests/util.py b/tests/util.py index f085c88..e601f2d 100644 --- a/tests/util.py +++ b/tests/util.py @@ -100,8 +100,8 @@ Description: Open the specified file, write a string to the file, and close the file. """ - fd = os.open(path, os.O_WRONLY|os.O_CREAT, 0600) - if not os.write(fd, "testing") == len("testing"): + fd = os.open(str(path), os.O_WRONLY|os.O_CREAT) + if not os.write(fd, b"testing") == len("testing"): raise IOError("failed to write the full test string in write_file()") os.close(fd) diff --git a/tools/Makefile.in b/tools/Makefile.in index 1dd44a4..6f4f3ef 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -34,7 +34,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -101,15 +111,14 @@ noinst_PROGRAMS = scmp_arch_detect$(EXEEXT) scmp_bpf_disasm$(EXEEXT) \ scmp_bpf_sim$(EXEEXT) subdir = tools -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/configure.h CONFIG_CLEAN_FILES = @@ -211,6 +220,8 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -226,6 +237,12 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ +CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -240,12 +257,15 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GCOV = @GCOV@ +GENHTML = @GENHTML@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -363,7 +383,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -719,6 +738,8 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.