New upstream version 2.5.1
Felix Geyer
3 years ago
0 | 0 | libseccomp: Releases |
1 | 1 | =============================================================================== |
2 | 2 | https://github.com/seccomp/libseccomp |
3 | ||
4 | * Version 2.5.1 - November 20, 2020 | |
5 | - Fix a bug where seccomp_load() could only be called once | |
6 | - Change the notification fd handling to only request a notification fd if | |
7 | the filter has a _NOTIFY action | |
8 | - Add documentation about SCMP_ACT_NOTIFY to the seccomp_add_rule(3) manpage | |
9 | - Clarify the maintainers' GPG keys | |
3 | 10 | |
4 | 11 | * Version 2.5.0 - July 20, 2020 |
5 | 12 | - Add support for the seccomp user notifications, see the |
39 | 39 | Markos Chandras <markos.chandras@imgtec.com> |
40 | 40 | Mathias Krause <minipli@googlemail.com> |
41 | 41 | Michael Forney <mforney@mforney.org> |
42 | Michael Karcher <github@mkarcher.dialup.fu-berlin.de> | |
42 | 43 | Mike Frysinger <vapier@gentoo.org> |
43 | 44 | Mike Strosaker <strosake@linux.vnet.ibm.com> |
44 | 45 | Miroslav Lichvar <mlichvar@redhat.com> |
45 | 46 | Paul Moore <paul@paul-moore.com> |
47 | Rodrigo Campos <rodrigo@kinvolk.io> | |
46 | 48 | Rolf Eike Beer <eb@emlix.com> |
49 | Samanta Navarro <ferivoz@riseup.net> | |
47 | 50 | Serge Hallyn <serge.hallyn@ubuntu.com> |
48 | 51 | Stéphane Graber <stgraber@ubuntu.com> |
49 | 52 | Stephen Coleman <omegacoleman@gmail.com> |
0 | # Makefile.in generated by automake 1.16.2 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2020 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2018 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, |
185 | 185 | $(am__extra_recursive_targets) |
186 | 186 | AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ |
187 | 187 | cscope distdir distdir-am dist dist-all distcheck |
188 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ | |
189 | configure.h.in | |
188 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ | |
189 | $(LISP)configure.h.in | |
190 | 190 | # Read a list of newline-separated strings from the standard input, |
191 | 191 | # and print each of them once, without duplicates. Input order is |
192 | 192 | # *not* preserved. |
692 | 692 | tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz |
693 | 693 | $(am__post_remove_distdir) |
694 | 694 | |
695 | dist-zstd: distdir | |
696 | tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst | |
697 | $(am__post_remove_distdir) | |
698 | ||
699 | 695 | dist-tarZ: distdir |
700 | 696 | @echo WARNING: "Support for distribution archives compressed with" \ |
701 | 697 | "legacy program 'compress' is deprecated." >&2 |
738 | 734 | eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ |
739 | 735 | *.zip*) \ |
740 | 736 | unzip $(distdir).zip ;;\ |
741 | *.tar.zst*) \ | |
742 | zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ | |
743 | 737 | esac |
744 | 738 | chmod -R a-w $(distdir) |
745 | 739 | chmod u+w $(distdir) |
920 | 914 | am--refresh check check-am clean clean-cscope clean-generic \ |
921 | 915 | clean-libtool clean-local cscope cscopelist-am ctags ctags-am \ |
922 | 916 | dist dist-all dist-bzip2 dist-gzip dist-lzip dist-shar \ |
923 | dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \ | |
917 | dist-tarZ dist-xz dist-zip distcheck distclean \ | |
924 | 918 | distclean-generic distclean-hdr distclean-libtool \ |
925 | 919 | distclean-tags distcleancheck distdir distuninstallcheck dvi \ |
926 | 920 | dvi-am html html-am info info-am install install-am \ |
73 | 73 | |
74 | 74 | # gpg --verify file.asc file |
75 | 75 | |
76 | At present, only the following keys are authorized to sign official libseccomp | |
77 | releases: | |
76 | At present, only the following keys, specified via the fingerprints below, are | |
77 | authorized to sign official libseccomp releases: | |
78 | 78 | |
79 | 79 | Paul Moore <paul@paul-moore.com> |
80 | 80 | 7100 AADF AE6E 6E94 0D2E 0AD6 55E4 5A5A E8CA 7C8A |
81 | 81 | |
82 | 82 | Tom Hromatka <tom.hromatka@oracle.com> |
83 | 83 | 47A6 8FCE 37C7 D702 4FD6 5E11 356C E62C 2B52 4099 |
84 | ||
85 | More information on GnuPG can be found at their website, https://gnupg.org. | |
84 | 86 | |
85 | 87 | ## Building and Installing the Library |
86 | 88 |
0 | # generated automatically by aclocal 1.16.2 -*- Autoconf -*- | |
1 | ||
2 | # Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
0 | # generated automatically by aclocal 1.16.1 -*- Autoconf -*- | |
1 | ||
2 | # Copyright (C) 1996-2018 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-2020 Free Software Foundation, Inc. | |
22 | # Copyright (C) 2002-2018 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, |
34 | 34 | [am__api_version='1.16' |
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.16.2], [], | |
37 | m4_if([$1], [1.16.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.16.2])dnl | |
53 | [AM_AUTOMAKE_VERSION([1.16.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-2020 Free Software Foundation, Inc. | |
58 | # Copyright (C) 2011-2018 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-2020 Free Software Foundation, Inc. | |
120 | # Copyright (C) 2001-2018 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, |
169 | 169 | |
170 | 170 | # AM_CONDITIONAL -*- Autoconf -*- |
171 | 171 | |
172 | # Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
172 | # Copyright (C) 1997-2018 Free Software Foundation, Inc. | |
173 | 173 | # |
174 | 174 | # This file is free software; the Free Software Foundation |
175 | 175 | # gives unlimited permission to copy and/or distribute it, |
200 | 200 | Usually this means the macro was only invoked conditionally.]]) |
201 | 201 | fi])]) |
202 | 202 | |
203 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
203 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
204 | 204 | # |
205 | 205 | # This file is free software; the Free Software Foundation |
206 | 206 | # gives unlimited permission to copy and/or distribute it, |
391 | 391 | |
392 | 392 | # Generate code to set up dependency tracking. -*- Autoconf -*- |
393 | 393 | |
394 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
394 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
395 | 395 | # |
396 | 396 | # This file is free software; the Free Software Foundation |
397 | 397 | # gives unlimited permission to copy and/or distribute it, |
430 | 430 | done |
431 | 431 | if test $am_rc -ne 0; then |
432 | 432 | AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments |
433 | for automatic dependency tracking. If GNU make was not used, consider | |
434 | re-running the configure script with MAKE="gmake" (or whatever is | |
435 | necessary). You can also try re-running configure with the | |
433 | for automatic dependency tracking. Try re-running configure with the | |
436 | 434 | '--disable-dependency-tracking' option to at least be able to build |
437 | 435 | the package (albeit without support for automatic dependency tracking).]) |
438 | 436 | fi |
459 | 457 | |
460 | 458 | # Do all the work for Automake. -*- Autoconf -*- |
461 | 459 | |
462 | # Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
460 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
463 | 461 | # |
464 | 462 | # This file is free software; the Free Software Foundation |
465 | 463 | # gives unlimited permission to copy and/or distribute it, |
656 | 654 | done |
657 | 655 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) |
658 | 656 | |
659 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
657 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
660 | 658 | # |
661 | 659 | # This file is free software; the Free Software Foundation |
662 | 660 | # gives unlimited permission to copy and/or distribute it, |
677 | 675 | fi |
678 | 676 | AC_SUBST([install_sh])]) |
679 | 677 | |
680 | # Copyright (C) 2003-2020 Free Software Foundation, Inc. | |
678 | # Copyright (C) 2003-2018 Free Software Foundation, Inc. | |
681 | 679 | # |
682 | 680 | # This file is free software; the Free Software Foundation |
683 | 681 | # gives unlimited permission to copy and/or distribute it, |
698 | 696 | |
699 | 697 | # Check to see how 'make' treats includes. -*- Autoconf -*- |
700 | 698 | |
701 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
699 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
702 | 700 | # |
703 | 701 | # This file is free software; the Free Software Foundation |
704 | 702 | # gives unlimited permission to copy and/or distribute it, |
741 | 739 | |
742 | 740 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- |
743 | 741 | |
744 | # Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
742 | # Copyright (C) 1997-2018 Free Software Foundation, Inc. | |
745 | 743 | # |
746 | 744 | # This file is free software; the Free Software Foundation |
747 | 745 | # gives unlimited permission to copy and/or distribute it, |
780 | 778 | |
781 | 779 | # Helper functions for option handling. -*- Autoconf -*- |
782 | 780 | |
783 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
781 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
784 | 782 | # |
785 | 783 | # This file is free software; the Free Software Foundation |
786 | 784 | # gives unlimited permission to copy and/or distribute it, |
809 | 807 | AC_DEFUN([_AM_IF_OPTION], |
810 | 808 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) |
811 | 809 | |
812 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
810 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
813 | 811 | # |
814 | 812 | # This file is free software; the Free Software Foundation |
815 | 813 | # gives unlimited permission to copy and/or distribute it, |
856 | 854 | # For backward compatibility. |
857 | 855 | AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) |
858 | 856 | |
859 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
857 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
860 | 858 | # |
861 | 859 | # This file is free software; the Free Software Foundation |
862 | 860 | # gives unlimited permission to copy and/or distribute it, |
1094 | 1092 | sys.exit(sys.hexversion < minverhex)" |
1095 | 1093 | AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) |
1096 | 1094 | |
1097 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
1095 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
1098 | 1096 | # |
1099 | 1097 | # This file is free software; the Free Software Foundation |
1100 | 1098 | # gives unlimited permission to copy and/or distribute it, |
1113 | 1111 | |
1114 | 1112 | # Check to make sure that the build environment is sane. -*- Autoconf -*- |
1115 | 1113 | |
1116 | # Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
1114 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
1117 | 1115 | # |
1118 | 1116 | # This file is free software; the Free Software Foundation |
1119 | 1117 | # gives unlimited permission to copy and/or distribute it, |
1194 | 1192 | rm -f conftest.file |
1195 | 1193 | ]) |
1196 | 1194 | |
1197 | # Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
1195 | # Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
1198 | 1196 | # |
1199 | 1197 | # This file is free software; the Free Software Foundation |
1200 | 1198 | # gives unlimited permission to copy and/or distribute it, |
1254 | 1252 | _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl |
1255 | 1253 | ]) |
1256 | 1254 | |
1257 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
1255 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
1258 | 1256 | # |
1259 | 1257 | # This file is free software; the Free Software Foundation |
1260 | 1258 | # gives unlimited permission to copy and/or distribute it, |
1282 | 1280 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" |
1283 | 1281 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
1284 | 1282 | |
1285 | # Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
1283 | # Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
1286 | 1284 | # |
1287 | 1285 | # This file is free software; the Free Software Foundation |
1288 | 1286 | # gives unlimited permission to copy and/or distribute it, |
1301 | 1299 | |
1302 | 1300 | # Check how to create a tarball. -*- Autoconf -*- |
1303 | 1301 | |
1304 | # Copyright (C) 2004-2020 Free Software Foundation, Inc. | |
1302 | # Copyright (C) 2004-2018 Free Software Foundation, Inc. | |
1305 | 1303 | # |
1306 | 1304 | # This file is free software; the Free Software Foundation |
1307 | 1305 | # gives unlimited permission to copy and/or distribute it, |
1 | 1 | # Wrapper for Microsoft lib.exe |
2 | 2 | |
3 | 3 | me=ar-lib |
4 | scriptversion=2019-07-04.01; # UTC | |
5 | ||
6 | # Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
4 | scriptversion=2012-03-01.08; # UTC | |
5 | ||
6 | # Copyright (C) 2010-2018 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 |
52 | 52 | MINGW*) |
53 | 53 | file_conv=mingw |
54 | 54 | ;; |
55 | CYGWIN* | MSYS*) | |
55 | CYGWIN*) | |
56 | 56 | file_conv=cygwin |
57 | 57 | ;; |
58 | 58 | *) |
64 | 64 | mingw) |
65 | 65 | file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` |
66 | 66 | ;; |
67 | cygwin | msys) | |
67 | cygwin) | |
68 | 68 | file=`cygpath -m "$file" || echo "$file"` |
69 | 69 | ;; |
70 | 70 | wine) |
223 | 223 | esac |
224 | 224 | done |
225 | 225 | else |
226 | $AR -NOLOGO -LIST "$archive" | tr -d '\r' | sed -e 's/\\/\\\\/g' \ | |
227 | | while read member | |
228 | do | |
229 | $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? | |
230 | done | |
226 | $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member | |
227 | do | |
228 | $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? | |
229 | done | |
231 | 230 | fi |
232 | 231 | |
233 | 232 | elif test -n "$quick$replace"; then |
2 | 2 | |
3 | 3 | scriptversion=2018-03-07.03; # UTC |
4 | 4 | |
5 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
5 | # Copyright (C) 1999-2018 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 |
52 | 52 | MINGW*) |
53 | 53 | file_conv=mingw |
54 | 54 | ;; |
55 | CYGWIN* | MSYS*) | |
55 | CYGWIN*) | |
56 | 56 | file_conv=cygwin |
57 | 57 | ;; |
58 | 58 | *) |
66 | 66 | mingw/*) |
67 | 67 | file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` |
68 | 68 | ;; |
69 | cygwin/* | msys/*) | |
69 | cygwin/*) | |
70 | 70 | file=`cygpath -m "$file" || echo "$file"` |
71 | 71 | ;; |
72 | 72 | wine/*) |
0 | 0 | #! /bin/sh |
1 | 1 | # Attempt to guess a canonical system name. |
2 | # Copyright 1992-2020 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2020-01-01' | |
2 | # Copyright 1992-2018 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2018-08-29' | |
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 |
49 | 49 | GNU config.guess ($timestamp) |
50 | 50 | |
51 | 51 | Originally written by Per Bothner. |
52 | Copyright 1992-2020 Free Software Foundation, Inc. | |
52 | Copyright 1992-2018 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." |
95 | 95 | |
96 | 96 | tmp= |
97 | 97 | # shellcheck disable=SC2172 |
98 | trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 | |
98 | trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 | |
99 | trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 | |
99 | 100 | |
100 | 101 | set_cc_for_build() { |
101 | # prevent multiple calls if $tmp is already set | |
102 | test "$tmp" && return 0 | |
103 | 102 | : "${TMPDIR=/tmp}" |
104 | 103 | # shellcheck disable=SC2039 |
105 | 104 | { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
263 | 262 | *:SolidBSD:*:*) |
264 | 263 | echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" |
265 | 264 | exit ;; |
266 | *:OS108:*:*) | |
267 | echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" | |
268 | exit ;; | |
269 | 265 | macppc:MirBSD:*:*) |
270 | 266 | echo powerpc-unknown-mirbsd"$UNAME_RELEASE" |
271 | 267 | exit ;; |
275 | 271 | *:Sortix:*:*) |
276 | 272 | echo "$UNAME_MACHINE"-unknown-sortix |
277 | 273 | exit ;; |
278 | *:Twizzler:*:*) | |
279 | echo "$UNAME_MACHINE"-unknown-twizzler | |
280 | exit ;; | |
281 | 274 | *:Redox:*:*) |
282 | 275 | echo "$UNAME_MACHINE"-unknown-redox |
283 | 276 | exit ;; |
284 | 277 | mips:OSF1:*.*) |
285 | echo mips-dec-osf1 | |
286 | exit ;; | |
278 | echo mips-dec-osf1 | |
279 | exit ;; | |
287 | 280 | alpha:OSF1:*:*) |
288 | 281 | case $UNAME_RELEASE in |
289 | 282 | *4.0) |
398 | 391 | echo i386-pc-auroraux"$UNAME_RELEASE" |
399 | 392 | exit ;; |
400 | 393 | i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) |
401 | set_cc_for_build | |
402 | SUN_ARCH=i386 | |
403 | # If there is a compiler, see if it is configured for 64-bit objects. | |
404 | # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. | |
405 | # This test works for both compilers. | |
406 | if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | |
407 | if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ | |
408 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
409 | grep IS_64BIT_ARCH >/dev/null | |
410 | then | |
411 | SUN_ARCH=x86_64 | |
412 | fi | |
413 | fi | |
414 | echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" | |
394 | UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" | |
395 | case `isainfo -b` in | |
396 | 32) | |
397 | echo i386-pc-solaris2"$UNAME_REL" | |
398 | ;; | |
399 | 64) | |
400 | echo x86_64-pc-solaris2"$UNAME_REL" | |
401 | ;; | |
402 | esac | |
415 | 403 | exit ;; |
416 | 404 | sun4*:SunOS:6*:*) |
417 | 405 | # According to config.sub, this is the proper way to canonicalize |
901 | 889 | echo "$UNAME_MACHINE"-pc-uwin |
902 | 890 | exit ;; |
903 | 891 | amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) |
904 | echo x86_64-pc-cygwin | |
892 | echo x86_64-unknown-cygwin | |
905 | 893 | exit ;; |
906 | 894 | prep*:SunOS:5.*:*) |
907 | 895 | echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" |
925 | 913 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
926 | 914 | exit ;; |
927 | 915 | alpha:Linux:*:*) |
928 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in | |
916 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in | |
929 | 917 | EV5) UNAME_MACHINE=alphaev5 ;; |
930 | 918 | EV56) UNAME_MACHINE=alphaev56 ;; |
931 | 919 | PCA56) UNAME_MACHINE=alphapca56 ;; |
992 | 980 | exit ;; |
993 | 981 | mips:Linux:*:* | mips64:Linux:*:*) |
994 | 982 | set_cc_for_build |
995 | IS_GLIBC=0 | |
996 | test x"${LIBC}" = xgnu && IS_GLIBC=1 | |
997 | 983 | sed 's/^ //' << EOF > "$dummy.c" |
998 | 984 | #undef CPU |
999 | #undef mips | |
1000 | #undef mipsel | |
1001 | #undef mips64 | |
1002 | #undef mips64el | |
1003 | #if ${IS_GLIBC} && defined(_ABI64) | |
1004 | LIBCABI=gnuabi64 | |
1005 | #else | |
1006 | #if ${IS_GLIBC} && defined(_ABIN32) | |
1007 | LIBCABI=gnuabin32 | |
1008 | #else | |
1009 | LIBCABI=${LIBC} | |
1010 | #endif | |
1011 | #endif | |
1012 | ||
1013 | #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 | |
1014 | CPU=mipsisa64r6 | |
1015 | #else | |
1016 | #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 | |
1017 | CPU=mipsisa32r6 | |
1018 | #else | |
1019 | #if defined(__mips64) | |
1020 | CPU=mips64 | |
1021 | #else | |
1022 | CPU=mips | |
1023 | #endif | |
1024 | #endif | |
1025 | #endif | |
1026 | ||
985 | #undef ${UNAME_MACHINE} | |
986 | #undef ${UNAME_MACHINE}el | |
1027 | 987 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) |
1028 | MIPS_ENDIAN=el | |
988 | CPU=${UNAME_MACHINE}el | |
1029 | 989 | #else |
1030 | 990 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) |
1031 | MIPS_ENDIAN= | |
991 | CPU=${UNAME_MACHINE} | |
1032 | 992 | #else |
1033 | MIPS_ENDIAN= | |
993 | CPU= | |
1034 | 994 | #endif |
1035 | 995 | #endif |
1036 | 996 | EOF |
1037 | eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" | |
1038 | test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } | |
997 | eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" | |
998 | test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } | |
1039 | 999 | ;; |
1040 | 1000 | mips64el:Linux:*:*) |
1041 | 1001 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
1148 | 1108 | *Pentium) UNAME_MACHINE=i586 ;; |
1149 | 1109 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; |
1150 | 1110 | esac |
1151 | echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" | |
1111 | echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" | |
1152 | 1112 | exit ;; |
1153 | 1113 | i*86:*:3.2:*) |
1154 | 1114 | if test -f /usr/options/cb.name; then |
1332 | 1292 | echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" |
1333 | 1293 | exit ;; |
1334 | 1294 | *:Darwin:*:*) |
1335 | UNAME_PROCESSOR=`uname -p` | |
1336 | case $UNAME_PROCESSOR in | |
1337 | unknown) UNAME_PROCESSOR=powerpc ;; | |
1338 | esac | |
1339 | if command -v xcode-select > /dev/null 2> /dev/null && \ | |
1340 | ! xcode-select --print-path > /dev/null 2> /dev/null ; then | |
1341 | # Avoid executing cc if there is no toolchain installed as | |
1342 | # cc will be a stub that puts up a graphical alert | |
1343 | # prompting the user to install developer tools. | |
1344 | CC_FOR_BUILD=no_compiler_found | |
1345 | else | |
1346 | set_cc_for_build | |
1347 | fi | |
1348 | if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | |
1349 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ | |
1350 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1351 | grep IS_64BIT_ARCH >/dev/null | |
1352 | then | |
1353 | case $UNAME_PROCESSOR in | |
1354 | i386) UNAME_PROCESSOR=x86_64 ;; | |
1355 | powerpc) UNAME_PROCESSOR=powerpc64 ;; | |
1356 | esac | |
1357 | fi | |
1358 | # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc | |
1359 | if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ | |
1360 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1361 | grep IS_PPC >/dev/null | |
1362 | then | |
1363 | UNAME_PROCESSOR=powerpc | |
1295 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown | |
1296 | set_cc_for_build | |
1297 | if test "$UNAME_PROCESSOR" = unknown ; then | |
1298 | UNAME_PROCESSOR=powerpc | |
1299 | fi | |
1300 | if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then | |
1301 | if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | |
1302 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ | |
1303 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1304 | grep IS_64BIT_ARCH >/dev/null | |
1305 | then | |
1306 | case $UNAME_PROCESSOR in | |
1307 | i386) UNAME_PROCESSOR=x86_64 ;; | |
1308 | powerpc) UNAME_PROCESSOR=powerpc64 ;; | |
1309 | esac | |
1310 | fi | |
1311 | # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc | |
1312 | if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ | |
1313 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1314 | grep IS_PPC >/dev/null | |
1315 | then | |
1316 | UNAME_PROCESSOR=powerpc | |
1317 | fi | |
1364 | 1318 | fi |
1365 | 1319 | elif test "$UNAME_PROCESSOR" = i386 ; then |
1366 | # uname -m returns i386 or x86_64 | |
1367 | UNAME_PROCESSOR=$UNAME_MACHINE | |
1320 | # Avoid executing cc on OS X 10.9, as it ships with a stub | |
1321 | # that puts up a graphical alert prompting to install | |
1322 | # developer tools. Any system running Mac OS X 10.7 or | |
1323 | # later (Darwin 11 and later) is required to have a 64-bit | |
1324 | # processor. This is not true of the ARM version of Darwin | |
1325 | # that Apple uses in portable devices. | |
1326 | UNAME_PROCESSOR=x86_64 | |
1368 | 1327 | fi |
1369 | 1328 | echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" |
1370 | 1329 | exit ;; |
1464 | 1423 | amd64:Isilon\ OneFS:*:*) |
1465 | 1424 | echo x86_64-unknown-onefs |
1466 | 1425 | exit ;; |
1467 | *:Unleashed:*:*) | |
1468 | echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" | |
1469 | exit ;; | |
1470 | 1426 | esac |
1471 | ||
1472 | # No uname command or uname output not recognized. | |
1473 | set_cc_for_build | |
1474 | cat > "$dummy.c" <<EOF | |
1475 | #ifdef _SEQUENT_ | |
1476 | #include <sys/types.h> | |
1477 | #include <sys/utsname.h> | |
1478 | #endif | |
1479 | #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) | |
1480 | #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) | |
1481 | #include <signal.h> | |
1482 | #if defined(_SIZE_T_) || defined(SIGLOST) | |
1483 | #include <sys/utsname.h> | |
1484 | #endif | |
1485 | #endif | |
1486 | #endif | |
1487 | main () | |
1488 | { | |
1489 | #if defined (sony) | |
1490 | #if defined (MIPSEB) | |
1491 | /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, | |
1492 | I don't know.... */ | |
1493 | printf ("mips-sony-bsd\n"); exit (0); | |
1494 | #else | |
1495 | #include <sys/param.h> | |
1496 | printf ("m68k-sony-newsos%s\n", | |
1497 | #ifdef NEWSOS4 | |
1498 | "4" | |
1499 | #else | |
1500 | "" | |
1501 | #endif | |
1502 | ); exit (0); | |
1503 | #endif | |
1504 | #endif | |
1505 | ||
1506 | #if defined (NeXT) | |
1507 | #if !defined (__ARCHITECTURE__) | |
1508 | #define __ARCHITECTURE__ "m68k" | |
1509 | #endif | |
1510 | int version; | |
1511 | version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; | |
1512 | if (version < 4) | |
1513 | printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); | |
1514 | else | |
1515 | printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); | |
1516 | exit (0); | |
1517 | #endif | |
1518 | ||
1519 | #if defined (MULTIMAX) || defined (n16) | |
1520 | #if defined (UMAXV) | |
1521 | printf ("ns32k-encore-sysv\n"); exit (0); | |
1522 | #else | |
1523 | #if defined (CMU) | |
1524 | printf ("ns32k-encore-mach\n"); exit (0); | |
1525 | #else | |
1526 | printf ("ns32k-encore-bsd\n"); exit (0); | |
1527 | #endif | |
1528 | #endif | |
1529 | #endif | |
1530 | ||
1531 | #if defined (__386BSD__) | |
1532 | printf ("i386-pc-bsd\n"); exit (0); | |
1533 | #endif | |
1534 | ||
1535 | #if defined (sequent) | |
1536 | #if defined (i386) | |
1537 | printf ("i386-sequent-dynix\n"); exit (0); | |
1538 | #endif | |
1539 | #if defined (ns32000) | |
1540 | printf ("ns32k-sequent-dynix\n"); exit (0); | |
1541 | #endif | |
1542 | #endif | |
1543 | ||
1544 | #if defined (_SEQUENT_) | |
1545 | struct utsname un; | |
1546 | ||
1547 | uname(&un); | |
1548 | if (strncmp(un.version, "V2", 2) == 0) { | |
1549 | printf ("i386-sequent-ptx2\n"); exit (0); | |
1550 | } | |
1551 | if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ | |
1552 | printf ("i386-sequent-ptx1\n"); exit (0); | |
1553 | } | |
1554 | printf ("i386-sequent-ptx\n"); exit (0); | |
1555 | #endif | |
1556 | ||
1557 | #if defined (vax) | |
1558 | #if !defined (ultrix) | |
1559 | #include <sys/param.h> | |
1560 | #if defined (BSD) | |
1561 | #if BSD == 43 | |
1562 | printf ("vax-dec-bsd4.3\n"); exit (0); | |
1563 | #else | |
1564 | #if BSD == 199006 | |
1565 | printf ("vax-dec-bsd4.3reno\n"); exit (0); | |
1566 | #else | |
1567 | printf ("vax-dec-bsd\n"); exit (0); | |
1568 | #endif | |
1569 | #endif | |
1570 | #else | |
1571 | printf ("vax-dec-bsd\n"); exit (0); | |
1572 | #endif | |
1573 | #else | |
1574 | #if defined(_SIZE_T_) || defined(SIGLOST) | |
1575 | struct utsname un; | |
1576 | uname (&un); | |
1577 | printf ("vax-dec-ultrix%s\n", un.release); exit (0); | |
1578 | #else | |
1579 | printf ("vax-dec-ultrix\n"); exit (0); | |
1580 | #endif | |
1581 | #endif | |
1582 | #endif | |
1583 | #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) | |
1584 | #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) | |
1585 | #if defined(_SIZE_T_) || defined(SIGLOST) | |
1586 | struct utsname *un; | |
1587 | uname (&un); | |
1588 | printf ("mips-dec-ultrix%s\n", un.release); exit (0); | |
1589 | #else | |
1590 | printf ("mips-dec-ultrix\n"); exit (0); | |
1591 | #endif | |
1592 | #endif | |
1593 | #endif | |
1594 | ||
1595 | #if defined (alliant) && defined (i860) | |
1596 | printf ("i860-alliant-bsd\n"); exit (0); | |
1597 | #endif | |
1598 | ||
1599 | exit (1); | |
1600 | } | |
1601 | EOF | |
1602 | ||
1603 | $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && | |
1604 | { echo "$SYSTEM_NAME"; exit; } | |
1605 | ||
1606 | # Apollos put the system type in the environment. | |
1607 | test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } | |
1608 | 1427 | |
1609 | 1428 | echo "$0: unable to guess system type" >&2 |
1610 | 1429 |
0 | 0 | #! /bin/sh |
1 | 1 | # Configuration validation subroutine script. |
2 | # Copyright 1992-2020 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2020-01-01' | |
2 | # Copyright 1992-2018 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2018-08-29' | |
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 |
66 | 66 | version="\ |
67 | 67 | GNU config.sub ($timestamp) |
68 | 68 | |
69 | Copyright 1992-2020 Free Software Foundation, Inc. | |
69 | Copyright 1992-2018 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." |
88 | 88 | - ) # Use stdin as input. |
89 | 89 | break ;; |
90 | 90 | -* ) |
91 | echo "$me: invalid option $1$help" >&2 | |
91 | echo "$me: invalid option $1$help" | |
92 | 92 | exit 1 ;; |
93 | 93 | |
94 | 94 | *local*) |
110 | 110 | esac |
111 | 111 | |
112 | 112 | # Split fields of configuration type |
113 | # shellcheck disable=SC2162 | |
114 | IFS="-" read field1 field2 field3 field4 <<EOF | |
113 | IFS="-" read -r field1 field2 field3 field4 <<EOF | |
115 | 114 | $1 |
116 | 115 | EOF |
117 | 116 | |
149 | 148 | esac |
150 | 149 | ;; |
151 | 150 | *-*) |
152 | # A lone config we happen to match not fitting any pattern | |
151 | # A lone config we happen to match not fitting any patern | |
153 | 152 | case $field1-$field2 in |
154 | 153 | decstation-3100) |
155 | 154 | basic_machine=mips-dec |
336 | 335 | basic_machine=m88k-harris |
337 | 336 | os=sysv3 |
338 | 337 | ;; |
339 | hp300 | hp300hpux) | |
338 | hp300) | |
340 | 339 | basic_machine=m68k-hp |
341 | os=hpux | |
342 | 340 | ;; |
343 | 341 | hp300bsd) |
344 | 342 | basic_machine=m68k-hp |
345 | 343 | os=bsd |
346 | 344 | ;; |
345 | hp300hpux) | |
346 | basic_machine=m68k-hp | |
347 | os=hpux | |
348 | ;; | |
347 | 349 | hppaosf) |
348 | 350 | basic_machine=hppa1.1-hp |
349 | 351 | os=osf |
356 | 358 | basic_machine=i386-mach |
357 | 359 | os=mach |
358 | 360 | ;; |
361 | vsta) | |
362 | basic_machine=i386-pc | |
363 | os=vsta | |
364 | ;; | |
359 | 365 | isi68 | isi) |
360 | 366 | basic_machine=m68k-isi |
361 | 367 | os=sysv |
603 | 609 | vms) |
604 | 610 | basic_machine=vax-dec |
605 | 611 | os=vms |
606 | ;; | |
607 | vsta) | |
608 | basic_machine=i386-pc | |
609 | os=vsta | |
610 | 612 | ;; |
611 | 613 | vxworks960) |
612 | 614 | basic_machine=i960-wrs |
818 | 820 | cpu=m68k |
819 | 821 | vendor=next |
820 | 822 | case $os in |
821 | openstep*) | |
822 | ;; | |
823 | nextstep*) | |
823 | nextstep* ) | |
824 | 824 | ;; |
825 | 825 | ns2*) |
826 | 826 | os=nextstep2 |
917 | 917 | ;; |
918 | 918 | |
919 | 919 | *-*) |
920 | # shellcheck disable=SC2162 | |
921 | IFS="-" read cpu vendor <<EOF | |
920 | IFS="-" read -r cpu vendor <<EOF | |
922 | 921 | $basic_machine |
923 | 922 | EOF |
924 | 923 | ;; |
950 | 949 | |
951 | 950 | # Decode basic machines in the full and proper CPU-Company form. |
952 | 951 | case $cpu-$vendor in |
953 | # Here we handle the default manufacturer of certain CPU types in canonical form. It is in | |
952 | # Here we handle the default manufacturer of certain CPU types in cannonical form. It is in | |
954 | 953 | # some cases the only manufacturer, in others, it is the most popular. |
955 | 954 | craynv-unknown) |
956 | 955 | vendor=cray |
1101 | 1100 | cpu=`echo "$cpu" | sed 's/^xscale/arm/'` |
1102 | 1101 | ;; |
1103 | 1102 | |
1104 | # Recognize the canonical CPU Types that limit and/or modify the | |
1103 | # Recognize the cannonical CPU Types that limit and/or modify the | |
1105 | 1104 | # company names they are paired with. |
1106 | 1105 | cr16-*) |
1107 | 1106 | os=${os:-elf} |
1150 | 1149 | ;; |
1151 | 1150 | |
1152 | 1151 | *) |
1153 | # Recognize the canonical CPU types that are allowed with any | |
1152 | # Recognize the cannonical CPU types that are allowed with any | |
1154 | 1153 | # company name. |
1155 | 1154 | case $cpu in |
1156 | 1155 | 1750a | 580 \ |
1161 | 1160 | | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ |
1162 | 1161 | | alphapca5[67] | alpha64pca5[67] \ |
1163 | 1162 | | am33_2.0 \ |
1164 | | amdgcn \ | |
1165 | 1163 | | arc | arceb \ |
1166 | 1164 | | arm | arm[lb]e | arme[lb] | armv* \ |
1167 | 1165 | | avr | avr32 \ |
1168 | 1166 | | asmjs \ |
1169 | 1167 | | ba \ |
1170 | 1168 | | be32 | be64 \ |
1171 | | bfin | bpf | bs2000 \ | |
1169 | | bfin | bs2000 \ | |
1172 | 1170 | | c[123]* | c30 | [cjt]90 | c4x \ |
1173 | 1171 | | c8051 | clipper | craynv | csky | cydra \ |
1174 | 1172 | | d10v | d30v | dlx | dsp16xx \ |
1183 | 1181 | | le32 | le64 \ |
1184 | 1182 | | lm32 \ |
1185 | 1183 | | m32c | m32r | m32rle \ |
1186 | | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ | |
1187 | | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ | |
1184 | | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \ | |
1185 | | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \ | |
1188 | 1186 | | m88110 | m88k | maxq | mb | mcore | mep | metag \ |
1189 | 1187 | | microblaze | microblazeel \ |
1190 | 1188 | | mips | mipsbe | mipseb | mipsel | mipsle \ |
1191 | 1189 | | mips16 \ |
1192 | | mips64 | mips64eb | mips64el \ | |
1190 | | mips64 | mips64el \ | |
1193 | 1191 | | mips64octeon | mips64octeonel \ |
1194 | 1192 | | mips64orion | mips64orionel \ |
1195 | 1193 | | mips64r5900 | mips64r5900el \ |
1216 | 1214 | | nds32 | nds32le | nds32be \ |
1217 | 1215 | | nfp \ |
1218 | 1216 | | nios | nios2 | nios2eb | nios2el \ |
1219 | | none | np1 | ns16k | ns32k | nvptx \ | |
1217 | | none | np1 | ns16k | ns32k \ | |
1220 | 1218 | | open8 \ |
1221 | 1219 | | or1k* \ |
1222 | 1220 | | or32 \ |
1223 | 1221 | | orion \ |
1224 | | picochip \ | |
1225 | 1222 | | pdp10 | pdp11 | pj | pjl | pn | power \ |
1226 | 1223 | | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ |
1227 | 1224 | | pru \ |
1229 | 1226 | | riscv | riscv32 | riscv64 \ |
1230 | 1227 | | rl78 | romp | rs6000 | rx \ |
1231 | 1228 | | score \ |
1232 | | sh | shl \ | |
1233 | | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ | |
1229 | | sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ | |
1234 | 1230 | | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ |
1235 | 1231 | | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ |
1236 | 1232 | | sparclite \ |
1240 | 1236 | | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ |
1241 | 1237 | | tron \ |
1242 | 1238 | | ubicom32 \ |
1243 | | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ | |
1239 | | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ | |
1244 | 1240 | | vax \ |
1245 | 1241 | | visium \ |
1246 | | w65 \ | |
1247 | | wasm32 | wasm64 \ | |
1242 | | wasm32 \ | |
1248 | 1243 | | we32k \ |
1249 | 1244 | | x86 | x86_64 | xc16x | xgate | xps100 \ |
1250 | 1245 | | xstormy16 | xtensa* \ |
1342 | 1337 | | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ |
1343 | 1338 | | sym* | kopensolaris* | plan9* \ |
1344 | 1339 | | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ |
1345 | | aos* | aros* | cloudabi* | sortix* | twizzler* \ | |
1340 | | aos* | aros* | cloudabi* | sortix* \ | |
1346 | 1341 | | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ |
1347 | 1342 | | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ |
1348 | 1343 | | knetbsd* | mirbsd* | netbsd* \ |
1349 | | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ | |
1344 | | bitrig* | openbsd* | solidbsd* | libertybsd* \ | |
1350 | 1345 | | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ |
1351 | 1346 | | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ |
1352 | 1347 | | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ |
1364 | 1359 | | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ |
1365 | 1360 | | skyos* | haiku* | rdos* | toppers* | drops* | es* \ |
1366 | 1361 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ |
1367 | | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | |
1368 | | nsk* | powerunix) | |
1362 | | midnightbsd*) | |
1369 | 1363 | # Remember, each alternative MUST END IN *, to match a version number. |
1370 | 1364 | ;; |
1371 | 1365 | qnx*) |
1448 | 1442 | ;; |
1449 | 1443 | ns2) |
1450 | 1444 | os=nextstep2 |
1445 | ;; | |
1446 | nsk*) | |
1447 | os=nsk | |
1451 | 1448 | ;; |
1452 | 1449 | # Preserve the version number of sinix5. |
1453 | 1450 | sinix5.*) |
2 | 2 | |
3 | 3 | scriptversion=2018-03-07.03; # UTC |
4 | 4 | |
5 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
5 | # Copyright (C) 1999-2018 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 |
450 | 450 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 |
451 | 451 | |
452 | 452 | # Copy the file name to the temp name. |
453 | (umask $cp_umask && | |
454 | { test -z "$stripcmd" || { | |
455 | # Create $dsttmp read-write so that cp doesn't create it read-only, | |
456 | # which would cause strip to fail. | |
457 | if test -z "$doit"; then | |
458 | : >"$dsttmp" # No need to fork-exec 'touch'. | |
459 | else | |
460 | $doit touch "$dsttmp" | |
461 | fi | |
462 | } | |
463 | } && | |
464 | $doit_exec $cpprog "$src" "$dsttmp") && | |
453 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && | |
465 | 454 | |
466 | 455 | # and set any options; do chmod last to preserve setuid bits. |
467 | 456 | # |
0 | 0 | #! /bin/sh |
1 | 1 | ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in |
2 | ## by inline-source v2018-07-24.06 | |
3 | ||
4 | # libtool (GNU libtool) 2.4.6.42-b88ce-dirty | |
2 | ## by inline-source v2014-01-03.01 | |
3 | ||
4 | # libtool (GNU libtool) 2.4.6 | |
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-2018 Free Software Foundation, Inc. | |
8 | # Copyright (C) 1996-2015 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.42-b88ce-dirty | |
34 | package_revision=2.4.6.42 | |
33 | VERSION=2.4.6 | |
34 | package_revision=2.4.6 | |
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=2018-07-24.06; # UTC | |
66 | scriptversion=2015-01-20.17; # UTC | |
67 | 67 | |
68 | 68 | # General shell script boiler plate, and helper functions. |
69 | 69 | # Written by Gary V. Vaughan, 2004 |
70 | 70 | |
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-2018 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> | |
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. | |
85 | 94 | |
86 | 95 | |
87 | 96 | ## ------ ## |
130 | 139 | fi" |
131 | 140 | done |
132 | 141 | |
142 | # CDPATH. | |
143 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH | |
144 | ||
133 | 145 | # Make sure IFS has a sensible default |
134 | 146 | sp=' ' |
135 | 147 | nl=' |
145 | 157 | } |
146 | 158 | fi |
147 | 159 | |
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 | |
168 | 160 | |
169 | 161 | |
170 | 162 | ## ------------------------- ## |
266 | 258 | rm -f conftest.in conftest.tmp conftest.nl conftest.out |
267 | 259 | } |
268 | 260 | |
269 | func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" | |
261 | func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin | |
270 | 262 | rm -f conftest.sed |
271 | 263 | SED=$func_path_progs_result |
272 | 264 | } |
302 | 294 | rm -f conftest.in conftest.tmp conftest.nl conftest.out |
303 | 295 | } |
304 | 296 | |
305 | func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" | |
297 | func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin | |
306 | 298 | GREP=$func_path_progs_result |
307 | 299 | } |
308 | 300 | |
587 | 579 | { |
588 | 580 | $debug_cmd |
589 | 581 | |
590 | func_quote_arg pretty "$2" | |
591 | eval "$1+=\\ \$func_quote_arg_result" | |
582 | func_quote_for_eval "$2" | |
583 | eval "$1+=\\ \$func_quote_for_eval_result" | |
592 | 584 | }' |
593 | 585 | else |
594 | 586 | func_append_quoted () |
595 | 587 | { |
596 | 588 | $debug_cmd |
597 | 589 | |
598 | func_quote_arg pretty "$2" | |
599 | eval "$1=\$$1\\ \$func_quote_arg_result" | |
590 | func_quote_for_eval "$2" | |
591 | eval "$1=\$$1\\ \$func_quote_for_eval_result" | |
600 | 592 | } |
601 | 593 | fi |
602 | 594 | |
1098 | 1090 | } |
1099 | 1091 | |
1100 | 1092 | |
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 () | |
1093 | # func_quote_for_eval ARG... | |
1094 | # -------------------------- | |
1095 | # Aesthetically quote ARGs to be evaled later. | |
1096 | # This function returns two values: | |
1097 | # i) func_quote_for_eval_result | |
1098 | # double-quoted, suitable for a subsequent eval | |
1099 | # ii) func_quote_for_eval_unquoted_result | |
1100 | # has all characters that are still active within double | |
1101 | # quotes backslashified. | |
1102 | func_quote_for_eval () | |
1107 | 1103 | { |
1108 | 1104 | $debug_cmd |
1109 | 1105 | |
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 | |
1106 | func_quote_for_eval_unquoted_result= | |
1107 | func_quote_for_eval_result= | |
1108 | while test 0 -lt $#; do | |
1109 | case $1 in | |
1110 | *[\\\`\"\$]*) | |
1111 | _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; | |
1112 | *) | |
1113 | _G_unquoted_arg=$1 ;; | |
1114 | esac | |
1115 | if test -n "$func_quote_for_eval_unquoted_result"; then | |
1116 | func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" | |
1117 | else | |
1118 | func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" | |
1119 | 1119 | fi |
1120 | 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 '\' '`' '"' '$' | |
1134 | do | |
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 | |
1155 | 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\" | |
1172 | ;; | |
1173 | esac | |
1174 | } | |
1175 | ||
1176 | ||
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 | |
1121 | case $_G_unquoted_arg in | |
1122 | # Double-quote args containing shell metacharacters to delay | |
1123 | # word splitting, command substitution and variable expansion | |
1124 | # for a subsequent eval. | |
1125 | # Many Bourne shells cannot handle close brackets correctly | |
1126 | # in scan sets, so we specify it separately. | |
1127 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | |
1128 | _G_quoted_arg=\"$_G_unquoted_arg\" | |
1196 | 1129 | ;; |
1197 | 1130 | *) |
1198 | printf -v func_quotefast_eval_result %q "$1" | |
1199 | ;; | |
1131 | _G_quoted_arg=$_G_unquoted_arg | |
1132 | ;; | |
1200 | 1133 | esac |
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" | |
1134 | ||
1135 | if test -n "$func_quote_for_eval_result"; then | |
1136 | func_append func_quote_for_eval_result " $_G_quoted_arg" | |
1289 | 1137 | else |
1290 | func_append func_quote_result "$func_quote_arg_result" | |
1138 | func_append func_quote_for_eval_result "$_G_quoted_arg" | |
1291 | 1139 | fi |
1292 | 1140 | shift |
1293 | 1141 | done |
1142 | } | |
1143 | ||
1144 | ||
1145 | # func_quote_for_expand ARG | |
1146 | # ------------------------- | |
1147 | # Aesthetically quote ARG to be evaled later; same as above, | |
1148 | # but do not quote variable references. | |
1149 | func_quote_for_expand () | |
1150 | { | |
1151 | $debug_cmd | |
1152 | ||
1153 | case $1 in | |
1154 | *[\\\`\"]*) | |
1155 | _G_arg=`$ECHO "$1" | $SED \ | |
1156 | -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; | |
1157 | *) | |
1158 | _G_arg=$1 ;; | |
1159 | esac | |
1160 | ||
1161 | case $_G_arg in | |
1162 | # Double-quote args containing shell metacharacters to delay | |
1163 | # word splitting and command substitution for a subsequent eval. | |
1164 | # Many Bourne shells cannot handle close brackets correctly | |
1165 | # in scan sets, so we specify it separately. | |
1166 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | |
1167 | _G_arg=\"$_G_arg\" | |
1168 | ;; | |
1169 | esac | |
1170 | ||
1171 | func_quote_for_expand_result=$_G_arg | |
1294 | 1172 | } |
1295 | 1173 | |
1296 | 1174 | |
1336 | 1214 | _G_cmd=$1 |
1337 | 1215 | _G_fail_exp=${2-':'} |
1338 | 1216 | |
1339 | func_quote_arg pretty,expand "$_G_cmd" | |
1340 | eval "func_notquiet $func_quote_arg_result" | |
1217 | func_quote_for_expand "$_G_cmd" | |
1218 | eval "func_notquiet $func_quote_for_expand_result" | |
1341 | 1219 | |
1342 | 1220 | $opt_dry_run || { |
1343 | 1221 | eval "$_G_cmd" |
1362 | 1240 | _G_fail_exp=${2-':'} |
1363 | 1241 | |
1364 | 1242 | $opt_quiet || { |
1365 | func_quote_arg expand,pretty "$_G_cmd" | |
1366 | eval "func_echo $func_quote_arg_result" | |
1243 | func_quote_for_expand "$_G_cmd" | |
1244 | eval "func_echo $func_quote_for_expand_result" | |
1367 | 1245 | } |
1368 | 1246 | |
1369 | 1247 | $opt_dry_run || { |
1490 | 1368 | # End: |
1491 | 1369 | #! /bin/sh |
1492 | 1370 | |
1371 | # Set a version string for this script. | |
1372 | scriptversion=2014-01-07.03; # UTC | |
1373 | ||
1493 | 1374 | # A portable, pluggable option parser for Bourne shell. |
1494 | 1375 | # Written by Gary V. Vaughan, 2010 |
1495 | 1376 | |
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-2018 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=2018-07-24.06; # UTC | |
1377 | # Copyright (C) 2010-2015 Free Software Foundation, Inc. | |
1378 | # This is free software; see the source for copying conditions. There is NO | |
1379 | # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
1380 | ||
1381 | # This program is free software: you can redistribute it and/or modify | |
1382 | # it under the terms of the GNU General Public License as published by | |
1383 | # the Free Software Foundation, either version 3 of the License, or | |
1384 | # (at your option) any later version. | |
1385 | ||
1386 | # This program is distributed in the hope that it will be useful, | |
1387 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
1388 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
1389 | # GNU General Public License for more details. | |
1390 | ||
1391 | # You should have received a copy of the GNU General Public License | |
1392 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
1393 | ||
1394 | # Please report bugs or propose patches to gary@gnu.org. | |
1513 | 1395 | |
1514 | 1396 | |
1515 | 1397 | ## ------ ## |
1532 | 1414 | # |
1533 | 1415 | # In order for the '--version' option to work, you will need to have a |
1534 | 1416 | # suitably formatted comment like the one at the top of this file |
1535 | # starting with '# Written by ' and ending with '# Copyright'. | |
1417 | # starting with '# Written by ' and ending with '# warranty; '. | |
1536 | 1418 | # |
1537 | 1419 | # For '-h' and '--help' to work, you will also need a one line |
1538 | 1420 | # description of your script's purpose in a comment directly above the |
1544 | 1426 | # to display verbose messages only when your user has specified |
1545 | 1427 | # '--verbose'. |
1546 | 1428 | # |
1547 | # After sourcing this file, you can plug in processing for additional | |
1429 | # After sourcing this file, you can plug processing for additional | |
1548 | 1430 | # options by amending the variables from the 'Configuration' section |
1549 | 1431 | # below, and following the instructions in the 'Option parsing' |
1550 | 1432 | # section further down. |
1593 | 1475 | ## ------------------------- ## |
1594 | 1476 | |
1595 | 1477 | # This section contains functions for adding, removing, and running hooks |
1596 | # in the main code. A hook is just a list of function names that can be | |
1597 | # run in order later on. | |
1478 | # to the main code. A hook is just a named list of of function, that can | |
1479 | # be run in order later on. | |
1598 | 1480 | |
1599 | 1481 | # func_hookable FUNC_NAME |
1600 | 1482 | # ----------------------- |
1627 | 1509 | |
1628 | 1510 | # func_remove_hook FUNC_NAME HOOK_FUNC |
1629 | 1511 | # ------------------------------------ |
1630 | # Remove HOOK_FUNC from the list of hook functions to be called by | |
1631 | # FUNC_NAME. | |
1512 | # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. | |
1632 | 1513 | func_remove_hook () |
1633 | 1514 | { |
1634 | 1515 | $debug_cmd |
1635 | 1516 | |
1636 | 1517 | 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 | |
1655 | 1518 | } |
1656 | 1519 | |
1657 | 1520 | |
1658 | 1521 | # func_run_hooks FUNC_NAME [ARG]... |
1659 | 1522 | # --------------------------------- |
1660 | 1523 | # Run all hook functions registered to FUNC_NAME. |
1661 | # It's assumed that the list of hook functions contains nothing more | |
1524 | # It is assumed that the list of hook functions contains nothing more | |
1662 | 1525 | # than a whitespace-delimited list of legal shell function names, and |
1663 | 1526 | # no effort is wasted trying to catch shell meta-characters or preserve |
1664 | 1527 | # whitespace. |
1668 | 1531 | |
1669 | 1532 | case " $hookable_fns " in |
1670 | 1533 | *" $1 "*) ;; |
1671 | *) func_fatal_error "'$1' does not support hook functions." ;; | |
1534 | *) func_fatal_error "'$1' does not support hook funcions.n" ;; | |
1672 | 1535 | esac |
1673 | 1536 | |
1674 | 1537 | eval _G_hook_fns=\$$1_hooks; shift |
1675 | 1538 | |
1676 | 1539 | for _G_hook in $_G_hook_fns; do |
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 | |
1540 | eval $_G_hook '"$@"' | |
1541 | ||
1542 | # store returned options list back into positional | |
1543 | # parameters for next 'cmd' execution. | |
1544 | eval _G_hook_result=\$${_G_hook}_result | |
1545 | eval set dummy "$_G_hook_result"; shift | |
1683 | 1546 | done |
1547 | ||
1548 | func_quote_for_eval ${1+"$@"} | |
1549 | func_run_hooks_result=$func_quote_for_eval_result | |
1684 | 1550 | } |
1685 | 1551 | |
1686 | 1552 | |
1690 | 1556 | ## --------------- ## |
1691 | 1557 | |
1692 | 1558 | # In order to add your own option parsing hooks, you must accept the |
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: | |
1559 | # full positional parameter list in your hook function, remove any | |
1560 | # options that you action, and then pass back the remaining unprocessed | |
1561 | # options in '<hooked_function_name>_result', escaped suitably for | |
1562 | # 'eval'. Like this: | |
1705 | 1563 | # |
1706 | 1564 | # my_options_prep () |
1707 | 1565 | # { |
1711 | 1569 | # usage_message=$usage_message' |
1712 | 1570 | # -s, --silent don'\''t print informational messages |
1713 | 1571 | # ' |
1714 | # # No change in '$@' (ignored completely by this hook). Leave | |
1715 | # # my_options_prep_result variable intact. | |
1572 | # | |
1573 | # func_quote_for_eval ${1+"$@"} | |
1574 | # my_options_prep_result=$func_quote_for_eval_result | |
1716 | 1575 | # } |
1717 | 1576 | # func_add_hook func_options_prep my_options_prep |
1718 | 1577 | # |
1721 | 1580 | # { |
1722 | 1581 | # $debug_cmd |
1723 | 1582 | # |
1724 | # args_changed=false | |
1725 | # | |
1726 | # # Note that, for efficiency, we parse as many options as we can | |
1583 | # # Note that for efficiency, we parse as many options as we can | |
1727 | 1584 | # # recognise in a loop before passing the remainder back to the |
1728 | 1585 | # # caller on the first unrecognised argument we encounter. |
1729 | 1586 | # while test $# -gt 0; do |
1730 | 1587 | # opt=$1; shift |
1731 | 1588 | # case $opt in |
1732 | # --silent|-s) opt_silent=: | |
1733 | # args_changed=: | |
1734 | # ;; | |
1589 | # --silent|-s) opt_silent=: ;; | |
1735 | 1590 | # # Separate non-argument short options: |
1736 | 1591 | # -s*) func_split_short_opt "$_G_opt" |
1737 | 1592 | # set dummy "$func_split_short_opt_name" \ |
1738 | 1593 | # "-$func_split_short_opt_arg" ${1+"$@"} |
1739 | 1594 | # shift |
1740 | # args_changed=: | |
1741 | 1595 | # ;; |
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 ;; | |
1596 | # *) set dummy "$_G_opt" "$*"; shift; break ;; | |
1746 | 1597 | # esac |
1747 | 1598 | # done |
1748 | 1599 | # |
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 | |
1600 | # func_quote_for_eval ${1+"$@"} | |
1601 | # my_silent_option_result=$func_quote_for_eval_result | |
1754 | 1602 | # } |
1755 | 1603 | # func_add_hook func_parse_options my_silent_option |
1756 | 1604 | # |
1761 | 1609 | # |
1762 | 1610 | # $opt_silent && $opt_verbose && func_fatal_help "\ |
1763 | 1611 | # '--silent' and '--verbose' options are mutually exclusive." |
1612 | # | |
1613 | # func_quote_for_eval ${1+"$@"} | |
1614 | # my_option_validation_result=$func_quote_for_eval_result | |
1764 | 1615 | # } |
1765 | 1616 | # func_add_hook func_validate_options my_option_validation |
1766 | 1617 | # |
1767 | # You'll also need to manually amend $usage_message to reflect the extra | |
1618 | # You'll alse need to manually amend $usage_message to reflect the extra | |
1768 | 1619 | # options you parse. It's preferable to append if you can, so that |
1769 | 1620 | # 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 | } | |
1782 | 1621 | |
1783 | 1622 | |
1784 | 1623 | # func_options [ARG]... |
1790 | 1629 | { |
1791 | 1630 | $debug_cmd |
1792 | 1631 | |
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 | } | |
1632 | func_options_prep ${1+"$@"} | |
1633 | eval func_parse_options \ | |
1634 | ${func_options_prep_result+"$func_options_prep_result"} | |
1635 | eval func_validate_options \ | |
1636 | ${func_parse_options_result+"$func_parse_options_result"} | |
1637 | ||
1638 | eval func_run_hooks func_options \ | |
1639 | ${func_validate_options_result+"$func_validate_options_result"} | |
1640 | ||
1641 | # save modified positional parameters for caller | |
1642 | func_options_result=$func_run_hooks_result | |
1814 | 1643 | } |
1815 | 1644 | |
1816 | 1645 | |
1819 | 1648 | # All initialisations required before starting the option parse loop. |
1820 | 1649 | # Note that when calling hook functions, we pass through the list of |
1821 | 1650 | # positional parameters. If a hook function modifies that list, and |
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. | |
1651 | # needs to propogate that back to rest of this script, then the complete | |
1652 | # modified list must be put in 'func_run_hooks_result' before | |
1653 | # returning. | |
1824 | 1654 | func_hookable func_options_prep |
1825 | 1655 | func_options_prep () |
1826 | 1656 | { |
1831 | 1661 | opt_warning_types= |
1832 | 1662 | |
1833 | 1663 | func_run_hooks func_options_prep ${1+"$@"} |
1834 | func_propagate_result func_run_hooks func_options_prep | |
1664 | ||
1665 | # save modified positional parameters for caller | |
1666 | func_options_prep_result=$func_run_hooks_result | |
1835 | 1667 | } |
1836 | 1668 | |
1837 | 1669 | |
1843 | 1675 | { |
1844 | 1676 | $debug_cmd |
1845 | 1677 | |
1846 | _G_parse_options_requote=false | |
1678 | func_parse_options_result= | |
1679 | ||
1847 | 1680 | # this just eases exit handling |
1848 | 1681 | while test $# -gt 0; do |
1849 | 1682 | # Defer to hook functions for initial option parsing, so they |
1850 | 1683 | # get priority in the event of reusing an option name. |
1851 | 1684 | func_run_hooks func_parse_options ${1+"$@"} |
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 | |
1685 | ||
1686 | # Adjust func_parse_options positional parameters to match | |
1687 | eval set dummy "$func_run_hooks_result"; shift | |
1860 | 1688 | |
1861 | 1689 | # Break out of the loop if we already parsed every option. |
1862 | 1690 | test $# -gt 0 || break |
1863 | 1691 | |
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=: | |
1867 | 1692 | _G_opt=$1 |
1868 | 1693 | shift |
1869 | 1694 | case $_G_opt in |
1870 | 1695 | --debug|-x) debug_cmd='set -x' |
1871 | func_echo "enabling shell trace mode" >&2 | |
1696 | func_echo "enabling shell trace mode" | |
1872 | 1697 | $debug_cmd |
1873 | 1698 | ;; |
1874 | 1699 | |
1878 | 1703 | ;; |
1879 | 1704 | |
1880 | 1705 | --warnings|--warning|-W) |
1881 | if test $# = 0 && func_missing_arg $_G_opt; then | |
1882 | _G_parse_options_requote=: | |
1883 | break | |
1884 | fi | |
1706 | test $# = 0 && func_missing_arg $_G_opt && break | |
1885 | 1707 | case " $warning_categories $1" in |
1886 | 1708 | *" $1 "*) |
1887 | 1709 | # trailing space prevents matching last $1 above |
1934 | 1756 | shift |
1935 | 1757 | ;; |
1936 | 1758 | |
1937 | --) _G_parse_options_requote=: ; break ;; | |
1759 | --) break ;; | |
1938 | 1760 | -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; |
1939 | *) set dummy "$_G_opt" ${1+"$@"}; shift | |
1940 | _G_match_parse_options=false | |
1941 | break | |
1942 | ;; | |
1761 | *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; | |
1943 | 1762 | esac |
1944 | ||
1945 | if $_G_match_parse_options; then | |
1946 | _G_parse_options_requote=: | |
1947 | fi | |
1948 | 1763 | done |
1949 | 1764 | |
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 | |
1765 | # save modified positional parameters for caller | |
1766 | func_quote_for_eval ${1+"$@"} | |
1767 | func_parse_options_result=$func_quote_for_eval_result | |
1955 | 1768 | } |
1956 | 1769 | |
1957 | 1770 | |
1968 | 1781 | test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" |
1969 | 1782 | |
1970 | 1783 | func_run_hooks func_validate_options ${1+"$@"} |
1971 | func_propagate_result func_run_hooks func_validate_options | |
1972 | 1784 | |
1973 | 1785 | # Bail if the options were screwed! |
1974 | 1786 | $exit_cmd $EXIT_FAILURE |
1787 | ||
1788 | # save modified positional parameters for caller | |
1789 | func_validate_options_result=$func_run_hooks_result | |
1975 | 1790 | } |
1976 | 1791 | |
1977 | 1792 | |
2027 | 1842 | |
2028 | 1843 | # func_split_equals STRING |
2029 | 1844 | # ------------------------ |
2030 | # Set func_split_equals_lhs and func_split_equals_rhs shell variables | |
2031 | # after splitting STRING at the '=' sign. | |
1845 | # Set func_split_equals_lhs and func_split_equals_rhs shell variables after | |
1846 | # splitting STRING at the '=' sign. | |
2032 | 1847 | test -z "$_G_HAVE_XSI_OPS" \ |
2033 | 1848 | && (eval 'x=a/b/c; |
2034 | 1849 | test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ |
2043 | 1858 | |
2044 | 1859 | func_split_equals_lhs=${1%%=*} |
2045 | 1860 | func_split_equals_rhs=${1#*=} |
2046 | if test "x$func_split_equals_lhs" = "x$1"; then | |
2047 | func_split_equals_rhs= | |
2048 | fi | |
1861 | test "x$func_split_equals_lhs" = "x$1" \ | |
1862 | && func_split_equals_rhs= | |
2049 | 1863 | }' |
2050 | 1864 | else |
2051 | 1865 | # ...otherwise fall back to using expr, which is often a shell builtin. |
2123 | 1937 | # func_version |
2124 | 1938 | # ------------ |
2125 | 1939 | # 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. | |
2135 | 1940 | func_version () |
2136 | 1941 | { |
2137 | 1942 | $debug_cmd |
2138 | 1943 | |
2139 | 1944 | printf '%s\n' "$progname $scriptversion" |
2140 | 1945 | $SED -n ' |
2141 | /^# Written by /!b | |
2142 | s|^# ||; p; n | |
2143 | ||
2144 | :fwd2blnk | |
2145 | /./ { | |
2146 | n | |
2147 | b fwd2blnk | |
1946 | /(C)/!b go | |
1947 | :more | |
1948 | /\./!{ | |
1949 | N | |
1950 | s|\n# | | | |
1951 | b more | |
2148 | 1952 | } |
2149 | p; n | |
2150 | ||
2151 | :holdwrnt | |
2152 | s|^# || | |
2153 | s|^# *$|| | |
2154 | /^Copyright /!{ | |
2155 | /./H | |
2156 | n | |
2157 | b holdwrnt | |
1953 | :go | |
1954 | /^# Written by /,/# warranty; / { | |
1955 | s|^# || | |
1956 | s|^# *$|| | |
1957 | s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| | |
1958 | p | |
2158 | 1959 | } |
2159 | ||
2160 | s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| | |
2161 | G | |
2162 | s|\(\n\)\n*|\1|g | |
2163 | p; q' < "$progpath" | |
1960 | /^# Written by / { | |
1961 | s|^# || | |
1962 | p | |
1963 | } | |
1964 | /^warranty; /q' < "$progpath" | |
2164 | 1965 | |
2165 | 1966 | exit $? |
2166 | 1967 | } |
2170 | 1971 | # mode: shell-script |
2171 | 1972 | # sh-indentation: 2 |
2172 | 1973 | # eval: (add-hook 'before-save-hook 'time-stamp) |
2173 | # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" | |
1974 | # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" | |
2174 | 1975 | # time-stamp-time-zone: "UTC" |
2175 | 1976 | # End: |
2176 | 1977 | |
2177 | 1978 | # Set a version string. |
2178 | scriptversion='(GNU libtool) 2.4.6.42-b88ce-dirty' | |
1979 | scriptversion='(GNU libtool) 2.4.6' | |
2179 | 1980 | |
2180 | 1981 | |
2181 | 1982 | # func_echo ARG... |
2266 | 2067 | compiler: $LTCC |
2267 | 2068 | compiler flags: $LTCFLAGS |
2268 | 2069 | linker: $LD (gnu? $with_gnu_ld) |
2269 | version: $progname (GNU libtool) 2.4.6.42-b88ce-dirty | |
2070 | version: $progname (GNU libtool) 2.4.6 | |
2270 | 2071 | automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` |
2271 | 2072 | autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` |
2272 | 2073 | |
2273 | 2074 | Report bugs to <bug-libtool@gnu.org>. |
2274 | GNU libtool home page: <http://www.gnu.org/s/libtool/>. | |
2075 | GNU libtool home page: <http://www.gnu.org/software/libtool/>. | |
2275 | 2076 | General help using GNU software: <http://www.gnu.org/gethelp/>." |
2276 | 2077 | exit 0 |
2277 | 2078 | } |
2468 | 2269 | nonopt= |
2469 | 2270 | preserve_args= |
2470 | 2271 | |
2471 | _G_rc_lt_options_prep=: | |
2472 | ||
2473 | 2272 | # Shorthand for --mode=foo, only valid as the first argument |
2474 | 2273 | case $1 in |
2475 | 2274 | clean|clea|cle|cl) |
2493 | 2292 | uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) |
2494 | 2293 | shift; set dummy --mode uninstall ${1+"$@"}; shift |
2495 | 2294 | ;; |
2496 | *) | |
2497 | _G_rc_lt_options_prep=false | |
2498 | ;; | |
2499 | 2295 | esac |
2500 | 2296 | |
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 | |
2297 | # Pass back the list of options. | |
2298 | func_quote_for_eval ${1+"$@"} | |
2299 | libtool_options_prep_result=$func_quote_for_eval_result | |
2506 | 2300 | } |
2507 | 2301 | func_add_hook func_options_prep libtool_options_prep |
2508 | 2302 | |
2514 | 2308 | { |
2515 | 2309 | $debug_cmd |
2516 | 2310 | |
2517 | _G_rc_lt_parse_options=false | |
2518 | ||
2519 | 2311 | # Perform our own loop to consume as many options as possible in |
2520 | 2312 | # each iteration. |
2521 | 2313 | while test $# -gt 0; do |
2522 | _G_match_lt_parse_options=: | |
2523 | 2314 | _G_opt=$1 |
2524 | 2315 | shift |
2525 | 2316 | case $_G_opt in |
2594 | 2385 | func_append preserve_args " $_G_opt" |
2595 | 2386 | ;; |
2596 | 2387 | |
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 | ;; | |
2388 | # An option not handled by this hook function: | |
2389 | *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; | |
2602 | 2390 | esac |
2603 | $_G_match_lt_parse_options && _G_rc_lt_parse_options=: | |
2604 | 2391 | done |
2605 | 2392 | |
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 | |
2393 | ||
2394 | # save modified positional parameters for caller | |
2395 | func_quote_for_eval ${1+"$@"} | |
2396 | libtool_parse_options_result=$func_quote_for_eval_result | |
2611 | 2397 | } |
2612 | 2398 | func_add_hook func_parse_options libtool_parse_options |
2613 | 2399 | |
2664 | 2450 | } |
2665 | 2451 | |
2666 | 2452 | # Pass back the unparsed argument list |
2667 | func_quote eval ${1+"$@"} | |
2668 | libtool_validate_options_result=$func_quote_result | |
2453 | func_quote_for_eval ${1+"$@"} | |
2454 | libtool_validate_options_result=$func_quote_for_eval_result | |
2669 | 2455 | } |
2670 | 2456 | func_add_hook func_validate_options libtool_validate_options |
2671 | 2457 | |
3631 | 3417 | esac |
3632 | 3418 | done |
3633 | 3419 | |
3634 | func_quote_arg pretty "$libobj" | |
3635 | test "X$libobj" != "X$func_quote_arg_result" \ | |
3420 | func_quote_for_eval "$libobj" | |
3421 | test "X$libobj" != "X$func_quote_for_eval_result" \ | |
3636 | 3422 | && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ |
3637 | 3423 | && func_warning "libobj name '$libobj' may not contain shell special characters." |
3638 | 3424 | func_dirname_and_basename "$obj" "/" "" |
3705 | 3491 | |
3706 | 3492 | func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 |
3707 | 3493 | srcfile=$func_to_tool_file_result |
3708 | func_quote_arg pretty "$srcfile" | |
3709 | qsrcfile=$func_quote_arg_result | |
3494 | func_quote_for_eval "$srcfile" | |
3495 | qsrcfile=$func_quote_for_eval_result | |
3710 | 3496 | |
3711 | 3497 | # Only build a PIC object if we are building libtool libraries. |
3712 | 3498 | if test yes = "$build_libtool_libs"; then |
4309 | 4095 | case $nonopt in *shtool*) :;; *) false;; esac |
4310 | 4096 | then |
4311 | 4097 | # Aesthetically quote it. |
4312 | func_quote_arg pretty "$nonopt" | |
4313 | install_prog="$func_quote_arg_result " | |
4098 | func_quote_for_eval "$nonopt" | |
4099 | install_prog="$func_quote_for_eval_result " | |
4314 | 4100 | arg=$1 |
4315 | 4101 | shift |
4316 | 4102 | else |
4320 | 4106 | |
4321 | 4107 | # The real first argument should be the name of the installation program. |
4322 | 4108 | # Aesthetically quote it. |
4323 | func_quote_arg pretty "$arg" | |
4324 | func_append install_prog "$func_quote_arg_result" | |
4109 | func_quote_for_eval "$arg" | |
4110 | func_append install_prog "$func_quote_for_eval_result" | |
4325 | 4111 | install_shared_prog=$install_prog |
4326 | 4112 | case " $install_prog " in |
4327 | 4113 | *[\\\ /]cp\ *) install_cp=: ;; |
4378 | 4164 | esac |
4379 | 4165 | |
4380 | 4166 | # Aesthetically quote the argument. |
4381 | func_quote_arg pretty "$arg" | |
4382 | func_append install_prog " $func_quote_arg_result" | |
4167 | func_quote_for_eval "$arg" | |
4168 | func_append install_prog " $func_quote_for_eval_result" | |
4383 | 4169 | if test -n "$arg2"; then |
4384 | func_quote_arg pretty "$arg2" | |
4170 | func_quote_for_eval "$arg2" | |
4385 | 4171 | fi |
4386 | func_append install_shared_prog " $func_quote_arg_result" | |
4172 | func_append install_shared_prog " $func_quote_for_eval_result" | |
4387 | 4173 | done |
4388 | 4174 | |
4389 | 4175 | test -z "$install_prog" && \ |
4394 | 4180 | |
4395 | 4181 | if test -n "$install_override_mode" && $no_mode; then |
4396 | 4182 | if $install_cp; then :; else |
4397 | func_quote_arg pretty "$install_override_mode" | |
4398 | func_append install_shared_prog " -m $func_quote_arg_result" | |
4183 | func_quote_for_eval "$install_override_mode" | |
4184 | func_append install_shared_prog " -m $func_quote_for_eval_result" | |
4399 | 4185 | fi |
4400 | 4186 | fi |
4401 | 4187 | |
4691 | 4477 | relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` |
4692 | 4478 | |
4693 | 4479 | $opt_quiet || { |
4694 | func_quote_arg expand,pretty "$relink_command" | |
4695 | eval "func_echo $func_quote_arg_result" | |
4480 | func_quote_for_expand "$relink_command" | |
4481 | eval "func_echo $func_quote_for_expand_result" | |
4696 | 4482 | } |
4697 | 4483 | if eval "$relink_command"; then : |
4698 | 4484 | else |
5471 | 5257 | if test \"\$libtool_execute_magic\" != \"$magic\"; then |
5472 | 5258 | file=\"\$0\"" |
5473 | 5259 | |
5474 | func_quote_arg pretty "$ECHO" | |
5475 | qECHO=$func_quote_arg_result | |
5260 | qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` | |
5476 | 5261 | $ECHO "\ |
5477 | 5262 | |
5478 | 5263 | # A function that is used when there is no print builtin or printf. |
5482 | 5267 | \$1 |
5483 | 5268 | _LTECHO_EOF' |
5484 | 5269 | } |
5485 | ECHO=$qECHO | |
5270 | ECHO=\"$qECHO\" | |
5486 | 5271 | fi |
5487 | 5272 | |
5488 | 5273 | # Very basic option parsing. These options are (a) specific to |
6825 | 6610 | while test "$#" -gt 0; do |
6826 | 6611 | arg=$1 |
6827 | 6612 | shift |
6828 | func_quote_arg pretty,unquoted "$arg" | |
6829 | qarg=$func_quote_arg_unquoted_result | |
6830 | func_append libtool_args " $func_quote_arg_result" | |
6613 | func_quote_for_eval "$arg" | |
6614 | qarg=$func_quote_for_eval_unquoted_result | |
6615 | func_append libtool_args " $func_quote_for_eval_result" | |
6831 | 6616 | |
6832 | 6617 | # If the previous option needs an argument, assign it. |
6833 | 6618 | if test -n "$prev"; then |
7425 | 7210 | save_ifs=$IFS; IFS=, |
7426 | 7211 | for flag in $args; do |
7427 | 7212 | IFS=$save_ifs |
7428 | func_quote_arg pretty "$flag" | |
7429 | func_append arg " $func_quote_arg_result" | |
7430 | func_append compiler_flags " $func_quote_arg_result" | |
7213 | func_quote_for_eval "$flag" | |
7214 | func_append arg " $func_quote_for_eval_result" | |
7215 | func_append compiler_flags " $func_quote_for_eval_result" | |
7431 | 7216 | done |
7432 | 7217 | IFS=$save_ifs |
7433 | 7218 | func_stripname ' ' '' "$arg" |
7441 | 7226 | save_ifs=$IFS; IFS=, |
7442 | 7227 | for flag in $args; do |
7443 | 7228 | IFS=$save_ifs |
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" | |
7229 | func_quote_for_eval "$flag" | |
7230 | func_append arg " $wl$func_quote_for_eval_result" | |
7231 | func_append compiler_flags " $wl$func_quote_for_eval_result" | |
7232 | func_append linker_flags " $func_quote_for_eval_result" | |
7448 | 7233 | done |
7449 | 7234 | IFS=$save_ifs |
7450 | 7235 | func_stripname ' ' '' "$arg" |
7468 | 7253 | |
7469 | 7254 | # -msg_* for osf cc |
7470 | 7255 | -msg_*) |
7471 | func_quote_arg pretty "$arg" | |
7472 | arg=$func_quote_arg_result | |
7256 | func_quote_for_eval "$arg" | |
7257 | arg=$func_quote_for_eval_result | |
7473 | 7258 | ;; |
7474 | 7259 | |
7475 | 7260 | # Flags to be passed through unchanged, with rationale: |
7488 | 7273 | # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization |
7489 | 7274 | # -specs=* GCC specs files |
7490 | 7275 | # -stdlib=* select c++ std lib with clang |
7491 | # -fsanitize=* Clang/GCC memory and address sanitizer | |
7492 | # -fuse-ld=* Linker select flags for GCC | |
7493 | 7276 | -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ |
7494 | 7277 | -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ |
7495 | 7278 | -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ |
7496 | -specs=*|-fsanitize=*|-fuse-ld=*) | |
7497 | func_quote_arg pretty "$arg" | |
7498 | arg=$func_quote_arg_result | |
7279 | -specs=*) | |
7280 | func_quote_for_eval "$arg" | |
7281 | arg=$func_quote_for_eval_result | |
7499 | 7282 | func_append compile_command " $arg" |
7500 | 7283 | func_append finalize_command " $arg" |
7501 | 7284 | func_append compiler_flags " $arg" |
7516 | 7299 | continue |
7517 | 7300 | else |
7518 | 7301 | # Otherwise treat like 'Some other compiler flag' below |
7519 | func_quote_arg pretty "$arg" | |
7520 | arg=$func_quote_arg_result | |
7302 | func_quote_for_eval "$arg" | |
7303 | arg=$func_quote_for_eval_result | |
7521 | 7304 | fi |
7522 | 7305 | ;; |
7523 | 7306 | |
7524 | 7307 | # Some other compiler flag. |
7525 | 7308 | -* | +*) |
7526 | func_quote_arg pretty "$arg" | |
7527 | arg=$func_quote_arg_result | |
7309 | func_quote_for_eval "$arg" | |
7310 | arg=$func_quote_for_eval_result | |
7528 | 7311 | ;; |
7529 | 7312 | |
7530 | 7313 | *.$objext) |
7644 | 7427 | *) |
7645 | 7428 | # Unknown arguments in both finalize_command and compile_command need |
7646 | 7429 | # to be aesthetically quoted because they are evaled later. |
7647 | func_quote_arg pretty "$arg" | |
7648 | arg=$func_quote_arg_result | |
7430 | func_quote_for_eval "$arg" | |
7431 | arg=$func_quote_for_eval_result | |
7649 | 7432 | ;; |
7650 | 7433 | esac # arg |
7651 | 7434 | |
10151 | 9934 | for cmd in $concat_cmds; do |
10152 | 9935 | IFS=$save_ifs |
10153 | 9936 | $opt_quiet || { |
10154 | func_quote_arg expand,pretty "$cmd" | |
10155 | eval "func_echo $func_quote_arg_result" | |
9937 | func_quote_for_expand "$cmd" | |
9938 | eval "func_echo $func_quote_for_expand_result" | |
10156 | 9939 | } |
10157 | 9940 | $opt_dry_run || eval "$cmd" || { |
10158 | 9941 | lt_exit=$? |
10245 | 10028 | eval cmd=\"$cmd\" |
10246 | 10029 | IFS=$save_ifs |
10247 | 10030 | $opt_quiet || { |
10248 | func_quote_arg expand,pretty "$cmd" | |
10249 | eval "func_echo $func_quote_arg_result" | |
10031 | func_quote_for_expand "$cmd" | |
10032 | eval "func_echo $func_quote_for_expand_result" | |
10250 | 10033 | } |
10251 | 10034 | $opt_dry_run || eval "$cmd" || { |
10252 | 10035 | lt_exit=$? |
10720 | 10503 | elif eval var_value=\$$var; test -z "$var_value"; then |
10721 | 10504 | relink_command="$var=; export $var; $relink_command" |
10722 | 10505 | else |
10723 | func_quote_arg pretty "$var_value" | |
10724 | relink_command="$var=$func_quote_arg_result; export $var; $relink_command" | |
10506 | func_quote_for_eval "$var_value" | |
10507 | relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" | |
10725 | 10508 | fi |
10726 | 10509 | done |
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 | |
10510 | relink_command="(cd `pwd`; $relink_command)" | |
10511 | relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` | |
10730 | 10512 | fi |
10731 | 10513 | |
10732 | 10514 | # Only actually do things if not in dry run mode. |
10966 | 10748 | elif eval var_value=\$$var; test -z "$var_value"; then |
10967 | 10749 | relink_command="$var=; export $var; $relink_command" |
10968 | 10750 | else |
10969 | func_quote_arg pretty,unquoted "$var_value" | |
10970 | relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" | |
10751 | func_quote_for_eval "$var_value" | |
10752 | relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" | |
10971 | 10753 | fi |
10972 | 10754 | done |
10973 | 10755 | # Quote the link command for shipping. |
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 | |
10756 | relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" | |
10757 | relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` | |
10978 | 10758 | if test yes = "$hardcode_automatic"; then |
10979 | 10759 | relink_command= |
10980 | 10760 | fi |
2 | 2 | |
3 | 3 | scriptversion=2018-03-07.03; # UTC |
4 | 4 | |
5 | # Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
5 | # Copyright (C) 1996-2018 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 |
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.5.0. | |
2 | # Generated by GNU Autoconf 2.69 for libseccomp 2.5.1. | |
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.5.0' | |
590 | PACKAGE_STRING='libseccomp 2.5.0' | |
589 | PACKAGE_VERSION='2.5.1' | |
590 | PACKAGE_STRING='libseccomp 2.5.1' | |
591 | 591 | PACKAGE_BUGREPORT='' |
592 | 592 | PACKAGE_URL='' |
593 | 593 | |
1347 | 1347 | # Omit some internal or obsolete options to make the list less imposing. |
1348 | 1348 | # This message is too long to be a string in the A/UX 3.1 sh. |
1349 | 1349 | cat <<_ACEOF |
1350 | \`configure' configures libseccomp 2.5.0 to adapt to many kinds of systems. | |
1350 | \`configure' configures libseccomp 2.5.1 to adapt to many kinds of systems. | |
1351 | 1351 | |
1352 | 1352 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1353 | 1353 | |
1417 | 1417 | |
1418 | 1418 | if test -n "$ac_init_help"; then |
1419 | 1419 | case $ac_init_help in |
1420 | short | recursive ) echo "Configuration of libseccomp 2.5.0:";; | |
1420 | short | recursive ) echo "Configuration of libseccomp 2.5.1:";; | |
1421 | 1421 | esac |
1422 | 1422 | cat <<\_ACEOF |
1423 | 1423 | |
1531 | 1531 | test -n "$ac_init_help" && exit $ac_status |
1532 | 1532 | if $ac_init_version; then |
1533 | 1533 | cat <<\_ACEOF |
1534 | libseccomp configure 2.5.0 | |
1534 | libseccomp configure 2.5.1 | |
1535 | 1535 | generated by GNU Autoconf 2.69 |
1536 | 1536 | |
1537 | 1537 | Copyright (C) 2012 Free Software Foundation, Inc. |
1809 | 1809 | This file contains any messages produced by compilers while |
1810 | 1810 | running configure, to aid debugging if configure makes a mistake. |
1811 | 1811 | |
1812 | It was created by libseccomp $as_me 2.5.0, which was | |
1812 | It was created by libseccomp $as_me 2.5.1, which was | |
1813 | 1813 | generated by GNU Autoconf 2.69. Invocation command line was |
1814 | 1814 | |
1815 | 1815 | $ $0 $@ |
2679 | 2679 | |
2680 | 2680 | # Define the identity of the package. |
2681 | 2681 | PACKAGE='libseccomp' |
2682 | VERSION='2.5.0' | |
2682 | VERSION='2.5.1' | |
2683 | 2683 | |
2684 | 2684 | |
2685 | 2685 | cat >>confdefs.h <<_ACEOF |
4079 | 4079 | |
4080 | 4080 | |
4081 | 4081 | |
4082 | macro_version='2.4.6.42-b88ce-dirty' | |
4083 | macro_revision='2.4.6.42' | |
4082 | macro_version='2.4.6' | |
4083 | macro_revision='2.4.6' | |
4084 | 4084 | |
4085 | 4085 | |
4086 | 4086 | |
5742 | 5742 | fi |
5743 | 5743 | |
5744 | 5744 | : ${AR=ar} |
5745 | ||
5746 | ||
5747 | ||
5748 | ||
5749 | ||
5750 | ||
5751 | # Use ARFLAGS variable as AR's operation code to sync the variable naming with | |
5752 | # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have | |
5753 | # higher priority because thats what people were doing historically (setting | |
5754 | # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS | |
5755 | # variable obsoleted/removed. | |
5756 | ||
5757 | test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} | |
5758 | lt_ar_flags=$AR_FLAGS | |
5759 | ||
5760 | ||
5761 | ||
5762 | ||
5763 | ||
5764 | ||
5765 | # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override | |
5766 | # by AR_FLAGS because that was never working and AR_FLAGS is about to die. | |
5745 | : ${AR_FLAGS=cru} | |
5746 | ||
5747 | ||
5748 | ||
5749 | ||
5750 | ||
5767 | 5751 | |
5768 | 5752 | |
5769 | 5753 | |
6213 | 6197 | if test "$lt_cv_nm_interface" = "MS dumpbin"; then |
6214 | 6198 | # Fake it for dumpbin and say T for any non-static function, |
6215 | 6199 | # D for any global variable and I for any imported variable. |
6216 | # Also find C++ and __fastcall symbols from MSVC++ or ICC, | |
6200 | # Also find C++ and __fastcall symbols from MSVC++, | |
6217 | 6201 | # which start with @ or ?. |
6218 | 6202 | lt_cv_sys_global_symbol_pipe="$AWK '"\ |
6219 | 6203 | " {last_section=section; section=\$ 3};"\ |
7482 | 7466 | _LT_EOF |
7483 | 7467 | echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 |
7484 | 7468 | $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 |
7485 | echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 | |
7486 | $AR $AR_FLAGS libconftest.a conftest.o 2>&5 | |
7469 | echo "$AR cru libconftest.a conftest.o" >&5 | |
7470 | $AR cru libconftest.a conftest.o 2>&5 | |
7487 | 7471 | echo "$RANLIB libconftest.a" >&5 |
7488 | 7472 | $RANLIB libconftest.a 2>&5 |
7489 | 7473 | cat > conftest.c << _LT_EOF |
8144 | 8128 | ofile=libtool |
8145 | 8129 | can_build_shared=yes |
8146 | 8130 | |
8147 | # All known linkers require a '.a' archive for static linking (except MSVC and | |
8148 | # ICC, which need '.lib'). | |
8131 | # All known linkers require a '.a' archive for static linking (except MSVC, | |
8132 | # which needs '.lib'). | |
8149 | 8133 | libext=a |
8150 | 8134 | |
8151 | 8135 | with_gnu_ld=$lt_cv_prog_gnu_ld |
9072 | 9056 | |
9073 | 9057 | case $host_os in |
9074 | 9058 | cygwin* | mingw* | pw32* | cegcc*) |
9075 | # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time | |
9059 | # FIXME: the MSVC++ port hasn't been tested in a loooong time | |
9076 | 9060 | # When not using gcc, we currently assume that we are using |
9077 | # Microsoft Visual C++ or Intel C++ Compiler. | |
9061 | # Microsoft Visual C++. | |
9078 | 9062 | if test yes != "$GCC"; then |
9079 | 9063 | with_gnu_ld=no |
9080 | 9064 | fi |
9081 | 9065 | ;; |
9082 | 9066 | interix*) |
9083 | # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) | |
9067 | # we just hope/assume this is gcc and not c89 (= MSVC++) | |
9084 | 9068 | with_gnu_ld=yes |
9085 | 9069 | ;; |
9086 | 9070 | openbsd* | bitrig*) |
9244 | 9228 | emximp -o $lib $output_objdir/$libname.def' |
9245 | 9229 | old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' |
9246 | 9230 | enable_shared_with_static_runtimes=yes |
9247 | file_list_spec='@' | |
9248 | 9231 | ;; |
9249 | 9232 | |
9250 | 9233 | interix[3-9]*) |
9462 | 9445 | if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then |
9463 | 9446 | 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' |
9464 | 9447 | else |
9465 | 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' | |
9448 | 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' | |
9466 | 9449 | fi |
9467 | 9450 | aix_use_runtimelinking=no |
9468 | 9451 | |
9729 | 9712 | |
9730 | 9713 | cygwin* | mingw* | pw32* | cegcc*) |
9731 | 9714 | # When not using gcc, we currently assume that we are using |
9732 | # Microsoft Visual C++ or Intel C++ Compiler. | |
9715 | # Microsoft Visual C++. | |
9733 | 9716 | # hardcode_libdir_flag_spec is actually meaningless, as there is |
9734 | 9717 | # no search path for DLLs. |
9735 | 9718 | case $cc_basename in |
9736 | cl* | icl*) | |
9737 | # Native MSVC or ICC | |
9719 | cl*) | |
9720 | # Native MSVC | |
9738 | 9721 | hardcode_libdir_flag_spec=' ' |
9739 | 9722 | allow_undefined_flag=unsupported |
9740 | 9723 | always_export_symbols=yes |
9775 | 9758 | fi' |
9776 | 9759 | ;; |
9777 | 9760 | *) |
9778 | # Assume MSVC and ICC wrapper | |
9761 | # Assume MSVC wrapper | |
9779 | 9762 | hardcode_libdir_flag_spec=' ' |
9780 | 9763 | allow_undefined_flag=unsupported |
9781 | 9764 | # Tell ltmain to make .lib files, not .a files. |
10099 | 10082 | emximp -o $lib $output_objdir/$libname.def' |
10100 | 10083 | old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' |
10101 | 10084 | enable_shared_with_static_runtimes=yes |
10102 | file_list_spec='@' | |
10103 | 10085 | ;; |
10104 | 10086 | |
10105 | 10087 | osf3*) |
10807 | 10789 | dynamic_linker='Win32 ld.exe' |
10808 | 10790 | ;; |
10809 | 10791 | |
10810 | *,cl* | *,icl*) | |
10811 | # Native MSVC or ICC | |
10792 | *,cl*) | |
10793 | # Native MSVC | |
10812 | 10794 | libname_spec='$name' |
10813 | 10795 | soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' |
10814 | 10796 | library_names_spec='$libname.dll.lib' |
10864 | 10846 | ;; |
10865 | 10847 | |
10866 | 10848 | *) |
10867 | # Assume MSVC and ICC wrapper | |
10849 | # Assume MSVC wrapper | |
10868 | 10850 | library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' |
10869 | 10851 | dynamic_linker='Win32 ld.exe' |
10870 | 10852 | ;; |
11128 | 11110 | # before this can be enabled. |
11129 | 11111 | hardcode_into_libs=yes |
11130 | 11112 | |
11113 | # Add ABI-specific directories to the system library path. | |
11114 | sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" | |
11115 | ||
11131 | 11116 | # Ideally, we could use ldconfig to report *all* directores which are |
11132 | 11117 | # searched for libraries, however this is still not possible. Aside from not |
11133 | 11118 | # being certain /sbin/ldconfig is available, command |
11136 | 11121 | # appending ld.so.conf contents (and includes) to the search path. |
11137 | 11122 | if test -f /etc/ld.so.conf; then |
11138 | 11123 | lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` |
11139 | sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" | |
11124 | sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" | |
11140 | 11125 | fi |
11141 | 11126 | |
11142 | 11127 | # We used to test for /lib/ld.so.1 and disable shared libraries on |
12043 | 12028 | old_striplib= |
12044 | 12029 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 |
12045 | 12030 | $as_echo_n "checking whether stripping libraries is possible... " >&6; } |
12046 | if test -z "$STRIP"; then | |
12047 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
12048 | $as_echo "no" >&6; } | |
12049 | else | |
12050 | if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then | |
12051 | old_striplib="$STRIP --strip-debug" | |
12052 | striplib="$STRIP --strip-unneeded" | |
12053 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
12031 | if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then | |
12032 | test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" | |
12033 | test -z "$striplib" && striplib="$STRIP --strip-unneeded" | |
12034 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
12054 | 12035 | $as_echo "yes" >&6; } |
12055 | else | |
12056 | case $host_os in | |
12057 | darwin*) | |
12058 | # FIXME - insert some real tests, host_os isn't really good enough | |
12036 | else | |
12037 | # FIXME - insert some real tests, host_os isn't really good enough | |
12038 | case $host_os in | |
12039 | darwin*) | |
12040 | if test -n "$STRIP"; then | |
12059 | 12041 | striplib="$STRIP -x" |
12060 | 12042 | old_striplib="$STRIP -S" |
12061 | 12043 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
12062 | 12044 | $as_echo "yes" >&6; } |
12063 | ;; | |
12064 | freebsd*) | |
12065 | if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then | |
12066 | old_striplib="$STRIP --strip-debug" | |
12067 | striplib="$STRIP --strip-unneeded" | |
12068 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
12069 | $as_echo "yes" >&6; } | |
12070 | else | |
12071 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
12072 | $as_echo "no" >&6; } | |
12073 | fi | |
12074 | ;; | |
12075 | *) | |
12045 | else | |
12076 | 12046 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
12077 | 12047 | $as_echo "no" >&6; } |
12078 | ;; | |
12079 | esac | |
12080 | fi | |
12048 | fi | |
12049 | ;; | |
12050 | *) | |
12051 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
12052 | $as_echo "no" >&6; } | |
12053 | ;; | |
12054 | esac | |
12081 | 12055 | fi |
12082 | 12056 | |
12083 | 12057 | |
12208 | 12182 | |
12209 | 12183 | |
12210 | 12184 | AM_CPPFLAGS="-I\${top_srcdir}/include -I\${top_builddir}/include" |
12211 | AM_CFLAGS="-Wall" | |
12185 | AM_CFLAGS="-Wall -Umips" | |
12212 | 12186 | AM_LDFLAGS="-Wl,-z -Wl,relro" |
12213 | 12187 | |
12214 | 12188 | |
13650 | 13624 | # report actual input values of CONFIG_FILES etc. instead of their |
13651 | 13625 | # values after options handling. |
13652 | 13626 | ac_log=" |
13653 | This file was extended by libseccomp $as_me 2.5.0, which was | |
13627 | This file was extended by libseccomp $as_me 2.5.1, which was | |
13654 | 13628 | generated by GNU Autoconf 2.69. Invocation command line was |
13655 | 13629 | |
13656 | 13630 | CONFIG_FILES = $CONFIG_FILES |
13716 | 13690 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
13717 | 13691 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
13718 | 13692 | ac_cs_version="\\ |
13719 | libseccomp config.status 2.5.0 | |
13693 | libseccomp config.status 2.5.1 | |
13720 | 13694 | configured by $0, generated by GNU Autoconf 2.69, |
13721 | 13695 | with options \\"\$ac_cs_config\\" |
13722 | 13696 | |
13887 | 13861 | DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' |
13888 | 13862 | sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' |
13889 | 13863 | AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' |
13890 | lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' | |
13891 | 13864 | AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' |
13892 | 13865 | archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' |
13893 | 13866 | STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' |
14016 | 13989 | DLLTOOL \ |
14017 | 13990 | sharedlib_from_linklib_cmd \ |
14018 | 13991 | AR \ |
13992 | AR_FLAGS \ | |
14019 | 13993 | archiver_list_spec \ |
14020 | 13994 | STRIP \ |
14021 | 13995 | RANLIB \ |
14817 | 14791 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
14818 | 14792 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
14819 | 14793 | as_fn_error $? "Something went wrong bootstrapping makefile fragments |
14820 | for automatic dependency tracking. If GNU make was not used, consider | |
14821 | re-running the configure script with MAKE=\"gmake\" (or whatever is | |
14822 | necessary). You can also try re-running configure with the | |
14794 | for automatic dependency tracking. Try re-running configure with the | |
14823 | 14795 | '--disable-dependency-tracking' option to at least be able to build |
14824 | 14796 | the package (albeit without support for automatic dependency tracking). |
14825 | 14797 | See \`config.log' for more details" "$LINENO" 5; } |
14846 | 14818 | cat <<_LT_EOF >> "$cfgfile" |
14847 | 14819 | #! $SHELL |
14848 | 14820 | # Generated automatically by $as_me ($PACKAGE) $VERSION |
14821 | # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: | |
14849 | 14822 | # NOTE: Changes made to this file will be lost: look at ltmain.sh. |
14850 | 14823 | |
14851 | 14824 | # Provide generalized library-building support services. |
14989 | 14962 | # The archiver. |
14990 | 14963 | AR=$lt_AR |
14991 | 14964 | |
14992 | # Flags to create an archive (by configure). | |
14993 | lt_ar_flags=$lt_ar_flags | |
14994 | ||
14995 | 14965 | # Flags to create an archive. |
14996 | AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} | |
14966 | AR_FLAGS=$lt_AR_FLAGS | |
14997 | 14967 | |
14998 | 14968 | # How to feed a file listing to the archiver. |
14999 | 14969 | archiver_list_spec=$lt_archiver_list_spec |
18 | 18 | dnl #### |
19 | 19 | dnl libseccomp defines |
20 | 20 | dnl #### |
21 | AC_INIT([libseccomp], [2.5.0]) | |
21 | AC_INIT([libseccomp], [2.5.1]) | |
22 | 22 | |
23 | 23 | dnl #### |
24 | 24 | dnl autoconf configuration |
64 | 64 | |
65 | 65 | dnl #### |
66 | 66 | dnl build flags |
67 | dnl NOTE: the '-Umips' is here because MIPS GCC compilers "helpfully" define it | |
68 | dnl for us which wreaks havoc on the build | |
67 | 69 | dnl #### |
68 | 70 | AM_CPPFLAGS="-I\${top_srcdir}/include -I\${top_builddir}/include" |
69 | AM_CFLAGS="-Wall" | |
71 | AM_CFLAGS="-Wall -Umips" | |
70 | 72 | AM_LDFLAGS="-Wl,-z -Wl,relro" |
71 | 73 | AC_SUBST([AM_CPPFLAGS]) |
72 | 74 | AC_SUBST([AM_CFLAGS]) |
0 | # Makefile.in generated by automake 1.16.2 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2020 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2018 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, |
0 | .TH "seccomp_api_get" 3 "13 June 2020" "paul@paul-moore.com" "libseccomp Documentation" | |
0 | .TH "seccomp_api_get" 3 "6 November 2020" "paul@paul-moore.com" "libseccomp Documentation" | |
1 | 1 | .\" ////////////////////////////////////////////////////////////////////////// |
2 | 2 | .SH NAME |
3 | 3 | .\" ////////////////////////////////////////////////////////////////////////// |
57 | 57 | .B 5 |
58 | 58 | The SCMP_ACT_NOTIFY action and the notify APIs are supported. |
59 | 59 | .TP |
60 | .B 5 | |
60 | .B 6 | |
61 | 61 | The simultaneous use of SCMP_FLTATR_CTL_TSYNC and the notify APIs are supported. |
62 | 62 | .\" ////////////////////////////////////////////////////////////////////////// |
63 | 63 | .SH RETURN VALUE |
23 | 23 | .BR seccomp_export_bpf () |
24 | 24 | and |
25 | 25 | .BR seccomp_export_pfc () |
26 | functions generate and output the current seccomp filter in either BPF (Berkley | |
26 | functions generate and output the current seccomp filter in either BPF (Berkeley | |
27 | 27 | Packet Filter) or PFC (Pseudo Filter Code). The output of |
28 | 28 | .BR seccomp_export_bpf () |
29 | 29 | is suitable for loading into the kernel, while the output of |
35 | 35 | function releases the existing filter context state before reinitializing it |
36 | 36 | and can only be called after a call to |
37 | 37 | .BR seccomp_init () |
38 | has succeeded. | |
38 | has succeeded. If | |
39 | .BR seccomp_reset () | |
40 | is called with a NULL filter, it resets the library's global task state, | |
41 | including any notification file descriptors retrieved by | |
42 | .BR seccomp_notify_fd(3) . | |
43 | Normally this is not needed, but it may be required to continue using the | |
44 | library after a | |
45 | .BR fork () | |
46 | or | |
47 | .BR clone () | |
48 | call to ensure the API level and user notification state is properly reset. | |
39 | 49 | .P |
40 | 50 | When the caller is finished configuring the seccomp filter and has loaded it |
41 | 51 | into the kernel, the caller should call |
58 | 58 | .\" ////////////////////////////////////////////////////////////////////////// |
59 | 59 | The |
60 | 60 | .BR seccomp_notify_fd () |
61 | returns the notification fd of the loaded filter. | |
61 | returns the notification fd of the loaded filter, -1 if a notification fd has | |
62 | not yet been created, and -EINVAL if the filter context is invalid. | |
62 | 63 | .P |
63 | 64 | The |
64 | 65 | .BR seccomp_notify_id_valid () |
208 | 208 | .B SCMP_ACT_ALLOW |
209 | 209 | The seccomp filter will have no effect on the thread calling the syscall if it |
210 | 210 | matches the filter rule. |
211 | .TP | |
212 | .B SCMP_ACT_NOTIFY | |
213 | A monitoring process will be notified when a process running the seccomp | |
214 | filter calls a syscall that matches the filter rule. The process that invokes | |
215 | the syscall waits in the kernel until the monitoring process has responded via | |
216 | .B seccomp_notify_respond(3) | |
217 | \&. | |
218 | ||
219 | When a filter utilizing | |
220 | .B SCMP_ACT_NOTIFY | |
221 | is loaded into the kernel, the kernel generates a notification fd that must be | |
222 | used to communicate between the monitoring process and the process(es) being | |
223 | filtered. See | |
224 | .B seccomp_notif_fd(3) | |
225 | for more information. | |
226 | ||
211 | 227 | .P |
212 | 228 | Valid comparison |
213 | 229 | .I op |
0 | # Makefile.in generated by automake 1.16.2 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2020 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2018 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, |
39 | 39 | |
40 | 40 | #define SCMP_VER_MAJOR 2 |
41 | 41 | #define SCMP_VER_MINOR 5 |
42 | #define SCMP_VER_MICRO 0 | |
42 | #define SCMP_VER_MICRO 1 | |
43 | 43 | |
44 | 44 | struct scmp_version { |
45 | 45 | unsigned int major; |
0 | 0 | # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- |
1 | 1 | # |
2 | # Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc. | |
2 | # Copyright (C) 1996-2001, 2003-2015 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 |
218 | 218 | ofile=libtool |
219 | 219 | can_build_shared=yes |
220 | 220 | |
221 | # All known linkers require a '.a' archive for static linking (except MSVC and | |
222 | # ICC, which need '.lib'). | |
221 | # All known linkers require a '.a' archive for static linking (except MSVC, | |
222 | # which needs '.lib'). | |
223 | 223 | libext=a |
224 | 224 | |
225 | 225 | with_gnu_ld=$lt_cv_prog_gnu_ld |
727 | 727 | cat <<_LT_EOF >> "$cfgfile" |
728 | 728 | #! $SHELL |
729 | 729 | # Generated automatically by $as_me ($PACKAGE) $VERSION |
730 | # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: | |
730 | 731 | # NOTE: Changes made to this file will be lost: look at ltmain.sh. |
731 | 732 | |
732 | 733 | # Provide generalized library-building support services. |
1040 | 1041 | _LT_EOF |
1041 | 1042 | echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD |
1042 | 1043 | $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD |
1043 | echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD | |
1044 | $AR $AR_FLAGS libconftest.a conftest.o 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 | |
1045 | 1046 | echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD |
1046 | 1047 | $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD |
1047 | 1048 | cat > conftest.c << _LT_EOF |
1491 | 1492 | m4_defun([_LT_PROG_AR], |
1492 | 1493 | [AC_CHECK_TOOLS(AR, [ar], false) |
1493 | 1494 | : ${AR=ar} |
1495 | : ${AR_FLAGS=cru} | |
1494 | 1496 | _LT_DECL([], [AR], [1], [The archiver]) |
1495 | ||
1496 | # Use ARFLAGS variable as AR's operation code to sync the variable naming with | |
1497 | # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have | |
1498 | # higher priority because thats what people were doing historically (setting | |
1499 | # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS | |
1500 | # variable obsoleted/removed. | |
1501 | ||
1502 | test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} | |
1503 | lt_ar_flags=$AR_FLAGS | |
1504 | _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) | |
1505 | ||
1506 | # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override | |
1507 | # by AR_FLAGS because that was never working and AR_FLAGS is about to die. | |
1508 | _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], | |
1509 | [Flags to create an archive]) | |
1497 | _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) | |
1510 | 1498 | |
1511 | 1499 | AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], |
1512 | 1500 | [lt_cv_ar_at_file=no |
2218 | 2206 | striplib= |
2219 | 2207 | old_striplib= |
2220 | 2208 | AC_MSG_CHECKING([whether stripping libraries is possible]) |
2221 | if test -z "$STRIP"; then | |
2222 | AC_MSG_RESULT([no]) | |
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]) | |
2223 | 2213 | else |
2224 | if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then | |
2225 | old_striplib="$STRIP --strip-debug" | |
2226 | striplib="$STRIP --strip-unneeded" | |
2227 | AC_MSG_RESULT([yes]) | |
2228 | else | |
2229 | case $host_os in | |
2230 | darwin*) | |
2231 | # FIXME - insert some real tests, host_os isn't really good enough | |
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 | |
2232 | 2218 | striplib="$STRIP -x" |
2233 | 2219 | old_striplib="$STRIP -S" |
2234 | 2220 | AC_MSG_RESULT([yes]) |
2235 | ;; | |
2236 | freebsd*) | |
2237 | if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then | |
2238 | old_striplib="$STRIP --strip-debug" | |
2239 | striplib="$STRIP --strip-unneeded" | |
2240 | AC_MSG_RESULT([yes]) | |
2241 | else | |
2242 | AC_MSG_RESULT([no]) | |
2243 | fi | |
2244 | ;; | |
2245 | *) | |
2221 | else | |
2246 | 2222 | AC_MSG_RESULT([no]) |
2247 | ;; | |
2248 | esac | |
2249 | fi | |
2223 | fi | |
2224 | ;; | |
2225 | *) | |
2226 | AC_MSG_RESULT([no]) | |
2227 | ;; | |
2228 | esac | |
2250 | 2229 | fi |
2251 | 2230 | _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) |
2252 | 2231 | _LT_DECL([], [striplib], [1]) |
2585 | 2564 | dynamic_linker='Win32 ld.exe' |
2586 | 2565 | ;; |
2587 | 2566 | |
2588 | *,cl* | *,icl*) | |
2589 | # Native MSVC or ICC | |
2567 | *,cl*) | |
2568 | # Native MSVC | |
2590 | 2569 | libname_spec='$name' |
2591 | 2570 | soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' |
2592 | 2571 | library_names_spec='$libname.dll.lib' |
2642 | 2621 | ;; |
2643 | 2622 | |
2644 | 2623 | *) |
2645 | # Assume MSVC and ICC wrapper | |
2624 | # Assume MSVC wrapper | |
2646 | 2625 | library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' |
2647 | 2626 | dynamic_linker='Win32 ld.exe' |
2648 | 2627 | ;; |
2887 | 2866 | # before this can be enabled. |
2888 | 2867 | hardcode_into_libs=yes |
2889 | 2868 | |
2869 | # Add ABI-specific directories to the system library path. | |
2870 | sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" | |
2871 | ||
2890 | 2872 | # Ideally, we could use ldconfig to report *all* directores which are |
2891 | 2873 | # searched for libraries, however this is still not possible. Aside from not |
2892 | 2874 | # being certain /sbin/ldconfig is available, command |
2895 | 2877 | # appending ld.so.conf contents (and includes) to the search path. |
2896 | 2878 | if test -f /etc/ld.so.conf; then |
2897 | 2879 | lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` |
2898 | sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" | |
2880 | sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" | |
2899 | 2881 | fi |
2900 | 2882 | |
2901 | 2883 | # We used to test for /lib/ld.so.1 and disable shared libraries on |
4030 | 4012 | if test "$lt_cv_nm_interface" = "MS dumpbin"; then |
4031 | 4013 | # Fake it for dumpbin and say T for any non-static function, |
4032 | 4014 | # D for any global variable and I for any imported variable. |
4033 | # Also find C++ and __fastcall symbols from MSVC++ or ICC, | |
4015 | # Also find C++ and __fastcall symbols from MSVC++, | |
4034 | 4016 | # which start with @ or ?. |
4035 | 4017 | lt_cv_sys_global_symbol_pipe="$AWK ['"\ |
4036 | 4018 | " {last_section=section; section=\$ 3};"\ |
4939 | 4921 | if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then |
4940 | 4922 | _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' |
4941 | 4923 | else |
4942 | _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' | |
4924 | _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 | 4925 | fi |
4944 | 4926 | ;; |
4945 | 4927 | pw32*) |
4947 | 4929 | ;; |
4948 | 4930 | cygwin* | mingw* | cegcc*) |
4949 | 4931 | case $cc_basename in |
4950 | cl* | icl*) | |
4932 | cl*) | |
4951 | 4933 | _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' |
4952 | 4934 | ;; |
4953 | 4935 | *) |
5004 | 4986 | |
5005 | 4987 | case $host_os in |
5006 | 4988 | cygwin* | mingw* | pw32* | cegcc*) |
5007 | # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time | |
4989 | # FIXME: the MSVC++ port hasn't been tested in a loooong time | |
5008 | 4990 | # When not using gcc, we currently assume that we are using |
5009 | # Microsoft Visual C++ or Intel C++ Compiler. | |
4991 | # Microsoft Visual C++. | |
5010 | 4992 | if test yes != "$GCC"; then |
5011 | 4993 | with_gnu_ld=no |
5012 | 4994 | fi |
5013 | 4995 | ;; |
5014 | 4996 | interix*) |
5015 | # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) | |
4997 | # we just hope/assume this is gcc and not c89 (= MSVC++) | |
5016 | 4998 | with_gnu_ld=yes |
5017 | 4999 | ;; |
5018 | 5000 | openbsd* | bitrig*) |
5176 | 5158 | emximp -o $lib $output_objdir/$libname.def' |
5177 | 5159 | _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' |
5178 | 5160 | _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes |
5179 | _LT_TAGVAR(file_list_spec, $1)='@' | |
5180 | 5161 | ;; |
5181 | 5162 | |
5182 | 5163 | interix[[3-9]]*) |
5394 | 5375 | if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then |
5395 | 5376 | _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' |
5396 | 5377 | else |
5397 | _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' | |
5378 | _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 | 5379 | fi |
5399 | 5380 | aix_use_runtimelinking=no |
5400 | 5381 | |
5577 | 5558 | |
5578 | 5559 | cygwin* | mingw* | pw32* | cegcc*) |
5579 | 5560 | # When not using gcc, we currently assume that we are using |
5580 | # Microsoft Visual C++ or Intel C++ Compiler. | |
5561 | # Microsoft Visual C++. | |
5581 | 5562 | # hardcode_libdir_flag_spec is actually meaningless, as there is |
5582 | 5563 | # no search path for DLLs. |
5583 | 5564 | case $cc_basename in |
5584 | cl* | icl*) | |
5585 | # Native MSVC or ICC | |
5565 | cl*) | |
5566 | # Native MSVC | |
5586 | 5567 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' |
5587 | 5568 | _LT_TAGVAR(allow_undefined_flag, $1)=unsupported |
5588 | 5569 | _LT_TAGVAR(always_export_symbols, $1)=yes |
5623 | 5604 | fi' |
5624 | 5605 | ;; |
5625 | 5606 | *) |
5626 | # Assume MSVC and ICC wrapper | |
5607 | # Assume MSVC wrapper | |
5627 | 5608 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' |
5628 | 5609 | _LT_TAGVAR(allow_undefined_flag, $1)=unsupported |
5629 | 5610 | # Tell ltmain to make .lib files, not .a files. |
5882 | 5863 | emximp -o $lib $output_objdir/$libname.def' |
5883 | 5864 | _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' |
5884 | 5865 | _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes |
5885 | _LT_TAGVAR(file_list_spec, $1)='@' | |
5886 | 5866 | ;; |
5887 | 5867 | |
5888 | 5868 | osf3*) |
6653 | 6633 | |
6654 | 6634 | cygwin* | mingw* | pw32* | cegcc*) |
6655 | 6635 | case $GXX,$cc_basename in |
6656 | ,cl* | no,cl* | ,icl* | no,icl*) | |
6657 | # Native MSVC or ICC | |
6636 | ,cl* | no,cl*) | |
6637 | # Native MSVC | |
6658 | 6638 | # hardcode_libdir_flag_spec is actually meaningless, as there is |
6659 | 6639 | # no search path for DLLs. |
6660 | 6640 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' |
6752 | 6732 | emximp -o $lib $output_objdir/$libname.def' |
6753 | 6733 | _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' |
6754 | 6734 | _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes |
6755 | _LT_TAGVAR(file_list_spec, $1)='@' | |
6756 | 6735 | ;; |
6757 | 6736 | |
6758 | 6737 | dgux*) |
0 | 0 | # Helper functions for option handling. -*- Autoconf -*- |
1 | 1 | # |
2 | # Copyright (C) 2004-2005, 2007-2009, 2011-2018 Free Software | |
2 | # Copyright (C) 2004-2005, 2007-2009, 2011-2015 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-2018 Free Software | |
2 | # Copyright (C) 2004-2005, 2007-2008, 2011-2015 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-2018 Free Software Foundation, Inc. | |
2 | # Copyright (C) 2004, 2011-2015 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 4221 ltversion.m4 | |
11 | # serial 4179 ltversion.m4 | |
12 | 12 | # This file is part of GNU Libtool |
13 | 13 | |
14 | m4_define([LT_PACKAGE_VERSION], [2.4.6.42-b88ce-dirty]) | |
15 | m4_define([LT_PACKAGE_REVISION], [2.4.6.42]) | |
14 | m4_define([LT_PACKAGE_VERSION], [2.4.6]) | |
15 | m4_define([LT_PACKAGE_REVISION], [2.4.6]) | |
16 | 16 | |
17 | 17 | AC_DEFUN([LTVERSION_VERSION], |
18 | [macro_version='2.4.6.42-b88ce-dirty' | |
19 | macro_revision='2.4.6.42' | |
18 | [macro_version='2.4.6' | |
19 | macro_revision='2.4.6' | |
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-2018 Free Software | |
2 | # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software | |
3 | 3 | # Foundation, Inc. |
4 | 4 | # Written by Scott James Remnant, 2004. |
5 | 5 | # |
60 | 60 | arch_syscall_dump_SOURCES = arch-syscall-dump.c ${SOURCES_ALL} |
61 | 61 | |
62 | 62 | arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ALL} |
63 | arch_syscall_check_CFLAGS = ${CODE_COVERAGE_CFLAGS} | |
63 | arch_syscall_check_CFLAGS = ${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS} | |
64 | 64 | arch_syscall_check_LDFLAGS = ${CODE_COVERAGE_LDFLAGS} |
65 | 65 | |
66 | 66 | libseccomp_la_SOURCES = ${SOURCES_ALL} |
0 | # Makefile.in generated by automake 1.16.2 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2020 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2018 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, |
586 | 586 | lib_LTLIBRARIES = libseccomp.la |
587 | 587 | arch_syscall_dump_SOURCES = arch-syscall-dump.c ${SOURCES_ALL} |
588 | 588 | arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ALL} |
589 | arch_syscall_check_CFLAGS = ${CODE_COVERAGE_CFLAGS} | |
589 | arch_syscall_check_CFLAGS = ${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS} | |
590 | 590 | arch_syscall_check_LDFLAGS = ${CODE_COVERAGE_LDFLAGS} |
591 | 591 | libseccomp_la_SOURCES = ${SOURCES_ALL} |
592 | 592 | libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} ${CODE_COVERAGE_CPPFLAGS} |
300 | 300 | { |
301 | 301 | struct db_filter_col *col = (struct db_filter_col *)ctx; |
302 | 302 | |
303 | /* use a NULL filter collection here since we are resetting it */ | |
304 | if (ctx == NULL || db_col_action_valid(NULL, def_action) < 0) | |
305 | return _rc_filter(-EINVAL); | |
306 | ||
303 | /* a NULL filter context indicates we are resetting the global state */ | |
304 | if (ctx == NULL) { | |
305 | /* reset the global state and redetermine the api level */ | |
306 | sys_reset_state(); | |
307 | _seccomp_api_update(); | |
308 | return _rc_filter(0); | |
309 | } | |
310 | /* ensure the default action is valid */ | |
311 | if (db_col_action_valid(NULL, def_action) < 0) | |
312 | return _rc_filter(-EINVAL); | |
313 | ||
314 | /* reset the filter */ | |
307 | 315 | return _rc_filter(db_col_reset(col, def_action)); |
308 | 316 | } |
309 | 317 | |
674 | 682 | /* NOTE - function header comment in include/seccomp.h */ |
675 | 683 | API int seccomp_notify_fd(const scmp_filter_ctx ctx) |
676 | 684 | { |
677 | struct db_filter_col *col; | |
685 | /* NOTE: for historical reasons, and possibly future use, we require a | |
686 | * valid filter context even though we don't actual use it here; the | |
687 | * api update is also not strictly necessary, but keep it for now */ | |
678 | 688 | |
679 | 689 | /* force a runtime api level detection */ |
680 | 690 | _seccomp_api_update(); |
681 | 691 | |
682 | 692 | if (_ctx_valid(ctx)) |
683 | 693 | return _rc_filter(-EINVAL); |
684 | col = (struct db_filter_col *)ctx; | |
685 | ||
686 | return _rc_filter(col->notify_fd); | |
694 | ||
695 | return _rc_filter(sys_notify_fd()); | |
687 | 696 | } |
688 | 697 | |
689 | 698 | /* NOTE - function header comment in include/seccomp.h */ |
49 | 49 | { |
50 | 50 | int sys; |
51 | 51 | |
52 | /* NOTE: we don't want to modify the pseudo-syscall numbers */ | |
52 | 53 | sys = arm_syscall_resolve_name(name); |
53 | if (sys == __NR_SCMP_ERROR) | |
54 | if (sys == __NR_SCMP_ERROR || sys < 0) | |
54 | 55 | return sys; |
55 | 56 | |
56 | 57 | return (sys | __SCMP_NR_BASE); |
67 | 68 | */ |
68 | 69 | const char *arm_syscall_resolve_num_munge(int num) |
69 | 70 | { |
70 | return arm_syscall_resolve_num(num & (~__SCMP_NR_BASE)); | |
71 | /* NOTE: we don't want to modify the pseudo-syscall numbers */ | |
72 | if (num >= 0) | |
73 | num &= ~__SCMP_NR_BASE; | |
74 | return arm_syscall_resolve_num(num); | |
71 | 75 | } |
72 | 76 | |
73 | 77 | const struct arch_def arch_def_arm = { |
42 | 42 | { |
43 | 43 | int sys; |
44 | 44 | |
45 | /* NOTE: we don't want to modify the pseudo-syscall numbers */ | |
45 | 46 | sys = mips_syscall_resolve_name(name); |
46 | if (sys == __NR_SCMP_ERROR) | |
47 | if (sys == __NR_SCMP_ERROR || sys < 0) | |
47 | 48 | return sys; |
48 | 49 | |
49 | 50 | return sys + __SCMP_NR_BASE; |
60 | 61 | */ |
61 | 62 | const char *mips_syscall_resolve_num_munge(int num) |
62 | 63 | { |
63 | return mips_syscall_resolve_num(num - __SCMP_NR_BASE); | |
64 | /* NOTE: we don't want to modify the pseudo-syscall numbers */ | |
65 | if (num >= __SCMP_NR_BASE) | |
66 | num -= __SCMP_NR_BASE; | |
67 | return mips_syscall_resolve_num(num); | |
64 | 68 | } |
65 | 69 | |
66 | 70 | const struct arch_def arch_def_mips = { |
40 | 40 | { |
41 | 41 | int sys; |
42 | 42 | |
43 | /* NOTE: we don't want to modify the pseudo-syscall numbers */ | |
43 | 44 | sys = mips64_syscall_resolve_name(name); |
44 | if (sys == __NR_SCMP_ERROR) | |
45 | if (sys == __NR_SCMP_ERROR || sys < 0) | |
45 | 46 | return sys; |
46 | 47 | |
47 | 48 | return sys + __SCMP_NR_BASE; |
58 | 59 | */ |
59 | 60 | const char *mips64_syscall_resolve_num_munge(int num) |
60 | 61 | { |
61 | return mips64_syscall_resolve_num(num - __SCMP_NR_BASE); | |
62 | /* NOTE: we don't want to modify the pseudo-syscall numbers */ | |
63 | if (num >= __SCMP_NR_BASE) | |
64 | num -= __SCMP_NR_BASE; | |
65 | return mips64_syscall_resolve_num(num); | |
62 | 66 | } |
63 | 67 | |
64 | 68 | const struct arch_def arch_def_mips64 = { |
42 | 42 | { |
43 | 43 | int sys; |
44 | 44 | |
45 | /* NOTE: we don't want to modify the pseudo-syscall numbers */ | |
45 | 46 | sys = mips64n32_syscall_resolve_name(name); |
46 | if (sys == __NR_SCMP_ERROR) | |
47 | if (sys == __NR_SCMP_ERROR || sys < 0) | |
47 | 48 | return sys; |
48 | 49 | |
49 | 50 | return sys + __SCMP_NR_BASE; |
60 | 61 | */ |
61 | 62 | const char *mips64n32_syscall_resolve_num_munge(int num) |
62 | 63 | { |
63 | return mips64n32_syscall_resolve_num(num - __SCMP_NR_BASE); | |
64 | /* NOTE: we don't want to modify the pseudo-syscall numbers */ | |
65 | if (num >= __SCMP_NR_BASE) | |
66 | num -= __SCMP_NR_BASE; | |
67 | return mips64n32_syscall_resolve_num(num); | |
64 | 68 | } |
65 | 69 | |
66 | 70 | const struct arch_def arch_def_mips64n32 = { |
38 | 38 | { |
39 | 39 | int sys; |
40 | 40 | |
41 | /* NOTE: we don't want to modify the pseudo-syscall numbers */ | |
41 | 42 | sys = x32_syscall_resolve_name(name); |
42 | if (sys == __NR_SCMP_ERROR) | |
43 | if (sys == __NR_SCMP_ERROR || sys < 0) | |
43 | 44 | return sys; |
44 | 45 | |
45 | 46 | return (sys | X32_SYSCALL_BIT); |
56 | 57 | */ |
57 | 58 | const char *x32_syscall_resolve_num_munge(int num) |
58 | 59 | { |
59 | return x32_syscall_resolve_num(num & (~X32_SYSCALL_BIT)); | |
60 | /* NOTE: we don't want to modify the pseudo-syscall numbers */ | |
61 | if (num >= 0) | |
62 | num &= ~X32_SYSCALL_BIT; | |
63 | return x32_syscall_resolve_num(num); | |
60 | 64 | } |
61 | 65 | |
62 | 66 | const struct arch_def arch_def_x32 = { |
1056 | 1056 | if (col->filters) |
1057 | 1057 | free(col->filters); |
1058 | 1058 | col->filters = NULL; |
1059 | col->notify_fd = -1; | |
1060 | 1059 | |
1061 | 1060 | /* set the endianess to undefined */ |
1062 | 1061 | col->endian = 0; |
159 | 159 | /* transaction snapshots */ |
160 | 160 | struct db_filter_snap *snapshots; |
161 | 161 | |
162 | /* notification fd that was returned from seccomp() */ | |
163 | int notify_fd; | |
162 | /* userspace notification */ | |
164 | 163 | bool notify_used; |
165 | 164 | }; |
166 | 165 |
0 | # Makefile.in generated by automake 1.16.2 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2020 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2018 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, |
1022 | 1022 | file - the output file |
1023 | 1023 | |
1024 | 1024 | Description: |
1025 | Output the filter in Berkley Packet Filter (BPF) to the given | |
1025 | Output the filter in Berkeley Packet Filter (BPF) to the given | |
1026 | 1026 | file. The output is identical to what is loaded into the |
1027 | 1027 | Linux Kernel. |
1028 | 1028 | """ |
39 | 39 | * our next release we may have to enable the allowlist */ |
40 | 40 | #define SYSCALL_ALLOWLIST_ENABLE 0 |
41 | 41 | |
42 | static int _nr_seccomp = -1; | |
43 | static int _support_seccomp_syscall = -1; | |
44 | static int _support_seccomp_flag_tsync = -1; | |
45 | static int _support_seccomp_flag_log = -1; | |
46 | static int _support_seccomp_action_log = -1; | |
47 | static int _support_seccomp_kill_process = -1; | |
48 | static int _support_seccomp_flag_spec_allow = -1; | |
49 | static int _support_seccomp_flag_new_listener = -1; | |
50 | static int _support_seccomp_user_notif = -1; | |
51 | static int _support_seccomp_flag_tsync_esrch = -1; | |
42 | /* task global state */ | |
43 | struct task_state { | |
44 | /* seccomp(2) syscall */ | |
45 | int nr_seccomp; | |
46 | ||
47 | /* userspace notification fd */ | |
48 | int notify_fd; | |
49 | ||
50 | /* runtime support flags */ | |
51 | int sup_syscall; | |
52 | int sup_flag_tsync; | |
53 | int sup_flag_log; | |
54 | int sup_action_log; | |
55 | int sup_kill_process; | |
56 | int sup_flag_spec_allow; | |
57 | int sup_flag_new_listener; | |
58 | int sup_user_notif; | |
59 | int sup_flag_tsync_esrch; | |
60 | }; | |
61 | static struct task_state state = { | |
62 | .nr_seccomp = -1, | |
63 | ||
64 | .notify_fd = -1, | |
65 | ||
66 | .sup_syscall = -1, | |
67 | .sup_flag_tsync = -1, | |
68 | .sup_flag_log = -1, | |
69 | .sup_action_log = -1, | |
70 | .sup_kill_process = -1, | |
71 | .sup_flag_spec_allow = -1, | |
72 | .sup_flag_new_listener = -1, | |
73 | .sup_user_notif = -1, | |
74 | .sup_flag_tsync_esrch = -1, | |
75 | }; | |
76 | ||
77 | /** | |
78 | * Reset the task state | |
79 | * | |
80 | * This function fully resets the library's global "system task state". | |
81 | * | |
82 | */ | |
83 | void sys_reset_state(void) | |
84 | { | |
85 | state.nr_seccomp = -1; | |
86 | ||
87 | if (state.notify_fd > 0) | |
88 | close(state.notify_fd); | |
89 | state.notify_fd = -1; | |
90 | ||
91 | state.sup_syscall = -1; | |
92 | state.sup_flag_tsync = -1; | |
93 | state.sup_flag_log = -1; | |
94 | state.sup_action_log = -1; | |
95 | state.sup_kill_process = -1; | |
96 | state.sup_flag_spec_allow = -1; | |
97 | state.sup_flag_new_listener = -1; | |
98 | state.sup_user_notif = -1; | |
99 | state.sup_flag_tsync_esrch = -1; | |
100 | } | |
52 | 101 | |
53 | 102 | /** |
54 | 103 | * Check to see if the seccomp() syscall is supported |
67 | 116 | /* NOTE: it is reasonably safe to assume that we should be able to call |
68 | 117 | * seccomp() when the caller first starts, but we can't rely on |
69 | 118 | * it later so we need to cache our findings for use later */ |
70 | if (_support_seccomp_syscall >= 0) | |
71 | return _support_seccomp_syscall; | |
119 | if (state.sup_syscall >= 0) | |
120 | return state.sup_syscall; | |
72 | 121 | |
73 | 122 | #if SYSCALL_ALLOWLIST_ENABLE |
74 | 123 | /* architecture allowlist */ |
99 | 148 | goto supported; |
100 | 149 | |
101 | 150 | unsupported: |
102 | _support_seccomp_syscall = 0; | |
151 | state.sup_syscall = 0; | |
103 | 152 | return 0; |
104 | 153 | supported: |
105 | _nr_seccomp = nr_seccomp; | |
106 | _support_seccomp_syscall = 1; | |
154 | state.nr_seccomp = nr_seccomp; | |
155 | state.sup_syscall = 1; | |
107 | 156 | return 1; |
108 | 157 | } |
109 | 158 | |
117 | 166 | */ |
118 | 167 | void sys_set_seccomp_syscall(bool enable) |
119 | 168 | { |
120 | _support_seccomp_syscall = (enable ? 1 : 0); | |
169 | state.sup_syscall = (enable ? 1 : 0); | |
121 | 170 | } |
122 | 171 | |
123 | 172 | /** |
131 | 180 | int sys_chk_seccomp_action(uint32_t action) |
132 | 181 | { |
133 | 182 | if (action == SCMP_ACT_KILL_PROCESS) { |
134 | if (_support_seccomp_kill_process < 0) { | |
183 | if (state.sup_kill_process < 0) { | |
135 | 184 | if (sys_chk_seccomp_syscall() == 1 && |
136 | syscall(_nr_seccomp, SECCOMP_GET_ACTION_AVAIL, 0, | |
137 | &action) == 0) | |
138 | _support_seccomp_kill_process = 1; | |
185 | syscall(state.nr_seccomp, | |
186 | SECCOMP_GET_ACTION_AVAIL, 0, &action) == 0) | |
187 | state.sup_kill_process = 1; | |
139 | 188 | else |
140 | _support_seccomp_kill_process = 0; | |
189 | state.sup_kill_process = 0; | |
141 | 190 | } |
142 | 191 | |
143 | return _support_seccomp_kill_process; | |
192 | return state.sup_kill_process; | |
144 | 193 | } else if (action == SCMP_ACT_KILL_THREAD) { |
145 | 194 | return 1; |
146 | 195 | } else if (action == SCMP_ACT_TRAP) { |
151 | 200 | } else if (action == SCMP_ACT_TRACE(action & 0x0000ffff)) { |
152 | 201 | return 1; |
153 | 202 | } else if (action == SCMP_ACT_LOG) { |
154 | if (_support_seccomp_action_log < 0) { | |
203 | if (state.sup_action_log < 0) { | |
155 | 204 | if (sys_chk_seccomp_syscall() == 1 && |
156 | syscall(_nr_seccomp, SECCOMP_GET_ACTION_AVAIL, 0, | |
157 | &action) == 0) | |
158 | _support_seccomp_action_log = 1; | |
205 | syscall(state.nr_seccomp, | |
206 | SECCOMP_GET_ACTION_AVAIL, 0, &action) == 0) | |
207 | state.sup_action_log = 1; | |
159 | 208 | else |
160 | _support_seccomp_action_log = 0; | |
209 | state.sup_action_log = 0; | |
161 | 210 | } |
162 | 211 | |
163 | return _support_seccomp_action_log; | |
212 | return state.sup_action_log; | |
164 | 213 | } else if (action == SCMP_ACT_ALLOW) { |
165 | 214 | return 1; |
166 | 215 | } else if (action == SCMP_ACT_NOTIFY) { |
167 | if (_support_seccomp_user_notif < 0) { | |
216 | if (state.sup_user_notif < 0) { | |
168 | 217 | struct seccomp_notif_sizes sizes; |
169 | 218 | if (sys_chk_seccomp_syscall() == 1 && |
170 | syscall(_nr_seccomp, SECCOMP_GET_NOTIF_SIZES, 0, | |
171 | &sizes) == 0) | |
172 | _support_seccomp_user_notif = 1; | |
219 | syscall(state.nr_seccomp, | |
220 | SECCOMP_GET_NOTIF_SIZES, 0, &sizes) == 0) | |
221 | state.sup_user_notif = 1; | |
173 | 222 | else |
174 | _support_seccomp_user_notif = 0; | |
223 | state.sup_user_notif = 0; | |
175 | 224 | } |
176 | 225 | |
177 | return _support_seccomp_user_notif; | |
226 | return state.sup_user_notif; | |
178 | 227 | } |
179 | 228 | |
180 | 229 | return 0; |
192 | 241 | { |
193 | 242 | switch (action) { |
194 | 243 | case SCMP_ACT_LOG: |
195 | _support_seccomp_action_log = (enable ? 1 : 0); | |
244 | state.sup_action_log = (enable ? 1 : 0); | |
196 | 245 | break; |
197 | 246 | case SCMP_ACT_KILL_PROCESS: |
198 | _support_seccomp_kill_process = (enable ? 1 : 0); | |
247 | state.sup_kill_process = (enable ? 1 : 0); | |
199 | 248 | break; |
200 | 249 | case SCMP_ACT_NOTIFY: |
201 | _support_seccomp_user_notif = (enable ? 1 : 0); | |
250 | state.sup_user_notif = (enable ? 1 : 0); | |
202 | 251 | break; |
203 | 252 | } |
204 | 253 | } |
211 | 260 | * Return one if the flag is supported, zero otherwise. |
212 | 261 | * |
213 | 262 | */ |
214 | static int _sys_chk_seccomp_flag_kernel(int flag) | |
263 | static int _sys_chk_flag_kernel(int flag) | |
215 | 264 | { |
216 | 265 | /* this is an invalid seccomp(2) call because the last argument |
217 | 266 | * is NULL, but depending on the errno value of EFAULT we can |
218 | 267 | * guess if the filter flag is supported or not */ |
219 | 268 | if (sys_chk_seccomp_syscall() == 1 && |
220 | syscall(_nr_seccomp, SECCOMP_SET_MODE_FILTER, flag, NULL) == -1 && | |
269 | syscall(state.nr_seccomp, | |
270 | SECCOMP_SET_MODE_FILTER, flag, NULL) == -1 && | |
221 | 271 | errno == EFAULT) |
222 | 272 | return 1; |
223 | 273 | |
237 | 287 | { |
238 | 288 | switch (flag) { |
239 | 289 | case SECCOMP_FILTER_FLAG_TSYNC: |
240 | if (_support_seccomp_flag_tsync < 0) | |
241 | _support_seccomp_flag_tsync = _sys_chk_seccomp_flag_kernel(flag); | |
242 | ||
243 | return _support_seccomp_flag_tsync; | |
290 | if (state.sup_flag_tsync < 0) | |
291 | state.sup_flag_tsync = _sys_chk_flag_kernel(flag); | |
292 | return state.sup_flag_tsync; | |
244 | 293 | case SECCOMP_FILTER_FLAG_LOG: |
245 | if (_support_seccomp_flag_log < 0) | |
246 | _support_seccomp_flag_log = _sys_chk_seccomp_flag_kernel(flag); | |
247 | ||
248 | return _support_seccomp_flag_log; | |
294 | if (state.sup_flag_log < 0) | |
295 | state.sup_flag_log = _sys_chk_flag_kernel(flag); | |
296 | return state.sup_flag_log; | |
249 | 297 | case SECCOMP_FILTER_FLAG_SPEC_ALLOW: |
250 | if (_support_seccomp_flag_spec_allow < 0) | |
251 | _support_seccomp_flag_spec_allow = _sys_chk_seccomp_flag_kernel(flag); | |
252 | ||
253 | return _support_seccomp_flag_spec_allow; | |
298 | if (state.sup_flag_spec_allow < 0) | |
299 | state.sup_flag_spec_allow = _sys_chk_flag_kernel(flag); | |
300 | return state.sup_flag_spec_allow; | |
254 | 301 | case SECCOMP_FILTER_FLAG_NEW_LISTENER: |
255 | if (_support_seccomp_flag_new_listener < 0) | |
256 | _support_seccomp_flag_new_listener = _sys_chk_seccomp_flag_kernel(flag); | |
257 | ||
258 | return _support_seccomp_flag_new_listener; | |
302 | if (state.sup_flag_new_listener < 0) | |
303 | state.sup_flag_new_listener = _sys_chk_flag_kernel(flag); | |
304 | return state.sup_flag_new_listener; | |
259 | 305 | case SECCOMP_FILTER_FLAG_TSYNC_ESRCH: |
260 | if (_support_seccomp_flag_tsync_esrch < 0) | |
261 | _support_seccomp_flag_tsync_esrch = _sys_chk_seccomp_flag_kernel(flag); | |
262 | return _support_seccomp_flag_tsync_esrch; | |
306 | if (state.sup_flag_tsync_esrch < 0) | |
307 | state.sup_flag_tsync_esrch = _sys_chk_flag_kernel(flag); | |
308 | return state.sup_flag_tsync_esrch; | |
263 | 309 | } |
264 | 310 | |
265 | 311 | return -EOPNOTSUPP; |
278 | 324 | { |
279 | 325 | switch (flag) { |
280 | 326 | case SECCOMP_FILTER_FLAG_TSYNC: |
281 | _support_seccomp_flag_tsync = (enable ? 1 : 0); | |
327 | state.sup_flag_tsync = (enable ? 1 : 0); | |
282 | 328 | break; |
283 | 329 | case SECCOMP_FILTER_FLAG_LOG: |
284 | _support_seccomp_flag_log = (enable ? 1 : 0); | |
330 | state.sup_flag_log = (enable ? 1 : 0); | |
285 | 331 | break; |
286 | 332 | case SECCOMP_FILTER_FLAG_SPEC_ALLOW: |
287 | _support_seccomp_flag_spec_allow = (enable ? 1 : 0); | |
333 | state.sup_flag_spec_allow = (enable ? 1 : 0); | |
288 | 334 | break; |
289 | 335 | case SECCOMP_FILTER_FLAG_NEW_LISTENER: |
290 | _support_seccomp_flag_new_listener = (enable ? 1 : 0); | |
336 | state.sup_flag_new_listener = (enable ? 1 : 0); | |
291 | 337 | break; |
292 | 338 | case SECCOMP_FILTER_FLAG_TSYNC_ESRCH: |
293 | _support_seccomp_flag_tsync_esrch = (enable ? 1 : 0); | |
339 | state.sup_flag_tsync_esrch = (enable ? 1 : 0); | |
294 | 340 | break; |
295 | 341 | } |
296 | 342 | } |
310 | 356 | { |
311 | 357 | int rc; |
312 | 358 | bool tsync_notify; |
359 | bool listener_req; | |
313 | 360 | struct bpf_program *prgm = NULL; |
314 | 361 | |
315 | 362 | rc = gen_bpf_generate(col, &prgm); |
323 | 370 | goto filter_load_out; |
324 | 371 | } |
325 | 372 | |
326 | tsync_notify = (_support_seccomp_flag_tsync_esrch > 0); | |
373 | tsync_notify = state.sup_flag_tsync_esrch > 0 && state.notify_fd == -1; | |
374 | listener_req = state.sup_user_notif > 0 && \ | |
375 | col->notify_used && state.notify_fd == -1; | |
327 | 376 | |
328 | 377 | /* load the filter into the kernel */ |
329 | 378 | if (sys_chk_seccomp_syscall() == 1) { |
332 | 381 | if (col->attr.tsync_enable) |
333 | 382 | flgs |= SECCOMP_FILTER_FLAG_TSYNC | \ |
334 | 383 | SECCOMP_FILTER_FLAG_TSYNC_ESRCH; |
335 | if (_support_seccomp_user_notif > 0) | |
384 | if (listener_req) | |
336 | 385 | flgs |= SECCOMP_FILTER_FLAG_NEW_LISTENER; |
337 | } else if (col->attr.tsync_enable) | |
386 | } else if (col->attr.tsync_enable) { | |
387 | if (listener_req) { | |
388 | /* NOTE: we _should_ catch this in db.c */ | |
389 | rc = -EFAULT; | |
390 | goto filter_load_out; | |
391 | } | |
338 | 392 | flgs |= SECCOMP_FILTER_FLAG_TSYNC; |
339 | else if (_support_seccomp_user_notif > 0) | |
393 | } else if (listener_req) | |
340 | 394 | flgs |= SECCOMP_FILTER_FLAG_NEW_LISTENER; |
341 | 395 | if (col->attr.log_enable) |
342 | 396 | flgs |= SECCOMP_FILTER_FLAG_LOG; |
343 | 397 | if (col->attr.spec_allow) |
344 | 398 | flgs |= SECCOMP_FILTER_FLAG_SPEC_ALLOW; |
345 | rc = syscall(_nr_seccomp, SECCOMP_SET_MODE_FILTER, flgs, prgm); | |
399 | rc = syscall(state.nr_seccomp, | |
400 | SECCOMP_SET_MODE_FILTER, flgs, prgm); | |
346 | 401 | if (tsync_notify && rc > 0) { |
347 | 402 | /* return 0 on NEW_LISTENER success, but save the fd */ |
348 | col->notify_fd = rc; | |
403 | state.notify_fd = rc; | |
349 | 404 | rc = 0; |
350 | 405 | } else if (rc > 0 && col->attr.tsync_enable) { |
351 | 406 | /* always return -ESRCH if we fail to sync threads */ |
352 | 407 | errno = ESRCH; |
353 | 408 | rc = -errno; |
354 | } else if (rc > 0 && _support_seccomp_user_notif > 0) { | |
409 | } else if (rc > 0 && state.sup_user_notif > 0) { | |
355 | 410 | /* return 0 on NEW_LISTENER success, but save the fd */ |
356 | col->notify_fd = rc; | |
411 | state.notify_fd = rc; | |
357 | 412 | rc = 0; |
358 | 413 | } |
359 | 414 | } else |
370 | 425 | } |
371 | 426 | |
372 | 427 | /** |
428 | * Return the userspace notification fd | |
429 | * | |
430 | * This function returns the userspace notification fd from | |
431 | * SECCOMP_FILTER_FLAG_NEW_LISTENER. If the notification fd has not yet been | |
432 | * set, or an error has occurred, -1 is returned. | |
433 | * | |
434 | */ | |
435 | int sys_notify_fd(void) | |
436 | { | |
437 | return state.notify_fd; | |
438 | } | |
439 | ||
440 | /** | |
373 | 441 | * Allocate a pair of notification request/response structures |
374 | 442 | * @param req the request location |
375 | 443 | * @param resp the response location |
385 | 453 | int rc; |
386 | 454 | static struct seccomp_notif_sizes sizes = { 0, 0, 0 }; |
387 | 455 | |
388 | if (_support_seccomp_syscall <= 0) | |
456 | if (state.sup_syscall <= 0) | |
389 | 457 | return -EOPNOTSUPP; |
390 | 458 | |
391 | 459 | if (sizes.seccomp_notif == 0 && sizes.seccomp_notif_resp == 0) { |
426 | 494 | */ |
427 | 495 | int sys_notify_receive(int fd, struct seccomp_notif *req) |
428 | 496 | { |
429 | if (_support_seccomp_user_notif <= 0) | |
497 | if (state.sup_user_notif <= 0) | |
430 | 498 | return -EOPNOTSUPP; |
431 | 499 | |
432 | 500 | if (ioctl(fd, SECCOMP_IOCTL_NOTIF_RECV, req) < 0) |
447 | 515 | */ |
448 | 516 | int sys_notify_respond(int fd, struct seccomp_notif_resp *resp) |
449 | 517 | { |
450 | if (_support_seccomp_user_notif <= 0) | |
518 | if (state.sup_user_notif <= 0) | |
451 | 519 | return -EOPNOTSUPP; |
452 | 520 | |
453 | 521 | if (ioctl(fd, SECCOMP_IOCTL_NOTIF_SEND, resp) < 0) |
466 | 534 | */ |
467 | 535 | int sys_notify_id_valid(int fd, uint64_t id) |
468 | 536 | { |
469 | if (_support_seccomp_user_notif <= 0) | |
537 | if (state.sup_user_notif <= 0) | |
470 | 538 | return -EOPNOTSUPP; |
471 | 539 | |
472 | 540 | if (ioctl(fd, SECCOMP_IOCTL_NOTIF_ID_VALID, &id) < 0) |
181 | 181 | #define SECCOMP_IOCTL_NOTIF_ID_VALID SECCOMP_IOR(2, __u64) |
182 | 182 | #endif /* SECCOMP_RET_USER_NOTIF */ |
183 | 183 | |
184 | void sys_reset_state(void); | |
185 | ||
184 | 186 | int sys_chk_seccomp_syscall(void); |
185 | 187 | void sys_set_seccomp_syscall(bool enable); |
186 | 188 | |
192 | 194 | |
193 | 195 | int sys_filter_load(struct db_filter_col *col, bool rawrc); |
194 | 196 | |
197 | int sys_notify_fd(void); | |
195 | 198 | int sys_notify_alloc(struct seccomp_notif **req, |
196 | 199 | struct seccomp_notif_resp **resp); |
197 | 200 | int sys_notify_receive(int fd, struct seccomp_notif *req); |
40 | 40 | if (ctx == NULL) |
41 | 41 | return ENOMEM; |
42 | 42 | |
43 | rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0); | |
43 | rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(openat), 0); | |
44 | 44 | if (rc != 0) |
45 | 45 | goto out; |
46 | 46 |
29 | 29 | |
30 | 30 | def test(args): |
31 | 31 | f = SyscallFilter(KILL) |
32 | f.add_rule(ALLOW, "open") | |
32 | f.add_rule(ALLOW, "openat") | |
33 | 33 | f.add_rule(ALLOW, "close") |
34 | 34 | f.add_rule(ALLOW, "read", |
35 | 35 | Arg(0, EQ, sys.stdin.fileno()), |
7 | 7 | test type: bpf-sim |
8 | 8 | |
9 | 9 | # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result |
10 | 04-sim-multilevel_chains all,-aarch64 open 0x856B008 4 N N N N ALLOW | |
10 | 04-sim-multilevel_chains all openat 0 0x856B008 4 N N N ALLOW | |
11 | 11 | 04-sim-multilevel_chains all close 4 N N N N N ALLOW |
12 | 12 | 04-sim-multilevel_chains x86 read 0 0x856B008 0x7FFFFFFE N N N ALLOW |
13 | 13 | 04-sim-multilevel_chains x86_64 read 0 0x856B008 0x7FFFFFFFFFFFFFFE N N N ALLOW |
26 | 26 | 04-sim-multilevel_chains all rt_sigreturn N N N N N N ALLOW |
27 | 27 | 04-sim-multilevel_chains x86 0-2 N N N N N N KILL |
28 | 28 | 04-sim-multilevel_chains x86 7-172 N N N N N N KILL |
29 | 04-sim-multilevel_chains x86 174-350 N N N N N N KILL | |
29 | 04-sim-multilevel_chains x86 174-294 N N N N N N KILL | |
30 | 04-sim-multilevel_chains x86 296-350 N N N N N N KILL | |
30 | 31 | 04-sim-multilevel_chains x86_64 4-14 N N N N N N KILL |
31 | 04-sim-multilevel_chains x86_64 16-350 N N N N N N KILL | |
32 | 04-sim-multilevel_chains x86_64 16-256 N N N N N N KILL | |
33 | 04-sim-multilevel_chains x86_64 258-350 N N N N N N KILL | |
32 | 34 | |
33 | 35 | test type: bpf-sim-fuzz |
34 | 36 |
59 | 59 | if (rc != 0) |
60 | 60 | goto out; |
61 | 61 | |
62 | rc = seccomp_rule_add(ctx, SCMP_ACT_TRACE(1234), SCMP_SYS(open), 0); | |
62 | rc = seccomp_rule_add(ctx, SCMP_ACT_TRACE(1234), SCMP_SYS(openat), 0); | |
63 | 63 | if (rc != 0) |
64 | 64 | goto out; |
65 | 65 | |
66 | rc = seccomp_rule_add(ctx, SCMP_ACT_KILL_PROCESS, SCMP_SYS(stat), 0); | |
66 | rc = seccomp_rule_add(ctx, SCMP_ACT_KILL_PROCESS, SCMP_SYS(fstat), 0); | |
67 | 67 | if (rc != 0) |
68 | 68 | goto out; |
69 | 69 |
36 | 36 | f.add_rule(LOG, "rt_sigreturn") |
37 | 37 | f.add_rule(ERRNO(errno.EPERM), "write") |
38 | 38 | f.add_rule(TRAP, "close") |
39 | f.add_rule(TRACE(1234), "open") | |
40 | f.add_rule(KILL_PROCESS, "stat") | |
39 | f.add_rule(TRACE(1234), "openat") | |
40 | f.add_rule(KILL_PROCESS, "fstat") | |
41 | 41 | return f |
42 | 42 | |
43 | 43 | args = util.get_opt() |
10 | 10 | 06-sim-actions all read 4 0x856B008 80 N N N ALLOW |
11 | 11 | 06-sim-actions all write 1 0x856B008 N N N N ERRNO(1) |
12 | 12 | 06-sim-actions all close 4 N N N N N TRAP |
13 | 06-sim-actions all,-aarch64 open 0x856B008 4 N N N N TRACE(1234) | |
14 | 06-sim-actions all,-aarch64 stat N N N N N N KILL_PROCESS | |
13 | 06-sim-actions all openat 0 0x856B008 4 N N N TRACE(1234) | |
14 | 06-sim-actions all fstat N N N N N N KILL_PROCESS | |
15 | 15 | 06-sim-actions all rt_sigreturn N N N N N N LOG |
16 | 16 | 06-sim-actions x86 0-2 N N N N N N KILL |
17 | 06-sim-actions x86 7-105 N N N N N N KILL | |
18 | 06-sim-actions x86 107-172 N N N N N N KILL | |
19 | 06-sim-actions x86 174-350 N N N N N N KILL | |
20 | 06-sim-actions x86_64 5-14 N N N N N N KILL | |
21 | 06-sim-actions x86_64 16-350 N N N N N N KILL | |
17 | 06-sim-actions x86 7-107 N N N N N N KILL | |
18 | 06-sim-actions x86 109-172 N N N N N N KILL | |
19 | 06-sim-actions x86 174-294 N N N N N N KILL | |
20 | 06-sim-actions x86 296-350 N N N N N N KILL | |
21 | 06-sim-actions x86_64 6-14 N N N N N N KILL | |
22 | 06-sim-actions x86_64 16-256 N N N N N N KILL | |
23 | 06-sim-actions x86_64 258-350 N N N N N N KILL | |
22 | 24 | |
23 | 25 | test type: bpf-sim-fuzz |
24 | 26 |
40 | 40 | seccomp_release(ctx); |
41 | 41 | ctx = NULL; |
42 | 42 | |
43 | /* seccomp_reset error */ | |
44 | rc = seccomp_reset(ctx, SCMP_ACT_KILL + 1); | |
45 | if (rc != -EINVAL) | |
46 | return -1; | |
47 | rc = seccomp_reset(ctx, SCMP_ACT_KILL); | |
48 | if (rc != -EINVAL) | |
43 | /* ensure that seccomp_reset(NULL, ...) is accepted */ | |
44 | rc = seccomp_reset(NULL, SCMP_ACT_ALLOW); | |
45 | if (rc != 0) | |
49 | 46 | return -1; |
50 | 47 | |
51 | 48 | /* seccomp_load error */ |
20 | 20 | |
21 | 21 | #include <sys/types.h> |
22 | 22 | #include <sys/wait.h> |
23 | #include <asm/unistd.h> | |
23 | 24 | #include <unistd.h> |
24 | 25 | #include <seccomp.h> |
25 | 26 | #include <signal.h> |
29 | 30 | |
30 | 31 | #include "util.h" |
31 | 32 | |
32 | #define MAGIC 0x1122334455667788UL | |
33 | ||
34 | 33 | int main(int argc, char *argv[]) |
35 | 34 | { |
36 | 35 | int rc, fd = -1, status; |
37 | 36 | struct seccomp_notif *req = NULL; |
38 | 37 | struct seccomp_notif_resp *resp = NULL; |
39 | 38 | scmp_filter_ctx ctx = NULL; |
40 | pid_t pid = 0; | |
39 | pid_t pid = 0, magic; | |
40 | ||
41 | magic = getpid(); | |
41 | 42 | |
42 | 43 | ctx = seccomp_init(SCMP_ACT_ALLOW); |
43 | 44 | if (ctx == NULL) |
58 | 59 | |
59 | 60 | pid = fork(); |
60 | 61 | if (pid == 0) |
61 | exit(syscall(SCMP_SYS(getpid)) != MAGIC); | |
62 | exit(syscall(__NR_getpid) != magic); | |
62 | 63 | |
63 | 64 | rc = seccomp_notify_alloc(&req, &resp); |
64 | 65 | if (rc) |
67 | 68 | rc = seccomp_notify_receive(fd, req); |
68 | 69 | if (rc) |
69 | 70 | goto out; |
70 | if (req->data.nr != SCMP_SYS(getpid)) { | |
71 | if (req->data.nr != __NR_getpid) { | |
71 | 72 | rc = -EFAULT; |
72 | 73 | goto out; |
73 | 74 | } |
76 | 77 | goto out; |
77 | 78 | |
78 | 79 | resp->id = req->id; |
79 | resp->val = MAGIC; | |
80 | resp->val = magic; | |
80 | 81 | resp->error = 0; |
81 | 82 | resp->flags = 0; |
82 | 83 | rc = seccomp_notify_respond(fd, resp); |
97 | 98 | goto out; |
98 | 99 | } |
99 | 100 | |
101 | rc = seccomp_reset(ctx, SCMP_ACT_ALLOW); | |
102 | if (rc < 0) | |
103 | goto out; | |
104 | ||
105 | rc = seccomp_rule_add(ctx, SCMP_ACT_NOTIFY, SCMP_SYS(getppid), 0, NULL); | |
106 | if (rc) | |
107 | goto out; | |
108 | ||
109 | rc = seccomp_load(ctx); | |
110 | if (rc < 0) | |
111 | goto out; | |
112 | ||
113 | rc = seccomp_notify_fd(ctx); | |
114 | if (rc < 0) | |
115 | goto out; | |
116 | if (rc != fd) { | |
117 | rc = -EFAULT; | |
118 | goto out; | |
119 | } else | |
120 | rc = 0; | |
121 | ||
100 | 122 | out: |
101 | 123 | if (fd >= 0) |
102 | 124 | close(fd); |
51 | 51 | raise RuntimeError("Child process error") |
52 | 52 | if os.WEXITSTATUS(rc) != 0: |
53 | 53 | raise RuntimeError("Child process error") |
54 | f.reset(ALLOW) | |
55 | f.add_rule(NOTIFY, "getppid") | |
56 | f.load() | |
57 | # no easy way to check the notification fd here | |
54 | 58 | quit(160) |
55 | 59 | |
56 | 60 | test() |
20 | 20 | |
21 | 21 | #include <sys/types.h> |
22 | 22 | #include <sys/wait.h> |
23 | #include <asm/unistd.h> | |
23 | 24 | #include <unistd.h> |
24 | 25 | #include <seccomp.h> |
25 | 26 | #include <signal.h> |
29 | 30 | |
30 | 31 | #include "util.h" |
31 | 32 | |
32 | #define MAGIC 0x1122334455667788UL | |
33 | ||
34 | 33 | int main(int argc, char *argv[]) |
35 | 34 | { |
36 | 35 | int rc, fd = -1, status; |
37 | 36 | struct seccomp_notif *req = NULL; |
38 | 37 | struct seccomp_notif_resp *resp = NULL; |
39 | 38 | scmp_filter_ctx ctx = NULL; |
40 | pid_t pid = 0; | |
39 | pid_t pid = 0, magic; | |
40 | ||
41 | magic = getpid(); | |
41 | 42 | |
42 | 43 | ctx = seccomp_init(SCMP_ACT_ALLOW); |
43 | 44 | if (ctx == NULL) |
62 | 63 | |
63 | 64 | pid = fork(); |
64 | 65 | if (pid == 0) |
65 | exit(syscall(SCMP_SYS(getpid)) != MAGIC); | |
66 | exit(syscall(__NR_getpid) != magic); | |
66 | 67 | |
67 | 68 | rc = seccomp_notify_alloc(&req, &resp); |
68 | 69 | if (rc) |
71 | 72 | rc = seccomp_notify_receive(fd, req); |
72 | 73 | if (rc) |
73 | 74 | goto out; |
74 | if (req->data.nr != SCMP_SYS(getpid)) { | |
75 | if (req->data.nr != __NR_getpid) { | |
75 | 76 | rc = -EFAULT; |
76 | 77 | goto out; |
77 | 78 | } |
80 | 81 | goto out; |
81 | 82 | |
82 | 83 | resp->id = req->id; |
83 | resp->val = MAGIC; | |
84 | resp->val = magic; | |
84 | 85 | resp->error = 0; |
85 | 86 | resp->flags = 0; |
86 | 87 | rc = seccomp_notify_respond(fd, resp); |
0 | # Makefile.in generated by automake 1.16.2 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2020 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2018 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, |
0 | # Makefile.in generated by automake 1.16.2 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2020 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2018 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, |