New upstream version 2.3.3
Felix Geyer
6 years ago
0 | 0 | libseccomp: Releases |
1 | 1 | =============================================================================== |
2 | 2 | https://github.com/seccomp/libseccomp |
3 | ||
4 | * Version 2.3.3 - January 10, 2018 | |
5 | - Updated the syscall table for Linux v4.15-rc7 | |
6 | ||
7 | * Version 2.3.2 - February 27, 2017 | |
8 | - Achieved full compliance with the CII Best Practices program | |
9 | - Added Travis CI builds to the GitHub repository | |
10 | - Added code coverage reporting with the "--enable-code-coverage" configure | |
11 | flag and added Coveralls to the GitHub repository | |
12 | - Updated the syscall tables to match Linux v4.10-rc6+ | |
13 | - Support for building with Python v3.x | |
14 | - Allow rules with the -1 syscall if the SCMP\_FLTATR\_API\_TSKIP attribute is | |
15 | set to true | |
16 | - Several small documentation fixes | |
3 | 17 | |
4 | 18 | * Version 2.3.1 - April 20, 2016 |
5 | 19 | - Fixed a problem with 32-bit x86 socket syscalls on some systems |
0 | 0 | libseccomp: Contributors |
1 | =============================================================================== | |
1 | ======================================================================== | |
2 | 2 | https://github.com/seccomp/libseccomp |
3 | 3 | |
4 | 4 | Andrew Jones <drjones@redhat.com> |
8 | 8 | Brian Cain <brian.cain@gmail.com> |
9 | 9 | Colin Walters <walters@verbum.org> |
10 | 10 | Corey Bryant <coreyb@linux.vnet.ibm.com> |
11 | David Drysdale <drysdale@google.com> | |
11 | 12 | Eduardo Otubo <otubo@linux.vnet.ibm.com> |
12 | 13 | Eric Paris <eparis@redhat.com> |
13 | 14 | Heiko Carstens <heiko.carstens@de.ibm.com> |
15 | Helge Deller <deller@gmx.de> | |
14 | 16 | Jake Edge <jake@lwn.net> |
15 | 17 | Jan Engelhardt <jengelh@inai.de> |
16 | 18 | Jan Willeke <willeke@linux.vnet.ibm.com> |
19 | Jay Guo <guojiannan@cn.ibm.com> | |
20 | Jiannan Guo <guojiannan1101@gmail.com> | |
17 | 21 | Joe MacDonald <joe@deserted.net> |
22 | Justin Cormack <justin.cormack@docker.com> | |
18 | 23 | Kees Cook <keescook@chromium.org> |
24 | Kyle R. Conway <kyle.r.conway@gmail.com> | |
25 | Luca Bruno <lucab@debian.org> | |
19 | 26 | Marcin Juszkiewicz <mjuszkiewicz@redhat.com> |
20 | 27 | Marcus Meissner <meissner@suse.de> |
21 | 28 | Markos Chandras <markos.chandras@imgtec.com> |
25 | 32 | Mike Strosaker <strosake@linux.vnet.ibm.com> |
26 | 33 | Paul Moore <paul@paul-moore.com> |
27 | 34 | Serge Hallyn <serge.hallyn@ubuntu.com> |
35 | Tobias Klauser <tklauser@distanz.ch> | |
28 | 36 | Thiago Marcos P. Santos <thiago.santos@intel.com> |
37 | valoq <valoq@mailbox.org> | |
29 | 38 | Vicente Olivert Riera <Vincent.Riera@imgtec.com> |
30 | 39 | Vitaly Vi Shukela <vi0oss@gmail.com> |
40 | Vladimir Rutsky <rutsky@users.noreply.github.com> |
21 | 21 | pkgconfdir = ${libdir}/pkgconfig |
22 | 22 | pkgconf_DATA = libseccomp.pc |
23 | 23 | |
24 | EXTRA_DIST = CHANGELOG CREDITS LICENSE README SUBMITTING_PATCHES | |
24 | EXTRA_DIST = CHANGELOG CREDITS LICENSE README.md SUBMITTING_PATCHES | |
25 | 25 | |
26 | 26 | # support silent builds |
27 | 27 | AM_MAKEFLAGS_0 = --quiet --no-print-directory |
35 | 35 | |
36 | 36 | check-syntax: |
37 | 37 | @./tools/check-syntax |
38 | ||
39 | check-code-coverage: check-build | |
40 | ${MAKE} ${AM_MAKEFLAGS} -C tests check-code-coverage | |
38 | 41 | |
39 | 42 | if COVERITY |
40 | 43 | coverity-build: clean |
0 | # Makefile.in generated by automake 1.14.1 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.15.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2017 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
32 | 32 | # |
33 | 33 | |
34 | 34 | VPATH = @srcdir@ |
35 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' | |
35 | am__is_gnu_make = { \ | |
36 | if test -z '$(MAKELEVEL)'; then \ | |
37 | false; \ | |
38 | elif test -n '$(MAKE_HOST)'; then \ | |
39 | true; \ | |
40 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ | |
41 | true; \ | |
42 | else \ | |
43 | false; \ | |
44 | fi; \ | |
45 | } | |
36 | 46 | am__make_running_with_option = \ |
37 | 47 | case $${target_option-} in \ |
38 | 48 | ?) ;; \ |
96 | 106 | build_triplet = @build@ |
97 | 107 | host_triplet = @host@ |
98 | 108 | subdir = . |
99 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ | |
100 | $(top_srcdir)/configure $(am__configure_deps) \ | |
101 | $(srcdir)/configure.h.in $(srcdir)/libseccomp.pc.in README \ | |
102 | build-aux/ar-lib build-aux/compile build-aux/config.guess \ | |
103 | build-aux/config.sub build-aux/depcomp build-aux/install-sh \ | |
104 | build-aux/missing build-aux/ltmain.sh \ | |
105 | $(top_srcdir)/build-aux/ar-lib $(top_srcdir)/build-aux/compile \ | |
106 | $(top_srcdir)/build-aux/config.guess \ | |
107 | $(top_srcdir)/build-aux/config.sub \ | |
108 | $(top_srcdir)/build-aux/install-sh \ | |
109 | $(top_srcdir)/build-aux/ltmain.sh \ | |
110 | $(top_srcdir)/build-aux/missing | |
111 | 109 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
112 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ | |
113 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | |
114 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | |
115 | $(top_srcdir)/configure.ac | |
110 | am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ | |
111 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | |
112 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | |
113 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac | |
116 | 114 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
117 | 115 | $(ACLOCAL_M4) |
116 | DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ | |
117 | $(am__configure_deps) $(am__DIST_COMMON) | |
118 | 118 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ |
119 | 119 | configure.lineno config.status.lineno |
120 | 120 | mkinstalldirs = $(install_sh) -d |
207 | 207 | CTAGS = ctags |
208 | 208 | CSCOPE = cscope |
209 | 209 | DIST_SUBDIRS = $(SUBDIRS) |
210 | am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configure.h.in \ | |
211 | $(srcdir)/libseccomp.pc.in $(top_srcdir)/build-aux/ar-lib \ | |
212 | $(top_srcdir)/build-aux/compile \ | |
213 | $(top_srcdir)/build-aux/config.guess \ | |
214 | $(top_srcdir)/build-aux/config.sub \ | |
215 | $(top_srcdir)/build-aux/install-sh \ | |
216 | $(top_srcdir)/build-aux/ltmain.sh \ | |
217 | $(top_srcdir)/build-aux/missing build-aux/ar-lib \ | |
218 | build-aux/compile build-aux/config.guess build-aux/config.sub \ | |
219 | build-aux/install-sh build-aux/ltmain.sh build-aux/missing | |
210 | 220 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
211 | 221 | distdir = $(PACKAGE)-$(VERSION) |
212 | 222 | top_distdir = $(distdir) |
263 | 273 | CC = @CC@ |
264 | 274 | CCDEPMODE = @CCDEPMODE@ |
265 | 275 | CFLAGS = @CFLAGS@ |
276 | CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ | |
277 | CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ | |
278 | CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ | |
279 | CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ | |
280 | CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ | |
281 | CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ | |
266 | 282 | CPP = @CPP@ |
267 | 283 | CPPFLAGS = @CPPFLAGS@ |
268 | 284 | CYGPATH_W = @CYGPATH_W@ |
277 | 293 | EGREP = @EGREP@ |
278 | 294 | EXEEXT = @EXEEXT@ |
279 | 295 | FGREP = @FGREP@ |
296 | GCOV = @GCOV@ | |
297 | GENHTML = @GENHTML@ | |
280 | 298 | GREP = @GREP@ |
281 | 299 | INSTALL = @INSTALL@ |
282 | 300 | INSTALL_DATA = @INSTALL_DATA@ |
283 | 301 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
284 | 302 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
285 | 303 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
304 | LCOV = @LCOV@ | |
286 | 305 | LD = @LD@ |
287 | 306 | LDFLAGS = @LDFLAGS@ |
288 | 307 | LIBOBJS = @LIBOBJS@ |
376 | 395 | SUBDIRS = include src tools tests doc |
377 | 396 | pkgconfdir = ${libdir}/pkgconfig |
378 | 397 | pkgconf_DATA = libseccomp.pc |
379 | EXTRA_DIST = CHANGELOG CREDITS LICENSE README SUBMITTING_PATCHES | |
398 | EXTRA_DIST = CHANGELOG CREDITS LICENSE README.md SUBMITTING_PATCHES | |
380 | 399 | |
381 | 400 | # support silent builds |
382 | 401 | AM_MAKEFLAGS_0 = --quiet --no-print-directory |
402 | 421 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ |
403 | 422 | $(am__cd) $(top_srcdir) && \ |
404 | 423 | $(AUTOMAKE) --foreign Makefile |
405 | .PRECIOUS: Makefile | |
406 | 424 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
407 | 425 | @case '$?' in \ |
408 | 426 | *config.status*) \ |
640 | 658 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ |
641 | 659 | || chmod -R a+r "$(distdir)" |
642 | 660 | dist-gzip: distdir |
643 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz | |
661 | tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz | |
644 | 662 | $(am__post_remove_distdir) |
645 | 663 | |
646 | 664 | dist-bzip2: distdir |
656 | 674 | $(am__post_remove_distdir) |
657 | 675 | |
658 | 676 | dist-tarZ: distdir |
677 | @echo WARNING: "Support for distribution archives compressed with" \ | |
678 | "legacy program 'compress' is deprecated." >&2 | |
679 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 | |
680 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z | |
681 | $(am__post_remove_distdir) | |
682 | ||
683 | dist-shar: distdir | |
659 | 684 | @echo WARNING: "Support for shar distribution archives is" \ |
660 | 685 | "deprecated." >&2 |
661 | 686 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 |
662 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z | |
663 | $(am__post_remove_distdir) | |
664 | ||
665 | dist-shar: distdir | |
666 | @echo WARNING: "Support for distribution archives compressed with" \ | |
667 | "legacy program 'compress' is deprecated." >&2 | |
668 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 | |
669 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz | |
687 | shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz | |
670 | 688 | $(am__post_remove_distdir) |
671 | 689 | |
672 | 690 | dist-zip: distdir |
684 | 702 | distcheck: dist |
685 | 703 | case '$(DIST_ARCHIVES)' in \ |
686 | 704 | *.tar.gz*) \ |
687 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ | |
705 | eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ | |
688 | 706 | *.tar.bz2*) \ |
689 | 707 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ |
690 | 708 | *.tar.lz*) \ |
694 | 712 | *.tar.Z*) \ |
695 | 713 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ |
696 | 714 | *.shar.gz*) \ |
697 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ | |
715 | eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ | |
698 | 716 | *.zip*) \ |
699 | 717 | unzip $(distdir).zip ;;\ |
700 | 718 | esac |
701 | 719 | chmod -R a-w $(distdir) |
702 | 720 | chmod u+w $(distdir) |
703 | mkdir $(distdir)/_build $(distdir)/_inst | |
721 | mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst | |
704 | 722 | chmod a-w $(distdir) |
705 | 723 | test -d $(distdir)/_build || exit 0; \ |
706 | 724 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ |
707 | 725 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ |
708 | 726 | && am__cwd=`pwd` \ |
709 | && $(am__cd) $(distdir)/_build \ | |
710 | && ../configure \ | |
727 | && $(am__cd) $(distdir)/_build/sub \ | |
728 | && ../../configure \ | |
711 | 729 | $(AM_DISTCHECK_CONFIGURE_FLAGS) \ |
712 | 730 | $(DISTCHECK_CONFIGURE_FLAGS) \ |
713 | --srcdir=.. --prefix="$$dc_install_base" \ | |
731 | --srcdir=../.. --prefix="$$dc_install_base" \ | |
714 | 732 | && $(MAKE) $(AM_MAKEFLAGS) \ |
715 | 733 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ |
716 | 734 | && $(MAKE) $(AM_MAKEFLAGS) check \ |
891 | 909 | ps ps-am tags tags-am uninstall uninstall-am \ |
892 | 910 | uninstall-pkgconfDATA |
893 | 911 | |
912 | .PRECIOUS: Makefile | |
913 | ||
894 | 914 | |
895 | 915 | check-build: all |
896 | 916 | ${MAKE} ${AM_MAKEFLAGS} -C src check-build |
898 | 918 | |
899 | 919 | check-syntax: |
900 | 920 | @./tools/check-syntax |
921 | ||
922 | check-code-coverage: check-build | |
923 | ${MAKE} ${AM_MAKEFLAGS} -C tests check-code-coverage | |
901 | 924 | |
902 | 925 | @COVERITY_TRUE@coverity-build: clean |
903 | 926 | @COVERITY_TRUE@ cov-build --dir cov-int ${MAKE} ${AM_MAKEFLAGS} check-build |
0 | libseccomp: An Enhanced Seccomp (mode 2) Helper Library | |
1 | =============================================================================== | |
2 | https://github.com/seccomp/libseccomp | |
3 | ||
4 | The libseccomp library provides an easy to use, platform independent, interface | |
5 | to the Linux Kernel's syscall filtering mechanism. The libseccomp API is | |
6 | designed to abstract away the underlying BPF based syscall filter language and | |
7 | present a more conventional function-call based filtering interface that should | |
8 | be familiar to, and easily adopted by, application developers. | |
9 | ||
10 | * Online Resources | |
11 | ||
12 | The library source repository currently lives on GitHub at the following URL: | |
13 | ||
14 | -> https://github.com/seccomp/libseccomp | |
15 | ||
16 | The project mailing list is currently hosted on Google Groups at the URL below, | |
17 | please note that a Google account is not required to subscribe to the mailing | |
18 | list. | |
19 | ||
20 | -> https://groups.google.com/forum/#!forum/libseccomp | |
21 | -> https://groups.google.com/forum/#!forum/libseccomp/join | |
22 | ||
23 | * Documentation | |
24 | ||
25 | The "doc/" directory contains all of the currently available documentation, | |
26 | mostly in the form of manpages. The top level directory also contains a README | |
27 | file (this file) as well as the LICENSE, CREDITS, SUBMITTING_PATCHES, and | |
28 | CHANGELOG files. | |
29 | ||
30 | Those who are interested in contributing to the the project are encouraged to | |
31 | read the SUBMITTING_PATCHES in the top level directory. | |
32 | ||
33 | * Building and Installing the Library | |
34 | ||
35 | If you are building the libseccomp library from an official release tarball, | |
36 | you should follow the familiar three step process used by most autotools based | |
37 | applications: | |
38 | ||
39 | # ./configure | |
40 | # make [V=0|1] | |
41 | # make install | |
42 | ||
43 | However, if you are building the library from sources retrieved from the source | |
44 | repository you may need to run the autogen.sh script before running configure. | |
45 | In both cases, running "./configure -h" will display a list of build-time | |
46 | configuration options. | |
47 | ||
48 | * Testing the Library | |
49 | ||
50 | There are a number of tests located in the "tests/" directory and a make target | |
51 | which can be used to help automate their execution. If you want to run the | |
52 | standard regression tests you can execute the following after building the | |
53 | library: | |
54 | ||
55 | # make check | |
56 | ||
57 | Be warned that the test run can take a while to run and produces a lot of | |
58 | output. | |
59 | ||
60 | * Other Useful Tools | |
61 | ||
62 | The "tools/" directory includes a number of tools which may be helpful in the | |
63 | development of the library, or applications using the library. Not all of | |
64 | these tools are installed by default. |
0 | An Enhanced Seccomp (seccomp-bpf) Helper Library | |
1 | =============================================================================== | |
2 | https://github.com/seccomp/libseccomp | |
3 | ||
4 | [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/608/badge)](https://bestpractices.coreinfrastructure.org/projects/608) | |
5 | [![Build Status](https://travis-ci.org/seccomp/libseccomp.svg?branch=release-2.3)](https://travis-ci.org/seccomp/libseccomp) | |
6 | [![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) | |
7 | ||
8 | The libseccomp library provides an easy to use, platform independent, interface | |
9 | to the Linux Kernel's syscall filtering mechanism. The libseccomp API is | |
10 | designed to abstract away the underlying BPF based syscall filter language and | |
11 | present a more conventional function-call based filtering interface that should | |
12 | be familiar to, and easily adopted by, application developers. | |
13 | ||
14 | ## Online Resources | |
15 | ||
16 | The library source repository currently lives on GitHub at the following URL: | |
17 | ||
18 | * https://github.com/seccomp/libseccomp | |
19 | ||
20 | The project mailing list is currently hosted on Google Groups at the URL below, | |
21 | please note that a Google account is not required to subscribe to the mailing | |
22 | list. | |
23 | ||
24 | * https://groups.google.com/forum/#!forum/libseccomp | |
25 | * https://groups.google.com/forum/#!forum/libseccomp/join | |
26 | ||
27 | ## Documentation | |
28 | ||
29 | The "doc/" directory contains all of the currently available documentation, | |
30 | mostly in the form of manpages. The top level directory also contains a README | |
31 | file (this file) as well as the LICENSE, CREDITS, SUBMITTING_PATCHES, and | |
32 | CHANGELOG files. | |
33 | ||
34 | Those who are interested in contributing to the the project are encouraged to | |
35 | read the SUBMITTING_PATCHES in the top level directory. | |
36 | ||
37 | ## Building and Installing the Library | |
38 | ||
39 | If you are building the libseccomp library from an official release tarball, | |
40 | you should follow the familiar three step process used by most autotools based | |
41 | applications: | |
42 | ||
43 | # ./configure | |
44 | # make [V=0|1] | |
45 | # make install | |
46 | ||
47 | However, if you are building the library from sources retrieved from the source | |
48 | repository you may need to run the autogen.sh script before running configure. | |
49 | In both cases, running "./configure -h" will display a list of build-time | |
50 | configuration options. | |
51 | ||
52 | ## Testing the Library | |
53 | ||
54 | There are a number of tests located in the "tests/" directory and a make target | |
55 | which can be used to help automate their execution. If you want to run the | |
56 | standard regression tests you can execute the following after building the | |
57 | library: | |
58 | ||
59 | # make check | |
60 | ||
61 | Be warned that the test run can take a while to run and produces a lot of | |
62 | output. | |
63 | ||
64 | ## Developer Tools | |
65 | ||
66 | The "tools/" directory includes a number of tools which may be helpful in the | |
67 | development of the library, or applications using the library. Not all of | |
68 | these tools are installed by default. | |
69 | ||
70 | ## Bug and Vulnerability Reporting | |
71 | ||
72 | Problems with the libseccomp library can be reported using the GitHub issue | |
73 | tracking system or the mailing list. Those who wish to privately report | |
74 | potential vulnerabilities can send mail to paul@paul-moore.com. |
0 | # generated automatically by aclocal 1.14.1 -*- Autoconf -*- | |
1 | ||
2 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. | |
0 | # generated automatically by aclocal 1.15.1 -*- Autoconf -*- | |
1 | ||
2 | # Copyright (C) 1996-2017 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | # This file is free software; the Free Software Foundation |
5 | 5 | # gives unlimited permission to copy and/or distribute it, |
19 | 19 | If you have problems, you may need to regenerate the build system entirely. |
20 | 20 | To do so, use the procedure documented by the package, typically 'autoreconf'.])]) |
21 | 21 | |
22 | # Copyright (C) 2002-2013 Free Software Foundation, Inc. | |
22 | # Copyright (C) 2002-2017 Free Software Foundation, Inc. | |
23 | 23 | # |
24 | 24 | # This file is free software; the Free Software Foundation |
25 | 25 | # gives unlimited permission to copy and/or distribute it, |
31 | 31 | # generated from the m4 files accompanying Automake X.Y. |
32 | 32 | # (This private macro should not be called outside this file.) |
33 | 33 | AC_DEFUN([AM_AUTOMAKE_VERSION], |
34 | [am__api_version='1.14' | |
34 | [am__api_version='1.15' | |
35 | 35 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to |
36 | 36 | dnl require some minimum version. Point them to the right macro. |
37 | m4_if([$1], [1.14.1], [], | |
37 | m4_if([$1], [1.15.1], [], | |
38 | 38 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl |
39 | 39 | ]) |
40 | 40 | |
50 | 50 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. |
51 | 51 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
52 | 52 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
53 | [AM_AUTOMAKE_VERSION([1.14.1])dnl | |
53 | [AM_AUTOMAKE_VERSION([1.15.1])dnl | |
54 | 54 | m4_ifndef([AC_AUTOCONF_VERSION], |
55 | 55 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
56 | 56 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
57 | 57 | |
58 | # Copyright (C) 2011-2013 Free Software Foundation, Inc. | |
58 | # Copyright (C) 2011-2017 Free Software Foundation, Inc. | |
59 | 59 | # |
60 | 60 | # This file is free software; the Free Software Foundation |
61 | 61 | # gives unlimited permission to copy and/or distribute it, |
117 | 117 | |
118 | 118 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- |
119 | 119 | |
120 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. | |
120 | # Copyright (C) 2001-2017 Free Software Foundation, Inc. | |
121 | 121 | # |
122 | 122 | # This file is free software; the Free Software Foundation |
123 | 123 | # gives unlimited permission to copy and/or distribute it, |
162 | 162 | # configured tree to be moved without reconfiguration. |
163 | 163 | |
164 | 164 | AC_DEFUN([AM_AUX_DIR_EXPAND], |
165 | [dnl Rely on autoconf to set up CDPATH properly. | |
166 | AC_PREREQ([2.50])dnl | |
167 | # expand $ac_aux_dir to an absolute path | |
168 | am_aux_dir=`cd $ac_aux_dir && pwd` | |
165 | [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl | |
166 | # Expand $ac_aux_dir to an absolute path. | |
167 | am_aux_dir=`cd "$ac_aux_dir" && pwd` | |
169 | 168 | ]) |
170 | 169 | |
171 | 170 | # AM_CONDITIONAL -*- Autoconf -*- |
172 | 171 | |
173 | # Copyright (C) 1997-2013 Free Software Foundation, Inc. | |
172 | # Copyright (C) 1997-2017 Free Software Foundation, Inc. | |
174 | 173 | # |
175 | 174 | # This file is free software; the Free Software Foundation |
176 | 175 | # gives unlimited permission to copy and/or distribute it, |
201 | 200 | Usually this means the macro was only invoked conditionally.]]) |
202 | 201 | fi])]) |
203 | 202 | |
204 | # Copyright (C) 1999-2013 Free Software Foundation, Inc. | |
203 | # Copyright (C) 1999-2017 Free Software Foundation, Inc. | |
205 | 204 | # |
206 | 205 | # This file is free software; the Free Software Foundation |
207 | 206 | # gives unlimited permission to copy and/or distribute it, |
392 | 391 | |
393 | 392 | # Generate code to set up dependency tracking. -*- Autoconf -*- |
394 | 393 | |
395 | # Copyright (C) 1999-2013 Free Software Foundation, Inc. | |
394 | # Copyright (C) 1999-2017 Free Software Foundation, Inc. | |
396 | 395 | # |
397 | 396 | # This file is free software; the Free Software Foundation |
398 | 397 | # gives unlimited permission to copy and/or distribute it, |
468 | 467 | |
469 | 468 | # Do all the work for Automake. -*- Autoconf -*- |
470 | 469 | |
471 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. | |
470 | # Copyright (C) 1996-2017 Free Software Foundation, Inc. | |
472 | 471 | # |
473 | 472 | # This file is free software; the Free Software Foundation |
474 | 473 | # gives unlimited permission to copy and/or distribute it, |
558 | 557 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> |
559 | 558 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> |
560 | 559 | AC_SUBST([mkdir_p], ['$(MKDIR_P)']) |
561 | # We need awk for the "check" target. The system "awk" is bad on | |
562 | # some platforms. | |
560 | # We need awk for the "check" target (and possibly the TAP driver). The | |
561 | # system "awk" is bad on some platforms. | |
563 | 562 | AC_REQUIRE([AC_PROG_AWK])dnl |
564 | 563 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
565 | 564 | AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
632 | 631 | END |
633 | 632 | AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) |
634 | 633 | fi |
635 | fi]) | |
634 | fi | |
635 | dnl The trailing newline in this macro's definition is deliberate, for | |
636 | dnl backward compatibility and to allow trailing 'dnl'-style comments | |
637 | dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. | |
638 | ]) | |
636 | 639 | |
637 | 640 | dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not |
638 | 641 | dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further |
661 | 664 | done |
662 | 665 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) |
663 | 666 | |
664 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. | |
667 | # Copyright (C) 2001-2017 Free Software Foundation, Inc. | |
665 | 668 | # |
666 | 669 | # This file is free software; the Free Software Foundation |
667 | 670 | # gives unlimited permission to copy and/or distribute it, |
672 | 675 | # Define $install_sh. |
673 | 676 | AC_DEFUN([AM_PROG_INSTALL_SH], |
674 | 677 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
675 | if test x"${install_sh}" != xset; then | |
678 | if test x"${install_sh+set}" != xset; then | |
676 | 679 | case $am_aux_dir in |
677 | 680 | *\ * | *\ *) |
678 | 681 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; |
682 | 685 | fi |
683 | 686 | AC_SUBST([install_sh])]) |
684 | 687 | |
685 | # Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
688 | # Copyright (C) 2003-2017 Free Software Foundation, Inc. | |
686 | 689 | # |
687 | 690 | # This file is free software; the Free Software Foundation |
688 | 691 | # gives unlimited permission to copy and/or distribute it, |
703 | 706 | |
704 | 707 | # Check to see how 'make' treats includes. -*- Autoconf -*- |
705 | 708 | |
706 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. | |
709 | # Copyright (C) 2001-2017 Free Software Foundation, Inc. | |
707 | 710 | # |
708 | 711 | # This file is free software; the Free Software Foundation |
709 | 712 | # gives unlimited permission to copy and/or distribute it, |
753 | 756 | |
754 | 757 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- |
755 | 758 | |
756 | # Copyright (C) 1997-2013 Free Software Foundation, Inc. | |
759 | # Copyright (C) 1997-2017 Free Software Foundation, Inc. | |
757 | 760 | # |
758 | 761 | # This file is free software; the Free Software Foundation |
759 | 762 | # gives unlimited permission to copy and/or distribute it, |
792 | 795 | |
793 | 796 | # Helper functions for option handling. -*- Autoconf -*- |
794 | 797 | |
795 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. | |
798 | # Copyright (C) 2001-2017 Free Software Foundation, Inc. | |
796 | 799 | # |
797 | 800 | # This file is free software; the Free Software Foundation |
798 | 801 | # gives unlimited permission to copy and/or distribute it, |
821 | 824 | AC_DEFUN([_AM_IF_OPTION], |
822 | 825 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) |
823 | 826 | |
824 | # Copyright (C) 1999-2013 Free Software Foundation, Inc. | |
827 | # Copyright (C) 1999-2017 Free Software Foundation, Inc. | |
825 | 828 | # |
826 | 829 | # This file is free software; the Free Software Foundation |
827 | 830 | # gives unlimited permission to copy and/or distribute it, |
868 | 871 | # For backward compatibility. |
869 | 872 | AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) |
870 | 873 | |
871 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. | |
874 | # Copyright (C) 2001-2017 Free Software Foundation, Inc. | |
872 | 875 | # |
873 | 876 | # This file is free software; the Free Software Foundation |
874 | 877 | # gives unlimited permission to copy and/or distribute it, |
887 | 890 | |
888 | 891 | # Check to make sure that the build environment is sane. -*- Autoconf -*- |
889 | 892 | |
890 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. | |
893 | # Copyright (C) 1996-2017 Free Software Foundation, Inc. | |
891 | 894 | # |
892 | 895 | # This file is free software; the Free Software Foundation |
893 | 896 | # gives unlimited permission to copy and/or distribute it, |
968 | 971 | rm -f conftest.file |
969 | 972 | ]) |
970 | 973 | |
971 | # Copyright (C) 2009-2013 Free Software Foundation, Inc. | |
974 | # Copyright (C) 2009-2017 Free Software Foundation, Inc. | |
972 | 975 | # |
973 | 976 | # This file is free software; the Free Software Foundation |
974 | 977 | # gives unlimited permission to copy and/or distribute it, |
1028 | 1031 | _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl |
1029 | 1032 | ]) |
1030 | 1033 | |
1031 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. | |
1034 | # Copyright (C) 2001-2017 Free Software Foundation, Inc. | |
1032 | 1035 | # |
1033 | 1036 | # This file is free software; the Free Software Foundation |
1034 | 1037 | # gives unlimited permission to copy and/or distribute it, |
1056 | 1059 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" |
1057 | 1060 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
1058 | 1061 | |
1059 | # Copyright (C) 2006-2013 Free Software Foundation, Inc. | |
1062 | # Copyright (C) 2006-2017 Free Software Foundation, Inc. | |
1060 | 1063 | # |
1061 | 1064 | # This file is free software; the Free Software Foundation |
1062 | 1065 | # gives unlimited permission to copy and/or distribute it, |
1075 | 1078 | |
1076 | 1079 | # Check how to create a tarball. -*- Autoconf -*- |
1077 | 1080 | |
1078 | # Copyright (C) 2004-2013 Free Software Foundation, Inc. | |
1081 | # Copyright (C) 2004-2017 Free Software Foundation, Inc. | |
1079 | 1082 | # |
1080 | 1083 | # This file is free software; the Free Software Foundation |
1081 | 1084 | # gives unlimited permission to copy and/or distribute it, |
1206 | 1209 | AC_SUBST([am__untar]) |
1207 | 1210 | ]) # _AM_PROG_TAR |
1208 | 1211 | |
1212 | m4_include([m4/ax_code_coverage.m4]) | |
1209 | 1213 | m4_include([m4/libtool.m4]) |
1210 | 1214 | m4_include([m4/ltoptions.m4]) |
1211 | 1215 | m4_include([m4/ltsugar.m4]) |
3 | 3 | me=ar-lib |
4 | 4 | scriptversion=2012-03-01.08; # UTC |
5 | 5 | |
6 | # Copyright (C) 2010-2013 Free Software Foundation, Inc. | |
6 | # Copyright (C) 2010-2017 Free Software Foundation, Inc. | |
7 | 7 | # Written by Peter Rosin <peda@lysator.liu.se>. |
8 | 8 | # |
9 | 9 | # This program is free software; you can redistribute it and/or modify |
0 | 0 | #! /bin/sh |
1 | 1 | # Wrapper for compilers which do not understand '-c -o'. |
2 | 2 | |
3 | scriptversion=2012-10-14.11; # UTC | |
4 | ||
5 | # Copyright (C) 1999-2013 Free Software Foundation, Inc. | |
3 | scriptversion=2016-01-11.22; # UTC | |
4 | ||
5 | # Copyright (C) 1999-2017 Free Software Foundation, Inc. | |
6 | 6 | # Written by Tom Tromey <tromey@cygnus.com>. |
7 | 7 | # |
8 | 8 | # This program is free software; you can redistribute it and/or modify |
254 | 254 | echo "compile $scriptversion" |
255 | 255 | exit $? |
256 | 256 | ;; |
257 | cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) | |
257 | cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ | |
258 | icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) | |
258 | 259 | func_cl_wrapper "$@" # Doesn't return... |
259 | 260 | ;; |
260 | 261 | esac |
341 | 342 | # eval: (add-hook 'write-file-hooks 'time-stamp) |
342 | 343 | # time-stamp-start: "scriptversion=" |
343 | 344 | # time-stamp-format: "%:y-%02m-%02d.%02H" |
344 | # time-stamp-time-zone: "UTC" | |
345 | # time-stamp-time-zone: "UTC0" | |
345 | 346 | # time-stamp-end: "; # UTC" |
346 | 347 | # End: |
0 | 0 | #! /bin/sh |
1 | 1 | # Attempt to guess a canonical system name. |
2 | # Copyright 1992-2015 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2015-12-14' | |
2 | # Copyright 1992-2017 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2017-05-27' | |
5 | 5 | |
6 | 6 | # This file is free software; you can redistribute it and/or modify it |
7 | 7 | # under the terms of the GNU General Public License as published by |
26 | 26 | # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. |
27 | 27 | # |
28 | 28 | # You can get the latest version of this script from: |
29 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD | |
29 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | |
30 | 30 | # |
31 | 31 | # Please send patches to <config-patches@gnu.org>. |
32 | 32 | |
49 | 49 | GNU config.guess ($timestamp) |
50 | 50 | |
51 | 51 | Originally written by Per Bothner. |
52 | Copyright 1992-2015 Free Software Foundation, Inc. | |
52 | Copyright 1992-2017 Free Software Foundation, Inc. | |
53 | 53 | |
54 | 54 | This is free software; see the source for copying conditions. There is NO |
55 | 55 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
185 | 185 | *) machine=${UNAME_MACHINE_ARCH}-unknown ;; |
186 | 186 | esac |
187 | 187 | # The Operating System including object format, if it has switched |
188 | # to ELF recently, or will in the future. | |
188 | # to ELF recently (or will in the future) and ABI. | |
189 | 189 | case "${UNAME_MACHINE_ARCH}" in |
190 | arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) | |
190 | earm*) | |
191 | os=netbsdelf | |
192 | ;; | |
193 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) | |
191 | 194 | eval $set_cc_for_build |
192 | 195 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
193 | 196 | | grep -q __ELF__ |
236 | 239 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` |
237 | 240 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} |
238 | 241 | exit ;; |
242 | *:LibertyBSD:*:*) | |
243 | UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` | |
244 | echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} | |
245 | exit ;; | |
239 | 246 | *:ekkoBSD:*:*) |
240 | 247 | echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} |
241 | 248 | exit ;; |
267 | 274 | ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` |
268 | 275 | case "$ALPHA_CPU_TYPE" in |
269 | 276 | "EV4 (21064)") |
270 | UNAME_MACHINE="alpha" ;; | |
277 | UNAME_MACHINE=alpha ;; | |
271 | 278 | "EV4.5 (21064)") |
272 | UNAME_MACHINE="alpha" ;; | |
279 | UNAME_MACHINE=alpha ;; | |
273 | 280 | "LCA4 (21066/21068)") |
274 | UNAME_MACHINE="alpha" ;; | |
281 | UNAME_MACHINE=alpha ;; | |
275 | 282 | "EV5 (21164)") |
276 | UNAME_MACHINE="alphaev5" ;; | |
283 | UNAME_MACHINE=alphaev5 ;; | |
277 | 284 | "EV5.6 (21164A)") |
278 | UNAME_MACHINE="alphaev56" ;; | |
285 | UNAME_MACHINE=alphaev56 ;; | |
279 | 286 | "EV5.6 (21164PC)") |
280 | UNAME_MACHINE="alphapca56" ;; | |
287 | UNAME_MACHINE=alphapca56 ;; | |
281 | 288 | "EV5.7 (21164PC)") |
282 | UNAME_MACHINE="alphapca57" ;; | |
289 | UNAME_MACHINE=alphapca57 ;; | |
283 | 290 | "EV6 (21264)") |
284 | UNAME_MACHINE="alphaev6" ;; | |
291 | UNAME_MACHINE=alphaev6 ;; | |
285 | 292 | "EV6.7 (21264A)") |
286 | UNAME_MACHINE="alphaev67" ;; | |
293 | UNAME_MACHINE=alphaev67 ;; | |
287 | 294 | "EV6.8CB (21264C)") |
288 | UNAME_MACHINE="alphaev68" ;; | |
295 | UNAME_MACHINE=alphaev68 ;; | |
289 | 296 | "EV6.8AL (21264B)") |
290 | UNAME_MACHINE="alphaev68" ;; | |
297 | UNAME_MACHINE=alphaev68 ;; | |
291 | 298 | "EV6.8CX (21264D)") |
292 | UNAME_MACHINE="alphaev68" ;; | |
299 | UNAME_MACHINE=alphaev68 ;; | |
293 | 300 | "EV6.9A (21264/EV69A)") |
294 | UNAME_MACHINE="alphaev69" ;; | |
301 | UNAME_MACHINE=alphaev69 ;; | |
295 | 302 | "EV7 (21364)") |
296 | UNAME_MACHINE="alphaev7" ;; | |
303 | UNAME_MACHINE=alphaev7 ;; | |
297 | 304 | "EV7.9 (21364A)") |
298 | UNAME_MACHINE="alphaev79" ;; | |
305 | UNAME_MACHINE=alphaev79 ;; | |
299 | 306 | esac |
300 | 307 | # A Pn.n version is a patched version. |
301 | 308 | # A Vn.n version is a released version. |
302 | 309 | # A Tn.n version is a released field test version. |
303 | 310 | # A Xn.n version is an unreleased experimental baselevel. |
304 | 311 | # 1.2 uses "1.2" for uname -r. |
305 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | |
312 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` | |
306 | 313 | # Reset EXIT trap before exiting to avoid spurious non-zero exit code. |
307 | 314 | exitcode=$? |
308 | 315 | trap '' 0 |
375 | 382 | exit ;; |
376 | 383 | i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) |
377 | 384 | eval $set_cc_for_build |
378 | SUN_ARCH="i386" | |
385 | SUN_ARCH=i386 | |
379 | 386 | # If there is a compiler, see if it is configured for 64-bit objects. |
380 | 387 | # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. |
381 | 388 | # This test works for both compilers. |
382 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | |
389 | if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | |
383 | 390 | if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ |
384 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
391 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
385 | 392 | grep IS_64BIT_ARCH >/dev/null |
386 | 393 | then |
387 | SUN_ARCH="x86_64" | |
394 | SUN_ARCH=x86_64 | |
388 | 395 | fi |
389 | 396 | fi |
390 | 397 | echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
409 | 416 | exit ;; |
410 | 417 | sun*:*:4.2BSD:*) |
411 | 418 | UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` |
412 | test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 | |
419 | test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 | |
413 | 420 | case "`/bin/arch`" in |
414 | 421 | sun3) |
415 | 422 | echo m68k-sun-sunos${UNAME_RELEASE} |
634 | 641 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` |
635 | 642 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` |
636 | 643 | case "${sc_cpu_version}" in |
637 | 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 | |
638 | 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 | |
644 | 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 | |
645 | 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 | |
639 | 646 | 532) # CPU_PA_RISC2_0 |
640 | 647 | case "${sc_kernel_bits}" in |
641 | 32) HP_ARCH="hppa2.0n" ;; | |
642 | 64) HP_ARCH="hppa2.0w" ;; | |
643 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 | |
648 | 32) HP_ARCH=hppa2.0n ;; | |
649 | 64) HP_ARCH=hppa2.0w ;; | |
650 | '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 | |
644 | 651 | esac ;; |
645 | 652 | esac |
646 | 653 | fi |
679 | 686 | exit (0); |
680 | 687 | } |
681 | 688 | EOF |
682 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` | |
689 | (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` | |
683 | 690 | test -z "$HP_ARCH" && HP_ARCH=hppa |
684 | 691 | fi ;; |
685 | 692 | esac |
686 | if [ ${HP_ARCH} = "hppa2.0w" ] | |
693 | if [ ${HP_ARCH} = hppa2.0w ] | |
687 | 694 | then |
688 | 695 | eval $set_cc_for_build |
689 | 696 | |
696 | 703 | # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess |
697 | 704 | # => hppa64-hp-hpux11.23 |
698 | 705 | |
699 | if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | | |
706 | if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | | |
700 | 707 | grep -q __LP64__ |
701 | 708 | then |
702 | HP_ARCH="hppa2.0w" | |
709 | HP_ARCH=hppa2.0w | |
703 | 710 | else |
704 | HP_ARCH="hppa64" | |
711 | HP_ARCH=hppa64 | |
705 | 712 | fi |
706 | 713 | fi |
707 | 714 | echo ${HP_ARCH}-hp-hpux${HPUX_REV} |
806 | 813 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
807 | 814 | exit ;; |
808 | 815 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) |
809 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | |
810 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | |
816 | FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` | |
817 | FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` | |
811 | 818 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` |
812 | 819 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
813 | 820 | exit ;; |
814 | 821 | 5000:UNIX_System_V:4.*:*) |
815 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | |
816 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` | |
822 | FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` | |
823 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` | |
817 | 824 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
818 | 825 | exit ;; |
819 | 826 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) |
829 | 836 | UNAME_PROCESSOR=`/usr/bin/uname -p` |
830 | 837 | case ${UNAME_PROCESSOR} in |
831 | 838 | amd64) |
832 | echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
833 | *) | |
834 | echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
839 | UNAME_PROCESSOR=x86_64 ;; | |
840 | i386) | |
841 | UNAME_PROCESSOR=i586 ;; | |
835 | 842 | esac |
843 | echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` | |
836 | 844 | exit ;; |
837 | 845 | i*:CYGWIN*:*) |
838 | 846 | echo ${UNAME_MACHINE}-pc-cygwin |
895 | 903 | exit ;; |
896 | 904 | *:GNU/*:*:*) |
897 | 905 | # other systems with GNU libc and userland |
898 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} | |
906 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} | |
899 | 907 | exit ;; |
900 | 908 | i*86:Minix:*:*) |
901 | 909 | echo ${UNAME_MACHINE}-pc-minix |
918 | 926 | EV68*) UNAME_MACHINE=alphaev68 ;; |
919 | 927 | esac |
920 | 928 | objdump --private-headers /bin/sh | grep -q ld.so.1 |
921 | if test "$?" = 0 ; then LIBC="gnulibc1" ; fi | |
929 | if test "$?" = 0 ; then LIBC=gnulibc1 ; fi | |
922 | 930 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
923 | 931 | exit ;; |
924 | 932 | arc:Linux:*:* | arceb:Linux:*:*) |
992 | 1000 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` |
993 | 1001 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } |
994 | 1002 | ;; |
1003 | mips64el:Linux:*:*) | |
1004 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
1005 | exit ;; | |
995 | 1006 | openrisc*:Linux:*:*) |
996 | 1007 | echo or1k-unknown-linux-${LIBC} |
997 | 1008 | exit ;; |
1024 | 1035 | ppcle:Linux:*:*) |
1025 | 1036 | echo powerpcle-unknown-linux-${LIBC} |
1026 | 1037 | exit ;; |
1038 | riscv32:Linux:*:* | riscv64:Linux:*:*) | |
1039 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
1040 | exit ;; | |
1027 | 1041 | s390:Linux:*:* | s390x:Linux:*:*) |
1028 | 1042 | echo ${UNAME_MACHINE}-ibm-linux-${LIBC} |
1029 | 1043 | exit ;; |
1043 | 1057 | echo ${UNAME_MACHINE}-dec-linux-${LIBC} |
1044 | 1058 | exit ;; |
1045 | 1059 | x86_64:Linux:*:*) |
1046 | eval $set_cc_for_build | |
1047 | X86_64_ABI= | |
1048 | # If there is a compiler, see if it is configured for 32-bit objects. | |
1049 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | |
1050 | if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ | |
1051 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1052 | grep IS_X32 >/dev/null | |
1053 | then | |
1054 | X86_64_ABI=x32 | |
1055 | fi | |
1056 | fi | |
1057 | echo ${UNAME_MACHINE}-pc-linux-${LIBC}${X86_64_ABI} | |
1060 | echo ${UNAME_MACHINE}-pc-linux-${LIBC} | |
1058 | 1061 | exit ;; |
1059 | 1062 | xtensa*:Linux:*:*) |
1060 | 1063 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
1282 | 1285 | SX-8R:SUPER-UX:*:*) |
1283 | 1286 | echo sx8r-nec-superux${UNAME_RELEASE} |
1284 | 1287 | exit ;; |
1288 | SX-ACE:SUPER-UX:*:*) | |
1289 | echo sxace-nec-superux${UNAME_RELEASE} | |
1290 | exit ;; | |
1285 | 1291 | Power*:Rhapsody:*:*) |
1286 | 1292 | echo powerpc-apple-rhapsody${UNAME_RELEASE} |
1287 | 1293 | exit ;; |
1295 | 1301 | UNAME_PROCESSOR=powerpc |
1296 | 1302 | fi |
1297 | 1303 | if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then |
1298 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | |
1304 | if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | |
1299 | 1305 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ |
1300 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1301 | grep IS_64BIT_ARCH >/dev/null | |
1306 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1307 | grep IS_64BIT_ARCH >/dev/null | |
1302 | 1308 | then |
1303 | 1309 | case $UNAME_PROCESSOR in |
1304 | 1310 | i386) UNAME_PROCESSOR=x86_64 ;; |
1305 | 1311 | powerpc) UNAME_PROCESSOR=powerpc64 ;; |
1306 | 1312 | esac |
1313 | fi | |
1314 | # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc | |
1315 | if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ | |
1316 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1317 | grep IS_PPC >/dev/null | |
1318 | then | |
1319 | UNAME_PROCESSOR=powerpc | |
1307 | 1320 | fi |
1308 | 1321 | fi |
1309 | 1322 | elif test "$UNAME_PROCESSOR" = i386 ; then |
1319 | 1332 | exit ;; |
1320 | 1333 | *:procnto*:*:* | *:QNX:[0123456789]*:*) |
1321 | 1334 | UNAME_PROCESSOR=`uname -p` |
1322 | if test "$UNAME_PROCESSOR" = "x86"; then | |
1335 | if test "$UNAME_PROCESSOR" = x86; then | |
1323 | 1336 | UNAME_PROCESSOR=i386 |
1324 | 1337 | UNAME_MACHINE=pc |
1325 | 1338 | fi |
1328 | 1341 | *:QNX:*:4*) |
1329 | 1342 | echo i386-pc-qnx |
1330 | 1343 | exit ;; |
1331 | NEO-?:NONSTOP_KERNEL:*:*) | |
1344 | NEO-*:NONSTOP_KERNEL:*:*) | |
1332 | 1345 | echo neo-tandem-nsk${UNAME_RELEASE} |
1333 | 1346 | exit ;; |
1334 | 1347 | NSE-*:NONSTOP_KERNEL:*:*) |
1335 | 1348 | echo nse-tandem-nsk${UNAME_RELEASE} |
1336 | 1349 | exit ;; |
1337 | NSR-?:NONSTOP_KERNEL:*:*) | |
1350 | NSR-*:NONSTOP_KERNEL:*:*) | |
1338 | 1351 | echo nsr-tandem-nsk${UNAME_RELEASE} |
1352 | exit ;; | |
1353 | NSX-*:NONSTOP_KERNEL:*:*) | |
1354 | echo nsx-tandem-nsk${UNAME_RELEASE} | |
1339 | 1355 | exit ;; |
1340 | 1356 | *:NonStop-UX:*:*) |
1341 | 1357 | echo mips-compaq-nonstopux |
1350 | 1366 | # "uname -m" is not consistent, so use $cputype instead. 386 |
1351 | 1367 | # is converted to i386 for consistency with other x86 |
1352 | 1368 | # operating systems. |
1353 | if test "$cputype" = "386"; then | |
1369 | if test "$cputype" = 386; then | |
1354 | 1370 | UNAME_MACHINE=i386 |
1355 | 1371 | else |
1356 | 1372 | UNAME_MACHINE="$cputype" |
1392 | 1408 | echo i386-pc-xenix |
1393 | 1409 | exit ;; |
1394 | 1410 | i*86:skyos:*:*) |
1395 | echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' | |
1411 | echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` | |
1396 | 1412 | exit ;; |
1397 | 1413 | i*86:rdos:*:*) |
1398 | 1414 | echo ${UNAME_MACHINE}-pc-rdos |
1411 | 1427 | cat >&2 <<EOF |
1412 | 1428 | $0: unable to guess system type |
1413 | 1429 | |
1414 | This script, last modified $timestamp, has failed to recognize | |
1415 | the operating system you are using. It is advised that you | |
1416 | download the most up to date version of the config scripts from | |
1417 | ||
1418 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD | |
1430 | This script (version $timestamp), has failed to recognize the | |
1431 | operating system you are using. If your script is old, overwrite | |
1432 | config.guess and config.sub with the latest versions from: | |
1433 | ||
1434 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | |
1419 | 1435 | and |
1420 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD | |
1421 | ||
1422 | If the version you run ($0) is already up to date, please | |
1423 | send the following data and any information you think might be | |
1424 | pertinent to <config-patches@gnu.org> in order to provide the needed | |
1425 | information to handle your system. | |
1436 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub | |
1437 | ||
1438 | If $0 has already been updated, send the following data and any | |
1439 | information you think might be pertinent to config-patches@gnu.org to | |
1440 | provide the necessary information to handle your system. | |
1426 | 1441 | |
1427 | 1442 | config.guess timestamp = $timestamp |
1428 | 1443 |
0 | 0 | #! /bin/sh |
1 | 1 | # Configuration validation subroutine script. |
2 | # Copyright 1992-2015 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2015-12-14' | |
2 | # Copyright 1992-2017 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2017-04-02' | |
5 | 5 | |
6 | 6 | # This file is free software; you can redistribute it and/or modify it |
7 | 7 | # under the terms of the GNU General Public License as published by |
32 | 32 | # Otherwise, we print the canonical config type on stdout and succeed. |
33 | 33 | |
34 | 34 | # You can get the latest version of this script from: |
35 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD | |
35 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub | |
36 | 36 | |
37 | 37 | # This file is supposed to be the same for all GNU packages |
38 | 38 | # and recognize all the CPU types, system types and aliases |
66 | 66 | version="\ |
67 | 67 | GNU config.sub ($timestamp) |
68 | 68 | |
69 | Copyright 1992-2015 Free Software Foundation, Inc. | |
69 | Copyright 1992-2017 Free Software Foundation, Inc. | |
70 | 70 | |
71 | 71 | This is free software; see the source for copying conditions. There is NO |
72 | 72 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
116 | 116 | nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ |
117 | 117 | linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ |
118 | 118 | knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ |
119 | kopensolaris*-gnu* | \ | |
119 | kopensolaris*-gnu* | cloudabi*-eabi* | \ | |
120 | 120 | storm-chaos* | os2-emx* | rtmk-nova*) |
121 | 121 | os=-$maybe_os |
122 | 122 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` |
257 | 257 | | be32 | be64 \ |
258 | 258 | | bfin \ |
259 | 259 | | c4x | c8051 | clipper \ |
260 | | d10v | d30v | dlx | dsp16xx | dvp \ | |
260 | | d10v | d30v | dlx | dsp16xx \ | |
261 | 261 | | e2k | epiphany \ |
262 | 262 | | fido | fr30 | frv | ft32 \ |
263 | 263 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ |
264 | 264 | | hexagon \ |
265 | | i370 | i860 | i960 | ia64 \ | |
265 | | i370 | i860 | i960 | ia16 | ia64 \ | |
266 | 266 | | ip2k | iq2000 \ |
267 | 267 | | k1om \ |
268 | 268 | | le32 | le64 \ |
300 | 300 | | open8 | or1k | or1knd | or32 \ |
301 | 301 | | pdp10 | pdp11 | pj | pjl \ |
302 | 302 | | powerpc | powerpc64 | powerpc64le | powerpcle \ |
303 | | pru \ | |
303 | 304 | | pyramid \ |
304 | 305 | | riscv32 | riscv64 \ |
305 | 306 | | rl78 | rx \ |
313 | 314 | | ubicom32 \ |
314 | 315 | | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ |
315 | 316 | | visium \ |
317 | | wasm32 \ | |
316 | 318 | | we32k \ |
317 | 319 | | x86 | xc16x | xstormy16 | xtensa \ |
318 | 320 | | z8k | z80) |
386 | 388 | | h8300-* | h8500-* \ |
387 | 389 | | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ |
388 | 390 | | hexagon-* \ |
389 | | i*86-* | i860-* | i960-* | ia64-* \ | |
391 | | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | |
390 | 392 | | ip2k-* | iq2000-* \ |
391 | 393 | | k1om-* \ |
392 | 394 | | le32-* | le64-* \ |
427 | 429 | | orion-* \ |
428 | 430 | | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ |
429 | 431 | | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ |
432 | | pru-* \ | |
430 | 433 | | pyramid-* \ |
431 | 434 | | riscv32-* | riscv64-* \ |
432 | 435 | | rl78-* | romp-* | rs6000-* | rx-* \ |
443 | 446 | | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ |
444 | 447 | | vax-* \ |
445 | 448 | | visium-* \ |
449 | | wasm32-* \ | |
446 | 450 | | we32k-* \ |
447 | 451 | | x86-* | x86_64-* | xc16x-* | xps100-* \ |
448 | 452 | | xstormy16-* | xtensa*-* \ |
641 | 645 | dpx2* | dpx2*-bull) |
642 | 646 | basic_machine=m68k-bull |
643 | 647 | os=-sysv3 |
648 | ;; | |
649 | e500v[12]) | |
650 | basic_machine=powerpc-unknown | |
651 | os=$os"spe" | |
652 | ;; | |
653 | e500v[12]-*) | |
654 | basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` | |
655 | os=$os"spe" | |
644 | 656 | ;; |
645 | 657 | ebmon29k) |
646 | 658 | basic_machine=a29k-amd |
826 | 838 | *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) |
827 | 839 | basic_machine=m68k-atari |
828 | 840 | os=-mint |
829 | ;; | |
830 | mipsEE* | ee | ps2) | |
831 | basic_machine=mips64r5900el-scei | |
832 | case $os in | |
833 | -linux*) | |
834 | ;; | |
835 | *) | |
836 | os=-elf | |
837 | ;; | |
838 | esac | |
839 | ;; | |
840 | iop) | |
841 | basic_machine=mipsel-scei | |
842 | os=-irx | |
843 | ;; | |
844 | dvp) | |
845 | basic_machine=dvp-scei | |
846 | os=-elf | |
847 | 841 | ;; |
848 | 842 | mips3*-*) |
849 | 843 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` |
955 | 949 | nsr-tandem) |
956 | 950 | basic_machine=nsr-tandem |
957 | 951 | ;; |
952 | nsx-tandem) | |
953 | basic_machine=nsx-tandem | |
954 | ;; | |
958 | 955 | op50n-* | op60c-*) |
959 | 956 | basic_machine=hppa1.1-oki |
960 | 957 | os=-proelf |
1039 | 1036 | ppc-* | ppcbe-*) |
1040 | 1037 | basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` |
1041 | 1038 | ;; |
1042 | ppcle | powerpclittle | ppc-le | powerpc-little) | |
1039 | ppcle | powerpclittle) | |
1043 | 1040 | basic_machine=powerpcle-unknown |
1044 | 1041 | ;; |
1045 | 1042 | ppcle-* | powerpclittle-*) |
1049 | 1046 | ;; |
1050 | 1047 | ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` |
1051 | 1048 | ;; |
1052 | ppc64le | powerpc64little | ppc64-le | powerpc64-little) | |
1049 | ppc64le | powerpc64little) | |
1053 | 1050 | basic_machine=powerpc64le-unknown |
1054 | 1051 | ;; |
1055 | 1052 | ppc64le-* | powerpc64little-*) |
1249 | 1246 | vxworks29k) |
1250 | 1247 | basic_machine=a29k-wrs |
1251 | 1248 | os=-vxworks |
1249 | ;; | |
1250 | wasm32) | |
1251 | basic_machine=wasm32-unknown | |
1252 | 1252 | ;; |
1253 | 1253 | w65*) |
1254 | 1254 | basic_machine=w65-wdc |
1399 | 1399 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ |
1400 | 1400 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ |
1401 | 1401 | | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ |
1402 | | -bitrig* | -openbsd* | -solidbsd* \ | |
1402 | | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | |
1403 | 1403 | | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ |
1404 | 1404 | | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ |
1405 | 1405 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ |
1406 | 1406 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ |
1407 | | -chorusos* | -chorusrdb* | -cegcc* \ | |
1407 | | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | |
1408 | 1408 | | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ |
1409 | | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | |
1409 | | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | |
1410 | 1410 | | -linux-newlib* | -linux-musl* | -linux-uclibc* \ |
1411 | 1411 | | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ |
1412 | 1412 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ |
1413 | 1413 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ |
1414 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \ | |
1414 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | |
1415 | 1415 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ |
1416 | 1416 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ |
1417 | 1417 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ |
1418 | 1418 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ |
1419 | | -onefs* | -tirtos*) | |
1419 | | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) | |
1420 | 1420 | # Remember, each alternative MUST END IN *, to match a version number. |
1421 | 1421 | ;; |
1422 | 1422 | -qnx*) |
1548 | 1548 | ;; |
1549 | 1549 | -nacl*) |
1550 | 1550 | ;; |
1551 | -ios) | |
1552 | ;; | |
1551 | 1553 | -none) |
1552 | 1554 | ;; |
1553 | 1555 | *) |
1642 | 1644 | ;; |
1643 | 1645 | sparc-* | *-sun) |
1644 | 1646 | os=-sunos4.1.1 |
1647 | ;; | |
1648 | pru-*) | |
1649 | os=-elf | |
1645 | 1650 | ;; |
1646 | 1651 | *-be) |
1647 | 1652 | os=-beos |
0 | 0 | #! /bin/sh |
1 | 1 | # depcomp - compile a program generating dependencies as side-effects |
2 | 2 | |
3 | scriptversion=2013-05-30.07; # UTC | |
4 | ||
5 | # Copyright (C) 1999-2013 Free Software Foundation, Inc. | |
3 | scriptversion=2016-01-11.22; # UTC | |
4 | ||
5 | # Copyright (C) 1999-2017 Free Software Foundation, Inc. | |
6 | 6 | |
7 | 7 | # This program is free software; you can redistribute it and/or modify |
8 | 8 | # it under the terms of the GNU General Public License as published by |
785 | 785 | # eval: (add-hook 'write-file-hooks 'time-stamp) |
786 | 786 | # time-stamp-start: "scriptversion=" |
787 | 787 | # time-stamp-format: "%:y-%02m-%02d.%02H" |
788 | # time-stamp-time-zone: "UTC" | |
788 | # time-stamp-time-zone: "UTC0" | |
789 | 789 | # time-stamp-end: "; # UTC" |
790 | 790 | # End: |
0 | 0 | #!/bin/sh |
1 | 1 | # install - install a program, script, or datafile |
2 | 2 | |
3 | scriptversion=2011-11-20.07; # UTC | |
3 | scriptversion=2016-01-11.22; # UTC | |
4 | 4 | |
5 | 5 | # This originates from X11R5 (mit/util/scripts/install.sh), which was |
6 | 6 | # later released in X11R6 (xc/config/util/install.sh) with the |
40 | 40 | # This script is compatible with the BSD install script, but was written |
41 | 41 | # from scratch. |
42 | 42 | |
43 | tab=' ' | |
43 | 44 | nl=' |
44 | 45 | ' |
45 | IFS=" "" $nl" | |
46 | ||
47 | # set DOITPROG to echo to test this script | |
48 | ||
49 | # Don't use :- since 4.3BSD and earlier shells don't like it. | |
46 | IFS=" $tab$nl" | |
47 | ||
48 | # Set DOITPROG to "echo" to test this script. | |
49 | ||
50 | 50 | doit=${DOITPROG-} |
51 | if test -z "$doit"; then | |
52 | doit_exec=exec | |
53 | else | |
54 | doit_exec=$doit | |
55 | fi | |
51 | doit_exec=${doit:-exec} | |
56 | 52 | |
57 | 53 | # Put in absolute file names if you don't have them in your path; |
58 | 54 | # or use environment vars. |
67 | 63 | rmprog=${RMPROG-rm} |
68 | 64 | stripprog=${STRIPPROG-strip} |
69 | 65 | |
70 | posix_glob='?' | |
71 | initialize_posix_glob=' | |
72 | test "$posix_glob" != "?" || { | |
73 | if (set -f) 2>/dev/null; then | |
74 | posix_glob= | |
75 | else | |
76 | posix_glob=: | |
77 | fi | |
78 | } | |
79 | ' | |
80 | ||
81 | 66 | posix_mkdir= |
82 | 67 | |
83 | 68 | # Desired mode of installed file. |
96 | 81 | dst_arg= |
97 | 82 | |
98 | 83 | copy_on_change=false |
99 | no_target_directory= | |
84 | is_target_a_directory=possibly | |
100 | 85 | |
101 | 86 | usage="\ |
102 | 87 | Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE |
136 | 121 | -d) dir_arg=true;; |
137 | 122 | |
138 | 123 | -g) chgrpcmd="$chgrpprog $2" |
139 | shift;; | |
124 | shift;; | |
140 | 125 | |
141 | 126 | --help) echo "$usage"; exit $?;; |
142 | 127 | |
143 | 128 | -m) mode=$2 |
144 | case $mode in | |
145 | *' '* | *' '* | *' | |
146 | '* | *'*'* | *'?'* | *'['*) | |
147 | echo "$0: invalid mode: $mode" >&2 | |
148 | exit 1;; | |
149 | esac | |
150 | shift;; | |
129 | case $mode in | |
130 | *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) | |
131 | echo "$0: invalid mode: $mode" >&2 | |
132 | exit 1;; | |
133 | esac | |
134 | shift;; | |
151 | 135 | |
152 | 136 | -o) chowncmd="$chownprog $2" |
153 | shift;; | |
137 | shift;; | |
154 | 138 | |
155 | 139 | -s) stripcmd=$stripprog;; |
156 | 140 | |
157 | -t) dst_arg=$2 | |
158 | # Protect names problematic for 'test' and other utilities. | |
159 | case $dst_arg in | |
160 | -* | [=\(\)!]) dst_arg=./$dst_arg;; | |
161 | esac | |
162 | shift;; | |
163 | ||
164 | -T) no_target_directory=true;; | |
141 | -t) | |
142 | is_target_a_directory=always | |
143 | dst_arg=$2 | |
144 | # Protect names problematic for 'test' and other utilities. | |
145 | case $dst_arg in | |
146 | -* | [=\(\)!]) dst_arg=./$dst_arg;; | |
147 | esac | |
148 | shift;; | |
149 | ||
150 | -T) is_target_a_directory=never;; | |
165 | 151 | |
166 | 152 | --version) echo "$0 $scriptversion"; exit $?;; |
167 | 153 | |
168 | --) shift | |
169 | break;; | |
170 | ||
171 | -*) echo "$0: invalid option: $1" >&2 | |
172 | exit 1;; | |
154 | --) shift | |
155 | break;; | |
156 | ||
157 | -*) echo "$0: invalid option: $1" >&2 | |
158 | exit 1;; | |
173 | 159 | |
174 | 160 | *) break;; |
175 | 161 | esac |
176 | 162 | shift |
177 | 163 | done |
164 | ||
165 | # We allow the use of options -d and -T together, by making -d | |
166 | # take the precedence; this is for compatibility with GNU install. | |
167 | ||
168 | if test -n "$dir_arg"; then | |
169 | if test -n "$dst_arg"; then | |
170 | echo "$0: target directory not allowed when installing a directory." >&2 | |
171 | exit 1 | |
172 | fi | |
173 | fi | |
178 | 174 | |
179 | 175 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then |
180 | 176 | # When -d is used, all remaining arguments are directories to create. |
207 | 203 | fi |
208 | 204 | |
209 | 205 | if test -z "$dir_arg"; then |
206 | if test $# -gt 1 || test "$is_target_a_directory" = always; then | |
207 | if test ! -d "$dst_arg"; then | |
208 | echo "$0: $dst_arg: Is not a directory." >&2 | |
209 | exit 1 | |
210 | fi | |
211 | fi | |
212 | fi | |
213 | ||
214 | if test -z "$dir_arg"; then | |
210 | 215 | do_exit='(exit $ret); exit $ret' |
211 | 216 | trap "ret=129; $do_exit" 1 |
212 | 217 | trap "ret=130; $do_exit" 2 |
222 | 227 | |
223 | 228 | *[0-7]) |
224 | 229 | if test -z "$stripcmd"; then |
225 | u_plus_rw= | |
230 | u_plus_rw= | |
226 | 231 | else |
227 | u_plus_rw='% 200' | |
232 | u_plus_rw='% 200' | |
228 | 233 | fi |
229 | 234 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; |
230 | 235 | *) |
231 | 236 | if test -z "$stripcmd"; then |
232 | u_plus_rw= | |
237 | u_plus_rw= | |
233 | 238 | else |
234 | u_plus_rw=,u+rw | |
239 | u_plus_rw=,u+rw | |
235 | 240 | fi |
236 | 241 | cp_umask=$mode$u_plus_rw;; |
237 | 242 | esac |
268 | 273 | # If destination is a directory, append the input filename; won't work |
269 | 274 | # if double slashes aren't ignored. |
270 | 275 | if test -d "$dst"; then |
271 | if test -n "$no_target_directory"; then | |
272 | echo "$0: $dst_arg: Is a directory" >&2 | |
273 | exit 1 | |
276 | if test "$is_target_a_directory" = never; then | |
277 | echo "$0: $dst_arg: Is a directory" >&2 | |
278 | exit 1 | |
274 | 279 | fi |
275 | 280 | dstdir=$dst |
276 | 281 | dst=$dstdir/`basename "$src"` |
277 | 282 | dstdir_status=0 |
278 | 283 | else |
279 | # Prefer dirname, but fall back on a substitute if dirname fails. | |
280 | dstdir=` | |
281 | (dirname "$dst") 2>/dev/null || | |
282 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
283 | X"$dst" : 'X\(//\)[^/]' \| \ | |
284 | X"$dst" : 'X\(//\)$' \| \ | |
285 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || | |
286 | echo X"$dst" | | |
287 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
288 | s//\1/ | |
289 | q | |
290 | } | |
291 | /^X\(\/\/\)[^/].*/{ | |
292 | s//\1/ | |
293 | q | |
294 | } | |
295 | /^X\(\/\/\)$/{ | |
296 | s//\1/ | |
297 | q | |
298 | } | |
299 | /^X\(\/\).*/{ | |
300 | s//\1/ | |
301 | q | |
302 | } | |
303 | s/.*/./; q' | |
304 | ` | |
305 | ||
284 | dstdir=`dirname "$dst"` | |
306 | 285 | test -d "$dstdir" |
307 | 286 | dstdir_status=$? |
308 | 287 | fi |
313 | 292 | if test $dstdir_status != 0; then |
314 | 293 | case $posix_mkdir in |
315 | 294 | '') |
316 | # Create intermediate dirs using mode 755 as modified by the umask. | |
317 | # This is like FreeBSD 'install' as of 1997-10-28. | |
318 | umask=`umask` | |
319 | case $stripcmd.$umask in | |
320 | # Optimize common cases. | |
321 | *[2367][2367]) mkdir_umask=$umask;; | |
322 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; | |
323 | ||
324 | *[0-7]) | |
325 | mkdir_umask=`expr $umask + 22 \ | |
326 | - $umask % 100 % 40 + $umask % 20 \ | |
327 | - $umask % 10 % 4 + $umask % 2 | |
328 | `;; | |
329 | *) mkdir_umask=$umask,go-w;; | |
330 | esac | |
331 | ||
332 | # With -d, create the new directory with the user-specified mode. | |
333 | # Otherwise, rely on $mkdir_umask. | |
334 | if test -n "$dir_arg"; then | |
335 | mkdir_mode=-m$mode | |
336 | else | |
337 | mkdir_mode= | |
338 | fi | |
339 | ||
340 | posix_mkdir=false | |
341 | case $umask in | |
342 | *[123567][0-7][0-7]) | |
343 | # POSIX mkdir -p sets u+wx bits regardless of umask, which | |
344 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. | |
345 | ;; | |
346 | *) | |
347 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ | |
348 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 | |
349 | ||
350 | if (umask $mkdir_umask && | |
351 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 | |
352 | then | |
353 | if test -z "$dir_arg" || { | |
354 | # Check for POSIX incompatibilities with -m. | |
355 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or | |
356 | # other-writable bit of parent directory when it shouldn't. | |
357 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. | |
358 | ls_ld_tmpdir=`ls -ld "$tmpdir"` | |
359 | case $ls_ld_tmpdir in | |
360 | d????-?r-*) different_mode=700;; | |
361 | d????-?--*) different_mode=755;; | |
362 | *) false;; | |
363 | esac && | |
364 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { | |
365 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` | |
366 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" | |
367 | } | |
368 | } | |
369 | then posix_mkdir=: | |
370 | fi | |
371 | rmdir "$tmpdir/d" "$tmpdir" | |
372 | else | |
373 | # Remove any dirs left behind by ancient mkdir implementations. | |
374 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null | |
375 | fi | |
376 | trap '' 0;; | |
377 | esac;; | |
295 | # Create intermediate dirs using mode 755 as modified by the umask. | |
296 | # This is like FreeBSD 'install' as of 1997-10-28. | |
297 | umask=`umask` | |
298 | case $stripcmd.$umask in | |
299 | # Optimize common cases. | |
300 | *[2367][2367]) mkdir_umask=$umask;; | |
301 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; | |
302 | ||
303 | *[0-7]) | |
304 | mkdir_umask=`expr $umask + 22 \ | |
305 | - $umask % 100 % 40 + $umask % 20 \ | |
306 | - $umask % 10 % 4 + $umask % 2 | |
307 | `;; | |
308 | *) mkdir_umask=$umask,go-w;; | |
309 | esac | |
310 | ||
311 | # With -d, create the new directory with the user-specified mode. | |
312 | # Otherwise, rely on $mkdir_umask. | |
313 | if test -n "$dir_arg"; then | |
314 | mkdir_mode=-m$mode | |
315 | else | |
316 | mkdir_mode= | |
317 | fi | |
318 | ||
319 | posix_mkdir=false | |
320 | case $umask in | |
321 | *[123567][0-7][0-7]) | |
322 | # POSIX mkdir -p sets u+wx bits regardless of umask, which | |
323 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. | |
324 | ;; | |
325 | *) | |
326 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ | |
327 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 | |
328 | ||
329 | if (umask $mkdir_umask && | |
330 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 | |
331 | then | |
332 | if test -z "$dir_arg" || { | |
333 | # Check for POSIX incompatibilities with -m. | |
334 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or | |
335 | # other-writable bit of parent directory when it shouldn't. | |
336 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. | |
337 | ls_ld_tmpdir=`ls -ld "$tmpdir"` | |
338 | case $ls_ld_tmpdir in | |
339 | d????-?r-*) different_mode=700;; | |
340 | d????-?--*) different_mode=755;; | |
341 | *) false;; | |
342 | esac && | |
343 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { | |
344 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` | |
345 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" | |
346 | } | |
347 | } | |
348 | then posix_mkdir=: | |
349 | fi | |
350 | rmdir "$tmpdir/d" "$tmpdir" | |
351 | else | |
352 | # Remove any dirs left behind by ancient mkdir implementations. | |
353 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null | |
354 | fi | |
355 | trap '' 0;; | |
356 | esac;; | |
378 | 357 | esac |
379 | 358 | |
380 | 359 | if |
381 | 360 | $posix_mkdir && ( |
382 | umask $mkdir_umask && | |
383 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" | |
361 | umask $mkdir_umask && | |
362 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" | |
384 | 363 | ) |
385 | 364 | then : |
386 | 365 | else |
390 | 369 | # directory the slow way, step by step, checking for races as we go. |
391 | 370 | |
392 | 371 | case $dstdir in |
393 | /*) prefix='/';; | |
394 | [-=\(\)!]*) prefix='./';; | |
395 | *) prefix='';; | |
372 | /*) prefix='/';; | |
373 | [-=\(\)!]*) prefix='./';; | |
374 | *) prefix='';; | |
396 | 375 | esac |
397 | ||
398 | eval "$initialize_posix_glob" | |
399 | 376 | |
400 | 377 | oIFS=$IFS |
401 | 378 | IFS=/ |
402 | $posix_glob set -f | |
379 | set -f | |
403 | 380 | set fnord $dstdir |
404 | 381 | shift |
405 | $posix_glob set +f | |
382 | set +f | |
406 | 383 | IFS=$oIFS |
407 | 384 | |
408 | 385 | prefixes= |
409 | 386 | |
410 | 387 | for d |
411 | 388 | do |
412 | test X"$d" = X && continue | |
413 | ||
414 | prefix=$prefix$d | |
415 | if test -d "$prefix"; then | |
416 | prefixes= | |
417 | else | |
418 | if $posix_mkdir; then | |
419 | (umask=$mkdir_umask && | |
420 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break | |
421 | # Don't fail if two instances are running concurrently. | |
422 | test -d "$prefix" || exit 1 | |
423 | else | |
424 | case $prefix in | |
425 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; | |
426 | *) qprefix=$prefix;; | |
427 | esac | |
428 | prefixes="$prefixes '$qprefix'" | |
429 | fi | |
430 | fi | |
431 | prefix=$prefix/ | |
389 | test X"$d" = X && continue | |
390 | ||
391 | prefix=$prefix$d | |
392 | if test -d "$prefix"; then | |
393 | prefixes= | |
394 | else | |
395 | if $posix_mkdir; then | |
396 | (umask=$mkdir_umask && | |
397 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break | |
398 | # Don't fail if two instances are running concurrently. | |
399 | test -d "$prefix" || exit 1 | |
400 | else | |
401 | case $prefix in | |
402 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; | |
403 | *) qprefix=$prefix;; | |
404 | esac | |
405 | prefixes="$prefixes '$qprefix'" | |
406 | fi | |
407 | fi | |
408 | prefix=$prefix/ | |
432 | 409 | done |
433 | 410 | |
434 | 411 | if test -n "$prefixes"; then |
435 | # Don't fail if two instances are running concurrently. | |
436 | (umask $mkdir_umask && | |
437 | eval "\$doit_exec \$mkdirprog $prefixes") || | |
438 | test -d "$dstdir" || exit 1 | |
439 | obsolete_mkdir_used=true | |
412 | # Don't fail if two instances are running concurrently. | |
413 | (umask $mkdir_umask && | |
414 | eval "\$doit_exec \$mkdirprog $prefixes") || | |
415 | test -d "$dstdir" || exit 1 | |
416 | obsolete_mkdir_used=true | |
440 | 417 | fi |
441 | 418 | fi |
442 | 419 | fi |
471 | 448 | |
472 | 449 | # If -C, don't bother to copy if it wouldn't change the file. |
473 | 450 | if $copy_on_change && |
474 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && | |
475 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && | |
476 | ||
477 | eval "$initialize_posix_glob" && | |
478 | $posix_glob set -f && | |
451 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && | |
452 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && | |
453 | set -f && | |
479 | 454 | set X $old && old=:$2:$4:$5:$6 && |
480 | 455 | set X $new && new=:$2:$4:$5:$6 && |
481 | $posix_glob set +f && | |
482 | ||
456 | set +f && | |
483 | 457 | test "$old" = "$new" && |
484 | 458 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 |
485 | 459 | then |
492 | 466 | # to itself, or perhaps because mv is so ancient that it does not |
493 | 467 | # support -f. |
494 | 468 | { |
495 | # Now remove or move aside any old file at destination location. | |
496 | # We try this two ways since rm can't unlink itself on some | |
497 | # systems and the destination file might be busy for other | |
498 | # reasons. In this case, the final cleanup might fail but the new | |
499 | # file should still install successfully. | |
500 | { | |
501 | test ! -f "$dst" || | |
502 | $doit $rmcmd -f "$dst" 2>/dev/null || | |
503 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && | |
504 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } | |
505 | } || | |
506 | { echo "$0: cannot unlink or rename $dst" >&2 | |
507 | (exit 1); exit 1 | |
508 | } | |
509 | } && | |
510 | ||
511 | # Now rename the file to the real destination. | |
512 | $doit $mvcmd "$dsttmp" "$dst" | |
469 | # Now remove or move aside any old file at destination location. | |
470 | # We try this two ways since rm can't unlink itself on some | |
471 | # systems and the destination file might be busy for other | |
472 | # reasons. In this case, the final cleanup might fail but the new | |
473 | # file should still install successfully. | |
474 | { | |
475 | test ! -f "$dst" || | |
476 | $doit $rmcmd -f "$dst" 2>/dev/null || | |
477 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && | |
478 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } | |
479 | } || | |
480 | { echo "$0: cannot unlink or rename $dst" >&2 | |
481 | (exit 1); exit 1 | |
482 | } | |
483 | } && | |
484 | ||
485 | # Now rename the file to the real destination. | |
486 | $doit $mvcmd "$dsttmp" "$dst" | |
513 | 487 | } |
514 | 488 | fi || exit 1 |
515 | 489 | |
521 | 495 | # eval: (add-hook 'write-file-hooks 'time-stamp) |
522 | 496 | # time-stamp-start: "scriptversion=" |
523 | 497 | # time-stamp-format: "%:y-%02m-%02d.%02H" |
524 | # time-stamp-time-zone: "UTC" | |
498 | # time-stamp-time-zone: "UTC0" | |
525 | 499 | # time-stamp-end: "; # UTC" |
526 | 500 | # End: |
0 | 0 | #! /bin/sh |
1 | 1 | ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in |
2 | ## by inline-source v2014-01-03.01 | |
3 | ||
4 | # libtool (GNU libtool) 2.4.6 | |
2 | ## by inline-source v2016-02-21.11 | |
3 | ||
4 | # libtool (GNU libtool) 2.4.6.40-6ca5-dirty | |
5 | 5 | # Provide generalized library-building support services. |
6 | 6 | # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
7 | 7 | |
8 | # Copyright (C) 1996-2015 Free Software Foundation, Inc. | |
8 | # Copyright (C) 1996-2017 Free Software Foundation, Inc. | |
9 | 9 | # This is free software; see the source for copying conditions. There is NO |
10 | 10 | # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11 | 11 | |
30 | 30 | |
31 | 31 | PROGRAM=libtool |
32 | 32 | PACKAGE=libtool |
33 | VERSION=2.4.6 | |
34 | package_revision=2.4.6 | |
33 | VERSION=2.4.6.40-6ca5-dirty | |
34 | package_revision=2.4.6.40 | |
35 | 35 | |
36 | 36 | |
37 | 37 | ## ------ ## |
63 | 63 | # libraries, which are installed to $pkgauxdir. |
64 | 64 | |
65 | 65 | # Set a version string for this script. |
66 | scriptversion=2015-10-04.22; # UTC | |
66 | scriptversion=2017-04-19.12; # UTC | |
67 | 67 | |
68 | 68 | # General shell script boiler plate, and helper functions. |
69 | 69 | # Written by Gary V. Vaughan, 2004 |
70 | 70 | |
71 | # Copyright (C) 2004-2015 Free Software Foundation, Inc. | |
72 | # This is free software; see the source for copying conditions. There is NO | |
73 | # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
74 | ||
75 | # This program is free software; you can redistribute it and/or modify | |
76 | # it under the terms of the GNU General Public License as published by | |
77 | # the Free Software Foundation; either version 3 of the License, or | |
78 | # (at your option) any later version. | |
79 | ||
80 | # As a special exception to the GNU General Public License, if you distribute | |
81 | # this file as part of a program or library that is built using GNU Libtool, | |
82 | # you may include this file under the same distribution terms that you use | |
83 | # for the rest of that program. | |
84 | ||
85 | # This program is distributed in the hope that it will be useful, | |
86 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
87 | # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU | |
88 | # General Public License for more details. | |
89 | ||
90 | # You should have received a copy of the GNU General Public License | |
91 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
92 | ||
93 | # Please report bugs or propose patches to gary@gnu.org. | |
71 | # This is free software. There is NO warranty; not even for | |
72 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
73 | # | |
74 | # Copyright (C) 2004-2017 Bootstrap Authors | |
75 | # | |
76 | # This file is dual licensed under the terms of the MIT license | |
77 | # <https://opensource.org/license/MIT>, and GPL version 3 or later | |
78 | # <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of | |
79 | # these licenses when using or redistributing this software or any of | |
80 | # the files within it. See the URLs above, or the file `LICENSE` | |
81 | # included in the Bootstrap distribution for the full license texts. | |
82 | ||
83 | # Please report bugs or propose patches to: | |
84 | # <https://github.com/gnulib-modules/bootstrap/issues> | |
94 | 85 | |
95 | 86 | |
96 | 87 | ## ------ ## |
139 | 130 | fi" |
140 | 131 | done |
141 | 132 | |
142 | # CDPATH. | |
143 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH | |
144 | ||
145 | 133 | # Make sure IFS has a sensible default |
146 | 134 | sp=' ' |
147 | 135 | nl=' |
157 | 145 | } |
158 | 146 | fi |
159 | 147 | |
148 | ||
149 | # func_unset VAR | |
150 | # -------------- | |
151 | # Portably unset VAR. | |
152 | # In some shells, an 'unset VAR' statement leaves a non-zero return | |
153 | # status if VAR is already unset, which might be problematic if the | |
154 | # statement is used at the end of a function (thus poisoning its return | |
155 | # value) or when 'set -e' is active (causing even a spurious abort of | |
156 | # the script in this case). | |
157 | func_unset () | |
158 | { | |
159 | { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } | |
160 | } | |
161 | ||
162 | ||
163 | # Make sure CDPATH doesn't cause `cd` commands to output the target dir. | |
164 | func_unset CDPATH | |
165 | ||
166 | # Make sure ${,E,F}GREP behave sanely. | |
167 | func_unset GREP_OPTIONS | |
160 | 168 | |
161 | 169 | |
162 | 170 | ## ------------------------- ## |
258 | 266 | rm -f conftest.in conftest.tmp conftest.nl conftest.out |
259 | 267 | } |
260 | 268 | |
261 | func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin | |
269 | func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" | |
262 | 270 | rm -f conftest.sed |
263 | 271 | SED=$func_path_progs_result |
264 | 272 | } |
294 | 302 | rm -f conftest.in conftest.tmp conftest.nl conftest.out |
295 | 303 | } |
296 | 304 | |
297 | func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin | |
305 | func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" | |
298 | 306 | GREP=$func_path_progs_result |
299 | 307 | } |
300 | 308 | |
579 | 587 | { |
580 | 588 | $debug_cmd |
581 | 589 | |
582 | func_quote_for_eval "$2" | |
583 | eval "$1+=\\ \$func_quote_for_eval_result" | |
590 | func_quote_arg pretty "$2" | |
591 | eval "$1+=\\ \$func_quote_arg_result" | |
584 | 592 | }' |
585 | 593 | else |
586 | 594 | func_append_quoted () |
587 | 595 | { |
588 | 596 | $debug_cmd |
589 | 597 | |
590 | func_quote_for_eval "$2" | |
591 | eval "$1=\$$1\\ \$func_quote_for_eval_result" | |
598 | func_quote_arg pretty "$2" | |
599 | eval "$1=\$$1\\ \$func_quote_arg_result" | |
592 | 600 | } |
593 | 601 | fi |
594 | 602 | |
1090 | 1098 | } |
1091 | 1099 | |
1092 | 1100 | |
1093 | # func_quote ARG | |
1094 | # -------------- | |
1095 | # Aesthetically quote one ARG, store the result into $func_quote_result. Note | |
1096 | # that we keep attention to performance here (so far O(N) complexity as long as | |
1097 | # func_append is O(1)). | |
1098 | func_quote () | |
1101 | # func_quote_portable EVAL ARG | |
1102 | # ---------------------------- | |
1103 | # Internal function to portably implement func_quote_arg. Note that we still | |
1104 | # keep attention to performance here so we as much as possible try to avoid | |
1105 | # calling sed binary (so far O(N) complexity as long as func_append is O(1)). | |
1106 | func_quote_portable () | |
1099 | 1107 | { |
1100 | 1108 | $debug_cmd |
1101 | 1109 | |
1102 | func_quote_result=$1 | |
1103 | ||
1104 | case $func_quote_result in | |
1105 | *[\\\`\"\$]*) | |
1106 | case $func_quote_result in | |
1107 | *[\[\*\?]*) | |
1108 | func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` | |
1109 | return 0 | |
1110 | ;; | |
1111 | esac | |
1112 | ||
1113 | func_quote_old_IFS=$IFS | |
1114 | for _G_char in '\' '`' '"' '$' | |
1115 | do | |
1116 | # STATE($1) PREV($2) SEPARATOR($3) | |
1117 | set start "" "" | |
1118 | func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy | |
1119 | IFS=$_G_char | |
1120 | for _G_part in $func_quote_result | |
1110 | func_quote_portable_result=$2 | |
1111 | ||
1112 | # one-time-loop (easy break) | |
1113 | while true | |
1114 | do | |
1115 | if $1; then | |
1116 | func_quote_portable_result=`$ECHO "$2" | $SED \ | |
1117 | -e "$sed_double_quote_subst" -e "$sed_double_backslash"` | |
1118 | break | |
1119 | fi | |
1120 | ||
1121 | # Quote for eval. | |
1122 | case $func_quote_portable_result in | |
1123 | *[\\\`\"\$]*) | |
1124 | case $func_quote_portable_result in | |
1125 | *[\[\*\?]*) | |
1126 | func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | |
1127 | | $SED "$sed_quote_subst"` | |
1128 | break | |
1129 | ;; | |
1130 | esac | |
1131 | ||
1132 | func_quote_portable_old_IFS=$IFS | |
1133 | for _G_char in '\' '`' '"' '$' | |
1121 | 1134 | do |
1122 | case $1 in | |
1123 | quote) | |
1124 | func_append func_quote_result "$3$2" | |
1125 | set quote "$_G_part" "\\$_G_char" | |
1126 | ;; | |
1127 | start) | |
1128 | set first "" "" | |
1129 | func_quote_result= | |
1130 | ;; | |
1131 | first) | |
1132 | set quote "$_G_part" "" | |
1133 | ;; | |
1134 | esac | |
1135 | # STATE($1) PREV($2) SEPARATOR($3) | |
1136 | set start "" "" | |
1137 | func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy | |
1138 | IFS=$_G_char | |
1139 | for _G_part in $func_quote_portable_result | |
1140 | do | |
1141 | case $1 in | |
1142 | quote) | |
1143 | func_append func_quote_portable_result "$3$2" | |
1144 | set quote "$_G_part" "\\$_G_char" | |
1145 | ;; | |
1146 | start) | |
1147 | set first "" "" | |
1148 | func_quote_portable_result= | |
1149 | ;; | |
1150 | first) | |
1151 | set quote "$_G_part" "" | |
1152 | ;; | |
1153 | esac | |
1154 | done | |
1135 | 1155 | done |
1136 | IFS=$func_quote_old_IFS | |
1137 | done | |
1156 | IFS=$func_quote_portable_old_IFS | |
1157 | ;; | |
1158 | *) ;; | |
1159 | esac | |
1160 | break | |
1161 | done | |
1162 | ||
1163 | func_quote_portable_unquoted_result=$func_quote_portable_result | |
1164 | case $func_quote_portable_result in | |
1165 | # double-quote args containing shell metacharacters to delay | |
1166 | # word splitting, command substitution and variable expansion | |
1167 | # for a subsequent eval. | |
1168 | # many bourne shells cannot handle close brackets correctly | |
1169 | # in scan sets, so we specify it separately. | |
1170 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | |
1171 | func_quote_portable_result=\"$func_quote_portable_result\" | |
1138 | 1172 | ;; |
1139 | *) ;; | |
1140 | 1173 | esac |
1141 | 1174 | } |
1142 | 1175 | |
1143 | 1176 | |
1144 | # func_quote_for_eval ARG... | |
1145 | # -------------------------- | |
1146 | # Aesthetically quote ARGs to be evaled later. | |
1147 | # This function returns two values: | |
1148 | # i) func_quote_for_eval_result | |
1149 | # double-quoted, suitable for a subsequent eval | |
1150 | # ii) func_quote_for_eval_unquoted_result | |
1151 | # has all characters that are still active within double | |
1152 | # quotes backslashified. | |
1153 | func_quote_for_eval () | |
1154 | { | |
1155 | $debug_cmd | |
1156 | ||
1157 | func_quote_for_eval_unquoted_result= | |
1158 | func_quote_for_eval_result= | |
1159 | while test 0 -lt $#; do | |
1160 | func_quote "$1" | |
1161 | _G_unquoted_arg=$func_quote_result | |
1162 | if test -n "$func_quote_for_eval_unquoted_result"; then | |
1163 | func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" | |
1164 | else | |
1165 | func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" | |
1166 | fi | |
1167 | ||
1168 | case $_G_unquoted_arg in | |
1169 | # Double-quote args containing shell metacharacters to delay | |
1170 | # word splitting, command substitution and variable expansion | |
1171 | # for a subsequent eval. | |
1172 | # Many Bourne shells cannot handle close brackets correctly | |
1173 | # in scan sets, so we specify it separately. | |
1174 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | |
1175 | _G_quoted_arg=\"$_G_unquoted_arg\" | |
1177 | # func_quotefast_eval ARG | |
1178 | # ----------------------- | |
1179 | # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', | |
1180 | # but optimized for speed. Result is stored in $func_quotefast_eval. | |
1181 | if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then | |
1182 | printf -v _GL_test_printf_tilde %q '~' | |
1183 | if test '\~' = "$_GL_test_printf_tilde"; then | |
1184 | func_quotefast_eval () | |
1185 | { | |
1186 | printf -v func_quotefast_eval_result %q "$1" | |
1187 | } | |
1188 | else | |
1189 | # Broken older Bash implementations. Make those faster too if possible. | |
1190 | func_quotefast_eval () | |
1191 | { | |
1192 | case $1 in | |
1193 | '~'*) | |
1194 | func_quote_portable false "$1" | |
1195 | func_quotefast_eval_result=$func_quote_portable_result | |
1176 | 1196 | ;; |
1177 | 1197 | *) |
1178 | _G_quoted_arg=$_G_unquoted_arg | |
1179 | ;; | |
1198 | printf -v func_quotefast_eval_result %q "$1" | |
1199 | ;; | |
1180 | 1200 | esac |
1181 | ||
1182 | if test -n "$func_quote_for_eval_result"; then | |
1183 | func_append func_quote_for_eval_result " $_G_quoted_arg" | |
1201 | } | |
1202 | fi | |
1203 | else | |
1204 | func_quotefast_eval () | |
1205 | { | |
1206 | func_quote_portable false "$1" | |
1207 | func_quotefast_eval_result=$func_quote_portable_result | |
1208 | } | |
1209 | fi | |
1210 | ||
1211 | ||
1212 | # func_quote_arg MODEs ARG | |
1213 | # ------------------------ | |
1214 | # Quote one ARG to be evaled later. MODEs argument may contain zero or more | |
1215 | # specifiers listed below separated by ',' character. This function returns two | |
1216 | # values: | |
1217 | # i) func_quote_arg_result | |
1218 | # double-quoted (when needed), suitable for a subsequent eval | |
1219 | # ii) func_quote_arg_unquoted_result | |
1220 | # has all characters that are still active within double | |
1221 | # quotes backslashified. Available only if 'unquoted' is specified. | |
1222 | # | |
1223 | # Available modes: | |
1224 | # ---------------- | |
1225 | # 'eval' (default) | |
1226 | # - escape shell special characters | |
1227 | # 'expand' | |
1228 | # - the same as 'eval'; but do not quote variable references | |
1229 | # 'pretty' | |
1230 | # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might | |
1231 | # be used later in func_quote to get output like: 'echo "a b"' instead | |
1232 | # of 'echo a\ b'. This is slower than default on some shells. | |
1233 | # 'unquoted' | |
1234 | # - produce also $func_quote_arg_unquoted_result which does not contain | |
1235 | # wrapping double-quotes. | |
1236 | # | |
1237 | # Examples for 'func_quote_arg pretty,unquoted string': | |
1238 | # | |
1239 | # string | *_result | *_unquoted_result | |
1240 | # ------------+-----------------------+------------------- | |
1241 | # " | \" | \" | |
1242 | # a b | "a b" | a b | |
1243 | # "a b" | "\"a b\"" | \"a b\" | |
1244 | # * | "*" | * | |
1245 | # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" | |
1246 | # | |
1247 | # Examples for 'func_quote_arg pretty,unquoted,expand string': | |
1248 | # | |
1249 | # string | *_result | *_unquoted_result | |
1250 | # --------------+---------------------+-------------------- | |
1251 | # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" | |
1252 | func_quote_arg () | |
1253 | { | |
1254 | _G_quote_expand=false | |
1255 | case ,$1, in | |
1256 | *,expand,*) | |
1257 | _G_quote_expand=: | |
1258 | ;; | |
1259 | esac | |
1260 | ||
1261 | case ,$1, in | |
1262 | *,pretty,*|*,expand,*|*,unquoted,*) | |
1263 | func_quote_portable $_G_quote_expand "$2" | |
1264 | func_quote_arg_result=$func_quote_portable_result | |
1265 | func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result | |
1266 | ;; | |
1267 | *) | |
1268 | # Faster quote-for-eval for some shells. | |
1269 | func_quotefast_eval "$2" | |
1270 | func_quote_arg_result=$func_quotefast_eval_result | |
1271 | ;; | |
1272 | esac | |
1273 | } | |
1274 | ||
1275 | ||
1276 | # func_quote MODEs ARGs... | |
1277 | # ------------------------ | |
1278 | # Quote all ARGs to be evaled later and join them into single command. See | |
1279 | # func_quote_arg's description for more info. | |
1280 | func_quote () | |
1281 | { | |
1282 | $debug_cmd | |
1283 | _G_func_quote_mode=$1 ; shift | |
1284 | func_quote_result= | |
1285 | while test 0 -lt $#; do | |
1286 | func_quote_arg "$_G_func_quote_mode" "$1" | |
1287 | if test -n "$func_quote_result"; then | |
1288 | func_append func_quote_result " $func_quote_arg_result" | |
1184 | 1289 | else |
1185 | func_append func_quote_for_eval_result "$_G_quoted_arg" | |
1290 | func_append func_quote_result "$func_quote_arg_result" | |
1186 | 1291 | fi |
1187 | 1292 | shift |
1188 | 1293 | done |
1189 | } | |
1190 | ||
1191 | ||
1192 | # func_quote_for_expand ARG | |
1193 | # ------------------------- | |
1194 | # Aesthetically quote ARG to be evaled later; same as above, | |
1195 | # but do not quote variable references. | |
1196 | func_quote_for_expand () | |
1197 | { | |
1198 | $debug_cmd | |
1199 | ||
1200 | case $1 in | |
1201 | *[\\\`\"]*) | |
1202 | _G_arg=`$ECHO "$1" | $SED \ | |
1203 | -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; | |
1204 | *) | |
1205 | _G_arg=$1 ;; | |
1206 | esac | |
1207 | ||
1208 | case $_G_arg in | |
1209 | # Double-quote args containing shell metacharacters to delay | |
1210 | # word splitting and command substitution for a subsequent eval. | |
1211 | # Many Bourne shells cannot handle close brackets correctly | |
1212 | # in scan sets, so we specify it separately. | |
1213 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | |
1214 | _G_arg=\"$_G_arg\" | |
1215 | ;; | |
1216 | esac | |
1217 | ||
1218 | func_quote_for_expand_result=$_G_arg | |
1219 | 1294 | } |
1220 | 1295 | |
1221 | 1296 | |
1261 | 1336 | _G_cmd=$1 |
1262 | 1337 | _G_fail_exp=${2-':'} |
1263 | 1338 | |
1264 | func_quote_for_expand "$_G_cmd" | |
1265 | eval "func_notquiet $func_quote_for_expand_result" | |
1339 | func_quote_arg pretty,expand "$_G_cmd" | |
1340 | eval "func_notquiet $func_quote_arg_result" | |
1266 | 1341 | |
1267 | 1342 | $opt_dry_run || { |
1268 | 1343 | eval "$_G_cmd" |
1287 | 1362 | _G_fail_exp=${2-':'} |
1288 | 1363 | |
1289 | 1364 | $opt_quiet || { |
1290 | func_quote_for_expand "$_G_cmd" | |
1291 | eval "func_echo $func_quote_for_expand_result" | |
1365 | func_quote_arg expand,pretty "$_G_cmd" | |
1366 | eval "func_echo $func_quote_arg_result" | |
1292 | 1367 | } |
1293 | 1368 | |
1294 | 1369 | $opt_dry_run || { |
1415 | 1490 | # End: |
1416 | 1491 | #! /bin/sh |
1417 | 1492 | |
1418 | # Set a version string for this script. | |
1419 | scriptversion=2014-01-07.03; # UTC | |
1420 | ||
1421 | 1493 | # A portable, pluggable option parser for Bourne shell. |
1422 | 1494 | # Written by Gary V. Vaughan, 2010 |
1423 | 1495 | |
1424 | # Copyright (C) 2010-2015 Free Software Foundation, Inc. | |
1425 | # This is free software; see the source for copying conditions. There is NO | |
1426 | # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
1427 | ||
1428 | # This program is free software: you can redistribute it and/or modify | |
1429 | # it under the terms of the GNU General Public License as published by | |
1430 | # the Free Software Foundation, either version 3 of the License, or | |
1431 | # (at your option) any later version. | |
1432 | ||
1433 | # This program is distributed in the hope that it will be useful, | |
1434 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
1435 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
1436 | # GNU General Public License for more details. | |
1437 | ||
1438 | # You should have received a copy of the GNU General Public License | |
1439 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
1440 | ||
1441 | # Please report bugs or propose patches to gary@gnu.org. | |
1496 | # This is free software. There is NO warranty; not even for | |
1497 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
1498 | # | |
1499 | # Copyright (C) 2010-2017 Bootstrap Authors | |
1500 | # | |
1501 | # This file is dual licensed under the terms of the MIT license | |
1502 | # <https://opensource.org/license/MIT>, and GPL version 3 or later | |
1503 | # <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of | |
1504 | # these licenses when using or redistributing this software or any of | |
1505 | # the files within it. See the URLs above, or the file `LICENSE` | |
1506 | # included in the Bootstrap distribution for the full license texts. | |
1507 | ||
1508 | # Please report bugs or propose patches to: | |
1509 | # <https://github.com/gnulib-modules/bootstrap/issues> | |
1510 | ||
1511 | # Set a version string for this script. | |
1512 | scriptversion=2016-03-06.01; # UTC | |
1442 | 1513 | |
1443 | 1514 | |
1444 | 1515 | ## ------ ## |
1461 | 1532 | # |
1462 | 1533 | # In order for the '--version' option to work, you will need to have a |
1463 | 1534 | # suitably formatted comment like the one at the top of this file |
1464 | # starting with '# Written by ' and ending with '# warranty; '. | |
1535 | # starting with '# Written by ' and ending with '# Copyright'. | |
1465 | 1536 | # |
1466 | 1537 | # For '-h' and '--help' to work, you will also need a one line |
1467 | 1538 | # description of your script's purpose in a comment directly above the |
1473 | 1544 | # to display verbose messages only when your user has specified |
1474 | 1545 | # '--verbose'. |
1475 | 1546 | # |
1476 | # After sourcing this file, you can plug processing for additional | |
1547 | # After sourcing this file, you can plug in processing for additional | |
1477 | 1548 | # options by amending the variables from the 'Configuration' section |
1478 | 1549 | # below, and following the instructions in the 'Option parsing' |
1479 | 1550 | # section further down. |
1522 | 1593 | ## ------------------------- ## |
1523 | 1594 | |
1524 | 1595 | # This section contains functions for adding, removing, and running hooks |
1525 | # to the main code. A hook is just a named list of of function, that can | |
1526 | # be run in order later on. | |
1596 | # in the main code. A hook is just a list of function names that can be | |
1597 | # run in order later on. | |
1527 | 1598 | |
1528 | 1599 | # func_hookable FUNC_NAME |
1529 | 1600 | # ----------------------- |
1556 | 1627 | |
1557 | 1628 | # func_remove_hook FUNC_NAME HOOK_FUNC |
1558 | 1629 | # ------------------------------------ |
1559 | # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. | |
1630 | # Remove HOOK_FUNC from the list of hook functions to be called by | |
1631 | # FUNC_NAME. | |
1560 | 1632 | func_remove_hook () |
1561 | 1633 | { |
1562 | 1634 | $debug_cmd |
1563 | 1635 | |
1564 | 1636 | eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' |
1637 | } | |
1638 | ||
1639 | ||
1640 | # func_propagate_result FUNC_NAME_A FUNC_NAME_B | |
1641 | # --------------------------------------------- | |
1642 | # If the *_result variable of FUNC_NAME_A _is set_, assign its value to | |
1643 | # *_result variable of FUNC_NAME_B. | |
1644 | func_propagate_result () | |
1645 | { | |
1646 | $debug_cmd | |
1647 | ||
1648 | func_propagate_result_result=: | |
1649 | if eval "test \"\${${1}_result+set}\" = set" | |
1650 | then | |
1651 | eval "${2}_result=\$${1}_result" | |
1652 | else | |
1653 | func_propagate_result_result=false | |
1654 | fi | |
1565 | 1655 | } |
1566 | 1656 | |
1567 | 1657 | |
1568 | 1658 | # func_run_hooks FUNC_NAME [ARG]... |
1569 | 1659 | # --------------------------------- |
1570 | 1660 | # Run all hook functions registered to FUNC_NAME. |
1571 | # It is assumed that the list of hook functions contains nothing more | |
1661 | # It's assumed that the list of hook functions contains nothing more | |
1572 | 1662 | # than a whitespace-delimited list of legal shell function names, and |
1573 | 1663 | # no effort is wasted trying to catch shell meta-characters or preserve |
1574 | 1664 | # whitespace. |
1578 | 1668 | |
1579 | 1669 | case " $hookable_fns " in |
1580 | 1670 | *" $1 "*) ;; |
1581 | *) func_fatal_error "'$1' does not support hook funcions.n" ;; | |
1671 | *) func_fatal_error "'$1' does not support hook functions." ;; | |
1582 | 1672 | esac |
1583 | 1673 | |
1584 | 1674 | eval _G_hook_fns=\$$1_hooks; shift |
1585 | 1675 | |
1586 | 1676 | for _G_hook in $_G_hook_fns; do |
1587 | eval $_G_hook '"$@"' | |
1588 | ||
1589 | # store returned options list back into positional | |
1590 | # parameters for next 'cmd' execution. | |
1591 | eval _G_hook_result=\$${_G_hook}_result | |
1592 | eval set dummy "$_G_hook_result"; shift | |
1677 | func_unset "${_G_hook}_result" | |
1678 | eval $_G_hook '${1+"$@"}' | |
1679 | func_propagate_result $_G_hook func_run_hooks | |
1680 | if $func_propagate_result_result; then | |
1681 | eval set dummy "$func_run_hooks_result"; shift | |
1682 | fi | |
1593 | 1683 | done |
1594 | ||
1595 | func_quote_for_eval ${1+"$@"} | |
1596 | func_run_hooks_result=$func_quote_for_eval_result | |
1597 | 1684 | } |
1598 | 1685 | |
1599 | 1686 | |
1603 | 1690 | ## --------------- ## |
1604 | 1691 | |
1605 | 1692 | # In order to add your own option parsing hooks, you must accept the |
1606 | # full positional parameter list in your hook function, remove any | |
1607 | # options that you action, and then pass back the remaining unprocessed | |
1608 | # options in '<hooked_function_name>_result', escaped suitably for | |
1609 | # 'eval'. Like this: | |
1693 | # full positional parameter list from your hook function. You may remove | |
1694 | # or edit any options that you action, and then pass back the remaining | |
1695 | # unprocessed options in '<hooked_function_name>_result', escaped | |
1696 | # suitably for 'eval'. | |
1697 | # | |
1698 | # The '<hooked_function_name>_result' variable is automatically unset | |
1699 | # before your hook gets called; for best performance, only set the | |
1700 | # *_result variable when necessary (i.e. don't call the 'func_quote' | |
1701 | # function unnecessarily because it can be an expensive operation on some | |
1702 | # machines). | |
1703 | # | |
1704 | # Like this: | |
1610 | 1705 | # |
1611 | 1706 | # my_options_prep () |
1612 | 1707 | # { |
1616 | 1711 | # usage_message=$usage_message' |
1617 | 1712 | # -s, --silent don'\''t print informational messages |
1618 | 1713 | # ' |
1619 | # | |
1620 | # func_quote_for_eval ${1+"$@"} | |
1621 | # my_options_prep_result=$func_quote_for_eval_result | |
1714 | # # No change in '$@' (ignored completely by this hook). Leave | |
1715 | # # my_options_prep_result variable intact. | |
1622 | 1716 | # } |
1623 | 1717 | # func_add_hook func_options_prep my_options_prep |
1624 | 1718 | # |
1627 | 1721 | # { |
1628 | 1722 | # $debug_cmd |
1629 | 1723 | # |
1630 | # # Note that for efficiency, we parse as many options as we can | |
1724 | # args_changed=false | |
1725 | # | |
1726 | # # Note that, for efficiency, we parse as many options as we can | |
1631 | 1727 | # # recognise in a loop before passing the remainder back to the |
1632 | 1728 | # # caller on the first unrecognised argument we encounter. |
1633 | 1729 | # while test $# -gt 0; do |
1634 | 1730 | # opt=$1; shift |
1635 | 1731 | # case $opt in |
1636 | # --silent|-s) opt_silent=: ;; | |
1732 | # --silent|-s) opt_silent=: | |
1733 | # args_changed=: | |
1734 | # ;; | |
1637 | 1735 | # # Separate non-argument short options: |
1638 | 1736 | # -s*) func_split_short_opt "$_G_opt" |
1639 | 1737 | # set dummy "$func_split_short_opt_name" \ |
1640 | 1738 | # "-$func_split_short_opt_arg" ${1+"$@"} |
1641 | 1739 | # shift |
1740 | # args_changed=: | |
1642 | 1741 | # ;; |
1643 | # *) set dummy "$_G_opt" "$*"; shift; break ;; | |
1742 | # *) # Make sure the first unrecognised option "$_G_opt" | |
1743 | # # is added back to "$@" in case we need it later, | |
1744 | # # if $args_changed was set to 'true'. | |
1745 | # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; | |
1644 | 1746 | # esac |
1645 | 1747 | # done |
1646 | 1748 | # |
1647 | # func_quote_for_eval ${1+"$@"} | |
1648 | # my_silent_option_result=$func_quote_for_eval_result | |
1749 | # # Only call 'func_quote' here if we processed at least one argument. | |
1750 | # if $args_changed; then | |
1751 | # func_quote eval ${1+"$@"} | |
1752 | # my_silent_option_result=$func_quote_result | |
1753 | # fi | |
1649 | 1754 | # } |
1650 | 1755 | # func_add_hook func_parse_options my_silent_option |
1651 | 1756 | # |
1656 | 1761 | # |
1657 | 1762 | # $opt_silent && $opt_verbose && func_fatal_help "\ |
1658 | 1763 | # '--silent' and '--verbose' options are mutually exclusive." |
1659 | # | |
1660 | # func_quote_for_eval ${1+"$@"} | |
1661 | # my_option_validation_result=$func_quote_for_eval_result | |
1662 | 1764 | # } |
1663 | 1765 | # func_add_hook func_validate_options my_option_validation |
1664 | 1766 | # |
1665 | # You'll alse need to manually amend $usage_message to reflect the extra | |
1767 | # You'll also need to manually amend $usage_message to reflect the extra | |
1666 | 1768 | # options you parse. It's preferable to append if you can, so that |
1667 | 1769 | # multiple option parsing hooks can be added safely. |
1770 | ||
1771 | ||
1772 | # func_options_finish [ARG]... | |
1773 | # ---------------------------- | |
1774 | # Finishing the option parse loop (call 'func_options' hooks ATM). | |
1775 | func_options_finish () | |
1776 | { | |
1777 | $debug_cmd | |
1778 | ||
1779 | func_run_hooks func_options ${1+"$@"} | |
1780 | func_propagate_result func_run_hooks func_options_finish | |
1781 | } | |
1668 | 1782 | |
1669 | 1783 | |
1670 | 1784 | # func_options [ARG]... |
1676 | 1790 | { |
1677 | 1791 | $debug_cmd |
1678 | 1792 | |
1679 | func_options_prep ${1+"$@"} | |
1680 | eval func_parse_options \ | |
1681 | ${func_options_prep_result+"$func_options_prep_result"} | |
1682 | eval func_validate_options \ | |
1683 | ${func_parse_options_result+"$func_parse_options_result"} | |
1684 | ||
1685 | eval func_run_hooks func_options \ | |
1686 | ${func_validate_options_result+"$func_validate_options_result"} | |
1687 | ||
1688 | # save modified positional parameters for caller | |
1689 | func_options_result=$func_run_hooks_result | |
1793 | _G_options_quoted=false | |
1794 | ||
1795 | for my_func in options_prep parse_options validate_options options_finish | |
1796 | do | |
1797 | func_unset func_${my_func}_result | |
1798 | func_unset func_run_hooks_result | |
1799 | eval func_$my_func '${1+"$@"}' | |
1800 | func_propagate_result func_$my_func func_options | |
1801 | if $func_propagate_result_result; then | |
1802 | eval set dummy "$func_options_result"; shift | |
1803 | _G_options_quoted=: | |
1804 | fi | |
1805 | done | |
1806 | ||
1807 | $_G_options_quoted || { | |
1808 | # As we (func_options) are top-level options-parser function and | |
1809 | # nobody quoted "$@" for us yet, we need to do it explicitly for | |
1810 | # caller. | |
1811 | func_quote eval ${1+"$@"} | |
1812 | func_options_result=$func_quote_result | |
1813 | } | |
1690 | 1814 | } |
1691 | 1815 | |
1692 | 1816 | |
1695 | 1819 | # All initialisations required before starting the option parse loop. |
1696 | 1820 | # Note that when calling hook functions, we pass through the list of |
1697 | 1821 | # positional parameters. If a hook function modifies that list, and |
1698 | # needs to propogate that back to rest of this script, then the complete | |
1699 | # modified list must be put in 'func_run_hooks_result' before | |
1700 | # returning. | |
1822 | # needs to propagate that back to rest of this script, then the complete | |
1823 | # modified list must be put in 'func_run_hooks_result' before returning. | |
1701 | 1824 | func_hookable func_options_prep |
1702 | 1825 | func_options_prep () |
1703 | 1826 | { |
1708 | 1831 | opt_warning_types= |
1709 | 1832 | |
1710 | 1833 | func_run_hooks func_options_prep ${1+"$@"} |
1711 | ||
1712 | # save modified positional parameters for caller | |
1713 | func_options_prep_result=$func_run_hooks_result | |
1834 | func_propagate_result func_run_hooks func_options_prep | |
1714 | 1835 | } |
1715 | 1836 | |
1716 | 1837 | |
1722 | 1843 | { |
1723 | 1844 | $debug_cmd |
1724 | 1845 | |
1725 | func_parse_options_result= | |
1726 | ||
1846 | _G_parse_options_requote=false | |
1727 | 1847 | # this just eases exit handling |
1728 | 1848 | while test $# -gt 0; do |
1729 | 1849 | # Defer to hook functions for initial option parsing, so they |
1730 | 1850 | # get priority in the event of reusing an option name. |
1731 | 1851 | func_run_hooks func_parse_options ${1+"$@"} |
1732 | ||
1733 | # Adjust func_parse_options positional parameters to match | |
1734 | eval set dummy "$func_run_hooks_result"; shift | |
1852 | func_propagate_result func_run_hooks func_parse_options | |
1853 | if $func_propagate_result_result; then | |
1854 | eval set dummy "$func_parse_options_result"; shift | |
1855 | # Even though we may have changed "$@", we passed the "$@" array | |
1856 | # down into the hook and it quoted it for us (because we are in | |
1857 | # this if-branch). No need to quote it again. | |
1858 | _G_parse_options_requote=false | |
1859 | fi | |
1735 | 1860 | |
1736 | 1861 | # Break out of the loop if we already parsed every option. |
1737 | 1862 | test $# -gt 0 || break |
1738 | 1863 | |
1864 | # We expect that one of the options parsed in this function matches | |
1865 | # and thus we remove _G_opt from "$@" and need to re-quote. | |
1866 | _G_match_parse_options=: | |
1739 | 1867 | _G_opt=$1 |
1740 | 1868 | shift |
1741 | 1869 | case $_G_opt in |
1742 | 1870 | --debug|-x) debug_cmd='set -x' |
1743 | func_echo "enabling shell trace mode" | |
1871 | func_echo "enabling shell trace mode" >&2 | |
1744 | 1872 | $debug_cmd |
1745 | 1873 | ;; |
1746 | 1874 | |
1750 | 1878 | ;; |
1751 | 1879 | |
1752 | 1880 | --warnings|--warning|-W) |
1753 | test $# = 0 && func_missing_arg $_G_opt && break | |
1881 | if test $# = 0 && func_missing_arg $_G_opt; then | |
1882 | _G_parse_options_requote=: | |
1883 | break | |
1884 | fi | |
1754 | 1885 | case " $warning_categories $1" in |
1755 | 1886 | *" $1 "*) |
1756 | 1887 | # trailing space prevents matching last $1 above |
1803 | 1934 | shift |
1804 | 1935 | ;; |
1805 | 1936 | |
1806 | --) break ;; | |
1937 | --) _G_parse_options_requote=: ; break ;; | |
1807 | 1938 | -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; |
1808 | *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; | |
1939 | *) set dummy "$_G_opt" ${1+"$@"}; shift | |
1940 | _G_match_parse_options=false | |
1941 | break | |
1942 | ;; | |
1809 | 1943 | esac |
1944 | ||
1945 | if $_G_match_parse_options; then | |
1946 | _G_parse_options_requote=: | |
1947 | fi | |
1810 | 1948 | done |
1811 | 1949 | |
1812 | # save modified positional parameters for caller | |
1813 | func_quote_for_eval ${1+"$@"} | |
1814 | func_parse_options_result=$func_quote_for_eval_result | |
1950 | if $_G_parse_options_requote; then | |
1951 | # save modified positional parameters for caller | |
1952 | func_quote eval ${1+"$@"} | |
1953 | func_parse_options_result=$func_quote_result | |
1954 | fi | |
1815 | 1955 | } |
1816 | 1956 | |
1817 | 1957 | |
1828 | 1968 | test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" |
1829 | 1969 | |
1830 | 1970 | func_run_hooks func_validate_options ${1+"$@"} |
1971 | func_propagate_result func_run_hooks func_validate_options | |
1831 | 1972 | |
1832 | 1973 | # Bail if the options were screwed! |
1833 | 1974 | $exit_cmd $EXIT_FAILURE |
1834 | ||
1835 | # save modified positional parameters for caller | |
1836 | func_validate_options_result=$func_run_hooks_result | |
1837 | 1975 | } |
1838 | 1976 | |
1839 | 1977 | |
1889 | 2027 | |
1890 | 2028 | # func_split_equals STRING |
1891 | 2029 | # ------------------------ |
1892 | # Set func_split_equals_lhs and func_split_equals_rhs shell variables after | |
1893 | # splitting STRING at the '=' sign. | |
2030 | # Set func_split_equals_lhs and func_split_equals_rhs shell variables | |
2031 | # after splitting STRING at the '=' sign. | |
1894 | 2032 | test -z "$_G_HAVE_XSI_OPS" \ |
1895 | 2033 | && (eval 'x=a/b/c; |
1896 | 2034 | test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ |
1905 | 2043 | |
1906 | 2044 | func_split_equals_lhs=${1%%=*} |
1907 | 2045 | func_split_equals_rhs=${1#*=} |
1908 | test "x$func_split_equals_lhs" = "x$1" \ | |
1909 | && func_split_equals_rhs= | |
2046 | if test "x$func_split_equals_lhs" = "x$1"; then | |
2047 | func_split_equals_rhs= | |
2048 | fi | |
1910 | 2049 | }' |
1911 | 2050 | else |
1912 | 2051 | # ...otherwise fall back to using expr, which is often a shell builtin. |
1984 | 2123 | # func_version |
1985 | 2124 | # ------------ |
1986 | 2125 | # Echo version message to standard output and exit. |
2126 | # The version message is extracted from the calling file's header | |
2127 | # comments, with leading '# ' stripped: | |
2128 | # 1. First display the progname and version | |
2129 | # 2. Followed by the header comment line matching /^# Written by / | |
2130 | # 3. Then a blank line followed by the first following line matching | |
2131 | # /^# Copyright / | |
2132 | # 4. Immediately followed by any lines between the previous matches, | |
2133 | # except lines preceding the intervening completely blank line. | |
2134 | # For example, see the header comments of this file. | |
1987 | 2135 | func_version () |
1988 | 2136 | { |
1989 | 2137 | $debug_cmd |
1990 | 2138 | |
1991 | 2139 | printf '%s\n' "$progname $scriptversion" |
1992 | 2140 | $SED -n ' |
1993 | /(C)/!b go | |
1994 | :more | |
1995 | /\./!{ | |
1996 | N | |
1997 | s|\n# | | | |
1998 | b more | |
2141 | /^# Written by /!b | |
2142 | s|^# ||; p; n | |
2143 | ||
2144 | :fwd2blnk | |
2145 | /./ { | |
2146 | n | |
2147 | b fwd2blnk | |
1999 | 2148 | } |
2000 | :go | |
2001 | /^# Written by /,/# warranty; / { | |
2002 | s|^# || | |
2003 | s|^# *$|| | |
2004 | s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| | |
2005 | p | |
2149 | p; n | |
2150 | ||
2151 | :holdwrnt | |
2152 | s|^# || | |
2153 | s|^# *$|| | |
2154 | /^Copyright /!{ | |
2155 | /./H | |
2156 | n | |
2157 | b holdwrnt | |
2006 | 2158 | } |
2007 | /^# Written by / { | |
2008 | s|^# || | |
2009 | p | |
2010 | } | |
2011 | /^warranty; /q' < "$progpath" | |
2159 | ||
2160 | s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| | |
2161 | G | |
2162 | s|\(\n\)\n*|\1|g | |
2163 | p; q' < "$progpath" | |
2012 | 2164 | |
2013 | 2165 | exit $? |
2014 | 2166 | } |
2023 | 2175 | # End: |
2024 | 2176 | |
2025 | 2177 | # Set a version string. |
2026 | scriptversion='(GNU libtool) 2.4.6' | |
2178 | scriptversion='(GNU libtool) 2.4.6.40-6ca5-dirty' | |
2027 | 2179 | |
2028 | 2180 | |
2029 | 2181 | # func_echo ARG... |
2114 | 2266 | compiler: $LTCC |
2115 | 2267 | compiler flags: $LTCFLAGS |
2116 | 2268 | linker: $LD (gnu? $with_gnu_ld) |
2117 | version: $progname (GNU libtool) 2.4.6 | |
2269 | version: $progname (GNU libtool) 2.4.6.40-6ca5-dirty | |
2118 | 2270 | automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` |
2119 | 2271 | autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` |
2120 | 2272 | |
2121 | 2273 | Report bugs to <bug-libtool@gnu.org>. |
2122 | GNU libtool home page: <http://www.gnu.org/software/libtool/>. | |
2274 | GNU libtool home page: <http://www.gnu.org/s/libtool/>. | |
2123 | 2275 | General help using GNU software: <http://www.gnu.org/gethelp/>." |
2124 | 2276 | exit 0 |
2125 | 2277 | } |
2170 | 2322 | # a configuration failure hint, and exit. |
2171 | 2323 | func_fatal_configuration () |
2172 | 2324 | { |
2173 | func__fatal_error ${1+"$@"} \ | |
2325 | func_fatal_error ${1+"$@"} \ | |
2174 | 2326 | "See the $PACKAGE documentation for more information." \ |
2175 | 2327 | "Fatal configuration error." |
2176 | 2328 | } |
2316 | 2468 | nonopt= |
2317 | 2469 | preserve_args= |
2318 | 2470 | |
2471 | _G_rc_lt_options_prep=: | |
2472 | ||
2319 | 2473 | # Shorthand for --mode=foo, only valid as the first argument |
2320 | 2474 | case $1 in |
2321 | 2475 | clean|clea|cle|cl) |
2339 | 2493 | uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) |
2340 | 2494 | shift; set dummy --mode uninstall ${1+"$@"}; shift |
2341 | 2495 | ;; |
2496 | *) | |
2497 | _G_rc_lt_options_prep=false | |
2498 | ;; | |
2342 | 2499 | esac |
2343 | 2500 | |
2344 | # Pass back the list of options. | |
2345 | func_quote_for_eval ${1+"$@"} | |
2346 | libtool_options_prep_result=$func_quote_for_eval_result | |
2501 | if $_G_rc_lt_options_prep; then | |
2502 | # Pass back the list of options. | |
2503 | func_quote eval ${1+"$@"} | |
2504 | libtool_options_prep_result=$func_quote_result | |
2505 | fi | |
2347 | 2506 | } |
2348 | 2507 | func_add_hook func_options_prep libtool_options_prep |
2349 | 2508 | |
2355 | 2514 | { |
2356 | 2515 | $debug_cmd |
2357 | 2516 | |
2517 | _G_rc_lt_parse_options=false | |
2518 | ||
2358 | 2519 | # Perform our own loop to consume as many options as possible in |
2359 | 2520 | # each iteration. |
2360 | 2521 | while test $# -gt 0; do |
2522 | _G_match_lt_parse_options=: | |
2361 | 2523 | _G_opt=$1 |
2362 | 2524 | shift |
2363 | 2525 | case $_G_opt in |
2432 | 2594 | func_append preserve_args " $_G_opt" |
2433 | 2595 | ;; |
2434 | 2596 | |
2435 | # An option not handled by this hook function: | |
2436 | *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; | |
2597 | # An option not handled by this hook function: | |
2598 | *) set dummy "$_G_opt" ${1+"$@"} ; shift | |
2599 | _G_match_lt_parse_options=false | |
2600 | break | |
2601 | ;; | |
2437 | 2602 | esac |
2603 | $_G_match_lt_parse_options && _G_rc_lt_parse_options=: | |
2438 | 2604 | done |
2439 | 2605 | |
2440 | ||
2441 | # save modified positional parameters for caller | |
2442 | func_quote_for_eval ${1+"$@"} | |
2443 | libtool_parse_options_result=$func_quote_for_eval_result | |
2606 | if $_G_rc_lt_parse_options; then | |
2607 | # save modified positional parameters for caller | |
2608 | func_quote eval ${1+"$@"} | |
2609 | libtool_parse_options_result=$func_quote_result | |
2610 | fi | |
2444 | 2611 | } |
2445 | 2612 | func_add_hook func_parse_options libtool_parse_options |
2446 | 2613 | |
2497 | 2664 | } |
2498 | 2665 | |
2499 | 2666 | # Pass back the unparsed argument list |
2500 | func_quote_for_eval ${1+"$@"} | |
2501 | libtool_validate_options_result=$func_quote_for_eval_result | |
2667 | func_quote eval ${1+"$@"} | |
2668 | libtool_validate_options_result=$func_quote_result | |
2502 | 2669 | } |
2503 | 2670 | func_add_hook func_validate_options libtool_validate_options |
2504 | 2671 | |
3464 | 3631 | esac |
3465 | 3632 | done |
3466 | 3633 | |
3467 | func_quote_for_eval "$libobj" | |
3468 | test "X$libobj" != "X$func_quote_for_eval_result" \ | |
3634 | func_quote_arg pretty "$libobj" | |
3635 | test "X$libobj" != "X$func_quote_arg_result" \ | |
3469 | 3636 | && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ |
3470 | 3637 | && func_warning "libobj name '$libobj' may not contain shell special characters." |
3471 | 3638 | func_dirname_and_basename "$obj" "/" "" |
3538 | 3705 | |
3539 | 3706 | func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 |
3540 | 3707 | srcfile=$func_to_tool_file_result |
3541 | func_quote_for_eval "$srcfile" | |
3542 | qsrcfile=$func_quote_for_eval_result | |
3708 | func_quote_arg pretty "$srcfile" | |
3709 | qsrcfile=$func_quote_arg_result | |
3543 | 3710 | |
3544 | 3711 | # Only build a PIC object if we are building libtool libraries. |
3545 | 3712 | if test yes = "$build_libtool_libs"; then |
4142 | 4309 | case $nonopt in *shtool*) :;; *) false;; esac |
4143 | 4310 | then |
4144 | 4311 | # Aesthetically quote it. |
4145 | func_quote_for_eval "$nonopt" | |
4146 | install_prog="$func_quote_for_eval_result " | |
4312 | func_quote_arg pretty "$nonopt" | |
4313 | install_prog="$func_quote_arg_result " | |
4147 | 4314 | arg=$1 |
4148 | 4315 | shift |
4149 | 4316 | else |
4153 | 4320 | |
4154 | 4321 | # The real first argument should be the name of the installation program. |
4155 | 4322 | # Aesthetically quote it. |
4156 | func_quote_for_eval "$arg" | |
4157 | func_append install_prog "$func_quote_for_eval_result" | |
4323 | func_quote_arg pretty "$arg" | |
4324 | func_append install_prog "$func_quote_arg_result" | |
4158 | 4325 | install_shared_prog=$install_prog |
4159 | 4326 | case " $install_prog " in |
4160 | 4327 | *[\\\ /]cp\ *) install_cp=: ;; |
4211 | 4378 | esac |
4212 | 4379 | |
4213 | 4380 | # Aesthetically quote the argument. |
4214 | func_quote_for_eval "$arg" | |
4215 | func_append install_prog " $func_quote_for_eval_result" | |
4381 | func_quote_arg pretty "$arg" | |
4382 | func_append install_prog " $func_quote_arg_result" | |
4216 | 4383 | if test -n "$arg2"; then |
4217 | func_quote_for_eval "$arg2" | |
4384 | func_quote_arg pretty "$arg2" | |
4218 | 4385 | fi |
4219 | func_append install_shared_prog " $func_quote_for_eval_result" | |
4386 | func_append install_shared_prog " $func_quote_arg_result" | |
4220 | 4387 | done |
4221 | 4388 | |
4222 | 4389 | test -z "$install_prog" && \ |
4227 | 4394 | |
4228 | 4395 | if test -n "$install_override_mode" && $no_mode; then |
4229 | 4396 | if $install_cp; then :; else |
4230 | func_quote_for_eval "$install_override_mode" | |
4231 | func_append install_shared_prog " -m $func_quote_for_eval_result" | |
4397 | func_quote_arg pretty "$install_override_mode" | |
4398 | func_append install_shared_prog " -m $func_quote_arg_result" | |
4232 | 4399 | fi |
4233 | 4400 | fi |
4234 | 4401 | |
4524 | 4691 | relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` |
4525 | 4692 | |
4526 | 4693 | $opt_quiet || { |
4527 | func_quote_for_expand "$relink_command" | |
4528 | eval "func_echo $func_quote_for_expand_result" | |
4694 | func_quote_arg expand,pretty "$relink_command" | |
4695 | eval "func_echo $func_quote_arg_result" | |
4529 | 4696 | } |
4530 | 4697 | if eval "$relink_command"; then : |
4531 | 4698 | else |
5304 | 5471 | if test \"\$libtool_execute_magic\" != \"$magic\"; then |
5305 | 5472 | file=\"\$0\"" |
5306 | 5473 | |
5307 | func_quote "$ECHO" | |
5308 | qECHO=$func_quote_result | |
5474 | func_quote_arg pretty "$ECHO" | |
5475 | qECHO=$func_quote_arg_result | |
5309 | 5476 | $ECHO "\ |
5310 | 5477 | |
5311 | 5478 | # A function that is used when there is no print builtin or printf. |
5315 | 5482 | \$1 |
5316 | 5483 | _LTECHO_EOF' |
5317 | 5484 | } |
5318 | ECHO=\"$qECHO\" | |
5485 | ECHO=$qECHO | |
5319 | 5486 | fi |
5320 | 5487 | |
5321 | 5488 | # Very basic option parsing. These options are (a) specific to |
6658 | 6825 | while test "$#" -gt 0; do |
6659 | 6826 | arg=$1 |
6660 | 6827 | shift |
6661 | func_quote_for_eval "$arg" | |
6662 | qarg=$func_quote_for_eval_unquoted_result | |
6663 | func_append libtool_args " $func_quote_for_eval_result" | |
6828 | func_quote_arg pretty,unquoted "$arg" | |
6829 | qarg=$func_quote_arg_unquoted_result | |
6830 | func_append libtool_args " $func_quote_arg_result" | |
6664 | 6831 | |
6665 | 6832 | # If the previous option needs an argument, assign it. |
6666 | 6833 | if test -n "$prev"; then |
7258 | 7425 | save_ifs=$IFS; IFS=, |
7259 | 7426 | for flag in $args; do |
7260 | 7427 | IFS=$save_ifs |
7261 | func_quote_for_eval "$flag" | |
7262 | func_append arg " $func_quote_for_eval_result" | |
7263 | func_append compiler_flags " $func_quote_for_eval_result" | |
7428 | func_quote_arg pretty "$flag" | |
7429 | func_append arg " $func_quote_arg_result" | |
7430 | func_append compiler_flags " $func_quote_arg_result" | |
7264 | 7431 | done |
7265 | 7432 | IFS=$save_ifs |
7266 | 7433 | func_stripname ' ' '' "$arg" |
7274 | 7441 | save_ifs=$IFS; IFS=, |
7275 | 7442 | for flag in $args; do |
7276 | 7443 | IFS=$save_ifs |
7277 | func_quote_for_eval "$flag" | |
7278 | func_append arg " $wl$func_quote_for_eval_result" | |
7279 | func_append compiler_flags " $wl$func_quote_for_eval_result" | |
7280 | func_append linker_flags " $func_quote_for_eval_result" | |
7444 | func_quote_arg pretty "$flag" | |
7445 | func_append arg " $wl$func_quote_arg_result" | |
7446 | func_append compiler_flags " $wl$func_quote_arg_result" | |
7447 | func_append linker_flags " $func_quote_arg_result" | |
7281 | 7448 | done |
7282 | 7449 | IFS=$save_ifs |
7283 | 7450 | func_stripname ' ' '' "$arg" |
7301 | 7468 | |
7302 | 7469 | # -msg_* for osf cc |
7303 | 7470 | -msg_*) |
7304 | func_quote_for_eval "$arg" | |
7305 | arg=$func_quote_for_eval_result | |
7471 | func_quote_arg pretty "$arg" | |
7472 | arg=$func_quote_arg_result | |
7306 | 7473 | ;; |
7307 | 7474 | |
7308 | 7475 | # Flags to be passed through unchanged, with rationale: |
7327 | 7494 | -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ |
7328 | 7495 | -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ |
7329 | 7496 | -specs=*|-fsanitize=*|-fuse-ld=*) |
7330 | func_quote_for_eval "$arg" | |
7331 | arg=$func_quote_for_eval_result | |
7497 | func_quote_arg pretty "$arg" | |
7498 | arg=$func_quote_arg_result | |
7332 | 7499 | func_append compile_command " $arg" |
7333 | 7500 | func_append finalize_command " $arg" |
7334 | 7501 | func_append compiler_flags " $arg" |
7349 | 7516 | continue |
7350 | 7517 | else |
7351 | 7518 | # Otherwise treat like 'Some other compiler flag' below |
7352 | func_quote_for_eval "$arg" | |
7353 | arg=$func_quote_for_eval_result | |
7519 | func_quote_arg pretty "$arg" | |
7520 | arg=$func_quote_arg_result | |
7354 | 7521 | fi |
7355 | 7522 | ;; |
7356 | 7523 | |
7357 | 7524 | # Some other compiler flag. |
7358 | 7525 | -* | +*) |
7359 | func_quote_for_eval "$arg" | |
7360 | arg=$func_quote_for_eval_result | |
7526 | func_quote_arg pretty "$arg" | |
7527 | arg=$func_quote_arg_result | |
7361 | 7528 | ;; |
7362 | 7529 | |
7363 | 7530 | *.$objext) |
7477 | 7644 | *) |
7478 | 7645 | # Unknown arguments in both finalize_command and compile_command need |
7479 | 7646 | # to be aesthetically quoted because they are evaled later. |
7480 | func_quote_for_eval "$arg" | |
7481 | arg=$func_quote_for_eval_result | |
7647 | func_quote_arg pretty "$arg" | |
7648 | arg=$func_quote_arg_result | |
7482 | 7649 | ;; |
7483 | 7650 | esac # arg |
7484 | 7651 | |
9984 | 10151 | for cmd in $concat_cmds; do |
9985 | 10152 | IFS=$save_ifs |
9986 | 10153 | $opt_quiet || { |
9987 | func_quote_for_expand "$cmd" | |
9988 | eval "func_echo $func_quote_for_expand_result" | |
10154 | func_quote_arg expand,pretty "$cmd" | |
10155 | eval "func_echo $func_quote_arg_result" | |
9989 | 10156 | } |
9990 | 10157 | $opt_dry_run || eval "$cmd" || { |
9991 | 10158 | lt_exit=$? |
10078 | 10245 | eval cmd=\"$cmd\" |
10079 | 10246 | IFS=$save_ifs |
10080 | 10247 | $opt_quiet || { |
10081 | func_quote_for_expand "$cmd" | |
10082 | eval "func_echo $func_quote_for_expand_result" | |
10248 | func_quote_arg expand,pretty "$cmd" | |
10249 | eval "func_echo $func_quote_arg_result" | |
10083 | 10250 | } |
10084 | 10251 | $opt_dry_run || eval "$cmd" || { |
10085 | 10252 | lt_exit=$? |
10553 | 10720 | elif eval var_value=\$$var; test -z "$var_value"; then |
10554 | 10721 | relink_command="$var=; export $var; $relink_command" |
10555 | 10722 | else |
10556 | func_quote_for_eval "$var_value" | |
10557 | relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" | |
10723 | func_quote_arg pretty "$var_value" | |
10724 | relink_command="$var=$func_quote_arg_result; export $var; $relink_command" | |
10558 | 10725 | fi |
10559 | 10726 | done |
10560 | func_quote "(cd `pwd`; $relink_command)" | |
10561 | relink_command=$func_quote_result | |
10727 | func_quote eval cd "`pwd`" | |
10728 | func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" | |
10729 | relink_command=$func_quote_arg_unquoted_result | |
10562 | 10730 | fi |
10563 | 10731 | |
10564 | 10732 | # Only actually do things if not in dry run mode. |
10798 | 10966 | elif eval var_value=\$$var; test -z "$var_value"; then |
10799 | 10967 | relink_command="$var=; export $var; $relink_command" |
10800 | 10968 | else |
10801 | func_quote_for_eval "$var_value" | |
10802 | relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" | |
10969 | func_quote_arg pretty,unquoted "$var_value" | |
10970 | relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" | |
10803 | 10971 | fi |
10804 | 10972 | done |
10805 | 10973 | # Quote the link command for shipping. |
10806 | relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" | |
10807 | func_quote "$relink_command" | |
10808 | relink_command=$func_quote_result | |
10974 | func_quote eval cd "`pwd`" | |
10975 | relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" | |
10976 | func_quote_arg pretty,unquoted "$relink_command" | |
10977 | relink_command=$func_quote_arg_unquoted_result | |
10809 | 10978 | if test yes = "$hardcode_automatic"; then |
10810 | 10979 | relink_command= |
10811 | 10980 | fi |
0 | 0 | #! /bin/sh |
1 | 1 | # Common wrapper for a few potentially missing GNU programs. |
2 | 2 | |
3 | scriptversion=2013-10-28.13; # UTC | |
4 | ||
5 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. | |
3 | scriptversion=2016-01-11.22; # UTC | |
4 | ||
5 | # Copyright (C) 1996-2017 Free Software Foundation, Inc. | |
6 | 6 | # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. |
7 | 7 | |
8 | 8 | # This program is free software; you can redistribute it and/or modify |
209 | 209 | # eval: (add-hook 'write-file-hooks 'time-stamp) |
210 | 210 | # time-stamp-start: "scriptversion=" |
211 | 211 | # time-stamp-format: "%:y-%02m-%02d.%02H" |
212 | # time-stamp-time-zone: "UTC" | |
212 | # time-stamp-time-zone: "UTC0" | |
213 | 213 | # time-stamp-end: "; # UTC" |
214 | 214 | # End: |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for libseccomp 2.3.1. | |
2 | # Generated by GNU Autoconf 2.69 for libseccomp 2.3.3. | |
3 | 3 | # |
4 | 4 | # |
5 | 5 | # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. |
586 | 586 | # Identity of this package. |
587 | 587 | PACKAGE_NAME='libseccomp' |
588 | 588 | PACKAGE_TARNAME='libseccomp' |
589 | PACKAGE_VERSION='2.3.1' | |
590 | PACKAGE_STRING='libseccomp 2.3.1' | |
589 | PACKAGE_VERSION='2.3.3' | |
590 | PACKAGE_STRING='libseccomp 2.3.3' | |
591 | 591 | PACKAGE_BUGREPORT='' |
592 | 592 | PACKAGE_URL='' |
593 | 593 | |
632 | 632 | am__EXEEXT_TRUE |
633 | 633 | LTLIBOBJS |
634 | 634 | LIBOBJS |
635 | CODE_COVERAGE_RULES | |
636 | CODE_COVERAGE_LDFLAGS | |
637 | CODE_COVERAGE_LIBS | |
638 | CODE_COVERAGE_CXXFLAGS | |
639 | CODE_COVERAGE_CFLAGS | |
640 | CODE_COVERAGE_CPPFLAGS | |
641 | GENHTML | |
642 | LCOV | |
643 | GCOV | |
644 | CODE_COVERAGE_ENABLED | |
645 | CODE_COVERAGE_ENABLED_FALSE | |
646 | CODE_COVERAGE_ENABLED_TRUE | |
635 | 647 | COVERITY_FALSE |
636 | 648 | COVERITY_TRUE |
637 | 649 | have_coverity |
771 | 783 | with_sysroot |
772 | 784 | enable_libtool_lock |
773 | 785 | enable_python |
786 | with_gcov | |
787 | enable_code_coverage | |
774 | 788 | ' |
775 | 789 | ac_precious_vars='build_alias |
776 | 790 | host_alias |
1322 | 1336 | # Omit some internal or obsolete options to make the list less imposing. |
1323 | 1337 | # This message is too long to be a string in the A/UX 3.1 sh. |
1324 | 1338 | cat <<_ACEOF |
1325 | \`configure' configures libseccomp 2.3.1 to adapt to many kinds of systems. | |
1339 | \`configure' configures libseccomp 2.3.3 to adapt to many kinds of systems. | |
1326 | 1340 | |
1327 | 1341 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1328 | 1342 | |
1392 | 1406 | |
1393 | 1407 | if test -n "$ac_init_help"; then |
1394 | 1408 | case $ac_init_help in |
1395 | short | recursive ) echo "Configuration of libseccomp 2.3.1:";; | |
1409 | short | recursive ) echo "Configuration of libseccomp 2.3.3:";; | |
1396 | 1410 | esac |
1397 | 1411 | cat <<\_ACEOF |
1398 | 1412 | |
1412 | 1426 | optimize for fast installation [default=yes] |
1413 | 1427 | --disable-libtool-lock avoid locking (might break parallel builds) |
1414 | 1428 | --enable-python build the python bindings, requires cython |
1429 | --enable-code-coverage Whether to enable code coverage support | |
1415 | 1430 | |
1416 | 1431 | Optional Packages: |
1417 | 1432 | --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] |
1424 | 1439 | --with-gnu-ld assume the C compiler uses GNU ld [default=no] |
1425 | 1440 | --with-sysroot[=DIR] Search for dependent libraries within DIR (or the |
1426 | 1441 | compiler's sysroot if not specified). |
1442 | --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). | |
1427 | 1443 | |
1428 | 1444 | Some influential environment variables: |
1429 | 1445 | CC C compiler command |
1503 | 1519 | test -n "$ac_init_help" && exit $ac_status |
1504 | 1520 | if $ac_init_version; then |
1505 | 1521 | cat <<\_ACEOF |
1506 | libseccomp configure 2.3.1 | |
1522 | libseccomp configure 2.3.3 | |
1507 | 1523 | generated by GNU Autoconf 2.69 |
1508 | 1524 | |
1509 | 1525 | Copyright (C) 2012 Free Software Foundation, Inc. |
1781 | 1797 | This file contains any messages produced by compilers while |
1782 | 1798 | running configure, to aid debugging if configure makes a mistake. |
1783 | 1799 | |
1784 | It was created by libseccomp $as_me 2.3.1, which was | |
1800 | It was created by libseccomp $as_me 2.3.3, which was | |
1785 | 1801 | generated by GNU Autoconf 2.69. Invocation command line was |
1786 | 1802 | |
1787 | 1803 | $ $0 $@ |
2165 | 2181 | |
2166 | 2182 | |
2167 | 2183 | |
2168 | am__api_version='1.14' | |
2184 | am__api_version='1.15' | |
2169 | 2185 | |
2170 | 2186 | # Find a good install program. We prefer a C program (faster), |
2171 | 2187 | # so one script is as good as another. But avoid the broken or |
2337 | 2353 | ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' |
2338 | 2354 | program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` |
2339 | 2355 | |
2340 | # expand $ac_aux_dir to an absolute path | |
2341 | am_aux_dir=`cd $ac_aux_dir && pwd` | |
2356 | # Expand $ac_aux_dir to an absolute path. | |
2357 | am_aux_dir=`cd "$ac_aux_dir" && pwd` | |
2342 | 2358 | |
2343 | 2359 | if test x"${MISSING+set}" != xset; then |
2344 | 2360 | case $am_aux_dir in |
2357 | 2373 | $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} |
2358 | 2374 | fi |
2359 | 2375 | |
2360 | if test x"${install_sh}" != xset; then | |
2376 | if test x"${install_sh+set}" != xset; then | |
2361 | 2377 | case $am_aux_dir in |
2362 | 2378 | *\ * | *\ *) |
2363 | 2379 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; |
2651 | 2667 | |
2652 | 2668 | # Define the identity of the package. |
2653 | 2669 | PACKAGE='libseccomp' |
2654 | VERSION='2.3.1' | |
2670 | VERSION='2.3.3' | |
2655 | 2671 | |
2656 | 2672 | |
2657 | 2673 | cat >>confdefs.h <<_ACEOF |
2685 | 2701 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> |
2686 | 2702 | mkdir_p='$(MKDIR_P)' |
2687 | 2703 | |
2688 | # We need awk for the "check" target. The system "awk" is bad on | |
2689 | # some platforms. | |
2704 | # We need awk for the "check" target (and possibly the TAP driver). The | |
2705 | # system "awk" is bad on some platforms. | |
2690 | 2706 | # Always define AMTAR for backward compatibility. Yes, it's still used |
2691 | 2707 | # in the wild :-( We should find a proper way to deprecate it ... |
2692 | 2708 | AMTAR='$${TAR-tar}' |
2828 | 2844 | as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 |
2829 | 2845 | fi |
2830 | 2846 | fi |
2847 | ||
2831 | 2848 | |
2832 | 2849 | ac_ext=c |
2833 | 2850 | ac_cpp='$CPP $CPPFLAGS' |
4050 | 4067 | |
4051 | 4068 | |
4052 | 4069 | |
4053 | macro_version='2.4.6' | |
4054 | macro_revision='2.4.6' | |
4070 | macro_version='2.4.6.40-6ca5-dirty' | |
4071 | macro_revision='2.4.6.40' | |
4055 | 4072 | |
4056 | 4073 | |
4057 | 4074 | |
5713 | 5730 | fi |
5714 | 5731 | |
5715 | 5732 | : ${AR=ar} |
5716 | : ${AR_FLAGS=cru} | |
5717 | ||
5718 | ||
5719 | ||
5720 | ||
5721 | ||
5733 | ||
5734 | ||
5735 | ||
5736 | ||
5737 | ||
5738 | ||
5739 | # Use ARFLAGS variable as AR's operation code to sync the variable naming with | |
5740 | # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have | |
5741 | # higher priority because thats what people were doing historically (setting | |
5742 | # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS | |
5743 | # variable obsoleted/removed. | |
5744 | ||
5745 | test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} | |
5746 | lt_ar_flags=$AR_FLAGS | |
5747 | ||
5748 | ||
5749 | ||
5750 | ||
5751 | ||
5752 | ||
5753 | # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override | |
5754 | # by AR_FLAGS because that was never working and AR_FLAGS is about to die. | |
5722 | 5755 | |
5723 | 5756 | |
5724 | 5757 | |
7437 | 7470 | _LT_EOF |
7438 | 7471 | echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 |
7439 | 7472 | $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 |
7440 | echo "$AR cru libconftest.a conftest.o" >&5 | |
7441 | $AR cru libconftest.a conftest.o 2>&5 | |
7473 | echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 | |
7474 | $AR $AR_FLAGS libconftest.a conftest.o 2>&5 | |
7442 | 7475 | echo "$RANLIB libconftest.a" >&5 |
7443 | 7476 | $RANLIB libconftest.a 2>&5 |
7444 | 7477 | cat > conftest.c << _LT_EOF |
9199 | 9232 | emximp -o $lib $output_objdir/$libname.def' |
9200 | 9233 | old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' |
9201 | 9234 | enable_shared_with_static_runtimes=yes |
9235 | file_list_spec='@' | |
9202 | 9236 | ;; |
9203 | 9237 | |
9204 | 9238 | interix[3-9]*) |
9416 | 9450 | if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then |
9417 | 9451 | 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' |
9418 | 9452 | else |
9419 | 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' | |
9453 | 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' | |
9420 | 9454 | fi |
9421 | 9455 | aix_use_runtimelinking=no |
9422 | 9456 | |
10053 | 10087 | emximp -o $lib $output_objdir/$libname.def' |
10054 | 10088 | old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' |
10055 | 10089 | enable_shared_with_static_runtimes=yes |
10090 | file_list_spec='@' | |
10056 | 10091 | ;; |
10057 | 10092 | |
10058 | 10093 | osf3*) |
10861 | 10896 | *) objformat=elf ;; |
10862 | 10897 | esac |
10863 | 10898 | fi |
10864 | # Handle Gentoo/FreeBSD as it was Linux | |
10865 | case $host_vendor in | |
10866 | gentoo) | |
10867 | version_type=linux ;; | |
10868 | *) | |
10869 | version_type=freebsd-$objformat ;; | |
10870 | esac | |
10871 | ||
10899 | version_type=freebsd-$objformat | |
10872 | 10900 | case $version_type in |
10873 | 10901 | freebsd-elf*) |
10874 | 10902 | library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' |
10879 | 10907 | freebsd-*) |
10880 | 10908 | library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' |
10881 | 10909 | need_version=yes |
10882 | ;; | |
10883 | linux) | |
10884 | library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' | |
10885 | soname_spec='${libname}${release}${shared_ext}$major' | |
10886 | need_lib_prefix=no | |
10887 | need_version=no | |
10888 | 10910 | ;; |
10889 | 10911 | esac |
10890 | 10912 | shlibpath_var=LD_LIBRARY_PATH |
12009 | 12031 | old_striplib= |
12010 | 12032 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 |
12011 | 12033 | $as_echo_n "checking whether stripping libraries is possible... " >&6; } |
12012 | if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then | |
12013 | test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" | |
12014 | test -z "$striplib" && striplib="$STRIP --strip-unneeded" | |
12015 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
12034 | if test -z "$STRIP"; then | |
12035 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
12036 | $as_echo "no" >&6; } | |
12037 | else | |
12038 | if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then | |
12039 | old_striplib="$STRIP --strip-debug" | |
12040 | striplib="$STRIP --strip-unneeded" | |
12041 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
12016 | 12042 | $as_echo "yes" >&6; } |
12017 | else | |
12018 | # FIXME - insert some real tests, host_os isn't really good enough | |
12019 | case $host_os in | |
12020 | darwin*) | |
12021 | if test -n "$STRIP"; then | |
12043 | else | |
12044 | case $host_os in | |
12045 | darwin*) | |
12046 | # FIXME - insert some real tests, host_os isn't really good enough | |
12022 | 12047 | striplib="$STRIP -x" |
12023 | 12048 | old_striplib="$STRIP -S" |
12024 | 12049 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
12025 | 12050 | $as_echo "yes" >&6; } |
12026 | else | |
12051 | ;; | |
12052 | freebsd*) | |
12053 | if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then | |
12054 | old_striplib="$STRIP --strip-debug" | |
12055 | striplib="$STRIP --strip-unneeded" | |
12056 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
12057 | $as_echo "yes" >&6; } | |
12058 | else | |
12059 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
12060 | $as_echo "no" >&6; } | |
12061 | fi | |
12062 | ;; | |
12063 | *) | |
12027 | 12064 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
12028 | 12065 | $as_echo "no" >&6; } |
12029 | fi | |
12030 | ;; | |
12031 | *) | |
12032 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
12033 | $as_echo "no" >&6; } | |
12034 | ;; | |
12035 | esac | |
12066 | ;; | |
12067 | esac | |
12068 | fi | |
12036 | 12069 | fi |
12037 | 12070 | |
12038 | 12071 | |
12322 | 12355 | COVERITY_TRUE='#' |
12323 | 12356 | COVERITY_FALSE= |
12324 | 12357 | fi |
12358 | ||
12359 | ||
12360 | ||
12361 | ||
12362 | ||
12363 | # allow to override gcov location | |
12364 | ||
12365 | # Check whether --with-gcov was given. | |
12366 | if test "${with_gcov+set}" = set; then : | |
12367 | withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov | |
12368 | else | |
12369 | _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov | |
12370 | fi | |
12371 | ||
12372 | ||
12373 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 | |
12374 | $as_echo_n "checking whether to build with code coverage support... " >&6; } | |
12375 | # Check whether --enable-code-coverage was given. | |
12376 | if test "${enable_code_coverage+set}" = set; then : | |
12377 | enableval=$enable_code_coverage; | |
12378 | else | |
12379 | enable_code_coverage=no | |
12380 | fi | |
12381 | ||
12382 | ||
12383 | if test x$enable_code_coverage = xyes; then | |
12384 | CODE_COVERAGE_ENABLED_TRUE= | |
12385 | CODE_COVERAGE_ENABLED_FALSE='#' | |
12386 | else | |
12387 | CODE_COVERAGE_ENABLED_TRUE='#' | |
12388 | CODE_COVERAGE_ENABLED_FALSE= | |
12389 | fi | |
12390 | ||
12391 | CODE_COVERAGE_ENABLED=$enable_code_coverage | |
12392 | ||
12393 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 | |
12394 | $as_echo "$enable_code_coverage" >&6; } | |
12395 | ||
12396 | if test "$enable_code_coverage" = "yes" ; then : | |
12397 | ||
12398 | # check for gcov | |
12399 | if test -n "$ac_tool_prefix"; then | |
12400 | # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. | |
12401 | set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 | |
12402 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
12403 | $as_echo_n "checking for $ac_word... " >&6; } | |
12404 | if ${ac_cv_prog_GCOV+:} false; then : | |
12405 | $as_echo_n "(cached) " >&6 | |
12406 | else | |
12407 | if test -n "$GCOV"; then | |
12408 | ac_cv_prog_GCOV="$GCOV" # Let the user override the test. | |
12409 | else | |
12410 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
12411 | for as_dir in $PATH | |
12412 | do | |
12413 | IFS=$as_save_IFS | |
12414 | test -z "$as_dir" && as_dir=. | |
12415 | for ac_exec_ext in '' $ac_executable_extensions; do | |
12416 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
12417 | ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" | |
12418 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
12419 | break 2 | |
12420 | fi | |
12421 | done | |
12422 | done | |
12423 | IFS=$as_save_IFS | |
12424 | ||
12425 | fi | |
12426 | fi | |
12427 | GCOV=$ac_cv_prog_GCOV | |
12428 | if test -n "$GCOV"; then | |
12429 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 | |
12430 | $as_echo "$GCOV" >&6; } | |
12431 | else | |
12432 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
12433 | $as_echo "no" >&6; } | |
12434 | fi | |
12435 | ||
12436 | ||
12437 | fi | |
12438 | if test -z "$ac_cv_prog_GCOV"; then | |
12439 | ac_ct_GCOV=$GCOV | |
12440 | # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. | |
12441 | set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 | |
12442 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
12443 | $as_echo_n "checking for $ac_word... " >&6; } | |
12444 | if ${ac_cv_prog_ac_ct_GCOV+:} false; then : | |
12445 | $as_echo_n "(cached) " >&6 | |
12446 | else | |
12447 | if test -n "$ac_ct_GCOV"; then | |
12448 | ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. | |
12449 | else | |
12450 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
12451 | for as_dir in $PATH | |
12452 | do | |
12453 | IFS=$as_save_IFS | |
12454 | test -z "$as_dir" && as_dir=. | |
12455 | for ac_exec_ext in '' $ac_executable_extensions; do | |
12456 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
12457 | ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" | |
12458 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
12459 | break 2 | |
12460 | fi | |
12461 | done | |
12462 | done | |
12463 | IFS=$as_save_IFS | |
12464 | ||
12465 | fi | |
12466 | fi | |
12467 | ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV | |
12468 | if test -n "$ac_ct_GCOV"; then | |
12469 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 | |
12470 | $as_echo "$ac_ct_GCOV" >&6; } | |
12471 | else | |
12472 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
12473 | $as_echo "no" >&6; } | |
12474 | fi | |
12475 | ||
12476 | if test "x$ac_ct_GCOV" = x; then | |
12477 | GCOV=":" | |
12478 | else | |
12479 | case $cross_compiling:$ac_tool_warned in | |
12480 | yes:) | |
12481 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
12482 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
12483 | ac_tool_warned=yes ;; | |
12484 | esac | |
12485 | GCOV=$ac_ct_GCOV | |
12486 | fi | |
12487 | else | |
12488 | GCOV="$ac_cv_prog_GCOV" | |
12489 | fi | |
12490 | ||
12491 | if test "X$GCOV" = "X:"; then : | |
12492 | as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 | |
12493 | fi | |
12494 | ||
12495 | ||
12496 | if test "$GCC" = "no" ; then : | |
12497 | ||
12498 | as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 | |
12499 | ||
12500 | fi | |
12501 | ||
12502 | # Extract the first word of "lcov", so it can be a program name with args. | |
12503 | set dummy lcov; ac_word=$2 | |
12504 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
12505 | $as_echo_n "checking for $ac_word... " >&6; } | |
12506 | if ${ac_cv_prog_LCOV+:} false; then : | |
12507 | $as_echo_n "(cached) " >&6 | |
12508 | else | |
12509 | if test -n "$LCOV"; then | |
12510 | ac_cv_prog_LCOV="$LCOV" # Let the user override the test. | |
12511 | else | |
12512 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
12513 | for as_dir in $PATH | |
12514 | do | |
12515 | IFS=$as_save_IFS | |
12516 | test -z "$as_dir" && as_dir=. | |
12517 | for ac_exec_ext in '' $ac_executable_extensions; do | |
12518 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
12519 | ac_cv_prog_LCOV="lcov" | |
12520 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
12521 | break 2 | |
12522 | fi | |
12523 | done | |
12524 | done | |
12525 | IFS=$as_save_IFS | |
12526 | ||
12527 | fi | |
12528 | fi | |
12529 | LCOV=$ac_cv_prog_LCOV | |
12530 | if test -n "$LCOV"; then | |
12531 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 | |
12532 | $as_echo "$LCOV" >&6; } | |
12533 | else | |
12534 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
12535 | $as_echo "no" >&6; } | |
12536 | fi | |
12537 | ||
12538 | ||
12539 | # Extract the first word of "genhtml", so it can be a program name with args. | |
12540 | set dummy genhtml; ac_word=$2 | |
12541 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
12542 | $as_echo_n "checking for $ac_word... " >&6; } | |
12543 | if ${ac_cv_prog_GENHTML+:} false; then : | |
12544 | $as_echo_n "(cached) " >&6 | |
12545 | else | |
12546 | if test -n "$GENHTML"; then | |
12547 | ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. | |
12548 | else | |
12549 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
12550 | for as_dir in $PATH | |
12551 | do | |
12552 | IFS=$as_save_IFS | |
12553 | test -z "$as_dir" && as_dir=. | |
12554 | for ac_exec_ext in '' $ac_executable_extensions; do | |
12555 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
12556 | ac_cv_prog_GENHTML="genhtml" | |
12557 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
12558 | break 2 | |
12559 | fi | |
12560 | done | |
12561 | done | |
12562 | IFS=$as_save_IFS | |
12563 | ||
12564 | fi | |
12565 | fi | |
12566 | GENHTML=$ac_cv_prog_GENHTML | |
12567 | if test -n "$GENHTML"; then | |
12568 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 | |
12569 | $as_echo "$GENHTML" >&6; } | |
12570 | else | |
12571 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
12572 | $as_echo "no" >&6; } | |
12573 | fi | |
12574 | ||
12575 | ||
12576 | ||
12577 | if test -z "$LCOV" ; then : | |
12578 | ||
12579 | as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 | |
12580 | ||
12581 | fi | |
12582 | ||
12583 | if test -z "$GENHTML" ; then : | |
12584 | ||
12585 | as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 | |
12586 | ||
12587 | fi | |
12588 | ||
12589 | CODE_COVERAGE_CPPFLAGS="-DNDEBUG" | |
12590 | CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" | |
12591 | CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" | |
12592 | CODE_COVERAGE_LIBS="-lgcov" | |
12593 | CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" | |
12594 | ||
12595 | ||
12596 | ||
12597 | ||
12598 | ||
12599 | ||
12600 | ||
12601 | CODE_COVERAGE_RULES_CHECK=' | |
12602 | -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check | |
12603 | $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture | |
12604 | ' | |
12605 | CODE_COVERAGE_RULES_CAPTURE=' | |
12606 | $(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) | |
12607 | $(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) | |
12608 | -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp | |
12609 | $(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) | |
12610 | @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" | |
12611 | ' | |
12612 | CODE_COVERAGE_RULES_CLEAN=' | |
12613 | clean: code-coverage-clean | |
12614 | distclean: code-coverage-clean | |
12615 | code-coverage-clean: | |
12616 | -$(LCOV) --directory $(top_builddir) -z | |
12617 | -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) | |
12618 | -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete | |
12619 | ' | |
12620 | ||
12621 | else | |
12622 | ||
12623 | CODE_COVERAGE_RULES_CHECK=' | |
12624 | @echo "Need to reconfigure with --enable-code-coverage" | |
12625 | ' | |
12626 | CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" | |
12627 | CODE_COVERAGE_RULES_CLEAN='' | |
12628 | ||
12629 | fi | |
12630 | ||
12631 | CODE_COVERAGE_RULES=' | |
12632 | # Code coverage | |
12633 | # | |
12634 | # Optional: | |
12635 | # - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. | |
12636 | # Multiple directories may be specified, separated by whitespace. | |
12637 | # (Default: $(top_builddir)) | |
12638 | # - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated | |
12639 | # by lcov for code coverage. (Default: | |
12640 | # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) | |
12641 | # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage | |
12642 | # reports to be created. (Default: | |
12643 | # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) | |
12644 | # - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, | |
12645 | # set to 0 to disable it and leave empty to stay with the default. | |
12646 | # (Default: empty) | |
12647 | # - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov | |
12648 | # instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) | |
12649 | # - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov | |
12650 | # instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) | |
12651 | # - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov | |
12652 | # - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the | |
12653 | # collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) | |
12654 | # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov | |
12655 | # instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) | |
12656 | # - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering | |
12657 | # lcov instance. (Default: empty) | |
12658 | # - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov | |
12659 | # instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) | |
12660 | # - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the | |
12661 | # genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) | |
12662 | # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml | |
12663 | # instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) | |
12664 | # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore | |
12665 | # | |
12666 | # The generated report will be titled using the $(PACKAGE_NAME) and | |
12667 | # $(PACKAGE_VERSION). In order to add the current git hash to the title, | |
12668 | # use the git-version-gen script, available online. | |
12669 | ||
12670 | # Optional variables | |
12671 | CODE_COVERAGE_DIRECTORY ?= $(top_builddir) | |
12672 | CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info | |
12673 | CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage | |
12674 | CODE_COVERAGE_BRANCH_COVERAGE ?= | |
12675 | CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ | |
12676 | --rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) | |
12677 | CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) | |
12678 | CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" | |
12679 | CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) | |
12680 | CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) | |
12681 | CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= | |
12682 | CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) | |
12683 | CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ | |
12684 | $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ | |
12685 | --rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) | |
12686 | CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) | |
12687 | CODE_COVERAGE_IGNORE_PATTERN ?= | |
12688 | ||
12689 | code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) | |
12690 | code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) | |
12691 | code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ | |
12692 | $(CODE_COVERAGE_OUTPUT_FILE); | |
12693 | code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) | |
12694 | code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) | |
12695 | code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ | |
12696 | $(CODE_COVERAGE_IGNORE_PATTERN); | |
12697 | code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) | |
12698 | code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) | |
12699 | code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); | |
12700 | code_coverage_quiet = $(code_coverage_quiet_$(V)) | |
12701 | code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) | |
12702 | code_coverage_quiet_0 = --quiet | |
12703 | ||
12704 | # sanitizes the test-name: replaces with underscores: dashes and dots | |
12705 | code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) | |
12706 | ||
12707 | # Use recursive makes in order to ignore errors during check | |
12708 | check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' | |
12709 | ||
12710 | # Capture code coverage data | |
12711 | code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' | |
12712 | ||
12713 | # Hook rule executed before code-coverage-capture, overridable by the user | |
12714 | code-coverage-capture-hook: | |
12715 | ||
12716 | '"$CODE_COVERAGE_RULES_CLEAN"' | |
12717 | ||
12718 | GITIGNOREFILES ?= | |
12719 | GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) | |
12720 | ||
12721 | A''M_DISTCHECK_CONFIGURE_FLAGS ?= | |
12722 | A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage | |
12723 | ||
12724 | .PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean | |
12725 | ' | |
12726 | ||
12727 | ||
12728 | ||
12325 | 12729 | |
12326 | 12730 | |
12327 | 12731 | ac_config_files="$ac_config_files libseccomp.pc include/seccomp.h" |
12471 | 12875 | as_fn_error $? "conditional \"COVERITY\" was never defined. |
12472 | 12876 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
12473 | 12877 | fi |
12878 | if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then | |
12879 | as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" was never defined. | |
12880 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
12881 | fi | |
12474 | 12882 | |
12475 | 12883 | : "${CONFIG_STATUS=./config.status}" |
12476 | 12884 | ac_write_fail=0 |
12868 | 13276 | # report actual input values of CONFIG_FILES etc. instead of their |
12869 | 13277 | # values after options handling. |
12870 | 13278 | ac_log=" |
12871 | This file was extended by libseccomp $as_me 2.3.1, which was | |
13279 | This file was extended by libseccomp $as_me 2.3.3, which was | |
12872 | 13280 | generated by GNU Autoconf 2.69. Invocation command line was |
12873 | 13281 | |
12874 | 13282 | CONFIG_FILES = $CONFIG_FILES |
12934 | 13342 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
12935 | 13343 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
12936 | 13344 | ac_cs_version="\\ |
12937 | libseccomp config.status 2.3.1 | |
13345 | libseccomp config.status 2.3.3 | |
12938 | 13346 | configured by $0, generated by GNU Autoconf 2.69, |
12939 | 13347 | with options \\"\$ac_cs_config\\" |
12940 | 13348 | |
13105 | 13513 | DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' |
13106 | 13514 | sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' |
13107 | 13515 | AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' |
13516 | lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' | |
13108 | 13517 | AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' |
13109 | 13518 | archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' |
13110 | 13519 | STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' |
13233 | 13642 | DLLTOOL \ |
13234 | 13643 | sharedlib_from_linklib_cmd \ |
13235 | 13644 | AR \ |
13236 | AR_FLAGS \ | |
13237 | 13645 | archiver_list_spec \ |
13238 | 13646 | STRIP \ |
13239 | 13647 | RANLIB \ |
14205 | 14613 | # The archiver. |
14206 | 14614 | AR=$lt_AR |
14207 | 14615 | |
14616 | # Flags to create an archive (by configure). | |
14617 | lt_ar_flags=$lt_ar_flags | |
14618 | ||
14208 | 14619 | # Flags to create an archive. |
14209 | AR_FLAGS=$lt_AR_FLAGS | |
14620 | AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} | |
14210 | 14621 | |
14211 | 14622 | # How to feed a file listing to the archiver. |
14212 | 14623 | archiver_list_spec=$lt_archiver_list_spec |
18 | 18 | dnl #### |
19 | 19 | dnl libseccomp defines |
20 | 20 | dnl #### |
21 | AC_INIT([libseccomp], [2.3.1]) | |
21 | AC_INIT([libseccomp], [2.3.3]) | |
22 | 22 | |
23 | 23 | dnl #### |
24 | 24 | dnl autoconf configuration |
124 | 124 | AM_CONDITIONAL(COVERITY, test "$have_coverity" = yes) |
125 | 125 | |
126 | 126 | dnl #### |
127 | dnl code coverage checks | |
128 | dnl -> https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html | |
129 | dnl #### | |
130 | AX_CODE_COVERAGE | |
131 | ||
132 | dnl #### | |
127 | 133 | dnl version dependent files |
128 | 134 | dnl #### |
129 | 135 | AC_CONFIG_FILES([ |
0 | # Makefile.in generated by automake 1.14.1 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.15.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2017 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
31 | 31 | # along with this library; if not, see <http://www.gnu.org/licenses>. |
32 | 32 | # |
33 | 33 | VPATH = @srcdir@ |
34 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' | |
34 | am__is_gnu_make = { \ | |
35 | if test -z '$(MAKELEVEL)'; then \ | |
36 | false; \ | |
37 | elif test -n '$(MAKE_HOST)'; then \ | |
38 | true; \ | |
39 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ | |
40 | true; \ | |
41 | else \ | |
42 | false; \ | |
43 | fi; \ | |
44 | } | |
35 | 45 | am__make_running_with_option = \ |
36 | 46 | case $${target_option-} in \ |
37 | 47 | ?) ;; \ |
95 | 105 | build_triplet = @build@ |
96 | 106 | host_triplet = @host@ |
97 | 107 | subdir = doc |
98 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ | |
99 | $(dist_man1_MANS) $(dist_man3_MANS) | |
100 | 108 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
101 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ | |
102 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | |
103 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | |
104 | $(top_srcdir)/configure.ac | |
109 | am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ | |
110 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | |
111 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | |
112 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac | |
105 | 113 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
106 | 114 | $(ACLOCAL_M4) |
115 | DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) | |
107 | 116 | mkinstalldirs = $(install_sh) -d |
108 | 117 | CONFIG_HEADER = $(top_builddir)/configure.h |
109 | 118 | CONFIG_CLEAN_FILES = |
160 | 169 | NROFF = nroff |
161 | 170 | MANS = $(dist_man1_MANS) $(dist_man3_MANS) |
162 | 171 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) |
172 | am__DIST_COMMON = $(dist_man1_MANS) $(dist_man3_MANS) \ | |
173 | $(srcdir)/Makefile.in | |
163 | 174 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
164 | 175 | ACLOCAL = @ACLOCAL@ |
165 | 176 | AMTAR = @AMTAR@ |
175 | 186 | CC = @CC@ |
176 | 187 | CCDEPMODE = @CCDEPMODE@ |
177 | 188 | CFLAGS = @CFLAGS@ |
189 | CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ | |
190 | CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ | |
191 | CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ | |
192 | CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ | |
193 | CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ | |
194 | CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ | |
178 | 195 | CPP = @CPP@ |
179 | 196 | CPPFLAGS = @CPPFLAGS@ |
180 | 197 | CYGPATH_W = @CYGPATH_W@ |
189 | 206 | EGREP = @EGREP@ |
190 | 207 | EXEEXT = @EXEEXT@ |
191 | 208 | FGREP = @FGREP@ |
209 | GCOV = @GCOV@ | |
210 | GENHTML = @GENHTML@ | |
192 | 211 | GREP = @GREP@ |
193 | 212 | INSTALL = @INSTALL@ |
194 | 213 | INSTALL_DATA = @INSTALL_DATA@ |
195 | 214 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
196 | 215 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
197 | 216 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
217 | LCOV = @LCOV@ | |
198 | 218 | LD = @LD@ |
199 | 219 | LDFLAGS = @LDFLAGS@ |
200 | 220 | LIBOBJS = @LIBOBJS@ |
328 | 348 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ |
329 | 349 | $(am__cd) $(top_srcdir) && \ |
330 | 350 | $(AUTOMAKE) --foreign doc/Makefile |
331 | .PRECIOUS: Makefile | |
332 | 351 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
333 | 352 | @case '$?' in \ |
334 | 353 | *config.status*) \ |
591 | 610 | mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ |
592 | 611 | uninstall-am uninstall-man uninstall-man1 uninstall-man3 |
593 | 612 | |
613 | .PRECIOUS: Makefile | |
614 | ||
594 | 615 | |
595 | 616 | # Tell versions [3.59,3.63) of GNU make to not export all variables. |
596 | 617 | # Otherwise a system limit (for SysV at least) may be exceeded. |
127 | 127 | .\" ////////////////////////////////////////////////////////////////////////// |
128 | 128 | .BR seccomp_init (3), |
129 | 129 | .BR seccomp_reset (3), |
130 | .BR seccom_merge (3) | |
130 | .BR seccomp_merge (3) |
75 | 75 | error being returned. Defaults to off ( |
76 | 76 | .I value |
77 | 77 | == 0). |
78 | .TP | |
79 | .B SCMP_FLTATR_ATL_TSKIP | |
80 | A flag to specify if libseccomp should allow filter rules to be created for | |
81 | the -1 syscall. The -1 syscall value can be used by tracer programs to skip | |
82 | specific syscall invocations, see | |
83 | .BR seccomp (2) | |
84 | for more information. Defaults to off ( | |
85 | .I value | |
86 | == 0). | |
78 | 87 | .\" ////////////////////////////////////////////////////////////////////////// |
79 | 88 | .SH RETURN VALUE |
80 | 89 | .\" ////////////////////////////////////////////////////////////////////////// |
128 | 137 | .\" ////////////////////////////////////////////////////////////////////////// |
129 | 138 | .BR seccomp_init (3), |
130 | 139 | .BR seccomp_reset (3), |
131 | .BR seccomp_load (3) | |
140 | .BR seccomp_load (3), | |
141 | .BR seccomp (2) |
52 | 52 | and |
53 | 53 | .BR seccomp_rule_add_array () |
54 | 54 | functions will make a "best effort" to add the rule as specified, but may alter |
55 | the rule slightly due to architecture specifics, e.g. socket and ipc functions | |
56 | on x86. The | |
55 | the rule slightly due to architecture specifics (e.g. internal rewriting of | |
56 | multiplexed syscalls, like socket and ipc functions on x86). The | |
57 | 57 | .BR seccomp_rule_add_exact () |
58 | 58 | and |
59 | 59 | .BR seccomp_rule_add_exact_array () |
89 | 89 | .BR SCMP_SYS () |
90 | 90 | macro instead. See the EXAMPLES section below. |
91 | 91 | .P |
92 | Starting with Linux v4.8, there may be a need to create a rule with a syscall | |
93 | value of -1 to allow tracing programs to skip a syscall invocation; in order | |
94 | to create a rule with a -1 syscall value it is necessary to first set the | |
95 | .B SCMP_FLTATR_API_TSKIP | |
96 | attribute. See | |
97 | .BR seccomp_attr_set (3) | |
98 | for more information. | |
99 | .P | |
92 | 100 | The filter context |
93 | 101 | .I ctx |
94 | 102 | is the value returned by the call to |
99 | 107 | values are as follows: |
100 | 108 | .TP |
101 | 109 | .B SCMP_ACT_KILL |
102 | The thread will be killed by the kernel when it calls a syscall that does not | |
103 | match any of the configured seccomp filter rules. | |
110 | The thread will be killed by the kernel when it calls a syscall that matches | |
111 | the filter rule. | |
104 | 112 | .TP |
105 | 113 | .B SCMP_ACT_TRAP |
106 | The thread will throw a SIGSYS signal when it calls a syscall that does not | |
107 | match any of the configured seccomp filter rules. | |
114 | The thread will throw a SIGSYS signal when it calls a syscall that matches the | |
115 | filter rule. | |
108 | 116 | .TP |
109 | 117 | .B SCMP_ACT_ERRNO(uint16_t errno) |
110 | 118 | The thread will receive a return value of |
111 | 119 | .I errno |
112 | when it calls a syscall that does not match any of the configured seccomp filter | |
113 | rules. | |
120 | when it calls a syscall that matches the filter rule. | |
114 | 121 | .TP |
115 | 122 | .B SCMP_ACT_TRACE(uint16_t msg_num) |
116 | 123 | If the thread is being traced and the tracing process specified the |
127 | 134 | .TP |
128 | 135 | .B SCMP_ACT_ALLOW |
129 | 136 | The seccomp filter will have no effect on the thread calling the syscall if it |
130 | does not match any of the configured seccomp filter rules. | |
137 | matches the filter rule. | |
131 | 138 | .P |
132 | 139 | Valid comparison |
133 | 140 | .I op |
290 | 297 | .\" ////////////////////////////////////////////////////////////////////////// |
291 | 298 | .SH SEE ALSO |
292 | 299 | .\" ////////////////////////////////////////////////////////////////////////// |
300 | .BR seccomp_syscall_resolve_name_rewrite (3), | |
293 | 301 | .BR seccomp_syscall_priority (3), |
294 | .BR seccomp_load (3) | |
302 | .BR seccomp_load (3), | |
303 | .BR seccomp_attr_set (3) |
29 | 29 | functions resolve the commonly used syscall name to the syscall number used by |
30 | 30 | the kernel and the rest of the libseccomp API, with |
31 | 31 | .BR seccomp_syscall_resolve_name_rewrite() |
32 | rewriting the syscall number for architectures that modify the syscall. The | |
32 | rewriting the syscall number for architectures that modify the syscall. Syscall | |
33 | rewriting typically happens in case of a multiplexed syscall, like | |
34 | .BR socketcall (2) | |
35 | or | |
36 | .BR ipc (2) | |
37 | on x86. | |
33 | 38 | .BR seccomp_syscall_resolve_num_arch() |
34 | 39 | function resolves the syscall number used by the kernel to the commonly used |
35 | 40 | syscall name. |
99 | 104 | .SH NOTES |
100 | 105 | .\" ////////////////////////////////////////////////////////////////////////// |
101 | 106 | .P |
107 | In case of bare syscalls implemented on top of a multiplexed syscall, | |
108 | .BR seccomp_syscall_resolve_name() | |
109 | and | |
110 | .BR seccomp_syscall_resolve_name_arch() | |
111 | can be used to verify if a bare syscall is implemented for a specific | |
112 | architecture, while | |
113 | .BR seccomp_syscall_resolve_name_rewrite() | |
114 | can be used to determine the underlying multiplexed syscall. | |
115 | .P | |
102 | 116 | While the seccomp filter can be generated independent of the kernel, kernel |
103 | 117 | support is required to load and enforce the seccomp filter generated by |
104 | 118 | libseccomp. |
0 | # Makefile.in generated by automake 1.14.1 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.15.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2017 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
32 | 32 | # |
33 | 33 | |
34 | 34 | VPATH = @srcdir@ |
35 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' | |
35 | am__is_gnu_make = { \ | |
36 | if test -z '$(MAKELEVEL)'; then \ | |
37 | false; \ | |
38 | elif test -n '$(MAKE_HOST)'; then \ | |
39 | true; \ | |
40 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ | |
41 | true; \ | |
42 | else \ | |
43 | false; \ | |
44 | fi; \ | |
45 | } | |
36 | 46 | am__make_running_with_option = \ |
37 | 47 | case $${target_option-} in \ |
38 | 48 | ?) ;; \ |
96 | 106 | build_triplet = @build@ |
97 | 107 | host_triplet = @host@ |
98 | 108 | subdir = include |
99 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ | |
100 | $(srcdir)/seccomp.h.in $(include_HEADERS) | |
101 | 109 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
102 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ | |
103 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | |
104 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | |
105 | $(top_srcdir)/configure.ac | |
110 | am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ | |
111 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | |
112 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | |
113 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac | |
106 | 114 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
107 | 115 | $(ACLOCAL_M4) |
116 | DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ | |
117 | $(am__DIST_COMMON) | |
108 | 118 | mkinstalldirs = $(install_sh) -d |
109 | 119 | CONFIG_HEADER = $(top_builddir)/configure.h |
110 | 120 | CONFIG_CLEAN_FILES = seccomp.h |
176 | 186 | done | $(am__uniquify_input)` |
177 | 187 | ETAGS = etags |
178 | 188 | CTAGS = ctags |
189 | am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/seccomp.h.in | |
179 | 190 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
180 | 191 | ACLOCAL = @ACLOCAL@ |
181 | 192 | AMTAR = @AMTAR@ |
191 | 202 | CC = @CC@ |
192 | 203 | CCDEPMODE = @CCDEPMODE@ |
193 | 204 | CFLAGS = @CFLAGS@ |
205 | CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ | |
206 | CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ | |
207 | CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ | |
208 | CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ | |
209 | CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ | |
210 | CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ | |
194 | 211 | CPP = @CPP@ |
195 | 212 | CPPFLAGS = @CPPFLAGS@ |
196 | 213 | CYGPATH_W = @CYGPATH_W@ |
205 | 222 | EGREP = @EGREP@ |
206 | 223 | EXEEXT = @EXEEXT@ |
207 | 224 | FGREP = @FGREP@ |
225 | GCOV = @GCOV@ | |
226 | GENHTML = @GENHTML@ | |
208 | 227 | GREP = @GREP@ |
209 | 228 | INSTALL = @INSTALL@ |
210 | 229 | INSTALL_DATA = @INSTALL_DATA@ |
211 | 230 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
212 | 231 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
213 | 232 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
233 | LCOV = @LCOV@ | |
214 | 234 | LD = @LD@ |
215 | 235 | LDFLAGS = @LDFLAGS@ |
216 | 236 | LIBOBJS = @LIBOBJS@ |
316 | 336 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ |
317 | 337 | $(am__cd) $(top_srcdir) && \ |
318 | 338 | $(AUTOMAKE) --foreign include/Makefile |
319 | .PRECIOUS: Makefile | |
320 | 339 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
321 | 340 | @case '$?' in \ |
322 | 341 | *config.status*) \ |
565 | 584 | ps ps-am tags tags-am uninstall uninstall-am \ |
566 | 585 | uninstall-includeHEADERS |
567 | 586 | |
587 | .PRECIOUS: Makefile | |
588 | ||
568 | 589 | |
569 | 590 | # Tell versions [3.59,3.63) of GNU make to not export all variables. |
570 | 591 | # Otherwise a system limit (for SysV at least) may be exceeded. |
36 | 36 | |
37 | 37 | #define SCMP_VER_MAJOR 2 |
38 | 38 | #define SCMP_VER_MINOR 3 |
39 | #define SCMP_VER_MICRO 1 | |
39 | #define SCMP_VER_MICRO 3 | |
40 | 40 | |
41 | 41 | struct scmp_version { |
42 | 42 | unsigned int major; |
62 | 62 | SCMP_FLTATR_ACT_BADARCH = 2, /**< bad architecture action */ |
63 | 63 | SCMP_FLTATR_CTL_NNP = 3, /**< set NO_NEW_PRIVS on filter load */ |
64 | 64 | SCMP_FLTATR_CTL_TSYNC = 4, /**< sync threads on filter load */ |
65 | SCMP_FLTATR_API_TSKIP = 5, /**< allow rules with a -1 syscall */ | |
65 | 66 | _SCMP_FLTATR_MAX, |
66 | 67 | }; |
67 | 68 | |
1602 | 1603 | #define __NR_userfaultfd __PNR_userfaultfd |
1603 | 1604 | #endif /* __NR_userfaultfd */ |
1604 | 1605 | |
1606 | #define __PNR_pkey_mprotect -10201 | |
1607 | #ifndef __NR_pkey_mprotect | |
1608 | #define __NR_pkey_mprotect __PNR_pkey_mprotect | |
1609 | #endif /* __NR_pkey_mprotect */ | |
1610 | ||
1611 | #define __PNR_pkey_alloc -10202 | |
1612 | #ifndef __NR_pkey_alloc | |
1613 | #define __NR_pkey_alloc __PNR_pkey_alloc | |
1614 | #endif /* __NR_pkey_alloc */ | |
1615 | ||
1616 | #define __PNR_pkey_free -10203 | |
1617 | #ifndef __NR_pkey_free | |
1618 | #define __NR_pkey_free __PNR_pkey_free | |
1619 | #endif /* __NR_pkey_free */ | |
1620 | ||
1621 | #define __PNR_get_tls -10204 | |
1622 | #ifndef __NR_get_tls | |
1623 | #ifdef __ARM_NR_get_tls | |
1624 | #define __NR_get_tls __ARM_NR_get_tls | |
1625 | #else | |
1626 | #define __NR_get_tls __PNR_get_tls | |
1627 | #endif | |
1628 | #endif /* __NR_get_tls */ | |
1629 | ||
1630 | #define __PNR_s390_guarded_storage -10205 | |
1631 | #ifndef __NR_s390_guarded_storage | |
1632 | #define __NR_s390_guarded_storage __PNR_s390_guarded_storage | |
1633 | #endif /* __NR_s390_guarded_storage */ | |
1634 | ||
1635 | #define __PNR_s390_sthyi -10206 | |
1636 | #ifndef __NR_s390_sthyi | |
1637 | #define __NR_s390_sthyi __PNR_s390_sthyi | |
1638 | #endif /* __NR_s390_sthyi */ | |
1639 | ||
1605 | 1640 | #ifdef __cplusplus |
1606 | 1641 | } |
1607 | 1642 | #endif |
62 | 62 | SCMP_FLTATR_ACT_BADARCH = 2, /**< bad architecture action */ |
63 | 63 | SCMP_FLTATR_CTL_NNP = 3, /**< set NO_NEW_PRIVS on filter load */ |
64 | 64 | SCMP_FLTATR_CTL_TSYNC = 4, /**< sync threads on filter load */ |
65 | SCMP_FLTATR_API_TSKIP = 5, /**< allow rules with a -1 syscall */ | |
65 | 66 | _SCMP_FLTATR_MAX, |
66 | 67 | }; |
67 | 68 | |
1602 | 1603 | #define __NR_userfaultfd __PNR_userfaultfd |
1603 | 1604 | #endif /* __NR_userfaultfd */ |
1604 | 1605 | |
1606 | #define __PNR_pkey_mprotect -10201 | |
1607 | #ifndef __NR_pkey_mprotect | |
1608 | #define __NR_pkey_mprotect __PNR_pkey_mprotect | |
1609 | #endif /* __NR_pkey_mprotect */ | |
1610 | ||
1611 | #define __PNR_pkey_alloc -10202 | |
1612 | #ifndef __NR_pkey_alloc | |
1613 | #define __NR_pkey_alloc __PNR_pkey_alloc | |
1614 | #endif /* __NR_pkey_alloc */ | |
1615 | ||
1616 | #define __PNR_pkey_free -10203 | |
1617 | #ifndef __NR_pkey_free | |
1618 | #define __NR_pkey_free __PNR_pkey_free | |
1619 | #endif /* __NR_pkey_free */ | |
1620 | ||
1621 | #define __PNR_get_tls -10204 | |
1622 | #ifndef __NR_get_tls | |
1623 | #ifdef __ARM_NR_get_tls | |
1624 | #define __NR_get_tls __ARM_NR_get_tls | |
1625 | #else | |
1626 | #define __NR_get_tls __PNR_get_tls | |
1627 | #endif | |
1628 | #endif /* __NR_get_tls */ | |
1629 | ||
1630 | #define __PNR_s390_guarded_storage -10205 | |
1631 | #ifndef __NR_s390_guarded_storage | |
1632 | #define __NR_s390_guarded_storage __PNR_s390_guarded_storage | |
1633 | #endif /* __NR_s390_guarded_storage */ | |
1634 | ||
1635 | #define __PNR_s390_sthyi -10206 | |
1636 | #ifndef __NR_s390_sthyi | |
1637 | #define __NR_s390_sthyi __PNR_s390_sthyi | |
1638 | #endif /* __NR_s390_sthyi */ | |
1639 | ||
1605 | 1640 | #ifdef __cplusplus |
1606 | 1641 | } |
1607 | 1642 | #endif |
0 | # =========================================================================== | |
1 | # http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html | |
2 | # =========================================================================== | |
3 | # | |
4 | # SYNOPSIS | |
5 | # | |
6 | # AX_CODE_COVERAGE() | |
7 | # | |
8 | # DESCRIPTION | |
9 | # | |
10 | # Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, | |
11 | # CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included | |
12 | # in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every | |
13 | # build target (program or library) which should be built with code | |
14 | # coverage support. Also defines CODE_COVERAGE_RULES which should be | |
15 | # substituted in your Makefile; and $enable_code_coverage which can be | |
16 | # used in subsequent configure output. CODE_COVERAGE_ENABLED is defined | |
17 | # and substituted, and corresponds to the value of the | |
18 | # --enable-code-coverage option, which defaults to being disabled. | |
19 | # | |
20 | # Test also for gcov program and create GCOV variable that could be | |
21 | # substituted. | |
22 | # | |
23 | # Note that all optimisation flags in CFLAGS must be disabled when code | |
24 | # coverage is enabled. | |
25 | # | |
26 | # Usage example: | |
27 | # | |
28 | # configure.ac: | |
29 | # | |
30 | # AX_CODE_COVERAGE | |
31 | # | |
32 | # Makefile.am: | |
33 | # | |
34 | # @CODE_COVERAGE_RULES@ | |
35 | # my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ... | |
36 | # my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... | |
37 | # my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... | |
38 | # my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... | |
39 | # | |
40 | # This results in a "check-code-coverage" rule being added to any | |
41 | # Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module | |
42 | # has been configured with --enable-code-coverage). Running `make | |
43 | # check-code-coverage` in that directory will run the module's test suite | |
44 | # (`make check`) and build a code coverage report detailing the code which | |
45 | # was touched, then print the URI for the report. | |
46 | # | |
47 | # In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined | |
48 | # instead of CODE_COVERAGE_LIBS. They are both still defined, but use of | |
49 | # CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is | |
50 | # deprecated. They have the same value. | |
51 | # | |
52 | # This code was derived from Makefile.decl in GLib, originally licenced | |
53 | # under LGPLv2.1+. | |
54 | # | |
55 | # LICENSE | |
56 | # | |
57 | # Copyright (c) 2012, 2016 Philip Withnall | |
58 | # Copyright (c) 2012 Xan Lopez | |
59 | # Copyright (c) 2012 Christian Persch | |
60 | # Copyright (c) 2012 Paolo Borelli | |
61 | # Copyright (c) 2012 Dan Winship | |
62 | # Copyright (c) 2015 Bastien ROUCARIES | |
63 | # | |
64 | # This library is free software; you can redistribute it and/or modify it | |
65 | # under the terms of the GNU Lesser General Public License as published by | |
66 | # the Free Software Foundation; either version 2.1 of the License, or (at | |
67 | # your option) any later version. | |
68 | # | |
69 | # This library is distributed in the hope that it will be useful, but | |
70 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
71 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser | |
72 | # General Public License for more details. | |
73 | # | |
74 | # You should have received a copy of the GNU Lesser General Public License | |
75 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
76 | ||
77 | #serial 20 | |
78 | ||
79 | AC_DEFUN([AX_CODE_COVERAGE],[ | |
80 | dnl Check for --enable-code-coverage | |
81 | AC_REQUIRE([AC_PROG_SED]) | |
82 | ||
83 | # allow to override gcov location | |
84 | AC_ARG_WITH([gcov], | |
85 | [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])], | |
86 | [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov], | |
87 | [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov]) | |
88 | ||
89 | AC_MSG_CHECKING([whether to build with code coverage support]) | |
90 | AC_ARG_ENABLE([code-coverage], | |
91 | AS_HELP_STRING([--enable-code-coverage], | |
92 | [Whether to enable code coverage support]),, | |
93 | enable_code_coverage=no) | |
94 | ||
95 | AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes]) | |
96 | AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage]) | |
97 | AC_MSG_RESULT($enable_code_coverage) | |
98 | ||
99 | AS_IF([ test "$enable_code_coverage" = "yes" ], [ | |
100 | # check for gcov | |
101 | AC_CHECK_TOOL([GCOV], | |
102 | [$_AX_CODE_COVERAGE_GCOV_PROG_WITH], | |
103 | [:]) | |
104 | AS_IF([test "X$GCOV" = "X:"], | |
105 | [AC_MSG_ERROR([gcov is needed to do coverage])]) | |
106 | AC_SUBST([GCOV]) | |
107 | ||
108 | dnl Check if gcc is being used | |
109 | AS_IF([ test "$GCC" = "no" ], [ | |
110 | AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) | |
111 | ]) | |
112 | ||
113 | AC_CHECK_PROG([LCOV], [lcov], [lcov]) | |
114 | AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) | |
115 | ||
116 | AS_IF([ test -z "$LCOV" ], [ | |
117 | AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed]) | |
118 | ]) | |
119 | ||
120 | AS_IF([ test -z "$GENHTML" ], [ | |
121 | AC_MSG_ERROR([Could not find genhtml from the lcov package]) | |
122 | ]) | |
123 | ||
124 | dnl Build the code coverage flags | |
125 | dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility | |
126 | CODE_COVERAGE_CPPFLAGS="-DNDEBUG" | |
127 | CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" | |
128 | CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" | |
129 | CODE_COVERAGE_LIBS="-lgcov" | |
130 | CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" | |
131 | ||
132 | AC_SUBST([CODE_COVERAGE_CPPFLAGS]) | |
133 | AC_SUBST([CODE_COVERAGE_CFLAGS]) | |
134 | AC_SUBST([CODE_COVERAGE_CXXFLAGS]) | |
135 | AC_SUBST([CODE_COVERAGE_LIBS]) | |
136 | AC_SUBST([CODE_COVERAGE_LDFLAGS]) | |
137 | ||
138 | [CODE_COVERAGE_RULES_CHECK=' | |
139 | -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check | |
140 | $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture | |
141 | '] | |
142 | [CODE_COVERAGE_RULES_CAPTURE=' | |
143 | $(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) | |
144 | $(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) | |
145 | -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp | |
146 | $(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) | |
147 | @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" | |
148 | '] | |
149 | [CODE_COVERAGE_RULES_CLEAN=' | |
150 | clean: code-coverage-clean | |
151 | distclean: code-coverage-clean | |
152 | code-coverage-clean: | |
153 | -$(LCOV) --directory $(top_builddir) -z | |
154 | -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) | |
155 | -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete | |
156 | '] | |
157 | ], [ | |
158 | [CODE_COVERAGE_RULES_CHECK=' | |
159 | @echo "Need to reconfigure with --enable-code-coverage" | |
160 | '] | |
161 | CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" | |
162 | CODE_COVERAGE_RULES_CLEAN='' | |
163 | ]) | |
164 | ||
165 | [CODE_COVERAGE_RULES=' | |
166 | # Code coverage | |
167 | # | |
168 | # Optional: | |
169 | # - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. | |
170 | # Multiple directories may be specified, separated by whitespace. | |
171 | # (Default: $(top_builddir)) | |
172 | # - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated | |
173 | # by lcov for code coverage. (Default: | |
174 | # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) | |
175 | # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage | |
176 | # reports to be created. (Default: | |
177 | # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) | |
178 | # - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, | |
179 | # set to 0 to disable it and leave empty to stay with the default. | |
180 | # (Default: empty) | |
181 | # - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov | |
182 | # instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) | |
183 | # - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov | |
184 | # instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) | |
185 | # - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov | |
186 | # - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the | |
187 | # collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) | |
188 | # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov | |
189 | # instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) | |
190 | # - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering | |
191 | # lcov instance. (Default: empty) | |
192 | # - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov | |
193 | # instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) | |
194 | # - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the | |
195 | # genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) | |
196 | # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml | |
197 | # instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) | |
198 | # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore | |
199 | # | |
200 | # The generated report will be titled using the $(PACKAGE_NAME) and | |
201 | # $(PACKAGE_VERSION). In order to add the current git hash to the title, | |
202 | # use the git-version-gen script, available online. | |
203 | ||
204 | # Optional variables | |
205 | CODE_COVERAGE_DIRECTORY ?= $(top_builddir) | |
206 | CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info | |
207 | CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage | |
208 | CODE_COVERAGE_BRANCH_COVERAGE ?= | |
209 | CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ | |
210 | --rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) | |
211 | CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) | |
212 | CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" | |
213 | CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) | |
214 | CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) | |
215 | CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= | |
216 | CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) | |
217 | CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ | |
218 | $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ | |
219 | --rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) | |
220 | CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) | |
221 | CODE_COVERAGE_IGNORE_PATTERN ?= | |
222 | ||
223 | code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) | |
224 | code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) | |
225 | code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ | |
226 | $(CODE_COVERAGE_OUTPUT_FILE); | |
227 | code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) | |
228 | code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) | |
229 | code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ | |
230 | $(CODE_COVERAGE_IGNORE_PATTERN); | |
231 | code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) | |
232 | code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) | |
233 | code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); | |
234 | code_coverage_quiet = $(code_coverage_quiet_$(V)) | |
235 | code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) | |
236 | code_coverage_quiet_0 = --quiet | |
237 | ||
238 | # sanitizes the test-name: replaces with underscores: dashes and dots | |
239 | code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) | |
240 | ||
241 | # Use recursive makes in order to ignore errors during check | |
242 | check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' | |
243 | ||
244 | # Capture code coverage data | |
245 | code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' | |
246 | ||
247 | # Hook rule executed before code-coverage-capture, overridable by the user | |
248 | code-coverage-capture-hook: | |
249 | ||
250 | '"$CODE_COVERAGE_RULES_CLEAN"' | |
251 | ||
252 | GITIGNOREFILES ?= | |
253 | GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) | |
254 | ||
255 | A''M_DISTCHECK_CONFIGURE_FLAGS ?= | |
256 | A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage | |
257 | ||
258 | .PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean | |
259 | '] | |
260 | ||
261 | AC_SUBST([CODE_COVERAGE_RULES]) | |
262 | m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])]) | |
263 | ]) |
0 | 0 | # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- |
1 | 1 | # |
2 | # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. | |
2 | # Copyright (C) 1996-2001, 2003-2017 Free Software Foundation, Inc. | |
3 | 3 | # Written by Gordon Matzigkeit, 1996 |
4 | 4 | # |
5 | 5 | # This file is free software; the Free Software Foundation gives |
1041 | 1041 | _LT_EOF |
1042 | 1042 | echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD |
1043 | 1043 | $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD |
1044 | echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD | |
1045 | $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD | |
1044 | echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD | |
1045 | $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD | |
1046 | 1046 | echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD |
1047 | 1047 | $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD |
1048 | 1048 | cat > conftest.c << _LT_EOF |
1492 | 1492 | m4_defun([_LT_PROG_AR], |
1493 | 1493 | [AC_CHECK_TOOLS(AR, [ar], false) |
1494 | 1494 | : ${AR=ar} |
1495 | : ${AR_FLAGS=cru} | |
1496 | 1495 | _LT_DECL([], [AR], [1], [The archiver]) |
1497 | _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) | |
1496 | ||
1497 | # Use ARFLAGS variable as AR's operation code to sync the variable naming with | |
1498 | # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have | |
1499 | # higher priority because thats what people were doing historically (setting | |
1500 | # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS | |
1501 | # variable obsoleted/removed. | |
1502 | ||
1503 | test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} | |
1504 | lt_ar_flags=$AR_FLAGS | |
1505 | _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) | |
1506 | ||
1507 | # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override | |
1508 | # by AR_FLAGS because that was never working and AR_FLAGS is about to die. | |
1509 | _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], | |
1510 | [Flags to create an archive]) | |
1498 | 1511 | |
1499 | 1512 | AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], |
1500 | 1513 | [lt_cv_ar_at_file=no |
2206 | 2219 | striplib= |
2207 | 2220 | old_striplib= |
2208 | 2221 | AC_MSG_CHECKING([whether stripping libraries is possible]) |
2209 | if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then | |
2210 | test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" | |
2211 | test -z "$striplib" && striplib="$STRIP --strip-unneeded" | |
2212 | AC_MSG_RESULT([yes]) | |
2222 | if test -z "$STRIP"; then | |
2223 | AC_MSG_RESULT([no]) | |
2213 | 2224 | else |
2214 | # FIXME - insert some real tests, host_os isn't really good enough | |
2215 | case $host_os in | |
2216 | darwin*) | |
2217 | if test -n "$STRIP"; then | |
2225 | if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then | |
2226 | old_striplib="$STRIP --strip-debug" | |
2227 | striplib="$STRIP --strip-unneeded" | |
2228 | AC_MSG_RESULT([yes]) | |
2229 | else | |
2230 | case $host_os in | |
2231 | darwin*) | |
2232 | # FIXME - insert some real tests, host_os isn't really good enough | |
2218 | 2233 | striplib="$STRIP -x" |
2219 | 2234 | old_striplib="$STRIP -S" |
2220 | 2235 | AC_MSG_RESULT([yes]) |
2221 | else | |
2236 | ;; | |
2237 | freebsd*) | |
2238 | if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then | |
2239 | old_striplib="$STRIP --strip-debug" | |
2240 | striplib="$STRIP --strip-unneeded" | |
2241 | AC_MSG_RESULT([yes]) | |
2242 | else | |
2243 | AC_MSG_RESULT([no]) | |
2244 | fi | |
2245 | ;; | |
2246 | *) | |
2222 | 2247 | AC_MSG_RESULT([no]) |
2223 | fi | |
2224 | ;; | |
2225 | *) | |
2226 | AC_MSG_RESULT([no]) | |
2227 | ;; | |
2228 | esac | |
2248 | ;; | |
2249 | esac | |
2250 | fi | |
2229 | 2251 | fi |
2230 | 2252 | _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) |
2231 | 2253 | _LT_DECL([], [striplib], [1]) |
2665 | 2687 | *) objformat=elf ;; |
2666 | 2688 | esac |
2667 | 2689 | fi |
2668 | # Handle Gentoo/FreeBSD as it was Linux | |
2669 | case $host_vendor in | |
2670 | gentoo) | |
2671 | version_type=linux ;; | |
2672 | *) | |
2673 | version_type=freebsd-$objformat ;; | |
2674 | esac | |
2675 | ||
2690 | version_type=freebsd-$objformat | |
2676 | 2691 | case $version_type in |
2677 | 2692 | freebsd-elf*) |
2678 | 2693 | library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' |
2683 | 2698 | freebsd-*) |
2684 | 2699 | library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' |
2685 | 2700 | need_version=yes |
2686 | ;; | |
2687 | linux) | |
2688 | library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' | |
2689 | soname_spec='${libname}${release}${shared_ext}$major' | |
2690 | need_lib_prefix=no | |
2691 | need_version=no | |
2692 | 2701 | ;; |
2693 | 2702 | esac |
2694 | 2703 | shlibpath_var=LD_LIBRARY_PATH |
4931 | 4940 | if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then |
4932 | 4941 | _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' |
4933 | 4942 | else |
4934 | _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' | |
4943 | _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' | |
4935 | 4944 | fi |
4936 | 4945 | ;; |
4937 | 4946 | pw32*) |
5168 | 5177 | emximp -o $lib $output_objdir/$libname.def' |
5169 | 5178 | _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' |
5170 | 5179 | _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes |
5180 | _LT_TAGVAR(file_list_spec, $1)='@' | |
5171 | 5181 | ;; |
5172 | 5182 | |
5173 | 5183 | interix[[3-9]]*) |
5385 | 5395 | if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then |
5386 | 5396 | _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' |
5387 | 5397 | else |
5388 | _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' | |
5398 | _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' | |
5389 | 5399 | fi |
5390 | 5400 | aix_use_runtimelinking=no |
5391 | 5401 | |
5873 | 5883 | emximp -o $lib $output_objdir/$libname.def' |
5874 | 5884 | _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' |
5875 | 5885 | _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes |
5886 | _LT_TAGVAR(file_list_spec, $1)='@' | |
5876 | 5887 | ;; |
5877 | 5888 | |
5878 | 5889 | osf3*) |
6742 | 6753 | emximp -o $lib $output_objdir/$libname.def' |
6743 | 6754 | _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' |
6744 | 6755 | _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes |
6756 | _LT_TAGVAR(file_list_spec, $1)='@' | |
6745 | 6757 | ;; |
6746 | 6758 | |
6747 | 6759 | dgux*) |
0 | 0 | # Helper functions for option handling. -*- Autoconf -*- |
1 | 1 | # |
2 | # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software | |
2 | # Copyright (C) 2004-2005, 2007-2009, 2011-2017 Free Software | |
3 | 3 | # Foundation, Inc. |
4 | 4 | # Written by Gary V. Vaughan, 2004 |
5 | 5 | # |
0 | 0 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- |
1 | 1 | # |
2 | # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software | |
2 | # Copyright (C) 2004-2005, 2007-2008, 2011-2017 Free Software | |
3 | 3 | # Foundation, Inc. |
4 | 4 | # Written by Gary V. Vaughan, 2004 |
5 | 5 | # |
0 | 0 | # ltversion.m4 -- version numbers -*- Autoconf -*- |
1 | 1 | # |
2 | # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. | |
2 | # Copyright (C) 2004, 2011-2017 Free Software Foundation, Inc. | |
3 | 3 | # Written by Scott James Remnant, 2004 |
4 | 4 | # |
5 | 5 | # This file is free software; the Free Software Foundation gives |
8 | 8 | |
9 | 9 | # @configure_input@ |
10 | 10 | |
11 | # serial 4179 ltversion.m4 | |
11 | # serial 4219 ltversion.m4 | |
12 | 12 | # This file is part of GNU Libtool |
13 | 13 | |
14 | m4_define([LT_PACKAGE_VERSION], [2.4.6]) | |
15 | m4_define([LT_PACKAGE_REVISION], [2.4.6]) | |
14 | m4_define([LT_PACKAGE_VERSION], [2.4.6.40-6ca5-dirty]) | |
15 | m4_define([LT_PACKAGE_REVISION], [2.4.6.40]) | |
16 | 16 | |
17 | 17 | AC_DEFUN([LTVERSION_VERSION], |
18 | [macro_version='2.4.6' | |
19 | macro_revision='2.4.6' | |
18 | [macro_version='2.4.6.40-6ca5-dirty' | |
19 | macro_revision='2.4.6.40' | |
20 | 20 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) |
21 | 21 | _LT_DECL(, macro_revision, 0) |
22 | 22 | ]) |
0 | 0 | # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- |
1 | 1 | # |
2 | # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software | |
2 | # Copyright (C) 2004-2005, 2007, 2009, 2011-2017 Free Software | |
3 | 3 | # Foundation, Inc. |
4 | 4 | # Written by Scott James Remnant, 2004. |
5 | 5 | # |
52 | 52 | arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ALL} |
53 | 53 | |
54 | 54 | libseccomp_la_SOURCES = ${SOURCES_ALL} |
55 | libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} -I${top_builddir}/include | |
56 | libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CFLAGS} -fPIC -DPIC -fvisibility=hidden | |
57 | libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${LDFLAGS} \ | |
55 | libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} ${CODE_COVERAGE_CPPFLAGS} \ | |
56 | -I${top_builddir}/include | |
57 | libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS} ${CFLAGS} \ | |
58 | -fPIC -DPIC -fvisibility=hidden | |
59 | libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${CODE_COVERAGE_LDFLAGS} ${LDFLAGS} \ | |
58 | 60 | -version-number ${VERSION_MAJOR}:${VERSION_MINOR}:${VERSION_MICRO} |
59 | 61 | |
60 | 62 | check-build: |
0 | # Makefile.in generated by automake 1.14.1 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.15.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2017 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
32 | 32 | # |
33 | 33 | |
34 | 34 | VPATH = @srcdir@ |
35 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' | |
35 | am__is_gnu_make = { \ | |
36 | if test -z '$(MAKELEVEL)'; then \ | |
37 | false; \ | |
38 | elif test -n '$(MAKE_HOST)'; then \ | |
39 | true; \ | |
40 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ | |
41 | true; \ | |
42 | else \ | |
43 | false; \ | |
44 | fi; \ | |
45 | } | |
36 | 46 | am__make_running_with_option = \ |
37 | 47 | case $${target_option-} in \ |
38 | 48 | ?) ;; \ |
100 | 110 | check_PROGRAMS = arch-syscall-check$(EXEEXT) \ |
101 | 111 | arch-syscall-dump$(EXEEXT) |
102 | 112 | subdir = src |
103 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ | |
104 | $(top_srcdir)/build-aux/depcomp | |
105 | 113 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
106 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ | |
107 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | |
108 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | |
109 | $(top_srcdir)/configure.ac | |
114 | am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ | |
115 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | |
116 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | |
117 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac | |
110 | 118 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
111 | 119 | $(ACLOCAL_M4) |
120 | DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) | |
112 | 121 | mkinstalldirs = $(install_sh) -d |
113 | 122 | CONFIG_HEADER = $(top_builddir)/configure.h |
114 | 123 | CONFIG_CLEAN_FILES = |
297 | 306 | fi; \ |
298 | 307 | } |
299 | 308 | DIST_SUBDIRS = . python |
309 | am__DIST_COMMON = $(srcdir)/Makefile.in \ | |
310 | $(top_srcdir)/build-aux/depcomp | |
300 | 311 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
301 | 312 | am__relativize = \ |
302 | 313 | dir0=`pwd`; \ |
337 | 348 | CC = @CC@ |
338 | 349 | CCDEPMODE = @CCDEPMODE@ |
339 | 350 | CFLAGS = @CFLAGS@ |
351 | CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ | |
352 | CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ | |
353 | CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ | |
354 | CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ | |
355 | CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ | |
356 | CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ | |
340 | 357 | CPP = @CPP@ |
341 | 358 | CPPFLAGS = @CPPFLAGS@ |
342 | 359 | CYGPATH_W = @CYGPATH_W@ |
351 | 368 | EGREP = @EGREP@ |
352 | 369 | EXEEXT = @EXEEXT@ |
353 | 370 | FGREP = @FGREP@ |
371 | GCOV = @GCOV@ | |
372 | GENHTML = @GENHTML@ | |
354 | 373 | GREP = @GREP@ |
355 | 374 | INSTALL = @INSTALL@ |
356 | 375 | INSTALL_DATA = @INSTALL_DATA@ |
357 | 376 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
358 | 377 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
359 | 378 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
379 | LCOV = @LCOV@ | |
360 | 380 | LD = @LD@ |
361 | 381 | LDFLAGS = @LDFLAGS@ |
362 | 382 | LIBOBJS = @LIBOBJS@ |
471 | 491 | arch_syscall_dump_SOURCES = arch-syscall-dump.c ${SOURCES_ALL} |
472 | 492 | arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ALL} |
473 | 493 | libseccomp_la_SOURCES = ${SOURCES_ALL} |
474 | libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} -I${top_builddir}/include | |
475 | libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CFLAGS} -fPIC -DPIC -fvisibility=hidden | |
476 | libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${LDFLAGS} \ | |
494 | libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} ${CODE_COVERAGE_CPPFLAGS} \ | |
495 | -I${top_builddir}/include | |
496 | ||
497 | libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS} ${CFLAGS} \ | |
498 | -fPIC -DPIC -fvisibility=hidden | |
499 | ||
500 | libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${CODE_COVERAGE_LDFLAGS} ${LDFLAGS} \ | |
477 | 501 | -version-number ${VERSION_MAJOR}:${VERSION_MINOR}:${VERSION_MICRO} |
478 | 502 | |
479 | 503 | all: all-recursive |
492 | 516 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ |
493 | 517 | $(am__cd) $(top_srcdir) && \ |
494 | 518 | $(AUTOMAKE) --foreign src/Makefile |
495 | .PRECIOUS: Makefile | |
496 | 519 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
497 | 520 | @case '$?' in \ |
498 | 521 | *config.status*) \ |
1260 | 1283 | pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ |
1261 | 1284 | uninstall-libLTLIBRARIES |
1262 | 1285 | |
1286 | .PRECIOUS: Makefile | |
1287 | ||
1263 | 1288 | |
1264 | 1289 | check-build: |
1265 | 1290 | ${MAKE} ${AM_MAKEFLAGS} ${check_PROGRAMS} |
64 | 64 | * syscall appears valid, negative values on failure. |
65 | 65 | * |
66 | 66 | */ |
67 | static int _syscall_valid(int syscall) | |
68 | { | |
67 | static int _syscall_valid(const struct db_filter_col *col, int syscall) | |
68 | { | |
69 | /* syscall -1 is used by tracers to skip the syscall */ | |
70 | if (col->attr.api_tskip && syscall == -1) | |
71 | return 0; | |
69 | 72 | if (syscall <= -1 && syscall >= -99) |
70 | 73 | return -EINVAL; |
71 | 74 | return 0; |
310 | 313 | { |
311 | 314 | struct db_filter_col *col = (struct db_filter_col *)ctx; |
312 | 315 | |
313 | if (db_col_valid(col) || _syscall_valid(syscall)) | |
316 | if (db_col_valid(col) || _syscall_valid(col, syscall)) | |
314 | 317 | return -EINVAL; |
315 | 318 | |
316 | 319 | return db_col_syscall_priority(col, syscall, priority); |
330 | 333 | if (arg_cnt > 0 && arg_array == NULL) |
331 | 334 | return -EINVAL; |
332 | 335 | |
333 | if (db_col_valid(col) || _syscall_valid(syscall)) | |
336 | if (db_col_valid(col) || _syscall_valid(col, syscall)) | |
334 | 337 | return -EINVAL; |
335 | 338 | |
336 | 339 | rc = db_action_valid(action); |
379 | 382 | if (arg_cnt > 0 && arg_array == NULL) |
380 | 383 | return -EINVAL; |
381 | 384 | |
382 | if (db_col_valid(col) || _syscall_valid(syscall)) | |
385 | if (db_col_valid(col) || _syscall_valid(col, syscall)) | |
383 | 386 | return -EINVAL; |
384 | 387 | |
385 | 388 | rc = db_action_valid(action); |
25 | 25 | #include "arch.h" |
26 | 26 | #include "arch-aarch64.h" |
27 | 27 | |
28 | /* NOTE: based on Linux 4.5-rc4 */ | |
28 | /* NOTE: based on Linux 4.15-rc7 */ | |
29 | 29 | const struct arch_syscall_def aarch64_syscall_table[] = { \ |
30 | 30 | { "_llseek", __PNR__llseek }, |
31 | 31 | { "_newselect", __PNR__newselect }, |
121 | 121 | { "get_mempolicy", 236 }, |
122 | 122 | { "get_robust_list", 100 }, |
123 | 123 | { "get_thread_area", __PNR_get_thread_area }, |
124 | { "get_tls", __PNR_get_tls }, | |
124 | 125 | { "getcpu", 168 }, |
125 | 126 | { "getcwd", 17 }, |
126 | 127 | { "getdents", __PNR_getdents }, |
253 | 254 | { "pipe", __PNR_pipe }, |
254 | 255 | { "pipe2", 59 }, |
255 | 256 | { "pivot_root", 41 }, |
257 | { "pkey_alloc", 289 }, | |
258 | { "pkey_free", 290 }, | |
259 | { "pkey_mprotect", 288 }, | |
256 | 260 | { "poll", __PNR_poll }, |
257 | 261 | { "ppoll", 73 }, |
258 | 262 | { "prctl", 167 }, |
259 | 263 | { "pread64", 67 }, |
260 | 264 | { "preadv", 69 }, |
265 | { "preadv2", 286 }, | |
261 | 266 | { "prlimit64", 261 }, |
262 | 267 | { "process_vm_readv", 270 }, |
263 | 268 | { "process_vm_writev", 271 }, |
268 | 273 | { "putpmsg", __PNR_putpmsg }, |
269 | 274 | { "pwrite64", 68 }, |
270 | 275 | { "pwritev", 70 }, |
276 | { "pwritev2", 287 }, | |
271 | 277 | { "query_module", __PNR_query_module }, |
272 | 278 | { "quotactl", 60 }, |
273 | 279 | { "read", 63 }, |
298 | 304 | { "rt_sigtimedwait", 137 }, |
299 | 305 | { "rt_tgsigqueueinfo", 240 }, |
300 | 306 | { "rtas", __PNR_rtas }, |
307 | { "s390_guarded_storage", __PNR_s390_guarded_storage }, | |
301 | 308 | { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, |
302 | 309 | { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, |
303 | 310 | { "s390_runtime_instr", __PNR_s390_runtime_instr }, |
311 | { "s390_sthyi", __PNR_s390_sthyi }, | |
304 | 312 | { "sched_get_priority_max", 125 }, |
305 | 313 | { "sched_get_priority_min", 126 }, |
306 | 314 | { "sched_getaffinity", 123 }, |
386 | 394 | { "stat64", __PNR_stat64 }, |
387 | 395 | { "statfs", 43 }, |
388 | 396 | { "statfs64", __PNR_statfs64 }, |
397 | { "statx", 291 }, | |
389 | 398 | { "stime", __PNR_stime }, |
390 | 399 | { "stty", __PNR_stty }, |
391 | 400 | { "subpage_prot", __PNR_subpage_prot }, |
501 | 510 | |
502 | 511 | |
503 | 512 | /** |
504 | * Iterate through the syscall table and return the syscall name | |
513 | * Iterate through the syscall table and return the syscall mapping | |
505 | 514 | * @param spot the offset into the syscall table |
506 | 515 | * |
507 | * Return the syscall name at position @spot or NULL on failure. This function | |
508 | * should only ever be used internally by libseccomp. | |
516 | * Return the syscall mapping at position @spot or NULL on failure. This | |
517 | * function should only ever be used internally by libseccomp. | |
509 | 518 | * |
510 | 519 | */ |
511 | const char *aarch64_syscall_iterate_name(unsigned int spot) | |
520 | const struct arch_syscall_def *aarch64_syscall_iterate(unsigned int spot) | |
512 | 521 | { |
513 | 522 | /* XXX - no safety checks here */ |
514 | return aarch64_syscall_table[spot].name; | |
523 | return &aarch64_syscall_table[spot]; | |
515 | 524 | } |
31 | 31 | int aarch64_syscall_resolve_name(const char *name); |
32 | 32 | const char *aarch64_syscall_resolve_num(int num); |
33 | 33 | |
34 | const char *aarch64_syscall_iterate_name(unsigned int spot); | |
34 | const struct arch_syscall_def *aarch64_syscall_iterate(unsigned int spot); | |
35 | ||
35 | 36 | #endif |
36 | 36 | #define __SCMP_NR_BASE __SCMP_NR_OABI_SYSCALL_BASE |
37 | 37 | #endif |
38 | 38 | |
39 | /* NOTE: based on Linux 4.5-rc4 */ | |
39 | /* NOTE: based on Linux 4.15-rc7 */ | |
40 | 40 | const struct arch_syscall_def arm_syscall_table[] = { \ |
41 | 41 | /* NOTE: arm_sync_file_range() and sync_file_range2() share values */ |
42 | 42 | { "_llseek", (__SCMP_NR_BASE + 140) }, |
133 | 133 | { "get_mempolicy", (__SCMP_NR_BASE + 320) }, |
134 | 134 | { "get_robust_list", (__SCMP_NR_BASE + 339) }, |
135 | 135 | { "get_thread_area", __PNR_get_thread_area }, |
136 | { "get_tls", (__SCMP_NR_BASE + (__SCMP_ARM_NR_BASE + 6)) }, | |
136 | 137 | { "getcpu", (__SCMP_NR_BASE + 345) }, |
137 | 138 | { "getcwd", (__SCMP_NR_BASE + 183) }, |
138 | 139 | { "getdents", (__SCMP_NR_BASE + 141) }, |
265 | 266 | { "pipe", (__SCMP_NR_BASE + 42) }, |
266 | 267 | { "pipe2", (__SCMP_NR_BASE + 359) }, |
267 | 268 | { "pivot_root", (__SCMP_NR_BASE + 218) }, |
269 | { "pkey_alloc", (__SCMP_NR_BASE + 395) }, | |
270 | { "pkey_free", (__SCMP_NR_BASE + 396) }, | |
271 | { "pkey_mprotect", (__SCMP_NR_BASE + 394) }, | |
268 | 272 | { "poll", (__SCMP_NR_BASE + 168) }, |
269 | 273 | { "ppoll", (__SCMP_NR_BASE + 336) }, |
270 | 274 | { "prctl", (__SCMP_NR_BASE + 172) }, |
271 | 275 | { "pread64", (__SCMP_NR_BASE + 180) }, |
272 | 276 | { "preadv", (__SCMP_NR_BASE + 361) }, |
277 | { "preadv2", (__SCMP_NR_BASE + 392) }, | |
273 | 278 | { "prlimit64", (__SCMP_NR_BASE + 369) }, |
274 | 279 | { "process_vm_readv", (__SCMP_NR_BASE + 376) }, |
275 | 280 | { "process_vm_writev", (__SCMP_NR_BASE + 377) }, |
280 | 285 | { "putpmsg", __PNR_putpmsg }, |
281 | 286 | { "pwrite64", (__SCMP_NR_BASE + 181) }, |
282 | 287 | { "pwritev", (__SCMP_NR_BASE + 362) }, |
288 | { "pwritev2", (__SCMP_NR_BASE + 393) }, | |
283 | 289 | { "query_module", __PNR_query_module }, |
284 | 290 | { "quotactl", (__SCMP_NR_BASE + 131) }, |
285 | 291 | { "read", (__SCMP_NR_BASE + 3) }, |
310 | 316 | { "rt_sigtimedwait", (__SCMP_NR_BASE + 177) }, |
311 | 317 | { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 363) }, |
312 | 318 | { "rtas", __PNR_rtas }, |
319 | { "s390_guarded_storage", __PNR_s390_guarded_storage }, | |
313 | 320 | { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, |
314 | 321 | { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, |
315 | 322 | { "s390_runtime_instr", __PNR_s390_runtime_instr }, |
323 | { "s390_sthyi", __PNR_s390_sthyi }, | |
316 | 324 | { "sched_get_priority_max", (__SCMP_NR_BASE + 159) }, |
317 | 325 | { "sched_get_priority_min", (__SCMP_NR_BASE + 160) }, |
318 | 326 | { "sched_getaffinity", (__SCMP_NR_BASE + 242) }, |
398 | 406 | { "stat64", (__SCMP_NR_BASE + 195) }, |
399 | 407 | { "statfs", (__SCMP_NR_BASE + 99) }, |
400 | 408 | { "statfs64", (__SCMP_NR_BASE + 266) }, |
409 | { "statx", (__SCMP_NR_BASE + 397) }, | |
401 | 410 | { "stime", __PNR_stime }, |
402 | 411 | { "stty", __PNR_stty }, |
403 | 412 | { "subpage_prot", __PNR_subpage_prot }, |
512 | 521 | } |
513 | 522 | |
514 | 523 | /** |
515 | * Iterate through the syscall table and return the syscall name | |
524 | * Iterate through the syscall table and return the syscall mapping | |
516 | 525 | * @param spot the offset into the syscall table |
517 | 526 | * |
518 | * Return the syscall name at position @spot or NULL on failure. This function | |
519 | * should only ever be used internally by libseccomp. | |
527 | * Return the syscall mapping at position @spot or NULL on failure. This | |
528 | * function should only ever be used internally by libseccomp. | |
520 | 529 | * |
521 | 530 | */ |
522 | const char *arm_syscall_iterate_name(unsigned int spot) | |
531 | const struct arch_syscall_def *arm_syscall_iterate(unsigned int spot) | |
523 | 532 | { |
524 | 533 | /* XXX - no safety checks here */ |
525 | return arm_syscall_table[spot].name; | |
534 | return &arm_syscall_table[spot]; | |
526 | 535 | } |
31 | 31 | int arm_syscall_resolve_name(const char *name); |
32 | 32 | const char *arm_syscall_resolve_num(int num); |
33 | 33 | |
34 | const char *arm_syscall_iterate_name(unsigned int spot); | |
34 | const struct arch_syscall_def *arm_syscall_iterate(unsigned int spot); | |
35 | 35 | |
36 | 36 | #endif |
29 | 29 | /* O32 ABI */ |
30 | 30 | #define __SCMP_NR_BASE 4000 |
31 | 31 | |
32 | /* NOTE: based on Linux 4.5-rc4 */ | |
32 | /* NOTE: based on Linux 4.15-rc7 */ | |
33 | 33 | const struct arch_syscall_def mips_syscall_table[] = { \ |
34 | 34 | { "_llseek", (__SCMP_NR_BASE + 140) }, |
35 | 35 | { "_newselect", (__SCMP_NR_BASE + 142) }, |
125 | 125 | { "get_mempolicy", (__SCMP_NR_BASE + 269) }, |
126 | 126 | { "get_robust_list", (__SCMP_NR_BASE + 310) }, |
127 | 127 | { "get_thread_area", __PNR_get_thread_area }, |
128 | { "get_tls", __PNR_get_tls }, | |
128 | 129 | { "getcpu", (__SCMP_NR_BASE + 312) }, |
129 | 130 | { "getcwd", (__SCMP_NR_BASE + 203) }, |
130 | 131 | { "getdents", (__SCMP_NR_BASE + 141) }, |
257 | 258 | { "pipe", (__SCMP_NR_BASE + 42) }, |
258 | 259 | { "pipe2", (__SCMP_NR_BASE + 328) }, |
259 | 260 | { "pivot_root", (__SCMP_NR_BASE + 216) }, |
261 | { "pkey_alloc", (__SCMP_NR_BASE + 364) }, | |
262 | { "pkey_free", (__SCMP_NR_BASE + 365) }, | |
263 | { "pkey_mprotect", (__SCMP_NR_BASE + 363) }, | |
260 | 264 | { "poll", (__SCMP_NR_BASE + 188) }, |
261 | 265 | { "ppoll", (__SCMP_NR_BASE + 302) }, |
262 | 266 | { "prctl", (__SCMP_NR_BASE + 192) }, |
263 | 267 | { "pread64", (__SCMP_NR_BASE + 200) }, |
264 | 268 | { "preadv", (__SCMP_NR_BASE + 330) }, |
269 | { "preadv2", (__SCMP_NR_BASE + 361) }, | |
265 | 270 | { "prlimit64", (__SCMP_NR_BASE + 338) }, |
266 | 271 | { "process_vm_readv", (__SCMP_NR_BASE + 345) }, |
267 | 272 | { "process_vm_writev", (__SCMP_NR_BASE + 346) }, |
272 | 277 | { "putpmsg", (__SCMP_NR_BASE + 209) }, |
273 | 278 | { "pwrite64", (__SCMP_NR_BASE + 201) }, |
274 | 279 | { "pwritev", (__SCMP_NR_BASE + 331) }, |
280 | { "pwritev2", (__SCMP_NR_BASE + 362) }, | |
275 | 281 | { "query_module", (__SCMP_NR_BASE + 187) }, |
276 | 282 | { "quotactl", (__SCMP_NR_BASE + 131) }, |
277 | 283 | { "read", (__SCMP_NR_BASE + 3) }, |
302 | 308 | { "rt_sigtimedwait", (__SCMP_NR_BASE + 197) }, |
303 | 309 | { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 332) }, |
304 | 310 | { "rtas", __PNR_rtas }, |
311 | { "s390_guarded_storage", __PNR_s390_guarded_storage }, | |
305 | 312 | { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, |
306 | 313 | { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, |
307 | 314 | { "s390_runtime_instr", __PNR_s390_runtime_instr }, |
315 | { "s390_sthyi", __PNR_s390_sthyi }, | |
308 | 316 | { "sched_get_priority_max", (__SCMP_NR_BASE + 163) }, |
309 | 317 | { "sched_get_priority_min", (__SCMP_NR_BASE + 164) }, |
310 | 318 | { "sched_getaffinity", (__SCMP_NR_BASE + 240) }, |
390 | 398 | { "stat64", (__SCMP_NR_BASE + 213) }, |
391 | 399 | { "statfs", (__SCMP_NR_BASE + 99) }, |
392 | 400 | { "statfs64", (__SCMP_NR_BASE + 255) }, |
401 | { "statx", (__SCMP_NR_BASE + 366) }, | |
393 | 402 | { "stime", (__SCMP_NR_BASE + 25) }, |
394 | 403 | { "stty", (__SCMP_NR_BASE + 31) }, |
395 | 404 | { "subpage_prot", __PNR_subpage_prot }, |
504 | 513 | } |
505 | 514 | |
506 | 515 | /** |
507 | * Iterate through the syscall table and return the syscall name | |
516 | * Iterate through the syscall table and return the syscall mapping | |
508 | 517 | * @param spot the offset into the syscall table |
509 | 518 | * |
510 | * Return the syscall name at position @spot or NULL on failure. This function | |
511 | * should only ever be used internally by libseccomp. | |
519 | * Return the syscall mapping at position @spot or NULL on failure. This | |
520 | * function should only ever be used internally by libseccomp. | |
512 | 521 | * |
513 | 522 | */ |
514 | const char *mips_syscall_iterate_name(unsigned int spot) | |
523 | const struct arch_syscall_def *mips_syscall_iterate(unsigned int spot) | |
515 | 524 | { |
516 | 525 | /* XXX - no safety checks here */ |
517 | return mips_syscall_table[spot].name; | |
526 | return &mips_syscall_table[spot]; | |
518 | 527 | } |
33 | 33 | int mips_syscall_resolve_name(const char *name); |
34 | 34 | const char *mips_syscall_resolve_num(int num); |
35 | 35 | |
36 | const char *mips_syscall_iterate_name(unsigned int spot); | |
36 | const struct arch_syscall_def *mips_syscall_iterate(unsigned int spot); | |
37 | 37 | |
38 | 38 | #endif |
29 | 29 | /* 64 ABI */ |
30 | 30 | #define __SCMP_NR_BASE 5000 |
31 | 31 | |
32 | /* NOTE: based on Linux 4.5-rc4 */ | |
32 | /* NOTE: based on Linux 4.15-rc7 */ | |
33 | 33 | const struct arch_syscall_def mips64_syscall_table[] = { \ |
34 | 34 | { "_llseek", __PNR__llseek }, |
35 | 35 | { "_newselect", (__SCMP_NR_BASE + 22) }, |
125 | 125 | { "get_mempolicy", (__SCMP_NR_BASE + 228) }, |
126 | 126 | { "get_robust_list", (__SCMP_NR_BASE + 269) }, |
127 | 127 | { "get_thread_area", __PNR_get_thread_area }, |
128 | { "get_tls", __PNR_get_tls }, | |
128 | 129 | { "getcpu", (__SCMP_NR_BASE + 271) }, |
129 | 130 | { "getcwd", (__SCMP_NR_BASE + 77) }, |
130 | 131 | { "getdents", (__SCMP_NR_BASE + 76) }, |
257 | 258 | { "pipe", (__SCMP_NR_BASE + 21) }, |
258 | 259 | { "pipe2", (__SCMP_NR_BASE + 287) }, |
259 | 260 | { "pivot_root", (__SCMP_NR_BASE + 151) }, |
261 | { "pkey_alloc", (__SCMP_NR_BASE + 324) }, | |
262 | { "pkey_free", (__SCMP_NR_BASE + 325) }, | |
263 | { "pkey_mprotect", (__SCMP_NR_BASE + 323) }, | |
260 | 264 | { "poll", (__SCMP_NR_BASE + 7) }, |
261 | 265 | { "ppoll", (__SCMP_NR_BASE + 261) }, |
262 | 266 | { "prctl", (__SCMP_NR_BASE + 153) }, |
263 | 267 | { "pread64", (__SCMP_NR_BASE + 16) }, |
264 | 268 | { "preadv", (__SCMP_NR_BASE + 289) }, |
269 | { "preadv2", (__SCMP_NR_BASE + 321) }, | |
265 | 270 | { "prlimit64", (__SCMP_NR_BASE + 297) }, |
266 | 271 | { "process_vm_readv", (__SCMP_NR_BASE + 304) }, |
267 | 272 | { "process_vm_writev", (__SCMP_NR_BASE + 305) }, |
272 | 277 | { "putpmsg", (__SCMP_NR_BASE + 175) }, |
273 | 278 | { "pwrite64", (__SCMP_NR_BASE + 17) }, |
274 | 279 | { "pwritev", (__SCMP_NR_BASE + 290) }, |
280 | { "pwritev2", (__SCMP_NR_BASE + 322) }, | |
275 | 281 | { "query_module", (__SCMP_NR_BASE + 171) }, |
276 | 282 | { "quotactl", (__SCMP_NR_BASE + 172) }, |
277 | 283 | { "read", (__SCMP_NR_BASE + 0) }, |
302 | 308 | { "rt_sigtimedwait", (__SCMP_NR_BASE + 126) }, |
303 | 309 | { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 291) }, |
304 | 310 | { "rtas", __PNR_rtas }, |
311 | { "s390_guarded_storage", __PNR_s390_guarded_storage }, | |
305 | 312 | { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, |
306 | 313 | { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, |
307 | 314 | { "s390_runtime_instr", __PNR_s390_runtime_instr }, |
315 | { "s390_sthyi", __PNR_s390_sthyi }, | |
308 | 316 | { "sched_get_priority_max", (__SCMP_NR_BASE + 143) }, |
309 | 317 | { "sched_get_priority_min", (__SCMP_NR_BASE + 144) }, |
310 | 318 | { "sched_getaffinity", (__SCMP_NR_BASE + 196) }, |
390 | 398 | { "stat64", __PNR_stat64 }, |
391 | 399 | { "statfs", (__SCMP_NR_BASE + 134) }, |
392 | 400 | { "statfs64", __PNR_statfs64 }, |
401 | { "statx", (__SCMP_NR_BASE + 326) }, | |
393 | 402 | { "stime", __PNR_stime }, |
394 | 403 | { "stty", __PNR_stty }, |
395 | 404 | { "subpage_prot", __PNR_subpage_prot }, |
504 | 513 | } |
505 | 514 | |
506 | 515 | /** |
507 | * Iterate through the syscall table and return the syscall name | |
516 | * Iterate through the syscall table and return the syscall mapping | |
508 | 517 | * @param spot the offset into the syscall table |
509 | 518 | * |
510 | * Return the syscall name at position @spot or NULL on failure. This function | |
511 | * should only ever be used internally by libseccomp. | |
519 | * Return the syscall mapping at position @spot or NULL on failure. This | |
520 | * function should only ever be used internally by libseccomp. | |
512 | 521 | * |
513 | 522 | */ |
514 | const char *mips64_syscall_iterate_name(unsigned int spot) | |
523 | const struct arch_syscall_def *mips64_syscall_iterate(unsigned int spot) | |
515 | 524 | { |
516 | 525 | /* XXX - no safety checks here */ |
517 | return mips64_syscall_table[spot].name; | |
526 | return &mips64_syscall_table[spot]; | |
518 | 527 | } |
33 | 33 | int mips64_syscall_resolve_name(const char *name); |
34 | 34 | const char *mips64_syscall_resolve_num(int num); |
35 | 35 | |
36 | const char *mips64_syscall_iterate_name(unsigned int spot); | |
36 | const struct arch_syscall_def *mips64_syscall_iterate(unsigned int spot); | |
37 | 37 | |
38 | 38 | #endif⏎ |
29 | 29 | /* N32 ABI */ |
30 | 30 | #define __SCMP_NR_BASE 6000 |
31 | 31 | |
32 | /* NOTE: based on Linux 4.5-rc4 */ | |
32 | /* NOTE: based on Linux 4.15-rc7 */ | |
33 | 33 | const struct arch_syscall_def mips64n32_syscall_table[] = { \ |
34 | 34 | { "_llseek", __PNR__llseek }, |
35 | 35 | { "_newselect", (__SCMP_NR_BASE + 22) }, |
125 | 125 | { "get_mempolicy", (__SCMP_NR_BASE + 232) }, |
126 | 126 | { "get_robust_list", (__SCMP_NR_BASE + 273) }, |
127 | 127 | { "get_thread_area", __PNR_get_thread_area }, |
128 | { "get_tls", __PNR_get_tls }, | |
128 | 129 | { "getcpu", (__SCMP_NR_BASE + 275) }, |
129 | 130 | { "getcwd", (__SCMP_NR_BASE + 77) }, |
130 | 131 | { "getdents", (__SCMP_NR_BASE + 76) }, |
257 | 258 | { "pipe", (__SCMP_NR_BASE + 21) }, |
258 | 259 | { "pipe2", (__SCMP_NR_BASE + 291) }, |
259 | 260 | { "pivot_root", (__SCMP_NR_BASE + 151) }, |
261 | { "pkey_alloc", (__SCMP_NR_BASE + 328) }, | |
262 | { "pkey_free", (__SCMP_NR_BASE + 329) }, | |
263 | { "pkey_mprotect", (__SCMP_NR_BASE + 327) }, | |
260 | 264 | { "poll", (__SCMP_NR_BASE + 7) }, |
261 | 265 | { "ppoll", (__SCMP_NR_BASE + 265) }, |
262 | 266 | { "prctl", (__SCMP_NR_BASE + 153) }, |
263 | 267 | { "pread64", (__SCMP_NR_BASE + 16) }, |
264 | 268 | { "preadv", (__SCMP_NR_BASE + 293) }, |
269 | { "preadv2", (__SCMP_NR_BASE + 325) }, | |
265 | 270 | { "prlimit64", (__SCMP_NR_BASE + 302) }, |
266 | 271 | { "process_vm_readv", (__SCMP_NR_BASE + 309) }, |
267 | 272 | { "process_vm_writev", (__SCMP_NR_BASE + 310) }, |
272 | 277 | { "putpmsg", (__SCMP_NR_BASE + 175) }, |
273 | 278 | { "pwrite64", (__SCMP_NR_BASE + 17) }, |
274 | 279 | { "pwritev", (__SCMP_NR_BASE + 294) }, |
280 | { "pwritev2", (__SCMP_NR_BASE + 326) }, | |
275 | 281 | { "query_module", (__SCMP_NR_BASE + 171) }, |
276 | 282 | { "quotactl", (__SCMP_NR_BASE + 172) }, |
277 | 283 | { "read", (__SCMP_NR_BASE + 0) }, |
302 | 308 | { "rt_sigtimedwait", (__SCMP_NR_BASE + 126) }, |
303 | 309 | { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 295) }, |
304 | 310 | { "rtas", __PNR_rtas }, |
311 | { "s390_guarded_storage", __PNR_s390_guarded_storage }, | |
305 | 312 | { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, |
306 | 313 | { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, |
307 | 314 | { "s390_runtime_instr", __PNR_s390_runtime_instr }, |
315 | { "s390_sthyi", __PNR_s390_sthyi }, | |
308 | 316 | { "sched_get_priority_max", (__SCMP_NR_BASE + 143) }, |
309 | 317 | { "sched_get_priority_min", (__SCMP_NR_BASE + 144) }, |
310 | 318 | { "sched_getaffinity", (__SCMP_NR_BASE + 196) }, |
390 | 398 | { "stat64", __PNR_stat64 }, |
391 | 399 | { "statfs", (__SCMP_NR_BASE + 134) }, |
392 | 400 | { "statfs64", (__SCMP_NR_BASE + 217) }, |
401 | { "statx", (__SCMP_NR_BASE + 330) }, | |
393 | 402 | { "stime", __PNR_stime }, |
394 | 403 | { "stty", __PNR_stty }, |
395 | 404 | { "subpage_prot", __PNR_subpage_prot }, |
504 | 513 | } |
505 | 514 | |
506 | 515 | /** |
507 | * Iterate through the syscall table and return the syscall name | |
516 | * Iterate through the syscall table and return the syscall mapping | |
508 | 517 | * @param spot the offset into the syscall table |
509 | 518 | * |
510 | * Return the syscall name at position @spot or NULL on failure. This function | |
511 | * should only ever be used internally by libseccomp. | |
519 | * Return the syscall mapping at position @spot or NULL on failure. This | |
520 | * function should only ever be used internally by libseccomp. | |
512 | 521 | * |
513 | 522 | */ |
514 | const char *mips64n32_syscall_iterate_name(unsigned int spot) | |
523 | const struct arch_syscall_def *mips64n32_syscall_iterate(unsigned int spot) | |
515 | 524 | { |
516 | 525 | /* XXX - no safety checks here */ |
517 | return mips64n32_syscall_table[spot].name; | |
526 | return &mips64n32_syscall_table[spot]; | |
518 | 527 | } |
33 | 33 | int mips64n32_syscall_resolve_name(const char *name); |
34 | 34 | const char *mips64n32_syscall_resolve_num(int num); |
35 | 35 | |
36 | const char *mips64n32_syscall_iterate_name(unsigned int spot); | |
36 | const struct arch_syscall_def *mips64n32_syscall_iterate(unsigned int spot); | |
37 | 37 | |
38 | 38 | #endif |
26 | 26 | #include "arch.h" |
27 | 27 | #include "arch-ppc.h" |
28 | 28 | |
29 | /* NOTE: based on Linux 4.5-rc4 */ | |
29 | /* NOTE: based on Linux 4.15-rc7 */ | |
30 | 30 | const struct arch_syscall_def ppc_syscall_table[] = { \ |
31 | 31 | { "_llseek", 140 }, |
32 | 32 | { "_newselect", 142 }, |
122 | 122 | { "get_mempolicy", 260 }, |
123 | 123 | { "get_robust_list", 299 }, |
124 | 124 | { "get_thread_area", __PNR_get_thread_area }, |
125 | { "get_tls", __PNR_get_tls }, | |
125 | 126 | { "getcpu", 302 }, |
126 | 127 | { "getcwd", 182 }, |
127 | 128 | { "getdents", 141 }, |
176 | 177 | { "ioprio_set", 273 }, |
177 | 178 | { "ipc", 117 }, |
178 | 179 | { "kcmp", 354 }, |
179 | { "kexec_file_load", __PNR_kexec_file_load }, | |
180 | { "kexec_file_load", 382 }, | |
180 | 181 | { "kexec_load", 268 }, |
181 | 182 | { "keyctl", 271 }, |
182 | 183 | { "kill", 37 }, |
254 | 255 | { "pipe", 42 }, |
255 | 256 | { "pipe2", 317 }, |
256 | 257 | { "pivot_root", 203 }, |
258 | { "pkey_alloc", __PNR_pkey_alloc }, | |
259 | { "pkey_free", __PNR_pkey_free }, | |
260 | { "pkey_mprotect", __PNR_pkey_mprotect }, | |
257 | 261 | { "poll", 167 }, |
258 | 262 | { "ppoll", 281 }, |
259 | 263 | { "prctl", 171 }, |
260 | 264 | { "pread64", 179 }, |
261 | 265 | { "preadv", 320 }, |
266 | { "preadv2", 380 }, | |
262 | 267 | { "prlimit64", 325 }, |
263 | 268 | { "process_vm_readv", 351 }, |
264 | 269 | { "process_vm_writev", 352 }, |
269 | 274 | { "putpmsg", 188 }, |
270 | 275 | { "pwrite64", 180 }, |
271 | 276 | { "pwritev", 321 }, |
277 | { "pwritev2", 381 }, | |
272 | 278 | { "query_module", 166 }, |
273 | 279 | { "quotactl", 131 }, |
274 | 280 | { "read", 3 }, |
299 | 305 | { "rt_sigtimedwait", 176 }, |
300 | 306 | { "rt_tgsigqueueinfo", 322 }, |
301 | 307 | { "rtas", 255 }, |
308 | { "s390_guarded_storage", __PNR_s390_guarded_storage }, | |
302 | 309 | { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, |
303 | 310 | { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, |
304 | 311 | { "s390_runtime_instr", __PNR_s390_runtime_instr }, |
312 | { "s390_sthyi", __PNR_s390_sthyi }, | |
305 | 313 | { "sched_get_priority_max", 159 }, |
306 | 314 | { "sched_get_priority_min", 160 }, |
307 | 315 | { "sched_getaffinity", 223 }, |
387 | 395 | { "stat64", 195 }, |
388 | 396 | { "statfs", 99 }, |
389 | 397 | { "statfs64", 252 }, |
398 | { "statx", 383}, | |
390 | 399 | { "stime", 25 }, |
391 | 400 | { "stty", 31 }, |
392 | 401 | { "subpage_prot", 310 }, |
501 | 510 | } |
502 | 511 | |
503 | 512 | /** |
504 | * Iterate through the syscall table and return the syscall name | |
513 | * Iterate through the syscall table and return the syscall mapping | |
505 | 514 | * @param spot the offset into the syscall table |
506 | 515 | * |
507 | * Return the syscall name at position @spot or NULL on failure. This function | |
508 | * should only ever be used internally by libseccomp. | |
516 | * Return the syscall mapping at position @spot or NULL on failure. This | |
517 | * function should only ever be used internally by libseccomp. | |
509 | 518 | * |
510 | 519 | */ |
511 | const char *ppc_syscall_iterate_name(unsigned int spot) | |
520 | const struct arch_syscall_def *ppc_syscall_iterate(unsigned int spot) | |
512 | 521 | { |
513 | 522 | /* XXX - no safety checks here */ |
514 | return ppc_syscall_table[spot].name; | |
523 | return &ppc_syscall_table[spot]; | |
515 | 524 | } |
32 | 32 | int ppc_syscall_resolve_name(const char *name); |
33 | 33 | const char *ppc_syscall_resolve_num(int num); |
34 | 34 | |
35 | const char *ppc_syscall_iterate_name(unsigned int spot); | |
35 | const struct arch_syscall_def *ppc_syscall_iterate(unsigned int spot); | |
36 | 36 | |
37 | 37 | #endif |
26 | 26 | #include "arch.h" |
27 | 27 | #include "arch-ppc64.h" |
28 | 28 | |
29 | /* NOTE: based on Linux 4.5-rc4 */ | |
29 | /* NOTE: based on Linux 4.15-rc7 */ | |
30 | 30 | const struct arch_syscall_def ppc64_syscall_table[] = { \ |
31 | 31 | { "_llseek", 140 }, |
32 | 32 | { "_newselect", 142 }, |
122 | 122 | { "get_mempolicy", 260 }, |
123 | 123 | { "get_robust_list", 299 }, |
124 | 124 | { "get_thread_area", __PNR_get_thread_area }, |
125 | { "get_tls", __PNR_get_tls }, | |
125 | 126 | { "getcpu", 302 }, |
126 | 127 | { "getcwd", 182 }, |
127 | 128 | { "getdents", 141 }, |
176 | 177 | { "ioprio_set", 273 }, |
177 | 178 | { "ipc", 117 }, |
178 | 179 | { "kcmp", 354 }, |
179 | { "kexec_file_load", __PNR_kexec_file_load }, | |
180 | { "kexec_file_load", 382 }, | |
180 | 181 | { "kexec_load", 268 }, |
181 | 182 | { "keyctl", 271 }, |
182 | 183 | { "kill", 37 }, |
254 | 255 | { "pipe", 42 }, |
255 | 256 | { "pipe2", 317 }, |
256 | 257 | { "pivot_root", 203 }, |
258 | { "pkey_alloc", __PNR_pkey_alloc }, | |
259 | { "pkey_free", __PNR_pkey_free }, | |
260 | { "pkey_mprotect", __PNR_pkey_mprotect }, | |
257 | 261 | { "poll", 167 }, |
258 | 262 | { "ppoll", 281 }, |
259 | 263 | { "prctl", 171 }, |
260 | 264 | { "pread64", 179 }, |
261 | 265 | { "preadv", 320 }, |
266 | { "preadv2", 380 }, | |
262 | 267 | { "prlimit64", 325 }, |
263 | 268 | { "process_vm_readv", 351 }, |
264 | 269 | { "process_vm_writev", 352 }, |
269 | 274 | { "putpmsg", 188 }, |
270 | 275 | { "pwrite64", 180 }, |
271 | 276 | { "pwritev", 321 }, |
277 | { "pwritev2", 381 }, | |
272 | 278 | { "query_module", 166 }, |
273 | 279 | { "quotactl", 131 }, |
274 | 280 | { "read", 3 }, |
299 | 305 | { "rt_sigtimedwait", 176 }, |
300 | 306 | { "rt_tgsigqueueinfo", 322 }, |
301 | 307 | { "rtas", 255 }, |
308 | { "s390_guarded_storage", __PNR_s390_guarded_storage }, | |
302 | 309 | { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, |
303 | 310 | { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, |
304 | 311 | { "s390_runtime_instr", __PNR_s390_runtime_instr }, |
312 | { "s390_sthyi", __PNR_s390_sthyi }, | |
305 | 313 | { "sched_get_priority_max", 159 }, |
306 | 314 | { "sched_get_priority_min", 160 }, |
307 | 315 | { "sched_getaffinity", 223 }, |
387 | 395 | { "stat64", __PNR_stat64 }, |
388 | 396 | { "statfs", 99 }, |
389 | 397 | { "statfs64", 252 }, |
398 | { "statx", 383}, | |
390 | 399 | { "stime", 25 }, |
391 | 400 | { "stty", 31 }, |
392 | 401 | { "subpage_prot", 310 }, |
501 | 510 | } |
502 | 511 | |
503 | 512 | /** |
504 | * Iterate through the syscall table and return the syscall name | |
513 | * Iterate through the syscall table and return the syscall mapping | |
505 | 514 | * @param spot the offset into the syscall table |
506 | 515 | * |
507 | * Return the syscall name at position @spot or NULL on failure. This function | |
508 | * should only ever be used internally by libseccomp. | |
516 | * Return the syscall mapping at position @spot or NULL on failure. This | |
517 | * function should only ever be used internally by libseccomp. | |
509 | 518 | * |
510 | 519 | */ |
511 | const char *ppc64_syscall_iterate_name(unsigned int spot) | |
520 | const struct arch_syscall_def *ppc64_syscall_iterate(unsigned int spot) | |
512 | 521 | { |
513 | 522 | /* XXX - no safety checks here */ |
514 | return ppc64_syscall_table[spot].name; | |
523 | return &ppc64_syscall_table[spot]; | |
515 | 524 | } |
33 | 33 | int ppc64_syscall_resolve_name(const char *name); |
34 | 34 | const char *ppc64_syscall_resolve_num(int num); |
35 | 35 | |
36 | const char *ppc64_syscall_iterate_name(unsigned int spot); | |
36 | const struct arch_syscall_def *ppc64_syscall_iterate(unsigned int spot); | |
37 | 37 | |
38 | 38 | #endif |
9 | 9 | #include "arch.h" |
10 | 10 | #include "arch-s390.h" |
11 | 11 | |
12 | /* NOTE: based on Linux 4.5-rc4 */ | |
12 | /* NOTE: based on Linux 4.15-rc7 */ | |
13 | 13 | const struct arch_syscall_def s390_syscall_table[] = { \ |
14 | 14 | { "_llseek", 140 }, |
15 | 15 | { "_newselect", 142 }, |
105 | 105 | { "get_mempolicy", 269 }, |
106 | 106 | { "get_robust_list", 305 }, |
107 | 107 | { "get_thread_area", __PNR_get_thread_area }, |
108 | { "get_tls", __PNR_get_tls }, | |
108 | 109 | { "getcpu", 311 }, |
109 | 110 | { "getcwd", 183 }, |
110 | 111 | { "getdents", 141 }, |
237 | 238 | { "pipe", 42 }, |
238 | 239 | { "pipe2", 325 }, |
239 | 240 | { "pivot_root", 217 }, |
241 | { "pkey_alloc", __PNR_pkey_alloc }, | |
242 | { "pkey_free", __PNR_pkey_free }, | |
243 | { "pkey_mprotect", __PNR_pkey_mprotect }, | |
240 | 244 | { "poll", 168 }, |
241 | 245 | { "ppoll", 302 }, |
242 | 246 | { "prctl", 172 }, |
243 | 247 | { "pread64", 180 }, |
244 | 248 | { "preadv", 328 }, |
249 | { "preadv2", 376 }, | |
245 | 250 | { "prlimit64", 334 }, |
246 | 251 | { "process_vm_readv", 340 }, |
247 | 252 | { "process_vm_writev", 341 }, |
252 | 257 | { "putpmsg", 189 }, |
253 | 258 | { "pwrite64", 181 }, |
254 | 259 | { "pwritev", 329 }, |
260 | { "pwritev2", 377 }, | |
255 | 261 | { "query_module", 167 }, |
256 | 262 | { "quotactl", 131 }, |
257 | 263 | { "read", 3 }, |
282 | 288 | { "rt_sigtimedwait", 177 }, |
283 | 289 | { "rt_tgsigqueueinfo", 330 }, |
284 | 290 | { "rtas", __PNR_rtas }, |
291 | { "s390_guarded_storage", 378 }, | |
285 | 292 | { "s390_pci_mmio_read", 353 }, |
286 | 293 | { "s390_pci_mmio_write", 352 }, |
287 | 294 | { "s390_runtime_instr", 342 }, |
295 | { "s390_sthyi", 380 }, | |
288 | 296 | { "sched_get_priority_max", 159 }, |
289 | 297 | { "sched_get_priority_min", 160 }, |
290 | 298 | { "sched_getaffinity", 240 }, |
370 | 378 | { "stat64", 195 }, |
371 | 379 | { "statfs", 99 }, |
372 | 380 | { "statfs64", 265 }, |
381 | { "statx", 379 }, | |
373 | 382 | { "stime", 25 }, |
374 | 383 | { "stty", __PNR_stty }, |
375 | 384 | { "subpage_prot", __PNR_subpage_prot }, |
566 | 575 | |
567 | 576 | return NULL; |
568 | 577 | } |
578 | ||
569 | 579 | /** |
570 | * Iterate through the syscall table and return the syscall name | |
580 | * Iterate through the syscall table and return the syscall mapping | |
571 | 581 | * @param spot the offset into the syscall table |
572 | 582 | * |
573 | * Return the syscall name at position @spot or NULL on failure. This function | |
574 | * should only ever be used internally by libseccomp. | |
583 | * Return the syscall mapping at position @spot or NULL on failure. This | |
584 | * function should only ever be used internally by libseccomp. | |
575 | 585 | * |
576 | 586 | */ |
577 | const char *s390_syscall_iterate_name(unsigned int spot) | |
587 | const struct arch_syscall_def *s390_syscall_iterate(unsigned int spot) | |
578 | 588 | { |
579 | 589 | /* XXX - no safety checks here */ |
580 | return s390_syscall_table[spot].name; | |
590 | return &s390_syscall_table[spot]; | |
581 | 591 | } |
208 | 208 | { |
209 | 209 | int rc; |
210 | 210 | unsigned int iter; |
211 | size_t args_size; | |
212 | 211 | int sys = rule->syscall; |
213 | 212 | int sys_a, sys_b; |
214 | 213 | struct db_api_rule_list *rule_a, *rule_b; |
218 | 217 | (359 to 373) : direct socket syscalls, Linux 4.3+ */ |
219 | 218 | |
220 | 219 | /* strict check for the multiplexed socket syscalls */ |
221 | for (iter = 0; iter < rule->args_cnt; iter++) { | |
220 | for (iter = 0; iter < ARG_COUNT_MAX; iter++) { | |
222 | 221 | if ((rule->args[iter].valid != 0) && (strict)) |
223 | 222 | return -EINVAL; |
224 | 223 | } |
248 | 247 | } else { |
249 | 248 | /* need two rules, dup the first and link together */ |
250 | 249 | rule_a = rule; |
251 | rule_b = malloc(sizeof(*rule_b)); | |
250 | rule_b = db_rule_dup(rule_a); | |
252 | 251 | if (rule_b == NULL) |
253 | 252 | return -ENOMEM; |
254 | args_size = sizeof(*rule_b->args) * rule_a->args_cnt; | |
255 | rule_b->args = malloc(args_size); | |
256 | if (rule_b->args == NULL) { | |
257 | free(rule_b); | |
258 | return -ENOMEM; | |
259 | } | |
260 | rule_b->action = rule_a->action; | |
261 | rule_b->syscall = rule_a->syscall; | |
262 | rule_b->args_cnt = rule_a->args_cnt; | |
263 | memcpy(rule_b->args, rule_a->args, args_size); | |
264 | 253 | rule_b->prev = rule_a; |
265 | 254 | rule_b->next = NULL; |
266 | 255 | rule_a->next = rule_b; |
19 | 19 | int s390_syscall_resolve_name(const char *name); |
20 | 20 | const char *s390_syscall_resolve_num(int num); |
21 | 21 | |
22 | const char *s390_syscall_iterate_name(unsigned int spot); | |
22 | const struct arch_syscall_def *s390_syscall_iterate(unsigned int spot); | |
23 | 23 | |
24 | 24 | int s390_syscall_rewrite(int *syscall); |
25 | 25 |
9 | 9 | #include "arch.h" |
10 | 10 | #include "arch-s390x.h" |
11 | 11 | |
12 | /* NOTE: based on Linux 4.5-rc4 */ | |
12 | /* NOTE: based on Linux 4.15-rc7 */ | |
13 | 13 | const struct arch_syscall_def s390x_syscall_table[] = { \ |
14 | 14 | { "_llseek", __PNR__llseek }, |
15 | 15 | { "_newselect", __PNR__newselect }, |
105 | 105 | { "get_mempolicy", 269 }, |
106 | 106 | { "get_robust_list", 305 }, |
107 | 107 | { "get_thread_area", __PNR_get_thread_area }, |
108 | { "get_tls", __PNR_get_tls }, | |
108 | 109 | { "getcpu", 311 }, |
109 | 110 | { "getcwd", 183 }, |
110 | 111 | { "getdents", 141 }, |
237 | 238 | { "pipe", 42 }, |
238 | 239 | { "pipe2", 325 }, |
239 | 240 | { "pivot_root", 217 }, |
241 | { "pkey_alloc", __PNR_pkey_alloc }, | |
242 | { "pkey_free", __PNR_pkey_free }, | |
243 | { "pkey_mprotect", __PNR_pkey_mprotect }, | |
240 | 244 | { "poll", 168 }, |
241 | 245 | { "ppoll", 302 }, |
242 | 246 | { "prctl", 172 }, |
243 | 247 | { "pread64", 180 }, |
244 | 248 | { "preadv", 328 }, |
249 | { "preadv2", 376 }, | |
245 | 250 | { "prlimit64", 334 }, |
246 | 251 | { "process_vm_readv", 340 }, |
247 | 252 | { "process_vm_writev", 341 }, |
252 | 257 | { "putpmsg", 189 }, |
253 | 258 | { "pwrite64", 181 }, |
254 | 259 | { "pwritev", 329 }, |
260 | { "pwritev2", 377 }, | |
255 | 261 | { "query_module", 167 }, |
256 | 262 | { "quotactl", 131 }, |
257 | 263 | { "read", 3 }, |
282 | 288 | { "rt_sigtimedwait", 177 }, |
283 | 289 | { "rt_tgsigqueueinfo", 330 }, |
284 | 290 | { "rtas", __PNR_rtas }, |
291 | { "s390_guarded_storage", 378 }, | |
285 | 292 | { "s390_pci_mmio_read", 353 }, |
286 | 293 | { "s390_pci_mmio_write", 352 }, |
287 | 294 | { "s390_runtime_instr", 342 }, |
295 | { "s390_sthyi", 380 }, | |
288 | 296 | { "sched_get_priority_max", 159 }, |
289 | 297 | { "sched_get_priority_min", 160 }, |
290 | 298 | { "sched_getaffinity", 240 }, |
370 | 378 | { "stat64", __PNR_stat64 }, |
371 | 379 | { "statfs", 99 }, |
372 | 380 | { "statfs64", 265 }, |
381 | { "statx", 379 }, | |
373 | 382 | { "stime", __PNR_stime }, |
374 | 383 | { "stty", __PNR_stty }, |
375 | 384 | { "subpage_prot", __PNR_subpage_prot }, |
568 | 577 | } |
569 | 578 | |
570 | 579 | /** |
571 | * Iterate through the syscall table and return the syscall name | |
580 | * Iterate through the syscall table and return the syscall mapping | |
572 | 581 | * @param spot the offset into the syscall table |
573 | 582 | * |
574 | * Return the syscall name at position @spot or NULL on failure. This function | |
575 | * should only ever be used internally by libseccomp. | |
583 | * Return the syscall mapping at position @spot or NULL on failure. This | |
584 | * function should only ever be used internally by libseccomp. | |
576 | 585 | * |
577 | 586 | */ |
578 | const char *s390x_syscall_iterate_name(unsigned int spot) | |
587 | const struct arch_syscall_def *s390x_syscall_iterate(unsigned int spot) | |
579 | 588 | { |
580 | 589 | /* XXX - no safety checks here */ |
581 | return s390x_syscall_table[spot].name; | |
590 | return &s390x_syscall_table[spot]; | |
582 | 591 | } |
208 | 208 | { |
209 | 209 | int rc; |
210 | 210 | unsigned int iter; |
211 | size_t args_size; | |
212 | 211 | int sys = rule->syscall; |
213 | 212 | int sys_a, sys_b; |
214 | 213 | struct db_api_rule_list *rule_a, *rule_b; |
218 | 217 | (359 to 373) : direct socket syscalls, Linux 4.3+ */ |
219 | 218 | |
220 | 219 | /* strict check for the multiplexed socket syscalls */ |
221 | for (iter = 0; iter < rule->args_cnt; iter++) { | |
220 | for (iter = 0; iter < ARG_COUNT_MAX; iter++) { | |
222 | 221 | if ((rule->args[iter].valid != 0) && (strict)) |
223 | 222 | return -EINVAL; |
224 | 223 | } |
248 | 247 | } else { |
249 | 248 | /* need two rules, dup the first and link together */ |
250 | 249 | rule_a = rule; |
251 | rule_b = malloc(sizeof(*rule_b)); | |
250 | rule_b = db_rule_dup(rule_a); | |
252 | 251 | if (rule_b == NULL) |
253 | 252 | return -ENOMEM; |
254 | args_size = sizeof(*rule_b->args) * rule_a->args_cnt; | |
255 | rule_b->args = malloc(args_size); | |
256 | if (rule_b->args == NULL) { | |
257 | free(rule_b); | |
258 | return -ENOMEM; | |
259 | } | |
260 | rule_b->action = rule_a->action; | |
261 | rule_b->syscall = rule_a->syscall; | |
262 | rule_b->args_cnt = rule_a->args_cnt; | |
263 | memcpy(rule_b->args, rule_a->args, args_size); | |
264 | 253 | rule_b->prev = rule_a; |
265 | 254 | rule_b->next = NULL; |
266 | 255 | rule_a->next = rule_b; |
22 | 22 | int s390x_syscall_resolve_name(const char *name); |
23 | 23 | const char *s390x_syscall_resolve_num(int num); |
24 | 24 | |
25 | const char *s390x_syscall_iterate_name(unsigned int spot); | |
25 | const struct arch_syscall_def *s390x_syscall_iterate(unsigned int spot); | |
26 | 26 | |
27 | 27 | int s390x_syscall_rewrite(int *syscall); |
28 | 28 |
48 | 48 | * |
49 | 49 | */ |
50 | 50 | void syscall_check(char *str_miss, const char *syscall, |
51 | const char *arch_name, const char *arch_sys) | |
51 | const char *arch_name, const struct arch_syscall_def *sys) | |
52 | 52 | { |
53 | if (strcmp(syscall, arch_sys)) { | |
53 | if (strcmp(syscall, sys->name)) { | |
54 | 54 | if (str_miss[0] != '\0') |
55 | 55 | strcat(str_miss, ","); |
56 | 56 | strcat(str_miss, arch_name); |
74 | 74 | int i_ppc64 = 0; |
75 | 75 | int i_s390 = 0; |
76 | 76 | int i_s390x = 0; |
77 | char str_miss[256]; | |
77 | 78 | const char *sys_name; |
78 | char str_miss[256]; | |
79 | const struct arch_syscall_def *sys; | |
79 | 80 | |
80 | 81 | do { |
81 | 82 | str_miss[0] = '\0'; |
82 | sys_name = x86_syscall_iterate_name(i_x86); | |
83 | if (sys_name == NULL) { | |
83 | sys = x86_syscall_iterate(i_x86); | |
84 | if (sys == NULL || sys->name == NULL) { | |
84 | 85 | printf("FAULT\n"); |
85 | 86 | return 1; |
86 | 87 | } |
88 | sys_name = sys->name; | |
87 | 89 | |
88 | 90 | /* check each arch using x86 as the reference */ |
89 | 91 | syscall_check(str_miss, sys_name, "x86_64", |
90 | x86_64_syscall_iterate_name(i_x86_64)); | |
92 | x86_64_syscall_iterate(i_x86_64)); | |
91 | 93 | syscall_check(str_miss, sys_name, "x32", |
92 | x32_syscall_iterate_name(i_x32)); | |
94 | x32_syscall_iterate(i_x32)); | |
93 | 95 | syscall_check(str_miss, sys_name, "arm", |
94 | arm_syscall_iterate_name(i_arm)); | |
96 | arm_syscall_iterate(i_arm)); | |
95 | 97 | syscall_check(str_miss, sys_name, "aarch64", |
96 | aarch64_syscall_iterate_name(i_aarch64)); | |
98 | aarch64_syscall_iterate(i_aarch64)); | |
97 | 99 | syscall_check(str_miss, sys_name, "mips", |
98 | mips_syscall_iterate_name(i_mips)); | |
100 | mips_syscall_iterate(i_mips)); | |
99 | 101 | syscall_check(str_miss, sys_name, "mips64", |
100 | mips64_syscall_iterate_name(i_mips64)); | |
102 | mips64_syscall_iterate(i_mips64)); | |
101 | 103 | syscall_check(str_miss, sys_name, "mips64n32", |
102 | mips64n32_syscall_iterate_name(i_mips64n32)); | |
104 | mips64n32_syscall_iterate(i_mips64n32)); | |
103 | 105 | syscall_check(str_miss, sys_name, "ppc", |
104 | ppc_syscall_iterate_name(i_ppc)); | |
106 | ppc_syscall_iterate(i_ppc)); | |
105 | 107 | syscall_check(str_miss, sys_name, "ppc64", |
106 | ppc64_syscall_iterate_name(i_ppc64)); | |
108 | ppc64_syscall_iterate(i_ppc64)); | |
107 | 109 | syscall_check(str_miss, sys_name, "s390", |
108 | s390_syscall_iterate_name(i_s390)); | |
110 | s390_syscall_iterate(i_s390)); | |
109 | 111 | syscall_check(str_miss, sys_name, "s390x", |
110 | s390x_syscall_iterate_name(i_s390x)); | |
112 | s390x_syscall_iterate(i_s390x)); | |
111 | 113 | |
112 | 114 | /* output the results */ |
113 | 115 | printf("%s: ", sys_name); |
118 | 120 | printf("OK\n"); |
119 | 121 | |
120 | 122 | /* next */ |
121 | if (x86_syscall_iterate_name(i_x86 + 1)) | |
123 | if (x86_syscall_iterate(i_x86 + 1)->name) | |
122 | 124 | i_x86++; |
123 | if (!x86_64_syscall_iterate_name(++i_x86_64)) | |
125 | if (!x86_64_syscall_iterate(++i_x86_64)->name) | |
124 | 126 | i_x86_64 = -1; |
125 | if (!x32_syscall_iterate_name(++i_x32)) | |
127 | if (!x32_syscall_iterate(++i_x32)->name) | |
126 | 128 | i_x32 = -1; |
127 | if (!arm_syscall_iterate_name(++i_arm)) | |
129 | if (!arm_syscall_iterate(++i_arm)->name) | |
128 | 130 | i_arm = -1; |
129 | if (!aarch64_syscall_iterate_name(++i_aarch64)) | |
131 | if (!aarch64_syscall_iterate(++i_aarch64)->name) | |
130 | 132 | i_aarch64 = -1; |
131 | if (!mips_syscall_iterate_name(++i_mips)) | |
133 | if (!mips_syscall_iterate(++i_mips)->name) | |
132 | 134 | i_mips = -1; |
133 | if (!mips64_syscall_iterate_name(++i_mips64)) | |
135 | if (!mips64_syscall_iterate(++i_mips64)->name) | |
134 | 136 | i_mips64 = -1; |
135 | if (!mips64n32_syscall_iterate_name(++i_mips64n32)) | |
137 | if (!mips64n32_syscall_iterate(++i_mips64n32)->name) | |
136 | 138 | i_mips64n32 = -1; |
137 | if (!ppc_syscall_iterate_name(++i_ppc)) | |
139 | if (!ppc_syscall_iterate(++i_ppc)->name) | |
138 | 140 | i_ppc = -1; |
139 | if (!ppc64_syscall_iterate_name(++i_ppc64)) | |
141 | if (!ppc64_syscall_iterate(++i_ppc64)->name) | |
140 | 142 | i_ppc64 = -1; |
141 | if (!s390_syscall_iterate_name(++i_s390)) | |
143 | if (!s390_syscall_iterate(++i_s390)->name) | |
142 | 144 | i_s390 = -1; |
143 | if (!s390x_syscall_iterate_name(++i_s390x)) | |
145 | if (!s390x_syscall_iterate(++i_s390x)->name) | |
144 | 146 | i_s390x = -1; |
145 | 147 | } while (i_x86_64 >= 0 && i_x32 >= 0 && |
146 | 148 | i_arm >= 0 && i_aarch64 >= 0 && |
149 | 151 | i_s390 >= 0 && i_s390x >= 0); |
150 | 152 | |
151 | 153 | /* check for any leftovers */ |
152 | sys_name = x86_syscall_iterate_name(i_x86 + 1); | |
153 | if (sys_name) { | |
154 | printf("%s: ERROR, x86 has additional syscalls\n", sys_name); | |
154 | sys = x86_syscall_iterate(i_x86 + 1); | |
155 | if (sys->name) { | |
156 | printf("ERROR, x86 has additional syscalls\n"); | |
155 | 157 | return 1; |
156 | 158 | } |
157 | 159 | if (i_x86_64 >= 0) { |
158 | printf("%s: ERROR, x86_64 has additional syscalls\n", | |
159 | x86_64_syscall_iterate_name(i_x86_64)); | |
160 | printf("ERROR, x86_64 has additional syscalls\n"); | |
160 | 161 | return 1; |
161 | 162 | } |
162 | 163 | if (i_x32 >= 0) { |
163 | printf("%s: ERROR, x32 has additional syscalls\n", | |
164 | x32_syscall_iterate_name(i_x32)); | |
164 | printf("ERROR, x32 has additional syscalls\n"); | |
165 | 165 | return 1; |
166 | 166 | } |
167 | 167 | if (i_arm >= 0) { |
168 | printf("%s: ERROR, arm has additional syscalls\n", | |
169 | arm_syscall_iterate_name(i_arm)); | |
168 | printf("ERROR, arm has additional syscalls\n"); | |
170 | 169 | return 1; |
171 | 170 | } |
172 | 171 | if (i_aarch64 >= 0) { |
173 | printf("%s: ERROR, aarch64 has additional syscalls\n", | |
174 | aarch64_syscall_iterate_name(i_aarch64)); | |
172 | printf("ERROR, aarch64 has additional syscalls\n"); | |
175 | 173 | return 1; |
176 | 174 | } |
177 | 175 | if (i_mips >= 0) { |
178 | printf("%s: ERROR, mips has additional syscalls\n", | |
179 | mips_syscall_iterate_name(i_mips)); | |
176 | printf("ERROR, mips has additional syscalls\n"); | |
180 | 177 | return 1; |
181 | 178 | } |
182 | 179 | if (i_mips64 >= 0) { |
183 | printf("%s: ERROR, mips64 has additional syscalls\n", | |
184 | mips64_syscall_iterate_name(i_mips64)); | |
180 | printf("ERROR, mips64 has additional syscalls\n"); | |
185 | 181 | return 1; |
186 | 182 | } |
187 | 183 | if (i_mips64n32 >= 0) { |
188 | printf("%s: ERROR, mips64n32 has additional syscalls\n", | |
189 | mips64n32_syscall_iterate_name(i_mips64n32)); | |
184 | printf("ERROR, mips64n32 has additional syscalls\n"); | |
190 | 185 | return 1; |
191 | 186 | } |
192 | 187 | if (i_ppc >= 0) { |
193 | printf("%s: ERROR, ppc has additional syscalls\n", | |
194 | ppc_syscall_iterate_name(i_ppc)); | |
188 | printf("ERROR, ppc has additional syscalls\n"); | |
189 | return 1; | |
195 | 190 | } |
196 | 191 | if (i_ppc64 >= 0) { |
197 | printf("%s: ERROR, ppc64 has additional syscalls\n", | |
198 | ppc64_syscall_iterate_name(i_ppc64)); | |
192 | printf("ERROR, ppc64 has additional syscalls\n"); | |
199 | 193 | return 1; |
200 | 194 | } |
201 | 195 | if (i_s390 >= 0) { |
202 | printf("%s: ERROR, s390 has additional syscalls\n", | |
203 | s390_syscall_iterate_name(i_s390)); | |
196 | printf("ERROR, s390 has additional syscalls\n"); | |
204 | 197 | return 1; |
205 | 198 | } |
206 | 199 | if (i_s390x >= 0) { |
207 | printf("%s: ERROR, s390x has additional syscalls\n", | |
208 | s390x_syscall_iterate_name(i_s390x)); | |
200 | printf("ERROR, s390x has additional syscalls\n"); | |
209 | 201 | return 1; |
210 | 202 | } |
211 | 203 |
64 | 64 | const struct arch_def *arch = arch_def_native; |
65 | 65 | int offset = 0; |
66 | 66 | int iter; |
67 | int sys_num; | |
68 | const char *sys_name; | |
67 | const struct arch_syscall_def *sys; | |
69 | 68 | |
70 | 69 | /* parse the command line */ |
71 | 70 | while ((opt = getopt(argc, argv, "a:o:h")) > 0) { |
89 | 88 | do { |
90 | 89 | switch (arch->token) { |
91 | 90 | case SCMP_ARCH_X86: |
92 | sys_name = x86_syscall_iterate_name(iter); | |
91 | sys = x86_syscall_iterate(iter); | |
93 | 92 | break; |
94 | 93 | case SCMP_ARCH_X86_64: |
95 | sys_name = x86_64_syscall_iterate_name(iter); | |
94 | sys = x86_64_syscall_iterate(iter); | |
96 | 95 | break; |
97 | 96 | case SCMP_ARCH_X32: |
98 | sys_name = x32_syscall_iterate_name(iter); | |
97 | sys = x32_syscall_iterate(iter); | |
99 | 98 | break; |
100 | 99 | case SCMP_ARCH_ARM: |
101 | sys_name = arm_syscall_iterate_name(iter); | |
100 | sys = arm_syscall_iterate(iter); | |
102 | 101 | break; |
103 | 102 | case SCMP_ARCH_AARCH64: |
104 | sys_name = aarch64_syscall_iterate_name(iter); | |
103 | sys = aarch64_syscall_iterate(iter); | |
105 | 104 | break; |
106 | 105 | case SCMP_ARCH_MIPS: |
107 | 106 | case SCMP_ARCH_MIPSEL: |
108 | sys_name = mips_syscall_iterate_name(iter); | |
107 | sys = mips_syscall_iterate(iter); | |
109 | 108 | break; |
110 | 109 | case SCMP_ARCH_MIPS64: |
111 | 110 | case SCMP_ARCH_MIPSEL64: |
112 | sys_name = mips64_syscall_iterate_name(iter); | |
111 | sys = mips64_syscall_iterate(iter); | |
113 | 112 | break; |
114 | 113 | case SCMP_ARCH_MIPS64N32: |
115 | 114 | case SCMP_ARCH_MIPSEL64N32: |
116 | sys_name = mips64n32_syscall_iterate_name(iter); | |
115 | sys = mips64n32_syscall_iterate(iter); | |
117 | 116 | break; |
118 | 117 | case SCMP_ARCH_PPC: |
119 | sys_name = ppc_syscall_iterate_name(iter); | |
118 | sys = ppc_syscall_iterate(iter); | |
120 | 119 | break; |
121 | 120 | case SCMP_ARCH_PPC64: |
122 | 121 | case SCMP_ARCH_PPC64LE: |
123 | sys_name = ppc64_syscall_iterate_name(iter); | |
122 | sys = ppc64_syscall_iterate(iter); | |
124 | 123 | break; |
125 | 124 | case SCMP_ARCH_S390: |
126 | sys_name = s390_syscall_iterate_name(iter); | |
125 | sys = s390_syscall_iterate(iter); | |
127 | 126 | break; |
128 | 127 | case SCMP_ARCH_S390X: |
129 | sys_name = s390x_syscall_iterate_name(iter); | |
128 | sys = s390x_syscall_iterate(iter); | |
130 | 129 | break; |
131 | 130 | default: |
132 | 131 | /* invalid arch */ |
133 | 132 | exit_usage(argv[0]); |
134 | 133 | } |
135 | if (sys_name != NULL) { | |
136 | sys_num = arch_syscall_resolve_name(arch, sys_name); | |
134 | if (sys->name != NULL) { | |
135 | int sys_num = sys->num; | |
136 | ||
137 | 137 | if (offset > 0 && sys_num > 0) |
138 | 138 | sys_num -= offset; |
139 | 139 | |
140 | 140 | /* output the results */ |
141 | printf("%s\t%d\n", sys_name, sys_num); | |
141 | printf("%s\t%d\n", sys->name, sys_num); | |
142 | 142 | |
143 | 143 | /* next */ |
144 | 144 | iter++; |
145 | 145 | } |
146 | } while (sys_name != NULL); | |
146 | } while (sys->name != NULL); | |
147 | 147 | |
148 | 148 | return 0; |
149 | 149 | } |
83 | 83 | [[ -z $1 ]] && return |
84 | 84 | |
85 | 85 | [[ -n $2 ]] && offset_str="-o $2" |
86 | $LIB_SYS_DUMP -a $1 $offset_str | sed -e '/[^\t]\+\t-[0-9]\+/d' | |
86 | $LIB_SYS_DUMP -a $1 $offset_str | sed -e '/[^\t]\+\t-[0-9]\+/d' | sort | |
87 | 87 | } |
88 | 88 | |
89 | 89 | # |
165 | 165 | # Dump the architecture's syscall table to stdout. |
166 | 166 | # |
167 | 167 | function dump_sys_arm() { |
168 | # NOTE: arm_sync_file_range() and sync_file_range2() share values | |
169 | gcc -E -dM -D__ARM_EABI__ $1/arch/arm/include/uapi/asm/unistd.h | \ | |
170 | grep "^#define __\(ARM_\)*NR_" | \ | |
171 | grep -v "^#define __NR_OABI_SYSCALL_BASE" | \ | |
172 | grep -v "^#define __NR_SYSCALL_BASE" | \ | |
173 | grep -v "^#define __ARM_NR_BASE" | \ | |
174 | 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/' | \ | |
175 | while read line; do \ | |
176 | if echo "$line" | grep -q "+"; then \ | |
177 | echo "$line" | awk '{ print $1"\t"$2+$4 }'; \ | |
178 | else \ | |
179 | echo "$line"; \ | |
180 | fi; \ | |
181 | done | \ | |
182 | sed -e '/#define __NR_sync_file_range2[ \t]\+__NR_arm_sync_file_range/d' | \ | |
183 | sort | |
168 | cat $1/arch/arm/tools/syscall.tbl | grep -v "^#" | \ | |
169 | sed -ne "/[0-9]\+[ \t]\+\(common\|eabi\)/p" | \ | |
170 | awk '{ print $3"\t"$1 }' | sort | (cat -; \ | |
171 | (cat $1/arch/arm/include/uapi/asm/unistd.h | \ | |
172 | grep "^#define __ARM_NR_" | grep -v "^#define __ARM_NR_BASE" | \ | |
173 | sed -e 's/#define __ARM_NR_\([a-z0-9_]*\)[ \t]\+(__ARM_NR_BASE+\(.*\))/\1 983040 + \2/' | \ | |
174 | awk '{ print $1"\t"$2+$4 }')) | sort | |
184 | 175 | } |
185 | 176 | |
186 | 177 | # |
202 | 193 | # Dump the architecture's syscall table to stdout. |
203 | 194 | # |
204 | 195 | function dump_sys_aarch64() { |
205 | gcc -E -dM -I$1/include/uapi -D__BITS_PER_LONG=64 $1/include/uapi/asm-generic/unistd.h | \ | |
196 | gcc -E -dM -I$1/include/uapi \ | |
197 | -D__BITS_PER_LONG=64 -D__ARCH_WANT_RENAMEAT \ | |
198 | $1/include/uapi/asm-generic/unistd.h | \ | |
206 | 199 | grep "^#define __NR_" | \ |
207 | 200 | sed -e '/__NR_syscalls/d' | \ |
208 | 201 | sed -e '/__NR_arch_specific_syscall/d' | \ |
25 | 25 | #include "arch.h" |
26 | 26 | #include "arch-x32.h" |
27 | 27 | |
28 | /* NOTE: based on Linux 4.5-rc4 */ | |
28 | /* NOTE: based on Linux 4.15-rc7 */ | |
29 | 29 | const struct arch_syscall_def x32_syscall_table[] = { \ |
30 | 30 | { "_llseek", __PNR__llseek }, |
31 | 31 | { "_newselect", __PNR__newselect }, |
121 | 121 | { "get_mempolicy", (X32_SYSCALL_BIT + 239) }, |
122 | 122 | { "get_robust_list", (X32_SYSCALL_BIT + 531) }, |
123 | 123 | { "get_thread_area", __PNR_get_thread_area }, |
124 | { "get_tls", __PNR_get_tls }, | |
124 | 125 | { "getcpu", (X32_SYSCALL_BIT + 309) }, |
125 | 126 | { "getcwd", (X32_SYSCALL_BIT + 79) }, |
126 | 127 | { "getdents", (X32_SYSCALL_BIT + 78) }, |
253 | 254 | { "pipe", (X32_SYSCALL_BIT + 22) }, |
254 | 255 | { "pipe2", (X32_SYSCALL_BIT + 293) }, |
255 | 256 | { "pivot_root", (X32_SYSCALL_BIT + 155) }, |
257 | { "pkey_alloc", (X32_SYSCALL_BIT + 330) }, | |
258 | { "pkey_free", (X32_SYSCALL_BIT + 331) }, | |
259 | { "pkey_mprotect", (X32_SYSCALL_BIT + 329) }, | |
256 | 260 | { "poll", (X32_SYSCALL_BIT + 7) }, |
257 | 261 | { "ppoll", (X32_SYSCALL_BIT + 271) }, |
258 | 262 | { "prctl", (X32_SYSCALL_BIT + 157) }, |
259 | 263 | { "pread64", (X32_SYSCALL_BIT + 17) }, |
260 | 264 | { "preadv", (X32_SYSCALL_BIT + 534) }, |
265 | { "preadv2", (X32_SYSCALL_BIT + 546) }, | |
261 | 266 | { "prlimit64", (X32_SYSCALL_BIT + 302) }, |
262 | 267 | { "process_vm_readv", (X32_SYSCALL_BIT + 539) }, |
263 | 268 | { "process_vm_writev", (X32_SYSCALL_BIT + 540) }, |
268 | 273 | { "putpmsg", (X32_SYSCALL_BIT + 182) }, |
269 | 274 | { "pwrite64", (X32_SYSCALL_BIT + 18) }, |
270 | 275 | { "pwritev", (X32_SYSCALL_BIT + 535) }, |
276 | { "pwritev2", (X32_SYSCALL_BIT + 547) }, | |
271 | 277 | { "query_module", __PNR_query_module }, |
272 | 278 | { "quotactl", (X32_SYSCALL_BIT + 179) }, |
273 | 279 | { "read", (X32_SYSCALL_BIT + 0) }, |
298 | 304 | { "rt_sigtimedwait", (X32_SYSCALL_BIT + 523) }, |
299 | 305 | { "rt_tgsigqueueinfo", (X32_SYSCALL_BIT + 536) }, |
300 | 306 | { "rtas", __PNR_rtas }, |
307 | { "s390_guarded_storage", __PNR_s390_guarded_storage }, | |
301 | 308 | { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, |
302 | 309 | { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, |
303 | 310 | { "s390_runtime_instr", __PNR_s390_runtime_instr }, |
311 | { "s390_sthyi", __PNR_s390_sthyi }, | |
304 | 312 | { "sched_get_priority_max", (X32_SYSCALL_BIT + 146) }, |
305 | 313 | { "sched_get_priority_min", (X32_SYSCALL_BIT + 147) }, |
306 | 314 | { "sched_getaffinity", (X32_SYSCALL_BIT + 204) }, |
386 | 394 | { "stat64", __PNR_stat64 }, |
387 | 395 | { "statfs", (X32_SYSCALL_BIT + 137) }, |
388 | 396 | { "statfs64", __PNR_statfs64 }, |
397 | { "statx", (X32_SYSCALL_BIT + 332) }, | |
389 | 398 | { "stime", __PNR_stime }, |
390 | 399 | { "stty", __PNR_stty }, |
391 | 400 | { "subpage_prot", __PNR_subpage_prot }, |
500 | 509 | } |
501 | 510 | |
502 | 511 | /** |
503 | * Iterate through the syscall table and return the syscall name | |
512 | * Iterate through the syscall table and return the syscall mapping | |
504 | 513 | * @param spot the offset into the syscall table |
505 | 514 | * |
506 | * Return the syscall name at position @spot or NULL on failure. This function | |
507 | * should only ever be used internally by libseccomp. | |
515 | * Return the syscall mapping at position @spot or NULL on failure. This | |
516 | * function should only ever be used internally by libseccomp. | |
508 | 517 | * |
509 | 518 | */ |
510 | const char *x32_syscall_iterate_name(unsigned int spot) | |
519 | const struct arch_syscall_def *x32_syscall_iterate(unsigned int spot) | |
511 | 520 | { |
512 | 521 | /* XXX - no safety checks here */ |
513 | return x32_syscall_table[spot].name; | |
522 | return &x32_syscall_table[spot]; | |
514 | 523 | } |
33 | 33 | int x32_syscall_resolve_name(const char *name); |
34 | 34 | const char *x32_syscall_resolve_num(int num); |
35 | 35 | |
36 | const char *x32_syscall_iterate_name(unsigned int spot); | |
36 | const struct arch_syscall_def *x32_syscall_iterate(unsigned int spot); | |
37 | 37 | |
38 | 38 | #endif |
25 | 25 | #include "arch.h" |
26 | 26 | #include "arch-x86.h" |
27 | 27 | |
28 | /* NOTE: based on Linux 4.5-rc4 */ | |
28 | /* NOTE: based on Linux 4.15-rc7 */ | |
29 | 29 | const struct arch_syscall_def x86_syscall_table[] = { \ |
30 | 30 | { "_llseek", 140 }, |
31 | 31 | { "_newselect", 142 }, |
40 | 40 | { "alarm", 27 }, |
41 | 41 | { "arm_fadvise64_64", __PNR_arm_fadvise64_64 }, |
42 | 42 | { "arm_sync_file_range", __PNR_arm_sync_file_range }, |
43 | { "arch_prctl", __PNR_arch_prctl }, | |
43 | { "arch_prctl", 384 }, | |
44 | 44 | { "bdflush", 134 }, |
45 | 45 | { "bind", 361 }, |
46 | 46 | { "bpf", 357 }, |
121 | 121 | { "get_mempolicy", 275 }, |
122 | 122 | { "get_robust_list", 312 }, |
123 | 123 | { "get_thread_area", 244 }, |
124 | { "get_tls", __PNR_get_tls }, | |
124 | 125 | { "getcpu", 318 }, |
125 | 126 | { "getcwd", 183 }, |
126 | 127 | { "getdents", 141 }, |
253 | 254 | { "pipe", 42 }, |
254 | 255 | { "pipe2", 331 }, |
255 | 256 | { "pivot_root", 217 }, |
257 | { "pkey_alloc", 381 }, | |
258 | { "pkey_free", 382 }, | |
259 | { "pkey_mprotect", 380 }, | |
256 | 260 | { "poll", 168 }, |
257 | 261 | { "ppoll", 309 }, |
258 | 262 | { "prctl", 172 }, |
259 | 263 | { "pread64", 180 }, |
260 | 264 | { "preadv", 333 }, |
265 | { "preadv2", 378 }, | |
261 | 266 | { "prlimit64", 340 }, |
262 | 267 | { "process_vm_readv", 347 }, |
263 | 268 | { "process_vm_writev", 348 }, |
268 | 273 | { "putpmsg", 189 }, |
269 | 274 | { "pwrite64", 181 }, |
270 | 275 | { "pwritev", 334 }, |
276 | { "pwritev2", 379 }, | |
271 | 277 | { "query_module", 167 }, |
272 | 278 | { "quotactl", 131 }, |
273 | 279 | { "read", 3 }, |
298 | 304 | { "rt_sigtimedwait", 177 }, |
299 | 305 | { "rt_tgsigqueueinfo", 335 }, |
300 | 306 | { "rtas", __PNR_rtas }, |
307 | { "s390_guarded_storage", __PNR_s390_guarded_storage }, | |
301 | 308 | { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, |
302 | 309 | { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, |
303 | 310 | { "s390_runtime_instr", __PNR_s390_runtime_instr }, |
311 | { "s390_sthyi", __PNR_s390_sthyi }, | |
304 | 312 | { "sched_get_priority_max", 159 }, |
305 | 313 | { "sched_get_priority_min", 160 }, |
306 | 314 | { "sched_getaffinity", 242 }, |
386 | 394 | { "stat64", 195 }, |
387 | 395 | { "statfs", 99 }, |
388 | 396 | { "statfs64", 268 }, |
397 | { "statx", 383 }, | |
389 | 398 | { "stime", 25 }, |
390 | 399 | { "stty", 31 }, |
391 | 400 | { "subpage_prot", __PNR_subpage_prot }, |
584 | 593 | } |
585 | 594 | |
586 | 595 | /** |
587 | * Iterate through the syscall table and return the syscall name | |
596 | * Iterate through the syscall table and return the syscall mapping | |
588 | 597 | * @param spot the offset into the syscall table |
589 | 598 | * |
590 | * Return the syscall name at position @spot or NULL on failure. This function | |
591 | * should only ever be used internally by libseccomp. | |
599 | * Return the syscall mapping at position @spot or NULL on failure. This | |
600 | * function should only ever be used internally by libseccomp. | |
592 | 601 | * |
593 | 602 | */ |
594 | const char *x86_syscall_iterate_name(unsigned int spot) | |
603 | const struct arch_syscall_def *x86_syscall_iterate(unsigned int spot) | |
595 | 604 | { |
596 | 605 | /* XXX - no safety checks here */ |
597 | return x86_syscall_table[spot].name; | |
606 | return &x86_syscall_table[spot]; | |
598 | 607 | } |
224 | 224 | { |
225 | 225 | int rc; |
226 | 226 | unsigned int iter; |
227 | size_t args_size; | |
228 | 227 | int sys = rule->syscall; |
229 | 228 | int sys_a, sys_b; |
230 | 229 | struct db_api_rule_list *rule_a, *rule_b; |
234 | 233 | (359 to 373) : direct socket syscalls, Linux 4.3+ */ |
235 | 234 | |
236 | 235 | /* strict check for the multiplexed socket syscalls */ |
237 | for (iter = 0; iter < rule->args_cnt; iter++) { | |
236 | for (iter = 0; iter < ARG_COUNT_MAX; iter++) { | |
238 | 237 | if ((rule->args[iter].valid != 0) && (strict)) |
239 | 238 | return -EINVAL; |
240 | 239 | } |
264 | 263 | } else { |
265 | 264 | /* need two rules, dup the first and link together */ |
266 | 265 | rule_a = rule; |
267 | rule_b = malloc(sizeof(*rule_b)); | |
266 | rule_b = db_rule_dup(rule_a); | |
268 | 267 | if (rule_b == NULL) |
269 | 268 | return -ENOMEM; |
270 | args_size = sizeof(*rule_b->args) * rule_a->args_cnt; | |
271 | rule_b->args = malloc(args_size); | |
272 | if (rule_b->args == NULL) { | |
273 | free(rule_b); | |
274 | return -ENOMEM; | |
275 | } | |
276 | rule_b->action = rule_a->action; | |
277 | rule_b->syscall = rule_a->syscall; | |
278 | rule_b->args_cnt = rule_a->args_cnt; | |
279 | memcpy(rule_b->args, rule_a->args, args_size); | |
280 | 269 | rule_b->prev = rule_a; |
281 | 270 | rule_b->next = NULL; |
282 | 271 | rule_a->next = rule_b; |
32 | 32 | int x86_syscall_resolve_name(const char *name); |
33 | 33 | const char *x86_syscall_resolve_num(int num); |
34 | 34 | |
35 | const char *x86_syscall_iterate_name(unsigned int spot); | |
35 | const struct arch_syscall_def *x86_syscall_iterate(unsigned int spot); | |
36 | 36 | |
37 | 37 | int x86_syscall_rewrite(int *syscall); |
38 | 38 |
25 | 25 | #include "arch.h" |
26 | 26 | #include "arch-x86_64.h" |
27 | 27 | |
28 | /* NOTE: based on Linux 4.5-rc4 */ | |
28 | /* NOTE: based on Linux 4.15-rc7 */ | |
29 | 29 | const struct arch_syscall_def x86_64_syscall_table[] = { \ |
30 | 30 | { "_llseek", __PNR__llseek }, |
31 | 31 | { "_newselect", __PNR__newselect }, |
121 | 121 | { "get_mempolicy", 239 }, |
122 | 122 | { "get_robust_list", 274 }, |
123 | 123 | { "get_thread_area", 211 }, |
124 | { "get_tls", __PNR_get_tls }, | |
124 | 125 | { "getcpu", 309 }, |
125 | 126 | { "getcwd", 79 }, |
126 | 127 | { "getdents", 78 }, |
253 | 254 | { "pipe", 22 }, |
254 | 255 | { "pipe2", 293 }, |
255 | 256 | { "pivot_root", 155 }, |
257 | { "pkey_alloc", 330 }, | |
258 | { "pkey_free", 331 }, | |
259 | { "pkey_mprotect", 329 }, | |
256 | 260 | { "poll", 7 }, |
257 | 261 | { "ppoll", 271 }, |
258 | 262 | { "prctl", 157 }, |
259 | 263 | { "pread64", 17 }, |
260 | 264 | { "preadv", 295 }, |
265 | { "preadv2", 327 }, | |
261 | 266 | { "prlimit64", 302 }, |
262 | 267 | { "process_vm_readv", 310 }, |
263 | 268 | { "process_vm_writev", 311 }, |
268 | 273 | { "putpmsg", 182 }, |
269 | 274 | { "pwrite64", 18 }, |
270 | 275 | { "pwritev", 296 }, |
276 | { "pwritev2", 328 }, | |
271 | 277 | { "query_module", 178 }, |
272 | 278 | { "quotactl", 179 }, |
273 | 279 | { "read", 0 }, |
298 | 304 | { "rt_sigtimedwait", 128 }, |
299 | 305 | { "rt_tgsigqueueinfo", 297 }, |
300 | 306 | { "rtas", __PNR_rtas }, |
307 | { "s390_guarded_storage", __PNR_s390_guarded_storage }, | |
301 | 308 | { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read }, |
302 | 309 | { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write }, |
303 | 310 | { "s390_runtime_instr", __PNR_s390_runtime_instr }, |
311 | { "s390_sthyi", __PNR_s390_sthyi }, | |
304 | 312 | { "sched_get_priority_max", 146 }, |
305 | 313 | { "sched_get_priority_min", 147 }, |
306 | 314 | { "sched_getaffinity", 204 }, |
386 | 394 | { "stat64", __PNR_stat64 }, |
387 | 395 | { "statfs", 137 }, |
388 | 396 | { "statfs64", __PNR_statfs64 }, |
397 | { "statx", 332 }, | |
389 | 398 | { "stime", __PNR_stime }, |
390 | 399 | { "stty", __PNR_stty }, |
391 | 400 | { "subpage_prot", __PNR_subpage_prot }, |
500 | 509 | } |
501 | 510 | |
502 | 511 | /** |
503 | * Iterate through the syscall table and return the syscall name | |
512 | * Iterate through the syscall table and return the syscall mapping | |
504 | 513 | * @param spot the offset into the syscall table |
505 | 514 | * |
506 | * Return the syscall name at position @spot or NULL on failure. This function | |
507 | * should only ever be used internally by libseccomp. | |
515 | * Return the syscall mapping at position @spot or NULL on failure. This | |
516 | * function should only ever be used internally by libseccomp. | |
508 | 517 | * |
509 | 518 | */ |
510 | const char *x86_64_syscall_iterate_name(unsigned int spot) | |
519 | const struct arch_syscall_def *x86_64_syscall_iterate(unsigned int spot) | |
511 | 520 | { |
512 | 521 | /* XXX - no safety checks here */ |
513 | return x86_64_syscall_table[spot].name; | |
522 | return &x86_64_syscall_table[spot]; | |
514 | 523 | } |
515 | 524 |
31 | 31 | int x86_64_syscall_resolve_name(const char *name); |
32 | 32 | const char *x86_64_syscall_resolve_num(int num); |
33 | 33 | |
34 | const char *x86_64_syscall_iterate_name(unsigned int spot); | |
34 | const struct arch_syscall_def *x86_64_syscall_iterate(unsigned int spot); | |
35 | 35 | |
36 | 36 | #endif |
43 | 43 | #include "arch-s390x.h" |
44 | 44 | #include "db.h" |
45 | 45 | #include "system.h" |
46 | ||
47 | #define default_arg_count_max 6 | |
48 | 46 | |
49 | 47 | #define default_arg_offset(x) (offsetof(struct seccomp_data, args[x])) |
50 | 48 | |
199 | 197 | } |
200 | 198 | |
201 | 199 | /** |
202 | * Determine the maximum number of syscall arguments | |
203 | * @param arch the architecture definition | |
204 | * | |
205 | * Determine the maximum number of syscall arguments for the given architecture. | |
206 | * Returns the number of arguments on success, negative values on failure. | |
207 | * | |
208 | */ | |
209 | int arch_arg_count_max(const struct arch_def *arch) | |
210 | { | |
211 | return (arch_valid(arch->token) == 0 ? default_arg_count_max : -EDOM); | |
212 | } | |
213 | ||
214 | /** | |
215 | 200 | * Determine the argument offset for the lower 32 bits |
216 | 201 | * @param arch the architecture definition |
217 | 202 | * @param arg the argument number |
331 | 316 | int sc_num; |
332 | 317 | const char *sc_name; |
333 | 318 | |
319 | /* special handling for syscall -1 */ | |
320 | if (*syscall == -1) | |
321 | return 0; | |
322 | ||
334 | 323 | if (arch->token != arch_def_native->token) { |
335 | 324 | sc_name = arch_syscall_resolve_num(arch_def_native, *syscall); |
336 | 325 | if (sc_name == NULL) |
361 | 350 | { |
362 | 351 | int sys = *syscall; |
363 | 352 | |
364 | if (sys >= 0) { | |
353 | if (sys >= -1) { | |
365 | 354 | /* we shouldn't be here - no rewrite needed */ |
366 | 355 | return 0; |
367 | } else if (sys < 0 && sys > -100) { | |
356 | } else if (sys < -1 && sys > -100) { | |
368 | 357 | /* reserved values */ |
369 | 358 | return -EINVAL; |
370 | 359 | } else if (sys <= -100 && sys > -10000) { |
400 | 389 | */ |
401 | 390 | int arch_filter_rule_add(struct db_filter_col *col, struct db_filter *db, |
402 | 391 | bool strict, uint32_t action, int syscall, |
403 | unsigned int chain_len, struct db_api_arg *chain) | |
392 | struct db_api_arg *chain) | |
404 | 393 | { |
405 | 394 | int rc; |
406 | size_t chain_size = sizeof(*chain) * chain_len; | |
407 | 395 | struct db_api_rule_list *rule, *rule_tail; |
408 | ||
409 | /* ensure we aren't using any reserved syscall values */ | |
410 | if (syscall < 0 && syscall > -100) | |
411 | return -EINVAL; | |
412 | 396 | |
413 | 397 | /* translate the syscall */ |
414 | 398 | rc = arch_syscall_translate(db->arch, &syscall); |
419 | 403 | rule = malloc(sizeof(*rule)); |
420 | 404 | if (rule == NULL) |
421 | 405 | return -ENOMEM; |
422 | rule->args = malloc(chain_size); | |
423 | if (rule->args == NULL) { | |
424 | free(rule); | |
425 | return -ENOMEM; | |
426 | } | |
427 | 406 | rule->action = action; |
428 | 407 | rule->syscall = syscall; |
429 | rule->args_cnt = chain_len; | |
430 | memcpy(rule->args, chain, chain_size); | |
408 | memcpy(rule->args, chain, sizeof(*chain) * ARG_COUNT_MAX); | |
431 | 409 | rule->prev = NULL; |
432 | 410 | rule->next = NULL; |
433 | 411 | |
434 | 412 | /* add the new rule to the existing filter */ |
435 | if (db->arch->rule_add == NULL) { | |
436 | /* negative syscalls require a db->arch->rule_add() function */ | |
437 | if (syscall < 0 && strict) { | |
413 | if (syscall == -1 || db->arch->rule_add == NULL) { | |
414 | /* syscalls < -1 require a db->arch->rule_add() function */ | |
415 | if (syscall < -1 && strict) { | |
438 | 416 | rc = -EDOM; |
439 | 417 | goto rule_add_failure; |
440 | 418 | } |
465 | 443 | do { |
466 | 444 | rule_tail = rule; |
467 | 445 | rule = rule->next; |
468 | free(rule_tail->args); | |
469 | 446 | free(rule_tail); |
470 | 447 | } while (rule); |
471 | 448 | return rc; |
59 | 59 | /* arch_def for the current architecture */ |
60 | 60 | extern const struct arch_def *arch_def_native; |
61 | 61 | |
62 | /* NOTE: Syscall mappings can be found by running the following commands | |
63 | * on the specific architecture's include file: | |
64 | * # gcc -E -dM <file> | grep '__NR_' | |
65 | * where <file> in many cases is /usr/include/asm/unistd.h, however, | |
66 | * depending on the architecture you may need to use a different header. | |
67 | * Further, you can automatically format this list for use as a struct | |
68 | * initializer with the following command: | |
69 | * # gcc -E -dM <file> | grep '__NR_' | \ | |
70 | * sed -e 's/#define[ \t]\+__NR_//' | sort | \ | |
71 | * sed -e 's/\([^ \t]\+\)\([ \t]\+\)\([0-9]\+\)/\t{ \"\1\", \3 },/' | |
72 | * Finally, when creating a table/array of this structure, the final | |
73 | * sentinel entry should be "{ NULL, __NR_SCMP_ERROR }"; see the existing | |
74 | * tables as an example. | |
75 | */ | |
62 | /* syscall name/num mapping */ | |
76 | 63 | struct arch_syscall_def { |
77 | 64 | const char *name; |
78 | 65 | unsigned int num; |
89 | 76 | const struct arch_def *arch_def_lookup(uint32_t token); |
90 | 77 | const struct arch_def *arch_def_lookup_name(const char *arch_name); |
91 | 78 | |
92 | int arch_arg_count_max(const struct arch_def *arch); | |
93 | ||
94 | 79 | int arch_arg_offset_lo(const struct arch_def *arch, unsigned int arg); |
95 | 80 | int arch_arg_offset_hi(const struct arch_def *arch, unsigned int arg); |
96 | 81 | int arch_arg_offset(const struct arch_def *arch, unsigned int arg); |
103 | 88 | |
104 | 89 | int arch_filter_rule_add(struct db_filter_col *col, struct db_filter *db, |
105 | 90 | bool strict, uint32_t action, int syscall, |
106 | unsigned int chain_len, struct db_api_arg *chain); | |
91 | struct db_api_arg *chain); | |
107 | 92 | |
108 | 93 | #endif |
380 | 380 | r_iter = db->rules; |
381 | 381 | while (r_iter != NULL) { |
382 | 382 | db->rules = r_iter->next; |
383 | free(r_iter->args); | |
384 | 383 | free(r_iter); |
385 | 384 | r_iter = db->rules; |
386 | 385 | } |
512 | 511 | } |
513 | 512 | |
514 | 513 | /** |
514 | * Duplicate an existing filter rule | |
515 | * @param src the rule to duplicate | |
516 | * | |
517 | * This function makes an exact copy of the given rule, but does not add it | |
518 | * to any lists. Returns a pointer to the new rule on success, NULL on | |
519 | * failure. | |
520 | * | |
521 | */ | |
522 | struct db_api_rule_list *db_rule_dup(const struct db_api_rule_list *src) | |
523 | { | |
524 | struct db_api_rule_list *dest; | |
525 | ||
526 | dest = malloc(sizeof(*dest)); | |
527 | if (dest == NULL) | |
528 | return NULL; | |
529 | memcpy(dest, src, sizeof(*dest)); | |
530 | dest->prev = NULL; | |
531 | dest->next = NULL; | |
532 | ||
533 | return dest; | |
534 | } | |
535 | ||
536 | /** | |
515 | 537 | * Free and reset the seccomp filter collection |
516 | 538 | * @param col the seccomp filter collection |
517 | 539 | * @param def_action the default filter action |
547 | 569 | col->attr.act_badarch = SCMP_ACT_KILL; |
548 | 570 | col->attr.nnp_enable = 1; |
549 | 571 | col->attr.tsync_enable = 0; |
572 | col->attr.api_tskip = 0; | |
550 | 573 | |
551 | 574 | /* set the state */ |
552 | 575 | col->state = _DB_STA_VALID; |
770 | 793 | break; |
771 | 794 | case SCMP_FLTATR_CTL_TSYNC: |
772 | 795 | *value = col->attr.tsync_enable; |
796 | break; | |
797 | case SCMP_FLTATR_API_TSKIP: | |
798 | *value = col->attr.api_tskip; | |
773 | 799 | break; |
774 | 800 | default: |
775 | 801 | rc = -EEXIST; |
818 | 844 | /* unsupported */ |
819 | 845 | rc = -EOPNOTSUPP; |
820 | 846 | break; |
847 | case SCMP_FLTATR_API_TSKIP: | |
848 | col->attr.api_tskip = (value ? 1 : 0); | |
849 | break; | |
821 | 850 | default: |
822 | 851 | rc = -EEXIST; |
823 | 852 | break; |
988 | 1017 | static struct db_sys_list *_db_rule_gen_64(const struct arch_def *arch, |
989 | 1018 | uint32_t action, |
990 | 1019 | unsigned int syscall, |
991 | struct db_api_arg *chain) | |
1020 | const struct db_api_arg *chain) | |
992 | 1021 | { |
993 | 1022 | unsigned int iter; |
994 | int chain_len_max; | |
995 | 1023 | struct db_sys_list *s_new; |
996 | 1024 | struct db_arg_chain_tree *c_iter_hi = NULL, *c_iter_lo = NULL; |
997 | 1025 | struct db_arg_chain_tree *c_prev_hi = NULL, *c_prev_lo = NULL; |
1004 | 1032 | s_new->num = syscall; |
1005 | 1033 | s_new->valid = true; |
1006 | 1034 | /* run through the argument chain */ |
1007 | chain_len_max = arch_arg_count_max(arch); | |
1008 | if (chain_len_max < 0) | |
1009 | goto gen_64_failure; | |
1010 | for (iter = 0; iter < chain_len_max; iter++) { | |
1035 | for (iter = 0; iter < ARG_COUNT_MAX; iter++) { | |
1011 | 1036 | if (chain[iter].valid == 0) |
1012 | 1037 | continue; |
1013 | 1038 | |
1128 | 1153 | static struct db_sys_list *_db_rule_gen_32(const struct arch_def *arch, |
1129 | 1154 | uint32_t action, |
1130 | 1155 | unsigned int syscall, |
1131 | struct db_api_arg *chain) | |
1156 | const struct db_api_arg *chain) | |
1132 | 1157 | { |
1133 | 1158 | unsigned int iter; |
1134 | int chain_len_max; | |
1135 | 1159 | struct db_sys_list *s_new; |
1136 | 1160 | struct db_arg_chain_tree *c_iter = NULL, *c_prev = NULL; |
1137 | 1161 | bool tf_flag; |
1143 | 1167 | s_new->num = syscall; |
1144 | 1168 | s_new->valid = true; |
1145 | 1169 | /* run through the argument chain */ |
1146 | chain_len_max = arch_arg_count_max(arch); | |
1147 | if (chain_len_max < 0) | |
1148 | goto gen_32_failure; | |
1149 | for (iter = 0; iter < chain_len_max; iter++) { | |
1170 | for (iter = 0; iter < ARG_COUNT_MAX; iter++) { | |
1150 | 1171 | if (chain[iter].valid == 0) |
1151 | 1172 | continue; |
1152 | 1173 | |
1237 | 1258 | int rc = -ENOMEM; |
1238 | 1259 | int syscall = rule->syscall; |
1239 | 1260 | uint32_t action = rule->action; |
1240 | struct db_api_arg *chain = rule->args; | |
1261 | const struct db_api_arg *chain = rule->args; | |
1241 | 1262 | struct db_sys_list *s_new, *s_iter, *s_prev = NULL; |
1242 | 1263 | struct db_arg_chain_tree *c_iter = NULL, *c_prev = NULL; |
1243 | 1264 | struct db_arg_chain_tree *ec_iter; |
1519 | 1540 | if (rc_tmp < 0) |
1520 | 1541 | goto priority_failure; |
1521 | 1542 | |
1522 | /* if this is a pseudo syscall (syscall < 0) then we need to | |
1523 | * rewrite the syscall for some arch specific reason */ | |
1524 | if (sc_tmp < 0) { | |
1543 | /* if this is a pseudo syscall then we need to rewrite the | |
1544 | * syscall for some arch specific reason, don't forget the | |
1545 | * special handling for syscall -1 */ | |
1546 | if (sc_tmp < -1) { | |
1525 | 1547 | /* we set this as a strict op - we don't really care |
1526 | 1548 | * since priorities are a "best effort" thing - as we |
1527 | 1549 | * want to catch the -EDOM error and bail on this |
1567 | 1589 | { |
1568 | 1590 | int rc = 0, rc_tmp; |
1569 | 1591 | unsigned int iter; |
1570 | unsigned int chain_len; | |
1571 | 1592 | unsigned int arg_num; |
1572 | 1593 | size_t chain_size; |
1573 | 1594 | struct db_api_arg *chain = NULL; |
1574 | 1595 | struct scmp_arg_cmp arg_data; |
1575 | 1596 | |
1576 | 1597 | /* collect the arguments for the filter rule */ |
1577 | chain_len = ARG_COUNT_MAX; | |
1578 | chain_size = sizeof(*chain) * chain_len; | |
1598 | chain_size = sizeof(*chain) * ARG_COUNT_MAX; | |
1579 | 1599 | chain = malloc(chain_size); |
1580 | 1600 | if (chain == NULL) |
1581 | 1601 | return -ENOMEM; |
1583 | 1603 | for (iter = 0; iter < arg_cnt; iter++) { |
1584 | 1604 | arg_data = arg_array[iter]; |
1585 | 1605 | arg_num = arg_data.arg; |
1586 | if (arg_num < chain_len && chain[arg_num].valid == 0) { | |
1606 | if (arg_num < ARG_COUNT_MAX && chain[arg_num].valid == 0) { | |
1587 | 1607 | chain[arg_num].valid = 1; |
1588 | 1608 | chain[arg_num].arg = arg_num; |
1589 | 1609 | chain[arg_num].op = arg_data.op; |
1615 | 1635 | |
1616 | 1636 | for (iter = 0; iter < col->filter_cnt; iter++) { |
1617 | 1637 | rc_tmp = arch_filter_rule_add(col, col->filters[iter], strict, |
1618 | action, syscall, | |
1619 | chain_len, chain); | |
1638 | action, syscall, chain); | |
1620 | 1639 | if (rc == 0 && rc_tmp < 0) |
1621 | 1640 | rc = rc_tmp; |
1622 | 1641 | } |
1638 | 1657 | int db_col_transaction_start(struct db_filter_col *col) |
1639 | 1658 | { |
1640 | 1659 | unsigned int iter; |
1641 | size_t args_size; | |
1642 | 1660 | struct db_filter_snap *snap; |
1643 | 1661 | struct db_filter *filter_o, *filter_s; |
1644 | 1662 | struct db_api_rule_list *rule_o, *rule_s; |
1672 | 1690 | continue; |
1673 | 1691 | do { |
1674 | 1692 | /* copy the rule */ |
1675 | rule_s = malloc(sizeof(*rule_s)); | |
1693 | rule_s = db_rule_dup(rule_o); | |
1676 | 1694 | if (rule_s == NULL) |
1677 | 1695 | goto trans_start_failure; |
1678 | args_size = sizeof(*rule_s->args) * rule_o->args_cnt; | |
1679 | rule_s->args = malloc(args_size); | |
1680 | if (rule_s->args == NULL) { | |
1681 | free(rule_s); | |
1682 | goto trans_start_failure; | |
1683 | } | |
1684 | rule_s->action = rule_o->action; | |
1685 | rule_s->syscall = rule_o->syscall; | |
1686 | rule_s->args_cnt = rule_o->args_cnt; | |
1687 | memcpy(rule_s->args, rule_o->args, args_size); | |
1688 | 1696 | if (filter_s->rules != NULL) { |
1689 | 1697 | rule_s->prev = filter_s->rules->prev; |
1690 | 1698 | rule_s->next = filter_s->rules; |
42 | 42 | struct db_api_rule_list { |
43 | 43 | uint32_t action; |
44 | 44 | int syscall; |
45 | struct db_api_arg *args; | |
46 | unsigned int args_cnt; | |
45 | struct db_api_arg args[ARG_COUNT_MAX]; | |
47 | 46 | |
48 | 47 | struct db_api_rule_list *prev, *next; |
49 | 48 | }; |
137 | 136 | uint32_t nnp_enable; |
138 | 137 | /* SECCOMP_FILTER_FLAG_TSYNC related attributes */ |
139 | 138 | uint32_t tsync_enable; |
139 | /* allow rules with a -1 syscall value */ | |
140 | uint32_t api_tskip; | |
140 | 141 | }; |
141 | 142 | |
142 | 143 | struct db_filter { |
188 | 189 | |
189 | 190 | int db_action_valid(uint32_t action); |
190 | 191 | |
192 | struct db_api_rule_list *db_rule_dup(const struct db_api_rule_list *src); | |
193 | ||
191 | 194 | struct db_filter_col *db_col_init(uint32_t def_action); |
192 | 195 | int db_col_reset(struct db_filter_col *col, uint32_t def_action); |
193 | 196 | void db_col_release(struct db_filter_col *col); |
1352 | 1352 | /* filter out x32 */ |
1353 | 1353 | _BPF_INSTR(instr, |
1354 | 1354 | _BPF_OP(state->arch, BPF_JMP + BPF_JGE), |
1355 | _BPF_JMP_HSH(state->bad_arch_hsh), | |
1355 | _BPF_JMP_NO, | |
1356 | 1356 | _BPF_JMP_NO, |
1357 | 1357 | _BPF_K(state->arch, X32_SYSCALL_BIT)); |
1358 | 1358 | if (b_head != NULL) |
1359 | 1359 | instr.jf = _BPF_JMP_HSH(b_head->hash); |
1360 | 1360 | else |
1361 | 1361 | instr.jf = _BPF_JMP_HSH(state->def_hsh); |
1362 | b_new = _blk_append(state, b_new, &instr); | |
1363 | if (b_new == NULL) | |
1364 | goto arch_failure; | |
1365 | /* NOTE: starting with Linux v4.8 the seccomp filters | |
1366 | * are processed both when the syscall is | |
1367 | * initially executed as well as after any | |
1368 | * tracing processes finish so we need to make | |
1369 | * sure we don't trap the -1 syscall which | |
1370 | * tracers can use to skip the syscall, see | |
1371 | * seccomp(2) for more information */ | |
1372 | _BPF_INSTR(instr, | |
1373 | _BPF_OP(state->arch, BPF_JMP + BPF_JEQ), | |
1374 | _BPF_JMP_NO, | |
1375 | _BPF_JMP_HSH(state->bad_arch_hsh), | |
1376 | _BPF_K(state->arch, -1)); | |
1377 | if (b_head != NULL) | |
1378 | instr.jt = _BPF_JMP_HSH(b_head->hash); | |
1379 | else | |
1380 | instr.jt = _BPF_JMP_HSH(state->def_hsh); | |
1362 | 1381 | blk_cnt++; |
1363 | 1382 | } else if (state->arch->token == SCMP_ARCH_X32) { |
1364 | 1383 | /* filter out x86_64 */ |
0 | # Makefile.in generated by automake 1.14.1 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.15.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2017 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
31 | 31 | # along with this library; if not, see <http://www.gnu.org/licenses>. |
32 | 32 | # |
33 | 33 | VPATH = @srcdir@ |
34 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' | |
34 | am__is_gnu_make = { \ | |
35 | if test -z '$(MAKELEVEL)'; then \ | |
36 | false; \ | |
37 | elif test -n '$(MAKE_HOST)'; then \ | |
38 | true; \ | |
39 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ | |
40 | true; \ | |
41 | else \ | |
42 | false; \ | |
43 | fi; \ | |
44 | } | |
35 | 45 | am__make_running_with_option = \ |
36 | 46 | case $${target_option-} in \ |
37 | 47 | ?) ;; \ |
95 | 105 | build_triplet = @build@ |
96 | 106 | host_triplet = @host@ |
97 | 107 | subdir = src/python |
98 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am | |
99 | 108 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
100 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ | |
101 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | |
102 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | |
103 | $(top_srcdir)/configure.ac | |
109 | am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ | |
110 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | |
111 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | |
112 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac | |
104 | 113 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
105 | 114 | $(ACLOCAL_M4) |
115 | DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) | |
106 | 116 | mkinstalldirs = $(install_sh) -d |
107 | 117 | CONFIG_HEADER = $(top_builddir)/configure.h |
108 | 118 | CONFIG_CLEAN_FILES = |
127 | 137 | *) (install-info --version) >/dev/null 2>&1;; \ |
128 | 138 | esac |
129 | 139 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) |
140 | am__DIST_COMMON = $(srcdir)/Makefile.in | |
130 | 141 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
131 | 142 | ACLOCAL = @ACLOCAL@ |
132 | 143 | AMTAR = @AMTAR@ |
142 | 153 | CC = @CC@ |
143 | 154 | CCDEPMODE = @CCDEPMODE@ |
144 | 155 | CFLAGS = @CFLAGS@ |
156 | CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ | |
157 | CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ | |
158 | CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ | |
159 | CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ | |
160 | CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ | |
161 | CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ | |
145 | 162 | CPP = @CPP@ |
146 | 163 | CPPFLAGS = @CPPFLAGS@ |
147 | 164 | CYGPATH_W = @CYGPATH_W@ |
156 | 173 | EGREP = @EGREP@ |
157 | 174 | EXEEXT = @EXEEXT@ |
158 | 175 | FGREP = @FGREP@ |
176 | GCOV = @GCOV@ | |
177 | GENHTML = @GENHTML@ | |
159 | 178 | GREP = @GREP@ |
160 | 179 | INSTALL = @INSTALL@ |
161 | 180 | INSTALL_DATA = @INSTALL_DATA@ |
162 | 181 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
163 | 182 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
164 | 183 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
184 | LCOV = @LCOV@ | |
165 | 185 | LD = @LD@ |
166 | 186 | LDFLAGS = @LDFLAGS@ |
167 | 187 | LIBOBJS = @LIBOBJS@ |
282 | 302 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/python/Makefile'; \ |
283 | 303 | $(am__cd) $(top_srcdir) && \ |
284 | 304 | $(AUTOMAKE) --foreign src/python/Makefile |
285 | .PRECIOUS: Makefile | |
286 | 305 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
287 | 306 | @case '$?' in \ |
288 | 307 | *config.status*) \ |
458 | 477 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ |
459 | 478 | tags-am uninstall uninstall-am |
460 | 479 | |
480 | .PRECIOUS: Makefile | |
481 | ||
461 | 482 | |
462 | 483 | all-local: build |
463 | 484 |
53 | 53 | SCMP_FLTATR_ACT_BADARCH |
54 | 54 | SCMP_FLTATR_CTL_NNP |
55 | 55 | SCMP_FLTATR_CTL_TSYNC |
56 | SCMP_FLTATR_API_TSKIP | |
56 | 57 | |
57 | 58 | cdef enum scmp_compare: |
58 | 59 | SCMP_CMP_NE |
0 | 0 | # |
1 | 1 | # Seccomp Library Python Bindings |
2 | 2 | # |
3 | # Copyright (c) 2012,2013 Red Hat <pmoore@redhat.com> | |
3 | # Copyright (c) 2012,2013,2017 Red Hat <pmoore@redhat.com> | |
4 | 4 | # Author: Paul Moore <paul@paul-moore.com> |
5 | 5 | # |
6 | 6 | |
67 | 67 | f.load() |
68 | 68 | """ |
69 | 69 | __author__ = 'Paul Moore <paul@paul-moore.com>' |
70 | __date__ = "7 January 2013" | |
71 | ||
70 | __date__ = "3 February 2017" | |
71 | ||
72 | from cpython.version cimport PY_MAJOR_VERSION | |
72 | 73 | from libc.stdint cimport uint32_t |
73 | 74 | import errno |
74 | 75 | |
75 | 76 | cimport libseccomp |
77 | ||
78 | def c_str(string): | |
79 | """ Convert a Python string to a C string. | |
80 | ||
81 | Arguments: | |
82 | string - the Python string | |
83 | ||
84 | Description: | |
85 | Convert the Python string into a form usable by C taking into consideration | |
86 | the Python major version, e.g. Python 2.x or Python 3.x. | |
87 | See http://docs.cython.org/en/latest/src/tutorial/strings.html for more | |
88 | information. | |
89 | """ | |
90 | if PY_MAJOR_VERSION < 3: | |
91 | return string | |
92 | else: | |
93 | return bytes(string, "ascii") | |
76 | 94 | |
77 | 95 | KILL = libseccomp.SCMP_ACT_KILL |
78 | 96 | TRAP = libseccomp.SCMP_ACT_TRAP |
120 | 138 | cdef char *ret_str |
121 | 139 | |
122 | 140 | if isinstance(syscall, basestring): |
123 | return libseccomp.seccomp_syscall_resolve_name_rewrite(arch, syscall) | |
141 | return libseccomp.seccomp_syscall_resolve_name_rewrite(arch, | |
142 | c_str(syscall)) | |
124 | 143 | elif isinstance(syscall, int): |
125 | 144 | ret_str = libseccomp.seccomp_syscall_resolve_num_arch(arch, syscall) |
126 | 145 | if ret_str is NULL: |
217 | 236 | else: |
218 | 237 | self._token = 0; |
219 | 238 | elif isinstance(arch, basestring): |
220 | self._token = libseccomp.seccomp_arch_resolve_name(arch) | |
239 | self._token = libseccomp.seccomp_arch_resolve_name(c_str(arch)) | |
221 | 240 | else: |
222 | 241 | raise TypeError("Architecture must be an int or str type") |
223 | 242 | if self._token == 0: |
245 | 264 | ACT_BADARCH = libseccomp.SCMP_FLTATR_ACT_BADARCH |
246 | 265 | CTL_NNP = libseccomp.SCMP_FLTATR_CTL_NNP |
247 | 266 | CTL_TSYNC = libseccomp.SCMP_FLTATR_CTL_TSYNC |
267 | API_TSKIP = libseccomp.SCMP_FLTATR_API_TSKIP | |
248 | 268 | |
249 | 269 | cdef class Arg: |
250 | 270 | """ Python object representing a SyscallFilter syscall argument. |
40 | 40 | |
41 | 41 | sys_num = resolve_syscall(Arch(), "open") |
42 | 42 | sys_name = resolve_syscall(Arch(), sys_num) |
43 | if (sys_name != "open"): | |
43 | if (sys_name != b"open"): | |
44 | 44 | raise RuntimeError("Test failure") |
45 | 45 | sys_num = resolve_syscall(Arch(), "read") |
46 | 46 | sys_name = resolve_syscall(Arch(), sys_num) |
47 | if (sys_name != "read"): | |
47 | if (sys_name != b"read"): | |
48 | 48 | raise RuntimeError("Test failure") |
49 | 49 | |
50 | 50 | test() |
32 | 32 | if action == TRAP: |
33 | 33 | util.install_trap() |
34 | 34 | f = SyscallFilter(action) |
35 | f.add_rule(ALLOW, "getpid") | |
35 | 36 | f.add_rule(ALLOW, "rt_sigreturn") |
36 | 37 | f.add_rule(ALLOW, "sigreturn") |
37 | 38 | f.add_rule(ALLOW, "exit_group") |
46 | 46 | f.add_rule(ALLOW, "rt_sigaction") |
47 | 47 | f.add_rule(ALLOW, "rt_sigreturn") |
48 | 48 | f.add_rule(ALLOW, "sigreturn") |
49 | f.add_rule(ALLOW, "sigaltstack") | |
49 | 50 | f.add_rule(ALLOW, "brk") |
50 | 51 | f.add_rule(ALLOW, "exit_group") |
51 | 52 | f.load() |
53 | ||
52 | 54 | try: |
53 | 55 | util.write_file("/dev/null") |
54 | 56 | except OSError as ex: |
34 | 34 | quit(1) |
35 | 35 | util.install_trap() |
36 | 36 | |
37 | fd = os.open("/dev/null", os.O_WRONLY|os.O_CREAT, 0600) | |
37 | fd = os.open("/dev/null", os.O_WRONLY|os.O_CREAT) | |
38 | 38 | |
39 | 39 | f = SyscallFilter(TRAP) |
40 | 40 | # NOTE: additional syscalls required for python |
42 | 42 | f.add_rule(ALLOW, "close") |
43 | 43 | f.add_rule(ALLOW, "rt_sigaction") |
44 | 44 | f.add_rule(ALLOW, "rt_sigreturn") |
45 | f.add_rule(ALLOW, "sigaltstack") | |
45 | 46 | f.add_rule(ALLOW, "exit_group") |
46 | 47 | f.add_rule(ALLOW, "brk") |
47 | 48 | f.load() |
48 | 49 | |
49 | 50 | try: |
50 | if not os.write(fd, "testing") == len("testing"): | |
51 | if not os.write(fd, b"testing") == len("testing"): | |
51 | 52 | raise IOError("failed to write the full test string") |
52 | 53 | quit(160) |
53 | 54 | except OSError as ex: |
47 | 47 | f.add_rule(ALLOW, "rt_sigaction") |
48 | 48 | f.add_rule(ALLOW, "rt_sigreturn") |
49 | 49 | f.add_rule(ALLOW, "sigreturn") |
50 | f.add_rule(ALLOW, "sigaltstack") | |
50 | 51 | f.add_rule(ALLOW, "brk") |
51 | 52 | f.add_rule(ALLOW, "exit_group") |
52 | 53 | f.load() |
0 | /** | |
1 | * Seccomp Library test program | |
2 | * | |
3 | * Copyright (c) 2017 Red Hat <pmoore@redhat.com> | |
4 | * Author: Paul Moore <paul@paul-moore.com> | |
5 | */ | |
6 | ||
7 | /* | |
8 | * This library is free software; you can redistribute it and/or modify it | |
9 | * under the terms of version 2.1 of the GNU Lesser General Public License as | |
10 | * published by the Free Software Foundation. | |
11 | * | |
12 | * This library is distributed in the hope that it will be useful, but WITHOUT | |
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | |
15 | * for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU Lesser General Public License | |
18 | * along with this library; if not, see <http://www.gnu.org/licenses>. | |
19 | */ | |
20 | ||
21 | /* | |
22 | * Just like mode 1 seccomp we allow 4 syscalls: | |
23 | * read, write, exit, and rt_sigreturn | |
24 | */ | |
25 | ||
26 | #include <errno.h> | |
27 | #include <unistd.h> | |
28 | ||
29 | #include <seccomp.h> | |
30 | ||
31 | #include "util.h" | |
32 | ||
33 | int main(int argc, char *argv[]) | |
34 | { | |
35 | int rc; | |
36 | struct util_options opts; | |
37 | scmp_filter_ctx ctx = NULL; | |
38 | ||
39 | rc = util_getopt(argc, argv, &opts); | |
40 | if (rc < 0) | |
41 | goto out; | |
42 | ||
43 | ctx = seccomp_init(SCMP_ACT_KILL); | |
44 | if (ctx == NULL) | |
45 | return ENOMEM; | |
46 | ||
47 | rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE); | |
48 | if (rc != 0) | |
49 | goto out; | |
50 | ||
51 | rc = seccomp_arch_add(ctx, SCMP_ARCH_X86); | |
52 | if (rc != 0) | |
53 | goto out; | |
54 | rc = seccomp_arch_add(ctx, SCMP_ARCH_X86_64); | |
55 | if (rc != 0) | |
56 | goto out; | |
57 | ||
58 | rc = seccomp_attr_set(ctx, SCMP_FLTATR_API_TSKIP, 1); | |
59 | if (rc != 0) | |
60 | goto out; | |
61 | ||
62 | rc = seccomp_syscall_priority(ctx, -1, 100); | |
63 | if (rc != 0) | |
64 | goto out; | |
65 | ||
66 | rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, -1, 0); | |
67 | if (rc != 0) | |
68 | goto out; | |
69 | ||
70 | rc = util_filter_output(&opts, ctx); | |
71 | if (rc) | |
72 | goto out; | |
73 | ||
74 | out: | |
75 | seccomp_release(ctx); | |
76 | return (rc < 0 ? -rc : rc); | |
77 | } |
0 | #!/usr/bin/env python | |
1 | ||
2 | # | |
3 | # Seccomp Library test program | |
4 | # | |
5 | # Copyright (c) 2017 Red Hat <pmoore@redhat.com> | |
6 | # Author: Paul Moore <paul@paul-moore.com> | |
7 | # | |
8 | ||
9 | # | |
10 | # This library is free software; you can redistribute it and/or modify it | |
11 | # under the terms of version 2.1 of the GNU Lesser General Public License as | |
12 | # published by the Free Software Foundation. | |
13 | # | |
14 | # This library is distributed in the hope that it will be useful, but WITHOUT | |
15 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | |
17 | # for more details. | |
18 | # | |
19 | # You should have received a copy of the GNU Lesser General Public License | |
20 | # along with this library; if not, see <http://www.gnu.org/licenses>. | |
21 | # | |
22 | ||
23 | import argparse | |
24 | import sys | |
25 | ||
26 | import util | |
27 | ||
28 | from seccomp import * | |
29 | ||
30 | def test(args): | |
31 | f = SyscallFilter(KILL) | |
32 | f.remove_arch(Arch()) | |
33 | f.add_arch(Arch("x86")) | |
34 | f.add_arch(Arch("x86_64")) | |
35 | f.set_attr(Attr.API_TSKIP, 1) | |
36 | f.syscall_priority(-1, 100) | |
37 | f.add_rule(ALLOW, -1) | |
38 | return f | |
39 | ||
40 | args = util.get_opt() | |
41 | ctx = test(args) | |
42 | util.filter_output(args, ctx) | |
43 | ||
44 | # kate: syntax python; | |
45 | # kate: indent-mode python; space-indent on; indent-width 4; mixedindent off; |
0 | # | |
1 | # libseccomp regression test automation data | |
2 | # | |
3 | # Copyright (c) 2017 Red Hat <pmoore@redhat.com> | |
4 | # Author: Paul Moore <paul@paul-moore.com> | |
5 | # | |
6 | ||
7 | test type: bpf-sim | |
8 | ||
9 | # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result | |
10 | 35-sim-negative_one +x86 -1 N N N N N N ALLOW | |
11 | 35-sim-negative_one +x86_64 -1 N N N N N N ALLOW | |
12 | 35-sim-negative_one +x32 -1 N N N N N N ALLOW | |
13 | ||
14 | test type: bpf-valgrind | |
15 | ||
16 | # Testname | |
17 | 35-sim-negative_one |
15 | 15 | # along with this library; if not, see <http://www.gnu.org/licenses>. |
16 | 16 | # |
17 | 17 | |
18 | AM_LDFLAGS = -static | |
19 | LDADD = util.la ../src/libseccomp.la | |
18 | @CODE_COVERAGE_RULES@ | |
19 | ||
20 | if CODE_COVERAGE_ENABLED | |
21 | DBG_STATIC = | |
22 | else | |
23 | DBG_STATIC = -static | |
24 | endif | |
25 | ||
26 | AM_LDFLAGS = ${DBG_STATIC} | |
27 | ||
28 | LDADD = util.la ../src/libseccomp.la ${CODE_COVERAGE_LIBS} | |
20 | 29 | |
21 | 30 | check_LTLIBRARIES = util.la |
22 | 31 | util_la_SOURCES = util.c util.h |
60 | 69 | 30-sim-socket_syscalls \ |
61 | 70 | 31-basic-version_check \ |
62 | 71 | 32-live-tsync_allow \ |
63 | 33-sim-socket_syscalls_be | |
72 | 33-sim-socket_syscalls_be \ | |
73 | 35-sim-negative_one | |
64 | 74 | |
65 | 75 | EXTRA_DIST_TESTPYTHON = \ |
66 | 76 | util.py \ |
96 | 106 | 30-sim-socket_syscalls.py \ |
97 | 107 | 31-basic-version_check.py \ |
98 | 108 | 32-live-tsync_allow.py \ |
99 | 33-sim-socket_syscalls_be.py | |
109 | 33-sim-socket_syscalls_be.py \ | |
110 | 35-sim-negative_one.py | |
100 | 111 | |
101 | 112 | EXTRA_DIST_TESTCFGS = \ |
102 | 113 | 01-sim-allow.tests \ |
131 | 142 | 30-sim-socket_syscalls.tests \ |
132 | 143 | 31-basic-version_check.tests \ |
133 | 144 | 32-live-tsync_allow.tests \ |
134 | 33-sim-socket_syscalls_be.tests | |
145 | 33-sim-socket_syscalls_be.tests \ | |
146 | 35-sim-negative_one.tests | |
135 | 147 | |
136 | 148 | EXTRA_DIST_TESTSCRIPTS = regression testdiff testgen |
137 | 149 |
0 | # Makefile.in generated by automake 1.14.1 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.15.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2017 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
31 | 31 | # along with this library; if not, see <http://www.gnu.org/licenses>. |
32 | 32 | # |
33 | 33 | VPATH = @srcdir@ |
34 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' | |
34 | am__is_gnu_make = { \ | |
35 | if test -z '$(MAKELEVEL)'; then \ | |
36 | false; \ | |
37 | elif test -n '$(MAKE_HOST)'; then \ | |
38 | true; \ | |
39 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ | |
40 | true; \ | |
41 | else \ | |
42 | false; \ | |
43 | fi; \ | |
44 | } | |
35 | 45 | am__make_running_with_option = \ |
36 | 46 | case $${target_option-} in \ |
37 | 47 | ?) ;; \ |
115 | 125 | 27-sim-bpf_blk_state$(EXEEXT) 28-sim-arch_x86$(EXEEXT) \ |
116 | 126 | 29-sim-pseudo_syscall$(EXEEXT) 30-sim-socket_syscalls$(EXEEXT) \ |
117 | 127 | 31-basic-version_check$(EXEEXT) 32-live-tsync_allow$(EXEEXT) \ |
118 | 33-sim-socket_syscalls_be$(EXEEXT) | |
128 | 33-sim-socket_syscalls_be$(EXEEXT) \ | |
129 | 35-sim-negative_one$(EXEEXT) | |
119 | 130 | EXTRA_PROGRAMS = 00-test$(EXEEXT) |
120 | 131 | subdir = tests |
121 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ | |
122 | $(top_srcdir)/build-aux/depcomp | |
123 | 132 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
124 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ | |
125 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | |
126 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | |
127 | $(top_srcdir)/configure.ac | |
133 | am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ | |
134 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | |
135 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | |
136 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac | |
128 | 137 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
129 | 138 | $(ACLOCAL_M4) |
139 | DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) | |
130 | 140 | mkinstalldirs = $(install_sh) -d |
131 | 141 | CONFIG_HEADER = $(top_builddir)/configure.h |
132 | 142 | CONFIG_CLEAN_FILES = |
144 | 154 | nodist_00_test_OBJECTS = 00-test.$(OBJEXT) |
145 | 155 | 00_test_OBJECTS = $(nodist_00_test_OBJECTS) |
146 | 156 | 00_test_LDADD = $(LDADD) |
147 | 00_test_DEPENDENCIES = util.la ../src/libseccomp.la | |
157 | am__DEPENDENCIES_1 = | |
158 | 00_test_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
159 | $(am__DEPENDENCIES_1) | |
148 | 160 | 01_sim_allow_SOURCES = 01-sim-allow.c |
149 | 161 | 01_sim_allow_OBJECTS = 01-sim-allow.$(OBJEXT) |
150 | 162 | 01_sim_allow_LDADD = $(LDADD) |
151 | 01_sim_allow_DEPENDENCIES = util.la ../src/libseccomp.la | |
163 | 01_sim_allow_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
164 | $(am__DEPENDENCIES_1) | |
152 | 165 | 02_sim_basic_SOURCES = 02-sim-basic.c |
153 | 166 | 02_sim_basic_OBJECTS = 02-sim-basic.$(OBJEXT) |
154 | 167 | 02_sim_basic_LDADD = $(LDADD) |
155 | 02_sim_basic_DEPENDENCIES = util.la ../src/libseccomp.la | |
168 | 02_sim_basic_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
169 | $(am__DEPENDENCIES_1) | |
156 | 170 | 03_sim_basic_chains_SOURCES = 03-sim-basic_chains.c |
157 | 171 | 03_sim_basic_chains_OBJECTS = 03-sim-basic_chains.$(OBJEXT) |
158 | 172 | 03_sim_basic_chains_LDADD = $(LDADD) |
159 | 03_sim_basic_chains_DEPENDENCIES = util.la ../src/libseccomp.la | |
173 | 03_sim_basic_chains_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
174 | $(am__DEPENDENCIES_1) | |
160 | 175 | 04_sim_multilevel_chains_SOURCES = 04-sim-multilevel_chains.c |
161 | 176 | 04_sim_multilevel_chains_OBJECTS = 04-sim-multilevel_chains.$(OBJEXT) |
162 | 177 | 04_sim_multilevel_chains_LDADD = $(LDADD) |
163 | 04_sim_multilevel_chains_DEPENDENCIES = util.la ../src/libseccomp.la | |
178 | 04_sim_multilevel_chains_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
179 | $(am__DEPENDENCIES_1) | |
164 | 180 | 05_sim_long_jumps_SOURCES = 05-sim-long_jumps.c |
165 | 181 | 05_sim_long_jumps_OBJECTS = 05-sim-long_jumps.$(OBJEXT) |
166 | 182 | 05_sim_long_jumps_LDADD = $(LDADD) |
167 | 05_sim_long_jumps_DEPENDENCIES = util.la ../src/libseccomp.la | |
183 | 05_sim_long_jumps_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
184 | $(am__DEPENDENCIES_1) | |
168 | 185 | 06_sim_actions_SOURCES = 06-sim-actions.c |
169 | 186 | 06_sim_actions_OBJECTS = 06-sim-actions.$(OBJEXT) |
170 | 187 | 06_sim_actions_LDADD = $(LDADD) |
171 | 06_sim_actions_DEPENDENCIES = util.la ../src/libseccomp.la | |
188 | 06_sim_actions_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
189 | $(am__DEPENDENCIES_1) | |
172 | 190 | 07_sim_db_bug_looping_SOURCES = 07-sim-db_bug_looping.c |
173 | 191 | 07_sim_db_bug_looping_OBJECTS = 07-sim-db_bug_looping.$(OBJEXT) |
174 | 192 | 07_sim_db_bug_looping_LDADD = $(LDADD) |
175 | 07_sim_db_bug_looping_DEPENDENCIES = util.la ../src/libseccomp.la | |
193 | 07_sim_db_bug_looping_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
194 | $(am__DEPENDENCIES_1) | |
176 | 195 | 08_sim_subtree_checks_SOURCES = 08-sim-subtree_checks.c |
177 | 196 | 08_sim_subtree_checks_OBJECTS = 08-sim-subtree_checks.$(OBJEXT) |
178 | 197 | 08_sim_subtree_checks_LDADD = $(LDADD) |
179 | 08_sim_subtree_checks_DEPENDENCIES = util.la ../src/libseccomp.la | |
198 | 08_sim_subtree_checks_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
199 | $(am__DEPENDENCIES_1) | |
180 | 200 | 09_sim_syscall_priority_pre_SOURCES = 09-sim-syscall_priority_pre.c |
181 | 201 | 09_sim_syscall_priority_pre_OBJECTS = \ |
182 | 202 | 09-sim-syscall_priority_pre.$(OBJEXT) |
183 | 203 | 09_sim_syscall_priority_pre_LDADD = $(LDADD) |
184 | 204 | 09_sim_syscall_priority_pre_DEPENDENCIES = util.la \ |
185 | ../src/libseccomp.la | |
205 | ../src/libseccomp.la $(am__DEPENDENCIES_1) | |
186 | 206 | 10_sim_syscall_priority_post_SOURCES = 10-sim-syscall_priority_post.c |
187 | 207 | 10_sim_syscall_priority_post_OBJECTS = \ |
188 | 208 | 10-sim-syscall_priority_post.$(OBJEXT) |
189 | 209 | 10_sim_syscall_priority_post_LDADD = $(LDADD) |
190 | 210 | 10_sim_syscall_priority_post_DEPENDENCIES = util.la \ |
191 | ../src/libseccomp.la | |
211 | ../src/libseccomp.la $(am__DEPENDENCIES_1) | |
192 | 212 | 11_basic_basic_errors_SOURCES = 11-basic-basic_errors.c |
193 | 213 | 11_basic_basic_errors_OBJECTS = 11-basic-basic_errors.$(OBJEXT) |
194 | 214 | 11_basic_basic_errors_LDADD = $(LDADD) |
195 | 11_basic_basic_errors_DEPENDENCIES = util.la ../src/libseccomp.la | |
215 | 11_basic_basic_errors_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
216 | $(am__DEPENDENCIES_1) | |
196 | 217 | 12_sim_basic_masked_ops_SOURCES = 12-sim-basic_masked_ops.c |
197 | 218 | 12_sim_basic_masked_ops_OBJECTS = 12-sim-basic_masked_ops.$(OBJEXT) |
198 | 219 | 12_sim_basic_masked_ops_LDADD = $(LDADD) |
199 | 12_sim_basic_masked_ops_DEPENDENCIES = util.la ../src/libseccomp.la | |
220 | 12_sim_basic_masked_ops_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
221 | $(am__DEPENDENCIES_1) | |
200 | 222 | 13_basic_attrs_SOURCES = 13-basic-attrs.c |
201 | 223 | 13_basic_attrs_OBJECTS = 13-basic-attrs.$(OBJEXT) |
202 | 224 | 13_basic_attrs_LDADD = $(LDADD) |
203 | 13_basic_attrs_DEPENDENCIES = util.la ../src/libseccomp.la | |
225 | 13_basic_attrs_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
226 | $(am__DEPENDENCIES_1) | |
204 | 227 | 14_sim_reset_SOURCES = 14-sim-reset.c |
205 | 228 | 14_sim_reset_OBJECTS = 14-sim-reset.$(OBJEXT) |
206 | 229 | 14_sim_reset_LDADD = $(LDADD) |
207 | 14_sim_reset_DEPENDENCIES = util.la ../src/libseccomp.la | |
230 | 14_sim_reset_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
231 | $(am__DEPENDENCIES_1) | |
208 | 232 | 15_basic_resolver_SOURCES = 15-basic-resolver.c |
209 | 233 | 15_basic_resolver_OBJECTS = 15-basic-resolver.$(OBJEXT) |
210 | 234 | 15_basic_resolver_LDADD = $(LDADD) |
211 | 15_basic_resolver_DEPENDENCIES = util.la ../src/libseccomp.la | |
235 | 15_basic_resolver_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
236 | $(am__DEPENDENCIES_1) | |
212 | 237 | 16_sim_arch_basic_SOURCES = 16-sim-arch_basic.c |
213 | 238 | 16_sim_arch_basic_OBJECTS = 16-sim-arch_basic.$(OBJEXT) |
214 | 239 | 16_sim_arch_basic_LDADD = $(LDADD) |
215 | 16_sim_arch_basic_DEPENDENCIES = util.la ../src/libseccomp.la | |
240 | 16_sim_arch_basic_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
241 | $(am__DEPENDENCIES_1) | |
216 | 242 | 17_sim_arch_merge_SOURCES = 17-sim-arch_merge.c |
217 | 243 | 17_sim_arch_merge_OBJECTS = 17-sim-arch_merge.$(OBJEXT) |
218 | 244 | 17_sim_arch_merge_LDADD = $(LDADD) |
219 | 17_sim_arch_merge_DEPENDENCIES = util.la ../src/libseccomp.la | |
245 | 17_sim_arch_merge_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
246 | $(am__DEPENDENCIES_1) | |
220 | 247 | 18_sim_basic_whitelist_SOURCES = 18-sim-basic_whitelist.c |
221 | 248 | 18_sim_basic_whitelist_OBJECTS = 18-sim-basic_whitelist.$(OBJEXT) |
222 | 249 | 18_sim_basic_whitelist_LDADD = $(LDADD) |
223 | 18_sim_basic_whitelist_DEPENDENCIES = util.la ../src/libseccomp.la | |
250 | 18_sim_basic_whitelist_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
251 | $(am__DEPENDENCIES_1) | |
224 | 252 | 19_sim_missing_syscalls_SOURCES = 19-sim-missing_syscalls.c |
225 | 253 | 19_sim_missing_syscalls_OBJECTS = 19-sim-missing_syscalls.$(OBJEXT) |
226 | 254 | 19_sim_missing_syscalls_LDADD = $(LDADD) |
227 | 19_sim_missing_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la | |
255 | 19_sim_missing_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
256 | $(am__DEPENDENCIES_1) | |
228 | 257 | 20_live_basic_die_SOURCES = 20-live-basic_die.c |
229 | 258 | 20_live_basic_die_OBJECTS = 20-live-basic_die.$(OBJEXT) |
230 | 259 | 20_live_basic_die_LDADD = $(LDADD) |
231 | 20_live_basic_die_DEPENDENCIES = util.la ../src/libseccomp.la | |
260 | 20_live_basic_die_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
261 | $(am__DEPENDENCIES_1) | |
232 | 262 | 21_live_basic_allow_SOURCES = 21-live-basic_allow.c |
233 | 263 | 21_live_basic_allow_OBJECTS = 21-live-basic_allow.$(OBJEXT) |
234 | 264 | 21_live_basic_allow_LDADD = $(LDADD) |
235 | 21_live_basic_allow_DEPENDENCIES = util.la ../src/libseccomp.la | |
265 | 21_live_basic_allow_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
266 | $(am__DEPENDENCIES_1) | |
236 | 267 | 22_sim_basic_chains_array_SOURCES = 22-sim-basic_chains_array.c |
237 | 268 | 22_sim_basic_chains_array_OBJECTS = \ |
238 | 269 | 22-sim-basic_chains_array.$(OBJEXT) |
239 | 270 | 22_sim_basic_chains_array_LDADD = $(LDADD) |
240 | 22_sim_basic_chains_array_DEPENDENCIES = util.la ../src/libseccomp.la | |
271 | 22_sim_basic_chains_array_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
272 | $(am__DEPENDENCIES_1) | |
241 | 273 | 23_sim_arch_all_le_basic_SOURCES = 23-sim-arch_all_le_basic.c |
242 | 274 | 23_sim_arch_all_le_basic_OBJECTS = 23-sim-arch_all_le_basic.$(OBJEXT) |
243 | 275 | 23_sim_arch_all_le_basic_LDADD = $(LDADD) |
244 | 23_sim_arch_all_le_basic_DEPENDENCIES = util.la ../src/libseccomp.la | |
276 | 23_sim_arch_all_le_basic_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
277 | $(am__DEPENDENCIES_1) | |
245 | 278 | 24_live_arg_allow_SOURCES = 24-live-arg_allow.c |
246 | 279 | 24_live_arg_allow_OBJECTS = 24-live-arg_allow.$(OBJEXT) |
247 | 280 | 24_live_arg_allow_LDADD = $(LDADD) |
248 | 24_live_arg_allow_DEPENDENCIES = util.la ../src/libseccomp.la | |
281 | 24_live_arg_allow_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
282 | $(am__DEPENDENCIES_1) | |
249 | 283 | 25_sim_multilevel_chains_adv_SOURCES = 25-sim-multilevel_chains_adv.c |
250 | 284 | 25_sim_multilevel_chains_adv_OBJECTS = \ |
251 | 285 | 25-sim-multilevel_chains_adv.$(OBJEXT) |
252 | 286 | 25_sim_multilevel_chains_adv_LDADD = $(LDADD) |
253 | 287 | 25_sim_multilevel_chains_adv_DEPENDENCIES = util.la \ |
254 | ../src/libseccomp.la | |
288 | ../src/libseccomp.la $(am__DEPENDENCIES_1) | |
255 | 289 | 26_sim_arch_all_be_basic_SOURCES = 26-sim-arch_all_be_basic.c |
256 | 290 | 26_sim_arch_all_be_basic_OBJECTS = 26-sim-arch_all_be_basic.$(OBJEXT) |
257 | 291 | 26_sim_arch_all_be_basic_LDADD = $(LDADD) |
258 | 26_sim_arch_all_be_basic_DEPENDENCIES = util.la ../src/libseccomp.la | |
292 | 26_sim_arch_all_be_basic_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
293 | $(am__DEPENDENCIES_1) | |
259 | 294 | 27_sim_bpf_blk_state_SOURCES = 27-sim-bpf_blk_state.c |
260 | 295 | 27_sim_bpf_blk_state_OBJECTS = 27-sim-bpf_blk_state.$(OBJEXT) |
261 | 296 | 27_sim_bpf_blk_state_LDADD = $(LDADD) |
262 | 27_sim_bpf_blk_state_DEPENDENCIES = util.la ../src/libseccomp.la | |
297 | 27_sim_bpf_blk_state_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
298 | $(am__DEPENDENCIES_1) | |
263 | 299 | 28_sim_arch_x86_SOURCES = 28-sim-arch_x86.c |
264 | 300 | 28_sim_arch_x86_OBJECTS = 28-sim-arch_x86.$(OBJEXT) |
265 | 301 | 28_sim_arch_x86_LDADD = $(LDADD) |
266 | 28_sim_arch_x86_DEPENDENCIES = util.la ../src/libseccomp.la | |
302 | 28_sim_arch_x86_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
303 | $(am__DEPENDENCIES_1) | |
267 | 304 | 29_sim_pseudo_syscall_SOURCES = 29-sim-pseudo_syscall.c |
268 | 305 | 29_sim_pseudo_syscall_OBJECTS = 29-sim-pseudo_syscall.$(OBJEXT) |
269 | 306 | 29_sim_pseudo_syscall_LDADD = $(LDADD) |
270 | 29_sim_pseudo_syscall_DEPENDENCIES = util.la ../src/libseccomp.la | |
307 | 29_sim_pseudo_syscall_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
308 | $(am__DEPENDENCIES_1) | |
271 | 309 | 30_sim_socket_syscalls_SOURCES = 30-sim-socket_syscalls.c |
272 | 310 | 30_sim_socket_syscalls_OBJECTS = 30-sim-socket_syscalls.$(OBJEXT) |
273 | 311 | 30_sim_socket_syscalls_LDADD = $(LDADD) |
274 | 30_sim_socket_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la | |
312 | 30_sim_socket_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
313 | $(am__DEPENDENCIES_1) | |
275 | 314 | 31_basic_version_check_SOURCES = 31-basic-version_check.c |
276 | 315 | 31_basic_version_check_OBJECTS = 31-basic-version_check.$(OBJEXT) |
277 | 316 | 31_basic_version_check_LDADD = $(LDADD) |
278 | 31_basic_version_check_DEPENDENCIES = util.la ../src/libseccomp.la | |
317 | 31_basic_version_check_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
318 | $(am__DEPENDENCIES_1) | |
279 | 319 | 32_live_tsync_allow_SOURCES = 32-live-tsync_allow.c |
280 | 320 | 32_live_tsync_allow_OBJECTS = 32-live-tsync_allow.$(OBJEXT) |
281 | 321 | 32_live_tsync_allow_LDADD = $(LDADD) |
282 | 32_live_tsync_allow_DEPENDENCIES = util.la ../src/libseccomp.la | |
322 | 32_live_tsync_allow_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
323 | $(am__DEPENDENCIES_1) | |
283 | 324 | 33_sim_socket_syscalls_be_SOURCES = 33-sim-socket_syscalls_be.c |
284 | 325 | 33_sim_socket_syscalls_be_OBJECTS = \ |
285 | 326 | 33-sim-socket_syscalls_be.$(OBJEXT) |
286 | 327 | 33_sim_socket_syscalls_be_LDADD = $(LDADD) |
287 | 33_sim_socket_syscalls_be_DEPENDENCIES = util.la ../src/libseccomp.la | |
328 | 33_sim_socket_syscalls_be_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
329 | $(am__DEPENDENCIES_1) | |
330 | 35_sim_negative_one_SOURCES = 35-sim-negative_one.c | |
331 | 35_sim_negative_one_OBJECTS = 35-sim-negative_one.$(OBJEXT) | |
332 | 35_sim_negative_one_LDADD = $(LDADD) | |
333 | 35_sim_negative_one_DEPENDENCIES = util.la ../src/libseccomp.la \ | |
334 | $(am__DEPENDENCIES_1) | |
288 | 335 | miniseq_SOURCES = miniseq.c |
289 | 336 | miniseq_OBJECTS = miniseq.$(OBJEXT) |
290 | 337 | miniseq_DEPENDENCIES = |
337 | 384 | 26-sim-arch_all_be_basic.c 27-sim-bpf_blk_state.c \ |
338 | 385 | 28-sim-arch_x86.c 29-sim-pseudo_syscall.c \ |
339 | 386 | 30-sim-socket_syscalls.c 31-basic-version_check.c \ |
340 | 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c miniseq.c | |
387 | 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c \ | |
388 | 35-sim-negative_one.c miniseq.c | |
341 | 389 | DIST_SOURCES = $(util_la_SOURCES) 01-sim-allow.c 02-sim-basic.c \ |
342 | 390 | 03-sim-basic_chains.c 04-sim-multilevel_chains.c \ |
343 | 391 | 05-sim-long_jumps.c 06-sim-actions.c 07-sim-db_bug_looping.c \ |
352 | 400 | 26-sim-arch_all_be_basic.c 27-sim-bpf_blk_state.c \ |
353 | 401 | 28-sim-arch_x86.c 29-sim-pseudo_syscall.c \ |
354 | 402 | 30-sim-socket_syscalls.c 31-basic-version_check.c \ |
355 | 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c miniseq.c | |
403 | 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c \ | |
404 | 35-sim-negative_one.c miniseq.c | |
356 | 405 | am__can_run_installinfo = \ |
357 | 406 | case $$AM_UPDATE_INFO_DIR in \ |
358 | 407 | n|no|NO) false;; \ |
399 | 448 | std='[m'; \ |
400 | 449 | fi; \ |
401 | 450 | } |
451 | am__DIST_COMMON = $(srcdir)/Makefile.in \ | |
452 | $(top_srcdir)/build-aux/depcomp | |
402 | 453 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
403 | 454 | ACLOCAL = @ACLOCAL@ |
404 | 455 | AMTAR = @AMTAR@ |
405 | 456 | AM_CFLAGS = @AM_CFLAGS@ |
406 | 457 | AM_CPPFLAGS = @AM_CPPFLAGS@ |
407 | 458 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ |
408 | AM_LDFLAGS = -static | |
459 | AM_LDFLAGS = ${DBG_STATIC} | |
409 | 460 | AR = @AR@ |
410 | 461 | AUTOCONF = @AUTOCONF@ |
411 | 462 | AUTOHEADER = @AUTOHEADER@ |
414 | 465 | CC = @CC@ |
415 | 466 | CCDEPMODE = @CCDEPMODE@ |
416 | 467 | CFLAGS = @CFLAGS@ |
468 | CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ | |
469 | CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ | |
470 | CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ | |
471 | CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ | |
472 | CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ | |
473 | CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ | |
417 | 474 | CPP = @CPP@ |
418 | 475 | CPPFLAGS = @CPPFLAGS@ |
419 | 476 | CYGPATH_W = @CYGPATH_W@ |
428 | 485 | EGREP = @EGREP@ |
429 | 486 | EXEEXT = @EXEEXT@ |
430 | 487 | FGREP = @FGREP@ |
488 | GCOV = @GCOV@ | |
489 | GENHTML = @GENHTML@ | |
431 | 490 | GREP = @GREP@ |
432 | 491 | INSTALL = @INSTALL@ |
433 | 492 | INSTALL_DATA = @INSTALL_DATA@ |
434 | 493 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
435 | 494 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
436 | 495 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
496 | LCOV = @LCOV@ | |
437 | 497 | LD = @LD@ |
438 | 498 | LDFLAGS = @LDFLAGS@ |
439 | 499 | LIBOBJS = @LIBOBJS@ |
523 | 583 | top_build_prefix = @top_build_prefix@ |
524 | 584 | top_builddir = @top_builddir@ |
525 | 585 | top_srcdir = @top_srcdir@ |
526 | LDADD = util.la ../src/libseccomp.la | |
586 | @CODE_COVERAGE_ENABLED_FALSE@DBG_STATIC = -static | |
587 | @CODE_COVERAGE_ENABLED_TRUE@DBG_STATIC = | |
588 | LDADD = util.la ../src/libseccomp.la ${CODE_COVERAGE_LIBS} | |
527 | 589 | check_LTLIBRARIES = util.la |
528 | 590 | util_la_SOURCES = util.c util.h |
529 | 591 | util_la_LDFLAGS = -module |
563 | 625 | 30-sim-socket_syscalls.py \ |
564 | 626 | 31-basic-version_check.py \ |
565 | 627 | 32-live-tsync_allow.py \ |
566 | 33-sim-socket_syscalls_be.py | |
628 | 33-sim-socket_syscalls_be.py \ | |
629 | 35-sim-negative_one.py | |
567 | 630 | |
568 | 631 | EXTRA_DIST_TESTCFGS = \ |
569 | 632 | 01-sim-allow.tests \ |
598 | 661 | 30-sim-socket_syscalls.tests \ |
599 | 662 | 31-basic-version_check.tests \ |
600 | 663 | 32-live-tsync_allow.tests \ |
601 | 33-sim-socket_syscalls_be.tests | |
664 | 33-sim-socket_syscalls_be.tests \ | |
665 | 35-sim-negative_one.tests | |
602 | 666 | |
603 | 667 | EXTRA_DIST_TESTSCRIPTS = regression testdiff testgen |
604 | 668 | EXTRA_DIST_TESTVALGRIND = valgrind_test.supp |
625 | 689 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ |
626 | 690 | $(am__cd) $(top_srcdir) && \ |
627 | 691 | $(AUTOMAKE) --foreign tests/Makefile |
628 | .PRECIOUS: Makefile | |
629 | 692 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
630 | 693 | @case '$?' in \ |
631 | 694 | *config.status*) \ |
802 | 865 | 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) |
803 | 866 | @rm -f 33-sim-socket_syscalls_be$(EXEEXT) |
804 | 867 | $(AM_V_CCLD)$(LINK) $(33_sim_socket_syscalls_be_OBJECTS) $(33_sim_socket_syscalls_be_LDADD) $(LIBS) |
868 | ||
869 | 35-sim-negative_one$(EXEEXT): $(35_sim_negative_one_OBJECTS) $(35_sim_negative_one_DEPENDENCIES) $(EXTRA_35_sim_negative_one_DEPENDENCIES) | |
870 | @rm -f 35-sim-negative_one$(EXEEXT) | |
871 | $(AM_V_CCLD)$(LINK) $(35_sim_negative_one_OBJECTS) $(35_sim_negative_one_LDADD) $(LIBS) | |
805 | 872 | |
806 | 873 | miniseq$(EXEEXT): $(miniseq_OBJECTS) $(miniseq_DEPENDENCIES) $(EXTRA_miniseq_DEPENDENCIES) |
807 | 874 | @rm -f miniseq$(EXEEXT) |
847 | 914 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/31-basic-version_check.Po@am__quote@ |
848 | 915 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/32-live-tsync_allow.Po@am__quote@ |
849 | 916 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/33-sim-socket_syscalls_be.Po@am__quote@ |
917 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/35-sim-negative_one.Po@am__quote@ | |
850 | 918 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miniseq.Po@am__quote@ |
851 | 919 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ |
852 | 920 | |
1179 | 1247 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ |
1180 | 1248 | tags tags-am uninstall uninstall-am |
1181 | 1249 | |
1250 | .PRECIOUS: Makefile | |
1251 | ||
1252 | ||
1253 | @CODE_COVERAGE_RULES@ | |
1182 | 1254 | |
1183 | 1255 | check-build: |
1184 | 1256 | ${MAKE} ${AM_MAKEFLAGS} ${check_PROGRAMS} |
49 | 49 | if (get_number(argv[1], &first) || get_number(argv[2], &last)) |
50 | 50 | return 1; |
51 | 51 | |
52 | for (cur = first; cur <= last; cur++) | |
53 | printf("%" PRIu64 "\n", cur); | |
52 | for (cur = first; cur != last; cur++) | |
53 | printf("%" PRId64 "\n", cur); | |
54 | printf("%" PRId64 "\n", cur); | |
54 | 55 | |
55 | 56 | return 0; |
56 | 57 | } |
81 | 81 | -s SINGLE_TEST specifies individual test number to be run |
82 | 82 | -t [TEMP_DIR] specifies directory to create temporary files in |
83 | 83 | -T [TEST_TYPE] only run tests matching the specified type |
84 | can also be set via LIBSECCOMP_TSTCFG_TYPE env variable | |
84 | 85 | -v specifies that verbose output be provided |
85 | 86 | EOF |
86 | 87 | } |
277 | 278 | local line=($3) |
278 | 279 | local testname=${line[0]} |
279 | 280 | local stress_count=${line[1]} |
281 | ||
282 | # check for stress count configuration via environment variables | |
283 | [[ -n $LIBSECCOMP_TSTCFG_STRESSCNT ]] && \ | |
284 | stress_count=$LIBSECCOMP_TSTCFG_STRESSCNT | |
280 | 285 | |
281 | 286 | for i in $(get_seq 1 $stress_count); do |
282 | 287 | local sys=$(generate_random_data) |
469 | 474 | |
470 | 475 | # get low and high syscall values and convert them to numbers |
471 | 476 | low_syscall=$(get_range $LOW "${line[2]}") |
472 | if [[ ! $low_syscall =~ ^[0-9]+$ ]]; then | |
477 | if [[ ! $low_syscall =~ ^\-?[0-9]+$ ]]; then | |
473 | 478 | low_syscall=$($GLBL_SYS_RESOLVER -a $simarch -t \ |
474 | 479 | $low_syscall) |
475 | 480 | if [[ $? -ne 0 ]]; then |
480 | 485 | fi |
481 | 486 | fi |
482 | 487 | high_syscall=$(get_range $HIGH "${line[2]}") |
483 | if [[ ! $high_syscall =~ ^[0-9]+$ ]]; then | |
488 | if [[ ! $high_syscall =~ ^\-?[0-9]+$ ]]; then | |
484 | 489 | high_syscall=$($GLBL_SYS_RESOLVER -a $simarch -t \ |
485 | 490 | $high_syscall) |
486 | 491 | if [[ $? -ne 0 ]]; then |
960 | 965 | single_list=() |
961 | 966 | fi |
962 | 967 | |
968 | # check for configuration via environment variables | |
969 | [[ -z $type && -n $LIBSECCOMP_TSTCFG_TYPE ]] && type=$LIBSECCOMP_TSTCFG_TYPE | |
970 | ||
963 | 971 | # open log file for append (default to stdout) |
964 | 972 | if [[ -n $logfile ]]; then |
965 | 973 | logfd=3 |
99 | 99 | Description: |
100 | 100 | Open the specified file, write a string to the file, and close the file. |
101 | 101 | """ |
102 | fd = os.open(path, os.O_WRONLY|os.O_CREAT, 0600) | |
103 | if not os.write(fd, "testing") == len("testing"): | |
102 | fd = os.open(str(path), os.O_WRONLY|os.O_CREAT) | |
103 | if not os.write(fd, b"testing") == len("testing"): | |
104 | 104 | raise IOError("failed to write the full test string in write_file()") |
105 | 105 | os.close(fd) |
106 | 106 |
0 | # Makefile.in generated by automake 1.14.1 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.15.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2017 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
33 | 33 | |
34 | 34 | |
35 | 35 | VPATH = @srcdir@ |
36 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' | |
36 | am__is_gnu_make = { \ | |
37 | if test -z '$(MAKELEVEL)'; then \ | |
38 | false; \ | |
39 | elif test -n '$(MAKE_HOST)'; then \ | |
40 | true; \ | |
41 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ | |
42 | true; \ | |
43 | else \ | |
44 | false; \ | |
45 | fi; \ | |
46 | } | |
37 | 47 | am__make_running_with_option = \ |
38 | 48 | case $${target_option-} in \ |
39 | 49 | ?) ;; \ |
100 | 110 | noinst_PROGRAMS = scmp_arch_detect$(EXEEXT) scmp_bpf_disasm$(EXEEXT) \ |
101 | 111 | scmp_bpf_sim$(EXEEXT) |
102 | 112 | subdir = tools |
103 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ | |
104 | $(top_srcdir)/build-aux/depcomp | |
105 | 113 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
106 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ | |
107 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | |
108 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | |
109 | $(top_srcdir)/configure.ac | |
114 | am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ | |
115 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | |
116 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | |
117 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac | |
110 | 118 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
111 | 119 | $(ACLOCAL_M4) |
120 | DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) | |
112 | 121 | mkinstalldirs = $(install_sh) -d |
113 | 122 | CONFIG_HEADER = $(top_builddir)/configure.h |
114 | 123 | CONFIG_CLEAN_FILES = |
210 | 219 | done | $(am__uniquify_input)` |
211 | 220 | ETAGS = etags |
212 | 221 | CTAGS = ctags |
222 | am__DIST_COMMON = $(srcdir)/Makefile.in \ | |
223 | $(top_srcdir)/build-aux/depcomp | |
213 | 224 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
214 | 225 | ACLOCAL = @ACLOCAL@ |
215 | 226 | AMTAR = @AMTAR@ |
225 | 236 | CC = @CC@ |
226 | 237 | CCDEPMODE = @CCDEPMODE@ |
227 | 238 | CFLAGS = @CFLAGS@ |
239 | CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ | |
240 | CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ | |
241 | CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ | |
242 | CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ | |
243 | CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ | |
244 | CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ | |
228 | 245 | CPP = @CPP@ |
229 | 246 | CPPFLAGS = @CPPFLAGS@ |
230 | 247 | CYGPATH_W = @CYGPATH_W@ |
239 | 256 | EGREP = @EGREP@ |
240 | 257 | EXEEXT = @EXEEXT@ |
241 | 258 | FGREP = @FGREP@ |
259 | GCOV = @GCOV@ | |
260 | GENHTML = @GENHTML@ | |
242 | 261 | GREP = @GREP@ |
243 | 262 | INSTALL = @INSTALL@ |
244 | 263 | INSTALL_DATA = @INSTALL_DATA@ |
245 | 264 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
246 | 265 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
247 | 266 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
267 | LCOV = @LCOV@ | |
248 | 268 | LD = @LD@ |
249 | 269 | LDFLAGS = @LDFLAGS@ |
250 | 270 | LIBOBJS = @LIBOBJS@ |
362 | 382 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ |
363 | 383 | $(am__cd) $(top_srcdir) && \ |
364 | 384 | $(AUTOMAKE) --foreign tools/Makefile |
365 | .PRECIOUS: Makefile | |
366 | 385 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
367 | 386 | @case '$?' in \ |
368 | 387 | *config.status*) \ |
718 | 737 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ |
719 | 738 | tags tags-am uninstall uninstall-am uninstall-binPROGRAMS |
720 | 739 | |
740 | .PRECIOUS: Makefile | |
741 | ||
721 | 742 | |
722 | 743 | # Tell versions [3.59,3.63) of GNU make to not export all variables. |
723 | 744 | # Otherwise a system limit (for SysV at least) may be exceeded. |