summaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
Diffstat (limited to 'patches')
-rw-r--r--patches/Imaging-1.1.7/0001-setup.py-remove-host-directories-from-search-paths.patch38
-rw-r--r--patches/Imaging-1.1.7/0002-fix-compiling-with-FreeType-2.5.1.patch24
-rw-r--r--patches/Imaging-1.1.7/series5
-rw-r--r--patches/ModemManager-1.16.2/0001-kerneldevice-udev-don-t-use-autoptr-in-GUdev-types.patch127
-rw-r--r--patches/ModemManager-1.16.2/series4
-rw-r--r--patches/NetworkManager-1.26.2/0001-clients-cli-build-generate_docs_nm_settings_nmcli-on.patch34
-rw-r--r--patches/NetworkManager-1.26.2/series1
-rw-r--r--patches/OpenSC-0.23.0/0001-pkcs11-tool-Fix-private-key-import.patch28
-rw-r--r--patches/OpenSC-0.23.0/0002-pkcs11-tool-Log-more-information-on-OpenSSL-errors.patch49
-rw-r--r--patches/OpenSC-0.23.0/series5
-rw-r--r--patches/Python-2.7.18/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch224
-rw-r--r--patches/Python-2.7.18/0002-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch37
-rw-r--r--patches/Python-2.7.18/0003-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch35
-rw-r--r--patches/Python-2.7.18/0004-setup.py-don-t-leak-host-path-into-cross-compilation.patch27
-rw-r--r--patches/Python-2.7.18/0005-add-cross-compilation-support.patch61
-rw-r--r--patches/Python-2.7.18/0006-python-don-t-add-rpaths-in-setup.py.patch31
-rw-r--r--patches/Python-2.7.18/0007-add-more-search-paths.patch28
-rw-r--r--patches/Python-2.7.18/0008-resolve-existing-LD_LIBRARY_PATH-during-make-not-dur.patch25
-rw-r--r--patches/Python-2.7.18/0009-python2-prevent-host-path-leakage.patch39
-rwxr-xr-xpatches/Python-2.7.18/autogen.sh14
-rw-r--r--patches/Python-2.7.18/series12
-rw-r--r--patches/Python-3.7.10/0001-python3-don-t-leak-host-path-into-target-binaries.patch23
-rw-r--r--patches/Python-3.7.10/0002-python3-prevent-host-path-leakage.patch42
-rw-r--r--patches/Python-3.7.10/series5
-rw-r--r--patches/SDL2_ttf-2.22.0/0001-configure-make-opengl-support-switchable.patch (renamed from patches/SDL2_ttf-2.0.15/0001-configure-make-opengl-support-switchable.patch)24
-rwxr-xr-xpatches/SDL2_ttf-2.22.0/autogen.sh (renamed from patches/SDL2_ttf-2.0.15/autogen.sh)0
-rw-r--r--patches/SDL2_ttf-2.22.0/series (renamed from patches/SDL2_ttf-2.0.15/series)0
-rw-r--r--patches/acl-2.3.1/0001-Switch-to-sys-xattr.h.patch (renamed from patches/acl-2.2.53/0001-Switch-to-sys-xattr.h.patch)6
l---------patches/acl-2.3.1/autogen.sh (renamed from patches/acl-2.2.53/autogen.sh)0
-rw-r--r--patches/acl-2.3.1/series (renamed from patches/acl-2.2.53/series)0
-rw-r--r--patches/aiosqlite-0.18.0/0001-add-setup.py.patch25
-rw-r--r--patches/aiosqlite-0.18.0/series1
-rw-r--r--patches/alsa-lib-1.2.1.2/0001-add-largefile-support.patch32
-rw-r--r--patches/alsa-lib-1.2.1.2/series4
-rw-r--r--patches/alsa-utils-1.2.11/0001-alsactl-info.c-fix-conditionals-on-__ALSA_PCM_H-and-.patch103
-rw-r--r--patches/alsa-utils-1.2.11/series4
-rw-r--r--patches/apitrace-11.1/0001-HACK-don-t-check-for-submodules-for-external-depende.patch26
-rw-r--r--patches/apitrace-11.1/0002-HACK-don-t-do-dpkg-architecture-magic.patch32
-rw-r--r--patches/apitrace-11.1/series5
-rw-r--r--patches/apitrace-9.0/0001-Use-CMAKE_INSTALL_LIBDIR-for-LIB_INSTALL_DIR.patch49
-rw-r--r--patches/apitrace-9.0/series4
-rw-r--r--patches/at-3.1.12/0001-configure.ac-remove-manual-compiler-check-with-AC_TR.patch33
-rw-r--r--patches/at-3.1.12/0002-configure.ac-convert-AC_TRY_COMPILE-AC_COMPILE_IFELS.patch34
-rw-r--r--patches/at-3.1.12/0003-Makefile.in-add-LDFLAGS-to-linking-stage.patch38
-rw-r--r--patches/at-3.1.12/0005-Makefile.in-replace-IROOT-by-DESTDIR.patch97
-rw-r--r--patches/at-3.1.12/series4
-rw-r--r--patches/aumix-2.9.1/0001-src-makefile-don-t-use-system-dirs.patch30
-rw-r--r--patches/aumix-2.9.1/series4
-rwxr-xr-xpatches/autogen.sh1
-rw-r--r--patches/autossh-1.4c/0001-Make-install-rule-friendly-towards-packaging-with-DE.patch47
-rw-r--r--patches/autossh-1.4c/series4
-rw-r--r--patches/bash-4.3.30/0001-Bash-4.3-patch-31.patch5467
-rw-r--r--patches/bash-4.3.30/0002-Bash-4.3-patch-32.patch5409
-rw-r--r--patches/bash-4.3.30/0003-Bash-4.3-patch-33.patch204
-rw-r--r--patches/bash-4.3.30/series6
l---------patches/bayer2rgb3-v0.6.0/autogen.sh (renamed from patches/alsa-lib-1.2.1.2/autogen.sh)0
-rw-r--r--patches/beep-1.3/0001-Makefile-fix.patch25
-rw-r--r--patches/beep-1.3/series4
-rw-r--r--patches/bonnie++-1.97.3/0001-configure-cache-result-of-large-file-test.patch32
-rw-r--r--patches/bonnie++-1.97.3/0002-use-DESTDIR-during-make-install.patch36
-rw-r--r--patches/bonnie++-1.97.3/series5
l---------patches/bridge-utils-1.7.1/autogen.sh (renamed from patches/at-3.1.12/autogen.sh)0
-rw-r--r--patches/busybox-1.31.1/0100-Remove-stime-function-calls.patch89
-rw-r--r--patches/busybox-1.31.1/0201-Fix-the-format-warning-when-building-applets-usage_p.patch30
-rw-r--r--patches/busybox-1.31.1/series11
-rw-r--r--patches/busybox-1.36.1/0200-reactivate-check-for-tty.patch (renamed from patches/busybox-1.31.1/0200-reactivate-check-for-tty.patch)4
-rw-r--r--patches/busybox-1.36.1/0201-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch (renamed from patches/busybox-1.31.1/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch)4
-rw-r--r--patches/busybox-1.36.1/0202-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch (renamed from patches/busybox-1.31.1/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch)8
-rw-r--r--patches/busybox-1.36.1/0203-tc-Fix-compilation-with-Linux-v6.8-rc1.patch61
-rw-r--r--patches/busybox-1.36.1/series10
-rw-r--r--patches/cairo-1.16.0/0001-only-build-GL-surface-tests-if-GLX-is-enabled.patch35
-rw-r--r--patches/cairo-1.16.0/0002-Makefile.sources-move-font-variations.c-a-test-code-.patch32
-rw-r--r--patches/cairo-1.16.0/0003-regrouping-of-test-sources-with-new-fc_font_test_sou.patch41
-rw-r--r--patches/cairo-1.16.0/series6
-rw-r--r--patches/cairo-1.18.0/0001-cairo-ft-fx-building-without-SVG-support.patch35
-rw-r--r--patches/cairo-1.18.0/0100-Cairo-Fix-Denial-of-Service-Attack-due-to-Logical-Pr.patch32
-rw-r--r--patches/cairo-1.18.0/0101-There-is-an-assertion-in-function-_cairo_arc_in_dire.patch29
-rw-r--r--patches/cairo-1.18.0/series7
-rw-r--r--patches/canfestival-3+hg20180126.794/0007-gnosis-port-to-python3.patch1912
-rw-r--r--patches/canfestival-3+hg20180126.794/0008-port-to-python3.patch945
-rw-r--r--patches/canfestival-3+hg20180126.794/series4
l---------patches/canutils-v2021.06.0/autogen.sh (renamed from patches/aumix-2.9.1/autogen.sh)0
-rw-r--r--patches/cbmbasic/0001-Add-IOBASE-and-pseudo-timer-will-give-RND-functional.patch52
-rw-r--r--patches/cbmbasic/series4
-rw-r--r--patches/cgic205/0001-Makefile-add-possibility-to-cross-compile.patch54
-rw-r--r--patches/cgic205/series4
-rw-r--r--patches/chrony-4.5/0001-configure-make-unrecognized-option-a-fatal-error.patch (renamed from patches/chrony-3.5/0001-configure-make-unrecognized-option-a-fatal-error.patch)4
-rw-r--r--patches/chrony-4.5/series (renamed from patches/chrony-3.5/series)0
-rw-r--r--patches/cku302/0003-add-missing-includes.patch73
-rw-r--r--patches/cku302/series3
-rw-r--r--patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch101
-rw-r--r--patches/classpath-0.99/0002-Fix-unmappable-character-error.patch23
-rwxr-xr-xpatches/classpath-0.99/autogen.sh2
-rw-r--r--patches/classpath-0.99/series5
-rw-r--r--patches/cog-0.8.1/0001-CMake-install-D-Bus-policy-configuration-to-CMAKE_IN.patch31
-rw-r--r--patches/cog-0.8.1/series4
l---------patches/cpputest-3.8/autogen.sh (renamed from patches/bayer2rgb3-0.4.1/autogen.sh)0
-rw-r--r--patches/crda-4.15/0001-fix-linking-libreg.patch (renamed from patches/crda-3.18/0001-fix-linking-libreg.patch)8
-rw-r--r--patches/crda-4.15/0002-Do-not-run-ldconfig-if-DESTDIR-is-set.patch (renamed from patches/crda-3.18/0002-Do-not-run-ldconfig-if-DESTDIR-is-set.patch)4
-rw-r--r--patches/crda-4.15/0003-Allow-build-without-embedding-pubkey-data-into-crda-.patch (renamed from patches/crda-3.18/0003-Allow-build-without-embedding-pubkey-data-into-crda-.patch)4
-rw-r--r--patches/crda-4.15/0004-udev-Fix-rule-for-initial-setup.patch (renamed from patches/crda-3.18/0004-udev-Fix-rule-for-initial-setup.patch)0
-rw-r--r--patches/crda-4.15/series (renamed from patches/crda-3.18/series)0
-rw-r--r--patches/cryptodev-linux-1.13/0001-zero-copy-Fix-build-for-Linux-6.4.patch33
-rw-r--r--patches/cryptodev-linux-1.13/0002-cryptodev_verbosity-Fix-build-for-Linux-6.4.patch40
-rw-r--r--patches/cryptodev-linux-1.13/0003-Move-recent-Linux-version-ifdefs-from-v6.4-to-v6.5.patch59
-rw-r--r--patches/cryptodev-linux-1.13/0004-Fix-build-for-Linux-6.7-rc1.patch34
-rw-r--r--patches/cryptodev-linux-1.13/series7
-rw-r--r--patches/dbus-1.15.8/0001-HACK-meson_post_install.py-don-t-try-to-change-owner.patch25
-rw-r--r--patches/dbus-1.15.8/series4
-rw-r--r--patches/dhcp-4.4.2/0001-Fixed-gcc-10-compilation-issues.patch82
-rw-r--r--patches/dhcp-4.4.2/series4
-rw-r--r--patches/dnsmasq-2.89/0001-the-pkg-config-file-is-lua-no-lua5.2.patch (renamed from patches/dnsmasq-2.81/0001-the-pkg-config-file-is-lua-no-lua5.2.patch)8
-rw-r--r--patches/dnsmasq-2.89/series (renamed from patches/dnsmasq-2.81/series)0
-rw-r--r--patches/dropwatch-1.5.3/0001-Fix-build-issue-when-compiling-with-Wcast-align.patch47
-rw-r--r--patches/dropwatch-1.5.3/0002-Fix-configure-for-libnl3-genl.patch43
-rw-r--r--patches/dropwatch-1.5.3/series5
l---------patches/dropwatch-1.5.4/autogen.sh (renamed from patches/bonnie++-1.97.3/autogen.sh)0
-rw-r--r--patches/dtc-v1.6.0/0001-fdtdump-Fix-gcc11-warning.patch30
-rw-r--r--patches/dtc-v1.6.0/series4
-rw-r--r--patches/e2fsprogs-1.47.0/0001-e2fsprogs-Disable-docs.patch37
-rw-r--r--patches/e2fsprogs-1.47.0/0002-e2fsprogs-Disable-ldconfig.patch29
-rw-r--r--patches/e2fsprogs-1.47.0/0003-mke2fs.conf-remove-orphan_file-from-ext4-features.patch39
-rw-r--r--patches/e2fsprogs-1.47.0/series6
-rw-r--r--patches/efivar-37/0001-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch55
-rw-r--r--patches/efivar-37/0002-Fix-all-the-places-Werror-address-of-packed-member-c.patch167
-rw-r--r--patches/efivar-37/series5
-rwxr-xr-xpatches/elfutils-0.180/autogen.sh18
-rw-r--r--patches/elfutils-0.180/series2
-rw-r--r--patches/elfutils-0.190/0001-disable-Werror-as-it-tends-to-break-with-new-gcc-ver.patch (renamed from patches/elfutils-0.180/0001-disable-Werror-as-it-tends-to-break-with-new-gcc-ver.patch)18
-rw-r--r--patches/elfutils-0.190/0002-riscv-retval-workaround.patch (renamed from patches/elfutils-0.180/0002-riscv-retval-workaround.patch)6
-rw-r--r--patches/elfutils-0.190/0003-remove-old-glibc-hack.patch30
l---------patches/elfutils-0.190/autogen.sh (renamed from patches/bridge-utils-1.6/autogen.sh)0
-rw-r--r--patches/elfutils-0.190/series6
l---------patches/evtest-1.35/autogen.sh (renamed from patches/cairo-1.16.0/autogen.sh)0
l---------patches/f2fs-tools-1.14.0/autogen.sh (renamed from patches/canutils-v2020.02.04/autogen.sh)0
-rw-r--r--patches/failmalloc-1.0/0001-fix-building-with-glibc-2.14.1.patch23
-rw-r--r--patches/failmalloc-1.0/series4
-rw-r--r--patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch33
-rw-r--r--patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch68
-rw-r--r--patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch22
-rw-r--r--patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch56
-rw-r--r--patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch44
-rw-r--r--patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch26
-rw-r--r--patches/fakeroot-1.25.3/0007-OS-X-portability.patch161
-rw-r--r--patches/fakeroot-1.25.3/series13
-rw-r--r--patches/fakeroot-1.31/0001-make-fakeroot-relocatable.patch (renamed from patches/fakeroot-1.25.3/0008-make-fakeroot-relocatable.patch)2
-rw-r--r--patches/fakeroot-1.31/series4
-rw-r--r--patches/fbset-2.1/0001-fbset-do-not-overwrite-CC-to-allow-crosscompiling.patch50
-rw-r--r--patches/fbset-2.1/series1
-rw-r--r--patches/fbtest-2023-03-28-g47f6351/0001-provide-a-pre-generated-penguin.c-to-get-rid-of-this.patch (renamed from patches/fbtest-2014-08-11-g29ab066/0001-provide-a-pre-generated-penguin.c-to-get-rid-of-this.patch)2
-rw-r--r--patches/fbtest-2023-03-28-g47f6351/0002-add-install-target.patch (renamed from patches/fbtest-2014-08-11-g29ab066/0002-add-install-target.patch)4
-rw-r--r--patches/fbtest-2023-03-28-g47f6351/0003-Initialize-ticks-in-benchmark.patch29
-rw-r--r--patches/fbtest-2023-03-28-g47f6351/series (renamed from patches/fbtest-2014-08-11-g29ab066/series)3
-rw-r--r--patches/fio-3.32/0001-use-latomic-when-necessary.patch (renamed from patches/fio-3.23/0001-use-latomic-when-necessary.patch)4
-rw-r--r--patches/fio-3.32/series (renamed from patches/fio-3.23/series)0
-rw-r--r--patches/flup-1.0.2/0001-support-python2.7.patch31
-rwxr-xr-xpatches/flup-1.0.2/autogen.sh4
-rw-r--r--patches/flup-1.0.2/series4
-rw-r--r--patches/flup-1.0.2/setuptools-0.6c11-py2.7.eggbin332005 -> 0 bytes
-rw-r--r--patches/freetype-2.13.2/0001-generate-freetype-config-and-freetype2.pc-correctly.patch (renamed from patches/freetype-2.10.1/0001-generate-freetype-config-and-freetype2.pc-correctly.patch)34
-rwxr-xr-xpatches/freetype-2.13.2/autogen.sh (renamed from patches/freetype-2.10.1/autogen.sh)0
-rw-r--r--patches/freetype-2.13.2/series (renamed from patches/freetype-2.10.1/series)0
-rw-r--r--patches/fuse-2.9.9/0001-Whitelist-UFSD-backport-to-2.9-branch-452.patch35
-rw-r--r--patches/fuse-2.9.9/0002-Correct-errno-comparison-571.patch21
-rw-r--r--patches/fuse-2.9.9/0003-util-ulockmgr_server.c-conditionally-define-closefro.patch59
-rw-r--r--patches/fuse-2.9.9/0100-use-asm-types.h-to-define-__u64-etc.patch (renamed from patches/fuse-2.9.9/0001-use-asm-types.h-to-define-__u64-etc.patch)0
l---------patches/fuse-2.9.9/autogen.sh (renamed from patches/dropwatch-1.5.3/autogen.sh)0
-rw-r--r--patches/fuse-2.9.9/series9
-rw-r--r--patches/glmark2-2020.04/0001-Build-Fix-Python-3-incompatibility.patch21
-rw-r--r--patches/glmark2-2020.04/0002-drm-Don-t-prefer-RGBA-component-widths-larger-than-8.patch32
-rw-r--r--patches/glmark2-2020.04/series5
-rw-r--r--patches/glu-9.0.1/0001-build-fix-the-debug-parameter-to-properly-handle-dis.patch30
-rw-r--r--patches/glu-9.0.1/series4
-rw-r--r--patches/gnutls-3.6.15/0001-don-t-try-ru-build-run-code-generator.patch31
-rwxr-xr-xpatches/gnutls-3.6.15/autogen.sh4
-rw-r--r--patches/gnutls-3.6.15/series4
-rw-r--r--patches/gobject-introspection-1.66.1/0002-meson-fix-building-with-Dbuild_introspection_data-fa.patch31
-rw-r--r--patches/gobject-introspection-1.66.1/series6
-rw-r--r--patches/gobject-introspection-1.72.0/0001-dumper.py-don-t-close-fds.patch (renamed from patches/gobject-introspection-1.66.1/0001-dumper.py-don-t-close-fds.patch)2
-rw-r--r--patches/gobject-introspection-1.72.0/0002-HACK-don-t-build-the-python-module-when-cross-compil.patch (renamed from patches/gobject-introspection-1.66.1/0003-HACK-don-t-build-the-python-module-when-cross-compil.patch)14
-rw-r--r--patches/gobject-introspection-1.72.0/series5
-rw-r--r--patches/gpsd-3.21/0003-SConstruct-don-t-make-python-files-without-shebang-e.patch23
-rw-r--r--patches/gpsd-3.21/series7
-rw-r--r--patches/gpsd-3.23.1/0001-SConscript-Search-for-ncursesw-pkgconfig.patch (renamed from patches/gpsd-3.21/0001-Search-for-ncursesw-pkgconfig.patch)16
-rw-r--r--patches/gpsd-3.23.1/0002-SConscript-Use-target-option-to-decide-whenewer-to-r.patch (renamed from patches/gpsd-3.21/0002-SConstruct-Use-target-option-to-decide-whenewer-to-r.patch)15
-rw-r--r--patches/gpsd-3.23.1/0003-SConscript-don-t-make-python-files-without-shebang-e.patch23
-rw-r--r--patches/gpsd-3.23.1/0004-SConscript-don-t-use-lnsl.patch (renamed from patches/gpsd-3.21/0004-SConstruct-don-t-use-lnsl.patch)14
-rw-r--r--patches/gpsd-3.23.1/series7
-rw-r--r--patches/grpc-1.21.0/0001-Add-pkg-config-files.patch47
-rw-r--r--patches/grpc-1.21.0/0100-Fix-gettid-naming-conflict.patch32
-rw-r--r--patches/grpc-1.21.0/0101-Rename-gettid-functions.patch79
-rw-r--r--patches/grpc-1.21.0/series7
-rw-r--r--patches/gst-plugins-bad-0.10.23/0001-remove-endianness-swapping.patch45
-rw-r--r--patches/gst-plugins-bad-0.10.23/0002-add-rgb666-support.patch52
-rw-r--r--patches/gst-plugins-bad-0.10.23/series4
-rw-r--r--patches/gst-plugins-base-0.10.36/0001-added-RGB666-Support-to-ffmpegcolorspace.patch296
-rw-r--r--patches/gst-plugins-base-0.10.36/0002-audioresample-Fix-build-on-x86-if-emmintrin.h-is-ava.patch33
-rw-r--r--patches/gst-plugins-base-0.10.36/series5
-rw-r--r--patches/gst-plugins-gl-0.10.2/0001-make-sure-gtk-example-builds-for-non-X-gtk.patch36
-rw-r--r--patches/gst-plugins-gl-0.10.2/series4
-rw-r--r--patches/gst-plugins-good-0.10.31/0001-follow-up-on-bug-622500-in-gst-plugins-good-bugzilla.patch22
-rw-r--r--patches/gst-plugins-good-0.10.31/0002-v4l2-fix-build-with-recent-kernels-the-v4l2_buffer-i.patch32
-rw-r--r--patches/gst-plugins-good-0.10.31/0003-remove-V4L2_CID_HCENTER-V4L2_CID_VCENTER-usage.patch60
-rw-r--r--patches/gst-plugins-good-0.10.31/series6
-rw-r--r--patches/gst-plugins-rs-1.24.3/0001-allow-executing-cargo-with-frozen.patch58
-rw-r--r--patches/gst-plugins-rs-1.24.3/0002-HACK-allow-feature-build_hasher_simple_hash_one.patch25
-rw-r--r--patches/gst-plugins-rs-1.24.3/series5
-rw-r--r--patches/gst-python-1.24.3/0001-gst-python-fix-cross-compiling.patch47
-rw-r--r--patches/gst-python-1.24.3/series4
-rw-r--r--patches/gstreamer-0.10.36/0001-parse-make-grammar.y-work-with-Bison-3.patch31
-rw-r--r--patches/gstreamer-0.10.36/series4
-rw-r--r--patches/gtk+-2.24.32/0001-gtk-Do-not-build-demos.patch22
-rw-r--r--patches/gtk+-2.24.32/series4
-rw-r--r--patches/gtk+-3.24.35/0001-build-make-atk-bridge-optional.patch (renamed from patches/gtk+-3.24.21/0001-build-make-atk-bridge-optional.patch)12
-rw-r--r--patches/gtk+-3.24.35/series (renamed from patches/gtk+-3.24.21/series)0
-rw-r--r--patches/hpanel-0.3.2/0001-Patches-the-Makefile-to-be-able-to-cross-compile.patch44
-rw-r--r--patches/hpanel-0.3.2/series3
-rw-r--r--patches/hping3-20051105/clean_makefile.diff74
-rw-r--r--patches/hping3-20051105/host_vs_target.diff75
-rw-r--r--patches/hping3-20051105/remove_pcap_header.diff23
-rw-r--r--patches/hping3-20051105/series3
-rw-r--r--patches/htmldoc-1.9.16/0001-Makefile-don-t-build-install-docs-or-desktop-files.patch28
-rw-r--r--patches/htmldoc-1.9.16/series (renamed from patches/open62541-1.2/series)4
-rw-r--r--patches/ima-evm-utils-1.1/0001-INSTALL-remove-file-at-it-s-autogenerated-by-autotoo.patch389
-rw-r--r--patches/ima-evm-utils-1.1/0002-Makefile.am-rename-INCLUDES-AM_CPPFLAGS.patch40
-rw-r--r--patches/ima-evm-utils-1.1/0006-evmctl-libimaevm-use-EVP_MAX_MD_SIZE-for-hash-size-i.patch73
-rw-r--r--patches/ima-evm-utils-1.1/0008-evmctl-add-parameter-e-to-set-evm-hash-algo.patch133
-rw-r--r--patches/ima-evm-utils-1.1/0011-HACK-don-t-generate-man-page.patch19
-rw-r--r--patches/ima-evm-utils-1.1/0013-evmctl-use-correct-include-for-xattr.h.patch80
-rw-r--r--patches/ima-evm-utils-1.1/series16
-rw-r--r--patches/ima-evm-utils-1.3.2/0001-evmctl-find-add-missing-closedir-dir-on-error.patch (renamed from patches/ima-evm-utils-1.1/0003-evmctl-find-add-missing-closedir-dir-on-error.patch)6
-rw-r--r--patches/ima-evm-utils-1.3.2/0002-evmctl-find-add-missing-error-handling-and-propagate.patch (renamed from patches/ima-evm-utils-1.1/0004-evmctl-find-add-missing-error-handling-and-propagate.patch)6
-rw-r--r--patches/ima-evm-utils-1.3.2/0003-evmctl-add-fallback-definitions-for-XATTR_NAME_IMA.patch (renamed from patches/ima-evm-utils-1.1/0005-evmctl-add-fallback-definitions-for-XATTR_NAME_IMA.patch)8
-rw-r--r--patches/ima-evm-utils-1.3.2/0004-libimaevm-use-SHA_DIGEST_LENGTH-instead-of-open-codi.patch (renamed from patches/ima-evm-utils-1.1/0007-libimaevm-use-SHA_DIGEST_LENGTH-instead-of-open-codi.patch)6
-rw-r--r--patches/ima-evm-utils-1.3.2/0005-evmctl-add-support-for-offline-image-preparation.patch (renamed from patches/ima-evm-utils-1.1/0009-evmctl-add-support-for-offline-image-preparation.patch)76
-rw-r--r--patches/ima-evm-utils-1.3.2/0006-evmctl-Do-not-account-.-and-.-for-directory-hash-gen.patch (renamed from patches/ima-evm-utils-1.1/0010-evmctl-Do-not-account-.-and-.-for-directory-hash-gen.patch)6
-rw-r--r--patches/ima-evm-utils-1.3.2/0007-Fix-warning-for-non-debug-use-case.patch (renamed from patches/ima-evm-utils-1.1/0012-Fix-warning-for-non-debug-use-case.patch)4
l---------patches/ima-evm-utils-1.3.2/autogen.sh (renamed from patches/evtest-1.33/autogen.sh)0
-rw-r--r--patches/ima-evm-utils-1.3.2/series10
-rw-r--r--patches/installer-0.7.0/0001-HACK-drop-shebang-magic.patch37
-rw-r--r--patches/installer-0.7.0/series4
-rw-r--r--patches/jed-0.99-19/0001-jed-don-t-execute-cross-compiled-files.patch30
-rw-r--r--patches/jed-0.99-19/0002-avoid-rpath.patch27
-rw-r--r--patches/jed-0.99-19/series5
-rw-r--r--patches/keyutils-1.6.3/0001-Makefile-don-t-create-absolute-link-outside-of-DESTD.patch (renamed from patches/keyutils-1.5.10/0001-Makefile-don-t-create-absolute-link-outside-of-DESTD.patch)10
-rw-r--r--patches/keyutils-1.6.3/0002-build-use-SOURCE_DATE_EPOCH-if-available-to-make-the.patch (renamed from patches/keyutils-1.5.10/0002-build-use-SOURCE_DATE_EPOCH-if-available-to-make-the.patch)4
-rw-r--r--patches/keyutils-1.6.3/series (renamed from patches/keyutils-1.5.10/series)0
-rw-r--r--patches/libaio-0.3.110/0001-make-the-package-DESTDIR-aware.patch30
-rw-r--r--patches/libaio-0.3.110/series4
l---------patches/libatasmart-0.19/autogen.sh (renamed from patches/f2fs-tools-1.12.0/autogen.sh)0
-rw-r--r--patches/libbsd-0.11.7/0001-use-I-instead-of-isystem-for-local-path.patch (renamed from patches/libbsd-0.8.2/0001-use-I-instead-of-isystem-for-local-path.patch)4
l---------patches/libbsd-0.11.7/autogen.sh (renamed from patches/fakeroot-1.25.3/autogen.sh)0
-rw-r--r--patches/libbsd-0.11.7/series (renamed from patches/libbsd-0.8.2/series)0
-rw-r--r--patches/libcaca-0.99.beta16/0002-set-the-escape-delay-with-set_escdelay.patch27
-rw-r--r--patches/libcaca-0.99.beta16/series4
-rw-r--r--patches/libcaca-0.99.beta19/0001-caca-config-add-SYSROOT-support.patch (renamed from patches/libcaca-0.99.beta16/0001-caca-config-add-SYSROOT-support.patch)8
-rw-r--r--patches/libcaca-0.99.beta19/series4
-rw-r--r--patches/libcap-2.44/0001-Fix-build-on-non-Linux-host.patch41
-rw-r--r--patches/libcap-2.44/series4
-rw-r--r--patches/libcroco-0.6.2/0001-croco-config-add-SYSROOT-support.patch28
-rw-r--r--patches/libcroco-0.6.2/series1
-rw-r--r--patches/libffi-3.3/0001-Fixed-missed-ifndef-for-__mips_soft_float-442.patch25
-rw-r--r--patches/libffi-3.3/0002-powerpc-fix-build-failure-on-power7-and-older-532.patch35
-rw-r--r--patches/libffi-3.3/series5
-rw-r--r--patches/libffi-3.4.6/0001-libffi-Fix-location-of-libraries-for-multilib-toolch.patch24
-rw-r--r--patches/libffi-3.4.6/0002-libffi-ensure-sysroot-paths-are-not-in-libffi.pc.patch33
l---------patches/libffi-3.4.6/autogen.sh (renamed from patches/glu-9.0.1/autogen.sh)0
-rw-r--r--patches/libffi-3.4.6/series5
-rw-r--r--patches/libgpg-error-1.36/0001-awk-Prepare-for-Gawk-5.0.patch154
-rw-r--r--patches/libgpg-error-1.36/series4
-rw-r--r--patches/libgpg-error-1.47/0001-gpgrt-config-improve-pkg-config-file-parsing.patch33
-rw-r--r--patches/libgpg-error-1.47/series4
-rw-r--r--patches/libgudev-230/0001-Prepare-to-check-for-an-older-UDEV.patch131
-rw-r--r--patches/libgudev-230/series4
l---------patches/libkcapi-1.5.0/autogen.sh (renamed from patches/gtk+-2.24.32/autogen.sh)0
-rw-r--r--patches/liboil-0.3.16/0001-liboil-don-t-check-for-assembler-options-and-add-com.patch29
-rw-r--r--patches/liboil-0.3.16/0002-fix-unaligned-access-whitelist-check.patch22
-rwxr-xr-xpatches/liboil-0.3.16/autogen.sh19
-rw-r--r--patches/liboil-0.3.16/series5
-rw-r--r--patches/libpcap-1.10.4/0100-build-and-install-share-lib-only.patch (renamed from patches/libpcap-1.8.1/0100-build-and-install-share-lib-only.patch)22
-rw-r--r--patches/libpcap-1.10.4/0101-pcap-config-add-SYSROOT-support.patch (renamed from patches/libpcap-1.8.1/0101-pcap-config-add-SYSROOT-support.patch)21
-rw-r--r--patches/libpcap-1.10.4/series (renamed from patches/libpcap-1.8.1/series)4
-rw-r--r--patches/libpcap-1.8.1/0001-Fix-compilation-if-INET6-isn-t-defined.patch58
-rw-r--r--patches/libpcap-1.8.1/0102-configure.ac-allow-specifying-path-for-libnl3.patch25
-rw-r--r--patches/libseccomp-2.5.5/0001-run-time-use-a-broadly-supported-shell-interpreter.patch (renamed from patches/libseccomp-2.5.1/0001-run-time-use-a-broadly-supported-shell-interpreter.patch)0
-rw-r--r--patches/libseccomp-2.5.5/series (renamed from patches/libseccomp-2.5.1/series)0
-rw-r--r--patches/libsndfile-1.0.25/0001-configure.ac-use-default-largefile-macro.patch22
-rwxr-xr-xpatches/libsndfile-1.0.25/autogen.sh19
-rw-r--r--patches/libsndfile-1.0.25/series4
-rw-r--r--patches/libsoup-2.66.2/0001-meson-allow-enabling-gir-when-cross-compiling.patch22
-rw-r--r--patches/libsoup-2.66.2/series4
-rw-r--r--patches/libtahu-1.0.1/0001-c-core-Makefile-Fixes-for-parallel-make-and-make-lib.patch34
-rw-r--r--patches/libtahu-1.0.1/0002-tahu.h-Do-not-define-SPARKPLUG_DEBUG.patch28
-rw-r--r--patches/libtahu-1.0.1/series2
-rw-r--r--patches/libtool-2.4.6/0001-libool.m4-add-ARFLAGS-variable.patch68
-rw-r--r--patches/libtool-2.4.6/0002-ARFLAGS-use-cr-instead-of-cru-by-default.patch124
-rw-r--r--patches/libtool-2.4.6/0003-libtool-fix-GCC-linking-with-specs.patch33
-rw-r--r--patches/libtool-2.4.6/0004-libtool-fix-GCC-clang-linking-with-fsanitize.patch33
-rw-r--r--patches/libtool-2.4.6/0005-libtool-pass-through-fuse-ld-flags.patch32
-rw-r--r--patches/libtool-2.4.6/series8
-rw-r--r--patches/libtremor-2018-03-19-g7c30a6634619/0001-HACK-configure.in-remove-extended-OGG-check.patch (renamed from patches/libtremor-1.0.3/0001-HACK-configure.in-remove-extended-OGG-check.patch)2
-rw-r--r--patches/libtremor-2018-03-19-g7c30a6634619/0002-Only-enable-ARM-assember-on-armel.patch30
l---------patches/libtremor-2018-03-19-g7c30a6634619/autogen.sh (renamed from patches/ima-evm-utils-1.1/autogen.sh)0
-rw-r--r--patches/libtremor-2018-03-19-g7c30a6634619/series (renamed from patches/libtremor-1.0.3/series)3
-rw-r--r--patches/libunwind-1.4.0/0001-Fix-compilation-with-fno-common.patch441
-rw-r--r--patches/libunwind-1.4.0/series4
-rwxr-xr-xpatches/libuv-v1.47.0/autogen.sh (renamed from patches/libuv-v1.34.0/autogen.sh)0
-rw-r--r--patches/libwacom-1.9/0001-HACK-build-generate-hwdb-as-native-tool.patch95
-rw-r--r--patches/libwacom-1.9/series4
-rw-r--r--patches/libx86-1.1/libx86-1.1-IF_MASK-undeclared.diff33
-rw-r--r--patches/libx86-1.1/series1
-rw-r--r--patches/libxml2-2.11.7/0200-xml2-config-is-not-SYSROOT-aware.patch (renamed from patches/libxml2-2.9.12/0200-xml2-config-is-not-SYSROOT-aware.patch)2
-rw-r--r--patches/libxml2-2.11.7/series (renamed from patches/libxml2-2.9.12/series)0
-rw-r--r--patches/libxslt-1.1.34/0001-Fix-xml2-config-check-in-configure-script.patch23
-rw-r--r--patches/libxslt-1.1.34/series7
-rw-r--r--patches/libxslt-1.1.39/0200-xslt-config-add-SYSROOT-support.patch (renamed from patches/libxslt-1.1.34/0200-xslt-config-add-SYSROOT-support.patch)0
-rw-r--r--patches/libxslt-1.1.39/series5
l---------patches/libyaml-0.2.5/autogen.sh (renamed from patches/libbsd-0.8.2/autogen.sh)0
-rw-r--r--patches/linuxptp-2.0/0001-Fix-building-with-new-kernel-headers.patch54
-rw-r--r--patches/linuxptp-2.0/series4
-rw-r--r--patches/lmbench-3.0-a9/0001-Add-autotool-based-build-system.patch (renamed from patches/lmbench-3.0-a9/lmbench-3.0-a9-remove-old-buildsystem.diff)34
-rw-r--r--patches/lmbench-3.0-a9/0002-Add-autotool-based-build-system.patch (renamed from patches/lmbench-3.0-a9/lmbench-3.0-a9-autotoolize.diff)47
-rw-r--r--patches/lmbench-3.0-a9/0003-minor-cleanups.patch (renamed from patches/lmbench-3.0-a9/lmbench-3.0-a9-rpcheaders.diff)20
-rw-r--r--patches/lmbench-3.0-a9/0004-Added-libtirpc.patch59
-rw-r--r--patches/lmbench-3.0-a9/0005-Added-missing-include-for-socklen_t-check.patch25
-rw-r--r--patches/lmbench-3.0-a9/series11
-rw-r--r--patches/localedef-glibc-2.37/0001-HACK-only-build-and-install-localedef.patch (renamed from patches/localedef-glibc-2.27/0001-HACK-only-build-and-install-localedef.patch)10
-rw-r--r--patches/localedef-glibc-2.37/0002-Do-not-fail-on-unknown-LC_IDENTIFICATION.category-va.patch (renamed from patches/localedef-glibc-2.27/0002-Do-not-fail-on-unknown-LC_IDENTIFICATION.category-va.patch)4
-rw-r--r--patches/localedef-glibc-2.37/series (renamed from patches/localedef-glibc-2.27/series)0
-rw-r--r--patches/lsh-2.0.4/0001-fix-typo-in-md5-compress.asm.patch21
-rw-r--r--patches/lsh-2.0.4/series4
-rw-r--r--patches/lshw-B.02.14/0001-fix-cross-compilation.patch69
-rw-r--r--patches/lshw-B.02.14/0003-fix-compiling-with-g-4.5.patch27
-rw-r--r--patches/lshw-B.02.14/series3
-rw-r--r--patches/lshw-B.02.19.2/0001-Replace-keyword-node-with-hwnode-for-TinyXpath-compa.patch (renamed from patches/lshw-B.02.14/0002-Replace-keyword-node-with-hwnode-for-TinyXpath-compa.patch)20
-rw-r--r--patches/lshw-B.02.19.2/series4
-rw-r--r--patches/lua-5.4.4/0001-Cross-compile-in-ptxdist-envirionment.patch (renamed from patches/lua-5.3.4/0001-Cross-compile-in-ptxdist-envirionment.patch)41
-rw-r--r--patches/lua-5.4.4/0002-Install-pkgconfig-file.patch (renamed from patches/lua-5.3.4/0002-Install-pkgconfig-file.patch)16
-rw-r--r--patches/lua-5.4.4/series (renamed from patches/lua-5.3.4/series)0
-rw-r--r--patches/lxml-4.4.2/0001-do-not-use-libdirs-from-xslt-config.patch31
-rw-r--r--patches/lxml-4.4.2/series1
-rw-r--r--patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch159
-rw-r--r--patches/m4-1.4.18/series4
-rw-r--r--patches/meson-0.56.0/0001-pkgconfig-Respect-variable-ordering-when-passed-as-l.patch26
-rw-r--r--patches/meson-0.56.0/0101-HACK-enable-NEON-only-for-ARMv7.patch25
-rw-r--r--patches/meson-0.56.0/series7
-rw-r--r--patches/meson-1.3.0/0001-don-t-add-rpaths-for-build-directories-when-cross-co.patch (renamed from patches/meson-0.56.0/0100-don-t-add-rpaths-for-build-directories-when-cross-co.patch)16
-rw-r--r--patches/meson-1.3.0/0002-HACK-enable-NEON-only-for-ARMv7.patch25
-rw-r--r--patches/meson-1.3.0/0003-HACK-don-t-fail-if-lrelease-is-missing.patch26
-rw-r--r--patches/meson-1.3.0/0004-HACK-don-t-fail-if-uic-is-missing.patch29
-rw-r--r--patches/meson-1.3.0/series7
-rw-r--r--patches/mgetty-1.1.36/0001-fix-install.patch205
-rw-r--r--patches/mgetty-1.1.36/0002-fix-building-on-arm64.patch22
-rw-r--r--patches/mgetty-1.1.36/0003-fix-building-with-gcc-7.x.patch78
-rw-r--r--patches/mgetty-1.1.36/series6
-rw-r--r--patches/minicom-2.8/0002-lib-usleep.c-fix-error-NULL-undeclared.patch27
-rw-r--r--patches/minicom-2.8/series5
-rw-r--r--patches/minicom-2.9/0001-build-reproducibly.patch (renamed from patches/minicom-2.8/0001-build-reproducibly.patch)6
-rw-r--r--patches/minicom-2.9/series4
-rw-r--r--patches/mlpack-4.2.1/0001-HACK-don-t-do-magic-stuff-for-cross-compiling.patch67
-rw-r--r--patches/mlpack-4.2.1/series4
l---------patches/mobile-broadband-provider-info-20220725/autogen.sh (renamed from patches/libgpg-error-1.36/autogen.sh)0
-rw-r--r--patches/mongodb-7.2.2/0001-HACK-SConstruct-remove-metrics.patch40
-rw-r--r--patches/mongodb-7.2.2/0002-HACK-SConstruct-keep-environment.patch24
-rw-r--r--patches/mongodb-7.2.2/0003-HACK-don-t-require-GitPython.patch24
-rw-r--r--patches/mongodb-7.2.2/series6
-rw-r--r--patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch142
l---------patches/mtd-utils-2.1.2/autogen.sh1
-rw-r--r--patches/mtd-utils-2.2.0/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch (renamed from patches/mtd-utils-2.1.2/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch)18
l---------patches/mtd-utils-2.2.0/autogen.sh (renamed from patches/libgudev-230/autogen.sh)0
-rw-r--r--patches/mtd-utils-2.2.0/series (renamed from patches/mtd-utils-2.1.2/series)3
-rw-r--r--patches/mysql-5.7.11/0001-Fix_buildsystem-use-compile-only-tests.patch100
-rw-r--r--patches/mysql-5.7.11/series4
-rw-r--r--patches/nanocom-1.0/0001-Nanocom-fix-its-buildsystem.patch37
-rw-r--r--patches/nanocom-1.0/series4
-rw-r--r--patches/nbd-3.12.1/0001-Don-t-make-the-readit-function-depend-on-WORDS_BIGEN.patch31
-rw-r--r--patches/nbd-3.12.1/series4
-rw-r--r--patches/ncftp-3.2.6-src/0001-HACK-configure-always-assume-cross-compiling.patch25
-rw-r--r--patches/ncftp-3.2.6-src/0002-HACK-avoid-miss-detecting-clang.patch36
-rw-r--r--patches/ncftp-3.2.6-src/series5
-rw-r--r--patches/ncurses-6.4/0001-teach-ncurses-config-about-sysroot.patch (renamed from patches/ncurses-6.2/0001-teach-ncurses-config-about-sysroot.patch)18
-rw-r--r--patches/ncurses-6.4/series (renamed from patches/ncurses-6.2/series)0
-rw-r--r--patches/net-snmp-5.9.1/0001-net-snmp-config-add-SYSROOT-support.patch (renamed from patches/net-snmp-5.9/0001-net-snmp-config-add-SYSROOT-support.patch)10
-rw-r--r--patches/net-snmp-5.9.1/0002-Don-t-disable-udp-and-tcp-when-disable-agentx-dom-so.patch (renamed from patches/net-snmp-5.9/0002-Don-t-disable-udp-and-tcp-when-disable-agentx-dom-so.patch)4
l---------patches/net-snmp-5.9.1/autogen.sh (renamed from patches/libkcapi-1.1.5/autogen.sh)0
-rw-r--r--patches/net-snmp-5.9.1/series (renamed from patches/net-snmp-5.9/series)0
l---------patches/net-snmp-5.9/autogen.sh1
-rw-r--r--patches/netperf-2.7.0/0001-fix-inlining.patch46
-rw-r--r--patches/netperf-2.7.0/series4
-rw-r--r--patches/nfs-utils-2.5.3/0001-allow-installing-all-tools-in-usr.patch38
-rw-r--r--patches/nfs-utils-2.5.3/0002-configure-check-for-rpc-rpc.h-presence.patch32
l---------patches/nfs-utils-2.5.3/autogen.sh1
-rw-r--r--patches/nfs-utils-2.5.3/series5
-rw-r--r--patches/nftables-0.8.3/0001-configure-don-t-enable-xtables-when-without-xtables-.patch32
l---------patches/nftables-0.8.3/autogen.sh1
-rw-r--r--patches/nftables-0.8.3/series4
-rw-r--r--patches/nginx-1.18.0/0006-auto-lib-openssl-conf-use-pkg-config.patch27
-rw-r--r--patches/nginx-1.18.0/0100-auto-endianness-add-mechanism-allowing-to-force-resu.patch22
-rw-r--r--patches/nginx-1.24.0/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch (renamed from patches/nginx-1.18.0/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch)2
-rw-r--r--patches/nginx-1.24.0/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch (renamed from patches/nginx-1.18.0/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch)0
-rw-r--r--patches/nginx-1.24.0/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch (renamed from patches/nginx-1.18.0/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch)46
-rw-r--r--patches/nginx-1.24.0/0004-auto-lib-libxslt-conf-use-pkg-config.patch (renamed from patches/nginx-1.18.0/0004-auto-lib-libxslt-conf-use-pkg-config.patch)2
-rw-r--r--patches/nginx-1.24.0/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch (renamed from patches/nginx-1.18.0/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch)27
-rw-r--r--patches/nginx-1.24.0/0006-auto-lib-openssl-conf-use-pkg-config.patch247
-rw-r--r--patches/nginx-1.24.0/0007-auto-lib-libgd-conf-use-pkg-config.patch (renamed from patches/nginx-1.18.0/0007-auto-lib-libgd-conf-use-pkg-config.patch)17
-rw-r--r--patches/nginx-1.24.0/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch (renamed from patches/nginx-1.18.0/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch)2
-rw-r--r--patches/nginx-1.24.0/0009-auto-os-linux-fix-build-with-libxcrypt.patch34
-rw-r--r--patches/nginx-1.24.0/0010-Allow-forcing-of-endianness-for-cross-compilation.patch114
-rw-r--r--patches/nginx-1.24.0/0100-auto-unix-allow-overriding-the-IPv6-build-tests.patch (renamed from patches/nginx-1.18.0/0101-auto-unix-allow-overriding-the-IPv6-build-tests.patch)4
-rw-r--r--patches/nginx-1.24.0/series (renamed from patches/nginx-1.18.0/series)7
-rw-r--r--patches/ninja-1.11.1.g95dee.kitware.jobserver-1/0001-don-t-close-open-fds.patch (renamed from patches/ninja-1.8.2/0007-don-t-close-open-fds.patch)6
-rw-r--r--patches/ninja-1.11.1.g95dee.kitware.jobserver-1/series4
-rw-r--r--patches/ninja-1.8.2/0001-Add-GNU-make-jobserver-client-support.patch478
-rw-r--r--patches/ninja-1.8.2/0002-Add-TokenPool-monitoring-to-SubprocessSet-DoWork.patch554
-rw-r--r--patches/ninja-1.8.2/0003-Ignore-jobserver-when-jN-is-forced-on-command-line.patch192
-rw-r--r--patches/ninja-1.8.2/0004-Honor-lN-from-MAKEFLAGS.patch128
-rw-r--r--patches/ninja-1.8.2/0005-Use-LinePrinter-for-TokenPool-messages.patch122
-rw-r--r--patches/ninja-1.8.2/0006-Prepare-PR-for-merging.patch151
-rw-r--r--patches/ninja-1.8.2/series10
-rw-r--r--patches/node-v12.16.1/0001-Disable-running-gyp-on-shared-deps.patch21
-rw-r--r--patches/node-v12.16.1/0002-Install-both-binaries-and-use-libdir.patch83
-rw-r--r--patches/node-v12.16.1/0003-tools-do-not-explicitely-set-an-rpath-in-make-genera.patch30
-rw-r--r--patches/node-v12.16.1/0004-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch44
-rw-r--r--patches/node-v12.16.1/0005-HACK-run-configure-directly-with-python2.patch23
-rw-r--r--patches/node-v12.16.1/series8
-rw-r--r--patches/node-v20.11.0/0001-Disable-running-gyp-on-shared-deps.patch46
-rw-r--r--patches/node-v20.11.0/0002-v8-don-t-override-ARM-CFLAGS.patch98
-rw-r--r--patches/node-v20.11.0/0100-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch46
-rw-r--r--patches/node-v20.11.0/0101-run-native-code-generators-with-qemu.patch85
-rw-r--r--patches/node-v20.11.0/series9
-rw-r--r--patches/nss-3.98/0001-nss-fix-nsinstall-build.patch (renamed from patches/nss-3.63/0001-nss-fix-nsinstall-build.patch)2
-rw-r--r--patches/nss-3.98/0002-add-nss.pc.in.patch (renamed from patches/nss-3.63/0002-add-nss.pc.in.patch)0
-rw-r--r--patches/nss-3.98/0003-HACK-don-t-build-commands-that-need-zlib.patch (renamed from patches/nss-3.63/0003-HACK-don-t-build-commands-that-need-zlib.patch)10
-rw-r--r--patches/nss-3.98/0004-HACK-fix-parallel-building-issue.patch (renamed from patches/nss-3.63/0004-HACK-fix-parallel-building-issue.patch)4
-rw-r--r--patches/nss-3.98/0005-fix-dependency-generation.patch (renamed from patches/nss-3.63/0005-fix-dependency-generation.patch)2
-rw-r--r--patches/nss-3.98/series (renamed from patches/nss-3.63/series)0
-rw-r--r--patches/ntp-4.2.8p12/0001-make-the-build-reproducible.patch26
-rw-r--r--patches/ntp-4.2.8p12/series4
-rw-r--r--patches/ntpclient-2007/0001-Use-the-correct-macro-name-to-parametrize-make-s-sta.patch33
-rw-r--r--patches/ntpclient-2007/0002-Avoid-some-confusing-compile-time-warnings.patch33
-rw-r--r--patches/ntpclient-2007/series3
-rw-r--r--patches/ntpclient_2015_365/0001-Makefile-add-installtarget.patch (renamed from patches/ntpclient-2007/0003-Makefile-add-installtarget.patch)14
-rw-r--r--patches/ntpclient_2015_365/series4
-rw-r--r--patches/numpy-1.17.4/0001-remove-sse2-flag.patch27
-rw-r--r--patches/numpy-1.17.4/series1
-rw-r--r--patches/numpy-1.26.0/0001-use-path-from-environment-only-for-library_dirs.patch25
-rw-r--r--patches/numpy-1.26.0/series4
-rw-r--r--patches/open62541-1.2/0001-CMake-Allow-UA_NODESET_DIR-to-be-custom-defined.patch144
-rw-r--r--patches/open62541-1.3.4/0001-feat-server-allow-UA_NODESET_DIR-to-be-custom-define.patch71
-rw-r--r--patches/open62541-1.3.4/series4
-rw-r--r--patches/openblas-0.3.24/0001-openblas.pc-add-prefix.patch20
-rw-r--r--patches/openblas-0.3.24/series4
-rw-r--r--patches/openssl-1.1.1k/0003-Set-systemwide-default-settings-for-libssl-users.patch46
-rw-r--r--patches/openssl-1.1.1k/series6
-rw-r--r--patches/openssl-3.2.1/0001-debian-targets.patch (renamed from patches/openssl-1.1.1k/0001-debian-targets.patch)99
-rw-r--r--patches/openssl-3.2.1/0002-pic.patch (renamed from patches/openssl-1.1.1k/0002-pic.patch)32
-rw-r--r--patches/openssl-3.2.1/0003-Configure-allow-to-enable-ktls-if-target-does-not-st.patch55
-rw-r--r--patches/openssl-3.2.1/0004-conf-Serialize-allocation-free-of-ssl_names.patch106
-rw-r--r--patches/openssl-3.2.1/0005-Configure-drop-fzero-call-used-regs-used-gpr-from-De.patch25
-rw-r--r--patches/openssl-3.2.1/series10
-rw-r--r--patches/opkg-utils-0.4.2/0001-Fix-reproducibility-issues-in-opkg-build.patch35
-rw-r--r--patches/opkg-utils-0.4.2/0103-Revert-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch38
-rw-r--r--patches/opkg-utils-0.6.3/0100-opkg-build-use-CROSS_COMPILE-ar.patch (renamed from patches/opkg-utils-0.4.2/0100-opkg-build-use-CROSS_COMPILE-ar.patch)10
-rw-r--r--patches/opkg-utils-0.6.3/0101-Update-Installed-Size-properly.patch (renamed from patches/opkg-utils-0.4.2/0101-Update-Installed-Size-properly.patch)6
-rw-r--r--patches/opkg-utils-0.6.3/0102-opkg-build-in-ptxdist-the-maxium-UID-for-system-user.patch (renamed from patches/opkg-utils-0.4.2/0102-opkg-build-in-ptxdist-the-maxium-UID-for-system-user.patch)4
-rw-r--r--patches/opkg-utils-0.6.3/0103-opkg-build-fix-typo-in-compressorargs.patch (renamed from patches/opkg-utils-0.4.2/0104-opkg-build-fix-typo-in-compressorargs.patch)4
-rw-r--r--patches/opkg-utils-0.6.3/series (renamed from patches/opkg-utils-0.4.2/series)6
-rw-r--r--patches/opus-1.5.1/0001-fix-arm-asm-meson-source-build.patch66
-rw-r--r--patches/opus-1.5.1/0002-Extended-asm-with-C-operands-doesn-t-work-at-top-lev.patch44
-rw-r--r--patches/opus-1.5.1/0003-use-semicolon-not-newline-for-inline-assembler.patch47
-rw-r--r--patches/opus-1.5.1/0004-Add-OPUS_ARM_INLINE_DOTPROD-dotprod-check.patch73
-rw-r--r--patches/opus-1.5.1/0005-Fix-meson-AVX2-fixed-point.patch23
-rw-r--r--patches/opus-1.5.1/0100-ptxdist-get-version.py-don-t-detect-extract-git-as-g.patch25
-rw-r--r--patches/opus-1.5.1/series11
-rw-r--r--patches/pango-1.43.0/0001-tests-fix-build-dependency.patch35
-rw-r--r--patches/pango-1.43.0/series4
-rw-r--r--patches/poco-1.9.0/0001-fix-parallel-building.patch57
-rw-r--r--patches/poco-1.9.0/series4
-rw-r--r--patches/polkit-0.105/0001-0.106-agenthelper-pam-Fix-newline-trimming-code.patch47
-rw-r--r--patches/polkit-0.105/0002-0.108-build-Fix-.gir-generation-for-parallel-make.patch45
-rw-r--r--patches/polkit-0.105/0003-0.110-Set-XAUTHORITY-environment-variable-if-is-unse.patch62
-rw-r--r--patches/polkit-0.105/0004-0.110-Fix-build-on-GNU-Hurd.patch44
-rw-r--r--patches/polkit-0.105/0005-0.111-pkexec-Set-process-environment-from-pam_getenv.patch47
-rw-r--r--patches/polkit-0.105/0006-0.111-Fix-a-memory-leak.patch26
-rw-r--r--patches/polkit-0.105/0007-0.112-Use-GOnce-for-interface-type-registration.patch122
-rw-r--r--patches/polkit-0.105/0008-0.112-polkitunixprocess-Deprecate-racy-APIs.patch31
-rw-r--r--patches/polkit-0.105/0009-0.112-pkcheck-Support-process-pid-start-time-uid-syn.patch121
-rw-r--r--patches/polkit-0.105/0010-0.113-Port-internals-non-deprecated-PolkitProcess-AP.patch34
-rw-r--r--patches/polkit-0.105/0011-0.113-pkexec-Work-around-systemd-injecting-broken-XD.patch81
-rw-r--r--patches/polkit-0.105/0012-0.113-PolkitAgentSession-fix-race-between-child-and-.patch125
-rw-r--r--patches/polkit-0.105/0013-0.113-polkitd-Fix-problem-with-removing-non-existent.patch27
-rw-r--r--patches/polkit-0.105/0014-0.113-PolkitSystemBusName-Add-public-API-to-retrieve.patch171
-rw-r--r--patches/polkit-0.105/0015-0.113-Fixed-compilation-problem-in-the-backend.patch27
-rw-r--r--patches/polkit-0.105/0016-0.113-Don-t-discard-error-data-returned-by-polkit_sy.patch29
-rw-r--r--patches/polkit-0.105/0017-0.113-sessionmonitor-systemd-Deduplicate-code-paths.patch108
-rw-r--r--patches/polkit-0.105/0018-0.113-sessionmonitor-systemd-prepare-for-D-Bus-user-.patch94
-rw-r--r--patches/polkit-0.105/0019-0.113-Refuse-duplicate-user-arguments-to-pkexec.patch42
-rw-r--r--patches/polkit-0.105/0020-0.113-authority-Fix-memory-leak-in-EnumerateActions-.patch31
-rw-r--r--patches/polkit-0.105/0021-0.113-CVE-2015-3218-backend-Handle-invalid-object-pa.patch120
-rw-r--r--patches/polkit-0.105/0022-0.113-sessionmonitor-systemd-Use-sd_uid_get_state-to.patch77
-rw-r--r--patches/polkit-0.105/0023-0.113-Fix-a-possible-NULL-dereference.patch39
-rw-r--r--patches/polkit-0.105/0024-0.113-Remove-a-redundant-assignment.patch30
-rw-r--r--patches/polkit-0.105/0025-0.113-Fix-duplicate-GError-use-when-uid-is-missing.patch36
-rw-r--r--patches/polkit-0.105/0026-0.113-Fix-a-crash-when-two-authentication-requests-a.patch41
-rw-r--r--patches/polkit-0.105/0027-0.113-CVE-2015-4625-Use-unpredictable-cookie-values-.patch545
-rw-r--r--patches/polkit-0.105/0028-0.113-CVE-2015-4625-Bind-use-of-cookies-to-specific-.patch488
-rw-r--r--patches/polkit-0.105/0029-0.113-docs-Update-for-changes-to-uid-binding-Authent.patch264
-rw-r--r--patches/polkit-0.105/0030-0.113-Fix-a-per-authorization-memory-leak.patch53
-rw-r--r--patches/polkit-0.105/0031-0.113-Fix-a-memory-leak-when-registering-an-authenti.patch27
-rw-r--r--patches/polkit-0.105/0032-0.113-CVE-2015-3255-Fix-GHashTable-usage.patch72
-rw-r--r--patches/polkit-0.105/0033-0.113-Fix-use-after-free-in-polkitagentsession.c.patch36
-rw-r--r--patches/polkit-0.105/0034-0.114-Fix-multi-line-pam-text-info.patch43
-rw-r--r--patches/polkit-0.105/0035-0.114-Refactor-send_to_helper-usage.patch153
-rw-r--r--patches/polkit-0.105/0036-0.114-Support-polkit-session-agent-running-outside-u.patch56
-rw-r--r--patches/polkit-0.105/0037-0.115-Fix-CVE-2018-1116-Trusting-client-supplied-UID.patch573
-rw-r--r--patches/polkit-0.105/0038-0.116-Allow-negative-uids-gids-in-PolkitUnixUser-and.patch191
-rw-r--r--patches/polkit-0.105/0039-0.116-Allow-uid-of-1-for-a-PolkitUnixProcess.patch47
-rw-r--r--patches/polkit-0.105/0040-Revert-Default-to-AdminIdentities-unix-group-wheel-f.patch39
-rw-r--r--patches/polkit-0.105/0041-Build-against-libsystemd.patch36
-rw-r--r--patches/polkit-0.105/0042-Move-D-Bus-policy-file-to-usr-share-dbus-1-system.d.patch35
-rw-r--r--patches/polkit-0.105/0043-0.116-backend-Compare-PolkitUnixProcess-uids-for-tem.patch186
-rw-r--r--patches/polkit-0.105/0100-automake-add-missing-conditional-HAVE_INTROSPECTION.patch130
-rw-r--r--patches/polkit-0.105/0101-Add-a-systemd-.service-file.patch121
l---------patches/polkit-0.105/autogen.sh1
-rw-r--r--patches/polkit-0.105/series50
-rw-r--r--patches/polkit-124/0001-build-install-polkit-agent-1-library-with-libs-only.patch65
-rw-r--r--patches/polkit-124/0002-build-libpolkit-agent-1-does-not-use-expat.patch21
-rw-r--r--patches/polkit-124/0003-build-libexpat-is-not-needed-with-libs-only.patch34
-rw-r--r--patches/polkit-124/series6
-rw-r--r--patches/portmap_6.0/portmap_6.0-fix-disable-tcpwrapper.diff22
-rw-r--r--patches/portmap_6.0/series1
l---------patches/powertop-v2.15/autogen.sh (renamed from patches/libpcap-1.8.1/autogen.sh)0
-rw-r--r--patches/ppp-2.4.7/0001-abort-on-errors-in-subdir-builds.patch48
-rw-r--r--patches/ppp-2.4.7/0002-scripts-Avoid-killing-wrong-pppd.patch29
-rw-r--r--patches/ppp-2.4.7/0003-pppd-Fix-sign-extension-when-displaying-bytes-in-oct.patch30
-rw-r--r--patches/ppp-2.4.7/0004-Suppress-false-error-message-on-PPPoE-disconnect.patch33
-rw-r--r--patches/ppp-2.4.7/0005-Send-PADT-on-PPPoE-disconnect.patch36
-rw-r--r--patches/ppp-2.4.7/0006-pppd-ipxcp-Prevent-buffer-overrun-on-remote-router-n.patch30
-rw-r--r--patches/ppp-2.4.7/0007-pppd-Fix-ccp_options.mppe-type.patch30
-rw-r--r--patches/ppp-2.4.7/0008-pppd-Fix-ccp_cilen-calculated-size-if-both-deflate_c.patch33
-rw-r--r--patches/ppp-2.4.7/0009-Fix-a-typo-in-comment.-Diff-from-Yuuichi-Someya.patch24
-rw-r--r--patches/ppp-2.4.7/0010-plog-count-only-relevant-lines-from-syslog.patch24
-rw-r--r--patches/ppp-2.4.7/0011-Change-include-from-sys-errno.h-to-errno.h.patch33
-rw-r--r--patches/ppp-2.4.7/0012-pppd-allow-use-of-arbitrary-interface-names.patch214
-rw-r--r--patches/ppp-2.4.7/0013-pppd-Remove-unused-declaration-of-ttyname.patch25
-rw-r--r--patches/ppp-2.4.7/0014-pppd-Provide-error-implementation-in-pppoe-discovery.patch52
-rw-r--r--patches/ppp-2.4.7/0015-pppoe-include-netinet-in.h-before-linux-in.h.patch49
-rw-r--r--patches/ppp-2.4.7/0016-adaptive_echos.patch72
-rw-r--r--patches/ppp-2.4.7/0017-Makefiles-cleanup.patch296
-rw-r--r--patches/ppp-2.4.7/0018-Bug-306261-pppd-does-not-properly-close-dev-ppp-on-p.patch44
-rw-r--r--patches/ppp-2.4.7/0019-Bug-284382-ppp-linkpidfile-is-not-created-upon-detac.patch48
-rw-r--r--patches/ppp-2.4.7/0022-cosmetic-cleanup-of-the-pppoatm-plugin.patch90
-rw-r--r--patches/ppp-2.4.7/0023-pppoe_noads.patch25
-rw-r--r--patches/ppp-2.4.7/0024-make-_PATH_CONNERRS-world-readable.patch27
-rw-r--r--patches/ppp-2.4.7/0025-Correct-unkown-unknown-typo.patch46
-rw-r--r--patches/ppp-2.4.7/0026-pppoe-custom-host-uniq-tag.patch302
-rw-r--r--patches/ppp-2.4.7/0027-Add-replacedefaultroute-option.patch324
-rw-r--r--patches/ppp-2.4.7/0029-add-support-for-the-Framed-MTU-Radius-attribute.patch42
-rw-r--r--patches/ppp-2.4.7/0030-018_ip-up_option.patch106
-rw-r--r--patches/ppp-2.4.7/0031-ppp-2.4.2-stripMSdomain.patch47
-rw-r--r--patches/ppp-2.4.7/0032-export-CALL_FILE-to-the-link-scripts.patch38
-rw-r--r--patches/ppp-2.4.7/0033-ipv6-accept-remote.patch73
-rw-r--r--patches/ppp-2.4.7/0034-fix-a-potential-buffer-overflow-in-clientid.c-rc_map.patch43
-rw-r--r--patches/ppp-2.4.7/0037-Fix-buffer-overflow-in-rc_mksid.patch36
-rw-r--r--patches/ppp-2.4.7/0038-EAP-TLS-authentication-support-for-PPP.patch3383
-rw-r--r--patches/ppp-2.4.7/0040-pppd-Use-openssl-for-the-DES-instead-of-the-libcrypt.patch115
-rw-r--r--patches/ppp-2.4.7/series46
-rw-r--r--patches/ppp-2.4.9/0001-configure-Allow-commas-in-the-CFLAGS-220.patch28
-rw-r--r--patches/ppp-2.4.9/0002-pppd-Fix-compilation-with-older-glibc-or-kernel-head.patch55
-rw-r--r--patches/ppp-2.4.9/0100-support-building-pppdump-with-the-system-zlib.patch (renamed from patches/ppp-2.4.7/0020-support-building-pppdump-with-the-system-zlib.patch)27
-rw-r--r--patches/ppp-2.4.9/0101-disable-unneeded-code-in-the-pppoatm-plugin.patch (renamed from patches/ppp-2.4.7/0021-disable-unneeded-code-in-the-pppoatm-plugin.patch)16
-rw-r--r--patches/ppp-2.4.9/0102-pppoe_noads.patch24
-rw-r--r--patches/ppp-2.4.9/0103-Forwarded-https-github.com-paulusmack-ppp-issues-187.patch (renamed from patches/ppp-2.4.7/0028-ppp-2.3.11-oedod.dif.patch)69
-rw-r--r--patches/ppp-2.4.9/0104-resolv.conf_no_log.patch (renamed from patches/ppp-2.4.7/0035-resolv.conf_no_log.patch)12
-rw-r--r--patches/ppp-2.4.9/0105-Debian-specific-changes.patch (renamed from patches/ppp-2.4.7/0036-Debian-specific-changes.patch)50
-rw-r--r--patches/ppp-2.4.9/0106-Replace-vendored-hash-functions-with-libcrypto.patch (renamed from patches/ppp-2.4.7/0039-Replace-vendored-hash-functions-with-libcrypto.patch)209
-rw-r--r--patches/ppp-2.4.9/0200-pppd-make-makefile-sysroot-aware.patch (renamed from patches/ppp-2.4.7/0100-pppd-make-makefile-sysroot-aware.patch)34
-rw-r--r--patches/ppp-2.4.9/0201-pppd-make-the-self-made-configure-cross-aware.patch (renamed from patches/ppp-2.4.7/0101-pppd-make-the-self-made-configure-cross-aware.patch)10
-rw-r--r--patches/ppp-2.4.9/series17
-rw-r--r--patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch40
-rw-r--r--patches/pps-tools-1.0.2/series4
-rw-r--r--patches/pps-tools-1.0.3/0001-Makefile-Remove-obstructive-use-of-SYSROOT-variable.patch29
-rw-r--r--patches/pps-tools-1.0.3/series4
-rw-r--r--patches/procps-ng-4.0.4/0001-build-sys-Add-systemd-elogind-to-w.patch42
l---------patches/procps-ng-4.0.4/autogen.sh (renamed from patches/libtremor-1.0.3/autogen.sh)0
-rw-r--r--patches/procps-ng-4.0.4/series4
-rw-r--r--patches/pyDataMatrixScanner/0001-load-lib-from-global-dir.patch30
-rw-r--r--patches/pyDataMatrixScanner/series3
-rw-r--r--patches/pyside-qt4.8+1.2.2/0001-only-add-qaccessibleevent_wrapper.cpp-if-accessible-.patch37
-rw-r--r--patches/pyside-qt4.8+1.2.2/0002-add-include-iostream.patch23
-rw-r--r--patches/pyside-qt4.8+1.2.2/0003-add-qws-support.patch116
-rw-r--r--patches/pyside-qt4.8+1.2.2/series6
-rw-r--r--patches/python_rplicmp-1.0/0001-build-files-correctly.patch24
-rw-r--r--patches/python_rplicmp-1.0/series4
-rw-r--r--patches/pytz-2023.3/0001-use-system-timezone-data.patch (renamed from patches/pytz-2020.1/0001-use-system-timezone-data.patch)0
-rw-r--r--patches/pytz-2023.3/series (renamed from patches/pytz-2020.1/series)0
-rw-r--r--patches/pyyaml-3.12/0001-setup.py-remove-overcomplicated-setup-resulting-in-w.patch324
-rw-r--r--patches/pyyaml-3.12/series4
-rw-r--r--patches/pyzmq-14.1.0/0001-HACK-setup.py-avoid-rpath-with-sysroot.patch24
-rw-r--r--patches/pyzmq-14.1.0/series4
-rw-r--r--patches/qemu-5.2.0/series5
-rw-r--r--patches/qemu-8.2.2/0001-linux-user-x86_64-Handle-the-vsyscall-page-in-open_s.patch57
-rw-r--r--patches/qemu-8.2.2/0100-9pfs-allow-real-symlinks-for-security_model-mapped-f.patch (renamed from patches/qemu-5.2.0/0001-9pfs-allow-real-symlinks-for-security_model-mapped-f.patch)26
-rw-r--r--patches/qemu-8.2.2/0101-let-ninja-use-the-jobserver.patch (renamed from patches/qemu-5.2.0/0002-let-ninja-use-the-jobserver.patch)10
-rw-r--r--patches/qemu-8.2.2/series8
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0001-mkspec-for-ptxdist.patch123
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0002-disable-ordered-compiling.patch79
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0003-Hack-hide-cursor-during-startup.patch27
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0004-add-missing-subdirs.patch73
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0005-Fix-dnd-issue-on-QWS.patch64
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0006-qmake-make-sure-local-include-dirs-come-first.patch39
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0007-phonon-fix-colors-for-video-on-qgraphicsview.patch36
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0008-don-t-build-webkit-tests.patch33
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0009-fix-build-issues-with-gcc6.patch51
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0010-configure-handle-gcc-9.x.patch22
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/0011-Redo-the-Q_FOREACH-loop-control-without-GCC-statemen.patch68
-rw-r--r--patches/qt-everywhere-opensource-src-4.8.7/series14
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0001-CVE-2023-4863-5.15.patch3767
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0002-CVE-2023-24607-qtbase-5.15.diff.patch337
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0003-CVE-2023-32573-qtsvg-5.15.diff.patch46
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0004-CVE-2023-32762-qtbase-5.15.diff.patch24
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0005-CVE-2023-32763-qtbase-5.15.diff.patch59
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0006-CVE-2023-33285-qtbase-5.15.diff.patch79
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0007-CVE-2023-34410-qtbase-5.15.diff.patch66
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0008-CVE-2023-37369-qtbase-5.15.diff.patch214
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0009-CVE-2023-38197-qtbase-5.15.diff.patch229
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0010-CVE-2023-43114-5.15.patch126
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0011-xkb-fix-build-with-libxkbcommon-1.6.0-and-later.patch38
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0100-qtwebengine-chromium-skia-Fix-build-with-gcc-12.patch61
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0101-qt3d-link-with-latomic-if-necessary.patch (renamed from patches/qt-everywhere-src-5.15.2/0003-qt3d-link-with-latomic-if-necessary.patch)0
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0102-qt5-qtwebengine-fix-gcc13-errors.patch268
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0103-Rename-x11-Present-Pixmap-to-x11-Present-PresentPixm.patch31
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0200-replace-Python-2-with-Python-3-in-the-build-system.patch176
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0201-update-Chromium-code-for-compatibility-with-Python-3.patch1874
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0202-fix-build-with-Python-3.11.patch61
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0203-remove-dependencies-on-third_party-catapult.patch9973
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0300-qtwayland-use-QT_EGL_NO_X11-and-qt_egl_p.h-everywher.patch (renamed from patches/qt-everywhere-src-5.15.2/0001-qtwayland-use-QT_EGL_NO_X11-and-qt_egl_p.h-everywher.patch)0
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0301-videonode-egl-use-QT_EGL_NO_X11-and-qt_egl_p.h.patch (renamed from patches/qt-everywhere-src-5.15.2/0002-videonode-egl-use-QT_EGL_NO_X11-and-qt_egl_p.h.patch)0
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0302-qtbase-fix-building-with-mesa-22.3.0.patch40
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0400-ptxdist-qtwebengine-allow-building-with-ptxdist.patch (renamed from patches/qt-everywhere-src-5.15.2/0005-ptxdist-qtwebengine-allow-building-with-ptxdist.patch)0
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0401-ptxdist-qtwebengine-let-ninja-use-the-jobserver.patch (renamed from patches/qt-everywhere-src-5.15.2/0006-ptxdist-qtwebengine-let-ninja-use-the-jobserver.patch)18
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0402-HACK-qtwebengine-workaround-for-too-long-file-names.patch (renamed from patches/qt-everywhere-src-5.15.2/0007-HACK-qtwebengine-workaround-for-too-long-file-names.patch)0
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/0500-eglfs_kms-device-ordering-robustness.patch (renamed from patches/qt-everywhere-src-5.15.2/0004-eglfs_kms-device-ordering-robustness.patch)0
-rw-r--r--patches/qt-everywhere-opensource-src-5.15.12/series35
-rw-r--r--patches/qt-everywhere-src-5.15.2/0008-qtbase-include-limits-where-necessary.patch69
-rw-r--r--patches/qt-everywhere-src-5.15.2/series11
-rw-r--r--patches/qt-everywhere-src-6.6.2/0100-qtwebengine-gn-fix-building-with-newer-compilers.patch47
-rw-r--r--patches/qt-everywhere-src-6.6.2/0200-HACK-qtwebengine-workaround-for-too-long-file-names.patch39
-rw-r--r--patches/qt-everywhere-src-6.6.2/0201-HACK-don-t-complain-about-unnecessary-host-tools.patch59
-rw-r--r--patches/qt-everywhere-src-6.6.2/0202-ptxdist-qtwebengine-allow-building-with-ptxdist.patch26
-rw-r--r--patches/qt-everywhere-src-6.6.2/0203-fix-building-with-QT_FEATURE_qml_devtools-disabled.patch29
-rw-r--r--patches/qt-everywhere-src-6.6.2/series11
-rw-r--r--patches/qwt-6.0.1/0001-fix-prefix.patch22
-rw-r--r--patches/qwt-6.0.1/0002-disable-designer-plugins.patch22
-rw-r--r--patches/qwt-6.0.1/0003-disable-svg-by-default.patch24
-rw-r--r--patches/qwt-6.0.1/0004-Disable-the-textengines-to-be-less-depended-on-the-Q.patch35
-rw-r--r--patches/qwt-6.0.1/series7
-rw-r--r--patches/readline-8.2/0001-rl-attribute.patch (renamed from patches/readline-8.0/0001-rl-attribute.patch)6
-rw-r--r--patches/readline-8.2/0002-rl-header.patch (renamed from patches/readline-8.0/0002-rl-header.patch)4
-rw-r--r--patches/readline-8.2/0003-rl-no-rpath.patch (renamed from patches/readline-8.0/0003-rl-no-rpath.patch)4
-rw-r--r--patches/readline-8.2/0004-rlfe-history.patch (renamed from patches/readline-8.0/0004-rlfe-history.patch)0
-rw-r--r--patches/readline-8.2/0005-always-link-against-our-termcap-libraries.patch (renamed from patches/readline-8.0/0005-always-link-against-our-termcap-libraries.patch)2
-rw-r--r--patches/readline-8.2/series (renamed from patches/readline-8.0/series)0
-rw-r--r--patches/redis-7.2.2/0001-Support-systemd-and-set-a-data-directory.patch30
-rw-r--r--patches/redis-7.2.2/series4
l---------patches/rng-tools-6.14/autogen.sh (renamed from patches/libxslt-1.1.34/autogen.sh)0
-rw-r--r--patches/rng-tools-6.5/0001-Buildsystem-fix-autotools-setup.patch25
l---------patches/rng-tools-6.5/autogen.sh1
-rw-r--r--patches/rng-tools-6.5/series4
-rw-r--r--patches/samba-4.14.6/0001-HACK-never-use-libunwind.patch46
-rw-r--r--patches/samba-4.14.6/series4
-rw-r--r--patches/scikit-learn-1.3.1/0001-setup.py-don-t-try-to-import-numpy-scipy-at-build-ti.patch28
-rw-r--r--patches/scikit-learn-1.3.1/series4
-rw-r--r--patches/scipy-1.11.3/0001-BLD-special-fix-dependencies-for-_ellip_harm_2-19168.patch34
-rw-r--r--patches/scipy-1.11.3/0100-add-option-to-specify-python-binary-for-code-generat.patch43
-rw-r--r--patches/scipy-1.11.3/series6
-rw-r--r--patches/screen-4.5.0/0001-don-t-link-against-libelf.patch33
-rw-r--r--patches/screen-4.5.0/0002-remove-configure-AC_TRY_RUN-tests.patch727
-rw-r--r--patches/screen-4.5.0/0003-autoconf-cleanup.patch397
-rw-r--r--patches/screen-4.5.0/0004-Fix-some-typos-found-by-Lintian.patch48
-rw-r--r--patches/screen-4.5.0/0005-show-encoding-in-hardstatus.patch52
-rw-r--r--patches/screen-4.5.0/0006-Unbreak-several-useful-keybindings.patch22
-rw-r--r--patches/screen-4.5.0/0007-Fix-privilege-escalation-by-reverting-upstream-commi.patch30
-rw-r--r--patches/screen-4.5.0/0008-Fix-terminal-garbage-in-Debian-Installer-over-serial.patch24
-rw-r--r--patches/screen-4.5.0/0009-Ignore-logfile-s-name-that-begins-with-the-symbol.patch77
-rwxr-xr-xpatches/screen-4.5.0/autogen.sh9
-rw-r--r--patches/screen-4.5.0/series12
-rw-r--r--patches/screen-4.9.1/0001-comm.h-now-depends-on-term.h.patch24
-rw-r--r--patches/screen-4.9.1/0002-comm.h-needed-for-list_-display-generic-.o.patch31
-rw-r--r--patches/screen-4.9.1/0003-suppress_remap.patch24
l---------patches/screen-4.9.1/autogen.sh (renamed from patches/libyaml-0.1.7/autogen.sh)0
-rw-r--r--patches/screen-4.9.1/series6
-rw-r--r--patches/setuptools-rust-1.5.2/series1
-rw-r--r--patches/setuptools-rust-1.5.2/use-Literal-from-typing.patch53
-rw-r--r--patches/shiboken-1.2.2/0001-cmake-allow-specifying-the-preferred-Python2-version.patch19
-rw-r--r--patches/shiboken-1.2.2/0002-cmake-allow-specifying-the-preferred-Python3-version.patch47
-rw-r--r--patches/shiboken-1.2.2/series5
-rw-r--r--patches/sockperf-3.10/0001-Fixed-AArch32-compilation.patch69
-rw-r--r--patches/sockperf-3.10/series4
-rw-r--r--patches/softhsm-2.6.1/0001-Prevent-accessing-of-global-c-objects-once-they-are-.patch673
-rw-r--r--patches/softhsm-2.6.1/series4
-rw-r--r--patches/squashfs4.4/0001-squashfs-tools-fix-build-failure-against-gcc-10.patch42
-rw-r--r--patches/squashfs4.4/series4
-rw-r--r--patches/squashfs4.5.1/0001-don-t-try-to-generate-manpages.patch21
-rw-r--r--patches/squashfs4.5.1/series4
-rw-r--r--patches/svgalib-1.9.25/0001-svgalib-disable-obsolete-drivers.patch12
-rw-r--r--patches/svgalib-1.9.25/0002-svgalib-patch-taken-from-open-embedded.patch42
-rw-r--r--patches/svgalib-1.9.25/0003-svgalib-search-also-in-local-sharedlib-dir.patch12
-rw-r--r--patches/svgalib-1.9.25/0004-don-t-try-to-change-ld.so.conf-or-run-ldconfig.patch24
-rw-r--r--patches/svgalib-1.9.25/series4
-rw-r--r--patches/tcp_wrappers_7.6/series2
-rw-r--r--patches/tcp_wrappers_7.6/tcp_wrappers-7.6-gcc34-1.patch31
-rw-r--r--patches/tcp_wrappers_7.6/tcp_wrappers_7.6-ptx1.diff31
-rw-r--r--patches/thttpd-2.25b/0001-rename-getline-local_getline.patch38
-rw-r--r--patches/thttpd-2.25b/series3
-rw-r--r--patches/tree-2.1.0/0100-Makefile-Correct-prefix-handling-and-installation.patch76
-rw-r--r--patches/tree-2.1.0/series5
-rw-r--r--patches/unstrung-1.11.0/0001-main-interface-needs-argument.patch24
-rw-r--r--patches/unstrung-1.11.0/0002-main-remove-double-dagid-entry.patch21
-rw-r--r--patches/unstrung-1.11.0/series5
-rw-r--r--patches/ustr-1.0.4/0001-makefile-make-it-possible-to-overwrite-binary-checks.patch61
-rw-r--r--patches/ustr-1.0.4/0002-fixes-gnu-inline.patch875
-rw-r--r--patches/ustr-1.0.4/series5
l---------patches/valgrind-3.16.1/autogen.sh1
-rw-r--r--patches/valgrind-3.22.0/0001-configure.ac-allow-all-arm-don-t-restrict-to-armv7.patch (renamed from patches/valgrind-3.16.1/0001-configure.ac-allow-all-arm-don-t-restrict-to-armv7.patch)4
-rw-r--r--patches/valgrind-3.22.0/0002-make-kernel-version-a-autoconf-cache-variable.patch (renamed from patches/valgrind-3.16.1/0002-make-kernel-version-a-autoconf-cache-variable.patch)4
l---------patches/valgrind-3.22.0/autogen.sh (renamed from patches/mobile-broadband-provider-info-20190618/autogen.sh)0
-rw-r--r--patches/valgrind-3.22.0/series (renamed from patches/valgrind-3.16.1/series)0
-rw-r--r--patches/vkrunner-2023-10-29-g93cbb7b1cca7/0001-Add-Cargo.lock.patch460
-rw-r--r--patches/vkrunner-2023-10-29-g93cbb7b1cca7/series4
-rw-r--r--patches/weston-13.0.1/0001-HACK-don-t-build-tests.patch23
-rw-r--r--patches/weston-13.0.1/series4
-rw-r--r--patches/xf86-input-tslib-0.0.6/0001-fix-segfault.patch41
-rw-r--r--patches/xf86-input-tslib-0.0.6/0002-add-support-for-ABI-12.patch213
-rw-r--r--patches/xf86-input-tslib-0.0.6/0003-fix-name-collision-with-Xorg-macro.patch34
-rw-r--r--patches/xf86-input-tslib-0.0.6/series6
-rw-r--r--patches/xf86-video-fbdev-0.5.0/0001-xf86-video-fbdev-add-option-to-leave-timings-alone.patch47
-rw-r--r--patches/xf86-video-fbdev-0.5.0/0002-Fix-build-error-when-building-with-xserver-built-usi.patch21
-rw-r--r--patches/xf86-video-fbdev-0.5.0/series5
l---------patches/xf86-video-intel-2.99.917-892-gc6cb1b199598/autogen.sh1
-rw-r--r--patches/xorg-server-1.20.10/0001-xf86bigfont-always-include-unistd.h.patch37
-rw-r--r--patches/xorg-server-1.20.10/series4
742 files changed, 26561 insertions, 37432 deletions
diff --git a/patches/Imaging-1.1.7/0001-setup.py-remove-host-directories-from-search-paths.patch b/patches/Imaging-1.1.7/0001-setup.py-remove-host-directories-from-search-paths.patch
deleted file mode 100644
index f322445cd..000000000
--- a/patches/Imaging-1.1.7/0001-setup.py-remove-host-directories-from-search-paths.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 26 May 2011 17:07:26 +0200
-Subject: [PATCH] setup.py: remove host directories from search paths
-
-This patch is probably not acceptable in upstream.
-
-Forwarded: not-needed
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- setup.py | 8 --------
- 1 file changed, 8 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index 5d4d53a..26d5672 100644
---- a/setup.py
-+++ b/setup.py
-@@ -147,7 +147,6 @@ class pil_build_ext(build_ext):
- add_directory(library_dirs, "/opt/local/lib")
- add_directory(include_dirs, "/opt/local/include")
-
-- add_directory(library_dirs, "/usr/local/lib")
- # FIXME: check /opt/stuff directories here?
-
- prefix = sysconfig.get_config_var("prefix")
-@@ -207,13 +206,6 @@ class pil_build_ext(build_ext):
- if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
- add_directory(include_dirs, tcl_dir)
-
-- # standard locations
-- add_directory(library_dirs, "/usr/local/lib")
-- add_directory(include_dirs, "/usr/local/include")
--
-- add_directory(library_dirs, "/usr/lib")
-- add_directory(include_dirs, "/usr/include")
--
- #
- # insert new dirs *before* default libs, to avoid conflicts
- # between Python PYD stub libs and real libraries
diff --git a/patches/Imaging-1.1.7/0002-fix-compiling-with-FreeType-2.5.1.patch b/patches/Imaging-1.1.7/0002-fix-compiling-with-FreeType-2.5.1.patch
deleted file mode 100644
index ef5f2649b..000000000
--- a/patches/Imaging-1.1.7/0002-fix-compiling-with-FreeType-2.5.1.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Andrew Stromnov <stromnov@gmail.com>
-Date: Thu, 28 Nov 2013 16:58:43 +0400
-Subject: [PATCH] fix compiling with FreeType 2.5.1
-
----
- _imagingft.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/_imagingft.c b/_imagingft.c
-index 9358087..3ab1cbe 100644
---- a/_imagingft.c
-+++ b/_imagingft.c
-@@ -70,7 +70,11 @@ struct {
- const char* message;
- } ft_errors[] =
-
-+#if defined(USE_FREETYPE_2_1)
-+#include FT_ERRORS_H
-+#else
- #include <freetype/fterrors.h>
-+#endif
-
- /* -------------------------------------------------------------------- */
- /* font objects */
diff --git a/patches/Imaging-1.1.7/series b/patches/Imaging-1.1.7/series
deleted file mode 100644
index 852e106f2..000000000
--- a/patches/Imaging-1.1.7/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-setup.py-remove-host-directories-from-search-paths.patch
-0002-fix-compiling-with-FreeType-2.5.1.patch
-# 02e3c3fc00cd9d7bba8253fd4c3e7b5a - git-ptx-patches magic
diff --git a/patches/ModemManager-1.16.2/0001-kerneldevice-udev-don-t-use-autoptr-in-GUdev-types.patch b/patches/ModemManager-1.16.2/0001-kerneldevice-udev-don-t-use-autoptr-in-GUdev-types.patch
deleted file mode 100644
index 511b1693f..000000000
--- a/patches/ModemManager-1.16.2/0001-kerneldevice-udev-don-t-use-autoptr-in-GUdev-types.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From: Aleksander Morgado <aleksander@aleksander.es>
-Date: Tue, 23 Mar 2021 15:36:58 +0100
-Subject: [PATCH] kerneldevice,udev: don't use autoptr in GUdev types
-
-The autoptr support in all GUdev types was introduced in
-commit 272533131c6ed38479a88805, included in libgudev 232.
-
-In the MM 1.16 branch we depend on libgudev 147, so avoid
-implicitly bumping the required version.
-
-Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/349
----
- src/kerneldevice/mm-kernel-device-udev.c | 30 +++++++++++++++++++++---------
- 1 file changed, 21 insertions(+), 9 deletions(-)
-
-diff --git a/src/kerneldevice/mm-kernel-device-udev.c b/src/kerneldevice/mm-kernel-device-udev.c
-index f75104bd6b1c..a6bf1a71df88 100644
---- a/src/kerneldevice/mm-kernel-device-udev.c
-+++ b/src/kerneldevice/mm-kernel-device-udev.c
-@@ -81,7 +81,7 @@ static void
- preload_contents_platform (MMKernelDeviceUdev *self,
- const gchar *platform)
- {
-- g_autoptr(GUdevDevice) iter = NULL;
-+ GUdevDevice *iter;
-
- iter = g_object_ref (self->priv->device);
- while (iter) {
-@@ -102,17 +102,19 @@ preload_contents_platform (MMKernelDeviceUdev *self,
- g_clear_object (&iter);
- iter = parent;
- }
-+
-+ g_clear_object (&iter);
- }
-
- static void
- preload_contents_pcmcia (MMKernelDeviceUdev *self)
- {
-- g_autoptr(GUdevDevice) iter = NULL;
-- gboolean pcmcia_subsystem_found = FALSE;
-+ GUdevDevice *iter;
-+ gboolean pcmcia_subsystem_found = FALSE;
-
- iter = g_object_ref (self->priv->device);
- while (iter) {
-- g_autoptr(GUdevDevice) parent = NULL;
-+ GUdevDevice *parent;
-
- /* Store the first driver found */
- if (!self->priv->driver)
-@@ -133,18 +135,21 @@ preload_contents_pcmcia (MMKernelDeviceUdev *self)
- self->priv->product = udev_device_get_sysfs_attr_as_hex (iter, "card_id");
- self->priv->physdev = g_object_ref (iter);
- /* stop traversing as soon as the physical device is found */
-+ g_clear_object (&parent);
- break;
- }
-
- g_clear_object (&iter);
-- iter = g_steal_pointer (&parent);
-+ iter = parent;
- }
-+
-+ g_clear_object (&iter);
- }
-
- static void
- preload_contents_pci (MMKernelDeviceUdev *self)
- {
-- g_autoptr(GUdevDevice) iter = NULL;
-+ GUdevDevice *iter;
-
- iter = g_object_ref (self->priv->device);
- while (iter) {
-@@ -170,12 +175,14 @@ preload_contents_pci (MMKernelDeviceUdev *self)
- g_clear_object (&iter);
- iter = parent;
- }
-+
-+ g_clear_object (&iter);
- }
-
- static void
- preload_contents_usb (MMKernelDeviceUdev *self)
- {
-- g_autoptr(GUdevDevice) iter = NULL;
-+ GUdevDevice *iter;
-
- iter = g_object_ref (self->priv->device);
- while (iter) {
-@@ -204,12 +211,14 @@ preload_contents_usb (MMKernelDeviceUdev *self)
- g_clear_object (&iter);
- iter = parent;
- }
-+
-+ g_clear_object (&iter);
- }
-
- static gchar *
- find_device_bus_subsystem (MMKernelDeviceUdev *self)
- {
-- g_autoptr(GUdevDevice) iter = NULL;
-+ GUdevDevice *iter;
-
- iter = g_object_ref (self->priv->device);
- while (iter) {
-@@ -224,8 +233,10 @@ find_device_bus_subsystem (MMKernelDeviceUdev *self)
- (g_strcmp0 (subsys, "pci") == 0) ||
- (g_strcmp0 (subsys, "platform") == 0) ||
- (g_strcmp0 (subsys, "pnp") == 0) ||
-- (g_strcmp0 (subsys, "sdio") == 0))
-+ (g_strcmp0 (subsys, "sdio") == 0)) {
-+ g_clear_object (&iter);
- return g_strdup (subsys);
-+ }
-
- parent = g_udev_device_get_parent (iter);
- g_clear_object (&iter);
-@@ -233,6 +244,7 @@ find_device_bus_subsystem (MMKernelDeviceUdev *self)
- }
-
- /* no more parents to check */
-+ g_clear_object (&iter);
- return NULL;
- }
-
diff --git a/patches/ModemManager-1.16.2/series b/patches/ModemManager-1.16.2/series
deleted file mode 100644
index 073ee95c5..000000000
--- a/patches/ModemManager-1.16.2/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-kerneldevice-udev-don-t-use-autoptr-in-GUdev-types.patch
-# 7ee4df7afdcd7083fe59386d7e47c795 - git-ptx-patches magic
diff --git a/patches/NetworkManager-1.26.2/0001-clients-cli-build-generate_docs_nm_settings_nmcli-on.patch b/patches/NetworkManager-1.26.2/0001-clients-cli-build-generate_docs_nm_settings_nmcli-on.patch
deleted file mode 100644
index db3c29643..000000000
--- a/patches/NetworkManager-1.26.2/0001-clients-cli-build-generate_docs_nm_settings_nmcli-on.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 5ddd262c1042ef2cd748b3b2a724d2e15f89b9fb Mon Sep 17 00:00:00 2001
-From: Robert Schwebel <r.schwebel@pengutronix.de>
-Date: Sat, 25 Jul 2020 18:14:35 +0200
-Subject: [PATCH] clients/cli: build generate_docs_nm_settings_nmcli only if
- docs are enabled
-
-Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
----
- clients/cli/meson.build | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/clients/cli/meson.build b/clients/cli/meson.build
-index 517deffa6..2dada71f5 100644
---- a/clients/cli/meson.build
-+++ b/clients/cli/meson.build
-@@ -35,6 +35,9 @@ executable(
-
- endif
-
-+enable_docs = get_option('docs')
-+if enable_docs
-+
- generate_docs_nm_settings_nmcli = executable(
- 'generate-docs-nm-settings-nmcli',
- files(
-@@ -56,3 +59,5 @@ generate_docs_nm_settings_nmcli_xml = custom_target(
- command: [ generate_docs_nm_settings_nmcli ],
- capture: true,
- )
-+
-+endif
---
-2.27.0
-
diff --git a/patches/NetworkManager-1.26.2/series b/patches/NetworkManager-1.26.2/series
deleted file mode 100644
index b04ab9c47..000000000
--- a/patches/NetworkManager-1.26.2/series
+++ /dev/null
@@ -1 +0,0 @@
-0001-clients-cli-build-generate_docs_nm_settings_nmcli-on.patch
diff --git a/patches/OpenSC-0.23.0/0001-pkcs11-tool-Fix-private-key-import.patch b/patches/OpenSC-0.23.0/0001-pkcs11-tool-Fix-private-key-import.patch
new file mode 100644
index 000000000..16427c56f
--- /dev/null
+++ b/patches/OpenSC-0.23.0/0001-pkcs11-tool-Fix-private-key-import.patch
@@ -0,0 +1,28 @@
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Thu, 1 Dec 2022 20:08:53 +0100
+Subject: [PATCH] pkcs11-tool: Fix private key import
+
+---
+ src/tools/pkcs11-tool.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/tools/pkcs11-tool.c b/src/tools/pkcs11-tool.c
+index aae205fe2cd6..cfee8526d5b0 100644
+--- a/src/tools/pkcs11-tool.c
++++ b/src/tools/pkcs11-tool.c
+@@ -3669,13 +3669,13 @@ parse_rsa_pkey(EVP_PKEY *pkey, int private, struct rsakey_info *rsa)
+ RSA_get0_factors(r, &r_p, &r_q);
+ RSA_get0_crt_params(r, &r_dmp1, &r_dmq1, &r_iqmp);
+ #else
+- if (EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_FACTOR1, &r_d) != 1 ||
++ if (EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_D, &r_d) != 1 ||
+ EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_FACTOR1, &r_p) != 1 ||
+ EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_FACTOR2, &r_q) != 1 ||
+ EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_EXPONENT1, &r_dmp1) != 1 ||
+ EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_EXPONENT2, &r_dmq1) != 1 ||
+- EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_EXPONENT3, &r_iqmp) != 1) {
+ util_fatal("OpenSSL error during RSA private key parsing");
++ EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_COEFFICIENT1, &r_iqmp) != 1) {
+ }
+ #endif
+ RSA_GET_BN(rsa, private_exponent, r_d);
diff --git a/patches/OpenSC-0.23.0/0002-pkcs11-tool-Log-more-information-on-OpenSSL-errors.patch b/patches/OpenSC-0.23.0/0002-pkcs11-tool-Log-more-information-on-OpenSSL-errors.patch
new file mode 100644
index 000000000..f5238e9d6
--- /dev/null
+++ b/patches/OpenSC-0.23.0/0002-pkcs11-tool-Log-more-information-on-OpenSSL-errors.patch
@@ -0,0 +1,49 @@
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Thu, 1 Dec 2022 20:11:41 +0100
+Subject: [PATCH] pkcs11-tool: Log more information on OpenSSL errors
+
+---
+ src/tools/pkcs11-tool.c | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/src/tools/pkcs11-tool.c b/src/tools/pkcs11-tool.c
+index cfee8526d5b0..f2e6b1dd91cd 100644
+--- a/src/tools/pkcs11-tool.c
++++ b/src/tools/pkcs11-tool.c
+@@ -3641,10 +3641,8 @@ parse_rsa_pkey(EVP_PKEY *pkey, int private, struct rsakey_info *rsa)
+ const BIGNUM *r_dmp1, *r_dmq1, *r_iqmp;
+ r = EVP_PKEY_get1_RSA(pkey);
+ if (!r) {
+- if (private)
+- util_fatal("OpenSSL error during RSA private key parsing");
+- else
+- util_fatal("OpenSSL error during RSA public key parsing");
++ util_fatal("OpenSSL error during RSA %s key parsing: %s", private ? "private" : "public",
++ ERR_error_string(ERR_peek_last_error(), NULL));
+ }
+
+ RSA_get0_key(r, &r_n, &r_e, NULL);
+@@ -3654,10 +3652,8 @@ parse_rsa_pkey(EVP_PKEY *pkey, int private, struct rsakey_info *rsa)
+ BIGNUM *r_dmp1 = NULL, *r_dmq1 = NULL, *r_iqmp = NULL;
+ if (EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_N, &r_n) != 1 ||
+ EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_E, &r_e) != 1) {
+- if (private)
+- util_fatal("OpenSSL error during RSA private key parsing");
+- else
+- util_fatal("OpenSSL error during RSA public key parsing");
++ util_fatal("OpenSSL error during RSA %s key parsing: %s", private ? "private" : "public",
++ ERR_error_string(ERR_peek_last_error(), NULL));
+ }
+ #endif
+ RSA_GET_BN(rsa, modulus, r_n);
+@@ -3674,8 +3670,9 @@ parse_rsa_pkey(EVP_PKEY *pkey, int private, struct rsakey_info *rsa)
+ EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_FACTOR2, &r_q) != 1 ||
+ EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_EXPONENT1, &r_dmp1) != 1 ||
+ EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_EXPONENT2, &r_dmq1) != 1 ||
+- util_fatal("OpenSSL error during RSA private key parsing");
+ EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_COEFFICIENT1, &r_iqmp) != 1) {
++ util_fatal("OpenSSL error during RSA private key parsing: %s",
++ ERR_error_string(ERR_peek_last_error(), NULL));
+ }
+ #endif
+ RSA_GET_BN(rsa, private_exponent, r_d);
diff --git a/patches/OpenSC-0.23.0/series b/patches/OpenSC-0.23.0/series
new file mode 100644
index 000000000..ab2d2c5a3
--- /dev/null
+++ b/patches/OpenSC-0.23.0/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-pkcs11-tool-Fix-private-key-import.patch
+0002-pkcs11-tool-Log-more-information-on-OpenSSL-errors.patch
+# 841748d6d3e699afc5d54133ee12d6dd - git-ptx-patches magic
diff --git a/patches/Python-2.7.18/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch b/patches/Python-2.7.18/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch
deleted file mode 100644
index 6eeecd140..000000000
--- a/patches/Python-2.7.18/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch
+++ /dev/null
@@ -1,224 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Tue, 5 May 2009 15:17:20 +0200
-Subject: [PATCH] Add support for socketcan to the python socket module
-
-This patch add support for the protocol family AF_CAN. It contains all the
-necessary code to use the python socket module for socketcan.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- Lib/plat-linux2/IN.py | 2 ++
- Modules/socketmodule.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++
- Modules/socketmodule.h | 11 +++++++
- configure.ac | 13 ++++++++
- 4 files changed, 115 insertions(+)
-
-diff --git a/Lib/plat-linux2/IN.py b/Lib/plat-linux2/IN.py
-index ad307f65398b..f72ae886cad8 100644
---- a/Lib/plat-linux2/IN.py
-+++ b/Lib/plat-linux2/IN.py
-@@ -384,6 +384,7 @@ PF_SNA = 22
- PF_IRDA = 23
- PF_PPPOX = 24
- PF_WANPIPE = 25
-+PF_CAN = 29
- PF_BLUETOOTH = 31
- PF_MAX = 32
- AF_UNSPEC = PF_UNSPEC
-@@ -414,6 +415,7 @@ AF_SNA = PF_SNA
- AF_IRDA = PF_IRDA
- AF_PPPOX = PF_PPPOX
- AF_WANPIPE = PF_WANPIPE
-+AF_CAN = PF_CAN
- AF_BLUETOOTH = PF_BLUETOOTH
- AF_MAX = PF_MAX
- SOL_RAW = 255
-diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
-index 4d5a8f6f0170..8636a8d6ca5e 100644
---- a/Modules/socketmodule.c
-+++ b/Modules/socketmodule.c
-@@ -448,6 +448,10 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
-
- #define SAS2SA(x) ((struct sockaddr *)(x))
-
-+#ifdef ENABLE_CAN
-+#include <linux/can/raw.h>
-+#endif
-+
- /*
- * Constants for getnameinfo()
- */
-@@ -1125,6 +1129,22 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto)
- }
- #endif /* ENABLE_IPV6 */
-
-+#ifdef ENABLE_CAN
-+ case AF_CAN:
-+ {
-+ struct sockaddr_can *a = (struct sockaddr_can *)addr;
-+ char *ifname = "";
-+ struct ifreq ifr;
-+ /* need to look up interface name give index */
-+ if (a->can_ifindex) {
-+ ifr.ifr_ifindex = a->can_ifindex;
-+ if (ioctl(sockfd, SIOCGIFNAME, &ifr) == 0)
-+ ifname = ifr.ifr_name;
-+ }
-+ return Py_BuildValue("s", ifname);
-+ }
-+#endif
-+
- #ifdef USE_BLUETOOTH
- case AF_BLUETOOTH:
- switch (proto) {
-@@ -1411,6 +1431,28 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
- }
- #endif /* ENABLE_IPV6 */
-
-+#ifdef ENABLE_CAN
-+ case AF_CAN:
-+ {
-+ struct sockaddr_can* addr;
-+ struct ifreq ifr;
-+ char *interfaceName;
-+ addr = (struct sockaddr_can*)addr_ret;
-+ if (!PyArg_Parse(args, "s", &interfaceName))
-+ return 0;
-+ strncpy(ifr.ifr_name, interfaceName, sizeof(ifr.ifr_name));
-+ ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0';
-+ if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
-+ s->errorhandler();
-+ return 0;
-+ }
-+ addr->can_family = AF_CAN;
-+ addr->can_ifindex = ifr.ifr_ifindex;
-+ *len_ret = sizeof *addr;
-+ return 1;
-+ }
-+#endif
-+
- #ifdef USE_BLUETOOTH
- case AF_BLUETOOTH:
- {
-@@ -1662,6 +1704,14 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret)
- }
- #endif /* ENABLE_IPV6 */
-
-+#ifdef ENABLE_CAN
-+ case AF_CAN:
-+ {
-+ *len_ret = sizeof (struct sockaddr_can);
-+ return 1;
-+ }
-+#endif
-+
- #ifdef USE_BLUETOOTH
- case AF_BLUETOOTH:
- {
-@@ -4813,6 +4863,10 @@ init_socket(void)
- PyModule_AddIntConstant(m, "AF_LLC", AF_LLC);
- #endif
-
-+#ifdef ENABLE_CAN
-+ PyModule_AddIntConstant(m, "AF_CAN", AF_CAN);
-+#endif
-+
- #ifdef USE_BLUETOOTH
- PyModule_AddIntConstant(m, "AF_BLUETOOTH", AF_BLUETOOTH);
- PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP);
-@@ -5169,6 +5223,41 @@ init_socket(void)
- PyModule_AddIntConstant(m, "IPPROTO_MAX", IPPROTO_MAX);
- #endif
-
-+#ifdef CAN_RAW
-+ PyModule_AddIntConstant(m, "CAN_RAW", CAN_RAW);
-+#endif
-+#ifdef CAN_BCM
-+ PyModule_AddIntConstant(m, "CAN_BCM", CAN_BCM);
-+#endif
-+#ifdef CAN_TP16
-+ PyModule_AddIntConstant(m, "CAN_TP16", CAN_TP16);
-+#endif
-+#ifdef CAN_TP20
-+ PyModule_AddIntConstant(m, "CAN_TP20", CAN_TP20);
-+#endif
-+#ifdef CAN_MCNET
-+ PyModule_AddIntConstant(m, "CAN_MCNET", CAN_MCNET);
-+#endif
-+#ifdef CAN_ISOTP
-+ PyModule_AddIntConstant(m, "CAN_ISOTP", CAN_ISOTP);
-+#endif
-+#ifdef CAN_NPROTO
-+ PyModule_AddIntConstant(m, "CAN_NPROTO", CAN_NPROTO);
-+#endif
-+
-+#ifdef SOL_CAN_BASE
-+ PyModule_AddIntConstant(m, "SOL_CAN_BASE", SOL_CAN_BASE);
-+#endif
-+#ifdef SOL_CAN_RAW
-+ PyModule_AddIntConstant(m, "SOL_CAN_RAW", SOL_CAN_RAW);
-+#endif
-+#ifdef ENABLE_CAN
-+ PyModule_AddIntConstant(m, "CAN_RAW_FILTER", CAN_RAW_FILTER);
-+ PyModule_AddIntConstant(m, "CAN_RAW_ERR_FILTER", CAN_RAW_ERR_FILTER);
-+ PyModule_AddIntConstant(m, "CAN_RAW_LOOPBACK", CAN_RAW_LOOPBACK);
-+ PyModule_AddIntConstant(m, "CAN_RAW_RECV_OWN_MSGS", CAN_RAW_RECV_OWN_MSGS);
-+#endif
-+
- /* Some port configuration */
- #ifdef IPPORT_RESERVED
- PyModule_AddIntConstant(m, "IPPORT_RESERVED", IPPORT_RESERVED);
-diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
-index d98e00e88d27..3b6e22e29d3a 100644
---- a/Modules/socketmodule.h
-+++ b/Modules/socketmodule.h
-@@ -55,6 +55,14 @@ typedef int socklen_t;
- #include <bluetooth/hci.h>
- #endif
-
-+#define AF_CAN 29
-+#define PF_CAN AF_CAN
-+
-+#ifdef HAVE_LINUX_CAN_H
-+#define ENABLE_CAN 1
-+#include <linux/can.h>
-+#endif
-+
- #ifdef HAVE_BLUETOOTH_H
- #include <bluetooth.h>
- #endif
-@@ -106,6 +114,9 @@ typedef union sock_addr {
- struct sockaddr_in6 in6;
- struct sockaddr_storage storage;
- #endif
-+#ifdef ENABLE_CAN
-+ struct sockaddr_can can;
-+#endif
- #ifdef HAVE_BLUETOOTH_BLUETOOTH_H
- struct sockaddr_l2 bt_l2;
- struct sockaddr_rc bt_rc;
-diff --git a/configure.ac b/configure.ac
-index efe6922b5de2..14cc590e55d7 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1753,6 +1753,19 @@ AC_CHECK_HEADERS(linux/netlink.h,,,[
- #endif
- ])
-
-+AC_CHECK_HEADERS(linux/can.h,[],[],[#include <sys/socket.h>])
-+# check for AF_CAN
-+AC_TRY_COMPILE(
-+ [[#include <sys/socket.h>
-+ int domain = AF_CAN;]],
-+ [[socket(domain, 0, 0);]],
-+ [],
-+ [
-+ AC_DEFINE(AF_CAN, 29, [Define AF_CAN if not defined by sys/socket.h])
-+ AC_DEFINE(PF_CAN, 29, [Define PF_CAN if not defined by sys/socket.h])
-+ ]
-+)
-+
- # checks for typedefs
- was_it_defined=no
- AC_MSG_CHECKING(for clock_t in time.h)
diff --git a/patches/Python-2.7.18/0002-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch b/patches/Python-2.7.18/0002-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch
deleted file mode 100644
index d1d5647b9..000000000
--- a/patches/Python-2.7.18/0002-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Fri, 24 Apr 2009 18:44:11 +0200
-Subject: [PATCH] use AC_CHECK_SIZEOF rather than AC_TRY_COMPILE for long long
- detection
-
-AC_CHECK_SIZEOF does first detect if the type is available and detects
-its size. Use it, rather than hand crafted function with AC_TRY_COMPILE.
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- configure.ac | 12 ++++--------
- 1 file changed, 4 insertions(+), 8 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 14cc590e55d7..04e713acd089 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1890,15 +1890,11 @@ AC_CHECK_SIZEOF(fpos_t, 4)
- AC_CHECK_SIZEOF(size_t, 4)
- AC_CHECK_SIZEOF(pid_t, 4)
-
--AC_MSG_CHECKING(for long long support)
--have_long_long=no
--AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x; x = (long long)0;]])],[
-- AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
-+AC_TYPE_LONG_LONG_INT
-+AC_CHECK_SIZEOF(long long)
-+if test "$ac_cv_type_long_long_int" = "yes" ; then
- have_long_long=yes
--],[])
--AC_MSG_RESULT($have_long_long)
--if test "$have_long_long" = yes ; then
--AC_CHECK_SIZEOF(long long, 8)
-+ AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
- fi
-
- AC_MSG_CHECKING(for long double support)
diff --git a/patches/Python-2.7.18/0003-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch b/patches/Python-2.7.18/0003-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch
deleted file mode 100644
index b6ef13c1e..000000000
--- a/patches/Python-2.7.18/0003-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Fri, 24 Apr 2009 18:47:19 +0200
-Subject: [PATCH] use AC_TYPE_LONG_DOUBLE to detect long double support
-
-use the correct AC_TYPE_LONG_DOUBLE function rahter than hand crafted
-test to detect long double support.
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- configure.ac | 12 ++----------
- 1 file changed, 2 insertions(+), 10 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 04e713acd089..5899a7d819b5 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1897,16 +1897,8 @@ if test "$ac_cv_type_long_long_int" = "yes" ; then
- AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
- fi
-
--AC_MSG_CHECKING(for long double support)
--have_long_double=no
--AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]])],[
-- AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
-- have_long_double=yes
--],[])
--AC_MSG_RESULT($have_long_double)
--if test "$have_long_double" = yes ; then
--AC_CHECK_SIZEOF(long double, 12)
--fi
-+AC_TYPE_LONG_DOUBLE
-+AC_CHECK_SIZEOF(long double)
-
- AC_MSG_CHECKING(for _Bool support)
- have_c99_bool=no
diff --git a/patches/Python-2.7.18/0004-setup.py-don-t-leak-host-path-into-cross-compilation.patch b/patches/Python-2.7.18/0004-setup.py-don-t-leak-host-path-into-cross-compilation.patch
deleted file mode 100644
index 1cabdcec5..000000000
--- a/patches/Python-2.7.18/0004-setup.py-don-t-leak-host-path-into-cross-compilation.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Tue, 28 Apr 2009 19:07:54 +0200
-Subject: [PATCH] setup.py: don't leak host path into cross compilation
- environment
-
-During cross compilation we don't host path (neither include nor library
-search patch) to leak into our environment.
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- setup.py | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/setup.py b/setup.py
-index f764223d0627..53161c941ff8 100644
---- a/setup.py
-+++ b/setup.py
-@@ -1274,6 +1274,9 @@ class PyBuildExt(build_ext):
- # the more recent berkeleydb's db.h file first in the include path
- # when attempting to compile and it will fail.
- f = "/usr/include/db.h"
-+ if cross_compiling:
-+ f = ''
-+
-
- if host_platform == 'darwin':
- if is_macosx_sdk_path(f):
diff --git a/patches/Python-2.7.18/0005-add-cross-compilation-support.patch b/patches/Python-2.7.18/0005-add-cross-compilation-support.patch
deleted file mode 100644
index f7812e732..000000000
--- a/patches/Python-2.7.18/0005-add-cross-compilation-support.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Mon, 4 May 2009 14:39:18 +0200
-Subject: [PATCH] add cross compilation support
-
-This patch adds preliminary cross compilation support to python.
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- Makefile.pre.in | 12 ++++++++----
- configure.ac | 7 +++++++
- 2 files changed, 15 insertions(+), 4 deletions(-)
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 2a14f3323bc3..c1e8839a2d21 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -88,6 +88,10 @@ CFLAGSFORSHARED=@CFLAGSFORSHARED@
- # C flags used for building the interpreter object files
- PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
-
-+# cross compiler options
-+ifndef DESTDIR
-+sysroot= @SYSROOT@
-+endif
-
- # Machine-dependent subdirectories
- MACHDEP= @MACHDEP@
-@@ -106,11 +110,11 @@ datarootdir= @datarootdir@
-
- # Expanded directories
- BINDIR= @bindir@
--LIBDIR= @libdir@
-+LIBDIR= $(sysroot)@libdir@
- MANDIR= @mandir@
--INCLUDEDIR= @includedir@
--CONFINCLUDEDIR= $(exec_prefix)/include
--SCRIPTDIR= $(prefix)/lib
-+INCLUDEDIR= $(sysroot)@includedir@
-+CONFINCLUDEDIR= $(sysroot)$(exec_prefix)/include
-+SCRIPTDIR= $(sysroot)$(prefix)/lib
-
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
-diff --git a/configure.ac b/configure.ac
-index 5899a7d819b5..0dd23a07d73e 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -980,6 +980,13 @@ if test "$cross_compiling" = yes; then
- RUNSHARED=
- fi
-
-+# sysroot
-+AC_SUBST(SYSROOT)
-+if test "$cross_compiling" = yes; then
-+ AC_MSG_CHECKING([for SYSROOT])
-+ AC_MSG_RESULT([$SYSROOT])
-+fi
-+
- AC_MSG_RESULT($LDLIBRARY)
-
- AC_PROG_RANLIB
diff --git a/patches/Python-2.7.18/0006-python-don-t-add-rpaths-in-setup.py.patch b/patches/Python-2.7.18/0006-python-don-t-add-rpaths-in-setup.py.patch
deleted file mode 100644
index b51ad1887..000000000
--- a/patches/Python-2.7.18/0006-python-don-t-add-rpaths-in-setup.py.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 27 May 2017 08:00:24 +0200
-Subject: [PATCH] python: don't add rpaths in setup.py
-
-We don't add rpaths.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- setup.py | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index 53161c941ff8..4abd73317729 100644
---- a/setup.py
-+++ b/setup.py
-@@ -1147,7 +1147,6 @@ class PyBuildExt(build_ext):
- exts.append(Extension('_bsddb', ['_bsddb.c'],
- depends = ['bsddb.h'],
- library_dirs=dblib_dir,
-- runtime_library_dirs=dblib_dir,
- include_dirs=db_incs,
- libraries=dblibs))
- else:
-@@ -1364,7 +1363,6 @@ class PyBuildExt(build_ext):
- print "building dbm using bdb"
- dbmext = Extension('dbm', ['dbmmodule.c'],
- library_dirs=dblib_dir,
-- runtime_library_dirs=dblib_dir,
- include_dirs=db_incs,
- define_macros=[
- ('HAVE_BERKDB_H', None),
diff --git a/patches/Python-2.7.18/0007-add-more-search-paths.patch b/patches/Python-2.7.18/0007-add-more-search-paths.patch
deleted file mode 100644
index ea1e2fc77..000000000
--- a/patches/Python-2.7.18/0007-add-more-search-paths.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 13 Jun 2013 10:42:58 +0200
-Subject: [PATCH] add more search paths
-
-Without this setup.py won't find libs in <sysroot>/lib
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- setup.py | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index 4abd73317729..67f867ce1123 100644
---- a/setup.py
-+++ b/setup.py
-@@ -548,8 +548,10 @@ class PyBuildExt(build_ext):
- # (PYTHONFRAMEWORK is set) to avoid # linking problems when
- # building a framework with different architectures than
- # the one that is currently installed (issue #7473)
-- add_dir_to_list(self.compiler.library_dirs,
-- sysconfig.get_config_var("LIBDIR"))
-+ libdir = sysconfig.get_config_var("LIBDIR")
-+ add_dir_to_list(self.compiler.library_dirs, libdir)
-+ if libdir.endswith('/usr/lib'):
-+ add_dir_to_list(self.compiler.library_dirs, libdir.replace('/usr/lib','/lib'))
- add_dir_to_list(self.compiler.include_dirs,
- sysconfig.get_config_var("INCLUDEDIR"))
-
diff --git a/patches/Python-2.7.18/0008-resolve-existing-LD_LIBRARY_PATH-during-make-not-dur.patch b/patches/Python-2.7.18/0008-resolve-existing-LD_LIBRARY_PATH-during-make-not-dur.patch
deleted file mode 100644
index 474a1a4c6..000000000
--- a/patches/Python-2.7.18/0008-resolve-existing-LD_LIBRARY_PATH-during-make-not-dur.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 5 Feb 2014 12:16:12 +0100
-Subject: [PATCH] resolve existing LD_LIBRARY_PATH during make, not during
- configure
-
-Otherwise, calling "make install" with fakeroot may not work correctly.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index 0dd23a07d73e..2c21a989e012 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -926,7 +926,7 @@ if test $enable_shared = "yes"; then
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
- LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-L. -lpython$(VERSION)'
-- RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:'${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}'
- case $ac_sys_system in
- FreeBSD*)
- SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
diff --git a/patches/Python-2.7.18/0009-python2-prevent-host-path-leakage.patch b/patches/Python-2.7.18/0009-python2-prevent-host-path-leakage.patch
deleted file mode 100644
index 0888a62c4..000000000
--- a/patches/Python-2.7.18/0009-python2-prevent-host-path-leakage.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From: Bastian Stender <bst@pengutronix.de>
-Date: Mon, 8 Jan 2018 15:55:40 +0100
-Subject: [PATCH] python2: prevent host path leakage
-
-If cross-compiling and host/target architecture match host paths are
-added to include_dirs and library_dirs in add_multiarch_paths() (e.g.
-/usr/lib/i386-linux-gnu, /usr/include/i386-linux-gnu). This leads to
-build failures for some extensions (at least _ssl and _socket).
-
-ptxdist does not support multiarch, so remove this addition when
-cross-compiling.
-
-Based on a patch by Alexandru Ardelean <ardeleanalex@gmail.com>.
-
-See these patches for reference:
-- https://github.com/openwrt/packages/pull/784
-- https://github.com/openwrt/packages/blob/master/lang/python/python/patches/006-remove-multi-arch-and-local-paths.patch
-- http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python/host_include_contamination.patch
-
-Signed-off-by: Bastian Stender <bst@pengutronix.de>
----
- setup.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/setup.py b/setup.py
-index 67f867ce1123..d7b1991f93ca 100644
---- a/setup.py
-+++ b/setup.py
-@@ -504,9 +504,9 @@ class PyBuildExt(build_ext):
- if not cross_compiling:
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-+ self.add_multiarch_paths()
- if cross_compiling:
- self.add_gcc_paths()
-- self.add_multiarch_paths()
-
- # Add paths specified in the environment variables LDFLAGS and
- # CPPFLAGS for header and library files.
diff --git a/patches/Python-2.7.18/autogen.sh b/patches/Python-2.7.18/autogen.sh
deleted file mode 100755
index 903ce7847..000000000
--- a/patches/Python-2.7.18/autogen.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-# to add config.guess and config.sub
-automake --copy --add-missing || true
-
-autoheader --force
-
-autoconf \
- --force \
- --warnings=cross \
- --warnings=syntax \
- --warnings=obsolete \
- --warnings=unsupported
-
diff --git a/patches/Python-2.7.18/series b/patches/Python-2.7.18/series
deleted file mode 100644
index 476244734..000000000
--- a/patches/Python-2.7.18/series
+++ /dev/null
@@ -1,12 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Add-support-for-socketcan-to-the-python-socket-modul.patch
-0002-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch
-0003-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch
-0004-setup.py-don-t-leak-host-path-into-cross-compilation.patch
-0005-add-cross-compilation-support.patch
-0006-python-don-t-add-rpaths-in-setup.py.patch
-0007-add-more-search-paths.patch
-0008-resolve-existing-LD_LIBRARY_PATH-during-make-not-dur.patch
-0009-python2-prevent-host-path-leakage.patch
-# 1fb48b2848c102e3848999b1d9f65710 - git-ptx-patches magic
diff --git a/patches/Python-3.7.10/0001-python3-don-t-leak-host-path-into-target-binaries.patch b/patches/Python-3.7.10/0001-python3-don-t-leak-host-path-into-target-binaries.patch
deleted file mode 100644
index ac5e64d48..000000000
--- a/patches/Python-3.7.10/0001-python3-don-t-leak-host-path-into-target-binaries.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 14 Oct 2018 18:51:17 +0200
-Subject: [PATCH] python3: don't leak host path into target binaries
-
-Without this the rpath of the _dbm module contains <sysroot>/usr/lib.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- setup.py | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/setup.py b/setup.py
-index bf90600eaad3..9250f5a1b691 100644
---- a/setup.py
-+++ b/setup.py
-@@ -1344,7 +1344,6 @@ class PyBuildExt(build_ext):
- if dbm_setup_debug: print("building dbm using bdb")
- dbmext = Extension('_dbm', ['_dbmmodule.c'],
- library_dirs=dblib_dir,
-- runtime_library_dirs=dblib_dir,
- include_dirs=db_incs,
- define_macros=[
- ('HAVE_BERKDB_H', None),
diff --git a/patches/Python-3.7.10/0002-python3-prevent-host-path-leakage.patch b/patches/Python-3.7.10/0002-python3-prevent-host-path-leakage.patch
deleted file mode 100644
index 36ece1f85..000000000
--- a/patches/Python-3.7.10/0002-python3-prevent-host-path-leakage.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From: Bastian Stender <bst@pengutronix.de>
-Date: Mon, 8 Jan 2018 16:11:23 +0100
-Subject: [PATCH] python3: prevent host path leakage
-
-If cross-compiling and host/target architecture match host paths are
-added to include_dirs and library_dirs in add_multiarch_paths() (e.g.
-/usr/lib/i386-linux-gnu, /usr/include/i386-linux-gnu). This leads to
-build failures for some extensions (at least _ssl and _socket).
-
-ptxdist does not support multiarch, so remove this addition when
-cross-compiling.
-
-Based on a patch by Alexandru Ardelean <ardeleanalex@gmail.com>.
-
-See these patches for reference:
-- https://github.com/openwrt/packages/pull/784
-- https://github.com/openwrt/packages/blob/master/lang/python/python/patches/006-remove-multi-arch-and-local-paths.patch
-- http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python/host_include_contamination.patch
-
-Signed-off-by: Bastian Stender <bst@pengutronix.de>
----
- setup.py | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/setup.py b/setup.py
-index 9250f5a1b691..3278aaf6e677 100644
---- a/setup.py
-+++ b/setup.py
-@@ -587,10 +587,12 @@ class PyBuildExt(build_ext):
- if not cross_compiling:
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-+
-+ self.add_multiarch_paths()
-+
- # only change this for cross builds for 3.3, issues on Mageia
- if cross_compiling:
- self.add_gcc_paths()
-- self.add_multiarch_paths()
-
- # Add paths specified in the environment variables LDFLAGS and
- # CPPFLAGS for header and library files.
diff --git a/patches/Python-3.7.10/series b/patches/Python-3.7.10/series
deleted file mode 100644
index 305ae1d73..000000000
--- a/patches/Python-3.7.10/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-python3-don-t-leak-host-path-into-target-binaries.patch
-0002-python3-prevent-host-path-leakage.patch
-# 9a6f885c0db25c8cff5dd088d9eff6af - git-ptx-patches magic
diff --git a/patches/SDL2_ttf-2.0.15/0001-configure-make-opengl-support-switchable.patch b/patches/SDL2_ttf-2.22.0/0001-configure-make-opengl-support-switchable.patch
index dd3470963..cf03ca9fb 100644
--- a/patches/SDL2_ttf-2.0.15/0001-configure-make-opengl-support-switchable.patch
+++ b/patches/SDL2_ttf-2.22.0/0001-configure-make-opengl-support-switchable.patch
@@ -4,16 +4,16 @@ Subject: [PATCH] configure: make opengl support switchable
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
- configure.in | 7 +++++++
+ configure.ac | 7 +++++++
1 file changed, 7 insertions(+)
-diff --git a/configure.in b/configure.in
-index 32b3a9139efd..d77bab0c0069 100644
---- a/configure.in
-+++ b/configure.in
-@@ -105,6 +105,12 @@ AM_PATH_SDL2($SDL_VERSION,
- CFLAGS="$CFLAGS $SDL_CFLAGS"
- LIBS="$LIBS $SDL_LIBS"
+diff --git a/configure.ac b/configure.ac
+index f0612a4be057..b12cab96de56 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -308,6 +308,12 @@ AM_CONDITIONAL(USE_BUILTIN_HARFBUZZ, test x$enable_harfbuzz_builtin = xyes)
+ dnl check for LD --no-undefined option
+ CheckNoUndef
+dnl Check to see if OpenGL support is desired
+AC_ARG_ENABLE(opengl,
@@ -23,12 +23,12 @@ index 32b3a9139efd..d77bab0c0069 100644
+if test x$enable_opengl = xyes; then
dnl Check for OpenGL
case "$host" in
- *-*-cygwin* | *-*-mingw32*)
-@@ -157,6 +163,7 @@ else
+ *-*-cygwin* | *-*-mingw*)
+@@ -358,6 +364,7 @@ else
GL_LIBS=""
fi
AC_SUBST([GL_LIBS])
+fi
AC_SUBST([MATHLIB])
- AC_SUBST([WINDRES])
-
+ AC_SUBST([TTF_CFLAGS])
+ AC_SUBST([TTF_LIBS])
diff --git a/patches/SDL2_ttf-2.0.15/autogen.sh b/patches/SDL2_ttf-2.22.0/autogen.sh
index a430a4eb7..a430a4eb7 100755
--- a/patches/SDL2_ttf-2.0.15/autogen.sh
+++ b/patches/SDL2_ttf-2.22.0/autogen.sh
diff --git a/patches/SDL2_ttf-2.0.15/series b/patches/SDL2_ttf-2.22.0/series
index 89c7959a2..89c7959a2 100644
--- a/patches/SDL2_ttf-2.0.15/series
+++ b/patches/SDL2_ttf-2.22.0/series
diff --git a/patches/acl-2.2.53/0001-Switch-to-sys-xattr.h.patch b/patches/acl-2.3.1/0001-Switch-to-sys-xattr.h.patch
index da061a087..3d64b9ba9 100644
--- a/patches/acl-2.2.53/0001-Switch-to-sys-xattr.h.patch
+++ b/patches/acl-2.3.1/0001-Switch-to-sys-xattr.h.patch
@@ -16,11 +16,11 @@ behind.
create mode 100644 libacl/error_context.h
diff --git a/configure.ac b/configure.ac
-index 92d6faac1913..28ef085f32a0 100644
+index 4abb9933948a..5915ee3e492c 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -46,8 +46,8 @@ dnl Automatically increment the revision for every release.
- LT_REVISION=$(echo "${PACKAGE_VERSION}" | tr -d .)
+@@ -51,8 +51,8 @@ fi
+ LT_REVISION=$(printf "%d%d%02d" "$1" "$2" "$3")
AC_SUBST(LT_REVISION)
-AC_PACKAGE_NEED_ATTR_ERROR_H
diff --git a/patches/acl-2.2.53/autogen.sh b/patches/acl-2.3.1/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/acl-2.2.53/autogen.sh
+++ b/patches/acl-2.3.1/autogen.sh
diff --git a/patches/acl-2.2.53/series b/patches/acl-2.3.1/series
index 5780f8222..5780f8222 100644
--- a/patches/acl-2.2.53/series
+++ b/patches/acl-2.3.1/series
diff --git a/patches/aiosqlite-0.18.0/0001-add-setup.py.patch b/patches/aiosqlite-0.18.0/0001-add-setup.py.patch
new file mode 100644
index 000000000..b7ef9455e
--- /dev/null
+++ b/patches/aiosqlite-0.18.0/0001-add-setup.py.patch
@@ -0,0 +1,25 @@
+From 0e7a0cafda6599d4af114fc0154a90b8786af7c6 Mon Sep 17 00:00:00 2001
+From: Artur Wiebe <artur@4wiebe.de>
+Date: Thu, 13 Apr 2023 16:47:50 +0200
+Subject: [PATCH] add setup.py
+
+---
+ setup.py | 6 ++++++
+ 1 file changed, 6 insertions(+)
+ create mode 100644 setup.py
+
+diff --git a/setup.py b/setup.py
+new file mode 100644
+index 0000000..358320c
+--- /dev/null
++++ b/setup.py
+@@ -0,0 +1,6 @@
++from setuptools import setup
++
++setup(
++ name='aiosqlite',
++ packages=['aiosqlite'],
++)
+--
+2.40.0
+
diff --git a/patches/aiosqlite-0.18.0/series b/patches/aiosqlite-0.18.0/series
new file mode 100644
index 000000000..737b1f8cb
--- /dev/null
+++ b/patches/aiosqlite-0.18.0/series
@@ -0,0 +1 @@
+0001-add-setup.py.patch
diff --git a/patches/alsa-lib-1.2.1.2/0001-add-largefile-support.patch b/patches/alsa-lib-1.2.1.2/0001-add-largefile-support.patch
deleted file mode 100644
index d6dce8fad..000000000
--- a/patches/alsa-lib-1.2.1.2/0001-add-largefile-support.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Lucas Stach <l.stach@pengutronix.de>
-Date: Tue, 17 Oct 2017 12:29:22 +0200
-Subject: [PATCH] add largefile support
-
-Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
----
- configure.ac | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 119ef6005103..e9b4ebe32c03 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -38,6 +38,9 @@ AM_PROG_LIBTOOL
-
- CC_NOUNDEFINED
-
-+dnl enable largefile
-+AC_SYS_LARGEFILE
-+
- dnl Checks for header files.
- AC_HEADER_STDC
- AC_CONFIG_HEADERS(include/config.h)
-@@ -706,6 +709,8 @@ if test ! -L "$srcdir"/include/alsa ; then
- ln -sf . "$srcdir"/include/alsa
- fi
-
-+CPPFLAGS='-include $(CONFIG_HEADER)'
-+
- AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
- include/Makefile include/sound/Makefile src/Versions src/Makefile \
- src/control/Makefile src/mixer/Makefile \
diff --git a/patches/alsa-lib-1.2.1.2/series b/patches/alsa-lib-1.2.1.2/series
deleted file mode 100644
index f96f3345c..000000000
--- a/patches/alsa-lib-1.2.1.2/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-add-largefile-support.patch
-# 28c8f5e33d509bdb14724d1cc3204a4d - git-ptx-patches magic
diff --git a/patches/alsa-utils-1.2.11/0001-alsactl-info.c-fix-conditionals-on-__ALSA_PCM_H-and-.patch b/patches/alsa-utils-1.2.11/0001-alsactl-info.c-fix-conditionals-on-__ALSA_PCM_H-and-.patch
new file mode 100644
index 000000000..6f4fe5848
--- /dev/null
+++ b/patches/alsa-utils-1.2.11/0001-alsactl-info.c-fix-conditionals-on-__ALSA_PCM_H-and-.patch
@@ -0,0 +1,103 @@
+From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Date: Sun, 17 Jul 2022 19:22:40 +0200
+Subject: [PATCH] alsactl/info.c: fix conditionals on __ALSA_PCM_H and
+ __ALSA_RAWMIDI_H
+
+Commit bbc74a61ac7c35e506c3d7f76ecf943cb55736a6 ("alsactl: implement
+'info' command") implemented an alsactl info command. In this
+implementation, there was an attempt to properly address optional
+features from alsa-lib by using conditions on __ALSA_PCM_H,
+__ALSA_RAWMIDI_H.
+
+Unfortunately, this attempt does not work entirely: only the code
+inside pcm_device_list(), rawmidi_device_list() was conditionally
+compiled, but their very prototype also use type definitions provided
+in pcm.h and rawmidi.h. So really, it's the entire function that needs
+to be conditionally implemented.
+
+Also, snd_rawmidi_stream_name() was not handled properly, for the same
+reason.
+
+This commit implements pcm_device_list() only if __ALSA_PCM_H is
+defined, and implements snd_rawmidi_stream_name() and
+rawmidi_device_list() only if __ALSA_RAWMIDI_H is defined.
+
+general_card_info() is modified to not call the PCM or raw MIDI
+functions when support is not available.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ alsactl/info.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/alsactl/info.c b/alsactl/info.c
+index 1d648d870381..aeff16babb19 100644
+--- a/alsactl/info.c
++++ b/alsactl/info.c
+@@ -22,9 +22,9 @@
+ #include "aconfig.h"
+ #include "alsactl.h"
+
++#ifdef __ALSA_PCM_H
+ static int pcm_device_list(snd_ctl_t *ctl, snd_pcm_stream_t stream, bool *first)
+ {
+-#ifdef __ALSA_PCM_H
+ int err, dev, idx;
+ unsigned int count;
+ snd_pcm_info_t *pcminfo;
+@@ -76,10 +76,12 @@ static int pcm_device_list(snd_ctl_t *ctl, snd_pcm_stream_t stream, bool *first)
+ idx, snd_pcm_info_get_subdevice_name(pcminfo));
+ }
+ }
+-#endif
++
+ return 0;
+ }
++#endif
+
++#ifdef __ALSA_RAWMIDI_H
+ static const char *snd_rawmidi_stream_name(snd_rawmidi_stream_t stream)
+ {
+ if (stream == SND_RAWMIDI_STREAM_INPUT)
+@@ -91,7 +93,6 @@ static const char *snd_rawmidi_stream_name(snd_rawmidi_stream_t stream)
+
+ static int rawmidi_device_list(snd_ctl_t *ctl, snd_rawmidi_stream_t stream, bool *first)
+ {
+-#ifdef __ALSA_RAWMIDI_H
+ int err, dev, idx;
+ unsigned int count;
+ snd_rawmidi_info_t *info;
+@@ -143,9 +144,10 @@ static int rawmidi_device_list(snd_ctl_t *ctl, snd_rawmidi_stream_t stream, bool
+ idx, snd_rawmidi_info_get_subdevice_name(info));
+ }
+ }
+-#endif
++
+ return 0;
+ }
++#endif
+
+ static int hwdep_device_list(snd_ctl_t *ctl)
+ {
+@@ -228,17 +230,21 @@ int general_card_info(int cardno)
+ }
+ err = card_info(ctl);
+
++#ifdef __ALSA_PCM_H
+ first = true;
+ if (err >= 0)
+ err = pcm_device_list(ctl, SND_PCM_STREAM_PLAYBACK, &first);
+ if (err >= 0)
+ err = pcm_device_list(ctl, SND_PCM_STREAM_CAPTURE, &first);
++#endif
+
++#ifdef __ALSA_RAWMIDI_H
+ first = true;
+ if (err >= 0)
+ err = rawmidi_device_list(ctl, SND_RAWMIDI_STREAM_INPUT, &first);
+ if (err >= 0)
+ err = rawmidi_device_list(ctl, SND_RAWMIDI_STREAM_OUTPUT, &first);
++#endif
+
+ if (err >= 0)
+ err = hwdep_device_list(ctl);
diff --git a/patches/alsa-utils-1.2.11/series b/patches/alsa-utils-1.2.11/series
new file mode 100644
index 000000000..b39a77d00
--- /dev/null
+++ b/patches/alsa-utils-1.2.11/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-alsactl-info.c-fix-conditionals-on-__ALSA_PCM_H-and-.patch
+# 33c3f6b9e58007dd7e241f57feb385ac - git-ptx-patches magic
diff --git a/patches/apitrace-11.1/0001-HACK-don-t-check-for-submodules-for-external-depende.patch b/patches/apitrace-11.1/0001-HACK-don-t-check-for-submodules-for-external-depende.patch
new file mode 100644
index 000000000..e174b1439
--- /dev/null
+++ b/patches/apitrace-11.1/0001-HACK-don-t-check-for-submodules-for-external-depende.patch
@@ -0,0 +1,26 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 28 Nov 2023 17:54:13 +0100
+Subject: [PATCH] HACK: don't check for submodules for external dependencies
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ thirdparty/CMakeLists.txt | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
+index 7eae7e55da3e..ceb9305b44a4 100644
+--- a/thirdparty/CMakeLists.txt
++++ b/thirdparty/CMakeLists.txt
+@@ -15,12 +15,8 @@ endfunction ()
+
+ set (SUBMODULES_MISSING FALSE)
+ foreach (path IN ITEMS
+- brotli/LICENSE
+- gtest/googletest/LICENSE
+ libbacktrace/LICENSE
+- libpng/LICENSE
+ snappy/COPYING
+- zlib/README
+ )
+ if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}")
+ message (SEND_ERROR "error: ${CMAKE_CURRENT_SOURCE_DIR}/${path} does not exist")
diff --git a/patches/apitrace-11.1/0002-HACK-don-t-do-dpkg-architecture-magic.patch b/patches/apitrace-11.1/0002-HACK-don-t-do-dpkg-architecture-magic.patch
new file mode 100644
index 000000000..0a456973b
--- /dev/null
+++ b/patches/apitrace-11.1/0002-HACK-don-t-do-dpkg-architecture-magic.patch
@@ -0,0 +1,32 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 28 Nov 2023 18:15:18 +0100
+Subject: [PATCH] HACK: don't do dpkg-architecture magic
+
+We don't want any architecture specific subdir and dpkg-architecture may
+not be available, so this is not deterministic anyways.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ CMakeLists.txt | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a863b47cabcf..3d8b5811ebe2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -425,15 +425,6 @@ endif ()
+ ##############################################################################
+ # Installation directories
+
+-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+- # Debian multiarch support
+- execute_process(COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
+- OUTPUT_VARIABLE ARCH_SUBDIR
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+- )
+-endif()
+-
+ if (WIN32 OR APPLE)
+ # On Windows/MacOSX, applications are usually installed on a directory of
+ # their own
diff --git a/patches/apitrace-11.1/series b/patches/apitrace-11.1/series
new file mode 100644
index 000000000..d4c24c917
--- /dev/null
+++ b/patches/apitrace-11.1/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-HACK-don-t-check-for-submodules-for-external-depende.patch
+0002-HACK-don-t-do-dpkg-architecture-magic.patch
+# d781b7ce7b411ab6ab663c32f56ed491 - git-ptx-patches magic
diff --git a/patches/apitrace-9.0/0001-Use-CMAKE_INSTALL_LIBDIR-for-LIB_INSTALL_DIR.patch b/patches/apitrace-9.0/0001-Use-CMAKE_INSTALL_LIBDIR-for-LIB_INSTALL_DIR.patch
deleted file mode 100644
index f2bf4d46b..000000000
--- a/patches/apitrace-9.0/0001-Use-CMAKE_INSTALL_LIBDIR-for-LIB_INSTALL_DIR.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Mon, 29 Apr 2019 20:32:04 +0200
-Subject: [PATCH] Use CMAKE_INSTALL_LIBDIR for LIB_INSTALL_DIR
-
-Respect the libdir cmake already set up for us instead of using
-debian-specific multiarch paths.
-
-Patch was rebased multiple times from 4.0 to 9.0 now.
-
-Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
----
- CMakeLists.txt | 17 ++---------------
- 1 file changed, 2 insertions(+), 15 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 19316e604286..6c3c4b85c19c 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -438,15 +438,6 @@ endif ()
- ##############################################################################
- # Installation directories
-
--if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
-- # Debian multiarch support
-- execute_process(COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
-- OUTPUT_VARIABLE ARCH_SUBDIR
-- ERROR_QUIET
-- OUTPUT_STRIP_TRAILING_WHITESPACE
-- )
--endif()
--
- if (WIN32 OR APPLE)
- # On Windows/MacOSX, applications are usually installed on a directory of
- # their own
-@@ -455,12 +446,8 @@ if (WIN32 OR APPLE)
- set (LIB_ARCH_INSTALL_DIR lib)
- else ()
- set (DOC_DEFAULT_INSTALL_DIR share/doc/${CMAKE_PROJECT_NAME})
-- set (LIB_INSTALL_DIR lib${LIB_SUFFIX}/${CMAKE_PROJECT_NAME})
-- if (ARCH_SUBDIR)
-- set (LIB_ARCH_INSTALL_DIR lib/${ARCH_SUBDIR}/${CMAKE_PROJECT_NAME})
-- else ()
-- set (LIB_ARCH_INSTALL_DIR lib${LIB_SUFFIX}/${CMAKE_PROJECT_NAME})
-- endif ()
-+ set (LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/${CMAKE_PROJECT_NAME})
-+ set (LIB_ARCH_INSTALL_DIR ${LIB_INSTALL_DIR})
- endif ()
-
- # Allow customization of the doc installation dir (Slackware uses different
diff --git a/patches/apitrace-9.0/series b/patches/apitrace-9.0/series
deleted file mode 100644
index c75669299..000000000
--- a/patches/apitrace-9.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Use-CMAKE_INSTALL_LIBDIR-for-LIB_INSTALL_DIR.patch
-# e6b6e6297e24d182be6d8261d1509250 - git-ptx-patches magic
diff --git a/patches/at-3.1.12/0001-configure.ac-remove-manual-compiler-check-with-AC_TR.patch b/patches/at-3.1.12/0001-configure.ac-remove-manual-compiler-check-with-AC_TR.patch
deleted file mode 100644
index 9e6992294..000000000
--- a/patches/at-3.1.12/0001-configure.ac-remove-manual-compiler-check-with-AC_TR.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From a182f18fa3b9fb3dd817b601b51c758f9a77f407 Mon Sep 17 00:00:00 2001
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Tue, 1 Dec 2009 17:08:14 +0100
-Subject: [PATCH 1/5] configure.ac: remove manual compiler check with AC_TRY_RUN
-
-AC_TRY_RUN breaks cross compilation, so remove it. autotools will take
-care about a working (cross-) compiler.
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- configure.ac | 6 ------
- 1 files changed, 0 insertions(+), 6 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index a8c2a14..997a37f 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -38,12 +38,6 @@ case "$host" in
- AC_MSG_RESULT(no)
- ;;
- esac
--AC_MSG_CHECKING(Trying to compile a trivial ANSI C program)
--AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
-- AC_MSG_RESULT(yes),
-- AC_MSG_RESULT(no)
-- AC_MSG_ERROR(Could not compile and run even a trivial ANSI C program - check CC.),
-- AC_MSG_ERROR(Could not compile and run even a trivial ANSI C program - check CC.))
-
- AC_MSG_CHECKING(__attribute__((noreturn)))
- AC_TRY_COMPILE([], [void __attribute__((noreturn)) panic(void);],
---
-1.6.5.3
-
diff --git a/patches/at-3.1.12/0002-configure.ac-convert-AC_TRY_COMPILE-AC_COMPILE_IFELS.patch b/patches/at-3.1.12/0002-configure.ac-convert-AC_TRY_COMPILE-AC_COMPILE_IFELS.patch
deleted file mode 100644
index ab6de4428..000000000
--- a/patches/at-3.1.12/0002-configure.ac-convert-AC_TRY_COMPILE-AC_COMPILE_IFELS.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From e12c96cccab550eda31cf7bb1dedddd3670ffe69 Mon Sep 17 00:00:00 2001
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Tue, 1 Dec 2009 17:22:22 +0100
-Subject: [PATCH 2/5] configure.ac: convert AC_TRY_COMPILE -> AC_COMPILE_IFELSE
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- configure.ac | 10 +++++-----
- 1 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 997a37f..cab80ed 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -40,11 +40,11 @@ case "$host" in
- esac
-
- AC_MSG_CHECKING(__attribute__((noreturn)))
--AC_TRY_COMPILE([], [void __attribute__((noreturn)) panic(void);],
-- AC_MSG_RESULT(yes)
-- AC_DEFINE(HAVE_ATTRIBUTE_NORETURN, 1,
-- [Define to 1 if compiler supports __attribute__((noreturn))]),
-- AC_MSG_RESULT(no)
-+AC_COMPILE_IFELSE(
-+ [AC_LANG_PROGRAM([[]], [[void __attribute__((noreturn)) panic(void);]])],
-+ [AC_MSG_RESULT(yes)
-+ AC_DEFINE(HAVE_ATTRIBUTE_NORETURN, 1, Define to 1 if compiler supports __attribute__((noreturn)))],
-+ [AC_MSG_RESULT(no)]
- )
- dnl Checks for libraries.
-
---
-1.6.5.3
-
diff --git a/patches/at-3.1.12/0003-Makefile.in-add-LDFLAGS-to-linking-stage.patch b/patches/at-3.1.12/0003-Makefile.in-add-LDFLAGS-to-linking-stage.patch
deleted file mode 100644
index e1ab3d376..000000000
--- a/patches/at-3.1.12/0003-Makefile.in-add-LDFLAGS-to-linking-stage.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 8720a71757f3626bf3bbc3a7aa2185e6387e5689 Mon Sep 17 00:00:00 2001
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Tue, 1 Dec 2009 20:37:31 +0100
-Subject: [PATCH 3/5] Makefile.in: add LDFLAGS to linking stage
-
-The linking stage ignores the LDFLAGS, this breaks if the flex library
-lives in a non standard location.
-
-This patch add LDFLAGS to both "at" and "atd" linking stage.
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- Makefile.in | 4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index dae6b7d..b766bbb 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -65,13 +65,13 @@ LIST = Filelist Filelist.asc
- all: at atd atrun
-
- at: $(ATOBJECTS)
-- $(CC) $(CFLAGS) -o at $(ATOBJECTS) $(LIBS) $(LEXLIB)
-+ $(CC) $(CFLAGS) $(LDFLAGS) -o at $(ATOBJECTS) $(LIBS) $(LEXLIB)
- rm -f $(CLONES)
- $(LN_S) -f at atq
- $(LN_S) -f at atrm
-
- atd: $(RUNOBJECTS)
-- $(CC) $(CFLAGS) -o atd $(RUNOBJECTS) $(LIBS) $(PAMLIB)
-+ $(CC) $(CFLAGS) $(LDFLAGS) -o atd $(RUNOBJECTS) $(LIBS) $(PAMLIB)
-
- y.tab.c y.tab.h: parsetime.y
- $(YACC) -d parsetime.y
---
-1.6.5.3
-
diff --git a/patches/at-3.1.12/0005-Makefile.in-replace-IROOT-by-DESTDIR.patch b/patches/at-3.1.12/0005-Makefile.in-replace-IROOT-by-DESTDIR.patch
deleted file mode 100644
index 6a295e37c..000000000
--- a/patches/at-3.1.12/0005-Makefile.in-replace-IROOT-by-DESTDIR.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 195d30e2e01fe2f91ed3bdaeec3982aa66b309dd Mon Sep 17 00:00:00 2001
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Tue, 1 Dec 2009 20:57:45 +0100
-Subject: [PATCH 5/5] Makefile.in: replace IROOT by DESTDIR
-
-This patch replaces IROOT by DESTDIR, which is the autotools standard
-variable. For backwards compatibilty IROOT overwrites the DESTDIR.
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- Makefile.in | 64 +++++++++++++++++++++++++++++++-----------------------------
- 1 file changed, 34 insertions(+), 30 deletions(-)
-
-Index: at-3.1.12/Makefile.in
-===================================================================
---- at-3.1.12.orig/Makefile.in
-+++ at-3.1.12/Makefile.in
-@@ -16,6 +16,10 @@ docdir = $(prefix)/doc
- atdocdir = $(docdir)/at
- etcdir = @ETCDIR@
-
-+ifdef IROOT
-+DESTDIR = $(IROOT)
-+endif
-+
- DAEMON_USERNAME = @DAEMON_USERNAME@
- DAEMON_GROUPNAME= @DAEMON_GROUPNAME@
- LOADAVG_MX = @LOADAVG_MX@
-@@ -86,38 +90,38 @@ atrun: atrun.in
- $(CC) -c $(CFLAGS) $(DEFS) $*.c
-
- install: all
-- $(INSTALL) -g root -o root -m 755 -d $(IROOT)$(etcdir)
-- $(INSTALL) -g root -o root -m 755 -d $(IROOT)$(bindir)
-- $(INSTALL) -g root -o root -m 755 -d $(IROOT)$(sbindir)
-- $(INSTALL) -g root -o root -m 755 -d $(IROOT)$(docdir)
-- $(INSTALL) -g root -o root -m 755 -d $(IROOT)$(atdocdir)
-- $(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 755 -d $(IROOT)$(ATSPOOL_DIR) $(IROOT)$(ATJOB_DIR)
-- chmod 1770 $(IROOT)$(ATSPOOL_DIR) $(IROOT)$(ATJOB_DIR)
-- touch $(IROOT)$(LFILE)
-- chmod 600 $(IROOT)$(LFILE)
-- chown $(DAEMON_USERNAME):$(DAEMON_GROUPNAME) $(IROOT)$(LFILE)
-- test -f $(IROOT)$(etcdir)/at.allow || test -f $(IROOT)$(etcdir)/at.deny || $(INSTALL) -o root -g $(DAEMON_GROUPNAME) -m 640 at.deny $(IROOT)$(etcdir)/
-- $(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 6755 -s at $(IROOT)$(bindir)
-- $(LN_S) -f at $(IROOT)$(bindir)/atq
-- $(LN_S) -f at $(IROOT)$(bindir)/atrm
-- $(INSTALL) -g root -o root -m 755 batch $(IROOT)$(bindir)
-- $(INSTALL) -d -o root -g root -m 755 $(IROOT)$(man1dir)
-- $(INSTALL) -d -o root -g root -m 755 $(IROOT)$(man5dir)
-- $(INSTALL) -d -o root -g root -m 755 $(IROOT)$(man8dir)
-- $(INSTALL) -g root -o root -m 755 -s atd $(IROOT)$(sbindir)
-- $(INSTALL) -g root -o root -m 755 atrun $(IROOT)$(sbindir)
-- $(INSTALL) -g root -o root -m 644 at.1 $(IROOT)$(man1dir)/
-- cd $(IROOT)$(man1dir) && $(LN_S) -f at.1 atq.1 && $(LN_S) -f at.1 batch.1 && $(LN_S) -f at.1 atrm.1
-- $(INSTALL) -g root -o root -m 644 atd.8 $(IROOT)$(man8dir)/
-+ $(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(etcdir)
-+ $(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(bindir)
-+ $(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(sbindir)
-+ $(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(docdir)
-+ $(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(atdocdir)
-+ $(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 755 -d $(DESTDIR)$(ATSPOOL_DIR) $(DESTDIR)$(ATJOB_DIR)
-+ chmod 1770 $(DESTDIR)$(ATSPOOL_DIR) $(DESTDIR)$(ATJOB_DIR)
-+ touch $(DESTDIR)$(LFILE)
-+ chmod 600 $(DESTDIR)$(LFILE)
-+ chown $(DAEMON_USERNAME):$(DAEMON_GROUPNAME) $(DESTDIR)$(LFILE)
-+ test -f $(DESTDIR)$(etcdir)/at.allow || test -f $(DESTDIR)$(etcdir)/at.deny || $(INSTALL) -o root -g $(DAEMON_GROUPNAME) -m 640 at.deny $(DESTDIR)$(etcdir)/
-+ $(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 6755 -s at $(DESTDIR)$(bindir)
-+ $(LN_S) -f at $(DESTDIR)$(bindir)/atq
-+ $(LN_S) -f at $(DESTDIR)$(bindir)/atrm
-+ $(INSTALL) -g root -o root -m 755 batch $(DESTDIR)$(bindir)
-+ $(INSTALL) -d -o root -g root -m 755 $(DESTDIR)$(man1dir)
-+ $(INSTALL) -d -o root -g root -m 755 $(DESTDIR)$(man5dir)
-+ $(INSTALL) -d -o root -g root -m 755 $(DESTDIR)$(man8dir)
-+ $(INSTALL) -g root -o root -m 755 -s atd $(DESTDIR)$(sbindir)
-+ $(INSTALL) -g root -o root -m 755 atrun $(DESTDIR)$(sbindir)
-+ $(INSTALL) -g root -o root -m 644 at.1 $(DESTDIR)$(man1dir)/
-+ cd $(DESTDIR)$(man1dir) && $(LN_S) -f at.1 atq.1 && $(LN_S) -f at.1 batch.1 && $(LN_S) -f at.1 atrm.1
-+ $(INSTALL) -g root -o root -m 644 atd.8 $(DESTDIR)$(man8dir)/
- sed "s,\$${exec_prefix},$(exec_prefix),g" <atrun.8>tmpman
-- $(INSTALL) -g root -o root -m 644 tmpman $(IROOT)$(man8dir)/atrun.8
-+ $(INSTALL) -g root -o root -m 644 tmpman $(DESTDIR)$(man8dir)/atrun.8
- rm -f tmpman
-- $(INSTALL) -g root -o root -m 644 at_allow.5 $(IROOT)$(man5dir)/
-- cd $(IROOT)$(man5dir) && $(LN_S) -f at_allow.5 at_deny.5
-- $(INSTALL) -g root -o root -m 644 $(DOCS) $(IROOT)$(atdocdir)
-- rm -f $(IROOT)$(mandir)/cat1/at.1* $(IROOT)$(mandir)/cat1/batch.1* \
-- $(IROOT)$(mandir)/cat1/atq.1*
-- rm -f $(IROOT)$(mandir)/cat1/atd.8*
-+ $(INSTALL) -g root -o root -m 644 at_allow.5 $(DESTDIR)$(man5dir)/
-+ cd $(DESTDIR)$(man5dir) && $(LN_S) -f at_allow.5 at_deny.5
-+ $(INSTALL) -g root -o root -m 644 $(DOCS) $(DESTDIR)$(atdocdir)
-+ rm -f $(DESTDIR)$(mandir)/cat1/at.1* $(DESTDIR)$(mandir)/cat1/batch.1* \
-+ $(DESTDIR)$(mandir)/cat1/atq.1*
-+ rm -f $(DESTDIR)$(mandir)/cat1/atd.8*
-
- dist: checkin $(DIST) $(LIST) Filelist.asc
- (cd ..; tar cf - `for a in $(DIST) $(LIST); do echo at-$(VERSION)/$$a; done` |\
diff --git a/patches/at-3.1.12/series b/patches/at-3.1.12/series
deleted file mode 100644
index 18e752288..000000000
--- a/patches/at-3.1.12/series
+++ /dev/null
@@ -1,4 +0,0 @@
-0001-configure.ac-remove-manual-compiler-check-with-AC_TR.patch
-0002-configure.ac-convert-AC_TRY_COMPILE-AC_COMPILE_IFELS.patch
-0003-Makefile.in-add-LDFLAGS-to-linking-stage.patch
-0005-Makefile.in-replace-IROOT-by-DESTDIR.patch
diff --git a/patches/aumix-2.9.1/0001-src-makefile-don-t-use-system-dirs.patch b/patches/aumix-2.9.1/0001-src-makefile-don-t-use-system-dirs.patch
deleted file mode 100644
index 93a146c44..000000000
--- a/patches/aumix-2.9.1/0001-src-makefile-don-t-use-system-dirs.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Date: Thu, 10 Jan 2013 14:42:21 +0100
-Subject: [PATCH] src/makefile: don't use system dirs
-
-Aumix's src/Makefile.am incorrect adds @includedir@ to the list of
-include paths and @libdir@ to the list of libraries paths. This is
-incorrect, as @includedir@ and @libdir@ are respectively /usr/include
-and /usr/lib, even in cross-compilation mode.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- src/Makefile.am | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/Makefile.am b/src/Makefile.am
-index d56c3e6..caeca31 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -9,9 +9,8 @@ aumix_SOURCES = common.c curses.c dummy.c gpm-xterm.c gtk.c interactive.c \
- mouse.c common.h curses.h gpm-xterm.h gtk.h interactive.h \
- mouse.h play.xpm record.xpm
- localedir = $(datadir)/locale
--INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\" -I@includedir@
-+INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\"
- AM_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ @GTK_CFLAGS@
--LDADD = -L@libdir@
- LIBS = @LIBS@ @GTK_LIBS@ @LIBINTL@
- DEFS = @DEFS@
-
diff --git a/patches/aumix-2.9.1/series b/patches/aumix-2.9.1/series
deleted file mode 100644
index 69f7c7e23..000000000
--- a/patches/aumix-2.9.1/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-src-makefile-don-t-use-system-dirs.patch
-# 2027ec073964554935db98ccad0f55ea - git-ptx-patches magic
diff --git a/patches/autogen.sh b/patches/autogen.sh
index 26ef3c670..e9eb29b95 100755
--- a/patches/autogen.sh
+++ b/patches/autogen.sh
@@ -6,6 +6,7 @@ if [ -n "${pkg_stamp}" ] && ! [[ " ${pkg_build_deps} " =~ " host-gettext " ]]; t
echo "No host-gettext dependency. Faking autopoint: AUTOPOINT=true."
export AUTOPOINT=true
fi
+export GTKDOCIZE=true
aclocal $ACLOCAL_FLAGS
diff --git a/patches/autossh-1.4c/0001-Make-install-rule-friendly-towards-packaging-with-DE.patch b/patches/autossh-1.4c/0001-Make-install-rule-friendly-towards-packaging-with-DE.patch
deleted file mode 100644
index 96fca563a..000000000
--- a/patches/autossh-1.4c/0001-Make-install-rule-friendly-towards-packaging-with-DE.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Jon Ringle <jringle@gridpoint.com>
-Date: Fri, 27 Jun 2014 16:39:41 -0400
-Subject: [PATCH] Make install rule friendly towards packaging with $DESTDIR
-
-Signed-off-by: Jon Ringle <jringle@gridpoint.com>
----
- Makefile.in | 30 +++++++++++++++---------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index fb7cc1d..a8e7a7e 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -45,18 +45,18 @@ distclean: allclean
- - /bin/rm -f Makefile
-
- install: $(TARGET)
-- mkdir -p -m 755 $(bindir)
-- mkdir -p -m 755 $(prefix)/share/doc/autossh
-- mkdir -p -m 755 $(datadir)/examples/autossh
-- mkdir -p -m 755 $(mandir)/man1
-- cp $(TARGET) $(bindir)
-- cp CHANGES README $(datadir)/doc/autossh
-- cp autossh.host $(datadir)/examples/autossh
-- cp rscreen $(datadir)/examples/autossh
-- cp autossh.1 $(mandir)/man1
-- chmod 755 $(bindir)/$(TARGET)
-- chmod 644 $(datadir)/doc/autossh/CHANGES
-- chmod 644 $(datadir)/doc/autossh/README
-- chmod 644 $(datadir)/examples/autossh/autossh.host
-- chmod 644 $(datadir)/examples/autossh/rscreen
-- chmod 644 $(mandir)/man1/autossh.1
-+ mkdir -p -m 755 $(DESTDIR)$(bindir)
-+ mkdir -p -m 755 $(DESTDIR)$(prefix)/share/doc/autossh
-+ mkdir -p -m 755 $(DESTDIR)$(datadir)/examples/autossh
-+ mkdir -p -m 755 $(DESTDIR)$(mandir)/man1
-+ cp $(TARGET) $(DESTDIR)$(bindir)
-+ cp CHANGES README $(DESTDIR)$(datadir)/doc/autossh
-+ cp autossh.host $(DESTDIR)$(datadir)/examples/autossh
-+ cp rscreen $(DESTDIR)$(datadir)/examples/autossh
-+ cp autossh.1 $(DESTDIR)$(mandir)/man1
-+ chmod 755 $(DESTDIR)$(bindir)/$(TARGET)
-+ chmod 644 $(DESTDIR)$(datadir)/doc/autossh/CHANGES
-+ chmod 644 $(DESTDIR)$(datadir)/doc/autossh/README
-+ chmod 644 $(DESTDIR)$(datadir)/examples/autossh/autossh.host
-+ chmod 644 $(DESTDIR)$(datadir)/examples/autossh/rscreen
-+ chmod 644 $(DESTDIR)$(mandir)/man1/autossh.1
diff --git a/patches/autossh-1.4c/series b/patches/autossh-1.4c/series
deleted file mode 100644
index 29f971c73..000000000
--- a/patches/autossh-1.4c/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Make-install-rule-friendly-towards-packaging-with-DE.patch
-# ecdd87ec5c25c56d421024daf8acf722 - git-ptx-patches magic
diff --git a/patches/bash-4.3.30/0001-Bash-4.3-patch-31.patch b/patches/bash-4.3.30/0001-Bash-4.3-patch-31.patch
deleted file mode 100644
index d9a187dcb..000000000
--- a/patches/bash-4.3.30/0001-Bash-4.3-patch-31.patch
+++ /dev/null
@@ -1,5467 +0,0 @@
-From: Chet Ramey <chet.ramey@case.edu>
-Date: Thu, 15 Jan 2015 10:20:04 -0500
-Subject: [PATCH] Bash-4.3 patch 31
-
----
- patchlevel.h | 2 +-
- subst.h | 1 +
- variables.c | 32 +-
- variables.c.orig | 5365 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 5397 insertions(+), 3 deletions(-)
- create mode 100644 variables.c.orig
-
-diff --git a/patchlevel.h b/patchlevel.h
-index e5dde5245275..0ad46aafbdd9 100644
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
- regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
- looks for to find the patch level (for the sccs version string). */
-
--#define PATCHLEVEL 30
-+#define PATCHLEVEL 31
-
- #endif /* _PATCHLEVEL_H_ */
-diff --git a/subst.h b/subst.h
-index cedaf8b6b444..1c300ab96b04 100644
---- a/subst.h
-+++ b/subst.h
-@@ -47,6 +47,7 @@
- #define ASS_MKASSOC 0x0004
- #define ASS_MKGLOBAL 0x0008 /* force global assignment */
- #define ASS_NAMEREF 0x0010 /* assigning to nameref variable */
-+#define ASS_FROMREF 0x0020 /* assigning from value of nameref variable */
-
- /* Flags for the string extraction functions. */
- #define SX_NOALLOC 0x0001 /* just skip; don't return substring */
-diff --git a/variables.c b/variables.c
-index 7c82710e0f0b..81b7877e32e8 100644
---- a/variables.c
-+++ b/variables.c
-@@ -2516,10 +2516,27 @@ bind_variable_internal (name, value, table, hflags, aflags)
- HASH_TABLE *table;
- int hflags, aflags;
- {
-- char *newval;
-+ char *newname, *newval;
- SHELL_VAR *entry;
-+#if defined (ARRAY_VARS)
-+ arrayind_t ind;
-+ char *subp;
-+ int sublen;
-+#endif
-
-+ newname = 0;
-+#if defined (ARRAY_VARS)
-+ if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference (name))
-+ {
-+ newname = array_variable_name (name, &subp, &sublen);
-+ if (newname == 0)
-+ return (SHELL_VAR *)NULL; /* XXX */
-+ entry = hash_lookup (newname, table);
-+ }
-+ else
-+#endif
- entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table);
-+
- /* Follow the nameref chain here if this is the global variables table */
- if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table)
- {
-@@ -2550,6 +2567,16 @@ bind_variable_internal (name, value, table, hflags, aflags)
- var_setvalue (entry, make_variable_value (entry, value, 0));
- }
- }
-+#if defined (ARRAY_VARS)
-+ else if (entry == 0 && newname)
-+ {
-+ entry = make_new_array_variable (newname); /* indexed array by default */
-+ if (entry == 0)
-+ return entry;
-+ ind = array_expand_index (name, subp, sublen);
-+ bind_array_element (entry, ind, value, aflags);
-+ }
-+#endif
- else if (entry == 0)
- {
- entry = make_new_variable (name, table);
-@@ -2670,7 +2697,8 @@ bind_variable (name, value, flags)
- normal. */
- if (nameref_cell (nv) == 0)
- return (bind_variable_internal (nv->name, value, nvc->table, 0, flags));
-- return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags));
-+ /* XXX - bug here with ref=array[index] */
-+ return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags|ASS_FROMREF));
- }
- else
- v = nv;
-diff --git a/variables.c.orig b/variables.c.orig
-new file mode 100644
-index 000000000000..7c82710e0f0b
---- /dev/null
-+++ b/variables.c.orig
-@@ -0,0 +1,5365 @@
-+/* variables.c -- Functions for hacking shell variables. */
-+
-+/* Copyright (C) 1987-2013 Free Software Foundation, Inc.
-+
-+ This file is part of GNU Bash, the Bourne Again SHell.
-+
-+ Bash is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ Bash is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+#include "config.h"
-+
-+#include "bashtypes.h"
-+#include "posixstat.h"
-+#include "posixtime.h"
-+
-+#if defined (__QNX__)
-+# if defined (__QNXNTO__)
-+# include <sys/netmgr.h>
-+# else
-+# include <sys/vc.h>
-+# endif /* !__QNXNTO__ */
-+#endif /* __QNX__ */
-+
-+#if defined (HAVE_UNISTD_H)
-+# include <unistd.h>
-+#endif
-+
-+#include <stdio.h>
-+#include "chartypes.h"
-+#if defined (HAVE_PWD_H)
-+# include <pwd.h>
-+#endif
-+#include "bashansi.h"
-+#include "bashintl.h"
-+
-+#define NEED_XTRACE_SET_DECL
-+
-+#include "shell.h"
-+#include "flags.h"
-+#include "execute_cmd.h"
-+#include "findcmd.h"
-+#include "mailcheck.h"
-+#include "input.h"
-+#include "hashcmd.h"
-+#include "pathexp.h"
-+#include "alias.h"
-+#include "jobs.h"
-+
-+#include "version.h"
-+
-+#include "builtins/getopt.h"
-+#include "builtins/common.h"
-+#include "builtins/builtext.h"
-+
-+#if defined (READLINE)
-+# include "bashline.h"
-+# include <readline/readline.h>
-+#else
-+# include <tilde/tilde.h>
-+#endif
-+
-+#if defined (HISTORY)
-+# include "bashhist.h"
-+# include <readline/history.h>
-+#endif /* HISTORY */
-+
-+#if defined (PROGRAMMABLE_COMPLETION)
-+# include "pcomplete.h"
-+#endif
-+
-+#define TEMPENV_HASH_BUCKETS 4 /* must be power of two */
-+
-+#define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0')
-+
-+#define BASHFUNC_PREFIX "BASH_FUNC_"
-+#define BASHFUNC_PREFLEN 10 /* == strlen(BASHFUNC_PREFIX */
-+#define BASHFUNC_SUFFIX "%%"
-+#define BASHFUNC_SUFFLEN 2 /* == strlen(BASHFUNC_SUFFIX) */
-+
-+extern char **environ;
-+
-+/* Variables used here and defined in other files. */
-+extern int posixly_correct;
-+extern int line_number, line_number_base;
-+extern int subshell_environment, indirection_level, subshell_level;
-+extern int build_version, patch_level;
-+extern int expanding_redir;
-+extern int last_command_exit_value;
-+extern char *dist_version, *release_status;
-+extern char *shell_name;
-+extern char *primary_prompt, *secondary_prompt;
-+extern char *current_host_name;
-+extern sh_builtin_func_t *this_shell_builtin;
-+extern SHELL_VAR *this_shell_function;
-+extern char *the_printed_command_except_trap;
-+extern char *this_command_name;
-+extern char *command_execution_string;
-+extern time_t shell_start_time;
-+extern int assigning_in_environment;
-+extern int executing_builtin;
-+extern int funcnest_max;
-+
-+#if defined (READLINE)
-+extern int no_line_editing;
-+extern int perform_hostname_completion;
-+#endif
-+
-+/* The list of shell variables that the user has created at the global
-+ scope, or that came from the environment. */
-+VAR_CONTEXT *global_variables = (VAR_CONTEXT *)NULL;
-+
-+/* The current list of shell variables, including function scopes */
-+VAR_CONTEXT *shell_variables = (VAR_CONTEXT *)NULL;
-+
-+/* The list of shell functions that the user has created, or that came from
-+ the environment. */
-+HASH_TABLE *shell_functions = (HASH_TABLE *)NULL;
-+
-+#if defined (DEBUGGER)
-+/* The table of shell function definitions that the user defined or that
-+ came from the environment. */
-+HASH_TABLE *shell_function_defs = (HASH_TABLE *)NULL;
-+#endif
-+
-+/* The current variable context. This is really a count of how deep into
-+ executing functions we are. */
-+int variable_context = 0;
-+
-+/* The set of shell assignments which are made only in the environment
-+ for a single command. */
-+HASH_TABLE *temporary_env = (HASH_TABLE *)NULL;
-+
-+/* Set to non-zero if an assignment error occurs while putting variables
-+ into the temporary environment. */
-+int tempenv_assign_error;
-+
-+/* Some funky variables which are known about specially. Here is where
-+ "$*", "$1", and all the cruft is kept. */
-+char *dollar_vars[10];
-+WORD_LIST *rest_of_args = (WORD_LIST *)NULL;
-+
-+/* The value of $$. */
-+pid_t dollar_dollar_pid;
-+
-+/* Non-zero means that we have to remake EXPORT_ENV. */
-+int array_needs_making = 1;
-+
-+/* The number of times BASH has been executed. This is set
-+ by initialize_variables (). */
-+int shell_level = 0;
-+
-+/* An array which is passed to commands as their environment. It is
-+ manufactured from the union of the initial environment and the
-+ shell variables that are marked for export. */
-+char **export_env = (char **)NULL;
-+static int export_env_index;
-+static int export_env_size;
-+
-+#if defined (READLINE)
-+static int winsize_assignment; /* currently assigning to LINES or COLUMNS */
-+#endif
-+
-+static HASH_TABLE *last_table_searched; /* hash_lookup sets this */
-+
-+/* Some forward declarations. */
-+static void create_variable_tables __P((void));
-+
-+static void set_machine_vars __P((void));
-+static void set_home_var __P((void));
-+static void set_shell_var __P((void));
-+static char *get_bash_name __P((void));
-+static void initialize_shell_level __P((void));
-+static void uidset __P((void));
-+#if defined (ARRAY_VARS)
-+static void make_vers_array __P((void));
-+#endif
-+
-+static SHELL_VAR *null_assign __P((SHELL_VAR *, char *, arrayind_t, char *));
-+#if defined (ARRAY_VARS)
-+static SHELL_VAR *null_array_assign __P((SHELL_VAR *, char *, arrayind_t, char *));
-+#endif
-+static SHELL_VAR *get_self __P((SHELL_VAR *));
-+
-+#if defined (ARRAY_VARS)
-+static SHELL_VAR *init_dynamic_array_var __P((char *, sh_var_value_func_t *, sh_var_assign_func_t *, int));
-+static SHELL_VAR *init_dynamic_assoc_var __P((char *, sh_var_value_func_t *, sh_var_assign_func_t *, int));
-+#endif
-+
-+static SHELL_VAR *assign_seconds __P((SHELL_VAR *, char *, arrayind_t, char *));
-+static SHELL_VAR *get_seconds __P((SHELL_VAR *));
-+static SHELL_VAR *init_seconds_var __P((void));
-+
-+static int brand __P((void));
-+static void sbrand __P((unsigned long)); /* set bash random number generator. */
-+static void seedrand __P((void)); /* seed generator randomly */
-+static SHELL_VAR *assign_random __P((SHELL_VAR *, char *, arrayind_t, char *));
-+static SHELL_VAR *get_random __P((SHELL_VAR *));
-+
-+static SHELL_VAR *assign_lineno __P((SHELL_VAR *, char *, arrayind_t, char *));
-+static SHELL_VAR *get_lineno __P((SHELL_VAR *));
-+
-+static SHELL_VAR *assign_subshell __P((SHELL_VAR *, char *, arrayind_t, char *));
-+static SHELL_VAR *get_subshell __P((SHELL_VAR *));
-+
-+static SHELL_VAR *get_bashpid __P((SHELL_VAR *));
-+
-+#if defined (HISTORY)
-+static SHELL_VAR *get_histcmd __P((SHELL_VAR *));
-+#endif
-+
-+#if defined (READLINE)
-+static SHELL_VAR *get_comp_wordbreaks __P((SHELL_VAR *));
-+static SHELL_VAR *assign_comp_wordbreaks __P((SHELL_VAR *, char *, arrayind_t, char *));
-+#endif
-+
-+#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS)
-+static SHELL_VAR *assign_dirstack __P((SHELL_VAR *, char *, arrayind_t, char *));
-+static SHELL_VAR *get_dirstack __P((SHELL_VAR *));
-+#endif
-+
-+#if defined (ARRAY_VARS)
-+static SHELL_VAR *get_groupset __P((SHELL_VAR *));
-+
-+static SHELL_VAR *build_hashcmd __P((SHELL_VAR *));
-+static SHELL_VAR *get_hashcmd __P((SHELL_VAR *));
-+static SHELL_VAR *assign_hashcmd __P((SHELL_VAR *, char *, arrayind_t, char *));
-+# if defined (ALIAS)
-+static SHELL_VAR *build_aliasvar __P((SHELL_VAR *));
-+static SHELL_VAR *get_aliasvar __P((SHELL_VAR *));
-+static SHELL_VAR *assign_aliasvar __P((SHELL_VAR *, char *, arrayind_t, char *));
-+# endif
-+#endif
-+
-+static SHELL_VAR *get_funcname __P((SHELL_VAR *));
-+static SHELL_VAR *init_funcname_var __P((void));
-+
-+static void initialize_dynamic_variables __P((void));
-+
-+static SHELL_VAR *hash_lookup __P((const char *, HASH_TABLE *));
-+static SHELL_VAR *new_shell_variable __P((const char *));
-+static SHELL_VAR *make_new_variable __P((const char *, HASH_TABLE *));
-+static SHELL_VAR *bind_variable_internal __P((const char *, char *, HASH_TABLE *, int, int));
-+
-+static void dispose_variable_value __P((SHELL_VAR *));
-+static void free_variable_hash_data __P((PTR_T));
-+
-+static VARLIST *vlist_alloc __P((int));
-+static VARLIST *vlist_realloc __P((VARLIST *, int));
-+static void vlist_add __P((VARLIST *, SHELL_VAR *, int));
-+
-+static void flatten __P((HASH_TABLE *, sh_var_map_func_t *, VARLIST *, int));
-+
-+static int qsort_var_comp __P((SHELL_VAR **, SHELL_VAR **));
-+
-+static SHELL_VAR **vapply __P((sh_var_map_func_t *));
-+static SHELL_VAR **fapply __P((sh_var_map_func_t *));
-+
-+static int visible_var __P((SHELL_VAR *));
-+static int visible_and_exported __P((SHELL_VAR *));
-+static int export_environment_candidate __P((SHELL_VAR *));
-+static int local_and_exported __P((SHELL_VAR *));
-+static int variable_in_context __P((SHELL_VAR *));
-+#if defined (ARRAY_VARS)
-+static int visible_array_vars __P((SHELL_VAR *));
-+#endif
-+
-+static SHELL_VAR *find_nameref_at_context __P((SHELL_VAR *, VAR_CONTEXT *));
-+static SHELL_VAR *find_variable_nameref_context __P((SHELL_VAR *, VAR_CONTEXT *, VAR_CONTEXT **));
-+static SHELL_VAR *find_variable_last_nameref_context __P((SHELL_VAR *, VAR_CONTEXT *, VAR_CONTEXT **));
-+
-+static SHELL_VAR *bind_tempenv_variable __P((const char *, char *));
-+static void push_temp_var __P((PTR_T));
-+static void propagate_temp_var __P((PTR_T));
-+static void dispose_temporary_env __P((sh_free_func_t *));
-+
-+static inline char *mk_env_string __P((const char *, const char *, int));
-+static char **make_env_array_from_var_list __P((SHELL_VAR **));
-+static char **make_var_export_array __P((VAR_CONTEXT *));
-+static char **make_func_export_array __P((void));
-+static void add_temp_array_to_env __P((char **, int, int));
-+
-+static int n_shell_variables __P((void));
-+static int set_context __P((SHELL_VAR *));
-+
-+static void push_func_var __P((PTR_T));
-+static void push_exported_var __P((PTR_T));
-+
-+static inline int find_special_var __P((const char *));
-+
-+static void
-+create_variable_tables ()
-+{
-+ if (shell_variables == 0)
-+ {
-+ shell_variables = global_variables = new_var_context ((char *)NULL, 0);
-+ shell_variables->scope = 0;
-+ shell_variables->table = hash_create (0);
-+ }
-+
-+ if (shell_functions == 0)
-+ shell_functions = hash_create (0);
-+
-+#if defined (DEBUGGER)
-+ if (shell_function_defs == 0)
-+ shell_function_defs = hash_create (0);
-+#endif
-+}
-+
-+/* Initialize the shell variables from the current environment.
-+ If PRIVMODE is nonzero, don't import functions from ENV or
-+ parse $SHELLOPTS. */
-+void
-+initialize_shell_variables (env, privmode)
-+ char **env;
-+ int privmode;
-+{
-+ char *name, *string, *temp_string;
-+ int c, char_index, string_index, string_length, ro;
-+ SHELL_VAR *temp_var;
-+
-+ create_variable_tables ();
-+
-+ for (string_index = 0; string = env[string_index++]; )
-+ {
-+ char_index = 0;
-+ name = string;
-+ while ((c = *string++) && c != '=')
-+ ;
-+ if (string[-1] == '=')
-+ char_index = string - name - 1;
-+
-+ /* If there are weird things in the environment, like `=xxx' or a
-+ string without an `=', just skip them. */
-+ if (char_index == 0)
-+ continue;
-+
-+ /* ASSERT(name[char_index] == '=') */
-+ name[char_index] = '\0';
-+ /* Now, name = env variable name, string = env variable value, and
-+ char_index == strlen (name) */
-+
-+ temp_var = (SHELL_VAR *)NULL;
-+
-+ /* If exported function, define it now. Don't import functions from
-+ the environment in privileged mode. */
-+ if (privmode == 0 && read_but_dont_execute == 0 &&
-+ STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) &&
-+ STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) &&
-+ STREQN ("() {", string, 4))
-+ {
-+ size_t namelen;
-+ char *tname; /* desired imported function name */
-+
-+ namelen = char_index - BASHFUNC_PREFLEN - BASHFUNC_SUFFLEN;
-+
-+ tname = name + BASHFUNC_PREFLEN; /* start of func name */
-+ tname[namelen] = '\0'; /* now tname == func name */
-+
-+ string_length = strlen (string);
-+ temp_string = (char *)xmalloc (namelen + string_length + 2);
-+
-+ memcpy (temp_string, tname, namelen);
-+ temp_string[namelen] = ' ';
-+ memcpy (temp_string + namelen + 1, string, string_length + 1);
-+
-+ /* Don't import function names that are invalid identifiers from the
-+ environment, though we still allow them to be defined as shell
-+ variables. */
-+ if (absolute_program (tname) == 0 && (posixly_correct == 0 || legal_identifier (tname)))
-+ parse_and_execute (temp_string, tname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
-+
-+ if (temp_var = find_function (tname))
-+ {
-+ VSETATTR (temp_var, (att_exported|att_imported));
-+ array_needs_making = 1;
-+ }
-+ else
-+ {
-+ if (temp_var = bind_variable (name, string, 0))
-+ {
-+ VSETATTR (temp_var, (att_exported | att_imported | att_invisible));
-+ array_needs_making = 1;
-+ }
-+ last_command_exit_value = 1;
-+ report_error (_("error importing function definition for `%s'"), tname);
-+ }
-+
-+ /* Restore original suffix */
-+ tname[namelen] = BASHFUNC_SUFFIX[0];
-+ }
-+#if defined (ARRAY_VARS)
-+# if ARRAY_EXPORT
-+ /* Array variables may not yet be exported. */
-+ else if (*string == '(' && string[1] == '[' && string[strlen (string) - 1] == ')')
-+ {
-+ string_length = 1;
-+ temp_string = extract_array_assignment_list (string, &string_length);
-+ temp_var = assign_array_from_string (name, temp_string);
-+ FREE (temp_string);
-+ VSETATTR (temp_var, (att_exported | att_imported));
-+ array_needs_making = 1;
-+ }
-+# endif /* ARRAY_EXPORT */
-+#endif
-+#if 0
-+ else if (legal_identifier (name))
-+#else
-+ else
-+#endif
-+ {
-+ ro = 0;
-+ if (posixly_correct && STREQ (name, "SHELLOPTS"))
-+ {
-+ temp_var = find_variable ("SHELLOPTS");
-+ ro = temp_var && readonly_p (temp_var);
-+ if (temp_var)
-+ VUNSETATTR (temp_var, att_readonly);
-+ }
-+ temp_var = bind_variable (name, string, 0);
-+ if (temp_var)
-+ {
-+ if (legal_identifier (name))
-+ VSETATTR (temp_var, (att_exported | att_imported));
-+ else
-+ VSETATTR (temp_var, (att_exported | att_imported | att_invisible));
-+ if (ro)
-+ VSETATTR (temp_var, att_readonly);
-+ array_needs_making = 1;
-+ }
-+ }
-+
-+ name[char_index] = '=';
-+ /* temp_var can be NULL if it was an exported function with a syntax
-+ error (a different bug, but it still shouldn't dump core). */
-+ if (temp_var && function_p (temp_var) == 0) /* XXX not yet */
-+ {
-+ CACHE_IMPORTSTR (temp_var, name);
-+ }
-+ }
-+
-+ set_pwd ();
-+
-+ /* Set up initial value of $_ */
-+ temp_var = set_if_not ("_", dollar_vars[0]);
-+
-+ /* Remember this pid. */
-+ dollar_dollar_pid = getpid ();
-+
-+ /* Now make our own defaults in case the vars that we think are
-+ important are missing. */
-+ temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE);
-+#if 0
-+ set_auto_export (temp_var); /* XXX */
-+#endif
-+
-+ temp_var = set_if_not ("TERM", "dumb");
-+#if 0
-+ set_auto_export (temp_var); /* XXX */
-+#endif
-+
-+#if defined (__QNX__)
-+ /* set node id -- don't import it from the environment */
-+ {
-+ char node_name[22];
-+# if defined (__QNXNTO__)
-+ netmgr_ndtostr(ND2S_LOCAL_STR, ND_LOCAL_NODE, node_name, sizeof(node_name));
-+# else
-+ qnx_nidtostr (getnid (), node_name, sizeof (node_name));
-+# endif
-+ temp_var = bind_variable ("NODE", node_name, 0);
-+ set_auto_export (temp_var);
-+ }
-+#endif
-+
-+ /* set up the prompts. */
-+ if (interactive_shell)
-+ {
-+#if defined (PROMPT_STRING_DECODE)
-+ set_if_not ("PS1", primary_prompt);
-+#else
-+ if (current_user.uid == -1)
-+ get_current_user_info ();
-+ set_if_not ("PS1", current_user.euid == 0 ? "# " : primary_prompt);
-+#endif
-+ set_if_not ("PS2", secondary_prompt);
-+ }
-+ set_if_not ("PS4", "+ ");
-+
-+ /* Don't allow IFS to be imported from the environment. */
-+ temp_var = bind_variable ("IFS", " \t\n", 0);
-+ setifs (temp_var);
-+
-+ /* Magic machine types. Pretty convenient. */
-+ set_machine_vars ();
-+
-+ /* Default MAILCHECK for interactive shells. Defer the creation of a
-+ default MAILPATH until the startup files are read, because MAIL
-+ names a mail file if MAILPATH is not set, and we should provide a
-+ default only if neither is set. */
-+ if (interactive_shell)
-+ {
-+ temp_var = set_if_not ("MAILCHECK", posixly_correct ? "600" : "60");
-+ VSETATTR (temp_var, att_integer);
-+ }
-+
-+ /* Do some things with shell level. */
-+ initialize_shell_level ();
-+
-+ set_ppid ();
-+
-+ /* Initialize the `getopts' stuff. */
-+ temp_var = bind_variable ("OPTIND", "1", 0);
-+ VSETATTR (temp_var, att_integer);
-+ getopts_reset (0);
-+ bind_variable ("OPTERR", "1", 0);
-+ sh_opterr = 1;
-+
-+ if (login_shell == 1 && posixly_correct == 0)
-+ set_home_var ();
-+
-+ /* Get the full pathname to THIS shell, and set the BASH variable
-+ to it. */
-+ name = get_bash_name ();
-+ temp_var = bind_variable ("BASH", name, 0);
-+ free (name);
-+
-+ /* Make the exported environment variable SHELL be the user's login
-+ shell. Note that the `tset' command looks at this variable
-+ to determine what style of commands to output; if it ends in "csh",
-+ then C-shell commands are output, else Bourne shell commands. */
-+ set_shell_var ();
-+
-+ /* Make a variable called BASH_VERSION which contains the version info. */
-+ bind_variable ("BASH_VERSION", shell_version_string (), 0);
-+#if defined (ARRAY_VARS)
-+ make_vers_array ();
-+#endif
-+
-+ if (command_execution_string)
-+ bind_variable ("BASH_EXECUTION_STRING", command_execution_string, 0);
-+
-+ /* Find out if we're supposed to be in Posix.2 mode via an
-+ environment variable. */
-+ temp_var = find_variable ("POSIXLY_CORRECT");
-+ if (!temp_var)
-+ temp_var = find_variable ("POSIX_PEDANTIC");
-+ if (temp_var && imported_p (temp_var))
-+ sv_strict_posix (temp_var->name);
-+
-+#if defined (HISTORY)
-+ /* Set history variables to defaults, and then do whatever we would
-+ do if the variable had just been set. Do this only in the case
-+ that we are remembering commands on the history list. */
-+ if (remember_on_history)
-+ {
-+ name = bash_tilde_expand (posixly_correct ? "~/.sh_history" : "~/.bash_history", 0);
-+
-+ set_if_not ("HISTFILE", name);
-+ free (name);
-+ }
-+#endif /* HISTORY */
-+
-+ /* Seed the random number generator. */
-+ seedrand ();
-+
-+ /* Handle some "special" variables that we may have inherited from a
-+ parent shell. */
-+ if (interactive_shell)
-+ {
-+ temp_var = find_variable ("IGNOREEOF");
-+ if (!temp_var)
-+ temp_var = find_variable ("ignoreeof");
-+ if (temp_var && imported_p (temp_var))
-+ sv_ignoreeof (temp_var->name);
-+ }
-+
-+#if defined (HISTORY)
-+ if (interactive_shell && remember_on_history)
-+ {
-+ sv_history_control ("HISTCONTROL");
-+ sv_histignore ("HISTIGNORE");
-+ sv_histtimefmt ("HISTTIMEFORMAT");
-+ }
-+#endif /* HISTORY */
-+
-+#if defined (READLINE) && defined (STRICT_POSIX)
-+ /* POSIXLY_CORRECT will only be 1 here if the shell was compiled
-+ -DSTRICT_POSIX */
-+ if (interactive_shell && posixly_correct && no_line_editing == 0)
-+ rl_prefer_env_winsize = 1;
-+#endif /* READLINE && STRICT_POSIX */
-+
-+ /*
-+ * 24 October 2001
-+ *
-+ * I'm tired of the arguing and bug reports. Bash now leaves SSH_CLIENT
-+ * and SSH2_CLIENT alone. I'm going to rely on the shell_level check in
-+ * isnetconn() to avoid running the startup files more often than wanted.
-+ * That will, of course, only work if the user's login shell is bash, so
-+ * I've made that behavior conditional on SSH_SOURCE_BASHRC being defined
-+ * in config-top.h.
-+ */
-+#if 0
-+ temp_var = find_variable ("SSH_CLIENT");
-+ if (temp_var && imported_p (temp_var))
-+ {
-+ VUNSETATTR (temp_var, att_exported);
-+ array_needs_making = 1;
-+ }
-+ temp_var = find_variable ("SSH2_CLIENT");
-+ if (temp_var && imported_p (temp_var))
-+ {
-+ VUNSETATTR (temp_var, att_exported);
-+ array_needs_making = 1;
-+ }
-+#endif
-+
-+ /* Get the user's real and effective user ids. */
-+ uidset ();
-+
-+ temp_var = find_variable ("BASH_XTRACEFD");
-+ if (temp_var && imported_p (temp_var))
-+ sv_xtracefd (temp_var->name);
-+
-+ /* Initialize the dynamic variables, and seed their values. */
-+ initialize_dynamic_variables ();
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Setting values for special shell variables */
-+/* */
-+/* **************************************************************** */
-+
-+static void
-+set_machine_vars ()
-+{
-+ SHELL_VAR *temp_var;
-+
-+ temp_var = set_if_not ("HOSTTYPE", HOSTTYPE);
-+ temp_var = set_if_not ("OSTYPE", OSTYPE);
-+ temp_var = set_if_not ("MACHTYPE", MACHTYPE);
-+
-+ temp_var = set_if_not ("HOSTNAME", current_host_name);
-+}
-+
-+/* Set $HOME to the information in the password file if we didn't get
-+ it from the environment. */
-+
-+/* This function is not static so the tilde and readline libraries can
-+ use it. */
-+char *
-+sh_get_home_dir ()
-+{
-+ if (current_user.home_dir == 0)
-+ get_current_user_info ();
-+ return current_user.home_dir;
-+}
-+
-+static void
-+set_home_var ()
-+{
-+ SHELL_VAR *temp_var;
-+
-+ temp_var = find_variable ("HOME");
-+ if (temp_var == 0)
-+ temp_var = bind_variable ("HOME", sh_get_home_dir (), 0);
-+#if 0
-+ VSETATTR (temp_var, att_exported);
-+#endif
-+}
-+
-+/* Set $SHELL to the user's login shell if it is not already set. Call
-+ get_current_user_info if we haven't already fetched the shell. */
-+static void
-+set_shell_var ()
-+{
-+ SHELL_VAR *temp_var;
-+
-+ temp_var = find_variable ("SHELL");
-+ if (temp_var == 0)
-+ {
-+ if (current_user.shell == 0)
-+ get_current_user_info ();
-+ temp_var = bind_variable ("SHELL", current_user.shell, 0);
-+ }
-+#if 0
-+ VSETATTR (temp_var, att_exported);
-+#endif
-+}
-+
-+static char *
-+get_bash_name ()
-+{
-+ char *name;
-+
-+ if ((login_shell == 1) && RELPATH(shell_name))
-+ {
-+ if (current_user.shell == 0)
-+ get_current_user_info ();
-+ name = savestring (current_user.shell);
-+ }
-+ else if (ABSPATH(shell_name))
-+ name = savestring (shell_name);
-+ else if (shell_name[0] == '.' && shell_name[1] == '/')
-+ {
-+ /* Fast path for common case. */
-+ char *cdir;
-+ int len;
-+
-+ cdir = get_string_value ("PWD");
-+ if (cdir)
-+ {
-+ len = strlen (cdir);
-+ name = (char *)xmalloc (len + strlen (shell_name) + 1);
-+ strcpy (name, cdir);
-+ strcpy (name + len, shell_name + 1);
-+ }
-+ else
-+ name = savestring (shell_name);
-+ }
-+ else
-+ {
-+ char *tname;
-+ int s;
-+
-+ tname = find_user_command (shell_name);
-+
-+ if (tname == 0)
-+ {
-+ /* Try the current directory. If there is not an executable
-+ there, just punt and use the login shell. */
-+ s = file_status (shell_name);
-+ if (s & FS_EXECABLE)
-+ {
-+ tname = make_absolute (shell_name, get_string_value ("PWD"));
-+ if (*shell_name == '.')
-+ {
-+ name = sh_canonpath (tname, PATH_CHECKDOTDOT|PATH_CHECKEXISTS);
-+ if (name == 0)
-+ name = tname;
-+ else
-+ free (tname);
-+ }
-+ else
-+ name = tname;
-+ }
-+ else
-+ {
-+ if (current_user.shell == 0)
-+ get_current_user_info ();
-+ name = savestring (current_user.shell);
-+ }
-+ }
-+ else
-+ {
-+ name = full_pathname (tname);
-+ free (tname);
-+ }
-+ }
-+
-+ return (name);
-+}
-+
-+void
-+adjust_shell_level (change)
-+ int change;
-+{
-+ char new_level[5], *old_SHLVL;
-+ intmax_t old_level;
-+ SHELL_VAR *temp_var;
-+
-+ old_SHLVL = get_string_value ("SHLVL");
-+ if (old_SHLVL == 0 || *old_SHLVL == '\0' || legal_number (old_SHLVL, &old_level) == 0)
-+ old_level = 0;
-+
-+ shell_level = old_level + change;
-+ if (shell_level < 0)
-+ shell_level = 0;
-+ else if (shell_level > 1000)
-+ {
-+ internal_warning (_("shell level (%d) too high, resetting to 1"), shell_level);
-+ shell_level = 1;
-+ }
-+
-+ /* We don't need the full generality of itos here. */
-+ if (shell_level < 10)
-+ {
-+ new_level[0] = shell_level + '0';
-+ new_level[1] = '\0';
-+ }
-+ else if (shell_level < 100)
-+ {
-+ new_level[0] = (shell_level / 10) + '0';
-+ new_level[1] = (shell_level % 10) + '0';
-+ new_level[2] = '\0';
-+ }
-+ else if (shell_level < 1000)
-+ {
-+ new_level[0] = (shell_level / 100) + '0';
-+ old_level = shell_level % 100;
-+ new_level[1] = (old_level / 10) + '0';
-+ new_level[2] = (old_level % 10) + '0';
-+ new_level[3] = '\0';
-+ }
-+
-+ temp_var = bind_variable ("SHLVL", new_level, 0);
-+ set_auto_export (temp_var);
-+}
-+
-+static void
-+initialize_shell_level ()
-+{
-+ adjust_shell_level (1);
-+}
-+
-+/* If we got PWD from the environment, update our idea of the current
-+ working directory. In any case, make sure that PWD exists before
-+ checking it. It is possible for getcwd () to fail on shell startup,
-+ and in that case, PWD would be undefined. If this is an interactive
-+ login shell, see if $HOME is the current working directory, and if
-+ that's not the same string as $PWD, set PWD=$HOME. */
-+
-+void
-+set_pwd ()
-+{
-+ SHELL_VAR *temp_var, *home_var;
-+ char *temp_string, *home_string;
-+
-+ home_var = find_variable ("HOME");
-+ home_string = home_var ? value_cell (home_var) : (char *)NULL;
-+
-+ temp_var = find_variable ("PWD");
-+ if (temp_var && imported_p (temp_var) &&
-+ (temp_string = value_cell (temp_var)) &&
-+ same_file (temp_string, ".", (struct stat *)NULL, (struct stat *)NULL))
-+ set_working_directory (temp_string);
-+ else if (home_string && interactive_shell && login_shell &&
-+ same_file (home_string, ".", (struct stat *)NULL, (struct stat *)NULL))
-+ {
-+ set_working_directory (home_string);
-+ temp_var = bind_variable ("PWD", home_string, 0);
-+ set_auto_export (temp_var);
-+ }
-+ else
-+ {
-+ temp_string = get_working_directory ("shell-init");
-+ if (temp_string)
-+ {
-+ temp_var = bind_variable ("PWD", temp_string, 0);
-+ set_auto_export (temp_var);
-+ free (temp_string);
-+ }
-+ }
-+
-+ /* According to the Single Unix Specification, v2, $OLDPWD is an
-+ `environment variable' and therefore should be auto-exported.
-+ Make a dummy invisible variable for OLDPWD, and mark it as exported. */
-+ temp_var = bind_variable ("OLDPWD", (char *)NULL, 0);
-+ VSETATTR (temp_var, (att_exported | att_invisible));
-+}
-+
-+/* Make a variable $PPID, which holds the pid of the shell's parent. */
-+void
-+set_ppid ()
-+{
-+ char namebuf[INT_STRLEN_BOUND(pid_t) + 1], *name;
-+ SHELL_VAR *temp_var;
-+
-+ name = inttostr (getppid (), namebuf, sizeof(namebuf));
-+ temp_var = find_variable ("PPID");
-+ if (temp_var)
-+ VUNSETATTR (temp_var, (att_readonly | att_exported));
-+ temp_var = bind_variable ("PPID", name, 0);
-+ VSETATTR (temp_var, (att_readonly | att_integer));
-+}
-+
-+static void
-+uidset ()
-+{
-+ char buff[INT_STRLEN_BOUND(uid_t) + 1], *b;
-+ register SHELL_VAR *v;
-+
-+ b = inttostr (current_user.uid, buff, sizeof (buff));
-+ v = find_variable ("UID");
-+ if (v == 0)
-+ {
-+ v = bind_variable ("UID", b, 0);
-+ VSETATTR (v, (att_readonly | att_integer));
-+ }
-+
-+ if (current_user.euid != current_user.uid)
-+ b = inttostr (current_user.euid, buff, sizeof (buff));
-+
-+ v = find_variable ("EUID");
-+ if (v == 0)
-+ {
-+ v = bind_variable ("EUID", b, 0);
-+ VSETATTR (v, (att_readonly | att_integer));
-+ }
-+}
-+
-+#if defined (ARRAY_VARS)
-+static void
-+make_vers_array ()
-+{
-+ SHELL_VAR *vv;
-+ ARRAY *av;
-+ char *s, d[32], b[INT_STRLEN_BOUND(int) + 1];
-+
-+ unbind_variable ("BASH_VERSINFO");
-+
-+ vv = make_new_array_variable ("BASH_VERSINFO");
-+ av = array_cell (vv);
-+ strcpy (d, dist_version);
-+ s = strchr (d, '.');
-+ if (s)
-+ *s++ = '\0';
-+ array_insert (av, 0, d);
-+ array_insert (av, 1, s);
-+ s = inttostr (patch_level, b, sizeof (b));
-+ array_insert (av, 2, s);
-+ s = inttostr (build_version, b, sizeof (b));
-+ array_insert (av, 3, s);
-+ array_insert (av, 4, release_status);
-+ array_insert (av, 5, MACHTYPE);
-+
-+ VSETATTR (vv, att_readonly);
-+}
-+#endif /* ARRAY_VARS */
-+
-+/* Set the environment variables $LINES and $COLUMNS in response to
-+ a window size change. */
-+void
-+sh_set_lines_and_columns (lines, cols)
-+ int lines, cols;
-+{
-+ char val[INT_STRLEN_BOUND(int) + 1], *v;
-+
-+#if defined (READLINE)
-+ /* If we are currently assigning to LINES or COLUMNS, don't do anything. */
-+ if (winsize_assignment)
-+ return;
-+#endif
-+
-+ v = inttostr (lines, val, sizeof (val));
-+ bind_variable ("LINES", v, 0);
-+
-+ v = inttostr (cols, val, sizeof (val));
-+ bind_variable ("COLUMNS", v, 0);
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Printing variables and values */
-+/* */
-+/* **************************************************************** */
-+
-+/* Print LIST (a list of shell variables) to stdout in such a way that
-+ they can be read back in. */
-+void
-+print_var_list (list)
-+ register SHELL_VAR **list;
-+{
-+ register int i;
-+ register SHELL_VAR *var;
-+
-+ for (i = 0; list && (var = list[i]); i++)
-+ if (invisible_p (var) == 0)
-+ print_assignment (var);
-+}
-+
-+/* Print LIST (a list of shell functions) to stdout in such a way that
-+ they can be read back in. */
-+void
-+print_func_list (list)
-+ register SHELL_VAR **list;
-+{
-+ register int i;
-+ register SHELL_VAR *var;
-+
-+ for (i = 0; list && (var = list[i]); i++)
-+ {
-+ printf ("%s ", var->name);
-+ print_var_function (var);
-+ printf ("\n");
-+ }
-+}
-+
-+/* Print the value of a single SHELL_VAR. No newline is
-+ output, but the variable is printed in such a way that
-+ it can be read back in. */
-+void
-+print_assignment (var)
-+ SHELL_VAR *var;
-+{
-+ if (var_isset (var) == 0)
-+ return;
-+
-+ if (function_p (var))
-+ {
-+ printf ("%s", var->name);
-+ print_var_function (var);
-+ printf ("\n");
-+ }
-+#if defined (ARRAY_VARS)
-+ else if (array_p (var))
-+ print_array_assignment (var, 0);
-+ else if (assoc_p (var))
-+ print_assoc_assignment (var, 0);
-+#endif /* ARRAY_VARS */
-+ else
-+ {
-+ printf ("%s=", var->name);
-+ print_var_value (var, 1);
-+ printf ("\n");
-+ }
-+}
-+
-+/* Print the value cell of VAR, a shell variable. Do not print
-+ the name, nor leading/trailing newline. If QUOTE is non-zero,
-+ and the value contains shell metacharacters, quote the value
-+ in such a way that it can be read back in. */
-+void
-+print_var_value (var, quote)
-+ SHELL_VAR *var;
-+ int quote;
-+{
-+ char *t;
-+
-+ if (var_isset (var) == 0)
-+ return;
-+
-+ if (quote && posixly_correct == 0 && ansic_shouldquote (value_cell (var)))
-+ {
-+ t = ansic_quote (value_cell (var), 0, (int *)0);
-+ printf ("%s", t);
-+ free (t);
-+ }
-+ else if (quote && sh_contains_shell_metas (value_cell (var)))
-+ {
-+ t = sh_single_quote (value_cell (var));
-+ printf ("%s", t);
-+ free (t);
-+ }
-+ else
-+ printf ("%s", value_cell (var));
-+}
-+
-+/* Print the function cell of VAR, a shell variable. Do not
-+ print the name, nor leading/trailing newline. */
-+void
-+print_var_function (var)
-+ SHELL_VAR *var;
-+{
-+ char *x;
-+
-+ if (function_p (var) && var_isset (var))
-+ {
-+ x = named_function_string ((char *)NULL, function_cell(var), FUNC_MULTILINE|FUNC_EXTERNAL);
-+ printf ("%s", x);
-+ }
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Dynamic Variables */
-+/* */
-+/* **************************************************************** */
-+
-+/* DYNAMIC VARIABLES
-+
-+ These are variables whose values are generated anew each time they are
-+ referenced. These are implemented using a pair of function pointers
-+ in the struct variable: assign_func, which is called from bind_variable
-+ and, if arrays are compiled into the shell, some of the functions in
-+ arrayfunc.c, and dynamic_value, which is called from find_variable.
-+
-+ assign_func is called from bind_variable_internal, if
-+ bind_variable_internal discovers that the variable being assigned to
-+ has such a function. The function is called as
-+ SHELL_VAR *temp = (*(entry->assign_func)) (entry, value, ind)
-+ and the (SHELL_VAR *)temp is returned as the value of bind_variable. It
-+ is usually ENTRY (self). IND is an index for an array variable, and
-+ unused otherwise.
-+
-+ dynamic_value is called from find_variable_internal to return a `new'
-+ value for the specified dynamic varible. If this function is NULL,
-+ the variable is treated as a `normal' shell variable. If it is not,
-+ however, then this function is called like this:
-+ tempvar = (*(var->dynamic_value)) (var);
-+
-+ Sometimes `tempvar' will replace the value of `var'. Other times, the
-+ shell will simply use the string value. Pretty object-oriented, huh?
-+
-+ Be warned, though: if you `unset' a special variable, it loses its
-+ special meaning, even if you subsequently set it.
-+
-+ The special assignment code would probably have been better put in
-+ subst.c: do_assignment_internal, in the same style as
-+ stupidly_hack_special_variables, but I wanted the changes as
-+ localized as possible. */
-+
-+#define INIT_DYNAMIC_VAR(var, val, gfunc, afunc) \
-+ do \
-+ { \
-+ v = bind_variable (var, (val), 0); \
-+ v->dynamic_value = gfunc; \
-+ v->assign_func = afunc; \
-+ } \
-+ while (0)
-+
-+#define INIT_DYNAMIC_ARRAY_VAR(var, gfunc, afunc) \
-+ do \
-+ { \
-+ v = make_new_array_variable (var); \
-+ v->dynamic_value = gfunc; \
-+ v->assign_func = afunc; \
-+ } \
-+ while (0)
-+
-+#define INIT_DYNAMIC_ASSOC_VAR(var, gfunc, afunc) \
-+ do \
-+ { \
-+ v = make_new_assoc_variable (var); \
-+ v->dynamic_value = gfunc; \
-+ v->assign_func = afunc; \
-+ } \
-+ while (0)
-+
-+static SHELL_VAR *
-+null_assign (self, value, unused, key)
-+ SHELL_VAR *self;
-+ char *value;
-+ arrayind_t unused;
-+ char *key;
-+{
-+ return (self);
-+}
-+
-+#if defined (ARRAY_VARS)
-+static SHELL_VAR *
-+null_array_assign (self, value, ind, key)
-+ SHELL_VAR *self;
-+ char *value;
-+ arrayind_t ind;
-+ char *key;
-+{
-+ return (self);
-+}
-+#endif
-+
-+/* Degenerate `dynamic_value' function; just returns what's passed without
-+ manipulation. */
-+static SHELL_VAR *
-+get_self (self)
-+ SHELL_VAR *self;
-+{
-+ return (self);
-+}
-+
-+#if defined (ARRAY_VARS)
-+/* A generic dynamic array variable initializer. Initialize array variable
-+ NAME with dynamic value function GETFUNC and assignment function SETFUNC. */
-+static SHELL_VAR *
-+init_dynamic_array_var (name, getfunc, setfunc, attrs)
-+ char *name;
-+ sh_var_value_func_t *getfunc;
-+ sh_var_assign_func_t *setfunc;
-+ int attrs;
-+{
-+ SHELL_VAR *v;
-+
-+ v = find_variable (name);
-+ if (v)
-+ return (v);
-+ INIT_DYNAMIC_ARRAY_VAR (name, getfunc, setfunc);
-+ if (attrs)
-+ VSETATTR (v, attrs);
-+ return v;
-+}
-+
-+static SHELL_VAR *
-+init_dynamic_assoc_var (name, getfunc, setfunc, attrs)
-+ char *name;
-+ sh_var_value_func_t *getfunc;
-+ sh_var_assign_func_t *setfunc;
-+ int attrs;
-+{
-+ SHELL_VAR *v;
-+
-+ v = find_variable (name);
-+ if (v)
-+ return (v);
-+ INIT_DYNAMIC_ASSOC_VAR (name, getfunc, setfunc);
-+ if (attrs)
-+ VSETATTR (v, attrs);
-+ return v;
-+}
-+#endif
-+
-+/* The value of $SECONDS. This is the number of seconds since shell
-+ invocation, or, the number of seconds since the last assignment + the
-+ value of the last assignment. */
-+static intmax_t seconds_value_assigned;
-+
-+static SHELL_VAR *
-+assign_seconds (self, value, unused, key)
-+ SHELL_VAR *self;
-+ char *value;
-+ arrayind_t unused;
-+ char *key;
-+{
-+ if (legal_number (value, &seconds_value_assigned) == 0)
-+ seconds_value_assigned = 0;
-+ shell_start_time = NOW;
-+ return (self);
-+}
-+
-+static SHELL_VAR *
-+get_seconds (var)
-+ SHELL_VAR *var;
-+{
-+ time_t time_since_start;
-+ char *p;
-+
-+ time_since_start = NOW - shell_start_time;
-+ p = itos(seconds_value_assigned + time_since_start);
-+
-+ FREE (value_cell (var));
-+
-+ VSETATTR (var, att_integer);
-+ var_setvalue (var, p);
-+ return (var);
-+}
-+
-+static SHELL_VAR *
-+init_seconds_var ()
-+{
-+ SHELL_VAR *v;
-+
-+ v = find_variable ("SECONDS");
-+ if (v)
-+ {
-+ if (legal_number (value_cell(v), &seconds_value_assigned) == 0)
-+ seconds_value_assigned = 0;
-+ }
-+ INIT_DYNAMIC_VAR ("SECONDS", (v ? value_cell (v) : (char *)NULL), get_seconds, assign_seconds);
-+ return v;
-+}
-+
-+/* The random number seed. You can change this by setting RANDOM. */
-+static unsigned long rseed = 1;
-+static int last_random_value;
-+static int seeded_subshell = 0;
-+
-+/* A linear congruential random number generator based on the example
-+ one in the ANSI C standard. This one isn't very good, but a more
-+ complicated one is overkill. */
-+
-+/* Returns a pseudo-random number between 0 and 32767. */
-+static int
-+brand ()
-+{
-+ /* From "Random number generators: good ones are hard to find",
-+ Park and Miller, Communications of the ACM, vol. 31, no. 10,
-+ October 1988, p. 1195. filtered through FreeBSD */
-+ long h, l;
-+
-+ /* Can't seed with 0. */
-+ if (rseed == 0)
-+ rseed = 123459876;
-+ h = rseed / 127773;
-+ l = rseed % 127773;
-+ rseed = 16807 * l - 2836 * h;
-+#if 0
-+ if (rseed < 0)
-+ rseed += 0x7fffffff;
-+#endif
-+ return ((unsigned int)(rseed & 32767)); /* was % 32768 */
-+}
-+
-+/* Set the random number generator seed to SEED. */
-+static void
-+sbrand (seed)
-+ unsigned long seed;
-+{
-+ rseed = seed;
-+ last_random_value = 0;
-+}
-+
-+static void
-+seedrand ()
-+{
-+ struct timeval tv;
-+
-+ gettimeofday (&tv, NULL);
-+ sbrand (tv.tv_sec ^ tv.tv_usec ^ getpid ());
-+}
-+
-+static SHELL_VAR *
-+assign_random (self, value, unused, key)
-+ SHELL_VAR *self;
-+ char *value;
-+ arrayind_t unused;
-+ char *key;
-+{
-+ sbrand (strtoul (value, (char **)NULL, 10));
-+ if (subshell_environment)
-+ seeded_subshell = getpid ();
-+ return (self);
-+}
-+
-+int
-+get_random_number ()
-+{
-+ int rv, pid;
-+
-+ /* Reset for command and process substitution. */
-+ pid = getpid ();
-+ if (subshell_environment && seeded_subshell != pid)
-+ {
-+ seedrand ();
-+ seeded_subshell = pid;
-+ }
-+
-+ do
-+ rv = brand ();
-+ while (rv == last_random_value);
-+ return rv;
-+}
-+
-+static SHELL_VAR *
-+get_random (var)
-+ SHELL_VAR *var;
-+{
-+ int rv;
-+ char *p;
-+
-+ rv = get_random_number ();
-+ last_random_value = rv;
-+ p = itos (rv);
-+
-+ FREE (value_cell (var));
-+
-+ VSETATTR (var, att_integer);
-+ var_setvalue (var, p);
-+ return (var);
-+}
-+
-+static SHELL_VAR *
-+assign_lineno (var, value, unused, key)
-+ SHELL_VAR *var;
-+ char *value;
-+ arrayind_t unused;
-+ char *key;
-+{
-+ intmax_t new_value;
-+
-+ if (value == 0 || *value == '\0' || legal_number (value, &new_value) == 0)
-+ new_value = 0;
-+ line_number = line_number_base = new_value;
-+ return var;
-+}
-+
-+/* Function which returns the current line number. */
-+static SHELL_VAR *
-+get_lineno (var)
-+ SHELL_VAR *var;
-+{
-+ char *p;
-+ int ln;
-+
-+ ln = executing_line_number ();
-+ p = itos (ln);
-+ FREE (value_cell (var));
-+ var_setvalue (var, p);
-+ return (var);
-+}
-+
-+static SHELL_VAR *
-+assign_subshell (var, value, unused, key)
-+ SHELL_VAR *var;
-+ char *value;
-+ arrayind_t unused;
-+ char *key;
-+{
-+ intmax_t new_value;
-+
-+ if (value == 0 || *value == '\0' || legal_number (value, &new_value) == 0)
-+ new_value = 0;
-+ subshell_level = new_value;
-+ return var;
-+}
-+
-+static SHELL_VAR *
-+get_subshell (var)
-+ SHELL_VAR *var;
-+{
-+ char *p;
-+
-+ p = itos (subshell_level);
-+ FREE (value_cell (var));
-+ var_setvalue (var, p);
-+ return (var);
-+}
-+
-+static SHELL_VAR *
-+get_bashpid (var)
-+ SHELL_VAR *var;
-+{
-+ int pid;
-+ char *p;
-+
-+ pid = getpid ();
-+ p = itos (pid);
-+
-+ FREE (value_cell (var));
-+ VSETATTR (var, att_integer|att_readonly);
-+ var_setvalue (var, p);
-+ return (var);
-+}
-+
-+static SHELL_VAR *
-+get_bash_command (var)
-+ SHELL_VAR *var;
-+{
-+ char *p;
-+
-+ if (the_printed_command_except_trap)
-+ p = savestring (the_printed_command_except_trap);
-+ else
-+ {
-+ p = (char *)xmalloc (1);
-+ p[0] = '\0';
-+ }
-+ FREE (value_cell (var));
-+ var_setvalue (var, p);
-+ return (var);
-+}
-+
-+#if defined (HISTORY)
-+static SHELL_VAR *
-+get_histcmd (var)
-+ SHELL_VAR *var;
-+{
-+ char *p;
-+
-+ p = itos (history_number ());
-+ FREE (value_cell (var));
-+ var_setvalue (var, p);
-+ return (var);
-+}
-+#endif
-+
-+#if defined (READLINE)
-+/* When this function returns, VAR->value points to malloced memory. */
-+static SHELL_VAR *
-+get_comp_wordbreaks (var)
-+ SHELL_VAR *var;
-+{
-+ /* If we don't have anything yet, assign a default value. */
-+ if (rl_completer_word_break_characters == 0 && bash_readline_initialized == 0)
-+ enable_hostname_completion (perform_hostname_completion);
-+
-+ FREE (value_cell (var));
-+ var_setvalue (var, savestring (rl_completer_word_break_characters));
-+
-+ return (var);
-+}
-+
-+/* When this function returns, rl_completer_word_break_characters points to
-+ malloced memory. */
-+static SHELL_VAR *
-+assign_comp_wordbreaks (self, value, unused, key)
-+ SHELL_VAR *self;
-+ char *value;
-+ arrayind_t unused;
-+ char *key;
-+{
-+ if (rl_completer_word_break_characters &&
-+ rl_completer_word_break_characters != rl_basic_word_break_characters)
-+ free (rl_completer_word_break_characters);
-+
-+ rl_completer_word_break_characters = savestring (value);
-+ return self;
-+}
-+#endif /* READLINE */
-+
-+#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS)
-+static SHELL_VAR *
-+assign_dirstack (self, value, ind, key)
-+ SHELL_VAR *self;
-+ char *value;
-+ arrayind_t ind;
-+ char *key;
-+{
-+ set_dirstack_element (ind, 1, value);
-+ return self;
-+}
-+
-+static SHELL_VAR *
-+get_dirstack (self)
-+ SHELL_VAR *self;
-+{
-+ ARRAY *a;
-+ WORD_LIST *l;
-+
-+ l = get_directory_stack (0);
-+ a = array_from_word_list (l);
-+ array_dispose (array_cell (self));
-+ dispose_words (l);
-+ var_setarray (self, a);
-+ return self;
-+}
-+#endif /* PUSHD AND POPD && ARRAY_VARS */
-+
-+#if defined (ARRAY_VARS)
-+/* We don't want to initialize the group set with a call to getgroups()
-+ unless we're asked to, but we only want to do it once. */
-+static SHELL_VAR *
-+get_groupset (self)
-+ SHELL_VAR *self;
-+{
-+ register int i;
-+ int ng;
-+ ARRAY *a;
-+ static char **group_set = (char **)NULL;
-+
-+ if (group_set == 0)
-+ {
-+ group_set = get_group_list (&ng);
-+ a = array_cell (self);
-+ for (i = 0; i < ng; i++)
-+ array_insert (a, i, group_set[i]);
-+ }
-+ return (self);
-+}
-+
-+static SHELL_VAR *
-+build_hashcmd (self)
-+ SHELL_VAR *self;
-+{
-+ HASH_TABLE *h;
-+ int i;
-+ char *k, *v;
-+ BUCKET_CONTENTS *item;
-+
-+ h = assoc_cell (self);
-+ if (h)
-+ assoc_dispose (h);
-+
-+ if (hashed_filenames == 0 || HASH_ENTRIES (hashed_filenames) == 0)
-+ {
-+ var_setvalue (self, (char *)NULL);
-+ return self;
-+ }
-+
-+ h = assoc_create (hashed_filenames->nbuckets);
-+ for (i = 0; i < hashed_filenames->nbuckets; i++)
-+ {
-+ for (item = hash_items (i, hashed_filenames); item; item = item->next)
-+ {
-+ k = savestring (item->key);
-+ v = pathdata(item)->path;
-+ assoc_insert (h, k, v);
-+ }
-+ }
-+
-+ var_setvalue (self, (char *)h);
-+ return self;
-+}
-+
-+static SHELL_VAR *
-+get_hashcmd (self)
-+ SHELL_VAR *self;
-+{
-+ build_hashcmd (self);
-+ return (self);
-+}
-+
-+static SHELL_VAR *
-+assign_hashcmd (self, value, ind, key)
-+ SHELL_VAR *self;
-+ char *value;
-+ arrayind_t ind;
-+ char *key;
-+{
-+ phash_insert (key, value, 0, 0);
-+ return (build_hashcmd (self));
-+}
-+
-+#if defined (ALIAS)
-+static SHELL_VAR *
-+build_aliasvar (self)
-+ SHELL_VAR *self;
-+{
-+ HASH_TABLE *h;
-+ int i;
-+ char *k, *v;
-+ BUCKET_CONTENTS *item;
-+
-+ h = assoc_cell (self);
-+ if (h)
-+ assoc_dispose (h);
-+
-+ if (aliases == 0 || HASH_ENTRIES (aliases) == 0)
-+ {
-+ var_setvalue (self, (char *)NULL);
-+ return self;
-+ }
-+
-+ h = assoc_create (aliases->nbuckets);
-+ for (i = 0; i < aliases->nbuckets; i++)
-+ {
-+ for (item = hash_items (i, aliases); item; item = item->next)
-+ {
-+ k = savestring (item->key);
-+ v = ((alias_t *)(item->data))->value;
-+ assoc_insert (h, k, v);
-+ }
-+ }
-+
-+ var_setvalue (self, (char *)h);
-+ return self;
-+}
-+
-+static SHELL_VAR *
-+get_aliasvar (self)
-+ SHELL_VAR *self;
-+{
-+ build_aliasvar (self);
-+ return (self);
-+}
-+
-+static SHELL_VAR *
-+assign_aliasvar (self, value, ind, key)
-+ SHELL_VAR *self;
-+ char *value;
-+ arrayind_t ind;
-+ char *key;
-+{
-+ add_alias (key, value);
-+ return (build_aliasvar (self));
-+}
-+#endif /* ALIAS */
-+
-+#endif /* ARRAY_VARS */
-+
-+/* If ARRAY_VARS is not defined, this just returns the name of any
-+ currently-executing function. If we have arrays, it's a call stack. */
-+static SHELL_VAR *
-+get_funcname (self)
-+ SHELL_VAR *self;
-+{
-+#if ! defined (ARRAY_VARS)
-+ char *t;
-+ if (variable_context && this_shell_function)
-+ {
-+ FREE (value_cell (self));
-+ t = savestring (this_shell_function->name);
-+ var_setvalue (self, t);
-+ }
-+#endif
-+ return (self);
-+}
-+
-+void
-+make_funcname_visible (on_or_off)
-+ int on_or_off;
-+{
-+ SHELL_VAR *v;
-+
-+ v = find_variable ("FUNCNAME");
-+ if (v == 0 || v->dynamic_value == 0)
-+ return;
-+
-+ if (on_or_off)
-+ VUNSETATTR (v, att_invisible);
-+ else
-+ VSETATTR (v, att_invisible);
-+}
-+
-+static SHELL_VAR *
-+init_funcname_var ()
-+{
-+ SHELL_VAR *v;
-+
-+ v = find_variable ("FUNCNAME");
-+ if (v)
-+ return v;
-+#if defined (ARRAY_VARS)
-+ INIT_DYNAMIC_ARRAY_VAR ("FUNCNAME", get_funcname, null_array_assign);
-+#else
-+ INIT_DYNAMIC_VAR ("FUNCNAME", (char *)NULL, get_funcname, null_assign);
-+#endif
-+ VSETATTR (v, att_invisible|att_noassign);
-+ return v;
-+}
-+
-+static void
-+initialize_dynamic_variables ()
-+{
-+ SHELL_VAR *v;
-+
-+ v = init_seconds_var ();
-+
-+ INIT_DYNAMIC_VAR ("BASH_COMMAND", (char *)NULL, get_bash_command, (sh_var_assign_func_t *)NULL);
-+ INIT_DYNAMIC_VAR ("BASH_SUBSHELL", (char *)NULL, get_subshell, assign_subshell);
-+
-+ INIT_DYNAMIC_VAR ("RANDOM", (char *)NULL, get_random, assign_random);
-+ VSETATTR (v, att_integer);
-+ INIT_DYNAMIC_VAR ("LINENO", (char *)NULL, get_lineno, assign_lineno);
-+ VSETATTR (v, att_integer);
-+
-+ INIT_DYNAMIC_VAR ("BASHPID", (char *)NULL, get_bashpid, null_assign);
-+ VSETATTR (v, att_integer|att_readonly);
-+
-+#if defined (HISTORY)
-+ INIT_DYNAMIC_VAR ("HISTCMD", (char *)NULL, get_histcmd, (sh_var_assign_func_t *)NULL);
-+ VSETATTR (v, att_integer);
-+#endif
-+
-+#if defined (READLINE)
-+ INIT_DYNAMIC_VAR ("COMP_WORDBREAKS", (char *)NULL, get_comp_wordbreaks, assign_comp_wordbreaks);
-+#endif
-+
-+#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS)
-+ v = init_dynamic_array_var ("DIRSTACK", get_dirstack, assign_dirstack, 0);
-+#endif /* PUSHD_AND_POPD && ARRAY_VARS */
-+
-+#if defined (ARRAY_VARS)
-+ v = init_dynamic_array_var ("GROUPS", get_groupset, null_array_assign, att_noassign);
-+
-+# if defined (DEBUGGER)
-+ v = init_dynamic_array_var ("BASH_ARGC", get_self, null_array_assign, att_noassign|att_nounset);
-+ v = init_dynamic_array_var ("BASH_ARGV", get_self, null_array_assign, att_noassign|att_nounset);
-+# endif /* DEBUGGER */
-+ v = init_dynamic_array_var ("BASH_SOURCE", get_self, null_array_assign, att_noassign|att_nounset);
-+ v = init_dynamic_array_var ("BASH_LINENO", get_self, null_array_assign, att_noassign|att_nounset);
-+
-+ v = init_dynamic_assoc_var ("BASH_CMDS", get_hashcmd, assign_hashcmd, att_nofree);
-+# if defined (ALIAS)
-+ v = init_dynamic_assoc_var ("BASH_ALIASES", get_aliasvar, assign_aliasvar, att_nofree);
-+# endif
-+#endif
-+
-+ v = init_funcname_var ();
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Retrieving variables and values */
-+/* */
-+/* **************************************************************** */
-+
-+/* How to get a pointer to the shell variable or function named NAME.
-+ HASHED_VARS is a pointer to the hash table containing the list
-+ of interest (either variables or functions). */
-+
-+static SHELL_VAR *
-+hash_lookup (name, hashed_vars)
-+ const char *name;
-+ HASH_TABLE *hashed_vars;
-+{
-+ BUCKET_CONTENTS *bucket;
-+
-+ bucket = hash_search (name, hashed_vars, 0);
-+ /* If we find the name in HASHED_VARS, set LAST_TABLE_SEARCHED to that
-+ table. */
-+ if (bucket)
-+ last_table_searched = hashed_vars;
-+ return (bucket ? (SHELL_VAR *)bucket->data : (SHELL_VAR *)NULL);
-+}
-+
-+SHELL_VAR *
-+var_lookup (name, vcontext)
-+ const char *name;
-+ VAR_CONTEXT *vcontext;
-+{
-+ VAR_CONTEXT *vc;
-+ SHELL_VAR *v;
-+
-+ v = (SHELL_VAR *)NULL;
-+ for (vc = vcontext; vc; vc = vc->down)
-+ if (v = hash_lookup (name, vc->table))
-+ break;
-+
-+ return v;
-+}
-+
-+/* Look up the variable entry named NAME. If SEARCH_TEMPENV is non-zero,
-+ then also search the temporarily built list of exported variables.
-+ The lookup order is:
-+ temporary_env
-+ shell_variables list
-+*/
-+
-+SHELL_VAR *
-+find_variable_internal (name, force_tempenv)
-+ const char *name;
-+ int force_tempenv;
-+{
-+ SHELL_VAR *var;
-+ int search_tempenv;
-+ VAR_CONTEXT *vc;
-+
-+ var = (SHELL_VAR *)NULL;
-+
-+ /* If explicitly requested, first look in the temporary environment for
-+ the variable. This allows constructs such as "foo=x eval 'echo $foo'"
-+ to get the `exported' value of $foo. This happens if we are executing
-+ a function or builtin, or if we are looking up a variable in a
-+ "subshell environment". */
-+ search_tempenv = force_tempenv || (expanding_redir == 0 && subshell_environment);
-+
-+ if (search_tempenv && temporary_env)
-+ var = hash_lookup (name, temporary_env);
-+
-+ vc = shell_variables;
-+#if 0
-+if (search_tempenv == 0 && /* (subshell_environment & SUBSHELL_COMSUB) && */
-+ expanding_redir &&
-+ (this_shell_builtin == eval_builtin || this_shell_builtin == command_builtin))
-+ {
-+ itrace("find_variable_internal: search_tempenv == 0: skipping VC_BLTNENV");
-+ while (vc && (vc->flags & VC_BLTNENV))
-+ vc = vc->down;
-+ if (vc == 0)
-+ vc = shell_variables;
-+ }
-+#endif
-+
-+ if (var == 0)
-+ var = var_lookup (name, vc);
-+
-+ if (var == 0)
-+ return ((SHELL_VAR *)NULL);
-+
-+ return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
-+}
-+
-+/* Look up and resolve the chain of nameref variables starting at V all the
-+ way to NULL or non-nameref. */
-+SHELL_VAR *
-+find_variable_nameref (v)
-+ SHELL_VAR *v;
-+{
-+ int level;
-+ char *newname;
-+ SHELL_VAR *orig, *oldv;
-+
-+ level = 0;
-+ orig = v;
-+ while (v && nameref_p (v))
-+ {
-+ level++;
-+ if (level > NAMEREF_MAX)
-+ return ((SHELL_VAR *)0); /* error message here? */
-+ newname = nameref_cell (v);
-+ if (newname == 0 || *newname == '\0')
-+ return ((SHELL_VAR *)0);
-+ oldv = v;
-+ v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin)));
-+ if (v == orig || v == oldv)
-+ {
-+ internal_warning (_("%s: circular name reference"), orig->name);
-+ return ((SHELL_VAR *)0);
-+ }
-+ }
-+ return v;
-+}
-+
-+/* Resolve the chain of nameref variables for NAME. XXX - could change later */
-+SHELL_VAR *
-+find_variable_last_nameref (name)
-+ const char *name;
-+{
-+ SHELL_VAR *v, *nv;
-+ char *newname;
-+ int level;
-+
-+ nv = v = find_variable_noref (name);
-+ level = 0;
-+ while (v && nameref_p (v))
-+ {
-+ level++;
-+ if (level > NAMEREF_MAX)
-+ return ((SHELL_VAR *)0); /* error message here? */
-+ newname = nameref_cell (v);
-+ if (newname == 0 || *newname == '\0')
-+ return ((SHELL_VAR *)0);
-+ nv = v;
-+ v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin)));
-+ }
-+ return nv;
-+}
-+
-+/* Resolve the chain of nameref variables for NAME. XXX - could change later */
-+SHELL_VAR *
-+find_global_variable_last_nameref (name)
-+ const char *name;
-+{
-+ SHELL_VAR *v, *nv;
-+ char *newname;
-+ int level;
-+
-+ nv = v = find_global_variable_noref (name);
-+ level = 0;
-+ while (v && nameref_p (v))
-+ {
-+ level++;
-+ if (level > NAMEREF_MAX)
-+ return ((SHELL_VAR *)0); /* error message here? */
-+ newname = nameref_cell (v);
-+ if (newname == 0 || *newname == '\0')
-+ return ((SHELL_VAR *)0);
-+ nv = v;
-+ v = find_global_variable_noref (newname);
-+ }
-+ return nv;
-+}
-+
-+static SHELL_VAR *
-+find_nameref_at_context (v, vc)
-+ SHELL_VAR *v;
-+ VAR_CONTEXT *vc;
-+{
-+ SHELL_VAR *nv, *nv2;
-+ VAR_CONTEXT *nvc;
-+ char *newname;
-+ int level;
-+
-+ nv = v;
-+ level = 1;
-+ while (nv && nameref_p (nv))
-+ {
-+ level++;
-+ if (level > NAMEREF_MAX)
-+ return ((SHELL_VAR *)NULL);
-+ newname = nameref_cell (nv);
-+ if (newname == 0 || *newname == '\0')
-+ return ((SHELL_VAR *)NULL);
-+ nv2 = hash_lookup (newname, vc->table);
-+ if (nv2 == 0)
-+ break;
-+ nv = nv2;
-+ }
-+ return nv;
-+}
-+
-+/* Do nameref resolution from the VC, which is the local context for some
-+ function or builtin, `up' the chain to the global variables context. If
-+ NVCP is not NULL, return the variable context where we finally ended the
-+ nameref resolution (so the bind_variable_internal can use the correct
-+ variable context and hash table). */
-+static SHELL_VAR *
-+find_variable_nameref_context (v, vc, nvcp)
-+ SHELL_VAR *v;
-+ VAR_CONTEXT *vc;
-+ VAR_CONTEXT **nvcp;
-+{
-+ SHELL_VAR *nv, *nv2;
-+ VAR_CONTEXT *nvc;
-+
-+ /* Look starting at the current context all the way `up' */
-+ for (nv = v, nvc = vc; nvc; nvc = nvc->down)
-+ {
-+ nv2 = find_nameref_at_context (nv, nvc);
-+ if (nv2 == 0)
-+ continue;
-+ nv = nv2;
-+ if (*nvcp)
-+ *nvcp = nvc;
-+ if (nameref_p (nv) == 0)
-+ break;
-+ }
-+ return (nameref_p (nv) ? (SHELL_VAR *)NULL : nv);
-+}
-+
-+/* Do nameref resolution from the VC, which is the local context for some
-+ function or builtin, `up' the chain to the global variables context. If
-+ NVCP is not NULL, return the variable context where we finally ended the
-+ nameref resolution (so the bind_variable_internal can use the correct
-+ variable context and hash table). */
-+static SHELL_VAR *
-+find_variable_last_nameref_context (v, vc, nvcp)
-+ SHELL_VAR *v;
-+ VAR_CONTEXT *vc;
-+ VAR_CONTEXT **nvcp;
-+{
-+ SHELL_VAR *nv, *nv2;
-+ VAR_CONTEXT *nvc;
-+
-+ /* Look starting at the current context all the way `up' */
-+ for (nv = v, nvc = vc; nvc; nvc = nvc->down)
-+ {
-+ nv2 = find_nameref_at_context (nv, nvc);
-+ if (nv2 == 0)
-+ continue;
-+ nv = nv2;
-+ if (*nvcp)
-+ *nvcp = nvc;
-+ }
-+ return (nameref_p (nv) ? nv : (SHELL_VAR *)NULL);
-+}
-+
-+/* Find a variable, forcing a search of the temporary environment first */
-+SHELL_VAR *
-+find_variable_tempenv (name)
-+ const char *name;
-+{
-+ SHELL_VAR *var;
-+
-+ var = find_variable_internal (name, 1);
-+ if (var && nameref_p (var))
-+ var = find_variable_nameref (var);
-+ return (var);
-+}
-+
-+/* Find a variable, not forcing a search of the temporary environment first */
-+SHELL_VAR *
-+find_variable_notempenv (name)
-+ const char *name;
-+{
-+ SHELL_VAR *var;
-+
-+ var = find_variable_internal (name, 0);
-+ if (var && nameref_p (var))
-+ var = find_variable_nameref (var);
-+ return (var);
-+}
-+
-+SHELL_VAR *
-+find_global_variable (name)
-+ const char *name;
-+{
-+ SHELL_VAR *var;
-+
-+ var = var_lookup (name, global_variables);
-+ if (var && nameref_p (var))
-+ var = find_variable_nameref (var);
-+
-+ if (var == 0)
-+ return ((SHELL_VAR *)NULL);
-+
-+ return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
-+}
-+
-+SHELL_VAR *
-+find_global_variable_noref (name)
-+ const char *name;
-+{
-+ SHELL_VAR *var;
-+
-+ var = var_lookup (name, global_variables);
-+
-+ if (var == 0)
-+ return ((SHELL_VAR *)NULL);
-+
-+ return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
-+}
-+
-+SHELL_VAR *
-+find_shell_variable (name)
-+ const char *name;
-+{
-+ SHELL_VAR *var;
-+
-+ var = var_lookup (name, shell_variables);
-+ if (var && nameref_p (var))
-+ var = find_variable_nameref (var);
-+
-+ if (var == 0)
-+ return ((SHELL_VAR *)NULL);
-+
-+ return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
-+}
-+
-+/* Look up the variable entry named NAME. Returns the entry or NULL. */
-+SHELL_VAR *
-+find_variable (name)
-+ const char *name;
-+{
-+ SHELL_VAR *v;
-+
-+ last_table_searched = 0;
-+ v = find_variable_internal (name, (expanding_redir == 0 && (assigning_in_environment || executing_builtin)));
-+ if (v && nameref_p (v))
-+ v = find_variable_nameref (v);
-+ return v;
-+}
-+
-+SHELL_VAR *
-+find_variable_noref (name)
-+ const char *name;
-+{
-+ SHELL_VAR *v;
-+
-+ v = find_variable_internal (name, (expanding_redir == 0 && (assigning_in_environment || executing_builtin)));
-+ return v;
-+}
-+
-+/* Look up the function entry whose name matches STRING.
-+ Returns the entry or NULL. */
-+SHELL_VAR *
-+find_function (name)
-+ const char *name;
-+{
-+ return (hash_lookup (name, shell_functions));
-+}
-+
-+/* Find the function definition for the shell function named NAME. Returns
-+ the entry or NULL. */
-+FUNCTION_DEF *
-+find_function_def (name)
-+ const char *name;
-+{
-+#if defined (DEBUGGER)
-+ return ((FUNCTION_DEF *)hash_lookup (name, shell_function_defs));
-+#else
-+ return ((FUNCTION_DEF *)0);
-+#endif
-+}
-+
-+/* Return the value of VAR. VAR is assumed to have been the result of a
-+ lookup without any subscript, if arrays are compiled into the shell. */
-+char *
-+get_variable_value (var)
-+ SHELL_VAR *var;
-+{
-+ if (var == 0)
-+ return ((char *)NULL);
-+#if defined (ARRAY_VARS)
-+ else if (array_p (var))
-+ return (array_reference (array_cell (var), 0));
-+ else if (assoc_p (var))
-+ return (assoc_reference (assoc_cell (var), "0"));
-+#endif
-+ else
-+ return (value_cell (var));
-+}
-+
-+/* Return the string value of a variable. Return NULL if the variable
-+ doesn't exist. Don't cons a new string. This is a potential memory
-+ leak if the variable is found in the temporary environment. Since
-+ functions and variables have separate name spaces, returns NULL if
-+ var_name is a shell function only. */
-+char *
-+get_string_value (var_name)
-+ const char *var_name;
-+{
-+ SHELL_VAR *var;
-+
-+ var = find_variable (var_name);
-+ return ((var) ? get_variable_value (var) : (char *)NULL);
-+}
-+
-+/* This is present for use by the tilde and readline libraries. */
-+char *
-+sh_get_env_value (v)
-+ const char *v;
-+{
-+ return get_string_value (v);
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Creating and setting variables */
-+/* */
-+/* **************************************************************** */
-+
-+/* Set NAME to VALUE if NAME has no value. */
-+SHELL_VAR *
-+set_if_not (name, value)
-+ char *name, *value;
-+{
-+ SHELL_VAR *v;
-+
-+ if (shell_variables == 0)
-+ create_variable_tables ();
-+
-+ v = find_variable (name);
-+ if (v == 0)
-+ v = bind_variable_internal (name, value, global_variables->table, HASH_NOSRCH, 0);
-+ return (v);
-+}
-+
-+/* Create a local variable referenced by NAME. */
-+SHELL_VAR *
-+make_local_variable (name)
-+ const char *name;
-+{
-+ SHELL_VAR *new_var, *old_var;
-+ VAR_CONTEXT *vc;
-+ int was_tmpvar;
-+ char *tmp_value;
-+
-+ /* local foo; local foo; is a no-op. */
-+ old_var = find_variable (name);
-+ if (old_var && local_p (old_var) && old_var->context == variable_context)
-+ return (old_var);
-+
-+ was_tmpvar = old_var && tempvar_p (old_var);
-+ /* If we're making a local variable in a shell function, the temporary env
-+ has already been merged into the function's variable context stack. We
-+ can assume that a temporary var in the same context appears in the same
-+ VAR_CONTEXT and can safely be returned without creating a new variable
-+ (which results in duplicate names in the same VAR_CONTEXT->table */
-+ /* We can't just test tmpvar_p because variables in the temporary env given
-+ to a shell function appear in the function's local variable VAR_CONTEXT
-+ but retain their tempvar attribute. We want temporary variables that are
-+ found in temporary_env, hence the test for last_table_searched, which is
-+ set in hash_lookup and only (so far) checked here. */
-+ if (was_tmpvar && old_var->context == variable_context && last_table_searched != temporary_env)
-+ {
-+ VUNSETATTR (old_var, att_invisible);
-+ return (old_var);
-+ }
-+ if (was_tmpvar)
-+ tmp_value = value_cell (old_var);
-+
-+ for (vc = shell_variables; vc; vc = vc->down)
-+ if (vc_isfuncenv (vc) && vc->scope == variable_context)
-+ break;
-+
-+ if (vc == 0)
-+ {
-+ internal_error (_("make_local_variable: no function context at current scope"));
-+ return ((SHELL_VAR *)NULL);
-+ }
-+ else if (vc->table == 0)
-+ vc->table = hash_create (TEMPENV_HASH_BUCKETS);
-+
-+ /* Since this is called only from the local/declare/typeset code, we can
-+ call builtin_error here without worry (of course, it will also work
-+ for anything that sets this_command_name). Variables with the `noassign'
-+ attribute may not be made local. The test against old_var's context
-+ level is to disallow local copies of readonly global variables (since I
-+ believe that this could be a security hole). Readonly copies of calling
-+ function local variables are OK. */
-+ if (old_var && (noassign_p (old_var) ||
-+ (readonly_p (old_var) && old_var->context == 0)))
-+ {
-+ if (readonly_p (old_var))
-+ sh_readonly (name);
-+ else if (noassign_p (old_var))
-+ builtin_error (_("%s: variable may not be assigned value"), name);
-+#if 0
-+ /* Let noassign variables through with a warning */
-+ if (readonly_p (old_var))
-+#endif
-+ return ((SHELL_VAR *)NULL);
-+ }
-+
-+ if (old_var == 0)
-+ new_var = make_new_variable (name, vc->table);
-+ else
-+ {
-+ new_var = make_new_variable (name, vc->table);
-+
-+ /* If we found this variable in one of the temporary environments,
-+ inherit its value. Watch to see if this causes problems with
-+ things like `x=4 local x'. XXX - see above for temporary env
-+ variables with the same context level as variable_context */
-+ /* XXX - we should only do this if the variable is not an array. */
-+ if (was_tmpvar)
-+ var_setvalue (new_var, savestring (tmp_value));
-+
-+ new_var->attributes = exported_p (old_var) ? att_exported : 0;
-+ }
-+
-+ vc->flags |= VC_HASLOCAL;
-+
-+ new_var->context = variable_context;
-+ VSETATTR (new_var, att_local);
-+
-+ if (ifsname (name))
-+ setifs (new_var);
-+
-+ if (was_tmpvar == 0)
-+ VSETATTR (new_var, att_invisible); /* XXX */
-+ return (new_var);
-+}
-+
-+/* Create a new shell variable with name NAME. */
-+static SHELL_VAR *
-+new_shell_variable (name)
-+ const char *name;
-+{
-+ SHELL_VAR *entry;
-+
-+ entry = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR));
-+
-+ entry->name = savestring (name);
-+ var_setvalue (entry, (char *)NULL);
-+ CLEAR_EXPORTSTR (entry);
-+
-+ entry->dynamic_value = (sh_var_value_func_t *)NULL;
-+ entry->assign_func = (sh_var_assign_func_t *)NULL;
-+
-+ entry->attributes = 0;
-+
-+ /* Always assume variables are to be made at toplevel!
-+ make_local_variable has the responsibility of changing the
-+ variable context. */
-+ entry->context = 0;
-+
-+ return (entry);
-+}
-+
-+/* Create a new shell variable with name NAME and add it to the hash table
-+ TABLE. */
-+static SHELL_VAR *
-+make_new_variable (name, table)
-+ const char *name;
-+ HASH_TABLE *table;
-+{
-+ SHELL_VAR *entry;
-+ BUCKET_CONTENTS *elt;
-+
-+ entry = new_shell_variable (name);
-+
-+ /* Make sure we have a shell_variables hash table to add to. */
-+ if (shell_variables == 0)
-+ create_variable_tables ();
-+
-+ elt = hash_insert (savestring (name), table, HASH_NOSRCH);
-+ elt->data = (PTR_T)entry;
-+
-+ return entry;
-+}
-+
-+#if defined (ARRAY_VARS)
-+SHELL_VAR *
-+make_new_array_variable (name)
-+ char *name;
-+{
-+ SHELL_VAR *entry;
-+ ARRAY *array;
-+
-+ entry = make_new_variable (name, global_variables->table);
-+ array = array_create ();
-+
-+ var_setarray (entry, array);
-+ VSETATTR (entry, att_array);
-+ return entry;
-+}
-+
-+SHELL_VAR *
-+make_local_array_variable (name, assoc_ok)
-+ char *name;
-+ int assoc_ok;
-+{
-+ SHELL_VAR *var;
-+ ARRAY *array;
-+
-+ var = make_local_variable (name);
-+ if (var == 0 || array_p (var) || (assoc_ok && assoc_p (var)))
-+ return var;
-+
-+ array = array_create ();
-+
-+ dispose_variable_value (var);
-+ var_setarray (var, array);
-+ VSETATTR (var, att_array);
-+ return var;
-+}
-+
-+SHELL_VAR *
-+make_new_assoc_variable (name)
-+ char *name;
-+{
-+ SHELL_VAR *entry;
-+ HASH_TABLE *hash;
-+
-+ entry = make_new_variable (name, global_variables->table);
-+ hash = assoc_create (0);
-+
-+ var_setassoc (entry, hash);
-+ VSETATTR (entry, att_assoc);
-+ return entry;
-+}
-+
-+SHELL_VAR *
-+make_local_assoc_variable (name)
-+ char *name;
-+{
-+ SHELL_VAR *var;
-+ HASH_TABLE *hash;
-+
-+ var = make_local_variable (name);
-+ if (var == 0 || assoc_p (var))
-+ return var;
-+
-+ dispose_variable_value (var);
-+ hash = assoc_create (0);
-+
-+ var_setassoc (var, hash);
-+ VSETATTR (var, att_assoc);
-+ return var;
-+}
-+#endif
-+
-+char *
-+make_variable_value (var, value, flags)
-+ SHELL_VAR *var;
-+ char *value;
-+ int flags;
-+{
-+ char *retval, *oval;
-+ intmax_t lval, rval;
-+ int expok, olen, op;
-+
-+ /* If this variable has had its type set to integer (via `declare -i'),
-+ then do expression evaluation on it and store the result. The
-+ functions in expr.c (evalexp()) and bind_int_variable() are responsible
-+ for turning off the integer flag if they don't want further
-+ evaluation done. */
-+ if (integer_p (var))
-+ {
-+ if (flags & ASS_APPEND)
-+ {
-+ oval = value_cell (var);
-+ lval = evalexp (oval, &expok); /* ksh93 seems to do this */
-+ if (expok == 0)
-+ {
-+ top_level_cleanup ();
-+ jump_to_top_level (DISCARD);
-+ }
-+ }
-+ rval = evalexp (value, &expok);
-+ if (expok == 0)
-+ {
-+ top_level_cleanup ();
-+ jump_to_top_level (DISCARD);
-+ }
-+ /* This can be fooled if the variable's value changes while evaluating
-+ `rval'. We can change it if we move the evaluation of lval to here. */
-+ if (flags & ASS_APPEND)
-+ rval += lval;
-+ retval = itos (rval);
-+ }
-+#if defined (CASEMOD_ATTRS)
-+ else if (capcase_p (var) || uppercase_p (var) || lowercase_p (var))
-+ {
-+ if (flags & ASS_APPEND)
-+ {
-+ oval = get_variable_value (var);
-+ if (oval == 0) /* paranoia */
-+ oval = "";
-+ olen = STRLEN (oval);
-+ retval = (char *)xmalloc (olen + (value ? STRLEN (value) : 0) + 1);
-+ strcpy (retval, oval);
-+ if (value)
-+ strcpy (retval+olen, value);
-+ }
-+ else if (*value)
-+ retval = savestring (value);
-+ else
-+ {
-+ retval = (char *)xmalloc (1);
-+ retval[0] = '\0';
-+ }
-+ op = capcase_p (var) ? CASE_CAPITALIZE
-+ : (uppercase_p (var) ? CASE_UPPER : CASE_LOWER);
-+ oval = sh_modcase (retval, (char *)0, op);
-+ free (retval);
-+ retval = oval;
-+ }
-+#endif /* CASEMOD_ATTRS */
-+ else if (value)
-+ {
-+ if (flags & ASS_APPEND)
-+ {
-+ oval = get_variable_value (var);
-+ if (oval == 0) /* paranoia */
-+ oval = "";
-+ olen = STRLEN (oval);
-+ retval = (char *)xmalloc (olen + (value ? STRLEN (value) : 0) + 1);
-+ strcpy (retval, oval);
-+ if (value)
-+ strcpy (retval+olen, value);
-+ }
-+ else if (*value)
-+ retval = savestring (value);
-+ else
-+ {
-+ retval = (char *)xmalloc (1);
-+ retval[0] = '\0';
-+ }
-+ }
-+ else
-+ retval = (char *)NULL;
-+
-+ return retval;
-+}
-+
-+/* Bind a variable NAME to VALUE in the HASH_TABLE TABLE, which may be the
-+ temporary environment (but usually is not). */
-+static SHELL_VAR *
-+bind_variable_internal (name, value, table, hflags, aflags)
-+ const char *name;
-+ char *value;
-+ HASH_TABLE *table;
-+ int hflags, aflags;
-+{
-+ char *newval;
-+ SHELL_VAR *entry;
-+
-+ entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table);
-+ /* Follow the nameref chain here if this is the global variables table */
-+ if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table)
-+ {
-+ entry = find_global_variable (entry->name);
-+ /* Let's see if we have a nameref referencing a variable that hasn't yet
-+ been created. */
-+ if (entry == 0)
-+ entry = find_variable_last_nameref (name); /* XXX */
-+ if (entry == 0) /* just in case */
-+ return (entry);
-+ }
-+
-+ /* The first clause handles `declare -n ref; ref=x;' */
-+ if (entry && invisible_p (entry) && nameref_p (entry))
-+ goto assign_value;
-+ else if (entry && nameref_p (entry))
-+ {
-+ newval = nameref_cell (entry);
-+#if defined (ARRAY_VARS)
-+ /* declare -n foo=x[2] */
-+ if (valid_array_reference (newval))
-+ /* XXX - should it be aflags? */
-+ entry = assign_array_element (newval, make_variable_value (entry, value, 0), aflags);
-+ else
-+#endif
-+ {
-+ entry = make_new_variable (newval, table);
-+ var_setvalue (entry, make_variable_value (entry, value, 0));
-+ }
-+ }
-+ else if (entry == 0)
-+ {
-+ entry = make_new_variable (name, table);
-+ var_setvalue (entry, make_variable_value (entry, value, 0)); /* XXX */
-+ }
-+ else if (entry->assign_func) /* array vars have assign functions now */
-+ {
-+ INVALIDATE_EXPORTSTR (entry);
-+ newval = (aflags & ASS_APPEND) ? make_variable_value (entry, value, aflags) : value;
-+ if (assoc_p (entry))
-+ entry = (*(entry->assign_func)) (entry, newval, -1, savestring ("0"));
-+ else if (array_p (entry))
-+ entry = (*(entry->assign_func)) (entry, newval, 0, 0);
-+ else
-+ entry = (*(entry->assign_func)) (entry, newval, -1, 0);
-+ if (newval != value)
-+ free (newval);
-+ return (entry);
-+ }
-+ else
-+ {
-+assign_value:
-+ if (readonly_p (entry) || noassign_p (entry))
-+ {
-+ if (readonly_p (entry))
-+ err_readonly (name);
-+ return (entry);
-+ }
-+
-+ /* Variables which are bound are visible. */
-+ VUNSETATTR (entry, att_invisible);
-+
-+#if defined (ARRAY_VARS)
-+ if (assoc_p (entry) || array_p (entry))
-+ newval = make_array_variable_value (entry, 0, "0", value, aflags);
-+ else
-+#endif
-+
-+ newval = make_variable_value (entry, value, aflags); /* XXX */
-+
-+ /* Invalidate any cached export string */
-+ INVALIDATE_EXPORTSTR (entry);
-+
-+#if defined (ARRAY_VARS)
-+ /* XXX -- this bears looking at again -- XXX */
-+ /* If an existing array variable x is being assigned to with x=b or
-+ `read x' or something of that nature, silently convert it to
-+ x[0]=b or `read x[0]'. */
-+ if (assoc_p (entry))
-+ {
-+ assoc_insert (assoc_cell (entry), savestring ("0"), newval);
-+ free (newval);
-+ }
-+ else if (array_p (entry))
-+ {
-+ array_insert (array_cell (entry), 0, newval);
-+ free (newval);
-+ }
-+ else
-+#endif
-+ {
-+ FREE (value_cell (entry));
-+ var_setvalue (entry, newval);
-+ }
-+ }
-+
-+ if (mark_modified_vars)
-+ VSETATTR (entry, att_exported);
-+
-+ if (exported_p (entry))
-+ array_needs_making = 1;
-+
-+ return (entry);
-+}
-+
-+/* Bind a variable NAME to VALUE. This conses up the name
-+ and value strings. If we have a temporary environment, we bind there
-+ first, then we bind into shell_variables. */
-+
-+SHELL_VAR *
-+bind_variable (name, value, flags)
-+ const char *name;
-+ char *value;
-+ int flags;
-+{
-+ SHELL_VAR *v, *nv;
-+ VAR_CONTEXT *vc, *nvc;
-+ int level;
-+
-+ if (shell_variables == 0)
-+ create_variable_tables ();
-+
-+ /* If we have a temporary environment, look there first for the variable,
-+ and, if found, modify the value there before modifying it in the
-+ shell_variables table. This allows sourced scripts to modify values
-+ given to them in a temporary environment while modifying the variable
-+ value that the caller sees. */
-+ if (temporary_env)
-+ bind_tempenv_variable (name, value);
-+
-+ /* XXX -- handle local variables here. */
-+ for (vc = shell_variables; vc; vc = vc->down)
-+ {
-+ if (vc_isfuncenv (vc) || vc_isbltnenv (vc))
-+ {
-+ v = hash_lookup (name, vc->table);
-+ nvc = vc;
-+ if (v && nameref_p (v))
-+ {
-+ nv = find_variable_nameref_context (v, vc, &nvc);
-+ if (nv == 0)
-+ {
-+ nv = find_variable_last_nameref_context (v, vc, &nvc);
-+ if (nv && nameref_p (nv))
-+ {
-+ /* If this nameref variable doesn't have a value yet,
-+ set the value. Otherwise, assign using the value as
-+ normal. */
-+ if (nameref_cell (nv) == 0)
-+ return (bind_variable_internal (nv->name, value, nvc->table, 0, flags));
-+ return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags));
-+ }
-+ else
-+ v = nv;
-+ }
-+ else
-+ v = nv;
-+ }
-+ if (v)
-+ return (bind_variable_internal (v->name, value, nvc->table, 0, flags));
-+ }
-+ }
-+ /* bind_variable_internal will handle nameref resolution in this case */
-+ return (bind_variable_internal (name, value, global_variables->table, 0, flags));
-+}
-+
-+SHELL_VAR *
-+bind_global_variable (name, value, flags)
-+ const char *name;
-+ char *value;
-+ int flags;
-+{
-+ SHELL_VAR *v, *nv;
-+ VAR_CONTEXT *vc, *nvc;
-+ int level;
-+
-+ if (shell_variables == 0)
-+ create_variable_tables ();
-+
-+ /* bind_variable_internal will handle nameref resolution in this case */
-+ return (bind_variable_internal (name, value, global_variables->table, 0, flags));
-+}
-+
-+/* Make VAR, a simple shell variable, have value VALUE. Once assigned a
-+ value, variables are no longer invisible. This is a duplicate of part
-+ of the internals of bind_variable. If the variable is exported, or
-+ all modified variables should be exported, mark the variable for export
-+ and note that the export environment needs to be recreated. */
-+SHELL_VAR *
-+bind_variable_value (var, value, aflags)
-+ SHELL_VAR *var;
-+ char *value;
-+ int aflags;
-+{
-+ char *t;
-+ int invis;
-+
-+ invis = invisible_p (var);
-+ VUNSETATTR (var, att_invisible);
-+
-+ if (var->assign_func)
-+ {
-+ /* If we're appending, we need the old value, so use
-+ make_variable_value */
-+ t = (aflags & ASS_APPEND) ? make_variable_value (var, value, aflags) : value;
-+ (*(var->assign_func)) (var, t, -1, 0);
-+ if (t != value && t)
-+ free (t);
-+ }
-+ else
-+ {
-+ t = make_variable_value (var, value, aflags);
-+#if defined (ARRAY_VARS)
-+ if ((aflags & ASS_NAMEREF) && (t == 0 || *t == 0 || (legal_identifier (t) == 0 && valid_array_reference (t) == 0)))
-+#else
-+ if ((aflags & ASS_NAMEREF) && (t == 0 || *t == 0 || legal_identifier (t) == 0))
-+#endif
-+ {
-+ free (t);
-+ if (invis)
-+ VSETATTR (var, att_invisible); /* XXX */
-+ return ((SHELL_VAR *)NULL);
-+ }
-+ FREE (value_cell (var));
-+ var_setvalue (var, t);
-+ }
-+
-+ INVALIDATE_EXPORTSTR (var);
-+
-+ if (mark_modified_vars)
-+ VSETATTR (var, att_exported);
-+
-+ if (exported_p (var))
-+ array_needs_making = 1;
-+
-+ return (var);
-+}
-+
-+/* Bind/create a shell variable with the name LHS to the RHS.
-+ This creates or modifies a variable such that it is an integer.
-+
-+ This used to be in expr.c, but it is here so that all of the
-+ variable binding stuff is localized. Since we don't want any
-+ recursive evaluation from bind_variable() (possible without this code,
-+ since bind_variable() calls the evaluator for variables with the integer
-+ attribute set), we temporarily turn off the integer attribute for each
-+ variable we set here, then turn it back on after binding as necessary. */
-+
-+SHELL_VAR *
-+bind_int_variable (lhs, rhs)
-+ char *lhs, *rhs;
-+{
-+ register SHELL_VAR *v;
-+ int isint, isarr, implicitarray;
-+
-+ isint = isarr = implicitarray = 0;
-+#if defined (ARRAY_VARS)
-+ if (valid_array_reference (lhs))
-+ {
-+ isarr = 1;
-+ v = array_variable_part (lhs, (char **)0, (int *)0);
-+ }
-+ else
-+#endif
-+ v = find_variable (lhs);
-+
-+ if (v)
-+ {
-+ isint = integer_p (v);
-+ VUNSETATTR (v, att_integer);
-+#if defined (ARRAY_VARS)
-+ if (array_p (v) && isarr == 0)
-+ implicitarray = 1;
-+#endif
-+ }
-+
-+#if defined (ARRAY_VARS)
-+ if (isarr)
-+ v = assign_array_element (lhs, rhs, 0);
-+ else if (implicitarray)
-+ v = bind_array_variable (lhs, 0, rhs, 0);
-+ else
-+#endif
-+ v = bind_variable (lhs, rhs, 0);
-+
-+ if (v && isint)
-+ VSETATTR (v, att_integer);
-+
-+ VUNSETATTR (v, att_invisible);
-+
-+ return (v);
-+}
-+
-+SHELL_VAR *
-+bind_var_to_int (var, val)
-+ char *var;
-+ intmax_t val;
-+{
-+ char ibuf[INT_STRLEN_BOUND (intmax_t) + 1], *p;
-+
-+ p = fmtulong (val, 10, ibuf, sizeof (ibuf), 0);
-+ return (bind_int_variable (var, p));
-+}
-+
-+/* Do a function binding to a variable. You pass the name and
-+ the command to bind to. This conses the name and command. */
-+SHELL_VAR *
-+bind_function (name, value)
-+ const char *name;
-+ COMMAND *value;
-+{
-+ SHELL_VAR *entry;
-+
-+ entry = find_function (name);
-+ if (entry == 0)
-+ {
-+ BUCKET_CONTENTS *elt;
-+
-+ elt = hash_insert (savestring (name), shell_functions, HASH_NOSRCH);
-+ entry = new_shell_variable (name);
-+ elt->data = (PTR_T)entry;
-+ }
-+ else
-+ INVALIDATE_EXPORTSTR (entry);
-+
-+ if (var_isset (entry))
-+ dispose_command (function_cell (entry));
-+
-+ if (value)
-+ var_setfunc (entry, copy_command (value));
-+ else
-+ var_setfunc (entry, 0);
-+
-+ VSETATTR (entry, att_function);
-+
-+ if (mark_modified_vars)
-+ VSETATTR (entry, att_exported);
-+
-+ VUNSETATTR (entry, att_invisible); /* Just to be sure */
-+
-+ if (exported_p (entry))
-+ array_needs_making = 1;
-+
-+#if defined (PROGRAMMABLE_COMPLETION)
-+ set_itemlist_dirty (&it_functions);
-+#endif
-+
-+ return (entry);
-+}
-+
-+#if defined (DEBUGGER)
-+/* Bind a function definition, which includes source file and line number
-+ information in addition to the command, into the FUNCTION_DEF hash table.*/
-+void
-+bind_function_def (name, value)
-+ const char *name;
-+ FUNCTION_DEF *value;
-+{
-+ FUNCTION_DEF *entry;
-+ BUCKET_CONTENTS *elt;
-+ COMMAND *cmd;
-+
-+ entry = find_function_def (name);
-+ if (entry)
-+ {
-+ dispose_function_def_contents (entry);
-+ entry = copy_function_def_contents (value, entry);
-+ }
-+ else
-+ {
-+ cmd = value->command;
-+ value->command = 0;
-+ entry = copy_function_def (value);
-+ value->command = cmd;
-+
-+ elt = hash_insert (savestring (name), shell_function_defs, HASH_NOSRCH);
-+ elt->data = (PTR_T *)entry;
-+ }
-+}
-+#endif /* DEBUGGER */
-+
-+/* Add STRING, which is of the form foo=bar, to the temporary environment
-+ HASH_TABLE (temporary_env). The functions in execute_cmd.c are
-+ responsible for moving the main temporary env to one of the other
-+ temporary environments. The expansion code in subst.c calls this. */
-+int
-+assign_in_env (word, flags)
-+ WORD_DESC *word;
-+ int flags;
-+{
-+ int offset, aflags;
-+ char *name, *temp, *value;
-+ SHELL_VAR *var;
-+ const char *string;
-+
-+ string = word->word;
-+
-+ aflags = 0;
-+ offset = assignment (string, 0);
-+ name = savestring (string);
-+ value = (char *)NULL;
-+
-+ if (name[offset] == '=')
-+ {
-+ name[offset] = 0;
-+
-+ /* don't ignore the `+' when assigning temporary environment */
-+ if (name[offset - 1] == '+')
-+ {
-+ name[offset - 1] = '\0';
-+ aflags |= ASS_APPEND;
-+ }
-+
-+ var = find_variable (name);
-+ if (var && (readonly_p (var) || noassign_p (var)))
-+ {
-+ if (readonly_p (var))
-+ err_readonly (name);
-+ free (name);
-+ return (0);
-+ }
-+
-+ temp = name + offset + 1;
-+ value = expand_assignment_string_to_string (temp, 0);
-+
-+ if (var && (aflags & ASS_APPEND))
-+ {
-+ temp = make_variable_value (var, value, aflags);
-+ FREE (value);
-+ value = temp;
-+ }
-+ }
-+
-+ if (temporary_env == 0)
-+ temporary_env = hash_create (TEMPENV_HASH_BUCKETS);
-+
-+ var = hash_lookup (name, temporary_env);
-+ if (var == 0)
-+ var = make_new_variable (name, temporary_env);
-+ else
-+ FREE (value_cell (var));
-+
-+ if (value == 0)
-+ {
-+ value = (char *)xmalloc (1); /* like do_assignment_internal */
-+ value[0] = '\0';
-+ }
-+
-+ var_setvalue (var, value);
-+ var->attributes |= (att_exported|att_tempvar);
-+ var->context = variable_context; /* XXX */
-+
-+ INVALIDATE_EXPORTSTR (var);
-+ var->exportstr = mk_env_string (name, value, 0);
-+
-+ array_needs_making = 1;
-+
-+ if (flags)
-+ stupidly_hack_special_variables (name);
-+
-+ if (echo_command_at_execute)
-+ /* The Korn shell prints the `+ ' in front of assignment statements,
-+ so we do too. */
-+ xtrace_print_assignment (name, value, 0, 1);
-+
-+ free (name);
-+ return 1;
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Copying variables */
-+/* */
-+/* **************************************************************** */
-+
-+#ifdef INCLUDE_UNUSED
-+/* Copy VAR to a new data structure and return that structure. */
-+SHELL_VAR *
-+copy_variable (var)
-+ SHELL_VAR *var;
-+{
-+ SHELL_VAR *copy = (SHELL_VAR *)NULL;
-+
-+ if (var)
-+ {
-+ copy = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR));
-+
-+ copy->attributes = var->attributes;
-+ copy->name = savestring (var->name);
-+
-+ if (function_p (var))
-+ var_setfunc (copy, copy_command (function_cell (var)));
-+#if defined (ARRAY_VARS)
-+ else if (array_p (var))
-+ var_setarray (copy, array_copy (array_cell (var)));
-+ else if (assoc_p (var))
-+ var_setassoc (copy, assoc_copy (assoc_cell (var)));
-+#endif
-+ else if (nameref_cell (var)) /* XXX - nameref */
-+ var_setref (copy, savestring (nameref_cell (var)));
-+ else if (value_cell (var)) /* XXX - nameref */
-+ var_setvalue (copy, savestring (value_cell (var)));
-+ else
-+ var_setvalue (copy, (char *)NULL);
-+
-+ copy->dynamic_value = var->dynamic_value;
-+ copy->assign_func = var->assign_func;
-+
-+ copy->exportstr = COPY_EXPORTSTR (var);
-+
-+ copy->context = var->context;
-+ }
-+ return (copy);
-+}
-+#endif
-+
-+/* **************************************************************** */
-+/* */
-+/* Deleting and unsetting variables */
-+/* */
-+/* **************************************************************** */
-+
-+/* Dispose of the information attached to VAR. */
-+static void
-+dispose_variable_value (var)
-+ SHELL_VAR *var;
-+{
-+ if (function_p (var))
-+ dispose_command (function_cell (var));
-+#if defined (ARRAY_VARS)
-+ else if (array_p (var))
-+ array_dispose (array_cell (var));
-+ else if (assoc_p (var))
-+ assoc_dispose (assoc_cell (var));
-+#endif
-+ else if (nameref_p (var))
-+ FREE (nameref_cell (var));
-+ else
-+ FREE (value_cell (var));
-+}
-+
-+void
-+dispose_variable (var)
-+ SHELL_VAR *var;
-+{
-+ if (var == 0)
-+ return;
-+
-+ if (nofree_p (var) == 0)
-+ dispose_variable_value (var);
-+
-+ FREE_EXPORTSTR (var);
-+
-+ free (var->name);
-+
-+ if (exported_p (var))
-+ array_needs_making = 1;
-+
-+ free (var);
-+}
-+
-+/* Unset the shell variable referenced by NAME. Unsetting a nameref variable
-+ unsets the variable it resolves to but leaves the nameref alone. */
-+int
-+unbind_variable (name)
-+ const char *name;
-+{
-+ SHELL_VAR *v, *nv;
-+ int r;
-+
-+ v = var_lookup (name, shell_variables);
-+ nv = (v && nameref_p (v)) ? find_variable_nameref (v) : (SHELL_VAR *)NULL;
-+
-+ r = nv ? makunbound (nv->name, shell_variables) : makunbound (name, shell_variables);
-+ return r;
-+}
-+
-+/* Unbind NAME, where NAME is assumed to be a nameref variable */
-+int
-+unbind_nameref (name)
-+ const char *name;
-+{
-+ SHELL_VAR *v;
-+
-+ v = var_lookup (name, shell_variables);
-+ if (v && nameref_p (v))
-+ return makunbound (name, shell_variables);
-+ return 0;
-+}
-+
-+/* Unset the shell function named NAME. */
-+int
-+unbind_func (name)
-+ const char *name;
-+{
-+ BUCKET_CONTENTS *elt;
-+ SHELL_VAR *func;
-+
-+ elt = hash_remove (name, shell_functions, 0);
-+
-+ if (elt == 0)
-+ return -1;
-+
-+#if defined (PROGRAMMABLE_COMPLETION)
-+ set_itemlist_dirty (&it_functions);
-+#endif
-+
-+ func = (SHELL_VAR *)elt->data;
-+ if (func)
-+ {
-+ if (exported_p (func))
-+ array_needs_making++;
-+ dispose_variable (func);
-+ }
-+
-+ free (elt->key);
-+ free (elt);
-+
-+ return 0;
-+}
-+
-+#if defined (DEBUGGER)
-+int
-+unbind_function_def (name)
-+ const char *name;
-+{
-+ BUCKET_CONTENTS *elt;
-+ FUNCTION_DEF *funcdef;
-+
-+ elt = hash_remove (name, shell_function_defs, 0);
-+
-+ if (elt == 0)
-+ return -1;
-+
-+ funcdef = (FUNCTION_DEF *)elt->data;
-+ if (funcdef)
-+ dispose_function_def (funcdef);
-+
-+ free (elt->key);
-+ free (elt);
-+
-+ return 0;
-+}
-+#endif /* DEBUGGER */
-+
-+int
-+delete_var (name, vc)
-+ const char *name;
-+ VAR_CONTEXT *vc;
-+{
-+ BUCKET_CONTENTS *elt;
-+ SHELL_VAR *old_var;
-+ VAR_CONTEXT *v;
-+
-+ for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down)
-+ if (elt = hash_remove (name, v->table, 0))
-+ break;
-+
-+ if (elt == 0)
-+ return (-1);
-+
-+ old_var = (SHELL_VAR *)elt->data;
-+ free (elt->key);
-+ free (elt);
-+
-+ dispose_variable (old_var);
-+ return (0);
-+}
-+
-+/* Make the variable associated with NAME go away. HASH_LIST is the
-+ hash table from which this variable should be deleted (either
-+ shell_variables or shell_functions).
-+ Returns non-zero if the variable couldn't be found. */
-+int
-+makunbound (name, vc)
-+ const char *name;
-+ VAR_CONTEXT *vc;
-+{
-+ BUCKET_CONTENTS *elt, *new_elt;
-+ SHELL_VAR *old_var;
-+ VAR_CONTEXT *v;
-+ char *t;
-+
-+ for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down)
-+ if (elt = hash_remove (name, v->table, 0))
-+ break;
-+
-+ if (elt == 0)
-+ return (-1);
-+
-+ old_var = (SHELL_VAR *)elt->data;
-+
-+ if (old_var && exported_p (old_var))
-+ array_needs_making++;
-+
-+ /* If we're unsetting a local variable and we're still executing inside
-+ the function, just mark the variable as invisible. The function
-+ eventually called by pop_var_context() will clean it up later. This
-+ must be done so that if the variable is subsequently assigned a new
-+ value inside the function, the `local' attribute is still present.
-+ We also need to add it back into the correct hash table. */
-+ if (old_var && local_p (old_var) && variable_context == old_var->context)
-+ {
-+ if (nofree_p (old_var))
-+ var_setvalue (old_var, (char *)NULL);
-+#if defined (ARRAY_VARS)
-+ else if (array_p (old_var))
-+ array_dispose (array_cell (old_var));
-+ else if (assoc_p (old_var))
-+ assoc_dispose (assoc_cell (old_var));
-+#endif
-+ else if (nameref_p (old_var))
-+ FREE (nameref_cell (old_var));
-+ else
-+ FREE (value_cell (old_var));
-+ /* Reset the attributes. Preserve the export attribute if the variable
-+ came from a temporary environment. Make sure it stays local, and
-+ make it invisible. */
-+ old_var->attributes = (exported_p (old_var) && tempvar_p (old_var)) ? att_exported : 0;
-+ VSETATTR (old_var, att_local);
-+ VSETATTR (old_var, att_invisible);
-+ var_setvalue (old_var, (char *)NULL);
-+ INVALIDATE_EXPORTSTR (old_var);
-+
-+ new_elt = hash_insert (savestring (old_var->name), v->table, 0);
-+ new_elt->data = (PTR_T)old_var;
-+ stupidly_hack_special_variables (old_var->name);
-+
-+ free (elt->key);
-+ free (elt);
-+ return (0);
-+ }
-+
-+ /* Have to save a copy of name here, because it might refer to
-+ old_var->name. If so, stupidly_hack_special_variables will
-+ reference freed memory. */
-+ t = savestring (name);
-+
-+ free (elt->key);
-+ free (elt);
-+
-+ dispose_variable (old_var);
-+ stupidly_hack_special_variables (t);
-+ free (t);
-+
-+ return (0);
-+}
-+
-+/* Get rid of all of the variables in the current context. */
-+void
-+kill_all_local_variables ()
-+{
-+ VAR_CONTEXT *vc;
-+
-+ for (vc = shell_variables; vc; vc = vc->down)
-+ if (vc_isfuncenv (vc) && vc->scope == variable_context)
-+ break;
-+ if (vc == 0)
-+ return; /* XXX */
-+
-+ if (vc->table && vc_haslocals (vc))
-+ {
-+ delete_all_variables (vc->table);
-+ hash_dispose (vc->table);
-+ }
-+ vc->table = (HASH_TABLE *)NULL;
-+}
-+
-+static void
-+free_variable_hash_data (data)
-+ PTR_T data;
-+{
-+ SHELL_VAR *var;
-+
-+ var = (SHELL_VAR *)data;
-+ dispose_variable (var);
-+}
-+
-+/* Delete the entire contents of the hash table. */
-+void
-+delete_all_variables (hashed_vars)
-+ HASH_TABLE *hashed_vars;
-+{
-+ hash_flush (hashed_vars, free_variable_hash_data);
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Setting variable attributes */
-+/* */
-+/* **************************************************************** */
-+
-+#define FIND_OR_MAKE_VARIABLE(name, entry) \
-+ do \
-+ { \
-+ entry = find_variable (name); \
-+ if (!entry) \
-+ { \
-+ entry = bind_variable (name, "", 0); \
-+ if (!no_invisible_vars && entry) entry->attributes |= att_invisible; \
-+ } \
-+ } \
-+ while (0)
-+
-+/* Make the variable associated with NAME be readonly.
-+ If NAME does not exist yet, create it. */
-+void
-+set_var_read_only (name)
-+ char *name;
-+{
-+ SHELL_VAR *entry;
-+
-+ FIND_OR_MAKE_VARIABLE (name, entry);
-+ VSETATTR (entry, att_readonly);
-+}
-+
-+#ifdef INCLUDE_UNUSED
-+/* Make the function associated with NAME be readonly.
-+ If NAME does not exist, we just punt, like auto_export code below. */
-+void
-+set_func_read_only (name)
-+ const char *name;
-+{
-+ SHELL_VAR *entry;
-+
-+ entry = find_function (name);
-+ if (entry)
-+ VSETATTR (entry, att_readonly);
-+}
-+
-+/* Make the variable associated with NAME be auto-exported.
-+ If NAME does not exist yet, create it. */
-+void
-+set_var_auto_export (name)
-+ char *name;
-+{
-+ SHELL_VAR *entry;
-+
-+ FIND_OR_MAKE_VARIABLE (name, entry);
-+ set_auto_export (entry);
-+}
-+
-+/* Make the function associated with NAME be auto-exported. */
-+void
-+set_func_auto_export (name)
-+ const char *name;
-+{
-+ SHELL_VAR *entry;
-+
-+ entry = find_function (name);
-+ if (entry)
-+ set_auto_export (entry);
-+}
-+#endif
-+
-+/* **************************************************************** */
-+/* */
-+/* Creating lists of variables */
-+/* */
-+/* **************************************************************** */
-+
-+static VARLIST *
-+vlist_alloc (nentries)
-+ int nentries;
-+{
-+ VARLIST *vlist;
-+
-+ vlist = (VARLIST *)xmalloc (sizeof (VARLIST));
-+ vlist->list = (SHELL_VAR **)xmalloc ((nentries + 1) * sizeof (SHELL_VAR *));
-+ vlist->list_size = nentries;
-+ vlist->list_len = 0;
-+ vlist->list[0] = (SHELL_VAR *)NULL;
-+
-+ return vlist;
-+}
-+
-+static VARLIST *
-+vlist_realloc (vlist, n)
-+ VARLIST *vlist;
-+ int n;
-+{
-+ if (vlist == 0)
-+ return (vlist = vlist_alloc (n));
-+ if (n > vlist->list_size)
-+ {
-+ vlist->list_size = n;
-+ vlist->list = (SHELL_VAR **)xrealloc (vlist->list, (vlist->list_size + 1) * sizeof (SHELL_VAR *));
-+ }
-+ return vlist;
-+}
-+
-+static void
-+vlist_add (vlist, var, flags)
-+ VARLIST *vlist;
-+ SHELL_VAR *var;
-+ int flags;
-+{
-+ register int i;
-+
-+ for (i = 0; i < vlist->list_len; i++)
-+ if (STREQ (var->name, vlist->list[i]->name))
-+ break;
-+ if (i < vlist->list_len)
-+ return;
-+
-+ if (i >= vlist->list_size)
-+ vlist = vlist_realloc (vlist, vlist->list_size + 16);
-+
-+ vlist->list[vlist->list_len++] = var;
-+ vlist->list[vlist->list_len] = (SHELL_VAR *)NULL;
-+}
-+
-+/* Map FUNCTION over the variables in VAR_HASH_TABLE. Return an array of the
-+ variables for which FUNCTION returns a non-zero value. A NULL value
-+ for FUNCTION means to use all variables. */
-+SHELL_VAR **
-+map_over (function, vc)
-+ sh_var_map_func_t *function;
-+ VAR_CONTEXT *vc;
-+{
-+ VAR_CONTEXT *v;
-+ VARLIST *vlist;
-+ SHELL_VAR **ret;
-+ int nentries;
-+
-+ for (nentries = 0, v = vc; v; v = v->down)
-+ nentries += HASH_ENTRIES (v->table);
-+
-+ if (nentries == 0)
-+ return (SHELL_VAR **)NULL;
-+
-+ vlist = vlist_alloc (nentries);
-+
-+ for (v = vc; v; v = v->down)
-+ flatten (v->table, function, vlist, 0);
-+
-+ ret = vlist->list;
-+ free (vlist);
-+ return ret;
-+}
-+
-+SHELL_VAR **
-+map_over_funcs (function)
-+ sh_var_map_func_t *function;
-+{
-+ VARLIST *vlist;
-+ SHELL_VAR **ret;
-+
-+ if (shell_functions == 0 || HASH_ENTRIES (shell_functions) == 0)
-+ return ((SHELL_VAR **)NULL);
-+
-+ vlist = vlist_alloc (HASH_ENTRIES (shell_functions));
-+
-+ flatten (shell_functions, function, vlist, 0);
-+
-+ ret = vlist->list;
-+ free (vlist);
-+ return ret;
-+}
-+
-+/* Flatten VAR_HASH_TABLE, applying FUNC to each member and adding those
-+ elements for which FUNC succeeds to VLIST->list. FLAGS is reserved
-+ for future use. Only unique names are added to VLIST. If FUNC is
-+ NULL, each variable in VAR_HASH_TABLE is added to VLIST. If VLIST is
-+ NULL, FUNC is applied to each SHELL_VAR in VAR_HASH_TABLE. If VLIST
-+ and FUNC are both NULL, nothing happens. */
-+static void
-+flatten (var_hash_table, func, vlist, flags)
-+ HASH_TABLE *var_hash_table;
-+ sh_var_map_func_t *func;
-+ VARLIST *vlist;
-+ int flags;
-+{
-+ register int i;
-+ register BUCKET_CONTENTS *tlist;
-+ int r;
-+ SHELL_VAR *var;
-+
-+ if (var_hash_table == 0 || (HASH_ENTRIES (var_hash_table) == 0) || (vlist == 0 && func == 0))
-+ return;
-+
-+ for (i = 0; i < var_hash_table->nbuckets; i++)
-+ {
-+ for (tlist = hash_items (i, var_hash_table); tlist; tlist = tlist->next)
-+ {
-+ var = (SHELL_VAR *)tlist->data;
-+
-+ r = func ? (*func) (var) : 1;
-+ if (r && vlist)
-+ vlist_add (vlist, var, flags);
-+ }
-+ }
-+}
-+
-+void
-+sort_variables (array)
-+ SHELL_VAR **array;
-+{
-+ qsort (array, strvec_len ((char **)array), sizeof (SHELL_VAR *), (QSFUNC *)qsort_var_comp);
-+}
-+
-+static int
-+qsort_var_comp (var1, var2)
-+ SHELL_VAR **var1, **var2;
-+{
-+ int result;
-+
-+ if ((result = (*var1)->name[0] - (*var2)->name[0]) == 0)
-+ result = strcmp ((*var1)->name, (*var2)->name);
-+
-+ return (result);
-+}
-+
-+/* Apply FUNC to each variable in SHELL_VARIABLES, adding each one for
-+ which FUNC succeeds to an array of SHELL_VAR *s. Returns the array. */
-+static SHELL_VAR **
-+vapply (func)
-+ sh_var_map_func_t *func;
-+{
-+ SHELL_VAR **list;
-+
-+ list = map_over (func, shell_variables);
-+ if (list /* && posixly_correct */)
-+ sort_variables (list);
-+ return (list);
-+}
-+
-+/* Apply FUNC to each variable in SHELL_FUNCTIONS, adding each one for
-+ which FUNC succeeds to an array of SHELL_VAR *s. Returns the array. */
-+static SHELL_VAR **
-+fapply (func)
-+ sh_var_map_func_t *func;
-+{
-+ SHELL_VAR **list;
-+
-+ list = map_over_funcs (func);
-+ if (list /* && posixly_correct */)
-+ sort_variables (list);
-+ return (list);
-+}
-+
-+/* Create a NULL terminated array of all the shell variables. */
-+SHELL_VAR **
-+all_shell_variables ()
-+{
-+ return (vapply ((sh_var_map_func_t *)NULL));
-+}
-+
-+/* Create a NULL terminated array of all the shell functions. */
-+SHELL_VAR **
-+all_shell_functions ()
-+{
-+ return (fapply ((sh_var_map_func_t *)NULL));
-+}
-+
-+static int
-+visible_var (var)
-+ SHELL_VAR *var;
-+{
-+ return (invisible_p (var) == 0);
-+}
-+
-+SHELL_VAR **
-+all_visible_functions ()
-+{
-+ return (fapply (visible_var));
-+}
-+
-+SHELL_VAR **
-+all_visible_variables ()
-+{
-+ return (vapply (visible_var));
-+}
-+
-+/* Return non-zero if the variable VAR is visible and exported. Array
-+ variables cannot be exported. */
-+static int
-+visible_and_exported (var)
-+ SHELL_VAR *var;
-+{
-+ return (invisible_p (var) == 0 && exported_p (var));
-+}
-+
-+/* Candidate variables for the export environment are either valid variables
-+ with the export attribute or invalid variables inherited from the initial
-+ environment and simply passed through. */
-+static int
-+export_environment_candidate (var)
-+ SHELL_VAR *var;
-+{
-+ return (exported_p (var) && (invisible_p (var) == 0 || imported_p (var)));
-+}
-+
-+/* Return non-zero if VAR is a local variable in the current context and
-+ is exported. */
-+static int
-+local_and_exported (var)
-+ SHELL_VAR *var;
-+{
-+ return (invisible_p (var) == 0 && local_p (var) && var->context == variable_context && exported_p (var));
-+}
-+
-+SHELL_VAR **
-+all_exported_variables ()
-+{
-+ return (vapply (visible_and_exported));
-+}
-+
-+SHELL_VAR **
-+local_exported_variables ()
-+{
-+ return (vapply (local_and_exported));
-+}
-+
-+static int
-+variable_in_context (var)
-+ SHELL_VAR *var;
-+{
-+ return (invisible_p (var) == 0 && local_p (var) && var->context == variable_context);
-+}
-+
-+SHELL_VAR **
-+all_local_variables ()
-+{
-+ VARLIST *vlist;
-+ SHELL_VAR **ret;
-+ VAR_CONTEXT *vc;
-+
-+ vc = shell_variables;
-+ for (vc = shell_variables; vc; vc = vc->down)
-+ if (vc_isfuncenv (vc) && vc->scope == variable_context)
-+ break;
-+
-+ if (vc == 0)
-+ {
-+ internal_error (_("all_local_variables: no function context at current scope"));
-+ return (SHELL_VAR **)NULL;
-+ }
-+ if (vc->table == 0 || HASH_ENTRIES (vc->table) == 0 || vc_haslocals (vc) == 0)
-+ return (SHELL_VAR **)NULL;
-+
-+ vlist = vlist_alloc (HASH_ENTRIES (vc->table));
-+
-+ flatten (vc->table, variable_in_context, vlist, 0);
-+
-+ ret = vlist->list;
-+ free (vlist);
-+ if (ret)
-+ sort_variables (ret);
-+ return ret;
-+}
-+
-+#if defined (ARRAY_VARS)
-+/* Return non-zero if the variable VAR is visible and an array. */
-+static int
-+visible_array_vars (var)
-+ SHELL_VAR *var;
-+{
-+ return (invisible_p (var) == 0 && array_p (var));
-+}
-+
-+SHELL_VAR **
-+all_array_variables ()
-+{
-+ return (vapply (visible_array_vars));
-+}
-+#endif /* ARRAY_VARS */
-+
-+char **
-+all_variables_matching_prefix (prefix)
-+ const char *prefix;
-+{
-+ SHELL_VAR **varlist;
-+ char **rlist;
-+ int vind, rind, plen;
-+
-+ plen = STRLEN (prefix);
-+ varlist = all_visible_variables ();
-+ for (vind = 0; varlist && varlist[vind]; vind++)
-+ ;
-+ if (varlist == 0 || vind == 0)
-+ return ((char **)NULL);
-+ rlist = strvec_create (vind + 1);
-+ for (vind = rind = 0; varlist[vind]; vind++)
-+ {
-+ if (plen == 0 || STREQN (prefix, varlist[vind]->name, plen))
-+ rlist[rind++] = savestring (varlist[vind]->name);
-+ }
-+ rlist[rind] = (char *)0;
-+ free (varlist);
-+
-+ return rlist;
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Managing temporary variable scopes */
-+/* */
-+/* **************************************************************** */
-+
-+/* Make variable NAME have VALUE in the temporary environment. */
-+static SHELL_VAR *
-+bind_tempenv_variable (name, value)
-+ const char *name;
-+ char *value;
-+{
-+ SHELL_VAR *var;
-+
-+ var = temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)NULL;
-+
-+ if (var)
-+ {
-+ FREE (value_cell (var));
-+ var_setvalue (var, savestring (value));
-+ INVALIDATE_EXPORTSTR (var);
-+ }
-+
-+ return (var);
-+}
-+
-+/* Find a variable in the temporary environment that is named NAME.
-+ Return the SHELL_VAR *, or NULL if not found. */
-+SHELL_VAR *
-+find_tempenv_variable (name)
-+ const char *name;
-+{
-+ return (temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)NULL);
-+}
-+
-+char **tempvar_list;
-+int tvlist_ind;
-+
-+/* Push the variable described by (SHELL_VAR *)DATA down to the next
-+ variable context from the temporary environment. */
-+static void
-+push_temp_var (data)
-+ PTR_T data;
-+{
-+ SHELL_VAR *var, *v;
-+ HASH_TABLE *binding_table;
-+
-+ var = (SHELL_VAR *)data;
-+
-+ binding_table = shell_variables->table;
-+ if (binding_table == 0)
-+ {
-+ if (shell_variables == global_variables)
-+ /* shouldn't happen */
-+ binding_table = shell_variables->table = global_variables->table = hash_create (0);
-+ else
-+ binding_table = shell_variables->table = hash_create (TEMPENV_HASH_BUCKETS);
-+ }
-+
-+ v = bind_variable_internal (var->name, value_cell (var), binding_table, 0, 0);
-+
-+ /* XXX - should we set the context here? It shouldn't matter because of how
-+ assign_in_env works, but might want to check. */
-+ if (binding_table == global_variables->table) /* XXX */
-+ var->attributes &= ~(att_tempvar|att_propagate);
-+ else
-+ {
-+ var->attributes |= att_propagate;
-+ if (binding_table == shell_variables->table)
-+ shell_variables->flags |= VC_HASTMPVAR;
-+ }
-+ v->attributes |= var->attributes;
-+
-+ if (find_special_var (var->name) >= 0)
-+ tempvar_list[tvlist_ind++] = savestring (var->name);
-+
-+ dispose_variable (var);
-+}
-+
-+static void
-+propagate_temp_var (data)
-+ PTR_T data;
-+{
-+ SHELL_VAR *var;
-+
-+ var = (SHELL_VAR *)data;
-+ if (tempvar_p (var) && (var->attributes & att_propagate))
-+ push_temp_var (data);
-+ else
-+ {
-+ if (find_special_var (var->name) >= 0)
-+ tempvar_list[tvlist_ind++] = savestring (var->name);
-+ dispose_variable (var);
-+ }
-+}
-+
-+/* Free the storage used in the hash table for temporary
-+ environment variables. PUSHF is a function to be called
-+ to free each hash table entry. It takes care of pushing variables
-+ to previous scopes if appropriate. PUSHF stores names of variables
-+ that require special handling (e.g., IFS) on tempvar_list, so this
-+ function can call stupidly_hack_special_variables on all the
-+ variables in the list when the temporary hash table is destroyed. */
-+static void
-+dispose_temporary_env (pushf)
-+ sh_free_func_t *pushf;
-+{
-+ int i;
-+
-+ tempvar_list = strvec_create (HASH_ENTRIES (temporary_env) + 1);
-+ tempvar_list[tvlist_ind = 0] = 0;
-+
-+ hash_flush (temporary_env, pushf);
-+ hash_dispose (temporary_env);
-+ temporary_env = (HASH_TABLE *)NULL;
-+
-+ tempvar_list[tvlist_ind] = 0;
-+
-+ array_needs_making = 1;
-+
-+#if 0
-+ sv_ifs ("IFS"); /* XXX here for now -- check setifs in assign_in_env */
-+#endif
-+ for (i = 0; i < tvlist_ind; i++)
-+ stupidly_hack_special_variables (tempvar_list[i]);
-+
-+ strvec_dispose (tempvar_list);
-+ tempvar_list = 0;
-+ tvlist_ind = 0;
-+}
-+
-+void
-+dispose_used_env_vars ()
-+{
-+ if (temporary_env)
-+ {
-+ dispose_temporary_env (propagate_temp_var);
-+ maybe_make_export_env ();
-+ }
-+}
-+
-+/* Take all of the shell variables in the temporary environment HASH_TABLE
-+ and make shell variables from them at the current variable context. */
-+void
-+merge_temporary_env ()
-+{
-+ if (temporary_env)
-+ dispose_temporary_env (push_temp_var);
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Creating and manipulating the environment */
-+/* */
-+/* **************************************************************** */
-+
-+static inline char *
-+mk_env_string (name, value, isfunc)
-+ const char *name, *value;
-+ int isfunc;
-+{
-+ size_t name_len, value_len;
-+ char *p, *q;
-+
-+ name_len = strlen (name);
-+ value_len = STRLEN (value);
-+
-+ /* If we are exporting a shell function, construct the encoded function
-+ name. */
-+ if (isfunc && value)
-+ {
-+ p = (char *)xmalloc (BASHFUNC_PREFLEN + name_len + BASHFUNC_SUFFLEN + value_len + 2);
-+ q = p;
-+ memcpy (q, BASHFUNC_PREFIX, BASHFUNC_PREFLEN);
-+ q += BASHFUNC_PREFLEN;
-+ memcpy (q, name, name_len);
-+ q += name_len;
-+ memcpy (q, BASHFUNC_SUFFIX, BASHFUNC_SUFFLEN);
-+ q += BASHFUNC_SUFFLEN;
-+ }
-+ else
-+ {
-+ p = (char *)xmalloc (2 + name_len + value_len);
-+ memcpy (p, name, name_len);
-+ q = p + name_len;
-+ }
-+
-+ q[0] = '=';
-+ if (value && *value)
-+ memcpy (q + 1, value, value_len + 1);
-+ else
-+ q[1] = '\0';
-+
-+ return (p);
-+}
-+
-+#ifdef DEBUG
-+/* Debugging */
-+static int
-+valid_exportstr (v)
-+ SHELL_VAR *v;
-+{
-+ char *s;
-+
-+ s = v->exportstr;
-+ if (s == 0)
-+ {
-+ internal_error (_("%s has null exportstr"), v->name);
-+ return (0);
-+ }
-+ if (legal_variable_starter ((unsigned char)*s) == 0)
-+ {
-+ internal_error (_("invalid character %d in exportstr for %s"), *s, v->name);
-+ return (0);
-+ }
-+ for (s = v->exportstr + 1; s && *s; s++)
-+ {
-+ if (*s == '=')
-+ break;
-+ if (legal_variable_char ((unsigned char)*s) == 0)
-+ {
-+ internal_error (_("invalid character %d in exportstr for %s"), *s, v->name);
-+ return (0);
-+ }
-+ }
-+ if (*s != '=')
-+ {
-+ internal_error (_("no `=' in exportstr for %s"), v->name);
-+ return (0);
-+ }
-+ return (1);
-+}
-+#endif
-+
-+static char **
-+make_env_array_from_var_list (vars)
-+ SHELL_VAR **vars;
-+{
-+ register int i, list_index;
-+ register SHELL_VAR *var;
-+ char **list, *value;
-+
-+ list = strvec_create ((1 + strvec_len ((char **)vars)));
-+
-+#define USE_EXPORTSTR (value == var->exportstr)
-+
-+ for (i = 0, list_index = 0; var = vars[i]; i++)
-+ {
-+#if defined (__CYGWIN__)
-+ /* We don't use the exportstr stuff on Cygwin at all. */
-+ INVALIDATE_EXPORTSTR (var);
-+#endif
-+ if (var->exportstr)
-+ value = var->exportstr;
-+ else if (function_p (var))
-+ value = named_function_string ((char *)NULL, function_cell (var), 0);
-+#if defined (ARRAY_VARS)
-+ else if (array_p (var))
-+# if ARRAY_EXPORT
-+ value = array_to_assignment_string (array_cell (var));
-+# else
-+ continue; /* XXX array vars cannot yet be exported */
-+# endif /* ARRAY_EXPORT */
-+ else if (assoc_p (var))
-+# if 0
-+ value = assoc_to_assignment_string (assoc_cell (var));
-+# else
-+ continue; /* XXX associative array vars cannot yet be exported */
-+# endif
-+#endif
-+ else
-+ value = value_cell (var);
-+
-+ if (value)
-+ {
-+ /* Gee, I'd like to get away with not using savestring() if we're
-+ using the cached exportstr... */
-+ list[list_index] = USE_EXPORTSTR ? savestring (value)
-+ : mk_env_string (var->name, value, function_p (var));
-+
-+ if (USE_EXPORTSTR == 0)
-+ SAVE_EXPORTSTR (var, list[list_index]);
-+
-+ list_index++;
-+#undef USE_EXPORTSTR
-+
-+#if 0 /* not yet */
-+#if defined (ARRAY_VARS)
-+ if (array_p (var) || assoc_p (var))
-+ free (value);
-+#endif
-+#endif
-+ }
-+ }
-+
-+ list[list_index] = (char *)NULL;
-+ return (list);
-+}
-+
-+/* Make an array of assignment statements from the hash table
-+ HASHED_VARS which contains SHELL_VARs. Only visible, exported
-+ variables are eligible. */
-+static char **
-+make_var_export_array (vcxt)
-+ VAR_CONTEXT *vcxt;
-+{
-+ char **list;
-+ SHELL_VAR **vars;
-+
-+#if 0
-+ vars = map_over (visible_and_exported, vcxt);
-+#else
-+ vars = map_over (export_environment_candidate, vcxt);
-+#endif
-+
-+ if (vars == 0)
-+ return (char **)NULL;
-+
-+ list = make_env_array_from_var_list (vars);
-+
-+ free (vars);
-+ return (list);
-+}
-+
-+static char **
-+make_func_export_array ()
-+{
-+ char **list;
-+ SHELL_VAR **vars;
-+
-+ vars = map_over_funcs (visible_and_exported);
-+ if (vars == 0)
-+ return (char **)NULL;
-+
-+ list = make_env_array_from_var_list (vars);
-+
-+ free (vars);
-+ return (list);
-+}
-+
-+/* Add ENVSTR to the end of the exported environment, EXPORT_ENV. */
-+#define add_to_export_env(envstr,do_alloc) \
-+do \
-+ { \
-+ if (export_env_index >= (export_env_size - 1)) \
-+ { \
-+ export_env_size += 16; \
-+ export_env = strvec_resize (export_env, export_env_size); \
-+ environ = export_env; \
-+ } \
-+ export_env[export_env_index++] = (do_alloc) ? savestring (envstr) : envstr; \
-+ export_env[export_env_index] = (char *)NULL; \
-+ } while (0)
-+
-+/* Add ASSIGN to EXPORT_ENV, or supercede a previous assignment in the
-+ array with the same left-hand side. Return the new EXPORT_ENV. */
-+char **
-+add_or_supercede_exported_var (assign, do_alloc)
-+ char *assign;
-+ int do_alloc;
-+{
-+ register int i;
-+ int equal_offset;
-+
-+ equal_offset = assignment (assign, 0);
-+ if (equal_offset == 0)
-+ return (export_env);
-+
-+ /* If this is a function, then only supersede the function definition.
-+ We do this by including the `=() {' in the comparison, like
-+ initialize_shell_variables does. */
-+ if (assign[equal_offset + 1] == '(' &&
-+ strncmp (assign + equal_offset + 2, ") {", 3) == 0) /* } */
-+ equal_offset += 4;
-+
-+ for (i = 0; i < export_env_index; i++)
-+ {
-+ if (STREQN (assign, export_env[i], equal_offset + 1))
-+ {
-+ free (export_env[i]);
-+ export_env[i] = do_alloc ? savestring (assign) : assign;
-+ return (export_env);
-+ }
-+ }
-+ add_to_export_env (assign, do_alloc);
-+ return (export_env);
-+}
-+
-+static void
-+add_temp_array_to_env (temp_array, do_alloc, do_supercede)
-+ char **temp_array;
-+ int do_alloc, do_supercede;
-+{
-+ register int i;
-+
-+ if (temp_array == 0)
-+ return;
-+
-+ for (i = 0; temp_array[i]; i++)
-+ {
-+ if (do_supercede)
-+ export_env = add_or_supercede_exported_var (temp_array[i], do_alloc);
-+ else
-+ add_to_export_env (temp_array[i], do_alloc);
-+ }
-+
-+ free (temp_array);
-+}
-+
-+/* Make the environment array for the command about to be executed, if the
-+ array needs making. Otherwise, do nothing. If a shell action could
-+ change the array that commands receive for their environment, then the
-+ code should `array_needs_making++'.
-+
-+ The order to add to the array is:
-+ temporary_env
-+ list of var contexts whose head is shell_variables
-+ shell_functions
-+
-+ This is the shell variable lookup order. We add only new variable
-+ names at each step, which allows local variables and variables in
-+ the temporary environments to shadow variables in the global (or
-+ any previous) scope.
-+*/
-+
-+static int
-+n_shell_variables ()
-+{
-+ VAR_CONTEXT *vc;
-+ int n;
-+
-+ for (n = 0, vc = shell_variables; vc; vc = vc->down)
-+ n += HASH_ENTRIES (vc->table);
-+ return n;
-+}
-+
-+int
-+chkexport (name)
-+ char *name;
-+{
-+ SHELL_VAR *v;
-+
-+ v = find_variable (name);
-+ if (v && exported_p (v))
-+ {
-+ array_needs_making = 1;
-+ maybe_make_export_env ();
-+ return 1;
-+ }
-+ return 0;
-+}
-+
-+void
-+maybe_make_export_env ()
-+{
-+ register char **temp_array;
-+ int new_size;
-+ VAR_CONTEXT *tcxt;
-+
-+ if (array_needs_making)
-+ {
-+ if (export_env)
-+ strvec_flush (export_env);
-+
-+ /* Make a guess based on how many shell variables and functions we
-+ have. Since there will always be array variables, and array
-+ variables are not (yet) exported, this will always be big enough
-+ for the exported variables and functions. */
-+ new_size = n_shell_variables () + HASH_ENTRIES (shell_functions) + 1 +
-+ HASH_ENTRIES (temporary_env);
-+ if (new_size > export_env_size)
-+ {
-+ export_env_size = new_size;
-+ export_env = strvec_resize (export_env, export_env_size);
-+ environ = export_env;
-+ }
-+ export_env[export_env_index = 0] = (char *)NULL;
-+
-+ /* Make a dummy variable context from the temporary_env, stick it on
-+ the front of shell_variables, call make_var_export_array on the
-+ whole thing to flatten it, and convert the list of SHELL_VAR *s
-+ to the form needed by the environment. */
-+ if (temporary_env)
-+ {
-+ tcxt = new_var_context ((char *)NULL, 0);
-+ tcxt->table = temporary_env;
-+ tcxt->down = shell_variables;
-+ }
-+ else
-+ tcxt = shell_variables;
-+
-+ temp_array = make_var_export_array (tcxt);
-+ if (temp_array)
-+ add_temp_array_to_env (temp_array, 0, 0);
-+
-+ if (tcxt != shell_variables)
-+ free (tcxt);
-+
-+#if defined (RESTRICTED_SHELL)
-+ /* Restricted shells may not export shell functions. */
-+ temp_array = restricted ? (char **)0 : make_func_export_array ();
-+#else
-+ temp_array = make_func_export_array ();
-+#endif
-+ if (temp_array)
-+ add_temp_array_to_env (temp_array, 0, 0);
-+
-+ array_needs_making = 0;
-+ }
-+}
-+
-+/* This is an efficiency hack. PWD and OLDPWD are auto-exported, so
-+ we will need to remake the exported environment every time we
-+ change directories. `_' is always put into the environment for
-+ every external command, so without special treatment it will always
-+ cause the environment to be remade.
-+
-+ If there is no other reason to make the exported environment, we can
-+ just update the variables in place and mark the exported environment
-+ as no longer needing a remake. */
-+void
-+update_export_env_inplace (env_prefix, preflen, value)
-+ char *env_prefix;
-+ int preflen;
-+ char *value;
-+{
-+ char *evar;
-+
-+ evar = (char *)xmalloc (STRLEN (value) + preflen + 1);
-+ strcpy (evar, env_prefix);
-+ if (value)
-+ strcpy (evar + preflen, value);
-+ export_env = add_or_supercede_exported_var (evar, 0);
-+}
-+
-+/* We always put _ in the environment as the name of this command. */
-+void
-+put_command_name_into_env (command_name)
-+ char *command_name;
-+{
-+ update_export_env_inplace ("_=", 2, command_name);
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Managing variable contexts */
-+/* */
-+/* **************************************************************** */
-+
-+/* Allocate and return a new variable context with NAME and FLAGS.
-+ NAME can be NULL. */
-+
-+VAR_CONTEXT *
-+new_var_context (name, flags)
-+ char *name;
-+ int flags;
-+{
-+ VAR_CONTEXT *vc;
-+
-+ vc = (VAR_CONTEXT *)xmalloc (sizeof (VAR_CONTEXT));
-+ vc->name = name ? savestring (name) : (char *)NULL;
-+ vc->scope = variable_context;
-+ vc->flags = flags;
-+
-+ vc->up = vc->down = (VAR_CONTEXT *)NULL;
-+ vc->table = (HASH_TABLE *)NULL;
-+
-+ return vc;
-+}
-+
-+/* Free a variable context and its data, including the hash table. Dispose
-+ all of the variables. */
-+void
-+dispose_var_context (vc)
-+ VAR_CONTEXT *vc;
-+{
-+ FREE (vc->name);
-+
-+ if (vc->table)
-+ {
-+ delete_all_variables (vc->table);
-+ hash_dispose (vc->table);
-+ }
-+
-+ free (vc);
-+}
-+
-+/* Set VAR's scope level to the current variable context. */
-+static int
-+set_context (var)
-+ SHELL_VAR *var;
-+{
-+ return (var->context = variable_context);
-+}
-+
-+/* Make a new variable context with NAME and FLAGS and a HASH_TABLE of
-+ temporary variables, and push it onto shell_variables. This is
-+ for shell functions. */
-+VAR_CONTEXT *
-+push_var_context (name, flags, tempvars)
-+ char *name;
-+ int flags;
-+ HASH_TABLE *tempvars;
-+{
-+ VAR_CONTEXT *vc;
-+
-+ vc = new_var_context (name, flags);
-+ vc->table = tempvars;
-+ if (tempvars)
-+ {
-+ /* Have to do this because the temp environment was created before
-+ variable_context was incremented. */
-+ flatten (tempvars, set_context, (VARLIST *)NULL, 0);
-+ vc->flags |= VC_HASTMPVAR;
-+ }
-+ vc->down = shell_variables;
-+ shell_variables->up = vc;
-+
-+ return (shell_variables = vc);
-+}
-+
-+static void
-+push_func_var (data)
-+ PTR_T data;
-+{
-+ SHELL_VAR *var, *v;
-+
-+ var = (SHELL_VAR *)data;
-+
-+ if (tempvar_p (var) && (posixly_correct || (var->attributes & att_propagate)))
-+ {
-+ /* Make sure we have a hash table to store the variable in while it is
-+ being propagated down to the global variables table. Create one if
-+ we have to */
-+ if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0)
-+ shell_variables->table = hash_create (0);
-+ /* XXX - should we set v->context here? */
-+ v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0);
-+ if (shell_variables == global_variables)
-+ var->attributes &= ~(att_tempvar|att_propagate);
-+ else
-+ shell_variables->flags |= VC_HASTMPVAR;
-+ v->attributes |= var->attributes;
-+ }
-+ else
-+ stupidly_hack_special_variables (var->name); /* XXX */
-+
-+ dispose_variable (var);
-+}
-+
-+/* Pop the top context off of VCXT and dispose of it, returning the rest of
-+ the stack. */
-+void
-+pop_var_context ()
-+{
-+ VAR_CONTEXT *ret, *vcxt;
-+
-+ vcxt = shell_variables;
-+ if (vc_isfuncenv (vcxt) == 0)
-+ {
-+ internal_error (_("pop_var_context: head of shell_variables not a function context"));
-+ return;
-+ }
-+
-+ if (ret = vcxt->down)
-+ {
-+ ret->up = (VAR_CONTEXT *)NULL;
-+ shell_variables = ret;
-+ if (vcxt->table)
-+ hash_flush (vcxt->table, push_func_var);
-+ dispose_var_context (vcxt);
-+ }
-+ else
-+ internal_error (_("pop_var_context: no global_variables context"));
-+}
-+
-+/* Delete the HASH_TABLEs for all variable contexts beginning at VCXT, and
-+ all of the VAR_CONTEXTs except GLOBAL_VARIABLES. */
-+void
-+delete_all_contexts (vcxt)
-+ VAR_CONTEXT *vcxt;
-+{
-+ VAR_CONTEXT *v, *t;
-+
-+ for (v = vcxt; v != global_variables; v = t)
-+ {
-+ t = v->down;
-+ dispose_var_context (v);
-+ }
-+
-+ delete_all_variables (global_variables->table);
-+ shell_variables = global_variables;
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Pushing and Popping temporary variable scopes */
-+/* */
-+/* **************************************************************** */
-+
-+VAR_CONTEXT *
-+push_scope (flags, tmpvars)
-+ int flags;
-+ HASH_TABLE *tmpvars;
-+{
-+ return (push_var_context ((char *)NULL, flags, tmpvars));
-+}
-+
-+static void
-+push_exported_var (data)
-+ PTR_T data;
-+{
-+ SHELL_VAR *var, *v;
-+
-+ var = (SHELL_VAR *)data;
-+
-+ /* If a temp var had its export attribute set, or it's marked to be
-+ propagated, bind it in the previous scope before disposing it. */
-+ /* XXX - This isn't exactly right, because all tempenv variables have the
-+ export attribute set. */
-+#if 0
-+ if (exported_p (var) || (var->attributes & att_propagate))
-+#else
-+ if (tempvar_p (var) && exported_p (var) && (var->attributes & att_propagate))
-+#endif
-+ {
-+ var->attributes &= ~att_tempvar; /* XXX */
-+ v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0);
-+ if (shell_variables == global_variables)
-+ var->attributes &= ~att_propagate;
-+ v->attributes |= var->attributes;
-+ }
-+ else
-+ stupidly_hack_special_variables (var->name); /* XXX */
-+
-+ dispose_variable (var);
-+}
-+
-+void
-+pop_scope (is_special)
-+ int is_special;
-+{
-+ VAR_CONTEXT *vcxt, *ret;
-+
-+ vcxt = shell_variables;
-+ if (vc_istempscope (vcxt) == 0)
-+ {
-+ internal_error (_("pop_scope: head of shell_variables not a temporary environment scope"));
-+ return;
-+ }
-+
-+ ret = vcxt->down;
-+ if (ret)
-+ ret->up = (VAR_CONTEXT *)NULL;
-+
-+ shell_variables = ret;
-+
-+ /* Now we can take care of merging variables in VCXT into set of scopes
-+ whose head is RET (shell_variables). */
-+ FREE (vcxt->name);
-+ if (vcxt->table)
-+ {
-+ if (is_special)
-+ hash_flush (vcxt->table, push_func_var);
-+ else
-+ hash_flush (vcxt->table, push_exported_var);
-+ hash_dispose (vcxt->table);
-+ }
-+ free (vcxt);
-+
-+ sv_ifs ("IFS"); /* XXX here for now */
-+}
-+
-+/* **************************************************************** */
-+/* */
-+/* Pushing and Popping function contexts */
-+/* */
-+/* **************************************************************** */
-+
-+static WORD_LIST **dollar_arg_stack = (WORD_LIST **)NULL;
-+static int dollar_arg_stack_slots;
-+static int dollar_arg_stack_index;
-+
-+/* XXX - we might want to consider pushing and popping the `getopts' state
-+ when we modify the positional parameters. */
-+void
-+push_context (name, is_subshell, tempvars)
-+ char *name; /* function name */
-+ int is_subshell;
-+ HASH_TABLE *tempvars;
-+{
-+ if (is_subshell == 0)
-+ push_dollar_vars ();
-+ variable_context++;
-+ push_var_context (name, VC_FUNCENV, tempvars);
-+}
-+
-+/* Only called when subshell == 0, so we don't need to check, and can
-+ unconditionally pop the dollar vars off the stack. */
-+void
-+pop_context ()
-+{
-+ pop_dollar_vars ();
-+ variable_context--;
-+ pop_var_context ();
-+
-+ sv_ifs ("IFS"); /* XXX here for now */
-+}
-+
-+/* Save the existing positional parameters on a stack. */
-+void
-+push_dollar_vars ()
-+{
-+ if (dollar_arg_stack_index + 2 > dollar_arg_stack_slots)
-+ {
-+ dollar_arg_stack = (WORD_LIST **)
-+ xrealloc (dollar_arg_stack, (dollar_arg_stack_slots += 10)
-+ * sizeof (WORD_LIST *));
-+ }
-+ dollar_arg_stack[dollar_arg_stack_index++] = list_rest_of_args ();
-+ dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL;
-+}
-+
-+/* Restore the positional parameters from our stack. */
-+void
-+pop_dollar_vars ()
-+{
-+ if (!dollar_arg_stack || dollar_arg_stack_index == 0)
-+ return;
-+
-+ remember_args (dollar_arg_stack[--dollar_arg_stack_index], 1);
-+ dispose_words (dollar_arg_stack[dollar_arg_stack_index]);
-+ dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL;
-+ set_dollar_vars_unchanged ();
-+}
-+
-+void
-+dispose_saved_dollar_vars ()
-+{
-+ if (!dollar_arg_stack || dollar_arg_stack_index == 0)
-+ return;
-+
-+ dispose_words (dollar_arg_stack[dollar_arg_stack_index]);
-+ dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL;
-+}
-+
-+/* Manipulate the special BASH_ARGV and BASH_ARGC variables. */
-+
-+void
-+push_args (list)
-+ WORD_LIST *list;
-+{
-+#if defined (ARRAY_VARS) && defined (DEBUGGER)
-+ SHELL_VAR *bash_argv_v, *bash_argc_v;
-+ ARRAY *bash_argv_a, *bash_argc_a;
-+ WORD_LIST *l;
-+ arrayind_t i;
-+ char *t;
-+
-+ GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a);
-+ GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a);
-+
-+ for (l = list, i = 0; l; l = l->next, i++)
-+ array_push (bash_argv_a, l->word->word);
-+
-+ t = itos (i);
-+ array_push (bash_argc_a, t);
-+ free (t);
-+#endif /* ARRAY_VARS && DEBUGGER */
-+}
-+
-+/* Remove arguments from BASH_ARGV array. Pop top element off BASH_ARGC
-+ array and use that value as the count of elements to remove from
-+ BASH_ARGV. */
-+void
-+pop_args ()
-+{
-+#if defined (ARRAY_VARS) && defined (DEBUGGER)
-+ SHELL_VAR *bash_argv_v, *bash_argc_v;
-+ ARRAY *bash_argv_a, *bash_argc_a;
-+ ARRAY_ELEMENT *ce;
-+ intmax_t i;
-+
-+ GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a);
-+ GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a);
-+
-+ ce = array_shift (bash_argc_a, 1, 0);
-+ if (ce == 0 || legal_number (element_value (ce), &i) == 0)
-+ i = 0;
-+
-+ for ( ; i > 0; i--)
-+ array_pop (bash_argv_a);
-+ array_dispose_element (ce);
-+#endif /* ARRAY_VARS && DEBUGGER */
-+}
-+
-+/*************************************************
-+ * *
-+ * Functions to manage special variables *
-+ * *
-+ *************************************************/
-+
-+/* Extern declarations for variables this code has to manage. */
-+extern int eof_encountered, eof_encountered_limit, ignoreeof;
-+
-+#if defined (READLINE)
-+extern int hostname_list_initialized;
-+#endif
-+
-+/* An alist of name.function for each special variable. Most of the
-+ functions don't do much, and in fact, this would be faster with a
-+ switch statement, but by the end of this file, I am sick of switch
-+ statements. */
-+
-+#define SET_INT_VAR(name, intvar) intvar = find_variable (name) != 0
-+
-+/* This table will be sorted with qsort() the first time it's accessed. */
-+struct name_and_function {
-+ char *name;
-+ sh_sv_func_t *function;
-+};
-+
-+static struct name_and_function special_vars[] = {
-+ { "BASH_COMPAT", sv_shcompat },
-+ { "BASH_XTRACEFD", sv_xtracefd },
-+
-+#if defined (JOB_CONTROL)
-+ { "CHILD_MAX", sv_childmax },
-+#endif
-+
-+#if defined (READLINE)
-+# if defined (STRICT_POSIX)
-+ { "COLUMNS", sv_winsize },
-+# endif
-+ { "COMP_WORDBREAKS", sv_comp_wordbreaks },
-+#endif
-+
-+ { "FUNCNEST", sv_funcnest },
-+
-+ { "GLOBIGNORE", sv_globignore },
-+
-+#if defined (HISTORY)
-+ { "HISTCONTROL", sv_history_control },
-+ { "HISTFILESIZE", sv_histsize },
-+ { "HISTIGNORE", sv_histignore },
-+ { "HISTSIZE", sv_histsize },
-+ { "HISTTIMEFORMAT", sv_histtimefmt },
-+#endif
-+
-+#if defined (__CYGWIN__)
-+ { "HOME", sv_home },
-+#endif
-+
-+#if defined (READLINE)
-+ { "HOSTFILE", sv_hostfile },
-+#endif
-+
-+ { "IFS", sv_ifs },
-+ { "IGNOREEOF", sv_ignoreeof },
-+
-+ { "LANG", sv_locale },
-+ { "LC_ALL", sv_locale },
-+ { "LC_COLLATE", sv_locale },
-+ { "LC_CTYPE", sv_locale },
-+ { "LC_MESSAGES", sv_locale },
-+ { "LC_NUMERIC", sv_locale },
-+ { "LC_TIME", sv_locale },
-+
-+#if defined (READLINE) && defined (STRICT_POSIX)
-+ { "LINES", sv_winsize },
-+#endif
-+
-+ { "MAIL", sv_mail },
-+ { "MAILCHECK", sv_mail },
-+ { "MAILPATH", sv_mail },
-+
-+ { "OPTERR", sv_opterr },
-+ { "OPTIND", sv_optind },
-+
-+ { "PATH", sv_path },
-+ { "POSIXLY_CORRECT", sv_strict_posix },
-+
-+#if defined (READLINE)
-+ { "TERM", sv_terminal },
-+ { "TERMCAP", sv_terminal },
-+ { "TERMINFO", sv_terminal },
-+#endif /* READLINE */
-+
-+ { "TEXTDOMAIN", sv_locale },
-+ { "TEXTDOMAINDIR", sv_locale },
-+
-+#if defined (HAVE_TZSET)
-+ { "TZ", sv_tz },
-+#endif
-+
-+#if defined (HISTORY) && defined (BANG_HISTORY)
-+ { "histchars", sv_histchars },
-+#endif /* HISTORY && BANG_HISTORY */
-+
-+ { "ignoreeof", sv_ignoreeof },
-+
-+ { (char *)0, (sh_sv_func_t *)0 }
-+};
-+
-+#define N_SPECIAL_VARS (sizeof (special_vars) / sizeof (special_vars[0]) - 1)
-+
-+static int
-+sv_compare (sv1, sv2)
-+ struct name_and_function *sv1, *sv2;
-+{
-+ int r;
-+
-+ if ((r = sv1->name[0] - sv2->name[0]) == 0)
-+ r = strcmp (sv1->name, sv2->name);
-+ return r;
-+}
-+
-+static inline int
-+find_special_var (name)
-+ const char *name;
-+{
-+ register int i, r;
-+
-+ for (i = 0; special_vars[i].name; i++)
-+ {
-+ r = special_vars[i].name[0] - name[0];
-+ if (r == 0)
-+ r = strcmp (special_vars[i].name, name);
-+ if (r == 0)
-+ return i;
-+ else if (r > 0)
-+ /* Can't match any of rest of elements in sorted list. Take this out
-+ if it causes problems in certain environments. */
-+ break;
-+ }
-+ return -1;
-+}
-+
-+/* The variable in NAME has just had its state changed. Check to see if it
-+ is one of the special ones where something special happens. */
-+void
-+stupidly_hack_special_variables (name)
-+ char *name;
-+{
-+ static int sv_sorted = 0;
-+ int i;
-+
-+ if (sv_sorted == 0) /* shouldn't need, but it's fairly cheap. */
-+ {
-+ qsort (special_vars, N_SPECIAL_VARS, sizeof (special_vars[0]),
-+ (QSFUNC *)sv_compare);
-+ sv_sorted = 1;
-+ }
-+
-+ i = find_special_var (name);
-+ if (i != -1)
-+ (*(special_vars[i].function)) (name);
-+}
-+
-+/* Special variables that need hooks to be run when they are unset as part
-+ of shell reinitialization should have their sv_ functions run here. */
-+void
-+reinit_special_variables ()
-+{
-+#if defined (READLINE)
-+ sv_comp_wordbreaks ("COMP_WORDBREAKS");
-+#endif
-+ sv_globignore ("GLOBIGNORE");
-+ sv_opterr ("OPTERR");
-+}
-+
-+void
-+sv_ifs (name)
-+ char *name;
-+{
-+ SHELL_VAR *v;
-+
-+ v = find_variable ("IFS");
-+ setifs (v);
-+}
-+
-+/* What to do just after the PATH variable has changed. */
-+void
-+sv_path (name)
-+ char *name;
-+{
-+ /* hash -r */
-+ phash_flush ();
-+}
-+
-+/* What to do just after one of the MAILxxxx variables has changed. NAME
-+ is the name of the variable. This is called with NAME set to one of
-+ MAIL, MAILCHECK, or MAILPATH. */
-+void
-+sv_mail (name)
-+ char *name;
-+{
-+ /* If the time interval for checking the files has changed, then
-+ reset the mail timer. Otherwise, one of the pathname vars
-+ to the users mailbox has changed, so rebuild the array of
-+ filenames. */
-+ if (name[4] == 'C') /* if (strcmp (name, "MAILCHECK") == 0) */
-+ reset_mail_timer ();
-+ else
-+ {
-+ free_mail_files ();
-+ remember_mail_dates ();
-+ }
-+}
-+
-+void
-+sv_funcnest (name)
-+ char *name;
-+{
-+ SHELL_VAR *v;
-+ intmax_t num;
-+
-+ v = find_variable (name);
-+ if (v == 0)
-+ funcnest_max = 0;
-+ else if (legal_number (value_cell (v), &num) == 0)
-+ funcnest_max = 0;
-+ else
-+ funcnest_max = num;
-+}
-+
-+/* What to do when GLOBIGNORE changes. */
-+void
-+sv_globignore (name)
-+ char *name;
-+{
-+ if (privileged_mode == 0)
-+ setup_glob_ignore (name);
-+}
-+
-+#if defined (READLINE)
-+void
-+sv_comp_wordbreaks (name)
-+ char *name;
-+{
-+ SHELL_VAR *sv;
-+
-+ sv = find_variable (name);
-+ if (sv == 0)
-+ reset_completer_word_break_chars ();
-+}
-+
-+/* What to do just after one of the TERMxxx variables has changed.
-+ If we are an interactive shell, then try to reset the terminal
-+ information in readline. */
-+void
-+sv_terminal (name)
-+ char *name;
-+{
-+ if (interactive_shell && no_line_editing == 0)
-+ rl_reset_terminal (get_string_value ("TERM"));
-+}
-+
-+void
-+sv_hostfile (name)
-+ char *name;
-+{
-+ SHELL_VAR *v;
-+
-+ v = find_variable (name);
-+ if (v == 0)
-+ clear_hostname_list ();
-+ else
-+ hostname_list_initialized = 0;
-+}
-+
-+#if defined (STRICT_POSIX)
-+/* In strict posix mode, we allow assignments to LINES and COLUMNS (and values
-+ found in the initial environment) to override the terminal size reported by
-+ the kernel. */
-+void
-+sv_winsize (name)
-+ char *name;
-+{
-+ SHELL_VAR *v;
-+ intmax_t xd;
-+ int d;
-+
-+ if (posixly_correct == 0 || interactive_shell == 0 || no_line_editing)
-+ return;
-+
-+ v = find_variable (name);
-+ if (v == 0 || var_isnull (v))
-+ rl_reset_screen_size ();
-+ else
-+ {
-+ if (legal_number (value_cell (v), &xd) == 0)
-+ return;
-+ winsize_assignment = 1;
-+ d = xd; /* truncate */
-+ if (name[0] == 'L') /* LINES */
-+ rl_set_screen_size (d, -1);
-+ else /* COLUMNS */
-+ rl_set_screen_size (-1, d);
-+ winsize_assignment = 0;
-+ }
-+}
-+#endif /* STRICT_POSIX */
-+#endif /* READLINE */
-+
-+/* Update the value of HOME in the export environment so tilde expansion will
-+ work on cygwin. */
-+#if defined (__CYGWIN__)
-+sv_home (name)
-+ char *name;
-+{
-+ array_needs_making = 1;
-+ maybe_make_export_env ();
-+}
-+#endif
-+
-+#if defined (HISTORY)
-+/* What to do after the HISTSIZE or HISTFILESIZE variables change.
-+ If there is a value for this HISTSIZE (and it is numeric), then stifle
-+ the history. Otherwise, if there is NO value for this variable,
-+ unstifle the history. If name is HISTFILESIZE, and its value is
-+ numeric, truncate the history file to hold no more than that many
-+ lines. */
-+void
-+sv_histsize (name)
-+ char *name;
-+{
-+ char *temp;
-+ intmax_t num;
-+ int hmax;
-+
-+ temp = get_string_value (name);
-+
-+ if (temp && *temp)
-+ {
-+ if (legal_number (temp, &num))
-+ {
-+ hmax = num;
-+ if (hmax < 0 && name[4] == 'S')
-+ unstifle_history (); /* unstifle history if HISTSIZE < 0 */
-+ else if (name[4] == 'S')
-+ {
-+ stifle_history (hmax);
-+ hmax = where_history ();
-+ if (history_lines_this_session > hmax)
-+ history_lines_this_session = hmax;
-+ }
-+ else if (hmax >= 0) /* truncate HISTFILE if HISTFILESIZE >= 0 */
-+ {
-+ history_truncate_file (get_string_value ("HISTFILE"), hmax);
-+ if (hmax <= history_lines_in_file)
-+ history_lines_in_file = hmax;
-+ }
-+ }
-+ }
-+ else if (name[4] == 'S')
-+ unstifle_history ();
-+}
-+
-+/* What to do after the HISTIGNORE variable changes. */
-+void
-+sv_histignore (name)
-+ char *name;
-+{
-+ setup_history_ignore (name);
-+}
-+
-+/* What to do after the HISTCONTROL variable changes. */
-+void
-+sv_history_control (name)
-+ char *name;
-+{
-+ char *temp;
-+ char *val;
-+ int tptr;
-+
-+ history_control = 0;
-+ temp = get_string_value (name);
-+
-+ if (temp == 0 || *temp == 0)
-+ return;
-+
-+ tptr = 0;
-+ while (val = extract_colon_unit (temp, &tptr))
-+ {
-+ if (STREQ (val, "ignorespace"))
-+ history_control |= HC_IGNSPACE;
-+ else if (STREQ (val, "ignoredups"))
-+ history_control |= HC_IGNDUPS;
-+ else if (STREQ (val, "ignoreboth"))
-+ history_control |= HC_IGNBOTH;
-+ else if (STREQ (val, "erasedups"))
-+ history_control |= HC_ERASEDUPS;
-+
-+ free (val);
-+ }
-+}
-+
-+#if defined (BANG_HISTORY)
-+/* Setting/unsetting of the history expansion character. */
-+void
-+sv_histchars (name)
-+ char *name;
-+{
-+ char *temp;
-+
-+ temp = get_string_value (name);
-+ if (temp)
-+ {
-+ history_expansion_char = *temp;
-+ if (temp[0] && temp[1])
-+ {
-+ history_subst_char = temp[1];
-+ if (temp[2])
-+ history_comment_char = temp[2];
-+ }
-+ }
-+ else
-+ {
-+ history_expansion_char = '!';
-+ history_subst_char = '^';
-+ history_comment_char = '#';
-+ }
-+}
-+#endif /* BANG_HISTORY */
-+
-+void
-+sv_histtimefmt (name)
-+ char *name;
-+{
-+ SHELL_VAR *v;
-+
-+ if (v = find_variable (name))
-+ {
-+ if (history_comment_char == 0)
-+ history_comment_char = '#';
-+ }
-+ history_write_timestamps = (v != 0);
-+}
-+#endif /* HISTORY */
-+
-+#if defined (HAVE_TZSET)
-+void
-+sv_tz (name)
-+ char *name;
-+{
-+ if (chkexport (name))
-+ tzset ();
-+}
-+#endif
-+
-+/* If the variable exists, then the value of it can be the number
-+ of times we actually ignore the EOF. The default is small,
-+ (smaller than csh, anyway). */
-+void
-+sv_ignoreeof (name)
-+ char *name;
-+{
-+ SHELL_VAR *tmp_var;
-+ char *temp;
-+
-+ eof_encountered = 0;
-+
-+ tmp_var = find_variable (name);
-+ ignoreeof = tmp_var != 0;
-+ temp = tmp_var ? value_cell (tmp_var) : (char *)NULL;
-+ if (temp)
-+ eof_encountered_limit = (*temp && all_digits (temp)) ? atoi (temp) : 10;
-+ set_shellopts (); /* make sure `ignoreeof' is/is not in $SHELLOPTS */
-+}
-+
-+void
-+sv_optind (name)
-+ char *name;
-+{
-+ char *tt;
-+ int s;
-+
-+ tt = get_string_value ("OPTIND");
-+ if (tt && *tt)
-+ {
-+ s = atoi (tt);
-+
-+ /* According to POSIX, setting OPTIND=1 resets the internal state
-+ of getopt (). */
-+ if (s < 0 || s == 1)
-+ s = 0;
-+ }
-+ else
-+ s = 0;
-+ getopts_reset (s);
-+}
-+
-+void
-+sv_opterr (name)
-+ char *name;
-+{
-+ char *tt;
-+
-+ tt = get_string_value ("OPTERR");
-+ sh_opterr = (tt && *tt) ? atoi (tt) : 1;
-+}
-+
-+void
-+sv_strict_posix (name)
-+ char *name;
-+{
-+ SET_INT_VAR (name, posixly_correct);
-+ posix_initialize (posixly_correct);
-+#if defined (READLINE)
-+ if (interactive_shell)
-+ posix_readline_initialize (posixly_correct);
-+#endif /* READLINE */
-+ set_shellopts (); /* make sure `posix' is/is not in $SHELLOPTS */
-+}
-+
-+void
-+sv_locale (name)
-+ char *name;
-+{
-+ char *v;
-+ int r;
-+
-+ v = get_string_value (name);
-+ if (name[0] == 'L' && name[1] == 'A') /* LANG */
-+ r = set_lang (name, v);
-+ else
-+ r = set_locale_var (name, v); /* LC_*, TEXTDOMAIN* */
-+
-+#if 1
-+ if (r == 0 && posixly_correct)
-+ last_command_exit_value = 1;
-+#endif
-+}
-+
-+#if defined (ARRAY_VARS)
-+void
-+set_pipestatus_array (ps, nproc)
-+ int *ps;
-+ int nproc;
-+{
-+ SHELL_VAR *v;
-+ ARRAY *a;
-+ ARRAY_ELEMENT *ae;
-+ register int i;
-+ char *t, tbuf[INT_STRLEN_BOUND(int) + 1];
-+
-+ v = find_variable ("PIPESTATUS");
-+ if (v == 0)
-+ v = make_new_array_variable ("PIPESTATUS");
-+ if (array_p (v) == 0)
-+ return; /* Do nothing if not an array variable. */
-+ a = array_cell (v);
-+
-+ if (a == 0 || array_num_elements (a) == 0)
-+ {
-+ for (i = 0; i < nproc; i++) /* was ps[i] != -1, not i < nproc */
-+ {
-+ t = inttostr (ps[i], tbuf, sizeof (tbuf));
-+ array_insert (a, i, t);
-+ }
-+ return;
-+ }
-+
-+ /* Fast case */
-+ if (array_num_elements (a) == nproc && nproc == 1)
-+ {
-+ ae = element_forw (a->head);
-+ free (element_value (ae));
-+ ae->value = itos (ps[0]);
-+ }
-+ else if (array_num_elements (a) <= nproc)
-+ {
-+ /* modify in array_num_elements members in place, then add */
-+ ae = a->head;
-+ for (i = 0; i < array_num_elements (a); i++)
-+ {
-+ ae = element_forw (ae);
-+ free (element_value (ae));
-+ ae->value = itos (ps[i]);
-+ }
-+ /* add any more */
-+ for ( ; i < nproc; i++)
-+ {
-+ t = inttostr (ps[i], tbuf, sizeof (tbuf));
-+ array_insert (a, i, t);
-+ }
-+ }
-+ else
-+ {
-+ /* deleting elements. it's faster to rebuild the array. */
-+ array_flush (a);
-+ for (i = 0; ps[i] != -1; i++)
-+ {
-+ t = inttostr (ps[i], tbuf, sizeof (tbuf));
-+ array_insert (a, i, t);
-+ }
-+ }
-+}
-+
-+ARRAY *
-+save_pipestatus_array ()
-+{
-+ SHELL_VAR *v;
-+ ARRAY *a, *a2;
-+
-+ v = find_variable ("PIPESTATUS");
-+ if (v == 0 || array_p (v) == 0 || array_cell (v) == 0)
-+ return ((ARRAY *)NULL);
-+
-+ a = array_cell (v);
-+ a2 = array_copy (array_cell (v));
-+
-+ return a2;
-+}
-+
-+void
-+restore_pipestatus_array (a)
-+ ARRAY *a;
-+{
-+ SHELL_VAR *v;
-+ ARRAY *a2;
-+
-+ v = find_variable ("PIPESTATUS");
-+ /* XXX - should we still assign even if existing value is NULL? */
-+ if (v == 0 || array_p (v) == 0 || array_cell (v) == 0)
-+ return;
-+
-+ a2 = array_cell (v);
-+ var_setarray (v, a);
-+
-+ array_dispose (a2);
-+}
-+#endif
-+
-+void
-+set_pipestatus_from_exit (s)
-+ int s;
-+{
-+#if defined (ARRAY_VARS)
-+ static int v[2] = { 0, -1 };
-+
-+ v[0] = s;
-+ set_pipestatus_array (v, 1);
-+#endif
-+}
-+
-+void
-+sv_xtracefd (name)
-+ char *name;
-+{
-+ SHELL_VAR *v;
-+ char *t, *e;
-+ int fd;
-+ FILE *fp;
-+
-+ v = find_variable (name);
-+ if (v == 0)
-+ {
-+ xtrace_reset ();
-+ return;
-+ }
-+
-+ t = value_cell (v);
-+ if (t == 0 || *t == 0)
-+ xtrace_reset ();
-+ else
-+ {
-+ fd = (int)strtol (t, &e, 10);
-+ if (e != t && *e == '\0' && sh_validfd (fd))
-+ {
-+ fp = fdopen (fd, "w");
-+ if (fp == 0)
-+ internal_error (_("%s: %s: cannot open as FILE"), name, value_cell (v));
-+ else
-+ xtrace_set (fd, fp);
-+ }
-+ else
-+ internal_error (_("%s: %s: invalid value for trace file descriptor"), name, value_cell (v));
-+ }
-+}
-+
-+#define MIN_COMPAT_LEVEL 31
-+
-+void
-+sv_shcompat (name)
-+ char *name;
-+{
-+ SHELL_VAR *v;
-+ char *val;
-+ int tens, ones, compatval;
-+
-+ v = find_variable (name);
-+ if (v == 0)
-+ {
-+ shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
-+ set_compatibility_opts ();
-+ return;
-+ }
-+ val = value_cell (v);
-+ if (val == 0 || *val == '\0')
-+ {
-+ shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
-+ set_compatibility_opts ();
-+ return;
-+ }
-+ /* Handle decimal-like compatibility version specifications: 4.2 */
-+ if (isdigit (val[0]) && val[1] == '.' && isdigit (val[2]) && val[3] == 0)
-+ {
-+ tens = val[0] - '0';
-+ ones = val[2] - '0';
-+ compatval = tens*10 + ones;
-+ }
-+ /* Handle integer-like compatibility version specifications: 42 */
-+ else if (isdigit (val[0]) && isdigit (val[1]) && val[2] == 0)
-+ {
-+ tens = val[0] - '0';
-+ ones = val[1] - '0';
-+ compatval = tens*10 + ones;
-+ }
-+ else
-+ {
-+compat_error:
-+ internal_error (_("%s: %s: compatibility value out of range"), name, val);
-+ shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
-+ set_compatibility_opts ();
-+ return;
-+ }
-+
-+ if (compatval < MIN_COMPAT_LEVEL || compatval > DEFAULT_COMPAT_LEVEL)
-+ goto compat_error;
-+
-+ shell_compatibility_level = compatval;
-+ set_compatibility_opts ();
-+}
-+
-+#if defined (JOB_CONTROL)
-+void
-+sv_childmax (name)
-+ char *name;
-+{
-+ char *tt;
-+ int s;
-+
-+ tt = get_string_value (name);
-+ s = (tt && *tt) ? atoi (tt) : 0;
-+ set_maxchild (s);
-+}
-+#endif
diff --git a/patches/bash-4.3.30/0002-Bash-4.3-patch-32.patch b/patches/bash-4.3.30/0002-Bash-4.3-patch-32.patch
deleted file mode 100644
index 801b4a609..000000000
--- a/patches/bash-4.3.30/0002-Bash-4.3-patch-32.patch
+++ /dev/null
@@ -1,5409 +0,0 @@
-From: Chet Ramey <chet.ramey@case.edu>
-Date: Thu, 15 Jan 2015 10:20:45 -0500
-Subject: [PATCH] Bash-4.3 patch 32
-
----
- jobs.c | 4 +-
- patchlevel.h | 2 +-
- variables.c.orig | 5365 ------------------------------------------------------
- 3 files changed, 4 insertions(+), 5367 deletions(-)
- delete mode 100644 variables.c.orig
-
-diff --git a/jobs.c b/jobs.c
-index f38b0c3f4446..b6e59eba0de8 100644
---- a/jobs.c
-+++ b/jobs.c
-@@ -3339,7 +3339,9 @@ itrace("waitchld: waitpid returns %d block = %d", pid, block);
- if (posixly_correct && this_shell_builtin && this_shell_builtin == wait_builtin)
- {
- interrupt_immediately = 0;
-- trap_handler (SIGCHLD); /* set pending_traps[SIGCHLD] */
-+ /* This was trap_handler (SIGCHLD) but that can lose traps if
-+ children_exited > 1 */
-+ queue_sigchld_trap (children_exited);
- wait_signal_received = SIGCHLD;
- /* If we're in a signal handler, let CHECK_WAIT_INTR pick it up;
- run_pending_traps will call run_sigchld_trap later */
-diff --git a/patchlevel.h b/patchlevel.h
-index 0ad46aafbdd9..b8bf38704ed2 100644
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
- regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
- looks for to find the patch level (for the sccs version string). */
-
--#define PATCHLEVEL 31
-+#define PATCHLEVEL 32
-
- #endif /* _PATCHLEVEL_H_ */
-diff --git a/variables.c.orig b/variables.c.orig
-deleted file mode 100644
-index 7c82710e0f0b..000000000000
---- a/variables.c.orig
-+++ /dev/null
-@@ -1,5365 +0,0 @@
--/* variables.c -- Functions for hacking shell variables. */
--
--/* Copyright (C) 1987-2013 Free Software Foundation, Inc.
--
-- This file is part of GNU Bash, the Bourne Again SHell.
--
-- Bash is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- Bash is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with Bash. If not, see <http://www.gnu.org/licenses/>.
--*/
--
--#include "config.h"
--
--#include "bashtypes.h"
--#include "posixstat.h"
--#include "posixtime.h"
--
--#if defined (__QNX__)
--# if defined (__QNXNTO__)
--# include <sys/netmgr.h>
--# else
--# include <sys/vc.h>
--# endif /* !__QNXNTO__ */
--#endif /* __QNX__ */
--
--#if defined (HAVE_UNISTD_H)
--# include <unistd.h>
--#endif
--
--#include <stdio.h>
--#include "chartypes.h"
--#if defined (HAVE_PWD_H)
--# include <pwd.h>
--#endif
--#include "bashansi.h"
--#include "bashintl.h"
--
--#define NEED_XTRACE_SET_DECL
--
--#include "shell.h"
--#include "flags.h"
--#include "execute_cmd.h"
--#include "findcmd.h"
--#include "mailcheck.h"
--#include "input.h"
--#include "hashcmd.h"
--#include "pathexp.h"
--#include "alias.h"
--#include "jobs.h"
--
--#include "version.h"
--
--#include "builtins/getopt.h"
--#include "builtins/common.h"
--#include "builtins/builtext.h"
--
--#if defined (READLINE)
--# include "bashline.h"
--# include <readline/readline.h>
--#else
--# include <tilde/tilde.h>
--#endif
--
--#if defined (HISTORY)
--# include "bashhist.h"
--# include <readline/history.h>
--#endif /* HISTORY */
--
--#if defined (PROGRAMMABLE_COMPLETION)
--# include "pcomplete.h"
--#endif
--
--#define TEMPENV_HASH_BUCKETS 4 /* must be power of two */
--
--#define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0')
--
--#define BASHFUNC_PREFIX "BASH_FUNC_"
--#define BASHFUNC_PREFLEN 10 /* == strlen(BASHFUNC_PREFIX */
--#define BASHFUNC_SUFFIX "%%"
--#define BASHFUNC_SUFFLEN 2 /* == strlen(BASHFUNC_SUFFIX) */
--
--extern char **environ;
--
--/* Variables used here and defined in other files. */
--extern int posixly_correct;
--extern int line_number, line_number_base;
--extern int subshell_environment, indirection_level, subshell_level;
--extern int build_version, patch_level;
--extern int expanding_redir;
--extern int last_command_exit_value;
--extern char *dist_version, *release_status;
--extern char *shell_name;
--extern char *primary_prompt, *secondary_prompt;
--extern char *current_host_name;
--extern sh_builtin_func_t *this_shell_builtin;
--extern SHELL_VAR *this_shell_function;
--extern char *the_printed_command_except_trap;
--extern char *this_command_name;
--extern char *command_execution_string;
--extern time_t shell_start_time;
--extern int assigning_in_environment;
--extern int executing_builtin;
--extern int funcnest_max;
--
--#if defined (READLINE)
--extern int no_line_editing;
--extern int perform_hostname_completion;
--#endif
--
--/* The list of shell variables that the user has created at the global
-- scope, or that came from the environment. */
--VAR_CONTEXT *global_variables = (VAR_CONTEXT *)NULL;
--
--/* The current list of shell variables, including function scopes */
--VAR_CONTEXT *shell_variables = (VAR_CONTEXT *)NULL;
--
--/* The list of shell functions that the user has created, or that came from
-- the environment. */
--HASH_TABLE *shell_functions = (HASH_TABLE *)NULL;
--
--#if defined (DEBUGGER)
--/* The table of shell function definitions that the user defined or that
-- came from the environment. */
--HASH_TABLE *shell_function_defs = (HASH_TABLE *)NULL;
--#endif
--
--/* The current variable context. This is really a count of how deep into
-- executing functions we are. */
--int variable_context = 0;
--
--/* The set of shell assignments which are made only in the environment
-- for a single command. */
--HASH_TABLE *temporary_env = (HASH_TABLE *)NULL;
--
--/* Set to non-zero if an assignment error occurs while putting variables
-- into the temporary environment. */
--int tempenv_assign_error;
--
--/* Some funky variables which are known about specially. Here is where
-- "$*", "$1", and all the cruft is kept. */
--char *dollar_vars[10];
--WORD_LIST *rest_of_args = (WORD_LIST *)NULL;
--
--/* The value of $$. */
--pid_t dollar_dollar_pid;
--
--/* Non-zero means that we have to remake EXPORT_ENV. */
--int array_needs_making = 1;
--
--/* The number of times BASH has been executed. This is set
-- by initialize_variables (). */
--int shell_level = 0;
--
--/* An array which is passed to commands as their environment. It is
-- manufactured from the union of the initial environment and the
-- shell variables that are marked for export. */
--char **export_env = (char **)NULL;
--static int export_env_index;
--static int export_env_size;
--
--#if defined (READLINE)
--static int winsize_assignment; /* currently assigning to LINES or COLUMNS */
--#endif
--
--static HASH_TABLE *last_table_searched; /* hash_lookup sets this */
--
--/* Some forward declarations. */
--static void create_variable_tables __P((void));
--
--static void set_machine_vars __P((void));
--static void set_home_var __P((void));
--static void set_shell_var __P((void));
--static char *get_bash_name __P((void));
--static void initialize_shell_level __P((void));
--static void uidset __P((void));
--#if defined (ARRAY_VARS)
--static void make_vers_array __P((void));
--#endif
--
--static SHELL_VAR *null_assign __P((SHELL_VAR *, char *, arrayind_t, char *));
--#if defined (ARRAY_VARS)
--static SHELL_VAR *null_array_assign __P((SHELL_VAR *, char *, arrayind_t, char *));
--#endif
--static SHELL_VAR *get_self __P((SHELL_VAR *));
--
--#if defined (ARRAY_VARS)
--static SHELL_VAR *init_dynamic_array_var __P((char *, sh_var_value_func_t *, sh_var_assign_func_t *, int));
--static SHELL_VAR *init_dynamic_assoc_var __P((char *, sh_var_value_func_t *, sh_var_assign_func_t *, int));
--#endif
--
--static SHELL_VAR *assign_seconds __P((SHELL_VAR *, char *, arrayind_t, char *));
--static SHELL_VAR *get_seconds __P((SHELL_VAR *));
--static SHELL_VAR *init_seconds_var __P((void));
--
--static int brand __P((void));
--static void sbrand __P((unsigned long)); /* set bash random number generator. */
--static void seedrand __P((void)); /* seed generator randomly */
--static SHELL_VAR *assign_random __P((SHELL_VAR *, char *, arrayind_t, char *));
--static SHELL_VAR *get_random __P((SHELL_VAR *));
--
--static SHELL_VAR *assign_lineno __P((SHELL_VAR *, char *, arrayind_t, char *));
--static SHELL_VAR *get_lineno __P((SHELL_VAR *));
--
--static SHELL_VAR *assign_subshell __P((SHELL_VAR *, char *, arrayind_t, char *));
--static SHELL_VAR *get_subshell __P((SHELL_VAR *));
--
--static SHELL_VAR *get_bashpid __P((SHELL_VAR *));
--
--#if defined (HISTORY)
--static SHELL_VAR *get_histcmd __P((SHELL_VAR *));
--#endif
--
--#if defined (READLINE)
--static SHELL_VAR *get_comp_wordbreaks __P((SHELL_VAR *));
--static SHELL_VAR *assign_comp_wordbreaks __P((SHELL_VAR *, char *, arrayind_t, char *));
--#endif
--
--#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS)
--static SHELL_VAR *assign_dirstack __P((SHELL_VAR *, char *, arrayind_t, char *));
--static SHELL_VAR *get_dirstack __P((SHELL_VAR *));
--#endif
--
--#if defined (ARRAY_VARS)
--static SHELL_VAR *get_groupset __P((SHELL_VAR *));
--
--static SHELL_VAR *build_hashcmd __P((SHELL_VAR *));
--static SHELL_VAR *get_hashcmd __P((SHELL_VAR *));
--static SHELL_VAR *assign_hashcmd __P((SHELL_VAR *, char *, arrayind_t, char *));
--# if defined (ALIAS)
--static SHELL_VAR *build_aliasvar __P((SHELL_VAR *));
--static SHELL_VAR *get_aliasvar __P((SHELL_VAR *));
--static SHELL_VAR *assign_aliasvar __P((SHELL_VAR *, char *, arrayind_t, char *));
--# endif
--#endif
--
--static SHELL_VAR *get_funcname __P((SHELL_VAR *));
--static SHELL_VAR *init_funcname_var __P((void));
--
--static void initialize_dynamic_variables __P((void));
--
--static SHELL_VAR *hash_lookup __P((const char *, HASH_TABLE *));
--static SHELL_VAR *new_shell_variable __P((const char *));
--static SHELL_VAR *make_new_variable __P((const char *, HASH_TABLE *));
--static SHELL_VAR *bind_variable_internal __P((const char *, char *, HASH_TABLE *, int, int));
--
--static void dispose_variable_value __P((SHELL_VAR *));
--static void free_variable_hash_data __P((PTR_T));
--
--static VARLIST *vlist_alloc __P((int));
--static VARLIST *vlist_realloc __P((VARLIST *, int));
--static void vlist_add __P((VARLIST *, SHELL_VAR *, int));
--
--static void flatten __P((HASH_TABLE *, sh_var_map_func_t *, VARLIST *, int));
--
--static int qsort_var_comp __P((SHELL_VAR **, SHELL_VAR **));
--
--static SHELL_VAR **vapply __P((sh_var_map_func_t *));
--static SHELL_VAR **fapply __P((sh_var_map_func_t *));
--
--static int visible_var __P((SHELL_VAR *));
--static int visible_and_exported __P((SHELL_VAR *));
--static int export_environment_candidate __P((SHELL_VAR *));
--static int local_and_exported __P((SHELL_VAR *));
--static int variable_in_context __P((SHELL_VAR *));
--#if defined (ARRAY_VARS)
--static int visible_array_vars __P((SHELL_VAR *));
--#endif
--
--static SHELL_VAR *find_nameref_at_context __P((SHELL_VAR *, VAR_CONTEXT *));
--static SHELL_VAR *find_variable_nameref_context __P((SHELL_VAR *, VAR_CONTEXT *, VAR_CONTEXT **));
--static SHELL_VAR *find_variable_last_nameref_context __P((SHELL_VAR *, VAR_CONTEXT *, VAR_CONTEXT **));
--
--static SHELL_VAR *bind_tempenv_variable __P((const char *, char *));
--static void push_temp_var __P((PTR_T));
--static void propagate_temp_var __P((PTR_T));
--static void dispose_temporary_env __P((sh_free_func_t *));
--
--static inline char *mk_env_string __P((const char *, const char *, int));
--static char **make_env_array_from_var_list __P((SHELL_VAR **));
--static char **make_var_export_array __P((VAR_CONTEXT *));
--static char **make_func_export_array __P((void));
--static void add_temp_array_to_env __P((char **, int, int));
--
--static int n_shell_variables __P((void));
--static int set_context __P((SHELL_VAR *));
--
--static void push_func_var __P((PTR_T));
--static void push_exported_var __P((PTR_T));
--
--static inline int find_special_var __P((const char *));
--
--static void
--create_variable_tables ()
--{
-- if (shell_variables == 0)
-- {
-- shell_variables = global_variables = new_var_context ((char *)NULL, 0);
-- shell_variables->scope = 0;
-- shell_variables->table = hash_create (0);
-- }
--
-- if (shell_functions == 0)
-- shell_functions = hash_create (0);
--
--#if defined (DEBUGGER)
-- if (shell_function_defs == 0)
-- shell_function_defs = hash_create (0);
--#endif
--}
--
--/* Initialize the shell variables from the current environment.
-- If PRIVMODE is nonzero, don't import functions from ENV or
-- parse $SHELLOPTS. */
--void
--initialize_shell_variables (env, privmode)
-- char **env;
-- int privmode;
--{
-- char *name, *string, *temp_string;
-- int c, char_index, string_index, string_length, ro;
-- SHELL_VAR *temp_var;
--
-- create_variable_tables ();
--
-- for (string_index = 0; string = env[string_index++]; )
-- {
-- char_index = 0;
-- name = string;
-- while ((c = *string++) && c != '=')
-- ;
-- if (string[-1] == '=')
-- char_index = string - name - 1;
--
-- /* If there are weird things in the environment, like `=xxx' or a
-- string without an `=', just skip them. */
-- if (char_index == 0)
-- continue;
--
-- /* ASSERT(name[char_index] == '=') */
-- name[char_index] = '\0';
-- /* Now, name = env variable name, string = env variable value, and
-- char_index == strlen (name) */
--
-- temp_var = (SHELL_VAR *)NULL;
--
-- /* If exported function, define it now. Don't import functions from
-- the environment in privileged mode. */
-- if (privmode == 0 && read_but_dont_execute == 0 &&
-- STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) &&
-- STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) &&
-- STREQN ("() {", string, 4))
-- {
-- size_t namelen;
-- char *tname; /* desired imported function name */
--
-- namelen = char_index - BASHFUNC_PREFLEN - BASHFUNC_SUFFLEN;
--
-- tname = name + BASHFUNC_PREFLEN; /* start of func name */
-- tname[namelen] = '\0'; /* now tname == func name */
--
-- string_length = strlen (string);
-- temp_string = (char *)xmalloc (namelen + string_length + 2);
--
-- memcpy (temp_string, tname, namelen);
-- temp_string[namelen] = ' ';
-- memcpy (temp_string + namelen + 1, string, string_length + 1);
--
-- /* Don't import function names that are invalid identifiers from the
-- environment, though we still allow them to be defined as shell
-- variables. */
-- if (absolute_program (tname) == 0 && (posixly_correct == 0 || legal_identifier (tname)))
-- parse_and_execute (temp_string, tname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
--
-- if (temp_var = find_function (tname))
-- {
-- VSETATTR (temp_var, (att_exported|att_imported));
-- array_needs_making = 1;
-- }
-- else
-- {
-- if (temp_var = bind_variable (name, string, 0))
-- {
-- VSETATTR (temp_var, (att_exported | att_imported | att_invisible));
-- array_needs_making = 1;
-- }
-- last_command_exit_value = 1;
-- report_error (_("error importing function definition for `%s'"), tname);
-- }
--
-- /* Restore original suffix */
-- tname[namelen] = BASHFUNC_SUFFIX[0];
-- }
--#if defined (ARRAY_VARS)
--# if ARRAY_EXPORT
-- /* Array variables may not yet be exported. */
-- else if (*string == '(' && string[1] == '[' && string[strlen (string) - 1] == ')')
-- {
-- string_length = 1;
-- temp_string = extract_array_assignment_list (string, &string_length);
-- temp_var = assign_array_from_string (name, temp_string);
-- FREE (temp_string);
-- VSETATTR (temp_var, (att_exported | att_imported));
-- array_needs_making = 1;
-- }
--# endif /* ARRAY_EXPORT */
--#endif
--#if 0
-- else if (legal_identifier (name))
--#else
-- else
--#endif
-- {
-- ro = 0;
-- if (posixly_correct && STREQ (name, "SHELLOPTS"))
-- {
-- temp_var = find_variable ("SHELLOPTS");
-- ro = temp_var && readonly_p (temp_var);
-- if (temp_var)
-- VUNSETATTR (temp_var, att_readonly);
-- }
-- temp_var = bind_variable (name, string, 0);
-- if (temp_var)
-- {
-- if (legal_identifier (name))
-- VSETATTR (temp_var, (att_exported | att_imported));
-- else
-- VSETATTR (temp_var, (att_exported | att_imported | att_invisible));
-- if (ro)
-- VSETATTR (temp_var, att_readonly);
-- array_needs_making = 1;
-- }
-- }
--
-- name[char_index] = '=';
-- /* temp_var can be NULL if it was an exported function with a syntax
-- error (a different bug, but it still shouldn't dump core). */
-- if (temp_var && function_p (temp_var) == 0) /* XXX not yet */
-- {
-- CACHE_IMPORTSTR (temp_var, name);
-- }
-- }
--
-- set_pwd ();
--
-- /* Set up initial value of $_ */
-- temp_var = set_if_not ("_", dollar_vars[0]);
--
-- /* Remember this pid. */
-- dollar_dollar_pid = getpid ();
--
-- /* Now make our own defaults in case the vars that we think are
-- important are missing. */
-- temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE);
--#if 0
-- set_auto_export (temp_var); /* XXX */
--#endif
--
-- temp_var = set_if_not ("TERM", "dumb");
--#if 0
-- set_auto_export (temp_var); /* XXX */
--#endif
--
--#if defined (__QNX__)
-- /* set node id -- don't import it from the environment */
-- {
-- char node_name[22];
--# if defined (__QNXNTO__)
-- netmgr_ndtostr(ND2S_LOCAL_STR, ND_LOCAL_NODE, node_name, sizeof(node_name));
--# else
-- qnx_nidtostr (getnid (), node_name, sizeof (node_name));
--# endif
-- temp_var = bind_variable ("NODE", node_name, 0);
-- set_auto_export (temp_var);
-- }
--#endif
--
-- /* set up the prompts. */
-- if (interactive_shell)
-- {
--#if defined (PROMPT_STRING_DECODE)
-- set_if_not ("PS1", primary_prompt);
--#else
-- if (current_user.uid == -1)
-- get_current_user_info ();
-- set_if_not ("PS1", current_user.euid == 0 ? "# " : primary_prompt);
--#endif
-- set_if_not ("PS2", secondary_prompt);
-- }
-- set_if_not ("PS4", "+ ");
--
-- /* Don't allow IFS to be imported from the environment. */
-- temp_var = bind_variable ("IFS", " \t\n", 0);
-- setifs (temp_var);
--
-- /* Magic machine types. Pretty convenient. */
-- set_machine_vars ();
--
-- /* Default MAILCHECK for interactive shells. Defer the creation of a
-- default MAILPATH until the startup files are read, because MAIL
-- names a mail file if MAILPATH is not set, and we should provide a
-- default only if neither is set. */
-- if (interactive_shell)
-- {
-- temp_var = set_if_not ("MAILCHECK", posixly_correct ? "600" : "60");
-- VSETATTR (temp_var, att_integer);
-- }
--
-- /* Do some things with shell level. */
-- initialize_shell_level ();
--
-- set_ppid ();
--
-- /* Initialize the `getopts' stuff. */
-- temp_var = bind_variable ("OPTIND", "1", 0);
-- VSETATTR (temp_var, att_integer);
-- getopts_reset (0);
-- bind_variable ("OPTERR", "1", 0);
-- sh_opterr = 1;
--
-- if (login_shell == 1 && posixly_correct == 0)
-- set_home_var ();
--
-- /* Get the full pathname to THIS shell, and set the BASH variable
-- to it. */
-- name = get_bash_name ();
-- temp_var = bind_variable ("BASH", name, 0);
-- free (name);
--
-- /* Make the exported environment variable SHELL be the user's login
-- shell. Note that the `tset' command looks at this variable
-- to determine what style of commands to output; if it ends in "csh",
-- then C-shell commands are output, else Bourne shell commands. */
-- set_shell_var ();
--
-- /* Make a variable called BASH_VERSION which contains the version info. */
-- bind_variable ("BASH_VERSION", shell_version_string (), 0);
--#if defined (ARRAY_VARS)
-- make_vers_array ();
--#endif
--
-- if (command_execution_string)
-- bind_variable ("BASH_EXECUTION_STRING", command_execution_string, 0);
--
-- /* Find out if we're supposed to be in Posix.2 mode via an
-- environment variable. */
-- temp_var = find_variable ("POSIXLY_CORRECT");
-- if (!temp_var)
-- temp_var = find_variable ("POSIX_PEDANTIC");
-- if (temp_var && imported_p (temp_var))
-- sv_strict_posix (temp_var->name);
--
--#if defined (HISTORY)
-- /* Set history variables to defaults, and then do whatever we would
-- do if the variable had just been set. Do this only in the case
-- that we are remembering commands on the history list. */
-- if (remember_on_history)
-- {
-- name = bash_tilde_expand (posixly_correct ? "~/.sh_history" : "~/.bash_history", 0);
--
-- set_if_not ("HISTFILE", name);
-- free (name);
-- }
--#endif /* HISTORY */
--
-- /* Seed the random number generator. */
-- seedrand ();
--
-- /* Handle some "special" variables that we may have inherited from a
-- parent shell. */
-- if (interactive_shell)
-- {
-- temp_var = find_variable ("IGNOREEOF");
-- if (!temp_var)
-- temp_var = find_variable ("ignoreeof");
-- if (temp_var && imported_p (temp_var))
-- sv_ignoreeof (temp_var->name);
-- }
--
--#if defined (HISTORY)
-- if (interactive_shell && remember_on_history)
-- {
-- sv_history_control ("HISTCONTROL");
-- sv_histignore ("HISTIGNORE");
-- sv_histtimefmt ("HISTTIMEFORMAT");
-- }
--#endif /* HISTORY */
--
--#if defined (READLINE) && defined (STRICT_POSIX)
-- /* POSIXLY_CORRECT will only be 1 here if the shell was compiled
-- -DSTRICT_POSIX */
-- if (interactive_shell && posixly_correct && no_line_editing == 0)
-- rl_prefer_env_winsize = 1;
--#endif /* READLINE && STRICT_POSIX */
--
-- /*
-- * 24 October 2001
-- *
-- * I'm tired of the arguing and bug reports. Bash now leaves SSH_CLIENT
-- * and SSH2_CLIENT alone. I'm going to rely on the shell_level check in
-- * isnetconn() to avoid running the startup files more often than wanted.
-- * That will, of course, only work if the user's login shell is bash, so
-- * I've made that behavior conditional on SSH_SOURCE_BASHRC being defined
-- * in config-top.h.
-- */
--#if 0
-- temp_var = find_variable ("SSH_CLIENT");
-- if (temp_var && imported_p (temp_var))
-- {
-- VUNSETATTR (temp_var, att_exported);
-- array_needs_making = 1;
-- }
-- temp_var = find_variable ("SSH2_CLIENT");
-- if (temp_var && imported_p (temp_var))
-- {
-- VUNSETATTR (temp_var, att_exported);
-- array_needs_making = 1;
-- }
--#endif
--
-- /* Get the user's real and effective user ids. */
-- uidset ();
--
-- temp_var = find_variable ("BASH_XTRACEFD");
-- if (temp_var && imported_p (temp_var))
-- sv_xtracefd (temp_var->name);
--
-- /* Initialize the dynamic variables, and seed their values. */
-- initialize_dynamic_variables ();
--}
--
--/* **************************************************************** */
--/* */
--/* Setting values for special shell variables */
--/* */
--/* **************************************************************** */
--
--static void
--set_machine_vars ()
--{
-- SHELL_VAR *temp_var;
--
-- temp_var = set_if_not ("HOSTTYPE", HOSTTYPE);
-- temp_var = set_if_not ("OSTYPE", OSTYPE);
-- temp_var = set_if_not ("MACHTYPE", MACHTYPE);
--
-- temp_var = set_if_not ("HOSTNAME", current_host_name);
--}
--
--/* Set $HOME to the information in the password file if we didn't get
-- it from the environment. */
--
--/* This function is not static so the tilde and readline libraries can
-- use it. */
--char *
--sh_get_home_dir ()
--{
-- if (current_user.home_dir == 0)
-- get_current_user_info ();
-- return current_user.home_dir;
--}
--
--static void
--set_home_var ()
--{
-- SHELL_VAR *temp_var;
--
-- temp_var = find_variable ("HOME");
-- if (temp_var == 0)
-- temp_var = bind_variable ("HOME", sh_get_home_dir (), 0);
--#if 0
-- VSETATTR (temp_var, att_exported);
--#endif
--}
--
--/* Set $SHELL to the user's login shell if it is not already set. Call
-- get_current_user_info if we haven't already fetched the shell. */
--static void
--set_shell_var ()
--{
-- SHELL_VAR *temp_var;
--
-- temp_var = find_variable ("SHELL");
-- if (temp_var == 0)
-- {
-- if (current_user.shell == 0)
-- get_current_user_info ();
-- temp_var = bind_variable ("SHELL", current_user.shell, 0);
-- }
--#if 0
-- VSETATTR (temp_var, att_exported);
--#endif
--}
--
--static char *
--get_bash_name ()
--{
-- char *name;
--
-- if ((login_shell == 1) && RELPATH(shell_name))
-- {
-- if (current_user.shell == 0)
-- get_current_user_info ();
-- name = savestring (current_user.shell);
-- }
-- else if (ABSPATH(shell_name))
-- name = savestring (shell_name);
-- else if (shell_name[0] == '.' && shell_name[1] == '/')
-- {
-- /* Fast path for common case. */
-- char *cdir;
-- int len;
--
-- cdir = get_string_value ("PWD");
-- if (cdir)
-- {
-- len = strlen (cdir);
-- name = (char *)xmalloc (len + strlen (shell_name) + 1);
-- strcpy (name, cdir);
-- strcpy (name + len, shell_name + 1);
-- }
-- else
-- name = savestring (shell_name);
-- }
-- else
-- {
-- char *tname;
-- int s;
--
-- tname = find_user_command (shell_name);
--
-- if (tname == 0)
-- {
-- /* Try the current directory. If there is not an executable
-- there, just punt and use the login shell. */
-- s = file_status (shell_name);
-- if (s & FS_EXECABLE)
-- {
-- tname = make_absolute (shell_name, get_string_value ("PWD"));
-- if (*shell_name == '.')
-- {
-- name = sh_canonpath (tname, PATH_CHECKDOTDOT|PATH_CHECKEXISTS);
-- if (name == 0)
-- name = tname;
-- else
-- free (tname);
-- }
-- else
-- name = tname;
-- }
-- else
-- {
-- if (current_user.shell == 0)
-- get_current_user_info ();
-- name = savestring (current_user.shell);
-- }
-- }
-- else
-- {
-- name = full_pathname (tname);
-- free (tname);
-- }
-- }
--
-- return (name);
--}
--
--void
--adjust_shell_level (change)
-- int change;
--{
-- char new_level[5], *old_SHLVL;
-- intmax_t old_level;
-- SHELL_VAR *temp_var;
--
-- old_SHLVL = get_string_value ("SHLVL");
-- if (old_SHLVL == 0 || *old_SHLVL == '\0' || legal_number (old_SHLVL, &old_level) == 0)
-- old_level = 0;
--
-- shell_level = old_level + change;
-- if (shell_level < 0)
-- shell_level = 0;
-- else if (shell_level > 1000)
-- {
-- internal_warning (_("shell level (%d) too high, resetting to 1"), shell_level);
-- shell_level = 1;
-- }
--
-- /* We don't need the full generality of itos here. */
-- if (shell_level < 10)
-- {
-- new_level[0] = shell_level + '0';
-- new_level[1] = '\0';
-- }
-- else if (shell_level < 100)
-- {
-- new_level[0] = (shell_level / 10) + '0';
-- new_level[1] = (shell_level % 10) + '0';
-- new_level[2] = '\0';
-- }
-- else if (shell_level < 1000)
-- {
-- new_level[0] = (shell_level / 100) + '0';
-- old_level = shell_level % 100;
-- new_level[1] = (old_level / 10) + '0';
-- new_level[2] = (old_level % 10) + '0';
-- new_level[3] = '\0';
-- }
--
-- temp_var = bind_variable ("SHLVL", new_level, 0);
-- set_auto_export (temp_var);
--}
--
--static void
--initialize_shell_level ()
--{
-- adjust_shell_level (1);
--}
--
--/* If we got PWD from the environment, update our idea of the current
-- working directory. In any case, make sure that PWD exists before
-- checking it. It is possible for getcwd () to fail on shell startup,
-- and in that case, PWD would be undefined. If this is an interactive
-- login shell, see if $HOME is the current working directory, and if
-- that's not the same string as $PWD, set PWD=$HOME. */
--
--void
--set_pwd ()
--{
-- SHELL_VAR *temp_var, *home_var;
-- char *temp_string, *home_string;
--
-- home_var = find_variable ("HOME");
-- home_string = home_var ? value_cell (home_var) : (char *)NULL;
--
-- temp_var = find_variable ("PWD");
-- if (temp_var && imported_p (temp_var) &&
-- (temp_string = value_cell (temp_var)) &&
-- same_file (temp_string, ".", (struct stat *)NULL, (struct stat *)NULL))
-- set_working_directory (temp_string);
-- else if (home_string && interactive_shell && login_shell &&
-- same_file (home_string, ".", (struct stat *)NULL, (struct stat *)NULL))
-- {
-- set_working_directory (home_string);
-- temp_var = bind_variable ("PWD", home_string, 0);
-- set_auto_export (temp_var);
-- }
-- else
-- {
-- temp_string = get_working_directory ("shell-init");
-- if (temp_string)
-- {
-- temp_var = bind_variable ("PWD", temp_string, 0);
-- set_auto_export (temp_var);
-- free (temp_string);
-- }
-- }
--
-- /* According to the Single Unix Specification, v2, $OLDPWD is an
-- `environment variable' and therefore should be auto-exported.
-- Make a dummy invisible variable for OLDPWD, and mark it as exported. */
-- temp_var = bind_variable ("OLDPWD", (char *)NULL, 0);
-- VSETATTR (temp_var, (att_exported | att_invisible));
--}
--
--/* Make a variable $PPID, which holds the pid of the shell's parent. */
--void
--set_ppid ()
--{
-- char namebuf[INT_STRLEN_BOUND(pid_t) + 1], *name;
-- SHELL_VAR *temp_var;
--
-- name = inttostr (getppid (), namebuf, sizeof(namebuf));
-- temp_var = find_variable ("PPID");
-- if (temp_var)
-- VUNSETATTR (temp_var, (att_readonly | att_exported));
-- temp_var = bind_variable ("PPID", name, 0);
-- VSETATTR (temp_var, (att_readonly | att_integer));
--}
--
--static void
--uidset ()
--{
-- char buff[INT_STRLEN_BOUND(uid_t) + 1], *b;
-- register SHELL_VAR *v;
--
-- b = inttostr (current_user.uid, buff, sizeof (buff));
-- v = find_variable ("UID");
-- if (v == 0)
-- {
-- v = bind_variable ("UID", b, 0);
-- VSETATTR (v, (att_readonly | att_integer));
-- }
--
-- if (current_user.euid != current_user.uid)
-- b = inttostr (current_user.euid, buff, sizeof (buff));
--
-- v = find_variable ("EUID");
-- if (v == 0)
-- {
-- v = bind_variable ("EUID", b, 0);
-- VSETATTR (v, (att_readonly | att_integer));
-- }
--}
--
--#if defined (ARRAY_VARS)
--static void
--make_vers_array ()
--{
-- SHELL_VAR *vv;
-- ARRAY *av;
-- char *s, d[32], b[INT_STRLEN_BOUND(int) + 1];
--
-- unbind_variable ("BASH_VERSINFO");
--
-- vv = make_new_array_variable ("BASH_VERSINFO");
-- av = array_cell (vv);
-- strcpy (d, dist_version);
-- s = strchr (d, '.');
-- if (s)
-- *s++ = '\0';
-- array_insert (av, 0, d);
-- array_insert (av, 1, s);
-- s = inttostr (patch_level, b, sizeof (b));
-- array_insert (av, 2, s);
-- s = inttostr (build_version, b, sizeof (b));
-- array_insert (av, 3, s);
-- array_insert (av, 4, release_status);
-- array_insert (av, 5, MACHTYPE);
--
-- VSETATTR (vv, att_readonly);
--}
--#endif /* ARRAY_VARS */
--
--/* Set the environment variables $LINES and $COLUMNS in response to
-- a window size change. */
--void
--sh_set_lines_and_columns (lines, cols)
-- int lines, cols;
--{
-- char val[INT_STRLEN_BOUND(int) + 1], *v;
--
--#if defined (READLINE)
-- /* If we are currently assigning to LINES or COLUMNS, don't do anything. */
-- if (winsize_assignment)
-- return;
--#endif
--
-- v = inttostr (lines, val, sizeof (val));
-- bind_variable ("LINES", v, 0);
--
-- v = inttostr (cols, val, sizeof (val));
-- bind_variable ("COLUMNS", v, 0);
--}
--
--/* **************************************************************** */
--/* */
--/* Printing variables and values */
--/* */
--/* **************************************************************** */
--
--/* Print LIST (a list of shell variables) to stdout in such a way that
-- they can be read back in. */
--void
--print_var_list (list)
-- register SHELL_VAR **list;
--{
-- register int i;
-- register SHELL_VAR *var;
--
-- for (i = 0; list && (var = list[i]); i++)
-- if (invisible_p (var) == 0)
-- print_assignment (var);
--}
--
--/* Print LIST (a list of shell functions) to stdout in such a way that
-- they can be read back in. */
--void
--print_func_list (list)
-- register SHELL_VAR **list;
--{
-- register int i;
-- register SHELL_VAR *var;
--
-- for (i = 0; list && (var = list[i]); i++)
-- {
-- printf ("%s ", var->name);
-- print_var_function (var);
-- printf ("\n");
-- }
--}
--
--/* Print the value of a single SHELL_VAR. No newline is
-- output, but the variable is printed in such a way that
-- it can be read back in. */
--void
--print_assignment (var)
-- SHELL_VAR *var;
--{
-- if (var_isset (var) == 0)
-- return;
--
-- if (function_p (var))
-- {
-- printf ("%s", var->name);
-- print_var_function (var);
-- printf ("\n");
-- }
--#if defined (ARRAY_VARS)
-- else if (array_p (var))
-- print_array_assignment (var, 0);
-- else if (assoc_p (var))
-- print_assoc_assignment (var, 0);
--#endif /* ARRAY_VARS */
-- else
-- {
-- printf ("%s=", var->name);
-- print_var_value (var, 1);
-- printf ("\n");
-- }
--}
--
--/* Print the value cell of VAR, a shell variable. Do not print
-- the name, nor leading/trailing newline. If QUOTE is non-zero,
-- and the value contains shell metacharacters, quote the value
-- in such a way that it can be read back in. */
--void
--print_var_value (var, quote)
-- SHELL_VAR *var;
-- int quote;
--{
-- char *t;
--
-- if (var_isset (var) == 0)
-- return;
--
-- if (quote && posixly_correct == 0 && ansic_shouldquote (value_cell (var)))
-- {
-- t = ansic_quote (value_cell (var), 0, (int *)0);
-- printf ("%s", t);
-- free (t);
-- }
-- else if (quote && sh_contains_shell_metas (value_cell (var)))
-- {
-- t = sh_single_quote (value_cell (var));
-- printf ("%s", t);
-- free (t);
-- }
-- else
-- printf ("%s", value_cell (var));
--}
--
--/* Print the function cell of VAR, a shell variable. Do not
-- print the name, nor leading/trailing newline. */
--void
--print_var_function (var)
-- SHELL_VAR *var;
--{
-- char *x;
--
-- if (function_p (var) && var_isset (var))
-- {
-- x = named_function_string ((char *)NULL, function_cell(var), FUNC_MULTILINE|FUNC_EXTERNAL);
-- printf ("%s", x);
-- }
--}
--
--/* **************************************************************** */
--/* */
--/* Dynamic Variables */
--/* */
--/* **************************************************************** */
--
--/* DYNAMIC VARIABLES
--
-- These are variables whose values are generated anew each time they are
-- referenced. These are implemented using a pair of function pointers
-- in the struct variable: assign_func, which is called from bind_variable
-- and, if arrays are compiled into the shell, some of the functions in
-- arrayfunc.c, and dynamic_value, which is called from find_variable.
--
-- assign_func is called from bind_variable_internal, if
-- bind_variable_internal discovers that the variable being assigned to
-- has such a function. The function is called as
-- SHELL_VAR *temp = (*(entry->assign_func)) (entry, value, ind)
-- and the (SHELL_VAR *)temp is returned as the value of bind_variable. It
-- is usually ENTRY (self). IND is an index for an array variable, and
-- unused otherwise.
--
-- dynamic_value is called from find_variable_internal to return a `new'
-- value for the specified dynamic varible. If this function is NULL,
-- the variable is treated as a `normal' shell variable. If it is not,
-- however, then this function is called like this:
-- tempvar = (*(var->dynamic_value)) (var);
--
-- Sometimes `tempvar' will replace the value of `var'. Other times, the
-- shell will simply use the string value. Pretty object-oriented, huh?
--
-- Be warned, though: if you `unset' a special variable, it loses its
-- special meaning, even if you subsequently set it.
--
-- The special assignment code would probably have been better put in
-- subst.c: do_assignment_internal, in the same style as
-- stupidly_hack_special_variables, but I wanted the changes as
-- localized as possible. */
--
--#define INIT_DYNAMIC_VAR(var, val, gfunc, afunc) \
-- do \
-- { \
-- v = bind_variable (var, (val), 0); \
-- v->dynamic_value = gfunc; \
-- v->assign_func = afunc; \
-- } \
-- while (0)
--
--#define INIT_DYNAMIC_ARRAY_VAR(var, gfunc, afunc) \
-- do \
-- { \
-- v = make_new_array_variable (var); \
-- v->dynamic_value = gfunc; \
-- v->assign_func = afunc; \
-- } \
-- while (0)
--
--#define INIT_DYNAMIC_ASSOC_VAR(var, gfunc, afunc) \
-- do \
-- { \
-- v = make_new_assoc_variable (var); \
-- v->dynamic_value = gfunc; \
-- v->assign_func = afunc; \
-- } \
-- while (0)
--
--static SHELL_VAR *
--null_assign (self, value, unused, key)
-- SHELL_VAR *self;
-- char *value;
-- arrayind_t unused;
-- char *key;
--{
-- return (self);
--}
--
--#if defined (ARRAY_VARS)
--static SHELL_VAR *
--null_array_assign (self, value, ind, key)
-- SHELL_VAR *self;
-- char *value;
-- arrayind_t ind;
-- char *key;
--{
-- return (self);
--}
--#endif
--
--/* Degenerate `dynamic_value' function; just returns what's passed without
-- manipulation. */
--static SHELL_VAR *
--get_self (self)
-- SHELL_VAR *self;
--{
-- return (self);
--}
--
--#if defined (ARRAY_VARS)
--/* A generic dynamic array variable initializer. Initialize array variable
-- NAME with dynamic value function GETFUNC and assignment function SETFUNC. */
--static SHELL_VAR *
--init_dynamic_array_var (name, getfunc, setfunc, attrs)
-- char *name;
-- sh_var_value_func_t *getfunc;
-- sh_var_assign_func_t *setfunc;
-- int attrs;
--{
-- SHELL_VAR *v;
--
-- v = find_variable (name);
-- if (v)
-- return (v);
-- INIT_DYNAMIC_ARRAY_VAR (name, getfunc, setfunc);
-- if (attrs)
-- VSETATTR (v, attrs);
-- return v;
--}
--
--static SHELL_VAR *
--init_dynamic_assoc_var (name, getfunc, setfunc, attrs)
-- char *name;
-- sh_var_value_func_t *getfunc;
-- sh_var_assign_func_t *setfunc;
-- int attrs;
--{
-- SHELL_VAR *v;
--
-- v = find_variable (name);
-- if (v)
-- return (v);
-- INIT_DYNAMIC_ASSOC_VAR (name, getfunc, setfunc);
-- if (attrs)
-- VSETATTR (v, attrs);
-- return v;
--}
--#endif
--
--/* The value of $SECONDS. This is the number of seconds since shell
-- invocation, or, the number of seconds since the last assignment + the
-- value of the last assignment. */
--static intmax_t seconds_value_assigned;
--
--static SHELL_VAR *
--assign_seconds (self, value, unused, key)
-- SHELL_VAR *self;
-- char *value;
-- arrayind_t unused;
-- char *key;
--{
-- if (legal_number (value, &seconds_value_assigned) == 0)
-- seconds_value_assigned = 0;
-- shell_start_time = NOW;
-- return (self);
--}
--
--static SHELL_VAR *
--get_seconds (var)
-- SHELL_VAR *var;
--{
-- time_t time_since_start;
-- char *p;
--
-- time_since_start = NOW - shell_start_time;
-- p = itos(seconds_value_assigned + time_since_start);
--
-- FREE (value_cell (var));
--
-- VSETATTR (var, att_integer);
-- var_setvalue (var, p);
-- return (var);
--}
--
--static SHELL_VAR *
--init_seconds_var ()
--{
-- SHELL_VAR *v;
--
-- v = find_variable ("SECONDS");
-- if (v)
-- {
-- if (legal_number (value_cell(v), &seconds_value_assigned) == 0)
-- seconds_value_assigned = 0;
-- }
-- INIT_DYNAMIC_VAR ("SECONDS", (v ? value_cell (v) : (char *)NULL), get_seconds, assign_seconds);
-- return v;
--}
--
--/* The random number seed. You can change this by setting RANDOM. */
--static unsigned long rseed = 1;
--static int last_random_value;
--static int seeded_subshell = 0;
--
--/* A linear congruential random number generator based on the example
-- one in the ANSI C standard. This one isn't very good, but a more
-- complicated one is overkill. */
--
--/* Returns a pseudo-random number between 0 and 32767. */
--static int
--brand ()
--{
-- /* From "Random number generators: good ones are hard to find",
-- Park and Miller, Communications of the ACM, vol. 31, no. 10,
-- October 1988, p. 1195. filtered through FreeBSD */
-- long h, l;
--
-- /* Can't seed with 0. */
-- if (rseed == 0)
-- rseed = 123459876;
-- h = rseed / 127773;
-- l = rseed % 127773;
-- rseed = 16807 * l - 2836 * h;
--#if 0
-- if (rseed < 0)
-- rseed += 0x7fffffff;
--#endif
-- return ((unsigned int)(rseed & 32767)); /* was % 32768 */
--}
--
--/* Set the random number generator seed to SEED. */
--static void
--sbrand (seed)
-- unsigned long seed;
--{
-- rseed = seed;
-- last_random_value = 0;
--}
--
--static void
--seedrand ()
--{
-- struct timeval tv;
--
-- gettimeofday (&tv, NULL);
-- sbrand (tv.tv_sec ^ tv.tv_usec ^ getpid ());
--}
--
--static SHELL_VAR *
--assign_random (self, value, unused, key)
-- SHELL_VAR *self;
-- char *value;
-- arrayind_t unused;
-- char *key;
--{
-- sbrand (strtoul (value, (char **)NULL, 10));
-- if (subshell_environment)
-- seeded_subshell = getpid ();
-- return (self);
--}
--
--int
--get_random_number ()
--{
-- int rv, pid;
--
-- /* Reset for command and process substitution. */
-- pid = getpid ();
-- if (subshell_environment && seeded_subshell != pid)
-- {
-- seedrand ();
-- seeded_subshell = pid;
-- }
--
-- do
-- rv = brand ();
-- while (rv == last_random_value);
-- return rv;
--}
--
--static SHELL_VAR *
--get_random (var)
-- SHELL_VAR *var;
--{
-- int rv;
-- char *p;
--
-- rv = get_random_number ();
-- last_random_value = rv;
-- p = itos (rv);
--
-- FREE (value_cell (var));
--
-- VSETATTR (var, att_integer);
-- var_setvalue (var, p);
-- return (var);
--}
--
--static SHELL_VAR *
--assign_lineno (var, value, unused, key)
-- SHELL_VAR *var;
-- char *value;
-- arrayind_t unused;
-- char *key;
--{
-- intmax_t new_value;
--
-- if (value == 0 || *value == '\0' || legal_number (value, &new_value) == 0)
-- new_value = 0;
-- line_number = line_number_base = new_value;
-- return var;
--}
--
--/* Function which returns the current line number. */
--static SHELL_VAR *
--get_lineno (var)
-- SHELL_VAR *var;
--{
-- char *p;
-- int ln;
--
-- ln = executing_line_number ();
-- p = itos (ln);
-- FREE (value_cell (var));
-- var_setvalue (var, p);
-- return (var);
--}
--
--static SHELL_VAR *
--assign_subshell (var, value, unused, key)
-- SHELL_VAR *var;
-- char *value;
-- arrayind_t unused;
-- char *key;
--{
-- intmax_t new_value;
--
-- if (value == 0 || *value == '\0' || legal_number (value, &new_value) == 0)
-- new_value = 0;
-- subshell_level = new_value;
-- return var;
--}
--
--static SHELL_VAR *
--get_subshell (var)
-- SHELL_VAR *var;
--{
-- char *p;
--
-- p = itos (subshell_level);
-- FREE (value_cell (var));
-- var_setvalue (var, p);
-- return (var);
--}
--
--static SHELL_VAR *
--get_bashpid (var)
-- SHELL_VAR *var;
--{
-- int pid;
-- char *p;
--
-- pid = getpid ();
-- p = itos (pid);
--
-- FREE (value_cell (var));
-- VSETATTR (var, att_integer|att_readonly);
-- var_setvalue (var, p);
-- return (var);
--}
--
--static SHELL_VAR *
--get_bash_command (var)
-- SHELL_VAR *var;
--{
-- char *p;
--
-- if (the_printed_command_except_trap)
-- p = savestring (the_printed_command_except_trap);
-- else
-- {
-- p = (char *)xmalloc (1);
-- p[0] = '\0';
-- }
-- FREE (value_cell (var));
-- var_setvalue (var, p);
-- return (var);
--}
--
--#if defined (HISTORY)
--static SHELL_VAR *
--get_histcmd (var)
-- SHELL_VAR *var;
--{
-- char *p;
--
-- p = itos (history_number ());
-- FREE (value_cell (var));
-- var_setvalue (var, p);
-- return (var);
--}
--#endif
--
--#if defined (READLINE)
--/* When this function returns, VAR->value points to malloced memory. */
--static SHELL_VAR *
--get_comp_wordbreaks (var)
-- SHELL_VAR *var;
--{
-- /* If we don't have anything yet, assign a default value. */
-- if (rl_completer_word_break_characters == 0 && bash_readline_initialized == 0)
-- enable_hostname_completion (perform_hostname_completion);
--
-- FREE (value_cell (var));
-- var_setvalue (var, savestring (rl_completer_word_break_characters));
--
-- return (var);
--}
--
--/* When this function returns, rl_completer_word_break_characters points to
-- malloced memory. */
--static SHELL_VAR *
--assign_comp_wordbreaks (self, value, unused, key)
-- SHELL_VAR *self;
-- char *value;
-- arrayind_t unused;
-- char *key;
--{
-- if (rl_completer_word_break_characters &&
-- rl_completer_word_break_characters != rl_basic_word_break_characters)
-- free (rl_completer_word_break_characters);
--
-- rl_completer_word_break_characters = savestring (value);
-- return self;
--}
--#endif /* READLINE */
--
--#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS)
--static SHELL_VAR *
--assign_dirstack (self, value, ind, key)
-- SHELL_VAR *self;
-- char *value;
-- arrayind_t ind;
-- char *key;
--{
-- set_dirstack_element (ind, 1, value);
-- return self;
--}
--
--static SHELL_VAR *
--get_dirstack (self)
-- SHELL_VAR *self;
--{
-- ARRAY *a;
-- WORD_LIST *l;
--
-- l = get_directory_stack (0);
-- a = array_from_word_list (l);
-- array_dispose (array_cell (self));
-- dispose_words (l);
-- var_setarray (self, a);
-- return self;
--}
--#endif /* PUSHD AND POPD && ARRAY_VARS */
--
--#if defined (ARRAY_VARS)
--/* We don't want to initialize the group set with a call to getgroups()
-- unless we're asked to, but we only want to do it once. */
--static SHELL_VAR *
--get_groupset (self)
-- SHELL_VAR *self;
--{
-- register int i;
-- int ng;
-- ARRAY *a;
-- static char **group_set = (char **)NULL;
--
-- if (group_set == 0)
-- {
-- group_set = get_group_list (&ng);
-- a = array_cell (self);
-- for (i = 0; i < ng; i++)
-- array_insert (a, i, group_set[i]);
-- }
-- return (self);
--}
--
--static SHELL_VAR *
--build_hashcmd (self)
-- SHELL_VAR *self;
--{
-- HASH_TABLE *h;
-- int i;
-- char *k, *v;
-- BUCKET_CONTENTS *item;
--
-- h = assoc_cell (self);
-- if (h)
-- assoc_dispose (h);
--
-- if (hashed_filenames == 0 || HASH_ENTRIES (hashed_filenames) == 0)
-- {
-- var_setvalue (self, (char *)NULL);
-- return self;
-- }
--
-- h = assoc_create (hashed_filenames->nbuckets);
-- for (i = 0; i < hashed_filenames->nbuckets; i++)
-- {
-- for (item = hash_items (i, hashed_filenames); item; item = item->next)
-- {
-- k = savestring (item->key);
-- v = pathdata(item)->path;
-- assoc_insert (h, k, v);
-- }
-- }
--
-- var_setvalue (self, (char *)h);
-- return self;
--}
--
--static SHELL_VAR *
--get_hashcmd (self)
-- SHELL_VAR *self;
--{
-- build_hashcmd (self);
-- return (self);
--}
--
--static SHELL_VAR *
--assign_hashcmd (self, value, ind, key)
-- SHELL_VAR *self;
-- char *value;
-- arrayind_t ind;
-- char *key;
--{
-- phash_insert (key, value, 0, 0);
-- return (build_hashcmd (self));
--}
--
--#if defined (ALIAS)
--static SHELL_VAR *
--build_aliasvar (self)
-- SHELL_VAR *self;
--{
-- HASH_TABLE *h;
-- int i;
-- char *k, *v;
-- BUCKET_CONTENTS *item;
--
-- h = assoc_cell (self);
-- if (h)
-- assoc_dispose (h);
--
-- if (aliases == 0 || HASH_ENTRIES (aliases) == 0)
-- {
-- var_setvalue (self, (char *)NULL);
-- return self;
-- }
--
-- h = assoc_create (aliases->nbuckets);
-- for (i = 0; i < aliases->nbuckets; i++)
-- {
-- for (item = hash_items (i, aliases); item; item = item->next)
-- {
-- k = savestring (item->key);
-- v = ((alias_t *)(item->data))->value;
-- assoc_insert (h, k, v);
-- }
-- }
--
-- var_setvalue (self, (char *)h);
-- return self;
--}
--
--static SHELL_VAR *
--get_aliasvar (self)
-- SHELL_VAR *self;
--{
-- build_aliasvar (self);
-- return (self);
--}
--
--static SHELL_VAR *
--assign_aliasvar (self, value, ind, key)
-- SHELL_VAR *self;
-- char *value;
-- arrayind_t ind;
-- char *key;
--{
-- add_alias (key, value);
-- return (build_aliasvar (self));
--}
--#endif /* ALIAS */
--
--#endif /* ARRAY_VARS */
--
--/* If ARRAY_VARS is not defined, this just returns the name of any
-- currently-executing function. If we have arrays, it's a call stack. */
--static SHELL_VAR *
--get_funcname (self)
-- SHELL_VAR *self;
--{
--#if ! defined (ARRAY_VARS)
-- char *t;
-- if (variable_context && this_shell_function)
-- {
-- FREE (value_cell (self));
-- t = savestring (this_shell_function->name);
-- var_setvalue (self, t);
-- }
--#endif
-- return (self);
--}
--
--void
--make_funcname_visible (on_or_off)
-- int on_or_off;
--{
-- SHELL_VAR *v;
--
-- v = find_variable ("FUNCNAME");
-- if (v == 0 || v->dynamic_value == 0)
-- return;
--
-- if (on_or_off)
-- VUNSETATTR (v, att_invisible);
-- else
-- VSETATTR (v, att_invisible);
--}
--
--static SHELL_VAR *
--init_funcname_var ()
--{
-- SHELL_VAR *v;
--
-- v = find_variable ("FUNCNAME");
-- if (v)
-- return v;
--#if defined (ARRAY_VARS)
-- INIT_DYNAMIC_ARRAY_VAR ("FUNCNAME", get_funcname, null_array_assign);
--#else
-- INIT_DYNAMIC_VAR ("FUNCNAME", (char *)NULL, get_funcname, null_assign);
--#endif
-- VSETATTR (v, att_invisible|att_noassign);
-- return v;
--}
--
--static void
--initialize_dynamic_variables ()
--{
-- SHELL_VAR *v;
--
-- v = init_seconds_var ();
--
-- INIT_DYNAMIC_VAR ("BASH_COMMAND", (char *)NULL, get_bash_command, (sh_var_assign_func_t *)NULL);
-- INIT_DYNAMIC_VAR ("BASH_SUBSHELL", (char *)NULL, get_subshell, assign_subshell);
--
-- INIT_DYNAMIC_VAR ("RANDOM", (char *)NULL, get_random, assign_random);
-- VSETATTR (v, att_integer);
-- INIT_DYNAMIC_VAR ("LINENO", (char *)NULL, get_lineno, assign_lineno);
-- VSETATTR (v, att_integer);
--
-- INIT_DYNAMIC_VAR ("BASHPID", (char *)NULL, get_bashpid, null_assign);
-- VSETATTR (v, att_integer|att_readonly);
--
--#if defined (HISTORY)
-- INIT_DYNAMIC_VAR ("HISTCMD", (char *)NULL, get_histcmd, (sh_var_assign_func_t *)NULL);
-- VSETATTR (v, att_integer);
--#endif
--
--#if defined (READLINE)
-- INIT_DYNAMIC_VAR ("COMP_WORDBREAKS", (char *)NULL, get_comp_wordbreaks, assign_comp_wordbreaks);
--#endif
--
--#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS)
-- v = init_dynamic_array_var ("DIRSTACK", get_dirstack, assign_dirstack, 0);
--#endif /* PUSHD_AND_POPD && ARRAY_VARS */
--
--#if defined (ARRAY_VARS)
-- v = init_dynamic_array_var ("GROUPS", get_groupset, null_array_assign, att_noassign);
--
--# if defined (DEBUGGER)
-- v = init_dynamic_array_var ("BASH_ARGC", get_self, null_array_assign, att_noassign|att_nounset);
-- v = init_dynamic_array_var ("BASH_ARGV", get_self, null_array_assign, att_noassign|att_nounset);
--# endif /* DEBUGGER */
-- v = init_dynamic_array_var ("BASH_SOURCE", get_self, null_array_assign, att_noassign|att_nounset);
-- v = init_dynamic_array_var ("BASH_LINENO", get_self, null_array_assign, att_noassign|att_nounset);
--
-- v = init_dynamic_assoc_var ("BASH_CMDS", get_hashcmd, assign_hashcmd, att_nofree);
--# if defined (ALIAS)
-- v = init_dynamic_assoc_var ("BASH_ALIASES", get_aliasvar, assign_aliasvar, att_nofree);
--# endif
--#endif
--
-- v = init_funcname_var ();
--}
--
--/* **************************************************************** */
--/* */
--/* Retrieving variables and values */
--/* */
--/* **************************************************************** */
--
--/* How to get a pointer to the shell variable or function named NAME.
-- HASHED_VARS is a pointer to the hash table containing the list
-- of interest (either variables or functions). */
--
--static SHELL_VAR *
--hash_lookup (name, hashed_vars)
-- const char *name;
-- HASH_TABLE *hashed_vars;
--{
-- BUCKET_CONTENTS *bucket;
--
-- bucket = hash_search (name, hashed_vars, 0);
-- /* If we find the name in HASHED_VARS, set LAST_TABLE_SEARCHED to that
-- table. */
-- if (bucket)
-- last_table_searched = hashed_vars;
-- return (bucket ? (SHELL_VAR *)bucket->data : (SHELL_VAR *)NULL);
--}
--
--SHELL_VAR *
--var_lookup (name, vcontext)
-- const char *name;
-- VAR_CONTEXT *vcontext;
--{
-- VAR_CONTEXT *vc;
-- SHELL_VAR *v;
--
-- v = (SHELL_VAR *)NULL;
-- for (vc = vcontext; vc; vc = vc->down)
-- if (v = hash_lookup (name, vc->table))
-- break;
--
-- return v;
--}
--
--/* Look up the variable entry named NAME. If SEARCH_TEMPENV is non-zero,
-- then also search the temporarily built list of exported variables.
-- The lookup order is:
-- temporary_env
-- shell_variables list
--*/
--
--SHELL_VAR *
--find_variable_internal (name, force_tempenv)
-- const char *name;
-- int force_tempenv;
--{
-- SHELL_VAR *var;
-- int search_tempenv;
-- VAR_CONTEXT *vc;
--
-- var = (SHELL_VAR *)NULL;
--
-- /* If explicitly requested, first look in the temporary environment for
-- the variable. This allows constructs such as "foo=x eval 'echo $foo'"
-- to get the `exported' value of $foo. This happens if we are executing
-- a function or builtin, or if we are looking up a variable in a
-- "subshell environment". */
-- search_tempenv = force_tempenv || (expanding_redir == 0 && subshell_environment);
--
-- if (search_tempenv && temporary_env)
-- var = hash_lookup (name, temporary_env);
--
-- vc = shell_variables;
--#if 0
--if (search_tempenv == 0 && /* (subshell_environment & SUBSHELL_COMSUB) && */
-- expanding_redir &&
-- (this_shell_builtin == eval_builtin || this_shell_builtin == command_builtin))
-- {
-- itrace("find_variable_internal: search_tempenv == 0: skipping VC_BLTNENV");
-- while (vc && (vc->flags & VC_BLTNENV))
-- vc = vc->down;
-- if (vc == 0)
-- vc = shell_variables;
-- }
--#endif
--
-- if (var == 0)
-- var = var_lookup (name, vc);
--
-- if (var == 0)
-- return ((SHELL_VAR *)NULL);
--
-- return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
--}
--
--/* Look up and resolve the chain of nameref variables starting at V all the
-- way to NULL or non-nameref. */
--SHELL_VAR *
--find_variable_nameref (v)
-- SHELL_VAR *v;
--{
-- int level;
-- char *newname;
-- SHELL_VAR *orig, *oldv;
--
-- level = 0;
-- orig = v;
-- while (v && nameref_p (v))
-- {
-- level++;
-- if (level > NAMEREF_MAX)
-- return ((SHELL_VAR *)0); /* error message here? */
-- newname = nameref_cell (v);
-- if (newname == 0 || *newname == '\0')
-- return ((SHELL_VAR *)0);
-- oldv = v;
-- v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin)));
-- if (v == orig || v == oldv)
-- {
-- internal_warning (_("%s: circular name reference"), orig->name);
-- return ((SHELL_VAR *)0);
-- }
-- }
-- return v;
--}
--
--/* Resolve the chain of nameref variables for NAME. XXX - could change later */
--SHELL_VAR *
--find_variable_last_nameref (name)
-- const char *name;
--{
-- SHELL_VAR *v, *nv;
-- char *newname;
-- int level;
--
-- nv = v = find_variable_noref (name);
-- level = 0;
-- while (v && nameref_p (v))
-- {
-- level++;
-- if (level > NAMEREF_MAX)
-- return ((SHELL_VAR *)0); /* error message here? */
-- newname = nameref_cell (v);
-- if (newname == 0 || *newname == '\0')
-- return ((SHELL_VAR *)0);
-- nv = v;
-- v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin)));
-- }
-- return nv;
--}
--
--/* Resolve the chain of nameref variables for NAME. XXX - could change later */
--SHELL_VAR *
--find_global_variable_last_nameref (name)
-- const char *name;
--{
-- SHELL_VAR *v, *nv;
-- char *newname;
-- int level;
--
-- nv = v = find_global_variable_noref (name);
-- level = 0;
-- while (v && nameref_p (v))
-- {
-- level++;
-- if (level > NAMEREF_MAX)
-- return ((SHELL_VAR *)0); /* error message here? */
-- newname = nameref_cell (v);
-- if (newname == 0 || *newname == '\0')
-- return ((SHELL_VAR *)0);
-- nv = v;
-- v = find_global_variable_noref (newname);
-- }
-- return nv;
--}
--
--static SHELL_VAR *
--find_nameref_at_context (v, vc)
-- SHELL_VAR *v;
-- VAR_CONTEXT *vc;
--{
-- SHELL_VAR *nv, *nv2;
-- VAR_CONTEXT *nvc;
-- char *newname;
-- int level;
--
-- nv = v;
-- level = 1;
-- while (nv && nameref_p (nv))
-- {
-- level++;
-- if (level > NAMEREF_MAX)
-- return ((SHELL_VAR *)NULL);
-- newname = nameref_cell (nv);
-- if (newname == 0 || *newname == '\0')
-- return ((SHELL_VAR *)NULL);
-- nv2 = hash_lookup (newname, vc->table);
-- if (nv2 == 0)
-- break;
-- nv = nv2;
-- }
-- return nv;
--}
--
--/* Do nameref resolution from the VC, which is the local context for some
-- function or builtin, `up' the chain to the global variables context. If
-- NVCP is not NULL, return the variable context where we finally ended the
-- nameref resolution (so the bind_variable_internal can use the correct
-- variable context and hash table). */
--static SHELL_VAR *
--find_variable_nameref_context (v, vc, nvcp)
-- SHELL_VAR *v;
-- VAR_CONTEXT *vc;
-- VAR_CONTEXT **nvcp;
--{
-- SHELL_VAR *nv, *nv2;
-- VAR_CONTEXT *nvc;
--
-- /* Look starting at the current context all the way `up' */
-- for (nv = v, nvc = vc; nvc; nvc = nvc->down)
-- {
-- nv2 = find_nameref_at_context (nv, nvc);
-- if (nv2 == 0)
-- continue;
-- nv = nv2;
-- if (*nvcp)
-- *nvcp = nvc;
-- if (nameref_p (nv) == 0)
-- break;
-- }
-- return (nameref_p (nv) ? (SHELL_VAR *)NULL : nv);
--}
--
--/* Do nameref resolution from the VC, which is the local context for some
-- function or builtin, `up' the chain to the global variables context. If
-- NVCP is not NULL, return the variable context where we finally ended the
-- nameref resolution (so the bind_variable_internal can use the correct
-- variable context and hash table). */
--static SHELL_VAR *
--find_variable_last_nameref_context (v, vc, nvcp)
-- SHELL_VAR *v;
-- VAR_CONTEXT *vc;
-- VAR_CONTEXT **nvcp;
--{
-- SHELL_VAR *nv, *nv2;
-- VAR_CONTEXT *nvc;
--
-- /* Look starting at the current context all the way `up' */
-- for (nv = v, nvc = vc; nvc; nvc = nvc->down)
-- {
-- nv2 = find_nameref_at_context (nv, nvc);
-- if (nv2 == 0)
-- continue;
-- nv = nv2;
-- if (*nvcp)
-- *nvcp = nvc;
-- }
-- return (nameref_p (nv) ? nv : (SHELL_VAR *)NULL);
--}
--
--/* Find a variable, forcing a search of the temporary environment first */
--SHELL_VAR *
--find_variable_tempenv (name)
-- const char *name;
--{
-- SHELL_VAR *var;
--
-- var = find_variable_internal (name, 1);
-- if (var && nameref_p (var))
-- var = find_variable_nameref (var);
-- return (var);
--}
--
--/* Find a variable, not forcing a search of the temporary environment first */
--SHELL_VAR *
--find_variable_notempenv (name)
-- const char *name;
--{
-- SHELL_VAR *var;
--
-- var = find_variable_internal (name, 0);
-- if (var && nameref_p (var))
-- var = find_variable_nameref (var);
-- return (var);
--}
--
--SHELL_VAR *
--find_global_variable (name)
-- const char *name;
--{
-- SHELL_VAR *var;
--
-- var = var_lookup (name, global_variables);
-- if (var && nameref_p (var))
-- var = find_variable_nameref (var);
--
-- if (var == 0)
-- return ((SHELL_VAR *)NULL);
--
-- return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
--}
--
--SHELL_VAR *
--find_global_variable_noref (name)
-- const char *name;
--{
-- SHELL_VAR *var;
--
-- var = var_lookup (name, global_variables);
--
-- if (var == 0)
-- return ((SHELL_VAR *)NULL);
--
-- return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
--}
--
--SHELL_VAR *
--find_shell_variable (name)
-- const char *name;
--{
-- SHELL_VAR *var;
--
-- var = var_lookup (name, shell_variables);
-- if (var && nameref_p (var))
-- var = find_variable_nameref (var);
--
-- if (var == 0)
-- return ((SHELL_VAR *)NULL);
--
-- return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var);
--}
--
--/* Look up the variable entry named NAME. Returns the entry or NULL. */
--SHELL_VAR *
--find_variable (name)
-- const char *name;
--{
-- SHELL_VAR *v;
--
-- last_table_searched = 0;
-- v = find_variable_internal (name, (expanding_redir == 0 && (assigning_in_environment || executing_builtin)));
-- if (v && nameref_p (v))
-- v = find_variable_nameref (v);
-- return v;
--}
--
--SHELL_VAR *
--find_variable_noref (name)
-- const char *name;
--{
-- SHELL_VAR *v;
--
-- v = find_variable_internal (name, (expanding_redir == 0 && (assigning_in_environment || executing_builtin)));
-- return v;
--}
--
--/* Look up the function entry whose name matches STRING.
-- Returns the entry or NULL. */
--SHELL_VAR *
--find_function (name)
-- const char *name;
--{
-- return (hash_lookup (name, shell_functions));
--}
--
--/* Find the function definition for the shell function named NAME. Returns
-- the entry or NULL. */
--FUNCTION_DEF *
--find_function_def (name)
-- const char *name;
--{
--#if defined (DEBUGGER)
-- return ((FUNCTION_DEF *)hash_lookup (name, shell_function_defs));
--#else
-- return ((FUNCTION_DEF *)0);
--#endif
--}
--
--/* Return the value of VAR. VAR is assumed to have been the result of a
-- lookup without any subscript, if arrays are compiled into the shell. */
--char *
--get_variable_value (var)
-- SHELL_VAR *var;
--{
-- if (var == 0)
-- return ((char *)NULL);
--#if defined (ARRAY_VARS)
-- else if (array_p (var))
-- return (array_reference (array_cell (var), 0));
-- else if (assoc_p (var))
-- return (assoc_reference (assoc_cell (var), "0"));
--#endif
-- else
-- return (value_cell (var));
--}
--
--/* Return the string value of a variable. Return NULL if the variable
-- doesn't exist. Don't cons a new string. This is a potential memory
-- leak if the variable is found in the temporary environment. Since
-- functions and variables have separate name spaces, returns NULL if
-- var_name is a shell function only. */
--char *
--get_string_value (var_name)
-- const char *var_name;
--{
-- SHELL_VAR *var;
--
-- var = find_variable (var_name);
-- return ((var) ? get_variable_value (var) : (char *)NULL);
--}
--
--/* This is present for use by the tilde and readline libraries. */
--char *
--sh_get_env_value (v)
-- const char *v;
--{
-- return get_string_value (v);
--}
--
--/* **************************************************************** */
--/* */
--/* Creating and setting variables */
--/* */
--/* **************************************************************** */
--
--/* Set NAME to VALUE if NAME has no value. */
--SHELL_VAR *
--set_if_not (name, value)
-- char *name, *value;
--{
-- SHELL_VAR *v;
--
-- if (shell_variables == 0)
-- create_variable_tables ();
--
-- v = find_variable (name);
-- if (v == 0)
-- v = bind_variable_internal (name, value, global_variables->table, HASH_NOSRCH, 0);
-- return (v);
--}
--
--/* Create a local variable referenced by NAME. */
--SHELL_VAR *
--make_local_variable (name)
-- const char *name;
--{
-- SHELL_VAR *new_var, *old_var;
-- VAR_CONTEXT *vc;
-- int was_tmpvar;
-- char *tmp_value;
--
-- /* local foo; local foo; is a no-op. */
-- old_var = find_variable (name);
-- if (old_var && local_p (old_var) && old_var->context == variable_context)
-- return (old_var);
--
-- was_tmpvar = old_var && tempvar_p (old_var);
-- /* If we're making a local variable in a shell function, the temporary env
-- has already been merged into the function's variable context stack. We
-- can assume that a temporary var in the same context appears in the same
-- VAR_CONTEXT and can safely be returned without creating a new variable
-- (which results in duplicate names in the same VAR_CONTEXT->table */
-- /* We can't just test tmpvar_p because variables in the temporary env given
-- to a shell function appear in the function's local variable VAR_CONTEXT
-- but retain their tempvar attribute. We want temporary variables that are
-- found in temporary_env, hence the test for last_table_searched, which is
-- set in hash_lookup and only (so far) checked here. */
-- if (was_tmpvar && old_var->context == variable_context && last_table_searched != temporary_env)
-- {
-- VUNSETATTR (old_var, att_invisible);
-- return (old_var);
-- }
-- if (was_tmpvar)
-- tmp_value = value_cell (old_var);
--
-- for (vc = shell_variables; vc; vc = vc->down)
-- if (vc_isfuncenv (vc) && vc->scope == variable_context)
-- break;
--
-- if (vc == 0)
-- {
-- internal_error (_("make_local_variable: no function context at current scope"));
-- return ((SHELL_VAR *)NULL);
-- }
-- else if (vc->table == 0)
-- vc->table = hash_create (TEMPENV_HASH_BUCKETS);
--
-- /* Since this is called only from the local/declare/typeset code, we can
-- call builtin_error here without worry (of course, it will also work
-- for anything that sets this_command_name). Variables with the `noassign'
-- attribute may not be made local. The test against old_var's context
-- level is to disallow local copies of readonly global variables (since I
-- believe that this could be a security hole). Readonly copies of calling
-- function local variables are OK. */
-- if (old_var && (noassign_p (old_var) ||
-- (readonly_p (old_var) && old_var->context == 0)))
-- {
-- if (readonly_p (old_var))
-- sh_readonly (name);
-- else if (noassign_p (old_var))
-- builtin_error (_("%s: variable may not be assigned value"), name);
--#if 0
-- /* Let noassign variables through with a warning */
-- if (readonly_p (old_var))
--#endif
-- return ((SHELL_VAR *)NULL);
-- }
--
-- if (old_var == 0)
-- new_var = make_new_variable (name, vc->table);
-- else
-- {
-- new_var = make_new_variable (name, vc->table);
--
-- /* If we found this variable in one of the temporary environments,
-- inherit its value. Watch to see if this causes problems with
-- things like `x=4 local x'. XXX - see above for temporary env
-- variables with the same context level as variable_context */
-- /* XXX - we should only do this if the variable is not an array. */
-- if (was_tmpvar)
-- var_setvalue (new_var, savestring (tmp_value));
--
-- new_var->attributes = exported_p (old_var) ? att_exported : 0;
-- }
--
-- vc->flags |= VC_HASLOCAL;
--
-- new_var->context = variable_context;
-- VSETATTR (new_var, att_local);
--
-- if (ifsname (name))
-- setifs (new_var);
--
-- if (was_tmpvar == 0)
-- VSETATTR (new_var, att_invisible); /* XXX */
-- return (new_var);
--}
--
--/* Create a new shell variable with name NAME. */
--static SHELL_VAR *
--new_shell_variable (name)
-- const char *name;
--{
-- SHELL_VAR *entry;
--
-- entry = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR));
--
-- entry->name = savestring (name);
-- var_setvalue (entry, (char *)NULL);
-- CLEAR_EXPORTSTR (entry);
--
-- entry->dynamic_value = (sh_var_value_func_t *)NULL;
-- entry->assign_func = (sh_var_assign_func_t *)NULL;
--
-- entry->attributes = 0;
--
-- /* Always assume variables are to be made at toplevel!
-- make_local_variable has the responsibility of changing the
-- variable context. */
-- entry->context = 0;
--
-- return (entry);
--}
--
--/* Create a new shell variable with name NAME and add it to the hash table
-- TABLE. */
--static SHELL_VAR *
--make_new_variable (name, table)
-- const char *name;
-- HASH_TABLE *table;
--{
-- SHELL_VAR *entry;
-- BUCKET_CONTENTS *elt;
--
-- entry = new_shell_variable (name);
--
-- /* Make sure we have a shell_variables hash table to add to. */
-- if (shell_variables == 0)
-- create_variable_tables ();
--
-- elt = hash_insert (savestring (name), table, HASH_NOSRCH);
-- elt->data = (PTR_T)entry;
--
-- return entry;
--}
--
--#if defined (ARRAY_VARS)
--SHELL_VAR *
--make_new_array_variable (name)
-- char *name;
--{
-- SHELL_VAR *entry;
-- ARRAY *array;
--
-- entry = make_new_variable (name, global_variables->table);
-- array = array_create ();
--
-- var_setarray (entry, array);
-- VSETATTR (entry, att_array);
-- return entry;
--}
--
--SHELL_VAR *
--make_local_array_variable (name, assoc_ok)
-- char *name;
-- int assoc_ok;
--{
-- SHELL_VAR *var;
-- ARRAY *array;
--
-- var = make_local_variable (name);
-- if (var == 0 || array_p (var) || (assoc_ok && assoc_p (var)))
-- return var;
--
-- array = array_create ();
--
-- dispose_variable_value (var);
-- var_setarray (var, array);
-- VSETATTR (var, att_array);
-- return var;
--}
--
--SHELL_VAR *
--make_new_assoc_variable (name)
-- char *name;
--{
-- SHELL_VAR *entry;
-- HASH_TABLE *hash;
--
-- entry = make_new_variable (name, global_variables->table);
-- hash = assoc_create (0);
--
-- var_setassoc (entry, hash);
-- VSETATTR (entry, att_assoc);
-- return entry;
--}
--
--SHELL_VAR *
--make_local_assoc_variable (name)
-- char *name;
--{
-- SHELL_VAR *var;
-- HASH_TABLE *hash;
--
-- var = make_local_variable (name);
-- if (var == 0 || assoc_p (var))
-- return var;
--
-- dispose_variable_value (var);
-- hash = assoc_create (0);
--
-- var_setassoc (var, hash);
-- VSETATTR (var, att_assoc);
-- return var;
--}
--#endif
--
--char *
--make_variable_value (var, value, flags)
-- SHELL_VAR *var;
-- char *value;
-- int flags;
--{
-- char *retval, *oval;
-- intmax_t lval, rval;
-- int expok, olen, op;
--
-- /* If this variable has had its type set to integer (via `declare -i'),
-- then do expression evaluation on it and store the result. The
-- functions in expr.c (evalexp()) and bind_int_variable() are responsible
-- for turning off the integer flag if they don't want further
-- evaluation done. */
-- if (integer_p (var))
-- {
-- if (flags & ASS_APPEND)
-- {
-- oval = value_cell (var);
-- lval = evalexp (oval, &expok); /* ksh93 seems to do this */
-- if (expok == 0)
-- {
-- top_level_cleanup ();
-- jump_to_top_level (DISCARD);
-- }
-- }
-- rval = evalexp (value, &expok);
-- if (expok == 0)
-- {
-- top_level_cleanup ();
-- jump_to_top_level (DISCARD);
-- }
-- /* This can be fooled if the variable's value changes while evaluating
-- `rval'. We can change it if we move the evaluation of lval to here. */
-- if (flags & ASS_APPEND)
-- rval += lval;
-- retval = itos (rval);
-- }
--#if defined (CASEMOD_ATTRS)
-- else if (capcase_p (var) || uppercase_p (var) || lowercase_p (var))
-- {
-- if (flags & ASS_APPEND)
-- {
-- oval = get_variable_value (var);
-- if (oval == 0) /* paranoia */
-- oval = "";
-- olen = STRLEN (oval);
-- retval = (char *)xmalloc (olen + (value ? STRLEN (value) : 0) + 1);
-- strcpy (retval, oval);
-- if (value)
-- strcpy (retval+olen, value);
-- }
-- else if (*value)
-- retval = savestring (value);
-- else
-- {
-- retval = (char *)xmalloc (1);
-- retval[0] = '\0';
-- }
-- op = capcase_p (var) ? CASE_CAPITALIZE
-- : (uppercase_p (var) ? CASE_UPPER : CASE_LOWER);
-- oval = sh_modcase (retval, (char *)0, op);
-- free (retval);
-- retval = oval;
-- }
--#endif /* CASEMOD_ATTRS */
-- else if (value)
-- {
-- if (flags & ASS_APPEND)
-- {
-- oval = get_variable_value (var);
-- if (oval == 0) /* paranoia */
-- oval = "";
-- olen = STRLEN (oval);
-- retval = (char *)xmalloc (olen + (value ? STRLEN (value) : 0) + 1);
-- strcpy (retval, oval);
-- if (value)
-- strcpy (retval+olen, value);
-- }
-- else if (*value)
-- retval = savestring (value);
-- else
-- {
-- retval = (char *)xmalloc (1);
-- retval[0] = '\0';
-- }
-- }
-- else
-- retval = (char *)NULL;
--
-- return retval;
--}
--
--/* Bind a variable NAME to VALUE in the HASH_TABLE TABLE, which may be the
-- temporary environment (but usually is not). */
--static SHELL_VAR *
--bind_variable_internal (name, value, table, hflags, aflags)
-- const char *name;
-- char *value;
-- HASH_TABLE *table;
-- int hflags, aflags;
--{
-- char *newval;
-- SHELL_VAR *entry;
--
-- entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table);
-- /* Follow the nameref chain here if this is the global variables table */
-- if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table)
-- {
-- entry = find_global_variable (entry->name);
-- /* Let's see if we have a nameref referencing a variable that hasn't yet
-- been created. */
-- if (entry == 0)
-- entry = find_variable_last_nameref (name); /* XXX */
-- if (entry == 0) /* just in case */
-- return (entry);
-- }
--
-- /* The first clause handles `declare -n ref; ref=x;' */
-- if (entry && invisible_p (entry) && nameref_p (entry))
-- goto assign_value;
-- else if (entry && nameref_p (entry))
-- {
-- newval = nameref_cell (entry);
--#if defined (ARRAY_VARS)
-- /* declare -n foo=x[2] */
-- if (valid_array_reference (newval))
-- /* XXX - should it be aflags? */
-- entry = assign_array_element (newval, make_variable_value (entry, value, 0), aflags);
-- else
--#endif
-- {
-- entry = make_new_variable (newval, table);
-- var_setvalue (entry, make_variable_value (entry, value, 0));
-- }
-- }
-- else if (entry == 0)
-- {
-- entry = make_new_variable (name, table);
-- var_setvalue (entry, make_variable_value (entry, value, 0)); /* XXX */
-- }
-- else if (entry->assign_func) /* array vars have assign functions now */
-- {
-- INVALIDATE_EXPORTSTR (entry);
-- newval = (aflags & ASS_APPEND) ? make_variable_value (entry, value, aflags) : value;
-- if (assoc_p (entry))
-- entry = (*(entry->assign_func)) (entry, newval, -1, savestring ("0"));
-- else if (array_p (entry))
-- entry = (*(entry->assign_func)) (entry, newval, 0, 0);
-- else
-- entry = (*(entry->assign_func)) (entry, newval, -1, 0);
-- if (newval != value)
-- free (newval);
-- return (entry);
-- }
-- else
-- {
--assign_value:
-- if (readonly_p (entry) || noassign_p (entry))
-- {
-- if (readonly_p (entry))
-- err_readonly (name);
-- return (entry);
-- }
--
-- /* Variables which are bound are visible. */
-- VUNSETATTR (entry, att_invisible);
--
--#if defined (ARRAY_VARS)
-- if (assoc_p (entry) || array_p (entry))
-- newval = make_array_variable_value (entry, 0, "0", value, aflags);
-- else
--#endif
--
-- newval = make_variable_value (entry, value, aflags); /* XXX */
--
-- /* Invalidate any cached export string */
-- INVALIDATE_EXPORTSTR (entry);
--
--#if defined (ARRAY_VARS)
-- /* XXX -- this bears looking at again -- XXX */
-- /* If an existing array variable x is being assigned to with x=b or
-- `read x' or something of that nature, silently convert it to
-- x[0]=b or `read x[0]'. */
-- if (assoc_p (entry))
-- {
-- assoc_insert (assoc_cell (entry), savestring ("0"), newval);
-- free (newval);
-- }
-- else if (array_p (entry))
-- {
-- array_insert (array_cell (entry), 0, newval);
-- free (newval);
-- }
-- else
--#endif
-- {
-- FREE (value_cell (entry));
-- var_setvalue (entry, newval);
-- }
-- }
--
-- if (mark_modified_vars)
-- VSETATTR (entry, att_exported);
--
-- if (exported_p (entry))
-- array_needs_making = 1;
--
-- return (entry);
--}
--
--/* Bind a variable NAME to VALUE. This conses up the name
-- and value strings. If we have a temporary environment, we bind there
-- first, then we bind into shell_variables. */
--
--SHELL_VAR *
--bind_variable (name, value, flags)
-- const char *name;
-- char *value;
-- int flags;
--{
-- SHELL_VAR *v, *nv;
-- VAR_CONTEXT *vc, *nvc;
-- int level;
--
-- if (shell_variables == 0)
-- create_variable_tables ();
--
-- /* If we have a temporary environment, look there first for the variable,
-- and, if found, modify the value there before modifying it in the
-- shell_variables table. This allows sourced scripts to modify values
-- given to them in a temporary environment while modifying the variable
-- value that the caller sees. */
-- if (temporary_env)
-- bind_tempenv_variable (name, value);
--
-- /* XXX -- handle local variables here. */
-- for (vc = shell_variables; vc; vc = vc->down)
-- {
-- if (vc_isfuncenv (vc) || vc_isbltnenv (vc))
-- {
-- v = hash_lookup (name, vc->table);
-- nvc = vc;
-- if (v && nameref_p (v))
-- {
-- nv = find_variable_nameref_context (v, vc, &nvc);
-- if (nv == 0)
-- {
-- nv = find_variable_last_nameref_context (v, vc, &nvc);
-- if (nv && nameref_p (nv))
-- {
-- /* If this nameref variable doesn't have a value yet,
-- set the value. Otherwise, assign using the value as
-- normal. */
-- if (nameref_cell (nv) == 0)
-- return (bind_variable_internal (nv->name, value, nvc->table, 0, flags));
-- return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags));
-- }
-- else
-- v = nv;
-- }
-- else
-- v = nv;
-- }
-- if (v)
-- return (bind_variable_internal (v->name, value, nvc->table, 0, flags));
-- }
-- }
-- /* bind_variable_internal will handle nameref resolution in this case */
-- return (bind_variable_internal (name, value, global_variables->table, 0, flags));
--}
--
--SHELL_VAR *
--bind_global_variable (name, value, flags)
-- const char *name;
-- char *value;
-- int flags;
--{
-- SHELL_VAR *v, *nv;
-- VAR_CONTEXT *vc, *nvc;
-- int level;
--
-- if (shell_variables == 0)
-- create_variable_tables ();
--
-- /* bind_variable_internal will handle nameref resolution in this case */
-- return (bind_variable_internal (name, value, global_variables->table, 0, flags));
--}
--
--/* Make VAR, a simple shell variable, have value VALUE. Once assigned a
-- value, variables are no longer invisible. This is a duplicate of part
-- of the internals of bind_variable. If the variable is exported, or
-- all modified variables should be exported, mark the variable for export
-- and note that the export environment needs to be recreated. */
--SHELL_VAR *
--bind_variable_value (var, value, aflags)
-- SHELL_VAR *var;
-- char *value;
-- int aflags;
--{
-- char *t;
-- int invis;
--
-- invis = invisible_p (var);
-- VUNSETATTR (var, att_invisible);
--
-- if (var->assign_func)
-- {
-- /* If we're appending, we need the old value, so use
-- make_variable_value */
-- t = (aflags & ASS_APPEND) ? make_variable_value (var, value, aflags) : value;
-- (*(var->assign_func)) (var, t, -1, 0);
-- if (t != value && t)
-- free (t);
-- }
-- else
-- {
-- t = make_variable_value (var, value, aflags);
--#if defined (ARRAY_VARS)
-- if ((aflags & ASS_NAMEREF) && (t == 0 || *t == 0 || (legal_identifier (t) == 0 && valid_array_reference (t) == 0)))
--#else
-- if ((aflags & ASS_NAMEREF) && (t == 0 || *t == 0 || legal_identifier (t) == 0))
--#endif
-- {
-- free (t);
-- if (invis)
-- VSETATTR (var, att_invisible); /* XXX */
-- return ((SHELL_VAR *)NULL);
-- }
-- FREE (value_cell (var));
-- var_setvalue (var, t);
-- }
--
-- INVALIDATE_EXPORTSTR (var);
--
-- if (mark_modified_vars)
-- VSETATTR (var, att_exported);
--
-- if (exported_p (var))
-- array_needs_making = 1;
--
-- return (var);
--}
--
--/* Bind/create a shell variable with the name LHS to the RHS.
-- This creates or modifies a variable such that it is an integer.
--
-- This used to be in expr.c, but it is here so that all of the
-- variable binding stuff is localized. Since we don't want any
-- recursive evaluation from bind_variable() (possible without this code,
-- since bind_variable() calls the evaluator for variables with the integer
-- attribute set), we temporarily turn off the integer attribute for each
-- variable we set here, then turn it back on after binding as necessary. */
--
--SHELL_VAR *
--bind_int_variable (lhs, rhs)
-- char *lhs, *rhs;
--{
-- register SHELL_VAR *v;
-- int isint, isarr, implicitarray;
--
-- isint = isarr = implicitarray = 0;
--#if defined (ARRAY_VARS)
-- if (valid_array_reference (lhs))
-- {
-- isarr = 1;
-- v = array_variable_part (lhs, (char **)0, (int *)0);
-- }
-- else
--#endif
-- v = find_variable (lhs);
--
-- if (v)
-- {
-- isint = integer_p (v);
-- VUNSETATTR (v, att_integer);
--#if defined (ARRAY_VARS)
-- if (array_p (v) && isarr == 0)
-- implicitarray = 1;
--#endif
-- }
--
--#if defined (ARRAY_VARS)
-- if (isarr)
-- v = assign_array_element (lhs, rhs, 0);
-- else if (implicitarray)
-- v = bind_array_variable (lhs, 0, rhs, 0);
-- else
--#endif
-- v = bind_variable (lhs, rhs, 0);
--
-- if (v && isint)
-- VSETATTR (v, att_integer);
--
-- VUNSETATTR (v, att_invisible);
--
-- return (v);
--}
--
--SHELL_VAR *
--bind_var_to_int (var, val)
-- char *var;
-- intmax_t val;
--{
-- char ibuf[INT_STRLEN_BOUND (intmax_t) + 1], *p;
--
-- p = fmtulong (val, 10, ibuf, sizeof (ibuf), 0);
-- return (bind_int_variable (var, p));
--}
--
--/* Do a function binding to a variable. You pass the name and
-- the command to bind to. This conses the name and command. */
--SHELL_VAR *
--bind_function (name, value)
-- const char *name;
-- COMMAND *value;
--{
-- SHELL_VAR *entry;
--
-- entry = find_function (name);
-- if (entry == 0)
-- {
-- BUCKET_CONTENTS *elt;
--
-- elt = hash_insert (savestring (name), shell_functions, HASH_NOSRCH);
-- entry = new_shell_variable (name);
-- elt->data = (PTR_T)entry;
-- }
-- else
-- INVALIDATE_EXPORTSTR (entry);
--
-- if (var_isset (entry))
-- dispose_command (function_cell (entry));
--
-- if (value)
-- var_setfunc (entry, copy_command (value));
-- else
-- var_setfunc (entry, 0);
--
-- VSETATTR (entry, att_function);
--
-- if (mark_modified_vars)
-- VSETATTR (entry, att_exported);
--
-- VUNSETATTR (entry, att_invisible); /* Just to be sure */
--
-- if (exported_p (entry))
-- array_needs_making = 1;
--
--#if defined (PROGRAMMABLE_COMPLETION)
-- set_itemlist_dirty (&it_functions);
--#endif
--
-- return (entry);
--}
--
--#if defined (DEBUGGER)
--/* Bind a function definition, which includes source file and line number
-- information in addition to the command, into the FUNCTION_DEF hash table.*/
--void
--bind_function_def (name, value)
-- const char *name;
-- FUNCTION_DEF *value;
--{
-- FUNCTION_DEF *entry;
-- BUCKET_CONTENTS *elt;
-- COMMAND *cmd;
--
-- entry = find_function_def (name);
-- if (entry)
-- {
-- dispose_function_def_contents (entry);
-- entry = copy_function_def_contents (value, entry);
-- }
-- else
-- {
-- cmd = value->command;
-- value->command = 0;
-- entry = copy_function_def (value);
-- value->command = cmd;
--
-- elt = hash_insert (savestring (name), shell_function_defs, HASH_NOSRCH);
-- elt->data = (PTR_T *)entry;
-- }
--}
--#endif /* DEBUGGER */
--
--/* Add STRING, which is of the form foo=bar, to the temporary environment
-- HASH_TABLE (temporary_env). The functions in execute_cmd.c are
-- responsible for moving the main temporary env to one of the other
-- temporary environments. The expansion code in subst.c calls this. */
--int
--assign_in_env (word, flags)
-- WORD_DESC *word;
-- int flags;
--{
-- int offset, aflags;
-- char *name, *temp, *value;
-- SHELL_VAR *var;
-- const char *string;
--
-- string = word->word;
--
-- aflags = 0;
-- offset = assignment (string, 0);
-- name = savestring (string);
-- value = (char *)NULL;
--
-- if (name[offset] == '=')
-- {
-- name[offset] = 0;
--
-- /* don't ignore the `+' when assigning temporary environment */
-- if (name[offset - 1] == '+')
-- {
-- name[offset - 1] = '\0';
-- aflags |= ASS_APPEND;
-- }
--
-- var = find_variable (name);
-- if (var && (readonly_p (var) || noassign_p (var)))
-- {
-- if (readonly_p (var))
-- err_readonly (name);
-- free (name);
-- return (0);
-- }
--
-- temp = name + offset + 1;
-- value = expand_assignment_string_to_string (temp, 0);
--
-- if (var && (aflags & ASS_APPEND))
-- {
-- temp = make_variable_value (var, value, aflags);
-- FREE (value);
-- value = temp;
-- }
-- }
--
-- if (temporary_env == 0)
-- temporary_env = hash_create (TEMPENV_HASH_BUCKETS);
--
-- var = hash_lookup (name, temporary_env);
-- if (var == 0)
-- var = make_new_variable (name, temporary_env);
-- else
-- FREE (value_cell (var));
--
-- if (value == 0)
-- {
-- value = (char *)xmalloc (1); /* like do_assignment_internal */
-- value[0] = '\0';
-- }
--
-- var_setvalue (var, value);
-- var->attributes |= (att_exported|att_tempvar);
-- var->context = variable_context; /* XXX */
--
-- INVALIDATE_EXPORTSTR (var);
-- var->exportstr = mk_env_string (name, value, 0);
--
-- array_needs_making = 1;
--
-- if (flags)
-- stupidly_hack_special_variables (name);
--
-- if (echo_command_at_execute)
-- /* The Korn shell prints the `+ ' in front of assignment statements,
-- so we do too. */
-- xtrace_print_assignment (name, value, 0, 1);
--
-- free (name);
-- return 1;
--}
--
--/* **************************************************************** */
--/* */
--/* Copying variables */
--/* */
--/* **************************************************************** */
--
--#ifdef INCLUDE_UNUSED
--/* Copy VAR to a new data structure and return that structure. */
--SHELL_VAR *
--copy_variable (var)
-- SHELL_VAR *var;
--{
-- SHELL_VAR *copy = (SHELL_VAR *)NULL;
--
-- if (var)
-- {
-- copy = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR));
--
-- copy->attributes = var->attributes;
-- copy->name = savestring (var->name);
--
-- if (function_p (var))
-- var_setfunc (copy, copy_command (function_cell (var)));
--#if defined (ARRAY_VARS)
-- else if (array_p (var))
-- var_setarray (copy, array_copy (array_cell (var)));
-- else if (assoc_p (var))
-- var_setassoc (copy, assoc_copy (assoc_cell (var)));
--#endif
-- else if (nameref_cell (var)) /* XXX - nameref */
-- var_setref (copy, savestring (nameref_cell (var)));
-- else if (value_cell (var)) /* XXX - nameref */
-- var_setvalue (copy, savestring (value_cell (var)));
-- else
-- var_setvalue (copy, (char *)NULL);
--
-- copy->dynamic_value = var->dynamic_value;
-- copy->assign_func = var->assign_func;
--
-- copy->exportstr = COPY_EXPORTSTR (var);
--
-- copy->context = var->context;
-- }
-- return (copy);
--}
--#endif
--
--/* **************************************************************** */
--/* */
--/* Deleting and unsetting variables */
--/* */
--/* **************************************************************** */
--
--/* Dispose of the information attached to VAR. */
--static void
--dispose_variable_value (var)
-- SHELL_VAR *var;
--{
-- if (function_p (var))
-- dispose_command (function_cell (var));
--#if defined (ARRAY_VARS)
-- else if (array_p (var))
-- array_dispose (array_cell (var));
-- else if (assoc_p (var))
-- assoc_dispose (assoc_cell (var));
--#endif
-- else if (nameref_p (var))
-- FREE (nameref_cell (var));
-- else
-- FREE (value_cell (var));
--}
--
--void
--dispose_variable (var)
-- SHELL_VAR *var;
--{
-- if (var == 0)
-- return;
--
-- if (nofree_p (var) == 0)
-- dispose_variable_value (var);
--
-- FREE_EXPORTSTR (var);
--
-- free (var->name);
--
-- if (exported_p (var))
-- array_needs_making = 1;
--
-- free (var);
--}
--
--/* Unset the shell variable referenced by NAME. Unsetting a nameref variable
-- unsets the variable it resolves to but leaves the nameref alone. */
--int
--unbind_variable (name)
-- const char *name;
--{
-- SHELL_VAR *v, *nv;
-- int r;
--
-- v = var_lookup (name, shell_variables);
-- nv = (v && nameref_p (v)) ? find_variable_nameref (v) : (SHELL_VAR *)NULL;
--
-- r = nv ? makunbound (nv->name, shell_variables) : makunbound (name, shell_variables);
-- return r;
--}
--
--/* Unbind NAME, where NAME is assumed to be a nameref variable */
--int
--unbind_nameref (name)
-- const char *name;
--{
-- SHELL_VAR *v;
--
-- v = var_lookup (name, shell_variables);
-- if (v && nameref_p (v))
-- return makunbound (name, shell_variables);
-- return 0;
--}
--
--/* Unset the shell function named NAME. */
--int
--unbind_func (name)
-- const char *name;
--{
-- BUCKET_CONTENTS *elt;
-- SHELL_VAR *func;
--
-- elt = hash_remove (name, shell_functions, 0);
--
-- if (elt == 0)
-- return -1;
--
--#if defined (PROGRAMMABLE_COMPLETION)
-- set_itemlist_dirty (&it_functions);
--#endif
--
-- func = (SHELL_VAR *)elt->data;
-- if (func)
-- {
-- if (exported_p (func))
-- array_needs_making++;
-- dispose_variable (func);
-- }
--
-- free (elt->key);
-- free (elt);
--
-- return 0;
--}
--
--#if defined (DEBUGGER)
--int
--unbind_function_def (name)
-- const char *name;
--{
-- BUCKET_CONTENTS *elt;
-- FUNCTION_DEF *funcdef;
--
-- elt = hash_remove (name, shell_function_defs, 0);
--
-- if (elt == 0)
-- return -1;
--
-- funcdef = (FUNCTION_DEF *)elt->data;
-- if (funcdef)
-- dispose_function_def (funcdef);
--
-- free (elt->key);
-- free (elt);
--
-- return 0;
--}
--#endif /* DEBUGGER */
--
--int
--delete_var (name, vc)
-- const char *name;
-- VAR_CONTEXT *vc;
--{
-- BUCKET_CONTENTS *elt;
-- SHELL_VAR *old_var;
-- VAR_CONTEXT *v;
--
-- for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down)
-- if (elt = hash_remove (name, v->table, 0))
-- break;
--
-- if (elt == 0)
-- return (-1);
--
-- old_var = (SHELL_VAR *)elt->data;
-- free (elt->key);
-- free (elt);
--
-- dispose_variable (old_var);
-- return (0);
--}
--
--/* Make the variable associated with NAME go away. HASH_LIST is the
-- hash table from which this variable should be deleted (either
-- shell_variables or shell_functions).
-- Returns non-zero if the variable couldn't be found. */
--int
--makunbound (name, vc)
-- const char *name;
-- VAR_CONTEXT *vc;
--{
-- BUCKET_CONTENTS *elt, *new_elt;
-- SHELL_VAR *old_var;
-- VAR_CONTEXT *v;
-- char *t;
--
-- for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down)
-- if (elt = hash_remove (name, v->table, 0))
-- break;
--
-- if (elt == 0)
-- return (-1);
--
-- old_var = (SHELL_VAR *)elt->data;
--
-- if (old_var && exported_p (old_var))
-- array_needs_making++;
--
-- /* If we're unsetting a local variable and we're still executing inside
-- the function, just mark the variable as invisible. The function
-- eventually called by pop_var_context() will clean it up later. This
-- must be done so that if the variable is subsequently assigned a new
-- value inside the function, the `local' attribute is still present.
-- We also need to add it back into the correct hash table. */
-- if (old_var && local_p (old_var) && variable_context == old_var->context)
-- {
-- if (nofree_p (old_var))
-- var_setvalue (old_var, (char *)NULL);
--#if defined (ARRAY_VARS)
-- else if (array_p (old_var))
-- array_dispose (array_cell (old_var));
-- else if (assoc_p (old_var))
-- assoc_dispose (assoc_cell (old_var));
--#endif
-- else if (nameref_p (old_var))
-- FREE (nameref_cell (old_var));
-- else
-- FREE (value_cell (old_var));
-- /* Reset the attributes. Preserve the export attribute if the variable
-- came from a temporary environment. Make sure it stays local, and
-- make it invisible. */
-- old_var->attributes = (exported_p (old_var) && tempvar_p (old_var)) ? att_exported : 0;
-- VSETATTR (old_var, att_local);
-- VSETATTR (old_var, att_invisible);
-- var_setvalue (old_var, (char *)NULL);
-- INVALIDATE_EXPORTSTR (old_var);
--
-- new_elt = hash_insert (savestring (old_var->name), v->table, 0);
-- new_elt->data = (PTR_T)old_var;
-- stupidly_hack_special_variables (old_var->name);
--
-- free (elt->key);
-- free (elt);
-- return (0);
-- }
--
-- /* Have to save a copy of name here, because it might refer to
-- old_var->name. If so, stupidly_hack_special_variables will
-- reference freed memory. */
-- t = savestring (name);
--
-- free (elt->key);
-- free (elt);
--
-- dispose_variable (old_var);
-- stupidly_hack_special_variables (t);
-- free (t);
--
-- return (0);
--}
--
--/* Get rid of all of the variables in the current context. */
--void
--kill_all_local_variables ()
--{
-- VAR_CONTEXT *vc;
--
-- for (vc = shell_variables; vc; vc = vc->down)
-- if (vc_isfuncenv (vc) && vc->scope == variable_context)
-- break;
-- if (vc == 0)
-- return; /* XXX */
--
-- if (vc->table && vc_haslocals (vc))
-- {
-- delete_all_variables (vc->table);
-- hash_dispose (vc->table);
-- }
-- vc->table = (HASH_TABLE *)NULL;
--}
--
--static void
--free_variable_hash_data (data)
-- PTR_T data;
--{
-- SHELL_VAR *var;
--
-- var = (SHELL_VAR *)data;
-- dispose_variable (var);
--}
--
--/* Delete the entire contents of the hash table. */
--void
--delete_all_variables (hashed_vars)
-- HASH_TABLE *hashed_vars;
--{
-- hash_flush (hashed_vars, free_variable_hash_data);
--}
--
--/* **************************************************************** */
--/* */
--/* Setting variable attributes */
--/* */
--/* **************************************************************** */
--
--#define FIND_OR_MAKE_VARIABLE(name, entry) \
-- do \
-- { \
-- entry = find_variable (name); \
-- if (!entry) \
-- { \
-- entry = bind_variable (name, "", 0); \
-- if (!no_invisible_vars && entry) entry->attributes |= att_invisible; \
-- } \
-- } \
-- while (0)
--
--/* Make the variable associated with NAME be readonly.
-- If NAME does not exist yet, create it. */
--void
--set_var_read_only (name)
-- char *name;
--{
-- SHELL_VAR *entry;
--
-- FIND_OR_MAKE_VARIABLE (name, entry);
-- VSETATTR (entry, att_readonly);
--}
--
--#ifdef INCLUDE_UNUSED
--/* Make the function associated with NAME be readonly.
-- If NAME does not exist, we just punt, like auto_export code below. */
--void
--set_func_read_only (name)
-- const char *name;
--{
-- SHELL_VAR *entry;
--
-- entry = find_function (name);
-- if (entry)
-- VSETATTR (entry, att_readonly);
--}
--
--/* Make the variable associated with NAME be auto-exported.
-- If NAME does not exist yet, create it. */
--void
--set_var_auto_export (name)
-- char *name;
--{
-- SHELL_VAR *entry;
--
-- FIND_OR_MAKE_VARIABLE (name, entry);
-- set_auto_export (entry);
--}
--
--/* Make the function associated with NAME be auto-exported. */
--void
--set_func_auto_export (name)
-- const char *name;
--{
-- SHELL_VAR *entry;
--
-- entry = find_function (name);
-- if (entry)
-- set_auto_export (entry);
--}
--#endif
--
--/* **************************************************************** */
--/* */
--/* Creating lists of variables */
--/* */
--/* **************************************************************** */
--
--static VARLIST *
--vlist_alloc (nentries)
-- int nentries;
--{
-- VARLIST *vlist;
--
-- vlist = (VARLIST *)xmalloc (sizeof (VARLIST));
-- vlist->list = (SHELL_VAR **)xmalloc ((nentries + 1) * sizeof (SHELL_VAR *));
-- vlist->list_size = nentries;
-- vlist->list_len = 0;
-- vlist->list[0] = (SHELL_VAR *)NULL;
--
-- return vlist;
--}
--
--static VARLIST *
--vlist_realloc (vlist, n)
-- VARLIST *vlist;
-- int n;
--{
-- if (vlist == 0)
-- return (vlist = vlist_alloc (n));
-- if (n > vlist->list_size)
-- {
-- vlist->list_size = n;
-- vlist->list = (SHELL_VAR **)xrealloc (vlist->list, (vlist->list_size + 1) * sizeof (SHELL_VAR *));
-- }
-- return vlist;
--}
--
--static void
--vlist_add (vlist, var, flags)
-- VARLIST *vlist;
-- SHELL_VAR *var;
-- int flags;
--{
-- register int i;
--
-- for (i = 0; i < vlist->list_len; i++)
-- if (STREQ (var->name, vlist->list[i]->name))
-- break;
-- if (i < vlist->list_len)
-- return;
--
-- if (i >= vlist->list_size)
-- vlist = vlist_realloc (vlist, vlist->list_size + 16);
--
-- vlist->list[vlist->list_len++] = var;
-- vlist->list[vlist->list_len] = (SHELL_VAR *)NULL;
--}
--
--/* Map FUNCTION over the variables in VAR_HASH_TABLE. Return an array of the
-- variables for which FUNCTION returns a non-zero value. A NULL value
-- for FUNCTION means to use all variables. */
--SHELL_VAR **
--map_over (function, vc)
-- sh_var_map_func_t *function;
-- VAR_CONTEXT *vc;
--{
-- VAR_CONTEXT *v;
-- VARLIST *vlist;
-- SHELL_VAR **ret;
-- int nentries;
--
-- for (nentries = 0, v = vc; v; v = v->down)
-- nentries += HASH_ENTRIES (v->table);
--
-- if (nentries == 0)
-- return (SHELL_VAR **)NULL;
--
-- vlist = vlist_alloc (nentries);
--
-- for (v = vc; v; v = v->down)
-- flatten (v->table, function, vlist, 0);
--
-- ret = vlist->list;
-- free (vlist);
-- return ret;
--}
--
--SHELL_VAR **
--map_over_funcs (function)
-- sh_var_map_func_t *function;
--{
-- VARLIST *vlist;
-- SHELL_VAR **ret;
--
-- if (shell_functions == 0 || HASH_ENTRIES (shell_functions) == 0)
-- return ((SHELL_VAR **)NULL);
--
-- vlist = vlist_alloc (HASH_ENTRIES (shell_functions));
--
-- flatten (shell_functions, function, vlist, 0);
--
-- ret = vlist->list;
-- free (vlist);
-- return ret;
--}
--
--/* Flatten VAR_HASH_TABLE, applying FUNC to each member and adding those
-- elements for which FUNC succeeds to VLIST->list. FLAGS is reserved
-- for future use. Only unique names are added to VLIST. If FUNC is
-- NULL, each variable in VAR_HASH_TABLE is added to VLIST. If VLIST is
-- NULL, FUNC is applied to each SHELL_VAR in VAR_HASH_TABLE. If VLIST
-- and FUNC are both NULL, nothing happens. */
--static void
--flatten (var_hash_table, func, vlist, flags)
-- HASH_TABLE *var_hash_table;
-- sh_var_map_func_t *func;
-- VARLIST *vlist;
-- int flags;
--{
-- register int i;
-- register BUCKET_CONTENTS *tlist;
-- int r;
-- SHELL_VAR *var;
--
-- if (var_hash_table == 0 || (HASH_ENTRIES (var_hash_table) == 0) || (vlist == 0 && func == 0))
-- return;
--
-- for (i = 0; i < var_hash_table->nbuckets; i++)
-- {
-- for (tlist = hash_items (i, var_hash_table); tlist; tlist = tlist->next)
-- {
-- var = (SHELL_VAR *)tlist->data;
--
-- r = func ? (*func) (var) : 1;
-- if (r && vlist)
-- vlist_add (vlist, var, flags);
-- }
-- }
--}
--
--void
--sort_variables (array)
-- SHELL_VAR **array;
--{
-- qsort (array, strvec_len ((char **)array), sizeof (SHELL_VAR *), (QSFUNC *)qsort_var_comp);
--}
--
--static int
--qsort_var_comp (var1, var2)
-- SHELL_VAR **var1, **var2;
--{
-- int result;
--
-- if ((result = (*var1)->name[0] - (*var2)->name[0]) == 0)
-- result = strcmp ((*var1)->name, (*var2)->name);
--
-- return (result);
--}
--
--/* Apply FUNC to each variable in SHELL_VARIABLES, adding each one for
-- which FUNC succeeds to an array of SHELL_VAR *s. Returns the array. */
--static SHELL_VAR **
--vapply (func)
-- sh_var_map_func_t *func;
--{
-- SHELL_VAR **list;
--
-- list = map_over (func, shell_variables);
-- if (list /* && posixly_correct */)
-- sort_variables (list);
-- return (list);
--}
--
--/* Apply FUNC to each variable in SHELL_FUNCTIONS, adding each one for
-- which FUNC succeeds to an array of SHELL_VAR *s. Returns the array. */
--static SHELL_VAR **
--fapply (func)
-- sh_var_map_func_t *func;
--{
-- SHELL_VAR **list;
--
-- list = map_over_funcs (func);
-- if (list /* && posixly_correct */)
-- sort_variables (list);
-- return (list);
--}
--
--/* Create a NULL terminated array of all the shell variables. */
--SHELL_VAR **
--all_shell_variables ()
--{
-- return (vapply ((sh_var_map_func_t *)NULL));
--}
--
--/* Create a NULL terminated array of all the shell functions. */
--SHELL_VAR **
--all_shell_functions ()
--{
-- return (fapply ((sh_var_map_func_t *)NULL));
--}
--
--static int
--visible_var (var)
-- SHELL_VAR *var;
--{
-- return (invisible_p (var) == 0);
--}
--
--SHELL_VAR **
--all_visible_functions ()
--{
-- return (fapply (visible_var));
--}
--
--SHELL_VAR **
--all_visible_variables ()
--{
-- return (vapply (visible_var));
--}
--
--/* Return non-zero if the variable VAR is visible and exported. Array
-- variables cannot be exported. */
--static int
--visible_and_exported (var)
-- SHELL_VAR *var;
--{
-- return (invisible_p (var) == 0 && exported_p (var));
--}
--
--/* Candidate variables for the export environment are either valid variables
-- with the export attribute or invalid variables inherited from the initial
-- environment and simply passed through. */
--static int
--export_environment_candidate (var)
-- SHELL_VAR *var;
--{
-- return (exported_p (var) && (invisible_p (var) == 0 || imported_p (var)));
--}
--
--/* Return non-zero if VAR is a local variable in the current context and
-- is exported. */
--static int
--local_and_exported (var)
-- SHELL_VAR *var;
--{
-- return (invisible_p (var) == 0 && local_p (var) && var->context == variable_context && exported_p (var));
--}
--
--SHELL_VAR **
--all_exported_variables ()
--{
-- return (vapply (visible_and_exported));
--}
--
--SHELL_VAR **
--local_exported_variables ()
--{
-- return (vapply (local_and_exported));
--}
--
--static int
--variable_in_context (var)
-- SHELL_VAR *var;
--{
-- return (invisible_p (var) == 0 && local_p (var) && var->context == variable_context);
--}
--
--SHELL_VAR **
--all_local_variables ()
--{
-- VARLIST *vlist;
-- SHELL_VAR **ret;
-- VAR_CONTEXT *vc;
--
-- vc = shell_variables;
-- for (vc = shell_variables; vc; vc = vc->down)
-- if (vc_isfuncenv (vc) && vc->scope == variable_context)
-- break;
--
-- if (vc == 0)
-- {
-- internal_error (_("all_local_variables: no function context at current scope"));
-- return (SHELL_VAR **)NULL;
-- }
-- if (vc->table == 0 || HASH_ENTRIES (vc->table) == 0 || vc_haslocals (vc) == 0)
-- return (SHELL_VAR **)NULL;
--
-- vlist = vlist_alloc (HASH_ENTRIES (vc->table));
--
-- flatten (vc->table, variable_in_context, vlist, 0);
--
-- ret = vlist->list;
-- free (vlist);
-- if (ret)
-- sort_variables (ret);
-- return ret;
--}
--
--#if defined (ARRAY_VARS)
--/* Return non-zero if the variable VAR is visible and an array. */
--static int
--visible_array_vars (var)
-- SHELL_VAR *var;
--{
-- return (invisible_p (var) == 0 && array_p (var));
--}
--
--SHELL_VAR **
--all_array_variables ()
--{
-- return (vapply (visible_array_vars));
--}
--#endif /* ARRAY_VARS */
--
--char **
--all_variables_matching_prefix (prefix)
-- const char *prefix;
--{
-- SHELL_VAR **varlist;
-- char **rlist;
-- int vind, rind, plen;
--
-- plen = STRLEN (prefix);
-- varlist = all_visible_variables ();
-- for (vind = 0; varlist && varlist[vind]; vind++)
-- ;
-- if (varlist == 0 || vind == 0)
-- return ((char **)NULL);
-- rlist = strvec_create (vind + 1);
-- for (vind = rind = 0; varlist[vind]; vind++)
-- {
-- if (plen == 0 || STREQN (prefix, varlist[vind]->name, plen))
-- rlist[rind++] = savestring (varlist[vind]->name);
-- }
-- rlist[rind] = (char *)0;
-- free (varlist);
--
-- return rlist;
--}
--
--/* **************************************************************** */
--/* */
--/* Managing temporary variable scopes */
--/* */
--/* **************************************************************** */
--
--/* Make variable NAME have VALUE in the temporary environment. */
--static SHELL_VAR *
--bind_tempenv_variable (name, value)
-- const char *name;
-- char *value;
--{
-- SHELL_VAR *var;
--
-- var = temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)NULL;
--
-- if (var)
-- {
-- FREE (value_cell (var));
-- var_setvalue (var, savestring (value));
-- INVALIDATE_EXPORTSTR (var);
-- }
--
-- return (var);
--}
--
--/* Find a variable in the temporary environment that is named NAME.
-- Return the SHELL_VAR *, or NULL if not found. */
--SHELL_VAR *
--find_tempenv_variable (name)
-- const char *name;
--{
-- return (temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)NULL);
--}
--
--char **tempvar_list;
--int tvlist_ind;
--
--/* Push the variable described by (SHELL_VAR *)DATA down to the next
-- variable context from the temporary environment. */
--static void
--push_temp_var (data)
-- PTR_T data;
--{
-- SHELL_VAR *var, *v;
-- HASH_TABLE *binding_table;
--
-- var = (SHELL_VAR *)data;
--
-- binding_table = shell_variables->table;
-- if (binding_table == 0)
-- {
-- if (shell_variables == global_variables)
-- /* shouldn't happen */
-- binding_table = shell_variables->table = global_variables->table = hash_create (0);
-- else
-- binding_table = shell_variables->table = hash_create (TEMPENV_HASH_BUCKETS);
-- }
--
-- v = bind_variable_internal (var->name, value_cell (var), binding_table, 0, 0);
--
-- /* XXX - should we set the context here? It shouldn't matter because of how
-- assign_in_env works, but might want to check. */
-- if (binding_table == global_variables->table) /* XXX */
-- var->attributes &= ~(att_tempvar|att_propagate);
-- else
-- {
-- var->attributes |= att_propagate;
-- if (binding_table == shell_variables->table)
-- shell_variables->flags |= VC_HASTMPVAR;
-- }
-- v->attributes |= var->attributes;
--
-- if (find_special_var (var->name) >= 0)
-- tempvar_list[tvlist_ind++] = savestring (var->name);
--
-- dispose_variable (var);
--}
--
--static void
--propagate_temp_var (data)
-- PTR_T data;
--{
-- SHELL_VAR *var;
--
-- var = (SHELL_VAR *)data;
-- if (tempvar_p (var) && (var->attributes & att_propagate))
-- push_temp_var (data);
-- else
-- {
-- if (find_special_var (var->name) >= 0)
-- tempvar_list[tvlist_ind++] = savestring (var->name);
-- dispose_variable (var);
-- }
--}
--
--/* Free the storage used in the hash table for temporary
-- environment variables. PUSHF is a function to be called
-- to free each hash table entry. It takes care of pushing variables
-- to previous scopes if appropriate. PUSHF stores names of variables
-- that require special handling (e.g., IFS) on tempvar_list, so this
-- function can call stupidly_hack_special_variables on all the
-- variables in the list when the temporary hash table is destroyed. */
--static void
--dispose_temporary_env (pushf)
-- sh_free_func_t *pushf;
--{
-- int i;
--
-- tempvar_list = strvec_create (HASH_ENTRIES (temporary_env) + 1);
-- tempvar_list[tvlist_ind = 0] = 0;
--
-- hash_flush (temporary_env, pushf);
-- hash_dispose (temporary_env);
-- temporary_env = (HASH_TABLE *)NULL;
--
-- tempvar_list[tvlist_ind] = 0;
--
-- array_needs_making = 1;
--
--#if 0
-- sv_ifs ("IFS"); /* XXX here for now -- check setifs in assign_in_env */
--#endif
-- for (i = 0; i < tvlist_ind; i++)
-- stupidly_hack_special_variables (tempvar_list[i]);
--
-- strvec_dispose (tempvar_list);
-- tempvar_list = 0;
-- tvlist_ind = 0;
--}
--
--void
--dispose_used_env_vars ()
--{
-- if (temporary_env)
-- {
-- dispose_temporary_env (propagate_temp_var);
-- maybe_make_export_env ();
-- }
--}
--
--/* Take all of the shell variables in the temporary environment HASH_TABLE
-- and make shell variables from them at the current variable context. */
--void
--merge_temporary_env ()
--{
-- if (temporary_env)
-- dispose_temporary_env (push_temp_var);
--}
--
--/* **************************************************************** */
--/* */
--/* Creating and manipulating the environment */
--/* */
--/* **************************************************************** */
--
--static inline char *
--mk_env_string (name, value, isfunc)
-- const char *name, *value;
-- int isfunc;
--{
-- size_t name_len, value_len;
-- char *p, *q;
--
-- name_len = strlen (name);
-- value_len = STRLEN (value);
--
-- /* If we are exporting a shell function, construct the encoded function
-- name. */
-- if (isfunc && value)
-- {
-- p = (char *)xmalloc (BASHFUNC_PREFLEN + name_len + BASHFUNC_SUFFLEN + value_len + 2);
-- q = p;
-- memcpy (q, BASHFUNC_PREFIX, BASHFUNC_PREFLEN);
-- q += BASHFUNC_PREFLEN;
-- memcpy (q, name, name_len);
-- q += name_len;
-- memcpy (q, BASHFUNC_SUFFIX, BASHFUNC_SUFFLEN);
-- q += BASHFUNC_SUFFLEN;
-- }
-- else
-- {
-- p = (char *)xmalloc (2 + name_len + value_len);
-- memcpy (p, name, name_len);
-- q = p + name_len;
-- }
--
-- q[0] = '=';
-- if (value && *value)
-- memcpy (q + 1, value, value_len + 1);
-- else
-- q[1] = '\0';
--
-- return (p);
--}
--
--#ifdef DEBUG
--/* Debugging */
--static int
--valid_exportstr (v)
-- SHELL_VAR *v;
--{
-- char *s;
--
-- s = v->exportstr;
-- if (s == 0)
-- {
-- internal_error (_("%s has null exportstr"), v->name);
-- return (0);
-- }
-- if (legal_variable_starter ((unsigned char)*s) == 0)
-- {
-- internal_error (_("invalid character %d in exportstr for %s"), *s, v->name);
-- return (0);
-- }
-- for (s = v->exportstr + 1; s && *s; s++)
-- {
-- if (*s == '=')
-- break;
-- if (legal_variable_char ((unsigned char)*s) == 0)
-- {
-- internal_error (_("invalid character %d in exportstr for %s"), *s, v->name);
-- return (0);
-- }
-- }
-- if (*s != '=')
-- {
-- internal_error (_("no `=' in exportstr for %s"), v->name);
-- return (0);
-- }
-- return (1);
--}
--#endif
--
--static char **
--make_env_array_from_var_list (vars)
-- SHELL_VAR **vars;
--{
-- register int i, list_index;
-- register SHELL_VAR *var;
-- char **list, *value;
--
-- list = strvec_create ((1 + strvec_len ((char **)vars)));
--
--#define USE_EXPORTSTR (value == var->exportstr)
--
-- for (i = 0, list_index = 0; var = vars[i]; i++)
-- {
--#if defined (__CYGWIN__)
-- /* We don't use the exportstr stuff on Cygwin at all. */
-- INVALIDATE_EXPORTSTR (var);
--#endif
-- if (var->exportstr)
-- value = var->exportstr;
-- else if (function_p (var))
-- value = named_function_string ((char *)NULL, function_cell (var), 0);
--#if defined (ARRAY_VARS)
-- else if (array_p (var))
--# if ARRAY_EXPORT
-- value = array_to_assignment_string (array_cell (var));
--# else
-- continue; /* XXX array vars cannot yet be exported */
--# endif /* ARRAY_EXPORT */
-- else if (assoc_p (var))
--# if 0
-- value = assoc_to_assignment_string (assoc_cell (var));
--# else
-- continue; /* XXX associative array vars cannot yet be exported */
--# endif
--#endif
-- else
-- value = value_cell (var);
--
-- if (value)
-- {
-- /* Gee, I'd like to get away with not using savestring() if we're
-- using the cached exportstr... */
-- list[list_index] = USE_EXPORTSTR ? savestring (value)
-- : mk_env_string (var->name, value, function_p (var));
--
-- if (USE_EXPORTSTR == 0)
-- SAVE_EXPORTSTR (var, list[list_index]);
--
-- list_index++;
--#undef USE_EXPORTSTR
--
--#if 0 /* not yet */
--#if defined (ARRAY_VARS)
-- if (array_p (var) || assoc_p (var))
-- free (value);
--#endif
--#endif
-- }
-- }
--
-- list[list_index] = (char *)NULL;
-- return (list);
--}
--
--/* Make an array of assignment statements from the hash table
-- HASHED_VARS which contains SHELL_VARs. Only visible, exported
-- variables are eligible. */
--static char **
--make_var_export_array (vcxt)
-- VAR_CONTEXT *vcxt;
--{
-- char **list;
-- SHELL_VAR **vars;
--
--#if 0
-- vars = map_over (visible_and_exported, vcxt);
--#else
-- vars = map_over (export_environment_candidate, vcxt);
--#endif
--
-- if (vars == 0)
-- return (char **)NULL;
--
-- list = make_env_array_from_var_list (vars);
--
-- free (vars);
-- return (list);
--}
--
--static char **
--make_func_export_array ()
--{
-- char **list;
-- SHELL_VAR **vars;
--
-- vars = map_over_funcs (visible_and_exported);
-- if (vars == 0)
-- return (char **)NULL;
--
-- list = make_env_array_from_var_list (vars);
--
-- free (vars);
-- return (list);
--}
--
--/* Add ENVSTR to the end of the exported environment, EXPORT_ENV. */
--#define add_to_export_env(envstr,do_alloc) \
--do \
-- { \
-- if (export_env_index >= (export_env_size - 1)) \
-- { \
-- export_env_size += 16; \
-- export_env = strvec_resize (export_env, export_env_size); \
-- environ = export_env; \
-- } \
-- export_env[export_env_index++] = (do_alloc) ? savestring (envstr) : envstr; \
-- export_env[export_env_index] = (char *)NULL; \
-- } while (0)
--
--/* Add ASSIGN to EXPORT_ENV, or supercede a previous assignment in the
-- array with the same left-hand side. Return the new EXPORT_ENV. */
--char **
--add_or_supercede_exported_var (assign, do_alloc)
-- char *assign;
-- int do_alloc;
--{
-- register int i;
-- int equal_offset;
--
-- equal_offset = assignment (assign, 0);
-- if (equal_offset == 0)
-- return (export_env);
--
-- /* If this is a function, then only supersede the function definition.
-- We do this by including the `=() {' in the comparison, like
-- initialize_shell_variables does. */
-- if (assign[equal_offset + 1] == '(' &&
-- strncmp (assign + equal_offset + 2, ") {", 3) == 0) /* } */
-- equal_offset += 4;
--
-- for (i = 0; i < export_env_index; i++)
-- {
-- if (STREQN (assign, export_env[i], equal_offset + 1))
-- {
-- free (export_env[i]);
-- export_env[i] = do_alloc ? savestring (assign) : assign;
-- return (export_env);
-- }
-- }
-- add_to_export_env (assign, do_alloc);
-- return (export_env);
--}
--
--static void
--add_temp_array_to_env (temp_array, do_alloc, do_supercede)
-- char **temp_array;
-- int do_alloc, do_supercede;
--{
-- register int i;
--
-- if (temp_array == 0)
-- return;
--
-- for (i = 0; temp_array[i]; i++)
-- {
-- if (do_supercede)
-- export_env = add_or_supercede_exported_var (temp_array[i], do_alloc);
-- else
-- add_to_export_env (temp_array[i], do_alloc);
-- }
--
-- free (temp_array);
--}
--
--/* Make the environment array for the command about to be executed, if the
-- array needs making. Otherwise, do nothing. If a shell action could
-- change the array that commands receive for their environment, then the
-- code should `array_needs_making++'.
--
-- The order to add to the array is:
-- temporary_env
-- list of var contexts whose head is shell_variables
-- shell_functions
--
-- This is the shell variable lookup order. We add only new variable
-- names at each step, which allows local variables and variables in
-- the temporary environments to shadow variables in the global (or
-- any previous) scope.
--*/
--
--static int
--n_shell_variables ()
--{
-- VAR_CONTEXT *vc;
-- int n;
--
-- for (n = 0, vc = shell_variables; vc; vc = vc->down)
-- n += HASH_ENTRIES (vc->table);
-- return n;
--}
--
--int
--chkexport (name)
-- char *name;
--{
-- SHELL_VAR *v;
--
-- v = find_variable (name);
-- if (v && exported_p (v))
-- {
-- array_needs_making = 1;
-- maybe_make_export_env ();
-- return 1;
-- }
-- return 0;
--}
--
--void
--maybe_make_export_env ()
--{
-- register char **temp_array;
-- int new_size;
-- VAR_CONTEXT *tcxt;
--
-- if (array_needs_making)
-- {
-- if (export_env)
-- strvec_flush (export_env);
--
-- /* Make a guess based on how many shell variables and functions we
-- have. Since there will always be array variables, and array
-- variables are not (yet) exported, this will always be big enough
-- for the exported variables and functions. */
-- new_size = n_shell_variables () + HASH_ENTRIES (shell_functions) + 1 +
-- HASH_ENTRIES (temporary_env);
-- if (new_size > export_env_size)
-- {
-- export_env_size = new_size;
-- export_env = strvec_resize (export_env, export_env_size);
-- environ = export_env;
-- }
-- export_env[export_env_index = 0] = (char *)NULL;
--
-- /* Make a dummy variable context from the temporary_env, stick it on
-- the front of shell_variables, call make_var_export_array on the
-- whole thing to flatten it, and convert the list of SHELL_VAR *s
-- to the form needed by the environment. */
-- if (temporary_env)
-- {
-- tcxt = new_var_context ((char *)NULL, 0);
-- tcxt->table = temporary_env;
-- tcxt->down = shell_variables;
-- }
-- else
-- tcxt = shell_variables;
--
-- temp_array = make_var_export_array (tcxt);
-- if (temp_array)
-- add_temp_array_to_env (temp_array, 0, 0);
--
-- if (tcxt != shell_variables)
-- free (tcxt);
--
--#if defined (RESTRICTED_SHELL)
-- /* Restricted shells may not export shell functions. */
-- temp_array = restricted ? (char **)0 : make_func_export_array ();
--#else
-- temp_array = make_func_export_array ();
--#endif
-- if (temp_array)
-- add_temp_array_to_env (temp_array, 0, 0);
--
-- array_needs_making = 0;
-- }
--}
--
--/* This is an efficiency hack. PWD and OLDPWD are auto-exported, so
-- we will need to remake the exported environment every time we
-- change directories. `_' is always put into the environment for
-- every external command, so without special treatment it will always
-- cause the environment to be remade.
--
-- If there is no other reason to make the exported environment, we can
-- just update the variables in place and mark the exported environment
-- as no longer needing a remake. */
--void
--update_export_env_inplace (env_prefix, preflen, value)
-- char *env_prefix;
-- int preflen;
-- char *value;
--{
-- char *evar;
--
-- evar = (char *)xmalloc (STRLEN (value) + preflen + 1);
-- strcpy (evar, env_prefix);
-- if (value)
-- strcpy (evar + preflen, value);
-- export_env = add_or_supercede_exported_var (evar, 0);
--}
--
--/* We always put _ in the environment as the name of this command. */
--void
--put_command_name_into_env (command_name)
-- char *command_name;
--{
-- update_export_env_inplace ("_=", 2, command_name);
--}
--
--/* **************************************************************** */
--/* */
--/* Managing variable contexts */
--/* */
--/* **************************************************************** */
--
--/* Allocate and return a new variable context with NAME and FLAGS.
-- NAME can be NULL. */
--
--VAR_CONTEXT *
--new_var_context (name, flags)
-- char *name;
-- int flags;
--{
-- VAR_CONTEXT *vc;
--
-- vc = (VAR_CONTEXT *)xmalloc (sizeof (VAR_CONTEXT));
-- vc->name = name ? savestring (name) : (char *)NULL;
-- vc->scope = variable_context;
-- vc->flags = flags;
--
-- vc->up = vc->down = (VAR_CONTEXT *)NULL;
-- vc->table = (HASH_TABLE *)NULL;
--
-- return vc;
--}
--
--/* Free a variable context and its data, including the hash table. Dispose
-- all of the variables. */
--void
--dispose_var_context (vc)
-- VAR_CONTEXT *vc;
--{
-- FREE (vc->name);
--
-- if (vc->table)
-- {
-- delete_all_variables (vc->table);
-- hash_dispose (vc->table);
-- }
--
-- free (vc);
--}
--
--/* Set VAR's scope level to the current variable context. */
--static int
--set_context (var)
-- SHELL_VAR *var;
--{
-- return (var->context = variable_context);
--}
--
--/* Make a new variable context with NAME and FLAGS and a HASH_TABLE of
-- temporary variables, and push it onto shell_variables. This is
-- for shell functions. */
--VAR_CONTEXT *
--push_var_context (name, flags, tempvars)
-- char *name;
-- int flags;
-- HASH_TABLE *tempvars;
--{
-- VAR_CONTEXT *vc;
--
-- vc = new_var_context (name, flags);
-- vc->table = tempvars;
-- if (tempvars)
-- {
-- /* Have to do this because the temp environment was created before
-- variable_context was incremented. */
-- flatten (tempvars, set_context, (VARLIST *)NULL, 0);
-- vc->flags |= VC_HASTMPVAR;
-- }
-- vc->down = shell_variables;
-- shell_variables->up = vc;
--
-- return (shell_variables = vc);
--}
--
--static void
--push_func_var (data)
-- PTR_T data;
--{
-- SHELL_VAR *var, *v;
--
-- var = (SHELL_VAR *)data;
--
-- if (tempvar_p (var) && (posixly_correct || (var->attributes & att_propagate)))
-- {
-- /* Make sure we have a hash table to store the variable in while it is
-- being propagated down to the global variables table. Create one if
-- we have to */
-- if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0)
-- shell_variables->table = hash_create (0);
-- /* XXX - should we set v->context here? */
-- v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0);
-- if (shell_variables == global_variables)
-- var->attributes &= ~(att_tempvar|att_propagate);
-- else
-- shell_variables->flags |= VC_HASTMPVAR;
-- v->attributes |= var->attributes;
-- }
-- else
-- stupidly_hack_special_variables (var->name); /* XXX */
--
-- dispose_variable (var);
--}
--
--/* Pop the top context off of VCXT and dispose of it, returning the rest of
-- the stack. */
--void
--pop_var_context ()
--{
-- VAR_CONTEXT *ret, *vcxt;
--
-- vcxt = shell_variables;
-- if (vc_isfuncenv (vcxt) == 0)
-- {
-- internal_error (_("pop_var_context: head of shell_variables not a function context"));
-- return;
-- }
--
-- if (ret = vcxt->down)
-- {
-- ret->up = (VAR_CONTEXT *)NULL;
-- shell_variables = ret;
-- if (vcxt->table)
-- hash_flush (vcxt->table, push_func_var);
-- dispose_var_context (vcxt);
-- }
-- else
-- internal_error (_("pop_var_context: no global_variables context"));
--}
--
--/* Delete the HASH_TABLEs for all variable contexts beginning at VCXT, and
-- all of the VAR_CONTEXTs except GLOBAL_VARIABLES. */
--void
--delete_all_contexts (vcxt)
-- VAR_CONTEXT *vcxt;
--{
-- VAR_CONTEXT *v, *t;
--
-- for (v = vcxt; v != global_variables; v = t)
-- {
-- t = v->down;
-- dispose_var_context (v);
-- }
--
-- delete_all_variables (global_variables->table);
-- shell_variables = global_variables;
--}
--
--/* **************************************************************** */
--/* */
--/* Pushing and Popping temporary variable scopes */
--/* */
--/* **************************************************************** */
--
--VAR_CONTEXT *
--push_scope (flags, tmpvars)
-- int flags;
-- HASH_TABLE *tmpvars;
--{
-- return (push_var_context ((char *)NULL, flags, tmpvars));
--}
--
--static void
--push_exported_var (data)
-- PTR_T data;
--{
-- SHELL_VAR *var, *v;
--
-- var = (SHELL_VAR *)data;
--
-- /* If a temp var had its export attribute set, or it's marked to be
-- propagated, bind it in the previous scope before disposing it. */
-- /* XXX - This isn't exactly right, because all tempenv variables have the
-- export attribute set. */
--#if 0
-- if (exported_p (var) || (var->attributes & att_propagate))
--#else
-- if (tempvar_p (var) && exported_p (var) && (var->attributes & att_propagate))
--#endif
-- {
-- var->attributes &= ~att_tempvar; /* XXX */
-- v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0);
-- if (shell_variables == global_variables)
-- var->attributes &= ~att_propagate;
-- v->attributes |= var->attributes;
-- }
-- else
-- stupidly_hack_special_variables (var->name); /* XXX */
--
-- dispose_variable (var);
--}
--
--void
--pop_scope (is_special)
-- int is_special;
--{
-- VAR_CONTEXT *vcxt, *ret;
--
-- vcxt = shell_variables;
-- if (vc_istempscope (vcxt) == 0)
-- {
-- internal_error (_("pop_scope: head of shell_variables not a temporary environment scope"));
-- return;
-- }
--
-- ret = vcxt->down;
-- if (ret)
-- ret->up = (VAR_CONTEXT *)NULL;
--
-- shell_variables = ret;
--
-- /* Now we can take care of merging variables in VCXT into set of scopes
-- whose head is RET (shell_variables). */
-- FREE (vcxt->name);
-- if (vcxt->table)
-- {
-- if (is_special)
-- hash_flush (vcxt->table, push_func_var);
-- else
-- hash_flush (vcxt->table, push_exported_var);
-- hash_dispose (vcxt->table);
-- }
-- free (vcxt);
--
-- sv_ifs ("IFS"); /* XXX here for now */
--}
--
--/* **************************************************************** */
--/* */
--/* Pushing and Popping function contexts */
--/* */
--/* **************************************************************** */
--
--static WORD_LIST **dollar_arg_stack = (WORD_LIST **)NULL;
--static int dollar_arg_stack_slots;
--static int dollar_arg_stack_index;
--
--/* XXX - we might want to consider pushing and popping the `getopts' state
-- when we modify the positional parameters. */
--void
--push_context (name, is_subshell, tempvars)
-- char *name; /* function name */
-- int is_subshell;
-- HASH_TABLE *tempvars;
--{
-- if (is_subshell == 0)
-- push_dollar_vars ();
-- variable_context++;
-- push_var_context (name, VC_FUNCENV, tempvars);
--}
--
--/* Only called when subshell == 0, so we don't need to check, and can
-- unconditionally pop the dollar vars off the stack. */
--void
--pop_context ()
--{
-- pop_dollar_vars ();
-- variable_context--;
-- pop_var_context ();
--
-- sv_ifs ("IFS"); /* XXX here for now */
--}
--
--/* Save the existing positional parameters on a stack. */
--void
--push_dollar_vars ()
--{
-- if (dollar_arg_stack_index + 2 > dollar_arg_stack_slots)
-- {
-- dollar_arg_stack = (WORD_LIST **)
-- xrealloc (dollar_arg_stack, (dollar_arg_stack_slots += 10)
-- * sizeof (WORD_LIST *));
-- }
-- dollar_arg_stack[dollar_arg_stack_index++] = list_rest_of_args ();
-- dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL;
--}
--
--/* Restore the positional parameters from our stack. */
--void
--pop_dollar_vars ()
--{
-- if (!dollar_arg_stack || dollar_arg_stack_index == 0)
-- return;
--
-- remember_args (dollar_arg_stack[--dollar_arg_stack_index], 1);
-- dispose_words (dollar_arg_stack[dollar_arg_stack_index]);
-- dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL;
-- set_dollar_vars_unchanged ();
--}
--
--void
--dispose_saved_dollar_vars ()
--{
-- if (!dollar_arg_stack || dollar_arg_stack_index == 0)
-- return;
--
-- dispose_words (dollar_arg_stack[dollar_arg_stack_index]);
-- dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL;
--}
--
--/* Manipulate the special BASH_ARGV and BASH_ARGC variables. */
--
--void
--push_args (list)
-- WORD_LIST *list;
--{
--#if defined (ARRAY_VARS) && defined (DEBUGGER)
-- SHELL_VAR *bash_argv_v, *bash_argc_v;
-- ARRAY *bash_argv_a, *bash_argc_a;
-- WORD_LIST *l;
-- arrayind_t i;
-- char *t;
--
-- GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a);
-- GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a);
--
-- for (l = list, i = 0; l; l = l->next, i++)
-- array_push (bash_argv_a, l->word->word);
--
-- t = itos (i);
-- array_push (bash_argc_a, t);
-- free (t);
--#endif /* ARRAY_VARS && DEBUGGER */
--}
--
--/* Remove arguments from BASH_ARGV array. Pop top element off BASH_ARGC
-- array and use that value as the count of elements to remove from
-- BASH_ARGV. */
--void
--pop_args ()
--{
--#if defined (ARRAY_VARS) && defined (DEBUGGER)
-- SHELL_VAR *bash_argv_v, *bash_argc_v;
-- ARRAY *bash_argv_a, *bash_argc_a;
-- ARRAY_ELEMENT *ce;
-- intmax_t i;
--
-- GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a);
-- GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a);
--
-- ce = array_shift (bash_argc_a, 1, 0);
-- if (ce == 0 || legal_number (element_value (ce), &i) == 0)
-- i = 0;
--
-- for ( ; i > 0; i--)
-- array_pop (bash_argv_a);
-- array_dispose_element (ce);
--#endif /* ARRAY_VARS && DEBUGGER */
--}
--
--/*************************************************
-- * *
-- * Functions to manage special variables *
-- * *
-- *************************************************/
--
--/* Extern declarations for variables this code has to manage. */
--extern int eof_encountered, eof_encountered_limit, ignoreeof;
--
--#if defined (READLINE)
--extern int hostname_list_initialized;
--#endif
--
--/* An alist of name.function for each special variable. Most of the
-- functions don't do much, and in fact, this would be faster with a
-- switch statement, but by the end of this file, I am sick of switch
-- statements. */
--
--#define SET_INT_VAR(name, intvar) intvar = find_variable (name) != 0
--
--/* This table will be sorted with qsort() the first time it's accessed. */
--struct name_and_function {
-- char *name;
-- sh_sv_func_t *function;
--};
--
--static struct name_and_function special_vars[] = {
-- { "BASH_COMPAT", sv_shcompat },
-- { "BASH_XTRACEFD", sv_xtracefd },
--
--#if defined (JOB_CONTROL)
-- { "CHILD_MAX", sv_childmax },
--#endif
--
--#if defined (READLINE)
--# if defined (STRICT_POSIX)
-- { "COLUMNS", sv_winsize },
--# endif
-- { "COMP_WORDBREAKS", sv_comp_wordbreaks },
--#endif
--
-- { "FUNCNEST", sv_funcnest },
--
-- { "GLOBIGNORE", sv_globignore },
--
--#if defined (HISTORY)
-- { "HISTCONTROL", sv_history_control },
-- { "HISTFILESIZE", sv_histsize },
-- { "HISTIGNORE", sv_histignore },
-- { "HISTSIZE", sv_histsize },
-- { "HISTTIMEFORMAT", sv_histtimefmt },
--#endif
--
--#if defined (__CYGWIN__)
-- { "HOME", sv_home },
--#endif
--
--#if defined (READLINE)
-- { "HOSTFILE", sv_hostfile },
--#endif
--
-- { "IFS", sv_ifs },
-- { "IGNOREEOF", sv_ignoreeof },
--
-- { "LANG", sv_locale },
-- { "LC_ALL", sv_locale },
-- { "LC_COLLATE", sv_locale },
-- { "LC_CTYPE", sv_locale },
-- { "LC_MESSAGES", sv_locale },
-- { "LC_NUMERIC", sv_locale },
-- { "LC_TIME", sv_locale },
--
--#if defined (READLINE) && defined (STRICT_POSIX)
-- { "LINES", sv_winsize },
--#endif
--
-- { "MAIL", sv_mail },
-- { "MAILCHECK", sv_mail },
-- { "MAILPATH", sv_mail },
--
-- { "OPTERR", sv_opterr },
-- { "OPTIND", sv_optind },
--
-- { "PATH", sv_path },
-- { "POSIXLY_CORRECT", sv_strict_posix },
--
--#if defined (READLINE)
-- { "TERM", sv_terminal },
-- { "TERMCAP", sv_terminal },
-- { "TERMINFO", sv_terminal },
--#endif /* READLINE */
--
-- { "TEXTDOMAIN", sv_locale },
-- { "TEXTDOMAINDIR", sv_locale },
--
--#if defined (HAVE_TZSET)
-- { "TZ", sv_tz },
--#endif
--
--#if defined (HISTORY) && defined (BANG_HISTORY)
-- { "histchars", sv_histchars },
--#endif /* HISTORY && BANG_HISTORY */
--
-- { "ignoreeof", sv_ignoreeof },
--
-- { (char *)0, (sh_sv_func_t *)0 }
--};
--
--#define N_SPECIAL_VARS (sizeof (special_vars) / sizeof (special_vars[0]) - 1)
--
--static int
--sv_compare (sv1, sv2)
-- struct name_and_function *sv1, *sv2;
--{
-- int r;
--
-- if ((r = sv1->name[0] - sv2->name[0]) == 0)
-- r = strcmp (sv1->name, sv2->name);
-- return r;
--}
--
--static inline int
--find_special_var (name)
-- const char *name;
--{
-- register int i, r;
--
-- for (i = 0; special_vars[i].name; i++)
-- {
-- r = special_vars[i].name[0] - name[0];
-- if (r == 0)
-- r = strcmp (special_vars[i].name, name);
-- if (r == 0)
-- return i;
-- else if (r > 0)
-- /* Can't match any of rest of elements in sorted list. Take this out
-- if it causes problems in certain environments. */
-- break;
-- }
-- return -1;
--}
--
--/* The variable in NAME has just had its state changed. Check to see if it
-- is one of the special ones where something special happens. */
--void
--stupidly_hack_special_variables (name)
-- char *name;
--{
-- static int sv_sorted = 0;
-- int i;
--
-- if (sv_sorted == 0) /* shouldn't need, but it's fairly cheap. */
-- {
-- qsort (special_vars, N_SPECIAL_VARS, sizeof (special_vars[0]),
-- (QSFUNC *)sv_compare);
-- sv_sorted = 1;
-- }
--
-- i = find_special_var (name);
-- if (i != -1)
-- (*(special_vars[i].function)) (name);
--}
--
--/* Special variables that need hooks to be run when they are unset as part
-- of shell reinitialization should have their sv_ functions run here. */
--void
--reinit_special_variables ()
--{
--#if defined (READLINE)
-- sv_comp_wordbreaks ("COMP_WORDBREAKS");
--#endif
-- sv_globignore ("GLOBIGNORE");
-- sv_opterr ("OPTERR");
--}
--
--void
--sv_ifs (name)
-- char *name;
--{
-- SHELL_VAR *v;
--
-- v = find_variable ("IFS");
-- setifs (v);
--}
--
--/* What to do just after the PATH variable has changed. */
--void
--sv_path (name)
-- char *name;
--{
-- /* hash -r */
-- phash_flush ();
--}
--
--/* What to do just after one of the MAILxxxx variables has changed. NAME
-- is the name of the variable. This is called with NAME set to one of
-- MAIL, MAILCHECK, or MAILPATH. */
--void
--sv_mail (name)
-- char *name;
--{
-- /* If the time interval for checking the files has changed, then
-- reset the mail timer. Otherwise, one of the pathname vars
-- to the users mailbox has changed, so rebuild the array of
-- filenames. */
-- if (name[4] == 'C') /* if (strcmp (name, "MAILCHECK") == 0) */
-- reset_mail_timer ();
-- else
-- {
-- free_mail_files ();
-- remember_mail_dates ();
-- }
--}
--
--void
--sv_funcnest (name)
-- char *name;
--{
-- SHELL_VAR *v;
-- intmax_t num;
--
-- v = find_variable (name);
-- if (v == 0)
-- funcnest_max = 0;
-- else if (legal_number (value_cell (v), &num) == 0)
-- funcnest_max = 0;
-- else
-- funcnest_max = num;
--}
--
--/* What to do when GLOBIGNORE changes. */
--void
--sv_globignore (name)
-- char *name;
--{
-- if (privileged_mode == 0)
-- setup_glob_ignore (name);
--}
--
--#if defined (READLINE)
--void
--sv_comp_wordbreaks (name)
-- char *name;
--{
-- SHELL_VAR *sv;
--
-- sv = find_variable (name);
-- if (sv == 0)
-- reset_completer_word_break_chars ();
--}
--
--/* What to do just after one of the TERMxxx variables has changed.
-- If we are an interactive shell, then try to reset the terminal
-- information in readline. */
--void
--sv_terminal (name)
-- char *name;
--{
-- if (interactive_shell && no_line_editing == 0)
-- rl_reset_terminal (get_string_value ("TERM"));
--}
--
--void
--sv_hostfile (name)
-- char *name;
--{
-- SHELL_VAR *v;
--
-- v = find_variable (name);
-- if (v == 0)
-- clear_hostname_list ();
-- else
-- hostname_list_initialized = 0;
--}
--
--#if defined (STRICT_POSIX)
--/* In strict posix mode, we allow assignments to LINES and COLUMNS (and values
-- found in the initial environment) to override the terminal size reported by
-- the kernel. */
--void
--sv_winsize (name)
-- char *name;
--{
-- SHELL_VAR *v;
-- intmax_t xd;
-- int d;
--
-- if (posixly_correct == 0 || interactive_shell == 0 || no_line_editing)
-- return;
--
-- v = find_variable (name);
-- if (v == 0 || var_isnull (v))
-- rl_reset_screen_size ();
-- else
-- {
-- if (legal_number (value_cell (v), &xd) == 0)
-- return;
-- winsize_assignment = 1;
-- d = xd; /* truncate */
-- if (name[0] == 'L') /* LINES */
-- rl_set_screen_size (d, -1);
-- else /* COLUMNS */
-- rl_set_screen_size (-1, d);
-- winsize_assignment = 0;
-- }
--}
--#endif /* STRICT_POSIX */
--#endif /* READLINE */
--
--/* Update the value of HOME in the export environment so tilde expansion will
-- work on cygwin. */
--#if defined (__CYGWIN__)
--sv_home (name)
-- char *name;
--{
-- array_needs_making = 1;
-- maybe_make_export_env ();
--}
--#endif
--
--#if defined (HISTORY)
--/* What to do after the HISTSIZE or HISTFILESIZE variables change.
-- If there is a value for this HISTSIZE (and it is numeric), then stifle
-- the history. Otherwise, if there is NO value for this variable,
-- unstifle the history. If name is HISTFILESIZE, and its value is
-- numeric, truncate the history file to hold no more than that many
-- lines. */
--void
--sv_histsize (name)
-- char *name;
--{
-- char *temp;
-- intmax_t num;
-- int hmax;
--
-- temp = get_string_value (name);
--
-- if (temp && *temp)
-- {
-- if (legal_number (temp, &num))
-- {
-- hmax = num;
-- if (hmax < 0 && name[4] == 'S')
-- unstifle_history (); /* unstifle history if HISTSIZE < 0 */
-- else if (name[4] == 'S')
-- {
-- stifle_history (hmax);
-- hmax = where_history ();
-- if (history_lines_this_session > hmax)
-- history_lines_this_session = hmax;
-- }
-- else if (hmax >= 0) /* truncate HISTFILE if HISTFILESIZE >= 0 */
-- {
-- history_truncate_file (get_string_value ("HISTFILE"), hmax);
-- if (hmax <= history_lines_in_file)
-- history_lines_in_file = hmax;
-- }
-- }
-- }
-- else if (name[4] == 'S')
-- unstifle_history ();
--}
--
--/* What to do after the HISTIGNORE variable changes. */
--void
--sv_histignore (name)
-- char *name;
--{
-- setup_history_ignore (name);
--}
--
--/* What to do after the HISTCONTROL variable changes. */
--void
--sv_history_control (name)
-- char *name;
--{
-- char *temp;
-- char *val;
-- int tptr;
--
-- history_control = 0;
-- temp = get_string_value (name);
--
-- if (temp == 0 || *temp == 0)
-- return;
--
-- tptr = 0;
-- while (val = extract_colon_unit (temp, &tptr))
-- {
-- if (STREQ (val, "ignorespace"))
-- history_control |= HC_IGNSPACE;
-- else if (STREQ (val, "ignoredups"))
-- history_control |= HC_IGNDUPS;
-- else if (STREQ (val, "ignoreboth"))
-- history_control |= HC_IGNBOTH;
-- else if (STREQ (val, "erasedups"))
-- history_control |= HC_ERASEDUPS;
--
-- free (val);
-- }
--}
--
--#if defined (BANG_HISTORY)
--/* Setting/unsetting of the history expansion character. */
--void
--sv_histchars (name)
-- char *name;
--{
-- char *temp;
--
-- temp = get_string_value (name);
-- if (temp)
-- {
-- history_expansion_char = *temp;
-- if (temp[0] && temp[1])
-- {
-- history_subst_char = temp[1];
-- if (temp[2])
-- history_comment_char = temp[2];
-- }
-- }
-- else
-- {
-- history_expansion_char = '!';
-- history_subst_char = '^';
-- history_comment_char = '#';
-- }
--}
--#endif /* BANG_HISTORY */
--
--void
--sv_histtimefmt (name)
-- char *name;
--{
-- SHELL_VAR *v;
--
-- if (v = find_variable (name))
-- {
-- if (history_comment_char == 0)
-- history_comment_char = '#';
-- }
-- history_write_timestamps = (v != 0);
--}
--#endif /* HISTORY */
--
--#if defined (HAVE_TZSET)
--void
--sv_tz (name)
-- char *name;
--{
-- if (chkexport (name))
-- tzset ();
--}
--#endif
--
--/* If the variable exists, then the value of it can be the number
-- of times we actually ignore the EOF. The default is small,
-- (smaller than csh, anyway). */
--void
--sv_ignoreeof (name)
-- char *name;
--{
-- SHELL_VAR *tmp_var;
-- char *temp;
--
-- eof_encountered = 0;
--
-- tmp_var = find_variable (name);
-- ignoreeof = tmp_var != 0;
-- temp = tmp_var ? value_cell (tmp_var) : (char *)NULL;
-- if (temp)
-- eof_encountered_limit = (*temp && all_digits (temp)) ? atoi (temp) : 10;
-- set_shellopts (); /* make sure `ignoreeof' is/is not in $SHELLOPTS */
--}
--
--void
--sv_optind (name)
-- char *name;
--{
-- char *tt;
-- int s;
--
-- tt = get_string_value ("OPTIND");
-- if (tt && *tt)
-- {
-- s = atoi (tt);
--
-- /* According to POSIX, setting OPTIND=1 resets the internal state
-- of getopt (). */
-- if (s < 0 || s == 1)
-- s = 0;
-- }
-- else
-- s = 0;
-- getopts_reset (s);
--}
--
--void
--sv_opterr (name)
-- char *name;
--{
-- char *tt;
--
-- tt = get_string_value ("OPTERR");
-- sh_opterr = (tt && *tt) ? atoi (tt) : 1;
--}
--
--void
--sv_strict_posix (name)
-- char *name;
--{
-- SET_INT_VAR (name, posixly_correct);
-- posix_initialize (posixly_correct);
--#if defined (READLINE)
-- if (interactive_shell)
-- posix_readline_initialize (posixly_correct);
--#endif /* READLINE */
-- set_shellopts (); /* make sure `posix' is/is not in $SHELLOPTS */
--}
--
--void
--sv_locale (name)
-- char *name;
--{
-- char *v;
-- int r;
--
-- v = get_string_value (name);
-- if (name[0] == 'L' && name[1] == 'A') /* LANG */
-- r = set_lang (name, v);
-- else
-- r = set_locale_var (name, v); /* LC_*, TEXTDOMAIN* */
--
--#if 1
-- if (r == 0 && posixly_correct)
-- last_command_exit_value = 1;
--#endif
--}
--
--#if defined (ARRAY_VARS)
--void
--set_pipestatus_array (ps, nproc)
-- int *ps;
-- int nproc;
--{
-- SHELL_VAR *v;
-- ARRAY *a;
-- ARRAY_ELEMENT *ae;
-- register int i;
-- char *t, tbuf[INT_STRLEN_BOUND(int) + 1];
--
-- v = find_variable ("PIPESTATUS");
-- if (v == 0)
-- v = make_new_array_variable ("PIPESTATUS");
-- if (array_p (v) == 0)
-- return; /* Do nothing if not an array variable. */
-- a = array_cell (v);
--
-- if (a == 0 || array_num_elements (a) == 0)
-- {
-- for (i = 0; i < nproc; i++) /* was ps[i] != -1, not i < nproc */
-- {
-- t = inttostr (ps[i], tbuf, sizeof (tbuf));
-- array_insert (a, i, t);
-- }
-- return;
-- }
--
-- /* Fast case */
-- if (array_num_elements (a) == nproc && nproc == 1)
-- {
-- ae = element_forw (a->head);
-- free (element_value (ae));
-- ae->value = itos (ps[0]);
-- }
-- else if (array_num_elements (a) <= nproc)
-- {
-- /* modify in array_num_elements members in place, then add */
-- ae = a->head;
-- for (i = 0; i < array_num_elements (a); i++)
-- {
-- ae = element_forw (ae);
-- free (element_value (ae));
-- ae->value = itos (ps[i]);
-- }
-- /* add any more */
-- for ( ; i < nproc; i++)
-- {
-- t = inttostr (ps[i], tbuf, sizeof (tbuf));
-- array_insert (a, i, t);
-- }
-- }
-- else
-- {
-- /* deleting elements. it's faster to rebuild the array. */
-- array_flush (a);
-- for (i = 0; ps[i] != -1; i++)
-- {
-- t = inttostr (ps[i], tbuf, sizeof (tbuf));
-- array_insert (a, i, t);
-- }
-- }
--}
--
--ARRAY *
--save_pipestatus_array ()
--{
-- SHELL_VAR *v;
-- ARRAY *a, *a2;
--
-- v = find_variable ("PIPESTATUS");
-- if (v == 0 || array_p (v) == 0 || array_cell (v) == 0)
-- return ((ARRAY *)NULL);
--
-- a = array_cell (v);
-- a2 = array_copy (array_cell (v));
--
-- return a2;
--}
--
--void
--restore_pipestatus_array (a)
-- ARRAY *a;
--{
-- SHELL_VAR *v;
-- ARRAY *a2;
--
-- v = find_variable ("PIPESTATUS");
-- /* XXX - should we still assign even if existing value is NULL? */
-- if (v == 0 || array_p (v) == 0 || array_cell (v) == 0)
-- return;
--
-- a2 = array_cell (v);
-- var_setarray (v, a);
--
-- array_dispose (a2);
--}
--#endif
--
--void
--set_pipestatus_from_exit (s)
-- int s;
--{
--#if defined (ARRAY_VARS)
-- static int v[2] = { 0, -1 };
--
-- v[0] = s;
-- set_pipestatus_array (v, 1);
--#endif
--}
--
--void
--sv_xtracefd (name)
-- char *name;
--{
-- SHELL_VAR *v;
-- char *t, *e;
-- int fd;
-- FILE *fp;
--
-- v = find_variable (name);
-- if (v == 0)
-- {
-- xtrace_reset ();
-- return;
-- }
--
-- t = value_cell (v);
-- if (t == 0 || *t == 0)
-- xtrace_reset ();
-- else
-- {
-- fd = (int)strtol (t, &e, 10);
-- if (e != t && *e == '\0' && sh_validfd (fd))
-- {
-- fp = fdopen (fd, "w");
-- if (fp == 0)
-- internal_error (_("%s: %s: cannot open as FILE"), name, value_cell (v));
-- else
-- xtrace_set (fd, fp);
-- }
-- else
-- internal_error (_("%s: %s: invalid value for trace file descriptor"), name, value_cell (v));
-- }
--}
--
--#define MIN_COMPAT_LEVEL 31
--
--void
--sv_shcompat (name)
-- char *name;
--{
-- SHELL_VAR *v;
-- char *val;
-- int tens, ones, compatval;
--
-- v = find_variable (name);
-- if (v == 0)
-- {
-- shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
-- set_compatibility_opts ();
-- return;
-- }
-- val = value_cell (v);
-- if (val == 0 || *val == '\0')
-- {
-- shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
-- set_compatibility_opts ();
-- return;
-- }
-- /* Handle decimal-like compatibility version specifications: 4.2 */
-- if (isdigit (val[0]) && val[1] == '.' && isdigit (val[2]) && val[3] == 0)
-- {
-- tens = val[0] - '0';
-- ones = val[2] - '0';
-- compatval = tens*10 + ones;
-- }
-- /* Handle integer-like compatibility version specifications: 42 */
-- else if (isdigit (val[0]) && isdigit (val[1]) && val[2] == 0)
-- {
-- tens = val[0] - '0';
-- ones = val[1] - '0';
-- compatval = tens*10 + ones;
-- }
-- else
-- {
--compat_error:
-- internal_error (_("%s: %s: compatibility value out of range"), name, val);
-- shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
-- set_compatibility_opts ();
-- return;
-- }
--
-- if (compatval < MIN_COMPAT_LEVEL || compatval > DEFAULT_COMPAT_LEVEL)
-- goto compat_error;
--
-- shell_compatibility_level = compatval;
-- set_compatibility_opts ();
--}
--
--#if defined (JOB_CONTROL)
--void
--sv_childmax (name)
-- char *name;
--{
-- char *tt;
-- int s;
--
-- tt = get_string_value (name);
-- s = (tt && *tt) ? atoi (tt) : 0;
-- set_maxchild (s);
--}
--#endif
diff --git a/patches/bash-4.3.30/0003-Bash-4.3-patch-33.patch b/patches/bash-4.3.30/0003-Bash-4.3-patch-33.patch
deleted file mode 100644
index cda179735..000000000
--- a/patches/bash-4.3.30/0003-Bash-4.3-patch-33.patch
+++ /dev/null
@@ -1,204 +0,0 @@
-From: Chet Ramey <chet.ramey@case.edu>
-Date: Thu, 15 Jan 2015 10:21:08 -0500
-Subject: [PATCH] Bash-4.3 patch 33
-
----
- bashline.c | 6 ++++--
- builtins/common.h | 4 ++++
- builtins/read.def | 31 ++++++++++++++++++++++++++++---
- patchlevel.h | 2 +-
- shell.c | 9 +++++++++
- sig.c | 6 ++++--
- 6 files changed, 50 insertions(+), 8 deletions(-)
-
-diff --git a/bashline.c b/bashline.c
-index 77ca033f2cc8..c87415171a4a 100644
---- a/bashline.c
-+++ b/bashline.c
-@@ -202,6 +202,7 @@ extern int current_command_line_count, saved_command_line_count;
- extern int last_command_exit_value;
- extern int array_needs_making;
- extern int posixly_correct, no_symbolic_links;
-+extern int sigalrm_seen;
- extern char *current_prompt_string, *ps1_prompt;
- extern STRING_INT_ALIST word_token_alist[];
- extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin;
-@@ -4208,8 +4209,9 @@ bash_event_hook ()
- {
- /* If we're going to longjmp to top_level, make sure we clean up readline.
- check_signals will call QUIT, which will eventually longjmp to top_level,
-- calling run_interrupt_trap along the way. */
-- if (interrupt_state)
-+ calling run_interrupt_trap along the way. The check for sigalrm_seen is
-+ to clean up the read builtin's state. */
-+ if (terminating_signal || interrupt_state || sigalrm_seen)
- rl_cleanup_after_signal ();
- bashline_reset_event_hook ();
- check_signals_and_traps (); /* XXX */
-diff --git a/builtins/common.h b/builtins/common.h
-index cae16b10fb65..a1298cb9c84a 100644
---- a/builtins/common.h
-+++ b/builtins/common.h
-@@ -122,6 +122,10 @@ extern void bash_logout __P((void));
- /* Functions from getopts.def */
- extern void getopts_reset __P((int));
-
-+/* Functions from read.def */
-+extern void read_tty_cleanup __P((void));
-+extern int read_tty_modified __P((void));
-+
- /* Functions from set.def */
- extern int minus_o_option_value __P((char *));
- extern void list_minus_o_opts __P((int, int));
-diff --git a/builtins/read.def b/builtins/read.def
-index 43971544d081..56c23010bbe8 100644
---- a/builtins/read.def
-+++ b/builtins/read.def
-@@ -140,10 +140,12 @@ static void reset_alarm __P((void));
- procenv_t alrmbuf;
- int sigalrm_seen;
-
--static int reading;
-+static int reading, tty_modified;
- static SigHandler *old_alrm;
- static unsigned char delim;
-
-+static struct ttsave termsave;
-+
- /* In all cases, SIGALRM just sets a flag that we check periodically. This
- avoids problems with the semi-tricky stuff we do with the xfree of
- input_string at the top of the unwind-protect list (see below). */
-@@ -188,7 +190,6 @@ read_builtin (list)
- struct stat tsb;
- SHELL_VAR *var;
- TTYSTRUCT ttattrs, ttset;
-- struct ttsave termsave;
- #if defined (ARRAY_VARS)
- WORD_LIST *alist;
- #endif
-@@ -221,7 +222,7 @@ read_builtin (list)
- USE_VAR(ps2);
- USE_VAR(lastsig);
-
-- sigalrm_seen = reading = 0;
-+ sigalrm_seen = reading = tty_modified = 0;
-
- i = 0; /* Index into the string that we are reading. */
- raw = edit = 0; /* Not reading raw input by default. */
-@@ -438,6 +439,8 @@ read_builtin (list)
- retval = 128+SIGALRM;
- goto assign_vars;
- }
-+ if (interactive_shell == 0)
-+ initialize_terminating_signals ();
- old_alrm = set_signal_handler (SIGALRM, sigalrm);
- add_unwind_protect (reset_alarm, (char *)NULL);
- #if defined (READLINE)
-@@ -482,7 +485,10 @@ read_builtin (list)
- i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset);
- if (i < 0)
- sh_ttyerror (1);
-+ tty_modified = 1;
- add_unwind_protect ((Function *)ttyrestore, (char *)&termsave);
-+ if (interactive_shell == 0)
-+ initialize_terminating_signals ();
- }
- }
- else if (silent) /* turn off echo but leave term in canonical mode */
-@@ -497,7 +503,10 @@ read_builtin (list)
- if (i < 0)
- sh_ttyerror (1);
-
-+ tty_modified = 1;
- add_unwind_protect ((Function *)ttyrestore, (char *)&termsave);
-+ if (interactive_shell == 0)
-+ initialize_terminating_signals ();
- }
-
- /* This *must* be the top unwind-protect on the stack, so the manipulation
-@@ -588,6 +597,8 @@ read_builtin (list)
- }
- else
- lastsig = 0;
-+ if (terminating_signal && tty_modified)
-+ ttyrestore (&termsave); /* fix terminal before exiting */
- CHECK_TERMSIG;
- eof = 1;
- break;
-@@ -978,6 +989,20 @@ ttyrestore (ttp)
- struct ttsave *ttp;
- {
- ttsetattr (ttp->fd, ttp->attrs);
-+ tty_modified = 0;
-+}
-+
-+void
-+read_tty_cleanup ()
-+{
-+ if (tty_modified)
-+ ttyrestore (&termsave);
-+}
-+
-+int
-+read_tty_modified ()
-+{
-+ return (tty_modified);
- }
-
- #if defined (READLINE)
-diff --git a/patchlevel.h b/patchlevel.h
-index b8bf38704ed2..cefe6bdd3a13 100644
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
- regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
- looks for to find the patch level (for the sccs version string). */
-
--#define PATCHLEVEL 32
-+#define PATCHLEVEL 33
-
- #endif /* _PATCHLEVEL_H_ */
-diff --git a/shell.c b/shell.c
-index bbc8a66cc2eb..2fd8179ba10d 100644
---- a/shell.c
-+++ b/shell.c
-@@ -73,6 +73,7 @@
- #endif
-
- #if defined (READLINE)
-+# include <readline/readline.h>
- # include "bashline.h"
- #endif
-
-@@ -909,6 +910,14 @@ exit_shell (s)
- fflush (stdout); /* XXX */
- fflush (stderr);
-
-+ /* Clean up the terminal if we are in a state where it's been modified. */
-+#if defined (READLINE)
-+ if (RL_ISSTATE (RL_STATE_TERMPREPPED) && rl_deprep_term_function)
-+ (*rl_deprep_term_function) ();
-+#endif
-+ if (read_tty_modified ())
-+ read_tty_cleanup ();
-+
- /* Do trap[0] if defined. Allow it to override the exit status
- passed to us. */
- if (signal_is_trapped (0))
-diff --git a/sig.c b/sig.c
-index 3b62ea5d7c5d..8bc45c17f478 100644
---- a/sig.c
-+++ b/sig.c
-@@ -532,8 +532,10 @@ termsig_sighandler (sig)
- #if defined (READLINE)
- /* Set the event hook so readline will call it after the signal handlers
- finish executing, so if this interrupted character input we can get
-- quick response. */
-- if (interactive_shell && interactive && no_line_editing == 0)
-+ quick response. If readline is active or has modified the terminal we
-+ need to set this no matter what the signal is, though the check for
-+ RL_STATE_TERMPREPPED is possibly redundant. */
-+ if (RL_ISSTATE (RL_STATE_SIGHANDLER) || RL_ISSTATE (RL_STATE_TERMPREPPED))
- bashline_set_event_hook ();
- #endif
-
diff --git a/patches/bash-4.3.30/series b/patches/bash-4.3.30/series
deleted file mode 100644
index 2e1fdf17f..000000000
--- a/patches/bash-4.3.30/series
+++ /dev/null
@@ -1,6 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Bash-4.3-patch-31.patch
-0002-Bash-4.3-patch-32.patch
-0003-Bash-4.3-patch-33.patch
-# 602897f584d96d29536a2fa60f8d5e23 - git-ptx-patches magic
diff --git a/patches/alsa-lib-1.2.1.2/autogen.sh b/patches/bayer2rgb3-v0.6.0/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/alsa-lib-1.2.1.2/autogen.sh
+++ b/patches/bayer2rgb3-v0.6.0/autogen.sh
diff --git a/patches/beep-1.3/0001-Makefile-fix.patch b/patches/beep-1.3/0001-Makefile-fix.patch
deleted file mode 100644
index 3a0e4eae8..000000000
--- a/patches/beep-1.3/0001-Makefile-fix.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Bastian Stender <bst@pengutronix.de>
-Date: Tue, 10 Oct 2017 11:58:17 +0200
-Subject: [PATCH] Makefile: fix
-
-Signed-off-by: Bastian Stender <bst@pengutronix.de>
----
- Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index cc359c4843e4..23f40d4a2a10 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1,9 +1,9 @@
- CC=gcc
- FLAGS=-Wall
- EXEC_NAME=beep
--INSTALL_DIR=/usr/bin
-+INSTALL_DIR=${DESTDIR}/usr/bin
- MAN_FILE=beep.1.gz
--MAN_DIR=/usr/man/man1
-+MAN_DIR=${DESTDIR}/usr/man/man1
-
- default : beep
-
diff --git a/patches/beep-1.3/series b/patches/beep-1.3/series
deleted file mode 100644
index 1511acea7..000000000
--- a/patches/beep-1.3/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Makefile-fix.patch
-# d6a7d2de78aeb0017353e94c1b0870c5 - git-ptx-patches magic
diff --git a/patches/bonnie++-1.97.3/0001-configure-cache-result-of-large-file-test.patch b/patches/bonnie++-1.97.3/0001-configure-cache-result-of-large-file-test.patch
deleted file mode 100644
index 3d78119f8..000000000
--- a/patches/bonnie++-1.97.3/0001-configure-cache-result-of-large-file-test.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Alexander Stein <alexander.stein@systec-electronic.com>
-Date: Mon, 27 Apr 2015 13:22:58 +0200
-Subject: [PATCH] configure: cache result of large file test
-
-Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
----
- configure.in | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index f92f0ab8ea8f..015e8ba82e71 100644
---- a/configure.in
-+++ b/configure.in
-@@ -83,6 +83,7 @@ void * thread_func(void * param) { return NULL; }
- , thread_ldflags="-pthread")
-
- AC_SUBST(large_file)
-+AC_CACHE_CHECK([Large file support], bonnie_cv_sys_largefile,
- AC_TRY_RUN([#ifndef _LARGEFILE64_SOURCE
- #define _LARGEFILE64_SOURCE
- #endif
-@@ -118,8 +119,8 @@ int main () {
- }
- close(fd);
- return 0;
--}], large_file="yes")
--if [[ -n "$large_file" ]]; then
-+}], bonnie_cv_sys_largefile=yes, bonnie_cv_sys_largefile=no))
-+if [[ "x$bonnie_cv_sys_largefile" = "xyes" ]]; then
- large_file="#define _LARGEFILE64_SOURCE"
- fi
-
diff --git a/patches/bonnie++-1.97.3/0002-use-DESTDIR-during-make-install.patch b/patches/bonnie++-1.97.3/0002-use-DESTDIR-during-make-install.patch
deleted file mode 100644
index 0d7848bac..000000000
--- a/patches/bonnie++-1.97.3/0002-use-DESTDIR-during-make-install.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 30 Apr 2015 17:47:05 +0200
-Subject: [PATCH] use DESTDIR during 'make install'
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- Makefile.in | 14 +++++++-------
- 1 file changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index 4f14819dd35c..14ac33ca54bb 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -52,15 +52,15 @@ generate_randfile: generate_randfile.o
- $(LINK) generate_randfile.o -o generate_randfile
-
- install-bin: $(EXE) $(EXES)
-- mkdir -p $(eprefix)/bin $(eprefix)/sbin
-- @INSTALL_PROGRAM@ @stripping@ $(EXES) $(eprefix)/sbin
-- @INSTALL_PROGRAM@ @stripping@ $(EXE) $(eprefix)/bin
-- @INSTALL_SCRIPT@ $(SCRIPTS) $(eprefix)/bin
-+ mkdir -p $(eprefix)/bin $(DESTDIR)$(eprefix)/sbin
-+ @INSTALL_PROGRAM@ @stripping@ $(EXES) $(DESTDIR)$(eprefix)/sbin
-+ @INSTALL_PROGRAM@ @stripping@ $(EXE) $(DESTDIR)$(eprefix)/bin
-+ @INSTALL_SCRIPT@ $(SCRIPTS) $(DESTDIR)$(eprefix)/bin
-
- install: install-bin
-- mkdir -p @mandir@/man1 @mandir@/man8
-- @INSTALL_DATA@ $(MAN1) @mandir@/man1
-- @INSTALL_DATA@ $(MAN8) @mandir@/man8
-+ mkdir -p @mandir@/man1 $(DESTDIR)@mandir@/man8
-+ @INSTALL_DATA@ $(MAN1) $(DESTDIR)@mandir@/man1
-+ @INSTALL_DATA@ $(MAN8) $(DESTDIR)@mandir@/man8
-
- %.o: %.cpp
- $(CXX) -c $<
diff --git a/patches/bonnie++-1.97.3/series b/patches/bonnie++-1.97.3/series
deleted file mode 100644
index b34bb5c9b..000000000
--- a/patches/bonnie++-1.97.3/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-configure-cache-result-of-large-file-test.patch
-0002-use-DESTDIR-during-make-install.patch
-# 484f49264861fb7df4a305cb4508383f - git-ptx-patches magic
diff --git a/patches/at-3.1.12/autogen.sh b/patches/bridge-utils-1.7.1/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/at-3.1.12/autogen.sh
+++ b/patches/bridge-utils-1.7.1/autogen.sh
diff --git a/patches/busybox-1.31.1/0100-Remove-stime-function-calls.patch b/patches/busybox-1.31.1/0100-Remove-stime-function-calls.patch
deleted file mode 100644
index 5e4c62ee1..000000000
--- a/patches/busybox-1.31.1/0100-Remove-stime-function-calls.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From: Alistair Francis <alistair.francis@wdc.com>
-Date: Tue, 19 Nov 2019 13:06:40 +0100
-Subject: [PATCH] Remove stime() function calls
-
-stime() has been deprecated in glibc 2.31 and replaced with
-clock_settime(). Let's replace the stime() function calls with
-clock_settime() in preperation.
-
-function old new delta
-rdate_main 197 224 +27
-clock_settime - 27 +27
-date_main 926 941 +15
-stime 37 - -37
-------------------------------------------------------------------------------
-(add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37) Total: 32 bytes
-
-Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
-Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
----
- coreutils/date.c | 6 +++++-
- libbb/missing_syscalls.c | 8 --------
- util-linux/rdate.c | 8 ++++++--
- 3 files changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/coreutils/date.c b/coreutils/date.c
-index 3414d38aedd9..4ade6abb4249 100644
---- a/coreutils/date.c
-+++ b/coreutils/date.c
-@@ -279,6 +279,9 @@ int date_main(int argc UNUSED_PARAM, char **argv)
- time(&ts.tv_sec);
- #endif
- }
-+#if !ENABLE_FEATURE_DATE_NANO
-+ ts.tv_nsec = 0;
-+#endif
- localtime_r(&ts.tv_sec, &tm_time);
-
- /* If date string is given, update tm_time, and maybe set date */
-@@ -301,9 +304,10 @@ int date_main(int argc UNUSED_PARAM, char **argv)
- if (date_str[0] != '@')
- tm_time.tm_isdst = -1;
- ts.tv_sec = validate_tm_time(date_str, &tm_time);
-+ ts.tv_nsec = 0;
-
- /* if setting time, set it */
-- if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) {
-+ if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) {
- bb_perror_msg("can't set date");
- }
- }
-diff --git a/libbb/missing_syscalls.c b/libbb/missing_syscalls.c
-index 87cf59b3d4cc..dc40d91552f1 100644
---- a/libbb/missing_syscalls.c
-+++ b/libbb/missing_syscalls.c
-@@ -15,14 +15,6 @@ pid_t getsid(pid_t pid)
- return syscall(__NR_getsid, pid);
- }
-
--int stime(const time_t *t)
--{
-- struct timeval tv;
-- tv.tv_sec = *t;
-- tv.tv_usec = 0;
-- return settimeofday(&tv, NULL);
--}
--
- int sethostname(const char *name, size_t len)
- {
- return syscall(__NR_sethostname, name, len);
-diff --git a/util-linux/rdate.c b/util-linux/rdate.c
-index 70f829e7fec7..878375d7868d 100644
---- a/util-linux/rdate.c
-+++ b/util-linux/rdate.c
-@@ -95,9 +95,13 @@ int rdate_main(int argc UNUSED_PARAM, char **argv)
- if (!(flags & 2)) { /* no -p (-s may be present) */
- if (time(NULL) == remote_time)
- bb_error_msg("current time matches remote time");
-- else
-- if (stime(&remote_time) < 0)
-+ else {
-+ struct timespec ts;
-+ ts.tv_sec = remote_time;
-+ ts.tv_nsec = 0;
-+ if (clock_settime(CLOCK_REALTIME, &ts) < 0)
- bb_perror_msg_and_die("can't set time of day");
-+ }
- }
-
- if (flags != 1) /* not lone -s */
diff --git a/patches/busybox-1.31.1/0201-Fix-the-format-warning-when-building-applets-usage_p.patch b/patches/busybox-1.31.1/0201-Fix-the-format-warning-when-building-applets-usage_p.patch
deleted file mode 100644
index 5a21793d8..000000000
--- a/patches/busybox-1.31.1/0201-Fix-the-format-warning-when-building-applets-usage_p.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Dinny Wu <dinny.wu@gmail.com>
-Date: Thu, 26 Jul 2012 14:12:51 +0000
-Subject: [PATCH] Fix the format warning when building applets/usage_pod.c
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When compiling busybox with gcc 4.6.3, it shows below warning:
-
-applets/usage_pod.c: In function ‘main’:
-applets/usage_pod.c:74:3: warning: format not a string literal and no format arguments [-Wformat-security]
-
-Signed-off-by: Dinny Wu <dinny.wu@gmail.com>
----
- applets/usage_pod.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/applets/usage_pod.c b/applets/usage_pod.c
-index ccc166aed708..9e6d3f0ee5b1 100644
---- a/applets/usage_pod.c
-+++ b/applets/usage_pod.c
-@@ -71,7 +71,7 @@ int main(void)
- } else {
- printf(", ");
- }
-- printf(usage_array[i].aname);
-+ printf("%s", usage_array[i].aname);
- col += len2;
- }
- printf("\n\n");
diff --git a/patches/busybox-1.31.1/series b/patches/busybox-1.31.1/series
deleted file mode 100644
index 2e75917fa..000000000
--- a/patches/busybox-1.31.1/series
+++ /dev/null
@@ -1,11 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-#tag:upstream-stable --start-number 1
-#tag:upstream-master --start-number 100
-0100-Remove-stime-function-calls.patch
-#tag:ptx --start-number 200
-0200-reactivate-check-for-tty.patch
-0201-Fix-the-format-warning-when-building-applets-usage_p.patch
-0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch
-0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch
-# df58d733972ae3ce861e84850c98ce86 - git-ptx-patches magic
diff --git a/patches/busybox-1.31.1/0200-reactivate-check-for-tty.patch b/patches/busybox-1.36.1/0200-reactivate-check-for-tty.patch
index 077b84efa..5c1c79272 100644
--- a/patches/busybox-1.31.1/0200-reactivate-check-for-tty.patch
+++ b/patches/busybox-1.36.1/0200-reactivate-check-for-tty.patch
@@ -14,10 +14,10 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
-index 57734b590ace..b9cf03d76f55 100644
+index 39ec1cdb63ec..be94e19c2011 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
-@@ -537,7 +537,7 @@ int main(int ac, char **av)
+@@ -539,7 +539,7 @@ int main(int ac, char **av)
break;
case 's':
input_mode = ask_silent;
diff --git a/patches/busybox-1.31.1/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch b/patches/busybox-1.36.1/0201-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch
index 4e9dca9dc..8ed9efe53 100644
--- a/patches/busybox-1.31.1/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch
+++ b/patches/busybox-1.36.1/0201-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch
@@ -10,10 +10,10 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 1 insertion(+)
diff --git a/Makefile.flags b/Makefile.flags
-index f3c897b0687f..72e0a13a6388 100644
+index 1cec5ba20b47..fd195efc965d 100644
--- a/Makefile.flags
+++ b/Makefile.flags
-@@ -153,6 +153,7 @@ ifeq ($(CONFIG_SELINUX),y)
+@@ -180,6 +180,7 @@ ifeq ($(CONFIG_SELINUX),y)
SELINUX_PC_MODULES = libselinux libsepol
$(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES)))
CPPFLAGS += $(SELINUX_CFLAGS)
diff --git a/patches/busybox-1.31.1/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch b/patches/busybox-1.36.1/0202-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch
index 6f2106090..21b6d3ccc 100644
--- a/patches/busybox-1.31.1/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch
+++ b/patches/busybox-1.36.1/0202-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch
@@ -9,10 +9,10 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/scripts/trylink b/scripts/trylink
-index ba2d265bc919..a3f3b5b8cc10 100755
+index 2255deee7699..4febc28fc013 100755
--- a/scripts/trylink
+++ b/scripts/trylink
-@@ -268,7 +268,12 @@ if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then
+@@ -269,7 +269,12 @@ if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then
cat $EXE.out
exit 1
}
@@ -26,7 +26,7 @@ index ba2d265bc919..a3f3b5b8cc10 100755
chmod a+x "$sharedlib_dir/libbusybox.so.$BB_VER"
echo "libbusybox: $sharedlib_dir/libbusybox.so.$BB_VER"
fi
-@@ -289,7 +294,11 @@ if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then
+@@ -290,7 +295,11 @@ if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then
cat $EXE.out
exit 1
}
@@ -39,7 +39,7 @@ index ba2d265bc919..a3f3b5b8cc10 100755
echo "busybox linked against libbusybox: $sharedlib_dir/busybox"
fi
-@@ -326,7 +335,9 @@ int main(int argc, char **argv)
+@@ -327,7 +336,9 @@ int main(int argc, char **argv)
exit 1
}
rm -- "$sharedlib_dir/applet.c" $EXE.out
diff --git a/patches/busybox-1.36.1/0203-tc-Fix-compilation-with-Linux-v6.8-rc1.patch b/patches/busybox-1.36.1/0203-tc-Fix-compilation-with-Linux-v6.8-rc1.patch
new file mode 100644
index 000000000..23715aa1a
--- /dev/null
+++ b/patches/busybox-1.36.1/0203-tc-Fix-compilation-with-Linux-v6.8-rc1.patch
@@ -0,0 +1,61 @@
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Sat, 23 Mar 2024 13:28:56 +0100
+Subject: [PATCH] tc: Fix compilation with Linux v6.8-rc1
+
+Linux v6.8-rc1 removed the definitions related to CBQ making tc fail to
+build. Add some #ifdefs to handle this missing support.
+
+Forwarded: http://lists.busybox.net/pipermail/busybox/2024-March/090678.html
+---
+ networking/tc.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/networking/tc.c b/networking/tc.c
+index 43187f7ee26c..1315b953e39f 100644
+--- a/networking/tc.c
++++ b/networking/tc.c
+@@ -231,6 +231,13 @@ static int cbq_parse_opt(int argc, char **argv, struct nlmsghdr *n)
+ return 0;
+ }
+ #endif
++
++#ifndef TCA_CBQ_MAX
++/*
++ * Linux v6.8-rc1~131^2~60^2^2 removed the uapi definitions for CBQ.
++ * See https://git.kernel.org/linus/33241dca48626
++ */
++#else
+ static int cbq_print_opt(struct rtattr *opt)
+ {
+ struct rtattr *tb[TCA_CBQ_MAX+1];
+@@ -322,6 +329,7 @@ static int cbq_print_opt(struct rtattr *opt)
+ done:
+ return 0;
+ }
++#endif
+
+ static FAST_FUNC int print_qdisc(
+ const struct sockaddr_nl *who UNUSED_PARAM,
+@@ -372,8 +380,10 @@ static FAST_FUNC int print_qdisc(
+ int qqq = index_in_strings(_q_, name);
+ if (qqq == 0) { /* pfifo_fast aka prio */
+ prio_print_opt(tb[TCA_OPTIONS]);
++#ifdef TCA_CBQ_MAX
+ } else if (qqq == 1) { /* class based queuing */
+ cbq_print_opt(tb[TCA_OPTIONS]);
++#endif
+ } else {
+ /* don't know how to print options for this qdisc */
+ printf("(options for %s)", name);
+@@ -442,9 +452,11 @@ static FAST_FUNC int print_class(
+ int qqq = index_in_strings(_q_, name);
+ if (qqq == 0) { /* pfifo_fast aka prio */
+ /* nothing. */ /*prio_print_opt(tb[TCA_OPTIONS]);*/
++#ifdef TCA_CBQ_MAX
+ } else if (qqq == 1) { /* class based queuing */
+ /* cbq_print_copt() is identical to cbq_print_opt(). */
+ cbq_print_opt(tb[TCA_OPTIONS]);
++#endif
+ } else {
+ /* don't know how to print options for this class */
+ printf("(options for %s)", name);
diff --git a/patches/busybox-1.36.1/series b/patches/busybox-1.36.1/series
new file mode 100644
index 000000000..87fee5091
--- /dev/null
+++ b/patches/busybox-1.36.1/series
@@ -0,0 +1,10 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+#tag:upstream-stable --start-number 1
+#tag:upstream-master --start-number 100
+#tag:ptx --start-number 200
+0200-reactivate-check-for-tty.patch
+0201-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch
+0202-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch
+0203-tc-Fix-compilation-with-Linux-v6.8-rc1.patch
+# e781b8c6838e27fd021f9c1a9f87654d - git-ptx-patches magic
diff --git a/patches/cairo-1.16.0/0001-only-build-GL-surface-tests-if-GLX-is-enabled.patch b/patches/cairo-1.16.0/0001-only-build-GL-surface-tests-if-GLX-is-enabled.patch
deleted file mode 100644
index 32fa1f64b..000000000
--- a/patches/cairo-1.16.0/0001-only-build-GL-surface-tests-if-GLX-is-enabled.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 15 Apr 2018 13:08:23 +0200
-Subject: [PATCH] only build GL surface tests if GLX is enabled
-
-All GL surface tests use GLX. So with --enable-png (to enable tests in
-general) and --enable-gl (for CAIRO_HAS_GL_SURFACE) building fails with:
-[...]
-gl-surface-source.c:33:5: error: unknown type name 'Display'
-gl-surface-source.c:34:5: error: unknown type name 'GLXContext'
-[...]
-And similar errors for the other tests.
-
-Fix this by making sure the GL surface tests are only built is GLX is
-enabled.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- test/Makefile.am | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/test/Makefile.am b/test/Makefile.am
-index e3c42ea88032..a50ba376e904 100644
---- a/test/Makefile.am
-+++ b/test/Makefile.am
-@@ -17,8 +17,10 @@ endif
- endif
-
- if CAIRO_HAS_GL_SURFACE
-+if CAIRO_HAS_GLX_FUNCTIONS
- test_sources += $(gl_surface_test_sources)
- endif
-+endif
-
- if CAIRO_HAS_EGL_FUNCTIONS
- test_sources += $(egl_surface_test_sources)
diff --git a/patches/cairo-1.16.0/0002-Makefile.sources-move-font-variations.c-a-test-code-.patch b/patches/cairo-1.16.0/0002-Makefile.sources-move-font-variations.c-a-test-code-.patch
deleted file mode 100644
index 8ae3809b9..000000000
--- a/patches/cairo-1.16.0/0002-Makefile.sources-move-font-variations.c-a-test-code-.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-Date: Mon, 8 Apr 2019 02:56:50 +0000
-Subject: [PATCH] Makefile.sources: move font-variations.c (a test code for
- Variation Font with FreeType2 functions) from test_sources to
- ft_font_test_sources, to restrict the test to the case with FreeType2
- backend. See discussion in
- https://lists.cairographics.org/archives/cairo/2019-April/028858.html
-
----
- test/Makefile.sources | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/test/Makefile.sources b/test/Makefile.sources
-index c47131faffe1..cc3d81f7e0be 100644
---- a/test/Makefile.sources
-+++ b/test/Makefile.sources
-@@ -144,7 +144,6 @@ test_sources = \
- font-face-get-type.c \
- font-matrix-translation.c \
- font-options.c \
-- font-variations.c \
- glyph-cache-pressure.c \
- get-and-set.c \
- get-clip.c \
-@@ -399,6 +398,7 @@ pthread_test_sources = \
-
- ft_font_test_sources = \
- bitmap-font.c \
-+ font-variations.c \
- ft-font-create-for-ft-face.c \
- ft-show-glyphs-positioning.c \
- ft-show-glyphs-table.c \
diff --git a/patches/cairo-1.16.0/0003-regrouping-of-test-sources-with-new-fc_font_test_sou.patch b/patches/cairo-1.16.0/0003-regrouping-of-test-sources-with-new-fc_font_test_sou.patch
deleted file mode 100644
index c81020488..000000000
--- a/patches/cairo-1.16.0/0003-regrouping-of-test-sources-with-new-fc_font_test_sou.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From: suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-Date: Wed, 10 Apr 2019 01:07:16 +0000
-Subject: [PATCH] regrouping of test sources with new 'fc_font_test_sources'
- group
-
----
- test/Makefile.am | 3 ++-
- test/Makefile.sources | 4 +++-
- 2 files changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/test/Makefile.am b/test/Makefile.am
-index a50ba376e904..2809b996d83f 100644
---- a/test/Makefile.am
-+++ b/test/Makefile.am
-@@ -11,8 +11,9 @@ test_sources += $(pthread_test_sources)
- endif
-
- if CAIRO_HAS_FT_FONT
--if CAIRO_HAS_FC_FONT
- test_sources += $(ft_font_test_sources)
-+if CAIRO_HAS_FC_FONT
-+test_sources += $(fc_font_test_sources)
- endif
- endif
-
-diff --git a/test/Makefile.sources b/test/Makefile.sources
-index cc3d81f7e0be..cb1c74d539e6 100644
---- a/test/Makefile.sources
-+++ b/test/Makefile.sources
-@@ -397,8 +397,10 @@ pthread_test_sources = \
- $(NULL)
-
- ft_font_test_sources = \
-+ font-variations.c
-+
-+fc_font_test_sources = \
- bitmap-font.c \
-- font-variations.c \
- ft-font-create-for-ft-face.c \
- ft-show-glyphs-positioning.c \
- ft-show-glyphs-table.c \
diff --git a/patches/cairo-1.16.0/series b/patches/cairo-1.16.0/series
deleted file mode 100644
index dc125547f..000000000
--- a/patches/cairo-1.16.0/series
+++ /dev/null
@@ -1,6 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-only-build-GL-surface-tests-if-GLX-is-enabled.patch
-0002-Makefile.sources-move-font-variations.c-a-test-code-.patch
-0003-regrouping-of-test-sources-with-new-fc_font_test_sou.patch
-# dfb78163a7d65338b42965982e516176 - git-ptx-patches magic
diff --git a/patches/cairo-1.18.0/0001-cairo-ft-fx-building-without-SVG-support.patch b/patches/cairo-1.18.0/0001-cairo-ft-fx-building-without-SVG-support.patch
new file mode 100644
index 000000000..808322966
--- /dev/null
+++ b/patches/cairo-1.18.0/0001-cairo-ft-fx-building-without-SVG-support.patch
@@ -0,0 +1,35 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Wed, 27 Sep 2023 09:56:56 +0200
+Subject: [PATCH] cairo-ft: fx building without SVG support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Without SVG support, FT_Color is not defined and building fails with:
+
+../cairo-1.18.0/src/cairo-ft-private.h:87:30: error: unknown type name ‘FT_Color’
+
+Fix this by defining FT_Color unconditionally.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ src/cairo-ft-private.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/cairo-ft-private.h b/src/cairo-ft-private.h
+index 836f7e523e59..399d0d046094 100644
+--- a/src/cairo-ft-private.h
++++ b/src/cairo-ft-private.h
+@@ -63,10 +63,10 @@ cairo_private cairo_status_t
+ _cairo_ft_face_decompose_glyph_outline (FT_Face face,
+ cairo_path_fixed_t **pathp);
+
+-#if HAVE_FT_SVG_DOCUMENT
+-
+ typedef struct FT_Color_ FT_Color;
+
++#if HAVE_FT_SVG_DOCUMENT
++
+ cairo_private cairo_status_t
+ _cairo_render_svg_glyph (const char *svg_document,
+ unsigned long first_glyph,
diff --git a/patches/cairo-1.18.0/0100-Cairo-Fix-Denial-of-Service-Attack-due-to-Logical-Pr.patch b/patches/cairo-1.18.0/0100-Cairo-Fix-Denial-of-Service-Attack-due-to-Logical-Pr.patch
new file mode 100644
index 000000000..b8a0aa0d7
--- /dev/null
+++ b/patches/cairo-1.18.0/0100-Cairo-Fix-Denial-of-Service-Attack-due-to-Logical-Pr.patch
@@ -0,0 +1,32 @@
+From: Christian Melki <christian.melki@t2data.com>
+Date: Tue, 17 May 2022 11:03:07 +0200
+Subject: [PATCH] Cairo: Fix Denial-of-Service Attack due to Logical Problem in
+ Program
+
+https://bugs.freedesktop.org/show_bug.cgi?id=100763
+
+CVE: CVE-2017-7475
+Upstream-Status: Submitted
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+The patch was imported from the Yocto project.
+
+Signed-off-by: Christian Melki <christian.melki@t2data.com>
+---
+ src/cairo-ft-font.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
+index bf0872e937db..0543c8c011e6 100644
+--- a/src/cairo-ft-font.c
++++ b/src/cairo-ft-font.c
+@@ -1233,7 +1233,7 @@ _get_bitmap_surface (FT_Bitmap *bitmap,
+ width = bitmap->width;
+ height = bitmap->rows;
+
+- if (width == 0 || height == 0) {
++ if (width == 0 || height == 0 || bitmap->buffer == NULL) {
+ *surface = (cairo_image_surface_t *)
+ cairo_image_surface_create_for_data (NULL, format, 0, 0, 0);
+ return (*surface)->base.status;
diff --git a/patches/cairo-1.18.0/0101-There-is-an-assertion-in-function-_cairo_arc_in_dire.patch b/patches/cairo-1.18.0/0101-There-is-an-assertion-in-function-_cairo_arc_in_dire.patch
new file mode 100644
index 000000000..741bd2473
--- /dev/null
+++ b/patches/cairo-1.18.0/0101-There-is-an-assertion-in-function-_cairo_arc_in_dire.patch
@@ -0,0 +1,29 @@
+From: Christian Melki <christian.melki@t2data.com>
+Date: Tue, 17 May 2022 11:10:14 +0200
+Subject: [PATCH] There is an assertion in function _cairo_arc_in_direction().
+
+CVE: CVE-2019-6462
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+The patch was imported from the Yocto project.
+
+Signed-off-by: Christian Melki <christian.melki@t2data.com>
+---
+ src/cairo-arc.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/cairo-arc.c b/src/cairo-arc.c
+index 010b9c1a7a18..4516c00e2602 100644
+--- a/src/cairo-arc.c
++++ b/src/cairo-arc.c
+@@ -191,7 +191,8 @@ _cairo_arc_in_direction (cairo_t *cr,
+ if (! ISFINITE (angle_max) || ! ISFINITE (angle_min))
+ return;
+
+- assert (angle_max >= angle_min);
++ if (angle_max < angle_min)
++ return;
+
+ if (angle_max - angle_min > 2 * M_PI * MAX_FULL_CIRCLES) {
+ angle_max = fmod (angle_max - angle_min, 2 * M_PI);
diff --git a/patches/cairo-1.18.0/series b/patches/cairo-1.18.0/series
new file mode 100644
index 000000000..6f99b817c
--- /dev/null
+++ b/patches/cairo-1.18.0/series
@@ -0,0 +1,7 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-cairo-ft-fx-building-without-SVG-support.patch
+#tag:yocto --start-number 100
+0100-Cairo-Fix-Denial-of-Service-Attack-due-to-Logical-Pr.patch
+0101-There-is-an-assertion-in-function-_cairo_arc_in_dire.patch
+# 3802b4df52c7537cff3ba7ad6393c380 - git-ptx-patches magic
diff --git a/patches/canfestival-3+hg20180126.794/0007-gnosis-port-to-python3.patch b/patches/canfestival-3+hg20180126.794/0007-gnosis-port-to-python3.patch
new file mode 100644
index 000000000..bc62c6b9a
--- /dev/null
+++ b/patches/canfestival-3+hg20180126.794/0007-gnosis-port-to-python3.patch
@@ -0,0 +1,1912 @@
+From: Roland Hieber <rhi@pengutronix.de>
+Date: Sun, 11 Feb 2024 22:51:48 +0100
+Subject: [PATCH] gnosis: port to python3
+
+Not all of the code was ported, only enough to make objdictgen calls in
+the Makefile work enough to generate the code in examples/.
+---
+ objdictgen/gnosis/__init__.py | 7 +-
+ objdictgen/gnosis/doc/xml_matters_39.txt | 2 +-
+ objdictgen/gnosis/indexer.py | 2 +-
+ objdictgen/gnosis/magic/dtdgenerator.py | 2 +-
+ objdictgen/gnosis/magic/multimethods.py | 4 +-
+ objdictgen/gnosis/pyconfig.py | 34 ++++-----
+ objdictgen/gnosis/trigramlib.py | 2 +-
+ objdictgen/gnosis/util/XtoY.py | 22 +++---
+ objdictgen/gnosis/util/introspect.py | 30 ++++----
+ objdictgen/gnosis/util/test/__init__.py | 0
+ objdictgen/gnosis/util/test/funcs.py | 2 +-
+ objdictgen/gnosis/util/test/test_data2attr.py | 16 ++---
+ objdictgen/gnosis/util/test/test_introspect.py | 39 +++++-----
+ objdictgen/gnosis/util/test/test_noinit.py | 43 ++++++------
+ .../gnosis/util/test/test_variants_noinit.py | 53 +++++++++-----
+ objdictgen/gnosis/util/xml2sql.py | 2 +-
+ objdictgen/gnosis/xml/indexer.py | 14 ++--
+ objdictgen/gnosis/xml/objectify/_objectify.py | 14 ++--
+ objdictgen/gnosis/xml/objectify/utils.py | 4 +-
+ objdictgen/gnosis/xml/pickle/__init__.py | 4 +-
+ objdictgen/gnosis/xml/pickle/_pickle.py | 82 ++++++++++------------
+ objdictgen/gnosis/xml/pickle/doc/HOWTO.extensions | 6 +-
+ objdictgen/gnosis/xml/pickle/exception.py | 2 +
+ objdictgen/gnosis/xml/pickle/ext/__init__.py | 2 +-
+ objdictgen/gnosis/xml/pickle/ext/_mutate.py | 17 +++--
+ objdictgen/gnosis/xml/pickle/ext/_mutators.py | 14 ++--
+ objdictgen/gnosis/xml/pickle/parsers/_dom.py | 34 ++++-----
+ objdictgen/gnosis/xml/pickle/parsers/_sax.py | 41 ++++++-----
+ objdictgen/gnosis/xml/pickle/test/test_all.py | 6 +-
+ .../gnosis/xml/pickle/test/test_badstring.py | 2 +-
+ objdictgen/gnosis/xml/pickle/test/test_bltin.py | 2 +-
+ objdictgen/gnosis/xml/pickle/test/test_mutators.py | 18 ++---
+ objdictgen/gnosis/xml/pickle/test/test_unicode.py | 31 ++++----
+ objdictgen/gnosis/xml/pickle/util/__init__.py | 4 +-
+ objdictgen/gnosis/xml/pickle/util/_flags.py | 11 ++-
+ objdictgen/gnosis/xml/pickle/util/_util.py | 20 +++---
+ objdictgen/gnosis/xml/relax/lex.py | 12 ++--
+ objdictgen/gnosis/xml/relax/rnctree.py | 2 +-
+ objdictgen/gnosis/xml/xmlmap.py | 32 ++++-----
+ 39 files changed, 322 insertions(+), 312 deletions(-)
+ create mode 100644 objdictgen/gnosis/util/test/__init__.py
+ create mode 100644 objdictgen/gnosis/xml/pickle/exception.py
+
+diff --git a/objdictgen/gnosis/__init__.py b/objdictgen/gnosis/__init__.py
+index ec2768738626..8d7bc5a5a467 100644
+--- a/objdictgen/gnosis/__init__.py
++++ b/objdictgen/gnosis/__init__.py
+@@ -1,9 +1,8 @@
+ import string
+ from os import sep
+-s = string
+-d = s.join(s.split(__file__, sep)[:-1], sep)+sep
+-_ = lambda f: s.rstrip(open(d+f).read())
+-l = lambda f: s.split(_(f),'\n')
++d = sep.join(__file__.split(sep)[:-1])+sep
++_ = lambda f: open(d+f).read().rstrip()
++l = lambda f: _(f).split('\n')
+
+ try:
+ __doc__ = _('README')
+diff --git a/objdictgen/gnosis/doc/xml_matters_39.txt b/objdictgen/gnosis/doc/xml_matters_39.txt
+index 136c20a6ae95..b2db8b83fd92 100644
+--- a/objdictgen/gnosis/doc/xml_matters_39.txt
++++ b/objdictgen/gnosis/doc/xml_matters_39.txt
+@@ -273,7 +273,7 @@ SERIALIZING TO XML
+ out.write(' %s=%s' % attr)
+ out.write('>')
+ for node in content(o):
+- if type(node) in StringTypes:
++ if type(node) == str:
+ out.write(node)
+ else:
+ write_xml(node, out=out)
+diff --git a/objdictgen/gnosis/indexer.py b/objdictgen/gnosis/indexer.py
+index e975afd5aeb6..60f1b742ec94 100644
+--- a/objdictgen/gnosis/indexer.py
++++ b/objdictgen/gnosis/indexer.py
+@@ -182,7 +182,7 @@ def recurse_files(curdir, pattern, exclusions, func=echo_fname, *args, **kw):
+ elif type(pattern)==type(re.compile('')):
+ if pattern.match(name):
+ files.append(fname)
+- elif type(pattern) is StringType:
++ elif type(pattern) is str:
+ if fnmatch.fnmatch(name, pattern):
+ files.append(fname)
+
+diff --git a/objdictgen/gnosis/magic/dtdgenerator.py b/objdictgen/gnosis/magic/dtdgenerator.py
+index 9f6368f4c0df..d06f80364616 100644
+--- a/objdictgen/gnosis/magic/dtdgenerator.py
++++ b/objdictgen/gnosis/magic/dtdgenerator.py
+@@ -83,7 +83,7 @@ class DTDGenerator(type):
+ map(lambda x: expand(x, subs), subs.keys())
+
+ # On final pass, substitute-in to the declarations
+- for decl, i in zip(decl_list, xrange(maxint)):
++ for decl, i in zip(decl_list, range(maxint)):
+ for name, sub in subs.items():
+ decl = decl.replace(name, sub)
+ decl_list[i] = decl
+diff --git a/objdictgen/gnosis/magic/multimethods.py b/objdictgen/gnosis/magic/multimethods.py
+index 699f4ffb5bbe..d1fe0302e631 100644
+--- a/objdictgen/gnosis/magic/multimethods.py
++++ b/objdictgen/gnosis/magic/multimethods.py
+@@ -59,7 +59,7 @@ def lexicographic_mro(signature, matches):
+ # Schwartzian transform to weight match sigs, left-to-right"
+ proximity = lambda klass, mro: mro.index(klass)
+ mros = [klass.mro() for klass in signature]
+- for (sig,func,nm),i in zip(matches,xrange(1000)):
++ for (sig,func,nm),i in zip(matches,range(1000)):
+ matches[i] = (map(proximity, sig, mros), matches[i])
+ matches.sort()
+ return map(lambda t:t[1], matches)
+@@ -71,7 +71,7 @@ def weighted_mro(signature, matches):
+ proximity = lambda klass, mro: mro.index(klass)
+ sum = lambda lst: reduce(add, lst)
+ mros = [klass.mro() for klass in signature]
+- for (sig,func,nm),i in zip(matches,xrange(1000)):
++ for (sig,func,nm),i in zip(matches,range(1000)):
+ matches[i] = (sum(map(proximity,sig,mros)), matches[i])
+ matches.sort()
+ return map(lambda t:t[1], matches)
+diff --git a/objdictgen/gnosis/pyconfig.py b/objdictgen/gnosis/pyconfig.py
+index b2419f2c4ba3..255fe42f9a1f 100644
+--- a/objdictgen/gnosis/pyconfig.py
++++ b/objdictgen/gnosis/pyconfig.py
+@@ -45,7 +45,7 @@
+ # just that each testcase compiles & runs OK.
+
+ # Note: Compatibility with Python 1.5 is required here.
+-import __builtin__, string
++import string
+
+ # FYI, there are tests for these PEPs:
+ #
+@@ -105,15 +105,15 @@ def compile_code( codestr ):
+ if codestr and codestr[-1] != '\n':
+ codestr = codestr + '\n'
+
+- return __builtin__.compile(codestr, 'dummyname', 'exec')
++ return compile(codestr, 'dummyname', 'exec')
+
+ def can_run_code( codestr ):
+ try:
+ eval( compile_code(codestr) )
+ return 1
+- except Exception,exc:
++ except Exception as exc:
+ if SHOW_DEBUG_INFO:
+- print "RUN EXC ",str(exc)
++ print("RUN EXC ",str(exc))
+
+ return 0
+
+@@ -359,11 +359,11 @@ def Can_AssignDoc():
+
+ def runtest(msg, test):
+ r = test()
+- print "%-40s %s" % (msg,['no','yes'][r])
++ print("%-40s %s" % (msg,['no','yes'][r]))
+
+ def runtest_1arg(msg, test, arg):
+ r = test(arg)
+- print "%-40s %s" % (msg,['no','yes'][r])
++ print("%-40s %s" % (msg,['no','yes'][r]))
+
+ if __name__ == '__main__':
+
+@@ -372,37 +372,37 @@ if __name__ == '__main__':
+ # show banner w/version
+ try:
+ v = sys.version_info
+- print "Python %d.%d.%d-%s [%s, %s]" % (v[0],v[1],v[2],str(v[3]),
+- os.name,sys.platform)
++ print("Python %d.%d.%d-%s [%s, %s]" % (v[0],v[1],v[2],str(v[3]),
++ os.name,sys.platform))
+ except:
+ # Python 1.5 lacks sys.version_info
+- print "Python %s [%s, %s]" % (string.split(sys.version)[0],
+- os.name,sys.platform)
++ print("Python %s [%s, %s]" % (string.split(sys.version)[0],
++ os.name,sys.platform))
+
+ # Python 1.5
+- print " ** Python 1.5 features **"
++ print(" ** Python 1.5 features **")
+ runtest("Can assign to __doc__?", Can_AssignDoc)
+
+ # Python 1.6
+- print " ** Python 1.6 features **"
++ print(" ** Python 1.6 features **")
+ runtest("Have Unicode?", Have_Unicode)
+ runtest("Have string methods?", Have_StringMethods)
+
+ # Python 2.0
+- print " ** Python 2.0 features **"
++ print(" ** Python 2.0 features **" )
+ runtest("Have augmented assignment?", Have_AugmentedAssignment)
+ runtest("Have list comprehensions?", Have_ListComprehensions)
+ runtest("Have 'import module AS ...'?", Have_ImportAs)
+
+ # Python 2.1
+- print " ** Python 2.1 features **"
++ print(" ** Python 2.1 features **" )
+ runtest("Have __future__?", Have_Future)
+ runtest("Have rich comparison?", Have_RichComparison)
+ runtest("Have function attributes?", Have_FunctionAttributes)
+ runtest("Have nested scopes?", Have_NestedScopes)
+
+ # Python 2.2
+- print " ** Python 2.2 features **"
++ print(" ** Python 2.2 features **" )
+ runtest("Have True/False?", Have_TrueFalse)
+ runtest("Have 'object' type?", Have_ObjectClass)
+ runtest("Have __slots__?", Have_Slots)
+@@ -415,7 +415,7 @@ if __name__ == '__main__':
+ runtest("Unified longs/ints?", Have_UnifiedLongInts)
+
+ # Python 2.3
+- print " ** Python 2.3 features **"
++ print(" ** Python 2.3 features **" )
+ runtest("Have enumerate()?", Have_Enumerate)
+ runtest("Have basestring?", Have_Basestring)
+ runtest("Longs > maxint in range()?", Have_LongRanges)
+@@ -425,7 +425,7 @@ if __name__ == '__main__':
+ runtest_1arg("bool is a baseclass [expect 'no']?", IsLegal_BaseClass, 'bool')
+
+ # Python 2.4
+- print " ** Python 2.4 features **"
++ print(" ** Python 2.4 features **" )
+ runtest("Have builtin sets?", Have_BuiltinSets)
+ runtest("Have function/method decorators?", Have_Decorators)
+ runtest("Have multiline imports?", Have_MultilineImports)
+diff --git a/objdictgen/gnosis/trigramlib.py b/objdictgen/gnosis/trigramlib.py
+index 3127638e22a0..3dc75ef16f49 100644
+--- a/objdictgen/gnosis/trigramlib.py
++++ b/objdictgen/gnosis/trigramlib.py
+@@ -23,7 +23,7 @@ def simplify_null(text):
+ def generate_trigrams(text, simplify=simplify):
+ "Iterator on trigrams in (simplified) text"
+ text = simplify(text)
+- for i in xrange(len(text)-3):
++ for i in range(len(text)-3):
+ yield text[i:i+3]
+
+ def read_trigrams(fname):
+diff --git a/objdictgen/gnosis/util/XtoY.py b/objdictgen/gnosis/util/XtoY.py
+index 9e2816216488..fc252b5d3dd0 100644
+--- a/objdictgen/gnosis/util/XtoY.py
++++ b/objdictgen/gnosis/util/XtoY.py
+@@ -27,20 +27,20 @@ def aton(s):
+
+ if re.match(re_float, s): return float(s)
+
+- if re.match(re_long, s): return long(s)
++ if re.match(re_long, s): return int(s[:-1]) # remove 'L' postfix
+
+ if re.match(re_int, s): return int(s)
+
+ m = re.match(re_hex, s)
+ if m:
+- n = long(m.group(3),16)
++ n = int(m.group(3),16)
+ if n < sys.maxint: n = int(n)
+ if m.group(1)=='-': n = n * (-1)
+ return n
+
+ m = re.match(re_oct, s)
+ if m:
+- n = long(m.group(3),8)
++ n = int(m.group(3),8)
+ if n < sys.maxint: n = int(n)
+ if m.group(1)=='-': n = n * (-1)
+ return n
+@@ -51,28 +51,26 @@ def aton(s):
+ r, i = s.split(':')
+ return complex(float(r), float(i))
+
+- raise SecurityError, \
+- "Malicious string '%s' passed to to_number()'d" % s
++ raise SecurityError( \
++ "Malicious string '%s' passed to to_number()'d" % s)
+
+ # we use ntoa() instead of repr() to ensure we have a known output format
+ def ntoa(n):
+ "Convert a number to a string without calling repr()"
+- if isinstance(n,IntType):
+- s = "%d" % n
+- elif isinstance(n,LongType):
++ if isinstance(n,int):
+ s = "%ldL" % n
+- elif isinstance(n,FloatType):
++ elif isinstance(n,float):
+ s = "%.17g" % n
+ # ensure a '.', adding if needed (unless in scientific notation)
+ if '.' not in s and 'e' not in s:
+ s = s + '.'
+- elif isinstance(n,ComplexType):
++ elif isinstance(n,complex):
+ # these are always used as doubles, so it doesn't
+ # matter if the '.' shows up
+ s = "%.17g:%.17g" % (n.real,n.imag)
+ else:
+- raise ValueError, \
+- "Unknown numeric type: %s" % repr(n)
++ raise ValueError( \
++ "Unknown numeric type: %s" % repr(n))
+ return s
+
+ def to_number(s):
+diff --git a/objdictgen/gnosis/util/introspect.py b/objdictgen/gnosis/util/introspect.py
+index 2eef3679211e..bf7425277d17 100644
+--- a/objdictgen/gnosis/util/introspect.py
++++ b/objdictgen/gnosis/util/introspect.py
+@@ -18,12 +18,10 @@ from types import *
+ from operator import add
+ from gnosis.util.combinators import or_, not_, and_, lazy_any
+
+-containers = (ListType, TupleType, DictType)
+-simpletypes = (IntType, LongType, FloatType, ComplexType, StringType)
+-if gnosis.pyconfig.Have_Unicode():
+- simpletypes = simpletypes + (UnicodeType,)
++containers = (list, tuple, dict)
++simpletypes = (int, float, complex, str)
+ datatypes = simpletypes+containers
+-immutabletypes = simpletypes+(TupleType,)
++immutabletypes = simpletypes+(tuple,)
+
+ class undef: pass
+
+@@ -34,15 +32,13 @@ def isinstance_any(o, types):
+
+ isContainer = lambda o: isinstance_any(o, containers)
+ isSimpleType = lambda o: isinstance_any(o, simpletypes)
+-isInstance = lambda o: type(o) is InstanceType
++isInstance = lambda o: isinstance(o, object)
+ isImmutable = lambda o: isinstance_any(o, immutabletypes)
+
+-if gnosis.pyconfig.Have_ObjectClass():
+- isNewStyleInstance = lambda o: issubclass(o.__class__,object) and \
+- not type(o) in datatypes
+-else:
+- isNewStyleInstance = lambda o: 0
+-isOldStyleInstance = lambda o: isinstance(o, ClassType)
++# Python 3 only has new-style classes
++import inspect
++isNewStyleInstance = lambda o: inspect.isclass(o)
++isOldStyleInstance = lambda o: False
+ isClass = or_(isOldStyleInstance, isNewStyleInstance)
+
+ if gnosis.pyconfig.Have_ObjectClass():
+@@ -95,7 +91,7 @@ def attr_dict(o, fillslots=0):
+ dct[attr] = getattr(o,attr)
+ return dct
+ else:
+- raise TypeError, "Object has neither __dict__ nor __slots__"
++ raise TypeError("Object has neither __dict__ nor __slots__")
+
+ attr_keys = lambda o: attr_dict(o).keys()
+ attr_vals = lambda o: attr_dict(o).values()
+@@ -129,10 +125,10 @@ def setCoreData(o, data, force=0):
+ new = o.__class__(data)
+ attr_update(new, attr_dict(o)) # __slots__ safe attr_dict()
+ o = new
+- elif isinstance(o, DictType):
++ elif isinstance(o, dict):
+ o.clear()
+ o.update(data)
+- elif isinstance(o, ListType):
++ elif isinstance(o, list):
+ o[:] = data
+ return o
+
+@@ -141,7 +137,7 @@ def getCoreData(o):
+ if hasCoreData(o):
+ return isinstance_any(o, datatypes)(o)
+ else:
+- raise TypeError, "Unhandled type in getCoreData for: ", o
++ raise TypeError("Unhandled type in getCoreData for: ", o)
+
+ def instance_noinit(C):
+ """Create an instance of class C without calling __init__
+@@ -166,7 +162,7 @@ def instance_noinit(C):
+ elif isNewStyleInstance(C):
+ return C.__new__(C)
+ else:
+- raise TypeError, "You must specify a class to create instance of."
++ raise TypeError("You must specify a class to create instance of.")
+
+ if __name__ == '__main__':
+ "We could use some could self-tests (see test/ subdir though)"
+diff --git a/objdictgen/gnosis/util/test/__init__.py b/objdictgen/gnosis/util/test/__init__.py
+new file mode 100644
+index 000000000000..e69de29bb2d1
+diff --git a/objdictgen/gnosis/util/test/funcs.py b/objdictgen/gnosis/util/test/funcs.py
+index 5d39d80bc3d4..28647fa14da0 100644
+--- a/objdictgen/gnosis/util/test/funcs.py
++++ b/objdictgen/gnosis/util/test/funcs.py
+@@ -1,4 +1,4 @@
+ import os, sys, string
+
+ def pyver():
+- return string.split(sys.version)[0]
++ return sys.version.split()[0]
+diff --git a/objdictgen/gnosis/util/test/test_data2attr.py b/objdictgen/gnosis/util/test/test_data2attr.py
+index fb5b9cd5cff4..24281a5ed761 100644
+--- a/objdictgen/gnosis/util/test/test_data2attr.py
++++ b/objdictgen/gnosis/util/test/test_data2attr.py
+@@ -1,5 +1,5 @@
+ from sys import version
+-from gnosis.util.introspect import data2attr, attr2data
++from ..introspect import data2attr, attr2data
+
+ if version >= '2.2':
+ class NewList(list): pass
+@@ -14,20 +14,20 @@ if version >= '2.2':
+ nd.attr = 'spam'
+
+ nl = data2attr(nl)
+- print nl, getattr(nl, '__coredata__', 'No __coredata__')
++ print(nl, getattr(nl, '__coredata__', 'No __coredata__'))
+ nl = attr2data(nl)
+- print nl, getattr(nl, '__coredata__', 'No __coredata__')
++ print(nl, getattr(nl, '__coredata__', 'No __coredata__'))
+
+ nt = data2attr(nt)
+- print nt, getattr(nt, '__coredata__', 'No __coredata__')
++ print(nt, getattr(nt, '__coredata__', 'No __coredata__'))
+ nt = attr2data(nt)
+- print nt, getattr(nt, '__coreData__', 'No __coreData__')
++ print(nt, getattr(nt, '__coreData__', 'No __coreData__'))
+
+ nd = data2attr(nd)
+- print nd, getattr(nd, '__coredata__', 'No __coredata__')
++ print(nd, getattr(nd, '__coredata__', 'No __coredata__'))
+ nd = attr2data(nd)
+- print nd, getattr(nd, '__coredata__', 'No __coredata__')
++ print(nd, getattr(nd, '__coredata__', 'No __coredata__'))
+ else:
+- print "data2attr() and attr2data() only work on 2.2+ new-style objects"
++ print("data2attr() and attr2data() only work on 2.2+ new-style objects")
+
+
+diff --git a/objdictgen/gnosis/util/test/test_introspect.py b/objdictgen/gnosis/util/test/test_introspect.py
+index 57e78ba2d88b..42aa10037570 100644
+--- a/objdictgen/gnosis/util/test/test_introspect.py
++++ b/objdictgen/gnosis/util/test/test_introspect.py
+@@ -1,7 +1,7 @@
+
+-import gnosis.util.introspect as insp
++from .. import introspect as insp
+ import sys
+-from funcs import pyver
++from .funcs import pyver
+
+ def test_list( ovlist, tname, test ):
+
+@@ -9,9 +9,9 @@ def test_list( ovlist, tname, test ):
+ sys.stdout.write('OBJ %s ' % str(o))
+
+ if (v and test(o)) or (not v and not test(o)):
+- print "%s = %d .. OK" % (tname,v)
++ print("%s = %d .. OK" % (tname,v))
+ else:
+- raise "ERROR - Wrong answer to test."
++ raise Exception("ERROR - Wrong answer to test.")
+
+ # isContainer
+ ol = [ ([], 1),
+@@ -40,30 +40,35 @@ ol = [ (foo1(), 1),
+ (foo2(), 1),
+ (foo3(), 0) ]
+
+-test_list( ol, 'isInstance', insp.isInstance)
++if pyver()[0] <= "2":
++ # in python >= 3, all variables are instances of object
++ test_list( ol, 'isInstance', insp.isInstance)
+
+ # isInstanceLike
+ ol = [ (foo1(), 1),
+ (foo2(), 1),
+ (foo3(), 0)]
+
+-test_list( ol, 'isInstanceLike', insp.isInstanceLike)
++if pyver()[0] <= "2":
++ # in python >= 3, all variables are instances of object
++ test_list( ol, 'isInstanceLike', insp.isInstanceLike)
+
+-from types import *
++if pyver()[0] <= "2":
++ from types import *
+
+-def is_oldclass(o):
+- if isinstance(o,ClassType):
+- return 1
+- else:
+- return 0
++ def is_oldclass(o):
++ if isinstance(o,ClassType):
++ return 1
++ else:
++ return 0
+
+-ol = [ (foo1,1),
+- (foo2,1),
+- (foo3,0)]
++ ol = [ (foo1,1),
++ (foo2,1),
++ (foo3,0)]
+
+-test_list(ol,'is_oldclass',is_oldclass)
++ test_list(ol,'is_oldclass',is_oldclass)
+
+-if pyver() >= '2.2':
++if pyver()[0] <= "2" and pyver() >= '2.2':
+ # isNewStyleClass
+ ol = [ (foo1,0),
+ (foo2,0),
+diff --git a/objdictgen/gnosis/util/test/test_noinit.py b/objdictgen/gnosis/util/test/test_noinit.py
+index a057133f2c0d..e027ce2390c6 100644
+--- a/objdictgen/gnosis/util/test/test_noinit.py
++++ b/objdictgen/gnosis/util/test/test_noinit.py
+@@ -1,28 +1,31 @@
+-from gnosis.util.introspect import instance_noinit
++from ..introspect import instance_noinit
++from .funcs import pyver
+
+-class Old_noinit: pass
++if pyver()[0] <= "2":
++ class Old_noinit: pass
+
+-class Old_init:
+- def __init__(self): print "Init in Old"
++ class Old_init:
++ def __init__(self): print("Init in Old")
+
+-class New_slots_and_init(int):
+- __slots__ = ('this','that')
+- def __init__(self): print "Init in New w/ slots"
++ class New_slots_and_init(int):
++ __slots__ = ('this','that')
++ def __init__(self): print("Init in New w/ slots")
+
+-class New_init_no_slots(int):
+- def __init__(self): print "Init in New w/o slots"
++ class New_init_no_slots(int):
++ def __init__(self): print("Init in New w/o slots")
+
+-class New_slots_no_init(int):
+- __slots__ = ('this','that')
++ class New_slots_no_init(int):
++ __slots__ = ('this','that')
+
+-class New_no_slots_no_init(int):
+- pass
++ class New_no_slots_no_init(int):
++ pass
+
+-print "----- This should be the only line -----"
+-instance_noinit(Old_noinit)
+-instance_noinit(Old_init)
+-instance_noinit(New_slots_and_init)
+-instance_noinit(New_slots_no_init)
+-instance_noinit(New_init_no_slots)
+-instance_noinit(New_no_slots_no_init)
+
++ instance_noinit(Old_noinit)
++ instance_noinit(Old_init)
++ instance_noinit(New_slots_and_init)
++ instance_noinit(New_slots_no_init)
++ instance_noinit(New_init_no_slots)
++ instance_noinit(New_no_slots_no_init)
++
++print("----- This should be the only line -----")
+diff --git a/objdictgen/gnosis/util/test/test_variants_noinit.py b/objdictgen/gnosis/util/test/test_variants_noinit.py
+index d2ea9a4fc46f..758a89d13660 100644
+--- a/objdictgen/gnosis/util/test/test_variants_noinit.py
++++ b/objdictgen/gnosis/util/test/test_variants_noinit.py
+@@ -1,25 +1,46 @@
+-from gnosis.util.introspect import hasSlots, hasInit
++from ..introspect import hasSlots, hasInit
+ from types import *
++from .funcs import pyver
+
+ class Old_noinit: pass
+
+ class Old_init:
+- def __init__(self): print "Init in Old"
++ def __init__(self): print("Init in Old")
+
+-class New_slots_and_init(int):
+- __slots__ = ('this','that')
+- def __init__(self): print "Init in New w/ slots"
++if pyver()[0] <= "2":
++ class New_slots_and_init(int):
++ __slots__ = ('this','that')
++ def __init__(self): print("Init in New w/ slots")
+
+-class New_init_no_slots(int):
+- def __init__(self): print "Init in New w/o slots"
++ class New_init_no_slots(int):
++ def __init__(self): print("Init in New w/o slots")
+
+-class New_slots_no_init(int):
+- __slots__ = ('this','that')
++ class New_slots_no_init(int):
++ __slots__ = ('this','that')
+
+-class New_no_slots_no_init(int):
+- pass
++ class New_no_slots_no_init(int):
++ pass
++
++else:
++ # nonempty __slots__ not supported for subtype of 'int' in Python 3
++ class New_slots_and_init:
++ __slots__ = ('this','that')
++ def __init__(self): print("Init in New w/ slots")
++
++ class New_init_no_slots:
++ def __init__(self): print("Init in New w/o slots")
++
++ class New_slots_no_init:
++ __slots__ = ('this','that')
++
++ class New_no_slots_no_init:
++ pass
++
++if pyver()[0] <= "2":
++ from UserDict import UserDict
++else:
++ from collections import UserDict
+
+-from UserDict import UserDict
+ class MyDict(UserDict):
+ pass
+
+@@ -43,7 +64,7 @@ def one():
+ obj.__class__ = C
+ return obj
+
+- print "----- This should be the only line -----"
++ print("----- This should be the only line -----")
+ instance_noinit(MyDict)
+ instance_noinit(Old_noinit)
+ instance_noinit(Old_init)
+@@ -75,7 +96,7 @@ def two():
+ obj = C()
+ return obj
+
+- print "----- Same test, fpm version of instance_noinit() -----"
++ print("----- Same test, fpm version of instance_noinit() -----")
+ instance_noinit(MyDict)
+ instance_noinit(Old_noinit)
+ instance_noinit(Old_init)
+@@ -90,7 +111,7 @@ def three():
+ if hasattr(C,'__init__') and isinstance(C.__init__,MethodType):
+ # the class defined init - remove it temporarily
+ _init = C.__init__
+- print _init
++ print(_init)
+ del C.__init__
+ obj = C()
+ C.__init__ = _init
+@@ -99,7 +120,7 @@ def three():
+ obj = C()
+ return obj
+
+- print "----- Same test, dqm version of instance_noinit() -----"
++ print("----- Same test, dqm version of instance_noinit() -----")
+ instance_noinit(MyDict)
+ instance_noinit(Old_noinit)
+ instance_noinit(Old_init)
+diff --git a/objdictgen/gnosis/util/xml2sql.py b/objdictgen/gnosis/util/xml2sql.py
+index 818661321db0..751985d88f23 100644
+--- a/objdictgen/gnosis/util/xml2sql.py
++++ b/objdictgen/gnosis/util/xml2sql.py
+@@ -77,7 +77,7 @@ def walkNodes(py_obj, parent_info=('',''), seq=0):
+ member = getattr(py_obj,colname)
+ if type(member) == InstanceType:
+ walkNodes(member, self_info)
+- elif type(member) == ListType:
++ elif type(member) == list:
+ for memitem in member:
+ if isinstance(memitem,_XO_):
+ seq += 1
+diff --git a/objdictgen/gnosis/xml/indexer.py b/objdictgen/gnosis/xml/indexer.py
+index 6e7f6941b506..45638b6d04ff 100644
+--- a/objdictgen/gnosis/xml/indexer.py
++++ b/objdictgen/gnosis/xml/indexer.py
+@@ -87,17 +87,11 @@ class XML_Indexer(indexer.PreferredIndexer, indexer.TextSplitter):
+ if type(member) is InstanceType:
+ xpath = xpath_suffix+'/'+membname
+ self.recurse_nodes(member, xpath.encode('UTF-8'))
+- elif type(member) is ListType:
++ elif type(member) is list:
+ for i in range(len(member)):
+ xpath = xpath_suffix+'/'+membname+'['+str(i+1)+']'
+ self.recurse_nodes(member[i], xpath.encode('UTF-8'))
+- elif type(member) is StringType:
+- if membname != 'PCDATA':
+- xpath = xpath_suffix+'/@'+membname
+- self.add_nodetext(member, xpath.encode('UTF-8'))
+- else:
+- self.add_nodetext(member, xpath_suffix.encode('UTF-8'))
+- elif type(member) is UnicodeType:
++ elif type(member) is str:
+ if membname != 'PCDATA':
+ xpath = xpath_suffix+'/@'+membname
+ self.add_nodetext(member.encode('UTF-8'),
+@@ -122,11 +116,11 @@ class XML_Indexer(indexer.PreferredIndexer, indexer.TextSplitter):
+ self.fileids[node_index] = node_id
+
+ for word in words:
+- if self.words.has_key(word):
++ if word in self.words.keys():
+ entry = self.words[word]
+ else:
+ entry = {}
+- if entry.has_key(node_index):
++ if node_index in entry.keys():
+ entry[node_index] = entry[node_index]+1
+ else:
+ entry[node_index] = 1
+diff --git a/objdictgen/gnosis/xml/objectify/_objectify.py b/objdictgen/gnosis/xml/objectify/_objectify.py
+index 27da2e451417..476dd9cd6245 100644
+--- a/objdictgen/gnosis/xml/objectify/_objectify.py
++++ b/objdictgen/gnosis/xml/objectify/_objectify.py
+@@ -43,10 +43,10 @@ def content(o):
+ return o._seq or []
+ def children(o):
+ "The child nodes (not PCDATA) of o"
+- return [x for x in content(o) if type(x) not in StringTypes]
++ return [x for x in content(o) if type(x) is not str]
+ def text(o):
+ "List of textual children"
+- return [x for x in content(o) if type(x) in StringTypes]
++ return [x for x in content(o) if type(x) is not str]
+ def dumps(o):
+ "The PCDATA in o (preserves whitespace)"
+ return "".join(text(o))
+@@ -59,7 +59,7 @@ def tagname(o):
+ def attributes(o):
+ "List of (XML) attributes of o"
+ return [(k,v) for k,v in o.__dict__.items()
+- if k!='PCDATA' and type(v) in StringTypes]
++ if k!='PCDATA' and type(v) is not str]
+
+ #-- Base class for objectified XML nodes
+ class _XO_:
+@@ -95,7 +95,7 @@ def _makeAttrDict(attr):
+ if not attr:
+ return {}
+ try:
+- attr.has_key('dummy')
++ 'dummy' in attr.keys()
+ except AttributeError:
+ # assume a W3C NamedNodeMap
+ attr_dict = {}
+@@ -116,7 +116,7 @@ class XML_Objectify:
+ or hasattr(xml_src,'childNodes')):
+ self._dom = xml_src
+ self._fh = None
+- elif type(xml_src) in (StringType, UnicodeType):
++ elif type(xml_src) is str:
+ if xml_src[0]=='<': # looks like XML
+ from cStringIO import StringIO
+ self._fh = StringIO(xml_src)
+@@ -210,7 +210,7 @@ class ExpatFactory:
+ # Does our current object have a child of this type already?
+ if hasattr(self._current, pyname):
+ # Convert a single child object into a list of children
+- if type(getattr(self._current, pyname)) is not ListType:
++ if type(getattr(self._current, pyname)) is not list:
+ setattr(self._current, pyname, [getattr(self._current, pyname)])
+ # Add the new subtag to the list of children
+ getattr(self._current, pyname).append(py_obj)
+@@ -290,7 +290,7 @@ def pyobj_from_dom(dom_node):
+ # does a py_obj attribute corresponding to the subtag already exist?
+ elif hasattr(py_obj, node_name):
+ # convert a single child object into a list of children
+- if type(getattr(py_obj, node_name)) is not ListType:
++ if type(getattr(py_obj, node_name)) is not list:
+ setattr(py_obj, node_name, [getattr(py_obj, node_name)])
+ # add the new subtag to the list of children
+ getattr(py_obj, node_name).append(pyobj_from_dom(node))
+diff --git a/objdictgen/gnosis/xml/objectify/utils.py b/objdictgen/gnosis/xml/objectify/utils.py
+index 781a189d2f04..431d9a0220da 100644
+--- a/objdictgen/gnosis/xml/objectify/utils.py
++++ b/objdictgen/gnosis/xml/objectify/utils.py
+@@ -39,7 +39,7 @@ def write_xml(o, out=stdout):
+ out.write(' %s=%s' % attr)
+ out.write('>')
+ for node in content(o):
+- if type(node) in StringTypes:
++ if type(node) is str:
+ out.write(node)
+ else:
+ write_xml(node, out=out)
+@@ -119,7 +119,7 @@ def pyobj_printer(py_obj, level=0):
+ if type(member) == InstanceType:
+ descript += '\n'+(' '*level)+'{'+membname+'}\n'
+ descript += pyobj_printer(member, level+3)
+- elif type(member) == ListType:
++ elif type(member) == list:
+ for i in range(len(member)):
+ descript += '\n'+(' '*level)+'['+membname+'] #'+str(i+1)
+ descript += (' '*level)+'\n'+pyobj_printer(member[i],level+3)
+diff --git a/objdictgen/gnosis/xml/pickle/__init__.py b/objdictgen/gnosis/xml/pickle/__init__.py
+index 34f90e50acba..4031142776c6 100644
+--- a/objdictgen/gnosis/xml/pickle/__init__.py
++++ b/objdictgen/gnosis/xml/pickle/__init__.py
+@@ -4,7 +4,7 @@ Please see the information at gnosis.xml.pickle.doc for
+ explanation of usage, design, license, and other details
+ """
+ from gnosis.xml.pickle._pickle import \
+- XML_Pickler, XMLPicklingError, XMLUnpicklingError, \
++ XML_Pickler, \
+ dump, dumps, load, loads
+
+ from gnosis.xml.pickle.util import \
+@@ -13,3 +13,5 @@ from gnosis.xml.pickle.util import \
+ setParser, setVerbose, enumParsers
+
+ from gnosis.xml.pickle.ext import *
++
++from gnosis.xml.pickle.exception import XMLPicklingError, XMLUnpicklingError
+diff --git a/objdictgen/gnosis/xml/pickle/_pickle.py b/objdictgen/gnosis/xml/pickle/_pickle.py
+index a5275e4830f6..5e1fa1c609f5 100644
+--- a/objdictgen/gnosis/xml/pickle/_pickle.py
++++ b/objdictgen/gnosis/xml/pickle/_pickle.py
+@@ -29,24 +29,17 @@ import gnosis.pyconfig
+
+ from types import *
+
+-try: # Get a usable StringIO
+- from cStringIO import StringIO
+-except:
+- from StringIO import StringIO
++from io import StringIO
+
+ # default settings
+-setInBody(IntType,0)
+-setInBody(FloatType,0)
+-setInBody(LongType,0)
+-setInBody(ComplexType,0)
+-setInBody(StringType,0)
++setInBody(int,0)
++setInBody(float,0)
++setInBody(complex,0)
+ # our unicode vs. "regular string" scheme relies on unicode
+ # strings only being in the body, so this is hardcoded.
+-setInBody(UnicodeType,1)
++setInBody(str,1)
+
+-# Define exceptions and flags
+-XMLPicklingError = "gnosis.xml.pickle.XMLPicklingError"
+-XMLUnpicklingError = "gnosis.xml.pickle.XMLUnpicklingError"
++from gnosis.xml.pickle.exception import XMLPicklingError, XMLUnpicklingError
+
+ # Maintain list of object identities for multiple and cyclical references
+ # (also to keep temporary objects alive)
+@@ -79,7 +72,7 @@ class StreamWriter:
+ self.iohandle = gzip.GzipFile(None,'wb',9,self.iohandle)
+
+ def append(self,item):
+- if type(item) in (ListType, TupleType): item = ''.join(item)
++ if type(item) in (list, tuple): item = ''.join(item)
+ self.iohandle.write(item)
+
+ def getvalue(self):
+@@ -102,7 +95,7 @@ def StreamReader( stream ):
+ appropriate for reading the stream."""
+
+ # turn strings into stream
+- if type(stream) in [StringType,UnicodeType]:
++ if type(stream) is str:
+ stream = StringIO(stream)
+
+ # determine if we have a gzipped stream by checking magic
+@@ -128,8 +121,8 @@ class XML_Pickler:
+ if isInstanceLike(py_obj):
+ self.to_pickle = py_obj
+ else:
+- raise XMLPicklingError, \
+- "XML_Pickler must be initialized with Instance (or None)"
++ raise XMLPicklingError( \
++ "XML_Pickler must be initialized with Instance (or None)")
+
+ def dump(self, iohandle, obj=None, binary=0, deepcopy=None):
+ "Write the XML representation of obj to iohandle."
+@@ -151,7 +144,8 @@ class XML_Pickler:
+ if parser:
+ return parser(fh, paranoia=paranoia)
+ else:
+- raise XMLUnpicklingError, "Unknown parser %s" % getParser()
++ raise XMLUnpicklingError("Unknown parser %s. Available parsers: %r" %
++ (getParser(), enumParsers()))
+
+ def dumps(self, obj=None, binary=0, deepcopy=None, iohandle=None):
+ "Create the XML representation as a string."
+@@ -159,15 +153,15 @@ class XML_Pickler:
+ if deepcopy is None: deepcopy = getDeepCopy()
+
+ # write to a file or string, either compressed or not
+- list = StreamWriter(iohandle,binary)
++ list_ = StreamWriter(iohandle,binary)
+
+ # here are our three forms:
+ if obj is not None: # XML_Pickler().dumps(obj)
+- return _pickle_toplevel_obj(list,obj, deepcopy)
++ return _pickle_toplevel_obj(list_,obj, deepcopy)
+ elif hasattr(self,'to_pickle'): # XML_Pickler(obj).dumps()
+- return _pickle_toplevel_obj(list,self.to_pickle, deepcopy)
++ return _pickle_toplevel_obj(list_,self.to_pickle, deepcopy)
+ else: # myXML_Pickler().dumps()
+- return _pickle_toplevel_obj(list,self, deepcopy)
++ return _pickle_toplevel_obj(list_,self, deepcopy)
+
+ def loads(self, xml_str, paranoia=None):
+ "Load a pickled object from the given XML string."
+@@ -221,8 +215,8 @@ def _pickle_toplevel_obj(xml_list, py_obj, deepcopy):
+ # sanity check until/if we eventually support these
+ # at the toplevel
+ if in_body or extra:
+- raise XMLPicklingError, \
+- "Sorry, mutators can't set in_body and/or extra at the toplevel."
++ raise XMLPicklingError( \
++ "Sorry, mutators can't set in_body and/or extra at the toplevel.")
+ famtype = famtype + 'family="obj" type="%s" ' % mtype
+
+ module = _module(py_obj)
+@@ -250,10 +244,10 @@ def _pickle_toplevel_obj(xml_list, py_obj, deepcopy):
+ # know that (or not care)
+ return xml_list.getvalue()
+
+-def pickle_instance(obj, list, level=0, deepcopy=0):
++def pickle_instance(obj, list_, level=0, deepcopy=0):
+ """Pickle the given object into a <PyObject>
+
+- Add XML tags to list. Level is indentation (for aesthetic reasons)
++ Add XML tags to list_. Level is indentation (for aesthetic reasons)
+ """
+ # concept: to pickle an object, we pickle two things:
+ #
+@@ -278,8 +272,8 @@ def pickle_instance(obj, list, level=0, deepcopy=0):
+ try:
+ len(args) # must be a sequence, from pickle.py
+ except:
+- raise XMLPicklingError, \
+- "__getinitargs__() must return a sequence"
++ raise XMLPicklingError( \
++ "__getinitargs__() must return a sequence")
+ except:
+ args = None
+
+@@ -293,22 +287,22 @@ def pickle_instance(obj, list, level=0, deepcopy=0):
+ # save initargs, if we have them
+ if args is not None:
+ # put them in an <attr name="__getinitargs__" ...> container
+- list.append(_attr_tag('__getinitargs__', args, level, deepcopy))
++ list_.append(_attr_tag('__getinitargs__', args, level, deepcopy))
+
+ # decide how to save the "stuff", depending on whether we need
+ # to later grab it back as a single object
+ if not hasattr(obj,'__setstate__'):
+- if type(stuff) is DictType:
++ if type(stuff) is dict:
+ # don't need it as a single object - save keys/vals as
+ # first-level attributes
+ for key,val in stuff.items():
+- list.append(_attr_tag(key, val, level, deepcopy))
++ list_.append(_attr_tag(key, val, level, deepcopy))
+ else:
+- raise XMLPicklingError, \
+- "__getstate__ must return a DictType here"
++ raise XMLPicklingError( \
++ "__getstate__ must return a dict here")
+ else:
+ # else, encapsulate the "stuff" in an <attr name="__getstate__" ...>
+- list.append(_attr_tag('__getstate__', stuff, level, deepcopy))
++ list_.append(_attr_tag('__getstate__', stuff, level, deepcopy))
+
+ #--- Functions to create XML output tags ---
+ def _attr_tag(name, thing, level=0, deepcopy=0):
+@@ -395,8 +389,8 @@ def _family_type(family,typename,mtype,mextra):
+
+ # sanity in case Python changes ...
+ if gnosis.pyconfig.Have_BoolClass() and gnosis.pyconfig.IsLegal_BaseClass('bool'):
+- raise XMLPicklingError, \
+- "Assumption broken - can now use bool as baseclass!"
++ raise XMLPicklingError( \
++ "Assumption broken - can now use bool as baseclass!")
+
+ Have_BoolClass = gnosis.pyconfig.Have_BoolClass()
+
+@@ -459,7 +453,7 @@ def _tag_completer(start_tag, orig_thing, close_tag, level, deepcopy):
+ pickle_instance(thing, tag_body, level+1, deepcopy)
+ else:
+ close_tag = ''
+- elif isinstance_any(thing, (IntType, LongType, FloatType, ComplexType)):
++ elif isinstance_any(thing, (int, float, complex)):
+ #thing_str = repr(thing)
+ thing_str = ntoa(thing)
+
+@@ -476,13 +470,13 @@ def _tag_completer(start_tag, orig_thing, close_tag, level, deepcopy):
+ start_tag = start_tag + '%s value="%s" />\n' % \
+ (_family_type('atom','numeric',mtag,mextra),thing_str)
+ close_tag = ''
+- elif isinstance_any(thing, (StringType,UnicodeType)):
++ elif isinstance_any(thing, str):
+ #XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ # special check for now - this will be fixed in the next major
+ # gnosis release, so I don't care that the code is inline & gross
+ # for now
+ #XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+- if isinstance(thing,UnicodeType):
++ if isinstance(thing,str):
+ # can't pickle unicode containing the special "escape" sequence
+ # we use for putting strings in the XML body (they'll be unpickled
+ # as strings, not unicode, if we do!)
+@@ -493,7 +487,7 @@ def _tag_completer(start_tag, orig_thing, close_tag, level, deepcopy):
+ if not is_legal_xml(thing):
+ raise Exception("Unpickleable Unicode value. To be fixed in next major Gnosis release.")
+
+- if isinstance(thing,StringType) and getInBody(StringType):
++ if isinstance(thing,str) and getInBody(str):
+ # technically, this will crash safe_content(), but I prefer to
+ # have the test here for clarity
+ try:
+@@ -525,7 +519,7 @@ def _tag_completer(start_tag, orig_thing, close_tag, level, deepcopy):
+ # before pickling subitems, in case it contains self-references
+ # (we CANNOT just move the visited{} update to the top of this
+ # function, since that would screw up every _family_type() call)
+- elif type(thing) is TupleType:
++ elif type(thing) is tuple:
+ start_tag, do_copy = \
+ _tag_compound(start_tag,_family_type('seq','tuple',mtag,mextra),
+ orig_thing,deepcopy)
+@@ -534,7 +528,7 @@ def _tag_completer(start_tag, orig_thing, close_tag, level, deepcopy):
+ tag_body.append(_item_tag(item, level+1, deepcopy))
+ else:
+ close_tag = ''
+- elif type(thing) is ListType:
++ elif type(thing) is list:
+ start_tag, do_copy = \
+ _tag_compound(start_tag,_family_type('seq','list',mtag,mextra),
+ orig_thing,deepcopy)
+@@ -545,7 +539,7 @@ def _tag_completer(start_tag, orig_thing, close_tag, level, deepcopy):
+ tag_body.append(_item_tag(item, level+1, deepcopy))
+ else:
+ close_tag = ''
+- elif type(thing) in [DictType]:
++ elif type(thing) in [dict]:
+ start_tag, do_copy = \
+ _tag_compound(start_tag,_family_type('map','dict',mtag,mextra),
+ orig_thing,deepcopy)
+@@ -583,7 +577,7 @@ def _tag_completer(start_tag, orig_thing, close_tag, level, deepcopy):
+ thing)
+ close_tag = close_tag.lstrip()
+ except:
+- raise XMLPicklingError, "non-handled type %s" % type(thing)
++ raise XMLPicklingError("non-handled type %s" % type(thing))
+
+ # need to keep a ref to the object for two reasons -
+ # 1. we can ref it later instead of copying it into the XML stream
+diff --git a/objdictgen/gnosis/xml/pickle/doc/HOWTO.extensions b/objdictgen/gnosis/xml/pickle/doc/HOWTO.extensions
+index e0bf7a253c48..13c320aafa21 100644
+--- a/objdictgen/gnosis/xml/pickle/doc/HOWTO.extensions
++++ b/objdictgen/gnosis/xml/pickle/doc/HOWTO.extensions
+@@ -51,11 +51,11 @@ integers into strings:
+
+ Now, to add silly_mutator to xml_pickle, you do:
+
+- m = silly_mutator( IntType, "silly_string", in_body=1 )
++ m = silly_mutator( int, "silly_string", in_body=1 )
+ mutate.add_mutator( m )
+
+ Explanation:
+- The parameter "IntType" says that we want to catch integers.
++ The parameter "int" says that we want to catch integers.
+ "silly_string" will be the typename in the XML stream.
+ "in_body=1" tells xml_pickle to place the value string in the body
+ of the tag.
+@@ -79,7 +79,7 @@ Mutator can define two additional functions:
+ # return 1 if we can unmutate mobj, 0 if not
+
+ By default, a Mutator will be asked to mutate/unmutate all objects of
+-the type it registered ("IntType", in our silly example). You would
++the type it registered ("int", in our silly example). You would
+ only need to override wants_obj/wants_mutated to provide specialized
+ sub-type handling (based on content, for example). test_mutators.py
+ shows examples of how to do this.
+diff --git a/objdictgen/gnosis/xml/pickle/exception.py b/objdictgen/gnosis/xml/pickle/exception.py
+new file mode 100644
+index 000000000000..a19e257bd8d8
+--- /dev/null
++++ b/objdictgen/gnosis/xml/pickle/exception.py
+@@ -0,0 +1,2 @@
++class XMLPicklingError(Exception): pass
++class XMLUnpicklingError(Exception): pass
+diff --git a/objdictgen/gnosis/xml/pickle/ext/__init__.py b/objdictgen/gnosis/xml/pickle/ext/__init__.py
+index df60171f5229..3833065f7750 100644
+--- a/objdictgen/gnosis/xml/pickle/ext/__init__.py
++++ b/objdictgen/gnosis/xml/pickle/ext/__init__.py
+@@ -6,7 +6,7 @@ __author__ = ["Frank McIngvale (frankm@hiwaay.net)",
+ "David Mertz (mertz@gnosis.cx)",
+ ]
+
+-from _mutate import \
++from ._mutate import \
+ can_mutate,mutate,can_unmutate,unmutate,\
+ add_mutator,remove_mutator,XMLP_Mutator, XMLP_Mutated, \
+ get_unmutator, try_mutate
+diff --git a/objdictgen/gnosis/xml/pickle/ext/_mutate.py b/objdictgen/gnosis/xml/pickle/ext/_mutate.py
+index aa8da4f87d62..43481a8c5331 100644
+--- a/objdictgen/gnosis/xml/pickle/ext/_mutate.py
++++ b/objdictgen/gnosis/xml/pickle/ext/_mutate.py
+@@ -3,8 +3,7 @@ from types import *
+ from gnosis.util.introspect import isInstanceLike, hasCoreData
+ import gnosis.pyconfig
+
+-XMLPicklingError = "gnosis.xml.pickle.XMLPicklingError"
+-XMLUnpicklingError = "gnosis.xml.pickle.XMLUnpicklingError"
++from gnosis.xml.pickle.exception import XMLPicklingError, XMLUnpicklingError
+
+ # hooks for adding mutators
+ # each dict entry is a list of chained mutators
+@@ -25,8 +24,8 @@ _has_coredata_cache = {}
+
+ # sanity in case Python changes ...
+ if gnosis.pyconfig.Have_BoolClass() and gnosis.pyconfig.IsLegal_BaseClass('bool'):
+- raise XMLPicklingError, \
+- "Assumption broken - can now use bool as baseclass!"
++ raise XMLPicklingError( \
++ "Assumption broken - can now use bool as baseclass!")
+
+ Have_BoolClass = gnosis.pyconfig.Have_BoolClass()
+
+@@ -54,7 +53,7 @@ def get_mutator(obj):
+ if not hasattr(obj,'__class__'):
+ return None
+
+- if _has_coredata_cache.has_key(obj.__class__):
++ if obj.__class__ in _has_coredata_cache.keys():
+ return _has_coredata_cache[obj.__class__]
+
+ if hasCoreData(obj):
+@@ -76,8 +75,8 @@ def mutate(obj):
+ tobj = mutator.mutate(obj)
+
+ if not isinstance(tobj,XMLP_Mutated):
+- raise XMLPicklingError, \
+- "Bad type returned from mutator %s" % mutator
++ raise XMLPicklingError( \
++ "Bad type returned from mutator %s" % mutator)
+
+ return (mutator.tag,tobj.obj,mutator.in_body,tobj.extra)
+
+@@ -96,8 +95,8 @@ def try_mutate(obj,alt_tag,alt_in_body,alt_extra):
+ tobj = mutator.mutate(obj)
+
+ if not isinstance(tobj,XMLP_Mutated):
+- raise XMLPicklingError, \
+- "Bad type returned from mutator %s" % mutator
++ raise XMLPicklingError( \
++ "Bad type returned from mutator %s" % mutator)
+
+ return (mutator.tag,tobj.obj,mutator.in_body,tobj.extra)
+
+diff --git a/objdictgen/gnosis/xml/pickle/ext/_mutators.py b/objdictgen/gnosis/xml/pickle/ext/_mutators.py
+index 142f611ea7b4..645dc4e64eed 100644
+--- a/objdictgen/gnosis/xml/pickle/ext/_mutators.py
++++ b/objdictgen/gnosis/xml/pickle/ext/_mutators.py
+@@ -1,5 +1,5 @@
+-from _mutate import XMLP_Mutator, XMLP_Mutated
+-import _mutate
++from gnosis.xml.pickle.ext._mutate import XMLP_Mutator, XMLP_Mutated
++import gnosis.xml.pickle.ext._mutate as _mutate
+ import sys, string
+ from types import *
+ from gnosis.util.introspect import isInstanceLike, attr_update, \
+@@ -176,16 +176,16 @@ def olddata_to_newdata(data,extra,paranoia):
+ (module,klass) = extra.split()
+ o = obj_from_name(klass,module,paranoia)
+
+- #if isinstance(o,ComplexType) and \
+- # type(data) in [StringType,UnicodeType]:
++ #if isinstance(o,complex) and \
++ # type(data) is str:
+ # # yuck ... have to strip () from complex data before
+ # # passing to __init__ (ran into this also in one of the
+ # # parsers ... maybe the () shouldn't be in the XML at all?)
+ # if data[0] == '(' and data[-1] == ')':
+ # data = data[1:-1]
+
+- if isinstance_any(o,(IntType,FloatType,ComplexType,LongType)) and \
+- type(data) in [StringType,UnicodeType]:
++ if isinstance_any(o,(int,float,complex)) and \
++ type(data) is str:
+ data = aton(data)
+
+ o = setCoreData(o,data)
+@@ -208,7 +208,7 @@ class mutate_bltin_instances(XMLP_Mutator):
+
+ def mutate(self,obj):
+
+- if isinstance(obj,UnicodeType):
++ if isinstance(obj,str):
+ # unicode strings are required to be placed in the body
+ # (by our encoding scheme)
+ self.in_body = 1
+diff --git a/objdictgen/gnosis/xml/pickle/parsers/_dom.py b/objdictgen/gnosis/xml/pickle/parsers/_dom.py
+index 0703331b8e48..8582f5c8f1a7 100644
+--- a/objdictgen/gnosis/xml/pickle/parsers/_dom.py
++++ b/objdictgen/gnosis/xml/pickle/parsers/_dom.py
+@@ -17,8 +17,7 @@ except ImportError:
+ array_type = 'array'
+
+ # Define exceptions and flags
+-XMLPicklingError = "gnosis.xml.pickle.XMLPicklingError"
+-XMLUnpicklingError = "gnosis.xml.pickle.XMLUnpicklingError"
++from gnosis.xml.pickle.exception import XMLPicklingError, XMLUnpicklingError
+
+ # Define our own TRUE/FALSE syms, based on Python version.
+ if pyconfig.Have_TrueFalse():
+@@ -70,7 +69,10 @@ def unpickle_instance(node, paranoia):
+
+ # next, decide what "stuff" is supposed to go into pyobj
+ if hasattr(raw,'__getstate__'):
+- stuff = raw.__getstate__
++ # Note: this code path was apparently never taken in Python 2, but
++ # __getstate__ is a function, and it makes no sense below to call
++ # __setstate__ or attr_update() with a function instead of a dict.
++ stuff = raw.__getstate__()
+ else:
+ stuff = raw.__dict__
+
+@@ -78,7 +80,7 @@ def unpickle_instance(node, paranoia):
+ if hasattr(pyobj,'__setstate__'):
+ pyobj.__setstate__(stuff)
+ else:
+- if type(stuff) is DictType: # must be a Dict if no __setstate__
++ if type(stuff) is dict: # must be a Dict if no __setstate__
+ # see note in pickle.py/load_build() about restricted
+ # execution -- do the same thing here
+ #try:
+@@ -92,9 +94,9 @@ def unpickle_instance(node, paranoia):
+ # does violate the pickle protocol, or because PARANOIA was
+ # set too high, and we couldn't create the real class, so
+ # __setstate__ is missing (and __stateinfo__ isn't a dict)
+- raise XMLUnpicklingError, \
+- "Non-DictType without setstate violates pickle protocol."+\
+- "(PARANOIA setting may be too high)"
++ raise XMLUnpicklingError( \
++ "Non-dict without setstate violates pickle protocol."+\
++ "(PARANOIA setting may be too high)")
+
+ return pyobj
+
+@@ -120,7 +122,7 @@ def get_node_valuetext(node):
+ # a value= attribute. ie. pickler can place it in either
+ # place (based on user preference) and unpickler doesn't care
+
+- if node._attrs.has_key('value'):
++ if 'value' in node._attrs.keys():
+ # text in tag
+ ttext = node.getAttribute('value')
+ return unsafe_string(ttext)
+@@ -165,8 +167,8 @@ def _fix_family(family,typename):
+ elif typename == 'False':
+ return 'uniq'
+ else:
+- raise XMLUnpicklingError, \
+- "family= must be given for unknown type %s" % typename
++ raise XMLUnpicklingError( \
++ "family= must be given for unknown type %s" % typename)
+
+ def _thing_from_dom(dom_node, container=None, paranoia=1):
+ "Converts an [xml_pickle] DOM tree to a 'native' Python object"
+@@ -248,7 +250,7 @@ def _thing_from_dom(dom_node, container=None, paranoia=1):
+ node.getAttribute('module'),
+ paranoia)
+ else:
+- raise XMLUnpicklingError, "Unknown lang type %s" % node_type
++ raise XMLUnpicklingError("Unknown lang type %s" % node_type)
+ elif node_family == 'uniq':
+ # uniq is another special type that is handled here instead
+ # of below.
+@@ -268,9 +270,9 @@ def _thing_from_dom(dom_node, container=None, paranoia=1):
+ elif node_type == 'False':
+ node_val = FALSE_VALUE
+ else:
+- raise XMLUnpicklingError, "Unknown uniq type %s" % node_type
++ raise XMLUnpicklingError("Unknown uniq type %s" % node_type)
+ else:
+- raise XMLUnpicklingError, "UNKNOWN family %s,%s,%s" % (node_family,node_type,node_name)
++ raise XMLUnpicklingError("UNKNOWN family %s,%s,%s" % (node_family,node_type,node_name))
+
+ # step 2 - take basic thing and make exact thing
+ # Note there are several NOPs here since node_val has been decided
+@@ -313,7 +315,7 @@ def _thing_from_dom(dom_node, container=None, paranoia=1):
+ #elif ext.can_handle_xml(node_type,node_valuetext):
+ # node_val = ext.xml_to_obj(node_type, node_valuetext, paranoia)
+ else:
+- raise XMLUnpicklingError, "Unknown type %s,%s" % (node,node_type)
++ raise XMLUnpicklingError("Unknown type %s,%s" % (node,node_type))
+
+ if node.nodeName == 'attr':
+ setattr(container,node_name,node_val)
+@@ -329,8 +331,8 @@ def _thing_from_dom(dom_node, container=None, paranoia=1):
+ # <entry> has no id for refchecking
+
+ else:
+- raise XMLUnpicklingError, \
+- "element %s is not in PyObjects.dtd" % node.nodeName
++ raise XMLUnpicklingError( \
++ "element %s is not in PyObjects.dtd" % node.nodeName)
+
+ return container
+
+diff --git a/objdictgen/gnosis/xml/pickle/parsers/_sax.py b/objdictgen/gnosis/xml/pickle/parsers/_sax.py
+index 4a6b42ad5858..6810135a52de 100644
+--- a/objdictgen/gnosis/xml/pickle/parsers/_sax.py
++++ b/objdictgen/gnosis/xml/pickle/parsers/_sax.py
+@@ -19,17 +19,16 @@ from gnosis.util.XtoY import to_number
+
+ import sys, os, string
+ from types import *
+-from StringIO import StringIO
++from io import StringIO
+
+ # Define exceptions and flags
+-XMLPicklingError = "gnosis.xml.pickle.XMLPicklingError"
+-XMLUnpicklingError = "gnosis.xml.pickle.XMLUnpicklingError"
++from gnosis.xml.pickle.exception import XMLPicklingError, XMLUnpicklingError
+
+ DEBUG = 0
+
+ def dbg(msg,force=0):
+ if DEBUG or force:
+- print msg
++ print(msg)
+
+ class _EmptyClass: pass
+
+@@ -64,12 +63,12 @@ class xmlpickle_handler(ContentHandler):
+ def prstk(self,force=0):
+ if DEBUG == 0 and not force:
+ return
+- print "**ELEM STACK**"
++ print("**ELEM STACK**")
+ for i in self.elem_stk:
+- print str(i)
+- print "**VALUE STACK**"
++ print(str(i))
++ print("**VALUE STACK**")
+ for i in self.val_stk:
+- print str(i)
++ print(str(i))
+
+ def save_obj_id(self,obj,elem):
+
+@@ -201,8 +200,8 @@ class xmlpickle_handler(ContentHandler):
+ elem[4].get('module'),
+ self.paranoia)
+ else:
+- raise XMLUnpicklingError, \
+- "Unknown lang type %s" % elem[2]
++ raise XMLUnpicklingError( \
++ "Unknown lang type %s" % elem[2])
+
+ elif family == 'uniq':
+ # uniq is a special type - we don't know how to unpickle
+@@ -225,12 +224,12 @@ class xmlpickle_handler(ContentHandler):
+ elif elem[2] == 'False':
+ obj = FALSE_VALUE
+ else:
+- raise XMLUnpicklingError, \
+- "Unknown uniq type %s" % elem[2]
++ raise XMLUnpicklingError( \
++ "Unknown uniq type %s" % elem[2])
+ else:
+- raise XMLUnpicklingError, \
++ raise XMLUnpicklingError( \
+ "UNKNOWN family %s,%s,%s" % \
+- (family,elem[2],elem[3])
++ (family,elem[2],elem[3]))
+
+ # step 2 -- convert basic -> specific type
+ # (many of these are NOPs, but included for clarity)
+@@ -286,8 +285,8 @@ class xmlpickle_handler(ContentHandler):
+
+ else:
+ self.prstk(1)
+- raise XMLUnpicklingError, \
+- "UNHANDLED elem %s"%elem[2]
++ raise XMLUnpicklingError( \
++ "UNHANDLED elem %s"%elem[2])
+
+ # push on stack and save obj ref
+ self.val_stk.append((elem[0],elem[3],obj))
+@@ -328,7 +327,7 @@ class xmlpickle_handler(ContentHandler):
+
+ def endDocument(self):
+ if DEBUG == 1:
+- print "NROBJS "+str(self.nr_objs)
++ print("NROBJS "+str(self.nr_objs))
+
+ def startElement(self,name,attrs):
+ dbg("** START ELEM %s,%s"%(name,attrs._attrs))
+@@ -406,17 +405,17 @@ class xmlpickle_handler(ContentHandler):
+
+ # implement the ErrorHandler interface here as well
+ def error(self,exception):
+- print "** ERROR - dumping stacks"
++ print("** ERROR - dumping stacks")
+ self.prstk(1)
+ raise exception
+
+ def fatalError(self,exception):
+- print "** FATAL ERROR - dumping stacks"
++ print("** FATAL ERROR - dumping stacks")
+ self.prstk(1)
+ raise exception
+
+ def warning(self,exception):
+- print "WARNING"
++ print("WARNING")
+ raise exception
+
+ # Implement EntityResolver interface (called when the parser runs
+@@ -435,7 +434,7 @@ class xmlpickle_handler(ContentHandler):
+ def thing_from_sax(filehandle=None,paranoia=1):
+
+ if DEBUG == 1:
+- print "**** SAX PARSER ****"
++ print("**** SAX PARSER ****")
+
+ e = ExpatParser()
+ m = xmlpickle_handler(paranoia)
+diff --git a/objdictgen/gnosis/xml/pickle/test/test_all.py b/objdictgen/gnosis/xml/pickle/test/test_all.py
+index 916dfa168806..a3f931621280 100644
+--- a/objdictgen/gnosis/xml/pickle/test/test_all.py
++++ b/objdictgen/gnosis/xml/pickle/test/test_all.py
+@@ -178,7 +178,7 @@ pechof(tout,"Sanity check: OK")
+ parser_dict = enumParsers()
+
+ # test with DOM parser, if available
+-if parser_dict.has_key('DOM'):
++if 'DOM' in parser_dict.keys():
+
+ # make sure the USE_.. files are gone
+ unlink("USE_SAX")
+@@ -199,7 +199,7 @@ else:
+ pechof(tout,"** SKIPPING DOM parser **")
+
+ # test with SAX parser, if available
+-if parser_dict.has_key("SAX"):
++if "SAX" in parser_dict.keys():
+
+ touch("USE_SAX")
+
+@@ -220,7 +220,7 @@ else:
+ pechof(tout,"** SKIPPING SAX parser **")
+
+ # test with cEXPAT parser, if available
+-if parser_dict.has_key("cEXPAT"):
++if "cEXPAT" in parser_dict.keys():
+
+ touch("USE_CEXPAT");
+
+diff --git a/objdictgen/gnosis/xml/pickle/test/test_badstring.py b/objdictgen/gnosis/xml/pickle/test/test_badstring.py
+index 837154f99a77..e8452e6c3857 100644
+--- a/objdictgen/gnosis/xml/pickle/test/test_badstring.py
++++ b/objdictgen/gnosis/xml/pickle/test/test_badstring.py
+@@ -88,7 +88,7 @@ try:
+ # safe_content assumes it can always convert the string
+ # to unicode, which isn't true
+ # ex: pickling a UTF-8 encoded value
+- setInBody(StringType, 1)
++ setInBody(str, 1)
+ f = Foo('\xed\xa0\x80')
+ x = xml_pickle.dumps(f)
+ print "************* ERROR *************"
+diff --git a/objdictgen/gnosis/xml/pickle/test/test_bltin.py b/objdictgen/gnosis/xml/pickle/test/test_bltin.py
+index c23c14785dc8..bd1e4afca149 100644
+--- a/objdictgen/gnosis/xml/pickle/test/test_bltin.py
++++ b/objdictgen/gnosis/xml/pickle/test/test_bltin.py
+@@ -48,7 +48,7 @@ foo = foo_class()
+
+ # try putting numeric content in body (doesn't matter which
+ # numeric type)
+-setInBody(ComplexType,1)
++setInBody(complex,1)
+
+ # test both code paths
+
+diff --git a/objdictgen/gnosis/xml/pickle/test/test_mutators.py b/objdictgen/gnosis/xml/pickle/test/test_mutators.py
+index ea049cf6421a..d8e531629d39 100644
+--- a/objdictgen/gnosis/xml/pickle/test/test_mutators.py
++++ b/objdictgen/gnosis/xml/pickle/test/test_mutators.py
+@@ -27,8 +27,8 @@ class mystring(XMLP_Mutator):
+ # (here we fold two types to a single tagname)
+
+ print "*** TEST 1 ***"
+-my1 = mystring(StringType,"MyString",in_body=1)
+-my2 = mystring(UnicodeType,"MyString",in_body=1)
++my1 = mystring(str,"MyString",in_body=1)
++my2 = mystring(str,"MyString",in_body=1)
+
+ mutate.add_mutator(my1)
+ mutate.add_mutator(my2)
+@@ -57,8 +57,8 @@ mutate.remove_mutator(my2)
+
+ print "*** TEST 2 ***"
+
+-my1 = mystring(StringType,"string",in_body=1)
+-my2 = mystring(UnicodeType,"string",in_body=1)
++my1 = mystring(str,"string",in_body=1)
++my2 = mystring(str,"string",in_body=1)
+
+ mutate.add_mutator(my1)
+ mutate.add_mutator(my2)
+@@ -86,14 +86,14 @@ print z
+ # mynumlist handles lists of integers and pickles them as "n,n,n,n"
+ # mycharlist does the same for single-char strings
+ #
+-# otherwise, the ListType builtin handles the list
++# otherwise, the list builtin handles the list
+
+ class mynumlist(XMLP_Mutator):
+
+ def wants_obj(self,obj):
+ # I only want lists of integers
+ for i in obj:
+- if type(i) is not IntType:
++ if type(i) is not int:
+ return 0
+
+ return 1
+@@ -113,7 +113,7 @@ class mycharlist(XMLP_Mutator):
+ def wants_obj(self,obj):
+ # I only want lists of single chars
+ for i in obj:
+- if type(i) is not StringType or \
++ if type(i) is not str or \
+ len(i) != 1:
+ return 0
+
+@@ -135,8 +135,8 @@ class mycharlist(XMLP_Mutator):
+
+ print "*** TEST 3 ***"
+
+-my1 = mynumlist(ListType,"NumList",in_body=1)
+-my2 = mycharlist(ListType,"CharList",in_body=1)
++my1 = mynumlist(list,"NumList",in_body=1)
++my2 = mycharlist(list,"CharList",in_body=1)
+
+ mutate.add_mutator(my1)
+ mutate.add_mutator(my2)
+diff --git a/objdictgen/gnosis/xml/pickle/test/test_unicode.py b/objdictgen/gnosis/xml/pickle/test/test_unicode.py
+index 2ab724664348..cf22ef6ad57b 100644
+--- a/objdictgen/gnosis/xml/pickle/test/test_unicode.py
++++ b/objdictgen/gnosis/xml/pickle/test/test_unicode.py
+@@ -2,13 +2,12 @@
+
+ from gnosis.xml.pickle import loads,dumps
+ from gnosis.xml.pickle.util import setInBody
+-from types import StringType, UnicodeType
+ import funcs
+
+ funcs.set_parser()
+
+ #-- Create some unicode and python strings (and an object that contains them)
+-ustring = u"Alef: %s, Omega: %s" % (unichr(1488), unichr(969))
++ustring = u"Alef: %s, Omega: %s" % (chr(1488), chr(969))
+ pstring = "Only US-ASCII characters"
+ estring = "Only US-ASCII with line breaks\n\tthat was a tab"
+ class C:
+@@ -25,12 +24,12 @@ xml = dumps(o)
+ #print '------------* Restored attributes from different strings *--------------'
+ o2 = loads(xml)
+ # check types explicitly, since comparison will coerce types
+-if not isinstance(o2.ustring,UnicodeType):
+- raise "AAGH! Didn't get UnicodeType"
+-if not isinstance(o2.pstring,StringType):
+- raise "AAGH! Didn't get StringType for pstring"
+-if not isinstance(o2.estring,StringType):
+- raise "AAGH! Didn't get StringType for estring"
++if not isinstance(o2.ustring,str):
++ raise "AAGH! Didn't get str"
++if not isinstance(o2.pstring,str):
++ raise "AAGH! Didn't get str for pstring"
++if not isinstance(o2.estring,str):
++ raise "AAGH! Didn't get str for estring"
+
+ #print "UNICODE:", `o2.ustring`, type(o2.ustring)
+ #print "PLAIN: ", o2.pstring, type(o2.pstring)
+@@ -43,18 +42,18 @@ if o.ustring != o2.ustring or \
+
+ #-- Pickle with Python strings in body
+ #print '\n------------* Pickle with Python strings in body *----------------------'
+-setInBody(StringType, 1)
++setInBody(str, 1)
+ xml = dumps(o)
+ #print xml,
+ #print '------------* Restored attributes from different strings *--------------'
+ o2 = loads(xml)
+ # check types explicitly, since comparison will coerce types
+-if not isinstance(o2.ustring,UnicodeType):
+- raise "AAGH! Didn't get UnicodeType"
+-if not isinstance(o2.pstring,StringType):
+- raise "AAGH! Didn't get StringType for pstring"
+-if not isinstance(o2.estring,StringType):
+- raise "AAGH! Didn't get StringType for estring"
++if not isinstance(o2.ustring,str):
++ raise "AAGH! Didn't get str"
++if not isinstance(o2.pstring,str):
++ raise "AAGH! Didn't get str for pstring"
++if not isinstance(o2.estring,str):
++ raise "AAGH! Didn't get str for estring"
+
+ #print "UNICODE:", `o2.ustring`, type(o2.ustring)
+ #print "PLAIN: ", o2.pstring, type(o2.pstring)
+@@ -67,7 +66,7 @@ if o.ustring != o2.ustring or \
+
+ #-- Pickle with Unicode strings in attributes (FAIL)
+ #print '\n------------* Pickle with Unicode strings in XML attrs *----------------'
+-setInBody(UnicodeType, 0)
++setInBody(str, 0)
+ try:
+ xml = dumps(o)
+ raise "FAIL: We should not be allowed to put Unicode in attrs"
+diff --git a/objdictgen/gnosis/xml/pickle/util/__init__.py b/objdictgen/gnosis/xml/pickle/util/__init__.py
+index 3eb05ee45b5e..46771ba97622 100644
+--- a/objdictgen/gnosis/xml/pickle/util/__init__.py
++++ b/objdictgen/gnosis/xml/pickle/util/__init__.py
+@@ -1,5 +1,5 @@
+-from _flags import *
+-from _util import \
++from gnosis.xml.pickle.util._flags import *
++from gnosis.xml.pickle.util._util import \
+ _klass, _module, _EmptyClass, subnodes, \
+ safe_eval, safe_string, unsafe_string, safe_content, unsafe_content, \
+ _mini_getstack, _mini_currentframe, \
+diff --git a/objdictgen/gnosis/xml/pickle/util/_flags.py b/objdictgen/gnosis/xml/pickle/util/_flags.py
+index 3555b0123251..969acd316e5f 100644
+--- a/objdictgen/gnosis/xml/pickle/util/_flags.py
++++ b/objdictgen/gnosis/xml/pickle/util/_flags.py
+@@ -32,17 +32,22 @@ def enumParsers():
+ try:
+ from gnosis.xml.pickle.parsers._dom import thing_from_dom
+ dict['DOM'] = thing_from_dom
+- except: pass
++ except:
++ print("Notice: no DOM parser available")
++ raise
+
+ try:
+ from gnosis.xml.pickle.parsers._sax import thing_from_sax
+ dict['SAX'] = thing_from_sax
+- except: pass
++ except:
++ print("Notice: no SAX parser available")
++ raise
+
+ try:
+ from gnosis.xml.pickle.parsers._cexpat import thing_from_cexpat
+ dict['cEXPAT'] = thing_from_cexpat
+- except: pass
++ except:
++ print("Notice: no cEXPAT parser available")
+
+ return dict
+
+diff --git a/objdictgen/gnosis/xml/pickle/util/_util.py b/objdictgen/gnosis/xml/pickle/util/_util.py
+index 86e7339a9090..46d99eb1f9bc 100644
+--- a/objdictgen/gnosis/xml/pickle/util/_util.py
++++ b/objdictgen/gnosis/xml/pickle/util/_util.py
+@@ -158,8 +158,8 @@ def get_class_from_name(classname, modname=None, paranoia=1):
+ dbg("**ERROR - couldn't get class - paranoia = %s" % str(paranoia))
+
+ # *should* only be for paranoia == 2, but a good failsafe anyways ...
+- raise XMLUnpicklingError, \
+- "Cannot create class under current PARANOIA setting!"
++ raise XMLUnpicklingError( \
++ "Cannot create class under current PARANOIA setting!")
+
+ def obj_from_name(classname, modname=None, paranoia=1):
+ """Given a classname, optional module name, return an object
+@@ -192,14 +192,14 @@ def _module(thing):
+
+ def safe_eval(s):
+ if 0: # Condition for malicious string in eval() block
+- raise "SecurityError", \
+- "Malicious string '%s' should not be eval()'d" % s
++ raise SecurityError( \
++ "Malicious string '%s' should not be eval()'d" % s)
+ else:
+ return eval(s)
+
+ def safe_string(s):
+- if isinstance(s, UnicodeType):
+- raise TypeError, "Unicode strings may not be stored in XML attributes"
++ if isinstance(s, str):
++ raise TypeError("Unicode strings may not be stored in XML attributes")
+
+ # markup XML entities
+ s = s.replace('&', '&amp;')
+@@ -215,7 +215,7 @@ def unsafe_string(s):
+ # for Python escapes, exec the string
+ # (niggle w/ literalizing apostrophe)
+ s = s.replace("'", r"\047")
+- exec "s='"+s+"'"
++ exec("s='"+s+"'")
+ # XML entities (DOM does it for us)
+ return s
+
+@@ -226,7 +226,7 @@ def safe_content(s):
+ s = s.replace('>', '&gt;')
+
+ # wrap "regular" python strings as unicode
+- if isinstance(s, StringType):
++ if isinstance(s, str):
+ s = u"\xbb\xbb%s\xab\xab" % s
+
+ return s.encode('utf-8')
+@@ -237,7 +237,7 @@ def unsafe_content(s):
+ # don't have to "unescape" XML entities (parser does it for us)
+
+ # unwrap python strings from unicode wrapper
+- if s[:2]==unichr(187)*2 and s[-2:]==unichr(171)*2:
++ if s[:2]==chr(187)*2 and s[-2:]==chr(171)*2:
+ s = s[2:-2].encode('us-ascii')
+
+ return s
+@@ -248,7 +248,7 @@ def subnodes(node):
+ # for PyXML > 0.8, childNodes includes both <DOM Elements> and
+ # DocumentType objects, so we have to separate them.
+ return filter(lambda n: hasattr(n,'_attrs') and \
+- n.nodeName<>'#text', node.childNodes)
++ n.nodeName!='#text', node.childNodes)
+
+ #-------------------------------------------------------------------
+ # Python 2.0 doesn't have the inspect module, so we provide
+diff --git a/objdictgen/gnosis/xml/relax/lex.py b/objdictgen/gnosis/xml/relax/lex.py
+index 833213c3887f..59b0c6ba5851 100644
+--- a/objdictgen/gnosis/xml/relax/lex.py
++++ b/objdictgen/gnosis/xml/relax/lex.py
+@@ -252,7 +252,7 @@ class Lexer:
+ # input() - Push a new string into the lexer
+ # ------------------------------------------------------------
+ def input(self,s):
+- if not isinstance(s,types.StringType):
++ if not isinstance(s,str):
+ raise ValueError, "Expected a string"
+ self.lexdata = s
+ self.lexpos = 0
+@@ -314,7 +314,7 @@ class Lexer:
+
+ # Verify type of the token. If not in the token map, raise an error
+ if not self.optimize:
+- if not self.lextokens.has_key(newtok.type):
++ if not newtok.type in self.lextokens.keys():
+ raise LexError, ("%s:%d: Rule '%s' returned an unknown token type '%s'" % (
+ func.func_code.co_filename, func.func_code.co_firstlineno,
+ func.__name__, newtok.type),lexdata[lexpos:])
+@@ -453,7 +453,7 @@ def lex(module=None,debug=0,optimize=0,lextab="lextab"):
+ tokens = ldict.get("tokens",None)
+ if not tokens:
+ raise SyntaxError,"lex: module does not define 'tokens'"
+- if not (isinstance(tokens,types.ListType) or isinstance(tokens,types.TupleType)):
++ if not (isinstance(tokens,list) or isinstance(tokens,tuple)):
+ raise SyntaxError,"lex: tokens must be a list or tuple."
+
+ # Build a dictionary of valid token names
+@@ -470,7 +470,7 @@ def lex(module=None,debug=0,optimize=0,lextab="lextab"):
+ if not is_identifier(n):
+ print "lex: Bad token name '%s'" % n
+ error = 1
+- if lexer.lextokens.has_key(n):
++ if n in lexer.lextokens.keys():
+ print "lex: Warning. Token '%s' multiply defined." % n
+ lexer.lextokens[n] = None
+ else:
+@@ -489,7 +489,7 @@ def lex(module=None,debug=0,optimize=0,lextab="lextab"):
+ for f in tsymbols:
+ if isinstance(ldict[f],types.FunctionType):
+ fsymbols.append(ldict[f])
+- elif isinstance(ldict[f],types.StringType):
++ elif isinstance(ldict[f],str):
+ ssymbols.append((f,ldict[f]))
+ else:
+ print "lex: %s not defined as a function or string" % f
+@@ -565,7 +565,7 @@ def lex(module=None,debug=0,optimize=0,lextab="lextab"):
+ error = 1
+ continue
+
+- if not lexer.lextokens.has_key(name[2:]):
++ if not name[2:] in lexer.lextokens.keys():
+ print "lex: Rule '%s' defined for an unspecified token %s." % (name,name[2:])
+ error = 1
+ continue
+diff --git a/objdictgen/gnosis/xml/relax/rnctree.py b/objdictgen/gnosis/xml/relax/rnctree.py
+index 5430d858f012..2eee519828f9 100644
+--- a/objdictgen/gnosis/xml/relax/rnctree.py
++++ b/objdictgen/gnosis/xml/relax/rnctree.py
+@@ -290,7 +290,7 @@ def scan_NS(nodes):
+ elif node.type == NS:
+ ns, url = map(str.strip, node.value.split('='))
+ OTHER_NAMESPACE[ns] = url
+- elif node.type == ANNOTATION and not OTHER_NAMESPACE.has_key('a'):
++ elif node.type == ANNOTATION and not 'a' in OTHER_NAMESPACE.keys():
+ OTHER_NAMESPACE['a'] =\
+ '"http://relaxng.org/ns/compatibility/annotations/1.0"'
+ elif node.type == DATATYPES:
+diff --git a/objdictgen/gnosis/xml/xmlmap.py b/objdictgen/gnosis/xml/xmlmap.py
+index 5f37cab24395..8103e902ae29 100644
+--- a/objdictgen/gnosis/xml/xmlmap.py
++++ b/objdictgen/gnosis/xml/xmlmap.py
+@@ -17,7 +17,7 @@
+ # codes. Anyways, Python 2.2 and up have fixed this bug, but
+ # I have used workarounds in the code here for compatibility.
+ #
+-# So, in several places you'll see I've used unichr() instead of
++# So, in several places you'll see I've used chr() instead of
+ # coding the u'' directly due to this bug. I'm guessing that
+ # might be a little slower.
+ #
+@@ -26,18 +26,10 @@ __all__ = ['usplit','is_legal_xml','is_legal_xml_char']
+
+ import re
+
+-# define True/False if this Python doesn't have them (only
+-# used in this file)
+-try:
+- a = True
+-except:
+- True = 1
+- False = 0
+-
+ def usplit( uval ):
+ """
+ Split Unicode string into a sequence of characters.
+- \U sequences are considered to be a single character.
++ \\U sequences are considered to be a single character.
+
+ You should assume you will get a sequence, and not assume
+ anything about the type of sequence (i.e. list vs. tuple vs. string).
+@@ -65,8 +57,8 @@ def usplit( uval ):
+ # the second character is in range (0xdc00 - 0xdfff), then
+ # it is a 2-character encoding
+ if len(uval[i:]) > 1 and \
+- uval[i] >= unichr(0xD800) and uval[i] <= unichr(0xDBFF) and \
+- uval[i+1] >= unichr(0xDC00) and uval[i+1] <= unichr(0xDFFF):
++ uval[i] >= chr(0xD800) and uval[i] <= chr(0xDBFF) and \
++ uval[i+1] >= chr(0xDC00) and uval[i+1] <= chr(0xDFFF):
+
+ # it's a two character encoding
+ clist.append( uval[i:i+2] )
+@@ -106,10 +98,10 @@ def make_illegal_xml_regex():
+ using the codes (D800-DBFF),(DC00-DFFF), which are both illegal
+ when used as single chars, from above.
+
+- Python won't let you define \U character ranges, so you can't
+- just say '\U00010000-\U0010FFFF'. However, you can take advantage
++ Python won't let you define \\U character ranges, so you can't
++ just say '\\U00010000-\\U0010FFFF'. However, you can take advantage
+ of the fact that (D800-DBFF) and (DC00-DFFF) are illegal, unless
+- part of a 2-character sequence, to match for the \U characters.
++ part of a 2-character sequence, to match for the \\U characters.
+ """
+
+ # First, add a group for all the basic illegal areas above
+@@ -124,9 +116,9 @@ def make_illegal_xml_regex():
+
+ # I've defined this oddly due to the bug mentioned at the top of this file
+ re_xml_illegal += u'([%s-%s][^%s-%s])|([^%s-%s][%s-%s])|([%s-%s]$)|(^[%s-%s])' % \
+- (unichr(0xd800),unichr(0xdbff),unichr(0xdc00),unichr(0xdfff),
+- unichr(0xd800),unichr(0xdbff),unichr(0xdc00),unichr(0xdfff),
+- unichr(0xd800),unichr(0xdbff),unichr(0xdc00),unichr(0xdfff))
++ (chr(0xd800),chr(0xdbff),chr(0xdc00),chr(0xdfff),
++ chr(0xd800),chr(0xdbff),chr(0xdc00),chr(0xdfff),
++ chr(0xd800),chr(0xdbff),chr(0xdc00),chr(0xdfff))
+
+ return re.compile( re_xml_illegal )
+
+@@ -156,7 +148,7 @@ def is_legal_xml_char( uchar ):
+
+ Otherwise, the first char of a legal 2-character
+ sequence will be incorrectly tagged as illegal, on
+- Pythons where \U is stored as 2-chars.
++ Pythons where \\U is stored as 2-chars.
+ """
+
+ # due to inconsistencies in how \U is handled (based on
+@@ -175,7 +167,7 @@ def is_legal_xml_char( uchar ):
+ (uchar >= u'\u000b' and uchar <= u'\u000c') or \
+ (uchar >= u'\u000e' and uchar <= u'\u0019') or \
+ # always illegal as single chars
+- (uchar >= unichr(0xd800) and uchar <= unichr(0xdfff)) or \
++ (uchar >= chr(0xd800) and uchar <= chr(0xdfff)) or \
+ (uchar >= u'\ufffe' and uchar <= u'\uffff')
+ )
+ elif len(uchar) == 2:
diff --git a/patches/canfestival-3+hg20180126.794/0008-port-to-python3.patch b/patches/canfestival-3+hg20180126.794/0008-port-to-python3.patch
new file mode 100644
index 000000000..133c509c6
--- /dev/null
+++ b/patches/canfestival-3+hg20180126.794/0008-port-to-python3.patch
@@ -0,0 +1,945 @@
+From: Roland Hieber <rhi@pengutronix.de>
+Date: Sun, 11 Feb 2024 22:28:38 +0100
+Subject: [PATCH] Port to Python 3
+
+Not all of the code was ported, only enough to make objdictgen calls in
+the Makefile work enough to generate the code in examples/.
+---
+ objdictgen/commondialogs.py | 2 +-
+ objdictgen/eds_utils.py | 76 ++++++++++++++++++++--------------------
+ objdictgen/gen_cfile.py | 25 +++++++------
+ objdictgen/networkedit.py | 4 +--
+ objdictgen/node.py | 57 +++++++++++++++---------------
+ objdictgen/nodeeditortemplate.py | 10 +++---
+ objdictgen/nodelist.py | 2 +-
+ objdictgen/nodemanager.py | 25 +++++++------
+ objdictgen/objdictedit.py | 22 ++++++------
+ objdictgen/objdictgen.py | 20 +++++------
+ 10 files changed, 122 insertions(+), 121 deletions(-)
+
+diff --git a/objdictgen/commondialogs.py b/objdictgen/commondialogs.py
+index 77d6705bd70b..38b840b617c0 100644
+--- a/objdictgen/commondialogs.py
++++ b/objdictgen/commondialogs.py
+@@ -1566,7 +1566,7 @@ class DCFEntryValuesDialog(wx.Dialog):
+ if values != "":
+ data = values[4:]
+ current = 0
+- for i in xrange(BE_to_LE(values[:4])):
++ for i in range(BE_to_LE(values[:4])):
+ value = {}
+ value["Index"] = BE_to_LE(data[current:current+2])
+ value["Subindex"] = BE_to_LE(data[current+2:current+3])
+diff --git a/objdictgen/eds_utils.py b/objdictgen/eds_utils.py
+index 969bae91dce5..aad8491681ac 100644
+--- a/objdictgen/eds_utils.py
++++ b/objdictgen/eds_utils.py
+@@ -53,8 +53,8 @@ BOOL_TRANSLATE = {True : "1", False : "0"}
+ ACCESS_TRANSLATE = {"RO" : "ro", "WO" : "wo", "RW" : "rw", "RWR" : "rw", "RWW" : "rw", "CONST" : "ro"}
+
+ # Function for verifying data values
+-is_integer = lambda x: type(x) in (IntType, LongType)
+-is_string = lambda x: type(x) in (StringType, UnicodeType)
++is_integer = lambda x: type(x) == int
++is_string = lambda x: type(x) == str
+ is_boolean = lambda x: x in (0, 1)
+
+ # Define checking of value for each attribute
+@@ -174,7 +174,7 @@ def ParseCPJFile(filepath):
+ try:
+ computed_value = int(value, 16)
+ except:
+- raise SyntaxError, _("\"%s\" is not a valid value for attribute \"%s\" of section \"[%s]\"")%(value, keyname, section_name)
++ raise SyntaxError(_("\"%s\" is not a valid value for attribute \"%s\" of section \"[%s]\"")%(value, keyname, section_name))
+ elif value.isdigit() or value.startswith("-") and value[1:].isdigit():
+ # Second case, value is a number and starts with "0" or "-0", then it's an octal value
+ if value.startswith("0") or value.startswith("-0"):
+@@ -193,59 +193,59 @@ def ParseCPJFile(filepath):
+
+ if keyname.upper() == "NETNAME":
+ if not is_string(computed_value):
+- raise SyntaxError, _("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name)
++ raise SyntaxError(_("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name))
+ topology["Name"] = computed_value
+ elif keyname.upper() == "NODES":
+ if not is_integer(computed_value):
+- raise SyntaxError, _("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name)
++ raise SyntaxError(_("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name))
+ topology["Number"] = computed_value
+ elif keyname.upper() == "EDSBASENAME":
+ if not is_string(computed_value):
+- raise SyntaxError, _("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name)
++ raise SyntaxError(_("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name))
+ topology["Path"] = computed_value
+ elif nodepresent_result:
+ if not is_boolean(computed_value):
+- raise SyntaxError, _("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name)
++ raise SyntaxError(_("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name))
+ nodeid = int(nodepresent_result.groups()[0])
+ if nodeid not in topology["Nodes"].keys():
+ topology["Nodes"][nodeid] = {}
+ topology["Nodes"][nodeid]["Present"] = computed_value
+ elif nodename_result:
+ if not is_string(value):
+- raise SyntaxError, _("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name)
++ raise SyntaxError(_("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name))
+ nodeid = int(nodename_result.groups()[0])
+ if nodeid not in topology["Nodes"].keys():
+ topology["Nodes"][nodeid] = {}
+ topology["Nodes"][nodeid]["Name"] = computed_value
+ elif nodedcfname_result:
+ if not is_string(computed_value):
+- raise SyntaxError, _("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name)
++ raise SyntaxError(_("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name))
+ nodeid = int(nodedcfname_result.groups()[0])
+ if nodeid not in topology["Nodes"].keys():
+ topology["Nodes"][nodeid] = {}
+ topology["Nodes"][nodeid]["DCFName"] = computed_value
+ else:
+- raise SyntaxError, _("Keyname \"%s\" not recognised for section \"[%s]\"")%(keyname, section_name)
++ raise SyntaxError(_("Keyname \"%s\" not recognised for section \"[%s]\"")%(keyname, section_name))
+
+ # All lines that are not empty and are neither a comment neither not a valid assignment
+ elif assignment.strip() != "":
+- raise SyntaxError, _("\"%s\" is not a valid CPJ line")%assignment.strip()
++ raise SyntaxError(_("\"%s\" is not a valid CPJ line")%assignment.strip())
+
+ if "Number" not in topology.keys():
+- raise SyntaxError, _("\"Nodes\" keyname in \"[%s]\" section is missing")%section_name
++ raise SyntaxError(_("\"Nodes\" keyname in \"[%s]\" section is missing")%section_name)
+
+ if topology["Number"] != len(topology["Nodes"]):
+- raise SyntaxError, _("\"Nodes\" value not corresponding to number of nodes defined")
++ raise SyntaxError(_("\"Nodes\" value not corresponding to number of nodes defined"))
+
+ for nodeid, node in topology["Nodes"].items():
+ if "Present" not in node.keys():
+- raise SyntaxError, _("\"Node%dPresent\" keyname in \"[%s]\" section is missing")%(nodeid, section_name)
++ raise SyntaxError(_("\"Node%dPresent\" keyname in \"[%s]\" section is missing")%(nodeid, section_name))
+
+ networks.append(topology)
+
+ # In other case, there is a syntax problem into CPJ file
+ else:
+- raise SyntaxError, _("Section \"[%s]\" is unrecognized")%section_name
++ raise SyntaxError(_("Section \"[%s]\" is unrecognized")%section_name)
+
+ return networks
+
+@@ -275,7 +275,7 @@ def ParseEDSFile(filepath):
+ if section_name.upper() not in eds_dict:
+ eds_dict[section_name.upper()] = values
+ else:
+- raise SyntaxError, _("\"[%s]\" section is defined two times")%section_name
++ raise SyntaxError(_("\"[%s]\" section is defined two times")%section_name)
+ # Second case, section name is an index name
+ elif index_result:
+ # Extract index number
+@@ -288,7 +288,7 @@ def ParseEDSFile(filepath):
+ values["subindexes"] = eds_dict[index]["subindexes"]
+ eds_dict[index] = values
+ else:
+- raise SyntaxError, _("\"[%s]\" section is defined two times")%section_name
++ raise SyntaxError(_("\"[%s]\" section is defined two times")%section_name)
+ is_entry = True
+ # Third case, section name is a subindex name
+ elif subindex_result:
+@@ -301,14 +301,14 @@ def ParseEDSFile(filepath):
+ if subindex not in eds_dict[index]["subindexes"]:
+ eds_dict[index]["subindexes"][subindex] = values
+ else:
+- raise SyntaxError, _("\"[%s]\" section is defined two times")%section_name
++ raise SyntaxError(_("\"[%s]\" section is defined two times")%section_name)
+ is_entry = True
+ # Third case, section name is a subindex name
+ elif index_objectlinks_result:
+ pass
+ # In any other case, there is a syntax problem into EDS file
+ else:
+- raise SyntaxError, _("Section \"[%s]\" is unrecognized")%section_name
++ raise SyntaxError(_("Section \"[%s]\" is unrecognized")%section_name)
+
+ for assignment in assignments:
+ # Escape any comment
+@@ -330,13 +330,13 @@ def ParseEDSFile(filepath):
+ test = int(value.upper().replace("$NODEID+", ""), 16)
+ computed_value = "\"%s\""%value
+ except:
+- raise SyntaxError, _("\"%s\" is not a valid formula for attribute \"%s\" of section \"[%s]\"")%(value, keyname, section_name)
++ raise SyntaxError(_("\"%s\" is not a valid formula for attribute \"%s\" of section \"[%s]\"")%(value, keyname, section_name))
+ # Second case, value starts with "0x", then it's an hexadecimal value
+ elif value.startswith("0x") or value.startswith("-0x"):
+ try:
+ computed_value = int(value, 16)
+ except:
+- raise SyntaxError, _("\"%s\" is not a valid value for attribute \"%s\" of section \"[%s]\"")%(value, keyname, section_name)
++ raise SyntaxError(_("\"%s\" is not a valid value for attribute \"%s\" of section \"[%s]\"")%(value, keyname, section_name))
+ elif value.isdigit() or value.startswith("-") and value[1:].isdigit():
+ # Third case, value is a number and starts with "0", then it's an octal value
+ if value.startswith("0") or value.startswith("-0"):
+@@ -354,17 +354,17 @@ def ParseEDSFile(filepath):
+ if is_entry:
+ # Verify that keyname is a possible attribute
+ if keyname.upper() not in ENTRY_ATTRIBUTES:
+- raise SyntaxError, _("Keyname \"%s\" not recognised for section \"[%s]\"")%(keyname, section_name)
++ raise SyntaxError(_("Keyname \"%s\" not recognised for section \"[%s]\"")%(keyname, section_name))
+ # Verify that value is valid
+ elif not ENTRY_ATTRIBUTES[keyname.upper()](computed_value):
+- raise SyntaxError, _("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name)
++ raise SyntaxError(_("Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\"")%(value, keyname, section_name))
+ else:
+ values[keyname.upper()] = computed_value
+ else:
+ values[keyname.upper()] = computed_value
+ # All lines that are not empty and are neither a comment neither not a valid assignment
+ elif assignment.strip() != "":
+- raise SyntaxError, _("\"%s\" is not a valid EDS line")%assignment.strip()
++ raise SyntaxError(_("\"%s\" is not a valid EDS line")%assignment.strip())
+
+ # If entry is an index or a subindex
+ if is_entry:
+@@ -384,7 +384,7 @@ def ParseEDSFile(filepath):
+ attributes = _("Attributes %s are")%_(", ").join(["\"%s\""%attribute for attribute in missing])
+ else:
+ attributes = _("Attribute \"%s\" is")%missing.pop()
+- raise SyntaxError, _("Error on section \"[%s]\":\n%s required for a %s entry")%(section_name, attributes, ENTRY_TYPES[values["OBJECTTYPE"]]["name"])
++ raise SyntaxError(_("Error on section \"[%s]\":\n%s required for a %s entry")%(section_name, attributes, ENTRY_TYPES[values["OBJECTTYPE"]]["name"]))
+ # Verify that parameters defined are all in the possible parameters
+ if not keys.issubset(possible):
+ unsupported = keys.difference(possible)
+@@ -392,7 +392,7 @@ def ParseEDSFile(filepath):
+ attributes = _("Attributes %s are")%_(", ").join(["\"%s\""%attribute for attribute in unsupported])
+ else:
+ attributes = _("Attribute \"%s\" is")%unsupported.pop()
+- raise SyntaxError, _("Error on section \"[%s]\":\n%s unsupported for a %s entry")%(section_name, attributes, ENTRY_TYPES[values["OBJECTTYPE"]]["name"])
++ raise SyntaxError(_("Error on section \"[%s]\":\n%s unsupported for a %s entry")%(section_name, attributes, ENTRY_TYPES[values["OBJECTTYPE"]]["name"]))
+
+ VerifyValue(values, section_name, "ParameterValue")
+ VerifyValue(values, section_name, "DefaultValue")
+@@ -409,10 +409,10 @@ def VerifyValue(values, section_name, param):
+ elif values["DATATYPE"] == 0x01:
+ values[param.upper()] = {0 : False, 1 : True}[values[param.upper()]]
+ else:
+- if not isinstance(values[param.upper()], (IntType, LongType)) and values[param.upper()].upper().find("$NODEID") == -1:
++ if not isinstance(values[param.upper()], int) and values[param.upper()].upper().find("$NODEID") == -1:
+ raise
+ except:
+- raise SyntaxError, _("Error on section \"[%s]\":\n%s incompatible with DataType")%(section_name, param)
++ raise SyntaxError(_("Error on section \"[%s]\":\n%s incompatible with DataType")%(section_name, param))
+
+
+ # Function that write an EDS file after generate it's content
+@@ -531,7 +531,7 @@ def GenerateFileContent(Node, filepath):
+ # Define section name
+ text = "\n[%X]\n"%entry
+ # If there is only one value, it's a VAR entry
+- if type(values) != ListType:
++ if type(values) != list:
+ # Extract the informations of the first subindex
+ subentry_infos = Node.GetSubentryInfos(entry, 0)
+ # Generate EDS informations for the entry
+@@ -636,7 +636,7 @@ def GenerateEDSFile(filepath, node):
+ # Write file
+ WriteFile(filepath, content)
+ return None
+- except ValueError, message:
++ except ValueError as essage:
+ return _("Unable to generate EDS file\n%s")%message
+
+ # Function that generate the CPJ file content for the nodelist
+@@ -696,7 +696,7 @@ def GenerateNode(filepath, nodeID = 0):
+ if values["OBJECTTYPE"] == 2:
+ values["DATATYPE"] = values.get("DATATYPE", 0xF)
+ if values["DATATYPE"] != 0xF:
+- raise SyntaxError, _("Domain entry 0x%4.4X DataType must be 0xF(DOMAIN) if defined")%entry
++ raise SyntaxError(_("Domain entry 0x%4.4X DataType must be 0xF(DOMAIN) if defined")%entry)
+ # Add mapping for entry
+ Node.AddMappingEntry(entry, name = values["PARAMETERNAME"], struct = 1)
+ # Add mapping for first subindex
+@@ -713,7 +713,7 @@ def GenerateNode(filepath, nodeID = 0):
+ # Add mapping for first subindex
+ Node.AddMappingEntry(entry, 0, values = {"name" : "Number of Entries", "type" : 0x05, "access" : "ro", "pdo" : False})
+ # Add mapping for other subindexes
+- for subindex in xrange(1, int(max_subindex) + 1):
++ for subindex in range(1, int(max_subindex) + 1):
+ # if subindex is defined
+ if subindex in values["subindexes"]:
+ Node.AddMappingEntry(entry, subindex, values = {"name" : values["subindexes"][subindex]["PARAMETERNAME"],
+@@ -727,7 +727,7 @@ def GenerateNode(filepath, nodeID = 0):
+ ## elif values["OBJECTTYPE"] == 9:
+ ## # Verify that the first subindex is defined
+ ## if 0 not in values["subindexes"]:
+-## raise SyntaxError, "Error on entry 0x%4.4X:\nSubindex 0 must be defined for a RECORD entry"%entry
++## raise SyntaxError("Error on entry 0x%4.4X:\nSubindex 0 must be defined for a RECORD entry"%entry)
+ ## # Add mapping for entry
+ ## Node.AddMappingEntry(entry, name = values["PARAMETERNAME"], struct = 7)
+ ## # Add mapping for first subindex
+@@ -740,7 +740,7 @@ def GenerateNode(filepath, nodeID = 0):
+ ## "pdo" : values["subindexes"][1].get("PDOMAPPING", 0) == 1,
+ ## "nbmax" : 0xFE})
+ ## else:
+-## raise SyntaxError, "Error on entry 0x%4.4X:\nA RECORD entry must have at least 2 subindexes"%entry
++## raise SyntaxError("Error on entry 0x%4.4X:\nA RECORD entry must have at least 2 subindexes"%entry)
+
+ # Define entry for the new node
+
+@@ -763,7 +763,7 @@ def GenerateNode(filepath, nodeID = 0):
+ max_subindex = max(values["subindexes"].keys())
+ Node.AddEntry(entry, value = [])
+ # Define value for all subindexes except the first
+- for subindex in xrange(1, int(max_subindex) + 1):
++ for subindex in range(1, int(max_subindex) + 1):
+ # Take default value if it is defined and entry is defined
+ if subindex in values["subindexes"] and "PARAMETERVALUE" in values["subindexes"][subindex]:
+ value = values["subindexes"][subindex]["PARAMETERVALUE"]
+@@ -774,9 +774,9 @@ def GenerateNode(filepath, nodeID = 0):
+ value = GetDefaultValue(Node, entry, subindex)
+ Node.AddEntry(entry, subindex, value)
+ else:
+- raise SyntaxError, _("Array or Record entry 0x%4.4X must have a \"SubNumber\" attribute")%entry
++ raise SyntaxError(_("Array or Record entry 0x%4.4X must have a \"SubNumber\" attribute")%entry)
+ return Node
+- except SyntaxError, message:
++ except SyntaxError as message:
+ return _("Unable to import EDS file\n%s")%message
+
+ #-------------------------------------------------------------------------------
+@@ -784,5 +784,5 @@ def GenerateNode(filepath, nodeID = 0):
+ #-------------------------------------------------------------------------------
+
+ if __name__ == '__main__':
+- print ParseEDSFile("examples/PEAK MicroMod.eds")
++ print(ParseEDSFile("examples/PEAK MicroMod.eds"))
+
+diff --git a/objdictgen/gen_cfile.py b/objdictgen/gen_cfile.py
+index 0945f52dc405..be452121fce9 100644
+--- a/objdictgen/gen_cfile.py
++++ b/objdictgen/gen_cfile.py
+@@ -61,9 +61,9 @@ def GetValidTypeInfos(typename, items=[]):
+ result = type_model.match(typename)
+ if result:
+ values = result.groups()
+- if values[0] == "UNSIGNED" and int(values[1]) in [i * 8 for i in xrange(1, 9)]:
++ if values[0] == "UNSIGNED" and int(values[1]) in [i * 8 for i in range(1, 9)]:
+ typeinfos = ("UNS%s"%values[1], None, "uint%s"%values[1], True)
+- elif values[0] == "INTEGER" and int(values[1]) in [i * 8 for i in xrange(1, 9)]:
++ elif values[0] == "INTEGER" and int(values[1]) in [i * 8 for i in range(1, 9)]:
+ typeinfos = ("INTEGER%s"%values[1], None, "int%s"%values[1], False)
+ elif values[0] == "REAL" and int(values[1]) in (32, 64):
+ typeinfos = ("%s%s"%(values[0], values[1]), None, "real%s"%values[1], False)
+@@ -82,11 +82,11 @@ def GetValidTypeInfos(typename, items=[]):
+ elif values[0] == "BOOLEAN":
+ typeinfos = ("UNS8", None, "boolean", False)
+ else:
+- raise ValueError, _("""!!! %s isn't a valid type for CanFestival.""")%typename
++ raise ValueError(_("""!!! %s isn't a valid type for CanFestival.""")%typename)
+ if typeinfos[2] not in ["visible_string", "domain"]:
+ internal_types[typename] = typeinfos
+ else:
+- raise ValueError, _("""!!! %s isn't a valid type for CanFestival.""")%typename
++ raise ValueError(_("""!!! %s isn't a valid type for CanFestival.""")%typename)
+ return typeinfos
+
+ def ComputeValue(type, value):
+@@ -107,7 +107,7 @@ def WriteFile(filepath, content):
+ def GetTypeName(Node, typenumber):
+ typename = Node.GetTypeName(typenumber)
+ if typename is None:
+- raise ValueError, _("""!!! Datatype with value "0x%4.4X" isn't defined in CanFestival.""")%typenumber
++ raise ValueError(_("""!!! Datatype with value "0x%4.4X" isn't defined in CanFestival.""")%typenumber)
+ return typename
+
+ def GenerateFileContent(Node, headerfilepath, pointers_dict = {}):
+@@ -189,7 +189,7 @@ def GenerateFileContent(Node, headerfilepath, pointers_dict = {}):
+ texts["index"] = index
+ strIndex = ""
+ entry_infos = Node.GetEntryInfos(index)
+- texts["EntryName"] = entry_infos["name"].encode('ascii','replace')
++ texts["EntryName"] = entry_infos["name"]
+ values = Node.GetEntry(index)
+ callbacks = Node.HasEntryCallbacks(index)
+ if index in variablelist:
+@@ -198,13 +198,13 @@ def GenerateFileContent(Node, headerfilepath, pointers_dict = {}):
+ strIndex += "\n/* index 0x%(index)04X : %(EntryName)s. */\n"%texts
+
+ # Entry type is VAR
+- if not isinstance(values, ListType):
++ if not isinstance(values, list):
+ subentry_infos = Node.GetSubentryInfos(index, 0)
+ typename = GetTypeName(Node, subentry_infos["type"])
+ typeinfos = GetValidTypeInfos(typename, [values])
+ if typename is "DOMAIN" and index in variablelist:
+ if not typeinfos[1]:
+- raise ValueError, _("\nDomain variable not initialized\nindex : 0x%04X\nsubindex : 0x00")%index
++ raise ValueError(_("\nDomain variable not initialized\nindex : 0x%04X\nsubindex : 0x00")%index)
+ texts["subIndexType"] = typeinfos[0]
+ if typeinfos[1] is not None:
+ texts["suffixe"] = "[%d]"%typeinfos[1]
+@@ -298,14 +298,14 @@ def GenerateFileContent(Node, headerfilepath, pointers_dict = {}):
+ name = "%(NodeName)s_Index%(index)04X"%texts
+ name=UnDigitName(name);
+ strIndex += " ODCallback_t %s_callbacks[] = \n {\n"%name
+- for subIndex in xrange(len(values)):
++ for subIndex in range(len(values)):
+ strIndex += " NULL,\n"
+ strIndex += " };\n"
+ indexCallbacks[index] = "*callbacks = %s_callbacks; "%name
+ else:
+ indexCallbacks[index] = ""
+ strIndex += " subindex %(NodeName)s_Index%(index)04X[] = \n {\n"%texts
+- for subIndex in xrange(len(values)):
++ for subIndex in range(len(values)):
+ subentry_infos = Node.GetSubentryInfos(index, subIndex)
+ if subIndex < len(values) - 1:
+ sep = ","
+@@ -514,8 +514,7 @@ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+ */
+ """%texts
+- contentlist = indexContents.keys()
+- contentlist.sort()
++ contentlist = sorted(indexContents.keys())
+ for index in contentlist:
+ fileContent += indexContents[index]
+
+@@ -600,6 +599,6 @@ def GenerateFile(filepath, node, pointers_dict = {}):
+ WriteFile(filepath, content)
+ WriteFile(headerfilepath, header)
+ return None
+- except ValueError, message:
++ except ValueError as message:
+ return _("Unable to Generate C File\n%s")%message
+
+diff --git a/objdictgen/networkedit.py b/objdictgen/networkedit.py
+index 6577d6f9760b..2ba72e6962e1 100644
+--- a/objdictgen/networkedit.py
++++ b/objdictgen/networkedit.py
+@@ -541,13 +541,13 @@ class networkedit(wx.Frame, NetworkEditorTemplate):
+ find_index = True
+ index, subIndex = result
+ result = OpenPDFDocIndex(index, ScriptDirectory)
+- if isinstance(result, (StringType, UnicodeType)):
++ if isinstance(result, str):
+ message = wx.MessageDialog(self, result, _("ERROR"), wx.OK|wx.ICON_ERROR)
+ message.ShowModal()
+ message.Destroy()
+ if not find_index:
+ result = OpenPDFDocIndex(None, ScriptDirectory)
+- if isinstance(result, (StringType, UnicodeType)):
++ if isinstance(result, str):
+ message = wx.MessageDialog(self, result, _("ERROR"), wx.OK|wx.ICON_ERROR)
+ message.ShowModal()
+ message.Destroy()
+diff --git a/objdictgen/node.py b/objdictgen/node.py
+index e73dacbe8248..acaf558a00c6 100755
+--- a/objdictgen/node.py
++++ b/objdictgen/node.py
+@@ -21,7 +21,7 @@
+ #License along with this library; if not, write to the Free Software
+ #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+-import cPickle
++import _pickle as cPickle
+ from types import *
+ import re
+
+@@ -348,7 +348,7 @@ def FindMapVariableList(mappingdictionary, Node, compute=True):
+ name = mappingdictionary[index]["values"][subIndex]["name"]
+ if mappingdictionary[index]["struct"] & OD_IdenticalSubindexes:
+ values = Node.GetEntry(index)
+- for i in xrange(len(values) - 1):
++ for i in range(len(values) - 1):
+ computed_name = name
+ if compute:
+ computed_name = StringFormat(computed_name, 1, i + 1)
+@@ -568,7 +568,7 @@ class Node:
+ elif subIndex == 1:
+ self.Dictionary[index] = [value]
+ return True
+- elif subIndex > 0 and type(self.Dictionary[index]) == ListType and subIndex == len(self.Dictionary[index]) + 1:
++ elif subIndex > 0 and type(self.Dictionary[index]) == list and subIndex == len(self.Dictionary[index]) + 1:
+ self.Dictionary[index].append(value)
+ return True
+ return False
+@@ -582,7 +582,7 @@ class Node:
+ if value != None:
+ self.Dictionary[index] = value
+ return True
+- elif type(self.Dictionary[index]) == ListType and 0 < subIndex <= len(self.Dictionary[index]):
++ elif type(self.Dictionary[index]) == list and 0 < subIndex <= len(self.Dictionary[index]):
+ if value != None:
+ self.Dictionary[index][subIndex - 1] = value
+ return True
+@@ -594,7 +594,7 @@ class Node:
+ if index in self.Dictionary:
+ if (comment != None or save != None or callback != None) and index not in self.ParamsDictionary:
+ self.ParamsDictionary[index] = {}
+- if subIndex == None or type(self.Dictionary[index]) != ListType and subIndex == 0:
++ if subIndex == None or type(self.Dictionary[index]) != list and subIndex == 0:
+ if comment != None:
+ self.ParamsDictionary[index]["comment"] = comment
+ if save != None:
+@@ -602,7 +602,7 @@ class Node:
+ if callback != None:
+ self.ParamsDictionary[index]["callback"] = callback
+ return True
+- elif type(self.Dictionary[index]) == ListType and 0 <= subIndex <= len(self.Dictionary[index]):
++ elif type(self.Dictionary[index]) == list and 0 <= subIndex <= len(self.Dictionary[index]):
+ if (comment != None or save != None or callback != None) and subIndex not in self.ParamsDictionary[index]:
+ self.ParamsDictionary[index][subIndex] = {}
+ if comment != None:
+@@ -626,7 +626,7 @@ class Node:
+ if index in self.ParamsDictionary:
+ self.ParamsDictionary.pop(index)
+ return True
+- elif type(self.Dictionary[index]) == ListType and subIndex == len(self.Dictionary[index]):
++ elif type(self.Dictionary[index]) == list and subIndex == len(self.Dictionary[index]):
+ self.Dictionary[index].pop(subIndex - 1)
+ if index in self.ParamsDictionary:
+ if subIndex in self.ParamsDictionary[index]:
+@@ -657,7 +657,7 @@ class Node:
+ def GetEntry(self, index, subIndex = None, compute = True):
+ if index in self.Dictionary:
+ if subIndex == None:
+- if type(self.Dictionary[index]) == ListType:
++ if type(self.Dictionary[index]) == list:
+ values = [len(self.Dictionary[index])]
+ for value in self.Dictionary[index]:
+ values.append(self.CompileValue(value, index, compute))
+@@ -665,11 +665,11 @@ class Node:
+ else:
+ return self.CompileValue(self.Dictionary[index], index, compute)
+ elif subIndex == 0:
+- if type(self.Dictionary[index]) == ListType:
++ if type(self.Dictionary[index]) == list:
+ return len(self.Dictionary[index])
+ else:
+ return self.CompileValue(self.Dictionary[index], index, compute)
+- elif type(self.Dictionary[index]) == ListType and 0 < subIndex <= len(self.Dictionary[index]):
++ elif type(self.Dictionary[index]) == list and 0 < subIndex <= len(self.Dictionary[index]):
+ return self.CompileValue(self.Dictionary[index][subIndex - 1], index, compute)
+ return None
+
+@@ -682,28 +682,28 @@ class Node:
+ self.ParamsDictionary = {}
+ if index in self.Dictionary:
+ if subIndex == None:
+- if type(self.Dictionary[index]) == ListType:
++ if type(self.Dictionary[index]) == list:
+ if index in self.ParamsDictionary:
+ result = []
+- for i in xrange(len(self.Dictionary[index]) + 1):
++ for i in range(len(self.Dictionary[index]) + 1):
+ line = DefaultParams.copy()
+ if i in self.ParamsDictionary[index]:
+ line.update(self.ParamsDictionary[index][i])
+ result.append(line)
+ return result
+ else:
+- return [DefaultParams.copy() for i in xrange(len(self.Dictionary[index]) + 1)]
++ return [DefaultParams.copy() for i in range(len(self.Dictionary[index]) + 1)]
+ else:
+ result = DefaultParams.copy()
+ if index in self.ParamsDictionary:
+ result.update(self.ParamsDictionary[index])
+ return result
+- elif subIndex == 0 and type(self.Dictionary[index]) != ListType:
++ elif subIndex == 0 and type(self.Dictionary[index]) != list:
+ result = DefaultParams.copy()
+ if index in self.ParamsDictionary:
+ result.update(self.ParamsDictionary[index])
+ return result
+- elif type(self.Dictionary[index]) == ListType and 0 <= subIndex <= len(self.Dictionary[index]):
++ elif type(self.Dictionary[index]) == list and 0 <= subIndex <= len(self.Dictionary[index]):
+ result = DefaultParams.copy()
+ if index in self.ParamsDictionary and subIndex in self.ParamsDictionary[index]:
+ result.update(self.ParamsDictionary[index][subIndex])
+@@ -780,23 +780,23 @@ class Node:
+ if self.UserMapping[index]["struct"] & OD_IdenticalSubindexes:
+ if self.IsStringType(self.UserMapping[index]["values"][subIndex]["type"]):
+ if self.IsRealType(values["type"]):
+- for i in xrange(len(self.Dictionary[index])):
++ for i in range(len(self.Dictionary[index])):
+ self.SetEntry(index, i + 1, 0.)
+ elif not self.IsStringType(values["type"]):
+- for i in xrange(len(self.Dictionary[index])):
++ for i in range(len(self.Dictionary[index])):
+ self.SetEntry(index, i + 1, 0)
+ elif self.IsRealType(self.UserMapping[index]["values"][subIndex]["type"]):
+ if self.IsStringType(values["type"]):
+- for i in xrange(len(self.Dictionary[index])):
++ for i in range(len(self.Dictionary[index])):
+ self.SetEntry(index, i + 1, "")
+ elif not self.IsRealType(values["type"]):
+- for i in xrange(len(self.Dictionary[index])):
++ for i in range(len(self.Dictionary[index])):
+ self.SetEntry(index, i + 1, 0)
+ elif self.IsStringType(values["type"]):
+- for i in xrange(len(self.Dictionary[index])):
++ for i in range(len(self.Dictionary[index])):
+ self.SetEntry(index, i + 1, "")
+ elif self.IsRealType(values["type"]):
+- for i in xrange(len(self.Dictionary[index])):
++ for i in range(len(self.Dictionary[index])):
+ self.SetEntry(index, i + 1, 0.)
+ else:
+ if self.IsStringType(self.UserMapping[index]["values"][subIndex]["type"]):
+@@ -883,14 +883,13 @@ class Node:
+ """
+ def GetIndexes(self):
+ listindex = self.Dictionary.keys()
+- listindex.sort()
+- return listindex
++ return sorted(listindex)
+
+ """
+ Print the Dictionary values
+ """
+ def Print(self):
+- print self.PrintString()
++ print(self.PrintString())
+
+ def PrintString(self):
+ result = ""
+@@ -899,7 +898,7 @@ class Node:
+ for index in listindex:
+ name = self.GetEntryName(index)
+ values = self.Dictionary[index]
+- if isinstance(values, ListType):
++ if isinstance(values, list):
+ result += "%04X (%s):\n"%(index, name)
+ for subidx, value in enumerate(values):
+ subentry_infos = self.GetSubentryInfos(index, subidx + 1)
+@@ -918,17 +917,17 @@ class Node:
+ value += (" %0"+"%d"%(size * 2)+"X")%BE_to_LE(data[i+7:i+7+size])
+ i += 7 + size
+ count += 1
+- elif isinstance(value, IntType):
++ elif isinstance(value, int):
+ value = "%X"%value
+ result += "%04X %02X (%s): %s\n"%(index, subidx+1, subentry_infos["name"], value)
+ else:
+- if isinstance(values, IntType):
++ if isinstance(values, int):
+ values = "%X"%values
+ result += "%04X (%s): %s\n"%(index, name, values)
+ return result
+
+ def CompileValue(self, value, index, compute = True):
+- if isinstance(value, (StringType, UnicodeType)) and value.upper().find("$NODEID") != -1:
++ if isinstance(value, str) and value.upper().find("$NODEID") != -1:
+ base = self.GetBaseIndex(index)
+ try:
+ raw = eval(value)
+@@ -1153,7 +1152,7 @@ def LE_to_BE(value, size):
+ """
+
+ data = ("%" + str(size * 2) + "." + str(size * 2) + "X") % value
+- list_car = [data[i:i+2] for i in xrange(0, len(data), 2)]
++ list_car = [data[i:i+2] for i in range(0, len(data), 2)]
+ list_car.reverse()
+ return "".join([chr(int(car, 16)) for car in list_car])
+
+diff --git a/objdictgen/nodeeditortemplate.py b/objdictgen/nodeeditortemplate.py
+index 462455f01df1..dc7c3743620d 100644
+--- a/objdictgen/nodeeditortemplate.py
++++ b/objdictgen/nodeeditortemplate.py
+@@ -83,10 +83,10 @@ class NodeEditorTemplate:
+ text = _("%s: %s entry of struct %s%s.")%(name,category,struct,number)
+ self.Frame.HelpBar.SetStatusText(text, 2)
+ else:
+- for i in xrange(3):
++ for i in range(3):
+ self.Frame.HelpBar.SetStatusText("", i)
+ else:
+- for i in xrange(3):
++ for i in range(3):
+ self.Frame.HelpBar.SetStatusText("", i)
+
+ def RefreshProfileMenu(self):
+@@ -95,7 +95,7 @@ class NodeEditorTemplate:
+ edititem = self.Frame.EditMenu.FindItemById(self.EDITMENU_ID)
+ if edititem:
+ length = self.Frame.AddMenu.GetMenuItemCount()
+- for i in xrange(length-6):
++ for i in range(length-6):
+ additem = self.Frame.AddMenu.FindItemByPosition(6)
+ self.Frame.AddMenu.Delete(additem.GetId())
+ if profile not in ("None", "DS-301"):
+@@ -201,7 +201,7 @@ class NodeEditorTemplate:
+ dialog.SetIndex(index)
+ if dialog.ShowModal() == wx.ID_OK:
+ result = self.Manager.AddMapVariableToCurrent(*dialog.GetValues())
+- if not isinstance(result, (StringType, UnicodeType)):
++ if not isinstance(result, str):
+ self.RefreshBufferState()
+ self.RefreshCurrentIndexList()
+ else:
+@@ -215,7 +215,7 @@ class NodeEditorTemplate:
+ dialog.SetTypeList(self.Manager.GetCustomisableTypes())
+ if dialog.ShowModal() == wx.ID_OK:
+ result = self.Manager.AddUserTypeToCurrent(*dialog.GetValues())
+- if not isinstance(result, (StringType, UnicodeType)):
++ if not isinstance(result, str):
+ self.RefreshBufferState()
+ self.RefreshCurrentIndexList()
+ else:
+diff --git a/objdictgen/nodelist.py b/objdictgen/nodelist.py
+index 97576ac24210..d1356434fe97 100644
+--- a/objdictgen/nodelist.py
++++ b/objdictgen/nodelist.py
+@@ -184,7 +184,7 @@ class NodeList:
+ result = self.Manager.OpenFileInCurrent(masterpath)
+ else:
+ result = self.Manager.CreateNewNode("MasterNode", 0x00, "master", "", "None", "", "heartbeat", ["DS302"])
+- if not isinstance(result, types.IntType):
++ if not isinstance(result, int):
+ return result
+ return None
+
+diff --git a/objdictgen/nodemanager.py b/objdictgen/nodemanager.py
+index 8ad5d83b430e..9394e05e76cd 100755
+--- a/objdictgen/nodemanager.py
++++ b/objdictgen/nodemanager.py
+@@ -31,6 +31,8 @@ import eds_utils, gen_cfile
+ from types import *
+ import os, re
+
++_ = lambda x: x
++
+ UndoBufferLength = 20
+
+ type_model = re.compile('([\_A-Z]*)([0-9]*)')
+@@ -65,7 +67,7 @@ class UndoBuffer:
+ self.MinIndex = 0
+ self.MaxIndex = 0
+ # Initialising buffer with currentstate at the first place
+- for i in xrange(UndoBufferLength):
++ for i in range(UndoBufferLength):
+ if i == 0:
+ self.Buffer.append(currentstate)
+ else:
+@@ -285,7 +287,8 @@ class NodeManager:
+ self.SetCurrentFilePath(filepath)
+ return index
+ except:
+- return _("Unable to load file \"%s\"!")%filepath
++ print( _("Unable to load file \"%s\"!")%filepath)
++ raise
+
+ """
+ Save current node in a file
+@@ -378,7 +381,7 @@ class NodeManager:
+ default = self.GetTypeDefaultValue(subentry_infos["type"])
+ # First case entry is record
+ if infos["struct"] & OD_IdenticalSubindexes:
+- for i in xrange(1, min(number,subentry_infos["nbmax"]-length) + 1):
++ for i in range(1, min(number,subentry_infos["nbmax"]-length) + 1):
+ node.AddEntry(index, length + i, default)
+ if not disable_buffer:
+ self.BufferCurrentNode()
+@@ -386,7 +389,7 @@ class NodeManager:
+ # Second case entry is array, only possible for manufacturer specific
+ elif infos["struct"] & OD_MultipleSubindexes and 0x2000 <= index <= 0x5FFF:
+ values = {"name" : "Undefined", "type" : 5, "access" : "rw", "pdo" : True}
+- for i in xrange(1, min(number,0xFE-length) + 1):
++ for i in range(1, min(number,0xFE-length) + 1):
+ node.AddMappingEntry(index, length + i, values = values.copy())
+ node.AddEntry(index, length + i, 0)
+ if not disable_buffer:
+@@ -408,7 +411,7 @@ class NodeManager:
+ nbmin = 1
+ # Entry is a record, or is an array of manufacturer specific
+ if infos["struct"] & OD_IdenticalSubindexes or 0x2000 <= index <= 0x5FFF and infos["struct"] & OD_IdenticalSubindexes:
+- for i in xrange(min(number, length - nbmin)):
++ for i in range(min(number, length - nbmin)):
+ self.RemoveCurrentVariable(index, length - i)
+ self.BufferCurrentNode()
+
+@@ -497,7 +500,7 @@ class NodeManager:
+ default = self.GetTypeDefaultValue(subentry_infos["type"])
+ node.AddEntry(index, value = [])
+ if "nbmin" in subentry_infos:
+- for i in xrange(subentry_infos["nbmin"]):
++ for i in range(subentry_infos["nbmin"]):
+ node.AddEntry(index, i + 1, default)
+ else:
+ node.AddEntry(index, 1, default)
+@@ -581,7 +584,7 @@ class NodeManager:
+ for menu,list in self.CurrentNode.GetSpecificMenu():
+ for i in list:
+ iinfos = self.GetEntryInfos(i)
+- indexes = [i + incr * iinfos["incr"] for incr in xrange(iinfos["nbmax"])]
++ indexes = [i + incr * iinfos["incr"] for incr in range(iinfos["nbmax"])]
+ if index in indexes:
+ found = True
+ diff = index - i
+@@ -613,10 +616,10 @@ class NodeManager:
+ if struct == rec:
+ values = {"name" : name + " %d[(sub)]", "type" : 0x05, "access" : "rw", "pdo" : True, "nbmax" : 0xFE}
+ node.AddMappingEntry(index, 1, values = values)
+- for i in xrange(number):
++ for i in range(number):
+ node.AddEntry(index, i + 1, 0)
+ else:
+- for i in xrange(number):
++ for i in range(number):
+ values = {"name" : "Undefined", "type" : 0x05, "access" : "rw", "pdo" : True}
+ node.AddMappingEntry(index, i + 1, values = values)
+ node.AddEntry(index, i + 1, 0)
+@@ -1029,7 +1032,7 @@ class NodeManager:
+ editors = []
+ values = node.GetEntry(index, compute = False)
+ params = node.GetParamsEntry(index)
+- if isinstance(values, ListType):
++ if isinstance(values, list):
+ for i, value in enumerate(values):
+ data.append({"value" : value})
+ data[-1].update(params[i])
+@@ -1049,7 +1052,7 @@ class NodeManager:
+ "type" : None, "value" : None,
+ "access" : None, "save" : "option",
+ "callback" : "option", "comment" : "string"}
+- if isinstance(values, ListType) and i == 0:
++ if isinstance(values, list) and i == 0:
+ if 0x1600 <= index <= 0x17FF or 0x1A00 <= index <= 0x1C00:
+ editor["access"] = "raccess"
+ else:
+diff --git a/objdictgen/objdictedit.py b/objdictgen/objdictedit.py
+index 9efb1ae83c0b..1a356fa2e7c5 100755
+--- a/objdictgen/objdictedit.py
++++ b/objdictgen/objdictedit.py
+@@ -30,8 +30,8 @@ __version__ = "$Revision: 1.48 $"
+
+ if __name__ == '__main__':
+ def usage():
+- print _("\nUsage of objdictedit.py :")
+- print "\n %s [Filepath, ...]\n"%sys.argv[0]
++ print(_("\nUsage of objdictedit.py :"))
++ print("\n %s [Filepath, ...]\n"%sys.argv[0])
+
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
+@@ -343,7 +343,7 @@ class objdictedit(wx.Frame, NodeEditorTemplate):
+ if self.ModeSolo:
+ for filepath in filesOpen:
+ result = self.Manager.OpenFileInCurrent(os.path.abspath(filepath))
+- if isinstance(result, (IntType, LongType)):
++ if isinstance(result, int):
+ new_editingpanel = EditingPanel(self.FileOpened, self, self.Manager)
+ new_editingpanel.SetIndex(result)
+ self.FileOpened.AddPage(new_editingpanel, "")
+@@ -392,13 +392,13 @@ class objdictedit(wx.Frame, NodeEditorTemplate):
+ find_index = True
+ index, subIndex = result
+ result = OpenPDFDocIndex(index, ScriptDirectory)
+- if isinstance(result, (StringType, UnicodeType)):
++ if isinstance(result, str):
+ message = wx.MessageDialog(self, result, _("ERROR"), wx.OK|wx.ICON_ERROR)
+ message.ShowModal()
+ message.Destroy()
+ if not find_index:
+ result = OpenPDFDocIndex(None, ScriptDirectory)
+- if isinstance(result, (StringType, UnicodeType)):
++ if isinstance(result, str):
+ message = wx.MessageDialog(self, result, _("ERROR"), wx.OK|wx.ICON_ERROR)
+ message.ShowModal()
+ message.Destroy()
+@@ -448,7 +448,7 @@ class objdictedit(wx.Frame, NodeEditorTemplate):
+ answer = dialog.ShowModal()
+ dialog.Destroy()
+ if answer == wx.ID_YES:
+- for i in xrange(self.Manager.GetBufferNumber()):
++ for i in range(self.Manager.GetBufferNumber()):
+ if self.Manager.CurrentIsSaved():
+ self.Manager.CloseCurrent()
+ else:
+@@ -542,7 +542,7 @@ class objdictedit(wx.Frame, NodeEditorTemplate):
+ NMT = dialog.GetNMTManagement()
+ options = dialog.GetOptions()
+ result = self.Manager.CreateNewNode(name, id, nodetype, description, profile, filepath, NMT, options)
+- if isinstance(result, (IntType, LongType)):
++ if isinstance(result, int):
+ new_editingpanel = EditingPanel(self.FileOpened, self, self.Manager)
+ new_editingpanel.SetIndex(result)
+ self.FileOpened.AddPage(new_editingpanel, "")
+@@ -570,7 +570,7 @@ class objdictedit(wx.Frame, NodeEditorTemplate):
+ filepath = dialog.GetPath()
+ if os.path.isfile(filepath):
+ result = self.Manager.OpenFileInCurrent(filepath)
+- if isinstance(result, (IntType, LongType)):
++ if isinstance(result, int):
+ new_editingpanel = EditingPanel(self.FileOpened, self, self.Manager)
+ new_editingpanel.SetIndex(result)
+ self.FileOpened.AddPage(new_editingpanel, "")
+@@ -603,7 +603,7 @@ class objdictedit(wx.Frame, NodeEditorTemplate):
+ result = self.Manager.SaveCurrentInFile()
+ if not result:
+ self.SaveAs()
+- elif not isinstance(result, (StringType, UnicodeType)):
++ elif not isinstance(result, str):
+ self.RefreshBufferState()
+ else:
+ message = wx.MessageDialog(self, result, _("Error"), wx.OK|wx.ICON_ERROR)
+@@ -621,7 +621,7 @@ class objdictedit(wx.Frame, NodeEditorTemplate):
+ filepath = dialog.GetPath()
+ if os.path.isdir(os.path.dirname(filepath)):
+ result = self.Manager.SaveCurrentInFile(filepath)
+- if not isinstance(result, (StringType, UnicodeType)):
++ if not isinstance(result, str):
+ self.RefreshBufferState()
+ else:
+ message = wx.MessageDialog(self, result, _("Error"), wx.OK|wx.ICON_ERROR)
+@@ -665,7 +665,7 @@ class objdictedit(wx.Frame, NodeEditorTemplate):
+ filepath = dialog.GetPath()
+ if os.path.isfile(filepath):
+ result = self.Manager.ImportCurrentFromEDSFile(filepath)
+- if isinstance(result, (IntType, LongType)):
++ if isinstance(result, int):
+ new_editingpanel = EditingPanel(self.FileOpened, self, self.Manager)
+ new_editingpanel.SetIndex(result)
+ self.FileOpened.AddPage(new_editingpanel, "")
+diff --git a/objdictgen/objdictgen.py b/objdictgen/objdictgen.py
+index 9d5131b7a8c9..6dd88737fa18 100644
+--- a/objdictgen/objdictgen.py
++++ b/objdictgen/objdictgen.py
+@@ -29,8 +29,8 @@ from nodemanager import *
+ _ = lambda x: x
+
+ def usage():
+- print _("\nUsage of objdictgen.py :")
+- print "\n %s XMLFilePath CFilePath\n"%sys.argv[0]
++ print(_("\nUsage of objdictgen.py :"))
++ print("\n %s XMLFilePath CFilePath\n"%sys.argv[0])
+
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
+@@ -57,20 +57,20 @@ if __name__ == '__main__':
+ if fileIn != "" and fileOut != "":
+ manager = NodeManager()
+ if os.path.isfile(fileIn):
+- print _("Parsing input file")
++ print(_("Parsing input file"))
+ result = manager.OpenFileInCurrent(fileIn)
+- if not isinstance(result, (StringType, UnicodeType)):
++ if not isinstance(result, str):
+ Node = result
+ else:
+- print result
++ print(result)
+ sys.exit(-1)
+ else:
+- print _("%s is not a valid file!")%fileIn
++ print(_("%s is not a valid file!")%fileIn)
+ sys.exit(-1)
+- print _("Writing output file")
++ print(_("Writing output file"))
+ result = manager.ExportCurrentToCFile(fileOut)
+- if isinstance(result, (UnicodeType, StringType)):
+- print result
++ if isinstance(result, str):
++ print(result)
+ sys.exit(-1)
+- print _("All done")
++ print(_("All done"))
+
diff --git a/patches/canfestival-3+hg20180126.794/series b/patches/canfestival-3+hg20180126.794/series
index 73f9b660f..06183b8a7 100644
--- a/patches/canfestival-3+hg20180126.794/series
+++ b/patches/canfestival-3+hg20180126.794/series
@@ -5,4 +5,6 @@
0003-Makefile.in-fix-suffix-rules.patch
0004-let-canfestival.h-include-config.h.patch
0005-Use-include-.-instead-of-include-.-for-own-files.patch
-# 3c7ac338090e2d1acca872cb33f8371f - git-ptx-patches magic
+0007-gnosis-port-to-python3.patch
+0008-port-to-python3.patch
+# c4e00d98381c6fe694a31333755e24e4 - git-ptx-patches magic
diff --git a/patches/aumix-2.9.1/autogen.sh b/patches/canutils-v2021.06.0/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/aumix-2.9.1/autogen.sh
+++ b/patches/canutils-v2021.06.0/autogen.sh
diff --git a/patches/cbmbasic/0001-Add-IOBASE-and-pseudo-timer-will-give-RND-functional.patch b/patches/cbmbasic/0001-Add-IOBASE-and-pseudo-timer-will-give-RND-functional.patch
deleted file mode 100644
index f455d0a14..000000000
--- a/patches/cbmbasic/0001-Add-IOBASE-and-pseudo-timer-will-give-RND-functional.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From: Wolfram Sang <ninja@the-dreams.de>
-Date: Sat, 29 Oct 2011 19:01:11 +0200
-Subject: [PATCH] Add IOBASE and pseudo-timer (will give RND-functionality)
-
-Signed-off-by: Wolfram Sang <ninja@the-dreams.de>
-
-# ---
-# 20091210 rsc: check if there is another upstream version
-# 20081127 wsa: already sent mainline and accepted.
----
- runtime.c | 14 ++++++++++++--
- 1 files changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/runtime.c b/runtime.c
-index 454000e..2c3c54b 100644
---- a/runtime.c
-+++ b/runtime.c
-@@ -29,6 +29,7 @@
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-+#include <time.h>
-
- unsigned char RAM[65536];
-
-@@ -155,6 +156,7 @@ init_os(int argc, char **argv) {
- interactive = 1;
- f = NULL;
- }
-+ srand(time(NULL));
- }
-
- static void
-@@ -565,8 +567,16 @@ PLOT() {
- /* IOBASE */
- static void
- IOBASE() {
-- printf("UNIMPL: IOBASE\n");
-- exit(1);
-+ /*
-+ * IOBASE is just used inside RND to get a timer value.
-+ * So, let's fake this here, too.
-+ */
-+ int pseudo_timer = rand();
-+ RAM[0xDC04] = pseudo_timer&0xff;
-+ RAM[0xDC05] = pseudo_timer>>8;
-+
-+ X = 0x00;
-+ Y = 0xDC;
- }
-
- int
diff --git a/patches/cbmbasic/series b/patches/cbmbasic/series
deleted file mode 100644
index 24a3eeb8f..000000000
--- a/patches/cbmbasic/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Add-IOBASE-and-pseudo-timer-will-give-RND-functional.patch
-# 92d915f4b4aaf53608a652ac1eeddc42 - git-ptx-patches magic
diff --git a/patches/cgic205/0001-Makefile-add-possibility-to-cross-compile.patch b/patches/cgic205/0001-Makefile-add-possibility-to-cross-compile.patch
deleted file mode 100644
index a6479e17a..000000000
--- a/patches/cgic205/0001-Makefile-add-possibility-to-cross-compile.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From: Marc Kleine-Budde <mkl@pengutronixd.de>
-Date: Wed, 2 May 2012 13:21:27 +0200
-Subject: [PATCH] Makefile: add possibility to cross compile
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- Makefile | 21 +++++++++++++--------
- 1 files changed, 13 insertions(+), 8 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index ad782bb..080aa23 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1,21 +1,26 @@
--CFLAGS=-g -Wall
--CC=gcc
-+CFLAGS+=-g -O2 -Wall
- AR=ar
- RANLIB=ranlib
- LIBS=-L./ -lcgic
-+PREFIX=/usr/local
-
--all: libcgic.a cgictest.cgi capture
-+all: libcgic.a libcgic.so.2.05
-
- install: libcgic.a
-- cp libcgic.a /usr/local/lib
-- cp cgic.h /usr/local/include
-- @echo libcgic.a is in /usr/local/lib. cgic.h is in /usr/local/include.
-+ cp libcgic.a libcgic.so.2.05 $(DESTDIR)$(PREFIX)/lib
-+ cp cgic.h $(DESTDIR)$(PREFIX)/include
-+ @echo libcgic.a is in $(PREFIX)/lib. cgic.h is in $(PREFIX)/include.
-
--libcgic.a: cgic.o cgic.h
-+libcgic.a: cgic.c cgic.h
- rm -f libcgic.a
-+ $(CC) $(CFLAGS) -D_REENTRANT -pipe -c cgic.c -o cgic.o
- $(AR) rc libcgic.a cgic.o
- $(RANLIB) libcgic.a
-
-+libcgic.so.2.05: cgic.c cgic.h
-+ $(CC) $(CFLAGS) -D_REENTRANT -fPIC -pipe -c cgic.c -o cgic.o
-+ $(CC) -shared -Wl,-soname,libcgic.so.2 -o libcgic.so.2.05 cgic.o -lc
-+
- #mingw32 and cygwin users: replace .cgi with .exe
-
- cgictest.cgi: cgictest.o libcgic.a
-@@ -25,5 +30,5 @@ capture: capture.o libcgic.a
- gcc capture.o -o capture ${LIBS}
-
- clean:
-- rm -f *.o *.a cgictest.cgi capture
-+ rm -f *.o *.a *.so.* cgictest.cgi capture
-
diff --git a/patches/cgic205/series b/patches/cgic205/series
deleted file mode 100644
index c3a68898f..000000000
--- a/patches/cgic205/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Makefile-add-possibility-to-cross-compile.patch
-# e802bf5fd4e0844a492fbaa8bd49d556 - git-ptx-patches magic
diff --git a/patches/chrony-3.5/0001-configure-make-unrecognized-option-a-fatal-error.patch b/patches/chrony-4.5/0001-configure-make-unrecognized-option-a-fatal-error.patch
index 01f213633..c7b762015 100644
--- a/patches/chrony-3.5/0001-configure-make-unrecognized-option-a-fatal-error.patch
+++ b/patches/chrony-4.5/0001-configure-make-unrecognized-option-a-fatal-error.patch
@@ -12,10 +12,10 @@ Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
1 file changed, 1 insertion(+)
diff --git a/configure b/configure
-index 323f5743cd57..080f7bce746d 100755
+index eefe5de82cb6..000021624709 100755
--- a/configure
+++ b/configure
-@@ -388,6 +388,7 @@ do
+@@ -410,6 +410,7 @@ do
;;
* )
echo "Unrecognized option : " $option
diff --git a/patches/chrony-3.5/series b/patches/chrony-4.5/series
index 501972558..501972558 100644
--- a/patches/chrony-3.5/series
+++ b/patches/chrony-4.5/series
diff --git a/patches/cku302/0003-add-missing-includes.patch b/patches/cku302/0003-add-missing-includes.patch
new file mode 100644
index 000000000..aef003a0c
--- /dev/null
+++ b/patches/cku302/0003-add-missing-includes.patch
@@ -0,0 +1,73 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 20 May 2024 16:09:59 +0200
+Subject: [PATCH] add missing includes
+
+Taken from Fedora.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ ckcmai.c | 4 ++++
+ ckupty.c | 4 ++++
+ ckutio.c | 4 ++++
+ ckuusx.c | 3 +++
+ 4 files changed, 15 insertions(+)
+
+diff --git a/ckcmai.c b/ckcmai.c
+index a5640e511584..f65d0a095a7a 100644
+--- a/ckcmai.c
++++ b/ckcmai.c
+@@ -1581,6 +1581,10 @@ _PROTOTYP( int getiobs, (VOID) );
+
+ #include <signal.h>
+
++#ifndef VMS
++#include <time.h>
++#endif
++
+ #ifndef NOCCTRAP
+ #include <setjmp.h>
+ #include "ckcsig.h"
+diff --git a/ckupty.c b/ckupty.c
+index 9906555a7ff6..8e0476ba6603 100644
+--- a/ckupty.c
++++ b/ckupty.c
+@@ -384,6 +384,10 @@ struct termbuf {
+
+ #endif /* TCSANOW */
+
++#ifdef HAVE_OPENPTY
++#include <pty.h>
++#endif
++
+ struct termios termbuf, termbuf2; /* pty control structure */
+
+ #ifdef INIT_SPTY
+diff --git a/ckutio.c b/ckutio.c
+index 05564deab32a..0d79e0cae3b4 100644
+--- a/ckutio.c
++++ b/ckutio.c
+@@ -14129,6 +14129,10 @@ extern int exp_handler, exp_stderr, exp_timo;
+ #endif /* USE_CKUPTY_C */
+ #endif /* HAVE_OPENPTY */
+
++#ifdef HAVE_OPENPTY
++#include <pty.h>
++#endif
++
+ VOID
+ pty_make_raw(fd) int fd; {
+ int x = -23, i;
+diff --git a/ckuusx.c b/ckuusx.c
+index d332bed813b7..82c1c9cc674a 100644
+--- a/ckuusx.c
++++ b/ckuusx.c
+@@ -5883,6 +5883,9 @@ _PROTOTYP(char *tgetstr,(char *, char **));
+ _PROTOTYP(int tputs,(char *, int, int (*)()));
+ _PROTOTYP(char *tgoto,(const char *, int, int));
+ #endif /* BUG999 */
++#ifdef linux
++#include <term.h>
++#endif
+
+ #endif /* CK_CURSES */
+
diff --git a/patches/cku302/series b/patches/cku302/series
index 09a7e0b01..b9ec13cae 100644
--- a/patches/cku302/series
+++ b/patches/cku302/series
@@ -2,4 +2,5 @@
#tag:base --start-number 1
0001-add-variable-to-allow-external-wart.patch
0002-Fix-build-with-glibc-2.28.patch
-# 86a9b3d8158aaa73154db330e5778b0f - git-ptx-patches magic
+0003-add-missing-includes.patch
+# 16d28b3b3d5e29b754d8d2052762c514 - git-ptx-patches magic
diff --git a/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch b/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
deleted file mode 100644
index 656eb3c70..000000000
--- a/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From: =?UTF-8?q?Guillermo=20Rodr=C3=ADguez?= <guille.rodriguez@gmail.com>
-Date: Thu, 22 Nov 2018 06:44:55 +0100
-Subject: [PATCH] Fix building with OpenJDK 1.8
-
-This patch makes it possible to build GNU Classpath using javac
-from OpenJDK 1.7 and 1.8.
-
-- From the javac docs: "Classes found through the classpath are
-subject to automatic recompilation if their sources are found."
-javac from OpenJDK 1.7+ will try (and fail) to recompile "standard"
-Java classes (e.g. java/lang/Object.java) when compiling the Java
-test class. Fix this by explicitly passing an empty -sourcepath.
-
-- Use -source/-target 1.6 instead of 1.5, as the latter is
-deprecated in Java 8.
----
- examples/Makefile.am | 4 ++--
- lib/Makefile.am | 4 ++--
- m4/ac_prog_java_works.m4 | 3 ++-
- m4/ac_prog_javac_works.m4 | 4 ++--
- tools/Makefile.am | 4 ++--
- 5 files changed, 10 insertions(+), 9 deletions(-)
-
-diff --git a/examples/Makefile.am b/examples/Makefile.am
-index ff47801247c9..ba40c08747b8 100644
---- a/examples/Makefile.am
-+++ b/examples/Makefile.am
-@@ -2,9 +2,9 @@
- GLIBJ_CLASSPATH='$(top_builddir)/lib/glibj.zip:$(top_builddir)/lib'
-
- if GCJ_JAVAC
--JCOMPILER = $(JAVAC) $(JAVACFLAGS) -fsource=1.5 -ftarget=1.5 --encoding=UTF-8 --bootclasspath=$(GLIBJ_CLASSPATH) --classpath='$(top_builddir)/tools/tools.zip'
-+JCOMPILER = $(JAVAC) $(JAVACFLAGS) -fsource=1.6 -ftarget=1.6 --encoding=UTF-8 --bootclasspath=$(GLIBJ_CLASSPATH) --classpath='$(top_builddir)/tools/tools.zip'
- else
--JCOMPILER = $(JAVAC) $(JAVACFLAGS) -source 1.5 -target 1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath '$(top_builddir)/tools/tools.zip'
-+JCOMPILER = $(JAVAC) $(JAVACFLAGS) -source 1.6 -target 1.6 -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath '$(top_builddir)/tools/tools.zip'
- endif
-
- # All our example java source files
-diff --git a/lib/Makefile.am b/lib/Makefile.am
-index 50d1baa9b738..97a8b692692c 100644
---- a/lib/Makefile.am
-+++ b/lib/Makefile.am
-@@ -9,9 +9,9 @@ compile_classpath = $(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$
-
- # handling source to bytecode compiler programs like gcj, jikes and kjc
- if GCJ_JAVAC
--JCOMPILER = $(JAVAC) $(JAVACFLAGS) -fsource=1.5 -ftarget=1.5 --bootclasspath='' --classpath=$(compile_classpath) -d . @classes
-+JCOMPILER = $(JAVAC) $(JAVACFLAGS) -fsource=1.6 -ftarget=1.6 --bootclasspath='' --classpath=$(compile_classpath) -d . @classes
- else
--JCOMPILER = $(JAVAC) $(JAVACFLAGS) $(JAVAC_MEM_OPT) -source 1.5 -target 1.5 -bootclasspath '' -classpath $(compile_classpath) -d . @classes
-+JCOMPILER = $(JAVAC) $(JAVACFLAGS) $(JAVAC_MEM_OPT) -source 1.6 -target 1.6 -bootclasspath '' -classpath $(compile_classpath) -d . @classes
- endif
-
- if CREATE_COLLECTIONS
-diff --git a/m4/ac_prog_java_works.m4 b/m4/ac_prog_java_works.m4
-index d3f274478d09..f36318ba1c9f 100644
---- a/m4/ac_prog_java_works.m4
-+++ b/m4/ac_prog_java_works.m4
-@@ -62,7 +62,8 @@ EOF
- changequote([, ])dnl
- if test x$ac_cv_prog_uudecode_base64 != xyes; then
- AC_REQUIRE([AC_PROG_JAVAC_WORKS])
-- if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
-+ CMD="$JAVAC $JAVACFLAGS -sourcepath '' $JAVA_TEST"
-+ if AC_TRY_COMMAND($CMD) && test -s $CLASS_TEST; then
- :
- else
- echo "configure: failed program was:" >&AC_FD_CC
-diff --git a/m4/ac_prog_javac_works.m4 b/m4/ac_prog_javac_works.m4
-index 7fb298d49be5..fbe24ce60f25 100644
---- a/m4/ac_prog_javac_works.m4
-+++ b/m4/ac_prog_javac_works.m4
-@@ -33,9 +33,9 @@ public class Object
- }
- EOF
- if test x$JAVAC_IS_GCJ = xyes; then
-- CMD="$JAVAC $JAVACFLAGS -fsource=1.5 -ftarget=1.5 $JAVA_TEST"
-+ CMD="$JAVAC $JAVACFLAGS -fsource=1.6 -ftarget=1.6 $JAVA_TEST"
- else
-- CMD="$JAVAC $JAVACFLAGS -source 1.5 -target 1.5 $JAVA_TEST"
-+ CMD="$JAVAC $JAVACFLAGS -sourcepath '' -source 1.6 -target 1.6 $JAVA_TEST"
- fi
- if AC_TRY_COMMAND($CMD) >/dev/null 2>&1; then
- ac_cv_prog_javac_works=yes
-diff --git a/tools/Makefile.am b/tools/Makefile.am
-index c5db7cd0ada4..54cd2ceab5ed 100755
---- a/tools/Makefile.am
-+++ b/tools/Makefile.am
-@@ -14,9 +14,9 @@ GLIBJ_CLASSPATH=asm:$(ANTLR_CLASSPATH)
-
- # Setup the compiler to use the GNU Classpath library we just built.
- if GCJ_JAVAC
--JCOMPILER = $(JAVAC) $(JAVACFLAGS) -fsource=1.5 -ftarget=1.5 --encoding=UTF-8 --bootclasspath=$(GLIBJ_BOOTCLASSPATH) --classpath=$(GLIBJ_CLASSPATH)
-+JCOMPILER = $(JAVAC) $(JAVACFLAGS) -fsource=1.6 -ftarget=1.6 --encoding=UTF-8 --bootclasspath=$(GLIBJ_BOOTCLASSPATH) --classpath=$(GLIBJ_CLASSPATH)
- else
--JCOMPILER = $(JAVAC) $(JAVACFLAGS) -source 1.5 -target 1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath $(GLIBJ_CLASSPATH)
-+JCOMPILER = $(JAVAC) $(JAVACFLAGS) -source 1.6 -target 1.6 -encoding UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath $(GLIBJ_CLASSPATH)
- endif
-
- if CREATE_WRAPPERS
diff --git a/patches/classpath-0.99/0002-Fix-unmappable-character-error.patch b/patches/classpath-0.99/0002-Fix-unmappable-character-error.patch
deleted file mode 100644
index 1427ea3c1..000000000
--- a/patches/classpath-0.99/0002-Fix-unmappable-character-error.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: =?UTF-8?q?Guillermo=20Rodr=C3=ADguez?= <guille.rodriguez@gmail.com>
-Date: Thu, 22 Nov 2018 06:44:55 +0100
-Subject: [PATCH] Fix unmappable character error
-
-Fix unmappable character to make it possible to build when
-default locale is not UTF-8.
----
- java/util/regex/Matcher.java | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/java/util/regex/Matcher.java b/java/util/regex/Matcher.java
-index 8d033d5e3160..584d9a4f8c8e 100644
---- a/java/util/regex/Matcher.java
-+++ b/java/util/regex/Matcher.java
-@@ -620,7 +620,7 @@ public final class Matcher implements MatchResult
- *
- * @param s the string to literalize.
- * @return the literalized string.
-- * @since 1.5
-+ * @since 1.5
- */
- public static String quoteReplacement(String s)
- {
diff --git a/patches/classpath-0.99/autogen.sh b/patches/classpath-0.99/autogen.sh
deleted file mode 100755
index 9ca025f61..000000000
--- a/patches/classpath-0.99/autogen.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-exec ./autogen.sh
diff --git a/patches/classpath-0.99/series b/patches/classpath-0.99/series
deleted file mode 100644
index e43938734..000000000
--- a/patches/classpath-0.99/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Fix-building-with-OpenJDK-1.8.patch
-0002-Fix-unmappable-character-error.patch
-# 3ac111393d482d13349d5b5141d89368 - git-ptx-patches magic
diff --git a/patches/cog-0.8.1/0001-CMake-install-D-Bus-policy-configuration-to-CMAKE_IN.patch b/patches/cog-0.8.1/0001-CMake-install-D-Bus-policy-configuration-to-CMAKE_IN.patch
deleted file mode 100644
index 9f2a19009..000000000
--- a/patches/cog-0.8.1/0001-CMake-install-D-Bus-policy-configuration-to-CMAKE_IN.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Bastian Krause <bst@pengutronix.de>
-Date: Wed, 14 Apr 2021 17:36:24 +0200
-Subject: [PATCH] CMake: install D-Bus policy configuration to
- CMAKE_INSTALL_DATADIR
-
-The D-BUS system bus policy config should reside in
-CMAKE_INSTALL_DATADIR rather than in CMAKE_INSTALL_SYSCONFDIR.
-
-See:
-
- https://gitlab.freedesktop.org/dbus/dbus/-/blob/ef55a3db0d8f17848f8a579092fb05900cc076f5/bus/CMakeLists.txt#L117
-
-Forwarded: https://github.com/Igalia/cog/pull/296
-Signed-off-by: Bastian Krause <bst@pengutronix.de>
----
- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index cb51087359fc..2fcd63845212 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -157,7 +157,7 @@ if (COG_DBUS_SYSTEM_BUS)
- configure_file(dbus/policy.conf.in ${COG_DEFAULT_APPID}.conf @ONLY)
- install(
- FILES ${CMAKE_CURRENT_BINARY_DIR}/${COG_DEFAULT_APPID}.conf
-- DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/dbus-1/system.d
-+ DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/system.d
- COMPONENT "runtime"
- )
-
diff --git a/patches/cog-0.8.1/series b/patches/cog-0.8.1/series
deleted file mode 100644
index 14639312e..000000000
--- a/patches/cog-0.8.1/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-CMake-install-D-Bus-policy-configuration-to-CMAKE_IN.patch
-# a7cfa1be71dd856d687d8a3863e5a56f - git-ptx-patches magic
diff --git a/patches/bayer2rgb3-0.4.1/autogen.sh b/patches/cpputest-3.8/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/bayer2rgb3-0.4.1/autogen.sh
+++ b/patches/cpputest-3.8/autogen.sh
diff --git a/patches/crda-3.18/0001-fix-linking-libreg.patch b/patches/crda-4.15/0001-fix-linking-libreg.patch
index 8eae90bd3..6b566ba04 100644
--- a/patches/crda-3.18/0001-fix-linking-libreg.patch
+++ b/patches/crda-4.15/0001-fix-linking-libreg.patch
@@ -9,7 +9,7 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
-index a3ead30371c9..2f485724c3be 100644
+index 6ca26f341dfa..832399dea8db 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ CFLAGS += -std=gnu99 -Wall -Werror -pedantic
@@ -39,10 +39,10 @@ index a3ead30371c9..2f485724c3be 100644
@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
- $(LIBREG): regdb.h reglib.h reglib.c
+ $(LIBREG): reglib.c regdb.h reglib.h
$(NQ) ' CC ' $@
-- $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^
-+ $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLIBS)
+- $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $<
++ $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $< $(LIBREGLIBS)
install-libreg-headers:
$(NQ) ' INSTALL libreg-headers'
diff --git a/patches/crda-3.18/0002-Do-not-run-ldconfig-if-DESTDIR-is-set.patch b/patches/crda-4.15/0002-Do-not-run-ldconfig-if-DESTDIR-is-set.patch
index fac346892..8f40e0a89 100644
--- a/patches/crda-3.18/0002-Do-not-run-ldconfig-if-DESTDIR-is-set.patch
+++ b/patches/crda-4.15/0002-Do-not-run-ldconfig-if-DESTDIR-is-set.patch
@@ -8,13 +8,13 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 2 insertions(+)
diff --git a/Makefile b/Makefile
-index 2f485724c3be..b74d3b544bd9 100644
+index 832399dea8db..4ba2ed5aadd8 100644
--- a/Makefile
+++ b/Makefile
@@ -127,7 +127,9 @@ install-libreg:
$(NQ) ' INSTALL libreg'
$(Q)mkdir -p $(DESTDIR)/$(LIBDIR)
- $(Q)cp $(LIBREG) $(DESTDIR)/$(LIBDIR)/
+ $(Q)$(INSTALL) -m 644 $(LIBREG) $(DESTDIR)/$(LIBDIR)/
+ifndef DESTDIR
$(Q)ldconfig
+endif
diff --git a/patches/crda-3.18/0003-Allow-build-without-embedding-pubkey-data-into-crda-.patch b/patches/crda-4.15/0003-Allow-build-without-embedding-pubkey-data-into-crda-.patch
index 5a55618e6..a5b9fb9f3 100644
--- a/patches/crda-3.18/0003-Allow-build-without-embedding-pubkey-data-into-crda-.patch
+++ b/patches/crda-4.15/0003-Allow-build-without-embedding-pubkey-data-into-crda-.patch
@@ -10,7 +10,7 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
-index b74d3b544bd9..9ce318484001 100644
+index 4ba2ed5aadd8..8f45630296d7 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,12 @@ ifeq ($(USE_OPENSSL),1)
@@ -27,7 +27,7 @@ index b74d3b544bd9..9ce318484001 100644
else
CFLAGS += -DUSE_GCRYPT
diff --git a/reglib.c b/reglib.c
-index e00e9b8d4b44..87691022f9e7 100644
+index 4dee40151bd6..6f1edec4e154 100644
--- a/reglib.c
+++ b/reglib.c
@@ -30,7 +30,7 @@
diff --git a/patches/crda-3.18/0004-udev-Fix-rule-for-initial-setup.patch b/patches/crda-4.15/0004-udev-Fix-rule-for-initial-setup.patch
index 551b84bf6..551b84bf6 100644
--- a/patches/crda-3.18/0004-udev-Fix-rule-for-initial-setup.patch
+++ b/patches/crda-4.15/0004-udev-Fix-rule-for-initial-setup.patch
diff --git a/patches/crda-3.18/series b/patches/crda-4.15/series
index fdaa19478..fdaa19478 100644
--- a/patches/crda-3.18/series
+++ b/patches/crda-4.15/series
diff --git a/patches/cryptodev-linux-1.13/0001-zero-copy-Fix-build-for-Linux-6.4.patch b/patches/cryptodev-linux-1.13/0001-zero-copy-Fix-build-for-Linux-6.4.patch
new file mode 100644
index 000000000..e63e12bd7
--- /dev/null
+++ b/patches/cryptodev-linux-1.13/0001-zero-copy-Fix-build-for-Linux-6.4.patch
@@ -0,0 +1,33 @@
+From: Gaurav Jain <gaurav.jain@nxp.com>
+Date: Tue, 30 May 2023 17:09:42 +0530
+Subject: [PATCH] zero copy: Fix build for Linux 6.4
+
+get_user_pages_remote api prototype is changed in kernel.
+struct vm_area_struct **vmas argument is removed.
+Migrate to the new API.
+
+Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
+---
+ zc.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/zc.c b/zc.c
+index fdf7da17e2e1..6637945a9227 100644
+--- a/zc.c
++++ b/zc.c
+@@ -80,10 +80,14 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
+ ret = get_user_pages_remote(task, mm,
+ (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
+ pg, NULL, NULL);
+-#else
++#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
+ ret = get_user_pages_remote(mm,
+ (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
+ pg, NULL, NULL);
++#else
++ ret = get_user_pages_remote(mm,
++ (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
++ pg, NULL);
+ #endif
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
+ up_read(&mm->mmap_sem);
diff --git a/patches/cryptodev-linux-1.13/0002-cryptodev_verbosity-Fix-build-for-Linux-6.4.patch b/patches/cryptodev-linux-1.13/0002-cryptodev_verbosity-Fix-build-for-Linux-6.4.patch
new file mode 100644
index 000000000..4c11c5d0a
--- /dev/null
+++ b/patches/cryptodev-linux-1.13/0002-cryptodev_verbosity-Fix-build-for-Linux-6.4.patch
@@ -0,0 +1,40 @@
+From: Gaurav Jain <gaurav.jain@nxp.com>
+Date: Wed, 28 Jun 2023 12:44:32 +0530
+Subject: [PATCH] cryptodev_verbosity: Fix build for Linux 6.4
+
+register_sysctl_table api is removed in kernel.
+migrate to the new api register_sysctl.
+
+child is also removed in linux 6.4 ctl_table struct.
+
+Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
+---
+ ioctl.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/ioctl.c b/ioctl.c
+index 8f241b8678f6..4262bbd58acc 100644
+--- a/ioctl.c
++++ b/ioctl.c
+@@ -1246,7 +1246,9 @@ static struct ctl_table verbosity_ctl_root[] = {
+ {
+ .procname = "ioctl",
+ .mode = 0555,
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
+ .child = verbosity_ctl_dir,
++#endif
+ },
+ {},
+ };
+@@ -1267,7 +1269,11 @@ static int __init init_cryptodev(void)
+ return rc;
+ }
+
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
+ verbosity_sysctl_header = register_sysctl_table(verbosity_ctl_root);
++#else
++ verbosity_sysctl_header = register_sysctl(verbosity_ctl_root->procname, verbosity_ctl_dir);
++#endif
+
+ pr_info(PFX "driver %s loaded.\n", VERSION);
+
diff --git a/patches/cryptodev-linux-1.13/0003-Move-recent-Linux-version-ifdefs-from-v6.4-to-v6.5.patch b/patches/cryptodev-linux-1.13/0003-Move-recent-Linux-version-ifdefs-from-v6.4-to-v6.5.patch
new file mode 100644
index 000000000..7905e586f
--- /dev/null
+++ b/patches/cryptodev-linux-1.13/0003-Move-recent-Linux-version-ifdefs-from-v6.4-to-v6.5.patch
@@ -0,0 +1,59 @@
+From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
+Date: Mon, 3 Jul 2023 00:46:02 +0000
+Subject: [PATCH] Move recent Linux version #ifdefs from v6.4 to v6.5
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The latest commits, meant to fix the build on Linux 6.4, are actually
+fixing the build for API changes introduced in the merge window of the
+yet-unreleased Linux 6.5, and actually break the build for Linux 6.4.
+
+In particular, the upstream commits introducing the API changes are the
+following, which are *not* included in the Linux v6.4 tag:
+* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=19c4e618a1bc3d0cad1f04c857be8076cb05bbb2
+* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ca5e863233e8f6acd1792fd85d6bc2729a1b2c10
+
+Change to #ifdef's to v6.5, where they will most likely be included.
+
+Signed-off-by: Joan Bruguera Micó <joanbrugueram@gmail.com>
+---
+ ioctl.c | 4 ++--
+ zc.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ioctl.c b/ioctl.c
+index 4262bbd58acc..e3eefe112914 100644
+--- a/ioctl.c
++++ b/ioctl.c
+@@ -1246,7 +1246,7 @@ static struct ctl_table verbosity_ctl_root[] = {
+ {
+ .procname = "ioctl",
+ .mode = 0555,
+-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0))
+ .child = verbosity_ctl_dir,
+ #endif
+ },
+@@ -1269,7 +1269,7 @@ static int __init init_cryptodev(void)
+ return rc;
+ }
+
+-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0))
+ verbosity_sysctl_header = register_sysctl_table(verbosity_ctl_root);
+ #else
+ verbosity_sysctl_header = register_sysctl(verbosity_ctl_root->procname, verbosity_ctl_dir);
+diff --git a/zc.c b/zc.c
+index 6637945a9227..00e00c13e5fc 100644
+--- a/zc.c
++++ b/zc.c
+@@ -80,7 +80,7 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
+ ret = get_user_pages_remote(task, mm,
+ (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
+ pg, NULL, NULL);
+-#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
++#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0))
+ ret = get_user_pages_remote(mm,
+ (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
+ pg, NULL, NULL);
diff --git a/patches/cryptodev-linux-1.13/0004-Fix-build-for-Linux-6.7-rc1.patch b/patches/cryptodev-linux-1.13/0004-Fix-build-for-Linux-6.7-rc1.patch
new file mode 100644
index 000000000..07de5d4d2
--- /dev/null
+++ b/patches/cryptodev-linux-1.13/0004-Fix-build-for-Linux-6.7-rc1.patch
@@ -0,0 +1,34 @@
+From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
+Date: Sun, 10 Dec 2023 13:57:55 +0000
+Subject: [PATCH] Fix build for Linux 6.7-rc1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since Linux 6.7-rc1, no ahash algorithms set a nonzero alignmask,
+and therefore `crypto_ahash_alignmask` has been removed.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0f8660c82b79af595b056f6b9f4f227edeb88574
+ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c626910f3f1bbce6ad18bc613d895d2a089ed95e
+
+Signed-off-by: Joan Bruguera Micó <joanbrugueram@gmail.com>
+---
+ cryptlib.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/cryptlib.c b/cryptlib.c
+index 4d739e535f44..0e59d4cd96b8 100644
+--- a/cryptlib.c
++++ b/cryptlib.c
+@@ -381,7 +381,11 @@ int cryptodev_hash_init(struct hash_data *hdata, const char *alg_name,
+ }
+
+ hdata->digestsize = crypto_ahash_digestsize(hdata->async.s);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0))
+ hdata->alignmask = crypto_ahash_alignmask(hdata->async.s);
++#else
++ hdata->alignmask = 0;
++#endif
+
+ init_completion(&hdata->async.result.completion);
+
diff --git a/patches/cryptodev-linux-1.13/series b/patches/cryptodev-linux-1.13/series
new file mode 100644
index 000000000..41b308456
--- /dev/null
+++ b/patches/cryptodev-linux-1.13/series
@@ -0,0 +1,7 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-zero-copy-Fix-build-for-Linux-6.4.patch
+0002-cryptodev_verbosity-Fix-build-for-Linux-6.4.patch
+0003-Move-recent-Linux-version-ifdefs-from-v6.4-to-v6.5.patch
+0004-Fix-build-for-Linux-6.7-rc1.patch
+# 19e654e3a0d17c03488aa9ea5adc09e5 - git-ptx-patches magic
diff --git a/patches/dbus-1.15.8/0001-HACK-meson_post_install.py-don-t-try-to-change-owner.patch b/patches/dbus-1.15.8/0001-HACK-meson_post_install.py-don-t-try-to-change-owner.patch
new file mode 100644
index 000000000..971cab3c3
--- /dev/null
+++ b/patches/dbus-1.15.8/0001-HACK-meson_post_install.py-don-t-try-to-change-owner.patch
@@ -0,0 +1,25 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 8 Dec 2023 18:12:20 +0100
+Subject: [PATCH] HACK: meson_post_install.py: don't try to change
+ owner/permissions for dbus-daemon-launch-helper
+
+This tries to get the uid from the build host. This can fail if the user
+is missing or produces an incorrect uid.
+This is not needed here anyways because ptxdist explicitly sets the
+correct owner/permissions during targetinstall.
+So just skip this during install.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ meson_post_install.py | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/meson_post_install.py b/meson_post_install.py
+index cfc03b2219ff..1d007ad65e6e 100755
+--- a/meson_post_install.py
++++ b/meson_post_install.py
+@@ -103,4 +103,3 @@ def post_install_exe():
+
+ if __name__ == "__main__":
+ post_install_relocation()
+- post_install_exe()
diff --git a/patches/dbus-1.15.8/series b/patches/dbus-1.15.8/series
new file mode 100644
index 000000000..8f5dfcd4b
--- /dev/null
+++ b/patches/dbus-1.15.8/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-HACK-meson_post_install.py-don-t-try-to-change-owner.patch
+# f313c4305c590ba31dfcce93696743c2 - git-ptx-patches magic
diff --git a/patches/dhcp-4.4.2/0001-Fixed-gcc-10-compilation-issues.patch b/patches/dhcp-4.4.2/0001-Fixed-gcc-10-compilation-issues.patch
deleted file mode 100644
index f0e3cc450..000000000
--- a/patches/dhcp-4.4.2/0001-Fixed-gcc-10-compilation-issues.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From: Thomas Markwalder <tmark@isc.org>
-Date: Thu, 30 Jul 2020 10:01:36 -0400
-Subject: [PATCH] Fixed gcc 10 compilation issues
-
-client/dhclient.c
-relay/dhcrelay.c
- extern'ed local_port,remote_port
-
-common/discover.c
- init local_port,remote_port to 0
-
-server/mdb.c
- extern'ed dhcp_type_host
-
-server/mdb6.c
- create_prefix6() - eliminated memcpy string overflow error
-
-Origin: https://sources.debian.org/patches/isc-dhcp/4.4.1-2.2/Fixed_gcc_10_compilation_issues.patch/
----
- client/dhclient.c | 5 +++--
- relay/dhcrelay.c | 4 ++--
- server/mdb.c | 2 +-
- server/mdb6.c | 2 +-
- 4 files changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/client/dhclient.c b/client/dhclient.c
-index 189e527094e8..7a7837cb8152 100644
---- a/client/dhclient.c
-+++ b/client/dhclient.c
-@@ -83,8 +83,9 @@ static const char message [] = "Internet Systems Consortium DHCP Client";
- static const char url [] = "For info, please visit https://www.isc.org/software/dhcp/";
- #endif /* UNIT_TEST */
-
--u_int16_t local_port = 0;
--u_int16_t remote_port = 0;
-+extern u_int16_t local_port;
-+extern u_int16_t remote_port;
-+
- #if defined(DHCPv6) && defined(DHCP4o6)
- int dhcp4o6_state = -1; /* -1 = stopped, 0 = polling, 1 = started */
- #endif
-diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c
-index 883d5058f2ee..7211e3bbbec9 100644
---- a/relay/dhcrelay.c
-+++ b/relay/dhcrelay.c
-@@ -95,8 +95,8 @@ enum { forward_and_append, /* Forward and append our own relay option. */
- forward_untouched, /* Forward without changes. */
- discard } agent_relay_mode = forward_and_replace;
-
--u_int16_t local_port;
--u_int16_t remote_port;
-+extern u_int16_t local_port;
-+extern u_int16_t remote_port;
-
- /* Relay agent server list. */
- struct server_list {
-diff --git a/server/mdb.c b/server/mdb.c
-index ff8a707fac1b..8266d76432b8 100644
---- a/server/mdb.c
-+++ b/server/mdb.c
-@@ -67,7 +67,7 @@ static host_id_info_t *host_id_info = NULL;
-
- int numclasseswritten;
-
--omapi_object_type_t *dhcp_type_host;
-+extern omapi_object_type_t *dhcp_type_host;
-
- isc_result_t enter_class(cd, dynamicp, commit)
- struct class *cd;
-diff --git a/server/mdb6.c b/server/mdb6.c
-index da7baf6e50df..ebe01e5607cb 100644
---- a/server/mdb6.c
-+++ b/server/mdb6.c
-@@ -1945,7 +1945,7 @@ create_prefix6(struct ipv6_pool *pool, struct iasubopt **pref,
- }
- new_ds.data = new_ds.buffer->data;
- memcpy(new_ds.buffer->data, ds.data, ds.len);
-- memcpy(new_ds.buffer->data + ds.len, &tmp, sizeof(tmp));
-+ memcpy(&new_ds.buffer->data[0] + ds.len, &tmp, sizeof(tmp));
- data_string_forget(&ds, MDL);
- data_string_copy(&ds, &new_ds, MDL);
- data_string_forget(&new_ds, MDL);
diff --git a/patches/dhcp-4.4.2/series b/patches/dhcp-4.4.2/series
deleted file mode 100644
index de5f31877..000000000
--- a/patches/dhcp-4.4.2/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Fixed-gcc-10-compilation-issues.patch
-# dd19bdbd49b780e973ed9392604d03fe - git-ptx-patches magic
diff --git a/patches/dnsmasq-2.81/0001-the-pkg-config-file-is-lua-no-lua5.2.patch b/patches/dnsmasq-2.89/0001-the-pkg-config-file-is-lua-no-lua5.2.patch
index c26cec2bb..ec0952173 100644
--- a/patches/dnsmasq-2.81/0001-the-pkg-config-file-is-lua-no-lua5.2.patch
+++ b/patches/dnsmasq-2.89/0001-the-pkg-config-file-is-lua-no-lua5.2.patch
@@ -8,7 +8,7 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
-index 78e25f053bf2..9511893615e3 100644
+index 48e8d3b40ee4..5c0e748280c7 100644
--- a/Makefile
+++ b/Makefile
@@ -60,8 +60,8 @@ idn2_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LIBIDN2 $(PKG_CONFI
@@ -19,6 +19,6 @@ index 78e25f053bf2..9511893615e3 100644
-lua_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua5.2`
+lua_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --cflags lua`
+lua_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua`
- nettle_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --cflags nettle hogweed`
- nettle_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --libs nettle hogweed`
- gmp_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC NO_GMP --copy -lgmp`
+ nettle_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --cflags 'nettle hogweed' \
+ HAVE_CRYPTOHASH $(PKG_CONFIG) --cflags nettle \
+ HAVE_NETTLEHASH $(PKG_CONFIG) --cflags nettle`
diff --git a/patches/dnsmasq-2.81/series b/patches/dnsmasq-2.89/series
index bdbf61ed5..bdbf61ed5 100644
--- a/patches/dnsmasq-2.81/series
+++ b/patches/dnsmasq-2.89/series
diff --git a/patches/dropwatch-1.5.3/0001-Fix-build-issue-when-compiling-with-Wcast-align.patch b/patches/dropwatch-1.5.3/0001-Fix-build-issue-when-compiling-with-Wcast-align.patch
deleted file mode 100644
index d63d0b18a..000000000
--- a/patches/dropwatch-1.5.3/0001-Fix-build-issue-when-compiling-with-Wcast-align.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Neil Horman <nhorman@tuxdriver.com>
-Date: Sat, 21 Mar 2020 07:22:29 -0400
-Subject: [PATCH] Fix build issue when compiling with -Wcast-align
-
-Passing a char buffer cast to struct nlmsghdr * violates the rules of
--Wcast-align on some arches, as described in :
-https://github.com/nhorman/dropwatch/issues/26
-
-Fix it by declaring the buffer as a struct nlmsghdr, and casting to a
-less alligned type
-
-Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
----
- src/main.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/main.c b/src/main.c
-index bd87085d7dc8..2253fc4eb8c1 100644
---- a/src/main.c
-+++ b/src/main.c
-@@ -267,7 +267,7 @@ int send_netlink_message(struct netlink_message *msg)
-
- struct netlink_message *recv_netlink_message(int *err)
- {
-- static unsigned char *buf;
-+ static struct nlmsghdr *buf;
- struct netlink_message *msg;
- struct genlmsghdr *glm;
- struct sockaddr_nl nla;
-@@ -277,7 +277,7 @@ struct netlink_message *recv_netlink_message(int *err)
- *err = 0;
-
- do {
-- rc = nl_recv(nsd, &nla, &buf, NULL);
-+ rc = nl_recv(nsd, &nla, (unsigned char **)&buf, NULL);
- if (rc < 0) {
- switch (errno) {
- case EINTR:
-@@ -294,7 +294,7 @@ struct netlink_message *recv_netlink_message(int *err)
- }
- } while (rc == 0);
-
-- msg = wrap_netlink_msg((struct nlmsghdr *)buf);
-+ msg = wrap_netlink_msg(buf);
-
- type = ((struct nlmsghdr *)msg->msg)->nlmsg_type;
-
diff --git a/patches/dropwatch-1.5.3/0002-Fix-configure-for-libnl3-genl.patch b/patches/dropwatch-1.5.3/0002-Fix-configure-for-libnl3-genl.patch
deleted file mode 100644
index 5c39d8201..000000000
--- a/patches/dropwatch-1.5.3/0002-Fix-configure-for-libnl3-genl.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From: Neil Horman <nhorman@tuxdriver.com>
-Date: Wed, 20 May 2020 07:08:47 -0400
-Subject: [PATCH] Fix configure for libnl3-genl
-
-Apparently, way back when we wrote the configure script, we included a
-package check for libnl, but not libnl3-genl (ostensibly because it
-didn't exist I think), and so we hardcoded linking to -lnl3-genl. The
-pkg-config file for that library exists now, so lets actually test for
-it during the running of configure, and use its output during make
-
-Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
----
- configure.ac | 1 +
- src/Makefile.am | 4 ++--
- 2 files changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index ad917022eb82..278da5479152 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -14,6 +14,7 @@ AC_PROG_AWK
- AC_CHECK_FUNCS(getopt_long)
-
- PKG_CHECK_MODULES([LIBNL3], [libnl-3.0], [], [AC_MSG_ERROR([libnl-3.0 is required])])
-+PKG_CHECK_MODULES([LIBNLG3], [libnl-genl-3.0], [], [AC_MSG_ERROR([libnl-genl-3.0 is required])])
- # Fallback on using -lreadline as readline.pc is only available since version 8.0
- PKG_CHECK_MODULES([READLINE], [readline], [], [READLINE_LIBS=-lreadline])
- PKG_CHECK_MODULES([LIBPCAP], [libpcap], [], [
-diff --git a/src/Makefile.am b/src/Makefile.am
-index a324fd36eb9e..f56a39dcf274 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -1,8 +1,8 @@
-
- bin_PROGRAMS = dropwatch dwdump
-
--AM_CFLAGS = -g -Wall -Werror $(LIBNL3_CFLAGS) $(READLINE_CFLAGS)
--AM_LDFLAGS = $(LIBNL3_LIBS) -lnl-genl-3 $(READLINE_LIBS) -lpcap
-+AM_CFLAGS = -g -Wall -Werror $(LIBNL3_CFLAGS) $(LIBNLG3_CFLAGS) $(READLINE_CFLAGS)
-+AM_LDFLAGS = $(LIBNL3_LIBS) $(LIBNLG3_LIBS) $(READLINE_LIBS) -lpcap
- AM_CPPFLAGS = -D_GNU_SOURCE
-
- dropwatch_SOURCES = main.c lookup.c lookup_kas.c
diff --git a/patches/dropwatch-1.5.3/series b/patches/dropwatch-1.5.3/series
deleted file mode 100644
index f3c5dd88d..000000000
--- a/patches/dropwatch-1.5.3/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Fix-build-issue-when-compiling-with-Wcast-align.patch
-0002-Fix-configure-for-libnl3-genl.patch
-# 68fccae5492fb3b53d1b549cfe32ed5f - git-ptx-patches magic
diff --git a/patches/bonnie++-1.97.3/autogen.sh b/patches/dropwatch-1.5.4/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/bonnie++-1.97.3/autogen.sh
+++ b/patches/dropwatch-1.5.4/autogen.sh
diff --git a/patches/dtc-v1.6.0/0001-fdtdump-Fix-gcc11-warning.patch b/patches/dtc-v1.6.0/0001-fdtdump-Fix-gcc11-warning.patch
deleted file mode 100644
index 052419940..000000000
--- a/patches/dtc-v1.6.0/0001-fdtdump-Fix-gcc11-warning.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: David Gibson <david@gibson.dropbear.id.au>
-Date: Wed, 6 Jan 2021 14:52:26 +1100
-Subject: [PATCH] fdtdump: Fix gcc11 warning
-
-In one place, fdtdump abuses fdt_set_magic(), passing it just a small char
-array instead of the full fdt header it expects. That's relying on the
-fact that in fact fdt_set_magic() will only actually access the first 4
-bytes of the buffer.
-
-This trips a new warning in GCC 11 - and it's entirely possible it was
-always UB. So, don't do that.
-
-Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
----
- fdtdump.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/fdtdump.c b/fdtdump.c
-index 9613befede71..d9fb374a59be 100644
---- a/fdtdump.c
-+++ b/fdtdump.c
-@@ -217,7 +217,7 @@ int main(int argc, char *argv[])
- char *p = buf;
- char *endp = buf + len;
-
-- fdt_set_magic(smagic, FDT_MAGIC);
-+ fdt32_st(smagic, FDT_MAGIC);
-
- /* poor man's memmem */
- while ((endp - p) >= FDT_MAGIC_SIZE) {
diff --git a/patches/dtc-v1.6.0/series b/patches/dtc-v1.6.0/series
deleted file mode 100644
index a7e9d0319..000000000
--- a/patches/dtc-v1.6.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-fdtdump-Fix-gcc11-warning.patch
-# cb5c26c7ab3ae2082ecff7af4de4e8c5 - git-ptx-patches magic
diff --git a/patches/e2fsprogs-1.47.0/0001-e2fsprogs-Disable-docs.patch b/patches/e2fsprogs-1.47.0/0001-e2fsprogs-Disable-docs.patch
new file mode 100644
index 000000000..38a8cc8eb
--- /dev/null
+++ b/patches/e2fsprogs-1.47.0/0001-e2fsprogs-Disable-docs.patch
@@ -0,0 +1,37 @@
+From: Christian Melki <christian.melki@t2data.com>
+Date: Thu, 9 Feb 2023 09:41:43 +0100
+Subject: [PATCH] e2fsprogs: Disable docs.
+
+Disable doc building and installing.
+
+Signed-off-by: Christian Melki <christian.melki@t2data.com>
+---
+ Makefile.in | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 79b71165002d..0b80c20d4858 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -35,7 +35,6 @@ TAR=tar
+ all:: subs
+ $(MAKE) libs
+ @ALL_CMT@ $(MAKE) progs
+-@ALL_CMT@ $(MAKE) docs
+
+ all-static::
+ $(MAKE) libs
+@@ -72,11 +71,11 @@ distclean-doc:
+ -test -d doc && cd doc && $(MAKE) distclean
+
+ install: subs all-libs-recursive install-progs-recursive \
+- install-shlibs-libs-recursive install-doc-libs
++ install-shlibs-libs-recursive
+ @SUBSET_CMT@ $(MAKE) install-libs
+
+ install-strip: subs all-libs-recursive install-strip-progs-recursive \
+- install-shlibs-strip-libs-recursive install-doc-libs
++ install-shlibs-strip-libs-recursive
+
+ uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
+
diff --git a/patches/e2fsprogs-1.47.0/0002-e2fsprogs-Disable-ldconfig.patch b/patches/e2fsprogs-1.47.0/0002-e2fsprogs-Disable-ldconfig.patch
new file mode 100644
index 000000000..100d5bc5e
--- /dev/null
+++ b/patches/e2fsprogs-1.47.0/0002-e2fsprogs-Disable-ldconfig.patch
@@ -0,0 +1,29 @@
+From: Christian Melki <christian.melki@t2data.com>
+Date: Thu, 9 Feb 2023 09:42:26 +0100
+Subject: [PATCH] e2fsprogs: Disable ldconfig.
+
+ldconfig on shlibs pokes files which are normally not
+accessible for non-root users.
+There are two ways to deal with this.
+1. Patch it, disabling the call.
+2. point ldconfig to something like ac_cv_path_LDCONFIG=true
+This patch inplements the former.
+
+Signed-off-by: Christian Melki <christian.melki@t2data.com>
+---
+ lib/Makefile.elf-lib | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/lib/Makefile.elf-lib b/lib/Makefile.elf-lib
+index f850f3ddb795..ea0bbde82b2f 100644
+--- a/lib/Makefile.elf-lib
++++ b/lib/Makefile.elf-lib
+@@ -50,8 +50,6 @@ install-shlibs install:: $(ELF_LIB) installdirs-elf-lib $(DEP_INSTALL_SYMLINK)
+ $(E) " SYMLINK $(libdir)/$(ELF_IMAGE).so"
+ $(Q) $(INSTALL_SYMLINK) $(ELF_INSTALL_DIR)/$(ELF_SONAME) \
+ $(libdir)/$(ELF_IMAGE).so $(DESTDIR)
+- $(E) " LDCONFIG"
+- $(Q) -$(LDCONFIG)
+
+ install-strip: install
+ $(E) " STRIP-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)"
diff --git a/patches/e2fsprogs-1.47.0/0003-mke2fs.conf-remove-orphan_file-from-ext4-features.patch b/patches/e2fsprogs-1.47.0/0003-mke2fs.conf-remove-orphan_file-from-ext4-features.patch
new file mode 100644
index 000000000..e401cad09
--- /dev/null
+++ b/patches/e2fsprogs-1.47.0/0003-mke2fs.conf-remove-orphan_file-from-ext4-features.patch
@@ -0,0 +1,39 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 22 Sep 2023 10:18:04 +0200
+Subject: [PATCH] mke2fs.conf: remove orphan_file from ext4 features
+
+It's a performance optimization for deleting files. This is usually not
+that important for embedded and the option causes problems during
+up/downgrading:
+
+If an ext4 image with orphan_file is installed in a system with an older
+e2fsprogs version, then resizing the filesystem to fill the partition
+will fail.
+
+If, during a downgrade, rootfs is created with orphan_file and then
+filled from a tarball, then booting into that system can fail because
+fsck does not work.
+
+So remove orphan_file from the config. With host-e2fsprogs, this file is
+used to generate images at build-time. With the target e2fsprogs package
+this file is installed. So in both cases above the filesystems are
+generated without orphan_file.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ misc/mke2fs.conf.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in
+index b7fc95df7acf..d1637f854e57 100644
+--- a/misc/mke2fs.conf.in
++++ b/misc/mke2fs.conf.in
+@@ -11,7 +11,7 @@
+ features = has_journal
+ }
+ ext4 = {
+- features = has_journal,extent,huge_file,flex_bg,metadata_csum,metadata_csum_seed,64bit,dir_nlink,extra_isize,orphan_file
++ features = has_journal,extent,huge_file,flex_bg,metadata_csum,metadata_csum_seed,64bit,dir_nlink,extra_isize
+ }
+ small = {
+ blocksize = 1024
diff --git a/patches/e2fsprogs-1.47.0/series b/patches/e2fsprogs-1.47.0/series
new file mode 100644
index 000000000..a4d897d2a
--- /dev/null
+++ b/patches/e2fsprogs-1.47.0/series
@@ -0,0 +1,6 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-e2fsprogs-Disable-docs.patch
+0002-e2fsprogs-Disable-ldconfig.patch
+0003-mke2fs.conf-remove-orphan_file-from-ext4-features.patch
+# 64efe4be705d81494b152b54654a13a5 - git-ptx-patches magic
diff --git a/patches/efivar-37/0001-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch b/patches/efivar-37/0001-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch
deleted file mode 100644
index 89e913a74..000000000
--- a/patches/efivar-37/0001-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From: Peter Jones <pjones@redhat.com>
-Date: Mon, 7 Jan 2019 10:30:59 -0500
-Subject: [PATCH] dp.h: make format_guid() handle misaligned guid pointers
- safely.
-
-GCC 9 adds -Werror=address-of-packed-member, which causes us to see the
-build error reported at
- https://bugzilla.opensuse.org/show_bug.cgi?id=1120862 .
-
-That bug report shows us the following:
-
-In file included from dp.c:26:
-dp.h: In function 'format_vendor_helper':
-dp.h:120:37: error: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Werror=address-of-packed-member]
- 120 | format_guid(buf, size, off, label, &dp->hw_vendor.vendor_guid);
- | ^~~~~~~~~~~~~~~~~~~~~~~~~~
-dp.h:74:25: note: in definition of macro 'format_guid'
- 74 | _rc = efi_guid_to_str(guid, &_guidstr); \
- | ^~~~
-cc1: all warnings being treated as errors
-
-This patch makes format_guid() use a local variable as a bounce buffer
-in the case that the guid we're passed is aligned as chaotic neutral.
-
-Note that this only fixes this instance and there may be others that bz
-didn't show because it exited too soon, and I don't have a gcc 9 build
-in front of me right now.
-
-Signed-off-by: Peter Jones <pjones@redhat.com>
----
- src/dp.h | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/src/dp.h b/src/dp.h
-index aa4e3902992d..20cb608d05f7 100644
---- a/src/dp.h
-+++ b/src/dp.h
-@@ -70,8 +70,15 @@
- #define format_guid(buf, size, off, dp_type, guid) ({ \
- int _rc; \
- char *_guidstr = NULL; \
-- \
-- _rc = efi_guid_to_str(guid, &_guidstr); \
-+ efi_guid_t _guid; \
-+ const efi_guid_t * const _guid_p = \
-+ likely(__alignof__(guid) == sizeof(guid)) \
-+ ? guid \
-+ : &_guid; \
-+ \
-+ if (unlikely(__alignof__(guid) == sizeof(guid))) \
-+ memmove(&_guid, guid, sizeof(_guid)); \
-+ _rc = efi_guid_to_str(_guid_p, &_guidstr); \
- if (_rc < 0) { \
- efi_error("could not build %s GUID DP string", \
- dp_type); \
diff --git a/patches/efivar-37/0002-Fix-all-the-places-Werror-address-of-packed-member-c.patch b/patches/efivar-37/0002-Fix-all-the-places-Werror-address-of-packed-member-c.patch
deleted file mode 100644
index 7653bd80a..000000000
--- a/patches/efivar-37/0002-Fix-all-the-places-Werror-address-of-packed-member-c.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From: Peter Jones <pjones@redhat.com>
-Date: Thu, 21 Feb 2019 15:20:12 -0500
-Subject: [PATCH] Fix all the places -Werror=address-of-packed-member catches.
-
-This gets rid of all the places GCC 9's -Werror=address-of-packed-member
-flags as problematic.
-
-Fixes github issue #123
-
-Signed-off-by: Peter Jones <pjones@redhat.com>
----
- src/dp-message.c | 6 ++++--
- src/dp.h | 12 ++++--------
- src/guid.c | 2 +-
- src/include/efivar/efivar.h | 2 +-
- src/ucs2.h | 27 +++++++++++++++++++--------
- 5 files changed, 29 insertions(+), 20 deletions(-)
-
-diff --git a/src/dp-message.c b/src/dp-message.c
-index 3724e5f57bdb..9f964663de86 100644
---- a/src/dp-message.c
-+++ b/src/dp-message.c
-@@ -620,11 +620,13 @@ _format_message_dn(char *buf, size_t size, const_efidp dp)
- ) / sizeof(efi_ip_addr_t);
- format(buf, size, off, "Dns", "Dns(");
- for (int i=0; i < end; i++) {
-- const efi_ip_addr_t *addr = &dp->dns.addrs[i];
-+ efi_ip_addr_t addr;
-+
-+ memcpy(&addr, &dp->dns.addrs[i], sizeof(addr));
- if (i != 0)
- format(buf, size, off, "Dns", ",");
- format_ip_addr(buf, size, off, "Dns",
-- dp->dns.is_ipv6, addr);
-+ dp->dns.is_ipv6, &addr);
- }
- format(buf, size, off, "Dns", ")");
- break;
-diff --git a/src/dp.h b/src/dp.h
-index 20cb608d05f7..1f921d524aaf 100644
---- a/src/dp.h
-+++ b/src/dp.h
-@@ -71,13 +71,9 @@
- int _rc; \
- char *_guidstr = NULL; \
- efi_guid_t _guid; \
-- const efi_guid_t * const _guid_p = \
-- likely(__alignof__(guid) == sizeof(guid)) \
-- ? guid \
-- : &_guid; \
-- \
-- if (unlikely(__alignof__(guid) == sizeof(guid))) \
-- memmove(&_guid, guid, sizeof(_guid)); \
-+ const efi_guid_t * const _guid_p = &_guid; \
-+ \
-+ memmove(&_guid, guid, sizeof(_guid)); \
- _rc = efi_guid_to_str(_guid_p, &_guidstr); \
- if (_rc < 0) { \
- efi_error("could not build %s GUID DP string", \
-@@ -86,7 +82,7 @@
- _guidstr = onstack(_guidstr, \
- strlen(_guidstr)+1); \
- _rc = format(buf, size, off, dp_type, "%s", \
-- _guidstr); \
-+ _guidstr); \
- } \
- _rc; \
- })
-diff --git a/src/guid.c b/src/guid.c
-index 306c9ff8287c..3156b3b7c60a 100644
---- a/src/guid.c
-+++ b/src/guid.c
-@@ -31,7 +31,7 @@
- extern const efi_guid_t efi_guid_zero;
-
- int NONNULL(1, 2) PUBLIC
--efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b)
-+efi_guid_cmp(const void * const a, const void * const b)
- {
- return memcmp(a, b, sizeof (efi_guid_t));
- }
-diff --git a/src/include/efivar/efivar.h b/src/include/efivar/efivar.h
-index 316891ccae9c..ad6449d9d938 100644
---- a/src/include/efivar/efivar.h
-+++ b/src/include/efivar/efivar.h
-@@ -128,7 +128,7 @@ extern int efi_symbol_to_guid(const char *symbol, efi_guid_t *guid)
-
- extern int efi_guid_is_zero(const efi_guid_t *guid);
- extern int efi_guid_is_empty(const efi_guid_t *guid);
--extern int efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b);
-+extern int efi_guid_cmp(const void * const a, const void * const b);
-
- /* import / export functions */
- typedef struct efi_variable efi_variable_t;
-diff --git a/src/ucs2.h b/src/ucs2.h
-index dbb59004b7c0..edd8367b4bcc 100644
---- a/src/ucs2.h
-+++ b/src/ucs2.h
-@@ -23,16 +23,21 @@
- (((val) & ((mask) << (shift))) >> (shift))
-
- static inline size_t UNUSED
--ucs2len(const uint16_t * const s, ssize_t limit)
-+ucs2len(const void *vs, ssize_t limit)
- {
- ssize_t i;
-- for (i = 0; i < (limit >= 0 ? limit : i+1) && s[i] != (uint16_t)0; i++)
-+ const uint16_t *s = vs;
-+ const uint8_t *s8 = vs;
-+
-+ for (i = 0;
-+ i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0;
-+ i++, s8 += 2, s++)
- ;
- return i;
- }
-
- static inline size_t UNUSED
--ucs2size(const uint16_t * const s, ssize_t limit)
-+ucs2size(const void *s, ssize_t limit)
- {
- size_t rc = ucs2len(s, limit);
- rc *= sizeof (uint16_t);
-@@ -69,10 +74,11 @@ utf8size(uint8_t *s, ssize_t limit)
- }
-
- static inline unsigned char * UNUSED
--ucs2_to_utf8(const uint16_t * const chars, ssize_t limit)
-+ucs2_to_utf8(const void * const voidchars, ssize_t limit)
- {
- ssize_t i, j;
- unsigned char *ret;
-+ const uint16_t * const chars = voidchars;
-
- if (limit < 0)
- limit = ucs2len(chars, -1);
-@@ -124,10 +130,12 @@ ucs2_to_utf8(const uint16_t * const chars, ssize_t limit)
- }
-
- static inline ssize_t UNUSED NONNULL(4)
--utf8_to_ucs2(uint16_t *ucs2, ssize_t size, int terminate, uint8_t *utf8)
-+utf8_to_ucs2(void *ucs2void, ssize_t size, int terminate, uint8_t *utf8)
- {
- ssize_t req;
- ssize_t i, j;
-+ uint16_t *ucs2 = ucs2void;
-+ uint16_t val16;
-
- if (!ucs2 && size > 0) {
- errno = EINVAL;
-@@ -162,10 +170,13 @@ utf8_to_ucs2(uint16_t *ucs2, ssize_t size, int terminate, uint8_t *utf8)
- val = utf8[i] & 0x7f;
- i += 1;
- }
-- ucs2[j] = val;
-+ val16 = val;
-+ ucs2[j] = val16;
-+ }
-+ if (terminate) {
-+ val16 = 0;
-+ ucs2[j++] = val16;
- }
-- if (terminate)
-- ucs2[j++] = (uint16_t)0;
- return j;
- };
-
diff --git a/patches/efivar-37/series b/patches/efivar-37/series
deleted file mode 100644
index e6f14fec2..000000000
--- a/patches/efivar-37/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch
-0002-Fix-all-the-places-Werror-address-of-packed-member-c.patch
-# cbb8f240dc2a442323107d34454fa178 - git-ptx-patches magic
diff --git a/patches/elfutils-0.180/autogen.sh b/patches/elfutils-0.180/autogen.sh
deleted file mode 100755
index df78c388b..000000000
--- a/patches/elfutils-0.180/autogen.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-set -e
-
-aclocal $ACLOCAL_FLAGS
-
-libtoolize \
- --force \
- --copy
-
-autoreconf \
- --force \
- --install \
- --warnings=cross \
- --warnings=syntax \
- --warnings=obsolete \
- --warnings=unsupported
-
diff --git a/patches/elfutils-0.180/series b/patches/elfutils-0.180/series
deleted file mode 100644
index 0ecd40a09..000000000
--- a/patches/elfutils-0.180/series
+++ /dev/null
@@ -1,2 +0,0 @@
-0001-disable-Werror-as-it-tends-to-break-with-new-gcc-ver.patch
-0002-riscv-retval-workaround.patch
diff --git a/patches/elfutils-0.180/0001-disable-Werror-as-it-tends-to-break-with-new-gcc-ver.patch b/patches/elfutils-0.190/0001-disable-Werror-as-it-tends-to-break-with-new-gcc-ver.patch
index 18820595a..c9955f19c 100644
--- a/patches/elfutils-0.180/0001-disable-Werror-as-it-tends-to-break-with-new-gcc-ver.patch
+++ b/patches/elfutils-0.190/0001-disable-Werror-as-it-tends-to-break-with-new-gcc-ver.patch
@@ -1,8 +1,8 @@
From: Helmut Grohne <helmut@subdivi.de>
-Date: Sun, 2 Aug 2020 09:48:45 +0200
+Date: Wed, 15 Nov 2023 13:00:19 +0100
Subject: [PATCH] disable -Werror as it tends to break with new gcc versions
-Imported from elfutils_0.180-1.debian.tar.xz
+Imported from elfutils_0.189-4.debian.tar.xz
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
@@ -10,22 +10,22 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 2 deletions(-)
diff --git a/config/eu.am b/config/eu.am
-index 6c3c444f143a..3bc0dc95b1fd 100644
+index e6c241f9d88a..4136e7cd538a 100644
--- a/config/eu.am
+++ b/config/eu.am
-@@ -73,7 +73,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
- -Wold-style-definition -Wstrict-prototypes -Wtrampolines \
+@@ -99,7 +99,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
$(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
+ $(USE_AFTER_FREE3_WARNING) \
- $(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
- $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
-@@ -83,7 +82,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \
- -Wtrampolines \
+ $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \
+@@ -109,7 +108,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \
+ $(TRAMPOLINES_WARNING) \
$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
$(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
- $(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
- $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
+ $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \
diff --git a/patches/elfutils-0.180/0002-riscv-retval-workaround.patch b/patches/elfutils-0.190/0002-riscv-retval-workaround.patch
index 338b533d6..a2c81d10d 100644
--- a/patches/elfutils-0.180/0002-riscv-retval-workaround.patch
+++ b/patches/elfutils-0.190/0002-riscv-retval-workaround.patch
@@ -1,8 +1,8 @@
From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 2 Aug 2020 09:48:45 +0200
+Date: Wed, 15 Nov 2023 13:00:19 +0100
Subject: [PATCH] riscv-retval-workaround
-Imported from elfutils_0.180-1.debian.tar.xz
+Imported from elfutils_0.189-4.debian.tar.xz
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
@@ -10,7 +10,7 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/riscv_retval.c b/backends/riscv_retval.c
-index 35b6010bf3e3..46d465e913d4 100644
+index 0a1e02f81cd2..95bfdc3cd019 100644
--- a/backends/riscv_retval.c
+++ b/backends/riscv_retval.c
@@ -111,7 +111,7 @@ flatten_aggregate_arg (Dwarf_Die *typedie __attribute__ ((unused)),
diff --git a/patches/elfutils-0.190/0003-remove-old-glibc-hack.patch b/patches/elfutils-0.190/0003-remove-old-glibc-hack.patch
new file mode 100644
index 000000000..0f8ba8fb2
--- /dev/null
+++ b/patches/elfutils-0.190/0003-remove-old-glibc-hack.patch
@@ -0,0 +1,30 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Wed, 15 Nov 2023 13:00:19 +0100
+Subject: [PATCH] remove old glibc hack
+
+Imported from elfutils_0.189-4.debian.tar.xz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ tests/dwfl-proc-attach.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/dwfl-proc-attach.c b/tests/dwfl-proc-attach.c
+index d02e9fc0e95e..9521900453df 100644
+--- a/tests/dwfl-proc-attach.c
++++ b/tests/dwfl-proc-attach.c
+@@ -107,6 +107,7 @@ main (int argc __attribute__ ((unused)),
+ return (threads == 3) ? 0 : -1;
+ }
+
++#if 0
+ /* HACK. This is a simple workaround for a combination of old glibc
+ and valgrind. libdw will try to dlopen libdebuginfod this causes
+ some unsuppressable memory leak warnings when the process is
+@@ -118,5 +119,6 @@ void *dlopen (void)
+ {
+ return NULL;
+ }
++#endif
+
+ #endif /* __linux__ */
diff --git a/patches/bridge-utils-1.6/autogen.sh b/patches/elfutils-0.190/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/bridge-utils-1.6/autogen.sh
+++ b/patches/elfutils-0.190/autogen.sh
diff --git a/patches/elfutils-0.190/series b/patches/elfutils-0.190/series
new file mode 100644
index 000000000..25d788eca
--- /dev/null
+++ b/patches/elfutils-0.190/series
@@ -0,0 +1,6 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-disable-Werror-as-it-tends-to-break-with-new-gcc-ver.patch
+0002-riscv-retval-workaround.patch
+0003-remove-old-glibc-hack.patch
+# 9cdd9b689558d0ff58c761b2e41416fc - git-ptx-patches magic
diff --git a/patches/cairo-1.16.0/autogen.sh b/patches/evtest-1.35/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/cairo-1.16.0/autogen.sh
+++ b/patches/evtest-1.35/autogen.sh
diff --git a/patches/canutils-v2020.02.04/autogen.sh b/patches/f2fs-tools-1.14.0/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/canutils-v2020.02.04/autogen.sh
+++ b/patches/f2fs-tools-1.14.0/autogen.sh
diff --git a/patches/failmalloc-1.0/0001-fix-building-with-glibc-2.14.1.patch b/patches/failmalloc-1.0/0001-fix-building-with-glibc-2.14.1.patch
deleted file mode 100644
index 54c8b568f..000000000
--- a/patches/failmalloc-1.0/0001-fix-building-with-glibc-2.14.1.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 23 Nov 2011 13:56:05 +0100
-Subject: [PATCH] fix building with glibc-2.14.1
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- failmalloc.c | 4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
-
-diff --git a/failmalloc.c b/failmalloc.c
-index fc33552..cecc7b5 100644
---- a/failmalloc.c
-+++ b/failmalloc.c
-@@ -204,5 +204,9 @@ failmalloc_init (void)
- failmalloc_install ();
- }
-
-+#ifdef __MALLOC_HOOK_VOLATILE
-+void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void) = failmalloc_init;
-+#else
- void (*__malloc_initialize_hook) (void) = failmalloc_init;
-+#endif
-
diff --git a/patches/failmalloc-1.0/series b/patches/failmalloc-1.0/series
deleted file mode 100644
index eda3da385..000000000
--- a/patches/failmalloc-1.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-fix-building-with-glibc-2.14.1.patch
-# 77ed858c96b7d3dc9f91cc361acc732c - git-ptx-patches magic
diff --git a/patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch b/patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch
deleted file mode 100644
index 92584801d..000000000
--- a/patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
-Date: Thu, 11 Feb 2021 20:59:25 -0800
-Subject: [PATCH] libfakeroot.c: define _STAT_VER if not already defined
-
-Based on patch from Jan Pazdziora:
-https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/SMQ3RYXEYTVZH6PLQMKNB3NM4XLPMNZO/
-
-Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
----
- libfakeroot.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/libfakeroot.c b/libfakeroot.c
-index 3e80e38b16db..14cdbc4dca12 100644
---- a/libfakeroot.c
-+++ b/libfakeroot.c
-@@ -90,6 +90,16 @@
- #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b)
- #endif
-
-+#ifndef _STAT_VER
-+ #if defined (__aarch64__)
-+ #define _STAT_VER 0
-+ #elif defined (__x86_64__)
-+ #define _STAT_VER 1
-+ #else
-+ #define _STAT_VER 3
-+ #endif
-+#endif
-+
- /*
- These INT_* (which stands for internal) macros should always be used when
- the fakeroot library owns the storage of the stat variable.
diff --git a/patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch b/patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch
deleted file mode 100644
index 59bc951d3..000000000
--- a/patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
-Date: Thu, 11 Feb 2021 21:00:04 -0800
-Subject: [PATCH] libfakeroot.c: add wrappers for new glibc 2.33+ symbols
-
-Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
----
- libfakeroot.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 48 insertions(+)
-
-diff --git a/libfakeroot.c b/libfakeroot.c
-index 14cdbc4dca12..d75c51fa990a 100644
---- a/libfakeroot.c
-+++ b/libfakeroot.c
-@@ -1352,6 +1352,54 @@ int renameat(int olddir_fd, const char *oldpath,
- #endif /* HAVE_FSTATAT */
-
-
-+#if defined(__GLIBC__) && __GLIBC_PREREQ(2,33)
-+/* Glibc 2.33 exports symbols for these functions in the shared lib */
-+ int lstat(const char *file_name, struct stat *statbuf) {
-+ return WRAP_LSTAT LSTAT_ARG(_STAT_VER, file_name, statbuf);
-+ }
-+ int stat(const char *file_name, struct stat *st) {
-+ return WRAP_STAT STAT_ARG(_STAT_VER, file_name, st);
-+ }
-+ int fstat(int fd, struct stat *st) {
-+ return WRAP_FSTAT FSTAT_ARG(_STAT_VER, fd, st);
-+ }
-+
-+ #ifdef HAVE_FSTATAT
-+ int fstatat(int dir_fd, const char *path, struct stat *st, int flags) {
-+ return WRAP_FSTATAT FSTATAT_ARG(_STAT_VER, dir_fd, path, st, flags);
-+ }
-+ #endif
-+
-+ #ifdef STAT64_SUPPORT
-+ int lstat64(const char *file_name, struct stat64 *st) {
-+ return WRAP_LSTAT64 LSTAT64_ARG(_STAT_VER, file_name, st);
-+ }
-+ int stat64(const char *file_name, struct stat64 *st) {
-+ return WRAP_STAT64 STAT64_ARG(_STAT_VER, file_name, st);
-+ }
-+ int fstat64(int fd, struct stat64 *st) {
-+ return WRAP_FSTAT64 FSTAT64_ARG(_STAT_VER, fd, st);
-+ }
-+
-+ #ifdef HAVE_FSTATAT
-+ int fstatat64(int dir_fd, const char *path, struct stat64 *st, int flags) {
-+ return WRAP_FSTATAT64 FSTATAT64_ARG(_STAT_VER, dir_fd, path, st, flags);
-+ }
-+ #endif
-+ #endif
-+
-+ int mknod(const char *pathname, mode_t mode, dev_t dev) {
-+ return WRAP_MKNOD MKNOD_ARG(_STAT_VER, pathname, mode, &dev);
-+ }
-+
-+ #if defined(HAVE_FSTATAT) && defined(HAVE_MKNODAT)
-+ int mknodat(int dir_fd, const char *pathname, mode_t mode, dev_t dev) {
-+ return WRAP_MKNODAT MKNODAT_ARG(_STAT_VER, dir_fd, pathname, mode, &dev);
-+ }
-+ #endif
-+#endif /* GLIBC_PREREQ */
-+
-+
- #ifdef FAKEROOT_FAKENET
- pid_t fork(void)
- {
diff --git a/patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch b/patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch
deleted file mode 100644
index 8007d7334..000000000
--- a/patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
-Date: Thu, 11 Feb 2021 21:00:20 -0800
-Subject: [PATCH] libfakeroot.c: fix compile error with DEBUG enabled
-
-Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
----
- libfakeroot.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/libfakeroot.c b/libfakeroot.c
-index d75c51fa990a..31480f8323ba 100644
---- a/libfakeroot.c
-+++ b/libfakeroot.c
-@@ -2525,7 +2525,7 @@ int statx (int dirfd, const char *path, int flags, unsigned int mask, struct sta
-
- #ifdef LIBFAKEROOT_DEBUGGING
- if (fakeroot_debug) {
-- fprintf(stderr, "statx fd %d\n", fd);
-+ fprintf(stderr, "statx fd %d\n", dirfd);
- }
- #endif /* LIBFAKEROOT_DEBUGGING */
- r=INT_NEXT_FSTATAT(dirfd, path, &st, flags);
diff --git a/patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch b/patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch
deleted file mode 100644
index 5291625ee..000000000
--- a/patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
-Date: Sat, 13 Feb 2021 19:32:08 -0800
-Subject: [PATCH] configure.ac: fix __xmknod{,at} pointer argument
-
-Switch default to assume * and not the absence of *.
-
-On glibc 2.33+, there is no definition for these functions in header
-files, so the compile test doesn't work. But, we can default to using
-the pointer (as is the case with newer glibc), and use the header file
-on older platforms to fail the test and use no pointer.
-
-Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
----
- configure.ac | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 73415d2a91a6..d85566f089b4 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -183,13 +183,13 @@ AC_MSG_CHECKING([for type of arg of __xmknod])
- ]], [[
- int __xmknod ( int ver,
- const char *pathname ,
-- mode_t mode , dev_t dev);
-+ mode_t mode , dev_t *dev);
- ]])],[
-- AC_DEFINE(XMKNOD_FRTH_ARG,)
-- AC_MSG_RESULT([no extra *])
-- ],[
- AC_DEFINE(XMKNOD_FRTH_ARG,[*])
- AC_MSG_RESULT([needs *])
-+ ],[
-+ AC_DEFINE(XMKNOD_FRTH_ARG,)
-+ AC_MSG_RESULT([no extra *])
-
- ])
-
-@@ -210,13 +210,13 @@ AC_MSG_CHECKING([for type of arg of __xmknodat])
- int __xmknodat ( int ver,
- int dirfd,
- const char *pathname ,
-- mode_t mode , dev_t dev);
-+ mode_t mode , dev_t *dev);
- ]])],[
-- AC_DEFINE(XMKNODAT_FIFTH_ARG,)
-- AC_MSG_RESULT([no extra *])
-- ],[
- AC_DEFINE(XMKNODAT_FIFTH_ARG,[*])
- AC_MSG_RESULT([needs *])
-+ ],[
-+ AC_DEFINE(XMKNODAT_FIFTH_ARG,)
-+ AC_MSG_RESULT([no extra *])
-
- ])
-
diff --git a/patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch b/patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch
deleted file mode 100644
index 620afc2ea..000000000
--- a/patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
-Date: Sat, 13 Feb 2021 19:35:31 -0800
-Subject: [PATCH] libfakeroot.c: fix fts_read and fts_children
-
-Apply Debian patch from [0], since glibc is usually built without LFS.
-__USE_LARGEFILE64 and FTSENT64 should be used anyway for proper support
-of this, if needed. See [1] for more details.
-
-[0]: https://sources.debian.org/patches/fakeroot/1.25.3-1.1/eglibc-fts-without-LFS/
-[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676428
-
-Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
----
- libfakeroot.c | 8 --------
- 1 file changed, 8 deletions(-)
-
-diff --git a/libfakeroot.c b/libfakeroot.c
-index 31480f8323ba..169f4da4de21 100644
---- a/libfakeroot.c
-+++ b/libfakeroot.c
-@@ -2066,11 +2066,7 @@ FTSENT *fts_read(FTS *ftsp) {
- || r->fts_info == FTS_NS || r->fts_info == FTS_NSOK))
- r->fts_statp = NULL; /* Otherwise fts_statp may be a random pointer */
- if(r && r->fts_statp) { /* Should we bother checking fts_info here? */
--# if defined(STAT64_SUPPORT) && !defined(__APPLE__)
-- SEND_GET_STAT64(r->fts_statp, _STAT_VER);
--# else
- SEND_GET_STAT(r->fts_statp, _STAT_VER);
--# endif
- }
-
- return r;
-@@ -2089,11 +2085,7 @@ FTSENT *fts_children(FTS *ftsp, int options) {
- first=next_fts_children(ftsp, options);
- for(r = first; r; r = r->fts_link) {
- if(r && r->fts_statp) { /* Should we bother checking fts_info here? */
--# if defined(STAT64_SUPPORT) && !defined(__APPLE__)
-- SEND_GET_STAT64(r->fts_statp, _STAT_VER);
--# else
- SEND_GET_STAT(r->fts_statp, _STAT_VER);
--# endif
- }
- }
-
diff --git a/patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch b/patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch
deleted file mode 100644
index 5db58dcd3..000000000
--- a/patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Dimitri John Ledkov <xnox@ubuntu.com>
-Date: Wed, 17 Feb 2021 14:41:43 +0000
-Subject: [PATCH] Add _STAT_VER defines for ppc64le, riscv64, s390x.
-
-Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
----
- libfakeroot.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/libfakeroot.c b/libfakeroot.c
-index 169f4da4de21..74f52ab1df79 100644
---- a/libfakeroot.c
-+++ b/libfakeroot.c
-@@ -93,6 +93,12 @@
- #ifndef _STAT_VER
- #if defined (__aarch64__)
- #define _STAT_VER 0
-+ #elif defined (__powerpc__) && __WORDSIZE == 64
-+ #define _STAT_VER 1
-+ #elif defined (__riscv) && __riscv_xlen==64
-+ #define _STAT_VER 0
-+ #elif defined (__s390x__)
-+ #define _STAT_VER 1
- #elif defined (__x86_64__)
- #define _STAT_VER 1
- #else
diff --git a/patches/fakeroot-1.25.3/0007-OS-X-portability.patch b/patches/fakeroot-1.25.3/0007-OS-X-portability.patch
deleted file mode 100644
index 768696a25..000000000
--- a/patches/fakeroot-1.25.3/0007-OS-X-portability.patch
+++ /dev/null
@@ -1,161 +0,0 @@
-From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
-Date: Sat, 13 Feb 2021 20:05:17 -0800
-Subject: [PATCH] OS X portability
-
-OS X portability work from OpenWrt.
-
-Cc: Felix Fietkau <nbd@nbd.name>
-Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
----
- configure.ac | 1 +
- libfakeroot.c | 36 ++++++++++++++++++++++++++++++++++--
- wrapawk_macosx | 10 +++++++---
- wrapfunc.inp | 4 ++--
- 4 files changed, 44 insertions(+), 7 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index d85566f089b4..35f9ecf28993 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -146,6 +146,7 @@ for first in size_t int; do
- #include <sys/types.h>
- #endif
- #include <unistd.h>
-+#include <stdio.h>
- #ifdef HAVE_GRP_H
- #include <grp.h>
- #endif
-diff --git a/libfakeroot.c b/libfakeroot.c
-index 74f52ab1df79..f9ca1820e4b7 100644
---- a/libfakeroot.c
-+++ b/libfakeroot.c
-@@ -128,8 +128,16 @@
- #define INT_SEND_STAT(a,b) SEND_STAT(a,b,_STAT_VER)
- #define INT_SEND_GET_XATTR(a,b) SEND_GET_XATTR(a,b,_STAT_VER)
- #define INT_SEND_GET_STAT(a,b) SEND_GET_STAT(a,b)
-+
-+/* 10.10 uses id_t in getpriority/setpriority calls, so pretend
-+ id_t is used everywhere, just happens to be int on some OSes */
-+#ifndef _ID_T
-+#define _ID_T
-+typedef int id_t;
-+#endif
- #endif
-
-+#include <sys/types.h>
- #include <stdlib.h>
- #include <sys/ipc.h>
- #include <sys/msg.h>
-@@ -141,7 +149,6 @@
- #include <unistd.h>
- #include <dirent.h>
- #include <errno.h>
--#include <sys/types.h>
- #ifdef HAVE_SYS_ACL_H
- #include <sys/acl.h>
- #endif /* HAVE_SYS_ACL_H */
-@@ -204,6 +211,15 @@ extern int unsetenv (const char *name);
- #undef __lxstat64
- #undef _FILE_OFFSET_BITS
-
-+
-+#ifndef AT_EMPTY_PATH
-+#define AT_EMPTY_PATH 0
-+#endif
-+
-+#ifndef AT_NO_AUTOMOUNT
-+#define AT_NO_AUTOMOUNT 0
-+#endif
-+
- /*
- // next_wrap_st:
- // this structure is used in next_wrap, which is defined in
-@@ -1975,7 +1991,7 @@ ssize_t fremovexattr(int fd, const char *name)
- }
- #endif /* HAVE_FREMOVEXATTR */
-
--int setpriority(int which, int who, int prio){
-+int setpriority(int which, id_t who, int prio){
- if (fakeroot_disabled)
- return next_setpriority(which, who, prio);
- next_setpriority(which, who, prio);
-@@ -2576,3 +2592,19 @@ int sysinfo(int command, char *buf, long count)
- }
- }
- #endif
-+
-+#ifdef HAVE_OPENAT
-+int openat(int dir_fd, const char *pathname, int flags, ...)
-+{
-+ mode_t mode;
-+
-+ if (flags & O_CREAT) {
-+ va_list args;
-+ va_start(args, flags);
-+ mode = va_arg(args, int);
-+ va_end(args);
-+ }
-+
-+ return next_openat(dir_fd, pathname, flags, mode);
-+}
-+#endif
-diff --git a/wrapawk_macosx b/wrapawk_macosx
-index 088a7f48de49..f783219758ac 100644
---- a/wrapawk_macosx
-+++ b/wrapawk_macosx
-@@ -46,26 +46,30 @@ BEGIN{
- argtype=$3;
- argname=$4;
- MACRO=$5;
-+ argtype_def=$6
-+ if(!argtype_def) {
-+ argtype_def = argtype
-+ }
- if(MACRO){
- print "extern " ret " MY_DEF(" name ")" argtype " __attribute__((visibility(\"hidden\")));" > headerfile;
- print "INTERPOSE(MY_DEF(" name "_RAW)," name "_RAW);" > structfile;
- print "#undef " name > deffile
- print "#define " name " MY_DEF(" name "_RAW)" > deffile
-
-- print "extern " ret, name, argtype ";" > tmpffile;
-+ print "extern " ret, name, argtype_def ";" > tmpffile;
- print "static __inline__ " ret " NEXT_" MACRO "_NOARG " argtype " __attribute__((always_inline));" > tmpffile;
- print "static __inline__ " ret " NEXT_" MACRO "_NOARG " argtype " {" > tmpffile;
- print " return " name, argname ";" > tmpffile;
- print "}" > tmpffile;
- print "" > tmpffile;
- } else {
-- print "extern " ret " my_" name, argtype " __attribute__((visibility(\"hidden\")));" > headerfile;
-+ print "extern " ret " my_" name, argtype_def " __attribute__((visibility(\"hidden\")));" > headerfile;
- print "#undef " name > structfile;
- print "INTERPOSE(my_" name "," name ");" > structfile;
- print "#define " name " my_" name > structfile
- print "#define " name " my_" name > deffile
-
-- print "extern " ret, name, argtype ";" > tmpffile;
-+ print "extern " ret, name, argtype_def ";" > tmpffile;
- if(argname){
- print "static __inline__ " ret " next_" name, argtype " __attribute__((always_inline));" > tmpffile;
- print "static __inline__ " ret " next_" name, argtype " {" > tmpffile;
-diff --git a/wrapfunc.inp b/wrapfunc.inp
-index f7ad1867891a..556af34579b0 100644
---- a/wrapfunc.inp
-+++ b/wrapfunc.inp
-@@ -146,7 +146,7 @@ setfsgid;gid_t;(gid_t fsgid);(fsgid)
- initgroups;int;(const char *user, INITGROUPS_SECOND_ARG group);(user, group)
- getgroups;int;(int size, gid_t list[]);(size, list)
- setgroups;int;(SETGROUPS_SIZE_TYPE size, const gid_t *list);(size, list)
--setpriority;int;(int which, int who, int prio);(which, who, prio)
-+setpriority;int;(int which, id_t who, int prio);(which, who, prio)
- #ifdef HAVE_CAPSET
- capset;int;(cap_user_header_t hdrp, const cap_user_data_t datap);(hdrp, datap)
- #endif /* HAVE_CAPSET */
-@@ -198,7 +198,7 @@ fchownat;int;(int dir_fd, const char *path, uid_t owner, gid_t group, int flags)
- mkdirat;int;(int dir_fd, const char *pathname, mode_t mode);(dir_fd, pathname, mode)
- #endif /* HAVE_MKDIRAT */
- #ifdef HAVE_OPENAT
--openat;int;(int dir_fd, const char *pathname, int flags);(dir_fd, pathname, flags)
-+openat;int;(int dir_fd, const char *pathname, int flags, mode_t mode);(dir_fd, pathname, flags, mode);;(int dir_fd, const char *pathname, int flags, ...)
- #endif /* HAVE_OPENAT */
- #ifdef HAVE_RENAMEAT
- renameat;int;(int olddir_fd, const char *oldpath, int newdir_fd, const char *newpath);(olddir_fd, oldpath, newdir_fd, newpath)
diff --git a/patches/fakeroot-1.25.3/series b/patches/fakeroot-1.25.3/series
deleted file mode 100644
index fa0010583..000000000
--- a/patches/fakeroot-1.25.3/series
+++ /dev/null
@@ -1,13 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-#tag:upstream --start-number 1
-0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch
-0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch
-0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch
-0004-configure.ac-fix-__xmknod-at-pointer-argument.patch
-0005-libfakeroot.c-fix-fts_read-and-fts_children.patch
-0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch
-0007-OS-X-portability.patch
-#tag:ptxdist --start-number 100
-0008-make-fakeroot-relocatable.patch
-# d07e91409b4dcfb1e6e2abd76ddc7481 - git-ptx-patches magic
diff --git a/patches/fakeroot-1.25.3/0008-make-fakeroot-relocatable.patch b/patches/fakeroot-1.31/0001-make-fakeroot-relocatable.patch
index 8d7a6994c..bedb319a9 100644
--- a/patches/fakeroot-1.25.3/0008-make-fakeroot-relocatable.patch
+++ b/patches/fakeroot-1.31/0001-make-fakeroot-relocatable.patch
@@ -27,7 +27,7 @@ index 0d6f435af1ed..08d8b27863a8 100755
USEABSLIBPATH=@LDPRELOADABS@
FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@
-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
-+PATHS="${FAKEROOT_PREFIX}@libdir@":${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
++PATHS="${FAKEROOT_PREFIX}/lib/fakeroot":${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
FAKED_MODE="unknown-is-root"
diff --git a/patches/fakeroot-1.31/series b/patches/fakeroot-1.31/series
new file mode 100644
index 000000000..bf6039484
--- /dev/null
+++ b/patches/fakeroot-1.31/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-make-fakeroot-relocatable.patch
+# 997aab71aab23715410e9573ed7fb092 - git-ptx-patches magic
diff --git a/patches/fbset-2.1/0001-fbset-do-not-overwrite-CC-to-allow-crosscompiling.patch b/patches/fbset-2.1/0001-fbset-do-not-overwrite-CC-to-allow-crosscompiling.patch
deleted file mode 100644
index 372113646..000000000
--- a/patches/fbset-2.1/0001-fbset-do-not-overwrite-CC-to-allow-crosscompiling.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 78265ef4686eb72f163802b63f7e145f96a88776 Mon Sep 17 00:00:00 2001
-From: Wolfram Sang <w.sang@pengutronix.de>
-Date: Thu, 28 Apr 2011 11:51:57 +0200
-Subject: [PATCH] fbset: fix makefile
-
-* do not overwrite CC to allow crosscompiling
-* use DESTDIR
-* don't create nodes or remove files in install
-
-Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
----
- Makefile | 17 ++++-------------
- 1 file changed, 4 insertions(+), 13 deletions(-)
-
-Index: fbset-2.1/Makefile
-===================================================================
---- fbset-2.1.orig/Makefile
-+++ fbset-2.1/Makefile
-@@ -2,7 +2,7 @@
- # Linux Frame Buffer Device Configuration
- #
-
--CC = gcc -Wall -O2 -I.
-+CFLAGS += -Wall -O2 -I.
- BISON = bison -d
- FLEX = flex
- INSTALL = install
-@@ -24,18 +24,9 @@ modes.tab.c: modes.y
- $(BISON) modes.y
-
- install: fbset
-- if [ -f /sbin/fbset ]; then rm /sbin/fbset; fi
-- $(INSTALL) fbset /usr/sbin
-- $(INSTALL) fbset.8 /usr/man/man8
-- $(INSTALL) fb.modes.5 /usr/man/man5
-- if [ ! -c /dev/fb0 ]; then mknod /dev/fb0 c 29 0; fi
-- if [ ! -c /dev/fb1 ]; then mknod /dev/fb1 c 29 32; fi
-- if [ ! -c /dev/fb2 ]; then mknod /dev/fb2 c 29 64; fi
-- if [ ! -c /dev/fb3 ]; then mknod /dev/fb3 c 29 96; fi
-- if [ ! -c /dev/fb4 ]; then mknod /dev/fb4 c 29 128; fi
-- if [ ! -c /dev/fb5 ]; then mknod /dev/fb5 c 29 160; fi
-- if [ ! -c /dev/fb6 ]; then mknod /dev/fb6 c 29 192; fi
-- if [ ! -c /dev/fb7 ]; then mknod /dev/fb7 c 29 224; fi
-+ $(INSTALL) -D fbset $(DESTDIR)/usr/sbin
-+ $(INSTALL) -D fbset.8 $(DESTDIR)/usr/man/man8
-+ $(INSTALL) -D fb.modes.5 $(DESTDIR)/usr/man/man5
-
- clean:
- $(RM) *.o fbset lex.yy.c modes.tab.c modes.tab.h
diff --git a/patches/fbset-2.1/series b/patches/fbset-2.1/series
deleted file mode 100644
index 7ec7a11b9..000000000
--- a/patches/fbset-2.1/series
+++ /dev/null
@@ -1 +0,0 @@
-0001-fbset-do-not-overwrite-CC-to-allow-crosscompiling.patch
diff --git a/patches/fbtest-2014-08-11-g29ab066/0001-provide-a-pre-generated-penguin.c-to-get-rid-of-this.patch b/patches/fbtest-2023-03-28-g47f6351/0001-provide-a-pre-generated-penguin.c-to-get-rid-of-this.patch
index 0baef3cd7..97b5d1c82 100644
--- a/patches/fbtest-2014-08-11-g29ab066/0001-provide-a-pre-generated-penguin.c-to-get-rid-of-this.patch
+++ b/patches/fbtest-2023-03-28-g47f6351/0001-provide-a-pre-generated-penguin.c-to-get-rid-of-this.patch
@@ -19,7 +19,7 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
create mode 100644 images/penguin.c
diff --git a/Makefile b/Makefile
-index 9a0a7ad95d9b..1557199d1fb5 100644
+index 5041f6ca5ca1..512a684f5f32 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ TOPDIR = .
diff --git a/patches/fbtest-2014-08-11-g29ab066/0002-add-install-target.patch b/patches/fbtest-2023-03-28-g47f6351/0002-add-install-target.patch
index 636226d53..3e65cbaa4 100644
--- a/patches/fbtest-2014-08-11-g29ab066/0002-add-install-target.patch
+++ b/patches/fbtest-2023-03-28-g47f6351/0002-add-install-target.patch
@@ -9,10 +9,10 @@ Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
1 file changed, 2 insertions(+)
diff --git a/Makefile b/Makefile
-index 1557199d1fb5..1f926b4cf6be 100644
+index 512a684f5f32..c20376dccf70 100644
--- a/Makefile
+++ b/Makefile
-@@ -12,3 +12,5 @@ include $(TOPDIR)/Rules.make
+@@ -13,3 +13,5 @@ include $(TOPDIR)/Rules.make
images: pnmtohex
diff --git a/patches/fbtest-2023-03-28-g47f6351/0003-Initialize-ticks-in-benchmark.patch b/patches/fbtest-2023-03-28-g47f6351/0003-Initialize-ticks-in-benchmark.patch
new file mode 100644
index 000000000..0360f05b9
--- /dev/null
+++ b/patches/fbtest-2023-03-28-g47f6351/0003-Initialize-ticks-in-benchmark.patch
@@ -0,0 +1,29 @@
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Thu, 29 Jun 2023 10:28:40 +0200
+Subject: [PATCH] Initialize ticks in benchmark()
+
+Fixes a build error with GCC 13:
+
+ util.c: In function 'benchmark':
+ util.c:177:17: error: 'ticks' may be used uninitialized [-Werror=maybe-uninitialized]
+ util.c:161:14: note: 'ticks' was declared here
+
+Link: https://lore.kernel.org/r/20230629082840.888110-1-p.zabel@pengutronix.de
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util.c b/util.c
+index cdf89b38618a..1193523990e7 100644
+--- a/util.c
++++ b/util.c
+@@ -158,7 +158,7 @@ static uint64_t get_ticks(void)
+
+ double benchmark(void (*func)(unsigned long n, void *data), void *data)
+ {
+- uint64_t ticks;
++ uint64_t ticks = 0;
+ unsigned long n = 1;
+
+ printf("Benchmarking... ");
diff --git a/patches/fbtest-2014-08-11-g29ab066/series b/patches/fbtest-2023-03-28-g47f6351/series
index af761ac8d..d3af842b3 100644
--- a/patches/fbtest-2014-08-11-g29ab066/series
+++ b/patches/fbtest-2023-03-28-g47f6351/series
@@ -2,4 +2,5 @@
#tag:base --start-number 1
0001-provide-a-pre-generated-penguin.c-to-get-rid-of-this.patch
0002-add-install-target.patch
-# 96842eebf8f8f3ef2bf71367ce23f9cd - git-ptx-patches magic
+0003-Initialize-ticks-in-benchmark.patch
+# 552895bf186281b657d9f116ef4cae0d - git-ptx-patches magic
diff --git a/patches/fio-3.23/0001-use-latomic-when-necessary.patch b/patches/fio-3.32/0001-use-latomic-when-necessary.patch
index d8265106d..7b502ea9f 100644
--- a/patches/fio-3.23/0001-use-latomic-when-necessary.patch
+++ b/patches/fio-3.32/0001-use-latomic-when-necessary.patch
@@ -11,10 +11,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/configure b/configure
-index 6d672fe5ebda..4103a5af66ed 100755
+index a2b9bd4cc8f4..a118d90f9648 100755
--- a/configure
+++ b/configure
-@@ -578,16 +578,19 @@ cat > $TMPC <<EOF
+@@ -607,16 +607,19 @@ cat > $TMPC <<EOF
#include <stdatomic.h>
int main(void)
{
diff --git a/patches/fio-3.23/series b/patches/fio-3.32/series
index 9d54f50bf..9d54f50bf 100644
--- a/patches/fio-3.23/series
+++ b/patches/fio-3.32/series
diff --git a/patches/flup-1.0.2/0001-support-python2.7.patch b/patches/flup-1.0.2/0001-support-python2.7.patch
deleted file mode 100644
index 2a2ee1613..000000000
--- a/patches/flup-1.0.2/0001-support-python2.7.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 12 Jun 2013 21:03:22 +0200
-Subject: [PATCH] support python2.7
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- ez_setup.py | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/ez_setup.py b/ez_setup.py
-index d24e845..b48fc0b 100644
---- a/ez_setup.py
-+++ b/ez_setup.py
-@@ -14,7 +14,7 @@ the appropriate options to ``use_setuptools()``.
- This file can also be run as a script to install or upgrade setuptools.
- """
- import sys
--DEFAULT_VERSION = "0.6c9"
-+DEFAULT_VERSION = "0.6c11"
- DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
-
- md5_data = {
-@@ -52,6 +52,8 @@ md5_data = {
- 'setuptools-0.6c9-py2.4.egg': '260a2be2e5388d66bdaee06abec6342a',
- 'setuptools-0.6c9-py2.5.egg': 'fe67c3e5a17b12c0e7c541b7ea43a8e6',
- 'setuptools-0.6c9-py2.6.egg': 'ca37b1ff16fa2ede6e19383e7b59245a',
-+ 'setuptools-0.6c11-py2.7.egg': 'fe1f997bc722265116870bc7919059ea',
-+
- }
-
- import sys, os
diff --git a/patches/flup-1.0.2/autogen.sh b/patches/flup-1.0.2/autogen.sh
deleted file mode 100755
index 71b2e73ea..000000000
--- a/patches/flup-1.0.2/autogen.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-cp patches/setuptools-0.6c11-py2.7.egg .
-
diff --git a/patches/flup-1.0.2/series b/patches/flup-1.0.2/series
deleted file mode 100644
index b90762fc5..000000000
--- a/patches/flup-1.0.2/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-support-python2.7.patch
-# 38422a23875f4810b966c4154441dc57 - git-ptx-patches magic
diff --git a/patches/flup-1.0.2/setuptools-0.6c11-py2.7.egg b/patches/flup-1.0.2/setuptools-0.6c11-py2.7.egg
deleted file mode 100644
index 8a51424a4..000000000
--- a/patches/flup-1.0.2/setuptools-0.6c11-py2.7.egg
+++ /dev/null
Binary files differ
diff --git a/patches/freetype-2.10.1/0001-generate-freetype-config-and-freetype2.pc-correctly.patch b/patches/freetype-2.13.2/0001-generate-freetype-config-and-freetype2.pc-correctly.patch
index d5b50f663..1110f457b 100644
--- a/patches/freetype-2.10.1/0001-generate-freetype-config-and-freetype2.pc-correctly.patch
+++ b/patches/freetype-2.13.2/0001-generate-freetype-config-and-freetype2.pc-correctly.patch
@@ -6,15 +6,15 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
builds/unix/configure.ac | 4 +++-
builds/unix/freetype-config.in | 19 ++++++-------------
- builds/unix/freetype2.in | 14 +++++++-------
+ builds/unix/freetype2.in | 18 +++++++++---------
builds/unix/unix-def.in | 3 ---
- 4 files changed, 16 insertions(+), 24 deletions(-)
+ 4 files changed, 18 insertions(+), 26 deletions(-)
diff --git a/builds/unix/configure.ac b/builds/unix/configure.ac
-index d374088aae9e..e40558adb105 100644
+index a98865a432d9..45c3bcbcd770 100644
--- a/builds/unix/configure.ac
+++ b/builds/unix/configure.ac
-@@ -1114,7 +1114,9 @@ AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
+@@ -1140,7 +1140,9 @@ AC_CONFIG_HEADERS([ftconfig.h])
# and `builds/unix/unix-cc.mk' that will be used by the build system
#
AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
@@ -23,10 +23,10 @@ index d374088aae9e..e40558adb105 100644
+ freetype-config:freetype-config.in
+ freetype2.pc:freetype2.in])
- # re-generate the Jamfile to use libtool now
- #
+ AC_OUTPUT
+
diff --git a/builds/unix/freetype-config.in b/builds/unix/freetype-config.in
-index 9e8d3c2bb82f..8f1c0af3c254 100644
+index 58561126f2bd..5d7cc4f36dfa 100644
--- a/builds/unix/freetype-config.in
+++ b/builds/unix/freetype-config.in
@@ -16,13 +16,6 @@ export LC_ALL
@@ -68,7 +68,7 @@ index 9e8d3c2bb82f..8f1c0af3c254 100644
test "${SYSROOT}$libdir" != "/usr/lib64" ; then
libs_L="-L${SYSROOT}$libdir"
diff --git a/builds/unix/freetype2.in b/builds/unix/freetype2.in
-index 2d759ecf8bfd..f44f14cabf9a 100644
+index fe389f4b6fef..885444efebf7 100644
--- a/builds/unix/freetype2.in
+++ b/builds/unix/freetype2.in
@@ -1,14 +1,14 @@
@@ -85,19 +85,21 @@ index 2d759ecf8bfd..f44f14cabf9a 100644
URL: https://freetype.org
Description: A free, high-quality, and portable font engine.
-Version: %ft_version%
+-Requires: %PKGCONFIG_REQUIRES%
+-Requires.private: %PKGCONFIG_REQUIRES_PRIVATE%
+-Libs: %PKGCONFIG_LIBS%
+-Libs.private: %PKGCONFIG_LIBS_PRIVATE%
+Version: @ft_version@
- Requires:
--Requires.private: %REQUIRES_PRIVATE%
-+Requires.private: @REQUIRES_PRIVATE@
- Libs: -L${libdir} -lfreetype
--Libs.private: %LIBS_PRIVATE%
-+Libs.private: @LIBS_PRIVATE@
++Requires: @PKGCONFIG_REQUIRES@
++Requires.private: @PKGCONFIG_REQUIRES_PRIVATE@
++Libs: @PKGCONFIG_LIBS@
++Libs.private: @PKGCONFIG_LIBS_PRIVATE@
Cflags: -I${includedir}/freetype2
diff --git a/builds/unix/unix-def.in b/builds/unix/unix-def.in
-index e74844d29dcd..c117b5ef0d5c 100644
+index d50994f3c928..ba02b00c742d 100644
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
-@@ -154,7 +154,4 @@ $(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
+@@ -157,7 +157,4 @@ $(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
# defines whether we should install `freetype-config' or not
INSTALL_FT2_CONFIG = @INSTALL_FT2_CONFIG@
diff --git a/patches/freetype-2.10.1/autogen.sh b/patches/freetype-2.13.2/autogen.sh
index 1056b101c..1056b101c 100755
--- a/patches/freetype-2.10.1/autogen.sh
+++ b/patches/freetype-2.13.2/autogen.sh
diff --git a/patches/freetype-2.10.1/series b/patches/freetype-2.13.2/series
index ab166a354..ab166a354 100644
--- a/patches/freetype-2.10.1/series
+++ b/patches/freetype-2.13.2/series
diff --git a/patches/fuse-2.9.9/0001-Whitelist-UFSD-backport-to-2.9-branch-452.patch b/patches/fuse-2.9.9/0001-Whitelist-UFSD-backport-to-2.9-branch-452.patch
new file mode 100644
index 000000000..2f7e58560
--- /dev/null
+++ b/patches/fuse-2.9.9/0001-Whitelist-UFSD-backport-to-2.9-branch-452.patch
@@ -0,0 +1,35 @@
+From: tenzap <46226844+tenzap@users.noreply.github.com>
+Date: Sun, 15 Sep 2019 17:57:08 +0200
+Subject: [PATCH] Whitelist UFSD (backport to 2.9 branch) (#452)
+
+---
+ ChangeLog | 6 ++++++
+ util/fusermount.c | 1 +
+ 2 files changed, 7 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index 13a369f6d113..5574f204abb2 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,9 @@
++Unreleased Changes
++==================
++
++* Added UFSD to whitelist (so users can now mount FUSE filesystems
++ on mountpoints within UFSD filesystems).
++
+ FUSE 2.9.9 (2019-01-04)
+ =======================
+
+diff --git a/util/fusermount.c b/util/fusermount.c
+index 4b799d96b131..5af487aa0e64 100644
+--- a/util/fusermount.c
++++ b/util/fusermount.c
+@@ -1049,6 +1049,7 @@ static int check_perm(const char **mntp, struct stat *stbuf, int *mountpoint_fd)
+ 0x73717368 /* SQUASHFS_MAGIC */,
+ 0x01021994 /* TMPFS_MAGIC */,
+ 0x24051905 /* UBIFS_SUPER_MAGIC */,
++ 0x736675005346544e /* UFSD */,
+ 0x58465342 /* XFS_SB_MAGIC */,
+ 0x2FC12FC1 /* ZFS_SUPER_MAGIC */,
+ };
diff --git a/patches/fuse-2.9.9/0002-Correct-errno-comparison-571.patch b/patches/fuse-2.9.9/0002-Correct-errno-comparison-571.patch
new file mode 100644
index 000000000..ea2a3afde
--- /dev/null
+++ b/patches/fuse-2.9.9/0002-Correct-errno-comparison-571.patch
@@ -0,0 +1,21 @@
+From: Andrew Gaul <gaul@google.com>
+Date: Mon, 14 Dec 2020 19:16:05 +0900
+Subject: [PATCH] Correct errno comparison (#571)
+
+---
+ lib/fuse.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/fuse.c b/lib/fuse.c
+index d1d873a37018..1ee0ef47945d 100644
+--- a/lib/fuse.c
++++ b/lib/fuse.c
+@@ -4350,7 +4350,7 @@ static int fuse_session_loop_remember(struct fuse *f)
+
+ res = poll(&fds, 1, timeout * 1000);
+ if (res == -1) {
+- if (errno == -EINTR)
++ if (errno == EINTR)
+ continue;
+ else
+ break;
diff --git a/patches/fuse-2.9.9/0003-util-ulockmgr_server.c-conditionally-define-closefro.patch b/patches/fuse-2.9.9/0003-util-ulockmgr_server.c-conditionally-define-closefro.patch
new file mode 100644
index 000000000..7e252df4b
--- /dev/null
+++ b/patches/fuse-2.9.9/0003-util-ulockmgr_server.c-conditionally-define-closefro.patch
@@ -0,0 +1,59 @@
+From: Sam James <sam@gentoo.org>
+Date: Sat, 24 Jul 2021 22:02:45 +0100
+Subject: [PATCH] util/ulockmgr_server.c: conditionally define closefrom (fix
+ glibc-2.34+)
+
+closefrom(3) has joined us in glibc-land from *BSD and Solaris. Since
+it's available in glibc 2.34+, we want to detect it and only define our
+fallback if the libc doesn't provide it.
+
+Bug: https://bugs.gentoo.org/803923
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ configure.ac | 1 +
+ util/ulockmgr_server.c | 6 ++++++
+ 2 files changed, 7 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 9946a0efa4a2..a2d481aa9c04 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -55,6 +55,7 @@ fi
+
+ AC_CHECK_FUNCS([fork setxattr fdatasync splice vmsplice utimensat])
+ AC_CHECK_FUNCS([posix_fallocate])
++AC_CHECK_FUNCS([closefrom])
+ AC_CHECK_MEMBERS([struct stat.st_atim])
+ AC_CHECK_MEMBERS([struct stat.st_atimespec])
+
+diff --git a/util/ulockmgr_server.c b/util/ulockmgr_server.c
+index 273c7d9231ae..a04dac5c6548 100644
+--- a/util/ulockmgr_server.c
++++ b/util/ulockmgr_server.c
+@@ -22,6 +22,10 @@
+ #include <sys/socket.h>
+ #include <sys/wait.h>
+
++#ifdef HAVE_CONFIG_H
++ #include "config.h"
++#endif
++
+ struct message {
+ unsigned intr : 1;
+ unsigned nofd : 1;
+@@ -124,6 +128,7 @@ static int receive_message(int sock, void *buf, size_t buflen, int *fdp,
+ return res;
+ }
+
++#if !defined(HAVE_CLOSEFROM)
+ static int closefrom(int minfd)
+ {
+ DIR *dir = opendir("/proc/self/fd");
+@@ -141,6 +146,7 @@ static int closefrom(int minfd)
+ }
+ return 0;
+ }
++#endif
+
+ static void send_reply(int cfd, struct message *msg)
+ {
diff --git a/patches/fuse-2.9.9/0001-use-asm-types.h-to-define-__u64-etc.patch b/patches/fuse-2.9.9/0100-use-asm-types.h-to-define-__u64-etc.patch
index 5b79e61a1..5b79e61a1 100644
--- a/patches/fuse-2.9.9/0001-use-asm-types.h-to-define-__u64-etc.patch
+++ b/patches/fuse-2.9.9/0100-use-asm-types.h-to-define-__u64-etc.patch
diff --git a/patches/dropwatch-1.5.3/autogen.sh b/patches/fuse-2.9.9/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/dropwatch-1.5.3/autogen.sh
+++ b/patches/fuse-2.9.9/autogen.sh
diff --git a/patches/fuse-2.9.9/series b/patches/fuse-2.9.9/series
index 8ade71715..4e490d092 100644
--- a/patches/fuse-2.9.9/series
+++ b/patches/fuse-2.9.9/series
@@ -1,4 +1,9 @@
# generated by git-ptx-patches
#tag:base --start-number 1
-0001-use-asm-types.h-to-define-__u64-etc.patch
-# 14044a304d2cf460a7b33d5e064996e9 - git-ptx-patches magic
+#tag:upstream --start-number 1
+0001-Whitelist-UFSD-backport-to-2.9-branch-452.patch
+0002-Correct-errno-comparison-571.patch
+0003-util-ulockmgr_server.c-conditionally-define-closefro.patch
+#tag:ptxdist --start-number 100
+0100-use-asm-types.h-to-define-__u64-etc.patch
+# 65207a5295e69748308b0f9451983b5e - git-ptx-patches magic
diff --git a/patches/glmark2-2020.04/0001-Build-Fix-Python-3-incompatibility.patch b/patches/glmark2-2020.04/0001-Build-Fix-Python-3-incompatibility.patch
deleted file mode 100644
index 88c85406a..000000000
--- a/patches/glmark2-2020.04/0001-Build-Fix-Python-3-incompatibility.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Marvin Schmidt <marv@exherbo.org>
-Date: Sun, 3 May 2020 18:20:05 +0200
-Subject: [PATCH] Build: Fix Python 3 incompatibility
-
----
- wscript | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/wscript b/wscript
-index aefde706be0a..e09fa7850e1c 100644
---- a/wscript
-+++ b/wscript
-@@ -20,7 +20,7 @@ FLAVORS = {
- 'x11-gl' : 'glmark2',
- 'x11-glesv2' : 'glmark2-es2',
- }
--FLAVORS_STR = ", ".join(sorted(FLAVORS.keys() + ['all-linux', 'all-win32']))
-+FLAVORS_STR = ", ".join(sorted(list(FLAVORS) + ['all-linux', 'all-win32']))
-
- def linux_flavors():
- return [f for f in FLAVORS.keys() if not f.startswith('win32')]
diff --git a/patches/glmark2-2020.04/0002-drm-Don-t-prefer-RGBA-component-widths-larger-than-8.patch b/patches/glmark2-2020.04/0002-drm-Don-t-prefer-RGBA-component-widths-larger-than-8.patch
deleted file mode 100644
index 490c4815c..000000000
--- a/patches/glmark2-2020.04/0002-drm-Don-t-prefer-RGBA-component-widths-larger-than-8.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Alexandros Frantzis <alexandros.frantzis@collabora.com>
-Date: Mon, 13 Jul 2020 11:16:28 +0300
-Subject: [PATCH] drm: Don't prefer RGBA component widths larger than 8
-
-Don't prefer RGBA component widths larger than 8, since they are
-unlikely to be what the users want or properly supported for display.
-Such widths can still be used, but only if explicitly requested.
-
-Fixes #125
----
- src/gl-visual-config.cpp | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/src/gl-visual-config.cpp b/src/gl-visual-config.cpp
-index dbd87d2a3c3c..013cc646356b 100644
---- a/src/gl-visual-config.cpp
-+++ b/src/gl-visual-config.cpp
-@@ -108,6 +108,14 @@ GLVisualConfig::score_component(int component, int target, int scale) const
- /* Reward exact matches with the maximum per component score */
- score = MAXIMUM_COMPONENT_SCORE;
- }
-+ else if (component > 8 && target <= 8 && scale > 1)
-+ {
-+ /* Penalize RGBA component widths larger than 8, since they are
-+ * unlikely to be what the users want or properly supported for
-+ * display. Such widths can still be used, but only if explicitly
-+ * requested. */
-+ score = UNACCEPTABLE_COMPONENT_PENALTY;
-+ }
- else
- {
- /*
diff --git a/patches/glmark2-2020.04/series b/patches/glmark2-2020.04/series
deleted file mode 100644
index 48cf812db..000000000
--- a/patches/glmark2-2020.04/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Build-Fix-Python-3-incompatibility.patch
-0002-drm-Don-t-prefer-RGBA-component-widths-larger-than-8.patch
-# 1ffb9f179a40f263a2758a123744c53e - git-ptx-patches magic
diff --git a/patches/glu-9.0.1/0001-build-fix-the-debug-parameter-to-properly-handle-dis.patch b/patches/glu-9.0.1/0001-build-fix-the-debug-parameter-to-properly-handle-dis.patch
deleted file mode 100644
index c1bb17c63..000000000
--- a/patches/glu-9.0.1/0001-build-fix-the-debug-parameter-to-properly-handle-dis.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Lucas Stach <l.stach@pengutronix.de>
-Date: Mon, 5 Oct 2020 16:45:11 +0200
-Subject: [PATCH] build: fix the debug parameter to properly handle
- --disable-debug
-
-Right now the the enableval isn't checked, so the debug options are added
-for --enable-debug and --disable-debug, which is quite surprising for a
-user. Fix this to peroply handle the disable case.
----
- configure.ac | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 6d9b04b45cb2..f1bb7b14eae4 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -42,8 +42,11 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
- AC_ARG_ENABLE(debug,
- AS_HELP_STRING([--enable-debug],
- [Enable debugging information]),
-- [CFLAGS="$CFLAGS -g -O0 -DDEBUG"
-- CXXFLAGS="$CXXFLAGS -g -O0 -DDEBUG"],
-+ [if test x$enableval = xyes; then
-+ CFLAGS="$CFLAGS -g -O0 -DDEBUG"
-+ CXXFLAGS="$CXXFLAGS -g -O0 -DDEBUG"; else
-+ CFLAGS="$CFLAGS -DNDEBUG"
-+ CXXFLAGS="$CXXFLAGS -DNDEBUG"; fi],
- [CFLAGS="$CFLAGS -DNDEBUG"
- CXXFLAGS="$CXXFLAGS -DNDEBUG"])
-
diff --git a/patches/glu-9.0.1/series b/patches/glu-9.0.1/series
deleted file mode 100644
index 1ad43d010..000000000
--- a/patches/glu-9.0.1/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-build-fix-the-debug-parameter-to-properly-handle-dis.patch
-# d78721868a7016e340f9e3fe654aa62e - git-ptx-patches magic
diff --git a/patches/gnutls-3.6.15/0001-don-t-try-ru-build-run-code-generator.patch b/patches/gnutls-3.6.15/0001-don-t-try-ru-build-run-code-generator.patch
deleted file mode 100644
index c879ec7f8..000000000
--- a/patches/gnutls-3.6.15/0001-don-t-try-ru-build-run-code-generator.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Fri, 3 Apr 2020 13:07:30 +0200
-Subject: [PATCH] don't try ru build / run code generator
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- lib/nettle/Makefile.am | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/lib/nettle/Makefile.am b/lib/nettle/Makefile.am
-index aae87e09023a..de6f9ed44399 100644
---- a/lib/nettle/Makefile.am
-+++ b/lib/nettle/Makefile.am
-@@ -99,6 +99,8 @@ ecc_generated_headers = \
- BUILT_SOURCES = $(ecc_generated_headers)
- EXTRA_DIST = $(ecc_generated_headers) ecc/eccdata.stamp
-
-+if !CROSS_COMPILING
-+
- noinst_PROGRAMS = ecc/eccdata$(EXEEXT)
-
- ecc_eccdata_SOURCES = ecc/eccdata.c
-@@ -126,6 +128,8 @@ ecc/ecc-gost-gc512a-32.h: ecc/eccdata.stamp
- ecc/ecc-gost-gc512a-64.h: ecc/eccdata.stamp
- $(AM_V_GEN)ecc/eccdata$(EXEEXT) gost_gc512a 43 6 64 > $@T && mv $@T $@
-
-+endif
-+
- libcrypto_la_SOURCES += \
- gost/ecc-gost-hash.c nettle-alloca.h ecc-gost-curve.h
-
diff --git a/patches/gnutls-3.6.15/autogen.sh b/patches/gnutls-3.6.15/autogen.sh
deleted file mode 100755
index d99000165..000000000
--- a/patches/gnutls-3.6.15/autogen.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-# only automake to avoid autopoint / gettext dependency
-automake
diff --git a/patches/gnutls-3.6.15/series b/patches/gnutls-3.6.15/series
deleted file mode 100644
index 1a79ecf82..000000000
--- a/patches/gnutls-3.6.15/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-don-t-try-ru-build-run-code-generator.patch
-# b14a2a9426010360472bbafa176de894 - git-ptx-patches magic
diff --git a/patches/gobject-introspection-1.66.1/0002-meson-fix-building-with-Dbuild_introspection_data-fa.patch b/patches/gobject-introspection-1.66.1/0002-meson-fix-building-with-Dbuild_introspection_data-fa.patch
deleted file mode 100644
index f788c564f..000000000
--- a/patches/gobject-introspection-1.66.1/0002-meson-fix-building-with-Dbuild_introspection_data-fa.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 3 Dec 2020 15:29:01 +0100
-Subject: [PATCH] meson: fix building with -Dbuild_introspection_data=false
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- meson.build | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index 14af2b17109b..8429553d483e 100644
---- a/meson.build
-+++ b/meson.build
-@@ -224,7 +224,7 @@ subdir('docs')
-
- # The tests will also run, which is not possible if they
- # were built for a different architecture.
--if not meson.is_cross_build()
-+if not meson.is_cross_build() and get_option('build_introspection_data')
- subdir('tests')
- endif
-
-@@ -283,7 +283,7 @@ pkg.generate(
- # FIXME: meson.override_dependency() and declare_dependency()'s variable arguments
- # are new in Meson 0.54.0, older versions of Meson won't be able to use g-i as
- # subproject anyway
--if meson.version().version_compare('>=0.54.0')
-+if meson.version().version_compare('>=0.54.0') and get_option('build_introspection_data')
- girepo_dep = declare_dependency(
- sources: typelibs,
- dependencies: girepo_dep,
diff --git a/patches/gobject-introspection-1.66.1/series b/patches/gobject-introspection-1.66.1/series
deleted file mode 100644
index 1b4ae1e76..000000000
--- a/patches/gobject-introspection-1.66.1/series
+++ /dev/null
@@ -1,6 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-dumper.py-don-t-close-fds.patch
-0002-meson-fix-building-with-Dbuild_introspection_data-fa.patch
-0003-HACK-don-t-build-the-python-module-when-cross-compil.patch
-# 304833ca29e000d20d22ec6022863d8c - git-ptx-patches magic
diff --git a/patches/gobject-introspection-1.66.1/0001-dumper.py-don-t-close-fds.patch b/patches/gobject-introspection-1.72.0/0001-dumper.py-don-t-close-fds.patch
index 05606e784..cf032b35c 100644
--- a/patches/gobject-introspection-1.66.1/0001-dumper.py-don-t-close-fds.patch
+++ b/patches/gobject-introspection-1.72.0/0001-dumper.py-don-t-close-fds.patch
@@ -10,7 +10,7 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/giscanner/dumper.py b/giscanner/dumper.py
-index e4b6ea03a301..cb3a7ad1659e 100644
+index 22afd61efb67..08c3ae19f4f2 100644
--- a/giscanner/dumper.py
+++ b/giscanner/dumper.py
@@ -275,7 +275,7 @@ class DumpCompiler(object):
diff --git a/patches/gobject-introspection-1.66.1/0003-HACK-don-t-build-the-python-module-when-cross-compil.patch b/patches/gobject-introspection-1.72.0/0002-HACK-don-t-build-the-python-module-when-cross-compil.patch
index ae368408a..dc64696d9 100644
--- a/patches/gobject-introspection-1.66.1/0003-HACK-don-t-build-the-python-module-when-cross-compil.patch
+++ b/patches/gobject-introspection-1.72.0/0002-HACK-don-t-build-the-python-module-when-cross-compil.patch
@@ -9,10 +9,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/giscanner/meson.build b/giscanner/meson.build
-index a3b06f37b912..b6dfb7144c76 100644
+index 3d7dc678a260..79795d54ac2d 100644
--- a/giscanner/meson.build
+++ b/giscanner/meson.build
-@@ -99,6 +99,7 @@ giscanner_lib = static_library('giscanner',
+@@ -97,6 +97,7 @@ giscanner_lib = static_library('giscanner',
dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep],
)
@@ -20,7 +20,7 @@ index a3b06f37b912..b6dfb7144c76 100644
# https://github.com/mesonbuild/meson/issues/4117
if host_machine.system() == 'windows'
python_ext_dep = python.dependency()
-@@ -120,3 +121,6 @@ giscanner_pymod = python.extension_module('_giscanner', ['giscannermodule.c'],
+@@ -118,3 +119,6 @@ giscanner_pymod = python.extension_module('_giscanner', ['giscannermodule.c'],
install: true,
install_dir: giscannerdir,
)
@@ -28,12 +28,12 @@ index a3b06f37b912..b6dfb7144c76 100644
+giscanner_pymod = []
+endif
diff --git a/meson.build b/meson.build
-index 8429553d483e..ec791006b29e 100644
+index e15f6f9965ca..52fd99ff1409 100644
--- a/meson.build
+++ b/meson.build
-@@ -157,8 +157,10 @@ endif
- libffi_dep = dependency('libffi',
- fallback : ['libffi', 'ffi_dep'])
+@@ -162,8 +162,10 @@ configure_file(
+ output: 'config.h'
+ )
-# python headers
-cc.check_header('Python.h', dependencies: [python.dependency()], required: true)
diff --git a/patches/gobject-introspection-1.72.0/series b/patches/gobject-introspection-1.72.0/series
new file mode 100644
index 000000000..4d340c52d
--- /dev/null
+++ b/patches/gobject-introspection-1.72.0/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-dumper.py-don-t-close-fds.patch
+0002-HACK-don-t-build-the-python-module-when-cross-compil.patch
+# 5897d2843253341a60a4fb45e833d86d - git-ptx-patches magic
diff --git a/patches/gpsd-3.21/0003-SConstruct-don-t-make-python-files-without-shebang-e.patch b/patches/gpsd-3.21/0003-SConstruct-don-t-make-python-files-without-shebang-e.patch
deleted file mode 100644
index 809d98a6d..000000000
--- a/patches/gpsd-3.21/0003-SConstruct-don-t-make-python-files-without-shebang-e.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Fri, 14 Aug 2020 09:44:34 +0200
-Subject: [PATCH] SConstruct: don't make python files without shebang
- executable
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- SConstruct | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/SConstruct b/SConstruct
-index 434141f3e46b..d303c3aa6d20 100644
---- a/SConstruct
-+++ b/SConstruct
-@@ -2116,7 +2116,7 @@ for fn in templated:
- env.Default(builder)
- # set read-only to alert people trying to edit the files.
- env.AddPostAction(builder, 'chmod -w $TARGET')
-- if ((fn.endswith(".py.in") or
-+ if ((fn[:-3] in ['contrib/skyview2svg.py', 'gps/gps.py'] or
- fn[:-3] in python_progs or
- fn[:-3] in ['contrib/ntpshmviz', 'contrib/webgps'])):
- # set python files to executable
diff --git a/patches/gpsd-3.21/series b/patches/gpsd-3.21/series
deleted file mode 100644
index bbfb1be7d..000000000
--- a/patches/gpsd-3.21/series
+++ /dev/null
@@ -1,7 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Search-for-ncursesw-pkgconfig.patch
-0002-SConstruct-Use-target-option-to-decide-whenewer-to-r.patch
-0003-SConstruct-don-t-make-python-files-without-shebang-e.patch
-0004-SConstruct-don-t-use-lnsl.patch
-# a4f439aa9ecaa21523935c6cada0b0dc - git-ptx-patches magic
diff --git a/patches/gpsd-3.21/0001-Search-for-ncursesw-pkgconfig.patch b/patches/gpsd-3.23.1/0001-SConscript-Search-for-ncursesw-pkgconfig.patch
index c7b874c83..7f662bf2d 100644
--- a/patches/gpsd-3.21/0001-Search-for-ncursesw-pkgconfig.patch
+++ b/patches/gpsd-3.23.1/0001-SConscript-Search-for-ncursesw-pkgconfig.patch
@@ -1,20 +1,20 @@
From: Ladislav Michl <ladis@linux-mips.org>
Date: Fri, 25 Oct 2019 14:18:30 +0200
-Subject: [PATCH] Search for ncursesw pkgconfig
+Subject: [PATCH] SConscript: Search for ncursesw pkgconfig
PTXDist can be configured to build wide char version of ncurses
-which SConstruct is unaware of.
+which SConscript is unaware of.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
- SConstruct | 2 ++
+ SConscript | 2 ++
1 file changed, 2 insertions(+)
-diff --git a/SConstruct b/SConstruct
-index e15d63f6ede0..71643c428f26 100644
---- a/SConstruct
-+++ b/SConstruct
-@@ -1067,6 +1067,8 @@ else:
+diff --git a/SConscript b/SConscript
+index 8c6136d9d623..dc7a5c997357 100644
+--- a/SConscript
++++ b/SConscript
+@@ -1036,6 +1036,8 @@ if not cleaning and not helping:
ncurseslibs = pkg_config('ncurses', rpath_hack=True)
if config.CheckPKG('tinfo'):
ncurseslibs += pkg_config('tinfo', rpath_hack=True)
diff --git a/patches/gpsd-3.21/0002-SConstruct-Use-target-option-to-decide-whenewer-to-r.patch b/patches/gpsd-3.23.1/0002-SConscript-Use-target-option-to-decide-whenewer-to-r.patch
index d7c6945ae..ef8974979 100644
--- a/patches/gpsd-3.21/0002-SConstruct-Use-target-option-to-decide-whenewer-to-r.patch
+++ b/patches/gpsd-3.23.1/0002-SConscript-Use-target-option-to-decide-whenewer-to-r.patch
@@ -1,17 +1,18 @@
From: Ladislav Michl <ladis@linux-mips.org>
Date: Sun, 2 Feb 2020 09:45:04 +0100
-Subject: [PATCH] SConstruct: Use 'target' option to decide whenewer to restart
+Subject: [PATCH] SConscript: Use 'target' option to decide whenewer to restart
systemd
+Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
- SConstruct | 2 +-
+ SConscript | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/SConstruct b/SConstruct
-index 71643c428f26..434141f3e46b 100644
---- a/SConstruct
-+++ b/SConstruct
-@@ -2853,7 +2853,7 @@ udev_install = Utility('udev-install', 'install', [
+diff --git a/SConscript b/SConscript
+index dc7a5c997357..e090a3a22e24 100644
+--- a/SConscript
++++ b/SConscript
+@@ -3102,7 +3102,7 @@ udev_install = Utility('udev-install', 'install', [
if env['systemd']:
env.Requires(udev_install, systemd_install)
diff --git a/patches/gpsd-3.23.1/0003-SConscript-don-t-make-python-files-without-shebang-e.patch b/patches/gpsd-3.23.1/0003-SConscript-don-t-make-python-files-without-shebang-e.patch
new file mode 100644
index 000000000..1c4caef05
--- /dev/null
+++ b/patches/gpsd-3.23.1/0003-SConscript-don-t-make-python-files-without-shebang-e.patch
@@ -0,0 +1,23 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 14 Aug 2020 09:44:34 +0200
+Subject: [PATCH] SConscript: don't make python files without shebang
+ executable
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ SConscript | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/SConscript b/SConscript
+index e090a3a22e24..400af2c1fdb3 100644
+--- a/SConscript
++++ b/SConscript
+@@ -2263,7 +2263,7 @@ for (tgt, src) in templated.items():
+ env.Default(builder)
+ # set read-only to alert people trying to edit the files.
+ env.AddPostAction(builder, 'chmod -w $TARGET')
+- if ((src.endswith(".py.in") or
++ if (((src.endswith(".py.in") and src not in ['gps/__init__.py.in', 'gps/packet.py.in']) or
+ tgt in python_progs or
+ tgt in ['contrib/ntpshmviz', 'contrib/webgps'])):
+ # set python files to executable
diff --git a/patches/gpsd-3.21/0004-SConstruct-don-t-use-lnsl.patch b/patches/gpsd-3.23.1/0004-SConscript-don-t-use-lnsl.patch
index e857f8faa..f5fd260e9 100644
--- a/patches/gpsd-3.21/0004-SConstruct-don-t-use-lnsl.patch
+++ b/patches/gpsd-3.23.1/0004-SConscript-don-t-use-lnsl.patch
@@ -1,19 +1,19 @@
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Fri, 13 Nov 2020 11:55:47 +0100
-Subject: [PATCH] SConstruct: don't use -lnsl
+Subject: [PATCH] SConscript: don't use -lnsl
It may be found on Linux but is not actually needed.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- SConstruct | 8 +-------
+ SConscript | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
-diff --git a/SConstruct b/SConstruct
-index d303c3aa6d20..ce627e93f65e 100644
---- a/SConstruct
-+++ b/SConstruct
-@@ -1113,13 +1113,7 @@ else:
+diff --git a/SConscript b/SConscript
+index 400af2c1fdb3..d6678ba9bd13 100644
+--- a/SConscript
++++ b/SConscript
+@@ -1082,13 +1082,7 @@ if not cleaning and not helping:
else:
confdefs.append("/* #undef HAVE_LIBRT */\n")
diff --git a/patches/gpsd-3.23.1/series b/patches/gpsd-3.23.1/series
new file mode 100644
index 000000000..931e45a04
--- /dev/null
+++ b/patches/gpsd-3.23.1/series
@@ -0,0 +1,7 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-SConscript-Search-for-ncursesw-pkgconfig.patch
+0002-SConscript-Use-target-option-to-decide-whenewer-to-r.patch
+0003-SConscript-don-t-make-python-files-without-shebang-e.patch
+0004-SConscript-don-t-use-lnsl.patch
+# 22a1bb00c3298707123a09b397fd475a - git-ptx-patches magic
diff --git a/patches/grpc-1.21.0/0001-Add-pkg-config-files.patch b/patches/grpc-1.21.0/0001-Add-pkg-config-files.patch
deleted file mode 100644
index 713419bd9..000000000
--- a/patches/grpc-1.21.0/0001-Add-pkg-config-files.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Clemens Gruber <clemens.gruber@pqgruber.com>
-Date: Mon, 10 Dec 2018 13:44:53 +0100
-Subject: [PATCH] Add pkg-config files
-
----
- grpc++.pc.in | 12 ++++++++++++
- grpc.pc.in | 12 ++++++++++++
- 2 files changed, 24 insertions(+)
- create mode 100644 grpc++.pc.in
- create mode 100644 grpc.pc.in
-
-diff --git a/grpc++.pc.in b/grpc++.pc.in
-new file mode 100644
-index 000000000000..c2677831a9c7
---- /dev/null
-+++ b/grpc++.pc.in
-@@ -0,0 +1,12 @@
-+prefix=${pcfiledir}/../..
-+exec_prefix=${prefix}
-+libdir=${prefix}/lib
-+includedir=${prefix}/include
-+
-+Name: gRPC++
-+Description: C++ wrapper for gRPC
-+Version: @VERSION@
-+Cflags: -I${includedir}
-+Requires.private: grpc protobuf
-+Libs: -L${libdir} -lgrpc++
-+Libs.private:
-diff --git a/grpc.pc.in b/grpc.pc.in
-new file mode 100644
-index 000000000000..917c57a5e074
---- /dev/null
-+++ b/grpc.pc.in
-@@ -0,0 +1,12 @@
-+prefix=${pcfiledir}/../..
-+exec_prefix=${prefix}
-+libdir=${prefix}/lib
-+includedir=${prefix}/include
-+
-+Name: gRPC
-+Description: high performance general RPC framework
-+Version: @VERSION@
-+Cflags: -I${includedir}
-+Requires.private: zlib libcares openssl
-+Libs: -L{libdir} -lgrpc
-+Libs.private: -lgpr
diff --git a/patches/grpc-1.21.0/0100-Fix-gettid-naming-conflict.patch b/patches/grpc-1.21.0/0100-Fix-gettid-naming-conflict.patch
deleted file mode 100644
index 65979bbce..000000000
--- a/patches/grpc-1.21.0/0100-Fix-gettid-naming-conflict.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Juanli Shen <juanlishen@google.com>
-Date: Fri, 23 Aug 2019 08:46:09 -0700
-Subject: [PATCH] Fix gettid() naming conflict
-
----
- src/core/lib/gpr/log_linux.cc | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc
-index 561276f0c20a..81026e5689bc 100644
---- a/src/core/lib/gpr/log_linux.cc
-+++ b/src/core/lib/gpr/log_linux.cc
-@@ -40,7 +40,9 @@
- #include <time.h>
- #include <unistd.h>
-
--static long gettid(void) { return syscall(__NR_gettid); }
-+// Not naming it as gettid() to avoid duplicate declarations when complied with
-+// GCC 9.1.
-+static long local_gettid(void) { return syscall(__NR_gettid); }
-
- void gpr_log(const char* file, int line, gpr_log_severity severity,
- const char* format, ...) {
-@@ -70,7 +72,7 @@ void gpr_default_log(gpr_log_func_args* args) {
- gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
- struct tm tm;
- static __thread long tid = 0;
-- if (tid == 0) tid = gettid();
-+ if (tid == 0) tid = local_gettid();
-
- timer = static_cast<time_t>(now.tv_sec);
- final_slash = strrchr(args->file, '/');
diff --git a/patches/grpc-1.21.0/0101-Rename-gettid-functions.patch b/patches/grpc-1.21.0/0101-Rename-gettid-functions.patch
deleted file mode 100644
index b9ece8175..000000000
--- a/patches/grpc-1.21.0/0101-Rename-gettid-functions.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From: Benjamin Peterson <benjamin@dropbox.com>
-Date: Fri, 3 May 2019 08:11:00 -0700
-Subject: [PATCH] Rename gettid() functions.
-
-glibc 2.30 will declare its own gettid; see https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92. Rename the grpc versions to avoid naming conflicts.
----
- src/core/lib/gpr/log_linux.cc | 6 ++----
- src/core/lib/gpr/log_posix.cc | 4 ++--
- src/core/lib/iomgr/ev_epollex_linux.cc | 4 ++--
- 3 files changed, 6 insertions(+), 8 deletions(-)
-
-diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc
-index 81026e5689bc..8b597b4cf2f1 100644
---- a/src/core/lib/gpr/log_linux.cc
-+++ b/src/core/lib/gpr/log_linux.cc
-@@ -40,9 +40,7 @@
- #include <time.h>
- #include <unistd.h>
-
--// Not naming it as gettid() to avoid duplicate declarations when complied with
--// GCC 9.1.
--static long local_gettid(void) { return syscall(__NR_gettid); }
-+static long sys_gettid(void) { return syscall(__NR_gettid); }
-
- void gpr_log(const char* file, int line, gpr_log_severity severity,
- const char* format, ...) {
-@@ -72,7 +70,7 @@ void gpr_default_log(gpr_log_func_args* args) {
- gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
- struct tm tm;
- static __thread long tid = 0;
-- if (tid == 0) tid = local_gettid();
-+ if (tid == 0) tid = sys_gettid();
-
- timer = static_cast<time_t>(now.tv_sec);
- final_slash = strrchr(args->file, '/');
-diff --git a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc
-index b6edc14ab6b9..2f7c6ce37605 100644
---- a/src/core/lib/gpr/log_posix.cc
-+++ b/src/core/lib/gpr/log_posix.cc
-@@ -31,7 +31,7 @@
- #include <string.h>
- #include <time.h>
-
--static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
-+static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
-
- void gpr_log(const char* file, int line, gpr_log_severity severity,
- const char* format, ...) {
-@@ -86,7 +86,7 @@ void gpr_default_log(gpr_log_func_args* args) {
- char* prefix;
- gpr_asprintf(&prefix, "%s%s.%09d %7" PRIdPTR " %s:%d]",
- gpr_log_severity_string(args->severity), time_buffer,
-- (int)(now.tv_nsec), gettid(), display_file, args->line);
-+ (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
-
- fprintf(stderr, "%-70s %s\n", prefix, args->message);
- gpr_free(prefix);
-diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
-index 08116b3ab534..76f598443120 100644
---- a/src/core/lib/iomgr/ev_epollex_linux.cc
-+++ b/src/core/lib/iomgr/ev_epollex_linux.cc
-@@ -1102,7 +1102,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
- }
-
- #ifndef NDEBUG
--static long gettid(void) { return syscall(__NR_gettid); }
-+static long sys_gettid(void) { return syscall(__NR_gettid); }
- #endif
-
- /* pollset->mu lock must be held by the caller before calling this.
-@@ -1122,7 +1122,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
- #define WORKER_PTR (&worker)
- #endif
- #ifndef NDEBUG
-- WORKER_PTR->originator = gettid();
-+ WORKER_PTR->originator = sys_gettid();
- #endif
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO,
diff --git a/patches/grpc-1.21.0/series b/patches/grpc-1.21.0/series
deleted file mode 100644
index 72f6287db..000000000
--- a/patches/grpc-1.21.0/series
+++ /dev/null
@@ -1,7 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Add-pkg-config-files.patch
-#tag:upstream --start-number 100
-0100-Fix-gettid-naming-conflict.patch
-0101-Rename-gettid-functions.patch
-# c5d68a15d62fcc8495ce48a49dd9d92d - git-ptx-patches magic
diff --git a/patches/gst-plugins-bad-0.10.23/0001-remove-endianness-swapping.patch b/patches/gst-plugins-bad-0.10.23/0001-remove-endianness-swapping.patch
deleted file mode 100644
index 5dcc70105..000000000
--- a/patches/gst-plugins-bad-0.10.23/0001-remove-endianness-swapping.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From: Luotao Fu <lfu@pengutronix.de>
-Date: Thu, 11 Dec 2008 11:57:48 +0100
-Subject: [PATCH] remove endianness swapping
-
- Swapping r- g- and bmask here is weird. It turns i.E. RGB888 to BGR888. For
- formats like RGB666 it turns the mask into a mess. Seems that gstreamer
- treat all True color as Big Endian. Still I doubt that it makes sense to
- swap the masks. I'm however not quite sure about this, comments are highly
- welcome.
-
-Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
----
- sys/fbdev/gstfbdevsink.c | 14 +-------------
- 1 files changed, 1 insertions(+), 13 deletions(-)
-
-diff --git a/sys/fbdev/gstfbdevsink.c b/sys/fbdev/gstfbdevsink.c
-index 989d48f..62b9986 100644
---- a/sys/fbdev/gstfbdevsink.c
-+++ b/sys/fbdev/gstfbdevsink.c
-@@ -153,21 +153,9 @@ gst_fbdevsink_getcaps (GstBaseSink * bsink)
-
- switch (fbdevsink->varinfo.bits_per_pixel) {
- case 32:
-- /* swap endian of masks */
-- rmask = swapendian (rmask);
-- gmask = swapendian (gmask);
-- bmask = swapendian (bmask);
-+ case 24:
- endianness = 4321;
- break;
-- case 24:{
-- /* swap red and blue masks */
-- uint32_t t = rmask;
--
-- rmask = bmask;
-- bmask = t;
-- endianness = 4321;
-- break;
-- }
- case 15:
- case 16:
- endianness = 1234;
---
-1.7.4.1
-
diff --git a/patches/gst-plugins-bad-0.10.23/0002-add-rgb666-support.patch b/patches/gst-plugins-bad-0.10.23/0002-add-rgb666-support.patch
deleted file mode 100644
index 5b9cf7a16..000000000
--- a/patches/gst-plugins-bad-0.10.23/0002-add-rgb666-support.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From: Luotao Fu <lfu@pengutronix.de>
-Date: Thu, 11 Dec 2008 12:03:59 +0100
-Subject: [PATCH] add rgb666 support
-
- This one adds support for rgb666 to fbdevsink. It's an exotic format, but still
- can be found on especially some embedded devices. The Modelines are taken
- directly from video.h of the video plugin, which is included by gstdevsink.
- It'd probably be cleaner to split this in a separate patch for plugins-base.
- I put the stuffs together for now for easier review. Patches for some sources
- with rgb666 capability are coming soon.
-
-Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
----
- sys/fbdev/gstfbdevsink.c | 19 +++++++++++++++++++
- 1 files changed, 19 insertions(+), 0 deletions(-)
-
-diff --git a/sys/fbdev/gstfbdevsink.c b/sys/fbdev/gstfbdevsink.c
-index 62b9986..b7d3f1a 100644
---- a/sys/fbdev/gstfbdevsink.c
-+++ b/sys/fbdev/gstfbdevsink.c
-@@ -69,9 +69,28 @@ static GstCaps *gst_fbdevsink_getcaps (GstBaseSink * bsink);
-
- static GstVideoSinkClass *parent_class = NULL;
-
-+#define GST_VIDEO_BYTE1_MASK_18 "0x0003F000"
-+#define GST_VIDEO_BYTE2_MASK_18 "0x00000FC0"
-+#define GST_VIDEO_BYTE3_MASK_18 "0x0000003F"
-+#define __GST_VIDEO_CAPS_MAKE_18(R, G, B) \
-+ "video/x-raw-rgb, " \
-+ "bpp = (int) 32, " \
-+ "depth = (int) 18, " \
-+ "endianness = (int) BIG_ENDIAN, " \
-+ "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_18 ", " \
-+ "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_18 ", " \
-+ "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_18 ", " \
-+ "width = " GST_VIDEO_SIZE_RANGE ", " \
-+ "height = " GST_VIDEO_SIZE_RANGE ", " \
-+ "framerate = " GST_VIDEO_FPS_RANGE
-+
-+#define GST_VIDEO_CAPS_RGB666 \
-+ __GST_VIDEO_CAPS_MAKE_18 (1, 2, 3)
-+
- #define GST_FBDEV_TEMPLATE_CAPS \
- GST_VIDEO_CAPS_RGB_15 \
- ";" GST_VIDEO_CAPS_RGB_16 \
-+ ";" GST_VIDEO_CAPS_RGB666 \
- ";" GST_VIDEO_CAPS_BGR \
- ";" GST_VIDEO_CAPS_BGRx \
- ";" GST_VIDEO_CAPS_xBGR \
---
-1.7.4.1
-
diff --git a/patches/gst-plugins-bad-0.10.23/series b/patches/gst-plugins-bad-0.10.23/series
deleted file mode 100644
index 27b2a0226..000000000
--- a/patches/gst-plugins-bad-0.10.23/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-0001-remove-endianness-swapping.patch
-0002-add-rgb666-support.patch
-# a70d7259ce8042d3a4e1640d6f8b4861 - git-ptx-patches magic
diff --git a/patches/gst-plugins-base-0.10.36/0001-added-RGB666-Support-to-ffmpegcolorspace.patch b/patches/gst-plugins-base-0.10.36/0001-added-RGB666-Support-to-ffmpegcolorspace.patch
deleted file mode 100644
index e18ce465b..000000000
--- a/patches/gst-plugins-base-0.10.36/0001-added-RGB666-Support-to-ffmpegcolorspace.patch
+++ /dev/null
@@ -1,296 +0,0 @@
-From: Luotao Fu <lfu@pengutronix.de>
-Date: Thu, 11 Dec 2008 17:02:52 +0100
-Subject: [PATCH] added RGB666 Support to ffmpegcolorspace
-
-This one adds RGB666 Support to ffmpegcolorspace
-Still very hacky, need to be enhanced before submitting to mainline
-
-Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
----
- gst/ffmpegcolorspace/avcodec.h | 1 +
- gst/ffmpegcolorspace/gstffmpegcodecmap.c | 26 ++++++++++--
- gst/ffmpegcolorspace/imgconvert.c | 71 ++++++++++++++++++++++++++++++--
- 3 files changed, 91 insertions(+), 7 deletions(-)
-
-diff --git a/gst/ffmpegcolorspace/avcodec.h b/gst/ffmpegcolorspace/avcodec.h
-index 6067aedb5e1b..6714b60350b1 100644
---- a/gst/ffmpegcolorspace/avcodec.h
-+++ b/gst/ffmpegcolorspace/avcodec.h
-@@ -94,6 +94,7 @@ enum PixelFormat {
-
- PIX_FMT_AYUV4444, ///< Packed pixel, A0 Y0 Cb Cr
- PIX_FMT_YUVA420P, ///< Planar YUV 4:4:2:0 (1 Cr & Cb sample per 2x2 Y & A samples) (A420)
-+ PIX_FMT_RGB666,
- PIX_FMT_NB
- };
-
-diff --git a/gst/ffmpegcolorspace/gstffmpegcodecmap.c b/gst/ffmpegcolorspace/gstffmpegcodecmap.c
-index 97052cb454f1..a8d17cf0b583 100644
---- a/gst/ffmpegcolorspace/gstffmpegcodecmap.c
-+++ b/gst/ffmpegcolorspace/gstffmpegcodecmap.c
-@@ -228,6 +228,14 @@ gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context)
- b_mask = 0xff000000;
- #endif
- break;
-+ case PIX_FMT_RGB666:
-+ bpp = 32;
-+ depth = 18;
-+ endianness = G_BIG_ENDIAN;
-+ r_mask = 0x0003f000;
-+ g_mask = 0x00000fc0;
-+ b_mask = 0x0000003f;
-+ break;
- case PIX_FMT_BGR32:
- bpp = 32;
- depth = 24;
-@@ -684,7 +692,6 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
- }
- } else if (gst_structure_has_name (structure, "video/x-raw-rgb")) {
- gint bpp = 0, rmask = 0, endianness = 0, amask = 0, depth = 0;
--
- if (gst_structure_get_int (structure, "bpp", &bpp) &&
- gst_structure_get_int (structure, "endianness", &endianness)) {
- if (gst_structure_get_int (structure, "red_mask", &rmask)) {
-@@ -696,6 +703,8 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
- context->pix_fmt = PIX_FMT_BGRA32;
- else if (rmask == 0x00ff0000)
- context->pix_fmt = PIX_FMT_RGBA32;
-+ else if (rmask == 0x0003f000)
-+ context->pix_fmt = PIX_FMT_RGB666;
- else if (rmask == 0xff000000)
- context->pix_fmt = PIX_FMT_ARGB32;
- else // if (r_mask = 0x000000ff)
-@@ -705,6 +714,11 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
- context->pix_fmt = PIX_FMT_BGRA32;
- else if (rmask == 0x0000ff00)
- context->pix_fmt = PIX_FMT_RGBA32;
-+ /* XXX: Hack here, gstreamer seems not to treat endianess in a
-+ * consistent way between plugins. Since we only have RGB666 for
-+ * now, We have to hack it around here */
-+ else if (rmask == 0x0003f000)
-+ context->pix_fmt = PIX_FMT_RGB666;
- else if (rmask == 0x000000ff)
- context->pix_fmt = PIX_FMT_ARGB32;
- else // if (rmask == 0xff000000)
-@@ -716,7 +730,9 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
- context->pix_fmt = PIX_FMT_RGB32;
- else if (rmask == 0x0000ff00)
- context->pix_fmt = PIX_FMT_BGR32;
-- else if (rmask == 0xff000000)
-+ else if (rmask == 0x0003f000)
-+ context->pix_fmt = PIX_FMT_RGB666;
-+ else if (rmask == 0xff000000)
- context->pix_fmt = PIX_FMT_xRGB32;
- else // if (rmask == 0x000000ff)
- context->pix_fmt = PIX_FMT_BGRx32;
-@@ -725,7 +741,10 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
- context->pix_fmt = PIX_FMT_RGB32;
- else if (rmask == 0x00ff0000)
- context->pix_fmt = PIX_FMT_BGR32;
-- else if (rmask == 0x000000ff)
-+ /* XXX: Hack here, see XXX section above for more details */
-+ else if (rmask == 0x0003f000)
-+ context->pix_fmt = PIX_FMT_RGB666;
-+ else if (rmask == 0x000000ff)
- context->pix_fmt = PIX_FMT_xRGB32;
- else // if (rmask == 0xff000000)
- context->pix_fmt = PIX_FMT_BGRx32;
-@@ -922,6 +941,7 @@ gst_ffmpegcsp_avpicture_fill (AVPicture * picture,
- picture->linesize[0] = stride;
- return size;
- case PIX_FMT_AYUV4444:
-+ case PIX_FMT_RGB666:
- case PIX_FMT_RGB32:
- case PIX_FMT_RGBA32:
- case PIX_FMT_ARGB32:
-diff --git a/gst/ffmpegcolorspace/imgconvert.c b/gst/ffmpegcolorspace/imgconvert.c
-index c670e25fff9b..696f32b3353c 100644
---- a/gst/ffmpegcolorspace/imgconvert.c
-+++ b/gst/ffmpegcolorspace/imgconvert.c
-@@ -488,7 +488,18 @@ static PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
- /* .x_chroma_shift = */ 1,
- /* .y_chroma_shift = */ 1,
- /* .depth = */ 8,
-- }
-+ },
-+ /* [PIX_FMT_RGB666] = */ {
-+ /* .format = */ PIX_FMT_RGB666,
-+ /* .name = */ "rgb666",
-+ /* .nb_channels = */ 4,
-+ /* .color_type = */ FF_COLOR_RGB,
-+ /* .pixel_type = */ FF_PIXEL_PLANAR,
-+ /* .is_alpha = */ 0,
-+ /* .x_chroma_shift = */ 0,
-+ /* .y_chroma_shift = */ 0,
-+ /* .depth = */ 6,
-+ }
- };
-
- /* returns NULL if not found */
-@@ -497,7 +508,6 @@ PixFmtInfo *
- get_pix_fmt_info (enum PixelFormat format)
- {
- int i;
--
- for (i = 0; i < sizeof (pix_fmt_info) / sizeof (pix_fmt_info[0]); i++) {
- if (pix_fmt_info[i].format == format) {
- return pix_fmt_info + i;
-@@ -673,6 +683,8 @@ avg_bits_per_pixel (int pix_fmt)
- case PIX_FMT_RGB555:
- bits = 16;
- break;
-+ case PIX_FMT_RGB666:
-+ bits = 8 * pf->nb_channels;
- case PIX_FMT_UYVY411:
- bits = 12;
- break;
-@@ -682,7 +694,9 @@ avg_bits_per_pixel (int pix_fmt)
- }
- break;
- case FF_PIXEL_PLANAR:
-- if (pf->x_chroma_shift == 0 && pf->y_chroma_shift == 0) {
-+ if(pix_fmt == PIX_FMT_RGB666) {
-+ bits = 8 * pf->nb_channels;
-+ } else if (pf->x_chroma_shift == 0 && pf->y_chroma_shift == 0) {
- bits = pf->depth * pf->nb_channels;
- } else {
- bits = pf->depth + ((2 * pf->depth) >>
-@@ -740,7 +754,6 @@ avcodec_find_best_pix_fmt (int pix_fmt_mask, int src_pix_fmt,
- ~FF_LOSS_DEPTH,
- 0,
- };
--
- /* try with successive loss */
- i = 0;
- for (;;) {
-@@ -2371,6 +2384,37 @@ bitcopy_n (unsigned int a, int n)
-
- #include "imgconvert_template.h"
-
-+/* rgb666 handling */
-+
-+#define RGB_NAME rgb666
-+#define FMT_RGB666
-+
-+#define RGB_IN(r, g, b, s)\
-+{\
-+ unsigned int v = ((const uint32_t *)(s))[0];\
-+ r = (v >> 12) & 0x3f;\
-+ g = (v >> 6) & 0x3f;\
-+ b = v & 0x3f;\
-+}
-+
-+#define RGBA_IN(r, g, b, a, s)\
-+{\
-+ unsigned int v = ((const uint32_t *)(s))[0];\
-+ a = 0xff;\
-+ r = (v >> 12) & 0x3f;\
-+ g = (v >> 6) & 0x3f;\
-+ b = v & 0x3f;\
-+}
-+
-+#define RGBA_OUT(d, r, g, b, a)\
-+{\
-+ ((uint32_t *)(d))[0] = ((r >> 2) << 12) | ((g >> 2) << 6) | (b >> 2);\
-+}
-+
-+#define BPP 4
-+
-+#include "imgconvert_template.h"
-+
- /* xrgb32 handling */
-
- #define RGB_NAME xrgb32
-@@ -3102,6 +3146,7 @@ static ConvertEntry convert_table[] = {
- {PIX_FMT_YUV420P, PIX_FMT_RGB565, yuv420p_to_rgb565},
- {PIX_FMT_YUV420P, PIX_FMT_BGR24, yuv420p_to_bgr24},
- {PIX_FMT_YUV420P, PIX_FMT_RGB24, yuv420p_to_rgb24},
-+ {PIX_FMT_YUV420P, PIX_FMT_RGB666, yuv420p_to_rgb666},
- {PIX_FMT_YUV420P, PIX_FMT_RGB32, yuv420p_to_rgb32},
- {PIX_FMT_YUV420P, PIX_FMT_BGR32, yuv420p_to_bgr32},
- {PIX_FMT_YUV420P, PIX_FMT_xRGB32, yuv420p_to_xrgb32},
-@@ -3115,6 +3160,7 @@ static ConvertEntry convert_table[] = {
- {PIX_FMT_NV12, PIX_FMT_RGB565, nv12_to_rgb565},
- {PIX_FMT_NV12, PIX_FMT_BGR24, nv12_to_bgr24},
- {PIX_FMT_NV12, PIX_FMT_RGB24, nv12_to_rgb24},
-+ {PIX_FMT_NV12, PIX_FMT_RGB666, nv12_to_rgb666},
- {PIX_FMT_NV12, PIX_FMT_RGB32, nv12_to_rgb32},
- {PIX_FMT_NV12, PIX_FMT_BGR32, nv12_to_bgr32},
- {PIX_FMT_NV12, PIX_FMT_xRGB32, nv12_to_xrgb32},
-@@ -3130,6 +3176,7 @@ static ConvertEntry convert_table[] = {
- {PIX_FMT_NV21, PIX_FMT_RGB565, nv21_to_rgb565},
- {PIX_FMT_NV21, PIX_FMT_BGR24, nv21_to_bgr24},
- {PIX_FMT_NV21, PIX_FMT_RGB24, nv21_to_rgb24},
-+ {PIX_FMT_NV21, PIX_FMT_RGB666, nv21_to_rgb666},
- {PIX_FMT_NV21, PIX_FMT_RGB32, nv21_to_rgb32},
- {PIX_FMT_NV21, PIX_FMT_BGR32, nv21_to_bgr32},
- {PIX_FMT_NV21, PIX_FMT_xRGB32, nv21_to_xrgb32},
-@@ -3151,6 +3198,7 @@ static ConvertEntry convert_table[] = {
- {PIX_FMT_YUVJ420P, PIX_FMT_RGB565, yuvj420p_to_rgb565},
- {PIX_FMT_YUVJ420P, PIX_FMT_BGR24, yuvj420p_to_bgr24},
- {PIX_FMT_YUVJ420P, PIX_FMT_RGB24, yuvj420p_to_rgb24},
-+ {PIX_FMT_YUVJ420P, PIX_FMT_RGB666, yuvj420p_to_rgb666},
- {PIX_FMT_YUVJ420P, PIX_FMT_RGB32, yuvj420p_to_rgb32},
- {PIX_FMT_YUVJ420P, PIX_FMT_BGR32, yuvj420p_to_bgr32},
- {PIX_FMT_YUVJ420P, PIX_FMT_RGB32, yuvj420p_to_xrgb32},
-@@ -3216,6 +3264,7 @@ static ConvertEntry convert_table[] = {
- {PIX_FMT_RGB24, PIX_FMT_NV21, rgb24_to_nv21},
- {PIX_FMT_RGB24, PIX_FMT_RGB565, rgb24_to_rgb565},
- {PIX_FMT_RGB24, PIX_FMT_RGB555, rgb24_to_rgb555},
-+ {PIX_FMT_RGB24, PIX_FMT_RGB666, rgb24_to_rgb666},
- {PIX_FMT_RGB24, PIX_FMT_RGB32, rgb24_to_rgb32},
- {PIX_FMT_RGB24, PIX_FMT_BGR32, rgb24_to_bgr32},
- {PIX_FMT_RGB24, PIX_FMT_xRGB32, rgb24_to_xrgb32},
-@@ -3239,6 +3288,7 @@ static ConvertEntry convert_table[] = {
-
- {PIX_FMT_RGB32, PIX_FMT_RGB24, rgb32_to_rgb24},
- {PIX_FMT_RGB32, PIX_FMT_RGB555, rgba32_to_rgb555},
-+ {PIX_FMT_RGB32, PIX_FMT_RGB666, rgba32_to_rgb666},
- {PIX_FMT_RGB32, PIX_FMT_PAL8, rgb32_to_pal8},
- {PIX_FMT_RGB32, PIX_FMT_YUV420P, rgb32_to_yuv420p},
- {PIX_FMT_RGB32, PIX_FMT_YUVA420P, rgb32_to_yuva420p},
-@@ -3269,6 +3319,7 @@ static ConvertEntry convert_table[] = {
- {PIX_FMT_RGBA32, PIX_FMT_BGRx32, rgba32_to_bgrx32},
- {PIX_FMT_RGBA32, PIX_FMT_ABGR32, rgba32_to_abgr32},
- {PIX_FMT_RGBA32, PIX_FMT_RGB24, rgba32_to_rgb24},
-+ {PIX_FMT_RGBA32, PIX_FMT_RGB666, rgba32_to_rgb666},
- {PIX_FMT_RGBA32, PIX_FMT_RGB555, rgba32_to_rgb555},
- {PIX_FMT_RGBA32, PIX_FMT_PAL8, rgba32_to_pal8},
- {PIX_FMT_RGBA32, PIX_FMT_YUV420P, rgba32_to_yuv420p},
-@@ -3408,10 +3459,18 @@ static ConvertEntry convert_table[] = {
- {PIX_FMT_Y16, PIX_FMT_ABGR32, y16_to_abgr32},
- {PIX_FMT_Y16, PIX_FMT_Y800, y16_to_y800},
-
-+ {PIX_FMT_RGB666, PIX_FMT_GRAY8, rgb666_to_gray},
-+ {PIX_FMT_RGB666, PIX_FMT_NV12, rgb666_to_nv12},
-+ {PIX_FMT_RGB666, PIX_FMT_NV21, rgb666_to_nv21},
-+ {PIX_FMT_RGB666, PIX_FMT_YUV420P, rgb666_to_yuv420p},
-+ {PIX_FMT_RGB666, PIX_FMT_RGBA32, rgb666_to_rgba32},
-+ {PIX_FMT_RGB666, PIX_FMT_RGB24, rgb666_to_rgb24},
-+
- {PIX_FMT_GRAY8, PIX_FMT_RGB555, gray_to_rgb555},
- {PIX_FMT_GRAY8, PIX_FMT_RGB565, gray_to_rgb565},
- {PIX_FMT_GRAY8, PIX_FMT_RGB24, gray_to_rgb24},
- {PIX_FMT_GRAY8, PIX_FMT_BGR24, gray_to_bgr24},
-+ {PIX_FMT_GRAY8, PIX_FMT_RGB666, gray_to_rgb666},
- {PIX_FMT_GRAY8, PIX_FMT_RGB32, gray_to_rgb32},
- {PIX_FMT_GRAY8, PIX_FMT_BGR32, gray_to_bgr32},
- {PIX_FMT_GRAY8, PIX_FMT_xRGB32, gray_to_xrgb32},
-@@ -3463,6 +3522,7 @@ static ConvertEntry convert_table[] = {
- {PIX_FMT_PAL8, PIX_FMT_RGB565, pal8_to_rgb565},
- {PIX_FMT_PAL8, PIX_FMT_BGR24, pal8_to_bgr24},
- {PIX_FMT_PAL8, PIX_FMT_RGB24, pal8_to_rgb24},
-+ {PIX_FMT_PAL8, PIX_FMT_RGB666, pal8_to_rgb666},
- {PIX_FMT_PAL8, PIX_FMT_RGB32, pal8_to_rgb32},
- {PIX_FMT_PAL8, PIX_FMT_BGR32, pal8_to_bgr32},
- {PIX_FMT_PAL8, PIX_FMT_xRGB32, pal8_to_xrgb32},
-@@ -3858,6 +3918,9 @@ img_get_alpha_info (const AVPicture * src, int pix_fmt, int width, int height)
- case PIX_FMT_ABGR32:
- ret = get_alpha_info_abgr32 (src, width, height);
- break;
-+ case PIX_FMT_RGB666:
-+ ret = get_alpha_info_rgb666 (src, width, height);
-+ break;
- case PIX_FMT_RGB555:
- ret = get_alpha_info_rgb555 (src, width, height);
- break;
diff --git a/patches/gst-plugins-base-0.10.36/0002-audioresample-Fix-build-on-x86-if-emmintrin.h-is-ava.patch b/patches/gst-plugins-base-0.10.36/0002-audioresample-Fix-build-on-x86-if-emmintrin.h-is-ava.patch
deleted file mode 100644
index 4f48709ba..000000000
--- a/patches/gst-plugins-base-0.10.36/0002-audioresample-Fix-build-on-x86-if-emmintrin.h-is-ava.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Antoine Jacoutot <ajacoutot@gnome.org>
-Date: Mon, 20 Jan 2014 15:44:09 +0100
-Subject: [PATCH] audioresample: Fix build on x86 if emmintrin.h is available
- but can't be used
-
-On i386, EMMINTRIN is defined but not usable without SSE so check for
-__SSE__ and __SSE2__ as well.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=670690
----
- gst/audioresample/resample.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/gst/audioresample/resample.c b/gst/audioresample/resample.c
-index 490eebcc41df..c47d51271be4 100644
---- a/gst/audioresample/resample.c
-+++ b/gst/audioresample/resample.c
-@@ -77,13 +77,13 @@
- #define EXPORT G_GNUC_INTERNAL
-
- #ifdef _USE_SSE
--#ifndef HAVE_XMMINTRIN_H
-+#if !defined(__SSE__) || !defined(HAVE_XMMINTRIN_H)
- #undef _USE_SSE
- #endif
- #endif
-
- #ifdef _USE_SSE2
--#ifndef HAVE_EMMINTRIN_H
-+#if !defined(__SSE2__) || !defined(HAVE_XMMINTRIN_H)
- #undef _USE_SSE2
- #endif
- #endif
diff --git a/patches/gst-plugins-base-0.10.36/series b/patches/gst-plugins-base-0.10.36/series
deleted file mode 100644
index 7360dd91c..000000000
--- a/patches/gst-plugins-base-0.10.36/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-added-RGB666-Support-to-ffmpegcolorspace.patch
-0002-audioresample-Fix-build-on-x86-if-emmintrin.h-is-ava.patch
-# b0035d1a88e1f254765abd3c5d24c8da - git-ptx-patches magic
diff --git a/patches/gst-plugins-gl-0.10.2/0001-make-sure-gtk-example-builds-for-non-X-gtk.patch b/patches/gst-plugins-gl-0.10.2/0001-make-sure-gtk-example-builds-for-non-X-gtk.patch
deleted file mode 100644
index 23000e7cd..000000000
--- a/patches/gst-plugins-gl-0.10.2/0001-make-sure-gtk-example-builds-for-non-X-gtk.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 30 Oct 2011 22:37:00 +0100
-Subject: [PATCH] make sure gtk example builds for non X gtk
-
-With this patch tests/examples/gtk/gstgtk.c will compile with non X gtk.
-It won't do anything usefull, though.
-
-Not for upstream.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- tests/examples/gtk/gstgtk.c | 4 ----
- 1 files changed, 0 insertions(+), 4 deletions(-)
-
-diff --git a/tests/examples/gtk/gstgtk.c b/tests/examples/gtk/gstgtk.c
-index 3a68e19..3d53325 100644
---- a/tests/examples/gtk/gstgtk.c
-+++ b/tests/examples/gtk/gstgtk.c
-@@ -26,8 +26,6 @@
- #include <gdk/gdkx.h>
- #elif defined(GDK_WINDOWING_QUARTZ)
- #include <gdk/gdkquartz.h>
--#else
--#error unimplemented GTK backend
- #endif
-
-
-@@ -42,8 +40,6 @@ gst_x_overlay_set_gtk_window (GstXOverlay *xoverlay, GtkWidget *window)
- (gulong)gdk_quartz_window_get_nswindow (window->window));
- #elif defined(GDK_WINDOWING_X11)
- gst_x_overlay_set_xwindow_id (xoverlay, GDK_WINDOW_XWINDOW(window->window));
--#else
--#error unimplemented GTK backend
- #endif
-
- }
diff --git a/patches/gst-plugins-gl-0.10.2/series b/patches/gst-plugins-gl-0.10.2/series
deleted file mode 100644
index bd9ef82d2..000000000
--- a/patches/gst-plugins-gl-0.10.2/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-make-sure-gtk-example-builds-for-non-X-gtk.patch
-# 2ea327771c70a99ce54d1e3f64e5c874 - git-ptx-patches magic
diff --git a/patches/gst-plugins-good-0.10.31/0001-follow-up-on-bug-622500-in-gst-plugins-good-bugzilla.patch b/patches/gst-plugins-good-0.10.31/0001-follow-up-on-bug-622500-in-gst-plugins-good-bugzilla.patch
deleted file mode 100644
index c1426db19..000000000
--- a/patches/gst-plugins-good-0.10.31/0001-follow-up-on-bug-622500-in-gst-plugins-good-bugzilla.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Michael Grzeschik <m.grzeschik@pengutronix.de>
-Date: Mon, 18 Apr 2011 11:35:21 +0200
-Subject: [PATCH] follow up on bug:622500 in gst-plugins-good bugzilla
-
-The situation is still unclear, so just for now we will
-keep that patch to check on this again later.
----
- sys/v4l2/gstv4l2sink.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
-index f6aba24..1a218e4 100644
---- a/sys/v4l2/gstv4l2sink.c
-+++ b/sys/v4l2/gstv4l2sink.c
-@@ -737,6 +737,7 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
- * gst_v4l2_buffer_pool_destroy()
- *
- */
-+ gst_v4l2_object_stop_streaming(v4l2sink->v4l2object);
- GST_DEBUG_OBJECT (v4l2sink, "warning, changing caps not supported yet");
- return FALSE;
- }
diff --git a/patches/gst-plugins-good-0.10.31/0002-v4l2-fix-build-with-recent-kernels-the-v4l2_buffer-i.patch b/patches/gst-plugins-good-0.10.31/0002-v4l2-fix-build-with-recent-kernels-the-v4l2_buffer-i.patch
deleted file mode 100644
index 9e92e9a5e..000000000
--- a/patches/gst-plugins-good-0.10.31/0002-v4l2-fix-build-with-recent-kernels-the-v4l2_buffer-i.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Matthias Clasen <mclasen@redhat.com>
-Date: Thu, 9 Aug 2012 08:35:23 +0100
-Subject: [PATCH] v4l2: fix build with recent kernels, the v4l2_buffer input
- field was removed
-
-This was unused apparently and removed in the kernel in commit:
-
- From 2b719d7baf490e24ce7d817c6337b7c87fda84c1 Mon Sep 17 00:00:00 2001
- From: Sakari Ailus <sakari.ailus@iki.fi>
- Date: Wed, 2 May 2012 09:40:03 -0300
- Subject: [PATCH] [media] v4l: drop v4l2_buffer.input and V4L2_BUF_FLAG_INPUT
-
- Remove input field in struct v4l2_buffer and flag V4L2_BUF_FLAG_INPUT which
- tells the former is valid. The flag is used by no driver currently.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=681491
----
- sys/v4l2/gstv4l2bufferpool.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
-index b81c6a4..51cc0ce 100644
---- a/sys/v4l2/gstv4l2bufferpool.c
-+++ b/sys/v4l2/gstv4l2bufferpool.c
-@@ -181,7 +181,6 @@ gst_v4l2_buffer_new (GstV4l2BufferPool * pool, guint index, GstCaps * caps)
- GST_LOG_OBJECT (pool->v4l2elem, " MMAP offset: %u",
- ret->vbuffer.m.offset);
- GST_LOG_OBJECT (pool->v4l2elem, " length: %u", ret->vbuffer.length);
-- GST_LOG_OBJECT (pool->v4l2elem, " input: %u", ret->vbuffer.input);
-
- data = (guint8 *) v4l2_mmap (0, ret->vbuffer.length,
- PROT_READ | PROT_WRITE, MAP_SHARED, pool->video_fd,
diff --git a/patches/gst-plugins-good-0.10.31/0003-remove-V4L2_CID_HCENTER-V4L2_CID_VCENTER-usage.patch b/patches/gst-plugins-good-0.10.31/0003-remove-V4L2_CID_HCENTER-V4L2_CID_VCENTER-usage.patch
deleted file mode 100644
index 5a8a07431..000000000
--- a/patches/gst-plugins-good-0.10.31/0003-remove-V4L2_CID_HCENTER-V4L2_CID_VCENTER-usage.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Tue, 17 Dec 2013 15:36:39 +0100
-Subject: [PATCH] remove V4L2_CID_HCENTER/V4L2_CID_VCENTER usage
-
-They have been deprecated for a long time and since v3.9 building fails
-with:
-
-v4l2_calls.c:58:26: error: 'V4L2_CID_HCENTER_DEPRECATED' undeclared (first use in this function)
- #define V4L2_CID_HCENTER V4L2_CID_HCENTER_DEPRECATED
- ^
-v4l2_calls.c:297:12: note: in expansion of macro 'V4L2_CID_HCENTER'
- case V4L2_CID_HCENTER:
- ^
-v4l2_calls.c:58:26: note: each undeclared identifier is reported only once for each function it appears in
- #define V4L2_CID_HCENTER V4L2_CID_HCENTER_DEPRECATED
- ^
-v4l2_calls.c:297:12: note: in expansion of macro 'V4L2_CID_HCENTER'
- case V4L2_CID_HCENTER:
- ^
-v4l2_calls.c:61:26: error: 'V4L2_CID_VCENTER_DEPRECATED' undeclared (first use in this function)
- #define V4L2_CID_VCENTER V4L2_CID_VCENTER_DEPRECATED
- ^
-v4l2_calls.c:298:12: note: in expansion of macro 'V4L2_CID_VCENTER'
- case V4L2_CID_VCENTER:
- ^
-make[4]: *** [libgstvideo4linux2_la-v4l2_calls.lo] Error 1
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- sys/v4l2/v4l2_calls.c | 10 ----------
- 1 file changed, 10 deletions(-)
-
-diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c
-index 309bfb6..47c2f46 100644
---- a/sys/v4l2/v4l2_calls.c
-+++ b/sys/v4l2/v4l2_calls.c
-@@ -53,14 +53,6 @@
-
- #include "gst/gst-i18n-plugin.h"
-
--/* Those are ioctl calls */
--#ifndef V4L2_CID_HCENTER
--#define V4L2_CID_HCENTER V4L2_CID_HCENTER_DEPRECATED
--#endif
--#ifndef V4L2_CID_VCENTER
--#define V4L2_CID_VCENTER V4L2_CID_VCENTER_DEPRECATED
--#endif
--
- GST_DEBUG_CATEGORY_EXTERN (v4l2_debug);
- #define GST_CAT_DEFAULT v4l2_debug
-
-@@ -294,8 +286,6 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
- break;
- case V4L2_CID_HFLIP:
- case V4L2_CID_VFLIP:
-- case V4L2_CID_HCENTER:
-- case V4L2_CID_VCENTER:
- #ifdef V4L2_CID_PAN_RESET
- case V4L2_CID_PAN_RESET:
- #endif
diff --git a/patches/gst-plugins-good-0.10.31/series b/patches/gst-plugins-good-0.10.31/series
deleted file mode 100644
index 180d8d650..000000000
--- a/patches/gst-plugins-good-0.10.31/series
+++ /dev/null
@@ -1,6 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-follow-up-on-bug-622500-in-gst-plugins-good-bugzilla.patch
-0002-v4l2-fix-build-with-recent-kernels-the-v4l2_buffer-i.patch
-0003-remove-V4L2_CID_HCENTER-V4L2_CID_VCENTER-usage.patch
-# 5c83a3ef700d58dc6d445f2e7559e797 - git-ptx-patches magic
diff --git a/patches/gst-plugins-rs-1.24.3/0001-allow-executing-cargo-with-frozen.patch b/patches/gst-plugins-rs-1.24.3/0001-allow-executing-cargo-with-frozen.patch
new file mode 100644
index 000000000..5fa0b68ce
--- /dev/null
+++ b/patches/gst-plugins-rs-1.24.3/0001-allow-executing-cargo-with-frozen.patch
@@ -0,0 +1,58 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 25 Apr 2023 17:43:16 +0200
+Subject: [PATCH] allow executing cargo with --frozen
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ cargo_wrapper.py | 4 ++++
+ meson.build | 4 ++++
+ meson_options.txt | 2 ++
+ 3 files changed, 10 insertions(+)
+
+diff --git a/cargo_wrapper.py b/cargo_wrapper.py
+index 183ffcd12acc..f8e063918c71 100644
+--- a/cargo_wrapper.py
++++ b/cargo_wrapper.py
+@@ -28,6 +28,7 @@ PARSER.add_argument('--lib-suffixes', nargs="+", default=[])
+ PARSER.add_argument('--exe-suffix')
+ PARSER.add_argument('--depfile')
+ PARSER.add_argument('--disable-doc', action="store_true", default=False)
++PARSER.add_argument('--frozen', action="store_true", default=False)
+
+
+ def shlex_join(args):
+@@ -122,6 +123,9 @@ if __name__ == "__main__":
+ print("Unknown command:", opts.command, file=logfile)
+ sys.exit(1)
+
++ if opts.frozen:
++ cargo_cmd += ['--frozen']
++
+ if rustc_target:
+ cargo_cmd += ['--target', rustc_target]
+ if features:
+diff --git a/meson.build b/meson.build
+index 741b0e46ba50..da5aec40e1a4 100644
+--- a/meson.build
++++ b/meson.build
+@@ -451,6 +451,10 @@ if get_option('doc').disabled()
+ extra_args += ['--disable-doc']
+ endif
+
++if get_option('frozen')
++ extra_args += ['--frozen']
++endif
++
+ # 'pkgconfig' is the entry in the machine file, if specified
+ pkg_config = find_program('pkgconfig', 'pkg-config')
+ if pkg_config.found()
+diff --git a/meson_options.txt b/meson_options.txt
+index 0842a6613211..cf44abae7ce7 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -66,3 +66,5 @@ option('examples', type: 'feature', value: 'disabled', yield: true,
+ description: 'Build examples')
+ option('tests', type : 'feature', value : 'auto', yield : true,
+ description : 'Build and enable unit tests')
++option('frozen', type: 'boolean', value: false,
++ description: 'Run cargo with --frozen')
diff --git a/patches/gst-plugins-rs-1.24.3/0002-HACK-allow-feature-build_hasher_simple_hash_one.patch b/patches/gst-plugins-rs-1.24.3/0002-HACK-allow-feature-build_hasher_simple_hash_one.patch
new file mode 100644
index 000000000..56c51cc72
--- /dev/null
+++ b/patches/gst-plugins-rs-1.24.3/0002-HACK-allow-feature-build_hasher_simple_hash_one.patch
@@ -0,0 +1,25 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sat, 2 Mar 2024 22:59:31 +0100
+Subject: [PATCH] HACK: allow feature build_hasher_simple_hash_one
+
+In rustc 1.70.0 from OSELAS.Toolchain-2023.07.*, this feature is still
+unstable, so explicitly allow it to make it possible to use this
+toolchain.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ ptxdist-cargo-home/source/ahash-0.8.11/src/lib.rs | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/ptxdist-cargo-home/source/ahash-0.8.11/src/lib.rs b/ptxdist-cargo-home/source/ahash-0.8.11/src/lib.rs
+index 69fb2ca2371f..e93e20b816c8 100644
+--- a/ptxdist-cargo-home/source/ahash-0.8.11/src/lib.rs
++++ b/ptxdist-cargo-home/source/ahash-0.8.11/src/lib.rs
+@@ -12,6 +12,7 @@
+ //! Because aHash does not have a fixed standard for its output, it is able to improve over time.
+ //! But this also means that different computers or computers using different versions of ahash may observe different
+ //! hash values for the same input.
++#![feature(build_hasher_simple_hash_one)]
+ #![cfg_attr(
+ all(
+ feature = "std",
diff --git a/patches/gst-plugins-rs-1.24.3/series b/patches/gst-plugins-rs-1.24.3/series
new file mode 100644
index 000000000..9a43194df
--- /dev/null
+++ b/patches/gst-plugins-rs-1.24.3/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-allow-executing-cargo-with-frozen.patch
+0002-HACK-allow-feature-build_hasher_simple_hash_one.patch
+# 1b24e8b1e596f24e14e42a3758cf1078 - git-ptx-patches magic
diff --git a/patches/gst-python-1.24.3/0001-gst-python-fix-cross-compiling.patch b/patches/gst-python-1.24.3/0001-gst-python-fix-cross-compiling.patch
new file mode 100644
index 000000000..9e3202209
--- /dev/null
+++ b/patches/gst-python-1.24.3/0001-gst-python-fix-cross-compiling.patch
@@ -0,0 +1,47 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sat, 2 Mar 2024 16:44:19 +0100
+Subject: [PATCH] gst-python: fix cross-compiling
+
+When cross-compiling, looking in the root filesystem of the build host to find
+the Python library makes no sense. Instead, assume that the directory and file
+name provided by Python are correct and use those without checking.
+---
+ meson.build | 24 ++++++++++++++----------
+ 1 file changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index f7efd4552db4..006b396bcd13 100644
+--- a/meson.build
++++ b/meson.build
+@@ -87,17 +87,21 @@ else
+ endif
+ endif
+ pylib_fname = ''
+-foreach loc: pylib_locs
+- foreach fname: pylib_fnames
+- fpath = loc / fname
+- debug(f'Looking for Python library at: @fpath@')
+- if fsmod.exists(fpath)
+- pylib_fname = fname
+- message(f'PY_LIB_FNAME = @fname@ (@loc@)')
+- break
+- endif
++if meson.is_cross_build()
++ pylib_fname = pylib_locs[0] / pylib_fnames[0]
++else
++ foreach loc: pylib_locs
++ foreach fname: pylib_fnames
++ fpath = loc / fname
++ debug(f'Looking for Python library at: @fpath@')
++ if fsmod.exists(fpath)
++ pylib_fname = fname
++ message(f'PY_LIB_FNAME = @fname@ (@loc@)')
++ break
++ endif
++ endforeach
+ endforeach
+-endforeach
++endif
+ if pylib_fname == ''
+ message('Could not find python library to load, will try loading at runtime')
+ endif
diff --git a/patches/gst-python-1.24.3/series b/patches/gst-python-1.24.3/series
new file mode 100644
index 000000000..6ab8e2ca1
--- /dev/null
+++ b/patches/gst-python-1.24.3/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-gst-python-fix-cross-compiling.patch
+# 8c160ebb6f35ca6c8a0ed3489fb1a177 - git-ptx-patches magic
diff --git a/patches/gstreamer-0.10.36/0001-parse-make-grammar.y-work-with-Bison-3.patch b/patches/gstreamer-0.10.36/0001-parse-make-grammar.y-work-with-Bison-3.patch
deleted file mode 100644
index 2bf7c7204..000000000
--- a/patches/gstreamer-0.10.36/0001-parse-make-grammar.y-work-with-Bison-3.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Kerrick Staley <kerrick@kerrickstaley.com>
-Date: Tue, 20 Aug 2013 23:59:29 -0700
-Subject: [PATCH] parse: make grammar.y work with Bison 3
-
-YYLEX_PARAM is no longer supported in Bison 3.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=706462
----
- gst/parse/grammar.y | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y
-index 24fc87b..7f9dd16 100644
---- a/gst/parse/grammar.y
-+++ b/gst/parse/grammar.y
-@@ -26,7 +26,6 @@
- */
-
- #define YYERROR_VERBOSE 1
--#define YYLEX_PARAM scanner
-
- #define YYENABLE_NLS 0
-
-@@ -648,6 +647,7 @@ static int yyerror (void *scanner, graph_t *graph, const char *s);
- %right '.'
- %left '!' '='
-
-+%lex-param { void *scanner }
- %parse-param { void *scanner }
- %parse-param { graph_t *graph }
- %pure-parser
diff --git a/patches/gstreamer-0.10.36/series b/patches/gstreamer-0.10.36/series
deleted file mode 100644
index 25b0b109f..000000000
--- a/patches/gstreamer-0.10.36/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-parse-make-grammar.y-work-with-Bison-3.patch
-# a3a435f70f584cb974149d88dc7a8704 - git-ptx-patches magic
diff --git a/patches/gtk+-2.24.32/0001-gtk-Do-not-build-demos.patch b/patches/gtk+-2.24.32/0001-gtk-Do-not-build-demos.patch
deleted file mode 100644
index 820dc7f9e..000000000
--- a/patches/gtk+-2.24.32/0001-gtk-Do-not-build-demos.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Markus Pargmann <mpa@pengutronix.de>
-Date: Thu, 13 Nov 2014 15:20:21 +0100
-Subject: [PATCH] gtk: Do not build demos
-
-Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
----
- Makefile.am | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 8e3a2f1283e9..7288db20341f 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1,7 +1,7 @@
- ## Makefile.am for GTK+
- include $(top_srcdir)/Makefile.decl
-
--SRC_SUBDIRS = gdk gtk modules demos tests perf
-+SRC_SUBDIRS = gdk gtk modules tests perf
- SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
-
- # require automake 1.4
diff --git a/patches/gtk+-2.24.32/series b/patches/gtk+-2.24.32/series
deleted file mode 100644
index 09c5f5a74..000000000
--- a/patches/gtk+-2.24.32/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-gtk-Do-not-build-demos.patch
-# dc5190e694355ef8da45835009bc3f40 - git-ptx-patches magic
diff --git a/patches/gtk+-3.24.21/0001-build-make-atk-bridge-optional.patch b/patches/gtk+-3.24.35/0001-build-make-atk-bridge-optional.patch
index 25067656c..78f656e31 100644
--- a/patches/gtk+-3.24.21/0001-build-make-atk-bridge-optional.patch
+++ b/patches/gtk+-3.24.35/0001-build-make-atk-bridge-optional.patch
@@ -46,19 +46,19 @@ index 7f0e5207d915..81b2ed0d55b3 100644
#endif
diff --git a/meson.build b/meson.build
-index 945c5de87ba8..cb421f0b516f 100644
+index f0b4fabe8b59..b4846b619676 100644
--- a/meson.build
+++ b/meson.build
-@@ -572,7 +572,7 @@ if x11_enabled
+@@ -582,7 +582,7 @@ if x11_enabled
xfixes_dep = dependency('xfixes', required: false)
xcomposite_dep = dependency('xcomposite', required: false)
fontconfig_dep = dependency('fontconfig', fallback: ['fontconfig', 'fontconfig_dep'])
-- atkbridge_dep = dependency('atk-bridge-2.0', version: atk_req)
-+ atkbridge_dep = dependency('atk-bridge-2.0', version: atk_req, required: false)
+- atkbridge_dep = dependency('atk-bridge-2.0', version: at_spi2_atk_req)
++ atkbridge_dep = dependency('atk-bridge-2.0', version: at_spi2_atk_req, required: false)
- x11_pkgs = ['fontconfig', 'x11', 'xext', 'xi', 'xrandr']
+ backend_immodules += ['xim']
-@@ -588,8 +588,9 @@ if x11_enabled
+@@ -600,8 +600,9 @@ if x11_enabled
if xdamage_dep.found()
x11_pkgs += ['xdamage']
endif
diff --git a/patches/gtk+-3.24.21/series b/patches/gtk+-3.24.35/series
index 91b3069ef..91b3069ef 100644
--- a/patches/gtk+-3.24.21/series
+++ b/patches/gtk+-3.24.35/series
diff --git a/patches/hpanel-0.3.2/0001-Patches-the-Makefile-to-be-able-to-cross-compile.patch b/patches/hpanel-0.3.2/0001-Patches-the-Makefile-to-be-able-to-cross-compile.patch
deleted file mode 100644
index f99a0028a..000000000
--- a/patches/hpanel-0.3.2/0001-Patches-the-Makefile-to-be-able-to-cross-compile.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From: Juergen Beisert <j.beisert@pengutronix.de>
-Date: Tue, 21 Jun 2011 09:27:25 +0200
-Subject: [PATCH] Patches the Makefile to be able to cross compile
-
-The original makefile assumes fixed pathes to libraries and
-include files. This patch replace them with calls to pkg_config.
-Don't strip the binary. targetinstall will do this.
-Install to $(DESTDIR).
-
-Forwarded: not-needed (upstream dead)
-Signed-off-by: j.beisert@pengutronix.de
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- Makefile | 19 ++++++++++---------
- 1 files changed, 10 insertions(+), 9 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 9d20d90..28519a7 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1,13 +1,14 @@
--CC=cc
--CFLAGS= -O2 -I/usr/X11R6/include -DHAVE_XPM -DXFT -DCLOCK
--LDFLAGS= -L/usr/X11R6/lib -lX11 -lXpm -lXft
-+.PHONY: install clean
-+
-+CFLAGS +=-O2 -g `pkg-config --cflags xft` `pkg-config --cflags xpm` -DCLOCK
-+LDLIBS +=`pkg-config --libs xft` `pkg-config --libs xpm`
- PROGNAME=hpanel
-
--$(PROGNAME): Makefile hpanel.c hpanel.h icon.xpm
-- $(CC) $(CFLAGS) $(LDFLAGS) hpanel.c -o $(PROGNAME)
-- @ls -l $(PROGNAME)
-- strip $(PROGNAME)
-- @ls -l $(PROGNAME)
-+$(PROGNAME): hpanel.c
-
- install:
-- install $(PROGNAME) /usr/local/bin
-+ install $(PROGNAME) $(DESTDIR)/usr/bin
-+
-+clean:
-+ @rm -f $(PROGNAME)
-+
diff --git a/patches/hpanel-0.3.2/series b/patches/hpanel-0.3.2/series
deleted file mode 100644
index 4561eb605..000000000
--- a/patches/hpanel-0.3.2/series
+++ /dev/null
@@ -1,3 +0,0 @@
-# generated by git-ptx-patches
-0001-Patches-the-Makefile-to-be-able-to-cross-compile.patch
-# ee25b7b07cba51a7b49037c8a8138fda - git-ptx-patches magic
diff --git a/patches/hping3-20051105/clean_makefile.diff b/patches/hping3-20051105/clean_makefile.diff
deleted file mode 100644
index 899524fe9..000000000
--- a/patches/hping3-20051105/clean_makefile.diff
+++ /dev/null
@@ -1,74 +0,0 @@
-Subject: Don't be smarter than make
-From: Juergen Beisert <jbe@pengutronix.de>
-
-Simplify the makefile and use embedded rules.
-
-Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
-[mkl: install relative links only]
-Singed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-
----
- Makefile.in | 29 +++++++++++++----------------
- 1 file changed, 13 insertions(+), 16 deletions(-)
-
-Index: Makefile.in
-===================================================================
---- Makefile.in.orig
-+++ Makefile.in
-@@ -9,7 +9,7 @@
- CC= gcc
- AR=/usr/bin/ar
- RANLIB=/usr/bin/ranlib
--CCOPT= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
-+CFLAGS= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
- DEBUG= -g
- #uncomment the following if you need libpcap based build under linux
- #(not raccomanded)
-@@ -50,21 +50,18 @@ libars.a: $(ARSOBJ)
- $(RANLIB) $@
-
- hping3: byteorder.h $(OBJ)
-- $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
-+ $(CC) -o hping3 $(LDFLAGS) $(DEBUG) $(OBJ) $(PCAP) $(LDLIBS) @SOLARISLIB@ @TCL_LIB@
- @echo
-- ./hping3 -v
-- @echo "use \`make strip' to strip hping3 binary"
-- @echo "use \`make install' to install hping3"
-+# ./hping3 -v
-+# @echo "use \`make strip' to strip hping3 binary"
-+# @echo "use \`make install' to install hping3"
-
- hping3-static: byteorder.h $(OBJ)
-- $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
-+ $(CC) -static -o hping3-static $(LDFLAGS) $(CCOPT) $(DEBUG) $(OBJ) $(PCAP) $(LDLIBS) @SOLARISLIB@ @TCL_LIB@ -ldl
-
- byteorder.h:
- ./configure
-
--.c.o:
-- $(CC) -c $(CCOPT) $(DEBUG) $(COMPILE_TIME) $<
--
- clean:
- rm -rf hping3 *.o libars.a
-
-@@ -72,13 +69,13 @@ distclean:
- rm -rf hping3 *.o byteorder byteorder.h systype.h Makefile libars.a .depend
-
- install: hping3
-- cp -f hping3 /usr/sbin/
-- chmod 755 /usr/sbin/hping3
-- ln -s /usr/sbin/hping3 /usr/sbin/hping
-- ln -s /usr/sbin/hping3 /usr/sbin/hping2
-- @if [ -d ${INSTALL_MANPATH}/man8 ]; then \
-- cp ./docs/hping3.8 ${INSTALL_MANPATH}/man8; \
-- chmod 644 ${INSTALL_MANPATH}/man8/hping3.8; \
-+ cp -f hping3 $(DESTDIR)/usr/sbin/
-+ chmod 755 $(DESTDIR)/usr/sbin/hping3
-+ ln -sf hping3 $(DESTDIR)/usr/sbin/hping
-+ ln -sf hping3 $(DESTDIR)/usr/sbin/hping2
-+ @if [ -d $(DESTDIR)${INSTALL_MANPATH}/man8 ]; then \
-+ cp ./docs/hping3.8 $(DESTDIR)/${INSTALL_MANPATH}/man8; \
-+ chmod 644 $(DESTDIR)/${INSTALL_MANPATH}/man8/hping3.8; \
- else \
- echo "@@@@@@ WARNING @@@@@@"; \
- echo "Can't install the man page: ${INSTALL_MANPATH}/man8 does not exist"; \
diff --git a/patches/hping3-20051105/host_vs_target.diff b/patches/hping3-20051105/host_vs_target.diff
deleted file mode 100644
index 59092f5b9..000000000
--- a/patches/hping3-20051105/host_vs_target.diff
+++ /dev/null
@@ -1,75 +0,0 @@
-Subject: Endianess detection should not happen at host side...
-From: Juergen Beisert <jbe@pengutronix.de>
-
-Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
-
----
- bytesex.h | 3 ++-
- configure | 20 ++------------------
- hping2.h | 2 +-
- 3 files changed, 5 insertions(+), 20 deletions(-)
-
-Index: configure
-===================================================================
---- configure.orig
-+++ configure
-@@ -15,30 +15,14 @@ fi
-
- CC=${CC:=cc}
-
--echo build byteorder.c...
--$CC byteorder.c -o byteorder || exit 1
--
- INSTALL_MANPATH=`echo $MANPATH|cut -f1 -d:`
- if [ "$INSTALL_MANPATH" = "" ]; then
- INSTALL_MANPATH="/usr/local/man"
- fi
--BYTEORDER=`./byteorder -m`
--
--echo create byteorder.h...
--cat > byteorder.h <<EOF
--#ifndef __BYTEORDER_H
--#define __BYTEORDER_H
-
--EOF
--echo \#ifndef $BYTEORDER >> byteorder.h
--echo \#define $BYTEORDER >> byteorder.h
--echo \#endif /\* $BYTEORDER \*/ >> byteorder.h
--cat >> byteorder.h <<EOF
--
--#endif /* __BYTEORDER_H */
--EOF
-+# CONFIGOSTYPE=`uname -s | tr [a-z] [A-Z]`
-+CONFIGOSTYPE=LINUX
-
--CONFIGOSTYPE=`uname -s | tr [a-z] [A-Z]`
- if [ ! "$CONFIGOSTYPE" ]; then
- CONFIGOSTYPE=UNKNOWN
- fi
-Index: hping2.h
-===================================================================
---- hping2.h.orig
-+++ hping2.h
-@@ -17,7 +17,7 @@
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <limits.h>
--#include "byteorder.h"
-+#include <asm/byteorder.h>
- #include "systype.h"
- #include "fixtypes.h"
-
-Index: bytesex.h
-===================================================================
---- bytesex.h.orig
-+++ bytesex.h
-@@ -9,7 +9,8 @@
-
- #if defined(__i386__) \
- || defined(__alpha__) \
-- || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__)))
-+ || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__))) \
-+ || defined(__ARMEL__)
- #define BYTE_ORDER_LITTLE_ENDIAN
- #elif defined(__mc68000__) \
- || defined (__sparc__) \
diff --git a/patches/hping3-20051105/remove_pcap_header.diff b/patches/hping3-20051105/remove_pcap_header.diff
deleted file mode 100644
index 2a9e75735..000000000
--- a/patches/hping3-20051105/remove_pcap_header.diff
+++ /dev/null
@@ -1,23 +0,0 @@
-Subject: The <net/bpf.h> include file does not exist an more
-From: Juergen Beisert <jbe@pengutronix.de>
-
-The <net/bpf.h> include file does not exist an more. Simply removed.
-
-Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
-
----
- libpcap_stuff.c | 1 -
- 1 file changed, 1 deletion(-)
-
-Index: libpcap_stuff.c
-===================================================================
---- libpcap_stuff.c.orig
-+++ libpcap_stuff.c
-@@ -17,7 +17,6 @@
- #include <stdlib.h>
- #include <sys/ioctl.h>
- #include <pcap.h>
--#include <net/bpf.h>
-
- #include "globals.h"
-
diff --git a/patches/hping3-20051105/series b/patches/hping3-20051105/series
deleted file mode 100644
index d639ae763..000000000
--- a/patches/hping3-20051105/series
+++ /dev/null
@@ -1,3 +0,0 @@
-clean_makefile.diff -p0
-remove_pcap_header.diff -p0
-host_vs_target.diff -p0
diff --git a/patches/htmldoc-1.9.16/0001-Makefile-don-t-build-install-docs-or-desktop-files.patch b/patches/htmldoc-1.9.16/0001-Makefile-don-t-build-install-docs-or-desktop-files.patch
new file mode 100644
index 000000000..940a09cee
--- /dev/null
+++ b/patches/htmldoc-1.9.16/0001-Makefile-don-t-build-install-docs-or-desktop-files.patch
@@ -0,0 +1,28 @@
+From: Roland Hieber <rhi@pengutronix.de>
+Date: Sun, 14 May 2023 23:57:58 +0200
+Subject: [PATCH] Makefile: don't build/install docs or desktop files
+
+htmldoc is configured without GUI, so no desktop data is needed.
+Furthermore it will try to call the built binary to build the docs,
+which will not work in cross builds.
+
+Forwarded: not-needed
+---
+ Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index d846bf7621e5..31211a244b62 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -19,8 +19,8 @@ include Makedefs
+ # Subdirectories...
+ #
+
+-DIRS = htmldoc doc
+-INSTALLDIRS = fonts data desktop doc htmldoc
++DIRS = htmldoc
++INSTALLDIRS = fonts data htmldoc
+
+
+ #
diff --git a/patches/open62541-1.2/series b/patches/htmldoc-1.9.16/series
index 248a1b603..e9d04563d 100644
--- a/patches/open62541-1.2/series
+++ b/patches/htmldoc-1.9.16/series
@@ -1,4 +1,4 @@
# generated by git-ptx-patches
#tag:base --start-number 1
-0001-CMake-Allow-UA_NODESET_DIR-to-be-custom-defined.patch
-# 4a88edd1483ff7bb07a623335b407de7 - git-ptx-patches magic
+0001-Makefile-don-t-build-install-docs-or-desktop-files.patch
+# fdcadd964bbc6253264d4d6326477667 - git-ptx-patches magic
diff --git a/patches/ima-evm-utils-1.1/0001-INSTALL-remove-file-at-it-s-autogenerated-by-autotoo.patch b/patches/ima-evm-utils-1.1/0001-INSTALL-remove-file-at-it-s-autogenerated-by-autotoo.patch
deleted file mode 100644
index c035197d9..000000000
--- a/patches/ima-evm-utils-1.1/0001-INSTALL-remove-file-at-it-s-autogenerated-by-autotoo.patch
+++ /dev/null
@@ -1,389 +0,0 @@
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Wed, 18 Nov 2015 15:15:15 +0100
-Subject: [PATCH] INSTALL: remove file, at it's autogenerated by autotools
-
-This patch remove the file "INSTALL" which is autogenerated during
-./autogen.sh.
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- INSTALL | 370 ----------------------------------------------------------------
- 1 file changed, 370 deletions(-)
- delete mode 100644 INSTALL
-
-diff --git a/INSTALL b/INSTALL
-deleted file mode 100644
-index 007e9396d0a2..000000000000
---- a/INSTALL
-+++ /dev/null
-@@ -1,370 +0,0 @@
--Installation Instructions
--*************************
--
--Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
--Inc.
--
-- Copying and distribution of this file, with or without modification,
--are permitted in any medium without royalty provided the copyright
--notice and this notice are preserved. This file is offered as-is,
--without warranty of any kind.
--
--Basic Installation
--==================
--
-- Briefly, the shell commands `./configure; make; make install' should
--configure, build, and install this package. The following
--more-detailed instructions are generic; see the `README' file for
--instructions specific to this package. Some packages provide this
--`INSTALL' file but do not implement all of the features documented
--below. The lack of an optional feature in a given package is not
--necessarily a bug. More recommendations for GNU packages can be found
--in *note Makefile Conventions: (standards)Makefile Conventions.
--
-- The `configure' shell script attempts to guess correct values for
--various system-dependent variables used during compilation. It uses
--those values to create a `Makefile' in each directory of the package.
--It may also create one or more `.h' files containing system-dependent
--definitions. Finally, it creates a shell script `config.status' that
--you can run in the future to recreate the current configuration, and a
--file `config.log' containing compiler output (useful mainly for
--debugging `configure').
--
-- It can also use an optional file (typically called `config.cache'
--and enabled with `--cache-file=config.cache' or simply `-C') that saves
--the results of its tests to speed up reconfiguring. Caching is
--disabled by default to prevent problems with accidental use of stale
--cache files.
--
-- If you need to do unusual things to compile the package, please try
--to figure out how `configure' could check whether to do them, and mail
--diffs or instructions to the address given in the `README' so they can
--be considered for the next release. If you are using the cache, and at
--some point `config.cache' contains results you don't want to keep, you
--may remove or edit it.
--
-- The file `configure.ac' (or `configure.in') is used to create
--`configure' by a program called `autoconf'. You need `configure.ac' if
--you want to change it or regenerate `configure' using a newer version
--of `autoconf'.
--
-- The simplest way to compile this package is:
--
-- 1. `cd' to the directory containing the package's source code and type
-- `./configure' to configure the package for your system.
--
-- Running `configure' might take a while. While running, it prints
-- some messages telling which features it is checking for.
--
-- 2. Type `make' to compile the package.
--
-- 3. Optionally, type `make check' to run any self-tests that come with
-- the package, generally using the just-built uninstalled binaries.
--
-- 4. Type `make install' to install the programs and any data files and
-- documentation. When installing into a prefix owned by root, it is
-- recommended that the package be configured and built as a regular
-- user, and only the `make install' phase executed with root
-- privileges.
--
-- 5. Optionally, type `make installcheck' to repeat any self-tests, but
-- this time using the binaries in their final installed location.
-- This target does not install anything. Running this target as a
-- regular user, particularly if the prior `make install' required
-- root privileges, verifies that the installation completed
-- correctly.
--
-- 6. You can remove the program binaries and object files from the
-- source code directory by typing `make clean'. To also remove the
-- files that `configure' created (so you can compile the package for
-- a different kind of computer), type `make distclean'. There is
-- also a `make maintainer-clean' target, but that is intended mainly
-- for the package's developers. If you use it, you may have to get
-- all sorts of other programs in order to regenerate files that came
-- with the distribution.
--
-- 7. Often, you can also type `make uninstall' to remove the installed
-- files again. In practice, not all packages have tested that
-- uninstallation works correctly, even though it is required by the
-- GNU Coding Standards.
--
-- 8. Some packages, particularly those that use Automake, provide `make
-- distcheck', which can by used by developers to test that all other
-- targets like `make install' and `make uninstall' work correctly.
-- This target is generally not run by end users.
--
--Compilers and Options
--=====================
--
-- Some systems require unusual options for compilation or linking that
--the `configure' script does not know about. Run `./configure --help'
--for details on some of the pertinent environment variables.
--
-- You can give `configure' initial values for configuration parameters
--by setting variables in the command line or in the environment. Here
--is an example:
--
-- ./configure CC=c99 CFLAGS=-g LIBS=-lposix
--
-- *Note Defining Variables::, for more details.
--
--Compiling For Multiple Architectures
--====================================
--
-- You can compile the package for more than one kind of computer at the
--same time, by placing the object files for each architecture in their
--own directory. To do this, you can use GNU `make'. `cd' to the
--directory where you want the object files and executables to go and run
--the `configure' script. `configure' automatically checks for the
--source code in the directory that `configure' is in and in `..'. This
--is known as a "VPATH" build.
--
-- With a non-GNU `make', it is safer to compile the package for one
--architecture at a time in the source code directory. After you have
--installed the package for one architecture, use `make distclean' before
--reconfiguring for another architecture.
--
-- On MacOS X 10.5 and later systems, you can create libraries and
--executables that work on multiple system types--known as "fat" or
--"universal" binaries--by specifying multiple `-arch' options to the
--compiler but only a single `-arch' option to the preprocessor. Like
--this:
--
-- ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
-- CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
-- CPP="gcc -E" CXXCPP="g++ -E"
--
-- This is not guaranteed to produce working output in all cases, you
--may have to build one architecture at a time and combine the results
--using the `lipo' tool if you have problems.
--
--Installation Names
--==================
--
-- By default, `make install' installs the package's commands under
--`/usr/local/bin', include files under `/usr/local/include', etc. You
--can specify an installation prefix other than `/usr/local' by giving
--`configure' the option `--prefix=PREFIX', where PREFIX must be an
--absolute file name.
--
-- You can specify separate installation prefixes for
--architecture-specific files and architecture-independent files. If you
--pass the option `--exec-prefix=PREFIX' to `configure', the package uses
--PREFIX as the prefix for installing programs and libraries.
--Documentation and other data files still use the regular prefix.
--
-- In addition, if you use an unusual directory layout you can give
--options like `--bindir=DIR' to specify different values for particular
--kinds of files. Run `configure --help' for a list of the directories
--you can set and what kinds of files go in them. In general, the
--default for these options is expressed in terms of `${prefix}', so that
--specifying just `--prefix' will affect all of the other directory
--specifications that were not explicitly provided.
--
-- The most portable way to affect installation locations is to pass the
--correct locations to `configure'; however, many packages provide one or
--both of the following shortcuts of passing variable assignments to the
--`make install' command line to change installation locations without
--having to reconfigure or recompile.
--
-- The first method involves providing an override variable for each
--affected directory. For example, `make install
--prefix=/alternate/directory' will choose an alternate location for all
--directory configuration variables that were expressed in terms of
--`${prefix}'. Any directories that were specified during `configure',
--but not in terms of `${prefix}', must each be overridden at install
--time for the entire installation to be relocated. The approach of
--makefile variable overrides for each directory variable is required by
--the GNU Coding Standards, and ideally causes no recompilation.
--However, some platforms have known limitations with the semantics of
--shared libraries that end up requiring recompilation when using this
--method, particularly noticeable in packages that use GNU Libtool.
--
-- The second method involves providing the `DESTDIR' variable. For
--example, `make install DESTDIR=/alternate/directory' will prepend
--`/alternate/directory' before all installation names. The approach of
--`DESTDIR' overrides is not required by the GNU Coding Standards, and
--does not work on platforms that have drive letters. On the other hand,
--it does better at avoiding recompilation issues, and works well even
--when some directory options were not specified in terms of `${prefix}'
--at `configure' time.
--
--Optional Features
--=================
--
-- If the package supports it, you can cause programs to be installed
--with an extra prefix or suffix on their names by giving `configure' the
--option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
--
-- Some packages pay attention to `--enable-FEATURE' options to
--`configure', where FEATURE indicates an optional part of the package.
--They may also pay attention to `--with-PACKAGE' options, where PACKAGE
--is something like `gnu-as' or `x' (for the X Window System). The
--`README' should mention any `--enable-' and `--with-' options that the
--package recognizes.
--
-- For packages that use the X Window System, `configure' can usually
--find the X include and library files automatically, but if it doesn't,
--you can use the `configure' options `--x-includes=DIR' and
--`--x-libraries=DIR' to specify their locations.
--
-- Some packages offer the ability to configure how verbose the
--execution of `make' will be. For these packages, running `./configure
----enable-silent-rules' sets the default to minimal output, which can be
--overridden with `make V=1'; while running `./configure
----disable-silent-rules' sets the default to verbose, which can be
--overridden with `make V=0'.
--
--Particular systems
--==================
--
-- On HP-UX, the default C compiler is not ANSI C compatible. If GNU
--CC is not installed, it is recommended to use the following options in
--order to use an ANSI C compiler:
--
-- ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
--
--and if that doesn't work, install pre-built binaries of GCC for HP-UX.
--
-- HP-UX `make' updates targets which have the same time stamps as
--their prerequisites, which makes it generally unusable when shipped
--generated files such as `configure' are involved. Use GNU `make'
--instead.
--
-- On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
--parse its `<wchar.h>' header file. The option `-nodtk' can be used as
--a workaround. If GNU CC is not installed, it is therefore recommended
--to try
--
-- ./configure CC="cc"
--
--and if that doesn't work, try
--
-- ./configure CC="cc -nodtk"
--
-- On Solaris, don't put `/usr/ucb' early in your `PATH'. This
--directory contains several dysfunctional programs; working variants of
--these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
--in your `PATH', put it _after_ `/usr/bin'.
--
-- On Haiku, software installed for all users goes in `/boot/common',
--not `/usr/local'. It is recommended to use the following options:
--
-- ./configure --prefix=/boot/common
--
--Specifying the System Type
--==========================
--
-- There may be some features `configure' cannot figure out
--automatically, but needs to determine by the type of machine the package
--will run on. Usually, assuming the package is built to be run on the
--_same_ architectures, `configure' can figure that out, but if it prints
--a message saying it cannot guess the machine type, give it the
--`--build=TYPE' option. TYPE can either be a short name for the system
--type, such as `sun4', or a canonical name which has the form:
--
-- CPU-COMPANY-SYSTEM
--
--where SYSTEM can have one of these forms:
--
-- OS
-- KERNEL-OS
--
-- See the file `config.sub' for the possible values of each field. If
--`config.sub' isn't included in this package, then this package doesn't
--need to know the machine type.
--
-- If you are _building_ compiler tools for cross-compiling, you should
--use the option `--target=TYPE' to select the type of system they will
--produce code for.
--
-- If you want to _use_ a cross compiler, that generates code for a
--platform different from the build platform, you should specify the
--"host" platform (i.e., that on which the generated programs will
--eventually be run) with `--host=TYPE'.
--
--Sharing Defaults
--================
--
-- If you want to set default values for `configure' scripts to share,
--you can create a site shell script called `config.site' that gives
--default values for variables like `CC', `cache_file', and `prefix'.
--`configure' looks for `PREFIX/share/config.site' if it exists, then
--`PREFIX/etc/config.site' if it exists. Or, you can set the
--`CONFIG_SITE' environment variable to the location of the site script.
--A warning: not all `configure' scripts look for a site script.
--
--Defining Variables
--==================
--
-- Variables not defined in a site shell script can be set in the
--environment passed to `configure'. However, some packages may run
--configure again during the build, and the customized values of these
--variables may be lost. In order to avoid this problem, you should set
--them in the `configure' command line, using `VAR=value'. For example:
--
-- ./configure CC=/usr/local2/bin/gcc
--
--causes the specified `gcc' to be used as the C compiler (unless it is
--overridden in the site shell script).
--
--Unfortunately, this technique does not work for `CONFIG_SHELL' due to
--an Autoconf limitation. Until the limitation is lifted, you can use
--this workaround:
--
-- CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
--
--`configure' Invocation
--======================
--
-- `configure' recognizes the following options to control how it
--operates.
--
--`--help'
--`-h'
-- Print a summary of all of the options to `configure', and exit.
--
--`--help=short'
--`--help=recursive'
-- Print a summary of the options unique to this package's
-- `configure', and exit. The `short' variant lists options used
-- only in the top level, while the `recursive' variant lists options
-- also present in any nested packages.
--
--`--version'
--`-V'
-- Print the version of Autoconf used to generate the `configure'
-- script, and exit.
--
--`--cache-file=FILE'
-- Enable the cache: use and save the results of the tests in FILE,
-- traditionally `config.cache'. FILE defaults to `/dev/null' to
-- disable caching.
--
--`--config-cache'
--`-C'
-- Alias for `--cache-file=config.cache'.
--
--`--quiet'
--`--silent'
--`-q'
-- Do not print messages saying which checks are being made. To
-- suppress all normal output, redirect it to `/dev/null' (any error
-- messages will still be shown).
--
--`--srcdir=DIR'
-- Look for the package's source code in directory DIR. Usually
-- `configure' can determine that directory automatically.
--
--`--prefix=DIR'
-- Use DIR as the installation prefix. *note Installation Names::
-- for more details, including other options available for fine-tuning
-- the installation locations.
--
--`--no-create'
--`-n'
-- Run the configure checks, but stop before creating any output
-- files.
--
--`configure' also accepts some other, not widely useful, options. Run
--`configure --help' for more details.
diff --git a/patches/ima-evm-utils-1.1/0002-Makefile.am-rename-INCLUDES-AM_CPPFLAGS.patch b/patches/ima-evm-utils-1.1/0002-Makefile.am-rename-INCLUDES-AM_CPPFLAGS.patch
deleted file mode 100644
index cb09b8d78..000000000
--- a/patches/ima-evm-utils-1.1/0002-Makefile.am-rename-INCLUDES-AM_CPPFLAGS.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Wed, 27 May 2015 10:41:27 +0200
-Subject: [PATCH] Makefile.am: rename INCLUDES -> AM_CPPFLAGS
-
-This patch fixes the following warning during autoreconf:
-
-| src/Makefile.am:19: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- src/Makefile.am | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/Makefile.am b/src/Makefile.am
-index deb18fb09dc7..9f547283d535 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -1,7 +1,7 @@
- lib_LTLIBRARIES = libimaevm.la
-
- libimaevm_la_SOURCES = libimaevm.c
--libimaevm_la_CPPFLAGS = $(OPENSSL_CFLAGS)
-+libimaevm_la_CPPFLAGS = $(OPENSSL_CFLAGS) $(AM_CPPFLAGS)
- # current[:revision[:age]]
- # result: [current-age].age.revision
- libimaevm_la_LDFLAGS = -version-info 0:0:0
-@@ -12,11 +12,11 @@ include_HEADERS = imaevm.h
- bin_PROGRAMS = evmctl
-
- evmctl_SOURCES = evmctl.c
--evmctl_CPPFLAGS = $(OPENSSL_CFLAGS)
-+evmctl_CPPFLAGS = $(OPENSSL_CFLAGS) $(AM_CPPFLAGS)
- evmctl_LDFLAGS = $(LDFLAGS_READLINE)
- evmctl_LDADD = $(OPENSSL_LIBS) -lkeyutils libimaevm.la
-
--INCLUDES = -I$(top_srcdir) -include config.h
-+AM_CPPFLAGS = -I$(top_srcdir) -include config.h
-
- DISTCLEANFILES = @DISTCLEANFILES@
-
diff --git a/patches/ima-evm-utils-1.1/0006-evmctl-libimaevm-use-EVP_MAX_MD_SIZE-for-hash-size-i.patch b/patches/ima-evm-utils-1.1/0006-evmctl-libimaevm-use-EVP_MAX_MD_SIZE-for-hash-size-i.patch
deleted file mode 100644
index a3cd597f8..000000000
--- a/patches/ima-evm-utils-1.1/0006-evmctl-libimaevm-use-EVP_MAX_MD_SIZE-for-hash-size-i.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Sat, 26 Mar 2016 22:58:07 +0100
-Subject: [PATCH] evmctl, libimaevm: use EVP_MAX_MD_SIZE for hash size instead
- of open coding it
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- src/evmctl.c | 10 +++++-----
- src/libimaevm.c | 2 +-
- 2 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/src/evmctl.c b/src/evmctl.c
-index de53be37b69b..b0f3b6362528 100644
---- a/src/evmctl.c
-+++ b/src/evmctl.c
-@@ -495,7 +495,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
-
- static int sign_evm(const char *file, const char *key)
- {
-- unsigned char hash[20];
-+ unsigned char hash[EVP_MAX_MD_SIZE];
- unsigned char sig[1024];
- int len, err;
-
-@@ -533,7 +533,7 @@ static int sign_evm(const char *file, const char *key)
-
- static int hash_ima(const char *file)
- {
-- unsigned char hash[66]; /* MAX hash size + 2 */
-+ unsigned char hash[EVP_MAX_MD_SIZE + 2]; /* MAX hash size + 2 */
- int len, err, offset;
- int algo = get_hash_algo(params.hash_algo);
-
-@@ -571,7 +571,7 @@ static int hash_ima(const char *file)
-
- static int sign_ima(const char *file, const char *key)
- {
-- unsigned char hash[64];
-+ unsigned char hash[EVP_MAX_MD_SIZE];
- unsigned char sig[1024];
- int len, err;
-
-@@ -751,7 +751,7 @@ static int cmd_sign_evm(struct command *cmd)
-
- static int verify_evm(const char *file)
- {
-- unsigned char hash[20];
-+ unsigned char hash[EVP_MAX_MD_SIZE];
- unsigned char sig[1024];
- int len;
-
-@@ -1119,7 +1119,7 @@ out:
-
- static int hmac_evm(const char *file, const char *key)
- {
-- unsigned char hash[20];
-+ unsigned char hash[EVP_MAX_MD_SIZE];
- unsigned char sig[1024];
- int len, err;
-
-diff --git a/src/libimaevm.c b/src/libimaevm.c
-index 6fa0ed4a1c74..8fc23be08bd7 100644
---- a/src/libimaevm.c
-+++ b/src/libimaevm.c
-@@ -590,7 +590,7 @@ int verify_hash(const char *file, const unsigned char *hash, int size, unsigned
- int ima_verify_signature(const char *file, unsigned char *sig, int siglen,
- unsigned char *digest, int digestlen)
- {
-- unsigned char hash[64];
-+ unsigned char hash[EVP_MAX_MD_SIZE];
- int hashlen, sig_hash_algo;
-
- if (sig[0] != 0x03) {
diff --git a/patches/ima-evm-utils-1.1/0008-evmctl-add-parameter-e-to-set-evm-hash-algo.patch b/patches/ima-evm-utils-1.1/0008-evmctl-add-parameter-e-to-set-evm-hash-algo.patch
deleted file mode 100644
index 488dfa822..000000000
--- a/patches/ima-evm-utils-1.1/0008-evmctl-add-parameter-e-to-set-evm-hash-algo.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
-Date: Tue, 8 Mar 2016 13:46:14 +0100
-Subject: [PATCH] evmctl: add parameter -e to set evm hash algo
-
-The paramter -a sets the hash algorithm only for IMA. To not break
-anything, add a new parameter -e to be able to change the hash for
-EVM, too.
-
-Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
----
- src/evmctl.c | 27 +++++++++++++++++++++++----
- src/imaevm.h | 1 +
- src/libimaevm.c | 1 +
- 3 files changed, 25 insertions(+), 4 deletions(-)
-
-diff --git a/src/evmctl.c b/src/evmctl.c
-index b0f3b6362528..5d664005e915 100644
---- a/src/evmctl.c
-+++ b/src/evmctl.c
-@@ -336,6 +336,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
- #else
- pctx = EVP_MD_CTX_new();
- #endif
-+ const EVP_MD *md;
-
- if (lstat(file, &st)) {
- log_err("Failed to stat: %s\n", file);
-@@ -379,7 +380,13 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
- return -1;
- }
-
-- err = EVP_DigestInit(pctx, EVP_sha1());
-+ md = EVP_get_digestbyname(params.evm_hash_algo);
-+ if (!md) {
-+ log_err("EVP_get_digestbyname() failed\n");
-+ return 1;
-+ }
-+
-+ err = EVP_DigestInit(pctx, md);
- if (!err) {
- log_err("EVP_DigestInit() failed\n");
- return 1;
-@@ -503,7 +510,7 @@ static int sign_evm(const char *file, const char *key)
- if (len <= 1)
- return len;
-
-- len = sign_hash("sha1", hash, len, key, NULL, sig + 1);
-+ len = sign_hash(params.evm_hash_algo, hash, len, key, NULL, sig + 1);
- if (len <= 1)
- return len;
-
-@@ -992,6 +999,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
- #else
- pctx = HMAC_CTX_new();
- #endif
-+ const EVP_MD *md;
-
- key = file2bin(keyfile, NULL, &keylen);
- if (!key) {
-@@ -1038,7 +1046,13 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
- goto out;
- }
-
-- err = !HMAC_Init_ex(pctx, evmkey, sizeof(evmkey), EVP_sha1(), NULL);
-+ md = EVP_get_digestbyname(params.evm_hash_algo);
-+ if (!md) {
-+ log_err("EVP_get_digestbyname() failed\n");
-+ return 1;
-+ }
-+
-+ err = !HMAC_Init_ex(pctx, evmkey, sizeof(evmkey), md, NULL);
- if (err) {
- log_err("HMAC_Init() failed\n");
- goto out;
-@@ -1635,6 +1649,7 @@ static void usage(void)
- printf(
- "\n"
- " -a, --hashalgo sha1 (default), sha224, sha256, sha384, sha512\n"
-+ " -e, --evmhashalgo sha1 (default), sha224, sha256, sha384, sha512\n"
- " -s, --imasig make IMA signature\n"
- " -d, --imahash make IMA hash\n"
- " -f, --sigfile store IMA signature in .sig file instead of xattr\n"
-@@ -1691,6 +1706,7 @@ static struct option opts[] = {
- {"imasig", 0, 0, 's'},
- {"imahash", 0, 0, 'd'},
- {"hashalgo", 1, 0, 'a'},
-+ {"evmhashalgo", 1, 0, 'e'},
- {"pass", 2, 0, 'p'},
- {"sigfile", 0, 0, 'f'},
- {"uuid", 2, 0, 'u'},
-@@ -1758,7 +1774,7 @@ int main(int argc, char *argv[])
- g_argc = argc;
-
- while (1) {
-- c = getopt_long(argc, argv, "hvnsda:op::fu::k:t:ri", opts, &lind);
-+ c = getopt_long(argc, argv, "hvnsda:e:op::fu::k:t:ri", opts, &lind);
- if (c == -1)
- break;
-
-@@ -1784,6 +1800,9 @@ int main(int argc, char *argv[])
- case 'a':
- params.hash_algo = optarg;
- break;
-+ case 'e':
-+ params.evm_hash_algo = optarg;
-+ break;
- case 'p':
- if (optarg)
- params.keypass = optarg;
-diff --git a/src/imaevm.h b/src/imaevm.h
-index 1bafaad0f4ab..ed92e4d8981d 100644
---- a/src/imaevm.h
-+++ b/src/imaevm.h
-@@ -179,6 +179,7 @@ struct libevm_params {
- int verbose;
- int x509;
- const char *hash_algo;
-+ const char *evm_hash_algo;
- const char *keyfile;
- const char *keypass;
- };
-diff --git a/src/libimaevm.c b/src/libimaevm.c
-index b6c328801708..4c093a038b72 100644
---- a/src/libimaevm.c
-+++ b/src/libimaevm.c
-@@ -129,6 +129,7 @@ struct libevm_params params = {
- .verbose = LOG_INFO - 1,
- .x509 = 1,
- .hash_algo = "sha1",
-+ .evm_hash_algo = "sha1",
- };
-
- static void __attribute__ ((constructor)) libinit(void);
diff --git a/patches/ima-evm-utils-1.1/0011-HACK-don-t-generate-man-page.patch b/patches/ima-evm-utils-1.1/0011-HACK-don-t-generate-man-page.patch
deleted file mode 100644
index bb44e8d6c..000000000
--- a/patches/ima-evm-utils-1.1/0011-HACK-don-t-generate-man-page.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 3 Jun 2015 16:08:51 +0200
-Subject: [PATCH] HACK: don't generate man page
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- Makefile.am | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 06ebf59ea4aa..e527f34f1faa 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1,5 +1,4 @@
- SUBDIRS = src
--dist_man_MANS = evmctl.1
-
- doc_DATA = examples/ima-genkey-self.sh examples/ima-genkey.sh examples/ima-gen-local-ca.sh
- EXTRA_DIST = autogen.sh $(doc_DATA)
diff --git a/patches/ima-evm-utils-1.1/0013-evmctl-use-correct-include-for-xattr.h.patch b/patches/ima-evm-utils-1.1/0013-evmctl-use-correct-include-for-xattr.h.patch
deleted file mode 100644
index 3157c711a..000000000
--- a/patches/ima-evm-utils-1.1/0013-evmctl-use-correct-include-for-xattr.h.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
-Date: Mon, 17 Oct 2016 12:45:32 +0100
-Subject: [PATCH] evmctl: use correct include for xattr.h
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The xattr API/ABI is provided by both the c-library, as well as by the
-libattr package. The c-library's header file is sys/xattr.h, whereas
-libattr's header file can be found in attr/xattr.h.
-
-Given none of the code here *links* against the libattr.so shared library, it
-is wrong to *compile* against libattr's API (header file).
-
-Doing so avoids confusion as to which xattr.h is used as the least problem,
-and potential ABI differences as the worst problem due the mismatching header
-file used.
-
-So make sure we compile and link against the same thing, the c-library in
-both cases.
-
-Signed-off-by: André Draszik <git@andred.net>
-Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
----
- configure.ac | 2 +-
- packaging/ima-evm-utils.spec | 1 -
- packaging/ima-evm-utils.spec.in | 1 -
- src/evmctl.c | 2 +-
- 4 files changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 6822f39cff69..06d061bc94ea 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -30,7 +30,7 @@ AC_SUBST(OPENSSL_LIBS)
- AC_CHECK_HEADER(unistd.h)
- AC_CHECK_HEADERS(openssl/conf.h)
-
--AC_CHECK_HEADERS(attr/xattr.h, , [AC_MSG_ERROR([attr/xattr.h header not found. You need the libattr development package.])])
-+AC_CHECK_HEADERS(sys/xattr.h, , [AC_MSG_ERROR([sys/xattr.h header not found. You need the c-library development package.])])
- AC_CHECK_HEADERS(keyutils.h, , [AC_MSG_ERROR([keyutils.h header not found. You need the libkeyutils development package.])])
-
- #debug support - yes for a while
-diff --git a/packaging/ima-evm-utils.spec b/packaging/ima-evm-utils.spec
-index a11a27a18815..63388d2b444b 100644
---- a/packaging/ima-evm-utils.spec
-+++ b/packaging/ima-evm-utils.spec
-@@ -11,7 +11,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
- BuildRequires: autoconf
- BuildRequires: automake
- BuildRequires: openssl-devel
--BuildRequires: libattr-devel
- BuildRequires: keyutils-libs-devel
-
- %description
-diff --git a/packaging/ima-evm-utils.spec.in b/packaging/ima-evm-utils.spec.in
-index 7ca6c6fb3b0d..65c32f9e6445 100644
---- a/packaging/ima-evm-utils.spec.in
-+++ b/packaging/ima-evm-utils.spec.in
-@@ -11,7 +11,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
- BuildRequires: autoconf
- BuildRequires: automake
- BuildRequires: openssl-devel
--BuildRequires: libattr-devel
- BuildRequires: keyutils-libs-devel
-
- %description
-diff --git a/src/evmctl.c b/src/evmctl.c
-index 4422c0e84d4a..02eb84d4c341 100644
---- a/src/evmctl.c
-+++ b/src/evmctl.c
-@@ -49,7 +49,7 @@
- #include <stdint.h>
- #include <string.h>
- #include <dirent.h>
--#include <attr/xattr.h>
-+#include <sys/xattr.h>
- #include <linux/xattr.h>
- #include <getopt.h>
- #include <keyutils.h>
diff --git a/patches/ima-evm-utils-1.1/series b/patches/ima-evm-utils-1.1/series
deleted file mode 100644
index 6fb042465..000000000
--- a/patches/ima-evm-utils-1.1/series
+++ /dev/null
@@ -1,16 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-INSTALL-remove-file-at-it-s-autogenerated-by-autotoo.patch
-0002-Makefile.am-rename-INCLUDES-AM_CPPFLAGS.patch
-0003-evmctl-find-add-missing-closedir-dir-on-error.patch
-0004-evmctl-find-add-missing-error-handling-and-propagate.patch
-0005-evmctl-add-fallback-definitions-for-XATTR_NAME_IMA.patch
-0006-evmctl-libimaevm-use-EVP_MAX_MD_SIZE-for-hash-size-i.patch
-0007-libimaevm-use-SHA_DIGEST_LENGTH-instead-of-open-codi.patch
-0008-evmctl-add-parameter-e-to-set-evm-hash-algo.patch
-0009-evmctl-add-support-for-offline-image-preparation.patch
-0010-evmctl-Do-not-account-.-and-.-for-directory-hash-gen.patch
-0011-HACK-don-t-generate-man-page.patch
-0012-Fix-warning-for-non-debug-use-case.patch
-0013-evmctl-use-correct-include-for-xattr.h.patch
-# 5032e96fb6da7cb77f053c2b5a6edc44 - git-ptx-patches magic
diff --git a/patches/ima-evm-utils-1.1/0003-evmctl-find-add-missing-closedir-dir-on-error.patch b/patches/ima-evm-utils-1.3.2/0001-evmctl-find-add-missing-closedir-dir-on-error.patch
index 4b1c84584..5c91c4621 100644
--- a/patches/ima-evm-utils-1.1/0003-evmctl-find-add-missing-closedir-dir-on-error.patch
+++ b/patches/ima-evm-utils-1.3.2/0001-evmctl-find-add-missing-closedir-dir-on-error.patch
@@ -10,10 +10,10 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 2 insertions(+)
diff --git a/src/evmctl.c b/src/evmctl.c
-index 2ffee786865b..20eccfa93b2b 100644
+index 1815f55d73e0..cca2fabdb2a6 100644
--- a/src/evmctl.c
+++ b/src/evmctl.c
-@@ -1229,6 +1229,7 @@ static int find(const char *path, int dts, find_cb_t func)
+@@ -1331,6 +1331,7 @@ static int find(const char *path, int dts, find_cb_t func)
if (fchdir(dirfd(dir))) {
log_err("Failed to chdir %s\n", path);
@@ -21,7 +21,7 @@ index 2ffee786865b..20eccfa93b2b 100644
return -1;
}
-@@ -1244,6 +1245,7 @@ static int find(const char *path, int dts, find_cb_t func)
+@@ -1346,6 +1347,7 @@ static int find(const char *path, int dts, find_cb_t func)
if (chdir("..")) {
log_err("Failed to chdir: %s\n", path);
diff --git a/patches/ima-evm-utils-1.1/0004-evmctl-find-add-missing-error-handling-and-propagate.patch b/patches/ima-evm-utils-1.3.2/0002-evmctl-find-add-missing-error-handling-and-propagate.patch
index 68660d95e..62471489a 100644
--- a/patches/ima-evm-utils-1.1/0004-evmctl-find-add-missing-error-handling-and-propagate.patch
+++ b/patches/ima-evm-utils-1.3.2/0002-evmctl-find-add-missing-error-handling-and-propagate.patch
@@ -12,10 +12,10 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/evmctl.c b/src/evmctl.c
-index 20eccfa93b2b..55fc619f5990 100644
+index cca2fabdb2a6..e6761f2ae5e4 100644
--- a/src/evmctl.c
+++ b/src/evmctl.c
-@@ -1234,13 +1234,20 @@ static int find(const char *path, int dts, find_cb_t func)
+@@ -1336,13 +1336,20 @@ static int find(const char *path, int dts, find_cb_t func)
}
while ((de = readdir(dir))) {
@@ -38,7 +38,7 @@ index 20eccfa93b2b..55fc619f5990 100644
}
if (chdir("..")) {
-@@ -1249,8 +1256,13 @@ static int find(const char *path, int dts, find_cb_t func)
+@@ -1351,8 +1358,13 @@ static int find(const char *path, int dts, find_cb_t func)
return -1;
}
diff --git a/patches/ima-evm-utils-1.1/0005-evmctl-add-fallback-definitions-for-XATTR_NAME_IMA.patch b/patches/ima-evm-utils-1.3.2/0003-evmctl-add-fallback-definitions-for-XATTR_NAME_IMA.patch
index 69aadb377..0de24af6a 100644
--- a/patches/ima-evm-utils-1.1/0005-evmctl-add-fallback-definitions-for-XATTR_NAME_IMA.patch
+++ b/patches/ima-evm-utils-1.3.2/0003-evmctl-add-fallback-definitions-for-XATTR_NAME_IMA.patch
@@ -10,12 +10,12 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 5 insertions(+)
diff --git a/src/evmctl.c b/src/evmctl.c
-index 55fc619f5990..de53be37b69b 100644
+index e6761f2ae5e4..a1fd9feaea78 100644
--- a/src/evmctl.c
+++ b/src/evmctl.c
-@@ -62,6 +62,11 @@
- #include <openssl/err.h>
- #include <openssl/rsa.h>
+@@ -72,6 +72,11 @@
+ #define XATTR_NAME_APPARMOR XATTR_SECURITY_PREFIX XATTR_APPARMOR_SUFFIX
+ #endif
+#ifndef XATTR_NAME_IMA
+#define XATTR_IMA_SUFFIX "ima"
diff --git a/patches/ima-evm-utils-1.1/0007-libimaevm-use-SHA_DIGEST_LENGTH-instead-of-open-codi.patch b/patches/ima-evm-utils-1.3.2/0004-libimaevm-use-SHA_DIGEST_LENGTH-instead-of-open-codi.patch
index 2164c6238..e20cfaa82 100644
--- a/patches/ima-evm-utils-1.1/0007-libimaevm-use-SHA_DIGEST_LENGTH-instead-of-open-codi.patch
+++ b/patches/ima-evm-utils-1.3.2/0004-libimaevm-use-SHA_DIGEST_LENGTH-instead-of-open-codi.patch
@@ -8,10 +8,10 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libimaevm.c b/src/libimaevm.c
-index 8fc23be08bd7..b6c328801708 100644
+index fa6c27858d0f..002b0657337c 100644
--- a/src/libimaevm.c
+++ b/src/libimaevm.c
-@@ -379,7 +379,7 @@ int verify_hash_v1(const char *file, const unsigned char *hash, int size,
+@@ -382,7 +382,7 @@ static int verify_hash_v1(const char *file, const unsigned char *hash, int size,
SHA_CTX ctx;
unsigned char out[1024];
RSA *key;
@@ -20,7 +20,7 @@ index 8fc23be08bd7..b6c328801708 100644
struct signature_hdr *hdr = (struct signature_hdr *)sig;
log_info("hash-v1: ");
-@@ -744,7 +744,7 @@ int sign_hash_v1(const char *hashalgo, const unsigned char *hash, int size, cons
+@@ -805,7 +805,7 @@ static int sign_hash_v1(const char *hashalgo, const unsigned char *hash,
unsigned char pub[1024];
RSA *key;
char name[20];
diff --git a/patches/ima-evm-utils-1.1/0009-evmctl-add-support-for-offline-image-preparation.patch b/patches/ima-evm-utils-1.3.2/0005-evmctl-add-support-for-offline-image-preparation.patch
index 6d9b40fc5..75d927341 100644
--- a/patches/ima-evm-utils-1.1/0009-evmctl-add-support-for-offline-image-preparation.patch
+++ b/patches/ima-evm-utils-1.3.2/0005-evmctl-add-support-for-offline-image-preparation.patch
@@ -33,29 +33,29 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
src/evmctl.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++--------
src/imaevm.h | 1 +
- src/libimaevm.c | 25 ++++++++++++++++++++++++-
- 3 files changed, 74 insertions(+), 9 deletions(-)
+ src/libimaevm.c | 24 +++++++++++++++++++++++-
+ 3 files changed, 73 insertions(+), 9 deletions(-)
diff --git a/src/evmctl.c b/src/evmctl.c
-index 5d664005e915..9003f7640c0f 100644
+index a1fd9feaea78..a4d784a5bfb6 100644
--- a/src/evmctl.c
+++ b/src/evmctl.c
-@@ -337,6 +337,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
+@@ -352,6 +352,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
+ #else
pctx = EVP_MD_CTX_new();
#endif
- const EVP_MD *md;
+ ino_t ino;
if (lstat(file, &st)) {
log_err("Failed to stat: %s\n", file);
-@@ -371,9 +372,25 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
+@@ -386,9 +387,25 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
}
close(fd);
}
- log_info("generation: %u\n", generation);
}
-+ if (params.image_mode) {
++ if (imaevm_params.image_mode) {
+ char buf[128] = { };
+
+ err = lgetxattr(file, "user.image-inode-number", buf, sizeof(buf) - 1);
@@ -75,7 +75,7 @@ index 5d664005e915..9003f7640c0f 100644
list_size = llistxattr(file, list, sizeof(list));
if (list_size < 0) {
log_err("llistxattr() failed\n");
-@@ -439,7 +456,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
+@@ -470,7 +487,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
hmac_size = sizeof(*hmac);
if (!evm_portable) {
@@ -84,7 +84,7 @@ index 5d664005e915..9003f7640c0f 100644
hmac->generation = generation;
}
hmac->uid = st.st_uid;
-@@ -450,7 +467,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
+@@ -481,7 +498,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
hmac_size = sizeof(*hmac);
if (!evm_portable) {
@@ -93,7 +93,7 @@ index 5d664005e915..9003f7640c0f 100644
hmac->generation = generation;
}
hmac->uid = st.st_uid;
-@@ -461,7 +478,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
+@@ -492,7 +509,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
hmac_size = sizeof(*hmac);
if (!evm_portable) {
@@ -102,19 +102,19 @@ index 5d664005e915..9003f7640c0f 100644
hmac->generation = generation;
}
hmac->uid = st.st_uid;
-@@ -1000,6 +1017,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
+@@ -1085,6 +1102,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
+ #else
pctx = HMAC_CTX_new();
#endif
- const EVP_MD *md;
+ ino_t ino;
key = file2bin(keyfile, NULL, &keylen);
if (!key) {
-@@ -1038,10 +1056,26 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
+@@ -1123,10 +1141,26 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
close(fd);
}
-+ if (params.image_mode) {
++ if (imaevm_params.image_mode) {
+ char buf[128] = { };
+
+ err = lgetxattr(file, "user.image-inode-number", buf, sizeof(buf) - 1);
@@ -137,7 +137,7 @@ index 5d664005e915..9003f7640c0f 100644
log_err("llistxattr() failed: %s\n", file);
goto out;
}
-@@ -1084,7 +1118,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
+@@ -1170,7 +1204,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
struct h_misc *hmac = (struct h_misc *)&hmac_misc;
hmac_size = sizeof(*hmac);
@@ -146,7 +146,7 @@ index 5d664005e915..9003f7640c0f 100644
hmac->generation = generation;
hmac->uid = st.st_uid;
hmac->gid = st.st_gid;
-@@ -1093,7 +1127,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
+@@ -1179,7 +1213,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
struct h_misc_64 *hmac = (struct h_misc_64 *)&hmac_misc;
hmac_size = sizeof(*hmac);
@@ -155,7 +155,7 @@ index 5d664005e915..9003f7640c0f 100644
hmac->generation = generation;
hmac->uid = st.st_uid;
hmac->gid = st.st_gid;
-@@ -1102,7 +1136,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
+@@ -1188,7 +1222,7 @@ static int calc_evm_hmac(const char *file, const char *keyfile, unsigned char *h
struct h_misc_32 *hmac = (struct h_misc_32 *)&hmac_misc;
hmac_size = sizeof(*hmac);
@@ -164,7 +164,7 @@ index 5d664005e915..9003f7640c0f 100644
hmac->generation = generation;
hmac->uid = st.st_uid;
hmac->gid = st.st_gid;
-@@ -1666,6 +1700,9 @@ static void usage(void)
+@@ -2476,6 +2510,9 @@ static void usage(void)
" --smack use extra SMACK xattrs for EVM\n"
" --m32 force EVM hmac/signature for 32 bit target system\n"
" --m64 force EVM hmac/signature for 64 bit target system\n"
@@ -174,7 +174,7 @@ index 5d664005e915..9003f7640c0f 100644
" --ino use custom inode for EVM\n"
" --uid use custom UID for EVM\n"
" --gid use custom GID for EVM\n"
-@@ -1716,6 +1753,7 @@ static struct option opts[] = {
+@@ -2528,6 +2565,7 @@ static struct option opts[] = {
{"recursive", 0, 0, 'r'},
{"m32", 0, 0, '3'},
{"m64", 0, 0, '6'},
@@ -182,31 +182,31 @@ index 5d664005e915..9003f7640c0f 100644
{"portable", 0, 0, 'o'},
{"smack", 0, 0, 128},
{"version", 0, 0, 129},
-@@ -1774,7 +1812,7 @@ int main(int argc, char *argv[])
+@@ -2600,7 +2638,7 @@ int main(int argc, char *argv[])
g_argc = argc;
while (1) {
-- c = getopt_long(argc, argv, "hvnsda:e:op::fu::k:t:ri", opts, &lind);
-+ c = getopt_long(argc, argv, "hvnsda:e:op::fu::k:t:rim", opts, &lind);
+- c = getopt_long(argc, argv, "hvnsda:op::fu::k:t:ri", opts, &lind);
++ c = getopt_long(argc, argv, "hvnsda:op::fu::k:t:rim", opts, &lind);
if (c == -1)
break;
-@@ -1847,6 +1885,9 @@ int main(int argc, char *argv[])
+@@ -2670,6 +2708,9 @@ int main(int argc, char *argv[])
case '6':
msize = 64;
break;
+ case 'm':
-+ params.image_mode = true;
++ imaevm_params.image_mode = true;
+ break;
case 128:
evm_config_xattrnames = evm_extra_smack_xattrs;
break;
diff --git a/src/imaevm.h b/src/imaevm.h
-index ed92e4d8981d..7e32d09c6538 100644
+index 45039199ab31..2f78a31ab438 100644
--- a/src/imaevm.h
+++ b/src/imaevm.h
-@@ -182,6 +182,7 @@ struct libevm_params {
- const char *evm_hash_algo;
+@@ -196,6 +196,7 @@ struct libimaevm_params {
+ const char *hash_algo;
const char *keyfile;
const char *keypass;
+ bool image_mode;
@@ -214,31 +214,23 @@ index ed92e4d8981d..7e32d09c6538 100644
struct RSA_ASN1_template {
diff --git a/src/libimaevm.c b/src/libimaevm.c
-index 4c093a038b72..866f74b39b41 100644
+index 002b0657337c..1cdf1dc590cc 100644
--- a/src/libimaevm.c
+++ b/src/libimaevm.c
-@@ -40,6 +40,7 @@
-
- /* should we use logger instead for library? */
- #define USE_FPRINTF
-+#define _GNU_SOURCE
-
- #include <sys/types.h>
- #include <sys/param.h>
-@@ -49,6 +50,7 @@
- #include <dirent.h>
- #include <string.h>
+@@ -51,6 +51,7 @@
#include <stdio.h>
+ #include <assert.h>
+ #include <ctype.h>
+#include <sys/xattr.h>
+ #include <openssl/crypto.h>
#include <openssl/pem.h>
- #include <openssl/evp.h>
-@@ -224,7 +226,28 @@ static int add_dir_hash(const char *file, EVP_MD_CTX *ctx)
+@@ -193,7 +194,28 @@ static int add_dir_hash(const char *file, EVP_MD_CTX *ctx)
}
while ((de = readdir(dir))) {
- ino = de->d_ino;
-+ if (params.image_mode) {
++ if (imaevm_params.image_mode) {
+ char *name;
+ char buf[128] = { };
+
diff --git a/patches/ima-evm-utils-1.1/0010-evmctl-Do-not-account-.-and-.-for-directory-hash-gen.patch b/patches/ima-evm-utils-1.3.2/0006-evmctl-Do-not-account-.-and-.-for-directory-hash-gen.patch
index 12b77a132..251f7136b 100644
--- a/patches/ima-evm-utils-1.1/0010-evmctl-Do-not-account-.-and-.-for-directory-hash-gen.patch
+++ b/patches/ima-evm-utils-1.3.2/0006-evmctl-Do-not-account-.-and-.-for-directory-hash-gen.patch
@@ -15,16 +15,16 @@ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 file changed, 3 insertions(+)
diff --git a/src/libimaevm.c b/src/libimaevm.c
-index 866f74b39b41..834b738426bf 100644
+index 1cdf1dc590cc..6bb0b0757c42 100644
--- a/src/libimaevm.c
+++ b/src/libimaevm.c
-@@ -226,6 +226,9 @@ static int add_dir_hash(const char *file, EVP_MD_CTX *ctx)
+@@ -194,6 +194,9 @@ static int add_dir_hash(const char *file, EVP_MD_CTX *ctx)
}
while ((de = readdir(dir))) {
+ if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."))
+ continue;
+
- if (params.image_mode) {
+ if (imaevm_params.image_mode) {
char *name;
char buf[128] = { };
diff --git a/patches/ima-evm-utils-1.1/0012-Fix-warning-for-non-debug-use-case.patch b/patches/ima-evm-utils-1.3.2/0007-Fix-warning-for-non-debug-use-case.patch
index 80073f19a..2cddf569a 100644
--- a/patches/ima-evm-utils-1.1/0012-Fix-warning-for-non-debug-use-case.patch
+++ b/patches/ima-evm-utils-1.3.2/0007-Fix-warning-for-non-debug-use-case.patch
@@ -14,10 +14,10 @@ Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/evmctl.c b/src/evmctl.c
-index 9003f7640c0f..4422c0e84d4a 100644
+index a4d784a5bfb6..7c1f15082615 100644
--- a/src/evmctl.c
+++ b/src/evmctl.c
-@@ -1191,7 +1191,7 @@ static int hmac_evm(const char *file, const char *key)
+@@ -1279,7 +1279,7 @@ static int hmac_evm(const char *file, const char *key)
return 0;
}
diff --git a/patches/evtest-1.33/autogen.sh b/patches/ima-evm-utils-1.3.2/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/evtest-1.33/autogen.sh
+++ b/patches/ima-evm-utils-1.3.2/autogen.sh
diff --git a/patches/ima-evm-utils-1.3.2/series b/patches/ima-evm-utils-1.3.2/series
new file mode 100644
index 000000000..36781ea6b
--- /dev/null
+++ b/patches/ima-evm-utils-1.3.2/series
@@ -0,0 +1,10 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-evmctl-find-add-missing-closedir-dir-on-error.patch
+0002-evmctl-find-add-missing-error-handling-and-propagate.patch
+0003-evmctl-add-fallback-definitions-for-XATTR_NAME_IMA.patch
+0004-libimaevm-use-SHA_DIGEST_LENGTH-instead-of-open-codi.patch
+0005-evmctl-add-support-for-offline-image-preparation.patch
+0006-evmctl-Do-not-account-.-and-.-for-directory-hash-gen.patch
+0007-Fix-warning-for-non-debug-use-case.patch
+# f8ecfd002cf2ee8244984a1757a1bfea - git-ptx-patches magic
diff --git a/patches/installer-0.7.0/0001-HACK-drop-shebang-magic.patch b/patches/installer-0.7.0/0001-HACK-drop-shebang-magic.patch
new file mode 100644
index 000000000..f12463329
--- /dev/null
+++ b/patches/installer-0.7.0/0001-HACK-drop-shebang-magic.patch
@@ -0,0 +1,37 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Thu, 27 Apr 2023 22:20:08 +0200
+Subject: [PATCH] HACK: drop shebang magic
+
+We replace the shebang later anyways, so make sure it's always the same.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ src/installer/scripts.py | 15 +--------------
+ 1 file changed, 1 insertion(+), 14 deletions(-)
+
+diff --git a/src/installer/scripts.py b/src/installer/scripts.py
+index 7e3c8fcd070a..ba6ed5aec3b6 100644
+--- a/src/installer/scripts.py
++++ b/src/installer/scripts.py
+@@ -59,20 +59,7 @@ def _build_shebang(executable: str, forlauncher: bool) -> bytes:
+ https://bitbucket.org/pypa/distlib/src/58cd5c6/distlib/scripts.py#lines-124
+ """
+ executable_bytes = executable.encode("utf-8")
+- if forlauncher: # The launcher can just use the command as-is.
+- return b"#!" + executable_bytes
+- if _is_executable_simple(executable_bytes):
+- return b"#!" + executable_bytes
+-
+- # Shebang support for an executable with a space in it is under-specified
+- # and platform-dependent, so we use a clever hack to generate a script to
+- # run in ``/bin/sh`` that should work on all reasonably modern platforms.
+- # Read the following message to understand how the hack works:
+- # https://github.com/pradyunsg/installer/pull/4#issuecomment-623668717
+-
+- quoted = shlex.quote(executable).encode("utf-8")
+- # I don't understand a lick what this is trying to do.
+- return b"#!/bin/sh\n'''exec' " + quoted + b' "$0" "$@"\n' + b"' '''"
++ return b"#!" + executable_bytes
+
+
+ class InvalidScript(ValueError):
diff --git a/patches/installer-0.7.0/series b/patches/installer-0.7.0/series
new file mode 100644
index 000000000..391c80de2
--- /dev/null
+++ b/patches/installer-0.7.0/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-HACK-drop-shebang-magic.patch
+# 1fa60d140bd5ea18d5663cb3af68671c - git-ptx-patches magic
diff --git a/patches/jed-0.99-19/0001-jed-don-t-execute-cross-compiled-files.patch b/patches/jed-0.99-19/0001-jed-don-t-execute-cross-compiled-files.patch
deleted file mode 100644
index 1129a3fb9..000000000
--- a/patches/jed-0.99-19/0001-jed-don-t-execute-cross-compiled-files.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Robert Schwebel <r.schwebel@pengutronix.de>
-Date: Wed, 3 Oct 2018 11:15:59 +0200
-Subject: [PATCH] jed: don't execute cross compiled files
-
-When cross compiling, chkslang is a tool for the "host" machine, but we
-try to run it on the "build" box.
-
-Hack alert - not for upstream.
-
-Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
----
- src/Makefile.in | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/src/Makefile.in b/src/Makefile.in
-index e91f66a1dea8..d2033fba2771 100644
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -160,9 +160,8 @@ slangversion: $(OBJDIR)/chkslang
- if $(OBJDIR)/chkslang jed $(MIN_SLANG_VERSION) $(MAX_SLANG_VERSION);\
- then exit 0; else $(RM) $(OBJDIR)/chkslang; exit 1; fi
-
--$(OBJDIR)/chkslang: config.h Makefile chkslang.c $(DOT_O_DEPS) $(chkslang_O_DEP)
-- $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(SRCDIR)/chkslang.c -o $(OBJDIR)/chkslang $(COMMON_LIBS)
--
-+$(OBJDIR)/chkslang: | $(OBJDIR)
-+ rm -f $@; ln -s /bin/true $@
-
- $(OBJDIR):
- -mkdir $(OBJDIR)
diff --git a/patches/jed-0.99-19/0002-avoid-rpath.patch b/patches/jed-0.99-19/0002-avoid-rpath.patch
deleted file mode 100644
index c0cb81558..000000000
--- a/patches/jed-0.99-19/0002-avoid-rpath.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Robert Schwebel <r.schwebel@pengutronix.de>
-Date: Wed, 3 Oct 2018 11:15:59 +0200
-Subject: [PATCH] avoid rpath
-
-An rpath on the target is uggly as hell when cross compiling. Disable
-it. This is just a hack and not intended for upstream. I was too lazy to
-fix it in the m4 macros... in the end, it's just an emacs clone, so it
-isn't worth it :-)
-
-Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
----
- configure | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/configure b/configure
-index 2dc36ae5daa4..661a3ae35fe2 100755
---- a/configure
-+++ b/configure
-@@ -11466,6 +11466,8 @@ esac
- RPATH="$RPATH:$jd_slang_library_dir"
- fi
- fi
-+# rsc: uggly hack to disable rpath
-+RPATH=
-
- fi
-
diff --git a/patches/jed-0.99-19/series b/patches/jed-0.99-19/series
deleted file mode 100644
index 3986b7794..000000000
--- a/patches/jed-0.99-19/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-jed-don-t-execute-cross-compiled-files.patch
-0002-avoid-rpath.patch
-# 5ef540b082b80bd2e3d53023327d388b - git-ptx-patches magic
diff --git a/patches/keyutils-1.5.10/0001-Makefile-don-t-create-absolute-link-outside-of-DESTD.patch b/patches/keyutils-1.6.3/0001-Makefile-don-t-create-absolute-link-outside-of-DESTD.patch
index fe9d7a374..590d087d6 100644
--- a/patches/keyutils-1.5.10/0001-Makefile-don-t-create-absolute-link-outside-of-DESTD.patch
+++ b/patches/keyutils-1.6.3/0001-Makefile-don-t-create-absolute-link-outside-of-DESTD.patch
@@ -8,15 +8,15 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index 824bbbf470c2..351e749760f7 100644
+index 599b1452a05a..0a2bacacfb88 100644
--- a/Makefile
+++ b/Makefile
-@@ -167,7 +167,7 @@ ifeq ($(NO_SOLIB),0)
+@@ -200,7 +200,7 @@ ifeq ($(NO_SOLIB),0)
$(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
$(LNS) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
mkdir -p $(DESTDIR)$(USRLIBDIR)
- $(LNS) $(LIBDIR)/$(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB)
+ $(LNS) $(SONAME) $(DESTDIR)$(LIBDIR)/$(DEVELLIB)
- endif
- $(INSTALL) -D keyctl $(DESTDIR)$(BINDIR)/keyctl
- $(INSTALL) -D request-key $(DESTDIR)$(SBINDIR)/request-key
+ sed \
+ -e 's,@VERSION\@,$(VERSION),g' \
+ -e 's,@prefix\@,$(PREFIX),g' \
diff --git a/patches/keyutils-1.5.10/0002-build-use-SOURCE_DATE_EPOCH-if-available-to-make-the.patch b/patches/keyutils-1.6.3/0002-build-use-SOURCE_DATE_EPOCH-if-available-to-make-the.patch
index 31e472864..efd87614f 100644
--- a/patches/keyutils-1.5.10/0002-build-use-SOURCE_DATE_EPOCH-if-available-to-make-the.patch
+++ b/patches/keyutils-1.6.3/0002-build-use-SOURCE_DATE_EPOCH-if-available-to-make-the.patch
@@ -16,10 +16,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index 351e749760f7..c5aafd5fbdc5 100644
+index 0a2bacacfb88..163dfd8dc565 100644
--- a/Makefile
+++ b/Makefile
-@@ -104,7 +104,7 @@ all: keyctl request-key key.dns_resolver
+@@ -109,7 +109,7 @@ all: keyctl request-key key.dns_resolver cxx
###############################################################################
#RPATH = -Wl,-rpath,$(LIBDIR)
diff --git a/patches/keyutils-1.5.10/series b/patches/keyutils-1.6.3/series
index 342a4d284..342a4d284 100644
--- a/patches/keyutils-1.5.10/series
+++ b/patches/keyutils-1.6.3/series
diff --git a/patches/libaio-0.3.110/0001-make-the-package-DESTDIR-aware.patch b/patches/libaio-0.3.110/0001-make-the-package-DESTDIR-aware.patch
deleted file mode 100644
index c0fd32f2b..000000000
--- a/patches/libaio-0.3.110/0001-make-the-package-DESTDIR-aware.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 26 May 2016 10:25:21 +0200
-Subject: [PATCH] make the package DESTDIR aware
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/Makefile | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/src/Makefile b/src/Makefile
-index eadb336b47e3..8a037c865c29 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -53,11 +53,11 @@ $(libname): $(libaio_sobjs) libaio.map
- $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
-
- install: $(all_targets)
-- install -D -m 644 libaio.h $(includedir)/libaio.h
-- install -D -m 644 libaio.a $(libdir)/libaio.a
-- install -D -m 755 $(libname) $(libdir)/$(libname)
-- ln -sf $(libname) $(libdir)/$(soname)
-- ln -sf $(libname) $(libdir)/libaio.so
-+ install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
-+ install -D -m 644 libaio.a $(DESTDIR)$(libdir)/libaio.a
-+ install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname)
-+ ln -sf $(libname) $(DESTDIR)$(libdir)/$(soname)
-+ ln -sf $(libname) $(DESTDIR)$(libdir)/libaio.so
-
- $(libaio_objs): libaio.h
-
diff --git a/patches/libaio-0.3.110/series b/patches/libaio-0.3.110/series
deleted file mode 100644
index 1c5e0b993..000000000
--- a/patches/libaio-0.3.110/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-make-the-package-DESTDIR-aware.patch
-# 2c519bc2ab00d1696f060ce28efb150a - git-ptx-patches magic
diff --git a/patches/f2fs-tools-1.12.0/autogen.sh b/patches/libatasmart-0.19/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/f2fs-tools-1.12.0/autogen.sh
+++ b/patches/libatasmart-0.19/autogen.sh
diff --git a/patches/libbsd-0.8.2/0001-use-I-instead-of-isystem-for-local-path.patch b/patches/libbsd-0.11.7/0001-use-I-instead-of-isystem-for-local-path.patch
index c919ce965..6dbf20c2a 100644
--- a/patches/libbsd-0.8.2/0001-use-I-instead-of-isystem-for-local-path.patch
+++ b/patches/libbsd-0.11.7/0001-use-I-instead-of-isystem-for-local-path.patch
@@ -12,7 +12,7 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
-index 4649937bb891..265c631d7e70 100644
+index 7ef2013a5ff9..167ad58ce747 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,7 +2,7 @@
@@ -25,7 +25,7 @@ index 4649937bb891..265c631d7e70 100644
-DLIBBSD_OVERLAY -DLIBBSD_DISABLE_DEPRECATED \
-D__REENTRANT
diff --git a/test/Makefile.am b/test/Makefile.am
-index 9b79f06540ce..dcc7d1d55914 100644
+index 90fe38430bbd..eb54cf39d60d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -7,7 +7,7 @@ HEADERS_CPPFLAGS = \
diff --git a/patches/fakeroot-1.25.3/autogen.sh b/patches/libbsd-0.11.7/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/fakeroot-1.25.3/autogen.sh
+++ b/patches/libbsd-0.11.7/autogen.sh
diff --git a/patches/libbsd-0.8.2/series b/patches/libbsd-0.11.7/series
index 4e941d98e..4e941d98e 100644
--- a/patches/libbsd-0.8.2/series
+++ b/patches/libbsd-0.11.7/series
diff --git a/patches/libcaca-0.99.beta16/0002-set-the-escape-delay-with-set_escdelay.patch b/patches/libcaca-0.99.beta16/0002-set-the-escape-delay-with-set_escdelay.patch
deleted file mode 100644
index 2e252163a..000000000
--- a/patches/libcaca-0.99.beta16/0002-set-the-escape-delay-with-set_escdelay.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 22 Jun 2011 00:31:47 +0200
-Subject: [PATCH] set the escape delay with set_escdelay
-
-This fixes building with ncurses-5.9:
-driver/ncurses.c: In function 'ncurses_init_graphics':
-driver/ncurses.c:267:5: error: lvalue required as left operand of assignment
-
-Origin: upstream, http://caca.zoy.org/changeset/4643/libcaca/trunk/caca/driver/ncurses.c
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- caca/driver/ncurses.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/caca/driver/ncurses.c b/caca/driver/ncurses.c
-index 274cdd8..4fe950c 100644
---- a/caca/driver/ncurses.c
-+++ b/caca/driver/ncurses.c
-@@ -264,7 +264,7 @@ static int ncurses_init_graphics(caca_display_t *dp)
- mouseinterval(-1); /* No click emulation */
-
- /* Set the escape delay to a ridiculously low value */
-- ESCDELAY = 10;
-+ set_escdelay(10);
-
- /* Activate colour */
- start_color();
diff --git a/patches/libcaca-0.99.beta16/series b/patches/libcaca-0.99.beta16/series
deleted file mode 100644
index 212faa1a1..000000000
--- a/patches/libcaca-0.99.beta16/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-0001-caca-config-add-SYSROOT-support.patch
-0002-set-the-escape-delay-with-set_escdelay.patch
-# d6fec66d66041a42b99192404234b9e8 - git-ptx-patches magic
diff --git a/patches/libcaca-0.99.beta16/0001-caca-config-add-SYSROOT-support.patch b/patches/libcaca-0.99.beta19/0001-caca-config-add-SYSROOT-support.patch
index a66f7dc37..b95a867aa 100644
--- a/patches/libcaca-0.99.beta16/0001-caca-config-add-SYSROOT-support.patch
+++ b/patches/libcaca-0.99.beta19/0001-caca-config-add-SYSROOT-support.patch
@@ -7,14 +7,14 @@ The method used here is probably not acceptable upstream.
Forwarded: not-needed
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
- caca-config.in | 6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
+ caca-config.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/caca-config.in b/caca-config.in
-index c768b99..56274e9 100644
+index a54e6e1149ef..4632f14fd7a6 100644
--- a/caca-config.in
+++ b/caca-config.in
-@@ -102,18 +102,18 @@ fi
+@@ -101,18 +101,18 @@ fi
if test "$echo_cflags" = "yes"
then
diff --git a/patches/libcaca-0.99.beta19/series b/patches/libcaca-0.99.beta19/series
new file mode 100644
index 000000000..3cb93edd0
--- /dev/null
+++ b/patches/libcaca-0.99.beta19/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-caca-config-add-SYSROOT-support.patch
+# 55662fe144e05c1c860b85eaff82bafd - git-ptx-patches magic
diff --git a/patches/libcap-2.44/0001-Fix-build-on-non-Linux-host.patch b/patches/libcap-2.44/0001-Fix-build-on-non-Linux-host.patch
deleted file mode 100644
index 31fb5e5cd..000000000
--- a/patches/libcap-2.44/0001-Fix-build-on-non-Linux-host.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From: Bernhard Walle <bernhard@bwalle.de>
-Date: Sun, 8 Apr 2012 17:55:56 +0200
-Subject: [PATCH] Fix build on non-Linux host
-
-Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- libcap/include/sys/capability.h | 1 -
- libcap/include/uapi/linux/capability.h | 6 ++++++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/libcap/include/sys/capability.h b/libcap/include/sys/capability.h
-index ac13c128e3d2..18391f853769 100644
---- a/libcap/include/sys/capability.h
-+++ b/libcap/include/sys/capability.h
-@@ -21,7 +21,6 @@ extern "C" {
-
- #include <sys/types.h>
- #include <stdint.h>
--#include <linux/types.h>
-
- #ifndef __user
- #define __user
-diff --git a/libcap/include/uapi/linux/capability.h b/libcap/include/uapi/linux/capability.h
-index 09b556389a87..9e659e379659 100644
---- a/libcap/include/uapi/linux/capability.h
-+++ b/libcap/include/uapi/linux/capability.h
-@@ -14,7 +14,13 @@
- #ifndef _UAPI_LINUX_CAPABILITY_H
- #define _UAPI_LINUX_CAPABILITY_H
-
-+#ifdef __linux__
- #include <linux/types.h>
-+#else
-+#include <stdint.h>
-+typedef uint32_t __u32;
-+typedef uint32_t __le32;
-+#endif
-
- /* User-level do most of the mapping between kernel and user
- capabilities based on the version tag given by the kernel. The
diff --git a/patches/libcap-2.44/series b/patches/libcap-2.44/series
deleted file mode 100644
index 4f7f7421b..000000000
--- a/patches/libcap-2.44/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Fix-build-on-non-Linux-host.patch
-# 69b7a8db215659ad00eab9b8ed2ab43e - git-ptx-patches magic
diff --git a/patches/libcroco-0.6.2/0001-croco-config-add-SYSROOT-support.patch b/patches/libcroco-0.6.2/0001-croco-config-add-SYSROOT-support.patch
deleted file mode 100644
index c10e24447..000000000
--- a/patches/libcroco-0.6.2/0001-croco-config-add-SYSROOT-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 320c3c9fb9d6c1fa143bf73fc891fc255d78500b Mon Sep 17 00:00:00 2001
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Sat, 9 Jan 2010 19:20:30 +0100
-Subject: [PATCH] croco-config: add SYSROOT support
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- croco-config.in | 4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/croco-config.in b/croco-config.in
-index 78911ff..a52853a 100644
---- a/croco-config.in
-+++ b/croco-config.in
-@@ -3,8 +3,8 @@
- prefix=@prefix@
- exec_prefix=@exec_prefix@
- exec_prefix_set=no
--includedir=@includedir@
--libdir=@libdir@
-+includedir=${SYSROOT}@includedir@
-+libdir=${SYSROOT}@libdir@
-
- usage()
- {
---
-1.6.6
-
diff --git a/patches/libcroco-0.6.2/series b/patches/libcroco-0.6.2/series
deleted file mode 100644
index 7b446bc65..000000000
--- a/patches/libcroco-0.6.2/series
+++ /dev/null
@@ -1 +0,0 @@
-0001-croco-config-add-SYSROOT-support.patch
diff --git a/patches/libffi-3.3/0001-Fixed-missed-ifndef-for-__mips_soft_float-442.patch b/patches/libffi-3.3/0001-Fixed-missed-ifndef-for-__mips_soft_float-442.patch
deleted file mode 100644
index fae0a0e7d..000000000
--- a/patches/libffi-3.3/0001-Fixed-missed-ifndef-for-__mips_soft_float-442.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Carl Hurd <carl.m.hurd@gmail.com>
-Date: Fri, 29 Nov 2019 14:46:11 -0500
-Subject: [PATCH] Fixed missed #ifndef for __mips_soft_float (#442)
-
-Thank you!
----
- src/mips/o32.S | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/mips/o32.S b/src/mips/o32.S
-index 44e74cb91a21..799139b2968b 100644
---- a/src/mips/o32.S
-+++ b/src/mips/o32.S
-@@ -282,9 +282,11 @@ $LCFI12:
- li $13, 1 # FFI_O32
- bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT
-
-+#ifndef __mips_soft_float
- # Store all possible float/double registers.
- s.d $f12, FA_0_0_OFF2($fp)
- s.d $f14, FA_1_0_OFF2($fp)
-+#endif
- 1:
- # prepare arguments for ffi_closure_mips_inner_O32
- REG_L a0, 4($15) # cif
diff --git a/patches/libffi-3.3/0002-powerpc-fix-build-failure-on-power7-and-older-532.patch b/patches/libffi-3.3/0002-powerpc-fix-build-failure-on-power7-and-older-532.patch
deleted file mode 100644
index aa2487c29..000000000
--- a/patches/libffi-3.3/0002-powerpc-fix-build-failure-on-power7-and-older-532.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Thu, 28 Nov 2019 12:42:41 +0000
-Subject: [PATCH] powerpc: fix build failure on power7 and older (#532)
-
-Build failure looks as:
-```
-libtool: compile: powerpc-unknown-linux-gnu-gcc \
- -O2 -mcpu=powerpc -mtune=powerpc -pipe ... -c src/powerpc/ffi.c ...
-In file included from src/powerpc/ffi.c:33:
-src/powerpc/ffi_powerpc.h:65:9: error: '__int128' is not supported on this target
- 65 | typedef __int128 float128;
- | ^~~~~~~~
-```
-
-The fix avoids using __int128 in favour of aligned char[16].
-
-Closes: https://github.com/libffi/libffi/issues/531
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
----
- src/powerpc/ffi_powerpc.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h
-index 5ee2a7095a6a..8e2f2f0e74a3 100644
---- a/src/powerpc/ffi_powerpc.h
-+++ b/src/powerpc/ffi_powerpc.h
-@@ -62,7 +62,7 @@ typedef _Float128 float128;
- #elif defined(__FLOAT128__)
- typedef __float128 float128;
- #else
--typedef __int128 float128;
-+typedef char float128[16] __attribute__((aligned(16)));
- #endif
-
- void FFI_HIDDEN ffi_closure_SYSV (void);
diff --git a/patches/libffi-3.3/series b/patches/libffi-3.3/series
deleted file mode 100644
index d90333c03..000000000
--- a/patches/libffi-3.3/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Fixed-missed-ifndef-for-__mips_soft_float-442.patch
-0002-powerpc-fix-build-failure-on-power7-and-older-532.patch
-# 8d546ed0993c3fef550e4e9fba36368b - git-ptx-patches magic
diff --git a/patches/libffi-3.4.6/0001-libffi-Fix-location-of-libraries-for-multilib-toolch.patch b/patches/libffi-3.4.6/0001-libffi-Fix-location-of-libraries-for-multilib-toolch.patch
new file mode 100644
index 000000000..851455713
--- /dev/null
+++ b/patches/libffi-3.4.6/0001-libffi-Fix-location-of-libraries-for-multilib-toolch.patch
@@ -0,0 +1,24 @@
+From: Christian Melki <christian.melki@t2data.com>
+Date: Thu, 8 Jul 2021 15:41:52 +0200
+Subject: [PATCH] libffi: Fix location of libraries for multilib toolchains.
+
+Buildroot came to the same solution.
+
+Signed-off-by: Christian Melki <christian.melki@t2data.com>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 3de0bea4737d..55b507e021aa 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -35,7 +35,7 @@ MAKEOVERRIDES=
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = libffi.pc
+
+-toolexeclib_LTLIBRARIES = libffi.la
++lib_LTLIBRARIES = libffi.la
+ noinst_LTLIBRARIES = libffi_convenience.la
+
+ libffi_la_SOURCES = src/prep_cif.c src/types.c \
diff --git a/patches/libffi-3.4.6/0002-libffi-ensure-sysroot-paths-are-not-in-libffi.pc.patch b/patches/libffi-3.4.6/0002-libffi-ensure-sysroot-paths-are-not-in-libffi.pc.patch
new file mode 100644
index 000000000..fc77ca27b
--- /dev/null
+++ b/patches/libffi-3.4.6/0002-libffi-ensure-sysroot-paths-are-not-in-libffi.pc.patch
@@ -0,0 +1,33 @@
+From: Ross Burton <ross.burton@intel.com>
+Date: Thu, 4 Feb 2016 16:22:50 +0000
+Subject: [PATCH] libffi: ensure sysroot paths are not in libffi.pc
+
+libffi's configure assumes that cross-compiled builds are complicated and
+introduces convoluted path manipulation involving gcc search paths to the
+install paths, resulting in paths like -L/usr/lib/../lib/ appearing in
+libffi.pc. When pkg-config is then used to obtain the linker flags for libffi
+it can't tell that this path is on the default search path and returns
+$SYSROOT/usr/lib/../lib which then gets written all over the target sysroot.
+This then means the sstate can't be shared and triggers QA errors.
+
+As this block is generally pointless, disable it.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 741a6690a729..2aa767cb192e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -401,7 +401,7 @@ AC_ARG_ENABLE(multi-os-directory,
+
+ # These variables are only ever used when we cross-build to X86_WIN32.
+ # And we only support this with GCC, so...
+-if test "x$GCC" = "xyes"; then
++if false; then
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ toolexecdir='${exec_prefix}'/'$(target_alias)'
diff --git a/patches/glu-9.0.1/autogen.sh b/patches/libffi-3.4.6/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/glu-9.0.1/autogen.sh
+++ b/patches/libffi-3.4.6/autogen.sh
diff --git a/patches/libffi-3.4.6/series b/patches/libffi-3.4.6/series
new file mode 100644
index 000000000..e7edd1e47
--- /dev/null
+++ b/patches/libffi-3.4.6/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-libffi-Fix-location-of-libraries-for-multilib-toolch.patch
+0002-libffi-ensure-sysroot-paths-are-not-in-libffi.pc.patch
+# 1a2be5d11f83cc2dc4277928237f651e - git-ptx-patches magic
diff --git a/patches/libgpg-error-1.36/0001-awk-Prepare-for-Gawk-5.0.patch b/patches/libgpg-error-1.36/0001-awk-Prepare-for-Gawk-5.0.patch
deleted file mode 100644
index 47a84c19b..000000000
--- a/patches/libgpg-error-1.36/0001-awk-Prepare-for-Gawk-5.0.patch
+++ /dev/null
@@ -1,154 +0,0 @@
-From: NIIBE Yutaka <gniibe@fsij.org>
-Date: Mon, 15 Apr 2019 15:10:44 +0900
-Subject: [PATCH] awk: Prepare for Gawk 5.0.
-
-* src/Makefile.am: Use pkg_namespace (instead of namespace).
-* src/mkerrnos.awk: Likewise.
-* lang/cl/mkerrcodes.awk: Don't escape # in regexp.
-* src/mkerrcodes.awk, src/mkerrcodes1.awk, src/mkerrcodes2.awk: Ditto.
-
---
-
-In Gawk 5.0, regexp routines are replaced by Gnulib implementation,
-which only allows escaping specific characters.
-
-GnuPG-bug-id: 4459
-Reported-by: Marius Schamschula
-Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
----
- lang/cl/mkerrcodes.awk | 2 +-
- src/Makefile.am | 2 +-
- src/mkerrcodes.awk | 2 +-
- src/mkerrcodes1.awk | 2 +-
- src/mkerrcodes2.awk | 2 +-
- src/mkerrnos.awk | 2 +-
- src/mkstrtable.awk | 10 +++++-----
- 7 files changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/lang/cl/mkerrcodes.awk b/lang/cl/mkerrcodes.awk
-index ae290435fccf..9a1fc18c55cb 100644
---- a/lang/cl/mkerrcodes.awk
-+++ b/lang/cl/mkerrcodes.awk
-@@ -122,7 +122,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-diff --git a/src/Makefile.am b/src/Makefile.am
-index ce1b882c23bf..f2590cb715d8 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -293,7 +293,7 @@ code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile
-
- errnos-sym.h: Makefile mkstrtable.awk errnos.in
- $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
-- -v prefix=GPG_ERR_ -v namespace=errnos_ \
-+ -v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \
- $(srcdir)/errnos.in >$@
-
-
-diff --git a/src/mkerrcodes.awk b/src/mkerrcodes.awk
-index 46d436c6b0c7..e9c857c62f9e 100644
---- a/src/mkerrcodes.awk
-+++ b/src/mkerrcodes.awk
-@@ -85,7 +85,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-diff --git a/src/mkerrcodes1.awk b/src/mkerrcodes1.awk
-index a771a73602f6..4578e290ca6b 100644
---- a/src/mkerrcodes1.awk
-+++ b/src/mkerrcodes1.awk
-@@ -81,7 +81,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-diff --git a/src/mkerrcodes2.awk b/src/mkerrcodes2.awk
-index ea5850341c33..188f7a48e358 100644
---- a/src/mkerrcodes2.awk
-+++ b/src/mkerrcodes2.awk
-@@ -91,7 +91,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-diff --git a/src/mkerrnos.awk b/src/mkerrnos.awk
-index f79df6613a09..15b1aad225ee 100644
---- a/src/mkerrnos.awk
-+++ b/src/mkerrnos.awk
-@@ -83,7 +83,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-diff --git a/src/mkstrtable.awk b/src/mkstrtable.awk
-index c9de9c1e4111..285e45f24ce1 100644
---- a/src/mkstrtable.awk
-+++ b/src/mkstrtable.awk
-@@ -77,7 +77,7 @@
- #
- # The variable prefix can be used to prepend a string to each message.
- #
--# The variable namespace can be used to prepend a string to each
-+# The variable pkg_namespace can be used to prepend a string to each
- # variable and macro name.
-
- BEGIN {
-@@ -102,7 +102,7 @@ header {
- print "/* The purpose of this complex string table is to produce";
- print " optimal code with a minimum of relocations. */";
- print "";
-- print "static const char " namespace "msgstr[] = ";
-+ print "static const char " pkg_namespace "msgstr[] = ";
- header = 0;
- }
- else
-@@ -110,7 +110,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-@@ -150,7 +150,7 @@ END {
- else
- print " gettext_noop (\"" last_msgstr "\");";
- print "";
-- print "static const int " namespace "msgidx[] =";
-+ print "static const int " pkg_namespace "msgidx[] =";
- print " {";
- for (i = 0; i < coded_msgs; i++)
- print " " pos[i] ",";
-@@ -158,7 +158,7 @@ END {
- print " };";
- print "";
- print "static GPG_ERR_INLINE int";
-- print namespace "msgidxof (int code)";
-+ print pkg_namespace "msgidxof (int code)";
- print "{";
- print " return (0 ? 0";
-
diff --git a/patches/libgpg-error-1.36/series b/patches/libgpg-error-1.36/series
deleted file mode 100644
index 39b476b41..000000000
--- a/patches/libgpg-error-1.36/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-awk-Prepare-for-Gawk-5.0.patch
-# d78e2e603a5ad706ac53915963ac24e4 - git-ptx-patches magic
diff --git a/patches/libgpg-error-1.47/0001-gpgrt-config-improve-pkg-config-file-parsing.patch b/patches/libgpg-error-1.47/0001-gpgrt-config-improve-pkg-config-file-parsing.patch
new file mode 100644
index 000000000..64a07ab6e
--- /dev/null
+++ b/patches/libgpg-error-1.47/0001-gpgrt-config-improve-pkg-config-file-parsing.patch
@@ -0,0 +1,33 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sun, 7 Aug 2022 11:28:19 +0200
+Subject: [PATCH] gpgrt-config: improve pkg-config file parsing
+
+.pc files may contain '${pcfiledir}'. Set it to ensure that paths that use
+it are expanded correctly.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ src/gpgrt-config.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpgrt-config.in b/src/gpgrt-config.in
+index 3aaa24329ecf..3bbc9e0e6184 100644
+--- a/src/gpgrt-config.in
++++ b/src/gpgrt-config.in
+@@ -166,6 +166,7 @@ read_config_file () {
+ fi
+ exit 1
+ fi
++ VAR_pcfiledir="$(dirname $RESULT)"
+ read_config_from_stdin $RESULT < $RESULT
+ }
+
+@@ -522,7 +523,7 @@ output=""
+
+ mt="no"
+
+-VAR_list=VAR_pc_sysrootdir
++VAR_list="VAR_pc_sysrootdir VAR_pcfiledir"
+ if [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
+ VAR_pc_sysrootdir="/"
+ else
diff --git a/patches/libgpg-error-1.47/series b/patches/libgpg-error-1.47/series
new file mode 100644
index 000000000..92e846ff5
--- /dev/null
+++ b/patches/libgpg-error-1.47/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-gpgrt-config-improve-pkg-config-file-parsing.patch
+# beec67d9655cda67970f34b4593c254e - git-ptx-patches magic
diff --git a/patches/libgudev-230/0001-Prepare-to-check-for-an-older-UDEV.patch b/patches/libgudev-230/0001-Prepare-to-check-for-an-older-UDEV.patch
deleted file mode 100644
index 02834a648..000000000
--- a/patches/libgudev-230/0001-Prepare-to-check-for-an-older-UDEV.patch
+++ /dev/null
@@ -1,131 +0,0 @@
-From: Juergen Borleis <entwicklung@pengutronix.de>
-Date: Thu, 10 Dec 2015 16:28:37 +0100
-Subject: [PATCH] Prepare to check for an older UDEV
-
-In order to use libgudev with systemd's based udev and the standalone udev
-we must libgudev check for an older udev release. Since v182 is the last
-standalone udev, check for this specific release. The libudev API seems stable
-enough in both releases.
-
-Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
----
- configure.ac | 2 +-
- m4/introspection.m4 | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 97 insertions(+), 1 deletion(-)
- create mode 100644 m4/introspection.m4
-
-diff --git a/configure.ac b/configure.ac
-index 2b5e96ef30a1..58a35631187f 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -38,7 +38,7 @@ GOBJECT_INTROSPECTION_CHECK([1.31.1])
- AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
- enable_introspection=no])
-
--PKG_CHECK_MODULES([LIBUDEV], [libudev >= 199])
-+PKG_CHECK_MODULES([LIBUDEV], [libudev >= 182])
- PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0])
-
- AC_CONFIG_FILES([
-diff --git a/m4/introspection.m4 b/m4/introspection.m4
-new file mode 100644
-index 000000000000..aa7b3b408852
---- /dev/null
-+++ b/m4/introspection.m4
-@@ -0,0 +1,96 @@
-+dnl -*- mode: autoconf -*-
-+dnl Copyright 2009 Johan Dahlin
-+dnl
-+dnl This file is free software; the author(s) gives unlimited
-+dnl permission to copy and/or distribute it, with or without
-+dnl modifications, as long as this notice is preserved.
-+dnl
-+
-+# serial 1
-+
-+m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
-+[
-+ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
-+ AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
-+ AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
-+
-+ dnl enable/disable introspection
-+ m4_if([$2], [require],
-+ [dnl
-+ enable_introspection=yes
-+ ],[dnl
-+ AC_ARG_ENABLE(introspection,
-+ AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
-+ [Enable introspection for this build]),,
-+ [enable_introspection=auto])
-+ ])dnl
-+
-+ AC_MSG_CHECKING([for gobject-introspection])
-+
-+ dnl presence/version checking
-+ AS_CASE([$enable_introspection],
-+ [no], [dnl
-+ found_introspection="no (disabled, use --enable-introspection to enable)"
-+ ],dnl
-+ [yes],[dnl
-+ PKG_CHECK_EXISTS([gobject-introspection-1.0],,
-+ AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
-+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
-+ found_introspection=yes,
-+ AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
-+ ],dnl
-+ [auto],[dnl
-+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
-+ dnl Canonicalize enable_introspection
-+ enable_introspection=$found_introspection
-+ ],dnl
-+ [dnl
-+ AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
-+ ])dnl
-+
-+ AC_MSG_RESULT([$found_introspection])
-+
-+ INTROSPECTION_SCANNER=
-+ INTROSPECTION_COMPILER=
-+ INTROSPECTION_GENERATE=
-+ INTROSPECTION_GIRDIR=
-+ INTROSPECTION_TYPELIBDIR=
-+ if test "x$found_introspection" = "xyes"; then
-+ INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
-+ INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
-+ INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
-+ INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
-+ INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
-+ INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
-+ INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
-+ INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
-+ fi
-+ AC_SUBST(INTROSPECTION_SCANNER)
-+ AC_SUBST(INTROSPECTION_COMPILER)
-+ AC_SUBST(INTROSPECTION_GENERATE)
-+ AC_SUBST(INTROSPECTION_GIRDIR)
-+ AC_SUBST(INTROSPECTION_TYPELIBDIR)
-+ AC_SUBST(INTROSPECTION_CFLAGS)
-+ AC_SUBST(INTROSPECTION_LIBS)
-+ AC_SUBST(INTROSPECTION_MAKEFILE)
-+
-+ AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
-+])
-+
-+
-+dnl Usage:
-+dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
-+
-+AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
-+[
-+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
-+])
-+
-+dnl Usage:
-+dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
-+
-+
-+AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
-+[
-+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
-+])
diff --git a/patches/libgudev-230/series b/patches/libgudev-230/series
deleted file mode 100644
index ad87bca53..000000000
--- a/patches/libgudev-230/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Prepare-to-check-for-an-older-UDEV.patch
-# e9296de8eff5967b176ee4e6b0558fdc - git-ptx-patches magic
diff --git a/patches/gtk+-2.24.32/autogen.sh b/patches/libkcapi-1.5.0/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/gtk+-2.24.32/autogen.sh
+++ b/patches/libkcapi-1.5.0/autogen.sh
diff --git a/patches/liboil-0.3.16/0001-liboil-don-t-check-for-assembler-options-and-add-com.patch b/patches/liboil-0.3.16/0001-liboil-don-t-check-for-assembler-options-and-add-com.patch
deleted file mode 100644
index 275c83ea2..000000000
--- a/patches/liboil-0.3.16/0001-liboil-don-t-check-for-assembler-options-and-add-com.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Mon, 4 Aug 2014 17:45:42 +0200
-Subject: [PATCH] liboil: don't check for assembler options and add compiler
- options
-
-Checking for "-Wa,-mfpu=vfp" and then adding "-mfpu=vfp" os of course nonsense.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure.ac | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index a657101..38bd436 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -188,10 +188,10 @@ if test x$HAVE_GCC_ASM = xyes -a x$HAVE_POWERPC = xyes ; then
- fi
-
- if test x$HAVE_GCC_ASM = xyes -a x$HAVE_ARM = xyes ; then
-- AS_COMPILER_FLAG(["-Wa,-mfpu=vfp"],
-+ AS_COMPILER_FLAG(["-mfpu=vfp"],
- [VFP_CFLAGS="$VFP_CFLAGS -mfpu=vfp"],
- true)
-- #AS_COMPILER_FLAG(["-Wa,-mfloat-abi=softfp"],
-+ #AS_COMPILER_FLAG(["-mfloat-abi=softfp"],
- # [VFP_CFLAGS="$VFP_CFLAGS -mfloat-abi=softfp"],
- # true)
- fi
diff --git a/patches/liboil-0.3.16/0002-fix-unaligned-access-whitelist-check.patch b/patches/liboil-0.3.16/0002-fix-unaligned-access-whitelist-check.patch
deleted file mode 100644
index 86f6d76df..000000000
--- a/patches/liboil-0.3.16/0002-fix-unaligned-access-whitelist-check.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Mon, 4 Aug 2014 17:47:38 +0200
-Subject: [PATCH] fix unaligned access whitelist check
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- m4/as-unaligned-access.m4 | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/m4/as-unaligned-access.m4 b/m4/as-unaligned-access.m4
-index ede8bd2..3496505 100644
---- a/m4/as-unaligned-access.m4
-+++ b/m4/as-unaligned-access.m4
-@@ -4,7 +4,7 @@ dnl check if unaligned memory access works correctly
- AC_DEFUN([AS_UNALIGNED_ACCESS], [
- AC_MSG_CHECKING([if unaligned memory access works correctly])
- if test x"$as_cv_unaligned_access" = x ; then
-- case $host in
-+ case "$host_cpu" in
- alpha*|arm*|hp*|mips*|sh*|sparc*|ia64*)
- _AS_ECHO_N([(blacklisted) ])
- as_cv_unaligned_access=no
diff --git a/patches/liboil-0.3.16/autogen.sh b/patches/liboil-0.3.16/autogen.sh
deleted file mode 100755
index 9a2ff4e99..000000000
--- a/patches/liboil-0.3.16/autogen.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-set -e
-
-aclocal $ACLOCAL_FLAGS
-
-am_macro_dir=m4 \
-libtoolize \
- --force \
- --copy
-
-autoreconf \
- --force \
- --install \
- --warnings=cross \
- --warnings=syntax \
- --warnings=obsolete \
- --warnings=unsupported
-
diff --git a/patches/liboil-0.3.16/series b/patches/liboil-0.3.16/series
deleted file mode 100644
index d5a53b3f8..000000000
--- a/patches/liboil-0.3.16/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-liboil-don-t-check-for-assembler-options-and-add-com.patch
-0002-fix-unaligned-access-whitelist-check.patch
-# a45ce1b5bbcfaf2b379d89609c26c1d1 - git-ptx-patches magic
diff --git a/patches/libpcap-1.8.1/0100-build-and-install-share-lib-only.patch b/patches/libpcap-1.10.4/0100-build-and-install-share-lib-only.patch
index 85ce7015d..cae5cc2b2 100644
--- a/patches/libpcap-1.8.1/0100-build-and-install-share-lib-only.patch
+++ b/patches/libpcap-1.10.4/0100-build-and-install-share-lib-only.patch
@@ -12,24 +12,24 @@ Signed-off-by: Alexander Aring <alex.aring@gmail.com>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile.in b/Makefile.in
-index e71d973ca448..e0debadeb837 100644
+index 54246586828d..4c6768d6d764 100644
--- a/Makefile.in
+++ b/Makefile.in
-@@ -358,7 +358,7 @@ EXTRA_DIST = \
- Win32/Prj/wpcap.vcxproj \
- Win32/Prj/wpcap.vcxproj.filters
+@@ -429,7 +429,7 @@ RELEASE_FILES = $(COMMON_C_SRC) $(HDR) $(MAN1) $(MAN3PCAP_EXPAND) \
+ $(MAN3PCAP_NOEXPAND) $(MANFILE) $(MANMISC) $(EXTRA_DIST) \
+ $(TEST_DIST)
--all: libpcap.a shared pcap-config
-+all: shared pcap-config
+-all: libpcap.a shared $(BUILD_RPCAPD) libpcap.pc pcap-config
++all: shared $(BUILD_RPCAPD) libpcap.pc pcap-config
libpcap.a: $(OBJ)
@rm -f $@
-@@ -550,7 +550,7 @@ selpolltest: tests/selpolltest.c libpcap.a
- valgrindtest: tests/valgrindtest.c libpcap.a
- $(CC) $(FULL_CFLAGS) -I. -L. -o valgrindtest $(srcdir)/tests/valgrindtest.c libpcap.a $(LIBS)
+@@ -615,7 +615,7 @@ testprogs: FORCE
--install: install-shared install-archive pcap-config
-+install: install-shared pcap-config
+ FORCE:
+
+-install: install-shared install-archive libpcap.pc pcap-config @INSTALL_RPCAPD@
++install: install-shared libpcap.pc pcap-config @INSTALL_RPCAPD@
[ -d $(DESTDIR)$(libdir) ] || \
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
[ -d $(DESTDIR)$(includedir) ] || \
diff --git a/patches/libpcap-1.8.1/0101-pcap-config-add-SYSROOT-support.patch b/patches/libpcap-1.10.4/0101-pcap-config-add-SYSROOT-support.patch
index 51cf6c554..da6d1d62a 100644
--- a/patches/libpcap-1.8.1/0101-pcap-config-add-SYSROOT-support.patch
+++ b/patches/libpcap-1.10.4/0101-pcap-config-add-SYSROOT-support.patch
@@ -4,14 +4,14 @@ Subject: [PATCH] pcap-config: add SYSROOT support
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
- pcap-config.in | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ pcap-config.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pcap-config.in b/pcap-config.in
-index 206be3b4a644..50b05f53d32e 100644
+index 6039ef33b324..505f7515f2f7 100644
--- a/pcap-config.in
+++ b/pcap-config.in
-@@ -6,8 +6,8 @@
+@@ -10,8 +10,8 @@
#
prefix="@prefix@"
exec_prefix="@exec_prefix@"
@@ -19,15 +19,6 @@ index 206be3b4a644..50b05f53d32e 100644
-libdir="@libdir@"
+includedir="${SYSROOT}@includedir@"
+libdir="${SYSROOT}@libdir@"
- V_RPATH_OPT="@V_RPATH_OPT@"
LIBS="@LIBS@"
-
-@@ -41,7 +41,7 @@ then
- #
- # If libdir isn't /usr/lib, add it to the run-time linker path.
- #
-- if [ "$libdir" != "/usr/lib" ]
-+ if [ "$libdir" != "${SYSROOT}/usr/lib" ]
- then
- RPATH=$V_RPATH_OPT$libdir
- fi
+ LIBS_STATIC="@LIBS_STATIC@"
+ VERSION="@PACKAGE_VERSION@"
diff --git a/patches/libpcap-1.8.1/series b/patches/libpcap-1.10.4/series
index 7e01f0602..897b78f91 100644
--- a/patches/libpcap-1.8.1/series
+++ b/patches/libpcap-1.10.4/series
@@ -1,9 +1,7 @@
# generated by git-ptx-patches
#tag:base --start-number 1
#tag:upstream --start-number 1
-0001-Fix-compilation-if-INET6-isn-t-defined.patch
#tag:ptx --start-number 100
0100-build-and-install-share-lib-only.patch
0101-pcap-config-add-SYSROOT-support.patch
-0102-configure.ac-allow-specifying-path-for-libnl3.patch
-# 363b6cba4073355bfab4a58107b4a1da - git-ptx-patches magic
+# a0b9f6d3f3bc0054c50d9df9a57fc140 - git-ptx-patches magic
diff --git a/patches/libpcap-1.8.1/0001-Fix-compilation-if-INET6-isn-t-defined.patch b/patches/libpcap-1.8.1/0001-Fix-compilation-if-INET6-isn-t-defined.patch
deleted file mode 100644
index 7607752e1..000000000
--- a/patches/libpcap-1.8.1/0001-Fix-compilation-if-INET6-isn-t-defined.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From: Guy Harris <guy@alum.mit.edu>
-Date: Tue, 17 Jan 2017 02:58:52 -0800
-Subject: [PATCH] Fix compilation if INET6 isn't defined.
-
-Addresses GitHub issue #541, but differently from the pull request (it
-defines gen_gateway() with a function prototype rather than using a
-pre-prototype-style definition).
----
- gencode.c | 14 +++++++-------
- 1 file changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/gencode.c b/gencode.c
-index a887f2730f7a..60494e3de974 100644
---- a/gencode.c
-+++ b/gencode.c
-@@ -523,7 +523,8 @@ static struct block *gen_host6(compiler_state_t *, struct in6_addr *,
- struct in6_addr *, int, int, int);
- #endif
- #ifndef INET6
--static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int);
-+static struct block *gen_gateway(compiler_state_t *, const u_char *,
-+ bpf_u_int32 **, int, int);
- #endif
- static struct block *gen_ipfrag(compiler_state_t *);
- static struct block *gen_portatom(compiler_state_t *, int, bpf_int32);
-@@ -690,7 +691,9 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
- }
- initchunks(&cstate);
- cstate.no_optimize = 0;
-+#ifdef INET6
- cstate.ai = NULL;
-+#endif
- cstate.ic.root = NULL;
- cstate.ic.cur_mark = 0;
- cstate.bpf_pcap = p;
-@@ -4902,11 +4905,8 @@ gen_host6(compiler_state_t *cstate, struct in6_addr *addr,
-
- #ifndef INET6
- static struct block *
--gen_gateway(eaddr, alist, proto, dir)
-- const u_char *eaddr;
-- bpf_u_int32 **alist;
-- int proto;
-- int dir;
-+gen_gateway(compiler_state_t *cstate, const u_char *eaddr, bpf_u_int32 **alist,
-+ int proto, int dir)
- {
- struct block *b0, *b1, *tmp;
-
-@@ -6470,7 +6470,7 @@ gen_scode(compiler_state_t *cstate, const char *name, struct qual q)
- alist = pcap_nametoaddr(name);
- if (alist == NULL || *alist == NULL)
- bpf_error(cstate, "unknown host '%s'", name);
-- b = gen_gateway(eaddr, alist, proto, dir);
-+ b = gen_gateway(cstate, eaddr, alist, proto, dir);
- free(eaddr);
- return b;
- #else
diff --git a/patches/libpcap-1.8.1/0102-configure.ac-allow-specifying-path-for-libnl3.patch b/patches/libpcap-1.8.1/0102-configure.ac-allow-specifying-path-for-libnl3.patch
deleted file mode 100644
index 3e56d90c9..000000000
--- a/patches/libpcap-1.8.1/0102-configure.ac-allow-specifying-path-for-libnl3.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 29 Jan 2014 09:17:52 +0100
-Subject: [PATCH] configure.ac: allow specifying path for libnl3
-
----
- configure.ac | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index da2f940da963..8a3ab56d865c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -511,7 +511,11 @@ linux)
- AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x])
- AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
- AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
-- V_INCLS="$V_INCLS ${incdir}"
-+ if test x$with_libnl != xyes ; then
-+ V_INCLS="$V_INCLS -I${with_libnl}/include/libnl3"
-+ else
-+ V_INCLS="$V_INCLS ${incdir}"
-+ fi
- have_any_nl="yes"
- ],[], ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 )
-
diff --git a/patches/libseccomp-2.5.1/0001-run-time-use-a-broadly-supported-shell-interpreter.patch b/patches/libseccomp-2.5.5/0001-run-time-use-a-broadly-supported-shell-interpreter.patch
index 9e4b6d350..9e4b6d350 100644
--- a/patches/libseccomp-2.5.1/0001-run-time-use-a-broadly-supported-shell-interpreter.patch
+++ b/patches/libseccomp-2.5.5/0001-run-time-use-a-broadly-supported-shell-interpreter.patch
diff --git a/patches/libseccomp-2.5.1/series b/patches/libseccomp-2.5.5/series
index d492518bb..d492518bb 100644
--- a/patches/libseccomp-2.5.1/series
+++ b/patches/libseccomp-2.5.5/series
diff --git a/patches/libsndfile-1.0.25/0001-configure.ac-use-default-largefile-macro.patch b/patches/libsndfile-1.0.25/0001-configure.ac-use-default-largefile-macro.patch
deleted file mode 100644
index 7dbc92bc3..000000000
--- a/patches/libsndfile-1.0.25/0001-configure.ac-use-default-largefile-macro.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 12 Jan 2014 18:36:22 +0100
-Subject: [PATCH] configure.ac: use default largefile macro
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index 20ba55a..72dccac 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -200,7 +200,7 @@ case "$host_os" in
- pre_largefile_sizeof_off_t=$ac_cv_sizeof_off_t
- unset ac_cv_sizeof_off_t
-
-- AC_SYS_EXTRA_LARGEFILE
-+ AC_SYS_LARGEFILE
-
- if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then
- ac_cv_sys_largefile_CFLAGS=""
diff --git a/patches/libsndfile-1.0.25/autogen.sh b/patches/libsndfile-1.0.25/autogen.sh
deleted file mode 100755
index cf66cf33c..000000000
--- a/patches/libsndfile-1.0.25/autogen.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-set -e
-
-aclocal $ACLOCAL_FLAGS
-
-libtoolize \
- --force \
- --copy
-
-autoreconf \
- --include=M4 \
- --force \
- --install \
- --warnings=cross \
- --warnings=syntax \
- --warnings=obsolete \
- --warnings=unsupported
-
diff --git a/patches/libsndfile-1.0.25/series b/patches/libsndfile-1.0.25/series
deleted file mode 100644
index 2c7bf05de..000000000
--- a/patches/libsndfile-1.0.25/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-configure.ac-use-default-largefile-macro.patch
-# b26d82dddc9376bd2a2696502b2b4dd2 - git-ptx-patches magic
diff --git a/patches/libsoup-2.66.2/0001-meson-allow-enabling-gir-when-cross-compiling.patch b/patches/libsoup-2.66.2/0001-meson-allow-enabling-gir-when-cross-compiling.patch
deleted file mode 100644
index 5acb5bab9..000000000
--- a/patches/libsoup-2.66.2/0001-meson-allow-enabling-gir-when-cross-compiling.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 8 Aug 2019 14:56:33 +0200
-Subject: [PATCH] meson: allow enabling gir when cross-compiling
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- meson.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index 89837c1553c6..759821019b29 100644
---- a/meson.build
-+++ b/meson.build
-@@ -290,7 +290,7 @@ enable_gnome = get_option('gnome') and host_machine.system() != 'windows'
- # FIXME: once we start to require meson 0.49.0+ and gnome-introspection 1.58.1+
- # the we can enable the introspection even for the static build. See
- # https://github.com/mesonbuild/meson/pull/4478.
--enable_introspection = get_option('introspection') and find_program('g-ir-scanner', required: false).found() and not meson.is_cross_build() and not is_static_library
-+enable_introspection = get_option('introspection') and find_program('g-ir-scanner', required: false).found() and not is_static_library
-
- ############
- # Vala API #
diff --git a/patches/libsoup-2.66.2/series b/patches/libsoup-2.66.2/series
deleted file mode 100644
index 305ed6fe0..000000000
--- a/patches/libsoup-2.66.2/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-meson-allow-enabling-gir-when-cross-compiling.patch
-# b5e8cd63bf616136df653d409ae9e0f9 - git-ptx-patches magic
diff --git a/patches/libtahu-1.0.1/0001-c-core-Makefile-Fixes-for-parallel-make-and-make-lib.patch b/patches/libtahu-1.0.1/0001-c-core-Makefile-Fixes-for-parallel-make-and-make-lib.patch
new file mode 100644
index 000000000..602fee06d
--- /dev/null
+++ b/patches/libtahu-1.0.1/0001-c-core-Makefile-Fixes-for-parallel-make-and-make-lib.patch
@@ -0,0 +1,34 @@
+From 6f70eff53d370b96070d1362ebcd4ce153b2a172 Mon Sep 17 00:00:00 2001
+From: Ian Abbott <abbotti@mev.co.uk>
+Date: Fri, 17 Feb 2023 10:41:20 +0000
+Subject: [PATCH] c/core/Makefile: Fixes for parallel make and make
+ lib/libtahu.so
+
+Change $(TEST) target to depend on the built library files.
+
+Change $(DNAME) target rules to create the lib directory.
+
+Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
+---
+ c/core/Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/c/core/Makefile b/c/core/Makefile
+index 8243a67..17c5e3d 100644
+--- a/c/core/Makefile
++++ b/c/core/Makefile
+@@ -36,9 +36,10 @@ $(SNAME): $(OBJ)
+
+ $(DNAME): LDFLAGS += -shared
+ $(DNAME): $(OBJ)
++ mkdir -p lib
+ $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+
+-$(TEST):
++$(TEST): $(SNAME) $(DNAME)
+ $(CC) $(CFLAGS) -o test/test_static $(TEST_OBJ) $(SNAME) -lmosquitto
+ $(CC) $(CFLAGS) $(LD_TEST) -o test/test_dynamic $(TEST_OBJ) -l$(NAME) -lmosquitto
+
+--
+2.39.1
+
diff --git a/patches/libtahu-1.0.1/0002-tahu.h-Do-not-define-SPARKPLUG_DEBUG.patch b/patches/libtahu-1.0.1/0002-tahu.h-Do-not-define-SPARKPLUG_DEBUG.patch
new file mode 100644
index 000000000..417cec098
--- /dev/null
+++ b/patches/libtahu-1.0.1/0002-tahu.h-Do-not-define-SPARKPLUG_DEBUG.patch
@@ -0,0 +1,28 @@
+From cff7b099c23937bad205833ea1e4e8278690eb21 Mon Sep 17 00:00:00 2001
+From: Ian Abbott <abbotti@mev.co.uk>
+Date: Fri, 17 Feb 2023 14:40:58 +0000
+Subject: [PATCH] tahu.h: Do not define SPARKPLUG_DEBUG
+
+If SPARKPLUG_DEBUG is defined in tahu.c, the library will write lots of
+debug messages to standard output. That's OK for experimentation, but
+not for a live system, so comment out the macro definition.
+---
+ c/core/include/tahu.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/c/core/include/tahu.h b/c/core/include/tahu.h
+index e599146..03fbaaa 100644
+--- a/c/core/include/tahu.h
++++ b/c/core/include/tahu.h
+@@ -29,7 +29,7 @@ extern "C" {
+ #endif
+
+ // Enable/disable debug messages
+-#define SPARKPLUG_DEBUG 1
++//#define SPARKPLUG_DEBUG 1
+
+ #ifdef SPARKPLUG_DEBUG
+ #define DEBUG_PRINT(...) printf(__VA_ARGS__)
+--
+2.39.1
+
diff --git a/patches/libtahu-1.0.1/series b/patches/libtahu-1.0.1/series
new file mode 100644
index 000000000..31edd1b86
--- /dev/null
+++ b/patches/libtahu-1.0.1/series
@@ -0,0 +1,2 @@
+0001-c-core-Makefile-Fixes-for-parallel-make-and-make-lib.patch
+0002-tahu.h-Do-not-define-SPARKPLUG_DEBUG.patch
diff --git a/patches/libtool-2.4.6/0001-libool.m4-add-ARFLAGS-variable.patch b/patches/libtool-2.4.6/0001-libool.m4-add-ARFLAGS-variable.patch
deleted file mode 100644
index 52e21f513..000000000
--- a/patches/libtool-2.4.6/0001-libool.m4-add-ARFLAGS-variable.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From: Pavel Raiskup <praiskup@redhat.com>
-Date: Fri, 17 Apr 2015 15:05:42 +0200
-Subject: [PATCH] libool.m4: add ARFLAGS variable
-
-Libtool has used $AR_FLAGS since 2000-05-29 commit
-8300de4c54e6f04f0d, Automake ARFLAGS since 2003-04-06 commit
-a71b3490639831ca. Even though ARFLAGS is younger, it sounds like
-better name according GNU Coding Standards.
-
-Related to bug#20082.
-
-* m4/libtool.m4 (_LT_PROG_AR): Copy ARFLAGS value into AR_FLAGS
-variable if AR_FLAGS is not set. Add new _LT_DECL'ed variable
-'lt_ar_flags' to keep the configure-time value of AR_FLAGS. The
-new 'lt_ar_flags' is to be used as the default value for AR_FLAGS
-at libtool-runtime.
-* NEWS: Document.
----
- NEWS | 6 ++++++
- m4/libtool.m4 | 17 +++++++++++++++--
- 2 files changed, 21 insertions(+), 2 deletions(-)
-
-diff --git a/NEWS b/NEWS
-index d7ca4341c393..590ce15ed5cd 100644
---- a/NEWS
-+++ b/NEWS
-@@ -140,6 +140,12 @@ NEWS - list of user-visible changes between releases of GNU Libtool
-
- make check-local TESTSUITEFLAGS='-k "!expensive"'
-
-+** New features:
-+
-+ - Libtool script now supports (configure-time and runtime) ARFLAGS
-+ variable, which obsoletes AR_FLAGS. This is due to naming conventions
-+ among other *FLAGS and to be consistent with Automake's ARFLAGS.
-+
- ** Bug fixes:
-
- - Fix a long-standing latent bug in autom4te include path for autotests
-diff --git a/m4/libtool.m4 b/m4/libtool.m4
-index a3bc337b79ad..2d6bda98fc92 100644
---- a/m4/libtool.m4
-+++ b/m4/libtool.m4
-@@ -1493,9 +1493,22 @@ need_locks=$enable_libtool_lock
- m4_defun([_LT_PROG_AR],
- [AC_CHECK_TOOLS(AR, [ar], false)
- : ${AR=ar}
--: ${AR_FLAGS=cru}
- _LT_DECL([], [AR], [1], [The archiver])
--_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-+
-+# Use ARFLAGS variable as AR's operation code to sync the variable naming with
-+# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
-+# higher priority because thats what people were doing historically (setting
-+# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
-+# variable obsoleted/removed.
-+
-+test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cru}
-+lt_ar_flags=$AR_FLAGS
-+_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
-+
-+# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
-+# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
-+_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
-+ [Flags to create an archive])
-
- AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
- [lt_cv_ar_at_file=no
diff --git a/patches/libtool-2.4.6/0002-ARFLAGS-use-cr-instead-of-cru-by-default.patch b/patches/libtool-2.4.6/0002-ARFLAGS-use-cr-instead-of-cru-by-default.patch
deleted file mode 100644
index a137845e8..000000000
--- a/patches/libtool-2.4.6/0002-ARFLAGS-use-cr-instead-of-cru-by-default.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-From: Pavel Raiskup <praiskup@redhat.com>
-Date: Fri, 17 Apr 2015 16:54:58 +0200
-Subject: [PATCH] ARFLAGS: use 'cr' instead of 'cru' by default
-
-In some GNU/Linux distributions people started to compile 'ar'
-binary with --enable-deterministic-archives (binutils project).
-That, however, in combination with our previous long time working
-default AR_FLAGS=cru causes warnings on such installations:
-ar: `u' modifier ignored since `D' is the default (see `U')
-
-The 'u' option (at least with GNU binutils) did small optimization
-during repeated builds because it instructed 'ar' to not
-open/close unchanged *.o files and to rather read their contents
-from old archive file. However, its removal should not cause a
-big performance hit for usual workflows.
-
-Distributions started using --enable-deterministic-archives
-knowing that it would disable the 'u', just to rather have a bit
-more deterministic builds.
-
-Also, to justify this change a bit more, keeping 'u' in ARFLAGS
-could only result in many per-project changes to override
-Libtool's ARFLAGS default, just to silent such warnings.
-
-Fixes bug#19967. Reported by Eric Blake.
-
-* m4/libtool.m4 (_LT_PROG_AR): Default AR_FLAGS to 'cr'.
-(_LT_REQUIRED_DARWIN_CHECKS): Use $AR_FLAGS instead 'cru' string.
-* doc/libtool.texi: Do 's/ar cru/ar cr/' in whole documentation.
-* NEWS: Document.
----
- NEWS | 4 ++++
- doc/libtool.texi | 10 +++++-----
- m4/libtool.m4 | 6 +++---
- 3 files changed, 12 insertions(+), 8 deletions(-)
-
-diff --git a/NEWS b/NEWS
-index 590ce15ed5cd..2afc01ef38a9 100644
---- a/NEWS
-+++ b/NEWS
-@@ -146,6 +146,10 @@ NEWS - list of user-visible changes between releases of GNU Libtool
- variable, which obsoletes AR_FLAGS. This is due to naming conventions
- among other *FLAGS and to be consistent with Automake's ARFLAGS.
-
-+** Important incompatible changes:
-+
-+ - Libtool changed ARFLAGS/AR_FLAGS default from 'cru' to 'cr'.
-+
- ** Bug fixes:
-
- - Fix a long-standing latent bug in autom4te include path for autotests
-diff --git a/doc/libtool.texi b/doc/libtool.texi
-index 0298627c2464..4c664bb2ab05 100644
---- a/doc/libtool.texi
-+++ b/doc/libtool.texi
-@@ -602,7 +602,7 @@ Without libtool, the programmer would invoke the @command{ar} command to
- create a static library:
-
- @example
--burger$ @kbd{ar cru libhello.a hello.o foo.o}
-+burger$ @kbd{ar cr libhello.a hello.o foo.o}
- burger$
- @end example
-
-@@ -632,7 +632,7 @@ libtool are the same ones you would use to produce an executable named
- a23$ @kbd{libtool --mode=link gcc -g -O -o libhello.la foo.o hello.o}
- *** Warning: Linking the shared library libhello.la against the
- *** non-libtool objects foo.o hello.o is not portable!
--ar cru .libs/libhello.a
-+ar cr .libs/libhello.a
- ranlib .libs/libhello.a
- creating libhello.la
- (cd .libs && rm -f libhello.la && ln -s ../libhello.la libhello.la)
-@@ -662,7 +662,7 @@ archive, not a shared library (@pxref{Static libraries}).}:
- @example
- a23$ @kbd{libtool --mode=link gcc -g -O -o libhello.la foo.lo hello.lo \
- -rpath /usr/local/lib -lm}
--ar cru @value{objdir}/libhello.a foo.o hello.o
-+ar cr @value{objdir}/libhello.a foo.o hello.o
- ranlib @value{objdir}/libhello.a
- creating libhello.la
- (cd @value{objdir} && rm -f libhello.la && ln -s ../libhello.la libhello.la)
-@@ -676,7 +676,7 @@ burger$ @kbd{libtool --mode=link gcc -g -O -o libhello.la foo.lo hello.lo \
- -rpath /usr/local/lib -lm}
- rm -fr @value{objdir}/libhello.a @value{objdir}/libhello.la
- ld -Bshareable -o @value{objdir}/libhello.so.0.0 @value{objdir}/foo.o @value{objdir}/hello.o -lm
--ar cru @value{objdir}/libhello.a foo.o hello.o
-+ar cr @value{objdir}/libhello.a foo.o hello.o
- ranlib @value{objdir}/libhello.a
- creating libhello.la
- (cd @value{objdir} && rm -f libhello.la && ln -s ../libhello.la libhello.la)
-@@ -6001,7 +6001,7 @@ in cases where it is necessary.
- @subsection Archivers
-
- On all known systems, building a static library can be accomplished by
--running @kbd{ar cru lib@var{name}.a @var{obj1}.o @var{obj2}.o @dots{}},
-+running @kbd{ar cr lib@var{name}.a @var{obj1}.o @var{obj2}.o @dots{}},
- where the @file{.a} file is the output library, and each @file{.o} file is an
- object file.
-
-diff --git a/m4/libtool.m4 b/m4/libtool.m4
-index 2d6bda98fc92..3335def6d847 100644
---- a/m4/libtool.m4
-+++ b/m4/libtool.m4
-@@ -1042,8 +1042,8 @@ int forced_loaded() { return 2;}
- _LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
-- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
-- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
-+ echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
-+ $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
- echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
- $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
- cat > conftest.c << _LT_EOF
-@@ -1501,7 +1501,7 @@ _LT_DECL([], [AR], [1], [The archiver])
- # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
- # variable obsoleted/removed.
-
--test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cru}
-+test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
- lt_ar_flags=$AR_FLAGS
- _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
-
diff --git a/patches/libtool-2.4.6/0003-libtool-fix-GCC-linking-with-specs.patch b/patches/libtool-2.4.6/0003-libtool-fix-GCC-linking-with-specs.patch
deleted file mode 100644
index c40a2b711..000000000
--- a/patches/libtool-2.4.6/0003-libtool-fix-GCC-linking-with-specs.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Pavel Raiskup <praiskup@redhat.com>
-Date: Fri, 18 Sep 2015 10:36:43 +0200
-Subject: [PATCH] libtool: fix GCC linking with -specs=*
-
-References:
-https://bugzilla.redhat.com/show_bug.cgi?id=985592
-
-* build-aux/ltmain.in (func_mode_link): Pass -specs=*
-to the linker, Fedora uses this option for hardening.
-
-Signed-off-by: Pavel Raiskup <praiskup@redhat.com>
----
- build-aux/ltmain.in | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
-index d5cf07a63f59..0c40da06deb4 100644
---- a/build-aux/ltmain.in
-+++ b/build-aux/ltmain.in
-@@ -5360,10 +5360,12 @@ func_mode_link ()
- # -tp=* Portland pgcc target processor selection
- # --sysroot=* for sysroot support
- # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-+ # -specs=* GCC specs files
- # -stdlib=* select c++ std lib with clang
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
-+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-+ -specs=*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
- func_append compile_command " $arg"
diff --git a/patches/libtool-2.4.6/0004-libtool-fix-GCC-clang-linking-with-fsanitize.patch b/patches/libtool-2.4.6/0004-libtool-fix-GCC-clang-linking-with-fsanitize.patch
deleted file mode 100644
index 67e103ca3..000000000
--- a/patches/libtool-2.4.6/0004-libtool-fix-GCC-clang-linking-with-fsanitize.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
-Date: Sun, 18 Oct 2015 21:55:39 -0700
-Subject: [PATCH] libtool: fix GCC/clang linking with -fsanitize=*
-
-References:
-https://lists.gnu.org/archive/html/libtool/2014-04/msg00026.html
-
-* build-aux/ltmain.in (func_mode_link): Pass -fsanitize=* to the
-linker to allow trivial use of the clang address sanitizer.
-
-Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
-Copyright-paperwork-exempt: Yes
----
- build-aux/ltmain.in | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
-index 0c40da06deb4..d063aa44a486 100644
---- a/build-aux/ltmain.in
-+++ b/build-aux/ltmain.in
-@@ -5362,10 +5362,11 @@ func_mode_link ()
- # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
- # -specs=* GCC specs files
- # -stdlib=* select c++ std lib with clang
-+ # -fsanitize=* Clang/GCC memory and address sanitizer
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-- -specs=*)
-+ -specs=*|-fsanitize=*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
- func_append compile_command " $arg"
diff --git a/patches/libtool-2.4.6/0005-libtool-pass-through-fuse-ld-flags.patch b/patches/libtool-2.4.6/0005-libtool-pass-through-fuse-ld-flags.patch
deleted file mode 100644
index e7c88c60c..000000000
--- a/patches/libtool-2.4.6/0005-libtool-pass-through-fuse-ld-flags.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sat, 13 Feb 2016 02:14:29 -0500
-Subject: [PATCH] libtool: pass through -fuse-ld flags
-
-Starting with gcc-4.8, there's a -fuse-ld flag that can be used to
-select between bfd & gold. Make sure we pass it through to the
-linking stage.
-
-* build-aux/ltmain.in (func_mode_link): Pass -fuse-ld=* flags
-through.
-Copyright-paperwork-exempt: Yes
----
- build-aux/ltmain.in | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
-index d063aa44a486..14e45d0b9d07 100644
---- a/build-aux/ltmain.in
-+++ b/build-aux/ltmain.in
-@@ -5363,10 +5363,11 @@ func_mode_link ()
- # -specs=* GCC specs files
- # -stdlib=* select c++ std lib with clang
- # -fsanitize=* Clang/GCC memory and address sanitizer
-+ # -fuse-ld=* Linker select flags for GCC
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-- -specs=*|-fsanitize=*)
-+ -specs=*|-fsanitize=*|-fuse-ld=*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
- func_append compile_command " $arg"
diff --git a/patches/libtool-2.4.6/series b/patches/libtool-2.4.6/series
deleted file mode 100644
index c0b3d421b..000000000
--- a/patches/libtool-2.4.6/series
+++ /dev/null
@@ -1,8 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-libool.m4-add-ARFLAGS-variable.patch
-0002-ARFLAGS-use-cr-instead-of-cru-by-default.patch
-0003-libtool-fix-GCC-linking-with-specs.patch
-0004-libtool-fix-GCC-clang-linking-with-fsanitize.patch
-0005-libtool-pass-through-fuse-ld-flags.patch
-# 55967635b8c962a56e9ee2fd8dc06f7d - git-ptx-patches magic
diff --git a/patches/libtremor-1.0.3/0001-HACK-configure.in-remove-extended-OGG-check.patch b/patches/libtremor-2018-03-19-g7c30a6634619/0001-HACK-configure.in-remove-extended-OGG-check.patch
index d0a40ef2a..5d17c6e9a 100644
--- a/patches/libtremor-1.0.3/0001-HACK-configure.in-remove-extended-OGG-check.patch
+++ b/patches/libtremor-2018-03-19-g7c30a6634619/0001-HACK-configure.in-remove-extended-OGG-check.patch
@@ -13,7 +13,7 @@ Tested-by: Juergen Beisert <jbe@pengutronix.de>
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/configure.in b/configure.in
-index e7f5690..6eaf6e4 100644
+index e7f56900295d..6eaf6e418363 100644
--- a/configure.in
+++ b/configure.in
@@ -119,11 +119,7 @@ fi
diff --git a/patches/libtremor-2018-03-19-g7c30a6634619/0002-Only-enable-ARM-assember-on-armel.patch b/patches/libtremor-2018-03-19-g7c30a6634619/0002-Only-enable-ARM-assember-on-armel.patch
new file mode 100644
index 000000000..19f267659
--- /dev/null
+++ b/patches/libtremor-2018-03-19-g7c30a6634619/0002-Only-enable-ARM-assember-on-armel.patch
@@ -0,0 +1,30 @@
+From: Sebastian Ramacher <sramacher@debian.org>
+Date: Sat, 12 Sep 2020 17:48:41 +0200
+Subject: [PATCH] Only enable ARM assember on armel
+
+---
+ configure.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 6eaf6e418363..a33613e34aab 100644
+--- a/configure.in
++++ b/configure.in
+@@ -48,7 +48,7 @@ cflags_save="$CFLAGS"
+ ldflags_save="$LDFLAGS"
+ if test -z "$GCC"; then
+ case $host in
+- arm-*-*)
++ arm-*-gnueabi)
+ DEBUG="-g -D_ARM_ASSEM_"
+ CFLAGS="-O -D_ARM_ASSEM_"
+ PROFILE="-p -g -O -D_ARM_ASSEM_" ;;
+@@ -60,7 +60,7 @@ if test -z "$GCC"; then
+ else
+
+ case $host in
+- arm-*-*)
++ arm-*-gnueabi)
+ DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -D_ARM_ASSEM_"
+ CFLAGS="-O2 -D_ARM_ASSEM_ -fsigned-char"
+ PROFILE="-W -pg -g -O2 -D_ARM_ASSEM_ -fsigned-char -fno-inline-functions";;
diff --git a/patches/ima-evm-utils-1.1/autogen.sh b/patches/libtremor-2018-03-19-g7c30a6634619/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/ima-evm-utils-1.1/autogen.sh
+++ b/patches/libtremor-2018-03-19-g7c30a6634619/autogen.sh
diff --git a/patches/libtremor-1.0.3/series b/patches/libtremor-2018-03-19-g7c30a6634619/series
index 75ee87212..12c69a94c 100644
--- a/patches/libtremor-1.0.3/series
+++ b/patches/libtremor-2018-03-19-g7c30a6634619/series
@@ -1,4 +1,5 @@
# generated by git-ptx-patches
#tag:base --start-number 1
0001-HACK-configure.in-remove-extended-OGG-check.patch
-# 8b861fdf14ed5f27dce4c67d75786cf3 - git-ptx-patches magic
+0002-Only-enable-ARM-assember-on-armel.patch
+# bf1ffccccf3c1c9653f3f1c13bad6006 - git-ptx-patches magic
diff --git a/patches/libunwind-1.4.0/0001-Fix-compilation-with-fno-common.patch b/patches/libunwind-1.4.0/0001-Fix-compilation-with-fno-common.patch
deleted file mode 100644
index 250114d2e..000000000
--- a/patches/libunwind-1.4.0/0001-Fix-compilation-with-fno-common.patch
+++ /dev/null
@@ -1,441 +0,0 @@
-From: Yichao Yu <yyc1992@gmail.com>
-Date: Tue, 31 Mar 2020 00:43:32 -0400
-Subject: [PATCH] Fix compilation with -fno-common.
-
-Making all other archs consistent with IA64 which should not have this problem.
-Also move the FIXME to the correct place.
-
-Also add some minimum comments about this...
----
- src/aarch64/Ginit.c | 15 +++++++--------
- src/arm/Ginit.c | 15 +++++++--------
- src/coredump/_UPT_get_dyn_info_list_addr.c | 5 +++++
- src/hppa/Ginit.c | 15 +++++++--------
- src/ia64/Ginit.c | 1 +
- src/mi/Gfind_dynamic_proc_info.c | 1 +
- src/mips/Ginit.c | 15 +++++++--------
- src/ppc32/Ginit.c | 11 +++++++----
- src/ppc64/Ginit.c | 11 +++++++----
- src/ptrace/_UPT_get_dyn_info_list_addr.c | 5 +++++
- src/s390x/Ginit.c | 15 +++++++--------
- src/sh/Ginit.c | 15 +++++++--------
- src/tilegx/Ginit.c | 15 +++++++--------
- src/x86/Ginit.c | 15 +++++++--------
- src/x86_64/Ginit.c | 15 +++++++--------
- 15 files changed, 89 insertions(+), 80 deletions(-)
-
-diff --git a/src/aarch64/Ginit.c b/src/aarch64/Ginit.c
-index dec235c82908..35389762f27e 100644
---- a/src/aarch64/Ginit.c
-+++ b/src/aarch64/Ginit.c
-@@ -61,13 +61,6 @@ tdep_uc_addr (unw_tdep_context_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--/* XXX fix me: there is currently no way to locate the dyn-info list
-- by a remote unwinder. On ia64, this is done via a special
-- unwind-table entry. Perhaps something similar can be done with
-- DWARF2 unwind info. */
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -78,7 +71,13 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
-diff --git a/src/arm/Ginit.c b/src/arm/Ginit.c
-index 2720d063a242..0bac0d72da6f 100644
---- a/src/arm/Ginit.c
-+++ b/src/arm/Ginit.c
-@@ -57,18 +57,17 @@ tdep_uc_addr (unw_tdep_context_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--/* XXX fix me: there is currently no way to locate the dyn-info list
-- by a remote unwinder. On ia64, this is done via a special
-- unwind-table entry. Perhaps something similar can be done with
-- DWARF2 unwind info. */
--
- static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
-diff --git a/src/coredump/_UPT_get_dyn_info_list_addr.c b/src/coredump/_UPT_get_dyn_info_list_addr.c
-index 0d11905566c3..739ed0569b9e 100644
---- a/src/coredump/_UPT_get_dyn_info_list_addr.c
-+++ b/src/coredump/_UPT_get_dyn_info_list_addr.c
-@@ -74,6 +74,11 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
-
- #else
-
-+/* XXX fix me: there is currently no way to locate the dyn-info list
-+ by a remote unwinder. On ia64, this is done via a special
-+ unwind-table entry. Perhaps something similar can be done with
-+ DWARF2 unwind info. */
-+
- static inline int
- get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
- int *countp)
-diff --git a/src/hppa/Ginit.c b/src/hppa/Ginit.c
-index 461e4b93da65..265455a68c82 100644
---- a/src/hppa/Ginit.c
-+++ b/src/hppa/Ginit.c
-@@ -64,13 +64,6 @@ _Uhppa_uc_addr (ucontext_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--/* XXX fix me: there is currently no way to locate the dyn-info list
-- by a remote unwinder. On ia64, this is done via a special
-- unwind-table entry. Perhaps something similar can be done with
-- DWARF2 unwind info. */
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -81,7 +74,13 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
-diff --git a/src/ia64/Ginit.c b/src/ia64/Ginit.c
-index b09a2ad57c7a..8601bb3ca885 100644
---- a/src/ia64/Ginit.c
-+++ b/src/ia64/Ginit.c
-@@ -68,6 +68,7 @@ get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- if (!_U_dyn_info_list_addr)
- return -UNW_ENOINFO;
- #endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
- *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-diff --git a/src/mi/Gfind_dynamic_proc_info.c b/src/mi/Gfind_dynamic_proc_info.c
-index 98d35012861c..2e7c62e5e862 100644
---- a/src/mi/Gfind_dynamic_proc_info.c
-+++ b/src/mi/Gfind_dynamic_proc_info.c
-@@ -49,6 +49,7 @@ local_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
- return -UNW_ENOINFO;
- #endif
-
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
- list = (unw_dyn_info_list_t *) (uintptr_t) _U_dyn_info_list_addr ();
- for (di = list->first; di; di = di->next)
- if (ip >= di->start_ip && ip < di->end_ip)
-diff --git a/src/mips/Ginit.c b/src/mips/Ginit.c
-index 3df170c75493..bf7a8f5a8f44 100644
---- a/src/mips/Ginit.c
-+++ b/src/mips/Ginit.c
-@@ -69,13 +69,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--/* XXX fix me: there is currently no way to locate the dyn-info list
-- by a remote unwinder. On ia64, this is done via a special
-- unwind-table entry. Perhaps something similar can be done with
-- DWARF2 unwind info. */
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -86,7 +79,13 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
-diff --git a/src/ppc32/Ginit.c b/src/ppc32/Ginit.c
-index ba302448a314..7b45455807c8 100644
---- a/src/ppc32/Ginit.c
-+++ b/src/ppc32/Ginit.c
-@@ -91,9 +91,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -104,7 +101,13 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
-diff --git a/src/ppc64/Ginit.c b/src/ppc64/Ginit.c
-index 4c88cd6e77ff..7bfb395a7923 100644
---- a/src/ppc64/Ginit.c
-+++ b/src/ppc64/Ginit.c
-@@ -95,9 +95,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -108,7 +105,13 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
-diff --git a/src/ptrace/_UPT_get_dyn_info_list_addr.c b/src/ptrace/_UPT_get_dyn_info_list_addr.c
-index cc5ed0441865..16671d453e1f 100644
---- a/src/ptrace/_UPT_get_dyn_info_list_addr.c
-+++ b/src/ptrace/_UPT_get_dyn_info_list_addr.c
-@@ -71,6 +71,11 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
-
- #else
-
-+/* XXX fix me: there is currently no way to locate the dyn-info list
-+ by a remote unwinder. On ia64, this is done via a special
-+ unwind-table entry. Perhaps something similar can be done with
-+ DWARF2 unwind info. */
-+
- static inline int
- get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
- int *countp)
-diff --git a/src/s390x/Ginit.c b/src/s390x/Ginit.c
-index f0886ac93370..db01743c0627 100644
---- a/src/s390x/Ginit.c
-+++ b/src/s390x/Ginit.c
-@@ -50,8 +50,6 @@ static struct unw_addr_space local_addr_space;
-
- unw_addr_space_t unw_local_addr_space = &local_addr_space;
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
- static inline void *
- uc_addr (ucontext_t *uc, int reg)
- {
-@@ -75,11 +73,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--/* XXX fix me: there is currently no way to locate the dyn-info list
-- by a remote unwinder. On ia64, this is done via a special
-- unwind-table entry. Perhaps something similar can be done with
-- DWARF2 unwind info. */
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -90,7 +83,13 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
-diff --git a/src/sh/Ginit.c b/src/sh/Ginit.c
-index 52988a721e9d..9fe96d2bd4d8 100644
---- a/src/sh/Ginit.c
-+++ b/src/sh/Ginit.c
-@@ -58,13 +58,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--/* XXX fix me: there is currently no way to locate the dyn-info list
-- by a remote unwinder. On ia64, this is done via a special
-- unwind-table entry. Perhaps something similar can be done with
-- DWARF2 unwind info. */
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -75,7 +68,13 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
-diff --git a/src/tilegx/Ginit.c b/src/tilegx/Ginit.c
-index 7564a558be43..925e6413246b 100644
---- a/src/tilegx/Ginit.c
-+++ b/src/tilegx/Ginit.c
-@@ -64,13 +64,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--/* XXX fix me: there is currently no way to locate the dyn-info list
-- by a remote unwinder. On ia64, this is done via a special
-- unwind-table entry. Perhaps something similar can be done with
-- DWARF2 unwind info. */
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -81,7 +74,13 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
-diff --git a/src/x86/Ginit.c b/src/x86/Ginit.c
-index f6b8dc27d493..3cec74a216b1 100644
---- a/src/x86/Ginit.c
-+++ b/src/x86/Ginit.c
-@@ -54,13 +54,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--/* XXX fix me: there is currently no way to locate the dyn-info list
-- by a remote unwinder. On ia64, this is done via a special
-- unwind-table entry. Perhaps something similar can be done with
-- DWARF2 unwind info. */
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -71,7 +64,13 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
-diff --git a/src/x86_64/Ginit.c b/src/x86_64/Ginit.c
-index 6161da6401b4..5c4e4269a6bf 100644
---- a/src/x86_64/Ginit.c
-+++ b/src/x86_64/Ginit.c
-@@ -49,13 +49,6 @@ static struct unw_addr_space local_addr_space;
-
- unw_addr_space_t unw_local_addr_space = &local_addr_space;
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--/* XXX fix me: there is currently no way to locate the dyn-info list
-- by a remote unwinder. On ia64, this is done via a special
-- unwind-table entry. Perhaps something similar can be done with
-- DWARF2 unwind info. */
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -66,7 +59,13 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
diff --git a/patches/libunwind-1.4.0/series b/patches/libunwind-1.4.0/series
deleted file mode 100644
index 3f1eae538..000000000
--- a/patches/libunwind-1.4.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Fix-compilation-with-fno-common.patch
-# 14a237c2929f4a533a7a5da1f74936a1 - git-ptx-patches magic
diff --git a/patches/libuv-v1.34.0/autogen.sh b/patches/libuv-v1.47.0/autogen.sh
index e81262ffe..e81262ffe 100755
--- a/patches/libuv-v1.34.0/autogen.sh
+++ b/patches/libuv-v1.47.0/autogen.sh
diff --git a/patches/libwacom-1.9/0001-HACK-build-generate-hwdb-as-native-tool.patch b/patches/libwacom-1.9/0001-HACK-build-generate-hwdb-as-native-tool.patch
deleted file mode 100644
index f8d72e4f6..000000000
--- a/patches/libwacom-1.9/0001-HACK-build-generate-hwdb-as-native-tool.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Tue, 16 Feb 2021 16:28:22 +0100
-Subject: [PATCH] HACK: build generate-hwdb as native tool
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- libwacom/libwacom.c | 6 ++++++
- meson.build | 18 ++++++++++++++----
- 2 files changed, 20 insertions(+), 4 deletions(-)
-
-diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
-index 062b3131dfec..44d3438ed576 100644
---- a/libwacom/libwacom.c
-+++ b/libwacom/libwacom.c
-@@ -34,7 +34,9 @@
- #include <stdbool.h>
- #include <stdio.h>
- #include <string.h>
-+#ifndef NO_UDEV
- #include <gudev/gudev.h>
-+#endif
-
- #include <linux/input-event-codes.h>
-
-@@ -44,6 +46,7 @@ libwacom_get_device(const WacomDeviceDatabase *db, const char *match)
- return (WacomDevice *) g_hash_table_lookup (db->device_ht, match);
- }
-
-+#ifndef NO_UDEV
- static gboolean
- is_tablet (GUdevDevice *device)
- {
-@@ -304,6 +307,7 @@ out:
- g_object_unref (client);
- return retval;
- }
-+#endif
-
- static WacomDevice *
- libwacom_copy(const WacomDevice *device)
-@@ -481,6 +485,7 @@ libwacom_new (const WacomDeviceDatabase *db, const char *name, int vendor_id, in
- return device;
- }
-
-+#ifndef NO_UDEV
- LIBWACOM_EXPORT WacomDevice*
- libwacom_new_from_path(const WacomDeviceDatabase *db, const char *path, WacomFallbackFlags fallback, WacomError *error)
- {
-@@ -558,6 +563,7 @@ bail:
- libwacom_error_set(error, WERROR_UNKNOWN_MODEL, NULL);
- return NULL;
- }
-+#endif
-
- LIBWACOM_EXPORT WacomDevice*
- libwacom_new_from_usbid(const WacomDeviceDatabase *db, int vendor_id, int product_id, WacomError *error)
-diff --git a/meson.build b/meson.build
-index b960826820b8..f8f690e4616e 100644
---- a/meson.build
-+++ b/meson.build
-@@ -128,20 +128,30 @@ test('svg-layout-exists',
-
- ############### tools ###########################
-
-+dep_native_glib = dependency('glib-2.0', native: true)
-+
- executable('libwacom-list-local-devices',
- 'tools/list-local-devices.c',
- dependencies: [dep_libwacom, dep_glib],
- include_directories: [includes_src],
- install: true)
-
--tools_cflags = ['-DTOPSRCDIR="@0@"'.format(meson.source_root())]
-+tools_cflags = [
-+ '-DTOPSRCDIR="@0@"'.format(meson.source_root()),
-+ '-DDATADIR="@0@"'.format(dir_data),
-+ '-DETCDIR="@0@"'.format(dir_etc),
-+ '-DNO_UDEV',
-+]
-
- gen_hwdb = executable('generate-hwdb',
-- 'tools/generate-hwdb.c',
-- dependencies: [dep_libwacom, dep_glib],
-+ ['tools/generate-hwdb.c',
-+ 'libwacom/libwacom-database.c',
-+ 'libwacom/libwacom.c',
-+ 'libwacom/libwacom-error.c' ],
-+ dependencies: dep_native_glib,
- include_directories: [includes_src],
- c_args: tools_cflags,
-- install: false)
-+ install: false, native: true)
- custom_target('hwdb',
- command: gen_hwdb,
- capture: true,
diff --git a/patches/libwacom-1.9/series b/patches/libwacom-1.9/series
deleted file mode 100644
index 0ffb269e2..000000000
--- a/patches/libwacom-1.9/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-HACK-build-generate-hwdb-as-native-tool.patch
-# 21d721c45f880605c0bd34c8ce3399e1 - git-ptx-patches magic
diff --git a/patches/libx86-1.1/libx86-1.1-IF_MASK-undeclared.diff b/patches/libx86-1.1/libx86-1.1-IF_MASK-undeclared.diff
deleted file mode 100644
index 2e4ac290f..000000000
--- a/patches/libx86-1.1/libx86-1.1-IF_MASK-undeclared.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Robert Schwebel <r.schwebel@pengutronix.de>
-Subject: define IF_MASK for sanitized kernel headers
-
-Current kernels don't have IF_MASK defined in their sanitized headers
-any more. This results in the following error:
-
-lrmi.c: In function 'set_regs':
-lrmi.c:191: error: 'IF_MASK' undeclared (first use in this function)
-
-Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
-
----
- lrmi.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-Index: libx86-1.1/lrmi.c
-===================================================================
---- libx86-1.1.orig/lrmi.c
-+++ libx86-1.1/lrmi.c
-@@ -54,6 +54,13 @@ OTHER DEALINGS IN THE SOFTWARE.
- #include "lrmi.h"
- #include "x86-common.h"
-
-+#if defined(__linux__) && !defined(TF_MASK)
-+#define TF_MASK X86_EFLAGS_TF
-+#define IF_MASK X86_EFLAGS_IF
-+#define VIF_MASK X86_EFLAGS_VIF
-+#define IOPL_MASK X86_EFLAGS_IOPL
-+#endif
-+
- #if defined(__linux__)
- #define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK)
- #elif defined(__NetBSD__) || defined(__FreeBSD__)
diff --git a/patches/libx86-1.1/series b/patches/libx86-1.1/series
deleted file mode 100644
index e55b9991a..000000000
--- a/patches/libx86-1.1/series
+++ /dev/null
@@ -1 +0,0 @@
-libx86-1.1-IF_MASK-undeclared.diff
diff --git a/patches/libxml2-2.9.12/0200-xml2-config-is-not-SYSROOT-aware.patch b/patches/libxml2-2.11.7/0200-xml2-config-is-not-SYSROOT-aware.patch
index 7204497b3..96bd12dbd 100644
--- a/patches/libxml2-2.9.12/0200-xml2-config-is-not-SYSROOT-aware.patch
+++ b/patches/libxml2-2.11.7/0200-xml2-config-is-not-SYSROOT-aware.patch
@@ -10,7 +10,7 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xml2-config.in b/xml2-config.in
-index cb4aa613a68c..31f9e67a999b 100644
+index 5863ffa04956..b5effdb2d15e 100644
--- a/xml2-config.in
+++ b/xml2-config.in
@@ -1,6 +1,6 @@
diff --git a/patches/libxml2-2.9.12/series b/patches/libxml2-2.11.7/series
index 05ba5ddea..05ba5ddea 100644
--- a/patches/libxml2-2.9.12/series
+++ b/patches/libxml2-2.11.7/series
diff --git a/patches/libxslt-1.1.34/0001-Fix-xml2-config-check-in-configure-script.patch b/patches/libxslt-1.1.34/0001-Fix-xml2-config-check-in-configure-script.patch
deleted file mode 100644
index ab7227344..000000000
--- a/patches/libxslt-1.1.34/0001-Fix-xml2-config-check-in-configure-script.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Nick Wellnhofer <wellnhofer@aevum.de>
-Date: Fri, 15 Nov 2019 11:53:11 +0100
-Subject: [PATCH] Fix xml2-config check in configure script
-
-A 'print' option has never been supported. After a recent change to
-libxml2, invalid options cause xml2-config to fail.
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index 325a7bea0dcf..d6b5594ad477 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -546,7 +546,7 @@ dnl make sure xml2-config is executable,
- dnl test version and init our variables
- dnl
-
--if test "x$LIBXML_LIBS" = "x" && ${XML_CONFIG} --libs print > /dev/null 2>&1
-+if test "x$LIBXML_LIBS" = "x" && ${XML_CONFIG} --libs > /dev/null 2>&1
- then
- AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
- XMLVERS=`$XML_CONFIG --version`
diff --git a/patches/libxslt-1.1.34/series b/patches/libxslt-1.1.34/series
deleted file mode 100644
index 1ede19a8c..000000000
--- a/patches/libxslt-1.1.34/series
+++ /dev/null
@@ -1,7 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-#tag:upstream --start-number 1
-0001-Fix-xml2-config-check-in-configure-script.patch
-#tag:ptx --start-number 200
-0200-xslt-config-add-SYSROOT-support.patch
-# c8a532c629ee7654cb91733eefc0814b - git-ptx-patches magic
diff --git a/patches/libxslt-1.1.34/0200-xslt-config-add-SYSROOT-support.patch b/patches/libxslt-1.1.39/0200-xslt-config-add-SYSROOT-support.patch
index 1f124a8d6..1f124a8d6 100644
--- a/patches/libxslt-1.1.34/0200-xslt-config-add-SYSROOT-support.patch
+++ b/patches/libxslt-1.1.39/0200-xslt-config-add-SYSROOT-support.patch
diff --git a/patches/libxslt-1.1.39/series b/patches/libxslt-1.1.39/series
new file mode 100644
index 000000000..e7aa0f393
--- /dev/null
+++ b/patches/libxslt-1.1.39/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+#tag:ptx --start-number 200
+0200-xslt-config-add-SYSROOT-support.patch
+# d971b2e05382256c96c63c656e15719c - git-ptx-patches magic
diff --git a/patches/libbsd-0.8.2/autogen.sh b/patches/libyaml-0.2.5/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/libbsd-0.8.2/autogen.sh
+++ b/patches/libyaml-0.2.5/autogen.sh
diff --git a/patches/linuxptp-2.0/0001-Fix-building-with-new-kernel-headers.patch b/patches/linuxptp-2.0/0001-Fix-building-with-new-kernel-headers.patch
deleted file mode 100644
index 247a6a353..000000000
--- a/patches/linuxptp-2.0/0001-Fix-building-with-new-kernel-headers.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From: Miroslav Lichvar <mlichvar@redhat.com>
-Date: Thu, 6 Dec 2018 18:23:44 +0100
-Subject: [PATCH] Fix building with new kernel headers.
-
-net_tstamp.h in recent kernel versions requires time.h for clockid_t.
-
-Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
----
- clock.c | 2 +-
- sk.c | 1 +
- timemaster.c | 1 +
- 3 files changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/clock.c b/clock.c
-index faf2dea82a5b..9bbcefa5c57c 100644
---- a/clock.c
-+++ b/clock.c
-@@ -17,11 +17,11 @@
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
- #include <errno.h>
-+#include <time.h>
- #include <linux/net_tstamp.h>
- #include <poll.h>
- #include <stdlib.h>
- #include <string.h>
--#include <time.h>
- #include <sys/queue.h>
-
- #include "address.h"
-diff --git a/sk.c b/sk.c
-index f18b2bf8732b..386b4c8adf80 100644
---- a/sk.c
-+++ b/sk.c
-@@ -18,6 +18,7 @@
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
- #include <errno.h>
-+#include <time.h>
- #include <linux/net_tstamp.h>
- #include <linux/sockios.h>
- #include <linux/ethtool.h>
-diff --git a/timemaster.c b/timemaster.c
-index 4ba921edb902..28c215a2de95 100644
---- a/timemaster.c
-+++ b/timemaster.c
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <libgen.h>
- #include <limits.h>
-+#include <time.h>
- #include <linux/net_tstamp.h>
- #include <net/if.h>
- #include <signal.h>
diff --git a/patches/linuxptp-2.0/series b/patches/linuxptp-2.0/series
deleted file mode 100644
index fe0aad830..000000000
--- a/patches/linuxptp-2.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Fix-building-with-new-kernel-headers.patch
-# b102f87ad3ef97777cea9ad16f755ca7 - git-ptx-patches magic
diff --git a/patches/lmbench-3.0-a9/lmbench-3.0-a9-remove-old-buildsystem.diff b/patches/lmbench-3.0-a9/0001-Add-autotool-based-build-system.patch
index 21c1ed39d..f40b509d8 100644
--- a/patches/lmbench-3.0-a9/lmbench-3.0-a9-remove-old-buildsystem.diff
+++ b/patches/lmbench-3.0-a9/0001-Add-autotool-based-build-system.patch
@@ -1,19 +1,23 @@
From: Robert Schwebel <r.schwebel@pengutronix.de>
-Subject: Add autotool based build system
+Date: Thu, 9 Apr 2009 19:40:55 +0000
+Subject: [PATCH] Add autotool based build system
In order to provide an autotool based build system, remove the old one.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
-
---
- Makefile | 74 --------
- results/Makefile | 333 -------------------------------------
- src/Makefile | 489 -------------------------------------------------------
+ Makefile | 74 ---------
+ results/Makefile | 333 -------------------------------------
+ src/Makefile | 489 -------------------------------------------------------
3 files changed, 896 deletions(-)
+ delete mode 100644 Makefile
+ delete mode 100644 results/Makefile
+ delete mode 100644 src/Makefile
-Index: lmbench-3.0-a9/Makefile
-===================================================================
---- lmbench-3.0-a9.orig/Makefile
+diff --git a/Makefile b/Makefile
+deleted file mode 100644
+index e84dda8079ac..000000000000
+--- a/Makefile
+++ /dev/null
@@ -1,74 +0,0 @@
-# Makefile for top level of lmbench
@@ -90,9 +94,10 @@ Index: lmbench-3.0-a9/Makefile
- cd .. && shar -S -a -n lmbench1.0 -L 50K < /tmp/FILES
-
-FRC:
-Index: lmbench-3.0-a9/results/Makefile
-===================================================================
---- lmbench-3.0-a9.orig/results/Makefile
+diff --git a/results/Makefile b/results/Makefile
+deleted file mode 100644
+index 0935376c13e3..000000000000
+--- a/results/Makefile
+++ /dev/null
@@ -1,333 +0,0 @@
-# Makefile for lmbench results.
@@ -428,9 +433,10 @@ Index: lmbench-3.0-a9/results/Makefile
- @if [ ! -d tmp ]; then mkdir tmp; fi
- @if [ ! -d PS ]; then mkdir PS; fi
- @if [ ! -d HTML ]; then mkdir HTML; fi
-Index: lmbench-3.0-a9/src/Makefile
-===================================================================
---- lmbench-3.0-a9.orig/src/Makefile
+diff --git a/src/Makefile b/src/Makefile
+deleted file mode 100644
+index 4962815b5fe7..000000000000
+--- a/src/Makefile
+++ /dev/null
@@ -1,489 +0,0 @@
-# $Id$
diff --git a/patches/lmbench-3.0-a9/lmbench-3.0-a9-autotoolize.diff b/patches/lmbench-3.0-a9/0002-Add-autotool-based-build-system.patch
index b41b77b91..c8d005c52 100644
--- a/patches/lmbench-3.0-a9/lmbench-3.0-a9-autotoolize.diff
+++ b/patches/lmbench-3.0-a9/0002-Add-autotool-based-build-system.patch
@@ -1,25 +1,30 @@
From: Robert Schwebel <r.schwebel@pengutronix.de>
-Subject: Add autotool based build system
+Date: Thu, 9 Apr 2009 19:40:55 +0000
+Subject: [PATCH] Add autotool based build system
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
-
---
- Makefile.am | 3 +
- autogen.sh | 22 ++++++++++++
- configure.ac | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/Makefile.am | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 226 insertions(+)
+ Makefile.am | 2 ++
+ autogen.sh | 22 +++++++++++++
+ configure.ac | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/Makefile.am | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 223 insertions(+)
+ create mode 100644 Makefile.am
+ create mode 100644 autogen.sh
+ create mode 100644 configure.ac
+ create mode 100644 src/Makefile.am
-Index: b/Makefile.am
-===================================================================
+diff --git a/Makefile.am b/Makefile.am
+new file mode 100644
+index 000000000000..02962da59478
--- /dev/null
+++ b/Makefile.am
-@@ -0,0 +1,3 @@
+@@ -0,0 +1,2 @@
+SUBDIRS = \
+ src
-+
-Index: b/autogen.sh
-===================================================================
+diff --git a/autogen.sh b/autogen.sh
+new file mode 100644
+index 000000000000..29db9c9806d6
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,22 @@
@@ -45,11 +50,12 @@ Index: b/autogen.sh
+autoreconf --force --install --symlink -Wall || exit $?
+
+banner "Finished"
-Index: b/configure.ac
-===================================================================
+diff --git a/configure.ac b/configure.ac
+new file mode 100644
+index 000000000000..7fdb476a2510
--- /dev/null
+++ b/configure.ac
-@@ -0,0 +1,101 @@
+@@ -0,0 +1,100 @@
+AC_PREREQ(2.59)
+
+AC_INIT([lmbench], [trunk], [bugs@pengutronix.de])
@@ -150,12 +156,12 @@ Index: b/configure.ac
+ src/Makefile
+])
+AC_OUTPUT
-+
-Index: b/src/Makefile.am
-===================================================================
+diff --git a/src/Makefile.am b/src/Makefile.am
+new file mode 100644
+index 000000000000..90de5e286d40
--- /dev/null
+++ b/src/Makefile.am
-@@ -0,0 +1,100 @@
+@@ -0,0 +1,99 @@
+bin_PROGRAMS = \
+ bw_file_rd \
+ bw_mem \
@@ -255,4 +261,3 @@ Index: b/src/Makefile.am
+#libactor_@name@_la_LIBADD = \
+# $(libpv_LIBS) \
+# $(libstiebel_LIBS)
-+
diff --git a/patches/lmbench-3.0-a9/lmbench-3.0-a9-rpcheaders.diff b/patches/lmbench-3.0-a9/0003-minor-cleanups.patch
index 07ef7b144..326994548 100644
--- a/patches/lmbench-3.0-a9/lmbench-3.0-a9-rpcheaders.diff
+++ b/patches/lmbench-3.0-a9/0003-minor-cleanups.patch
@@ -1,13 +1,19 @@
From: Robert Schwebel <r.schwebel@pengutronix.de>
-Subject: minor cleanups
+Date: Thu, 9 Apr 2009 19:40:55 +0000
+Subject: [PATCH] minor cleanups
Add missing header file, add a cast to silence compiler.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
+ src/lib_tcp.c | 3 ++-
+ src/lib_udp.c | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
---- lmbench-3.0-a9-orig/src/lib_tcp.c 2006-06-27 18:27:19.000000000 +0200
-+++ lmbench-3.0-a9/src/lib_tcp.c 2009-04-09 17:56:50.000000000 +0200
+diff --git a/src/lib_tcp.c b/src/lib_tcp.c
+index 738d5578abbc..5d5860ea4f61 100644
+--- a/src/lib_tcp.c
++++ b/src/lib_tcp.c
@@ -7,6 +7,7 @@
*/
#define _LIB /* bench.h needs this */
@@ -16,7 +22,7 @@ Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
/*
* Get a TCP socket, bind it, figure out the port,
-@@ -148,7 +149,7 @@
+@@ -148,7 +149,7 @@ tcp_connect(char *host, int prog, int rdwr)
fprintf(stderr, "Client port %d\n", sockport(sock));
#endif
sock_optimize(sock, rdwr);
@@ -25,8 +31,10 @@ Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
save_host = host; /* XXX - counting on them not
* changing it - benchmark only.
*/
---- lmbench-3.0-a9-orig/src/lib_udp.c 2006-06-27 18:27:20.000000000 +0200
-+++ lmbench-3.0-a9/src/lib_udp.c 2009-04-09 17:57:19.000000000 +0200
+diff --git a/src/lib_udp.c b/src/lib_udp.c
+index 1ed4c92b8444..13b3d6536fd1 100644
+--- a/src/lib_udp.c
++++ b/src/lib_udp.c
@@ -7,6 +7,7 @@
*/
#define _LIB /* bench.h needs this */
diff --git a/patches/lmbench-3.0-a9/0004-Added-libtirpc.patch b/patches/lmbench-3.0-a9/0004-Added-libtirpc.patch
new file mode 100644
index 000000000..ec4691780
--- /dev/null
+++ b/patches/lmbench-3.0-a9/0004-Added-libtirpc.patch
@@ -0,0 +1,59 @@
+From: =?UTF-8?q?Sven=20P=C3=BCschel?= <s.pueschel@pengutronix.de>
+Date: Wed, 1 Feb 2023 08:17:38 +0000
+Subject: [PATCH] Added libtirpc
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+glibc has removed the SunRPC implementation, therefore it was replaced with libtirpc
+See also https://fedoraproject.org/wiki/Changes/SunRPCRemoval
+
+Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
+---
+ configure.ac | 31 +++++++++++++++++++++++++++++++
+ 1 file changed, 31 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 7fdb476a2510..0f0e54fb2e7d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -27,8 +27,39 @@ AC_SUBST(LT_AGE)
+ #
+ # Checks for programs.
+ #
++
++# Function copied and modified from http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=blob;f=aclocal/libtirpc.m4;h=bddae022693100c810edff042d51b145c8f411a6;hb=HEAD
++dnl Checks for TI-RPC library and headers
++dnl
++AC_DEFUN([AC_LIBTIRPC], [
++
++ PKG_PROG_PKG_CONFIG([0.9.0])
++ PKG_CHECK_MODULES([TIRPC], [libtirpc],
++ [LIBS="${LIBS} ${TIRPC_LIBS}"
++ AM_CFLAGS="${AM_CFLAGS} ${TIRPC_CFLAGS}"
++ AC_DEFINE([HAVE_LIBTIRPC], [1],
++ [Define to 1 if you have and wish to use libtirpc.])])
++
++ AS_IF([test -n "${LIBTIRPC}"],
++ [AC_CHECK_LIB([tirpc], [authgss_free_private_data],
++ [AC_DEFINE([HAVE_AUTHGSS_FREE_PRIVATE_DATA], [1],
++ [Define to 1 if your rpcsec library provides authgss_free_private_data])],,
++ [${LIBS}])])
++
++ AS_IF([test -n "${LIBTIRPC}"],
++ [AC_CHECK_LIB([tirpc], [libtirpc_set_debug],
++ [AC_DEFINE([HAVE_LIBTIRPC_SET_DEBUG], [1],
++ [Define to 1 if your tirpc library provides libtirpc_set_debug])],,
++ [${LIBS}])])
++
++ AC_SUBST([AM_CFLAGS])
++ AC_SUBST([LIBS])
++
++])dnl
++
+ AC_PROG_CC
+ AC_PROG_LIBTOOL
++AC_LIBTIRPC
+
+ AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])
+
diff --git a/patches/lmbench-3.0-a9/0005-Added-missing-include-for-socklen_t-check.patch b/patches/lmbench-3.0-a9/0005-Added-missing-include-for-socklen_t-check.patch
new file mode 100644
index 000000000..a25b192dd
--- /dev/null
+++ b/patches/lmbench-3.0-a9/0005-Added-missing-include-for-socklen_t-check.patch
@@ -0,0 +1,25 @@
+From: =?UTF-8?q?Sven=20P=C3=BCschel?= <s.pueschel@pengutronix.de>
+Date: Wed, 1 Feb 2023 08:54:07 +0000
+Subject: [PATCH] Added missing include for socklen_t check
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0f0e54fb2e7d..431d436203fa 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -100,7 +100,7 @@ AC_CHECK_TYPE([uint64],[CFLAGS="${CFLAGS} -DHAVE_uint64"])
+ AC_CHECK_TYPE([uint64_t],[CFLAGS="${CFLAGS} -DHAVE_uint64_t"])
+ AC_CHECK_TYPE([int64],[CFLAGS="${CFLAGS} -DHAVE_int64"])
+ AC_CHECK_TYPE([int64_t],[CFLAGS="${CFLAGS} -DHAVE_int64_t"])
+-AC_CHECK_TYPE([socklen_t],[CFLAGS="${CFLAGS} -DHAVE_socklen_t"])
++AC_CHECK_TYPE([socklen_t],[CFLAGS="${CFLAGS} -DHAVE_socklen_t"], [], [[#include <sys/socket.h>]])
+ AC_CHECK_TYPE([off64_t],[CFLAGS="${CFLAGS} -DHAVE_off64_t"])
+
+ AC_COMPILE_IFELSE(
diff --git a/patches/lmbench-3.0-a9/series b/patches/lmbench-3.0-a9/series
index 0c4ffef30..0426ae051 100644
--- a/patches/lmbench-3.0-a9/series
+++ b/patches/lmbench-3.0-a9/series
@@ -1,3 +1,8 @@
-lmbench-3.0-a9-remove-old-buildsystem.diff
-lmbench-3.0-a9-autotoolize.diff
-lmbench-3.0-a9-rpcheaders.diff
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Add-autotool-based-build-system.patch
+0002-Add-autotool-based-build-system.patch
+0003-minor-cleanups.patch
+0004-Added-libtirpc.patch
+0005-Added-missing-include-for-socklen_t-check.patch
+# e13ee6371916fe5f60ad543ca2daa4b2 - git-ptx-patches magic
diff --git a/patches/localedef-glibc-2.27/0001-HACK-only-build-and-install-localedef.patch b/patches/localedef-glibc-2.37/0001-HACK-only-build-and-install-localedef.patch
index 9ad678c96..8e9f7d679 100644
--- a/patches/localedef-glibc-2.27/0001-HACK-only-build-and-install-localedef.patch
+++ b/patches/localedef-glibc-2.37/0001-HACK-only-build-and-install-localedef.patch
@@ -9,10 +9,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/Rules b/Rules
-index 706c8a749dfb..04f3f333cd06 100644
+index ac9455d6a707..da4e76523d6f 100644
--- a/Rules
+++ b/Rules
-@@ -188,10 +188,16 @@ binaries-shared-notests = $(filter-out $(binaries-pie) $(binaries-static), \
+@@ -224,10 +224,16 @@ binaries-shared-notests = $(filter-out $(binaries-pie) $(binaries-static), \
$(binaries-all-notests))
ifneq "$(strip $(binaries-shared-notests))" ""
@@ -34,10 +34,10 @@ index 706c8a749dfb..04f3f333cd06 100644
ifneq "$(strip $(binaries-shared-tests))" ""
diff --git a/locale/Makefile b/locale/Makefile
-index fd9972279ba7..a8541593295f 100644
+index eb55750496e1..0fe80c31cb36 100644
--- a/locale/Makefile
+++ b/locale/Makefile
-@@ -32,13 +32,13 @@ categories = ctype messages monetary numeric time paper name \
+@@ -33,15 +33,15 @@ categories = ctype messages monetary numeric time paper name \
address telephone measurement identification collate
aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
xlocale localename global-locale coll-lookup
@@ -48,6 +48,8 @@ index fd9972279ba7..a8541593295f 100644
+install-bin = localedef
extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
$(locale-modules:=.o) $(lib-modules:=.o)
+ generated += C-translit.h
+ before-compile += $(objpfx)C-translit.h
-extra-libs = libBrokenLocale
+#extra-libs = libBrokenLocale
diff --git a/patches/localedef-glibc-2.27/0002-Do-not-fail-on-unknown-LC_IDENTIFICATION.category-va.patch b/patches/localedef-glibc-2.37/0002-Do-not-fail-on-unknown-LC_IDENTIFICATION.category-va.patch
index 00f10302b..c5230a63d 100644
--- a/patches/localedef-glibc-2.27/0002-Do-not-fail-on-unknown-LC_IDENTIFICATION.category-va.patch
+++ b/patches/localedef-glibc-2.37/0002-Do-not-fail-on-unknown-LC_IDENTIFICATION.category-va.patch
@@ -14,10 +14,10 @@ Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/locale/programs/ld-identification.c b/locale/programs/ld-identification.c
-index df0257b6c075..aef618c86363 100644
+index 214b47b396b1..74b51aae2b01 100644
--- a/locale/programs/ld-identification.c
+++ b/locale/programs/ld-identification.c
-@@ -194,8 +194,8 @@ No definition for %s category found"), "LC_IDENTIFICATION");
+@@ -193,8 +193,8 @@ No definition for %s category found"), "LC_IDENTIFICATION");
matched = true;
if (matched != true)
diff --git a/patches/localedef-glibc-2.27/series b/patches/localedef-glibc-2.37/series
index 78e9f706b..78e9f706b 100644
--- a/patches/localedef-glibc-2.27/series
+++ b/patches/localedef-glibc-2.37/series
diff --git a/patches/lsh-2.0.4/0001-fix-typo-in-md5-compress.asm.patch b/patches/lsh-2.0.4/0001-fix-typo-in-md5-compress.asm.patch
deleted file mode 100644
index 784b23ff7..000000000
--- a/patches/lsh-2.0.4/0001-fix-typo-in-md5-compress.asm.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Tue, 22 Nov 2011 16:50:31 +0100
-Subject: [PATCH] fix typo in md5-compress.asm
-
-without this building with gcc-4.6 is broken.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/nettle/x86/md5-compress.asm | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/src/nettle/x86/md5-compress.asm b/src/nettle/x86/md5-compress.asm
-index 9664754..e3c51f3 100644
---- a/src/nettle/x86/md5-compress.asm
-+++ b/src/nettle/x86/md5-compress.asm
-@@ -171,4 +171,4 @@ PROLOGUE(_nettle_md5_compress)
- popl %ebp
- popl %ebx
- ret
--EPILOGUE(_nettle_sha1_compress)
-+EPILOGUE(_nettle_md5_compress)
diff --git a/patches/lsh-2.0.4/series b/patches/lsh-2.0.4/series
deleted file mode 100644
index b3a31f466..000000000
--- a/patches/lsh-2.0.4/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-fix-typo-in-md5-compress.asm.patch
-# 877723ef86b38b26af32bf999bbc4c22 - git-ptx-patches magic
diff --git a/patches/lshw-B.02.14/0001-fix-cross-compilation.patch b/patches/lshw-B.02.14/0001-fix-cross-compilation.patch
deleted file mode 100644
index 3e9974d15..000000000
--- a/patches/lshw-B.02.14/0001-fix-cross-compilation.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From cb3fbcd551017645b092743e2b48c27514829196 Mon Sep 17 00:00:00 2001
-From: Remy Bohmer <linux@bohmer.net>
-Date: Sun, 20 Jun 2010 22:48:09 +0200
-Subject: [PATCH 1/2] fix cross-compilation
-
-Signed-off-by: Remy Bohmer <linux@bohmer.net>
-[mkl: improve fix]
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- src/Makefile | 4 ++--
- src/core/Makefile | 6 +++---
- src/gui/Makefile | 6 +++---
- 3 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/src/Makefile b/src/Makefile
-index 93c3ead..ea20184 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -18,8 +18,8 @@ export DATADIR
- CXX?=c++
- INCLUDES=-I./core/
- DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
--CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
--LDFLAGS=-L./core/ -g
-+CXXFLAGS+=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) $(CPPFLAGS)
-+LDFLAGS+=-L./core/ -g
- ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
- LDFLAGS+= -Wl,--as-needed
- endif
-diff --git a/src/core/Makefile b/src/core/Makefile
-index 024b921..b108a6e 100644
---- a/src/core/Makefile
-+++ b/src/core/Makefile
-@@ -1,10 +1,10 @@
- PACKAGENAME?=lshw
-
--CXX=c++
-+CXX?=c++
- INCLUDES=
- DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
--CXXFLAGS=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
--LDFLAGS=
-+CXXFLAGS+=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) $(CPPFLAGS)
-+LDFLAGS+=
- LDSTATIC=
- LIBS=
-
-diff --git a/src/gui/Makefile b/src/gui/Makefile
-index 05fbbfd..d410a1d 100644
---- a/src/gui/Makefile
-+++ b/src/gui/Makefile
-@@ -8,11 +8,11 @@ OBJCOPY?=objcopy
- DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
- GTKINCLUDES=$(shell pkg-config gtk+-2.0 --cflags)
- INCLUDES=-I../core $(GTKINCLUDES)
--CXXFLAGS=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
--CFLAGS=$(CXXFLAGS) $(DEFINES)
-+CXXFLAGS+=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) $(CPPFLAGS)
-+CFLAGS+=$(CXXFLAGS) $(DEFINES)
- GTKLIBS=$(shell pkg-config gtk+-2.0 --libs)
- LIBS=-L../core -llshw -lresolv $(GTKLIBS)
--LDFLAGS=
-+LDFLAGS+=
- ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
- LDFLAGS+= -Wl,--as-needed
- endif
---
-1.7.1
-
diff --git a/patches/lshw-B.02.14/0003-fix-compiling-with-g-4.5.patch b/patches/lshw-B.02.14/0003-fix-compiling-with-g-4.5.patch
deleted file mode 100644
index 903b87dd5..000000000
--- a/patches/lshw-B.02.14/0003-fix-compiling-with-g-4.5.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: unknown author <unknown.author@example.com>
-Date: Mon, 23 Aug 2010 10:45:58 +0200
-Subject: [PATCH] fix compiling with g++ 4.5
-
-g++ 4.5 is stricter and won't compile without this patch.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/core/scsi.cc | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/src/core/scsi.cc b/src/core/scsi.cc
-index ef49677..e72376b 100644
---- a/src/core/scsi.cc
-+++ b/src/core/scsi.cc
-@@ -842,7 +842,7 @@ static bool scan_hosts(hwNode & node)
-
- if (!controller)
- {
-- controller = node.addChild(hwNode::hwNode("scsi", hw::storage));
-+ controller = node.addChild(hwNode("scsi", hw::storage));
- if (controller)
- {
- controller->setLogicalName(host_logicalname(number));
---
-1.7.1
-
diff --git a/patches/lshw-B.02.14/series b/patches/lshw-B.02.14/series
deleted file mode 100644
index c740bfba6..000000000
--- a/patches/lshw-B.02.14/series
+++ /dev/null
@@ -1,3 +0,0 @@
-0001-fix-cross-compilation.patch
-0002-Replace-keyword-node-with-hwnode-for-TinyXpath-compa.patch
-0003-fix-compiling-with-g-4.5.patch
diff --git a/patches/lshw-B.02.14/0002-Replace-keyword-node-with-hwnode-for-TinyXpath-compa.patch b/patches/lshw-B.02.19.2/0001-Replace-keyword-node-with-hwnode-for-TinyXpath-compa.patch
index eb9abb671..b075f7edf 100644
--- a/patches/lshw-B.02.14/0002-Replace-keyword-node-with-hwnode-for-TinyXpath-compa.patch
+++ b/patches/lshw-B.02.19.2/0001-Replace-keyword-node-with-hwnode-for-TinyXpath-compa.patch
@@ -1,7 +1,6 @@
-From 0eea91e31ed90c82acc45c221be689c10e4f779c Mon Sep 17 00:00:00 2001
-From: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
+From: "Bart vdr. Meulen" <bartvdrmeulen@gmail.com>
Date: Sun, 20 Jun 2010 22:48:09 +0200
-Subject: [PATCH 2/2] Replace keyword node with hwnode for TinyXpath compatibility
+Subject: [PATCH] Replace keyword node with hwnode for TinyXpath compatibility
It turns out that within TinyXpath 'node' is a reserved key-word.
Replace it with 'hwnode' when printing to xml.
@@ -9,14 +8,14 @@ Replace it with 'hwnode' when printing to xml.
Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
Signed-off-by: Remy Bohmer <linux@bohmer.net>
---
- src/core/hw.cc | 4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ src/core/hw.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/hw.cc b/src/core/hw.cc
-index 36679d3..367729b 100644
+index 4522c1af0fc3..13c22ac8f44d 100644
--- a/src/core/hw.cc
+++ b/src/core/hw.cc
-@@ -1343,7 +1343,7 @@ string hwNode::asXML(unsigned level)
+@@ -1715,7 +1715,7 @@ string hwNode::asXML(unsigned level)
if(visible(getClassName()))
{
out << spaces(2*level);
@@ -25,7 +24,7 @@ index 36679d3..367729b 100644
if (disabled())
out << " disabled=\"true\"";
if (claimed())
-@@ -1596,7 +1596,7 @@ string hwNode::asXML(unsigned level)
+@@ -2014,7 +2014,7 @@ string hwNode::asXML(unsigned level)
if(visible(getClassName()))
{
out << spaces(2*level);
@@ -33,7 +32,4 @@ index 36679d3..367729b 100644
+ out << "</hwnode>" << endl;
}
- return out.str();
---
-1.7.1
-
+ if((level==0) && ::enabled("output:list"))
diff --git a/patches/lshw-B.02.19.2/series b/patches/lshw-B.02.19.2/series
new file mode 100644
index 000000000..9e84d09a6
--- /dev/null
+++ b/patches/lshw-B.02.19.2/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Replace-keyword-node-with-hwnode-for-TinyXpath-compa.patch
+# 71740a4e0313709445f69ef544501432 - git-ptx-patches magic
diff --git a/patches/lua-5.3.4/0001-Cross-compile-in-ptxdist-envirionment.patch b/patches/lua-5.4.4/0001-Cross-compile-in-ptxdist-envirionment.patch
index 859d18ce1..7b72d7a43 100644
--- a/patches/lua-5.3.4/0001-Cross-compile-in-ptxdist-envirionment.patch
+++ b/patches/lua-5.4.4/0001-Cross-compile-in-ptxdist-envirionment.patch
@@ -9,14 +9,14 @@ Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
-index 119110d2f010..c40c4cd6e0f7 100644
+index fef1af4821e6..3c169540fea4 100644
--- a/Makefile
+++ b/Makefile
@@ -4,13 +4,13 @@
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
--PLAT= none
+-PLAT= guess
+PLAT= linux
# Where to install. The installation starts in the src and doc directories,
@@ -28,16 +28,15 @@ index 119110d2f010..c40c4cd6e0f7 100644
INSTALL_BIN= $(INSTALL_TOP)/bin
INSTALL_INC= $(INSTALL_TOP)/include
INSTALL_LIB= $(INSTALL_TOP)/lib
-@@ -52,7 +52,7 @@ R= $V.4
+@@ -52,13 +52,17 @@ R= $V.4
all: $(PLAT)
- $(PLATS) clean:
-- cd src && $(MAKE) $@
-+ cd src && $(MAKE) $@ R=$R
+ $(PLATS) help test clean:
+- @cd src && $(MAKE) $@
++ @cd src && $(MAKE) $@ R=$R
- test: dummy
- src/lua -v
-@@ -62,6 +62,10 @@ install: dummy
+ install: dummy
+ cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
@@ -49,19 +48,19 @@ index 119110d2f010..c40c4cd6e0f7 100644
uninstall:
diff --git a/src/Makefile b/src/Makefile
-index d71c75c87322..8ad9a1b718ad 100644
+index 1907381fef0a..e53fd31d3383 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,15 +4,13 @@
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
--PLAT= none
+-PLAT= guess
+PLAT= linux
-CC= gcc -std=gnu99
--CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
-+CFLAGS= -std=gnu99 -fPIC -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
+-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)
++CFLAGS= -std=gnu99 -fPIC -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
@@ -69,17 +68,17 @@ index d71c75c87322..8ad9a1b718ad 100644
-RANLIB= ranlib
+ARFLAGS= rcu
RM= rm -f
+ UNAME= uname
- SYSCFLAGS=
-@@ -29,6 +27,7 @@ MYOBJS=
- PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
+@@ -33,6 +31,7 @@ CMCFLAGS=
+ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so.$R
- CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
- lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
- ltm.o lundump.o lvm.o lzio.o
-@@ -43,8 +42,8 @@ LUAC_T= luac
+ CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
+ LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
+ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+@@ -44,8 +43,8 @@ LUAC_T= luac
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
@@ -90,7 +89,7 @@ index d71c75c87322..8ad9a1b718ad 100644
# Targets start here.
default: $(PLAT)
-@@ -56,9 +55,12 @@ o: $(ALL_O)
+@@ -57,9 +56,12 @@ o: $(ALL_O)
a: $(ALL_A)
$(LUA_A): $(BASE_O)
diff --git a/patches/lua-5.3.4/0002-Install-pkgconfig-file.patch b/patches/lua-5.4.4/0002-Install-pkgconfig-file.patch
index ca02e3804..a3bbad59e 100644
--- a/patches/lua-5.3.4/0002-Install-pkgconfig-file.patch
+++ b/patches/lua-5.4.4/0002-Install-pkgconfig-file.patch
@@ -10,12 +10,12 @@ Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
create mode 100644 lua.pc.in
diff --git a/Makefile b/Makefile
-index c40c4cd6e0f7..179246813af2 100644
+index 3c169540fea4..cf428cedcff4 100644
--- a/Makefile
+++ b/Makefile
-@@ -57,8 +57,8 @@ $(PLATS) clean:
- test: dummy
- src/lua -v
+@@ -54,8 +54,8 @@ all: $(PLAT)
+ $(PLATS) help test clean:
+ @cd src && $(MAKE) $@ R=$R
-install: dummy
- cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
@@ -24,7 +24,7 @@ index c40c4cd6e0f7..179246813af2 100644
cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
-@@ -66,6 +66,7 @@ install: dummy
+@@ -63,6 +63,7 @@ install: dummy
ln -s liblua.so.$R $(INSTALL_LIB)/liblua.so.$V
ln -s liblua.so.$R $(INSTALL_LIB)/liblua.so.$(basename $V)
ln -s liblua.so.$V $(INSTALL_LIB)/liblua.so
@@ -32,15 +32,15 @@ index c40c4cd6e0f7..179246813af2 100644
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
uninstall:
-@@ -112,6 +113,9 @@ pc:
+@@ -104,6 +105,9 @@ pc:
@echo "libdir=$(INSTALL_LIB)"
@echo "includedir=$(INSTALL_INC)"
+lua.pc: lua.pc.in
+ sed -e "s/@VERSION@/$R/g" $< > $@
+
- # list targets that do not create files (but not all makes understand .PHONY)
- .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
+ # Targets that do not create files (not all makes understand .PHONY).
+ .PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc
diff --git a/lua.pc.in b/lua.pc.in
new file mode 100644
diff --git a/patches/lua-5.3.4/series b/patches/lua-5.4.4/series
index 8d0a79399..8d0a79399 100644
--- a/patches/lua-5.3.4/series
+++ b/patches/lua-5.4.4/series
diff --git a/patches/lxml-4.4.2/0001-do-not-use-libdirs-from-xslt-config.patch b/patches/lxml-4.4.2/0001-do-not-use-libdirs-from-xslt-config.patch
deleted file mode 100644
index c0cea0f16..000000000
--- a/patches/lxml-4.4.2/0001-do-not-use-libdirs-from-xslt-config.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From d20f79d5e0d04a243f8bda8ef49e59f8d3afaf9c Mon Sep 17 00:00:00 2001
-From: Artur Wiebe <artur@4wiebe.de>
-Date: Thu, 30 Aug 2018 10:46:22 +0200
-Subject: [PATCH] do not use libdirs from xslt-config
-
----
- setupinfo.py | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/setupinfo.py b/setupinfo.py
-index bdac1d0..87feac7 100644
---- a/setupinfo.py
-+++ b/setupinfo.py
-@@ -292,10 +292,10 @@ def library_dirs(static_library_dirs):
- return static_library_dirs
- # filter them from xslt-config --libs
- result = []
-- possible_library_dirs = flags('libs')
-- for possible_library_dir in possible_library_dirs:
-- if possible_library_dir.startswith('-L'):
-- result.append(possible_library_dir[2:])
-+# possible_library_dirs = flags('libs')
-+# for possible_library_dir in possible_library_dirs:
-+# if possible_library_dir.startswith('-L'):
-+# result.append(possible_library_dir[2:])
- return result
-
- def include_dirs(static_include_dirs):
---
-2.18.0
-
diff --git a/patches/lxml-4.4.2/series b/patches/lxml-4.4.2/series
deleted file mode 100644
index 13f153f5b..000000000
--- a/patches/lxml-4.4.2/series
+++ /dev/null
@@ -1 +0,0 @@
-0001-do-not-use-libdirs-from-xslt-config.patch
diff --git a/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch b/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
deleted file mode 100644
index 00b99fdd9..000000000
--- a/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Thu, 8 Mar 2018 16:42:45 2018 -0800
-Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
-
-Problem reported by Daniel P. Berrangé in:
-https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
-* lib/fbufmode.c (fbufmode):
-* lib/fflush.c (clear_ungetc_buffer_preserving_position)
-(disable_seek_optimization, rpl_fflush):
-* lib/fpending.c (__fpending):
-* lib/fpurge.c (fpurge):
-* lib/freadable.c (freadable):
-* lib/freadahead.c (freadahead):
-* lib/freading.c (freading):
-* lib/freadptr.c (freadptr):
-* lib/freadseek.c (freadptrinc):
-* lib/fseeko.c (fseeko):
-* lib/fseterr.c (fseterr):
-* lib/fwritable.c (fwritable):
-* lib/fwriting.c (fwriting):
-Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
-* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
-Define if not already defined.
-
-manual backport of of4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
-
-Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
----
- lib/fflush.c | 6 +++---
- lib/fpending.c | 2 +-
- lib/fpurge.c | 2 +-
- lib/freadahead.c | 2 +-
- lib/freading.c | 2 +-
- lib/fseeko.c | 4 ++--
- lib/stdio-impl.h | 6 ++++++
- 7 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/lib/fflush.c b/lib/fflush.c
-index ef2a7f1237ee..787790d09031 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
-
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
-
- #endif
-
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
- if (stream == NULL || ! freading (stream))
- return fflush (stream);
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-
- clear_ungetc_buffer_preserving_position (stream);
-
-diff --git a/lib/fpending.c b/lib/fpending.c
-index ce93604e518f..9fe7ffb2f615 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
-diff --git a/lib/fpurge.c b/lib/fpurge.c
-index 53ee68c37efc..7cba3a37bef2 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_IO_read_end = fp->_IO_read_ptr;
- fp->_IO_write_ptr = fp->_IO_write_base;
- /* Avoid memory leak when there is an active ungetc buffer. */
-diff --git a/lib/freadahead.c b/lib/freadahead.c
-index cfc969b4cffd..5e43e13af727 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -25,7 +25,7 @@
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- if (fp->_IO_write_ptr > fp->_IO_write_base)
- return 0;
- return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/lib/freading.c
-index 05cb0b80999d..f1da5b958b5e 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- return ((fp->_flags & _IO_NO_WRITES) != 0
- || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
- && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/lib/fseeko.c
-index 0c01c4fd08c1..0601619d80a2 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
-
- /* These tests are based on fpurge.c. */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- if (fp->_IO_read_end == fp->_IO_read_ptr
- && fp->_IO_write_ptr == fp->_IO_write_base
- && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- return -1;
- }
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_flags &= ~_IO_EOF_SEEN;
- fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
-index 766d6936590f..75fe3ade4237 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
- the same implementation of stdio extension API, except that some fields
- have different naming conventions, or their access requires some casts. */
-
-+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
-+ problem by defining it ourselves. FIXME: Do not rely on glibc
-+ internals. */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
-
- /* BSD stdio derived implementations. */
-
diff --git a/patches/m4-1.4.18/series b/patches/m4-1.4.18/series
deleted file mode 100644
index c9993f086..000000000
--- a/patches/m4-1.4.18/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
-# b03bed9248af170f04892265a5918d5b - git-ptx-patches magic
diff --git a/patches/meson-0.56.0/0001-pkgconfig-Respect-variable-ordering-when-passed-as-l.patch b/patches/meson-0.56.0/0001-pkgconfig-Respect-variable-ordering-when-passed-as-l.patch
deleted file mode 100644
index 086ec0d81..000000000
--- a/patches/meson-0.56.0/0001-pkgconfig-Respect-variable-ordering-when-passed-as-l.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Xavier Claessens <xavier.claessens@collabora.com>
-Date: Mon, 7 Dec 2020 11:40:20 -0500
-Subject: [PATCH] pkgconfig: Respect variable ordering when passed as list
-
-This fix a regression introduced in Meson 0.56.0 when using python 3.5.
-Also mention in documentation that using a meson dict does not guarantee
-ordering.
-
-Fixes: #8074.
----
- mesonbuild/interpreter.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
-index 6222f97a71d8..b0cbecc75114 100644
---- a/mesonbuild/interpreter.py
-+++ b/mesonbuild/interpreter.py
-@@ -2690,7 +2690,7 @@ class Interpreter(InterpreterBase):
- varlist = mesonlib.stringlistify(variables)
- if list_new:
- FeatureNew.single_use('variables as list of strings', '0.56.0', self.subproject)
-- variables = {}
-+ variables = collections.OrderedDict()
- for v in varlist:
- try:
- (key, value) = v.split('=', 1)
diff --git a/patches/meson-0.56.0/0101-HACK-enable-NEON-only-for-ARMv7.patch b/patches/meson-0.56.0/0101-HACK-enable-NEON-only-for-ARMv7.patch
deleted file mode 100644
index f6f0dc448..000000000
--- a/patches/meson-0.56.0/0101-HACK-enable-NEON-only-for-ARMv7.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Tue, 1 Oct 2019 22:30:59 +0200
-Subject: [PATCH] HACK: enable NEON only for ARMv7
-
-NEON detection is broken, so just skip it for anything that is not ARMv7.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- mesonbuild/modules/unstable_simd.py | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/mesonbuild/modules/unstable_simd.py b/mesonbuild/modules/unstable_simd.py
-index 4c066fb91339..e4b1824a7087 100644
---- a/mesonbuild/modules/unstable_simd.py
-+++ b/mesonbuild/modules/unstable_simd.py
-@@ -62,6 +62,9 @@ class SimdModule(ExtensionModule):
- continue
- iset_fname = kwargs[iset] # Might also be an array or Files. static_library will validate.
- args = compiler.get_instruction_set_args(iset)
-+ cpu = state.environment.machines.host.cpu
-+ if iset == 'neon' and not cpu.startswith('armv7'):
-+ args = None
- if args is None:
- mlog.log('Compiler supports %s:' % iset, mlog.red('NO'))
- continue
diff --git a/patches/meson-0.56.0/series b/patches/meson-0.56.0/series
deleted file mode 100644
index 10eaa5573..000000000
--- a/patches/meson-0.56.0/series
+++ /dev/null
@@ -1,7 +0,0 @@
-# generated by git-ptx-patches
-#tag:upstream --start-number 1
-0001-pkgconfig-Respect-variable-ordering-when-passed-as-l.patch
-#tag:ptxdist --start-number 100
-0100-don-t-add-rpaths-for-build-directories-when-cross-co.patch
-0101-HACK-enable-NEON-only-for-ARMv7.patch
-# a15bcb28786933dffabce202768a0e86 - git-ptx-patches magic
diff --git a/patches/meson-0.56.0/0100-don-t-add-rpaths-for-build-directories-when-cross-co.patch b/patches/meson-1.3.0/0001-don-t-add-rpaths-for-build-directories-when-cross-co.patch
index ccf5bfc2f..6a4772ac5 100644
--- a/patches/meson-0.56.0/0100-don-t-add-rpaths-for-build-directories-when-cross-co.patch
+++ b/patches/meson-1.3.0/0001-don-t-add-rpaths-for-build-directories-when-cross-co.patch
@@ -7,14 +7,14 @@ size unnecessarily.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- mesonbuild/linkers.py | 8 ++++++--
+ mesonbuild/linkers/linkers.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
-diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py
-index 589945c511ff..59463bdfdcc5 100644
---- a/mesonbuild/linkers.py
-+++ b/mesonbuild/linkers.py
-@@ -605,7 +605,10 @@ class GnuLikeDynamicLinkerMixin:
+diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
+index dbb5e57aa585..3d321cc24413 100644
+--- a/mesonbuild/linkers/linkers.py
++++ b/mesonbuild/linkers/linkers.py
+@@ -684,7 +684,10 @@ class GnuLikeDynamicLinkerMixin(DynamicLinkerBase):
# Need to deduplicate rpaths, as macOS's install_name_tool
# is *very* allergic to duplicate -delete_rpath arguments
# when calling depfixer on installation.
@@ -23,10 +23,10 @@ index 589945c511ff..59463bdfdcc5 100644
+ all_paths = mesonlib.OrderedSet([os.path.join(origin_placeholder, p) for p in processed_rpaths])
+ else:
+ all_paths = mesonlib.OrderedSet()
- rpath_dirs_to_remove = set()
+ rpath_dirs_to_remove: T.Set[bytes] = set()
for p in all_paths:
rpath_dirs_to_remove.add(p.encode('utf8'))
-@@ -633,7 +636,8 @@ class GnuLikeDynamicLinkerMixin:
+@@ -712,7 +715,8 @@ class GnuLikeDynamicLinkerMixin(DynamicLinkerBase):
paths = padding
else:
paths = paths + ':' + padding
diff --git a/patches/meson-1.3.0/0002-HACK-enable-NEON-only-for-ARMv7.patch b/patches/meson-1.3.0/0002-HACK-enable-NEON-only-for-ARMv7.patch
new file mode 100644
index 000000000..7be876034
--- /dev/null
+++ b/patches/meson-1.3.0/0002-HACK-enable-NEON-only-for-ARMv7.patch
@@ -0,0 +1,25 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 1 Oct 2019 22:30:59 +0200
+Subject: [PATCH] HACK: enable NEON only for ARMv7
+
+NEON detection is broken, so just skip it for anything that is not ARMv7.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ mesonbuild/modules/simd.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/mesonbuild/modules/simd.py b/mesonbuild/modules/simd.py
+index b8baf39ef34a..2ce09b20d2f9 100644
+--- a/mesonbuild/modules/simd.py
++++ b/mesonbuild/modules/simd.py
+@@ -94,6 +94,9 @@ class SimdModule(ExtensionModule):
+ continue
+
+ compile_args = compiler.get_instruction_set_args(iset)
++ cpu = state.environment.machines.host.cpu
++ if iset == 'neon' and not cpu.startswith('armv7'):
++ compile_args = None
+ if compile_args is None:
+ mlog.log(f'Compiler supports {iset}:', mlog.red('NO'))
+ continue
diff --git a/patches/meson-1.3.0/0003-HACK-don-t-fail-if-lrelease-is-missing.patch b/patches/meson-1.3.0/0003-HACK-don-t-fail-if-lrelease-is-missing.patch
new file mode 100644
index 000000000..28e6b9084
--- /dev/null
+++ b/patches/meson-1.3.0/0003-HACK-don-t-fail-if-lrelease-is-missing.patch
@@ -0,0 +1,26 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Wed, 7 Jun 2023 11:42:46 +0200
+Subject: [PATCH] HACK: don't fail if lrelease is missing
+
+PTXdist does not currently build lrelease for Qt6 so this is always
+missing. It's not needed in most cases, so just ignore it.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ mesonbuild/modules/qt.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
+index 83dcf31bdfb3..b3242ceaf167 100644
+--- a/mesonbuild/modules/qt.py
++++ b/mesonbuild/modules/qt.py
+@@ -278,6 +278,9 @@ class QtBaseModule(ExtensionModule):
+ self._detect_tools(state, method, required=False)
+ for tool in self.tools.values():
+ if not tool.found():
++ if tool.name == 'lrelease':
++ mlog.warning('Ignoring missing lrelease')
++ continue
+ if required:
+ raise MesonException('Qt tools not found')
+ return False
diff --git a/patches/meson-1.3.0/0004-HACK-don-t-fail-if-uic-is-missing.patch b/patches/meson-1.3.0/0004-HACK-don-t-fail-if-uic-is-missing.patch
new file mode 100644
index 000000000..c404d3149
--- /dev/null
+++ b/patches/meson-1.3.0/0004-HACK-don-t-fail-if-uic-is-missing.patch
@@ -0,0 +1,29 @@
+From: Michael Tretter <m.tretter@pengutronix.de>
+Date: Tue, 12 Mar 2024 18:22:06 +0100
+Subject: [PATCH] HACK: don't fail if uic is missing
+
+Qt5 builds the uic only if Widgets are enabled. The uic is not required
+for applications that don't use Widgets, but is required as standard
+tool by meson.
+
+Ignore uic if it is not found.
+
+Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
+---
+ mesonbuild/modules/qt.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
+index b3242ceaf167..26b5dbc9fc0d 100644
+--- a/mesonbuild/modules/qt.py
++++ b/mesonbuild/modules/qt.py
+@@ -281,6 +281,9 @@ class QtBaseModule(ExtensionModule):
+ if tool.name == 'lrelease':
+ mlog.warning('Ignoring missing lrelease')
+ continue
++ if tool.name == 'uic':
++ mlog.warning('Ignoring missing uic')
++ continue
+ if required:
+ raise MesonException('Qt tools not found')
+ return False
diff --git a/patches/meson-1.3.0/series b/patches/meson-1.3.0/series
new file mode 100644
index 000000000..3bba04f5b
--- /dev/null
+++ b/patches/meson-1.3.0/series
@@ -0,0 +1,7 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-don-t-add-rpaths-for-build-directories-when-cross-co.patch
+0002-HACK-enable-NEON-only-for-ARMv7.patch
+0003-HACK-don-t-fail-if-lrelease-is-missing.patch
+0004-HACK-don-t-fail-if-uic-is-missing.patch
+# 344e721ffeeec9faa5876797156d7064 - git-ptx-patches magic
diff --git a/patches/mgetty-1.1.36/0001-fix-install.patch b/patches/mgetty-1.1.36/0001-fix-install.patch
deleted file mode 100644
index 774b3ac4c..000000000
--- a/patches/mgetty-1.1.36/0001-fix-install.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 15 Jan 2017 12:02:05 +0100
-Subject: [PATCH] fix install
-
-prefix all paths with DESTDIR when installing.
-install all necessary stuff
-don't chown dirs
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- Makefile | 77 +++++++++++++++++++++++++++++--------------------------
- callback/Makefile | 4 +--
- fax/Makefile | 25 +++++++++---------
- g3/Makefile | 4 +--
- 4 files changed, 57 insertions(+), 53 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 97ea1986dce9..401ae6e4b37b 100644
---- a/Makefile
-+++ b/Makefile
-@@ -580,56 +580,54 @@ install.bin: mgetty sendfax newslock \
- #
- # binaries
- #
-- -test -d $(BINDIR) || ( ./mkidirs $(BINDIR) ; chmod 755 $(BINDIR) )
-- $(INSTALL) -m 755 newslock $(BINDIR)
-+ -test -d $(DESTDIR)$(BINDIR) || ( ./mkidirs $(DESTDIR)$(BINDIR) ; chmod 755 $(DESTDIR)$(BINDIR) )
-+ $(INSTALL) -m 755 newslock $(DESTDIR)$(BINDIR)
-
-- -test -d $(SBINDIR) || ( ./mkidirs $(SBINDIR) ; chmod 755 $(SBINDIR) )
-- -mv -f $(SBINDIR)/mgetty $(SBINDIR)/mgetty.old
-- -mv -f $(SBINDIR)/sendfax $(SBINDIR)/sendfax.old
-- $(INSTALL) -s -m 700 mgetty $(SBINDIR)
-- $(INSTALL) -s -m 755 sendfax $(SBINDIR)
-+ -test -d $(DESTDIR)$(SBINDIR) || ( ./mkidirs $(DESTDIR)$(SBINDIR) ; chmod 755 $(DESTDIR)$(SBINDIR) )
-+ -mv -f $(DESTDIR)$(SBINDIR)/mgetty $(DESTDIR)$(SBINDIR)/mgetty.old
-+ -mv -f $(DESTDIR)$(SBINDIR)/sendfax $(DESTDIR)$(SBINDIR)/sendfax.old
-+ $(INSTALL) -s -m 700 mgetty $(DESTDIR)$(SBINDIR)
-+ $(INSTALL) -s -m 755 sendfax $(DESTDIR)$(SBINDIR)
- #
- # data files + directories
- #
-- test -d $(LIBDIR) || \
-- ( ./mkidirs $(LIBDIR) && chmod 755 $(LIBDIR) )
-- test -d $(CONFDIR) || \
-- ( ./mkidirs $(CONFDIR) && chmod 755 $(CONFDIR))
-- test -f $(CONFDIR)/login.config || \
-- $(INSTALL) -o root -m 600 login.config $(CONFDIR)/
-- test -f $(CONFDIR)/mgetty.config || \
-- $(INSTALL) -o root -m 600 mgetty.config $(CONFDIR)/
-- test -f $(CONFDIR)/sendfax.config || \
-- $(INSTALL) -o root -m 644 sendfax.config $(CONFDIR)/
-- test -f $(CONFDIR)/dialin.config || \
-- $(INSTALL) -o root -m 600 dialin.config $(CONFDIR)/
-- test -f $(CONFDIR)/faxrunq.config || \
-- $(INSTALL) -o root -m 644 faxrunq.config $(CONFDIR)/
-+ test -d $(DESTDIR)$(LIBDIR) || \
-+ ( ./mkidirs $(DESTDIR)$(LIBDIR) && chmod 755 $(DESTDIR)$(LIBDIR) )
-+ test -d $(DESTDIR)$(CONFDIR) || \
-+ ( ./mkidirs $(DESTDIR)$(CONFDIR) && chmod 755 $(DESTDIR)$(CONFDIR))
-+ test -f $(DESTDIR)$(CONFDIR)/login.config || \
-+ $(INSTALL) -o root -m 600 login.config $(DESTDIR)$(CONFDIR)/
-+ test -f $(DESTDIR)$(CONFDIR)/mgetty.config || \
-+ $(INSTALL) -o root -m 600 mgetty.config $(DESTDIR)$(CONFDIR)/
-+ test -f $(DESTDIR)$(CONFDIR)/sendfax.config || \
-+ $(INSTALL) -o root -m 644 sendfax.config $(DESTDIR)$(CONFDIR)/
-+ test -f $(DESTDIR)$(CONFDIR)/dialin.config || \
-+ $(INSTALL) -o root -m 600 dialin.config $(DESTDIR)$(CONFDIR)/
-+ test -f $(DESTDIR)$(CONFDIR)/faxrunq.config || \
-+ $(INSTALL) -o root -m 644 faxrunq.config $(DESTDIR)$(CONFDIR)/
- #
- # test for outdated stuff
- #
-- -@if test -f $(LIBDIR)/mgetty.login ; \
-+ -@if test -f $(DESTDIR)$(LIBDIR)/mgetty.login ; \
- then \
-- echo "WARNING: the format of $(LIBDIR)/mgetty.login has " ;\
-+ echo "WARNING: the format of $(DESTDIR)$(LIBDIR)/mgetty.login has " ;\
- echo "been changed. Because of this, to avoid confusions, it's called " ;\
-- echo "$(CONFDIR)/login.config now." ;\
-+ echo "$(DESTDIR)$(CONFDIR)/login.config now." ;\
- echo "" ;\
- fi
- #
- # fax spool directories
- #
-- test -d $(spool) || \
-- ( mkdir $(spool) && chmod 755 $(spool) )
-- test -d $(FAX_SPOOL) || \
-- ( mkdir $(FAX_SPOOL) && \
-- chown $(FAX_OUT_USER) $(FAX_SPOOL) && \
-- chmod 755 $(FAX_SPOOL) )
-- test -d $(FAX_SPOOL_IN) || \
-- ( mkdir $(FAX_SPOOL_IN) && chmod 755 $(FAX_SPOOL_IN) )
-- test -d $(FAX_SPOOL_OUT) || \
-- mkdir $(FAX_SPOOL_OUT)
-- chown $(FAX_OUT_USER) $(FAX_SPOOL_OUT)
-- chmod 755 $(FAX_SPOOL_OUT)
-+ test -d $(DESTDIR)$(spool) || \
-+ ( ./mkidirs $(DESTDIR)$(spool) && chmod 755 $(DESTDIR)$(spool) )
-+ test -d $(DESTDIR)$(FAX_SPOOL) || \
-+ ( ./mkidirs $(DESTDIR)$(FAX_SPOOL) && \
-+ chmod 755 $(DESTDIR)$(FAX_SPOOL) )
-+ test -d $(DESTDIR)$(FAX_SPOOL_IN) || \
-+ ( ./mkidirs $(DESTDIR)$(FAX_SPOOL_IN) && chmod 755 $(DESTDIR)$(FAX_SPOOL_IN) )
-+ test -d $(DESTDIR)$(FAX_SPOOL_OUT) || \
-+ ./mkidirs $(DESTDIR)$(FAX_SPOOL_OUT)
-+ chmod 755 $(DESTDIR)$(FAX_SPOOL_OUT)
- #
- # g3 tool programs
- #
-@@ -644,6 +642,13 @@ install.bin: mgetty sendfax newslock \
- BINDIR=$(BINDIR) SBINDIR=$(SBINDIR) \
- LIBDIR=$(LIBDIR) CONFDIR=$(CONFDIR)
- #
-+# callback
-+#
-+ cd callback ; $(MAKE) install INSTALL="$(INSTALL)" \
-+ FAX_OUT_USER=$(FAX_OUT_USER) \
-+ BINDIR=$(BINDIR) SBINDIR=$(SBINDIR) \
-+ LIBDIR=$(LIBDIR) CONFDIR=$(CONFDIR)
-+#
- # compatibility
- #
- if [ ! -z "$(INSTALL_MECHO)" ] ; then \
-diff --git a/callback/Makefile b/callback/Makefile
-index 061e63a9f966..577e0dfa6fe2 100644
---- a/callback/Makefile
-+++ b/callback/Makefile
-@@ -37,7 +37,7 @@ clean:
- # install programs
- #
- install: all
-- $(INSTALL) -s -m 700 -o root callback $(SBINDIR)
-- $(INSTALL) -s -m 4711 -o root ct $(BINDIR)
-+ $(INSTALL) -s -m 700 -o root callback $(DESTDIR)$(SBINDIR)
-+ $(INSTALL) -s -m 4711 -o root ct $(DESTDIR)$(BINDIR)
-
- # source modules
-diff --git a/fax/Makefile b/fax/Makefile
-index 89ceccb611f8..6438c0f8461c 100644
---- a/fax/Makefile
-+++ b/fax/Makefile
-@@ -53,25 +53,24 @@ install: all
- # programs / scripts
- #
- -for i in $(FAX_SCRIPTS); do \
-- mv -f $(BINDIR)/$$i $(BINDIR)/$$i.old 2>/dev/null ; \
-- $(INSTALL) -m 755 $$i $(BINDIR) ; \
-+ mv -f $(DESTDIR)$(BINDIR)/$$i $(DESTDIR)$(BINDIR)/$$i.old 2>/dev/null ; \
-+ $(INSTALL) -m 755 $$i $(DESTDIR)$(BINDIR) ; \
- done
-- $(INSTALL) -m 755 faxrunqd $(SBINDIR)
-- $(INSTALL) faxq-helper $(LIBDIR)
-- chown $(FAX_OUT_USER) $(LIBDIR)/faxq-helper
-- chmod 4711 $(LIBDIR)/faxq-helper
-+ $(INSTALL) -m 755 faxrunqd $(DESTDIR)$(SBINDIR)
-+ $(INSTALL) faxq-helper $(DESTDIR)$(LIBDIR)
-+ chmod 4711 $(DESTDIR)$(LIBDIR)/faxq-helper
- #
- # data files
- #
-- $(INSTALL) -m 644 cour25.pbm $(LIBDIR)
-- $(INSTALL) -m 644 cour25n.pbm $(LIBDIR)
-- -test -f $(CONFDIR)/faxheader || \
-- $(INSTALL) -m 644 faxheader $(CONFDIR)
-+ $(INSTALL) -m 644 cour25.pbm $(DESTDIR)$(LIBDIR)
-+ $(INSTALL) -m 644 cour25n.pbm $(DESTDIR)$(LIBDIR)
-+ -test -f $(DESTDIR)$(CONFDIR)/faxheader || \
-+ $(INSTALL) -m 644 faxheader $(DESTDIR)$(CONFDIR)
- #
- # /etc/magic
- #
-- -@test -r /etc/magic && \
-- if grep "string.*P1" /etc/magic >/dev/null ; then : ; \
-+ -@test -r $(DESTDIR)/etc/magic && \
-+ if grep "string.*P1" $(DESTDIR)/etc/magic >/dev/null ; then : ; \
- else \
- echo "WARNING: no PBM magic (string P1) found in /etc/magic" ; \
- echo " maybe you should append the definitions in \`\`fax/etc-magic''." ; \
-@@ -79,4 +78,4 @@ install: all
- #
- # faxspool.rules sample file
- #
-- $(INSTALL) -m 644 faxspool.rules $(CONFDIR)/faxspool.rules.sample
-+ $(INSTALL) -m 644 faxspool.rules $(DESTDIR)$(CONFDIR)/faxspool.rules.sample
-diff --git a/g3/Makefile b/g3/Makefile
-index 33082e1e9692..70e2f57cd534 100644
---- a/g3/Makefile
-+++ b/g3/Makefile
-@@ -37,12 +37,12 @@ install: all
- # install programs
- #
- for f in $(G3_PROGRAMS) ; do \
-- $(INSTALL) -s -m 755 $$f $(BINDIR) ; \
-+ $(INSTALL) -s -m 755 $$f $(DESTDIR)$(BINDIR) ; \
- done
- #
- # make symlink for "g3topbm" (so third-party fax viewers won't fail)
- #
-- -cd $(BINDIR) ; \
-+ -cd $(DESTDIR)$(BINDIR) ; \
- test -x g3topbm || ln -s g32pbm g3topbm
-
-
diff --git a/patches/mgetty-1.1.36/0002-fix-building-on-arm64.patch b/patches/mgetty-1.1.36/0002-fix-building-on-arm64.patch
deleted file mode 100644
index cd91ebee9..000000000
--- a/patches/mgetty-1.1.36/0002-fix-building-on-arm64.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 15 Jan 2017 12:06:11 +0100
-Subject: [PATCH] fix building on arm64
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- mgetty.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mgetty.h b/mgetty.h
-index 14845207421a..811e5519d1b4 100644
---- a/mgetty.h
-+++ b/mgetty.h
-@@ -198,7 +198,7 @@ typedef unsigned char uch;
- */
- #if defined(__alpha__) || defined(__sparc64__) || \
- defined(__ia64__) || defined(__s390x__) || defined(__x86_64__) || \
-- defined(__powerpc64__)
-+ defined(__powerpc64__) || defined(__aarch64__)
- # define PTR_IS_LONG
- #endif
-
diff --git a/patches/mgetty-1.1.36/0003-fix-building-with-gcc-7.x.patch b/patches/mgetty-1.1.36/0003-fix-building-with-gcc-7.x.patch
deleted file mode 100644
index 7783883b6..000000000
--- a/patches/mgetty-1.1.36/0003-fix-building-with-gcc-7.x.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From: Hilko Bengen <bengen@debian.org>
-Date: Wed, 7 Feb 2018 10:59:18 +0100
-Subject: [PATCH] fix building with gcc 7.x
-
-make some functions static
-
-Patch imported from Debian.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- g3/g3cat.c | 3 +++
- g3/pbm2g3.c | 4 ++++
- 2 files changed, 7 insertions(+)
-
-diff --git a/g3/g3cat.c b/g3/g3cat.c
-index 8a4b708afa7e..4205d332cde7 100644
---- a/g3/g3cat.c
-+++ b/g3/g3cat.c
-@@ -67,6 +67,7 @@ void putcode _P2( (code, len), int code, int len )
- }
-
- #ifdef __GNUC__
-+static
- inline
- #endif
- void putwhitespan _P1( (l), int l )
-@@ -98,6 +99,7 @@ void putwhitespan _P1( (l), int l )
- }
-
- #ifdef __GNUC__
-+static
- inline
- #endif
- void putblackspan _P1( (l), int l )
-@@ -129,6 +131,7 @@ void putblackspan _P1( (l), int l )
- }
-
- #ifdef __GNUC__
-+static
- inline
- #endif
- void puteol _P0( void ) /* write byte-aligned EOL */
-diff --git a/g3/pbm2g3.c b/g3/pbm2g3.c
-index 283a72867312..7dc81a808bfc 100644
---- a/g3/pbm2g3.c
-+++ b/g3/pbm2g3.c
-@@ -40,6 +40,7 @@ static unsigned int out_hibit = 0;
- static int out_byte_tab[ 256 ]; /* for g3 byte reversal */
-
- #ifdef __GNUC__
-+static
- inline
- #endif
- void putcode _P2( (code, len), int code, int len )
-@@ -60,6 +61,7 @@ void putcode _P2( (code, len), int code, int len )
- }
-
- #ifdef __GNUC__
-+static
- inline
- #endif
- void puteol _P0( void ) /* write byte-aligned EOL */
-@@ -69,6 +71,7 @@ void puteol _P0( void ) /* write byte-aligned EOL */
- }
-
- #ifdef __GNUC__
-+static
- inline
- #endif
- void putwhitespan _P1( (l), int l )
-@@ -100,6 +103,7 @@ void putwhitespan _P1( (l), int l )
- }
-
- #ifdef __GNUC__
-+static
- inline
- #endif
- void putblackspan _P1( (l), int l )
diff --git a/patches/mgetty-1.1.36/series b/patches/mgetty-1.1.36/series
deleted file mode 100644
index a518c09ac..000000000
--- a/patches/mgetty-1.1.36/series
+++ /dev/null
@@ -1,6 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-fix-install.patch
-0002-fix-building-on-arm64.patch
-0003-fix-building-with-gcc-7.x.patch
-# 96cac79d77bdaba764aa0a1ae734b06b - git-ptx-patches magic
diff --git a/patches/minicom-2.8/0002-lib-usleep.c-fix-error-NULL-undeclared.patch b/patches/minicom-2.8/0002-lib-usleep.c-fix-error-NULL-undeclared.patch
deleted file mode 100644
index 79e414295..000000000
--- a/patches/minicom-2.8/0002-lib-usleep.c-fix-error-NULL-undeclared.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Roland Hieber <rhi@pengutronix.de>
-Date: Mon, 24 May 2021 22:52:00 +0200
-Subject: [PATCH] lib/usleep.c: fix error: 'NULL' undeclared
-
-This fixes compilation with GCC 11:
-
- usleep.c: In function 'usleep':
- usleep.c:14:12: error: 'NULL' undeclared (first use in this function)
- usleep.c:14:12: note: 'NULL' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
- usleep.c:14:12: note: each undeclared identifier is reported only once for each function it appears in
- make[2]: *** [Makefile:365: usleep.o] Error 1
----
- lib/usleep.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/lib/usleep.c b/lib/usleep.c
-index af9dd0326024..861c00ad97d1 100644
---- a/lib/usleep.c
-+++ b/lib/usleep.c
-@@ -2,6 +2,7 @@
- # include <config.h>
- #endif
-
-+#include <stddef.h>
- #include <sys/time.h>
- #include <sys/select.h>
-
diff --git a/patches/minicom-2.8/series b/patches/minicom-2.8/series
deleted file mode 100644
index 259f67ccf..000000000
--- a/patches/minicom-2.8/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-build-reproducibly.patch
-0002-lib-usleep.c-fix-error-NULL-undeclared.patch
-# beb4273308afd0935d7b8b27ba4f2497 - git-ptx-patches magic
diff --git a/patches/minicom-2.8/0001-build-reproducibly.patch b/patches/minicom-2.9/0001-build-reproducibly.patch
index 2d48c129a..ba445171e 100644
--- a/patches/minicom-2.8/0001-build-reproducibly.patch
+++ b/patches/minicom-2.9/0001-build-reproducibly.patch
@@ -8,10 +8,10 @@ Origin: Debian, https://sources.debian.org/patches/minicom/2.8-1/04reproducible.
1 file changed, 6 deletions(-)
diff --git a/src/minicom.c b/src/minicom.c
-index cfdb76396968..bf3ad17ca089 100644
+index c9ce75c223be..8a006a3e039f 100644
--- a/src/minicom.c
+++ b/src/minicom.c
-@@ -1248,9 +1248,6 @@ int main(int argc, char **argv)
+@@ -1323,9 +1323,6 @@ int main(int argc, char **argv)
switch(c) {
case 'v':
printf(_("%s version %s"), PACKAGE, VERSION);
@@ -21,7 +21,7 @@ index cfdb76396968..bf3ad17ca089 100644
printf("\n");
printf(_("Copyright (C) Miquel van Smoorenburg.\n\n"));
printf(_("This program is free software; you can redistribute it and/or\n"
-@@ -1580,9 +1577,6 @@ int main(int argc, char **argv)
+@@ -1659,9 +1656,6 @@ int main(int argc, char **argv)
mc_wprintf(us, "\n%s %s\r\n", _("Welcome to minicom"), VERSION);
mc_wprintf(us, "\n%s: %s\r\n", _("OPTIONS"), option_string);
diff --git a/patches/minicom-2.9/series b/patches/minicom-2.9/series
new file mode 100644
index 000000000..a3135b429
--- /dev/null
+++ b/patches/minicom-2.9/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-build-reproducibly.patch
+# efe12230191a1ea2d64341d06c8f792b - git-ptx-patches magic
diff --git a/patches/mlpack-4.2.1/0001-HACK-don-t-do-magic-stuff-for-cross-compiling.patch b/patches/mlpack-4.2.1/0001-HACK-don-t-do-magic-stuff-for-cross-compiling.patch
new file mode 100644
index 000000000..4e29a36ad
--- /dev/null
+++ b/patches/mlpack-4.2.1/0001-HACK-don-t-do-magic-stuff-for-cross-compiling.patch
@@ -0,0 +1,67 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 20 Nov 2023 10:09:15 +0100
+Subject: [PATCH] HACK: don't do magic stuff for cross-compiling
+
+ - PTXdist handles sysroot & toolchain prefix
+ - don't link to arbitrary libraries just for cross-compiling
+ - don't force downloading dependencies
+ - the toolchain will set all necessary compiler optimizations
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ CMake/ConfigureCrossCompile.cmake | 9 +--------
+ CMakeLists.txt | 2 +-
+ board/flags-config.cmake | 2 ++
+ 3 files changed, 4 insertions(+), 9 deletions(-)
+
+diff --git a/CMake/ConfigureCrossCompile.cmake b/CMake/ConfigureCrossCompile.cmake
+index a320d32932be..6f8fb74e28cf 100644
+--- a/CMake/ConfigureCrossCompile.cmake
++++ b/CMake/ConfigureCrossCompile.cmake
+@@ -9,13 +9,6 @@
+
+ if (CMAKE_CROSSCOMPILING)
+ include(board/flags-config.cmake)
+- if (NOT CMAKE_SYSROOT AND (NOT TOOLCHAIN_PREFIX))
+- message(FATAL_ERROR "Neither CMAKE_SYSROOT nor TOOLCHAIN_PREFIX are set; please set both of them and try again.")
+- elseif(NOT CMAKE_SYSROOT)
+- message(FATAL_ERROR "Cannot configure: CMAKE_SYSROOT must be set when performing cross-compiling!")
+- elseif(NOT TOOLCHAIN_PREFIX)
+- message(FATAL_ERROR "Cannot configure: TOOLCHAIN_PREFIX must be set when performing cross-compiling!")
+- endif()
+ endif()
+
+ macro(search_openblas version)
+@@ -40,5 +33,5 @@ macro(search_openblas version)
+ endif()
+ find_library(GFORTRAN NAMES libgfortran.a)
+ find_library(PTHREAD NAMES libpthread.a)
+- set(CROSS_COMPILE_SUPPORT_LIBRARIES ${GFORTRAN} ${PTHREAD})
++ #set(CROSS_COMPILE_SUPPORT_LIBRARIES ${GFORTRAN} ${PTHREAD})
+ endmacro()
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cc826923286e..71801a8587b5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -45,7 +45,7 @@ endif()
+
+ # Enable auto-download if we are cross compiling.
+ if (CMAKE_CROSSCOMPILING)
+- set(DOWNLOAD_DEPENDENCIES ON)
++ set(DOWNLOAD_DEPENDENCIES OFF)
+ endif()
+
+ # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES.
+diff --git a/board/flags-config.cmake b/board/flags-config.cmake
+index 06dfecd5cfc9..ddde5bca5826 100644
+--- a/board/flags-config.cmake
++++ b/board/flags-config.cmake
+@@ -63,6 +63,8 @@ elseif(BOARD MATCHES "NORTHWOOD")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
+ set(OPENBLAS_TARGET "NORTHWOOD")
+ set(OPENBLAS_BINARY "32")
++elseif(BOARD MATCHES "PTX")
++ ## BSP toolchain will set the correct optimizations
+ elseif(BOARD)
+ ## TODO: update documentation with a list of the supported boards.
+ message(FATAL_ERROR "Given BOARD_NAME is not known; please choose a supported board from the list")
diff --git a/patches/mlpack-4.2.1/series b/patches/mlpack-4.2.1/series
new file mode 100644
index 000000000..37997b1dd
--- /dev/null
+++ b/patches/mlpack-4.2.1/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-HACK-don-t-do-magic-stuff-for-cross-compiling.patch
+# b54392880537e8535b4de1e35e1d8bea - git-ptx-patches magic
diff --git a/patches/libgpg-error-1.36/autogen.sh b/patches/mobile-broadband-provider-info-20220725/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/libgpg-error-1.36/autogen.sh
+++ b/patches/mobile-broadband-provider-info-20220725/autogen.sh
diff --git a/patches/mongodb-7.2.2/0001-HACK-SConstruct-remove-metrics.patch b/patches/mongodb-7.2.2/0001-HACK-SConstruct-remove-metrics.patch
new file mode 100644
index 000000000..cc33f9ac5
--- /dev/null
+++ b/patches/mongodb-7.2.2/0001-HACK-SConstruct-remove-metrics.patch
@@ -0,0 +1,40 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 5 Mar 2024 09:53:43 +0100
+Subject: [PATCH] HACK: SConstruct: remove metrics
+
+It's not available here and not needed.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ SConstruct | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/SConstruct b/SConstruct
+index 6303ad21f4be..7f0415775fbe 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -25,7 +25,6 @@ from pkg_resources import parse_version
+
+ import SCons
+ import SCons.Script
+-from mongo_tooling_metrics.lib.top_level_metrics import SConsToolingMetrics
+ from site_scons.mongo import build_profiles
+
+ # This must be first, even before EnsureSConsVersion, if
+@@ -1692,16 +1691,6 @@ env = Environment(variables=env_vars, **envDict)
+ del envDict
+ env.AddMethod(lambda env, name, **kwargs: add_option(name, **kwargs), 'AddOption')
+
+-# The placement of this is intentional. Here we setup an atexit method to store tooling metrics.
+-# We should only register this function after env, env_vars and the parser have been properly initialized.
+-SConsToolingMetrics.register_metrics(
+- utc_starttime=datetime.utcnow(),
+- artifact_dir=env.Dir('$BUILD_DIR').get_abspath(),
+- env_vars=env_vars,
+- env=env,
+- parser=_parser,
+-)
+-
+ if get_option('build-metrics'):
+ env['BUILD_METRICS_ARTIFACTS_DIR'] = '$BUILD_ROOT/$VARIANT_DIR'
+ env.Tool('build_metrics')
diff --git a/patches/mongodb-7.2.2/0002-HACK-SConstruct-keep-environment.patch b/patches/mongodb-7.2.2/0002-HACK-SConstruct-keep-environment.patch
new file mode 100644
index 000000000..091a6af87
--- /dev/null
+++ b/patches/mongodb-7.2.2/0002-HACK-SConstruct-keep-environment.patch
@@ -0,0 +1,24 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 5 Mar 2024 09:54:42 +0100
+Subject: [PATCH] HACK: SConstruct: keep environment
+
+Without this $PATH is sometimes lost and the compiler may not be found.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ SConstruct | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/SConstruct b/SConstruct
+index 7f0415775fbe..efe13094e2bc 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -1687,7 +1687,7 @@ envDict = dict(
+ if get_option('build-tools') == 'next':
+ SCons.Tool.DefaultToolpath.insert(0, os.path.abspath('site_scons/site_tools/next'))
+
+-env = Environment(variables=env_vars, **envDict)
++env = Environment(ENV=os.environ, variables=env_vars, **envDict)
+ del envDict
+ env.AddMethod(lambda env, name, **kwargs: add_option(name, **kwargs), 'AddOption')
+
diff --git a/patches/mongodb-7.2.2/0003-HACK-don-t-require-GitPython.patch b/patches/mongodb-7.2.2/0003-HACK-don-t-require-GitPython.patch
new file mode 100644
index 000000000..1c6ef68ca
--- /dev/null
+++ b/patches/mongodb-7.2.2/0003-HACK-don-t-require-GitPython.patch
@@ -0,0 +1,24 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Wed, 6 Mar 2024 08:44:02 +0100
+Subject: [PATCH] HACK: don't require GitPython
+
+It's only used to create dist packages, not to build from source
+archive. So remove the 'import' to avoid the dependency.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ site_scons/site_tools/distsrc.py | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/site_scons/site_tools/distsrc.py b/site_scons/site_tools/distsrc.py
+index 893552e6ace4..556c7f0790bb 100644
+--- a/site_scons/site_tools/distsrc.py
++++ b/site_scons/site_tools/distsrc.py
+@@ -20,7 +20,6 @@
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ #
+
+-import git
+ import SCons
+ import os
+ import os.path as ospath
diff --git a/patches/mongodb-7.2.2/series b/patches/mongodb-7.2.2/series
new file mode 100644
index 000000000..c23838084
--- /dev/null
+++ b/patches/mongodb-7.2.2/series
@@ -0,0 +1,6 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-HACK-SConstruct-remove-metrics.patch
+0002-HACK-SConstruct-keep-environment.patch
+0003-HACK-don-t-require-GitPython.patch
+# 92efd435d713858af1a7f9c04eb75aab - git-ptx-patches magic
diff --git a/patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch b/patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch
deleted file mode 100644
index f45b660ee..000000000
--- a/patches/mtd-utils-2.1.2/0002-Add-an-ubifs-mount-helper.patch
+++ /dev/null
@@ -1,142 +0,0 @@
-From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
-Date: Tue, 6 Oct 2020 11:19:13 +0200
-Subject: [PATCH] Add an ubifs mount helper
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This abstracts away attaching of the right ubi and then selecting the right
-ubi device and volume to mount.
-
-As described in the comment at the top this allows to mount ubifs volumes
-directly from /etc/fstab without having to use hardcoded numbers (which
-depend on mount order and so are unreliable) and extra magic to care for
-attaching.
-
-Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-Origin: upstream, commit:efeba0875ed181e7c1c7915742a3868799604d0c
----
- ubifs-utils/Makemodule.am | 2 +
- ubifs-utils/mount.ubifs | 101 ++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 103 insertions(+)
- create mode 100755 ubifs-utils/mount.ubifs
-
-diff --git a/ubifs-utils/Makemodule.am b/ubifs-utils/Makemodule.am
-index 59109ccd613c..5c5d99f7572b 100644
---- a/ubifs-utils/Makemodule.am
-+++ b/ubifs-utils/Makemodule.am
-@@ -47,4 +47,6 @@ UBIFS_EXTRA = \
-
- EXTRA_DIST += $(UBIFS_HEADER) $(UBIFS_EXTRA)
-
-+dist_sbin_SCRIPTS = ubifs-utils/mount.ubifs
-+
- sbin_PROGRAMS += $(UBIFS_BINS)
-diff --git a/ubifs-utils/mount.ubifs b/ubifs-utils/mount.ubifs
-new file mode 100755
-index 000000000000..b94ddc5649f4
---- /dev/null
-+++ b/ubifs-utils/mount.ubifs
-@@ -0,0 +1,101 @@
-+#!/bin/sh
-+
-+# This script should be installed as /sbin/mount.ubifs. The benefit is that an
-+# fstab entry like:
-+#
-+# mtd=mtddev:home /home ubifs defaults 0 0
-+#
-+# results in the ubi contained in the mtd named "mtddev" to be attached (if not
-+# already done) and then the volume named "home" being mounted to /home.
-+
-+# This is called by mount with the following options:
-+# /sbin/mount.ubifs spec dir [-sfnv] [-N namespace] [-o options] [-t type.subtype]
-+
-+spec="$1"
-+shift
-+
-+mtdname2num() {
-+ local name
-+
-+ name="$1"
-+
-+ for d in $(find /sys/class/mtd/ -regex '.*/mtd[0-9]*'); do
-+ case "$d" in
-+ *ro)
-+ continue
-+ ;;
-+ esac
-+
-+ if test "$name" = "$(cat "$d/name")"; then
-+ local dev mtdnum
-+
-+ dev="$(basename "$d")"
-+ mtdnum="${dev#mtd}"
-+ echo "$mtdnum"
-+ return
-+ fi
-+ done
-+
-+ return 1
-+}
-+
-+mtdnum2ubi() {
-+ local mtdnum
-+
-+ mtdnum="$1"
-+
-+ for d in $(find /sys/class/ubi/ -regex '.*/ubi[0-9]*'); do
-+ case "$d" in
-+ *_[0-9]*)
-+ continue
-+ ;;
-+ esac
-+
-+ if test "$mtdnum" = "$(cat "$d/mtd_num")"; then
-+ local ubi
-+
-+ ubi="$(basename "$d")"
-+ echo "$ubi"
-+ return;
-+ fi
-+ done
-+
-+ return 1
-+}
-+
-+mtdnum2ubi_autoattach() {
-+ local mtdnum ubi
-+
-+ mtdnum="$1"
-+
-+ ubi="$(mtdnum2ubi "$mtdnum")" && { echo "$ubi"; return; }
-+
-+ # ubiattach might fail with "mtdX is already attached to ubiY" if there
-+ # is more than one mount to do in the same mtd partition. So ignore errors.
-+ ubiattach -m "$mtdnum" >&2 || true
-+
-+ mtdnum2ubi "$mtdnum"
-+}
-+
-+case "$spec" in
-+ mtd=*:*)
-+ spec="${spec#mtd=}"
-+ mtd="${spec%:*}"
-+ rspec="${spec#*:}"
-+
-+ mtdnum="$(mtdname2num "$mtd")" || {
-+ echo "Failed to find mtdnum for mtd \"$mtd\""
-+ exit 1
-+ }
-+
-+ ubi="$(mtdnum2ubi_autoattach "$mtdnum")" || {
-+ echo "Failed to find ubi for mtd \"$mtd\""
-+ exit 1
-+ }
-+
-+ spec="$ubi:$rspec"
-+
-+ ;;
-+esac
-+
-+/bin/mount -i -t ubifs "$spec" "$@"
diff --git a/patches/mtd-utils-2.1.2/autogen.sh b/patches/mtd-utils-2.1.2/autogen.sh
deleted file mode 120000
index 9f8a4cb7d..000000000
--- a/patches/mtd-utils-2.1.2/autogen.sh
+++ /dev/null
@@ -1 +0,0 @@
-../autogen.sh \ No newline at end of file
diff --git a/patches/mtd-utils-2.1.2/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch b/patches/mtd-utils-2.2.0/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
index 1cea5f238..e6ff202a7 100644
--- a/patches/mtd-utils-2.1.2/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
+++ b/patches/mtd-utils-2.2.0/0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
@@ -9,7 +9,7 @@ Subject: [PATCH] nandmarkbad: new util to mark blocks as bad
create mode 100644 nand-utils/nandmarkbad.c
diff --git a/nand-utils/Makemodule.am b/nand-utils/Makemodule.am
-index d75b0cb3e36c..c31dcb01f06e 100644
+index cee677783e7a..7fd1de5aa9ae 100644
--- a/nand-utils/Makemodule.am
+++ b/nand-utils/Makemodule.am
@@ -7,6 +7,9 @@ nandwrite_LDADD = libmtd.a
@@ -19,18 +19,18 @@ index d75b0cb3e36c..c31dcb01f06e 100644
+nandmarkbad_SOURCES = nand-utils/nandmarkbad.c
+nandmarkbad_LDADD = libmtd.a
+
- nftldump_SOURCES = nand-utils/nftldump.c
+ nftldump_SOURCES = nand-utils/nftldump.c include/mtd_swab.h
+ nftldump_SOURCES += include/mtd/nftl-user.h include/mtd/ftl-user.h
nftldump_LDADD = libmtd.a
+@@ -23,7 +26,7 @@ NAND_SH = \
-@@ -14,7 +17,7 @@ nftl_format_SOURCES = nand-utils/nftl_format.c
- nftl_format_LDADD = libmtd.a
+ EXTRA_DIST += $(NAND_SH)
- NAND_BINS = \
-- nanddump nandwrite nandtest nftldump nftl_format
-+ nanddump nandwrite nandtest nandmarkbad nftldump nftl_format
+-sbin_PROGRAMS += nanddump nandwrite nandtest nftldump nftl_format nandflipbits
++sbin_PROGRAMS += nanddump nandwrite nandtest nandmarkbad nftldump nftl_format nandflipbits
- NAND_SH = \
- nand-utils/load_nandsim.sh
+ if BUILD_TESTS
+ test_SCRIPTS += $(NAND_SH)
diff --git a/nand-utils/nandmarkbad.c b/nand-utils/nandmarkbad.c
new file mode 100644
index 000000000000..cf05698c3609
diff --git a/patches/libgudev-230/autogen.sh b/patches/mtd-utils-2.2.0/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/libgudev-230/autogen.sh
+++ b/patches/mtd-utils-2.2.0/autogen.sh
diff --git a/patches/mtd-utils-2.1.2/series b/patches/mtd-utils-2.2.0/series
index 7a5eec8b0..92dc1b94f 100644
--- a/patches/mtd-utils-2.1.2/series
+++ b/patches/mtd-utils-2.2.0/series
@@ -1,5 +1,4 @@
# generated by git-ptx-patches
#tag:base --start-number 1
0001-nandmarkbad-new-util-to-mark-blocks-as-bad.patch
-0002-Add-an-ubifs-mount-helper.patch
-# 096af547b18d202f08576089a0cee058 - git-ptx-patches magic
+# 407ded52b82ffa3ff91d50cf6b2388e0 - git-ptx-patches magic
diff --git a/patches/mysql-5.7.11/0001-Fix_buildsystem-use-compile-only-tests.patch b/patches/mysql-5.7.11/0001-Fix_buildsystem-use-compile-only-tests.patch
deleted file mode 100644
index 106abc54a..000000000
--- a/patches/mysql-5.7.11/0001-Fix_buildsystem-use-compile-only-tests.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From: Juergen Borleis <jbe@pengutronix.de>
-Date: Tue, 15 Mar 2016 15:02:02 +0100
-Subject: [PATCH] Fix_buildsystem: use compile only tests
-
-Testing compiler features need not to run to test them.
----
- storage/innobase/innodb.cmake | 36 ++++++++++++++++--------------------
- 1 file changed, 16 insertions(+), 20 deletions(-)
-
-diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake
-index 809e58941e95..944f4e10803b 100644
---- a/storage/innobase/innodb.cmake
-+++ b/storage/innobase/innodb.cmake
-@@ -108,7 +108,7 @@ IF(HAVE_NANOSLEEP)
- ENDIF()
-
- IF(NOT MSVC)
-- CHECK_C_SOURCE_RUNS(
-+ CHECK_CXX_SOURCE_COMPILES(
- "
- #define _GNU_SOURCE
- #include <fcntl.h>
-@@ -131,28 +131,27 @@ ENDIF()
-
- IF(NOT MSVC)
- # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
--IF(NOT CMAKE_CROSSCOMPILING)
-- CHECK_C_SOURCE_RUNS(
-- "#include<stdint.h>
-+CHECK_CXX_SOURCE_COMPILES("
-+ #include<stdint.h>
- int main()
- {
- __sync_synchronize();
- return(0);
- }"
-- HAVE_IB_GCC_SYNC_SYNCHRONISE
-- )
-- CHECK_C_SOURCE_RUNS(
-- "#include<stdint.h>
-+ HAVE_IB_GCC_SYNC_SYNCHRONISE)
-+
-+CHECK_CXX_SOURCE_COMPILES("
-+ #include<stdint.h>
- int main()
- {
- __atomic_thread_fence(__ATOMIC_ACQUIRE);
- __atomic_thread_fence(__ATOMIC_RELEASE);
- return(0);
- }"
-- HAVE_IB_GCC_ATOMIC_THREAD_FENCE
-- )
-- CHECK_C_SOURCE_RUNS(
-- "#include<stdint.h>
-+ HAVE_IB_GCC_ATOMIC_THREAD_FENCE)
-+
-+CHECK_CXX_SOURCE_COMPILES("
-+ #include<stdint.h>
- int main()
- {
- unsigned char a = 0;
-@@ -164,9 +163,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
- __ATOMIC_RELEASE, __ATOMIC_ACQUIRE);
- return(0);
- }"
-- HAVE_IB_GCC_ATOMIC_COMPARE_EXCHANGE
-- )
--ENDIF()
-+ HAVE_IB_GCC_ATOMIC_COMPARE_EXCHANGE)
-
- IF(HAVE_IB_GCC_SYNC_SYNCHRONISE)
- ADD_DEFINITIONS(-DHAVE_IB_GCC_SYNC_SYNCHRONISE=1)
-@@ -181,8 +178,7 @@ IF(HAVE_IB_GCC_ATOMIC_COMPARE_EXCHANGE)
- ENDIF()
-
- # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
--IF(NOT CMAKE_CROSSCOMPILING)
-- CHECK_C_SOURCE_RUNS(
-+CHECK_CXX_SOURCE_COMPILES(
- "
- #include <pthread.h>
- #include <string.h>
-@@ -201,14 +197,14 @@ IF(NOT CMAKE_CROSSCOMPILING)
- return(0);
- }"
- HAVE_IB_ATOMIC_PTHREAD_T_GCC)
--ENDIF()
-+
- IF(HAVE_IB_ATOMIC_PTHREAD_T_GCC)
- ADD_DEFINITIONS(-DHAVE_IB_ATOMIC_PTHREAD_T_GCC=1)
- ENDIF()
-
- # Only use futexes on Linux if GCC atomics are available
--IF(NOT MSVC AND NOT CMAKE_CROSSCOMPILING)
-- CHECK_C_SOURCE_RUNS(
-+IF(NOT MSVC)
-+ CHECK_CXX_SOURCE_COMPILES(
- "
- #include <stdio.h>
- #include <unistd.h>
diff --git a/patches/mysql-5.7.11/series b/patches/mysql-5.7.11/series
deleted file mode 100644
index 2d5f3314f..000000000
--- a/patches/mysql-5.7.11/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Fix_buildsystem-use-compile-only-tests.patch
-# feb58169ae07f03fb795bfc9055f69a9 - git-ptx-patches magic
diff --git a/patches/nanocom-1.0/0001-Nanocom-fix-its-buildsystem.patch b/patches/nanocom-1.0/0001-Nanocom-fix-its-buildsystem.patch
deleted file mode 100644
index 2e50eff3f..000000000
--- a/patches/nanocom-1.0/0001-Nanocom-fix-its-buildsystem.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From: Juergen Beisert <jbe@pengutronix.de>
-Date: Mon, 2 Jul 2012 10:36:35 +0200
-Subject: [PATCH] Nanocom: fix its buildsystem
-
-This existing Makefile tries to be smarter than Make is. And it fails badly.
- - it is not able to compile twice
- - it does not honor external flags, nor does it list the binaries sources for
- dependency detection
-
-Signed-off.by: Juergen Beisert <jbe@pengutronix.de>
----
- Makefile | 10 ++++------
- 1 files changed, 4 insertions(+), 6 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index df28d22..1ef2aed 100644
---- a/Makefile
-+++ b/Makefile
-@@ -12,13 +12,11 @@
- #** GNU General Public License for more details at www.gnu.org
- #****************************************************************************/
-
--CC=gcc
-+all: nanocom
-
--all: clean nanocom
-+nanocom: mux.c menu.c nanocom.c
-
--nanocom:
-- $(CC) mux.c nanocom.c menu.c -o nanocom
--
- clean:
- rm -rf *.o nanocom
--
-\ No newline at end of file
-+
-+.PHONY: all clean
diff --git a/patches/nanocom-1.0/series b/patches/nanocom-1.0/series
deleted file mode 100644
index 5314ad7bf..000000000
--- a/patches/nanocom-1.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Nanocom-fix-its-buildsystem.patch
-# e6ac4f301256655d216f4f37323e0a80 - git-ptx-patches magic
diff --git a/patches/nbd-3.12.1/0001-Don-t-make-the-readit-function-depend-on-WORDS_BIGEN.patch b/patches/nbd-3.12.1/0001-Don-t-make-the-readit-function-depend-on-WORDS_BIGEN.patch
deleted file mode 100644
index c84172966..000000000
--- a/patches/nbd-3.12.1/0001-Don-t-make-the-readit-function-depend-on-WORDS_BIGEN.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Wouter Verhelst <w@uter.be>
-Date: Tue, 1 Dec 2015 13:59:27 +0100
-Subject: [PATCH] Don't make the readit() function depend on WORDS_BIGENDIAN
-
-We had accidentally moved the readit() function to the wrong location in
-this cliserv file, which meant that it wouldn't be compiled in if
-WORDS_BIGENDIAN was defined.
-
-Fix that.
----
- cliserv.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/cliserv.c b/cliserv.c
-index 93835f9800af..241aa556ed26 100644
---- a/cliserv.c
-+++ b/cliserv.c
-@@ -81,6 +81,7 @@ u64 ntohll(u64 a) {
- hi = ntohl(hi);
- return ((u64) lo) << 32U | hi;
- }
-+#endif
-
- /**
- * Read data from a file descriptor into a buffer
-@@ -103,5 +104,3 @@ void readit(int f, void *buf, size_t len) {
- }
- }
- }
--
--#endif
diff --git a/patches/nbd-3.12.1/series b/patches/nbd-3.12.1/series
deleted file mode 100644
index 21ea7d41f..000000000
--- a/patches/nbd-3.12.1/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Don-t-make-the-readit-function-depend-on-WORDS_BIGEN.patch
-# e21d14a8cba5e1ec12aea4ded98639ae - git-ptx-patches magic
diff --git a/patches/ncftp-3.2.6-src/0001-HACK-configure-always-assume-cross-compiling.patch b/patches/ncftp-3.2.6-src/0001-HACK-configure-always-assume-cross-compiling.patch
deleted file mode 100644
index 6a8d60706..000000000
--- a/patches/ncftp-3.2.6-src/0001-HACK-configure-always-assume-cross-compiling.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Mon, 10 Apr 2017 11:04:41 +0200
-Subject: [PATCH] HACK: configure: always assume cross-compiling
-
-Running a simple test program is not a good check for cross-compiling. It
-succeed e.g. for x86 on x86_64 even if more complex programs fail to run.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure b/configure
-index da04298783a7..b3095d8d3c34 100755
---- a/configure
-+++ b/configure
-@@ -847,7 +847,7 @@ if { (eval echo configure:847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && te
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
-- ac_cv_prog_cc_cross=no
-+ ac_cv_prog_cc_cross=yes
- else
- ac_cv_prog_cc_cross=yes
- fi
diff --git a/patches/ncftp-3.2.6-src/0002-HACK-avoid-miss-detecting-clang.patch b/patches/ncftp-3.2.6-src/0002-HACK-avoid-miss-detecting-clang.patch
deleted file mode 100644
index 7b4390302..000000000
--- a/patches/ncftp-3.2.6-src/0002-HACK-avoid-miss-detecting-clang.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 18 Aug 2019 14:51:50 +0200
-Subject: [PATCH] HACK: avoid miss detecting clang
-
-Without this gcc may be miss detected as clang if the build path contained
-the word 'clang'.
-
-Note: configure is patched here because regenerating it is broken.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure b/configure
-index b3095d8d3c34..0c0546dc2758 100755
---- a/configure
-+++ b/configure
-@@ -1820,7 +1820,7 @@ case "$CC" in
- CC_is_clang="yes"
- ;;
- *)
-- cc_dash_v=`${CC-gcc} -v 2>&1 | grep clang 2>/dev/null`
-+ cc_dash_v=`${CC-gcc} -v 2>&1 | grep '^clang' 2>/dev/null`
- if test -n "$cc_dash_v" ; then
- CC_is_clang="yes"
- fi
-@@ -2984,7 +2984,7 @@ case "$CC" in
- CC_is_clang="yes"
- ;;
- *)
-- cc_dash_v=`${CC-gcc} -v 2>&1 | grep clang 2>/dev/null`
-+ cc_dash_v=`${CC-gcc} -v 2>&1 | grep '^clang' 2>/dev/null`
- if test -n "$cc_dash_v" ; then
- CC_is_clang="yes"
- fi
diff --git a/patches/ncftp-3.2.6-src/series b/patches/ncftp-3.2.6-src/series
deleted file mode 100644
index 1bd3c790e..000000000
--- a/patches/ncftp-3.2.6-src/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-HACK-configure-always-assume-cross-compiling.patch
-0002-HACK-avoid-miss-detecting-clang.patch
-# f8d883c4a3df4b49699ecdc988b884d4 - git-ptx-patches magic
diff --git a/patches/ncurses-6.2/0001-teach-ncurses-config-about-sysroot.patch b/patches/ncurses-6.4/0001-teach-ncurses-config-about-sysroot.patch
index 707b5a49c..4a8ee40a9 100644
--- a/patches/ncurses-6.2/0001-teach-ncurses-config-about-sysroot.patch
+++ b/patches/ncurses-6.4/0001-teach-ncurses-config-about-sysroot.patch
@@ -7,13 +7,17 @@ This patch teaches ncurses-config about sysroot
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
[ported from ncurses 6.1 to 6.2]
Signed-off-by: Robert Schwebel <rsc@pengutronix.de>
+[ported from ncurses 6.3 to 6.4]
+Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
- misc/ncurses-config.in | 12 ++++++------
- 1 files changed, 6 insertions(+), 6 deletions(-)
+ misc/ncurses-config.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
---- ncurses-6.2/misc/ncurses-config.in 2020-02-03 00:34:34.000000000 +0100
-+++ ncurses-6.2-ptx/misc/ncurses-config.in 2020-07-25 23:28:48.123350040 +0200
-@@ -149,10 +149,10 @@
+diff --git a/misc/ncurses-config.in b/misc/ncurses-config.in
+index c9f1cf809843..af37d68c022c 100644
+--- a/misc/ncurses-config.in
++++ b/misc/ncurses-config.in
+@@ -188,10 +188,10 @@ while [ $# -gt 0 ]; do
--cflags)
INCS="@PKG_CFLAGS@"
if [ "x@WITH_OVERWRITE@" = xno ]; then
@@ -26,8 +30,8 @@ Signed-off-by: Robert Schwebel <rsc@pengutronix.de>
fi
sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
$INCS
-@@ -235,7 +235,7 @@
- echo $INCS
+@@ -274,7 +274,7 @@ ENDECHO
+ echo "$INCS"
;;
--libdir)
- echo "${libdir}"
diff --git a/patches/ncurses-6.2/series b/patches/ncurses-6.4/series
index fbdd3447d..fbdd3447d 100644
--- a/patches/ncurses-6.2/series
+++ b/patches/ncurses-6.4/series
diff --git a/patches/net-snmp-5.9/0001-net-snmp-config-add-SYSROOT-support.patch b/patches/net-snmp-5.9.1/0001-net-snmp-config-add-SYSROOT-support.patch
index e1c88ae10..8995a6ea2 100644
--- a/patches/net-snmp-5.9/0001-net-snmp-config-add-SYSROOT-support.patch
+++ b/patches/net-snmp-5.9.1/0001-net-snmp-config-add-SYSROOT-support.patch
@@ -16,10 +16,10 @@ Signed-off-by: Alexander Dahl <post@lespocky.de>
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net-snmp-config.in b/net-snmp-config.in
-index a412412118af..eb7bd0921fd6 100644
+index 6b5abf8f838a..366d648dfb19 100644
--- a/net-snmp-config.in
+++ b/net-snmp-config.in
-@@ -54,7 +54,7 @@ NSC_LAGENTLIBS="@LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@"
+@@ -57,7 +57,7 @@ NSC_LAGENTLIBS="@LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@"
NSC_LMIBLIBS="@LMIBLIBS@"
NSC_INCLUDEDIR=${includedir}
@@ -28,7 +28,7 @@ index a412412118af..eb7bd0921fd6 100644
NSC_SNMPLIBS="-lnetsnmp ${NSC_LNETSNMPLIBS}"
NSC_SUBAGENTLIBS="-lnetsnmpagent ${NSC_LAGENTLIBS} ${NSC_SNMPLIBS}"
-@@ -140,10 +140,10 @@ else
+@@ -143,10 +143,10 @@ else
;;
#################################################### compile
--base-cflags)
@@ -41,12 +41,12 @@ index a412412118af..eb7bd0921fd6 100644
;;
--srcdir)
echo $NSC_SRCDIR
-@@ -657,7 +657,7 @@ EOF
+@@ -660,7 +660,7 @@ EOF
echo "Ack. Can't create $tmpfile."
exit 1
fi
- cmd="@CC@ $cflags @CFLAGS@ @DEVFLAGS@ -I. -I${NSC_INCLUDEDIR} -o $outname $tmpfile $cfiles $NSC_LDFLAGS $NSC_LIBDIR $NSC_BASE_AGENT_LIBS $NSC_AGENTLIBS $ldflags"
+ cmd="@CC@ $cflags @CFLAGS@ @DEVFLAGS@ -I. -I${SYSROOT}${NSC_INCLUDEDIR} -o $outname $tmpfile $cfiles $NSC_LDFLAGS $NSC_LIBDIR $NSC_BASE_AGENT_LIBS $NSC_AGENTLIBS $ldflags"
echo "running: $cmd"
- `$cmd`
+ echo `$cmd`
result=$?
diff --git a/patches/net-snmp-5.9/0002-Don-t-disable-udp-and-tcp-when-disable-agentx-dom-so.patch b/patches/net-snmp-5.9.1/0002-Don-t-disable-udp-and-tcp-when-disable-agentx-dom-so.patch
index 4b7338c71..bf0b88a82 100644
--- a/patches/net-snmp-5.9/0002-Don-t-disable-udp-and-tcp-when-disable-agentx-dom-so.patch
+++ b/patches/net-snmp-5.9.1/0002-Don-t-disable-udp-and-tcp-when-disable-agentx-dom-so.patch
@@ -17,10 +17,10 @@ semantic.
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/configure.d/config_project_with_enable b/configure.d/config_project_with_enable
-index daa0ccc0fbbc..fd7feba777b4 100644
+index cdf56deb69dc..37d6ed1d6984 100644
--- a/configure.d/config_project_with_enable
+++ b/configure.d/config_project_with_enable
-@@ -777,9 +777,11 @@ NETSNMP_ARG_ENABLE(local-smux,
+@@ -771,9 +771,11 @@ NETSNMP_ARG_ENABLE(local-smux,
fi])
NETSNMP_ARG_ENABLE(agentx-dom-sock-only,
diff --git a/patches/libkcapi-1.1.5/autogen.sh b/patches/net-snmp-5.9.1/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/libkcapi-1.1.5/autogen.sh
+++ b/patches/net-snmp-5.9.1/autogen.sh
diff --git a/patches/net-snmp-5.9/series b/patches/net-snmp-5.9.1/series
index 1596362e4..1596362e4 100644
--- a/patches/net-snmp-5.9/series
+++ b/patches/net-snmp-5.9.1/series
diff --git a/patches/net-snmp-5.9/autogen.sh b/patches/net-snmp-5.9/autogen.sh
deleted file mode 120000
index 9f8a4cb7d..000000000
--- a/patches/net-snmp-5.9/autogen.sh
+++ /dev/null
@@ -1 +0,0 @@
-../autogen.sh \ No newline at end of file
diff --git a/patches/netperf-2.7.0/0001-fix-inlining.patch b/patches/netperf-2.7.0/0001-fix-inlining.patch
deleted file mode 100644
index 1e6689da7..000000000
--- a/patches/netperf-2.7.0/0001-fix-inlining.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 68cfbafb9f239950065e6a0ed7ca60c12668740f Mon Sep 17 00:00:00 2001
-From: Clemens Gruber <clemens.gruber@pqgruber.com>
-Date: Thu, 15 Dec 2016 16:14:01 +0100
-Subject: [PATCH] fix inlining
-
-Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
----
- src/netlib.c | 14 +-------------
- 1 file changed, 1 insertion(+), 13 deletions(-)
-
-diff --git a/src/netlib.c b/src/netlib.c
-index f3a3fe5e00ab..4465d0f1b5f3 100644
---- a/src/netlib.c
-+++ b/src/netlib.c
-@@ -3997,11 +3997,7 @@ void demo_stream_setup(uint32_t a, uint32_t b) {
- }
- }
-
--#ifdef WIN32
--__forceinline void demo_interval_display(double actual_interval)
--#else
-- inline void demo_interval_display(double actual_interval)
--#endif
-+void demo_interval_display(double actual_interval)
- {
- static int count = 0;
- struct timeval now;
-@@ -4060,15 +4056,7 @@ __forceinline void demo_interval_display(double actual_interval)
- important compilers have supported such a construct so it should
- not be a big deal. raj 2012-01-23 */
-
--#ifdef WIN32
--/* It would seem that the Microsoft compiler will not inline across
-- source files. So there is little point in having an inline
-- directive in that situation. Of course that makes me wonder if an
-- inline directive has to appear in netlib.h... */
- void demo_interval_tick(uint32_t units)
--#else
-- inline void demo_interval_tick(uint32_t units)
--#endif
- {
- double actual_interval = 0.0;
-
---
-2.10.2
-
diff --git a/patches/netperf-2.7.0/series b/patches/netperf-2.7.0/series
deleted file mode 100644
index 54488afdf..000000000
--- a/patches/netperf-2.7.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-fix-inlining.patch
-# ce464498af68ff457cdb324c32f1c72b - git-ptx-patches magic
diff --git a/patches/nfs-utils-2.5.3/0001-allow-installing-all-tools-in-usr.patch b/patches/nfs-utils-2.5.3/0001-allow-installing-all-tools-in-usr.patch
deleted file mode 100644
index 8a4415770..000000000
--- a/patches/nfs-utils-2.5.3/0001-allow-installing-all-tools-in-usr.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 11 Jan 2017 11:57:05 +0100
-Subject: [PATCH] allow installing all tools in /usr
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- utils/mount/Makefile.am | 4 ----
- utils/nfsdcltrack/Makefile.am | 4 ----
- 2 files changed, 8 deletions(-)
-
-diff --git a/utils/mount/Makefile.am b/utils/mount/Makefile.am
-index ad0be93b1def..ece27eeab7bf 100644
---- a/utils/mount/Makefile.am
-+++ b/utils/mount/Makefile.am
-@@ -1,9 +1,5 @@
- ## Process this file with automake to produce Makefile.in
-
--# These binaries go in /sbin (not /usr/sbin), and that cannot be
--# overridden at config time.
--sbindir = /sbin
--
- man8_MANS = mount.nfs.man umount.nfs.man
- man5_MANS = nfs.man
-
-diff --git a/utils/nfsdcltrack/Makefile.am b/utils/nfsdcltrack/Makefile.am
-index 2f7fe3de6922..6a17fce373f0 100644
---- a/utils/nfsdcltrack/Makefile.am
-+++ b/utils/nfsdcltrack/Makefile.am
-@@ -1,9 +1,5 @@
- ## Process this file with automake to produce Makefile.in
-
--# These binaries go in /sbin (not /usr/sbin), and that cannot be
--# overridden at config time. The kernel "knows" the /sbin name.
--sbindir = /sbin
--
- man8_MANS = nfsdcltrack.man
- EXTRA_DIST = $(man8_MANS)
-
diff --git a/patches/nfs-utils-2.5.3/0002-configure-check-for-rpc-rpc.h-presence.patch b/patches/nfs-utils-2.5.3/0002-configure-check-for-rpc-rpc.h-presence.patch
deleted file mode 100644
index 27519121c..000000000
--- a/patches/nfs-utils-2.5.3/0002-configure-check-for-rpc-rpc.h-presence.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Roland Hieber <rhi@pengutronix.de>
-Date: Tue, 25 May 2021 01:08:07 +0200
-Subject: [PATCH] configure: check for rpc/rpc.h presence
-
-Recent versions of glibc (since 2.26?) no longer supply rpc/rpc.h.
-Detect such cases and prompt the user to build with libtirpc instead.
-
-Signed-off-by: Roland Hieber <rhi@pengutronix.de>
-Signed-off-by: Steve Dickson <steved@redhat.com>
-Origin: upstream, http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=be7365239abf8556773b063730621967b9971708
----
- configure.ac | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index f2e1bd30d0f2..25e988dfa33c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -335,6 +335,13 @@ AC_CHECK_HEADERS([sched.h], [], [])
- AC_CHECK_FUNCS([unshare fstatat statx], [] , [])
- AC_LIBPTHREAD([])
-
-+# rpc/rpc.h can come from the glibc or from libtirpc
-+nfsutils_save_CPPFLAGS="${CPPFLAGS}"
-+CPPFLAGS="${CPPFLAGS} ${TIRPC_CFLAGS}"
-+AC_CHECK_HEADER(rpc/rpc.h, ,
-+ AC_MSG_ERROR([Header file rpc/rpc.h not found - maybe try building with --enable-tirpc]))
-+CPPFLAGS="${nfsutils_save_CPPFLAGS}"
-+
- if test "$enable_nfsv4" = yes; then
- dnl check for libevent libraries and headers
- AC_LIBEVENT
diff --git a/patches/nfs-utils-2.5.3/autogen.sh b/patches/nfs-utils-2.5.3/autogen.sh
deleted file mode 120000
index 9f8a4cb7d..000000000
--- a/patches/nfs-utils-2.5.3/autogen.sh
+++ /dev/null
@@ -1 +0,0 @@
-../autogen.sh \ No newline at end of file
diff --git a/patches/nfs-utils-2.5.3/series b/patches/nfs-utils-2.5.3/series
deleted file mode 100644
index b6261ed8f..000000000
--- a/patches/nfs-utils-2.5.3/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-allow-installing-all-tools-in-usr.patch
-0002-configure-check-for-rpc-rpc.h-presence.patch
-# e74bb66e111cbf71e8ff8030c9081753 - git-ptx-patches magic
diff --git a/patches/nftables-0.8.3/0001-configure-don-t-enable-xtables-when-without-xtables-.patch b/patches/nftables-0.8.3/0001-configure-don-t-enable-xtables-when-without-xtables-.patch
deleted file mode 100644
index 2b5ff1bf5..000000000
--- a/patches/nftables-0.8.3/0001-configure-don-t-enable-xtables-when-without-xtables-.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Florian Westphal <fw@strlen.de>
-Date: Wed, 4 Apr 2018 13:53:28 +0200
-Subject: [PATCH] configure: don't enable xtables when --without-xtables is
- passed
-
-AC_ARG_WITH runs this when EITHER --with-foo or --without-foo is given,
-so use 'withval'.
-
-After this patch:
-./configure -> xtables off
-./configure --with-xtables -> xtables on
-./configure --without-xtables -> xtables off (was on).
-
-Reported-by: Alexander Dahl <ada@thorsis.com>
-Signed-off-by: Florian Westphal <fw@strlen.de>
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index 2d0b1b939a18..74e721cd4691 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -99,7 +99,7 @@ AM_CONDITIONAL([BUILD_CLI], [test "x$with_cli" != xno])
-
- AC_ARG_WITH([xtables], [AS_HELP_STRING([--with-xtables],
- [Use libxtables for iptables interaction)])],
-- [with_libxtables=yes], [with_libxtables=no])
-+ [with_libxtables=$withval], [with_libxtables=no])
- AS_IF([test "x$with_libxtables" != xno], [
- PKG_CHECK_MODULES([XTABLES], [xtables >= 1.6.1])
- AC_DEFINE([HAVE_LIBXTABLES], [1], [0])
diff --git a/patches/nftables-0.8.3/autogen.sh b/patches/nftables-0.8.3/autogen.sh
deleted file mode 120000
index 9f8a4cb7d..000000000
--- a/patches/nftables-0.8.3/autogen.sh
+++ /dev/null
@@ -1 +0,0 @@
-../autogen.sh \ No newline at end of file
diff --git a/patches/nftables-0.8.3/series b/patches/nftables-0.8.3/series
deleted file mode 100644
index d4fe1dc34..000000000
--- a/patches/nftables-0.8.3/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-configure-don-t-enable-xtables-when-without-xtables-.patch
-# 12321dad8667c00b553d2c9b76ee6dd3 - git-ptx-patches magic
diff --git a/patches/nginx-1.18.0/0006-auto-lib-openssl-conf-use-pkg-config.patch b/patches/nginx-1.18.0/0006-auto-lib-openssl-conf-use-pkg-config.patch
deleted file mode 100644
index 5cbd262fe..000000000
--- a/patches/nginx-1.18.0/0006-auto-lib-openssl-conf-use-pkg-config.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Martin Bark <martin@barkynet.com>
-Date: Fri, 6 May 2016 14:48:31 +0100
-Subject: [PATCH] auto/lib/openssl/conf: use pkg-config
-
-Change to using pkg-config to find the path to openssl and its
-dependencies.
-
-Signed-off-by: Martin Bark <martin@barkynet.com>
----
- auto/lib/openssl/conf | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf
-index 4fb52df7fe17..32ab2a045209 100644
---- a/auto/lib/openssl/conf
-+++ b/auto/lib/openssl/conf
-@@ -59,8 +59,8 @@ else
- ngx_feature_name="NGX_OPENSSL"
- ngx_feature_run=no
- ngx_feature_incs="#include <openssl/ssl.h>"
-- ngx_feature_path=
-- ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL $NGX_LIBPTHREAD"
-+ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl|sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
-+ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs openssl) $NGX_LIBDL $NGX_LIBPTHREAD"
- ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
- . auto/feature
-
diff --git a/patches/nginx-1.18.0/0100-auto-endianness-add-mechanism-allowing-to-force-resu.patch b/patches/nginx-1.18.0/0100-auto-endianness-add-mechanism-allowing-to-force-resu.patch
deleted file mode 100644
index 8d4ad867a..000000000
--- a/patches/nginx-1.18.0/0100-auto-endianness-add-mechanism-allowing-to-force-resu.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Wed, 2 Sep 2015 18:20:10 +0200
-Subject: [PATCH] auto/endianness: add mechanism allowing to force result
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- auto/endianness | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/auto/endianness b/auto/endianness
-index 1b552b6b37b8..0f2394cfb6a1 100644
---- a/auto/endianness
-+++ b/auto/endianness
-@@ -32,7 +32,7 @@ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
- eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-
- if [ -x $NGX_AUTOTEST ]; then
-- if $NGX_AUTOTEST >/dev/null 2>&1; then
-+ if $NGX_AUTOTEST >/dev/null 2>&1 || test "$ngx_force_have_little_endian" = "yes"; then
- echo " little endian"
- have=NGX_HAVE_LITTLE_ENDIAN . auto/have
- else
diff --git a/patches/nginx-1.18.0/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch b/patches/nginx-1.24.0/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch
index bc4c8d527..2353f6400 100644
--- a/patches/nginx-1.18.0/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch
+++ b/patches/nginx-1.24.0/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch
@@ -14,7 +14,7 @@ Refresh for 1.8.0.
Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
[martin@barkynet.com: Updated for 1.10.0]
Signed-off-by: Martin Bark <martin@barkynet.com>
-Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
Refresh for 1.12.0
---
auto/types/sizeof | 37 ++++++++++++++++++++++++++++---------
diff --git a/patches/nginx-1.18.0/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch b/patches/nginx-1.24.0/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch
index 4742694ce..4742694ce 100644
--- a/patches/nginx-1.18.0/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch
+++ b/patches/nginx-1.24.0/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch
diff --git a/patches/nginx-1.18.0/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch b/patches/nginx-1.24.0/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch
index b468812bd..187dccaa4 100644
--- a/patches/nginx-1.18.0/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch
+++ b/patches/nginx-1.24.0/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch
@@ -14,17 +14,19 @@ Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Refresh for 1.8.0.
Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
+[rebased against v1.20.1]
+Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
auto/cc/conf | 3 +++
auto/cc/name | 1 +
auto/lib/libatomic/conf | 1 +
auto/os/darwin | 3 +++
auto/os/linux | 4 ++++
- auto/unix | 8 ++++++++
- 6 files changed, 20 insertions(+)
+ auto/unix | 7 +++++++
+ 6 files changed, 19 insertions(+)
diff --git a/auto/cc/conf b/auto/cc/conf
-index afbca62bcef9..ad42c8000cca 100644
+index ba31cb88c9c6..2995131ca904 100644
--- a/auto/cc/conf
+++ b/auto/cc/conf
@@ -184,6 +184,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
@@ -104,7 +106,7 @@ index 429468f7fd40..1ed47cca5c89 100644
#include <sys/socket.h>
#include <sys/uio.h>
diff --git a/auto/os/linux b/auto/os/linux
-index 5e280eca75db..50bf84d503d0 100644
+index eb6702679a4b..1d7a0af7ae19 100644
--- a/auto/os/linux
+++ b/auto/os/linux
@@ -37,6 +37,7 @@ fi
@@ -115,7 +117,7 @@ index 5e280eca75db..50bf84d503d0 100644
ngx_feature_incs="#include <sys/epoll.h>"
ngx_feature_path=
ngx_feature_libs=
-@@ -111,6 +112,7 @@ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
+@@ -136,6 +137,7 @@ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
ngx_feature="sendfile()"
ngx_feature_name="NGX_HAVE_SENDFILE"
ngx_feature_run=yes
@@ -123,7 +125,7 @@ index 5e280eca75db..50bf84d503d0 100644
ngx_feature_incs="#include <sys/sendfile.h>
#include <errno.h>"
ngx_feature_path=
-@@ -132,6 +134,7 @@ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
+@@ -157,6 +159,7 @@ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
ngx_feature="sendfile64()"
ngx_feature_name="NGX_HAVE_SENDFILE64"
ngx_feature_run=yes
@@ -131,7 +133,7 @@ index 5e280eca75db..50bf84d503d0 100644
ngx_feature_incs="#include <sys/sendfile.h>
#include <errno.h>"
ngx_feature_path=
-@@ -150,6 +153,7 @@ ngx_include="sys/prctl.h"; . auto/include
+@@ -175,6 +178,7 @@ ngx_include="sys/prctl.h"; . auto/include
ngx_feature="prctl(PR_SET_DUMPABLE)"
ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE"
ngx_feature_run=yes
@@ -140,7 +142,7 @@ index 5e280eca75db..50bf84d503d0 100644
ngx_feature_path=
ngx_feature_libs=
diff --git a/auto/unix b/auto/unix
-index 43d3b25a5456..3da005375cf5 100644
+index 867101982440..679e21213879 100644
--- a/auto/unix
+++ b/auto/unix
@@ -100,6 +100,7 @@ if test -z "$NGX_KQUEUE_CHECKED"; then
@@ -151,31 +153,23 @@ index 43d3b25a5456..3da005375cf5 100644
ngx_feature_incs="#include <sys/event.h>
#include <sys/time.h>"
ngx_feature_path=
-@@ -730,6 +731,7 @@ ngx_feature_test="char buf[1]; struct iovec vec[1]; ssize_t n;
- ngx_feature="sys_nerr"
- ngx_feature_name="NGX_SYS_NERR"
- ngx_feature_run=value
-+ngx_feature_run_force_result="$ngx_force_sys_nerr"
- ngx_feature_incs='#include <errno.h>
- #include <stdio.h>'
- ngx_feature_path=
-@@ -744,6 +746,7 @@ if [ $ngx_found = no ]; then
- ngx_feature="_sys_nerr"
+@@ -722,6 +723,7 @@ if [ $ngx_found = no ]; then
+ ngx_feature="sys_nerr"
ngx_feature_name="NGX_SYS_NERR"
ngx_feature_run=value
+ ngx_feature_run_force_result="$ngx_force_sys_nerr"
ngx_feature_incs='#include <errno.h>
#include <stdio.h>'
ngx_feature_path=
-@@ -759,6 +762,7 @@ if [ $ngx_found = no ]; then
- ngx_feature='maximum errno'
- ngx_feature_name=NGX_SYS_NERR
+@@ -737,6 +739,7 @@ if [ $ngx_found = no ]; then
+ ngx_feature="_sys_nerr"
+ ngx_feature_name="NGX_SYS_NERR"
ngx_feature_run=value
+ ngx_feature_run_force_result="$ngx_force_sys_nerr"
ngx_feature_incs='#include <errno.h>
- #include <string.h>
#include <stdio.h>'
-@@ -841,6 +845,7 @@ ngx_feature_test="void *p; p = memalign(4096, 4096);
+ ngx_feature_path=
+@@ -806,6 +809,7 @@ ngx_feature_test="void *p; p = memalign(4096, 4096);
ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
ngx_feature_name="NGX_HAVE_MAP_ANON"
ngx_feature_run=yes
@@ -183,7 +177,7 @@ index 43d3b25a5456..3da005375cf5 100644
ngx_feature_incs="#include <sys/mman.h>"
ngx_feature_path=
ngx_feature_libs=
-@@ -854,6 +859,7 @@ ngx_feature_test="void *p;
+@@ -819,6 +823,7 @@ ngx_feature_test="void *p;
ngx_feature='mmap("/dev/zero", MAP_SHARED)'
ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
ngx_feature_run=yes
@@ -191,7 +185,7 @@ index 43d3b25a5456..3da005375cf5 100644
ngx_feature_incs="#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>"
-@@ -869,6 +875,7 @@ ngx_feature_test='void *p; int fd;
+@@ -834,6 +839,7 @@ ngx_feature_test='void *p; int fd;
ngx_feature="System V shared memory"
ngx_feature_name="NGX_HAVE_SYSVSHM"
ngx_feature_run=yes
@@ -199,7 +193,7 @@ index 43d3b25a5456..3da005375cf5 100644
ngx_feature_incs="#include <sys/ipc.h>
#include <sys/shm.h>"
ngx_feature_path=
-@@ -883,6 +890,7 @@ ngx_feature_test="int id;
+@@ -848,6 +854,7 @@ ngx_feature_test="int id;
ngx_feature="POSIX semaphores"
ngx_feature_name="NGX_HAVE_POSIX_SEM"
ngx_feature_run=yes
diff --git a/patches/nginx-1.18.0/0004-auto-lib-libxslt-conf-use-pkg-config.patch b/patches/nginx-1.24.0/0004-auto-lib-libxslt-conf-use-pkg-config.patch
index bd0c07b84..b881dc028 100644
--- a/patches/nginx-1.18.0/0004-auto-lib-libxslt-conf-use-pkg-config.patch
+++ b/patches/nginx-1.24.0/0004-auto-lib-libxslt-conf-use-pkg-config.patch
@@ -6,6 +6,8 @@ Change to using pkg-config to find the path to libxslt and its
dependencies.
Signed-off-by: Martin Bark <martin@barkynet.com>
+[Peter: updated for 1.15.6]
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
auto/lib/libxslt/conf | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/patches/nginx-1.18.0/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch b/patches/nginx-1.24.0/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch
index 8a98f197f..b2949a069 100644
--- a/patches/nginx-1.18.0/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch
+++ b/patches/nginx-1.24.0/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch
@@ -14,10 +14,12 @@ Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Refresh for 1.8.0.
Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
+[rebased against v1.20.1]
+Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
auto/os/sys_nerr | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- auto/unix | 10 ++++++++
- 2 files changed, 88 insertions(+)
+ auto/unix | 8 ++++++
+ 2 files changed, 86 insertions(+)
create mode 100644 auto/os/sys_nerr
diff --git a/auto/os/sys_nerr b/auto/os/sys_nerr
@@ -105,21 +107,16 @@ index 000000000000..8970f5f6ec73
+
+echo " $ngx_sys_nerr"
diff --git a/auto/unix b/auto/unix
-index 3da005375cf5..a67ee3e2939c 100644
+index 679e21213879..12059a2301f2 100644
--- a/auto/unix
+++ b/auto/unix
-@@ -736,6 +736,10 @@ ngx_feature_incs='#include <errno.h>
- #include <stdio.h>'
- ngx_feature_path=
- ngx_feature_libs=
-+
-+if false ; then
-+# Disabled because only valid for native build.
-+
- ngx_feature_test='printf("%d", sys_nerr);'
- . auto/feature
-
-@@ -784,6 +788,12 @@ if [ $ngx_found = no ]; then
+@@ -744,10 +744,18 @@ if [ $ngx_found = no ]; then
+ #include <stdio.h>'
+ ngx_feature_path=
+ ngx_feature_libs=
++ if false ; then
++ # Disabled because only valid for native build.
+ ngx_feature_test='printf("%d", _sys_nerr);'
. auto/feature
fi
diff --git a/patches/nginx-1.24.0/0006-auto-lib-openssl-conf-use-pkg-config.patch b/patches/nginx-1.24.0/0006-auto-lib-openssl-conf-use-pkg-config.patch
new file mode 100644
index 000000000..e06ffd6fe
--- /dev/null
+++ b/patches/nginx-1.24.0/0006-auto-lib-openssl-conf-use-pkg-config.patch
@@ -0,0 +1,247 @@
+From: Martin Bark <martin@barkynet.com>
+Date: Fri, 6 May 2016 14:48:31 +0100
+Subject: [PATCH] auto/lib/openssl/conf: use pkg-config
+
+Change to using pkg-config to find the path to openssl and its
+dependencies.
+
+Signed-off-by: Martin Bark <martin@barkynet.com>
+---
+ auto/lib/openssl/conf | 187 +++++++++++++++++++++++++-------------------------
+ 1 file changed, 94 insertions(+), 93 deletions(-)
+
+diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf
+index 4fb52df7fe17..9f30490d745d 100644
+--- a/auto/lib/openssl/conf
++++ b/auto/lib/openssl/conf
+@@ -1,4 +1,3 @@
+-
+ # Copyright (C) Igor Sysoev
+ # Copyright (C) Nginx, Inc.
+
+@@ -7,123 +6,125 @@ if [ $OPENSSL != NONE ]; then
+
+ case "$CC" in
+
+- cl | bcc32)
+- have=NGX_OPENSSL . auto/have
+- have=NGX_SSL . auto/have
+-
+- CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
+-
+- CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
+- CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
+-
+- if [ -f $OPENSSL/ms/do_ms.bat ]; then
+- # before OpenSSL 1.1.0
+- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib"
+- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib"
+- else
+- # OpenSSL 1.1.0+
+- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib"
+- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib"
+- fi
+-
+- # libeay32.lib requires gdi32.lib
+- CORE_LIBS="$CORE_LIBS gdi32.lib"
+- # OpenSSL 1.0.0 requires crypt32.lib
+- CORE_LIBS="$CORE_LIBS crypt32.lib"
+- ;;
+-
+- *)
+- have=NGX_OPENSSL . auto/have
+- have=NGX_SSL . auto/have
+-
+- CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
+- CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
+- CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
+- CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
+- CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
+- CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD"
+-
+- if [ "$NGX_PLATFORM" = win32 ]; then
+- CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
+- fi
+- ;;
++ cl | bcc32)
++ have=NGX_OPENSSL . auto/have
++ have=NGX_SSL . auto/have
++
++ CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
++
++ CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
++ CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
++
++ if [ -f $OPENSSL/ms/do_ms.bat ]; then
++ # before OpenSSL 1.1.0
++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib"
++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib"
++ else
++ # OpenSSL 1.1.0+
++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib"
++ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib"
++ fi
++
++ # libeay32.lib requires gdi32.lib
++ CORE_LIBS="$CORE_LIBS gdi32.lib"
++ # OpenSSL 1.0.0 requires crypt32.lib
++ CORE_LIBS="$CORE_LIBS crypt32.lib"
++ ;;
++
++ *)
++ have=NGX_OPENSSL . auto/have
++ have=NGX_SSL . auto/have
++
++ CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
++ CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
++ CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
++ CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
++ CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
++ CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD"
++
++ if [ "$NGX_PLATFORM" = win32 ]; then
++ CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
++ fi
++ ;;
+ esac
+
+ else
+
+ if [ "$NGX_PLATFORM" != win32 ]; then
+
+- OPENSSL=NO
++ OPENSSL=NO
+
+- ngx_feature="OpenSSL library"
+- ngx_feature_name="NGX_OPENSSL"
+- ngx_feature_run=no
+- ngx_feature_incs="#include <openssl/ssl.h>"
+- ngx_feature_path=
+- ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL $NGX_LIBPTHREAD"
+- ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
+- . auto/feature
++ ngx_feature="OpenSSL library"
++ ngx_feature_name="NGX_OPENSSL"
++ ngx_feature_run=no
++ ngx_feature_incs="#include <openssl/ssl.h>"
++ ngx_feature_path=
++ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl|
++ sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
++ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs openssl)"
++ ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
++ . auto/feature
+
+- if [ $ngx_found = no ]; then
++ if [ $ngx_found = no ]; then
+
+- # FreeBSD port
++ # FreeBSD port
+
+- ngx_feature="OpenSSL library in /usr/local/"
+- ngx_feature_path="/usr/local/include"
++ ngx_feature="OpenSSL library in /usr/local/"
++ ngx_feature_path="/usr/local/include"
+
+- if [ $NGX_RPATH = YES ]; then
+- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto"
+- else
+- ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto"
+- fi
++ if [ $NGX_RPATH = YES ]; then
++ ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto"
++ else
++ ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto"
++ fi
+
+- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
++ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+
+- . auto/feature
+- fi
++ . auto/feature
++ fi
+
+- if [ $ngx_found = no ]; then
++ if [ $ngx_found = no ]; then
+
+- # NetBSD port
++ # NetBSD port
+
+- ngx_feature="OpenSSL library in /usr/pkg/"
+- ngx_feature_path="/usr/pkg/include"
++ ngx_feature="OpenSSL library in /usr/pkg/"
++ ngx_feature_path="/usr/pkg/include"
+
+- if [ $NGX_RPATH = YES ]; then
+- ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto"
+- else
+- ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto"
+- fi
++ if [ $NGX_RPATH = YES ]; then
++ ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto"
++ else
++ ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto"
++ fi
+
+- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
++ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+
+- . auto/feature
+- fi
++ . auto/feature
++ fi
+
+- if [ $ngx_found = no ]; then
++ if [ $ngx_found = no ]; then
+
+- # MacPorts
++ # MacPorts
+
+- ngx_feature="OpenSSL library in /opt/local/"
+- ngx_feature_path="/opt/local/include"
++ ngx_feature="OpenSSL library in /opt/local/"
++ ngx_feature_path="/opt/local/include"
+
+- if [ $NGX_RPATH = YES ]; then
+- ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto"
+- else
+- ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto"
+- fi
++ if [ $NGX_RPATH = YES ]; then
++ ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto"
++ else
++ ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto"
++ fi
+
+- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
++ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+
+- . auto/feature
+- fi
++ . auto/feature
++ fi
+
+- if [ $ngx_found = yes ]; then
+- have=NGX_SSL . auto/have
+- CORE_INCS="$CORE_INCS $ngx_feature_path"
+- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+- OPENSSL=YES
+- fi
++ if [ $ngx_found = yes ]; then
++ have=NGX_SSL . auto/have
++ CORE_INCS="$CORE_INCS $ngx_feature_path"
++ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
++ OPENSSL=YES
++ fi
+ fi
+
+ if [ $OPENSSL != YES ]; then
+@@ -136,7 +137,7 @@ into the system, or build the OpenSSL library statically from the source
+ with nginx by using --with-openssl=<path> option.
+
+ END
+- exit 1
++ exit 1
+ fi
+
+ fi
diff --git a/patches/nginx-1.18.0/0007-auto-lib-libgd-conf-use-pkg-config.patch b/patches/nginx-1.24.0/0007-auto-lib-libgd-conf-use-pkg-config.patch
index 2f1c80013..bc496436a 100644
--- a/patches/nginx-1.18.0/0007-auto-lib-libgd-conf-use-pkg-config.patch
+++ b/patches/nginx-1.24.0/0007-auto-lib-libgd-conf-use-pkg-config.patch
@@ -6,22 +6,27 @@ Change to using pkg-config to find the path to libgd and its
dependencies.
Signed-off-by: Martin Bark <martin@barkynet.com>
+[Peter: updated for 1.15.6]
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+[Fabrice: use pkg-config instead of gdlib-config]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
- auto/lib/libgd/conf | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ auto/lib/libgd/conf | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/auto/lib/libgd/conf b/auto/lib/libgd/conf
-index 678639767a63..1a4379a5e45c 100644
+index 678639767a63..031bcfec86ad 100644
--- a/auto/lib/libgd/conf
+++ b/auto/lib/libgd/conf
-@@ -7,8 +7,8 @@
+@@ -7,8 +7,9 @@
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <gd.h>"
- ngx_feature_path=
- ngx_feature_libs="-lgd"
-+ ngx_feature_path="$(${GDLIB_CONFIG:=gdlib-config} --includedir)"
-+ ngx_feature_libs="$(${GDLIB_CONFIG:=gdlib-config} --libs)"
++ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I gdlib|
++ sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
++ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs gdlib)"
ngx_feature_test="gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);
(void) img"
. auto/feature
diff --git a/patches/nginx-1.18.0/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch b/patches/nginx-1.24.0/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch
index 43b3e2e38..a1eb9e5cc 100644
--- a/patches/nginx-1.18.0/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch
+++ b/patches/nginx-1.24.0/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch
@@ -9,7 +9,7 @@ Signed-off-by: Martin Bark <martin@barkynet.com>
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h
-index 3036caebf630..e282a1f7533c 100644
+index 88fef47cefeb..ceb2f6175bf5 100644
--- a/src/os/unix/ngx_linux_config.h
+++ b/src/os/unix/ngx_linux_config.h
@@ -55,10 +55,12 @@
diff --git a/patches/nginx-1.24.0/0009-auto-os-linux-fix-build-with-libxcrypt.patch b/patches/nginx-1.24.0/0009-auto-os-linux-fix-build-with-libxcrypt.patch
new file mode 100644
index 000000000..a65123aeb
--- /dev/null
+++ b/patches/nginx-1.24.0/0009-auto-os-linux-fix-build-with-libxcrypt.patch
@@ -0,0 +1,34 @@
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 2 Apr 2021 09:18:26 +0200
+Subject: [PATCH] auto/os/linux: fix build with libxcrypt
+
+If crypt_r is found in libcrypt, add -lcrypt to CORE_LIBS to avoid the
+following build failure with libxcrypt:
+
+objs/ngx_modules.o \
+-lpcre -L/home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/../xtensa-buildroot-linux-uclibc/sysroot/usr/lib -lssl -lcrypto -L/home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/../xtensa-buildroot-linux-uclibc/sysroot/usr/lib -lxslt -lxml2 -lGeoIP \
+-Wl,-E
+/home/giuliobenetti/autobuild/run/instance-3/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/9.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: objs/src/os/unix/ngx_user.o:/home/giuliobenetti/autobuild/run/instance-3/output-1/build/nginx-1.18.0/src/os/unix/ngx_user.c:18: undefined reference to `crypt_r'
+
+Fixes:
+ - http://autobuild.buildroot.org/results/79a51b0d348e756517b5c9ce815a67f5c657e7e6
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ auto/os/linux | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/auto/os/linux b/auto/os/linux
+index 1d7a0af7ae19..d8afcb78ca37 100644
+--- a/auto/os/linux
++++ b/auto/os/linux
+@@ -232,6 +232,9 @@ ngx_feature_test="struct crypt_data cd;
+ crypt_r(\"key\", \"salt\", &cd);"
+ . auto/feature
+
++if [ $ngx_found = yes ]; then
++ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
++fi
+
+ ngx_include="sys/vfs.h"; . auto/include
+
diff --git a/patches/nginx-1.24.0/0010-Allow-forcing-of-endianness-for-cross-compilation.patch b/patches/nginx-1.24.0/0010-Allow-forcing-of-endianness-for-cross-compilation.patch
new file mode 100644
index 000000000..da9f27cc6
--- /dev/null
+++ b/patches/nginx-1.24.0/0010-Allow-forcing-of-endianness-for-cross-compilation.patch
@@ -0,0 +1,114 @@
+From: Nevo Hed <nhed+buildroot@starry.com>
+Date: Mon, 30 Aug 2021 13:28:13 -0400
+Subject: [PATCH] Allow forcing of endianness for cross-compilation
+
+Upstream-status: Invalid (upstream doesn't support cross-compilation)
+See https://trac.nginx.org/nginx/ticket/2240
+
+Signed-off-by: Nevo Hed <nhed+buildroot@starry.com>
+---
+ auto/endianness | 61 +++++++++++++++++++++++++++++++++++++--------------------
+ auto/options | 6 ++++++
+ 2 files changed, 46 insertions(+), 21 deletions(-)
+
+diff --git a/auto/endianness b/auto/endianness
+index 1b552b6b37b8..4b2a3cd75bcc 100644
+--- a/auto/endianness
++++ b/auto/endianness
+@@ -26,25 +26,44 @@ int main(void) {
+
+ END
+
+-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
+-
+-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+-
+-if [ -x $NGX_AUTOTEST ]; then
+- if $NGX_AUTOTEST >/dev/null 2>&1; then
+- echo " little endian"
++case "${NGX_FORCE_ENDIANNESS}" in
++ little)
++ echo " little endian (forced)"
+ have=NGX_HAVE_LITTLE_ENDIAN . auto/have
+- else
+- echo " big endian"
+- fi
+-
+- rm -rf $NGX_AUTOTEST*
+-
+-else
+- rm -rf $NGX_AUTOTEST*
+-
+- echo
+- echo "$0: error: cannot detect system byte ordering"
+- exit 1
+-fi
++ ;;
++
++ big)
++ echo " big endian (forced)"
++ ;;
++
++ "")
++ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
++ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
++
++ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
++
++ if [ -x $NGX_AUTOTEST ]; then
++ if $NGX_AUTOTEST >/dev/null 2>&1; then
++ echo " little endian"
++ have=NGX_HAVE_LITTLE_ENDIAN . auto/have
++ else
++ echo " big endian"
++ fi
++
++ rm -rf $NGX_AUTOTEST*
++
++ else
++ rm -rf $NGX_AUTOTEST*
++
++ echo
++ echo "$0: error: cannot detect system byte ordering"
++ exit 1
++ fi
++ ;;
++
++ *)
++ echo
++ echo "$0: error: invalid \"--force-endianness=${NGX_FORCE_ENDIANNESS}\""
++ exit 1
++ ;;
++esac
+diff --git a/auto/options b/auto/options
+index 48f3a1a4251b..7f4163d3449a 100644
+--- a/auto/options
++++ b/auto/options
+@@ -17,6 +17,8 @@ NGX_USER=
+ NGX_GROUP=
+ NGX_BUILD=
+
++NGX_FORCE_ENDIANNESS=
++
+ CC=${CC:-cc}
+ CPP=
+ NGX_OBJS=objs
+@@ -197,6 +199,8 @@ do
+ --user=*) NGX_USER="$value" ;;
+ --group=*) NGX_GROUP="$value" ;;
+
++ --force-endianness=*) NGX_FORCE_ENDIANNESS="$value" ;;
++
+ --crossbuild=*) NGX_PLATFORM="$value" ;;
+
+ --build=*) NGX_BUILD="$value" ;;
+@@ -434,6 +438,8 @@ cat << END
+ --build=NAME set build name
+ --builddir=DIR set build directory
+
++ --force-endianness=<big>|<little> force endianness
++
+ --with-select_module enable select module
+ --without-select_module disable select module
+ --with-poll_module enable poll module
diff --git a/patches/nginx-1.18.0/0101-auto-unix-allow-overriding-the-IPv6-build-tests.patch b/patches/nginx-1.24.0/0100-auto-unix-allow-overriding-the-IPv6-build-tests.patch
index d8c4a04b1..81e04691b 100644
--- a/patches/nginx-1.18.0/0101-auto-unix-allow-overriding-the-IPv6-build-tests.patch
+++ b/patches/nginx-1.24.0/0100-auto-unix-allow-overriding-the-IPv6-build-tests.patch
@@ -30,7 +30,7 @@ index 8016d802e7a8..a9c6b6ee5eeb 100644
END
diff --git a/auto/unix b/auto/unix
-index a67ee3e2939c..1c3c1cf5996f 100644
+index 12059a2301f2..f467fef04868 100644
--- a/auto/unix
+++ b/auto/unix
@@ -440,7 +440,8 @@ ngx_feature_test="struct in_pktinfo pkt;
@@ -43,7 +43,7 @@ index a67ee3e2939c..1c3c1cf5996f 100644
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>"
ngx_feature_path=
-@@ -668,7 +669,8 @@ ngx_param=NGX_MAX_TIME_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
+@@ -645,7 +646,8 @@ ngx_param=NGX_MAX_TIME_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
ngx_feature="AF_INET6"
ngx_feature_name="NGX_HAVE_INET6"
diff --git a/patches/nginx-1.18.0/series b/patches/nginx-1.24.0/series
index 92d0a70c8..1eeb9c431 100644
--- a/patches/nginx-1.18.0/series
+++ b/patches/nginx-1.24.0/series
@@ -9,7 +9,8 @@
0006-auto-lib-openssl-conf-use-pkg-config.patch
0007-auto-lib-libgd-conf-use-pkg-config.patch
0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch
+0009-auto-os-linux-fix-build-with-libxcrypt.patch
+0010-Allow-forcing-of-endianness-for-cross-compilation.patch
#tag:ptxdist --start-number 100
-0100-auto-endianness-add-mechanism-allowing-to-force-resu.patch
-0101-auto-unix-allow-overriding-the-IPv6-build-tests.patch
-# 2d82d97a87698e491d40c417a32a8a6b - git-ptx-patches magic
+0100-auto-unix-allow-overriding-the-IPv6-build-tests.patch
+# 8b3a0cda12fc98d0ea43c37b609327f9 - git-ptx-patches magic
diff --git a/patches/ninja-1.8.2/0007-don-t-close-open-fds.patch b/patches/ninja-1.11.1.g95dee.kitware.jobserver-1/0001-don-t-close-open-fds.patch
index 8da54d4bd..0155a62bb 100644
--- a/patches/ninja-1.8.2/0007-don-t-close-open-fds.patch
+++ b/patches/ninja-1.11.1.g95dee.kitware.jobserver-1/0001-don-t-close-open-fds.patch
@@ -10,10 +10,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.py b/configure.py
-index 41d95469c00d..d5e34a0eeb3a 100755
+index a239b90eef44..1f287c116d66 100755
--- a/configure.py
+++ b/configure.py
-@@ -186,7 +186,7 @@ class Bootstrap:
+@@ -191,7 +191,7 @@ class Bootstrap:
try:
if self.verbose:
print(cmdline)
@@ -22,7 +22,7 @@ index 41d95469c00d..d5e34a0eeb3a 100755
except subprocess.CalledProcessError:
print('when running: ', cmdline)
raise
-@@ -683,4 +683,4 @@ if options.bootstrap:
+@@ -722,4 +722,4 @@ if options.bootstrap:
if options.verbose:
rebuild_args.append('-v')
diff --git a/patches/ninja-1.11.1.g95dee.kitware.jobserver-1/series b/patches/ninja-1.11.1.g95dee.kitware.jobserver-1/series
new file mode 100644
index 000000000..05bd05b30
--- /dev/null
+++ b/patches/ninja-1.11.1.g95dee.kitware.jobserver-1/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-don-t-close-open-fds.patch
+# 9f9c2c8544d68ab2c7db95cac6cf30bc - git-ptx-patches magic
diff --git a/patches/ninja-1.8.2/0001-Add-GNU-make-jobserver-client-support.patch b/patches/ninja-1.8.2/0001-Add-GNU-make-jobserver-client-support.patch
deleted file mode 100644
index 5c23e036e..000000000
--- a/patches/ninja-1.8.2/0001-Add-GNU-make-jobserver-client-support.patch
+++ /dev/null
@@ -1,478 +0,0 @@
-From: Stefan Becker <stefanb@gpartner-nvidia.com>
-Date: Tue, 22 Mar 2016 13:48:07 +0200
-Subject: [PATCH] Add GNU make jobserver client support
-
-- add new TokenPool interface
-- GNU make implementation for TokenPool parses and verifies the magic
- information from the MAKEFLAGS environment variable
-- RealCommandRunner tries to acquire TokenPool
- * if no token pool is available then there is no change in behaviour
-- When a token pool is available then RealCommandRunner behaviour
- changes as follows
- * CanRunMore() only returns true if TokenPool::Acquire() returns true
- * StartCommand() calls TokenPool::Reserve()
- * WaitForCommand() calls TokenPool::Release()
-
-Documentation for GNU make jobserver
-
- http://make.mad-scientist.net/papers/jobserver-implementation/
-
-Fixes https://github.com/ninja-build/ninja/issues/1139
----
- configure.py | 2 +
- src/build.cc | 59 ++++++++-----
- src/build.h | 3 +
- src/tokenpool-gnu-make.cc | 211 ++++++++++++++++++++++++++++++++++++++++++++++
- src/tokenpool-none.cc | 27 ++++++
- src/tokenpool.h | 26 ++++++
- 6 files changed, 308 insertions(+), 20 deletions(-)
- create mode 100644 src/tokenpool-gnu-make.cc
- create mode 100644 src/tokenpool-none.cc
- create mode 100644 src/tokenpool.h
-
-diff --git a/configure.py b/configure.py
-index a4437489426e..41d95469c00d 100755
---- a/configure.py
-+++ b/configure.py
-@@ -499,6 +499,7 @@ for name in ['build',
- objs += cxx(name)
- if platform.is_windows():
- for name in ['subprocess-win32',
-+ 'tokenpool-none',
- 'includes_normalize-win32',
- 'msvc_helper-win32',
- 'msvc_helper_main-win32']:
-@@ -508,6 +509,7 @@ if platform.is_windows():
- objs += cc('getopt')
- else:
- objs += cxx('subprocess-posix')
-+ objs += cxx('tokenpool-gnu-make')
- if platform.is_aix():
- objs += cc('getopt')
- if platform.is_msvc():
-diff --git a/src/build.cc b/src/build.cc
-index 61ef0e849add..cc796ff838fa 100644
---- a/src/build.cc
-+++ b/src/build.cc
-@@ -38,6 +38,7 @@
- #include "graph.h"
- #include "state.h"
- #include "subprocess.h"
-+#include "tokenpool.h"
- #include "util.h"
-
- namespace {
-@@ -347,7 +348,7 @@ bool Plan::AddSubTarget(Node* node, Node* dependent, string* err) {
- }
-
- Edge* Plan::FindWork() {
-- if (ready_.empty())
-+ if (!more_ready())
- return NULL;
- set<Edge*>::iterator e = ready_.begin();
- Edge* edge = *e;
-@@ -485,8 +486,8 @@ void Plan::Dump() {
- }
-
- struct RealCommandRunner : public CommandRunner {
-- explicit RealCommandRunner(const BuildConfig& config) : config_(config) {}
-- virtual ~RealCommandRunner() {}
-+ explicit RealCommandRunner(const BuildConfig& config);
-+ virtual ~RealCommandRunner();
- virtual bool CanRunMore();
- virtual bool StartCommand(Edge* edge);
- virtual bool WaitForCommand(Result* result);
-@@ -495,9 +496,18 @@ struct RealCommandRunner : public CommandRunner {
-
- const BuildConfig& config_;
- SubprocessSet subprocs_;
-+ TokenPool *tokens_;
- map<Subprocess*, Edge*> subproc_to_edge_;
- };
-
-+RealCommandRunner::RealCommandRunner(const BuildConfig& config) : config_(config) {
-+ tokens_ = TokenPool::Get();
-+}
-+
-+RealCommandRunner::~RealCommandRunner() {
-+ delete tokens_;
-+}
-+
- vector<Edge*> RealCommandRunner::GetActiveEdges() {
- vector<Edge*> edges;
- for (map<Subprocess*, Edge*>::iterator e = subproc_to_edge_.begin();
-@@ -508,14 +518,18 @@ vector<Edge*> RealCommandRunner::GetActiveEdges() {
-
- void RealCommandRunner::Abort() {
- subprocs_.Clear();
-+ if (tokens_)
-+ tokens_->Clear();
- }
-
- bool RealCommandRunner::CanRunMore() {
- size_t subproc_number =
- subprocs_.running_.size() + subprocs_.finished_.size();
- return (int)subproc_number < config_.parallelism
-- && ((subprocs_.running_.empty() || config_.max_load_average <= 0.0f)
-- || GetLoadAverage() < config_.max_load_average);
-+ && (subprocs_.running_.empty() ||
-+ ((config_.max_load_average <= 0.0f ||
-+ GetLoadAverage() < config_.max_load_average)
-+ && (!tokens_ || tokens_->Acquire())));
- }
-
- bool RealCommandRunner::StartCommand(Edge* edge) {
-@@ -523,6 +537,8 @@ bool RealCommandRunner::StartCommand(Edge* edge) {
- Subprocess* subproc = subprocs_.Add(command, edge->use_console());
- if (!subproc)
- return false;
-+ if (tokens_)
-+ tokens_->Reserve();
- subproc_to_edge_.insert(make_pair(subproc, edge));
-
- return true;
-@@ -536,6 +552,9 @@ bool RealCommandRunner::WaitForCommand(Result* result) {
- return false;
- }
-
-+ if (tokens_)
-+ tokens_->Release();
-+
- result->status = subproc->Finish();
- result->output = subproc->GetOutput();
-
-@@ -644,23 +663,23 @@ bool Builder::Build(string* err) {
- // Second, we attempt to wait for / reap the next finished command.
- while (plan_.more_to_do()) {
- // See if we can start any more commands.
-- if (failures_allowed && command_runner_->CanRunMore()) {
-- if (Edge* edge = plan_.FindWork()) {
-- if (!StartEdge(edge, err)) {
-- Cleanup();
-- status_->BuildFinished();
-- return false;
-- }
--
-- if (edge->is_phony()) {
-- plan_.EdgeFinished(edge, Plan::kEdgeSucceeded);
-- } else {
-- ++pending_commands;
-- }
-+ if (failures_allowed && plan_.more_ready() &&
-+ command_runner_->CanRunMore()) {
-+ Edge* edge = plan_.FindWork();
-+ if (!StartEdge(edge, err)) {
-+ Cleanup();
-+ status_->BuildFinished();
-+ return false;
-+ }
-
-- // We made some progress; go back to the main loop.
-- continue;
-+ if (edge->is_phony()) {
-+ plan_.EdgeFinished(edge, Plan::kEdgeSucceeded);
-+ } else {
-+ ++pending_commands;
- }
-+
-+ // We made some progress; go back to the main loop.
-+ continue;
- }
-
- // See if we can reap any finished commands.
-diff --git a/src/build.h b/src/build.h
-index 43786f1c928f..cca7e8d8181d 100644
---- a/src/build.h
-+++ b/src/build.h
-@@ -53,6 +53,9 @@ struct Plan {
- /// Returns true if there's more work to be done.
- bool more_to_do() const { return wanted_edges_ > 0 && command_edges_ > 0; }
-
-+ /// Returns true if there's more edges ready to start
-+ bool more_ready() const { return !ready_.empty(); }
-+
- /// Dumps the current state of the plan.
- void Dump();
-
-diff --git a/src/tokenpool-gnu-make.cc b/src/tokenpool-gnu-make.cc
-new file mode 100644
-index 000000000000..a8f9b7139d23
---- /dev/null
-+++ b/src/tokenpool-gnu-make.cc
-@@ -0,0 +1,211 @@
-+// Copyright 2016 Google Inc. All Rights Reserved.
-+//
-+// Licensed under the Apache License, Version 2.0 (the "License");
-+// you may not use this file except in compliance with the License.
-+// You may obtain a copy of the License at
-+//
-+// http://www.apache.org/licenses/LICENSE-2.0
-+//
-+// Unless required by applicable law or agreed to in writing, software
-+// distributed under the License is distributed on an "AS IS" BASIS,
-+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+// See the License for the specific language governing permissions and
-+// limitations under the License.
-+
-+#include "tokenpool.h"
-+
-+#include <errno.h>
-+#include <fcntl.h>
-+#include <poll.h>
-+#include <unistd.h>
-+#include <signal.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <stdlib.h>
-+
-+// TokenPool implementation for GNU make jobserver
-+// (http://make.mad-scientist.net/papers/jobserver-implementation/)
-+struct GNUmakeTokenPool : public TokenPool {
-+ GNUmakeTokenPool();
-+ virtual ~GNUmakeTokenPool();
-+
-+ virtual bool Acquire();
-+ virtual void Reserve();
-+ virtual void Release();
-+ virtual void Clear();
-+
-+ bool Setup();
-+
-+ private:
-+ int available_;
-+ int used_;
-+
-+#ifdef _WIN32
-+ // @TODO
-+#else
-+ int rfd_;
-+ int wfd_;
-+
-+ struct sigaction old_act_;
-+ bool restore_;
-+
-+ static int dup_rfd_;
-+ static void CloseDupRfd(int signum);
-+
-+ bool CheckFd(int fd);
-+ bool SetAlarmHandler();
-+#endif
-+
-+ void Return();
-+};
-+
-+// every instance owns an implicit token -> available_ == 1
-+GNUmakeTokenPool::GNUmakeTokenPool() : available_(1), used_(0),
-+ rfd_(-1), wfd_(-1), restore_(false) {
-+}
-+
-+GNUmakeTokenPool::~GNUmakeTokenPool() {
-+ Clear();
-+ if (restore_)
-+ sigaction(SIGALRM, &old_act_, NULL);
-+}
-+
-+bool GNUmakeTokenPool::CheckFd(int fd) {
-+ if (fd < 0)
-+ return false;
-+ int ret = fcntl(fd, F_GETFD);
-+ if (ret < 0)
-+ return false;
-+ return true;
-+}
-+
-+int GNUmakeTokenPool::dup_rfd_ = -1;
-+
-+void GNUmakeTokenPool::CloseDupRfd(int signum) {
-+ close(dup_rfd_);
-+ dup_rfd_ = -1;
-+}
-+
-+bool GNUmakeTokenPool::SetAlarmHandler() {
-+ struct sigaction act;
-+ memset(&act, 0, sizeof(act));
-+ act.sa_handler = CloseDupRfd;
-+ if (sigaction(SIGALRM, &act, &old_act_) < 0) {
-+ perror("sigaction:");
-+ return(false);
-+ } else {
-+ restore_ = true;
-+ return(true);
-+ }
-+}
-+
-+bool GNUmakeTokenPool::Setup() {
-+ const char *value = getenv("MAKEFLAGS");
-+ if (value) {
-+ // GNU make <= 4.1
-+ const char *jobserver = strstr(value, "--jobserver-fds=");
-+ // GNU make => 4.2
-+ if (!jobserver)
-+ jobserver = strstr(value, "--jobserver-auth=");
-+ if (jobserver) {
-+ int rfd = -1;
-+ int wfd = -1;
-+ if ((sscanf(jobserver, "%*[^=]=%d,%d", &rfd, &wfd) == 2) &&
-+ CheckFd(rfd) &&
-+ CheckFd(wfd) &&
-+ SetAlarmHandler()) {
-+ printf("ninja: using GNU make jobserver.\n");
-+ rfd_ = rfd;
-+ wfd_ = wfd;
-+ return true;
-+ }
-+ }
-+ }
-+
-+ return false;
-+}
-+
-+bool GNUmakeTokenPool::Acquire() {
-+ if (available_ > 0)
-+ return true;
-+
-+#ifdef USE_PPOLL
-+ pollfd pollfds[] = {{rfd_, POLLIN, 0}};
-+ int ret = poll(pollfds, 1, 0);
-+#else
-+ fd_set set;
-+ struct timeval timeout = { 0, 0 };
-+ FD_ZERO(&set);
-+ FD_SET(rfd_, &set);
-+ int ret = select(rfd_ + 1, &set, NULL, NULL, &timeout);
-+#endif
-+ if (ret > 0) {
-+ dup_rfd_ = dup(rfd_);
-+
-+ if (dup_rfd_ != -1) {
-+ struct sigaction act, old_act;
-+ int ret = 0;
-+
-+ memset(&act, 0, sizeof(act));
-+ act.sa_handler = CloseDupRfd;
-+ if (sigaction(SIGCHLD, &act, &old_act) == 0) {
-+ char buf;
-+
-+ // block until token read, child exits or timeout
-+ alarm(1);
-+ ret = read(dup_rfd_, &buf, 1);
-+ alarm(0);
-+
-+ sigaction(SIGCHLD, &old_act, NULL);
-+ }
-+
-+ CloseDupRfd(0);
-+
-+ if (ret > 0) {
-+ available_++;
-+ return true;
-+ }
-+ }
-+ }
-+ return false;
-+}
-+
-+void GNUmakeTokenPool::Reserve() {
-+ available_--;
-+ used_++;
-+}
-+
-+void GNUmakeTokenPool::Return() {
-+ const char buf = '+';
-+ while (1) {
-+ int ret = write(wfd_, &buf, 1);
-+ if (ret > 0)
-+ available_--;
-+ if ((ret != -1) || (errno != EINTR))
-+ return;
-+ // write got interrupted - retry
-+ }
-+}
-+
-+void GNUmakeTokenPool::Release() {
-+ available_++;
-+ used_--;
-+ if (available_ > 1)
-+ Return();
-+}
-+
-+void GNUmakeTokenPool::Clear() {
-+ while (used_ > 0)
-+ Release();
-+ while (available_ > 1)
-+ Return();
-+}
-+
-+struct TokenPool *TokenPool::Get(void) {
-+ GNUmakeTokenPool *tokenpool = new GNUmakeTokenPool;
-+ if (tokenpool->Setup())
-+ return tokenpool;
-+ else
-+ delete tokenpool;
-+ return NULL;
-+}
-diff --git a/src/tokenpool-none.cc b/src/tokenpool-none.cc
-new file mode 100644
-index 000000000000..602b3316f54d
---- /dev/null
-+++ b/src/tokenpool-none.cc
-@@ -0,0 +1,27 @@
-+// Copyright 2016 Google Inc. All Rights Reserved.
-+//
-+// Licensed under the Apache License, Version 2.0 (the "License");
-+// you may not use this file except in compliance with the License.
-+// You may obtain a copy of the License at
-+//
-+// http://www.apache.org/licenses/LICENSE-2.0
-+//
-+// Unless required by applicable law or agreed to in writing, software
-+// distributed under the License is distributed on an "AS IS" BASIS,
-+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+// See the License for the specific language governing permissions and
-+// limitations under the License.
-+
-+#include "tokenpool.h"
-+
-+#include <fcntl.h>
-+#include <poll.h>
-+#include <unistd.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <stdlib.h>
-+
-+// No-op TokenPool implementation
-+struct TokenPool *TokenPool::Get(void) {
-+ return NULL;
-+}
-diff --git a/src/tokenpool.h b/src/tokenpool.h
-new file mode 100644
-index 000000000000..f560b1083b65
---- /dev/null
-+++ b/src/tokenpool.h
-@@ -0,0 +1,26 @@
-+// Copyright 2016 Google Inc. All Rights Reserved.
-+//
-+// Licensed under the Apache License, Version 2.0 (the "License");
-+// you may not use this file except in compliance with the License.
-+// You may obtain a copy of the License at
-+//
-+// http://www.apache.org/licenses/LICENSE-2.0
-+//
-+// Unless required by applicable law or agreed to in writing, software
-+// distributed under the License is distributed on an "AS IS" BASIS,
-+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+// See the License for the specific language governing permissions and
-+// limitations under the License.
-+
-+// interface to token pool
-+struct TokenPool {
-+ virtual ~TokenPool() {}
-+
-+ virtual bool Acquire() = 0;
-+ virtual void Reserve() = 0;
-+ virtual void Release() = 0;
-+ virtual void Clear() = 0;
-+
-+ // returns NULL if token pool is not available
-+ static struct TokenPool *Get(void);
-+};
diff --git a/patches/ninja-1.8.2/0002-Add-TokenPool-monitoring-to-SubprocessSet-DoWork.patch b/patches/ninja-1.8.2/0002-Add-TokenPool-monitoring-to-SubprocessSet-DoWork.patch
deleted file mode 100644
index f8ee646d7..000000000
--- a/patches/ninja-1.8.2/0002-Add-TokenPool-monitoring-to-SubprocessSet-DoWork.patch
+++ /dev/null
@@ -1,554 +0,0 @@
-From: Stefan Becker <stefanb@gpartner-nvidia.com>
-Date: Fri, 27 May 2016 16:47:10 +0300
-Subject: [PATCH] Add TokenPool monitoring to SubprocessSet::DoWork()
-
-Improve on the original jobserver client implementation. This makes
-ninja a more aggressive GNU make jobserver client.
-
-- add monitor interface to TokenPool
-- TokenPool is passed down when main loop indicates that more work is
- ready and would be allowed to start if a token becomes available
-- posix: update DoWork() to monitor TokenPool read file descriptor
-- WaitForCommand() exits when DoWork() sets token flag
-- Main loop starts over when WaitForCommand() sets token exit status
----
- src/build.cc | 53 +++++++++++++++++++++++++++++++++++------------
- src/build.h | 3 ++-
- src/build_test.cc | 9 ++++++--
- src/exit_status.h | 3 ++-
- src/subprocess-posix.cc | 33 +++++++++++++++++++++++++++--
- src/subprocess-win32.cc | 2 +-
- src/subprocess.h | 8 ++++++-
- src/subprocess_test.cc | 47 ++++++++++++++++++++++++++++-------------
- src/tokenpool-gnu-make.cc | 5 +++++
- src/tokenpool.h | 6 ++++++
- 10 files changed, 134 insertions(+), 35 deletions(-)
-
-diff --git a/src/build.cc b/src/build.cc
-index cc796ff838fa..219bb9f1ff48 100644
---- a/src/build.cc
-+++ b/src/build.cc
-@@ -49,8 +49,9 @@ struct DryRunCommandRunner : public CommandRunner {
-
- // Overridden from CommandRunner:
- virtual bool CanRunMore();
-+ virtual bool AcquireToken();
- virtual bool StartCommand(Edge* edge);
-- virtual bool WaitForCommand(Result* result);
-+ virtual bool WaitForCommand(Result* result, bool more_ready);
-
- private:
- queue<Edge*> finished_;
-@@ -60,12 +61,16 @@ bool DryRunCommandRunner::CanRunMore() {
- return true;
- }
-
-+bool DryRunCommandRunner::AcquireToken() {
-+ return true;
-+}
-+
- bool DryRunCommandRunner::StartCommand(Edge* edge) {
- finished_.push(edge);
- return true;
- }
-
--bool DryRunCommandRunner::WaitForCommand(Result* result) {
-+bool DryRunCommandRunner::WaitForCommand(Result* result, bool more_ready) {
- if (finished_.empty())
- return false;
-
-@@ -489,8 +494,9 @@ struct RealCommandRunner : public CommandRunner {
- explicit RealCommandRunner(const BuildConfig& config);
- virtual ~RealCommandRunner();
- virtual bool CanRunMore();
-+ virtual bool AcquireToken();
- virtual bool StartCommand(Edge* edge);
-- virtual bool WaitForCommand(Result* result);
-+ virtual bool WaitForCommand(Result* result, bool more_ready);
- virtual vector<Edge*> GetActiveEdges();
- virtual void Abort();
-
-@@ -527,9 +533,12 @@ bool RealCommandRunner::CanRunMore() {
- subprocs_.running_.size() + subprocs_.finished_.size();
- return (int)subproc_number < config_.parallelism
- && (subprocs_.running_.empty() ||
-- ((config_.max_load_average <= 0.0f ||
-- GetLoadAverage() < config_.max_load_average)
-- && (!tokens_ || tokens_->Acquire())));
-+ (config_.max_load_average <= 0.0f ||
-+ GetLoadAverage() < config_.max_load_average));
-+}
-+
-+bool RealCommandRunner::AcquireToken() {
-+ return (!tokens_ || tokens_->Acquire());
- }
-
- bool RealCommandRunner::StartCommand(Edge* edge) {
-@@ -544,14 +553,23 @@ bool RealCommandRunner::StartCommand(Edge* edge) {
- return true;
- }
-
--bool RealCommandRunner::WaitForCommand(Result* result) {
-+bool RealCommandRunner::WaitForCommand(Result* result, bool more_ready) {
- Subprocess* subproc;
-- while ((subproc = subprocs_.NextFinished()) == NULL) {
-- bool interrupted = subprocs_.DoWork();
-+ subprocs_.ResetTokenAvailable();
-+ while (((subproc = subprocs_.NextFinished()) == NULL) &&
-+ !subprocs_.IsTokenAvailable()) {
-+ bool interrupted = subprocs_.DoWork(more_ready ? tokens_ : NULL);
- if (interrupted)
- return false;
- }
-
-+ // token became available
-+ if (subproc == NULL) {
-+ result->status = ExitTokenAvailable;
-+ return true;
-+ }
-+
-+ // command completed
- if (tokens_)
- tokens_->Release();
-
-@@ -662,9 +680,14 @@ bool Builder::Build(string* err) {
- // command runner.
- // Second, we attempt to wait for / reap the next finished command.
- while (plan_.more_to_do()) {
-- // See if we can start any more commands.
-- if (failures_allowed && plan_.more_ready() &&
-- command_runner_->CanRunMore()) {
-+ // See if we can start any more commands...
-+ bool can_run_more =
-+ failures_allowed &&
-+ plan_.more_ready() &&
-+ command_runner_->CanRunMore();
-+
-+ // ... but we also need a token to do that.
-+ if (can_run_more && command_runner_->AcquireToken()) {
- Edge* edge = plan_.FindWork();
- if (!StartEdge(edge, err)) {
- Cleanup();
-@@ -685,7 +708,7 @@ bool Builder::Build(string* err) {
- // See if we can reap any finished commands.
- if (pending_commands) {
- CommandRunner::Result result;
-- if (!command_runner_->WaitForCommand(&result) ||
-+ if (!command_runner_->WaitForCommand(&result, can_run_more) ||
- result.status == ExitInterrupted) {
- Cleanup();
- status_->BuildFinished();
-@@ -693,6 +716,10 @@ bool Builder::Build(string* err) {
- return false;
- }
-
-+ // We might be able to start another command; start the main loop over.
-+ if (result.status == ExitTokenAvailable)
-+ continue;
-+
- --pending_commands;
- if (!FinishCommand(&result, err)) {
- Cleanup();
-diff --git a/src/build.h b/src/build.h
-index cca7e8d8181d..ca605e62e0e3 100644
---- a/src/build.h
-+++ b/src/build.h
-@@ -108,6 +108,7 @@ private:
- struct CommandRunner {
- virtual ~CommandRunner() {}
- virtual bool CanRunMore() = 0;
-+ virtual bool AcquireToken() = 0;
- virtual bool StartCommand(Edge* edge) = 0;
-
- /// The result of waiting for a command.
-@@ -119,7 +120,7 @@ struct CommandRunner {
- bool success() const { return status == ExitSuccess; }
- };
- /// Wait for a command to complete, or return false if interrupted.
-- virtual bool WaitForCommand(Result* result) = 0;
-+ virtual bool WaitForCommand(Result* result, bool more_ready) = 0;
-
- virtual vector<Edge*> GetActiveEdges() { return vector<Edge*>(); }
- virtual void Abort() {}
-diff --git a/src/build_test.cc b/src/build_test.cc
-index 46ab33ef86c8..a1022edcf546 100644
---- a/src/build_test.cc
-+++ b/src/build_test.cc
-@@ -445,8 +445,9 @@ struct FakeCommandRunner : public CommandRunner {
-
- // CommandRunner impl
- virtual bool CanRunMore();
-+ virtual bool AcquireToken();
- virtual bool StartCommand(Edge* edge);
-- virtual bool WaitForCommand(Result* result);
-+ virtual bool WaitForCommand(Result* result, bool more_ready);
- virtual vector<Edge*> GetActiveEdges();
- virtual void Abort();
-
-@@ -547,6 +548,10 @@ bool FakeCommandRunner::CanRunMore() {
- return last_command_ == NULL;
- }
-
-+bool FakeCommandRunner::AcquireToken() {
-+ return true;
-+}
-+
- bool FakeCommandRunner::StartCommand(Edge* edge) {
- assert(!last_command_);
- commands_ran_.push_back(edge->EvaluateCommand());
-@@ -575,7 +580,7 @@ bool FakeCommandRunner::StartCommand(Edge* edge) {
- return true;
- }
-
--bool FakeCommandRunner::WaitForCommand(Result* result) {
-+bool FakeCommandRunner::WaitForCommand(Result* result, bool more_ready) {
- if (!last_command_)
- return false;
-
-diff --git a/src/exit_status.h b/src/exit_status.h
-index a714ece791f7..75ebf6a7a0ce 100644
---- a/src/exit_status.h
-+++ b/src/exit_status.h
-@@ -18,7 +18,8 @@
- enum ExitStatus {
- ExitSuccess,
- ExitFailure,
-- ExitInterrupted
-+ ExitTokenAvailable,
-+ ExitInterrupted,
- };
-
- #endif // NINJA_EXIT_STATUS_H_
-diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc
-index 1de22c38f7fa..980fadf78e0d 100644
---- a/src/subprocess-posix.cc
-+++ b/src/subprocess-posix.cc
-@@ -13,6 +13,7 @@
- // limitations under the License.
-
- #include "subprocess.h"
-+#include "tokenpool.h"
-
- #include <assert.h>
- #include <errno.h>
-@@ -219,7 +220,7 @@ Subprocess *SubprocessSet::Add(const string& command, bool use_console) {
- }
-
- #ifdef USE_PPOLL
--bool SubprocessSet::DoWork() {
-+bool SubprocessSet::DoWork(struct TokenPool* tokens) {
- vector<pollfd> fds;
- nfds_t nfds = 0;
-
-@@ -233,6 +234,12 @@ bool SubprocessSet::DoWork() {
- ++nfds;
- }
-
-+ if (tokens) {
-+ pollfd pfd = { tokens->GetMonitorFd(), POLLIN | POLLPRI, 0 };
-+ fds.push_back(pfd);
-+ ++nfds;
-+ }
-+
- interrupted_ = 0;
- int ret = ppoll(&fds.front(), nfds, NULL, &old_mask_);
- if (ret == -1) {
-@@ -265,11 +272,20 @@ bool SubprocessSet::DoWork() {
- ++i;
- }
-
-+ if (tokens) {
-+ pollfd *pfd = &fds[nfds - 1];
-+ if (pfd->fd >= 0) {
-+ assert(pfd->fd == tokens->GetMonitorFd());
-+ if (pfd->revents != 0)
-+ token_available_ = true;
-+ }
-+ }
-+
- return IsInterrupted();
- }
-
- #else // !defined(USE_PPOLL)
--bool SubprocessSet::DoWork() {
-+bool SubprocessSet::DoWork(struct TokenPool* tokens) {
- fd_set set;
- int nfds = 0;
- FD_ZERO(&set);
-@@ -284,6 +300,13 @@ bool SubprocessSet::DoWork() {
- }
- }
-
-+ if (tokens) {
-+ int fd = tokens->GetMonitorFd();
-+ FD_SET(fd, &set);
-+ if (nfds < fd+1)
-+ nfds = fd+1;
-+ }
-+
- interrupted_ = 0;
- int ret = pselect(nfds, &set, 0, 0, 0, &old_mask_);
- if (ret == -1) {
-@@ -312,6 +335,12 @@ bool SubprocessSet::DoWork() {
- ++i;
- }
-
-+ if (tokens) {
-+ int fd = tokens->GetMonitorFd();
-+ if ((fd >= 0) && FD_ISSET(fd, &set))
-+ token_available_ = true;
-+ }
-+
- return IsInterrupted();
- }
- #endif // !defined(USE_PPOLL)
-diff --git a/src/subprocess-win32.cc b/src/subprocess-win32.cc
-index 4bab71939d6d..9b415b0b7bc3 100644
---- a/src/subprocess-win32.cc
-+++ b/src/subprocess-win32.cc
-@@ -236,7 +236,7 @@ Subprocess *SubprocessSet::Add(const string& command, bool use_console) {
- return subprocess;
- }
-
--bool SubprocessSet::DoWork() {
-+bool SubprocessSet::DoWork(struct TokenPool* tokens) {
- DWORD bytes_read;
- Subprocess* subproc;
- OVERLAPPED* overlapped;
-diff --git a/src/subprocess.h b/src/subprocess.h
-index b2d486ca400c..bf1a46090bc1 100644
---- a/src/subprocess.h
-+++ b/src/subprocess.h
-@@ -77,6 +77,8 @@ struct Subprocess {
- friend struct SubprocessSet;
- };
-
-+struct TokenPool;
-+
- /// SubprocessSet runs a ppoll/pselect() loop around a set of Subprocesses.
- /// DoWork() waits for any state change in subprocesses; finished_
- /// is a queue of subprocesses as they finish.
-@@ -85,13 +87,17 @@ struct SubprocessSet {
- ~SubprocessSet();
-
- Subprocess* Add(const string& command, bool use_console = false);
-- bool DoWork();
-+ bool DoWork(struct TokenPool* tokens);
- Subprocess* NextFinished();
- void Clear();
-
- vector<Subprocess*> running_;
- queue<Subprocess*> finished_;
-
-+ bool token_available_;
-+ bool IsTokenAvailable() { return token_available_; }
-+ void ResetTokenAvailable() { token_available_ = false; }
-+
- #ifdef _WIN32
- static BOOL WINAPI NotifyInterrupted(DWORD dwCtrlType);
- static HANDLE ioport_;
-diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc
-index 0a8c2061b7f2..e759ea4574bc 100644
---- a/src/subprocess_test.cc
-+++ b/src/subprocess_test.cc
-@@ -43,10 +43,12 @@ TEST_F(SubprocessTest, BadCommandStderr) {
- Subprocess* subproc = subprocs_.Add("cmd /c ninja_no_such_command");
- ASSERT_NE((Subprocess *) 0, subproc);
-
-+ subprocs_.ResetTokenAvailable();
- while (!subproc->Done()) {
- // Pretend we discovered that stderr was ready for writing.
-- subprocs_.DoWork();
-+ subprocs_.DoWork(NULL);
- }
-+ ASSERT_EQ(false, subprocs_.IsTokenAvailable());
-
- EXPECT_EQ(ExitFailure, subproc->Finish());
- EXPECT_NE("", subproc->GetOutput());
-@@ -57,10 +59,12 @@ TEST_F(SubprocessTest, NoSuchCommand) {
- Subprocess* subproc = subprocs_.Add("ninja_no_such_command");
- ASSERT_NE((Subprocess *) 0, subproc);
-
-+ subprocs_.ResetTokenAvailable();
- while (!subproc->Done()) {
- // Pretend we discovered that stderr was ready for writing.
-- subprocs_.DoWork();
-+ subprocs_.DoWork(NULL);
- }
-+ ASSERT_EQ(false, subprocs_.IsTokenAvailable());
-
- EXPECT_EQ(ExitFailure, subproc->Finish());
- EXPECT_NE("", subproc->GetOutput());
-@@ -76,9 +80,11 @@ TEST_F(SubprocessTest, InterruptChild) {
- Subprocess* subproc = subprocs_.Add("kill -INT $$");
- ASSERT_NE((Subprocess *) 0, subproc);
-
-+ subprocs_.ResetTokenAvailable();
- while (!subproc->Done()) {
-- subprocs_.DoWork();
-+ subprocs_.DoWork(NULL);
- }
-+ ASSERT_EQ(false, subprocs_.IsTokenAvailable());
-
- EXPECT_EQ(ExitInterrupted, subproc->Finish());
- }
-@@ -88,7 +94,7 @@ TEST_F(SubprocessTest, InterruptParent) {
- ASSERT_NE((Subprocess *) 0, subproc);
-
- while (!subproc->Done()) {
-- bool interrupted = subprocs_.DoWork();
-+ bool interrupted = subprocs_.DoWork(NULL);
- if (interrupted)
- return;
- }
-@@ -100,9 +106,11 @@ TEST_F(SubprocessTest, InterruptChildWithSigTerm) {
- Subprocess* subproc = subprocs_.Add("kill -TERM $$");
- ASSERT_NE((Subprocess *) 0, subproc);
-
-+ subprocs_.ResetTokenAvailable();
- while (!subproc->Done()) {
-- subprocs_.DoWork();
-+ subprocs_.DoWork(NULL);
- }
-+ ASSERT_EQ(false, subprocs_.IsTokenAvailable());
-
- EXPECT_EQ(ExitInterrupted, subproc->Finish());
- }
-@@ -112,7 +120,7 @@ TEST_F(SubprocessTest, InterruptParentWithSigTerm) {
- ASSERT_NE((Subprocess *) 0, subproc);
-
- while (!subproc->Done()) {
-- bool interrupted = subprocs_.DoWork();
-+ bool interrupted = subprocs_.DoWork(NULL);
- if (interrupted)
- return;
- }
-@@ -124,9 +132,11 @@ TEST_F(SubprocessTest, InterruptChildWithSigHup) {
- Subprocess* subproc = subprocs_.Add("kill -HUP $$");
- ASSERT_NE((Subprocess *) 0, subproc);
-
-+ subprocs_.ResetTokenAvailable();
- while (!subproc->Done()) {
-- subprocs_.DoWork();
-+ subprocs_.DoWork(NULL);
- }
-+ ASSERT_EQ(false, subprocs_.IsTokenAvailable());
-
- EXPECT_EQ(ExitInterrupted, subproc->Finish());
- }
-@@ -136,7 +146,7 @@ TEST_F(SubprocessTest, InterruptParentWithSigHup) {
- ASSERT_NE((Subprocess *) 0, subproc);
-
- while (!subproc->Done()) {
-- bool interrupted = subprocs_.DoWork();
-+ bool interrupted = subprocs_.DoWork(NULL);
- if (interrupted)
- return;
- }
-@@ -151,9 +161,11 @@ TEST_F(SubprocessTest, Console) {
- subprocs_.Add("test -t 0 -a -t 1 -a -t 2", /*use_console=*/true);
- ASSERT_NE((Subprocess*)0, subproc);
-
-+ subprocs_.ResetTokenAvailable();
- while (!subproc->Done()) {
-- subprocs_.DoWork();
-+ subprocs_.DoWork(NULL);
- }
-+ ASSERT_EQ(false, subprocs_.IsTokenAvailable());
-
- EXPECT_EQ(ExitSuccess, subproc->Finish());
- }
-@@ -165,9 +177,11 @@ TEST_F(SubprocessTest, SetWithSingle) {
- Subprocess* subproc = subprocs_.Add(kSimpleCommand);
- ASSERT_NE((Subprocess *) 0, subproc);
-
-+ subprocs_.ResetTokenAvailable();
- while (!subproc->Done()) {
-- subprocs_.DoWork();
-+ subprocs_.DoWork(NULL);
- }
-+ ASSERT_EQ(false, subprocs_.IsTokenAvailable());
- ASSERT_EQ(ExitSuccess, subproc->Finish());
- ASSERT_NE("", subproc->GetOutput());
-
-@@ -198,12 +212,13 @@ TEST_F(SubprocessTest, SetWithMulti) {
- ASSERT_EQ("", processes[i]->GetOutput());
- }
-
-+ subprocs_.ResetTokenAvailable();
- while (!processes[0]->Done() || !processes[1]->Done() ||
- !processes[2]->Done()) {
- ASSERT_GT(subprocs_.running_.size(), 0u);
-- subprocs_.DoWork();
-+ subprocs_.DoWork(NULL);
- }
--
-+ ASSERT_EQ(false, subprocs_.IsTokenAvailable());
- ASSERT_EQ(0u, subprocs_.running_.size());
- ASSERT_EQ(3u, subprocs_.finished_.size());
-
-@@ -235,8 +250,10 @@ TEST_F(SubprocessTest, SetWithLots) {
- ASSERT_NE((Subprocess *) 0, subproc);
- procs.push_back(subproc);
- }
-+ subprocs_.ResetTokenAvailable();
- while (!subprocs_.running_.empty())
-- subprocs_.DoWork();
-+ subprocs_.DoWork(NULL);
-+ ASSERT_EQ(false, subprocs_.IsTokenAvailable());
- for (size_t i = 0; i < procs.size(); ++i) {
- ASSERT_EQ(ExitSuccess, procs[i]->Finish());
- ASSERT_NE("", procs[i]->GetOutput());
-@@ -252,9 +269,11 @@ TEST_F(SubprocessTest, SetWithLots) {
- // that stdin is closed.
- TEST_F(SubprocessTest, ReadStdin) {
- Subprocess* subproc = subprocs_.Add("cat -");
-+ subprocs_.ResetTokenAvailable();
- while (!subproc->Done()) {
-- subprocs_.DoWork();
-+ subprocs_.DoWork(NULL);
- }
-+ ASSERT_EQ(false, subprocs_.IsTokenAvailable());
- ASSERT_EQ(ExitSuccess, subproc->Finish());
- ASSERT_EQ(1u, subprocs_.finished_.size());
- }
-diff --git a/src/tokenpool-gnu-make.cc b/src/tokenpool-gnu-make.cc
-index a8f9b7139d23..396bb7d87443 100644
---- a/src/tokenpool-gnu-make.cc
-+++ b/src/tokenpool-gnu-make.cc
-@@ -33,6 +33,7 @@ struct GNUmakeTokenPool : public TokenPool {
- virtual void Reserve();
- virtual void Release();
- virtual void Clear();
-+ virtual int GetMonitorFd();
-
- bool Setup();
-
-@@ -201,6 +202,10 @@ void GNUmakeTokenPool::Clear() {
- Return();
- }
-
-+int GNUmakeTokenPool::GetMonitorFd() {
-+ return(rfd_);
-+}
-+
- struct TokenPool *TokenPool::Get(void) {
- GNUmakeTokenPool *tokenpool = new GNUmakeTokenPool;
- if (tokenpool->Setup())
-diff --git a/src/tokenpool.h b/src/tokenpool.h
-index f560b1083b65..301e1998ee8e 100644
---- a/src/tokenpool.h
-+++ b/src/tokenpool.h
-@@ -21,6 +21,12 @@ struct TokenPool {
- virtual void Release() = 0;
- virtual void Clear() = 0;
-
-+#ifdef _WIN32
-+ // @TODO
-+#else
-+ virtual int GetMonitorFd() = 0;
-+#endif
-+
- // returns NULL if token pool is not available
- static struct TokenPool *Get(void);
- };
diff --git a/patches/ninja-1.8.2/0003-Ignore-jobserver-when-jN-is-forced-on-command-line.patch b/patches/ninja-1.8.2/0003-Ignore-jobserver-when-jN-is-forced-on-command-line.patch
deleted file mode 100644
index cd4b78f69..000000000
--- a/patches/ninja-1.8.2/0003-Ignore-jobserver-when-jN-is-forced-on-command-line.patch
+++ /dev/null
@@ -1,192 +0,0 @@
-From: Stefan Becker <chemobejk@gmail.com>
-Date: Sun, 12 Nov 2017 16:58:55 +0200
-Subject: [PATCH] Ignore jobserver when -jN is forced on command line
-
-This emulates the behaviour of GNU make.
-
-- add parallelism_from_cmdline flag to build configuration
-- set the flag when -jN is given on command line
-- pass the flag to TokenPool::Get()
-- GNUmakeTokenPool::Setup()
- * prints a warning when the flag is true and jobserver was detected
- * returns false, i.e. jobserver will be ignored
-- ignore config.parallelism in CanRunMore() when we have a valid
- TokenPool, because it gets always initialized to a default when not
- given on the command line
----
- src/build.cc | 10 ++++++----
- src/build.h | 4 +++-
- src/ninja.cc | 1 +
- src/tokenpool-gnu-make.cc | 34 +++++++++++++++++++---------------
- src/tokenpool-none.cc | 4 ++--
- src/tokenpool.h | 4 ++--
- 6 files changed, 33 insertions(+), 24 deletions(-)
-
-diff --git a/src/build.cc b/src/build.cc
-index 219bb9f1ff48..bc26bdade61b 100644
---- a/src/build.cc
-+++ b/src/build.cc
-@@ -507,7 +507,7 @@ struct RealCommandRunner : public CommandRunner {
- };
-
- RealCommandRunner::RealCommandRunner(const BuildConfig& config) : config_(config) {
-- tokens_ = TokenPool::Get();
-+ tokens_ = TokenPool::Get(config_.parallelism_from_cmdline);
- }
-
- RealCommandRunner::~RealCommandRunner() {
-@@ -529,9 +529,11 @@ void RealCommandRunner::Abort() {
- }
-
- bool RealCommandRunner::CanRunMore() {
-- size_t subproc_number =
-- subprocs_.running_.size() + subprocs_.finished_.size();
-- return (int)subproc_number < config_.parallelism
-+ bool parallelism_limit_not_reached =
-+ tokens_ || // ignore config_.parallelism
-+ ((int) (subprocs_.running_.size() +
-+ subprocs_.finished_.size()) < config_.parallelism);
-+ return parallelism_limit_not_reached
- && (subprocs_.running_.empty() ||
- (config_.max_load_average <= 0.0f ||
- GetLoadAverage() < config_.max_load_average));
-diff --git a/src/build.h b/src/build.h
-index ca605e62e0e3..6bc6fea26e94 100644
---- a/src/build.h
-+++ b/src/build.h
-@@ -128,7 +128,8 @@ struct CommandRunner {
-
- /// Options (e.g. verbosity, parallelism) passed to a build.
- struct BuildConfig {
-- BuildConfig() : verbosity(NORMAL), dry_run(false), parallelism(1),
-+ BuildConfig() : verbosity(NORMAL), dry_run(false),
-+ parallelism(1), parallelism_from_cmdline(false),
- failures_allowed(1), max_load_average(-0.0f) {}
-
- enum Verbosity {
-@@ -139,6 +140,7 @@ struct BuildConfig {
- Verbosity verbosity;
- bool dry_run;
- int parallelism;
-+ bool parallelism_from_cmdline;
- int failures_allowed;
- /// The maximum load average we must not exceed. A negative value
- /// means that we do not have any limit.
-diff --git a/src/ninja.cc b/src/ninja.cc
-index ed004ac8f1fe..4332636c1b64 100644
---- a/src/ninja.cc
-+++ b/src/ninja.cc
-@@ -1063,6 +1063,7 @@ int ReadFlags(int* argc, char*** argv,
- if (*end != 0 || value <= 0)
- Fatal("invalid -j parameter");
- config->parallelism = value;
-+ config->parallelism_from_cmdline = true;
- break;
- }
- case 'k': {
-diff --git a/src/tokenpool-gnu-make.cc b/src/tokenpool-gnu-make.cc
-index 396bb7d87443..af4be05a31cf 100644
---- a/src/tokenpool-gnu-make.cc
-+++ b/src/tokenpool-gnu-make.cc
-@@ -1,4 +1,4 @@
--// Copyright 2016 Google Inc. All Rights Reserved.
-+// Copyright 2016-2017 Google Inc. All Rights Reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
-@@ -35,7 +35,7 @@ struct GNUmakeTokenPool : public TokenPool {
- virtual void Clear();
- virtual int GetMonitorFd();
-
-- bool Setup();
-+ bool Setup(bool ignore);
-
- private:
- int available_;
-@@ -100,7 +100,7 @@ bool GNUmakeTokenPool::SetAlarmHandler() {
- }
- }
-
--bool GNUmakeTokenPool::Setup() {
-+bool GNUmakeTokenPool::Setup(bool ignore) {
- const char *value = getenv("MAKEFLAGS");
- if (value) {
- // GNU make <= 4.1
-@@ -109,16 +109,20 @@ bool GNUmakeTokenPool::Setup() {
- if (!jobserver)
- jobserver = strstr(value, "--jobserver-auth=");
- if (jobserver) {
-- int rfd = -1;
-- int wfd = -1;
-- if ((sscanf(jobserver, "%*[^=]=%d,%d", &rfd, &wfd) == 2) &&
-- CheckFd(rfd) &&
-- CheckFd(wfd) &&
-- SetAlarmHandler()) {
-- printf("ninja: using GNU make jobserver.\n");
-- rfd_ = rfd;
-- wfd_ = wfd;
-- return true;
-+ if (ignore) {
-+ printf("ninja: warning: -jN forced on command line; ignoring GNU make jobserver.\n");
-+ } else {
-+ int rfd = -1;
-+ int wfd = -1;
-+ if ((sscanf(jobserver, "%*[^=]=%d,%d", &rfd, &wfd) == 2) &&
-+ CheckFd(rfd) &&
-+ CheckFd(wfd) &&
-+ SetAlarmHandler()) {
-+ printf("ninja: using GNU make jobserver.\n");
-+ rfd_ = rfd;
-+ wfd_ = wfd;
-+ return true;
-+ }
- }
- }
- }
-@@ -206,9 +210,9 @@ int GNUmakeTokenPool::GetMonitorFd() {
- return(rfd_);
- }
-
--struct TokenPool *TokenPool::Get(void) {
-+struct TokenPool *TokenPool::Get(bool ignore) {
- GNUmakeTokenPool *tokenpool = new GNUmakeTokenPool;
-- if (tokenpool->Setup())
-+ if (tokenpool->Setup(ignore))
- return tokenpool;
- else
- delete tokenpool;
-diff --git a/src/tokenpool-none.cc b/src/tokenpool-none.cc
-index 602b3316f54d..199b22264bc6 100644
---- a/src/tokenpool-none.cc
-+++ b/src/tokenpool-none.cc
-@@ -1,4 +1,4 @@
--// Copyright 2016 Google Inc. All Rights Reserved.
-+// Copyright 2016-2017 Google Inc. All Rights Reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
-@@ -22,6 +22,6 @@
- #include <stdlib.h>
-
- // No-op TokenPool implementation
--struct TokenPool *TokenPool::Get(void) {
-+struct TokenPool *TokenPool::Get(bool ignore) {
- return NULL;
- }
-diff --git a/src/tokenpool.h b/src/tokenpool.h
-index 301e1998ee8e..878a0933c2f0 100644
---- a/src/tokenpool.h
-+++ b/src/tokenpool.h
-@@ -1,4 +1,4 @@
--// Copyright 2016 Google Inc. All Rights Reserved.
-+// Copyright 2016-2017 Google Inc. All Rights Reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
-@@ -28,5 +28,5 @@ struct TokenPool {
- #endif
-
- // returns NULL if token pool is not available
-- static struct TokenPool *Get(void);
-+ static struct TokenPool *Get(bool ignore);
- };
diff --git a/patches/ninja-1.8.2/0004-Honor-lN-from-MAKEFLAGS.patch b/patches/ninja-1.8.2/0004-Honor-lN-from-MAKEFLAGS.patch
deleted file mode 100644
index 2a2505001..000000000
--- a/patches/ninja-1.8.2/0004-Honor-lN-from-MAKEFLAGS.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From: Stefan Becker <chemobejk@gmail.com>
-Date: Sun, 12 Nov 2017 18:04:12 +0200
-Subject: [PATCH] Honor -lN from MAKEFLAGS
-
-This emulates the behaviour of GNU make.
-
-- build: make a copy of max_load_average and pass it to TokenPool.
-- GNUmakeTokenPool: if we detect a jobserver and a valid -lN argument in
- MAKEFLAGS then set max_load_average to N.
----
- src/build.cc | 10 +++++++---
- src/tokenpool-gnu-make.cc | 19 +++++++++++++++----
- src/tokenpool-none.cc | 2 +-
- src/tokenpool.h | 2 +-
- 4 files changed, 24 insertions(+), 9 deletions(-)
-
-diff --git a/src/build.cc b/src/build.cc
-index bc26bdade61b..6eaf299caeec 100644
---- a/src/build.cc
-+++ b/src/build.cc
-@@ -501,13 +501,17 @@ struct RealCommandRunner : public CommandRunner {
- virtual void Abort();
-
- const BuildConfig& config_;
-+ // copy of config_.max_load_average; can be modified by TokenPool setup
-+ double max_load_average_;
- SubprocessSet subprocs_;
- TokenPool *tokens_;
- map<Subprocess*, Edge*> subproc_to_edge_;
- };
-
- RealCommandRunner::RealCommandRunner(const BuildConfig& config) : config_(config) {
-- tokens_ = TokenPool::Get(config_.parallelism_from_cmdline);
-+ max_load_average_ = config.max_load_average;
-+ tokens_ = TokenPool::Get(config_.parallelism_from_cmdline,
-+ max_load_average_);
- }
-
- RealCommandRunner::~RealCommandRunner() {
-@@ -535,8 +539,8 @@ bool RealCommandRunner::CanRunMore() {
- subprocs_.finished_.size()) < config_.parallelism);
- return parallelism_limit_not_reached
- && (subprocs_.running_.empty() ||
-- (config_.max_load_average <= 0.0f ||
-- GetLoadAverage() < config_.max_load_average));
-+ (max_load_average_ <= 0.0f ||
-+ GetLoadAverage() < max_load_average_));
- }
-
- bool RealCommandRunner::AcquireToken() {
-diff --git a/src/tokenpool-gnu-make.cc b/src/tokenpool-gnu-make.cc
-index af4be05a31cf..fb654c4d88ba 100644
---- a/src/tokenpool-gnu-make.cc
-+++ b/src/tokenpool-gnu-make.cc
-@@ -35,7 +35,7 @@ struct GNUmakeTokenPool : public TokenPool {
- virtual void Clear();
- virtual int GetMonitorFd();
-
-- bool Setup(bool ignore);
-+ bool Setup(bool ignore, double& max_load_average);
-
- private:
- int available_;
-@@ -100,7 +100,7 @@ bool GNUmakeTokenPool::SetAlarmHandler() {
- }
- }
-
--bool GNUmakeTokenPool::Setup(bool ignore) {
-+bool GNUmakeTokenPool::Setup(bool ignore, double& max_load_average) {
- const char *value = getenv("MAKEFLAGS");
- if (value) {
- // GNU make <= 4.1
-@@ -118,9 +118,20 @@ bool GNUmakeTokenPool::Setup(bool ignore) {
- CheckFd(rfd) &&
- CheckFd(wfd) &&
- SetAlarmHandler()) {
-+ const char *l_arg = strstr(value, " -l");
-+ int load_limit = -1;
-+
- printf("ninja: using GNU make jobserver.\n");
- rfd_ = rfd;
- wfd_ = wfd;
-+
-+ // translate GNU make -lN to ninja -lN
-+ if (l_arg &&
-+ (sscanf(l_arg + 3, "%d ", &load_limit) == 1) &&
-+ (load_limit > 0)) {
-+ max_load_average = load_limit;
-+ }
-+
- return true;
- }
- }
-@@ -210,9 +221,9 @@ int GNUmakeTokenPool::GetMonitorFd() {
- return(rfd_);
- }
-
--struct TokenPool *TokenPool::Get(bool ignore) {
-+struct TokenPool *TokenPool::Get(bool ignore, double& max_load_average) {
- GNUmakeTokenPool *tokenpool = new GNUmakeTokenPool;
-- if (tokenpool->Setup(ignore))
-+ if (tokenpool->Setup(ignore, max_load_average))
- return tokenpool;
- else
- delete tokenpool;
-diff --git a/src/tokenpool-none.cc b/src/tokenpool-none.cc
-index 199b22264bc6..e8e25426c39f 100644
---- a/src/tokenpool-none.cc
-+++ b/src/tokenpool-none.cc
-@@ -22,6 +22,6 @@
- #include <stdlib.h>
-
- // No-op TokenPool implementation
--struct TokenPool *TokenPool::Get(bool ignore) {
-+struct TokenPool *TokenPool::Get(bool ignore, double& max_load_average) {
- return NULL;
- }
-diff --git a/src/tokenpool.h b/src/tokenpool.h
-index 878a0933c2f0..f9e8cc2ee081 100644
---- a/src/tokenpool.h
-+++ b/src/tokenpool.h
-@@ -28,5 +28,5 @@ struct TokenPool {
- #endif
-
- // returns NULL if token pool is not available
-- static struct TokenPool *Get(bool ignore);
-+ static struct TokenPool *Get(bool ignore, double& max_load_average);
- };
diff --git a/patches/ninja-1.8.2/0005-Use-LinePrinter-for-TokenPool-messages.patch b/patches/ninja-1.8.2/0005-Use-LinePrinter-for-TokenPool-messages.patch
deleted file mode 100644
index 1894be5a1..000000000
--- a/patches/ninja-1.8.2/0005-Use-LinePrinter-for-TokenPool-messages.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From: Stefan Becker <chemobejk@gmail.com>
-Date: Wed, 6 Dec 2017 22:14:21 +0200
-Subject: [PATCH] Use LinePrinter for TokenPool messages
-
-- replace printf() with calls to LinePrinter
-- print GNU make jobserver message only when verbose build is requested
----
- src/build.cc | 1 +
- src/tokenpool-gnu-make.cc | 22 ++++++++++++++++------
- src/tokenpool-none.cc | 4 +++-
- src/tokenpool.h | 4 +++-
- 4 files changed, 23 insertions(+), 8 deletions(-)
-
-diff --git a/src/build.cc b/src/build.cc
-index 6eaf299caeec..754d362c7162 100644
---- a/src/build.cc
-+++ b/src/build.cc
-@@ -511,6 +511,7 @@ struct RealCommandRunner : public CommandRunner {
- RealCommandRunner::RealCommandRunner(const BuildConfig& config) : config_(config) {
- max_load_average_ = config.max_load_average;
- tokens_ = TokenPool::Get(config_.parallelism_from_cmdline,
-+ config_.verbosity == BuildConfig::VERBOSE,
- max_load_average_);
- }
-
-diff --git a/src/tokenpool-gnu-make.cc b/src/tokenpool-gnu-make.cc
-index fb654c4d88ba..b0d3e6ebc463 100644
---- a/src/tokenpool-gnu-make.cc
-+++ b/src/tokenpool-gnu-make.cc
-@@ -23,6 +23,8 @@
- #include <string.h>
- #include <stdlib.h>
-
-+#include "line_printer.h"
-+
- // TokenPool implementation for GNU make jobserver
- // (http://make.mad-scientist.net/papers/jobserver-implementation/)
- struct GNUmakeTokenPool : public TokenPool {
-@@ -35,7 +37,7 @@ struct GNUmakeTokenPool : public TokenPool {
- virtual void Clear();
- virtual int GetMonitorFd();
-
-- bool Setup(bool ignore, double& max_load_average);
-+ bool Setup(bool ignore, bool verbose, double& max_load_average);
-
- private:
- int available_;
-@@ -100,7 +102,9 @@ bool GNUmakeTokenPool::SetAlarmHandler() {
- }
- }
-
--bool GNUmakeTokenPool::Setup(bool ignore, double& max_load_average) {
-+bool GNUmakeTokenPool::Setup(bool ignore,
-+ bool verbose,
-+ double& max_load_average) {
- const char *value = getenv("MAKEFLAGS");
- if (value) {
- // GNU make <= 4.1
-@@ -109,8 +113,10 @@ bool GNUmakeTokenPool::Setup(bool ignore, double& max_load_average) {
- if (!jobserver)
- jobserver = strstr(value, "--jobserver-auth=");
- if (jobserver) {
-+ LinePrinter printer;
-+
- if (ignore) {
-- printf("ninja: warning: -jN forced on command line; ignoring GNU make jobserver.\n");
-+ printer.PrintOnNewLine("ninja: warning: -jN forced on command line; ignoring GNU make jobserver.\n");
- } else {
- int rfd = -1;
- int wfd = -1;
-@@ -121,7 +127,9 @@ bool GNUmakeTokenPool::Setup(bool ignore, double& max_load_average) {
- const char *l_arg = strstr(value, " -l");
- int load_limit = -1;
-
-- printf("ninja: using GNU make jobserver.\n");
-+ if (verbose) {
-+ printer.PrintOnNewLine("ninja: using GNU make jobserver.\n");
-+ }
- rfd_ = rfd;
- wfd_ = wfd;
-
-@@ -221,9 +229,11 @@ int GNUmakeTokenPool::GetMonitorFd() {
- return(rfd_);
- }
-
--struct TokenPool *TokenPool::Get(bool ignore, double& max_load_average) {
-+struct TokenPool *TokenPool::Get(bool ignore,
-+ bool verbose,
-+ double& max_load_average) {
- GNUmakeTokenPool *tokenpool = new GNUmakeTokenPool;
-- if (tokenpool->Setup(ignore, max_load_average))
-+ if (tokenpool->Setup(ignore, verbose, max_load_average))
- return tokenpool;
- else
- delete tokenpool;
-diff --git a/src/tokenpool-none.cc b/src/tokenpool-none.cc
-index e8e25426c39f..1c1c499c8d9c 100644
---- a/src/tokenpool-none.cc
-+++ b/src/tokenpool-none.cc
-@@ -22,6 +22,8 @@
- #include <stdlib.h>
-
- // No-op TokenPool implementation
--struct TokenPool *TokenPool::Get(bool ignore, double& max_load_average) {
-+struct TokenPool *TokenPool::Get(bool ignore,
-+ bool verbose,
-+ double& max_load_average) {
- return NULL;
- }
-diff --git a/src/tokenpool.h b/src/tokenpool.h
-index f9e8cc2ee081..4bf477f20c8a 100644
---- a/src/tokenpool.h
-+++ b/src/tokenpool.h
-@@ -28,5 +28,7 @@ struct TokenPool {
- #endif
-
- // returns NULL if token pool is not available
-- static struct TokenPool *Get(bool ignore, double& max_load_average);
-+ static struct TokenPool *Get(bool ignore,
-+ bool verbose,
-+ double& max_load_average);
- };
diff --git a/patches/ninja-1.8.2/0006-Prepare-PR-for-merging.patch b/patches/ninja-1.8.2/0006-Prepare-PR-for-merging.patch
deleted file mode 100644
index bf44d5f4b..000000000
--- a/patches/ninja-1.8.2/0006-Prepare-PR-for-merging.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From: Stefan Becker <chemobejk@gmail.com>
-Date: Sat, 7 Apr 2018 17:11:21 +0300
-Subject: [PATCH] Prepare PR for merging
-
-- fix Windows build error in no-op TokenPool implementation
-- improve Acquire() to block for a maximum of 100ms
-- address review comments
----
- src/build.h | 2 ++
- src/tokenpool-gnu-make.cc | 53 ++++++++++++++++++++++++++++++++++++++++-------
- src/tokenpool-none.cc | 7 +------
- 3 files changed, 49 insertions(+), 13 deletions(-)
-
-diff --git a/src/build.h b/src/build.h
-index 6bc6fea26e94..530812bb9a2a 100644
---- a/src/build.h
-+++ b/src/build.h
-@@ -120,6 +120,8 @@ struct CommandRunner {
- bool success() const { return status == ExitSuccess; }
- };
- /// Wait for a command to complete, or return false if interrupted.
-+ /// If more_ready is true then the optional TokenPool is monitored too
-+ /// and we return when a token becomes available.
- virtual bool WaitForCommand(Result* result, bool more_ready) = 0;
-
- virtual vector<Edge*> GetActiveEdges() { return vector<Edge*>(); }
-diff --git a/src/tokenpool-gnu-make.cc b/src/tokenpool-gnu-make.cc
-index b0d3e6ebc463..4132bb06d9dd 100644
---- a/src/tokenpool-gnu-make.cc
-+++ b/src/tokenpool-gnu-make.cc
-@@ -1,4 +1,4 @@
--// Copyright 2016-2017 Google Inc. All Rights Reserved.
-+// Copyright 2016-2018 Google Inc. All Rights Reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
-@@ -19,6 +19,7 @@
- #include <poll.h>
- #include <unistd.h>
- #include <signal.h>
-+#include <sys/time.h>
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
-@@ -153,6 +154,15 @@ bool GNUmakeTokenPool::Acquire() {
- if (available_ > 0)
- return true;
-
-+ // Please read
-+ //
-+ // http://make.mad-scientist.net/papers/jobserver-implementation/
-+ //
-+ // for the reasoning behind the following code.
-+ //
-+ // Try to read one character from the pipe. Returns true on success.
-+ //
-+ // First check if read() would succeed without blocking.
- #ifdef USE_PPOLL
- pollfd pollfds[] = {{rfd_, POLLIN, 0}};
- int ret = poll(pollfds, 1, 0);
-@@ -164,33 +174,62 @@ bool GNUmakeTokenPool::Acquire() {
- int ret = select(rfd_ + 1, &set, NULL, NULL, &timeout);
- #endif
- if (ret > 0) {
-+ // Handle potential race condition:
-+ // - the above check succeeded, i.e. read() should not block
-+ // - the character disappears before we call read()
-+ //
-+ // Create a duplicate of rfd_. The duplicate file descriptor dup_rfd_
-+ // can safely be closed by signal handlers without affecting rfd_.
- dup_rfd_ = dup(rfd_);
-
- if (dup_rfd_ != -1) {
- struct sigaction act, old_act;
- int ret = 0;
-
-+ // Temporarily replace SIGCHLD handler with our own
- memset(&act, 0, sizeof(act));
- act.sa_handler = CloseDupRfd;
- if (sigaction(SIGCHLD, &act, &old_act) == 0) {
-- char buf;
--
-- // block until token read, child exits or timeout
-- alarm(1);
-- ret = read(dup_rfd_, &buf, 1);
-- alarm(0);
-+ struct itimerval timeout;
-+
-+ // install a 100ms timeout that generates SIGALARM on expiration
-+ memset(&timeout, 0, sizeof(timeout));
-+ timeout.it_value.tv_usec = 100 * 1000; // [ms] -> [usec]
-+ if (setitimer(ITIMER_REAL, &timeout, NULL) == 0) {
-+ char buf;
-+
-+ // Now try to read() from dup_rfd_. Return values from read():
-+ //
-+ // 1. token read -> 1
-+ // 2. pipe closed -> 0
-+ // 3. alarm expires -> -1 (EINTR)
-+ // 4. child exits -> -1 (EINTR)
-+ // 5. alarm expired before entering read() -> -1 (EBADF)
-+ // 6. child exited before entering read() -> -1 (EBADF)
-+ // 7. child exited before handler is installed -> go to 1 - 3
-+ ret = read(dup_rfd_, &buf, 1);
-+
-+ // disarm timer
-+ memset(&timeout, 0, sizeof(timeout));
-+ setitimer(ITIMER_REAL, &timeout, NULL);
-+ }
-
- sigaction(SIGCHLD, &old_act, NULL);
- }
-
- CloseDupRfd(0);
-
-+ // Case 1 from above list
- if (ret > 0) {
- available_++;
- return true;
- }
- }
- }
-+
-+ // read() would block, i.e. no token available,
-+ // cases 2-6 from above list or
-+ // select() / poll() / dup() / sigaction() / setitimer() failed
- return false;
- }
-
-diff --git a/src/tokenpool-none.cc b/src/tokenpool-none.cc
-index 1c1c499c8d9c..4c592875b4ad 100644
---- a/src/tokenpool-none.cc
-+++ b/src/tokenpool-none.cc
-@@ -1,4 +1,4 @@
--// Copyright 2016-2017 Google Inc. All Rights Reserved.
-+// Copyright 2016-2018 Google Inc. All Rights Reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
-@@ -14,11 +14,6 @@
-
- #include "tokenpool.h"
-
--#include <fcntl.h>
--#include <poll.h>
--#include <unistd.h>
--#include <stdio.h>
--#include <string.h>
- #include <stdlib.h>
-
- // No-op TokenPool implementation
diff --git a/patches/ninja-1.8.2/series b/patches/ninja-1.8.2/series
deleted file mode 100644
index ef13f1510..000000000
--- a/patches/ninja-1.8.2/series
+++ /dev/null
@@ -1,10 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Add-GNU-make-jobserver-client-support.patch
-0002-Add-TokenPool-monitoring-to-SubprocessSet-DoWork.patch
-0003-Ignore-jobserver-when-jN-is-forced-on-command-line.patch
-0004-Honor-lN-from-MAKEFLAGS.patch
-0005-Use-LinePrinter-for-TokenPool-messages.patch
-0006-Prepare-PR-for-merging.patch
-0007-don-t-close-open-fds.patch
-# e4c44c2e231b79ea6c0263de5d69c6d3 - git-ptx-patches magic
diff --git a/patches/node-v12.16.1/0001-Disable-running-gyp-on-shared-deps.patch b/patches/node-v12.16.1/0001-Disable-running-gyp-on-shared-deps.patch
deleted file mode 100644
index f1d6bb737..000000000
--- a/patches/node-v12.16.1/0001-Disable-running-gyp-on-shared-deps.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Zuzana Svetlikova <zsvetlik@redhat.com>
-Date: Thu, 27 Apr 2017 14:25:42 +0200
-Subject: [PATCH] Disable running gyp on shared deps
-
----
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 05eaa73abbe0..965e4f8560e6 100644
---- a/Makefile
-+++ b/Makefile
-@@ -141,7 +141,7 @@ test-code-cache: with-code-cache
- echo "'test-code-cache' target is a noop"
-
- out/Makefile: config.gypi common.gypi node.gyp \
-- deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp \
-+ deps/http_parser/http_parser.gyp \
- tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \
- tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
- $(PYTHON) tools/gyp_node.py -f make
diff --git a/patches/node-v12.16.1/0002-Install-both-binaries-and-use-libdir.patch b/patches/node-v12.16.1/0002-Install-both-binaries-and-use-libdir.patch
deleted file mode 100644
index b9dc62bb4..000000000
--- a/patches/node-v12.16.1/0002-Install-both-binaries-and-use-libdir.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
-Date: Tue, 19 Mar 2019 23:22:40 -0400
-Subject: [PATCH] Install both binaries and use libdir.
-
-This allows us to build with a shared library for other users while
-still providing the normal executable.
-
-Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
----
- configure.py | 7 +++++++
- tools/install.py | 31 ++++++++++++++-----------------
- 2 files changed, 21 insertions(+), 17 deletions(-)
-
-diff --git a/configure.py b/configure.py
-index 14f5665e0299..36a8a413713a 100755
---- a/configure.py
-+++ b/configure.py
-@@ -572,6 +572,12 @@ parser.add_option('--shared',
- help='compile shared library for embedding node in another project. ' +
- '(This mode is not officially supported for regular applications)')
-
-+parser.add_option('--libdir',
-+ action='store',
-+ dest='libdir',
-+ default='lib',
-+ help='a directory to install the shared library into')
-+
- parser.add_option('--without-v8-platform',
- action='store_true',
- dest='without_v8_platform',
-@@ -1121,6 +1127,7 @@ def configure_node(o):
- o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
-
- o['variables']['node_shared'] = b(options.shared)
-+ o['variables']['libdir'] = options.libdir
- node_module_version = getmoduleversion.get_version()
-
- if options.dest_os == 'android':
-diff --git a/tools/install.py b/tools/install.py
-index 655802980a6e..fe4723bf1501 100755
---- a/tools/install.py
-+++ b/tools/install.py
-@@ -121,26 +121,23 @@ def subdir_files(path, dest, action):
-
- def files(action):
- is_windows = sys.platform == 'win32'
-- output_file = 'node'
- output_prefix = 'out/Release/'
-+ output_libprefix = output_prefix
-
-- if 'false' == variables.get('node_shared'):
-- if is_windows:
-- output_file += '.exe'
-+ if is_windows:
-+ output_bin = 'node.exe'
-+ output_lib = 'node.dll'
- else:
-- if is_windows:
-- output_file += '.dll'
-- else:
-- output_file = 'lib' + output_file + '.' + variables.get('shlib_suffix')
-- # GYP will output to lib.target except on OS X, this is hardcoded
-- # in its source - see the _InstallableTargetInstallPath function.
-- if sys.platform != 'darwin':
-- output_prefix += 'lib.target/'
--
-- if 'false' == variables.get('node_shared'):
-- action([output_prefix + output_file], 'bin/' + output_file)
-- else:
-- action([output_prefix + output_file], 'lib/' + output_file)
-+ output_bin = 'node'
-+ output_lib = 'libnode.' + variables.get('shlib_suffix')
-+ # GYP will output to lib.target except on OS X, this is hardcoded
-+ # in its source - see the _InstallableTargetInstallPath function.
-+ if sys.platform != 'darwin':
-+ output_libprefix += 'lib.target/'
-+
-+ action([output_prefix + output_bin], 'bin/' + output_bin)
-+ if 'true' == variables.get('node_shared'):
-+ action([output_libprefix + output_lib], variables.get('libdir') + '/' + output_lib)
-
- if 'true' == variables.get('node_use_dtrace'):
- action(['out/Release/node.d'], 'lib/dtrace/node.d')
diff --git a/patches/node-v12.16.1/0003-tools-do-not-explicitely-set-an-rpath-in-make-genera.patch b/patches/node-v12.16.1/0003-tools-do-not-explicitely-set-an-rpath-in-make-genera.patch
deleted file mode 100644
index f05bcafd5..000000000
--- a/patches/node-v12.16.1/0003-tools-do-not-explicitely-set-an-rpath-in-make-genera.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: =?UTF-8?q?Ulrich=20=C3=96lmann?= <u.oelmann@pengutronix.de>
-Date: Fri, 13 Mar 2020 12:36:49 +0100
-Subject: [PATCH] tools: do not explicitely set an rpath in make generator
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This is not necessary as the library is installed into the standard path.
-
-Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
----
- tools/gyp/pylib/gyp/generator/make.py | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py
-index 91a119c5a576..c109b2b488ec 100644
---- a/tools/gyp/pylib/gyp/generator/make.py
-+++ b/tools/gyp/pylib/gyp/generator/make.py
-@@ -1474,11 +1474,7 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
- target_postbuilds[configname] = target_postbuild
- else:
- ldflags = config.get('ldflags', [])
-- # Compute an rpath for this output if needed.
- if any(dep.endswith('.so') or '.so.' in dep for dep in deps):
-- # We want to get the literal string "$ORIGIN" into the link command,
-- # so we need lots of escaping.
-- ldflags.append(r'-Wl,-rpath=\$$ORIGIN/lib.%s/' % self.toolset)
- ldflags.append(r'-Wl,-rpath-link=\$(builddir)/lib.%s/' %
- self.toolset)
- library_dirs = config.get('library_dirs', [])
diff --git a/patches/node-v12.16.1/0004-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch b/patches/node-v12.16.1/0004-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch
deleted file mode 100644
index 121bba28b..000000000
--- a/patches/node-v12.16.1/0004-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Fri, 27 Mar 2020 11:32:01 +0100
-Subject: [PATCH] HACK: don't add LD_LIBRARY_PATH for external tools
-
-When host and target architecture match, then the target path in
-LD_LIBRARY_PATH confuses the linker and the wrong libraries are used.
-As a result executing the tool fails.
-Always removing the target path from LD_LIBRARY_PATH is not an options
-because in this case building host-nodejs fails with a missing library.
-
-In PTXdist we overwrite the path to the tool to point to sysroot-host when
-building the target nodejs. We can use that to set the LD_LIBRARY_PATH only
-for host-nodejs.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- tools/gyp/pylib/gyp/generator/make.py | 14 +++++++++-----
- 1 file changed, 9 insertions(+), 5 deletions(-)
-
-diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py
-index c109b2b488ec..995f6df0f441 100644
---- a/tools/gyp/pylib/gyp/generator/make.py
-+++ b/tools/gyp/pylib/gyp/generator/make.py
-@@ -923,11 +923,15 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
- # libraries, but until everything is made cross-compile safe, also use
- # target libraries.
- # TODO(piman): when everything is cross-compile safe, remove lib.target
-- self.WriteLn('cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:'
-- '$(builddir)/lib.target:$$LD_LIBRARY_PATH; '
-- 'export LD_LIBRARY_PATH; '
-- '%s%s'
-- % (name, cd_action, command))
-+ if action['action'][0].startswith('$(builddir)'):
-+ self.WriteLn('cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:'
-+ '$(builddir)/lib.target:$$LD_LIBRARY_PATH; '
-+ 'export LD_LIBRARY_PATH; '
-+ '%s%s'
-+ % (name, cd_action, command))
-+ else:
-+ self.WriteLn('cmd_%s = %s%s'
-+ % (name, cd_action, command))
- self.WriteLn()
- outputs = [self.Absolutify(o) for o in outputs]
- # The makefile rules are all relative to the top dir, but the gyp actions
diff --git a/patches/node-v12.16.1/0005-HACK-run-configure-directly-with-python2.patch b/patches/node-v12.16.1/0005-HACK-run-configure-directly-with-python2.patch
deleted file mode 100644
index 3119571fc..000000000
--- a/patches/node-v12.16.1/0005-HACK-run-configure-directly-with-python2.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Mon, 13 Apr 2020 07:37:05 +0200
-Subject: [PATCH] HACK: run configure directly with python2
-
-This ensures that the correct Python version is used. Without this,
-'python2.7' is the first try. This is either the cross Python or bypasses
-the host-system-python dependency check.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure b/configure
-index 9156e13f7aed..317a768b0fd6 100755
---- a/configure
-+++ b/configure
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/usr/bin/env python2
-
- # Locate python2 interpreter and re-execute the script. Note that the
- # mix of single and double quotes is intentional, as is the fact that
diff --git a/patches/node-v12.16.1/series b/patches/node-v12.16.1/series
deleted file mode 100644
index f0162c556..000000000
--- a/patches/node-v12.16.1/series
+++ /dev/null
@@ -1,8 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Disable-running-gyp-on-shared-deps.patch
-0002-Install-both-binaries-and-use-libdir.patch
-0003-tools-do-not-explicitely-set-an-rpath-in-make-genera.patch
-0004-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch
-0005-HACK-run-configure-directly-with-python2.patch
-# c39d7fdc79e6b2f672a807f38ade396e - git-ptx-patches magic
diff --git a/patches/node-v20.11.0/0001-Disable-running-gyp-on-shared-deps.patch b/patches/node-v20.11.0/0001-Disable-running-gyp-on-shared-deps.patch
new file mode 100644
index 000000000..b6e52636e
--- /dev/null
+++ b/patches/node-v20.11.0/0001-Disable-running-gyp-on-shared-deps.patch
@@ -0,0 +1,46 @@
+From: Zuzana Svetlikova <zsvetlik@redhat.com>
+Date: Thu, 27 Apr 2017 14:25:42 +0200
+Subject: [PATCH] Disable running gyp on shared deps
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Probably imported from:
+https://src.fedoraproject.org/rpms/nodejs/c/41af04f2a3c050fb44628e91ac65fd225b927acb?branch=22609d8c1bfeaa21fe0057645af20b3a2ccc7f53
+which is probably based on dont-run-gyp-files-for-bundled-deps.patch added in:
+https://github.com/alpinelinux/aports/commit/6662eb3199902e8451fb20dce82554ad96f796bb
+
+We also explicitly prune some dependencies from source in the bitbake recipe:
+
+python prune_sources() {
+ import shutil
+
+ shutil.rmtree(d.getVar('S') + '/deps/openssl')
+ if 'ares' in d.getVar('PACKAGECONFIG'):
+ shutil.rmtree(d.getVar('S') + '/deps/cares')
+ if 'brotli' in d.getVar('PACKAGECONFIG'):
+ shutil.rmtree(d.getVar('S') + '/deps/brotli')
+ if 'libuv' in d.getVar('PACKAGECONFIG'):
+ shutil.rmtree(d.getVar('S') + '/deps/uv')
+ if 'nghttp2' in d.getVar('PACKAGECONFIG'):
+ shutil.rmtree(d.getVar('S') + '/deps/nghttp2')
+ if 'zlib' in d.getVar('PACKAGECONFIG'):
+ shutil.rmtree(d.getVar('S') + '/deps/zlib')
+}
+do_unpack[postfuncs] += "prune_sources"
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index b7871bf21857..e1b2c717b414 100644
+--- a/Makefile
++++ b/Makefile
+@@ -169,7 +169,7 @@ with-code-cache test-code-cache:
+ $(warning '$@' target is a noop)
+
+ out/Makefile: config.gypi common.gypi node.gyp \
+- deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
++ deps/llhttp/llhttp.gyp \
+ deps/simdutf/simdutf.gyp deps/ada/ada.gyp \
+ tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \
+ tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
diff --git a/patches/node-v20.11.0/0002-v8-don-t-override-ARM-CFLAGS.patch b/patches/node-v20.11.0/0002-v8-don-t-override-ARM-CFLAGS.patch
new file mode 100644
index 000000000..5fd7984f2
--- /dev/null
+++ b/patches/node-v20.11.0/0002-v8-don-t-override-ARM-CFLAGS.patch
@@ -0,0 +1,98 @@
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
+Date: Sat, 9 Nov 2019 14:45:30 +0000
+Subject: [PATCH] v8: don't override ARM CFLAGS
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This overrides yocto-provided build flags with its own, e.g we get
+ arm-poky-linux-musleabi-g++ -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 \
+ ... \
+ -march=armv7-a -mfpu=neon -mfloat-abi=hard -marm
+
+Causing the latter to override the former, and compiler warnings:
+ cc1plus: warning: switch '-mcpu=cortex-a7' conflicts with '-march=armv7-a' switch
+
+Patch this out, so that yocto-provided flags take precedence.
+Note that in reality the same should probably be done for all the other
+supported architectures, too.
+
+Note that this also switches to Thumb(2) mode (in my case). No obvious
+problems have been noted during compilation or runtime.
+
+Upstream-Status: Inappropriate [oe-specific]
+Signed-off-by: André Draszik <git@andred.net>
+---
+ tools/v8_gypfiles/toolchain.gypi | 52 ++--------------------------------------
+ 1 file changed, 2 insertions(+), 50 deletions(-)
+
+diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi
+index f53644502a2d..f01f45af8534 100644
+--- a/tools/v8_gypfiles/toolchain.gypi
++++ b/tools/v8_gypfiles/toolchain.gypi
+@@ -177,31 +177,7 @@
+ 'target_conditions': [
+ ['_toolset=="host"', {
+ 'conditions': [
+- ['v8_target_arch==host_arch', {
+- # Host built with an Arm CXX compiler.
+- 'conditions': [
+- [ 'arm_version==7', {
+- 'cflags': ['-march=armv7-a',],
+- }],
+- [ 'arm_version==7 or arm_version=="default"', {
+- 'conditions': [
+- [ 'arm_fpu!="default"', {
+- 'cflags': ['-mfpu=<(arm_fpu)',],
+- }],
+- ],
+- }],
+- [ 'arm_float_abi!="default"', {
+- 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
+- }],
+- [ 'arm_thumb==1', {
+- 'cflags': ['-mthumb',],
+- }],
+- [ 'arm_thumb==0', {
+- 'cflags': ['-marm',],
+- }],
+- ],
+- }, {
+- # 'v8_target_arch!=host_arch'
++ ['v8_target_arch!=host_arch', {
+ # Host not built with an Arm CXX compiler (simulator build).
+ 'conditions': [
+ [ 'arm_float_abi=="hard"', {
+@@ -220,31 +196,7 @@
+ }], # _toolset=="host"
+ ['_toolset=="target"', {
+ 'conditions': [
+- ['v8_target_arch==target_arch', {
+- # Target built with an Arm CXX compiler.
+- 'conditions': [
+- [ 'arm_version==7', {
+- 'cflags': ['-march=armv7-a',],
+- }],
+- [ 'arm_version==7 or arm_version=="default"', {
+- 'conditions': [
+- [ 'arm_fpu!="default"', {
+- 'cflags': ['-mfpu=<(arm_fpu)',],
+- }],
+- ],
+- }],
+- [ 'arm_float_abi!="default"', {
+- 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
+- }],
+- [ 'arm_thumb==1', {
+- 'cflags': ['-mthumb',],
+- }],
+- [ 'arm_thumb==0', {
+- 'cflags': ['-marm',],
+- }],
+- ],
+- }, {
+- # 'v8_target_arch!=target_arch'
++ ['v8_target_arch!=target_arch', {
+ # Target not built with an Arm CXX compiler (simulator build).
+ 'conditions': [
+ [ 'arm_float_abi=="hard"', {
diff --git a/patches/node-v20.11.0/0100-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch b/patches/node-v20.11.0/0100-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch
new file mode 100644
index 000000000..211304072
--- /dev/null
+++ b/patches/node-v20.11.0/0100-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch
@@ -0,0 +1,46 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 27 Mar 2020 11:32:01 +0100
+Subject: [PATCH] HACK: don't add LD_LIBRARY_PATH for external tools
+
+When host and target architecture match, then the target path in
+LD_LIBRARY_PATH confuses the linker and the wrong libraries are used.
+As a result executing the tool fails.
+Always removing the target path from LD_LIBRARY_PATH is not an options
+because in this case building host-nodejs fails with a missing library.
+
+In PTXdist we overwrite the path to the tool to point to sysroot-host when
+building the target nodejs. We can use that to set the LD_LIBRARY_PATH only
+for host-nodejs.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ tools/gyp/pylib/gyp/generator/make.py | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py
+index 1b9974948e4d..d6f7097dd6bf 100644
+--- a/tools/gyp/pylib/gyp/generator/make.py
++++ b/tools/gyp/pylib/gyp/generator/make.py
+@@ -1071,12 +1071,16 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
+ "%s%s" % (name, cd_action, command)
+ )
+ else:
+- self.WriteLn(
+- "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:"
+- "$(builddir)/lib.target:$$LD_LIBRARY_PATH; "
+- "export LD_LIBRARY_PATH; "
+- "%s%s" % (name, cd_action, command)
+- )
++ if action['action'][0].startswith('$(builddir)'):
++ self.WriteLn(
++ "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:"
++ "$(builddir)/lib.target:$$LD_LIBRARY_PATH; "
++ "export LD_LIBRARY_PATH; "
++ "%s%s" % (name, cd_action, command)
++ )
++ else:
++ self.WriteLn('cmd_%s = %s%s'
++ % (name, cd_action, command))
+ self.WriteLn()
+ outputs = [self.Absolutify(o) for o in outputs]
+ # The makefile rules are all relative to the top dir, but the gyp actions
diff --git a/patches/node-v20.11.0/0101-run-native-code-generators-with-qemu.patch b/patches/node-v20.11.0/0101-run-native-code-generators-with-qemu.patch
new file mode 100644
index 000000000..5cbcfd4ff
--- /dev/null
+++ b/patches/node-v20.11.0/0101-run-native-code-generators-with-qemu.patch
@@ -0,0 +1,85 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sat, 4 Feb 2023 16:18:21 +0100
+Subject: [PATCH] run native code generators with qemu
+
+Host tools cannot be used because they would generate code based on
+properties of the host architecture, e.g. pointer size.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ node.gyp | 3 +++
+ tools/v8_gypfiles/v8.gyp | 5 +++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/node.gyp b/node.gyp
+index aa98fe4c2fae..5ebc27d92de4 100644
+--- a/node.gyp
++++ b/node.gyp
+@@ -662,6 +662,7 @@
+ 'action_name': 'node_mksnapshot',
+ 'process_outputs_as_sources': 1,
+ 'inputs': [
++ '<(PRODUCT_DIR)/tool-wrapper',
+ '<(node_mksnapshot_exec)',
+ '<(node_snapshot_main)',
+ ],
+@@ -966,6 +967,7 @@
+ 'action_name': 'node_js2c',
+ 'process_outputs_as_sources': 1,
+ 'inputs': [
++ '<(PRODUCT_DIR)/tool-wrapper',
+ '<(node_js2c_exec)',
+ '<@(library_files)',
+ '<@(deps_files)',
+@@ -975,6 +977,7 @@
+ '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
+ ],
+ 'action': [
++ '<(PRODUCT_DIR)/tool-wrapper',
+ '<(node_js2c_exec)',
+ '<@(_outputs)',
+ 'lib',
+diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
+index adfc3f6e1095..f4c472a08d23 100644
+--- a/tools/v8_gypfiles/v8.gyp
++++ b/tools/v8_gypfiles/v8.gyp
+@@ -81,6 +81,7 @@
+ {
+ 'action_name': 'run_torque_action',
+ 'inputs': [ # Order matters.
++ '<(PRODUCT_DIR)/tool-wrapper',
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
+ '<@(torque_files)',
+ ],
+@@ -112,6 +113,7 @@
+ '<@(torque_outputs_inc)',
+ ],
+ 'action': [
++ '<(PRODUCT_DIR)/tool-wrapper',
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
+ '-o', '<(SHARED_INTERMEDIATE_DIR)/torque-generated',
+ '-v8-root', '<(V8_ROOT)',
+@@ -224,6 +226,7 @@
+ {
+ 'action_name': 'generate_bytecode_builtins_list_action',
+ 'inputs': [
++ '<(PRODUCT_DIR)/tool-wrapper',
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
+ ],
+ 'outputs': [
+@@ -401,6 +404,7 @@
+ ],
+ },
+ 'inputs': [
++ '<(PRODUCT_DIR)/tool-wrapper',
+ '<(mksnapshot_exec)',
+ ],
+ 'outputs': [
+@@ -1670,6 +1674,7 @@
+ {
+ 'action_name': 'run_gen-regexp-special-case_action',
+ 'inputs': [
++ '<(PRODUCT_DIR)/tool-wrapper',
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
+ ],
+ 'outputs': [
diff --git a/patches/node-v20.11.0/series b/patches/node-v20.11.0/series
new file mode 100644
index 000000000..144cf5e3c
--- /dev/null
+++ b/patches/node-v20.11.0/series
@@ -0,0 +1,9 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+#tag:yocto --start-number 1
+0001-Disable-running-gyp-on-shared-deps.patch
+0002-v8-don-t-override-ARM-CFLAGS.patch
+#tag:ptxdist --start-number 100
+0100-HACK-don-t-add-LD_LIBRARY_PATH-for-external-tools.patch
+0101-run-native-code-generators-with-qemu.patch
+# 9987788495828c11410721504d543da5 - git-ptx-patches magic
diff --git a/patches/nss-3.63/0001-nss-fix-nsinstall-build.patch b/patches/nss-3.98/0001-nss-fix-nsinstall-build.patch
index 6787295ce..ec9c342b6 100644
--- a/patches/nss-3.63/0001-nss-fix-nsinstall-build.patch
+++ b/patches/nss-3.98/0001-nss-fix-nsinstall-build.patch
@@ -24,7 +24,7 @@ Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
1 file changed, 7 insertions(+)
diff --git a/nss/coreconf/nsinstall/Makefile b/nss/coreconf/nsinstall/Makefile
-index 08dfbc2fe627..aa385a17453f 100644
+index 5061789ffebd..4e67f56cf0bc 100644
--- a/nss/coreconf/nsinstall/Makefile
+++ b/nss/coreconf/nsinstall/Makefile
@@ -18,6 +18,13 @@ INTERNAL_TOOLS = 1
diff --git a/patches/nss-3.63/0002-add-nss.pc.in.patch b/patches/nss-3.98/0002-add-nss.pc.in.patch
index addc805b5..addc805b5 100644
--- a/patches/nss-3.63/0002-add-nss.pc.in.patch
+++ b/patches/nss-3.98/0002-add-nss.pc.in.patch
diff --git a/patches/nss-3.63/0003-HACK-don-t-build-commands-that-need-zlib.patch b/patches/nss-3.98/0003-HACK-don-t-build-commands-that-need-zlib.patch
index 623e97076..0447fef00 100644
--- a/patches/nss-3.63/0003-HACK-don-t-build-commands-that-need-zlib.patch
+++ b/patches/nss-3.98/0003-HACK-don-t-build-commands-that-need-zlib.patch
@@ -12,19 +12,19 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 2 deletions(-)
diff --git a/nss/cmd/manifest.mn b/nss/cmd/manifest.mn
-index 695177c9dccf..004c7f819198 100644
+index 06bb99f4f8e0..4eb0024415ee 100644
--- a/nss/cmd/manifest.mn
+++ b/nss/cmd/manifest.mn
-@@ -67,7 +67,6 @@ NSS_SRCDIRS = \
- rsapoptst \
+@@ -69,7 +69,6 @@ NSS_SRCDIRS = \
+ sdbthreadtst \
sdrtest \
selfserv \
- signtool \
signver \
smimetools \
ssltap \
-@@ -77,7 +76,6 @@ NSS_SRCDIRS = \
- tstclnt \
+@@ -80,7 +79,6 @@ NSS_SRCDIRS = \
+ validation \
vfychain \
vfyserv \
- modutil \
diff --git a/patches/nss-3.63/0004-HACK-fix-parallel-building-issue.patch b/patches/nss-3.98/0004-HACK-fix-parallel-building-issue.patch
index b2273008a..b4e5a9f00 100644
--- a/patches/nss-3.63/0004-HACK-fix-parallel-building-issue.patch
+++ b/patches/nss-3.98/0004-HACK-fix-parallel-building-issue.patch
@@ -17,7 +17,7 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/nss/coreconf/rules.mk b/nss/coreconf/rules.mk
-index dc72e9cef62f..62fb57655819 100644
+index a341b8385ae4..2c0a7a3f30b1 100644
--- a/nss/coreconf/rules.mk
+++ b/nss/coreconf/rules.mk
@@ -373,8 +373,8 @@ endif
@@ -30,4 +30,4 @@ index dc72e9cef62f..62fb57655819 100644
+ $$(INSTALL) -m 444 $$< $(3)
$(1): $$(addprefix $(3)/,$$($(2))) | $(3)/d
- endif
+
diff --git a/patches/nss-3.63/0005-fix-dependency-generation.patch b/patches/nss-3.98/0005-fix-dependency-generation.patch
index c97c3fb60..1192da18b 100644
--- a/patches/nss-3.63/0005-fix-dependency-generation.patch
+++ b/patches/nss-3.98/0005-fix-dependency-generation.patch
@@ -18,7 +18,7 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 2 insertions(+)
diff --git a/nss/coreconf/rules.mk b/nss/coreconf/rules.mk
-index 62fb57655819..b318eb41cb7c 100644
+index 2c0a7a3f30b1..a188881df94b 100644
--- a/nss/coreconf/rules.mk
+++ b/nss/coreconf/rules.mk
@@ -191,6 +191,8 @@ ifeq ($(OS_ARCH),WINNT)
diff --git a/patches/nss-3.63/series b/patches/nss-3.98/series
index 534d0d6d6..534d0d6d6 100644
--- a/patches/nss-3.63/series
+++ b/patches/nss-3.98/series
diff --git a/patches/ntp-4.2.8p12/0001-make-the-build-reproducible.patch b/patches/ntp-4.2.8p12/0001-make-the-build-reproducible.patch
deleted file mode 100644
index 5c70b10a2..000000000
--- a/patches/ntp-4.2.8p12/0001-make-the-build-reproducible.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Tue, 23 Oct 2018 00:21:54 +0200
-Subject: [PATCH] make the build reproducible
-
-Don't include the current date / time into the build.
-
-Original patch from Debian.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- scripts/build/mkver.in | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/scripts/build/mkver.in b/scripts/build/mkver.in
-index 3aef1c816a7f..badd2cda8c1f 100644
---- a/scripts/build/mkver.in
-+++ b/scripts/build/mkver.in
-@@ -15,8 +15,6 @@ case "@VER_SUFFIX@" in
- *) ConfStr="${ConfStr}-@VER_SUFFIX@" ;;
- esac
-
--ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`"
--
- if [ ! -f .version ]; then
- echo 0 > .version
- fi
diff --git a/patches/ntp-4.2.8p12/series b/patches/ntp-4.2.8p12/series
deleted file mode 100644
index 6b9bdfd27..000000000
--- a/patches/ntp-4.2.8p12/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-make-the-build-reproducible.patch
-# a698708e9f96ed91827a81d376db1955 - git-ptx-patches magic
diff --git a/patches/ntpclient-2007/0001-Use-the-correct-macro-name-to-parametrize-make-s-sta.patch b/patches/ntpclient-2007/0001-Use-the-correct-macro-name-to-parametrize-make-s-sta.patch
deleted file mode 100644
index 1a742ba53..000000000
--- a/patches/ntpclient-2007/0001-Use-the-correct-macro-name-to-parametrize-make-s-sta.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From bfaeb4bc93d1298d97a166dfec900e407f77e6e1 Mon Sep 17 00:00:00 2001
-From: Juergen Beisert <juergen@kreuzholzen.de>
-Date: Wed, 20 Jan 2010 00:04:56 +0100
-Subject: [PATCH 1/3] Use the correct macro name to parametrize make's standard rule
-
-To add libraries to be linked, the 'LDLIBS' is the correct macro name.
-'LDFAGS' is for paths etc.
-
-Make's standard rule to compile a C file into an executable is:
-
-$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< $(LDLIBS) -o $@
-
-Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>
----
- Makefile | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index ceed367..3ab9206 100644
---- a/Makefile
-+++ b/Makefile
-@@ -14,7 +14,7 @@ CFLAGS += -DENABLE_DEBUG
- CFLAGS += -DENABLE_REPLAY
- # CFLAGS += -DUSE_OBSOLETE_GETTIMEOFDAY
-
--LDFLAGS += -lrt
-+LDLIBS += -lrt
-
- all: ntpclient
-
---
-1.6.6
-
diff --git a/patches/ntpclient-2007/0002-Avoid-some-confusing-compile-time-warnings.patch b/patches/ntpclient-2007/0002-Avoid-some-confusing-compile-time-warnings.patch
deleted file mode 100644
index d90028e05..000000000
--- a/patches/ntpclient-2007/0002-Avoid-some-confusing-compile-time-warnings.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From cb4ef6d4101d3a558647c8d9e84f67a81b1d1bd2 Mon Sep 17 00:00:00 2001
-From: Juergen Beisert <juergen@kreuzholzen.de>
-Date: Wed, 20 Jan 2010 00:04:56 +0100
-Subject: [PATCH 2/3] Avoid some confusing compile time warnings
-
-We are compiling ntpclient on a GNU based system. This patch avoids the
-following warning:
-
-ntpclient.c:447: warning: implicit declaration of function 'herror'
-ntpclient.c:447: warning: nested extern declaration of 'herror'
-
-Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- ntpclient.c | 2 --
- 1 files changed, 0 insertions(+), 2 deletions(-)
-
-diff --git a/ntpclient.c b/ntpclient.c
-index 61254e2..73d9fa6 100644
---- a/ntpclient.c
-+++ b/ntpclient.c
-@@ -32,8 +32,6 @@
- * labelled "XXX fixme - non-automatic build configuration".
- */
-
--#define _POSIX_C_SOURCE 199309
--
- #ifdef USE_OBSOLETE_GETTIMEOFDAY
- #define _BSD_SOURCE
- #endif
---
-1.6.6
-
diff --git a/patches/ntpclient-2007/series b/patches/ntpclient-2007/series
deleted file mode 100644
index 0b0052937..000000000
--- a/patches/ntpclient-2007/series
+++ /dev/null
@@ -1,3 +0,0 @@
-0001-Use-the-correct-macro-name-to-parametrize-make-s-sta.patch
-0002-Avoid-some-confusing-compile-time-warnings.patch
-0003-Makefile-add-installtarget.patch
diff --git a/patches/ntpclient-2007/0003-Makefile-add-installtarget.patch b/patches/ntpclient_2015_365/0001-Makefile-add-installtarget.patch
index ddaae7bb1..33c09cf80 100644
--- a/patches/ntpclient-2007/0003-Makefile-add-installtarget.patch
+++ b/patches/ntpclient_2015_365/0001-Makefile-add-installtarget.patch
@@ -1,19 +1,18 @@
-From e4b1603f6e38923c905110a7d096c4d4a3553ccb Mon Sep 17 00:00:00 2001
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Wed, 20 Jan 2010 00:05:54 +0100
-Subject: [PATCH 3/3] Makefile: add installtarget
+Subject: [PATCH] Makefile: add installtarget
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
- Makefile | 6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
+ Makefile | 6 ++++++
+ 1 file changed, 6 insertions(+)
diff --git a/Makefile b/Makefile
-index 3ab9206..fe4da0a 100644
+index 0b596626fd9c..4ae37fd3dd43 100644
--- a/Makefile
+++ b/Makefile
-@@ -27,5 +27,11 @@ ntpclient.o phaselock.o: ntpclient.h
+@@ -39,5 +39,11 @@ ntpclient.o phaselock.o: ntpclient.h
adjtimex: adjtimex.o
@@ -25,6 +24,3 @@ index 3ab9206..fe4da0a 100644
+
clean:
rm -f ntpclient adjtimex *.o
---
-1.6.6
-
diff --git a/patches/ntpclient_2015_365/series b/patches/ntpclient_2015_365/series
new file mode 100644
index 000000000..6d4842f4a
--- /dev/null
+++ b/patches/ntpclient_2015_365/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Makefile-add-installtarget.patch
+# b4b01856a6ce13d5b2fba2d4ab158b05 - git-ptx-patches magic
diff --git a/patches/numpy-1.17.4/0001-remove-sse2-flag.patch b/patches/numpy-1.17.4/0001-remove-sse2-flag.patch
deleted file mode 100644
index 2c88b429b..000000000
--- a/patches/numpy-1.17.4/0001-remove-sse2-flag.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 4708211dc86d396f30c54bf71bc7194338272637 Mon Sep 17 00:00:00 2001
-From: mattip <matti.picus@gmail.com>
-Date: Mon, 11 Nov 2019 12:48:00 -0700
-Subject: [PATCH] BUILD: remove SSE2 flag from numpy.random builds
-
-This is a backport of https://github.com/numpy/numpy/pull/14878
-
----
- numpy/random/setup.py | 5 -----
- 1 file changed, 5 deletions(-)
-
-diff --git a/numpy/random/setup.py b/numpy/random/setup.py
-index ca01250f437..f9059d7d76a 100644
---- a/numpy/random/setup.py
-+++ b/numpy/random/setup.py
-@@ -49,11 +49,6 @@
- elif not is_msvc:
- # Some bit generators require c99
- EXTRA_COMPILE_ARGS += ['-std=c99']
-- INTEL_LIKE = any(arch in platform.machine()
-- for arch in ('x86', 'i686', 'i386', 'amd64'))
-- if INTEL_LIKE:
-- # Assumes GCC or GCC-like compiler
-- EXTRA_COMPILE_ARGS += ['-msse2']
-
- # Use legacy integer variable sizes
- LEGACY_DEFS = [('NP_RANDOM_LEGACY', '1')]
diff --git a/patches/numpy-1.17.4/series b/patches/numpy-1.17.4/series
deleted file mode 100644
index 64785c945..000000000
--- a/patches/numpy-1.17.4/series
+++ /dev/null
@@ -1 +0,0 @@
-0001-remove-sse2-flag.patch
diff --git a/patches/numpy-1.26.0/0001-use-path-from-environment-only-for-library_dirs.patch b/patches/numpy-1.26.0/0001-use-path-from-environment-only-for-library_dirs.patch
new file mode 100644
index 000000000..199780ab2
--- /dev/null
+++ b/patches/numpy-1.26.0/0001-use-path-from-environment-only-for-library_dirs.patch
@@ -0,0 +1,25 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 21 Nov 2023 12:06:35 +0100
+Subject: [PATCH] use path from environment only for 'library_dirs'
+
+The environment variable is needed for openblas to be found but it should
+not be used exdend the rpath.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ numpy/distutils/system_info.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
+index edf56909ab5d..2b43b450a417 100644
+--- a/numpy/distutils/system_info.py
++++ b/numpy/distutils/system_info.py
+@@ -890,7 +890,7 @@ def get_paths(self, section, key):
+ if not env_var[0] == e0:
+ log.info('Setting %s=%s' % (env_var[0], e0))
+ env_var = e0
+- if env_var and env_var in os.environ:
++ if env_var and env_var in os.environ and key == 'library_dirs':
+ d = os.environ[env_var]
+ if d == 'None':
+ log.info('Disabled %s: %s',
diff --git a/patches/numpy-1.26.0/series b/patches/numpy-1.26.0/series
new file mode 100644
index 000000000..a493ac227
--- /dev/null
+++ b/patches/numpy-1.26.0/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-use-path-from-environment-only-for-library_dirs.patch
+# d9bc0f9a910e0d311ad4c7761b8f6062 - git-ptx-patches magic
diff --git a/patches/open62541-1.2/0001-CMake-Allow-UA_NODESET_DIR-to-be-custom-defined.patch b/patches/open62541-1.2/0001-CMake-Allow-UA_NODESET_DIR-to-be-custom-defined.patch
deleted file mode 100644
index d07f9a30a..000000000
--- a/patches/open62541-1.2/0001-CMake-Allow-UA_NODESET_DIR-to-be-custom-defined.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-From 3b0511e0e85700a8623ab6d0e1a6f8df42bc1c16 Mon Sep 17 00:00:00 2001
-From: Sascha Hauer <s.hauer@pengutronix.de>
-Date: Wed, 3 Mar 2021 10:46:28 +0100
-Subject: [PATCH] CMake: Allow UA_NODESET_DIR to be custom defined.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This makes it easier for developers to keep all ua-nodesets XML
-definitions in a common location.
-
-Backported from: https://github.com/open62541/open62541/pull/3310
-
-Signed-off-by: Björn Esser <b.esser@pengutronix.de>
----
- CMakeLists.txt | 6 +++++-
- doc/nodeset_compiler.rst | 22 +++++++++++-----------
- examples/CMakeLists.txt | 4 ----
- tools/cmake/macros_public.cmake | 2 +-
- 4 files changed, 17 insertions(+), 17 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index d09a77a6..87338eb8 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -15,7 +15,6 @@ include(GNUInstallDirs)
-
- # Set when installed via make install
- set(open62541_TOOLS_DIR ${PROJECT_SOURCE_DIR}/tools)
--set(open62541_NODESET_DIR ${PROJECT_SOURCE_DIR}/deps/ua-nodeset)
- set(XDP_LIBRARY "/usr/local/src/bpf-next/tools/lib/bpf/libbpf.a")
-
- include(macros_internal)
-@@ -160,6 +159,11 @@ if(UA_ENABLE_ENCRYPTION_OPENSSL)
- set(UA_ENABLE_ENCRYPTION_MBEDTLS OFF)
- endif()
-
-+if(NOT UA_NODESET_DIR)
-+ set(UA_NODESET_DIR ${PROJECT_SOURCE_DIR}/deps/ua-nodeset)
-+endif()
-+set(open62541_NODESET_DIR ${UA_NODESET_DIR})
-+
- # Namespace Zero
- set(UA_NAMESPACE_ZERO "REDUCED" CACHE STRING "Completeness of the generated namespace zero (minimal/reduced/full)")
- SET_PROPERTY(CACHE UA_NAMESPACE_ZERO PROPERTY STRINGS "MINIMAL" "REDUCED" "FULL")
-diff --git a/doc/nodeset_compiler.rst b/doc/nodeset_compiler.rst
-index 730eda80..ea110d40 100644
---- a/doc/nodeset_compiler.rst
-+++ b/doc/nodeset_compiler.rst
-@@ -292,17 +292,17 @@ Here are some examples for the ``DI`` and ``PLCOpen`` nodesets::
- # Generate types and namespace for DI
- ua_generate_nodeset_and_datatypes(
- NAME "di"
-- FILE_CSV "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv"
-- FILE_BSD "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd"
-+ FILE_CSV "${UA_NODESET_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv"
-+ FILE_BSD "${UA_NODESET_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd"
- NAMESPACE_MAP "2:http://opcfoundation.org/UA/DI/"
-- FILE_NS "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml"
-+ FILE_NS "${UA_NODESET_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml"
- )
-
- # generate PLCopen namespace which is using DI
- ua_generate_nodeset_and_datatypes(
- NAME "plc"
- # PLCopen does not define custom types. Only generate the nodeset
-- FILE_NS "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/PLCopen/Opc.Ua.Plc.NodeSet2.xml"
-+ FILE_NS "${UA_NODESET_DIR}/PLCopen/Opc.Ua.Plc.NodeSet2.xml"
- # PLCopen depends on the di nodeset, which must be generated before
- DEPENDS "di"
- )
-@@ -401,8 +401,8 @@ This DI nodeset makes use of some additional data types in ``deps/ua-nodeset/DI/
- NAME "ua_types_di"
- TARGET_SUFFIX "types-di"
- NAMESPACE_MAP "2:http://opcfoundation.org/UA/DI/"
-- FILE_CSV "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv"
-- FILES_BSD "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd"
-+ FILE_CSV "${UA_NODESET_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv"
-+ FILES_BSD "${UA_NODESET_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd"
- )
-
- The ``NAMESPACE_MAP`` parameter is an array of strings which indicates the mapping of specific namespace uris to the resulting namespace index.
-@@ -414,11 +414,11 @@ Now you can compile the DI nodeset XML using the following command::
-
- ua_generate_nodeset(
- NAME "di"
-- FILE "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml"
-+ FILE "${UA_NODESET_DIR}/DI/Opc.Ua.Di.NodeSet2.xml"
- TYPES_ARRAY "UA_TYPES_DI"
- INTERNAL
- DEPENDS_TYPES "UA_TYPES"
-- DEPENDS_NS "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml"
-+ DEPENDS_NS "${UA_NODESET_DIR}/Schema/Opc.Ua.NodeSet2.xml"
- DEPENDS_TARGET "open62541-generator-types-di"
- )
-
-@@ -429,13 +429,13 @@ Next we can generate the PLCopen nodeset. Since it doesn't require any additiona
-
- ua_generate_nodeset(
- NAME "plc"
-- FILE "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/PLCopen/Opc.Ua.Plc.NodeSet2.xml"
-+ FILE "${UA_NODESET_DIR}/PLCopen/Opc.Ua.Plc.NodeSet2.xml"
- INTERNAL
- DEPENDS_TYPES
- "UA_TYPES" "UA_TYPES_DI"
- DEPENDS_NS
-- "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml"
-- "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml"
-+ "${UA_NODESET_DIR}/Schema/Opc.Ua.NodeSet2.xml"
-+ "${UA_NODESET_DIR}/DI/Opc.Ua.Di.NodeSet2.xml"
- DEPENDS_TARGET "open62541-generator-ns-di"
- )
-
-diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
-index 70c84560..b589dec3 100644
---- a/examples/CMakeLists.txt
-+++ b/examples/CMakeLists.txt
-@@ -26,10 +26,6 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
- set(UA_TOOLS_DIR ${open62541_TOOLS_DIR})
- endif()
-
-- if(NOT UA_NODESET_DIR)
-- set(UA_NODESET_DIR ${open62541_NODESET_DIR})
-- endif()
--
- function(assign_source_group)
- # define empty function. We don't need it in standalone
- endfunction(assign_source_group)
-diff --git a/tools/cmake/macros_public.cmake b/tools/cmake/macros_public.cmake
-index 95414e3d..4172392f 100644
---- a/tools/cmake/macros_public.cmake
-+++ b/tools/cmake/macros_public.cmake
-@@ -97,7 +97,7 @@ endfunction()
- # passed which will all combined to one resulting code.
- # IMPORT_BSD Combination of types array and path to the .bsd file containing additional type definitions referenced by
- # the FILES_BSD files. The value is separated with a hash sign, i.e.
--# 'UA_TYPES#${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.Types.bsd'
-+# 'UA_TYPES#${UA_NODESET_DIR}/Schema/Opc.Ua.Types.bsd'
- # Multiple files can be passed which will all be imported.
- # [FILES_SELECTED] Optional path to a simple text file which contains a list of types which should be included in the generation.
- # The file should contain one type per line. Multiple files can be passed to this argument.
---
-2.29.2
-
diff --git a/patches/open62541-1.3.4/0001-feat-server-allow-UA_NODESET_DIR-to-be-custom-define.patch b/patches/open62541-1.3.4/0001-feat-server-allow-UA_NODESET_DIR-to-be-custom-define.patch
new file mode 100644
index 000000000..f54b5d7a5
--- /dev/null
+++ b/patches/open62541-1.3.4/0001-feat-server-allow-UA_NODESET_DIR-to-be-custom-define.patch
@@ -0,0 +1,71 @@
+From: Noel Graf <69737119+NoelGraf@users.noreply.github.com>
+Date: Tue, 7 Jun 2022 11:04:03 +0200
+Subject: [PATCH] feat(server) allow UA_NODESET_DIR to be custom defined.
+ (#5138)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This makes it easier for developers to keep all ua-nodesets XML
+definitions in a common location.
+
+Signed-off-by: Björn Esser <b.esser@pengutronix.de>
+
+Co-authored-by: Björn Esser <b.esser@pengutronix.de>
+Origin: backport, https://github.com/open62541/open62541/commit/02f101df73b8d9a32b6882f41e1a2240f3c601b3
+Signed-off-by: Roland Hieber <rhi@pengutronix.de>
+---
+ CMakeLists.txt | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1934374ecc2b..27498e54a6be 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -20,7 +20,7 @@ include(GNUInstallDirs)
+
+ # Set when installed via make install
+ set(open62541_TOOLS_DIR ${PROJECT_SOURCE_DIR}/tools)
+-set(open62541_NODESET_DIR ${PROJECT_SOURCE_DIR}/deps/ua-nodeset)
++set(UA_NODESET_DIR ${PROJECT_SOURCE_DIR}/deps/ua-nodeset CACHE STRING "The path to the nodetset directory.")
+ set(open62541_MQTT_DIR ${PROJECT_SOURCE_DIR}/deps/mqtt-c)
+
+ include(macros_internal)
+@@ -1184,12 +1184,12 @@ set(UA_FILE_NODESETS)
+
+ if(UA_NAMESPACE_ZERO STREQUAL "FULL" OR UA_NAMESPACE_ZERO STREQUAL "LATEST_1_05")
+ if(NOT UA_FILE_NS0)
+- set(UA_FILE_NS0 ${open62541_NODESET_DIR}/Schema/Opc.Ua.NodeSet2.xml)
++ set(UA_FILE_NS0 ${UA_NODESET_DIR}/Schema/Opc.Ua.NodeSet2.xml)
+ endif()
+ set(UA_FILE_NODESETS "${UA_FILE_NS0}")
+
+ if(NOT EXISTS "${UA_FILE_NS0}")
+- message(FATAL_ERROR "File ${UA_FILE_NS0} not found. You probably need to initialize the git submodule for deps/ua-nodeset or set open62541_NODESET_DIR.")
++ message(FATAL_ERROR "File ${UA_FILE_NS0} not found. You probably need to initialize the git submodule for deps/ua-nodeset or set UA_NODESET_DIR.")
+ else()
+ # If the "LATEST_1_05" flag is set, it must be checked whether the nodeset NS0 is on the latest version.
+ if(UA_NAMESPACE_ZERO STREQUAL "LATEST_1_05")
+@@ -1202,9 +1202,10 @@ if(UA_NAMESPACE_ZERO STREQUAL "FULL" OR UA_NAMESPACE_ZERO STREQUAL "LATEST_1_05"
+ endif()
+
+
+- set(UA_FILE_NODEIDS ${open62541_NODESET_DIR}/Schema/NodeIds.csv)
+- set(UA_FILE_STATUSCODES ${open62541_NODESET_DIR}/Schema/StatusCode.csv)
+- set(UA_FILE_TYPES_BSD ${open62541_NODESET_DIR}/Schema/Opc.Ua.Types.bsd)
++
++ set(UA_FILE_NODEIDS ${UA_NODESET_DIR}/Schema/NodeIds.csv)
++ set(UA_FILE_STATUSCODES ${UA_NODESET_DIR}/Schema/StatusCode.csv)
++ set(UA_FILE_TYPES_BSD ${UA_NODESET_DIR}/Schema/Opc.Ua.Types.bsd)
+ else()
+ if(NOT UA_FILE_NS0)
+ set(UA_FILE_NS0 ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.NodeSet2.Reduced.xml)
+@@ -1691,7 +1692,7 @@ endif()
+ set(UA_install_tools_dirs "tools/certs"
+ "tools/nodeset_compiler"
+ "tools/schema"
+- ${open62541_NODESET_DIR})
++ ${UA_NODESET_DIR})
+
+ set(UA_install_tools_files "tools/generate_datatypes.py"
+ "tools/generate_nodeid_header.py"
diff --git a/patches/open62541-1.3.4/series b/patches/open62541-1.3.4/series
new file mode 100644
index 000000000..65289cc57
--- /dev/null
+++ b/patches/open62541-1.3.4/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-feat-server-allow-UA_NODESET_DIR-to-be-custom-define.patch
+# 5f49204d943b5891fa7fb1fe92f69352 - git-ptx-patches magic
diff --git a/patches/openblas-0.3.24/0001-openblas.pc-add-prefix.patch b/patches/openblas-0.3.24/0001-openblas.pc-add-prefix.patch
new file mode 100644
index 000000000..5f39f1ed7
--- /dev/null
+++ b/patches/openblas-0.3.24/0001-openblas.pc-add-prefix.patch
@@ -0,0 +1,20 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Wed, 22 Nov 2023 08:52:47 +0100
+Subject: [PATCH] openblas.pc: add prefix=
+
+This is necessary for the PTXdist pc file mangling to work correctly.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ cmake/openblas.pc.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cmake/openblas.pc.in b/cmake/openblas.pc.in
+index 7e120af86609..4a192b84ddaf 100644
+--- a/cmake/openblas.pc.in
++++ b/cmake/openblas.pc.in
+@@ -1,3 +1,4 @@
++prefix=@CMAKE_INSTALL_PREFIX@
+ libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+ libsuffix=@SUFFIX64_UNDERSCORE@
+ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
diff --git a/patches/openblas-0.3.24/series b/patches/openblas-0.3.24/series
new file mode 100644
index 000000000..e33f06605
--- /dev/null
+++ b/patches/openblas-0.3.24/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-openblas.pc-add-prefix.patch
+# 0c516007ce3365e0a487aedd5026b60d - git-ptx-patches magic
diff --git a/patches/openssl-1.1.1k/0003-Set-systemwide-default-settings-for-libssl-users.patch b/patches/openssl-1.1.1k/0003-Set-systemwide-default-settings-for-libssl-users.patch
deleted file mode 100644
index 2377d8017..000000000
--- a/patches/openssl-1.1.1k/0003-Set-systemwide-default-settings-for-libssl-users.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
-Date: Tue, 20 Mar 2018 22:07:30 +0100
-Subject: [PATCH] Set systemwide default settings for libssl users
-
-This config change enforeces a TLS1.2 protocol version as minimum. It
-can be overwritten by the system administrator.
-
-It also changes the default security level from 1 to 2, moving from the 80 bit
-security level to the 112 bit security level.
-
-Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
-
-Imported from openssl_1.1.1k-1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- apps/openssl.cnf | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/apps/openssl.cnf b/apps/openssl.cnf
-index 4acca4b0446f..a6fed92a2e75 100644
---- a/apps/openssl.cnf
-+++ b/apps/openssl.cnf
-@@ -15,6 +15,9 @@ HOME = .
- #oid_file = $ENV::HOME/.oid
- oid_section = new_oids
-
-+# System default
-+openssl_conf = default_conf
-+
- # To use this configuration file with the "-extfile" option of the
- # "openssl x509" utility, name here the section containing the
- # X.509v3 extensions to use:
-@@ -348,3 +351,12 @@ ess_cert_id_chain = no # Must the ESS cert id chain be included?
- # (optional, default: no)
- ess_cert_id_alg = sha1 # algorithm to compute certificate
- # identifier (optional, default: sha1)
-+[default_conf]
-+ssl_conf = ssl_sect
-+
-+[ssl_sect]
-+system_default = system_default_sect
-+
-+[system_default_sect]
-+MinProtocol = TLSv1.2
-+CipherString = DEFAULT@SECLEVEL=2
diff --git a/patches/openssl-1.1.1k/series b/patches/openssl-1.1.1k/series
deleted file mode 100644
index 2bfca5ade..000000000
--- a/patches/openssl-1.1.1k/series
+++ /dev/null
@@ -1,6 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-debian-targets.patch
-0002-pic.patch
-0003-Set-systemwide-default-settings-for-libssl-users.patch
-# 0312ece60c710f114a26383fdd75ddcb - git-ptx-patches magic
diff --git a/patches/openssl-1.1.1k/0001-debian-targets.patch b/patches/openssl-3.2.1/0001-debian-targets.patch
index 940d68e3d..cb16676dc 100644
--- a/patches/openssl-1.1.1k/0001-debian-targets.patch
+++ b/patches/openssl-3.2.1/0001-debian-targets.patch
@@ -2,23 +2,23 @@ From: Debian OpenSSL Team <pkg-openssl-devel@lists.alioth.debian.org>
Date: Sun, 5 Nov 2017 15:09:09 +0100
Subject: [PATCH] debian-targets
-Imported from openssl_1.1.1k-1.debian.tar.xz
+Imported from openssl_3.0.8-1.debian.tar.xz
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- Configurations/20-debian.conf | 210 ++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 210 insertions(+)
+ Configurations/20-debian.conf | 169 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 169 insertions(+)
create mode 100644 Configurations/20-debian.conf
diff --git a/Configurations/20-debian.conf b/Configurations/20-debian.conf
new file mode 100644
-index 000000000000..a3d5f68d36aa
+index 000000000000..c6860ed4b7d7
--- /dev/null
+++ b/Configurations/20-debian.conf
-@@ -0,0 +1,210 @@
+@@ -0,0 +1,169 @@
+my %targets = (
+ "debian" => {
-+ cflags => add("-Wa,--noexecstack -Wall"),
++ cflags => add("-Wa,--noexecstack -Wall -fzero-call-used-regs=used-gpr -DOPENSSL_TLS_SECURITY_LEVEL=2"),
+ },
+ "debian-alpha" => {
+ inherit_from => [ "linux-alpha-gcc", "debian" ],
@@ -31,6 +31,9 @@ index 000000000000..a3d5f68d36aa
+ inherit_from => [ "debian-alpha" ],
+ cflags => add("-mcpu=ev5"),
+ },
++ "debian-arc" => {
++ inherit_from => [ "linux-latomic", "debian" ],
++ },
+ "debian-arm64" => {
+ inherit_from => [ "linux-aarch64", "debian" ],
+ },
@@ -62,15 +65,21 @@ index 000000000000..a3d5f68d36aa
+ },
+ "debian-hppa" => {
+ inherit_from => [ "linux-generic32", "debian" ],
++ cflags => add("-DB_ENDIAN"),
+ },
+ "debian-hurd-i386" => {
+ inherit_from => [ "hurd-x86", "debian" ],
+ },
+ "debian-ia64" => {
+ inherit_from => [ "linux-ia64", "debian" ],
++ cflags => add("-fzero-call-used-regs=skip"),
++ },
++ "debian-loong64" => {
++ inherit_from => [ "linux64-loongarch64", "debian" ],
+ },
+ "debian-m68k" => {
-+ inherit_from => [ "linux-generic32", "debian" ],
++ inherit_from => [ "linux-latomic", "debian" ],
++ cflags => add("-DB_ENDIAN"),
+ },
+ "debian-mips" => {
+ inherit_from => [ "linux-mips32", "debian" ],
@@ -97,59 +106,6 @@ index 000000000000..a3d5f68d36aa
+ cflags => add("-DL_ENDIAN"),
+ },
+
-+ # Temporary MIPS R6 targets. Those will vanish approx in 1.1.1 because
-+ # aes-mips.pl creates proper R6 ASM code. After that, we can inherit from
-+ # the linux*-mips* targets.
-+ "linux-mips32r6" => {
-+ # Configure script adds minimally required -march for assembly
-+ # support, if no -march was specified at command line.
-+ inherit_from => [ "linux-generic32"],
-+ cflags => add("-mabi=32"),
-+ perlasm_scheme => "o32",
-+ shared_ldflag => add("-mabi=32"),
-+ },
-+ # mips32 and mips64 below refer to contemporary MIPS Architecture
-+ # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
-+ "linux-mips64r6" => {
-+ inherit_from => [ "linux-generic32"],
-+ cflags => add("-mabi=n32"),
-+ bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
-+ perlasm_scheme => "n32",
-+ shared_ldflag => add("-mabi=n32"),
-+ multilib => "32",
-+ },
-+ "linux64-mips64r6" => {
-+ inherit_from => [ "linux-generic64"],
-+ cflags => add("-mabi=64"),
-+ perlasm_scheme => "64",
-+ shared_ldflag => add("-mabi=64"),
-+ multilib => "64",
-+ },
-+ "debian-mipsr6" => {
-+ inherit_from => [ "linux-mips32r6", "debian" ],
-+ cflags => add("-DB_ENDIAN"),
-+ },
-+ "debian-mipsr6el" => {
-+ inherit_from => [ "linux-mips32r6", "debian" ],
-+ cflags => add("-DL_ENDIAN"),
-+ },
-+ "debian-mipsn32r6" => {
-+ inherit_from => [ "linux-mips64r6", "debian" ],
-+ cflags => add("-DB_ENDIAN"),
-+ },
-+ "debian-mipsn32r6el" => {
-+ inherit_from => [ "linux-mips64r6", "debian" ],
-+ cflags => add("-DL_ENDIAN"),
-+ },
-+ "debian-mips64r6" => {
-+ inherit_from => [ "linux64-mips64r6", "debian" ],
-+ cflags => add("-DB_ENDIAN"),
-+ },
-+ "debian-mips64r6el" => {
-+ inherit_from => [ "linux64-mips64r6", "debian" ],
-+ cflags => add("-DL_ENDIAN"),
-+ },
-+
+ "debian-musl-linux-arm64" => {
+ inherit_from => [ "linux-aarch64", "debian" ],
+ },
@@ -169,7 +125,7 @@ index 000000000000..a3d5f68d36aa
+ },
+
+ "debian-nios2" => {
-+ inherit_from => [ "linux-generic32", "debian" ],
++ inherit_from => [ "linux-latomic", "debian" ],
+ },
+ "debian-powerpc" => {
+ inherit_from => [ "linux-ppc", "debian" ],
@@ -178,7 +134,8 @@ index 000000000000..a3d5f68d36aa
+ inherit_from => [ "linux-ppc", "debian" ],
+ },
+ "debian-ppc64" => {
-+ inherit_from => [ "linux-generic64", "debian", asm("ppc64_asm") ],
++ inherit_from => [ "linux-generic64", "debian", ],
++ asm_arch => 'ppc64',
+ cflags => add("-DB_ENDIAN"),
+ perlasm_scheme => "linux64",
+ },
@@ -195,28 +152,31 @@ index 000000000000..a3d5f68d36aa
+ inherit_from => [ "linux64-s390x", "debian" ],
+ },
+ "debian-sh3" => {
-+ inherit_from => [ "linux-generic32", "debian" ],
++ inherit_from => [ "linux-latomic", "debian" ],
+ },
+ "debian-sh3eb" => {
-+ inherit_from => [ "linux-generic32", "debian" ],
++ inherit_from => [ "linux-latomic", "debian" ],
+ },
+ "debian-sh4" => {
-+ inherit_from => [ "linux-generic32", "debian" ],
++ inherit_from => [ "linux-latomic", "debian" ],
+ },
+ "debian-sh4eb" => {
-+ inherit_from => [ "linux-generic32", "debian" ],
++ inherit_from => [ "linux-latomic", "debian" ],
+ },
+ "debian-m32r" => {
-+ inherit_from => [ "linux-generic32", "debian" ],
++ inherit_from => [ "linux-latomic", "debian" ],
+ },
+ "debian-sparc" => {
-+ inherit_from => [ "linux-generic32", "debian", asm("sparcv9_asm") ],
++ inherit_from => [ "linux-latomic", "debian", ],
++ asm_arch => 'sparcv9',
+ cflags => add("-DB_ENDIAN -DBN_DIV2W"),
+ },
+ "debian-sparc64" => {
-+ inherit_from => [ "linux-generic64", "debian", asm("sparcv9_asm") ],
++ inherit_from => [ "linux-generic64", "debian" ],
++ asm_arch => 'sparcv9',
+ cflags => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
+ bn_ops => "BN_LLONG RC4_CHAR",
++ ex_libs => add("-latomic"),
+ },
+ "debian-tilegx" => {
+ inherit_from => [ "linux-generic64", "debian" ],
@@ -225,4 +185,3 @@ index 000000000000..a3d5f68d36aa
+ inherit_from => [ "linux-x32", "debian" ],
+ },
+);
-+
diff --git a/patches/openssl-1.1.1k/0002-pic.patch b/patches/openssl-3.2.1/0002-pic.patch
index d833d93e8..840819211 100644
--- a/patches/openssl-1.1.1k/0002-pic.patch
+++ b/patches/openssl-3.2.1/0002-pic.patch
@@ -2,7 +2,7 @@ From: Debian OpenSSL Team <pkg-openssl-devel@lists.alioth.debian.org>
Date: Sun, 5 Nov 2017 15:09:09 +0100
Subject: [PATCH] pic
-Imported from openssl_1.1.1k-1.debian.tar.xz
+Imported from openssl_3.0.8-1.debian.tar.xz
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
@@ -13,7 +13,7 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
4 files changed, 55 insertions(+), 12 deletions(-)
diff --git a/crypto/des/asm/desboth.pl b/crypto/des/asm/desboth.pl
-index ef7054e27506..50765d2b1552 100644
+index afffd20d84cd..b50e85ce24f8 100644
--- a/crypto/des/asm/desboth.pl
+++ b/crypto/des/asm/desboth.pl
@@ -23,6 +23,11 @@ sub DES_encrypt3
@@ -54,7 +54,7 @@ index ef7054e27506..50765d2b1552 100644
&stack_pop(3);
&mov($L,&DWP(0,"ebx","",0));
diff --git a/crypto/perlasm/cbc.pl b/crypto/perlasm/cbc.pl
-index 01bafe457d68..c093be5a4fd6 100644
+index ef09e0fd297a..fe6ff45d1804 100644
--- a/crypto/perlasm/cbc.pl
+++ b/crypto/perlasm/cbc.pl
@@ -129,7 +129,11 @@ sub cbc
@@ -70,7 +70,7 @@ index 01bafe457d68..c093be5a4fd6 100644
&mov("eax", &DWP($data_off,"esp","",0));
&mov("ebx", &DWP($data_off+4,"esp","",0));
-@@ -192,7 +196,11 @@ sub cbc
+@@ -199,7 +203,11 @@ sub cbc
&mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
&mov(&DWP($data_off+4,"esp","",0), "ebx"); #
@@ -83,7 +83,7 @@ index 01bafe457d68..c093be5a4fd6 100644
&mov("eax", &DWP($data_off,"esp","",0));
&mov("ebx", &DWP($data_off+4,"esp","",0));
-@@ -225,7 +233,11 @@ sub cbc
+@@ -232,7 +240,11 @@ sub cbc
&mov(&DWP($data_off,"esp","",0), "eax"); # put back
&mov(&DWP($data_off+4,"esp","",0), "ebx"); #
@@ -96,7 +96,7 @@ index 01bafe457d68..c093be5a4fd6 100644
&mov("eax", &DWP($data_off,"esp","",0)); # get return
&mov("ebx", &DWP($data_off+4,"esp","",0)); #
-@@ -268,7 +280,11 @@ sub cbc
+@@ -275,7 +287,11 @@ sub cbc
&mov(&DWP($data_off,"esp","",0), "eax"); # put back
&mov(&DWP($data_off+4,"esp","",0), "ebx"); #
@@ -110,18 +110,18 @@ index 01bafe457d68..c093be5a4fd6 100644
&mov("eax", &DWP($data_off,"esp","",0)); # get return
&mov("ebx", &DWP($data_off+4,"esp","",0)); #
diff --git a/crypto/perlasm/x86gas.pl b/crypto/perlasm/x86gas.pl
-index 5c7ea3880e4d..7e49b55e97c7 100644
+index 1b2b27c02286..a62c01b175a2 100644
--- a/crypto/perlasm/x86gas.pl
+++ b/crypto/perlasm/x86gas.pl
-@@ -170,6 +170,7 @@ sub ::file_end
+@@ -171,6 +171,7 @@ sub ::file_end
if ($::macosx) { push (@out,"$tmp,2\n"); }
elsif ($::elf) { push (@out,"$tmp,4\n"); }
else { push (@out,"$tmp\n"); }
-+ if ($::elf) { push (@out,".hidden\tOPENSSL_ia32cap_P\n"); }
++ if ($::elf) { push (@out,".hidden\tOPENSSL_ia32cap_P\n"); }
}
push(@out,$initseg) if ($initseg);
- }
-@@ -228,8 +229,23 @@ ___
+ if ($::elf) {
+@@ -249,8 +250,23 @@ ___
elsif ($::elf)
{ $initseg.=<<___;
.section .init
@@ -146,10 +146,10 @@ index 5c7ea3880e4d..7e49b55e97c7 100644
elsif ($::coff)
{ $initseg.=<<___; # applies to both Cygwin and Mingw
diff --git a/crypto/x86cpuid.pl b/crypto/x86cpuid.pl
-index ba4fd80fb32e..18c124707587 100644
+index a7bcb27e262d..6688a1fc4464 100644
--- a/crypto/x86cpuid.pl
+++ b/crypto/x86cpuid.pl
-@@ -18,6 +18,8 @@ open OUT,">$output";
+@@ -16,6 +16,8 @@ $output = pop and open STDOUT,">$output";
for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
@@ -158,7 +158,7 @@ index ba4fd80fb32e..18c124707587 100644
&function_begin("OPENSSL_ia32_cpuid");
&xor ("edx","edx");
&pushf ();
-@@ -163,9 +165,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
+@@ -161,9 +163,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
&set_label("nocpuid");
&function_end("OPENSSL_ia32_cpuid");
@@ -169,7 +169,7 @@ index ba4fd80fb32e..18c124707587 100644
&xor ("eax","eax");
&xor ("edx","edx");
&picmeup("ecx","OPENSSL_ia32cap_P");
-@@ -179,7 +179,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
+@@ -177,7 +177,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
# This works in Ring 0 only [read DJGPP+MS-DOS+privileged DPMI host],
# but it's safe to call it on any [supported] 32-bit platform...
# Just check for [non-]zero return value...
@@ -178,7 +178,7 @@ index ba4fd80fb32e..18c124707587 100644
&picmeup("ecx","OPENSSL_ia32cap_P");
&bt (&DWP(0,"ecx"),4);
&jnc (&label("nohalt")); # no TSC
-@@ -246,7 +246,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
+@@ -244,7 +244,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
&ret ();
&function_end_B("OPENSSL_far_spin");
diff --git a/patches/openssl-3.2.1/0003-Configure-allow-to-enable-ktls-if-target-does-not-st.patch b/patches/openssl-3.2.1/0003-Configure-allow-to-enable-ktls-if-target-does-not-st.patch
new file mode 100644
index 000000000..6b518ef22
--- /dev/null
+++ b/patches/openssl-3.2.1/0003-Configure-allow-to-enable-ktls-if-target-does-not-st.patch
@@ -0,0 +1,55 @@
+From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+Date: Thu, 1 Apr 2021 21:46:17 +0200
+Subject: [PATCH] Configure: allow to enable ktls if target does not start with
+ Linux
+
+The Debian build system uses a `debian' target which sets CFLAGS and
+then we have for instance debian-amd64 which inherits from
+linux-x86_64 and debian. So far so good.
+
+Since the target name does not start with `linux', the build system does not
+enable ktls. So in order to get enabled, I
+added a
+ `enable => [ "ktls" ],'
+to the generic linux config which sets it explicit). Having this set, we can
+check for it instead matching the target name.
+
+This commit is based on changes for afalgeng in commit
+ 9e381e8a01859 ("Configure: allow to enable afalgeng if target does not start with Linux")
+
+Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+
+Imported from openssl_3.0.8-1.debian.tar.xz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Configurations/10-main.conf | 2 +-
+ Configure | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
+index 2a047caa7d4a..aa2685be93b9 100644
+--- a/Configurations/10-main.conf
++++ b/Configurations/10-main.conf
+@@ -693,7 +693,7 @@ my %targets = (
+ shared_target => "linux-shared",
+ shared_cflag => "-fPIC",
+ shared_ldflag => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
+- enable => [ "afalgeng" ],
++ enable => [ "afalgeng", "ktls" ],
+ },
+ "linux-latomic" => {
+ inherit_from => [ "linux-generic32" ],
+diff --git a/Configure b/Configure
+index cca1ac8d162e..c9bbcbbed3e6 100755
+--- a/Configure
++++ b/Configure
+@@ -1765,7 +1765,7 @@ unless ($disabled{devcryptoeng}) {
+ unless ($disabled{ktls}) {
+ $config{ktls}="";
+ my $cc = $config{CROSS_COMPILE}.$config{CC};
+- if ($target =~ m/^linux/) {
++ if (grep { $_ eq 'afalgeng' } @{$target{enable}}) {
+ system("printf '#include <sys/types.h>\n#include <linux/tls.h>' | $cc -E - >/dev/null 2>&1");
+ if ($? != 0) {
+ disable('too-old-kernel', 'ktls');
diff --git a/patches/openssl-3.2.1/0004-conf-Serialize-allocation-free-of-ssl_names.patch b/patches/openssl-3.2.1/0004-conf-Serialize-allocation-free-of-ssl_names.patch
new file mode 100644
index 000000000..e9cabb5f9
--- /dev/null
+++ b/patches/openssl-3.2.1/0004-conf-Serialize-allocation-free-of-ssl_names.patch
@@ -0,0 +1,106 @@
+From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+Date: Mon, 19 Sep 2022 20:51:31 +0200
+Subject: [PATCH] conf: Serialize allocation/free of ssl_names.
+
+The access to `ssl_names' is not fully serialized. With multiple threads
+it is possible that more than one thread starts to clean up `ssl_names'.
+This leads to occasional segfaults if more than one terminates and
+performs the clean up.
+
+Fixes: #19243
+
+Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+
+Imported from openssl_3.0.8-1.debian.tar.xz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ crypto/conf/conf_ssl.c | 35 ++++++++++++++++++++++++++++++++---
+ 1 file changed, 32 insertions(+), 3 deletions(-)
+
+diff --git a/crypto/conf/conf_ssl.c b/crypto/conf/conf_ssl.c
+index 84c5b2afe581..d6596e60c3b5 100644
+--- a/crypto/conf/conf_ssl.c
++++ b/crypto/conf/conf_ssl.c
+@@ -12,6 +12,7 @@
+ #include <openssl/conf.h>
+ #include <openssl/err.h>
+ #include "internal/sslconf.h"
++#include "internal/thread_once.h"
+ #include "conf_local.h"
+
+ /*
+@@ -35,12 +36,25 @@ struct ssl_conf_cmd_st {
+ char *arg;
+ };
+
++static CRYPTO_ONCE init_ssl_names_lock = CRYPTO_ONCE_STATIC_INIT;
++static CRYPTO_RWLOCK *ssl_names_lock;
+ static struct ssl_conf_name_st *ssl_names;
+ static size_t ssl_names_count;
+
+-static void ssl_module_free(CONF_IMODULE *md)
++DEFINE_RUN_ONCE_STATIC(do_init_ssl_names_lock)
++{
++ ssl_names_lock = CRYPTO_THREAD_lock_new();
++ if (ssl_names_lock == NULL) {
++ ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
++ return 0;
++ }
++ return 1;
++}
++
++static void ssl_module_free_unlocked(CONF_IMODULE *md)
+ {
+ size_t i, j;
++
+ if (ssl_names == NULL)
+ return;
+ for (i = 0; i < ssl_names_count; i++) {
+@@ -58,6 +72,14 @@ static void ssl_module_free(CONF_IMODULE *md)
+ ssl_names_count = 0;
+ }
+
++static void ssl_module_free(CONF_IMODULE *md)
++{
++ if (!CRYPTO_THREAD_write_lock(ssl_names_lock))
++ return;
++ ssl_module_free_unlocked(md);
++ CRYPTO_THREAD_unlock(ssl_names_lock);
++}
++
+ static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf)
+ {
+ size_t i, j, cnt;
+@@ -65,6 +87,12 @@ static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf)
+ const char *ssl_conf_section;
+ STACK_OF(CONF_VALUE) *cmd_lists;
+
++ if (!RUN_ONCE(&init_ssl_names_lock, do_init_ssl_names_lock))
++ return 0;
++
++ if (!CRYPTO_THREAD_write_lock(ssl_names_lock))
++ return 0;
++
+ ssl_conf_section = CONF_imodule_get_value(md);
+ cmd_lists = NCONF_get_section(cnf, ssl_conf_section);
+ if (sk_CONF_VALUE_num(cmd_lists) <= 0) {
+@@ -77,7 +105,7 @@ static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf)
+ goto err;
+ }
+ cnt = sk_CONF_VALUE_num(cmd_lists);
+- ssl_module_free(md);
++ ssl_module_free_unlocked(md);
+ ssl_names = OPENSSL_zalloc(sizeof(*ssl_names) * cnt);
+ if (ssl_names == NULL)
+ goto err;
+@@ -126,7 +154,8 @@ static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf)
+ rv = 1;
+ err:
+ if (rv == 0)
+- ssl_module_free(md);
++ ssl_module_free_unlocked(md);
++ CRYPTO_THREAD_unlock(ssl_names_lock);
+ return rv;
+ }
+
diff --git a/patches/openssl-3.2.1/0005-Configure-drop-fzero-call-used-regs-used-gpr-from-De.patch b/patches/openssl-3.2.1/0005-Configure-drop-fzero-call-used-regs-used-gpr-from-De.patch
new file mode 100644
index 000000000..a26a6a2ae
--- /dev/null
+++ b/patches/openssl-3.2.1/0005-Configure-drop-fzero-call-used-regs-used-gpr-from-De.patch
@@ -0,0 +1,25 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 17 Feb 2023 15:00:13 +0100
+Subject: [PATCH] Configure: drop -fzero-call-used-regs=used-gpr from Debian
+ targets
+
+This option is only supported since gcc 11 so it cannot be used
+unconditionally.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Configurations/20-debian.conf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Configurations/20-debian.conf b/Configurations/20-debian.conf
+index c6860ed4b7d7..607704906c62 100644
+--- a/Configurations/20-debian.conf
++++ b/Configurations/20-debian.conf
+@@ -1,6 +1,6 @@
+ my %targets = (
+ "debian" => {
+- cflags => add("-Wa,--noexecstack -Wall -fzero-call-used-regs=used-gpr -DOPENSSL_TLS_SECURITY_LEVEL=2"),
++ cflags => add("-Wa,--noexecstack -Wall -DOPENSSL_TLS_SECURITY_LEVEL=2"),
+ },
+ "debian-alpha" => {
+ inherit_from => [ "linux-alpha-gcc", "debian" ],
diff --git a/patches/openssl-3.2.1/series b/patches/openssl-3.2.1/series
new file mode 100644
index 000000000..cd66cc21a
--- /dev/null
+++ b/patches/openssl-3.2.1/series
@@ -0,0 +1,10 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+#tag:debian --start-number 1
+0001-debian-targets.patch
+0002-pic.patch
+0003-Configure-allow-to-enable-ktls-if-target-does-not-st.patch
+0004-conf-Serialize-allocation-free-of-ssl_names.patch
+0005-Configure-drop-fzero-call-used-regs-used-gpr-from-De.patch
+#tag:upstream --start-number 100
+# ab24a399a1a602376760e385c08ab320 - git-ptx-patches magic
diff --git a/patches/opkg-utils-0.4.2/0001-Fix-reproducibility-issues-in-opkg-build.patch b/patches/opkg-utils-0.4.2/0001-Fix-reproducibility-issues-in-opkg-build.patch
deleted file mode 100644
index f1615a392..000000000
--- a/patches/opkg-utils-0.4.2/0001-Fix-reproducibility-issues-in-opkg-build.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Richard Purdie <richard.purdie@linuxfoundation.org>
-Date: Wed, 5 Feb 2020 12:08:39 +0000
-Subject: [PATCH] Fix reproducibility issues in opkg-build
-
-There is a sorting problem with opkg-build where the ipk generated is depending
-upon the order of files on disk. The reason is the --sort option to tar only
-influences the orders of files tar reads, not those passed by the -T option.
-
-Add in a sort call to resolve this issue. To ensure consistent sorting we
-also need to force to a specific locale (C) else the results are still not
-deterministic.
-
-Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
----
- opkg-build | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/opkg-build b/opkg-build
-index 8b3d7a9f78de..1b564166a7a4 100755
---- a/opkg-build
-+++ b/opkg-build
-@@ -305,8 +305,10 @@ if [ ! -z "$SOURCE_DATE_EPOCH" ]; then
- mtime_args="--mtime=@$build_date --clamp-mtime"
- fi
-
--( cd $pkg_dir/$CONTROL && find . -type f > $tmp_dir/control_list )
--( cd $pkg_dir && find . -path ./$CONTROL -prune -o -path . -o -print > $tmp_dir/file_list )
-+export LANG=C
-+export LC_ALL=C
-+( cd $pkg_dir/$CONTROL && find . -type f | sort > $tmp_dir/control_list )
-+( cd $pkg_dir && find . -path ./$CONTROL -prune -o -path . -o -print | sort > $tmp_dir/file_list )
- ( cd $pkg_dir && tar $ogargs $tsortargs --no-recursion $mtime_args -c $tarformat -T $tmp_dir/file_list | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
- ( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --no-recursion --mtime=@$build_date -c $tarformat -T $tmp_dir/control_list | gzip $zipargs > $tmp_dir/control.tar.gz )
- rm $tmp_dir/file_list
diff --git a/patches/opkg-utils-0.4.2/0103-Revert-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch b/patches/opkg-utils-0.4.2/0103-Revert-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch
deleted file mode 100644
index b855eec53..000000000
--- a/patches/opkg-utils-0.4.2/0103-Revert-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 25 Jan 2020 18:28:40 +0100
-Subject: [PATCH] Revert "opkg-build: clamp mtimes to SOURCE_DATE_EPOCH"
-
-This reverts commit c3cc95693048bdd57a82069bad47abbc72a1932e.
-
-We set the mtime already in PTXdist so it's not needed and this breaks
-building with tar <= 1.28 (e.g. CentOS 7).
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- opkg-build | 9 +--------
- 1 file changed, 1 insertion(+), 8 deletions(-)
-
-diff --git a/opkg-build b/opkg-build
-index 6d6f7e92b919..2fb6216104b6 100755
---- a/opkg-build
-+++ b/opkg-build
-@@ -298,18 +298,11 @@ mkdir $tmp_dir
-
- build_date="${SOURCE_DATE_EPOCH:-$(date +%s)}"
-
--mtime_args=""
--# --clamp-mtime requires tar > 1.28. Only use it if SOURCE_DATE_EPOCH is set, to avoid having a generic case dependency on tar > 1.28.
--# this setting will make sure files generated at build time have consistent mtimes, for reproducible builds.
--if [ ! -z "$SOURCE_DATE_EPOCH" ]; then
-- mtime_args="--mtime=@$build_date --clamp-mtime"
--fi
--
- export LANG=C
- export LC_ALL=C
- ( cd $pkg_dir/$CONTROL && find . -type f | sort > $tmp_dir/control_list )
- ( cd $pkg_dir && find . -path ./$CONTROL -prune -o -path . -o -print | sort > $tmp_dir/file_list )
--( cd $pkg_dir && tar $ogargs $tsortargs --no-recursion $mtime_args -c $tarformat -T $tmp_dir/file_list | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
-+( cd $pkg_dir && tar $ogargs $tsortargs --no-recursion -c $tarformat -T $tmp_dir/file_list | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
- ( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --no-recursion --mtime=@$build_date -c $tarformat -T $tmp_dir/control_list | gzip $zipargs > $tmp_dir/control.tar.gz )
- rm $tmp_dir/file_list
- rm $tmp_dir/control_list
diff --git a/patches/opkg-utils-0.4.2/0100-opkg-build-use-CROSS_COMPILE-ar.patch b/patches/opkg-utils-0.6.3/0100-opkg-build-use-CROSS_COMPILE-ar.patch
index 9e54dd0ec..556092909 100644
--- a/patches/opkg-utils-0.4.2/0100-opkg-build-use-CROSS_COMPILE-ar.patch
+++ b/patches/opkg-utils-0.6.3/0100-opkg-build-use-CROSS_COMPILE-ar.patch
@@ -14,15 +14,15 @@ Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/opkg-build b/opkg-build
-index 1b564166a7a4..eca1ee2fa42c 100755
+index 6edd938b8f7e..ef2fbfa42c09 100755
--- a/opkg-build
+++ b/opkg-build
-@@ -324,7 +324,7 @@ fi
+@@ -352,7 +352,7 @@ fi
rm -f $pkg_file
if [ "$outer" = "ar" ] ; then
-- ( cd $tmp_dir && ar -crfD $pkg_file ./debian-binary ./control.tar.gz ./data.tar.$cext )
-+ ( cd $tmp_dir && ${CROSS_COMPILE}ar -crfD $pkg_file ./debian-binary ./control.tar.gz ./data.tar.$cext )
+- ( cd $tmp_dir && ar -crfD $pkg_file ./debian-binary ./control.tar.gz ./data.tar.$cext )
++ ( cd $tmp_dir && ${CROSS_COMPILE}ar -crfD $pkg_file ./debian-binary ./control.tar.gz ./data.tar.$cext )
else
- ( cd $tmp_dir && tar -c $tsortargs --mtime=@$build_date $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
+ ( cd $tmp_dir && tar -c $tsortargs $mtime_args $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
fi
diff --git a/patches/opkg-utils-0.4.2/0101-Update-Installed-Size-properly.patch b/patches/opkg-utils-0.6.3/0101-Update-Installed-Size-properly.patch
index 3f617eaff..48a00ff9a 100644
--- a/patches/opkg-utils-0.4.2/0101-Update-Installed-Size-properly.patch
+++ b/patches/opkg-utils-0.6.3/0101-Update-Installed-Size-properly.patch
@@ -11,10 +11,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/opkg.py b/opkg.py
-index ba947c2e887b..7b7e216419a1 100644
+index e5a65dd1ae8f..ec77c147156c 100644
--- a/opkg.py
+++ b/opkg.py
-@@ -248,7 +248,7 @@ class Package(object):
+@@ -276,7 +276,7 @@ class Package(object):
lineparts = re.match(r'([\w-]*?):\s*(.*)', line)
if lineparts:
name = lineparts.group(1)
@@ -23,7 +23,7 @@ index ba947c2e887b..7b7e216419a1 100644
value = lineparts.group(2)
while 1:
line = control.readline().rstrip()
-@@ -510,7 +510,7 @@ class Package(object):
+@@ -538,7 +538,7 @@ class Package(object):
if 'sha256' in checksum:
if self.sha256: out = out + "SHA256sum: %s\n" % (self.sha256)
if self.size: out = out + "Size: %d\n" % int(self.size)
diff --git a/patches/opkg-utils-0.4.2/0102-opkg-build-in-ptxdist-the-maxium-UID-for-system-user.patch b/patches/opkg-utils-0.6.3/0102-opkg-build-in-ptxdist-the-maxium-UID-for-system-user.patch
index 8a1df58e1..ba8c852a1 100644
--- a/patches/opkg-utils-0.4.2/0102-opkg-build-in-ptxdist-the-maxium-UID-for-system-user.patch
+++ b/patches/opkg-utils-0.6.3/0102-opkg-build-in-ptxdist-the-maxium-UID-for-system-user.patch
@@ -8,11 +8,11 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/opkg-build b/opkg-build
-index eca1ee2fa42c..6d6f7e92b919 100755
+index ef2fbfa42c09..6a1b631fc5d5 100755
--- a/opkg-build
+++ b/opkg-build
@@ -69,14 +69,14 @@ You probably want to remove them: " >&2
- fi
+ fi
fi
- large_uid_files=`find . -uid +99 -ls -printf '\\\n' || true`
diff --git a/patches/opkg-utils-0.4.2/0104-opkg-build-fix-typo-in-compressorargs.patch b/patches/opkg-utils-0.6.3/0103-opkg-build-fix-typo-in-compressorargs.patch
index ea791bbc2..1576296ba 100644
--- a/patches/opkg-utils-0.4.2/0104-opkg-build-fix-typo-in-compressorargs.patch
+++ b/patches/opkg-utils-0.6.3/0103-opkg-build-fix-typo-in-compressorargs.patch
@@ -11,10 +11,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/opkg-build b/opkg-build
-index 2fb6216104b6..7e1a1af99948 100755
+index 6a1b631fc5d5..c609249190f4 100755
--- a/opkg-build
+++ b/opkg-build
-@@ -236,7 +236,7 @@ if gzip --help 2>&1 | grep -- "-T" > /dev/null; then
+@@ -252,7 +252,7 @@ if gzip --help 2>&1 | grep -- "-T" > /dev/null; then
zipargs="-9nT"
fi
diff --git a/patches/opkg-utils-0.4.2/series b/patches/opkg-utils-0.6.3/series
index 5782e137f..800146487 100644
--- a/patches/opkg-utils-0.4.2/series
+++ b/patches/opkg-utils-0.6.3/series
@@ -1,11 +1,9 @@
# generated by git-ptx-patches
#tag:base --start-number 1
#tag:upstream --start-number 1
-0001-Fix-reproducibility-issues-in-opkg-build.patch
#tag:ptx --start-number 100
0100-opkg-build-use-CROSS_COMPILE-ar.patch
0101-Update-Installed-Size-properly.patch
0102-opkg-build-in-ptxdist-the-maxium-UID-for-system-user.patch
-0103-Revert-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch
-0104-opkg-build-fix-typo-in-compressorargs.patch
-# beebeb187639b0a8c121563179f0d21b - git-ptx-patches magic
+0103-opkg-build-fix-typo-in-compressorargs.patch
+# 6c399b3d39fd841e35a006cd4534b2eb - git-ptx-patches magic
diff --git a/patches/opus-1.5.1/0001-fix-arm-asm-meson-source-build.patch b/patches/opus-1.5.1/0001-fix-arm-asm-meson-source-build.patch
new file mode 100644
index 000000000..046b12c65
--- /dev/null
+++ b/patches/opus-1.5.1/0001-fix-arm-asm-meson-source-build.patch
@@ -0,0 +1,66 @@
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Wed, 6 Mar 2024 11:21:07 +0000
+Subject: [PATCH] fix arm asm meson source build
+
+meson does mot support output with paths; add a meson.build file in the arm
+directory. The output files were being incorrectly placed in the celt/ directory.
+
+Program arm/arm2gnu.pl found: YES (/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-H3.arm-12.0-devel/build/opus-v1.5.1/celt/arm/arm2gnu.pl)
+Configuring celt_pitch_xcorr_arm-gnu.S with command
+
+../celt/meson.build:51:25: ERROR: configure_file keyword argument "output" Output 'arm/armopts.s' must not contain a path segment.
+
+before:
+celt/celt_pitch_xcorr_arm-gnu.S
+
+after:
+celt/arm/celt_pitch_xcorr_arm-gnu.S
+celt/arm/armopts.s
+celt/arm/armopts-gnu.S
+
+Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
+Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
+---
+ celt/arm/meson.build | 12 ++++++++++++
+ celt/meson.build | 9 +--------
+ 2 files changed, 13 insertions(+), 8 deletions(-)
+ create mode 100644 celt/arm/meson.build
+
+diff --git a/celt/arm/meson.build b/celt/arm/meson.build
+new file mode 100644
+index 000000000000..b4dec564fcbe
+--- /dev/null
++++ b/celt/arm/meson.build
+@@ -0,0 +1,12 @@
++arm2gnu = [find_program('arm2gnu.pl')] + arm2gnu_args
++celt_sources_arm_asm = configure_file(input: 'celt_pitch_xcorr_arm.s',
++ output: '@BASENAME@-gnu.S',
++ command: arm2gnu + ['@INPUT@'],
++ capture: true)
++celt_arm_armopts_s_in = configure_file(input: 'armopts.s.in',
++ output: 'armopts.s',
++ configuration: opus_conf)
++celt_arm_armopts_s = configure_file(input: [celt_arm_armopts_s_in],
++ output: '@BASENAME@-gnu.S',
++ command: arm2gnu + ['@INPUT@'],
++ capture: true)
+diff --git a/celt/meson.build b/celt/meson.build
+index 7852fc156021..46601ca13586 100644
+--- a/celt/meson.build
++++ b/celt/meson.build
+@@ -43,14 +43,7 @@ if host_cpu_family in ['arm', 'aarch64'] and have_arm_intrinsics_or_asm
+ celt_sources += sources['CELT_SOURCES_ARM_NE10']
+ endif
+ if opus_arm_external_asm
+- arm2gnu = [find_program('arm/arm2gnu.pl')] + arm2gnu_args
+- celt_sources_arm_asm = configure_file(input: 'arm/celt_pitch_xcorr_arm.s',
+- output: '@BASENAME@-gnu.S',
+- command: arm2gnu + ['@INPUT@'],
+- capture: true)
+- celt_arm_armopts_s = configure_file(input: 'arm/armopts.s.in',
+- output: 'arm/armopts.s',
+- configuration: opus_conf)
++ subdir('arm')
+ celt_static_libs += static_library('celt-armasm',
+ celt_arm_armopts_s, celt_sources_arm_asm,
+ install: false)
diff --git a/patches/opus-1.5.1/0002-Extended-asm-with-C-operands-doesn-t-work-at-top-lev.patch b/patches/opus-1.5.1/0002-Extended-asm-with-C-operands-doesn-t-work-at-top-lev.patch
new file mode 100644
index 000000000..6fd6e641d
--- /dev/null
+++ b/patches/opus-1.5.1/0002-Extended-asm-with-C-operands-doesn-t-work-at-top-lev.patch
@@ -0,0 +1,44 @@
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sat, 9 Mar 2024 17:39:20 +0000
+Subject: [PATCH] =?UTF-8?q?Extended=20asm=20with=20C=20operands=20doesn?=
+ =?UTF-8?q?=E2=80=99t=20work=20at=20top=20level?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+fix the following test in the meson.build
+
+stderr:
+testfile.c:6:34: error: expected ')' before '::' token
+ 6 |__asm__ (""::)
+ | ~ ^~
+ | )
+testfile.c:6:37: error: expected ';' at end of input
+ 6 |__asm__ (""::)
+ | ^
+ | ;
+-----------
+Checking if "compiler supports gcc-style inline assembly" compiles: NO
+
+refer:
+- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41045
+
+Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
+Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 5623260962fc..1b16b08f662a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -227,7 +227,7 @@ if not opt_asm.disabled()
+ #error GCC before 3.4 has critical bugs compiling inline assembly
+ #endif
+ #endif
+- __asm__ (""::)''',
++ int main(int argc, char ** argv) { __asm__ (""::); }''',
+ name : 'compiler supports gcc-style inline assembly')
+
+ opus_conf.set('OPUS_ARM_INLINE_ASM', 1)
diff --git a/patches/opus-1.5.1/0003-use-semicolon-not-newline-for-inline-assembler.patch b/patches/opus-1.5.1/0003-use-semicolon-not-newline-for-inline-assembler.patch
new file mode 100644
index 000000000..e36073e2a
--- /dev/null
+++ b/patches/opus-1.5.1/0003-use-semicolon-not-newline-for-inline-assembler.patch
@@ -0,0 +1,47 @@
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sat, 9 Mar 2024 17:58:18 +0000
+Subject: [PATCH] use semicolon not newline for inline assembler
+
+fixes:
+
+testfile.c:3:11: warning: missing terminating " character
+ 3 | __asm__(".arch armv5te
+ | ^
+testfile.c:4:1: error: expected string literal before '.' token
+ 4 | .object_arch armv4t
+ | ^
+testfile.c:5:14: warning: missing terminating " character
+ 5 | qadd r3,r3,r3");
+ | ^
+
+Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
+Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
+---
+ meson.build | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 1b16b08f662a..bd23744cadb1 100644
+--- a/meson.build
++++ b/meson.build
+@@ -277,17 +277,17 @@ if not opt_asm.disabled()
+ if not opus_arm_may_have_edsp
+ message('Trying to force-enable armv5e EDSP instructions...')
+ # AS_ASM_ARM_EDSP_FORCE
+- opus_arm_may_have_edsp = cc.compiles(asm_tmpl.format('.arch armv5te\n.object_arch armv4t\nqadd r3,r3,r3'),
++ opus_arm_may_have_edsp = cc.compiles(asm_tmpl.format('.arch armv5te;.object_arch armv4t;qadd r3,r3,r3'),
+ name : 'Assembler supports EDSP instructions on ARM (forced)')
+ endif
+ if not opus_arm_may_have_media
+ message('Trying to force-enable ARMv6 media instructions...')
+- opus_arm_may_have_media = cc.compiles(asm_tmpl.format('.arch armv6\n.object_arch armv4t\nshadd8 r3,r3,r3'),
++ opus_arm_may_have_media = cc.compiles(asm_tmpl.format('.arch armv6;.object_arch armv4t;shadd8 r3,r3,r3'),
+ name : 'Assembler supports ARMv6 media instructions on ARM (forced)')
+ endif
+ if not opus_arm_may_have_neon
+ message('Trying to force-enable NEON instructions...')
+- opus_arm_may_have_neon = cc.compiles(asm_tmpl.format('.arch armv7-a\n.fpu neon\n.object_arch armv4t\nvorr d0,d0,d0'),
++ opus_arm_may_have_neon = cc.compiles(asm_tmpl.format('.arch armv7-a;.fpu neon;.object_arch armv4t;vorr d0,d0,d0'),
+ name : 'Assembler supports NEON instructions on ARM (forced)')
+ endif
+ endif
diff --git a/patches/opus-1.5.1/0004-Add-OPUS_ARM_INLINE_DOTPROD-dotprod-check.patch b/patches/opus-1.5.1/0004-Add-OPUS_ARM_INLINE_DOTPROD-dotprod-check.patch
new file mode 100644
index 000000000..30590fb63
--- /dev/null
+++ b/patches/opus-1.5.1/0004-Add-OPUS_ARM_INLINE_DOTPROD-dotprod-check.patch
@@ -0,0 +1,73 @@
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sat, 9 Mar 2024 18:55:53 +0000
+Subject: [PATCH] Add OPUS_ARM_INLINE_DOTPROD dotprod check
+
+fixes:
+ ../meson.build:322:9: ERROR: Unknown variable "opus_arm_may_have_dotprod"
+
+after:
+ dotprod check passes through.
+
+Checking if "compiler supports gcc-style inline assembly" compiles: YES
+Checking if "assembler supports EDSP instructions on ARM" compiles: YES
+Checking if "assembler supports ARMv6 media instructions on ARM" compiles: YES
+Checking if "assembler supports NEON instructions on ARM" compiles: YES
+Checking if "assembler supports DOTPROD instructions on ARM" compiles: NO
+Program perl found: YES (/usr/bin/perl)
+Fetching value of define "__APPLE__" : (undefined)
+Checking if "compiler supports ARMv7/AArch64 NEON intrinsics" : links: YES
+Checking if "compiler supports AArch64 NEON intrinsics" : links: NO
+Checking if "compiler supports AArch64 NEON intrinsics with -mfpu=neon" : links: NO
+Message: Compiler does not support AArch64 NEON intrinsics
+Checking if "compiler supports AArch64 DOTPROD intrinsics" : links: NO
+Checking if "compiler supports AArch64 DOTPROD intrinsics with -march=armv8.2-a+dotprod" : links: NO
+Message: Compiler does not support AArch64 DOTPROD intrinsics
+
+refer:
+- https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/exploring-the-arm-dot-product-instructions
+
+test with:
+armv7ve-none-linux-gnueabihf-gcc test.c
+/tmp/cc02sooK.s: Assembler messages:
+/tmp/cc02sooK.s:32: Error: bad instruction `udot v0.4s,v1.16b,v2.16b'
+
+aarch64-none-linux-gnu-gcc test.c
+/tmp/ccnVi9Ec.s: Assembler messages:
+/tmp/ccnVi9Ec.s:12: Error: selected processor does not support `udot v0.4s,v1.16b,v2.16b'
+
+aarch64-none-linux-gnu-gcc -march=armv8.2-a+dotprod test.c
+
+Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
+Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
+---
+ meson.build | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index bd23744cadb1..8624f0c38a59 100644
+--- a/meson.build
++++ b/meson.build
+@@ -252,6 +252,13 @@ if not opt_asm.disabled()
+ opus_conf.set('OPUS_ARM_INLINE_NEON', 1)
+ inline_optimization += ['NEON']
+ endif
++
++ # AS_ASM_ARM_DOTPROD
++ if cc.compiles(asm_tmpl.format('udot v0.4s,v1.16b,v2.16b'),
++ name : 'assembler supports DOTPROD instructions on ARM')
++ opus_conf.set('OPUS_ARM_INLINE_DOTPROD', 1)
++ inline_optimization += ['DOTPROD']
++ endif
+ endif
+
+ # We need Perl to translate RVCT-syntax asm to gas syntax
+@@ -273,6 +280,9 @@ if not opt_asm.disabled()
+ opus_arm_may_have_neon = opus_conf.has('OPUS_ARM_INLINE_NEON')
+ opus_arm_presume_neon = opus_arm_may_have_neon and opus_can_presume_simd
+
++ opus_arm_may_have_dotprod = opus_conf.has('OPUS_ARM_INLINE_DOTPROD')
++ opus_arm_presume_dotprod = opus_arm_may_have_dotprod and opus_can_presume_simd
++
+ if not opt_rtcd.disabled()
+ if not opus_arm_may_have_edsp
+ message('Trying to force-enable armv5e EDSP instructions...')
diff --git a/patches/opus-1.5.1/0005-Fix-meson-AVX2-fixed-point.patch b/patches/opus-1.5.1/0005-Fix-meson-AVX2-fixed-point.patch
new file mode 100644
index 000000000..3ca42f93b
--- /dev/null
+++ b/patches/opus-1.5.1/0005-Fix-meson-AVX2-fixed-point.patch
@@ -0,0 +1,23 @@
+From: Jean-Marc Valin <jmvalin@jmvalin.ca>
+Date: Tue, 12 Mar 2024 02:03:22 -0400
+Subject: [PATCH] Fix meson AVX2 fixed-point
+
+---
+ silk/meson.build | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/silk/meson.build b/silk/meson.build
+index 80a59b050eb5..35d955784f5d 100644
+--- a/silk/meson.build
++++ b/silk/meson.build
+@@ -44,9 +44,7 @@ foreach intr_name : ['sse4_1', 'avx2', 'neon_intr']
+ endif
+
+ intr_sources = get_variable('silk_sources_' + intr_name)
+- if opt_fixed_point
+- intr_sources += get_variable('silk_sources_fixed_' + intr_name)
+- else
++ if not opt_fixed_point
+ intr_sources += get_variable('silk_sources_float_' + intr_name)
+ endif
+
diff --git a/patches/opus-1.5.1/0100-ptxdist-get-version.py-don-t-detect-extract-git-as-g.patch b/patches/opus-1.5.1/0100-ptxdist-get-version.py-don-t-detect-extract-git-as-g.patch
new file mode 100644
index 000000000..0fce16913
--- /dev/null
+++ b/patches/opus-1.5.1/0100-ptxdist-get-version.py-don-t-detect-extract-git-as-g.patch
@@ -0,0 +1,25 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sun, 24 Mar 2024 15:59:29 +0100
+Subject: [PATCH] ptxdist: get-version.py: don't detect 'extract --git' as git
+ checkout
+
+Otherwise building fails because the relevant tags are missing.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ meson/get-version.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson/get-version.py b/meson/get-version.py
+index d3835f134c81..96a275f15af8 100755
+--- a/meson/get-version.py
++++ b/meson/get-version.py
+@@ -31,7 +31,7 @@ if __name__ == '__main__':
+
+ # check if git checkout
+ git_dir = os.path.join(srcroot, '.git')
+- is_git = os.path.isdir(git_dir) or os.path.isfile(git_dir)
++ is_git = (os.path.isdir(git_dir) or os.path.isfile(git_dir)) and not os.path.isdir(os.path.join(srcroot, '.ptxdist/git-patches'))
+ have_git = shutil.which('git') is not None
+
+ if is_git and have_git:
diff --git a/patches/opus-1.5.1/series b/patches/opus-1.5.1/series
new file mode 100644
index 000000000..5678dc243
--- /dev/null
+++ b/patches/opus-1.5.1/series
@@ -0,0 +1,11 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+#tag:upstream --start-number 1
+0001-fix-arm-asm-meson-source-build.patch
+0002-Extended-asm-with-C-operands-doesn-t-work-at-top-lev.patch
+0003-use-semicolon-not-newline-for-inline-assembler.patch
+0004-Add-OPUS_ARM_INLINE_DOTPROD-dotprod-check.patch
+0005-Fix-meson-AVX2-fixed-point.patch
+#tag:ptxdist --start-number 100
+0100-ptxdist-get-version.py-don-t-detect-extract-git-as-g.patch
+# d3a0d1e86246dea00cfd9809d8cd3632 - git-ptx-patches magic
diff --git a/patches/pango-1.43.0/0001-tests-fix-build-dependency.patch b/patches/pango-1.43.0/0001-tests-fix-build-dependency.patch
deleted file mode 100644
index 0873ddfaa..000000000
--- a/patches/pango-1.43.0/0001-tests-fix-build-dependency.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Marco Felsch <m.felsch@pengutronix.de>
-Date: Wed, 13 Mar 2019 11:03:18 +0100
-Subject: [PATCH] tests: fix build dependency
-
-In case of cairo is found but without png support this test will fail
-during linking becuase the 'cairo_surface_write_to_png' is undefined.
-
-Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
----
- tests/meson.build | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/tests/meson.build b/tests/meson.build
-index bceb9093d9a5..6a74e0998a08 100644
---- a/tests/meson.build
-+++ b/tests/meson.build
-@@ -35,12 +35,17 @@ if cairo_dep.found()
- test_cflags += '-DHAVE_CAIRO'
- tests += [
- [ 'testiter', [ 'testiter.c' ], [ libpangocairo_dep ] ],
-- [ 'test-pangocairo-threads', [ 'test-pangocairo-threads.c' ], [ libpangocairo_dep, cairo_dep ] ],
- [ 'markup-parse', [ 'markup-parse.c' ], [ libpangocairo_dep ] ],
- [ 'test-layout', [ 'test-layout.c', 'test-common.c' ], [ libpangocairo_dep ] ],
- [ 'test-font', [ 'test-font.c' ], [ libpangocairo_dep ] ],
- [ 'testattributes', [ 'testattributes.c', 'test-common.c' ], [ libpangocairo_dep ] ],
- ]
-+
-+ if pango_cairo_backends.contains('png')
-+ tests += [
-+ [ 'test-pangocairo-threads', [ 'test-pangocairo-threads.c' ], [ libpangocairo_dep, cairo_dep ] ],
-+ ]
-+ endif
- endif
-
- installed_test_data = [
diff --git a/patches/pango-1.43.0/series b/patches/pango-1.43.0/series
deleted file mode 100644
index 19f20760e..000000000
--- a/patches/pango-1.43.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-tests-fix-build-dependency.patch
-# 3d31badd8cc08ee86bb7372d30866049 - git-ptx-patches magic
diff --git a/patches/poco-1.9.0/0001-fix-parallel-building.patch b/patches/poco-1.9.0/0001-fix-parallel-building.patch
deleted file mode 100644
index e5897fb1d..000000000
--- a/patches/poco-1.9.0/0001-fix-parallel-building.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Tue, 5 Feb 2019 22:02:43 +0100
-Subject: [PATCH] fix parallel building
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- build/rules/compile | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/build/rules/compile b/build/rules/compile
-index f513434938fa..f52d4d2c2776 100644
---- a/build/rules/compile
-+++ b/build/rules/compile
-@@ -36,35 +36,35 @@ $(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_SHARED) $(OB
- #
- # Rules for compiling
- #
--$(OBJPATH_DEBUG_STATIC)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG)
-+$(OBJPATH_DEBUG_STATIC)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) | $(OBJPATH_DEBUG_STATIC)
- @echo "** Compiling" $< "(debug, static)"
- $(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(STATICOPT_CXX) -c $< -o $@
-
--$(OBJPATH_RELEASE_STATIC)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG)
-+$(OBJPATH_RELEASE_STATIC)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) | $(OBJPATH_RELEASE_STATIC)
- @echo "** Compiling" $< "(release, static)"
- $(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(STATICOPT_CXX) -c $< -o $@
-
--$(OBJPATH_DEBUG_STATIC)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG)
-+$(OBJPATH_DEBUG_STATIC)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) | $(OBJPATH_DEBUG_STATIC)
- @echo "** Compiling" $< "(debug, static)"
- $(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(STATICOPT_CC) -c $< -o $@
-
--$(OBJPATH_RELEASE_STATIC)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG)
-+$(OBJPATH_RELEASE_STATIC)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) | $(OBJPATH_RELEASE_STATIC)
- @echo "** Compiling" $< "(release, static)"
- $(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(STATICOPT_CC) -c $< -o $@
-
--$(OBJPATH_DEBUG_SHARED)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG)
-+$(OBJPATH_DEBUG_SHARED)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) | $(OBJPATH_DEBUG_SHARED)
- @echo "** Compiling" $< "(debug, shared)"
- $(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $@
-
--$(OBJPATH_RELEASE_SHARED)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG)
-+$(OBJPATH_RELEASE_SHARED)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) | $(OBJPATH_RELEASE_SHARED)
- @echo "** Compiling" $< "(release, shared)"
- $(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $@
-
--$(OBJPATH_DEBUG_SHARED)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG)
-+$(OBJPATH_DEBUG_SHARED)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) | $(OBJPATH_DEBUG_SHARED)
- @echo "** Compiling" $< "(debug, shared)"
- $(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(SHAREDOPT_CC) -c $< -o $@
-
--$(OBJPATH_RELEASE_SHARED)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG)
-+$(OBJPATH_RELEASE_SHARED)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) | $(OBJPATH_RELEASE_SHARED)
- @echo "** Compiling" $< "(release, shared)"
- $(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(SHAREDOPT_CC) -c $< -o $@
-
diff --git a/patches/poco-1.9.0/series b/patches/poco-1.9.0/series
deleted file mode 100644
index c107fa32c..000000000
--- a/patches/poco-1.9.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-fix-parallel-building.patch
-# 5cc5d42dfd5d2c4a2a35024d9a874950 - git-ptx-patches magic
diff --git a/patches/polkit-0.105/0001-0.106-agenthelper-pam-Fix-newline-trimming-code.patch b/patches/polkit-0.105/0001-0.106-agenthelper-pam-Fix-newline-trimming-code.patch
deleted file mode 100644
index 0dcef786f..000000000
--- a/patches/polkit-0.105/0001-0.106-agenthelper-pam-Fix-newline-trimming-code.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Colin Walters <walters@verbum.org>
-Date: Wed, 6 Jun 2012 09:05:14 -0400
-Subject: [PATCH] 0.106: agenthelper-pam: Fix newline-trimming code
-
-First, we were using == instead of =, as the author probably intended.
-But after changing that, we're now assigning to const memory. Fix
-that by writing to a temporary string buffer.
-
-Signed-off-by: David Zeuthen <zeuthen@gmail.com>
-Origin: upstream, 0.106, commit:14121fda7e4fa9463c66ce419cc32be7e7f3b535
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitagent/polkitagenthelper-pam.c | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
-
-diff --git a/src/polkitagent/polkitagenthelper-pam.c b/src/polkitagent/polkitagenthelper-pam.c
-index 85a26718a513..7af5321ebfa3 100644
---- a/src/polkitagent/polkitagenthelper-pam.c
-+++ b/src/polkitagent/polkitagenthelper-pam.c
-@@ -227,6 +227,8 @@ conversation_function (int n, const struct pam_message **msg, struct pam_respons
- char buf[PAM_MAX_RESP_SIZE];
- int i;
- gchar *escaped = NULL;
-+ gchar *tmp = NULL;
-+ size_t len;
-
- data = data;
- if (n <= 0 || n > PAM_MAX_NUM_MSG)
-@@ -258,9 +260,12 @@ conversation_function (int n, const struct pam_message **msg, struct pam_respons
- #ifdef PAH_DEBUG
- fprintf (stderr, "polkit-agent-helper-1: writing `%s' to stdout\n", msg[i]->msg);
- #endif /* PAH_DEBUG */
-- if (strlen (msg[i]->msg) > 0 && msg[i]->msg[strlen (msg[i]->msg) - 1] == '\n')
-- msg[i]->msg[strlen (msg[i]->msg) - 1] == '\0';
-- escaped = g_strescape (msg[i]->msg, NULL);
-+ tmp = g_strdup (msg[i]->msg);
-+ len = strlen (tmp);
-+ if (len > 0 && tmp[len - 1] == '\n')
-+ tmp[len - 1] = '\0';
-+ escaped = g_strescape (tmp, NULL);
-+ g_free (tmp);
- fputs (escaped, stdout);
- g_free (escaped);
- #ifdef PAH_DEBUG
diff --git a/patches/polkit-0.105/0002-0.108-build-Fix-.gir-generation-for-parallel-make.patch b/patches/polkit-0.105/0002-0.108-build-Fix-.gir-generation-for-parallel-make.patch
deleted file mode 100644
index 6f8991262..000000000
--- a/patches/polkit-0.105/0002-0.108-build-Fix-.gir-generation-for-parallel-make.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From: Ryan Lortie <desrt@velocity.(none)>
-Date: Tue, 13 Nov 2012 11:50:14 -0500
-Subject: [PATCH] 0.108: build: Fix .gir generation for parallel make
-
-As per the intructions in the introspection Makefile, we should have a
-line declaring a dependency between the .gir and .la files.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57077
-Signed-off-by: David Zeuthen <zeuthen@gmail.com>
-Bug-Debian: https://bugs.debian.org/894205
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/Makefile.am | 2 ++
- src/polkitagent/Makefile.am | 2 ++
- 2 files changed, 4 insertions(+)
-
-diff --git a/src/polkit/Makefile.am b/src/polkit/Makefile.am
-index 1068ea124b41..41ccf5c34581 100644
---- a/src/polkit/Makefile.am
-+++ b/src/polkit/Makefile.am
-@@ -106,6 +106,8 @@ if HAVE_INTROSPECTION
-
- INTROSPECTION_GIRS = Polkit-1.0.gir
-
-+Polkit-1.0.gir: libpolkit-gobject-1.la
-+
- girdir = $(INTROSPECTION_GIRDIR)
- gir_DATA = Polkit-1.0.gir
-
-diff --git a/src/polkitagent/Makefile.am b/src/polkitagent/Makefile.am
-index e8c9fb1a7aa8..7b51137b5658 100644
---- a/src/polkitagent/Makefile.am
-+++ b/src/polkitagent/Makefile.am
-@@ -106,6 +106,8 @@ if HAVE_INTROSPECTION
- girdir = $(INTROSPECTION_GIRDIR)
- gir_DATA = PolkitAgent-1.0.gir
-
-+PolkitAgent-1.0.gir: libpolkit-agent-1.la
-+
- typelibsdir = $(INTROSPECTION_TYPELIBDIR)
- typelibs_DATA = PolkitAgent-1.0.typelib
-
diff --git a/patches/polkit-0.105/0003-0.110-Set-XAUTHORITY-environment-variable-if-is-unse.patch b/patches/polkit-0.105/0003-0.110-Set-XAUTHORITY-environment-variable-if-is-unse.patch
deleted file mode 100644
index 53082a771..000000000
--- a/patches/polkit-0.105/0003-0.110-Set-XAUTHORITY-environment-variable-if-is-unse.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From: David Zeuthen <zeuthen@gmail.com>
-Date: Wed, 19 Dec 2012 14:28:29 -0500
-Subject: [PATCH] 0.110: Set XAUTHORITY environment variable if is unset
-
-The way it works is that if XAUTHORITY is unset, then its default
-value is $HOME/.Xauthority. But since we're changing user identity
-this will not work since $HOME will now change. Therefore, if
-XAUTHORITY is unset, just set its default value before changing
-identity. This bug only affected login managers using X Window
-Authorization but not explicitly setting the XAUTHORITY variable.
-
-You can argue that XAUTHORITY is broken since it forces uid-changing
-apps like pkexec(1) to do more work - and get involved in intimate
-details of how X works and so on - but that doesn't change how things
-work.
-
-Based on a patch from Peter Wu <lekensteyn@gmail.com>.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51623
-Signed-off-by: David Zeuthen <zeuthen@gmail.com>
-Origin: upstream, 0.110, commit:d6acecdd0ebb42e28ff28e04e0207cb01fa20910
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/programs/pkexec.c | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
-
-diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c
-index 373977b891c8..7fafa14d1c7a 100644
---- a/src/programs/pkexec.c
-+++ b/src/programs/pkexec.c
-@@ -597,6 +597,28 @@ main (int argc, char *argv[])
- g_ptr_array_add (saved_env, g_strdup (value));
- }
-
-+ /* $XAUTHORITY is "special" - if unset, we need to set it to ~/.Xauthority. Yes,
-+ * this is broken but it's unfortunately how things work (see fdo #51623 for
-+ * details)
-+ */
-+ if (g_getenv ("XAUTHORITY") == NULL)
-+ {
-+ const gchar *home;
-+
-+ /* pre-2.36 GLib does not examine $HOME (it always looks in /etc/passwd) and
-+ * this is not what we want
-+ */
-+ home = g_getenv ("HOME");
-+ if (home == NULL)
-+ home = g_get_home_dir ();
-+
-+ if (home != NULL)
-+ {
-+ g_ptr_array_add (saved_env, g_strdup ("XAUTHORITY"));
-+ g_ptr_array_add (saved_env, g_build_filename (home, ".Xauthority", NULL));
-+ }
-+ }
-+
- /* Nuke the environment to get a well-known and sanitized environment to avoid attacks
- * via e.g. the DBUS_SYSTEM_BUS_ADDRESS environment variable and similar.
- */
diff --git a/patches/polkit-0.105/0004-0.110-Fix-build-on-GNU-Hurd.patch b/patches/polkit-0.105/0004-0.110-Fix-build-on-GNU-Hurd.patch
deleted file mode 100644
index c58fd302c..000000000
--- a/patches/polkit-0.105/0004-0.110-Fix-build-on-GNU-Hurd.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From: Emilio Pozuelo Monfort <pochu27@gmail.com>
-Date: Sat, 26 Mar 2011 07:28:14 +0000
-Subject: [PATCH] 0.110: Fix build on GNU Hurd
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35685
-Applied-upstream: 0.110, commit:d6de13e12379826af8ca9355a32da48707b9831f
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/programs/pkexec.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c
-index 7fafa14d1c7a..682fe95419c8 100644
---- a/src/programs/pkexec.c
-+++ b/src/programs/pkexec.c
-@@ -53,7 +53,7 @@
- #include <polkitagent/polkitagent.h>
-
- static gchar *original_user_name = NULL;
--static gchar original_cwd[PATH_MAX];
-+static gchar *original_cwd;
- static gchar *command_line = NULL;
- static struct passwd *pw;
-
-@@ -465,7 +465,7 @@ main (int argc, char *argv[])
- goto out;
- }
-
-- if (getcwd (original_cwd, sizeof (original_cwd)) == NULL)
-+ if ((original_cwd = g_get_current_dir ()) == NULL)
- {
- g_printerr ("Error getting cwd: %s\n",
- g_strerror (errno));
-@@ -953,6 +953,7 @@ main (int argc, char *argv[])
- g_ptr_array_free (saved_env, TRUE);
- }
-
-+ g_free (original_cwd);
- g_free (path);
- g_free (command_line);
- g_free (opt_user);
diff --git a/patches/polkit-0.105/0005-0.111-pkexec-Set-process-environment-from-pam_getenv.patch b/patches/polkit-0.105/0005-0.111-pkexec-Set-process-environment-from-pam_getenv.patch
deleted file mode 100644
index 4f4fa151a..000000000
--- a/patches/polkit-0.105/0005-0.111-pkexec-Set-process-environment-from-pam_getenv.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Steve Langasek <steve.langasek@canonical.com>
-Date: Fri, 8 Mar 2013 12:00:00 +0100
-Subject: [PATCH] 0.111: pkexec: Set process environment from pam_getenvlist()
-
-Various pam modules provide environment variables that are intended to be set
-in the environment of the pam session. pkexec needs to process the output of
-pam_getenvlist() to get these.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62016
-Applied-upstream: 0.111, commit:5aef9722c15a350fbf8b20a3b58419f156cc7c98
-Bug-Ubuntu: https://bugs.launchpad.net/bugs/982684
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/programs/pkexec.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c
-index 682fe95419c8..9a0570a307a1 100644
---- a/src/programs/pkexec.c
-+++ b/src/programs/pkexec.c
-@@ -145,6 +145,7 @@ open_session (const gchar *user_to_auth)
- gboolean ret;
- gint rc;
- pam_handle_t *pam_h;
-+ char **envlist;
- struct pam_conv conversation;
-
- ret = FALSE;
-@@ -176,6 +177,15 @@ open_session (const gchar *user_to_auth)
-
- ret = TRUE;
-
-+ envlist = pam_getenvlist (pam_h);
-+ if (envlist != NULL)
-+ {
-+ guint n;
-+ for (n = 0; envlist[n]; n++)
-+ putenv (envlist[n]);
-+ free (envlist);
-+ }
-+
- out:
- if (pam_h != NULL)
- pam_end (pam_h, rc);
diff --git a/patches/polkit-0.105/0006-0.111-Fix-a-memory-leak.patch b/patches/polkit-0.105/0006-0.111-Fix-a-memory-leak.patch
deleted file mode 100644
index c92b7f595..000000000
--- a/patches/polkit-0.105/0006-0.111-Fix-a-memory-leak.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Tue, 7 May 2013 22:30:25 +0200
-Subject: [PATCH] 0.111: Fix a memory leak
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64336
-Origin: upstream, 0.111, commit:d7b6ab40b586c255c49aba22f558eb6602c88b1e
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitagent/polkitagenthelper-pam.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/polkitagent/polkitagenthelper-pam.c b/src/polkitagent/polkitagenthelper-pam.c
-index 7af5321ebfa3..292abbe44e88 100644
---- a/src/polkitagent/polkitagenthelper-pam.c
-+++ b/src/polkitagent/polkitagenthelper-pam.c
-@@ -321,6 +321,7 @@ error:
- }
- }
- memset (aresp, 0, n * sizeof *aresp);
-+ free (aresp);
- *resp = NULL;
- return PAM_CONV_ERR;
- }
diff --git a/patches/polkit-0.105/0007-0.112-Use-GOnce-for-interface-type-registration.patch b/patches/polkit-0.105/0007-0.112-Use-GOnce-for-interface-type-registration.patch
deleted file mode 100644
index 907510e9e..000000000
--- a/patches/polkit-0.105/0007-0.112-Use-GOnce-for-interface-type-registration.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From: Tomas Bzatek <tbzatek@redhat.com>
-Date: Wed, 29 May 2013 13:45:31 +0000
-Subject: [PATCH] 0.112: Use GOnce for interface type registration
-
-Static local variable may not be enough since it doesn't provide locking.
-
-Related to these udisksd warnings:
- GLib-GObject-WARNING **: cannot register existing type `PolkitSubject'
-
-Thanks to Hans de Goede for spotting this!
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65130
-Origin: upstream, 0.112, commit:20ad116a6582e57d20f9d8197758947918753a4c
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitidentity.c | 10 ++++++----
- src/polkit/polkitsubject.c | 10 ++++++----
- src/polkitbackend/polkitbackendactionlookup.c | 10 ++++++----
- 3 files changed, 18 insertions(+), 12 deletions(-)
-
-diff --git a/src/polkit/polkitidentity.c b/src/polkit/polkitidentity.c
-index dd15b2f94828..7813c2c07919 100644
---- a/src/polkit/polkitidentity.c
-+++ b/src/polkit/polkitidentity.c
-@@ -49,9 +49,9 @@ base_init (gpointer g_iface)
- GType
- polkit_identity_get_type (void)
- {
-- static GType iface_type = 0;
-+ static volatile gsize g_define_type_id__volatile = 0;
-
-- if (iface_type == 0)
-+ if (g_once_init_enter (&g_define_type_id__volatile))
- {
- static const GTypeInfo info =
- {
-@@ -67,12 +67,14 @@ polkit_identity_get_type (void)
- NULL /* value_table */
- };
-
-- iface_type = g_type_register_static (G_TYPE_INTERFACE, "PolkitIdentity", &info, 0);
-+ GType iface_type =
-+ g_type_register_static (G_TYPE_INTERFACE, "PolkitIdentity", &info, 0);
-
- g_type_interface_add_prerequisite (iface_type, G_TYPE_OBJECT);
-+ g_once_init_leave (&g_define_type_id__volatile, iface_type);
- }
-
-- return iface_type;
-+ return g_define_type_id__volatile;
- }
-
- /**
-diff --git a/src/polkit/polkitsubject.c b/src/polkit/polkitsubject.c
-index d2c4c205b1f2..aed57951bb6b 100644
---- a/src/polkit/polkitsubject.c
-+++ b/src/polkit/polkitsubject.c
-@@ -50,9 +50,9 @@ base_init (gpointer g_iface)
- GType
- polkit_subject_get_type (void)
- {
-- static GType iface_type = 0;
-+ static volatile gsize g_define_type_id__volatile = 0;
-
-- if (iface_type == 0)
-+ if (g_once_init_enter (&g_define_type_id__volatile))
- {
- static const GTypeInfo info =
- {
-@@ -68,12 +68,14 @@ polkit_subject_get_type (void)
- NULL /* value_table */
- };
-
-- iface_type = g_type_register_static (G_TYPE_INTERFACE, "PolkitSubject", &info, 0);
-+ GType iface_type =
-+ g_type_register_static (G_TYPE_INTERFACE, "PolkitSubject", &info, 0);
-
- g_type_interface_add_prerequisite (iface_type, G_TYPE_OBJECT);
-+ g_once_init_leave (&g_define_type_id__volatile, iface_type);
- }
-
-- return iface_type;
-+ return g_define_type_id__volatile;
- }
-
- /**
-diff --git a/src/polkitbackend/polkitbackendactionlookup.c b/src/polkitbackend/polkitbackendactionlookup.c
-index 5a1a228a4c10..20747e7921ef 100644
---- a/src/polkitbackend/polkitbackendactionlookup.c
-+++ b/src/polkitbackend/polkitbackendactionlookup.c
-@@ -74,9 +74,9 @@ base_init (gpointer g_iface)
- GType
- polkit_backend_action_lookup_get_type (void)
- {
-- static GType iface_type = 0;
-+ static volatile gsize g_define_type_id__volatile = 0;
-
-- if (iface_type == 0)
-+ if (g_once_init_enter (&g_define_type_id__volatile))
- {
- static const GTypeInfo info =
- {
-@@ -92,12 +92,14 @@ polkit_backend_action_lookup_get_type (void)
- NULL /* value_table */
- };
-
-- iface_type = g_type_register_static (G_TYPE_INTERFACE, "PolkitBackendActionLookup", &info, 0);
-+ GType iface_type =
-+ g_type_register_static (G_TYPE_INTERFACE, "PolkitBackendActionLookup", &info, 0);
-
- g_type_interface_add_prerequisite (iface_type, G_TYPE_OBJECT);
-+ g_once_init_leave (&g_define_type_id__volatile, iface_type);
- }
-
-- return iface_type;
-+ return g_define_type_id__volatile;
- }
-
- /**
diff --git a/patches/polkit-0.105/0008-0.112-polkitunixprocess-Deprecate-racy-APIs.patch b/patches/polkit-0.105/0008-0.112-polkitunixprocess-Deprecate-racy-APIs.patch
deleted file mode 100644
index c39c0486c..000000000
--- a/patches/polkit-0.105/0008-0.112-polkitunixprocess-Deprecate-racy-APIs.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Colin Walters <walters@verbum.org>
-Date: Tue, 20 Aug 2013 15:15:31 -0400
-Subject: [PATCH] 0.112: polkitunixprocess: Deprecate racy APIs
-
-It's only safe for processes to be created with their owning uid,
-(without kernel support, which we don't have). Anything else is
-subject to clients exec()ing setuid binaries after the fact.
-
-Origin: upstream, 0.112, commit:08291789a1f99d4ab29c74c39344304bcca43023
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitunixprocess.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/polkit/polkitunixprocess.h b/src/polkit/polkitunixprocess.h
-index 531a57d61445..f5ed1a73e652 100644
---- a/src/polkit/polkitunixprocess.h
-+++ b/src/polkit/polkitunixprocess.h
-@@ -47,7 +47,9 @@ typedef struct _PolkitUnixProcess PolkitUnixProcess;
- typedef struct _PolkitUnixProcessClass PolkitUnixProcessClass;
-
- GType polkit_unix_process_get_type (void) G_GNUC_CONST;
-+G_GNUC_DEPRECATED_FOR(polkit_unix_process_new_for_owner)
- PolkitSubject *polkit_unix_process_new (gint pid);
-+G_GNUC_DEPRECATED_FOR(polkit_unix_process_new_for_owner)
- PolkitSubject *polkit_unix_process_new_full (gint pid,
- guint64 start_time);
- PolkitSubject *polkit_unix_process_new_for_owner (gint pid,
diff --git a/patches/polkit-0.105/0009-0.112-pkcheck-Support-process-pid-start-time-uid-syn.patch b/patches/polkit-0.105/0009-0.112-pkcheck-Support-process-pid-start-time-uid-syn.patch
deleted file mode 100644
index 198ddc639..000000000
--- a/patches/polkit-0.105/0009-0.112-pkcheck-Support-process-pid-start-time-uid-syn.patch
+++ /dev/null
@@ -1,121 +0,0 @@
-From: Colin Walters <walters@verbum.org>
-Date: Mon, 19 Aug 2013 12:16:11 -0400
-Subject: [PATCH] 0.112: pkcheck: Support --process=pid,start-time,uid syntax
- too
-
-The uid is a new addition; this allows callers such as libvirt to
-close a race condition in reading the uid of the process talking to
-them. They can read it via getsockopt(SO_PEERCRED) or equivalent,
-rather than having pkcheck look at /proc later after the fact.
-
-Programs which invoke pkcheck but need to know beforehand (i.e. at
-compile time) whether or not it supports passing the uid can
-use:
-
-pkcheck_supports_uid=$($PKG_CONFIG --variable pkcheck_supports_uid polkit-gobject-1)
-test x$pkcheck_supports_uid = xyes
-
-Origin: upstream, 0.112, commit:3968411b0c7ba193f9b9276ec911692aec248608
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- data/polkit-gobject-1.pc.in | 3 +++
- docs/man/pkcheck.xml | 29 ++++++++++++++++++++---------
- src/programs/pkcheck.c | 7 ++++++-
- 3 files changed, 29 insertions(+), 10 deletions(-)
-
-diff --git a/data/polkit-gobject-1.pc.in b/data/polkit-gobject-1.pc.in
-index c39677ddf52f..5c4c62072f80 100644
---- a/data/polkit-gobject-1.pc.in
-+++ b/data/polkit-gobject-1.pc.in
-@@ -11,3 +11,6 @@ Version: @VERSION@
- Libs: -L${libdir} -lpolkit-gobject-1
- Cflags: -I${includedir}/polkit-1
- Requires: gio-2.0 >= 2.18 glib-2.0 >= 2.18
-+# Programs using pkcheck can use this to determine
-+# whether or not it can be passed a uid.
-+pkcheck_supports_uid=true
-diff --git a/docs/man/pkcheck.xml b/docs/man/pkcheck.xml
-index 6b8a874311a0..508447e23329 100644
---- a/docs/man/pkcheck.xml
-+++ b/docs/man/pkcheck.xml
-@@ -55,6 +55,9 @@
- <arg choice="plain">
- <replaceable>pid,pid-start-time</replaceable>
- </arg>
-+ <arg choice="plain">
-+ <replaceable>pid,pid-start-time,uid</replaceable>
-+ </arg>
- </group>
- </arg>
- <arg choice="plain">
-@@ -90,7 +93,7 @@
- <title>DESCRIPTION</title>
- <para>
- <command>pkcheck</command> is used to check whether a process, specified by
-- either <option>--process</option> or <option>--system-bus-name</option>,
-+ either <option>--process</option> (see below) or <option>--system-bus-name</option>,
- is authorized for <replaceable>action</replaceable>. The <option>--detail</option>
- option can be used zero or more times to pass details about <replaceable>action</replaceable>.
- If <option>--allow-user-interaction</option> is passed, <command>pkcheck</command> blocks
-@@ -160,17 +163,25 @@ KEY3=VALUE3
- <refsect1 id="pkcheck-notes">
- <title>NOTES</title>
- <para>
-- Since process identifiers can be recycled, the caller should always use
-- <replaceable>pid,pid-start-time</replaceable> to specify the process
-- to check for authorization when using the <option>--process</option> option.
-- The value of <replaceable>pid-start-time</replaceable>
-- can be determined by consulting e.g. the
-+ Do not use either the bare <replaceable>pid</replaceable> or
-+ <replaceable>pid,start-time</replaceable> syntax forms for
-+ <option>--process</option>. There are race conditions in both.
-+ New code should always use
-+ <replaceable>pid,pid-start-time,uid</replaceable>. The value of
-+ <replaceable>start-time</replaceable> can be determined by
-+ consulting e.g. the
- <citerefentry>
- <refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum>
- </citerefentry>
-- file system depending on the operating system. If only <replaceable>pid</replaceable>
-- is passed to the <option>--process</option> option, then <command>pkcheck</command>
-- will look up the start time itself but note that this may be racy.
-+ file system depending on the operating system. If fewer than 3
-+ arguments are passed, <command>pkcheck</command> will attempt to
-+ look up them up internally, but note that this may be racy.
-+ </para>
-+ <para>
-+ If your program is a daemon with e.g. a custom Unix domain
-+ socket, you should determine the <replaceable>uid</replaceable>
-+ parameter via operating system mechanisms such as
-+ <literal>PEERCRED</literal>.
- </para>
- </refsect1>
-
-diff --git a/src/programs/pkcheck.c b/src/programs/pkcheck.c
-index 719a36c47c21..057e926db86f 100644
---- a/src/programs/pkcheck.c
-+++ b/src/programs/pkcheck.c
-@@ -372,6 +372,7 @@ main (int argc, char *argv[])
- else if (g_strcmp0 (argv[n], "--process") == 0 || g_strcmp0 (argv[n], "-p") == 0)
- {
- gint pid;
-+ guint uid;
- guint64 pid_start_time;
-
- n++;
-@@ -381,7 +382,11 @@ main (int argc, char *argv[])
- goto out;
- }
-
-- if (sscanf (argv[n], "%i,%" G_GUINT64_FORMAT, &pid, &pid_start_time) == 2)
-+ if (sscanf (argv[n], "%i,%" G_GUINT64_FORMAT ",%u", &pid, &pid_start_time, &uid) == 3)
-+ {
-+ subject = polkit_unix_process_new_for_owner (pid, pid_start_time, uid);
-+ }
-+ else if (sscanf (argv[n], "%i,%" G_GUINT64_FORMAT, &pid, &pid_start_time) == 2)
- {
- subject = polkit_unix_process_new_full (pid, pid_start_time);
- }
diff --git a/patches/polkit-0.105/0010-0.113-Port-internals-non-deprecated-PolkitProcess-AP.patch b/patches/polkit-0.105/0010-0.113-Port-internals-non-deprecated-PolkitProcess-AP.patch
deleted file mode 100644
index b1f29326e..000000000
--- a/patches/polkit-0.105/0010-0.113-Port-internals-non-deprecated-PolkitProcess-AP.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: Colin Walters <walters@verbum.org>
-Date: Sat, 9 Nov 2013 13:48:21 -0500
-Subject: [PATCH] 0.113: Port internals non-deprecated PolkitProcess API where
- possible
-
-We can't port everything, but in PolkitPermission and these test
-cases, we can use _for_owner() with the right information.
-
-[smcv: drop the part that touches
-test/polkitbackend/test-polkitbackendjsauthority.c which is not
-in this branch]
-
-Origin: upstream, 0.113, commit:6d3d0a8ffb0fd8ae59eb35593b305ec87da8858d
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitpermission.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/polkit/polkitpermission.c b/src/polkit/polkitpermission.c
-index 22d195fcdc60..f8a666e81913 100644
---- a/src/polkit/polkitpermission.c
-+++ b/src/polkit/polkitpermission.c
-@@ -122,7 +122,7 @@ polkit_permission_constructed (GObject *object)
- PolkitPermission *permission = POLKIT_PERMISSION (object);
-
- if (permission->subject == NULL)
-- permission->subject = polkit_unix_process_new (getpid ());
-+ permission->subject = polkit_unix_process_new_for_owner (getpid (), 0, getuid ());
-
- if (G_OBJECT_CLASS (polkit_permission_parent_class)->constructed != NULL)
- G_OBJECT_CLASS (polkit_permission_parent_class)->constructed (object);
diff --git a/patches/polkit-0.105/0011-0.113-pkexec-Work-around-systemd-injecting-broken-XD.patch b/patches/polkit-0.105/0011-0.113-pkexec-Work-around-systemd-injecting-broken-XD.patch
deleted file mode 100644
index a270de1fe..000000000
--- a/patches/polkit-0.105/0011-0.113-pkexec-Work-around-systemd-injecting-broken-XD.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From: Colin Walters <walters@verbum.org>
-Date: Thu, 21 Nov 2013 17:39:37 -0500
-Subject: [PATCH] 0.113: pkexec: Work around systemd injecting broken
- XDG_RUNTIME_DIR
-
-This workaround isn't too much code, and it's often better to fix bugs
-in two places anyways.
-
-For more information:
-
-See https://bugzilla.redhat.com/show_bug.cgi?id=753882
-See http://lists.freedesktop.org/archives/systemd-devel/2013-November/014370.html
-
-Origin: upstream, 0.113, commit:8635ffc16aeff6a07d675f861fe0dea03ea81d7e
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/programs/pkexec.c | 33 ++++++++++++++++++++++++++++++---
- 1 file changed, 30 insertions(+), 3 deletions(-)
-
-diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c
-index 9a0570a307a1..5e99044311ac 100644
---- a/src/programs/pkexec.c
-+++ b/src/programs/pkexec.c
-@@ -139,8 +139,22 @@ pam_conversation_function (int n,
- return PAM_CONV_ERR;
- }
-
-+/* A work around for:
-+ * https://bugzilla.redhat.com/show_bug.cgi?id=753882
-+ */
-+static gboolean
-+xdg_runtime_dir_is_owned_by (const char *path,
-+ uid_t target_uid)
-+{
-+ struct stat stbuf;
-+
-+ return stat (path, &stbuf) == 0 &&
-+ stbuf.st_uid == target_uid;
-+}
-+
- static gboolean
--open_session (const gchar *user_to_auth)
-+open_session (const gchar *user_to_auth,
-+ uid_t target_uid)
- {
- gboolean ret;
- gint rc;
-@@ -182,7 +196,19 @@ open_session (const gchar *user_to_auth)
- {
- guint n;
- for (n = 0; envlist[n]; n++)
-- putenv (envlist[n]);
-+ {
-+ const char *envitem = envlist[n];
-+
-+ if (g_str_has_prefix (envitem, "XDG_RUNTIME_DIR="))
-+ {
-+ const char *eq = strchr (envitem, '=');
-+ g_assert (eq);
-+ if (!xdg_runtime_dir_is_owned_by (eq + 1, target_uid))
-+ continue;
-+ }
-+
-+ putenv (envlist[n]);
-+ }
- free (envlist);
- }
-
-@@ -892,7 +918,8 @@ main (int argc, char *argv[])
- * As evident above, neither su(1) (and, for that matter, nor sudo(8)) does this.
- */
- #ifdef POLKIT_AUTHFW_PAM
-- if (!open_session (pw->pw_name))
-+ if (!open_session (pw->pw_name,
-+ pw->pw_uid))
- {
- goto out;
- }
diff --git a/patches/polkit-0.105/0012-0.113-PolkitAgentSession-fix-race-between-child-and-.patch b/patches/polkit-0.105/0012-0.113-PolkitAgentSession-fix-race-between-child-and-.patch
deleted file mode 100644
index d91e0f09c..000000000
--- a/patches/polkit-0.105/0012-0.113-PolkitAgentSession-fix-race-between-child-and-.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From: Rui Matos <tiagomatos@gmail.com>
-Date: Thu, 6 Feb 2014 18:41:18 +0100
-Subject: [PATCH] 0.113: PolkitAgentSession: fix race between child and io
- watches
-
-The helper flushes and fdatasyncs stdout and stderr before terminating
-but this doesn't guarantee that our io watch is called before our
-child watch. This means that we can end up with a successful return
-from the helper which we still report as a failure.
-
-If we add G_IO_HUP and G_IO_ERR to the conditions we look for in the
-io watch and the child terminates we still run the io watch handler
-which will complete the session.
-
-This means that the child watch is in fact needless and we can remove
-it.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60847
-Origin: upstream, 0.113, commit:7650ad1e08ab13bdb461783c4995d186d9392840
-Bug: http://bugs.freedesktop.org/show_bug.cgi?id=30515
-Bug-Ubuntu: https://launchpad.net/bugs/649939
-Bug-Ubuntu: https://launchpad.net/bugs/445303
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitagent/polkitagentsession.c | 47 +++++++---------------------
- 1 file changed, 11 insertions(+), 36 deletions(-)
-
-diff --git a/src/polkitagent/polkitagentsession.c b/src/polkitagent/polkitagentsession.c
-index 8129cd9f7091..a658a2295da7 100644
---- a/src/polkitagent/polkitagentsession.c
-+++ b/src/polkitagent/polkitagentsession.c
-@@ -92,7 +92,6 @@ struct _PolkitAgentSession
- int child_stdout;
- GPid child_pid;
-
-- GSource *child_watch_source;
- GSource *child_stdout_watch_source;
- GIOChannel *child_stdout_channel;
-
-@@ -377,13 +376,6 @@ kill_helper (PolkitAgentSession *session)
- session->child_pid = 0;
- }
-
-- if (session->child_watch_source != NULL)
-- {
-- g_source_destroy (session->child_watch_source);
-- g_source_unref (session->child_watch_source);
-- session->child_watch_source = NULL;
-- }
--
- if (session->child_stdout_watch_source != NULL)
- {
- g_source_destroy (session->child_stdout_watch_source);
-@@ -429,26 +421,6 @@ complete_session (PolkitAgentSession *session,
- }
- }
-
--static void
--child_watch_func (GPid pid,
-- gint status,
-- gpointer user_data)
--{
-- PolkitAgentSession *session = POLKIT_AGENT_SESSION (user_data);
--
-- if (G_UNLIKELY (_show_debug ()))
-- {
-- g_print ("PolkitAgentSession: in child_watch_func for pid %d (WIFEXITED=%d WEXITSTATUS=%d)\n",
-- (gint) pid,
-- WIFEXITED(status),
-- WEXITSTATUS(status));
-- }
--
-- /* kill all the watches we have set up, except for the child since it has exited already */
-- session->child_pid = 0;
-- complete_session (session, FALSE);
--}
--
- static gboolean
- io_watch_have_data (GIOChannel *channel,
- GIOCondition condition,
-@@ -475,10 +447,13 @@ io_watch_have_data (GIOChannel *channel,
- NULL,
- NULL,
- &error);
-- if (error != NULL)
-+ if (error != NULL || line == NULL)
- {
-- g_warning ("Error reading line from helper: %s", error->message);
-- g_error_free (error);
-+ /* In case we get just G_IO_HUP, line is NULL but error is
-+ unset.*/
-+ g_warning ("Error reading line from helper: %s",
-+ error ? error->message : "nothing to read");
-+ g_clear_error (&error);
-
- complete_session (session, FALSE);
- goto out;
-@@ -540,6 +515,9 @@ io_watch_have_data (GIOChannel *channel,
- g_free (line);
- g_free (unescaped);
-
-+ if (condition & (G_IO_ERR | G_IO_HUP))
-+ complete_session (session, FALSE);
-+
- /* keep the IOChannel around */
- return TRUE;
- }
-@@ -650,12 +628,9 @@ polkit_agent_session_initiate (PolkitAgentSession *session)
- if (G_UNLIKELY (_show_debug ()))
- g_print ("PolkitAgentSession: spawned helper with pid %d\n", (gint) session->child_pid);
-
-- session->child_watch_source = g_child_watch_source_new (session->child_pid);
-- g_source_set_callback (session->child_watch_source, (GSourceFunc) child_watch_func, session, NULL);
-- g_source_attach (session->child_watch_source, g_main_context_get_thread_default ());
--
- session->child_stdout_channel = g_io_channel_unix_new (session->child_stdout);
-- session->child_stdout_watch_source = g_io_create_watch (session->child_stdout_channel, G_IO_IN);
-+ session->child_stdout_watch_source = g_io_create_watch (session->child_stdout_channel,
-+ G_IO_IN | G_IO_ERR | G_IO_HUP);
- g_source_set_callback (session->child_stdout_watch_source, (GSourceFunc) io_watch_have_data, session, NULL);
- g_source_attach (session->child_stdout_watch_source, g_main_context_get_thread_default ());
-
diff --git a/patches/polkit-0.105/0013-0.113-polkitd-Fix-problem-with-removing-non-existent.patch b/patches/polkit-0.105/0013-0.113-polkitd-Fix-problem-with-removing-non-existent.patch
deleted file mode 100644
index 9c6e5ec30..000000000
--- a/patches/polkit-0.105/0013-0.113-polkitd-Fix-problem-with-removing-non-existent.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Lukasz Skalski <l.skalski@samsung.com>
-Date: Tue, 22 Apr 2014 11:11:20 +0200
-Subject: [PATCH] 0.113: polkitd: Fix problem with removing non-existent source
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77167
-Applied-upstream: 0.113, commit:3ca4e00c7e003ea80aa96b499bc7cd83246d7108
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitd/main.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/polkitd/main.c b/src/polkitd/main.c
-index b21723f697ce..f18fb917c3b6 100644
---- a/src/polkitd/main.c
-+++ b/src/polkitd/main.c
-@@ -93,7 +93,7 @@ on_sigint (gpointer user_data)
- {
- g_print ("Handling SIGINT\n");
- g_main_loop_quit (loop);
-- return FALSE;
-+ return TRUE;
- }
-
- int
diff --git a/patches/polkit-0.105/0014-0.113-PolkitSystemBusName-Add-public-API-to-retrieve.patch b/patches/polkit-0.105/0014-0.113-PolkitSystemBusName-Add-public-API-to-retrieve.patch
deleted file mode 100644
index e10a19d58..000000000
--- a/patches/polkit-0.105/0014-0.113-PolkitSystemBusName-Add-public-API-to-retrieve.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-From: Colin Walters <walters@verbum.org>
-Date: Wed, 21 Aug 2013 12:23:55 -0400
-Subject: [PATCH] 0.113: PolkitSystemBusName: Add public API to retrieve Unix
- user
-
-And change the duplicated code in the backend session monitors to use
-it. This just a code cleanup resulting from review after
-CVE-2013-4288. There's no security impact from this patch, it just
-removes duplicated code.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69538
-Origin: upstream, 0.113, commit:904d8404d93dec45fce3b719eb1a626acc6b8a73
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitsystembusname.c | 56 +++++++++++++++++++
- src/polkit/polkitsystembusname.h | 4 ++
- .../polkitbackendsessionmonitor-systemd.c | 20 +------
- .../polkitbackendsessionmonitor.c | 20 +------
- 4 files changed, 62 insertions(+), 38 deletions(-)
-
-diff --git a/src/polkit/polkitsystembusname.c b/src/polkit/polkitsystembusname.c
-index 2a297c4af475..51e4a694aa38 100644
---- a/src/polkit/polkitsystembusname.c
-+++ b/src/polkit/polkitsystembusname.c
-@@ -25,6 +25,7 @@
-
- #include <string.h>
- #include "polkitsystembusname.h"
-+#include "polkitunixuser.h"
- #include "polkitsubject.h"
- #include "polkitprivate.h"
-
-@@ -396,3 +397,58 @@ polkit_system_bus_name_get_process_sync (PolkitSystemBusName *system_bus_name,
- return ret;
- }
-
-+/**
-+ * polkit_system_bus_name_get_user_sync:
-+ * @system_bus_name: A #PolkitSystemBusName.
-+ * @cancellable: (allow-none): A #GCancellable or %NULL.
-+ * @error: (allow-none): Return location for error or %NULL.
-+ *
-+ * Synchronously gets a #PolkitUnixUser object for @system_bus_name;
-+ * the calling thread is blocked until a reply is received.
-+ *
-+ * Returns: (allow-none) (transfer full): A #PolkitUnixUser object or %NULL if @error is set.
-+ **/
-+PolkitUnixUser *
-+polkit_system_bus_name_get_user_sync (PolkitSystemBusName *system_bus_name,
-+ GCancellable *cancellable,
-+ GError **error)
-+{
-+ GDBusConnection *connection;
-+ PolkitUnixUser *ret;
-+ GVariant *result;
-+ guint32 uid;
-+
-+ g_return_val_if_fail (POLKIT_IS_SYSTEM_BUS_NAME (system_bus_name), NULL);
-+ g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
-+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-+
-+ ret = NULL;
-+
-+ connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, cancellable, error);
-+ if (connection == NULL)
-+ goto out;
-+
-+ result = g_dbus_connection_call_sync (connection,
-+ "org.freedesktop.DBus", /* name */
-+ "/org/freedesktop/DBus", /* object path */
-+ "org.freedesktop.DBus", /* interface name */
-+ "GetConnectionUnixUser", /* method */
-+ g_variant_new ("(s)", system_bus_name->name),
-+ G_VARIANT_TYPE ("(u)"),
-+ G_DBUS_CALL_FLAGS_NONE,
-+ -1,
-+ cancellable,
-+ error);
-+ if (result == NULL)
-+ goto out;
-+
-+ g_variant_get (result, "(u)", &uid);
-+ g_variant_unref (result);
-+
-+ ret = (PolkitUnixUser*)polkit_unix_user_new (uid);
-+
-+ out:
-+ if (connection != NULL)
-+ g_object_unref (connection);
-+ return ret;
-+}
-diff --git a/src/polkit/polkitsystembusname.h b/src/polkit/polkitsystembusname.h
-index 1fc464fc41ef..38d31f715d10 100644
---- a/src/polkit/polkitsystembusname.h
-+++ b/src/polkit/polkitsystembusname.h
-@@ -56,6 +56,10 @@ PolkitSubject *polkit_system_bus_name_get_process_sync (PolkitSystemBusName
- GCancellable *cancellable,
- GError **error);
-
-+PolkitUnixUser * polkit_system_bus_name_get_user_sync (PolkitSystemBusName *system_bus_name,
-+ GCancellable *cancellable,
-+ GError **error);
-+
- G_END_DECLS
-
- #endif /* __POLKIT_SYSTEM_BUS_NAME_H */
-diff --git a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-index 58593c323508..018531051714 100644
---- a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-+++ b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-@@ -277,25 +277,7 @@ polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor
- }
- else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
- {
-- GVariant *result;
--
-- result = g_dbus_connection_call_sync (monitor->system_bus,
-- "org.freedesktop.DBus",
-- "/org/freedesktop/DBus",
-- "org.freedesktop.DBus",
-- "GetConnectionUnixUser",
-- g_variant_new ("(s)", polkit_system_bus_name_get_name (POLKIT_SYSTEM_BUS_NAME (subject))),
-- G_VARIANT_TYPE ("(u)"),
-- G_DBUS_CALL_FLAGS_NONE,
-- -1, /* timeout_msec */
-- NULL, /* GCancellable */
-- error);
-- if (result == NULL)
-- goto out;
-- g_variant_get (result, "(u)", &uid);
-- g_variant_unref (result);
--
-- ret = polkit_unix_user_new (uid);
-+ ret = (PolkitIdentity*)polkit_system_bus_name_get_user_sync (POLKIT_SYSTEM_BUS_NAME (subject), NULL, error);
- }
- else if (POLKIT_IS_UNIX_SESSION (subject))
- {
-diff --git a/src/polkitbackend/polkitbackendsessionmonitor.c b/src/polkitbackend/polkitbackendsessionmonitor.c
-index 9c331b64a0ec..4075d3ff06ad 100644
---- a/src/polkitbackend/polkitbackendsessionmonitor.c
-+++ b/src/polkitbackend/polkitbackendsessionmonitor.c
-@@ -306,25 +306,7 @@ polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor
- }
- else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
- {
-- GVariant *result;
--
-- result = g_dbus_connection_call_sync (monitor->system_bus,
-- "org.freedesktop.DBus",
-- "/org/freedesktop/DBus",
-- "org.freedesktop.DBus",
-- "GetConnectionUnixUser",
-- g_variant_new ("(s)", polkit_system_bus_name_get_name (POLKIT_SYSTEM_BUS_NAME (subject))),
-- G_VARIANT_TYPE ("(u)"),
-- G_DBUS_CALL_FLAGS_NONE,
-- -1, /* timeout_msec */
-- NULL, /* GCancellable */
-- error);
-- if (result == NULL)
-- goto out;
-- g_variant_get (result, "(u)", &uid);
-- g_variant_unref (result);
--
-- ret = polkit_unix_user_new (uid);
-+ ret = (PolkitIdentity*)polkit_system_bus_name_get_user_sync (POLKIT_SYSTEM_BUS_NAME (subject));
- }
- else if (POLKIT_IS_UNIX_SESSION (subject))
- {
diff --git a/patches/polkit-0.105/0015-0.113-Fixed-compilation-problem-in-the-backend.patch b/patches/polkit-0.105/0015-0.113-Fixed-compilation-problem-in-the-backend.patch
deleted file mode 100644
index a61daa192..000000000
--- a/patches/polkit-0.105/0015-0.113-Fixed-compilation-problem-in-the-backend.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Xabier Rodriguez Calvar <calvaris@igalia.com>
-Date: Sun, 10 Nov 2013 19:16:41 +0100
-Subject: [PATCH] 0.113: Fixed compilation problem in the backend
-
-Origin: upstream, 0.113, commit: dbbb7dc60abdd970af0a8fae404484181fa909c9
-Bug-Debian: https://bugs.debian.org/798769
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitbackend/polkitbackendsessionmonitor.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/polkitbackend/polkitbackendsessionmonitor.c b/src/polkitbackend/polkitbackendsessionmonitor.c
-index 4075d3ff06ad..05f51c581479 100644
---- a/src/polkitbackend/polkitbackendsessionmonitor.c
-+++ b/src/polkitbackend/polkitbackendsessionmonitor.c
-@@ -306,7 +306,7 @@ polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor
- }
- else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
- {
-- ret = (PolkitIdentity*)polkit_system_bus_name_get_user_sync (POLKIT_SYSTEM_BUS_NAME (subject));
-+ ret = (PolkitIdentity*)polkit_system_bus_name_get_user_sync (POLKIT_SYSTEM_BUS_NAME (subject), NULL, NULL);
- }
- else if (POLKIT_IS_UNIX_SESSION (subject))
- {
diff --git a/patches/polkit-0.105/0016-0.113-Don-t-discard-error-data-returned-by-polkit_sy.patch b/patches/polkit-0.105/0016-0.113-Don-t-discard-error-data-returned-by-polkit_sy.patch
deleted file mode 100644
index de3da552f..000000000
--- a/patches/polkit-0.105/0016-0.113-Don-t-discard-error-data-returned-by-polkit_sy.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Mon, 11 Nov 2013 23:51:23 +0100
-Subject: [PATCH] 0.113: Don't discard error data returned by
- polkit_system_bus_name_get_user_sync
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71458
-Origin: upstream, 0.113, commit: 145d43b9c891f248ad68ebe597cb151a865bdb3a
-Bug-Debian: https://bugs.debian.org/798769
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitbackend/polkitbackendsessionmonitor.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/polkitbackend/polkitbackendsessionmonitor.c b/src/polkitbackend/polkitbackendsessionmonitor.c
-index 05f51c581479..e1a9ab3a32cc 100644
---- a/src/polkitbackend/polkitbackendsessionmonitor.c
-+++ b/src/polkitbackend/polkitbackendsessionmonitor.c
-@@ -306,7 +306,7 @@ polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor
- }
- else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
- {
-- ret = (PolkitIdentity*)polkit_system_bus_name_get_user_sync (POLKIT_SYSTEM_BUS_NAME (subject), NULL, NULL);
-+ ret = (PolkitIdentity*)polkit_system_bus_name_get_user_sync (POLKIT_SYSTEM_BUS_NAME (subject), NULL, error);
- }
- else if (POLKIT_IS_UNIX_SESSION (subject))
- {
diff --git a/patches/polkit-0.105/0017-0.113-sessionmonitor-systemd-Deduplicate-code-paths.patch b/patches/polkit-0.105/0017-0.113-sessionmonitor-systemd-Deduplicate-code-paths.patch
deleted file mode 100644
index 756701aa4..000000000
--- a/patches/polkit-0.105/0017-0.113-sessionmonitor-systemd-Deduplicate-code-paths.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From: Colin Walters <walters@verbum.org>
-Date: Thu, 7 Nov 2013 15:57:50 -0500
-Subject: [PATCH] 0.113: sessionmonitor-systemd: Deduplicate code paths
-
-We had the code to go from pid -> session duplicated. If we have a
-PolkitSystemBusName, convert it to a PolkitUnixProcess.
-Then we can do PolkitUnixProcess -> pid -> session in one place.
-
-This is just a code cleanup.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69538
-Origin: upstream, 0.113, commit:26d0c0578211fb96fc8fe75572aa11ad6ecbf9b8
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- .../polkitbackendsessionmonitor-systemd.c | 63 +++++++------------
- 1 file changed, 22 insertions(+), 41 deletions(-)
-
-diff --git a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-index 018531051714..756b728ab952 100644
---- a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-+++ b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-@@ -313,61 +313,42 @@ polkit_backend_session_monitor_get_session_for_subject (PolkitBackendSessionMoni
- PolkitSubject *subject,
- GError **error)
- {
-- PolkitSubject *session;
--
-- session = NULL;
-+ PolkitUnixProcess *tmp_process = NULL;
-+ PolkitUnixProcess *process = NULL;
-+ PolkitSubject *session = NULL;
-+ char *session_id = NULL;
-+ pid_t pid;
-
- if (POLKIT_IS_UNIX_PROCESS (subject))
-- {
-- gchar *session_id;
-- pid_t pid;
--
-- pid = polkit_unix_process_get_pid (POLKIT_UNIX_PROCESS (subject));
-- if (sd_pid_get_session (pid, &session_id) < 0)
-- goto out;
--
-- session = polkit_unix_session_new (session_id);
-- free (session_id);
-- }
-+ process = POLKIT_UNIX_PROCESS (subject); /* We already have a process */
- else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
- {
-- guint32 pid;
-- gchar *session_id;
-- GVariant *result;
--
-- result = g_dbus_connection_call_sync (monitor->system_bus,
-- "org.freedesktop.DBus",
-- "/org/freedesktop/DBus",
-- "org.freedesktop.DBus",
-- "GetConnectionUnixProcessID",
-- g_variant_new ("(s)", polkit_system_bus_name_get_name (POLKIT_SYSTEM_BUS_NAME (subject))),
-- G_VARIANT_TYPE ("(u)"),
-- G_DBUS_CALL_FLAGS_NONE,
-- -1, /* timeout_msec */
-- NULL, /* GCancellable */
-- error);
-- if (result == NULL)
-- goto out;
-- g_variant_get (result, "(u)", &pid);
-- g_variant_unref (result);
--
-- if (sd_pid_get_session (pid, &session_id) < 0)
-- goto out;
--
-- session = polkit_unix_session_new (session_id);
-- free (session_id);
-+ /* Convert bus name to process */
-+ tmp_process = (PolkitUnixProcess*)polkit_system_bus_name_get_process_sync (POLKIT_SYSTEM_BUS_NAME (subject), NULL, error);
-+ if (!tmp_process)
-+ goto out;
-+ process = tmp_process;
- }
- else
- {
- g_set_error (error,
- POLKIT_ERROR,
- POLKIT_ERROR_NOT_SUPPORTED,
-- "Cannot get user for subject of type %s",
-+ "Cannot get session for subject of type %s",
- g_type_name (G_TYPE_FROM_INSTANCE (subject)));
- }
-
-- out:
-+ /* Now do process -> pid -> session */
-+ g_assert (process != NULL);
-+ pid = polkit_unix_process_get_pid (process);
-
-+ if (sd_pid_get_session (pid, &session_id) < 0)
-+ goto out;
-+
-+ session = polkit_unix_session_new (session_id);
-+ free (session_id);
-+ out:
-+ if (tmp_process) g_object_unref (tmp_process);
- return session;
- }
-
diff --git a/patches/polkit-0.105/0018-0.113-sessionmonitor-systemd-prepare-for-D-Bus-user-.patch b/patches/polkit-0.105/0018-0.113-sessionmonitor-systemd-prepare-for-D-Bus-user-.patch
deleted file mode 100644
index ffd729a55..000000000
--- a/patches/polkit-0.105/0018-0.113-sessionmonitor-systemd-prepare-for-D-Bus-user-.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From: Kay Sievers <kay@vrfy.org>
-Date: Mon, 19 May 2014 10:19:49 +0900
-Subject: [PATCH] 0.113: sessionmonitor-systemd: prepare for D-Bus "user bus"
- model
-
-In the D-Bus "user bus" model, all sessions of a user share the same
-D-Bus instance, a polkit requesting process might live outside the
-login session which registered the user's polkit agent.
-
-In case a polkit requesting process is not part of the user's login
-session, we ask systemd-logind for the user's "display" session
-instead.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=78905
-Bug-Debian: https://bugs.debian.org/779988
-Applied-upstream: 0.113, commit:a68f5dfd7662767b7b9822090b70bc5bd145c50c
-[smcv: backport configure.ac changes; fail with #error if the required
-API is not found]
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure.ac | 4 +++
- .../polkitbackendsessionmonitor-systemd.c | 29 +++++++++++++++----
- 2 files changed, 28 insertions(+), 5 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index f4a0c4177fbf..aa2760f90606 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -165,6 +165,10 @@ if test "$enable_systemd" != "no"; then
- have_systemd=no)
- if test "$have_systemd" = "yes"; then
- SESSION_TRACKING=systemd
-+ save_LIBS=$LIBS
-+ LIBS=$SYSTEMD_LIBS
-+ AC_CHECK_FUNCS(sd_uid_get_display)
-+ LIBS=$save_LIBS
- else
- if test "$enable_systemd" = "yes"; then
- AC_MSG_ERROR([systemd support requested but libsystemd-login1 library not found])
-diff --git a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-index 756b728ab952..ebd05cea45dc 100644
---- a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-+++ b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-@@ -318,6 +318,9 @@ polkit_backend_session_monitor_get_session_for_subject (PolkitBackendSessionMoni
- PolkitSubject *session = NULL;
- char *session_id = NULL;
- pid_t pid;
-+#if HAVE_SD_UID_GET_DISPLAY
-+ uid_t uid;
-+#endif
-
- if (POLKIT_IS_UNIX_PROCESS (subject))
- process = POLKIT_UNIX_PROCESS (subject); /* We already have a process */
-@@ -338,16 +341,32 @@ polkit_backend_session_monitor_get_session_for_subject (PolkitBackendSessionMoni
- g_type_name (G_TYPE_FROM_INSTANCE (subject)));
- }
-
-- /* Now do process -> pid -> session */
-+ /* Now do process -> pid -> same session */
- g_assert (process != NULL);
- pid = polkit_unix_process_get_pid (process);
-
-- if (sd_pid_get_session (pid, &session_id) < 0)
-+ if (sd_pid_get_session (pid, &session_id) >= 0)
-+ {
-+ session = polkit_unix_session_new (session_id);
-+ goto out;
-+ }
-+
-+#if HAVE_SD_UID_GET_DISPLAY
-+ /* Now do process -> uid -> graphical session (systemd version 213)*/
-+ if (sd_pid_get_owner_uid (pid, &uid) < 0)
- goto out;
--
-- session = polkit_unix_session_new (session_id);
-- free (session_id);
-+
-+ if (sd_uid_get_display (uid, &session_id) >= 0)
-+ {
-+ session = polkit_unix_session_new (session_id);
-+ goto out;
-+ }
-+#else
-+#error Debian should have sd_uid_get_display()
-+#endif
-+
- out:
-+ free (session_id);
- if (tmp_process) g_object_unref (tmp_process);
- return session;
- }
diff --git a/patches/polkit-0.105/0019-0.113-Refuse-duplicate-user-arguments-to-pkexec.patch b/patches/polkit-0.105/0019-0.113-Refuse-duplicate-user-arguments-to-pkexec.patch
deleted file mode 100644
index 65708c9d5..000000000
--- a/patches/polkit-0.105/0019-0.113-Refuse-duplicate-user-arguments-to-pkexec.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Tue, 26 Aug 2014 17:59:47 +0200
-Subject: [PATCH] 0.113: Refuse duplicate --user arguments to pkexec
-
-This usage is clearly erroneous, so we should tell the users they are
-making a mistake.
-
-Besides, this allows an attacker to cause a high number of heap
-allocations with attacker-controlled sizes (
-http://googleprojectzero.blogspot.cz/2014/08/the-poisoned-nul-byte-2014-edition.html
-), making some exploits easier.
-
-(To be clear, this is not a pkexec vulnerability, and we will not
-refuse attacker-affected malloc() usage as a matter of policy; but this
-commit is both user-friendly and adding some hardening.)
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83093
-Origin: upstream, 0.113, commit:6c992bc8aefa195a41eaa41c07f46f17de18e25c
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/programs/pkexec.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c
-index 5e99044311ac..abc660dfddc6 100644
---- a/src/programs/pkexec.c
-+++ b/src/programs/pkexec.c
-@@ -533,6 +533,11 @@ main (int argc, char *argv[])
- goto out;
- }
-
-+ if (opt_user != NULL)
-+ {
-+ g_printerr ("--user specified twice\n");
-+ goto out;
-+ }
- opt_user = g_strdup (argv[n]);
- }
- else if (strcmp (argv[n], "--disable-internal-agent") == 0)
diff --git a/patches/polkit-0.105/0020-0.113-authority-Fix-memory-leak-in-EnumerateActions-.patch b/patches/polkit-0.105/0020-0.113-authority-Fix-memory-leak-in-EnumerateActions-.patch
deleted file mode 100644
index 6b5668119..000000000
--- a/patches/polkit-0.105/0020-0.113-authority-Fix-memory-leak-in-EnumerateActions-.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: "Max A. Dednev" <dednev@rambler.ru>
-Date: Sun, 11 Jan 2015 20:00:44 -0500
-Subject: [PATCH] 0.113: authority: Fix memory leak in EnumerateActions call
- results handler
-
-Policykit-1 doesn't release reference counters of GVariant data for
-org.freedesktop.PolicyKit1.Authority.EnumerateActions dbus call. This
-patch fixed reference counting and following memory leak.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88288
-Origin: upstream, 0.113, commit:f4d71e0de885010494b8b0b8d62ca910011d7544
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitauthority.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/src/polkit/polkitauthority.c b/src/polkit/polkitauthority.c
-index 9947cf3273b2..84dab72c6f0f 100644
---- a/src/polkit/polkitauthority.c
-+++ b/src/polkit/polkitauthority.c
-@@ -715,7 +715,6 @@ polkit_authority_enumerate_actions_finish (PolkitAuthority *authority,
- while ((child = g_variant_iter_next_value (&iter)) != NULL)
- {
- ret = g_list_prepend (ret, polkit_action_description_new_for_gvariant (child));
-- g_variant_ref_sink (child);
- g_variant_unref (child);
- }
- ret = g_list_reverse (ret);
diff --git a/patches/polkit-0.105/0021-0.113-CVE-2015-3218-backend-Handle-invalid-object-pa.patch b/patches/polkit-0.105/0021-0.113-CVE-2015-3218-backend-Handle-invalid-object-pa.patch
deleted file mode 100644
index 688d87e55..000000000
--- a/patches/polkit-0.105/0021-0.113-CVE-2015-3218-backend-Handle-invalid-object-pa.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-From: Colin Walters <walters@redhat.com>
-Date: Sat, 30 May 2015 09:06:23 -0400
-Subject: [PATCH] 0.113: CVE-2015-3218: backend: Handle invalid object paths in
- RegisterAuthenticationAgent
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Properly propagate the error, otherwise we dereference a `NULL`
-pointer. This is a local, authenticated DoS.
-
-`RegisterAuthenticationAgentWithOptions` and
-`UnregisterAuthentication` have been validated to not need changes for
-this.
-
-http://lists.freedesktop.org/archives/polkit-devel/2015-May/000420.html
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90829
-Bug-Debian: https://bugs.debian.org/787932
-Reported-by: Tavis Ormandy <taviso@google.com>
-Reviewed-by: Philip Withnall <philip@tecnocode.co.uk>
-Reviewed-by: Miloslav Trmač <mitr@redhat.com>
-Signed-off-by: Colin Walters <walters@redhat.com>
-Origin: upstream, 0.113, commit:48e646918efb2bf0b3b505747655726d7869f31c
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- .../polkitbackendinteractiveauthority.c | 53 +++++++++++--------
- 1 file changed, 30 insertions(+), 23 deletions(-)
-
-diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
-index b237e9db0be8..25e13fb0907e 100644
---- a/src/polkitbackend/polkitbackendinteractiveauthority.c
-+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -1558,36 +1558,42 @@ authentication_agent_new (PolkitSubject *scope,
- const gchar *unique_system_bus_name,
- const gchar *locale,
- const gchar *object_path,
-- GVariant *registration_options)
-+ GVariant *registration_options,
-+ GError **error)
- {
- AuthenticationAgent *agent;
-- GError *error;
-+ GDBusProxy *proxy;
-
-- agent = g_new0 (AuthenticationAgent, 1);
-+ if (!g_variant_is_object_path (object_path))
-+ {
-+ g_set_error (error, POLKIT_ERROR, POLKIT_ERROR_FAILED,
-+ "Invalid object path '%s'", object_path);
-+ return NULL;
-+ }
-+
-+ proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
-+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
-+ G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
-+ NULL, /* GDBusInterfaceInfo* */
-+ unique_system_bus_name,
-+ object_path,
-+ "org.freedesktop.PolicyKit1.AuthenticationAgent",
-+ NULL, /* GCancellable* */
-+ error);
-+ if (proxy == NULL)
-+ {
-+ g_prefix_error (error, "Failed to construct proxy for agent: " );
-+ return NULL;
-+ }
-
-+ agent = g_new0 (AuthenticationAgent, 1);
- agent->ref_count = 1;
- agent->scope = g_object_ref (scope);
- agent->object_path = g_strdup (object_path);
- agent->unique_system_bus_name = g_strdup (unique_system_bus_name);
- agent->locale = g_strdup (locale);
- agent->registration_options = registration_options != NULL ? g_variant_ref (registration_options) : NULL;
--
-- error = NULL;
-- agent->proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
-- G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
-- G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
-- NULL, /* GDBusInterfaceInfo* */
-- agent->unique_system_bus_name,
-- agent->object_path,
-- "org.freedesktop.PolicyKit1.AuthenticationAgent",
-- NULL, /* GCancellable* */
-- &error);
-- if (agent->proxy == NULL)
-- {
-- g_warning ("Error constructing proxy for agent: %s", error->message);
-- g_error_free (error);
-- /* TODO: Make authentication_agent_new() return NULL and set a GError */
-- }
-+ agent->proxy = proxy;
-
- return agent;
- }
-@@ -2234,8 +2240,6 @@ polkit_backend_interactive_authority_register_authentication_agent (PolkitBacken
- caller_cmdline = NULL;
- agent = NULL;
-
-- /* TODO: validate that object path is well-formed */
--
- interactive_authority = POLKIT_BACKEND_INTERACTIVE_AUTHORITY (authority);
- priv = POLKIT_BACKEND_INTERACTIVE_AUTHORITY_GET_PRIVATE (interactive_authority);
-
-@@ -2322,7 +2326,10 @@ polkit_backend_interactive_authority_register_authentication_agent (PolkitBacken
- polkit_system_bus_name_get_name (POLKIT_SYSTEM_BUS_NAME (caller)),
- locale,
- object_path,
-- options);
-+ options,
-+ error);
-+ if (!agent)
-+ goto out;
-
- g_hash_table_insert (priv->hash_scope_to_authentication_agent,
- g_object_ref (subject),
diff --git a/patches/polkit-0.105/0022-0.113-sessionmonitor-systemd-Use-sd_uid_get_state-to.patch b/patches/polkit-0.105/0022-0.113-sessionmonitor-systemd-Use-sd_uid_get_state-to.patch
deleted file mode 100644
index 6f10b2954..000000000
--- a/patches/polkit-0.105/0022-0.113-sessionmonitor-systemd-Use-sd_uid_get_state-to.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From: Philip Withnall <philip.withnall@collabora.co.uk>
-Date: Tue, 2 Jun 2015 16:19:51 +0100
-Subject: [PATCH] 0.113: sessionmonitor-systemd: Use sd_uid_get_state() to
- check session activity
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Instead of using sd_pid_get_session() then sd_session_is_active() to
-determine whether the user is active, use sd_uid_get_state() directly.
-This gets the maximum of the states of all the user’s sessions, rather
-than the state of the session containing the subject process. Since the
-user is the security boundary, this is fine.
-
-This change is necessary for `systemd --user` sessions, where most user
-code will be forked off user@.service, rather than running inside the
-logind session (whether that be a foreground/active or background/online
-session).
-
-Policy-wise, the change is from checking whether the subject process is
-in an active session; to checking whether the subject process is owned
-by a user with at least one active session.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=76358
-Applied-upstream: 0.113, commit:a29653ffa99e0809e15aa34afcd7b2df8593871c
-Bug-Debian: https://bugs.debian.org/779988
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- .../polkitbackendsessionmonitor-systemd.c | 33 ++++++++++++++++++-
- 1 file changed, 32 insertions(+), 1 deletion(-)
-
-diff --git a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-index ebd05cea45dc..6bd517abb169 100644
---- a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-+++ b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-@@ -391,6 +391,37 @@ gboolean
- polkit_backend_session_monitor_is_session_active (PolkitBackendSessionMonitor *monitor,
- PolkitSubject *session)
- {
-- return sd_session_is_active (polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (session)));
-+ const char *session_id;
-+ char *state;
-+ uid_t uid;
-+ gboolean is_active = FALSE;
-+
-+ session_id = polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (session));
-+
-+ g_debug ("Checking whether session %s is active.", session_id);
-+
-+ /* Check whether *any* of the user's current sessions are active. */
-+ if (sd_session_get_uid (session_id, &uid) < 0)
-+ goto fallback;
-+
-+ g_debug ("Session %s has UID %u.", session_id, uid);
-+
-+ if (sd_uid_get_state (uid, &state) < 0)
-+ goto fallback;
-+
-+ g_debug ("UID %u has state %s.", uid, state);
-+
-+ is_active = (g_strcmp0 (state, "active") == 0);
-+ free (state);
-+
-+ return is_active;
-+
-+fallback:
-+ /* Fall back to checking the session. This is not ideal, since the user
-+ * might have multiple sessions, and we cannot guarantee to have chosen
-+ * the active one.
-+ *
-+ * See: https://bugs.freedesktop.org/show_bug.cgi?id=76358. */
-+ return sd_session_is_active (session_id);
- }
-
diff --git a/patches/polkit-0.105/0023-0.113-Fix-a-possible-NULL-dereference.patch b/patches/polkit-0.105/0023-0.113-Fix-a-possible-NULL-dereference.patch
deleted file mode 100644
index 5bcc45010..000000000
--- a/patches/polkit-0.105/0023-0.113-Fix-a-possible-NULL-dereference.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Wed, 11 Jun 2014 22:36:50 +0200
-Subject: [PATCH] 0.113: Fix a possible NULL dereference.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-polkit_backend_session_monitor_get_user_for_subject() may return NULL
-(and because it is using external processes, we can’t really rule it
-out). The code was already anticipating NULL in the cleanup section, so
-handle it also when actually using the value.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80767
-Origin: upstream, 0.113, commit:6109543303def367b84eaac97d2ff9cefe735efb
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitbackend/polkitbackendinteractiveauthority.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
-index 25e13fb0907e..00ee0446445f 100644
---- a/src/polkitbackend/polkitbackendinteractiveauthority.c
-+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -557,7 +557,11 @@ log_result (PolkitBackendInteractiveAuthority *authority,
- user_of_subject = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, subject, NULL);
-
- subject_str = polkit_subject_to_string (subject);
-- user_of_subject_str = polkit_identity_to_string (user_of_subject);
-+
-+ if (user_of_subject != NULL)
-+ user_of_subject_str = polkit_identity_to_string (user_of_subject);
-+ else
-+ user_of_subject_str = g_strdup ("<unknown>");
- caller_str = polkit_subject_to_string (caller);
-
- subject_cmdline = _polkit_subject_get_cmdline (subject);
diff --git a/patches/polkit-0.105/0024-0.113-Remove-a-redundant-assignment.patch b/patches/polkit-0.105/0024-0.113-Remove-a-redundant-assignment.patch
deleted file mode 100644
index aab9d157d..000000000
--- a/patches/polkit-0.105/0024-0.113-Remove-a-redundant-assignment.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Wed, 11 Jun 2014 22:44:28 +0200
-Subject: [PATCH] 0.113: Remove a redundant assignment.
-
-Instead of a nonsensical (data = data), use the more customary
-((void)data) to silence the warning about an unused parameter.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80767
-Origin: upstream, 0.113, commit:37143eb06cb0c4dffca67079dd1c10c5b191b6a7
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitagent/polkitagenthelper-pam.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/polkitagent/polkitagenthelper-pam.c b/src/polkitagent/polkitagenthelper-pam.c
-index 292abbe44e88..937386e8f1d3 100644
---- a/src/polkitagent/polkitagenthelper-pam.c
-+++ b/src/polkitagent/polkitagenthelper-pam.c
-@@ -230,7 +230,7 @@ conversation_function (int n, const struct pam_message **msg, struct pam_respons
- gchar *tmp = NULL;
- size_t len;
-
-- data = data;
-+ (void)data;
- if (n <= 0 || n > PAM_MAX_NUM_MSG)
- return PAM_CONV_ERR;
-
diff --git a/patches/polkit-0.105/0025-0.113-Fix-duplicate-GError-use-when-uid-is-missing.patch b/patches/polkit-0.105/0025-0.113-Fix-duplicate-GError-use-when-uid-is-missing.patch
deleted file mode 100644
index eca000906..000000000
--- a/patches/polkit-0.105/0025-0.113-Fix-duplicate-GError-use-when-uid-is-missing.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Mon, 15 Sep 2014 19:45:15 +0200
-Subject: [PATCH] 0.113: Fix duplicate GError use when "uid" is missing
-
-Some GLib versions complain loudly about this.
-
-To reproduce, call e.g. RegisterAuthenticationAgent with the following
-parameters:
-("unix-process", {"pid": __import__('gi.repository.GLib', globals(),
-locals(), ['Variant']).Variant("u", 1), "start-time":
-__import__('gi.repository.GLib', globals(), locals(),
-['Variant']).Variant("t", 1)}), "cs", "/"
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90877
-Origin: upstream, 0.113, commit:2c8738941be18ef05ce724df46547f41dbc02fb5
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitsubject.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/polkit/polkitsubject.c b/src/polkit/polkitsubject.c
-index aed57951bb6b..78ec745a4df2 100644
---- a/src/polkit/polkitsubject.c
-+++ b/src/polkit/polkitsubject.c
-@@ -424,7 +424,7 @@ polkit_subject_new_for_gvariant (GVariant *variant,
- start_time = g_variant_get_uint64 (v);
- g_variant_unref (v);
-
-- v = lookup_asv (details_gvariant, "uid", G_VARIANT_TYPE_INT32, error);
-+ v = lookup_asv (details_gvariant, "uid", G_VARIANT_TYPE_INT32, NULL);
- if (v != NULL)
- {
- uid = g_variant_get_int32 (v);
diff --git a/patches/polkit-0.105/0026-0.113-Fix-a-crash-when-two-authentication-requests-a.patch b/patches/polkit-0.105/0026-0.113-Fix-a-crash-when-two-authentication-requests-a.patch
deleted file mode 100644
index 46dd4293d..000000000
--- a/patches/polkit-0.105/0026-0.113-Fix-a-crash-when-two-authentication-requests-a.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Sat, 6 Jun 2015 01:07:08 +0200
-Subject: [PATCH] 0.113: Fix a crash when two authentication requests are in
- flight.
-
-To reproduce:
-1. pkttyagent -p $$ # or another suitable PID
-2. pkcheck -p $that_pid -a org.freedesktop.policykit.exec -u
-3. pkcheck -p $that_pid -a org.freedesktop.policykit.exec -u
-4. Then, in the pkttyagent prompt, press Enter.
-
-polkit_agent_text_listener_initiate_authentication was already setting
-an appropriate error code, so the g_assert was unnecessary.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90879
-Origin: upstream, 0.113, commit:e2d2fafd106624ddfea4b17d3f40704b2031c00b
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitagent/polkitagenttextlistener.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/src/polkitagent/polkitagenttextlistener.c b/src/polkitagent/polkitagenttextlistener.c
-index b5c8a3f370e1..e63c2853cfe5 100644
---- a/src/polkitagent/polkitagenttextlistener.c
-+++ b/src/polkitagent/polkitagenttextlistener.c
-@@ -546,12 +546,10 @@ polkit_agent_text_listener_initiate_authentication_finish (PolkitAgentListener
- GAsyncResult *res,
- GError **error)
- {
-- PolkitAgentTextListener *listener = POLKIT_AGENT_TEXT_LISTENER (_listener);
- gboolean ret;
-
- g_warn_if_fail (g_simple_async_result_get_source_tag (G_SIMPLE_ASYNC_RESULT (res)) ==
- polkit_agent_text_listener_initiate_authentication);
-- g_assert (listener->active_session == NULL);
-
- ret = FALSE;
-
diff --git a/patches/polkit-0.105/0027-0.113-CVE-2015-4625-Use-unpredictable-cookie-values-.patch b/patches/polkit-0.105/0027-0.113-CVE-2015-4625-Use-unpredictable-cookie-values-.patch
deleted file mode 100644
index 612bc4ef7..000000000
--- a/patches/polkit-0.105/0027-0.113-CVE-2015-4625-Use-unpredictable-cookie-values-.patch
+++ /dev/null
@@ -1,545 +0,0 @@
-From: Colin Walters <walters@redhat.com>
-Date: Thu, 4 Jun 2015 12:15:18 -0400
-Subject: [PATCH] 0.113: CVE-2015-4625: Use unpredictable cookie values, keep
- them secret
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Tavis noted that it'd be possible with a 32 bit counter for someone to
-cause the cookie to wrap by creating Authentication requests in a
-loop.
-
-Something important to note here is that wrapping of signed integers
-is undefined behavior in C, so we definitely want to fix that. All
-counter integers used in this patch are unsigned.
-
-See the comment above `authentication_agent_generate_cookie` for
-details, but basically we're now using a cookie of the form:
-
-```
- <agent serial> - <agent random id> - <session serial> - <session
-random id>
-```
-
-Which has multiple 64 bit counters, plus unpredictable random 128 bit
-integer ids (effectively UUIDs, but we're not calling them that
-because we don't need to be globally unique.
-
-We further ensure that the cookies are not visible to other processes
-by changing the setuid helper to accept them over standard input. This
-means that an attacker would have to guess both ids.
-
-In any case, the security hole here is better fixed with the other
-change to bind user id (uid) of the agent with cookie lookups, making
-cookie guessing worthless.
-
-Nevertheless, I think it's worth doing this change too, for defense in
-depth.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90832
-CVE: CVE-2015-4625
-Reported-by: Tavis Ormandy <taviso@google.com>
-Reviewed-by: Miloslav Trmač <mitr@redhat.com>
-Signed-off-by: Colin Walters <walters@redhat.com>
-Origin: upstream, 0.113, commit:ea544ffc18405237ccd95d28d7f45afef49aca17
-Bug-Debian: https://bugs.debian.org/796134
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure.ac | 2 +-
- src/polkitagent/polkitagenthelper-pam.c | 12 ++-
- src/polkitagent/polkitagenthelper-shadow.c | 12 ++-
- src/polkitagent/polkitagenthelperprivate.c | 33 +++++++
- src/polkitagent/polkitagenthelperprivate.h | 2 +
- src/polkitagent/polkitagentsession.c | 30 +++---
- .../polkitbackendinteractiveauthority.c | 99 +++++++++++++++----
- 7 files changed, 150 insertions(+), 40 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index aa2760f90606..388605d2cb08 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -123,7 +123,7 @@ if test "x$GCC" = "xyes"; then
- changequote([,])dnl
- fi
-
--PKG_CHECK_MODULES(GLIB, [gio-2.0 >= 2.28.0])
-+PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
- AC_SUBST(GLIB_CFLAGS)
- AC_SUBST(GLIB_LIBS)
-
-diff --git a/src/polkitagent/polkitagenthelper-pam.c b/src/polkitagent/polkitagenthelper-pam.c
-index 937386e8f1d3..19062aa8d0da 100644
---- a/src/polkitagent/polkitagenthelper-pam.c
-+++ b/src/polkitagent/polkitagenthelper-pam.c
-@@ -65,7 +65,7 @@ main (int argc, char *argv[])
- {
- int rc;
- const char *user_to_auth;
-- const char *cookie;
-+ char *cookie = NULL;
- struct pam_conv pam_conversation;
- pam_handle_t *pam_h;
- const void *authed_user;
-@@ -97,7 +97,7 @@ main (int argc, char *argv[])
- openlog ("polkit-agent-helper-1", LOG_CONS | LOG_PID, LOG_AUTHPRIV);
-
- /* check for correct invocation */
-- if (argc != 3)
-+ if (!(argc == 2 || argc == 3))
- {
- syslog (LOG_NOTICE, "inappropriate use of helper, wrong number of arguments [uid=%d]", getuid ());
- fprintf (stderr, "polkit-agent-helper-1: wrong number of arguments. This incident has been logged.\n");
-@@ -105,7 +105,10 @@ main (int argc, char *argv[])
- }
-
- user_to_auth = argv[1];
-- cookie = argv[2];
-+
-+ cookie = read_cookie (argc, argv);
-+ if (!cookie)
-+ goto error;
-
- if (getuid () != 0)
- {
-@@ -203,6 +206,8 @@ main (int argc, char *argv[])
- goto error;
- }
-
-+ free (cookie);
-+
- #ifdef PAH_DEBUG
- fprintf (stderr, "polkit-agent-helper-1: successfully sent D-Bus message to PolicyKit daemon\n");
- #endif /* PAH_DEBUG */
-@@ -212,6 +217,7 @@ main (int argc, char *argv[])
- return 0;
-
- error:
-+ free (cookie);
- if (pam_h != NULL)
- pam_end (pam_h, rc);
-
-diff --git a/src/polkitagent/polkitagenthelper-shadow.c b/src/polkitagent/polkitagenthelper-shadow.c
-index a4f73acff3a9..e87791541a9c 100644
---- a/src/polkitagent/polkitagenthelper-shadow.c
-+++ b/src/polkitagent/polkitagenthelper-shadow.c
-@@ -46,7 +46,7 @@ main (int argc, char *argv[])
- {
- struct spwd *shadow;
- const char *user_to_auth;
-- const char *cookie;
-+ char *cookie = NULL;
- time_t now;
-
- /* clear the entire environment to avoid attacks with
-@@ -67,7 +67,7 @@ main (int argc, char *argv[])
- openlog ("polkit-agent-helper-1", LOG_CONS | LOG_PID, LOG_AUTHPRIV);
-
- /* check for correct invocation */
-- if (argc != 3)
-+ if (!(argc == 2 || argc == 3))
- {
- syslog (LOG_NOTICE, "inappropriate use of helper, wrong number of arguments [uid=%d]", getuid ());
- fprintf (stderr, "polkit-agent-helper-1: wrong number of arguments. This incident has been logged.\n");
-@@ -86,7 +86,10 @@ main (int argc, char *argv[])
- }
-
- user_to_auth = argv[1];
-- cookie = argv[2];
-+
-+ cookie = read_cookie (argc, argv);
-+ if (!cookie)
-+ goto error;
-
- #ifdef PAH_DEBUG
- fprintf (stderr, "polkit-agent-helper-1: user to auth is '%s'.\n", user_to_auth);
-@@ -153,6 +156,8 @@ main (int argc, char *argv[])
- goto error;
- }
-
-+ free (cookie);
-+
- #ifdef PAH_DEBUG
- fprintf (stderr, "polkit-agent-helper-1: successfully sent D-Bus message to PolicyKit daemon\n");
- #endif /* PAH_DEBUG */
-@@ -162,6 +167,7 @@ main (int argc, char *argv[])
- return 0;
-
- error:
-+ free (cookie);
- fprintf (stdout, "FAILURE\n");
- flush_and_wait ();
- return 1;
-diff --git a/src/polkitagent/polkitagenthelperprivate.c b/src/polkitagent/polkitagenthelperprivate.c
-index 4417e70f6ef7..a99de7dd5c16 100644
---- a/src/polkitagent/polkitagenthelperprivate.c
-+++ b/src/polkitagent/polkitagenthelperprivate.c
-@@ -23,6 +23,7 @@
- #include "config.h"
- #include "polkitagenthelperprivate.h"
- #include <stdio.h>
-+#include <string.h>
- #include <stdlib.h>
- #include <unistd.h>
-
-@@ -45,6 +46,38 @@ _polkit_clearenv (void)
- #endif
-
-
-+char *
-+read_cookie (int argc, char **argv)
-+{
-+ /* As part of CVE-2015-4625, we started passing the cookie
-+ * on standard input, to ensure it's not visible to other
-+ * processes. However, to ensure that things continue
-+ * to work if the setuid binary is upgraded while old
-+ * agents are still running (this will be common with
-+ * package managers), we support both modes.
-+ */
-+ if (argc == 3)
-+ return strdup (argv[2]);
-+ else
-+ {
-+ char *ret = NULL;
-+ size_t n = 0;
-+ ssize_t r = getline (&ret, &n, stdin);
-+ if (r == -1)
-+ {
-+ if (!feof (stdin))
-+ perror ("getline");
-+ free (ret);
-+ return NULL;
-+ }
-+ else
-+ {
-+ g_strchomp (ret);
-+ return ret;
-+ }
-+ }
-+}
-+
- gboolean
- send_dbus_message (const char *cookie, const char *user)
- {
-diff --git a/src/polkitagent/polkitagenthelperprivate.h b/src/polkitagent/polkitagenthelperprivate.h
-index aeca2c74d44a..547fdccfd2e2 100644
---- a/src/polkitagent/polkitagenthelperprivate.h
-+++ b/src/polkitagent/polkitagenthelperprivate.h
-@@ -38,6 +38,8 @@
-
- int _polkit_clearenv (void);
-
-+char *read_cookie (int argc, char **argv);
-+
- gboolean send_dbus_message (const char *cookie, const char *user);
-
- void flush_and_wait ();
-diff --git a/src/polkitagent/polkitagentsession.c b/src/polkitagent/polkitagentsession.c
-index a658a2295da7..6a3d6bc94c49 100644
---- a/src/polkitagent/polkitagentsession.c
-+++ b/src/polkitagent/polkitagentsession.c
-@@ -55,6 +55,7 @@
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/wait.h>
-+#include <gio/gunixoutputstream.h>
- #include <pwd.h>
-
- #include "polkitagentmarshal.h"
-@@ -88,7 +89,7 @@ struct _PolkitAgentSession
- gchar *cookie;
- PolkitIdentity *identity;
-
-- int child_stdin;
-+ GOutputStream *child_stdin;
- int child_stdout;
- GPid child_pid;
-
-@@ -129,7 +130,6 @@ G_DEFINE_TYPE (PolkitAgentSession, polkit_agent_session, G_TYPE_OBJECT);
- static void
- polkit_agent_session_init (PolkitAgentSession *session)
- {
-- session->child_stdin = -1;
- session->child_stdout = -1;
- }
-
-@@ -395,11 +395,7 @@ kill_helper (PolkitAgentSession *session)
- session->child_stdout = -1;
- }
-
-- if (session->child_stdin != -1)
-- {
-- g_warn_if_fail (close (session->child_stdin) == 0);
-- session->child_stdin = -1;
-- }
-+ g_clear_object (&session->child_stdin);
-
- session->helper_is_running = FALSE;
-
-@@ -545,9 +541,9 @@ polkit_agent_session_response (PolkitAgentSession *session,
-
- add_newline = (response[response_len] != '\n');
-
-- write (session->child_stdin, response, response_len);
-+ (void) g_output_stream_write_all (session->child_stdin, response, response_len, NULL, NULL, NULL);
- if (add_newline)
-- write (session->child_stdin, newline, 1);
-+ (void) g_output_stream_write_all (session->child_stdin, newline, 1, NULL, NULL, NULL);
- }
-
- /**
-@@ -567,8 +563,9 @@ polkit_agent_session_initiate (PolkitAgentSession *session)
- {
- uid_t uid;
- GError *error;
-- gchar *helper_argv[4];
-+ gchar *helper_argv[3];
- struct passwd *passwd;
-+ int stdin_fd = -1;
-
- g_return_if_fail (POLKIT_AGENT_IS_SESSION (session));
-
-@@ -600,10 +597,8 @@ polkit_agent_session_initiate (PolkitAgentSession *session)
-
- helper_argv[0] = PACKAGE_LIBEXEC_DIR "/polkit-agent-helper-1";
- helper_argv[1] = passwd->pw_name;
-- helper_argv[2] = session->cookie;
-- helper_argv[3] = NULL;
-+ helper_argv[2] = NULL;
-
-- session->child_stdin = -1;
- session->child_stdout = -1;
-
- error = NULL;
-@@ -615,7 +610,7 @@ polkit_agent_session_initiate (PolkitAgentSession *session)
- NULL,
- NULL,
- &session->child_pid,
-- &session->child_stdin,
-+ &stdin_fd,
- &session->child_stdout,
- NULL,
- &error))
-@@ -628,6 +623,13 @@ polkit_agent_session_initiate (PolkitAgentSession *session)
- if (G_UNLIKELY (_show_debug ()))
- g_print ("PolkitAgentSession: spawned helper with pid %d\n", (gint) session->child_pid);
-
-+ session->child_stdin = (GOutputStream*)g_unix_output_stream_new (stdin_fd, TRUE);
-+
-+ /* Write the cookie on stdin so it can't be seen by other processes */
-+ (void) g_output_stream_write_all (session->child_stdin, session->cookie, strlen (session->cookie),
-+ NULL, NULL, NULL);
-+ (void) g_output_stream_write_all (session->child_stdin, "\n", 1, NULL, NULL, NULL);
-+
- session->child_stdout_channel = g_io_channel_unix_new (session->child_stdout);
- session->child_stdout_watch_source = g_io_create_watch (session->child_stdout_channel,
- G_IO_IN | G_IO_ERR | G_IO_HUP);
-diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
-index 00ee0446445f..10eda2c7fb36 100644
---- a/src/polkitbackend/polkitbackendinteractiveauthority.c
-+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -212,6 +212,8 @@ typedef struct
-
- GDBusConnection *system_bus_connection;
- guint name_owner_changed_signal_id;
-+
-+ guint64 agent_serial;
- } PolkitBackendInteractiveAuthorityPrivate;
-
- /* ---------------------------------------------------------------------------------------------------- */
-@@ -430,11 +432,15 @@ struct AuthenticationAgent
- volatile gint ref_count;
-
- PolkitSubject *scope;
-+ guint64 serial;
-
- gchar *locale;
- GVariant *registration_options;
- gchar *object_path;
- gchar *unique_system_bus_name;
-+ GRand *cookie_pool;
-+ gchar *cookie_prefix;
-+ guint64 cookie_serial;
-
- GDBusProxy *proxy;
-
-@@ -1430,9 +1436,54 @@ authentication_session_cancelled_cb (GCancellable *cancellable,
- authentication_session_cancel (session);
- }
-
-+/* We're not calling this a UUID, but it's basically
-+ * the same thing, just not formatted that way because:
-+ *
-+ * - I'm too lazy to do it
-+ * - If we did, people might think it was actually
-+ * generated from /dev/random, which we're not doing
-+ * because this value doesn't actually need to be
-+ * globally unique.
-+ */
-+static void
-+append_rand_u128_str (GString *buf,
-+ GRand *pool)
-+{
-+ g_string_append_printf (buf, "%08x%08x%08x%08x",
-+ g_rand_int (pool),
-+ g_rand_int (pool),
-+ g_rand_int (pool),
-+ g_rand_int (pool));
-+}
-+
-+/* A value that should be unique to the (AuthenticationAgent, AuthenticationSession)
-+ * pair, and not guessable by other agents.
-+ *
-+ * <agent serial> - <agent uuid> - <session serial> - <session uuid>
-+ *
-+ * See http://lists.freedesktop.org/archives/polkit-devel/2015-June/000425.html
-+ *
-+ */
-+static gchar *
-+authentication_agent_generate_cookie (AuthenticationAgent *agent)
-+{
-+ GString *buf = g_string_new ("");
-+
-+ g_string_append (buf, agent->cookie_prefix);
-+
-+ g_string_append_c (buf, '-');
-+ agent->cookie_serial++;
-+ g_string_append_printf (buf, "%" G_GUINT64_FORMAT,
-+ agent->cookie_serial);
-+ g_string_append_c (buf, '-');
-+ append_rand_u128_str (buf, agent->cookie_pool);
-+
-+ return g_string_free (buf, FALSE);
-+}
-+
-+
- static AuthenticationSession *
- authentication_session_new (AuthenticationAgent *agent,
-- const gchar *cookie,
- PolkitSubject *subject,
- PolkitIdentity *user_of_subject,
- PolkitSubject *caller,
-@@ -1449,7 +1500,7 @@ authentication_session_new (AuthenticationAgent *agent,
-
- session = g_new0 (AuthenticationSession, 1);
- session->agent = authentication_agent_ref (agent);
-- session->cookie = g_strdup (cookie);
-+ session->cookie = authentication_agent_generate_cookie (agent);
- session->subject = g_object_ref (subject);
- session->user_of_subject = g_object_ref (user_of_subject);
- session->caller = g_object_ref (caller);
-@@ -1496,16 +1547,6 @@ authentication_session_free (AuthenticationSession *session)
- g_free (session);
- }
-
--static gchar *
--authentication_agent_new_cookie (AuthenticationAgent *agent)
--{
-- static gint counter = 0;
--
-- /* TODO: use a more random-looking cookie */
--
-- return g_strdup_printf ("cookie%d", counter++);
--}
--
- static PolkitSubject *
- authentication_agent_get_scope (AuthenticationAgent *agent)
- {
-@@ -1553,12 +1594,15 @@ authentication_agent_unref (AuthenticationAgent *agent)
- g_free (agent->unique_system_bus_name);
- if (agent->registration_options != NULL)
- g_variant_unref (agent->registration_options);
-+ g_rand_free (agent->cookie_pool);
-+ g_free (agent->cookie_prefix);
- g_free (agent);
- }
- }
-
- static AuthenticationAgent *
--authentication_agent_new (PolkitSubject *scope,
-+authentication_agent_new (guint64 serial,
-+ PolkitSubject *scope,
- const gchar *unique_system_bus_name,
- const gchar *locale,
- const gchar *object_path,
-@@ -1592,6 +1636,7 @@ authentication_agent_new (PolkitSubject *scope,
-
- agent = g_new0 (AuthenticationAgent, 1);
- agent->ref_count = 1;
-+ agent->serial = serial;
- agent->scope = g_object_ref (scope);
- agent->object_path = g_strdup (object_path);
- agent->unique_system_bus_name = g_strdup (unique_system_bus_name);
-@@ -1599,6 +1644,25 @@ authentication_agent_new (PolkitSubject *scope,
- agent->registration_options = registration_options != NULL ? g_variant_ref (registration_options) : NULL;
- agent->proxy = proxy;
-
-+ {
-+ GString *cookie_prefix = g_string_new ("");
-+ GRand *agent_private_rand = g_rand_new ();
-+
-+ g_string_append_printf (cookie_prefix, "%" G_GUINT64_FORMAT "-", agent->serial);
-+
-+ /* Use a uniquely seeded PRNG to get a prefix cookie for this agent,
-+ * whose sequence will not correlate with the per-authentication session
-+ * cookies.
-+ */
-+ append_rand_u128_str (cookie_prefix, agent_private_rand);
-+ g_rand_free (agent_private_rand);
-+
-+ agent->cookie_prefix = g_string_free (cookie_prefix, FALSE);
-+
-+ /* And a newly seeded pool for per-session cookies */
-+ agent->cookie_pool = g_rand_new ();
-+ }
-+
- return agent;
- }
-
-@@ -2083,7 +2147,6 @@ authentication_agent_initiate_challenge (AuthenticationAgent *agent,
- gpointer user_data)
- {
- AuthenticationSession *session;
-- gchar *cookie;
- GList *l;
- GList *identities;
- gchar *localized_message;
-@@ -2104,8 +2167,6 @@ authentication_agent_initiate_challenge (AuthenticationAgent *agent,
- &localized_icon_name,
- &localized_details);
-
-- cookie = authentication_agent_new_cookie (agent);
--
- identities = NULL;
-
- /* select admin user if required by the implicit authorization */
-@@ -2125,7 +2186,6 @@ authentication_agent_initiate_challenge (AuthenticationAgent *agent,
- }
-
- session = authentication_session_new (agent,
-- cookie,
- subject,
- user_of_subject,
- caller,
-@@ -2179,7 +2239,6 @@ authentication_agent_initiate_challenge (AuthenticationAgent *agent,
-
- g_list_foreach (identities, (GFunc) g_object_unref, NULL);
- g_list_free (identities);
-- g_free (cookie);
-
- g_free (localized_message);
- g_free (localized_icon_name);
-@@ -2326,7 +2385,9 @@ polkit_backend_interactive_authority_register_authentication_agent (PolkitBacken
- goto out;
- }
-
-- agent = authentication_agent_new (subject,
-+ priv->agent_serial++;
-+ agent = authentication_agent_new (priv->agent_serial,
-+ subject,
- polkit_system_bus_name_get_name (POLKIT_SYSTEM_BUS_NAME (caller)),
- locale,
- object_path,
diff --git a/patches/polkit-0.105/0028-0.113-CVE-2015-4625-Bind-use-of-cookies-to-specific-.patch b/patches/polkit-0.105/0028-0.113-CVE-2015-4625-Bind-use-of-cookies-to-specific-.patch
deleted file mode 100644
index 871bf9fbc..000000000
--- a/patches/polkit-0.105/0028-0.113-CVE-2015-4625-Bind-use-of-cookies-to-specific-.patch
+++ /dev/null
@@ -1,488 +0,0 @@
-From: Colin Walters <walters@redhat.com>
-Date: Wed, 17 Jun 2015 13:07:02 -0400
-Subject: [PATCH] 0.113: CVE-2015-4625: Bind use of cookies to specific uids
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-http://lists.freedesktop.org/archives/polkit-devel/2015-June/000425.html
-
-The "cookie" value that Polkit hands out is global to all polkit
-users. And when `AuthenticationAgentResponse` is invoked, we
-previously only received the cookie and *target* identity, and
-attempted to find an agent from that.
-
-The problem is that the current cookie is just an integer
-counter, and if it overflowed, it would be possible for
-an successful authorization in one session to trigger a response
-in another session.
-
-The overflow and ability to guess the cookie were fixed by the
-previous patch.
-
-This patch is conceptually further hardening on top of that. Polkit
-currently treats uids as equivalent from a security domain
-perspective; there is no support for
-SELinux/AppArmor/etc. differentiation.
-
-We can retrieve the uid from `getuid()` in the setuid helper, which
-allows us to ensure the uid invoking `AuthenticationAgentResponse2`
-matches that of the agent.
-
-Then the authority only looks at authentication sessions matching the
-cookie that were created by a matching uid, thus removing the ability
-for different uids to interfere with each other entirely.
-
-Several fixes to this patch were contributed by:
-Miloslav Trmač <mitr@redhat.com>
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90837
-CVE: CVE-2015-4625
-Reported-by: Tavis Ormandy <taviso@google.com>
-Reviewed-by: Miloslav Trmač <mitr@redhat.com>
-Signed-off-by: Colin Walters <walters@redhat.com>
-Origin: upstream, 0.113, commit:493aa5dc1d278ab9097110c1262f5229bbaf1766
-Bug-Debian: https://bugs.debian.org/796134
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- ...desktop.PolicyKit1.AuthenticationAgent.xml | 14 ++++-
- data/org.freedesktop.PolicyKit1.Authority.xml | 24 +++++++-
- ...e-org.freedesktop.PolicyKit1.Authority.xml | 46 +++++++++++++-
- docs/polkit/overview.xml | 18 +++---
- src/polkit/polkitauthority.c | 13 +++-
- src/polkitbackend/polkitbackendauthority.c | 61 ++++++++++++++++++-
- src/polkitbackend/polkitbackendauthority.h | 2 +
- .../polkitbackendinteractiveauthority.c | 39 ++++++++++--
- 8 files changed, 198 insertions(+), 19 deletions(-)
-
-diff --git a/data/org.freedesktop.PolicyKit1.AuthenticationAgent.xml b/data/org.freedesktop.PolicyKit1.AuthenticationAgent.xml
-index 3b519c2fb2c2..5beef7d4ef92 100644
---- a/data/org.freedesktop.PolicyKit1.AuthenticationAgent.xml
-+++ b/data/org.freedesktop.PolicyKit1.AuthenticationAgent.xml
-@@ -8,7 +8,19 @@
- <annotation name="org.gtk.EggDBus.DocString" value="<para>This D-Bus interface is used for communication between the system-wide PolicyKit daemon and one or more authentication agents each running in a user session.</para><para>An authentication agent must implement this interface and register (passing the object path of the object implementing the interface) using the org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent() and org.freedesktop.PolicyKit1.Authority.UnregisterAuthenticationAgent() methods on the #org.freedesktop.PolicyKit1.Authority interface of the PolicyKit daemon.</para>"/>
-
- <method name="BeginAuthentication">
-- <annotation name="org.gtk.EggDBus.DocString" value="<para>Called by the PolicyKit daemon when the authentication agent needs the user to authenticate as one of the identities in @identities for the action with the identifier @action_id.</para><para>Upon succesful authentication, the authentication agent must invoke the org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse() method on the #org.freedesktop.PolicyKit1.Authority interface of the PolicyKit daemon before returning.</para><para>If the user dismisses the authentication dialog, the authentication agent should return an error.</para>"/>
-+ <annotation name="org.gtk.EggDBus.DocString" value="<para>Called
-+ by the PolicyKit daemon when the authentication agent needs the
-+ user to authenticate as one of the identities in @identities for
-+ the action with the identifier @action_id.</para><para>This
-+ authentication is normally achieved via the
-+ polkit_agent_session_response() API, which invokes a private
-+ setuid helper process to verify the authentication. When
-+ successful, it calls the
-+ org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse2()
-+ method on the #org.freedesktop.PolicyKit1.Authority interface of
-+ the PolicyKit daemon before returning. If the user dismisses the
-+ authentication dialog, the authentication agent should call
-+ polkit_agent_session_cancel().</para>"/>
-
- <arg name="action_id" direction="in" type="s">
- <annotation name="org.gtk.EggDBus.DocString" value="The identifier for the action that the user is authentication for."/>
-diff --git a/data/org.freedesktop.PolicyKit1.Authority.xml b/data/org.freedesktop.PolicyKit1.Authority.xml
-index fbfb9cdcfbad..f9021ee2e7c8 100644
---- a/data/org.freedesktop.PolicyKit1.Authority.xml
-+++ b/data/org.freedesktop.PolicyKit1.Authority.xml
-@@ -313,7 +313,29 @@
- </method>
-
- <method name="AuthenticationAgentResponse">
-- <annotation name="org.gtk.EggDBus.DocString" value="Method for authentication agents to invoke on successful authentication. This method will fail unless a sufficiently privileged caller invokes it."/>
-+ <annotation name="org.gtk.EggDBus.DocString" value="Method for authentication agents to invoke on successful
-+authentication, intended only for use by a privileged helper process
-+internal to polkit."/>
-+
-+ <arg name="cookie" direction="in" type="s">
-+ <annotation name="org.gtk.EggDBus.DocString" value="The cookie identifying the authentication request that was passed to the authentication agent."/>
-+ </arg>
-+
-+ <arg name="identity" direction="in" type="(sa{sv})">
-+ <annotation name="org.gtk.EggDBus.Type" value="Identity"/>
-+ <annotation name="org.gtk.EggDBus.DocString" value="A #Identity struct describing what identity was authenticated."/>
-+ </arg>
-+ </method>
-+
-+ <method name="AuthenticationAgentResponse2">
-+ <annotation name="org.gtk.EggDBus.DocString" value="Method for authentication agents to invoke on successful
-+authentication, intended only for use by a privileged helper process
-+internal to polkit. Note this method was added in 0.114, and should be preferred over AuthenticationAgentResponse
-+as it fixes a security issue."/>
-+
-+ <arg name="uid" direction="in" type="u">
-+ <annotation name="org.gtk.EggDBus.DocString" value="The real uid of the agent. Normally set by the setuid helper program."/>
-+ </arg>
-
- <arg name="cookie" direction="in" type="s">
- <annotation name="org.gtk.EggDBus.DocString" value="The cookie identifying the authentication request that was passed to the authentication agent."/>
-diff --git a/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.xml b/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.xml
-index 6525e250acc2..e66bf5349c61 100644
---- a/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.xml
-+++ b/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.xml
-@@ -42,6 +42,8 @@ Structure <link linkend="eggdbus-struct-TemporaryAuthorization">TemporaryAuth
- IN String object_path)
- <link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse">AuthenticationAgentResponse</link> (IN String cookie,
- IN <link linkend="eggdbus-struct-Identity">Identity</link> identity)
-+<link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse">AuthenticationAgentResponse2</link> (IN uint32 uid, IN String cookie,
-+ IN <link linkend="eggdbus-struct-Identity">Identity</link> identity)
- <link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.EnumerateTemporaryAuthorizations">EnumerateTemporaryAuthorizations</link> (IN <link linkend="eggdbus-struct-Subject">Subject</link> subject,
- OUT Array&lt;<link linkend="eggdbus-struct-TemporaryAuthorization">TemporaryAuthorization</link>&gt; temporary_authorizations)
- <link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.RevokeTemporaryAuthorizations">RevokeTemporaryAuthorizations</link> (IN <link linkend="eggdbus-struct-Subject">Subject</link> subject)
-@@ -777,9 +779,51 @@ AuthenticationAgentResponse (IN String cookie,
- IN <link linkend="eggdbus-struct-Identity">Identity</link> identity)
- </programlisting>
- <para>
--Method for authentication agents to invoke on successful authentication. This method will fail unless a sufficiently privileged caller invokes it.
-+Method for authentication agents to invoke on successful
-+authentication, intended only for use by a privileged helper process
-+internal to polkit. Deprecated in favor of AuthenticationAgentResponse2.
-+ </para>
-+<variablelist role="params">
-+ <varlistentry>
-+ <term><literal>IN String <parameter>cookie</parameter></literal>:</term>
-+ <listitem>
-+ <para>
-+The cookie identifying the authentication request that was passed to the authentication agent.
-+ </para>
-+ </listitem>
-+ </varlistentry>
-+ <varlistentry>
-+ <term><literal>IN <link linkend="eggdbus-struct-Identity">Identity</link> <parameter>identity</parameter></literal>:</term>
-+ <listitem>
-+ <para>
-+A <link linkend="eggdbus-struct-Identity">Identity</link> struct describing what identity was authenticated.
-+ </para>
-+ </listitem>
-+ </varlistentry>
-+</variablelist>
-+ </refsect2>
-+ <refsect2 role="function" id="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse2">
-+ <title>AuthenticationAgentResponse2 ()</title>
-+ <programlisting>
-+AuthenticationAgentResponse2 (IN uint32 uid,
-+ IN String cookie,
-+ IN <link linkend="eggdbus-struct-Identity">Identity</link> identity)
-+ </programlisting>
-+ <para>
-+Method for authentication agents to invoke on successful
-+authentication, intended only for use by a privileged helper process
-+internal to polkit. Note this method was introduced in 0.114 to fix a security issue.
- </para>
- <variablelist role="params">
-+ <varlistentry>
-+ <term><literal>IN uint32 <parameter>uid</parameter></literal>:</term>
-+ <listitem>
-+ <para>
-+The user id of the agent; normally this is the owner of the parent pid
-+of the process that invoked the internal setuid helper.
-+ </para>
-+ </listitem>
-+ </varlistentry>
- <varlistentry>
- <term><literal>IN String <parameter>cookie</parameter></literal>:</term>
- <listitem>
-diff --git a/docs/polkit/overview.xml b/docs/polkit/overview.xml
-index 24440d2ed03d..c29d8da242c6 100644
---- a/docs/polkit/overview.xml
-+++ b/docs/polkit/overview.xml
-@@ -66,16 +66,18 @@
- <para>
- Authentication agents are provided by desktop environments. When
- an user session starts, the agent registers with the polkit
-- Authority using
-- the <link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent">RegisterAuthenticationAgent()</link>
-+ Authority using the <link
-+ linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent">RegisterAuthenticationAgent()</link>
- method. When services are needed, the authority will invoke
-- methods on
-- the <link linkend="eggdbus-interface-org.freedesktop.PolicyKit1.AuthenticationAgent">org.freedesktop.PolicyKit1.AuthenticationAgent</link>
-+ methods on the <link
-+ linkend="eggdbus-interface-org.freedesktop.PolicyKit1.AuthenticationAgent">org.freedesktop.PolicyKit1.AuthenticationAgent</link>
- D-Bus interface. Once the user is authenticated, (a privileged
-- part of) the agent invokes
-- the <link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse">AuthenticationAgentResponse()</link>
-- method. Note that the polkit Authority itself does not care
-- how the agent authenticates the user.
-+ part of) the agent invokes the <link
-+ linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse">AuthenticationAgentResponse()</link>
-+ method. This method should be treated as an internal
-+ implementation detail, and callers should use the public shared
-+ library API to invoke it, which currently uses a setuid helper
-+ program.
- </para>
- <para>
- The <link linkend="ref-authentication-agent-api">libpolkit-agent-1</link>
-diff --git a/src/polkit/polkitauthority.c b/src/polkit/polkitauthority.c
-index 84dab72c6f0f..f45abc4ad946 100644
---- a/src/polkit/polkitauthority.c
-+++ b/src/polkit/polkitauthority.c
-@@ -1492,6 +1492,14 @@ polkit_authority_authentication_agent_response (PolkitAuthority *authority,
- gpointer user_data)
- {
- GVariant *identity_value;
-+ /* Note that in reality, this API is only accessible to root, and
-+ * only called from the setuid helper `polkit-agent-helper-1`.
-+ *
-+ * However, because this is currently public API, we avoid
-+ * triggering warnings from ABI diff type programs by just grabbing
-+ * the real uid of the caller here.
-+ */
-+ uid_t uid = getuid ();
-
- g_return_if_fail (POLKIT_IS_AUTHORITY (authority));
- g_return_if_fail (cookie != NULL);
-@@ -1501,8 +1509,9 @@ polkit_authority_authentication_agent_response (PolkitAuthority *authority,
- identity_value = polkit_identity_to_gvariant (identity);
- g_variant_ref_sink (identity_value);
- g_dbus_proxy_call (authority->proxy,
-- "AuthenticationAgentResponse",
-- g_variant_new ("(s@(sa{sv}))",
-+ "AuthenticationAgentResponse2",
-+ g_variant_new ("(us@(sa{sv}))",
-+ (guint32)uid,
- cookie,
- identity_value),
- G_DBUS_CALL_FLAGS_NONE,
-diff --git a/src/polkitbackend/polkitbackendauthority.c b/src/polkitbackend/polkitbackendauthority.c
-index fd4f161c3a61..d1b1a257e435 100644
---- a/src/polkitbackend/polkitbackendauthority.c
-+++ b/src/polkitbackend/polkitbackendauthority.c
-@@ -355,6 +355,7 @@ polkit_backend_authority_unregister_authentication_agent (PolkitBackendAuthority
- gboolean
- polkit_backend_authority_authentication_agent_response (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
-+ uid_t uid,
- const gchar *cookie,
- PolkitIdentity *identity,
- GError **error)
-@@ -373,7 +374,7 @@ polkit_backend_authority_authentication_agent_response (PolkitBackendAuthority
- }
- else
- {
-- return klass->authentication_agent_response (authority, caller, cookie, identity, error);
-+ return klass->authentication_agent_response (authority, caller, uid, cookie, identity, error);
- }
- }
-
-@@ -587,6 +588,11 @@ static const gchar *server_introspection_data =
- " <arg type='s' name='cookie' direction='in'/>"
- " <arg type='(sa{sv})' name='identity' direction='in'/>"
- " </method>"
-+ " <method name='AuthenticationAgentResponse2'>"
-+ " <arg type='u' name='uid' direction='in'/>"
-+ " <arg type='s' name='cookie' direction='in'/>"
-+ " <arg type='(sa{sv})' name='identity' direction='in'/>"
-+ " </method>"
- " <method name='EnumerateTemporaryAuthorizations'>"
- " <arg type='(sa{sv})' name='subject' direction='in'/>"
- " <arg type='a(ss(sa{sv})tt)' name='temporary_authorizations' direction='out'/>"
-@@ -1035,6 +1041,57 @@ server_handle_authentication_agent_response (Server *server,
- error = NULL;
- if (!polkit_backend_authority_authentication_agent_response (server->authority,
- caller,
-+ (uid_t)-1,
-+ cookie,
-+ identity,
-+ &error))
-+ {
-+ g_dbus_method_invocation_return_gerror (invocation, error);
-+ g_error_free (error);
-+ goto out;
-+ }
-+
-+ g_dbus_method_invocation_return_value (invocation, g_variant_new ("()"));
-+
-+ out:
-+ if (identity != NULL)
-+ g_object_unref (identity);
-+}
-+
-+static void
-+server_handle_authentication_agent_response2 (Server *server,
-+ GVariant *parameters,
-+ PolkitSubject *caller,
-+ GDBusMethodInvocation *invocation)
-+{
-+ const gchar *cookie;
-+ GVariant *identity_gvariant;
-+ PolkitIdentity *identity;
-+ GError *error;
-+ guint32 uid;
-+
-+ identity = NULL;
-+
-+ g_variant_get (parameters,
-+ "(u&s@(sa{sv}))",
-+ &uid,
-+ &cookie,
-+ &identity_gvariant);
-+
-+ error = NULL;
-+ identity = polkit_identity_new_for_gvariant (identity_gvariant, &error);
-+ if (identity == NULL)
-+ {
-+ g_prefix_error (&error, "Error getting identity: ");
-+ g_dbus_method_invocation_return_gerror (invocation, error);
-+ g_error_free (error);
-+ goto out;
-+ }
-+
-+ error = NULL;
-+ if (!polkit_backend_authority_authentication_agent_response (server->authority,
-+ caller,
-+ (uid_t)uid,
- cookie,
- identity,
- &error))
-@@ -1222,6 +1279,8 @@ server_handle_method_call (GDBusConnection *connection,
- server_handle_unregister_authentication_agent (server, parameters, caller, invocation);
- else if (g_strcmp0 (method_name, "AuthenticationAgentResponse") == 0)
- server_handle_authentication_agent_response (server, parameters, caller, invocation);
-+ else if (g_strcmp0 (method_name, "AuthenticationAgentResponse2") == 0)
-+ server_handle_authentication_agent_response2 (server, parameters, caller, invocation);
- else if (g_strcmp0 (method_name, "EnumerateTemporaryAuthorizations") == 0)
- server_handle_enumerate_temporary_authorizations (server, parameters, caller, invocation);
- else if (g_strcmp0 (method_name, "RevokeTemporaryAuthorizations") == 0)
-diff --git a/src/polkitbackend/polkitbackendauthority.h b/src/polkitbackend/polkitbackendauthority.h
-index a564054f433a..1c212e0d4937 100644
---- a/src/polkitbackend/polkitbackendauthority.h
-+++ b/src/polkitbackend/polkitbackendauthority.h
-@@ -154,6 +154,7 @@ struct _PolkitBackendAuthorityClass
-
- gboolean (*authentication_agent_response) (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
-+ uid_t uid,
- const gchar *cookie,
- PolkitIdentity *identity,
- GError **error);
-@@ -256,6 +257,7 @@ gboolean polkit_backend_authority_unregister_authentication_agent (PolkitBackend
-
- gboolean polkit_backend_authority_authentication_agent_response (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
-+ uid_t uid,
- const gchar *cookie,
- PolkitIdentity *identity,
- GError **error);
-diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
-index 10eda2c7fb36..5e29af2c83ce 100644
---- a/src/polkitbackend/polkitbackendinteractiveauthority.c
-+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -106,8 +106,9 @@ static AuthenticationAgent *get_authentication_agent_for_subject (PolkitBackendI
- PolkitSubject *subject);
-
-
--static AuthenticationSession *get_authentication_session_for_cookie (PolkitBackendInteractiveAuthority *authority,
-- const gchar *cookie);
-+static AuthenticationSession *get_authentication_session_for_uid_and_cookie (PolkitBackendInteractiveAuthority *authority,
-+ uid_t uid,
-+ const gchar *cookie);
-
- static GList *get_authentication_sessions_initiated_by_system_bus_unique_name (PolkitBackendInteractiveAuthority *authority,
- const gchar *system_bus_unique_name);
-@@ -167,6 +168,7 @@ static gboolean polkit_backend_interactive_authority_unregister_authentication_a
-
- static gboolean polkit_backend_interactive_authority_authentication_agent_response (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
-+ uid_t uid,
- const gchar *cookie,
- PolkitIdentity *identity,
- GError **error);
-@@ -431,6 +433,7 @@ struct AuthenticationAgent
- {
- volatile gint ref_count;
-
-+ uid_t creator_uid;
- PolkitSubject *scope;
- guint64 serial;
-
-@@ -1603,6 +1606,7 @@ authentication_agent_unref (AuthenticationAgent *agent)
- static AuthenticationAgent *
- authentication_agent_new (guint64 serial,
- PolkitSubject *scope,
-+ PolkitIdentity *creator,
- const gchar *unique_system_bus_name,
- const gchar *locale,
- const gchar *object_path,
-@@ -1611,6 +1615,10 @@ authentication_agent_new (guint64 serial,
- {
- AuthenticationAgent *agent;
- GDBusProxy *proxy;
-+ PolkitUnixUser *creator_user;
-+
-+ g_assert (POLKIT_IS_UNIX_USER (creator));
-+ creator_user = POLKIT_UNIX_USER (creator);
-
- if (!g_variant_is_object_path (object_path))
- {
-@@ -1638,6 +1646,7 @@ authentication_agent_new (guint64 serial,
- agent->ref_count = 1;
- agent->serial = serial;
- agent->scope = g_object_ref (scope);
-+ agent->creator_uid = (uid_t)polkit_unix_user_get_uid (creator_user);
- agent->object_path = g_strdup (object_path);
- agent->unique_system_bus_name = g_strdup (unique_system_bus_name);
- agent->locale = g_strdup (locale);
-@@ -1736,8 +1745,9 @@ get_authentication_agent_for_subject (PolkitBackendInteractiveAuthority *authori
- }
-
- static AuthenticationSession *
--get_authentication_session_for_cookie (PolkitBackendInteractiveAuthority *authority,
-- const gchar *cookie)
-+get_authentication_session_for_uid_and_cookie (PolkitBackendInteractiveAuthority *authority,
-+ uid_t uid,
-+ const gchar *cookie)
- {
- PolkitBackendInteractiveAuthorityPrivate *priv;
- GHashTableIter hash_iter;
-@@ -1755,6 +1765,23 @@ get_authentication_session_for_cookie (PolkitBackendInteractiveAuthority *author
- {
- GList *l;
-
-+ /* We need to ensure that if somehow we have duplicate cookies
-+ * due to wrapping, that the cookie used is matched to the user
-+ * who called AuthenticationAgentResponse2. See
-+ * http://lists.freedesktop.org/archives/polkit-devel/2015-June/000425.html
-+ *
-+ * Except if the legacy AuthenticationAgentResponse is invoked,
-+ * we don't know the uid and hence use -1. Continue to support
-+ * the old behavior for backwards compatibility, although everyone
-+ * who is using our own setuid helper will automatically be updated
-+ * to the new API.
-+ */
-+ if (uid != (uid_t)-1)
-+ {
-+ if (agent->creator_uid != uid)
-+ continue;
-+ }
-+
- for (l = agent->active_sessions; l != NULL; l = l->next)
- {
- AuthenticationSession *session = l->data;
-@@ -2388,6 +2415,7 @@ polkit_backend_interactive_authority_register_authentication_agent (PolkitBacken
- priv->agent_serial++;
- agent = authentication_agent_new (priv->agent_serial,
- subject,
-+ user_of_caller,
- polkit_system_bus_name_get_name (POLKIT_SYSTEM_BUS_NAME (caller)),
- locale,
- object_path,
-@@ -2601,6 +2629,7 @@ polkit_backend_interactive_authority_unregister_authentication_agent (PolkitBack
- static gboolean
- polkit_backend_interactive_authority_authentication_agent_response (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
-+ uid_t uid,
- const gchar *cookie,
- PolkitIdentity *identity,
- GError **error)
-@@ -2643,7 +2672,7 @@ polkit_backend_interactive_authority_authentication_agent_response (PolkitBacken
- }
-
- /* find the authentication session */
-- session = get_authentication_session_for_cookie (interactive_authority, cookie);
-+ session = get_authentication_session_for_uid_and_cookie (interactive_authority, uid, cookie);
- if (session == NULL)
- {
- g_set_error (error,
diff --git a/patches/polkit-0.105/0029-0.113-docs-Update-for-changes-to-uid-binding-Authent.patch b/patches/polkit-0.105/0029-0.113-docs-Update-for-changes-to-uid-binding-Authent.patch
deleted file mode 100644
index ff1e8bd29..000000000
--- a/patches/polkit-0.105/0029-0.113-docs-Update-for-changes-to-uid-binding-Authent.patch
+++ /dev/null
@@ -1,264 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Wed, 17 Jun 2015 01:01:27 +0200
-Subject: [PATCH] 0.113: docs: Update for changes to uid
- binding/AuthenticationAgentResponse2
-
- - Refer to PolkitAgentSession in general instead of to _response only
- - Revert to the original description of authentication cancellation, the
- agent really needs to return an error to the caller (in addition to dealing
- with the session if any).
- - Explicitly document the UID assumption; in the process fixing bug #69980.
- - Keep documenting that we need a sufficiently privileged caller.
- - Refer to the ...Response2 API in more places.
- - Also update docbook documentation.
- - Drop a paragraph suggesting non-PolkitAgentSession implementations are
- expected and commonplace.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90837
-Reviewed-by: Colin Walters <walters@redhat.com>
-Origin: upstream, 0.113, commit:fb5076b7c05d01a532d593a4079a29cf2d63a228
-Bug-Debian: https://bugs.debian.org/796134
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- ...desktop.PolicyKit1.AuthenticationAgent.xml | 6 ++---
- data/org.freedesktop.PolicyKit1.Authority.xml | 11 +++++----
- ...desktop.PolicyKit1.AuthenticationAgent.xml | 7 ++++--
- ...e-org.freedesktop.PolicyKit1.Authority.xml | 12 ++++++----
- docs/polkit/overview.xml | 8 +++----
- src/polkit/polkitauthority.c | 24 +++++++++++++++++--
- src/polkitagent/polkitagentlistener.c | 5 +---
- src/polkitbackend/polkitbackendauthority.c | 1 +
- 8 files changed, 51 insertions(+), 23 deletions(-)
-
-diff --git a/data/org.freedesktop.PolicyKit1.AuthenticationAgent.xml b/data/org.freedesktop.PolicyKit1.AuthenticationAgent.xml
-index 5beef7d4ef92..482332f6fc35 100644
---- a/data/org.freedesktop.PolicyKit1.AuthenticationAgent.xml
-+++ b/data/org.freedesktop.PolicyKit1.AuthenticationAgent.xml
-@@ -13,14 +13,14 @@
- user to authenticate as one of the identities in @identities for
- the action with the identifier @action_id.</para><para>This
- authentication is normally achieved via the
-- polkit_agent_session_response() API, which invokes a private
-+ PolkitAgentSession API, which invokes a private
- setuid helper process to verify the authentication. When
- successful, it calls the
- org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse2()
- method on the #org.freedesktop.PolicyKit1.Authority interface of
- the PolicyKit daemon before returning. If the user dismisses the
-- authentication dialog, the authentication agent should call
-- polkit_agent_session_cancel().</para>"/>
-+ authentication dialog, the authentication agent should return an
-+ error.</para>"/>
-
- <arg name="action_id" direction="in" type="s">
- <annotation name="org.gtk.EggDBus.DocString" value="The identifier for the action that the user is authentication for."/>
-diff --git a/data/org.freedesktop.PolicyKit1.Authority.xml b/data/org.freedesktop.PolicyKit1.Authority.xml
-index f9021ee2e7c8..88da3c052cbe 100644
---- a/data/org.freedesktop.PolicyKit1.Authority.xml
-+++ b/data/org.freedesktop.PolicyKit1.Authority.xml
-@@ -283,7 +283,7 @@
- <!-- ---------------------------------------------------------------------------------------------------- -->
-
- <method name="RegisterAuthenticationAgent">
-- <annotation name="org.gtk.EggDBus.DocString" value="<para>Register an authentication agent.</para><para>Note that current versions of PolicyKit will only work if @session_id is set to the empty string. In the future it might work for non-empty strings if the caller is sufficiently privileged.</para>"/>
-+ <annotation name="org.gtk.EggDBus.DocString" value="<para>Register an authentication agent.</para><para>Note that this should be called by the same effective UID which will be passed to org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse2().</para>"/>
-
- <arg name="subject" direction="in" type="(sa{sv})">
- <annotation name="org.gtk.EggDBus.Type" value="Subject"/>
-@@ -315,7 +315,8 @@
- <method name="AuthenticationAgentResponse">
- <annotation name="org.gtk.EggDBus.DocString" value="Method for authentication agents to invoke on successful
- authentication, intended only for use by a privileged helper process
--internal to polkit."/>
-+internal to polkit. This method will fail unless a sufficiently privileged
-+caller invokes it. Deprecated in favor of org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse2."/>
-
- <arg name="cookie" direction="in" type="s">
- <annotation name="org.gtk.EggDBus.DocString" value="The cookie identifying the authentication request that was passed to the authentication agent."/>
-@@ -330,11 +331,13 @@ internal to polkit."/>
- <method name="AuthenticationAgentResponse2">
- <annotation name="org.gtk.EggDBus.DocString" value="Method for authentication agents to invoke on successful
- authentication, intended only for use by a privileged helper process
--internal to polkit. Note this method was added in 0.114, and should be preferred over AuthenticationAgentResponse
-+internal to polkit. This method will fail unless a sufficiently privileged
-+caller invokes it. Note this method was added in 0.114, and should be preferred over org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse()
- as it fixes a security issue."/>
-
- <arg name="uid" direction="in" type="u">
-- <annotation name="org.gtk.EggDBus.DocString" value="The real uid of the agent. Normally set by the setuid helper program."/>
-+ <annotation name="org.gtk.EggDBus.DocString" value="The real uid of the agent. Normally set by the setuid helper program.
-+Must match the effective UID of the caller of org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent()."/>
- </arg>
-
- <arg name="cookie" direction="in" type="s">
-diff --git a/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.AuthenticationAgent.xml b/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.AuthenticationAgent.xml
-index ec596268cc3c..ab27b2f6638c 100644
---- a/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.AuthenticationAgent.xml
-+++ b/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.AuthenticationAgent.xml
-@@ -47,10 +47,13 @@ BeginAuthentication (IN String action_id,
- identifier <parameter>action_id</parameter>.</para><para>Upon
- succesful authentication, the authentication agent must invoke
- the <link
-- linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse">AuthenticationAgentResponse()</link>
-+ linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse2">AuthenticationAgentResponse2()</link>
- method on the <link
- linkend="eggdbus-interface-org.freedesktop.PolicyKit1.Authority">org.freedesktop.PolicyKit1.Authority</link>
-- interface of the PolicyKit daemon before returning.
-+ interface of the PolicyKit daemon before returning. This is normally
-+ achieved via the <link linkend="PolkitAgentSession">PolkitAgentSession</link>
-+ API, which invokes a private setuid helper process to verify the
-+ authentication.
- </para>
- <para>
- The authentication agent should not return until after authentication is complete.
-diff --git a/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.xml b/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.xml
-index e66bf5349c61..f2eed63999de 100644
---- a/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.xml
-+++ b/docs/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.xml
-@@ -42,7 +42,7 @@ Structure <link linkend="eggdbus-struct-TemporaryAuthorization">TemporaryAuth
- IN String object_path)
- <link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse">AuthenticationAgentResponse</link> (IN String cookie,
- IN <link linkend="eggdbus-struct-Identity">Identity</link> identity)
--<link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse">AuthenticationAgentResponse2</link> (IN uint32 uid, IN String cookie,
-+<link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse2">AuthenticationAgentResponse2</link> (IN uint32 uid, IN String cookie,
- IN <link linkend="eggdbus-struct-Identity">Identity</link> identity)
- <link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.EnumerateTemporaryAuthorizations">EnumerateTemporaryAuthorizations</link> (IN <link linkend="eggdbus-struct-Subject">Subject</link> subject,
- OUT Array&lt;<link linkend="eggdbus-struct-TemporaryAuthorization">TemporaryAuthorization</link>&gt; temporary_authorizations)
-@@ -701,7 +701,7 @@ RegisterAuthenticationAgent (IN <link linkend="eggdbus-struct-Subject">Subject<
- IN String object_path)
- </programlisting>
- <para>
--<para>Register an authentication agent.</para><para>Note that current versions of PolicyKit will only work if <parameter>session_id</parameter> is set to the empty string. In the future it might work for non-empty strings if the caller is sufficiently privileged.</para>
-+<para>Register an authentication agent.</para><para>Note that this should be called by same effective UID which will be passed to <link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse2">AuthenticationAgentResponse2()</link>.</para>
- </para>
- <variablelist role="params">
- <varlistentry>
-@@ -781,7 +781,8 @@ AuthenticationAgentResponse (IN String cookie,
- <para>
- Method for authentication agents to invoke on successful
- authentication, intended only for use by a privileged helper process
--internal to polkit. Deprecated in favor of AuthenticationAgentResponse2.
-+internal to polkit. This method will fail unless a sufficiently privileged
-++caller invokes it. Deprecated in favor of <link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse2">AuthenticationAgentResponse2()</link>.
- </para>
- <variablelist role="params">
- <varlistentry>
-@@ -812,7 +813,10 @@ AuthenticationAgentResponse2 (IN uint32 uid,
- <para>
- Method for authentication agents to invoke on successful
- authentication, intended only for use by a privileged helper process
--internal to polkit. Note this method was introduced in 0.114 to fix a security issue.
-+internal to polkit. This method will fail unless a sufficiently privileged
-+caller invokes it. Note this method was introduced in 0.114 and should be
-+preferred over <link linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse">AuthenticationAgentResponse()</link>
-+as it fixes a security issue.
- </para>
- <variablelist role="params">
- <varlistentry>
-diff --git a/docs/polkit/overview.xml b/docs/polkit/overview.xml
-index c29d8da242c6..8ddb34ccb1de 100644
---- a/docs/polkit/overview.xml
-+++ b/docs/polkit/overview.xml
-@@ -73,11 +73,11 @@
- linkend="eggdbus-interface-org.freedesktop.PolicyKit1.AuthenticationAgent">org.freedesktop.PolicyKit1.AuthenticationAgent</link>
- D-Bus interface. Once the user is authenticated, (a privileged
- part of) the agent invokes the <link
-- linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse">AuthenticationAgentResponse()</link>
-+ linkend="eggdbus-method-org.freedesktop.PolicyKit1.Authority.AuthenticationAgentResponse2">AuthenticationAgentResponse2()</link>
- method. This method should be treated as an internal
-- implementation detail, and callers should use the public shared
-- library API to invoke it, which currently uses a setuid helper
-- program.
-+ implementation detail, and callers should use the
-+ <link linkend="PolkitAgentSession">PolkitAgentSession</link> API to invoke
-+ it, which currently uses a setuid helper program.
- </para>
- <para>
- The <link linkend="ref-authentication-agent-api">libpolkit-agent-1</link>
-diff --git a/src/polkit/polkitauthority.c b/src/polkit/polkitauthority.c
-index f45abc4ad946..4e882e6412ea 100644
---- a/src/polkit/polkitauthority.c
-+++ b/src/polkit/polkitauthority.c
-@@ -1038,6 +1038,10 @@ polkit_authority_check_authorization_sync (PolkitAuthority *author
- *
- * Asynchronously registers an authentication agent.
- *
-+ * Note that this should be called by the same effective UID which will be
-+ * the real UID using the #PolkitAgentSession API or otherwise calling
-+ * polkit_authority_authentication_agent_response().
-+ *
- * When the operation is finished, @callback will be invoked in the
- * <link linkend="g-main-context-push-thread-default">thread-default
- * main loop</link> of the thread you are calling this method
-@@ -1129,7 +1133,13 @@ polkit_authority_register_authentication_agent_finish (PolkitAuthority *authorit
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: (allow-none): Return location for error or %NULL.
- *
-- * Registers an authentication agent. The calling thread is blocked
-+ * Registers an authentication agent.
-+ *
-+ * Note that this should be called by the same effective UID which will be
-+ * the real UID using the #PolkitAgentSession API or otherwise calling
-+ * polkit_authority_authentication_agent_response().
-+ *
-+ * The calling thread is blocked
- * until a reply is received. See
- * polkit_authority_register_authentication_agent() for the
- * asynchronous version.
-@@ -1178,6 +1188,10 @@ polkit_authority_register_authentication_agent_sync (PolkitAuthority *author
- *
- * Asynchronously registers an authentication agent.
- *
-+ * Note that this should be called by the same effective UID which will be
-+ * the real UID using the #PolkitAgentSession API or otherwise calling
-+ * polkit_authority_authentication_agent_response().
-+ *
- * When the operation is finished, @callback will be invoked in the
- * <link linkend="g-main-context-push-thread-default">thread-default
- * main loop</link> of the thread you are calling this method
-@@ -1292,7 +1306,13 @@ polkit_authority_register_authentication_agent_with_options_finish (PolkitAuthor
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: (allow-none): Return location for error or %NULL.
- *
-- * Registers an authentication agent. The calling thread is blocked
-+ * Registers an authentication agent.
-+ *
-+ * Note that this should be called by the same effective UID which will be
-+ * the real UID using the #PolkitAgentSession API or otherwise calling
-+ * polkit_authority_authentication_agent_response().
-+ *
-+ * The calling thread is blocked
- * until a reply is received. See
- * polkit_authority_register_authentication_agent_with_options() for the
- * asynchronous version.
-diff --git a/src/polkitagent/polkitagentlistener.c b/src/polkitagent/polkitagentlistener.c
-index 0d97501a028c..10dbfb9c0d4e 100644
---- a/src/polkitagent/polkitagentlistener.c
-+++ b/src/polkitagent/polkitagentlistener.c
-@@ -37,10 +37,7 @@
- *
- * Typically authentication agents use #PolkitAgentSession to
- * authenticate users (via passwords) and communicate back the
-- * authentication result to the PolicyKit daemon. This is however not
-- * requirement. Depending on the system an authentication agent may
-- * use other means (such as a Yes/No dialog) to obtain sufficient
-- * evidence that the user is one of the requested identities.
-+ * authentication result to the PolicyKit daemon.
- *
- * To register a #PolkitAgentListener with the PolicyKit daemon, use
- * polkit_agent_listener_register() or
-diff --git a/src/polkitbackend/polkitbackendauthority.c b/src/polkitbackend/polkitbackendauthority.c
-index d1b1a257e435..10b8af34205c 100644
---- a/src/polkitbackend/polkitbackendauthority.c
-+++ b/src/polkitbackend/polkitbackendauthority.c
-@@ -343,6 +343,7 @@ polkit_backend_authority_unregister_authentication_agent (PolkitBackendAuthority
- * polkit_backend_authority_authentication_agent_response:
- * @authority: A #PolkitBackendAuthority.
- * @caller: The system bus name that initiated the query.
-+ * @uid: The real UID of the registered agent, or (uid_t)-1 if unknown.
- * @cookie: The cookie passed to the authentication agent from the authority.
- * @identity: The identity that was authenticated.
- * @error: Return location for error or %NULL.
diff --git a/patches/polkit-0.105/0030-0.113-Fix-a-per-authorization-memory-leak.patch b/patches/polkit-0.105/0030-0.113-Fix-a-per-authorization-memory-leak.patch
deleted file mode 100644
index a3428746e..000000000
--- a/patches/polkit-0.105/0030-0.113-Fix-a-per-authorization-memory-leak.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Tue, 1 Jul 2014 20:00:48 +0200
-Subject: [PATCH] 0.113: Fix a per-authorization memory leak
-
-We were leaking PolkitAuthorizationResult on every request, primarily on
-the success path, but also on various error paths as well.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69501
-Origin: upstream, 0.113, commit:0f5852a4bdabe377ddcdbed09a0c1f95710e17fe
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitbackend/polkitbackendauthority.c | 1 +
- src/polkitbackend/polkitbackendinteractiveauthority.c | 5 ++++-
- 2 files changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/src/polkitbackend/polkitbackendauthority.c b/src/polkitbackend/polkitbackendauthority.c
-index 10b8af34205c..39eb5b9d29fa 100644
---- a/src/polkitbackend/polkitbackendauthority.c
-+++ b/src/polkitbackend/polkitbackendauthority.c
-@@ -714,6 +714,7 @@ check_auth_cb (GObject *source_object,
- g_variant_ref_sink (value);
- g_dbus_method_invocation_return_value (data->invocation, g_variant_new ("(@(bba{ss}))", value));
- g_variant_unref (value);
-+ g_object_unref (result);
- }
-
- check_auth_data_free (data);
-diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
-index 5e29af2c83ce..73d0a0e29e24 100644
---- a/src/polkitbackend/polkitbackendinteractiveauthority.c
-+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -1015,7 +1015,7 @@ polkit_backend_interactive_authority_check_authorization (PolkitBackendAuthority
-
- /* Otherwise just return the result */
- g_simple_async_result_set_op_res_gpointer (simple,
-- result,
-+ g_object_ref (result),
- g_object_unref);
- g_simple_async_result_complete (simple);
- g_object_unref (simple);
-@@ -1032,6 +1032,9 @@ polkit_backend_interactive_authority_check_authorization (PolkitBackendAuthority
- g_free (subject_str);
- g_free (user_of_caller_str);
- g_free (user_of_subject_str);
-+
-+ if (result != NULL)
-+ g_object_unref (result);
- }
-
- /* ---------------------------------------------------------------------------------------------------- */
diff --git a/patches/polkit-0.105/0031-0.113-Fix-a-memory-leak-when-registering-an-authenti.patch b/patches/polkit-0.105/0031-0.113-Fix-a-memory-leak-when-registering-an-authenti.patch
deleted file mode 100644
index aa649cf24..000000000
--- a/patches/polkit-0.105/0031-0.113-Fix-a-memory-leak-when-registering-an-authenti.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Tue, 1 Jul 2014 20:00:48 +0200
-Subject: [PATCH] 0.113: Fix a memory leak when registering an authentication
- agent
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69501
-Origin: upstream, 0.113, commit:ec039f9d7ede5b839f5511e26d5cd6ae9107cb2e
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitbackend/polkitbackendauthority.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/polkitbackend/polkitbackendauthority.c b/src/polkitbackend/polkitbackendauthority.c
-index 39eb5b9d29fa..afe5b90c140e 100644
---- a/src/polkitbackend/polkitbackendauthority.c
-+++ b/src/polkitbackend/polkitbackendauthority.c
-@@ -900,6 +900,7 @@ server_handle_register_authentication_agent (Server *server,
- g_dbus_method_invocation_return_value (invocation, g_variant_new ("()"));
-
- out:
-+ g_variant_unref (subject_gvariant);
- if (subject != NULL)
- g_object_unref (subject);
- }
diff --git a/patches/polkit-0.105/0032-0.113-CVE-2015-3255-Fix-GHashTable-usage.patch b/patches/polkit-0.105/0032-0.113-CVE-2015-3255-Fix-GHashTable-usage.patch
deleted file mode 100644
index 9303bf791..000000000
--- a/patches/polkit-0.105/0032-0.113-CVE-2015-3255-Fix-GHashTable-usage.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Wed, 1 Apr 2015 05:22:37 +0200
-Subject: [PATCH] 0.113: CVE-2015-3255 Fix GHashTable usage.
-
-Don't assume that the hash table with free both the key and the value
-at the same time, supply proper deallocation functions for the key
-and value separately.
-
-Then drop ParsedAction::action_id which is no longer used for anything.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=69501
-and
-https://bugs.freedesktop.org/show_bug.cgi?id=83590
-
-CVE: CVE-2015-3255
-Origin: upstream, 0.113, commit:9f5e0c731784003bd4d6fc75ab739ff8b2ea269f
-Bug-Debian: https://bugs.debian.org/796134
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitbackend/polkitbackendactionpool.c | 8 +++-----
- 1 file changed, 3 insertions(+), 5 deletions(-)
-
-diff --git a/src/polkitbackend/polkitbackendactionpool.c b/src/polkitbackend/polkitbackendactionpool.c
-index e3ed38d4a81e..4270d4ed2b41 100644
---- a/src/polkitbackend/polkitbackendactionpool.c
-+++ b/src/polkitbackend/polkitbackendactionpool.c
-@@ -40,7 +40,6 @@
-
- typedef struct
- {
-- gchar *action_id;
- gchar *vendor_name;
- gchar *vendor_url;
- gchar *icon_name;
-@@ -62,7 +61,6 @@ typedef struct
- static void
- parsed_action_free (ParsedAction *action)
- {
-- g_free (action->action_id);
- g_free (action->vendor_name);
- g_free (action->vendor_url);
- g_free (action->icon_name);
-@@ -134,7 +132,7 @@ polkit_backend_action_pool_init (PolkitBackendActionPool *pool)
-
- priv->parsed_actions = g_hash_table_new_full (g_str_hash,
- g_str_equal,
-- NULL,
-+ g_free,
- (GDestroyNotify) parsed_action_free);
-
- priv->parsed_files = g_hash_table_new_full (g_str_hash,
-@@ -988,7 +986,6 @@ _end (void *data, const char *el)
- icon_name = pd->global_icon_name;
-
- action = g_new0 (ParsedAction, 1);
-- action->action_id = g_strdup (pd->action_id);
- action->vendor_name = g_strdup (vendor);
- action->vendor_url = g_strdup (vendor_url);
- action->icon_name = g_strdup (icon_name);
-@@ -1003,7 +1000,8 @@ _end (void *data, const char *el)
- action->implicit_authorization_inactive = pd->implicit_authorization_inactive;
- action->implicit_authorization_active = pd->implicit_authorization_active;
-
-- g_hash_table_insert (priv->parsed_actions, action->action_id, action);
-+ g_hash_table_insert (priv->parsed_actions, g_strdup (pd->action_id),
-+ action);
-
- /* we steal these hash tables */
- pd->annotations = NULL;
diff --git a/patches/polkit-0.105/0033-0.113-Fix-use-after-free-in-polkitagentsession.c.patch b/patches/polkit-0.105/0033-0.113-Fix-use-after-free-in-polkitagentsession.c.patch
deleted file mode 100644
index ee35b7cb2..000000000
--- a/patches/polkit-0.105/0033-0.113-Fix-use-after-free-in-polkitagentsession.c.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Tue, 14 Apr 2015 22:27:41 +0200
-Subject: [PATCH] 0.113: Fix use-after-free in polkitagentsession.c
-
-PolkitAgentTextListener's "completed" handler drops the last reference
-to the session; in fact this is explicitly recommended in the signal's
-documentation. So we must not access any members of session after
-emitting the signal.
-
-Found while dealing with
-https://bugs.freedesktop.org/show_bug.cgi?id=69501
-
-Origin: upstream, 0.113, commit:efb6cd56a423ba15bb1f44ee3c4987aad5a5fd45
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitagent/polkitagentsession.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/polkitagent/polkitagentsession.c b/src/polkitagent/polkitagentsession.c
-index 6a3d6bc94c49..46fbaf06f469 100644
---- a/src/polkitagent/polkitagentsession.c
-+++ b/src/polkitagent/polkitagentsession.c
-@@ -412,8 +412,9 @@ complete_session (PolkitAgentSession *session,
- {
- if (G_UNLIKELY (_show_debug ()))
- g_print ("PolkitAgentSession: emitting ::completed(%s)\n", result ? "TRUE" : "FALSE");
-- g_signal_emit_by_name (session, "completed", result);
- session->have_emitted_completed = TRUE;
-+ /* Note that the signal handler may drop the last reference to session. */
-+ g_signal_emit_by_name (session, "completed", result);
- }
- }
-
diff --git a/patches/polkit-0.105/0034-0.114-Fix-multi-line-pam-text-info.patch b/patches/polkit-0.105/0034-0.114-Fix-multi-line-pam-text-info.patch
deleted file mode 100644
index 5c51de5a7..000000000
--- a/patches/polkit-0.105/0034-0.114-Fix-multi-line-pam-text-info.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From: Dariusz Gadomski <dariusz.gadomski@canonical.com>
-Date: Tue, 10 Nov 2015 10:52:02 +0100
-Subject: [PATCH] 0.114: Fix multi-line pam text info.
-
-There are pam modules (e.g. pam_vas) that may attempt to display multi-line
-PAM_TEXT_INFO messages. Polkit was interpreting the lines after the first one
-as a separate message that was not recognized causing the authorization
-to fail. Escaping these strings and unescaping them fixes the issue.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92886
-Origin: upstream, 0.114, commit:10597322eccc320f9053821750ae9af51e918d74
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitagent/polkitagenthelper-pam.c | 13 +++++++++----
- 1 file changed, 9 insertions(+), 4 deletions(-)
-
-diff --git a/src/polkitagent/polkitagenthelper-pam.c b/src/polkitagent/polkitagenthelper-pam.c
-index 19062aa8d0da..063d656dcbef 100644
---- a/src/polkitagent/polkitagenthelper-pam.c
-+++ b/src/polkitagent/polkitagenthelper-pam.c
-@@ -302,10 +302,15 @@ conversation_function (int n, const struct pam_message **msg, struct pam_respons
- case PAM_TEXT_INFO:
- fprintf (stdout, "PAM_TEXT_INFO ");
- conv2:
-- fputs (msg[i]->msg, stdout);
-- if (strlen (msg[i]->msg) > 0 &&
-- msg[i]->msg[strlen (msg[i]->msg) - 1] != '\n')
-- fputc ('\n', stdout);
-+ tmp = g_strdup (msg[i]->msg);
-+ len = strlen (tmp);
-+ if (len > 0 && tmp[len - 1] == '\n')
-+ tmp[len - 1] = '\0';
-+ escaped = g_strescape (tmp, NULL);
-+ g_free (tmp);
-+ fputs (escaped, stdout);
-+ g_free (escaped);
-+ fputc ('\n', stdout);
- fflush (stdout);
- break;
-
diff --git a/patches/polkit-0.105/0035-0.114-Refactor-send_to_helper-usage.patch b/patches/polkit-0.105/0035-0.114-Refactor-send_to_helper-usage.patch
deleted file mode 100644
index 8be72ef26..000000000
--- a/patches/polkit-0.105/0035-0.114-Refactor-send_to_helper-usage.patch
+++ /dev/null
@@ -1,153 +0,0 @@
-From: Dariusz Gadomski <dariusz.gadomski@canonical.com>
-Date: Thu, 12 Nov 2015 15:01:19 +0100
-Subject: [PATCH] 0.114: Refactor send_to_helper usage
-
-There were duplicated pieces of code detecting EOLs and escaping the code.
-Those actions has been delegated to already-existing send_to_helper function.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92886
-Origin: upstream, 0.114, commit:2690cd0312b310946c86674c8dd1f55c63f7dd6a
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitagent/polkitagenthelper-pam.c | 81 ++++++++-----------------
- 1 file changed, 26 insertions(+), 55 deletions(-)
-
-diff --git a/src/polkitagent/polkitagenthelper-pam.c b/src/polkitagent/polkitagenthelper-pam.c
-index 063d656dcbef..3ea3a3f2e801 100644
---- a/src/polkitagent/polkitagenthelper-pam.c
-+++ b/src/polkitagent/polkitagenthelper-pam.c
-@@ -39,25 +39,35 @@ static void
- send_to_helper (const gchar *str1,
- const gchar *str2)
- {
-+ char *escaped;
-+ char *tmp2;
-+ size_t len2;
-+
-+ tmp2 = g_strdup(str2);
-+ len2 = strlen(tmp2);
- #ifdef PAH_DEBUG
-- fprintf (stderr, "polkit-agent-helper-1: writing `%s' to stdout\n", str1);
-+ fprintf (stderr, "polkit-agent-helper-1: writing `%s ' to stdout\n", str1);
- #endif /* PAH_DEBUG */
-- fprintf (stdout, "%s", str1);
-+ fprintf (stdout, "%s ", str1);
-+
-+ if (len2 > 0 && tmp2[len2 - 1] == '\n')
-+ tmp2[len2 - 1] = '\0';
-+ escaped = g_strescape (tmp2, NULL);
- #ifdef PAH_DEBUG
-- fprintf (stderr, "polkit-agent-helper-1: writing `%s' to stdout\n", str2);
-+ fprintf (stderr, "polkit-agent-helper-1: writing `%s' to stdout\n", escaped);
- #endif /* PAH_DEBUG */
-- fprintf (stdout, "%s", str2);
-- if (strlen (str2) > 0 && str2[strlen (str2) - 1] != '\n')
-- {
-+ fprintf (stdout, "%s", escaped);
- #ifdef PAH_DEBUG
-- fprintf (stderr, "polkit-agent-helper-1: writing newline to stdout\n");
-+ fprintf (stderr, "polkit-agent-helper-1: writing newline to stdout\n");
- #endif /* PAH_DEBUG */
-- fputc ('\n', stdout);
-- }
-+ fputc ('\n', stdout);
- #ifdef PAH_DEBUG
- fprintf (stderr, "polkit-agent-helper-1: flushing stdout\n");
- #endif /* PAH_DEBUG */
- fflush (stdout);
-+
-+ g_free (escaped);
-+ g_free (tmp2);
- }
-
- int
-@@ -89,7 +99,7 @@ main (int argc, char *argv[])
-
- /* Special-case a very common error triggered in jhbuild setups */
- s = g_strdup_printf ("Incorrect permissions on %s (needs to be setuid root)", argv[0]);
-- send_to_helper ("PAM_ERROR_MSG ", s);
-+ send_to_helper ("PAM_ERROR_MSG", s);
- g_free (s);
- goto error;
- }
-@@ -232,9 +242,6 @@ conversation_function (int n, const struct pam_message **msg, struct pam_respons
- struct pam_response *aresp;
- char buf[PAM_MAX_RESP_SIZE];
- int i;
-- gchar *escaped = NULL;
-- gchar *tmp = NULL;
-- size_t len;
-
- (void)data;
- if (n <= 0 || n > PAM_MAX_NUM_MSG)
-@@ -251,38 +258,13 @@ conversation_function (int n, const struct pam_message **msg, struct pam_respons
- {
-
- case PAM_PROMPT_ECHO_OFF:
--#ifdef PAH_DEBUG
-- fprintf (stderr, "polkit-agent-helper-1: writing `PAM_PROMPT_ECHO_OFF ' to stdout\n");
--#endif /* PAH_DEBUG */
-- fprintf (stdout, "PAM_PROMPT_ECHO_OFF ");
-+ send_to_helper ("PAM_PROMPT_ECHO_OFF", msg[i]->msg);
- goto conv1;
-
- case PAM_PROMPT_ECHO_ON:
--#ifdef PAH_DEBUG
-- fprintf (stderr, "polkit-agent-helper-1: writing `PAM_PROMPT_ECHO_ON ' to stdout\n");
--#endif /* PAH_DEBUG */
-- fprintf (stdout, "PAM_PROMPT_ECHO_ON ");
-- conv1:
--#ifdef PAH_DEBUG
-- fprintf (stderr, "polkit-agent-helper-1: writing `%s' to stdout\n", msg[i]->msg);
--#endif /* PAH_DEBUG */
-- tmp = g_strdup (msg[i]->msg);
-- len = strlen (tmp);
-- if (len > 0 && tmp[len - 1] == '\n')
-- tmp[len - 1] = '\0';
-- escaped = g_strescape (tmp, NULL);
-- g_free (tmp);
-- fputs (escaped, stdout);
-- g_free (escaped);
--#ifdef PAH_DEBUG
-- fprintf (stderr, "polkit-agent-helper-1: writing newline to stdout\n");
--#endif /* PAH_DEBUG */
-- fputc ('\n', stdout);
--#ifdef PAH_DEBUG
-- fprintf (stderr, "polkit-agent-helper-1: flushing stdout\n");
--#endif /* PAH_DEBUG */
-- fflush (stdout);
-+ send_to_helper ("PAM_PROMPT_ECHO_ON", msg[i]->msg);
-
-+ conv1:
- if (fgets (buf, sizeof buf, stdin) == NULL)
- goto error;
-
-@@ -296,22 +278,11 @@ conversation_function (int n, const struct pam_message **msg, struct pam_respons
- break;
-
- case PAM_ERROR_MSG:
-- fprintf (stdout, "PAM_ERROR_MSG ");
-- goto conv2;
-+ send_to_helper ("PAM_ERROR_MSG", msg[i]->msg);
-+ break;
-
- case PAM_TEXT_INFO:
-- fprintf (stdout, "PAM_TEXT_INFO ");
-- conv2:
-- tmp = g_strdup (msg[i]->msg);
-- len = strlen (tmp);
-- if (len > 0 && tmp[len - 1] == '\n')
-- tmp[len - 1] = '\0';
-- escaped = g_strescape (tmp, NULL);
-- g_free (tmp);
-- fputs (escaped, stdout);
-- g_free (escaped);
-- fputc ('\n', stdout);
-- fflush (stdout);
-+ send_to_helper ("PAM_TEXT_INFO", msg[i]->msg);
- break;
-
- default:
diff --git a/patches/polkit-0.105/0036-0.114-Support-polkit-session-agent-running-outside-u.patch b/patches/polkit-0.105/0036-0.114-Support-polkit-session-agent-running-outside-u.patch
deleted file mode 100644
index 49ee8a807..000000000
--- a/patches/polkit-0.105/0036-0.114-Support-polkit-session-agent-running-outside-u.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From: Sebastien Bacher <seb128@ubuntu.com>
-Date: Mon, 2 Apr 2018 10:52:47 -0400
-Subject: [PATCH] 0.114: Support polkit session agent running outside user
- session
-
-commit a68f5dfd7662767b7b9822090b70bc5bd145c50c made
-session applications that are running from a user bus
-work with polkitd, by falling back to using the currently
-active session.
-
-This commit is similar, but for the polkit agent. It allows,
-a polkit agent to be run from a systemd --user service
-that's not running directly in the users session.
-
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=96977
-Applied-upstream: 0.114, commit:00a663e3fb14d8023e7cb6a66d091872bf4f2851
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitunixsession-systemd.c | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/src/polkit/polkitunixsession-systemd.c b/src/polkit/polkitunixsession-systemd.c
-index 8a8bf65b9995..c34f36a909cf 100644
---- a/src/polkit/polkitunixsession-systemd.c
-+++ b/src/polkit/polkitunixsession-systemd.c
-@@ -451,6 +451,7 @@ polkit_unix_session_initable_init (GInitable *initable,
- PolkitUnixSession *session = POLKIT_UNIX_SESSION (initable);
- gboolean ret = FALSE;
- char *s;
-+ uid_t uid;
-
- if (session->session_id != NULL)
- {
-@@ -467,6 +468,19 @@ polkit_unix_session_initable_init (GInitable *initable,
- goto out;
- }
-
-+ /* Now do process -> uid -> graphical session (systemd version 213)*/
-+ if (sd_pid_get_owner_uid (session->pid, &uid) < 0)
-+ goto error;
-+
-+ if (sd_uid_get_display (uid, &s) >= 0)
-+ {
-+ session->session_id = g_strdup (s);
-+ free (s);
-+ ret = TRUE;
-+ goto out;
-+ }
-+
-+error:
- g_set_error (error,
- POLKIT_ERROR,
- POLKIT_ERROR_FAILED,
diff --git a/patches/polkit-0.105/0037-0.115-Fix-CVE-2018-1116-Trusting-client-supplied-UID.patch b/patches/polkit-0.105/0037-0.115-Fix-CVE-2018-1116-Trusting-client-supplied-UID.patch
deleted file mode 100644
index eaffd94a7..000000000
--- a/patches/polkit-0.105/0037-0.115-Fix-CVE-2018-1116-Trusting-client-supplied-UID.patch
+++ /dev/null
@@ -1,573 +0,0 @@
-From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com>
-Date: Mon, 25 Jun 2018 19:24:06 +0200
-Subject: [PATCH] 0.115: Fix CVE-2018-1116: Trusting client-supplied UID
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-As part of CVE-2013-4288, the D-Bus clients were allowed (and
-encouraged) to submit the UID of the subject of authorization checks
-to avoid races against UID changes (notably using executables
-set-UID to root).
-
-However, that also allowed any client to submit an arbitrary UID, and
-that could be used to bypass "can only ask about / affect the same UID"
-checks in CheckAuthorization / RegisterAuthenticationAgent /
-UnregisterAuthenticationAgent. This allowed an attacker:
-
-- With CheckAuthorization, to cause the registered authentication
- agent in victim's session to pop up a dialog, or to determine whether
- the victim currently has a temporary authorization to perform an
- operation.
-
- (In principle, the attacker can also determine whether JavaScript
- rules allow the victim process to perform an operation; however,
- usually rules base their decisions on information determined from
- the supplied UID, so the attacker usually won't learn anything new.)
-
-- With RegisterAuthenticationAgent, to prevent the victim's
- authentication agent to work (for a specific victim process),
- or to learn about which operations requiring authorization
- the victim is attempting.
-
-To fix this, expose internal _polkit_unix_process_get_owner() /
-obsolete polkit_unix_process_get_owner() as a private
-polkit_unix_process_get_racy_uid__() (being more explicit about the
-dangers on relying on it), and use it in
-polkit_backend_session_monitor_get_user_for_subject() to return
-a boolean indicating whether the subject UID may be caller-chosen.
-
-Then, in the permission checks that require the subject to be
-equal to the caller, fail on caller-chosen UIDs (and continue
-through the pre-existing code paths which allow root, or root-designated
-server processes, to ask about arbitrary subjects.)
-
-Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-Origin: upstream, 0.115, commit:bc7ffad53643a9c80231fc41f5582d6a8931c32c
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitprivate.h | 2 +
- src/polkit/polkitunixprocess.c | 60 +++++++++++++++----
- .../polkitbackendinteractiveauthority.c | 39 +++++++-----
- .../polkitbackendsessionmonitor-systemd.c | 38 ++++++++++--
- .../polkitbackendsessionmonitor.c | 40 +++++++++++--
- .../polkitbackendsessionmonitor.h | 1 +
- 6 files changed, 147 insertions(+), 33 deletions(-)
-
-diff --git a/src/polkit/polkitprivate.h b/src/polkit/polkitprivate.h
-index 579cc2535014..d6cd45d46aa5 100644
---- a/src/polkit/polkitprivate.h
-+++ b/src/polkit/polkitprivate.h
-@@ -34,6 +34,8 @@ GVariant *polkit_action_description_to_gvariant (PolkitActionDescription *action
- GVariant *polkit_subject_to_gvariant (PolkitSubject *subject);
- GVariant *polkit_identity_to_gvariant (PolkitIdentity *identity);
-
-+gint polkit_unix_process_get_racy_uid__ (PolkitUnixProcess *process, GError **error);
-+
- PolkitSubject *polkit_subject_new_for_gvariant (GVariant *variant, GError **error);
- PolkitIdentity *polkit_identity_new_for_gvariant (GVariant *variant, GError **error);
-
-diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c
-index 913be3ac6a0a..464f034c0a21 100644
---- a/src/polkit/polkitunixprocess.c
-+++ b/src/polkit/polkitunixprocess.c
-@@ -49,6 +49,14 @@
- * To uniquely identify processes, both the process id and the start
- * time of the process (a monotonic increasing value representing the
- * time since the kernel was started) is used.
-+ *
-+ * NOTE: This object stores, and provides access to, the real UID of the
-+ * process. That value can change over time (with set*uid*(2) and exec*(2)).
-+ * Checks whether an operation is allowed need to take care to use the UID
-+ * value as of the time when the operation was made (or, following the open()
-+ * privilege check model, when the connection making the operation possible
-+ * was initiated). That is usually done by initializing this with
-+ * polkit_unix_process_new_for_owner() with trusted data.
- */
-
- /**
-@@ -83,9 +91,6 @@ static void subject_iface_init (PolkitSubjectIface *subject_iface);
- static guint64 get_start_time_for_pid (gint pid,
- GError **error);
-
--static gint _polkit_unix_process_get_owner (PolkitUnixProcess *process,
-- GError **error);
--
- #ifdef HAVE_FREEBSD
- static gboolean get_kinfo_proc (gint pid, struct kinfo_proc *p);
- #endif
-@@ -170,7 +175,7 @@ polkit_unix_process_constructed (GObject *object)
- {
- GError *error;
- error = NULL;
-- process->uid = _polkit_unix_process_get_owner (process, &error);
-+ process->uid = polkit_unix_process_get_racy_uid__ (process, &error);
- if (error != NULL)
- {
- process->uid = -1;
-@@ -259,6 +264,12 @@ polkit_unix_process_class_init (PolkitUnixProcessClass *klass)
- * Gets the user id for @process. Note that this is the real user-id,
- * not the effective user-id.
- *
-+ * NOTE: The UID may change over time, so the returned value may not match the
-+ * current state of the underlying process; or the UID may have been set by
-+ * polkit_unix_process_new_for_owner() or polkit_unix_process_set_uid(),
-+ * in which case it may not correspond to the actual UID of the referenced
-+ * process at all (at any point in time).
-+ *
- * Returns: The user id for @process or -1 if unknown.
- */
- gint
-@@ -655,18 +666,26 @@ out:
- return start_time;
- }
-
--static gint
--_polkit_unix_process_get_owner (PolkitUnixProcess *process,
-- GError **error)
-+/*
-+ * Private: Return the "current" UID. Note that this is inherently racy,
-+ * and the value may already be obsolete by the time this function returns;
-+ * this function only guarantees that the UID was valid at some point during
-+ * its execution.
-+ */
-+gint
-+polkit_unix_process_get_racy_uid__ (PolkitUnixProcess *process,
-+ GError **error)
- {
- gint result;
- gchar *contents;
- gchar **lines;
-+ guint64 start_time;
- #ifdef HAVE_FREEBSD
- struct kinfo_proc p;
- #else
- gchar filename[64];
- guint n;
-+ GError *local_error;
- #endif
-
- g_return_val_if_fail (POLKIT_IS_UNIX_PROCESS (process), 0);
-@@ -689,6 +708,7 @@ _polkit_unix_process_get_owner (PolkitUnixProcess *process,
- }
-
- result = p.ki_uid;
-+ start_time = (guint64) p.ki_start.tv_sec;
- #else
-
- /* see 'man proc' for layout of the status file
-@@ -722,17 +742,37 @@ _polkit_unix_process_get_owner (PolkitUnixProcess *process,
- else
- {
- result = real_uid;
-- goto out;
-+ goto found;
- }
- }
--
- g_set_error (error,
- POLKIT_ERROR,
- POLKIT_ERROR_FAILED,
- "Didn't find any line starting with `Uid:' in file %s",
- filename);
-+ goto out;
-+
-+found:
-+ /* The UID and start time are, sadly, not available in a single file. So,
-+ * read the UID first, and then the start time; if the start time is the same
-+ * before and after reading the UID, it couldn't have changed.
-+ */
-+ local_error = NULL;
-+ start_time = get_start_time_for_pid (process->pid, &local_error);
-+ if (local_error != NULL)
-+ {
-+ g_propagate_error (error, local_error);
-+ goto out;
-+ }
- #endif
-
-+ if (process->start_time != start_time)
-+ {
-+ g_set_error (error, POLKIT_ERROR, POLKIT_ERROR_FAILED,
-+ "process with PID %d has been replaced", process->pid);
-+ goto out;
-+ }
-+
- out:
- g_strfreev (lines);
- g_free (contents);
-@@ -744,5 +784,5 @@ gint
- polkit_unix_process_get_owner (PolkitUnixProcess *process,
- GError **error)
- {
-- return _polkit_unix_process_get_owner (process, error);
-+ return polkit_unix_process_get_racy_uid__ (process, error);
- }
-diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
-index 73d0a0e29e24..97a8d8009886 100644
---- a/src/polkitbackend/polkitbackendinteractiveauthority.c
-+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -563,7 +563,7 @@ log_result (PolkitBackendInteractiveAuthority *authority,
- if (polkit_authorization_result_get_is_authorized (result))
- log_result_str = "ALLOWING";
-
-- user_of_subject = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, subject, NULL);
-+ user_of_subject = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, subject, NULL, NULL);
-
- subject_str = polkit_subject_to_string (subject);
-
-@@ -837,6 +837,7 @@ polkit_backend_interactive_authority_check_authorization (PolkitBackendAuthority
- gchar *subject_str;
- PolkitIdentity *user_of_caller;
- PolkitIdentity *user_of_subject;
-+ gboolean user_of_subject_matches;
- gchar *user_of_caller_str;
- gchar *user_of_subject_str;
- PolkitAuthorizationResult *result;
-@@ -882,7 +883,7 @@ polkit_backend_interactive_authority_check_authorization (PolkitBackendAuthority
- action_id);
-
- user_of_caller = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor,
-- caller,
-+ caller, NULL,
- &error);
- if (error != NULL)
- {
-@@ -897,7 +898,7 @@ polkit_backend_interactive_authority_check_authorization (PolkitBackendAuthority
- g_debug (" user of caller is %s", user_of_caller_str);
-
- user_of_subject = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor,
-- subject,
-+ subject, &user_of_subject_matches,
- &error);
- if (error != NULL)
- {
-@@ -927,7 +928,10 @@ polkit_backend_interactive_authority_check_authorization (PolkitBackendAuthority
- * We only allow this if, and only if,
- *
- * - processes may check for another process owned by the *same* user but not
-- * if details are passed (otherwise you'd be able to spoof the dialog)
-+ * if details are passed (otherwise you'd be able to spoof the dialog);
-+ * the caller supplies the user_of_subject value, so we additionally
-+ * require it to match at least at one point in time (via
-+ * user_of_subject_matches).
- *
- * - processes running as uid 0 may check anything and pass any details
- *
-@@ -935,7 +939,9 @@ polkit_backend_interactive_authority_check_authorization (PolkitBackendAuthority
- * then any uid referenced by that annotation is also allowed to check
- * to check anything and pass any details
- */
-- if (!polkit_identity_equal (user_of_caller, user_of_subject) || has_details)
-+ if (!user_of_subject_matches
-+ || !polkit_identity_equal (user_of_caller, user_of_subject)
-+ || has_details)
- {
- if (!may_identity_check_authorization (interactive_authority, action_id, user_of_caller))
- {
-@@ -1102,9 +1108,10 @@ check_authorization_sync (PolkitBackendAuthority *authority,
- goto out;
- }
-
-- /* every subject has a user */
-+ /* every subject has a user; this is supplied by the client, so we rely
-+ * on the caller to validate its acceptability. */
- user_of_subject = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor,
-- subject,
-+ subject, NULL,
- error);
- if (user_of_subject == NULL)
- goto out;
-@@ -2319,6 +2326,7 @@ polkit_backend_interactive_authority_register_authentication_agent (PolkitBacken
- PolkitSubject *session_for_caller;
- PolkitIdentity *user_of_caller;
- PolkitIdentity *user_of_subject;
-+ gboolean user_of_subject_matches;
- AuthenticationAgent *agent;
- gboolean ret;
- gchar *caller_cmdline;
-@@ -2371,7 +2379,7 @@ polkit_backend_interactive_authority_register_authentication_agent (PolkitBacken
- goto out;
- }
-
-- user_of_caller = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, caller, NULL);
-+ user_of_caller = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, caller, NULL, NULL);
- if (user_of_caller == NULL)
- {
- g_set_error (error,
-@@ -2380,7 +2388,7 @@ polkit_backend_interactive_authority_register_authentication_agent (PolkitBacken
- "Cannot determine user of caller");
- goto out;
- }
-- user_of_subject = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, subject, NULL);
-+ user_of_subject = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, subject, &user_of_subject_matches, NULL);
- if (user_of_subject == NULL)
- {
- g_set_error (error,
-@@ -2389,7 +2397,8 @@ polkit_backend_interactive_authority_register_authentication_agent (PolkitBacken
- "Cannot determine user of subject");
- goto out;
- }
-- if (!polkit_identity_equal (user_of_caller, user_of_subject))
-+ if (!user_of_subject_matches
-+ || !polkit_identity_equal (user_of_caller, user_of_subject))
- {
- if (POLKIT_IS_UNIX_USER (user_of_caller) && polkit_unix_user_get_uid (POLKIT_UNIX_USER (user_of_caller)) == 0)
- {
-@@ -2482,6 +2491,7 @@ polkit_backend_interactive_authority_unregister_authentication_agent (PolkitBack
- PolkitSubject *session_for_caller;
- PolkitIdentity *user_of_caller;
- PolkitIdentity *user_of_subject;
-+ gboolean user_of_subject_matches;
- AuthenticationAgent *agent;
- gboolean ret;
- gchar *scope_str;
-@@ -2530,7 +2540,7 @@ polkit_backend_interactive_authority_unregister_authentication_agent (PolkitBack
- goto out;
- }
-
-- user_of_caller = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, caller, NULL);
-+ user_of_caller = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, caller, NULL, NULL);
- if (user_of_caller == NULL)
- {
- g_set_error (error,
-@@ -2539,7 +2549,7 @@ polkit_backend_interactive_authority_unregister_authentication_agent (PolkitBack
- "Cannot determine user of caller");
- goto out;
- }
-- user_of_subject = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, subject, NULL);
-+ user_of_subject = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor, subject, &user_of_subject_matches, NULL);
- if (user_of_subject == NULL)
- {
- g_set_error (error,
-@@ -2548,7 +2558,8 @@ polkit_backend_interactive_authority_unregister_authentication_agent (PolkitBack
- "Cannot determine user of subject");
- goto out;
- }
-- if (!polkit_identity_equal (user_of_caller, user_of_subject))
-+ if (!user_of_subject_matches
-+ || !polkit_identity_equal (user_of_caller, user_of_subject))
- {
- if (POLKIT_IS_UNIX_USER (user_of_caller) && polkit_unix_user_get_uid (POLKIT_UNIX_USER (user_of_caller)) == 0)
- {
-@@ -2658,7 +2669,7 @@ polkit_backend_interactive_authority_authentication_agent_response (PolkitBacken
- identity_str);
-
- user_of_caller = polkit_backend_session_monitor_get_user_for_subject (priv->session_monitor,
-- caller,
-+ caller, NULL,
- error);
- if (user_of_caller == NULL)
- goto out;
-diff --git a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-index 6bd517abb169..773256e37ae0 100644
---- a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-+++ b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
-@@ -29,6 +29,7 @@
- #include <stdlib.h>
-
- #include <polkit/polkit.h>
-+#include <polkit/polkitprivate.h>
- #include "polkitbackendsessionmonitor.h"
-
- /* <internal>
-@@ -246,26 +247,40 @@ polkit_backend_session_monitor_get_sessions (PolkitBackendSessionMonitor *monito
- * polkit_backend_session_monitor_get_user:
- * @monitor: A #PolkitBackendSessionMonitor.
- * @subject: A #PolkitSubject.
-+ * @result_matches: If not %NULL, set to indicate whether the return value matches current (RACY) state.
- * @error: Return location for error.
- *
- * Gets the user corresponding to @subject or %NULL if no user exists.
- *
-+ * NOTE: For a #PolkitUnixProcess, the UID is read from @subject (which may
-+ * come from e.g. a D-Bus client), so it may not correspond to the actual UID
-+ * of the referenced process (at any point in time). This is indicated by
-+ * setting @result_matches to %FALSE; the caller may reject such subjects or
-+ * require additional privileges. @result_matches == %TRUE only indicates that
-+ * the UID matched the underlying process at ONE point in time, it may not match
-+ * later.
-+ *
- * Returns: %NULL if @error is set otherwise a #PolkitUnixUser that should be freed with g_object_unref().
- */
- PolkitIdentity *
- polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor *monitor,
- PolkitSubject *subject,
-+ gboolean *result_matches,
- GError **error)
- {
- PolkitIdentity *ret;
-- guint32 uid;
-+ gboolean matches;
-
- ret = NULL;
-+ matches = FALSE;
-
- if (POLKIT_IS_UNIX_PROCESS (subject))
- {
-- uid = polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject));
-- if ((gint) uid == -1)
-+ gint subject_uid, current_uid;
-+ GError *local_error;
-+
-+ subject_uid = polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject));
-+ if (subject_uid == -1)
- {
- g_set_error (error,
- POLKIT_ERROR,
-@@ -273,14 +288,24 @@ polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor
- "Unix process subject does not have uid set");
- goto out;
- }
-- ret = polkit_unix_user_new (uid);
-+ local_error = NULL;
-+ current_uid = polkit_unix_process_get_racy_uid__ (POLKIT_UNIX_PROCESS (subject), &local_error);
-+ if (local_error != NULL)
-+ {
-+ g_propagate_error (error, local_error);
-+ goto out;
-+ }
-+ ret = polkit_unix_user_new (subject_uid);
-+ matches = (subject_uid == current_uid);
- }
- else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
- {
- ret = (PolkitIdentity*)polkit_system_bus_name_get_user_sync (POLKIT_SYSTEM_BUS_NAME (subject), NULL, error);
-+ matches = TRUE;
- }
- else if (POLKIT_IS_UNIX_SESSION (subject))
- {
-+ uid_t uid;
-
- if (sd_session_get_uid (polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (subject)), &uid) < 0)
- {
-@@ -292,9 +317,14 @@ polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor
- }
-
- ret = polkit_unix_user_new (uid);
-+ matches = TRUE;
- }
-
- out:
-+ if (result_matches != NULL)
-+ {
-+ *result_matches = matches;
-+ }
- return ret;
- }
-
-diff --git a/src/polkitbackend/polkitbackendsessionmonitor.c b/src/polkitbackend/polkitbackendsessionmonitor.c
-index e1a9ab3a32cc..ed3075595dfb 100644
---- a/src/polkitbackend/polkitbackendsessionmonitor.c
-+++ b/src/polkitbackend/polkitbackendsessionmonitor.c
-@@ -27,6 +27,7 @@
- #include <glib/gstdio.h>
-
- #include <polkit/polkit.h>
-+#include <polkit/polkitprivate.h>
- #include "polkitbackendsessionmonitor.h"
-
- #define CKDB_PATH "/var/run/ConsoleKit/database"
-@@ -273,28 +274,40 @@ polkit_backend_session_monitor_get_sessions (PolkitBackendSessionMonitor *monito
- * polkit_backend_session_monitor_get_user:
- * @monitor: A #PolkitBackendSessionMonitor.
- * @subject: A #PolkitSubject.
-+ * @result_matches: If not %NULL, set to indicate whether the return value matches current (RACY) state.
- * @error: Return location for error.
- *
- * Gets the user corresponding to @subject or %NULL if no user exists.
- *
-+ * NOTE: For a #PolkitUnixProcess, the UID is read from @subject (which may
-+ * come from e.g. a D-Bus client), so it may not correspond to the actual UID
-+ * of the referenced process (at any point in time). This is indicated by
-+ * setting @result_matches to %FALSE; the caller may reject such subjects or
-+ * require additional privileges. @result_matches == %TRUE only indicates that
-+ * the UID matched the underlying process at ONE point in time, it may not match
-+ * later.
-+ *
- * Returns: %NULL if @error is set otherwise a #PolkitUnixUser that should be freed with g_object_unref().
- */
- PolkitIdentity *
- polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor *monitor,
- PolkitSubject *subject,
-+ gboolean *result_matches,
- GError **error)
- {
- PolkitIdentity *ret;
-+ gboolean matches;
- GError *local_error;
-- gchar *group;
-- guint32 uid;
-
- ret = NULL;
-+ matches = FALSE;
-
- if (POLKIT_IS_UNIX_PROCESS (subject))
- {
-- uid = polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject));
-- if ((gint) uid == -1)
-+ gint subject_uid, current_uid;
-+
-+ subject_uid = polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject));
-+ if (subject_uid == -1)
- {
- g_set_error (error,
- POLKIT_ERROR,
-@@ -302,14 +315,26 @@ polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor
- "Unix process subject does not have uid set");
- goto out;
- }
-- ret = polkit_unix_user_new (uid);
-+ local_error = NULL;
-+ current_uid = polkit_unix_process_get_racy_uid__ (POLKIT_UNIX_PROCESS (subject), &local_error);
-+ if (local_error != NULL)
-+ {
-+ g_propagate_error (error, local_error);
-+ goto out;
-+ }
-+ ret = polkit_unix_user_new (subject_uid);
-+ matches = (subject_uid == current_uid);
- }
- else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
- {
- ret = (PolkitIdentity*)polkit_system_bus_name_get_user_sync (POLKIT_SYSTEM_BUS_NAME (subject), NULL, error);
-+ matches = TRUE;
- }
- else if (POLKIT_IS_UNIX_SESSION (subject))
- {
-+ gint uid;
-+ gchar *group;
-+
- if (!ensure_database (monitor, error))
- {
- g_prefix_error (error, "Error getting user for session: Error ensuring CK database at " CKDB_PATH ": ");
-@@ -328,9 +353,14 @@ polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor
- g_free (group);
-
- ret = polkit_unix_user_new (uid);
-+ matches = TRUE;
- }
-
- out:
-+ if (result_matches != NULL)
-+ {
-+ *result_matches = matches;
-+ }
- return ret;
- }
-
-diff --git a/src/polkitbackend/polkitbackendsessionmonitor.h b/src/polkitbackend/polkitbackendsessionmonitor.h
-index 8f8a2caefd6b..3972326bf9f3 100644
---- a/src/polkitbackend/polkitbackendsessionmonitor.h
-+++ b/src/polkitbackend/polkitbackendsessionmonitor.h
-@@ -47,6 +47,7 @@ GList *polkit_backend_session_monitor_get_sessions (Polkit
-
- PolkitIdentity *polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor *monitor,
- PolkitSubject *subject,
-+ gboolean *result_matches,
- GError **error);
-
- PolkitSubject *polkit_backend_session_monitor_get_session_for_subject (PolkitBackendSessionMonitor *monitor,
diff --git a/patches/polkit-0.105/0038-0.116-Allow-negative-uids-gids-in-PolkitUnixUser-and.patch b/patches/polkit-0.105/0038-0.116-Allow-negative-uids-gids-in-PolkitUnixUser-and.patch
deleted file mode 100644
index 5ac4f582e..000000000
--- a/patches/polkit-0.105/0038-0.116-Allow-negative-uids-gids-in-PolkitUnixUser-and.patch
+++ /dev/null
@@ -1,191 +0,0 @@
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Mon, 3 Dec 2018 10:28:58 +0100
-Subject: [PATCH] 0.116: Allow negative uids/gids in PolkitUnixUser and Group
- objects
-
-(uid_t) -1 is still used as placeholder to mean "unset". This is OK, since
-there should be no users with such number, see
-https://systemd.io/UIDS-GIDS#special-linux-uids.
-
-(uid_t) -1 is used as the default value in class initialization.
-
-When a user or group above INT32_MAX is created, the numeric uid or
-gid wraps around to negative when the value is assigned to gint, and
-polkit gets confused. Let's accept such gids, except for -1.
-
-A nicer fix would be to change the underlying type to e.g. uint32 to
-not have negative values. But this cannot be done without breaking the
-API, so likely new functions will have to be added (a
-polkit_unix_user_new variant that takes a unsigned, and the same for
-_group_new, _set_uid, _get_uid, _set_gid, _get_gid, etc.). This will
-require a bigger patch.
-
-Fixes https://gitlab.freedesktop.org/polkit/polkit/issues/74.
-
-(cherry picked from commit 2cb40c4d5feeaa09325522bd7d97910f1b59e379)
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitunixgroup.c | 15 +++++++++++----
- src/polkit/polkitunixprocess.c | 12 ++++++++----
- src/polkit/polkitunixuser.c | 13 ++++++++++---
- 3 files changed, 29 insertions(+), 11 deletions(-)
-
-diff --git a/src/polkit/polkitunixgroup.c b/src/polkit/polkitunixgroup.c
-index c57a1aaacbb1..309f68918895 100644
---- a/src/polkit/polkitunixgroup.c
-+++ b/src/polkit/polkitunixgroup.c
-@@ -71,6 +71,7 @@ G_DEFINE_TYPE_WITH_CODE (PolkitUnixGroup, polkit_unix_group, G_TYPE_OBJECT,
- static void
- polkit_unix_group_init (PolkitUnixGroup *unix_group)
- {
-+ unix_group->gid = -1; /* (git_t) -1 is not a valid GID under Linux */
- }
-
- static void
-@@ -100,11 +101,14 @@ polkit_unix_group_set_property (GObject *object,
- GParamSpec *pspec)
- {
- PolkitUnixGroup *unix_group = POLKIT_UNIX_GROUP (object);
-+ gint val;
-
- switch (prop_id)
- {
- case PROP_GID:
-- unix_group->gid = g_value_get_int (value);
-+ val = g_value_get_int (value);
-+ g_return_if_fail (val != -1);
-+ unix_group->gid = val;
- break;
-
- default:
-@@ -131,9 +135,9 @@ polkit_unix_group_class_init (PolkitUnixGroupClass *klass)
- g_param_spec_int ("gid",
- "Group ID",
- "The UNIX group ID",
-- 0,
-+ G_MININT,
- G_MAXINT,
-- 0,
-+ -1,
- G_PARAM_CONSTRUCT |
- G_PARAM_READWRITE |
- G_PARAM_STATIC_NAME |
-@@ -166,9 +170,10 @@ polkit_unix_group_get_gid (PolkitUnixGroup *group)
- */
- void
- polkit_unix_group_set_gid (PolkitUnixGroup *group,
-- gint gid)
-+ gint gid)
- {
- g_return_if_fail (POLKIT_IS_UNIX_GROUP (group));
-+ g_return_if_fail (gid != -1);
- group->gid = gid;
- }
-
-@@ -183,6 +188,8 @@ polkit_unix_group_set_gid (PolkitUnixGroup *group,
- PolkitIdentity *
- polkit_unix_group_new (gint gid)
- {
-+ g_return_val_if_fail (gid != -1, NULL);
-+
- return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_GROUP,
- "gid", gid,
- NULL));
-diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c
-index 464f034c0a21..02a083f70a1c 100644
---- a/src/polkit/polkitunixprocess.c
-+++ b/src/polkit/polkitunixprocess.c
-@@ -147,9 +147,14 @@ polkit_unix_process_set_property (GObject *object,
- polkit_unix_process_set_pid (unix_process, g_value_get_int (value));
- break;
-
-- case PROP_UID:
-- polkit_unix_process_set_uid (unix_process, g_value_get_int (value));
-+ case PROP_UID: {
-+ gint val;
-+
-+ val = g_value_get_int (value);
-+ g_return_if_fail (val != -1);
-+ polkit_unix_process_set_uid (unix_process, val);
- break;
-+ }
-
- case PROP_START_TIME:
- polkit_unix_process_set_start_time (unix_process, g_value_get_uint64 (value));
-@@ -227,7 +232,7 @@ polkit_unix_process_class_init (PolkitUnixProcessClass *klass)
- g_param_spec_int ("uid",
- "User ID",
- "The UNIX user ID",
-- -1,
-+ G_MININT,
- G_MAXINT,
- -1,
- G_PARAM_CONSTRUCT |
-@@ -291,7 +296,6 @@ polkit_unix_process_set_uid (PolkitUnixProcess *process,
- gint uid)
- {
- g_return_if_fail (POLKIT_IS_UNIX_PROCESS (process));
-- g_return_if_fail (uid >= -1);
- process->uid = uid;
- }
-
-diff --git a/src/polkit/polkitunixuser.c b/src/polkit/polkitunixuser.c
-index 8bfd3a1fb05d..234a6976c573 100644
---- a/src/polkit/polkitunixuser.c
-+++ b/src/polkit/polkitunixuser.c
-@@ -72,6 +72,7 @@ G_DEFINE_TYPE_WITH_CODE (PolkitUnixUser, polkit_unix_user, G_TYPE_OBJECT,
- static void
- polkit_unix_user_init (PolkitUnixUser *unix_user)
- {
-+ unix_user->uid = -1; /* (uid_t) -1 is not a valid UID under Linux */
- unix_user->name = NULL;
- }
-
-@@ -112,11 +113,14 @@ polkit_unix_user_set_property (GObject *object,
- GParamSpec *pspec)
- {
- PolkitUnixUser *unix_user = POLKIT_UNIX_USER (object);
-+ gint val;
-
- switch (prop_id)
- {
- case PROP_UID:
-- unix_user->uid = g_value_get_int (value);
-+ val = g_value_get_int (value);
-+ g_return_if_fail (val != -1);
-+ unix_user->uid = val;
- break;
-
- default:
-@@ -144,9 +148,9 @@ polkit_unix_user_class_init (PolkitUnixUserClass *klass)
- g_param_spec_int ("uid",
- "User ID",
- "The UNIX user ID",
-- 0,
-+ G_MININT,
- G_MAXINT,
-- 0,
-+ -1,
- G_PARAM_CONSTRUCT |
- G_PARAM_READWRITE |
- G_PARAM_STATIC_NAME |
-@@ -182,6 +186,7 @@ polkit_unix_user_set_uid (PolkitUnixUser *user,
- gint uid)
- {
- g_return_if_fail (POLKIT_IS_UNIX_USER (user));
-+ g_return_if_fail (uid != -1);
- user->uid = uid;
- }
-
-@@ -196,6 +201,8 @@ polkit_unix_user_set_uid (PolkitUnixUser *user,
- PolkitIdentity *
- polkit_unix_user_new (gint uid)
- {
-+ g_return_val_if_fail (uid != -1, NULL);
-+
- return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_USER,
- "uid", uid,
- NULL));
diff --git a/patches/polkit-0.105/0039-0.116-Allow-uid-of-1-for-a-PolkitUnixProcess.patch b/patches/polkit-0.105/0039-0.116-Allow-uid-of-1-for-a-PolkitUnixProcess.patch
deleted file mode 100644
index cdb6c31d9..000000000
--- a/patches/polkit-0.105/0039-0.116-Allow-uid-of-1-for-a-PolkitUnixProcess.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Matthew Leeds <matthew.leeds@endlessm.com>
-Date: Tue, 11 Dec 2018 12:04:26 -0800
-Subject: [PATCH] 0.116: Allow uid of -1 for a PolkitUnixProcess
-
-Commit 2cb40c4d5 changed PolkitUnixUser, PolkitUnixGroup, and
-PolkitUnixProcess to allow negative values for their uid/gid properties,
-since these are values above INT_MAX which wrap around but are still
-valid, with the exception of -1 which is not valid. However,
-PolkitUnixProcess allows a uid of -1 to be passed to
-polkit_unix_process_new_for_owner() which means polkit is expected to
-figure out the uid on its own (this happens in the _constructed
-function). So this commit removes the check in
-polkit_unix_process_set_property() so that new_for_owner() can be used
-as documented without producing a critical error message.
-
-This does not affect the protection against CVE-2018-19788 which is
-based on creating a user with a UID up to but not including 4294967295
-(-1).
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitunixprocess.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
-
-diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c
-index 02a083f70a1c..4a4256746d6e 100644
---- a/src/polkit/polkitunixprocess.c
-+++ b/src/polkit/polkitunixprocess.c
-@@ -147,14 +147,9 @@ polkit_unix_process_set_property (GObject *object,
- polkit_unix_process_set_pid (unix_process, g_value_get_int (value));
- break;
-
-- case PROP_UID: {
-- gint val;
--
-- val = g_value_get_int (value);
-- g_return_if_fail (val != -1);
-- polkit_unix_process_set_uid (unix_process, val);
-+ case PROP_UID:
-+ polkit_unix_process_set_uid (unix_process, g_value_get_int (value));
- break;
-- }
-
- case PROP_START_TIME:
- polkit_unix_process_set_start_time (unix_process, g_value_get_uint64 (value));
diff --git a/patches/polkit-0.105/0040-Revert-Default-to-AdminIdentities-unix-group-wheel-f.patch b/patches/polkit-0.105/0040-Revert-Default-to-AdminIdentities-unix-group-wheel-f.patch
deleted file mode 100644
index cd41f00be..000000000
--- a/patches/polkit-0.105/0040-Revert-Default-to-AdminIdentities-unix-group-wheel-f.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From: Michael Biebl <biebl@debian.org>
-Date: Fri, 9 Dec 2011 00:31:21 +0100
-Subject: [PATCH] Revert "Default to AdminIdentities=unix-group:wheel for local
- authority"
-
-This reverts commit 763faf434b445c20ae9529100d3ef5290976d0c9.
-
-On Red Hat derivatives, every member of group 'wheel' is necessarily
-privileged. On Debian derivatives, there is no wheel group, and gid 0
-(root) is not used in this way. Change the default rule to consider
-uid 0 to be privileged, instead.
-
-On Red Hat derivatives, 50-default.rules is not preserved by upgrades;
-on dpkg-based systems, it is a proper conffile and may be edited
-(at the sysadmin's own risk), so the comment about not editing it is
-misleading.
-
-[smcv: added longer explanation of why we make this change;
-remove unrelated cosmetic change to a man page]
-
-Forwarded: no, Debian-specific
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkitbackend/50-localauthority.conf | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/polkitbackend/50-localauthority.conf b/src/polkitbackend/50-localauthority.conf
-index 5e44bde08869..20e0ba344e83 100644
---- a/src/polkitbackend/50-localauthority.conf
-+++ b/src/polkitbackend/50-localauthority.conf
-@@ -7,4 +7,4 @@
- #
-
- [Configuration]
--AdminIdentities=unix-group:wheel
-+AdminIdentities=unix-user:0
diff --git a/patches/polkit-0.105/0041-Build-against-libsystemd.patch b/patches/polkit-0.105/0041-Build-against-libsystemd.patch
deleted file mode 100644
index 76ef40029..000000000
--- a/patches/polkit-0.105/0041-Build-against-libsystemd.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Michael Biebl <biebl@debian.org>
-Date: Wed, 8 Jul 2015 02:08:33 +0200
-Subject: [PATCH] Build against libsystemd
-
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779756
-Forwarded: no, obsoleted by upstream commit 2291767a014f5a04a92ca6f0eb472794f212ca67 in 0.113
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure.ac | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 388605d2cb08..f55ddb7fa002 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -160,7 +160,7 @@ AC_ARG_ENABLE([systemd],
- [enable_systemd=auto])
- if test "$enable_systemd" != "no"; then
- PKG_CHECK_MODULES(SYSTEMD,
-- [libsystemd-login],
-+ [libsystemd],
- have_systemd=yes,
- have_systemd=no)
- if test "$have_systemd" = "yes"; then
-@@ -171,7 +171,7 @@ if test "$enable_systemd" != "no"; then
- LIBS=$save_LIBS
- else
- if test "$enable_systemd" = "yes"; then
-- AC_MSG_ERROR([systemd support requested but libsystemd-login1 library not found])
-+ AC_MSG_ERROR([systemd support requested but libsystemd library not found])
- fi
- fi
- fi
diff --git a/patches/polkit-0.105/0042-Move-D-Bus-policy-file-to-usr-share-dbus-1-system.d.patch b/patches/polkit-0.105/0042-Move-D-Bus-policy-file-to-usr-share-dbus-1-system.d.patch
deleted file mode 100644
index 89ecb9e66..000000000
--- a/patches/polkit-0.105/0042-Move-D-Bus-policy-file-to-usr-share-dbus-1-system.d.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Michael Biebl <biebl@debian.org>
-Date: Tue, 27 Nov 2018 18:36:27 +0100
-Subject: [PATCH] Move D-Bus policy file to /usr/share/dbus-1/system.d/
-
-To better support stateless systems with an empty /etc, the old location
-in /etc/dbus-1/system.d/ should only be used for local admin changes.
-Package provided D-Bus policy files are supposed to be installed in
-/usr/share/dbus-1/system.d/.
-
-This is supported since dbus 1.9.18.
-
-https://lists.freedesktop.org/archives/dbus/2015-July/016746.html
-
-https://gitlab.freedesktop.org/polkit/polkit/merge_requests/11
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- data/Makefile.am | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/data/Makefile.am b/data/Makefile.am
-index f0beeba42cd2..ec41433b48d9 100644
---- a/data/Makefile.am
-+++ b/data/Makefile.am
-@@ -9,7 +9,7 @@ service_DATA = $(service_in_files:.service.in=.service)
- $(service_DATA): $(service_in_files) Makefile
- @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
-
--dbusconfdir = $(sysconfdir)/dbus-1/system.d
-+dbusconfdir = $(datadir)/dbus-1/system.d
- dbusconf_DATA = org.freedesktop.PolicyKit1.conf
-
- if POLKIT_AUTHFW_PAM
diff --git a/patches/polkit-0.105/0043-0.116-backend-Compare-PolkitUnixProcess-uids-for-tem.patch b/patches/polkit-0.105/0043-0.116-backend-Compare-PolkitUnixProcess-uids-for-tem.patch
deleted file mode 100644
index 93af341dc..000000000
--- a/patches/polkit-0.105/0043-0.116-backend-Compare-PolkitUnixProcess-uids-for-tem.patch
+++ /dev/null
@@ -1,186 +0,0 @@
-From: Colin Walters <walters@verbum.org>
-Date: Fri, 4 Jan 2019 14:24:48 -0500
-Subject: [PATCH] 0.116: backend: Compare PolkitUnixProcess uids for temporary
- authorizations
-
-It turns out that the combination of `(pid, start time)` is not
-enough to be unique. For temporary authorizations, we can avoid
-separate users racing on pid reuse by simply comparing the uid.
-
-https://bugs.chromium.org/p/project-zero/issues/detail?id=1692
-
-And the above original email report is included in full in a new comment.
-
-Reported-by: Jann Horn <jannh@google.com>
-
-Closes: https://gitlab.freedesktop.org/polkit/polkit/issues/75
-(cherry picked from commit 6cc6aafee135ba44ea748250d7d29b562ca190e3)
-
-Imported from policykit-1_0.105-25.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/polkit/polkitsubject.c | 2 +
- src/polkit/polkitunixprocess.c | 71 ++++++++++++++++++-
- .../polkitbackendinteractiveauthority.c | 39 +++++++++-
- 3 files changed, 110 insertions(+), 2 deletions(-)
-
-diff --git a/src/polkit/polkitsubject.c b/src/polkit/polkitsubject.c
-index 78ec745a4df2..fadcfe9b624e 100644
---- a/src/polkit/polkitsubject.c
-+++ b/src/polkit/polkitsubject.c
-@@ -99,6 +99,8 @@ polkit_subject_hash (PolkitSubject *subject)
- * @b: A #PolkitSubject.
- *
- * Checks if @a and @b are equal, ie. represent the same subject.
-+ * However, avoid calling polkit_subject_equal() to compare two processes;
-+ * for more information see the `PolkitUnixProcess` documentation.
- *
- * This function can be used in e.g. g_hash_table_new().
- *
-diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c
-index 4a4256746d6e..0f33598a7401 100644
---- a/src/polkit/polkitunixprocess.c
-+++ b/src/polkit/polkitunixprocess.c
-@@ -44,7 +44,10 @@
- * @title: PolkitUnixProcess
- * @short_description: Unix processs
- *
-- * An object for representing a UNIX process.
-+ * An object for representing a UNIX process. NOTE: This object as
-+ * designed is now known broken; a mechanism to exploit a delay in
-+ * start time in the Linux kernel was identified. Avoid
-+ * calling polkit_subject_equal() to compare two processes.
- *
- * To uniquely identify processes, both the process id and the start
- * time of the process (a monotonic increasing value representing the
-@@ -59,6 +62,72 @@
- * polkit_unix_process_new_for_owner() with trusted data.
- */
-
-+/* See https://gitlab.freedesktop.org/polkit/polkit/issues/75
-+
-+ But quoting the original email in full here to ensure it's preserved:
-+
-+ From: Jann Horn <jannh@google.com>
-+ Subject: 0.116: [SECURITY] polkit: temporary auth hijacking via PID reuse and non-atomic fork
-+ Date: Wednesday, October 10, 2018 5:34 PM
-+
-+When a (non-root) user attempts to e.g. control systemd units in the system
-+instance from an active session over DBus, the access is gated by a polkit
-+policy that requires "auth_admin_keep" auth. This results in an auth prompt
-+being shown to the user, asking the user to confirm the action by entering the
-+password of an administrator account.
-+
-+After the action has been confirmed, the auth decision for "auth_admin_keep" is
-+cached for up to five minutes. Subject to some restrictions, similar actions can
-+then be performed in this timespan without requiring re-auth:
-+
-+ - The PID of the DBus client requesting the new action must match the PID of
-+ the DBus client requesting the old action (based on SO_PEERCRED information
-+ forwarded by the DBus daemon).
-+ - The "start time" of the client's PID (as seen in /proc/$pid/stat, field 22)
-+ must not have changed. The granularity of this timestamp is in the
-+ millisecond range.
-+ - polkit polls every two seconds whether a process with the expected start time
-+ still exists. If not, the temporary auth entry is purged.
-+
-+Without the start time check, this would obviously be buggy because an attacker
-+could simply wait for the legitimate client to disappear, then create a new
-+client with the same PID.
-+
-+Unfortunately, the start time check is bypassable because fork() is not atomic.
-+Looking at the source code of copy_process() in the kernel:
-+
-+ p->start_time = ktime_get_ns();
-+ p->real_start_time = ktime_get_boot_ns();
-+ [...]
-+ retval = copy_thread_tls(clone_flags, stack_start, stack_size, p, tls);
-+ if (retval)
-+ goto bad_fork_cleanup_io;
-+
-+ if (pid != &init_struct_pid) {
-+ pid = alloc_pid(p->nsproxy->pid_ns_for_children);
-+ if (IS_ERR(pid)) {
-+ retval = PTR_ERR(pid);
-+ goto bad_fork_cleanup_thread;
-+ }
-+ }
-+
-+The ktime_get_boot_ns() call is where the "start time" of the process is
-+recorded. The alloc_pid() call is where a free PID is allocated. In between
-+these, some time passes; and because the copy_thread_tls() call between them can
-+access userspace memory when sys_clone() is invoked through the 32-bit syscall
-+entry point, an attacker can even stall the kernel arbitrarily long at this
-+point (by supplying a pointer into userspace memory that is associated with a
-+userfaultfd or is backed by a custom FUSE filesystem).
-+
-+This means that an attacker can immediately call sys_clone() when the victim
-+process is created, often resulting in a process that has the exact same start
-+time reported in procfs; and then the attacker can delay the alloc_pid() call
-+until after the victim process has died and the PID assignment has cycled
-+around. This results in an attacker process that polkit can't distinguish from
-+the victim process.
-+*/
-+
-+
- /**
- * PolkitUnixProcess:
- *
-diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
-index 97a8d8009886..1e17dfd5b695 100644
---- a/src/polkitbackend/polkitbackendinteractiveauthority.c
-+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -2870,6 +2870,43 @@ temporary_authorization_store_free (TemporaryAuthorizationStore *store)
- g_free (store);
- }
-
-+/* See the comment at the top of polkitunixprocess.c */
-+static gboolean
-+subject_equal_for_authz (PolkitSubject *a,
-+ PolkitSubject *b)
-+{
-+ if (!polkit_subject_equal (a, b))
-+ return FALSE;
-+
-+ /* Now special case unix processes, as we want to protect against
-+ * pid reuse by including the UID.
-+ */
-+ if (POLKIT_IS_UNIX_PROCESS (a) && POLKIT_IS_UNIX_PROCESS (b)) {
-+ PolkitUnixProcess *ap = (PolkitUnixProcess*)a;
-+ int uid_a = polkit_unix_process_get_uid ((PolkitUnixProcess*)a);
-+ PolkitUnixProcess *bp = (PolkitUnixProcess*)b;
-+ int uid_b = polkit_unix_process_get_uid ((PolkitUnixProcess*)b);
-+
-+ if (uid_a != -1 && uid_b != -1)
-+ {
-+ if (uid_a == uid_b)
-+ {
-+ return TRUE;
-+ }
-+ else
-+ {
-+ g_printerr ("denying slowfork; pid %d uid %d != %d!\n",
-+ polkit_unix_process_get_pid (ap),
-+ uid_a, uid_b);
-+ return FALSE;
-+ }
-+ }
-+ /* Fall through; one of the uids is unset so we can't reliably compare */
-+ }
-+
-+ return TRUE;
-+}
-+
- static gboolean
- temporary_authorization_store_has_authorization (TemporaryAuthorizationStore *store,
- PolkitSubject *subject,
-@@ -2912,7 +2949,7 @@ temporary_authorization_store_has_authorization (TemporaryAuthorizationStore *st
- TemporaryAuthorization *authorization = l->data;
-
- if (strcmp (action_id, authorization->action_id) == 0 &&
-- polkit_subject_equal (subject_to_use, authorization->subject))
-+ subject_equal_for_authz (subject_to_use, authorization->subject))
- {
- ret = TRUE;
- if (out_tmp_authz_id != NULL)
diff --git a/patches/polkit-0.105/0100-automake-add-missing-conditional-HAVE_INTROSPECTION.patch b/patches/polkit-0.105/0100-automake-add-missing-conditional-HAVE_INTROSPECTION.patch
deleted file mode 100644
index 88afa7a00..000000000
--- a/patches/polkit-0.105/0100-automake-add-missing-conditional-HAVE_INTROSPECTION.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-From: =?UTF-8?q?Ulrich=20=C3=96lmann?= <u.oelmann@pengutronix.de>
-Date: Wed, 4 Oct 2017 10:57:38 +0200
-Subject: [PATCH] automake: add missing conditional HAVE_INTROSPECTION
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Copy the corresponding m4 file from gobject-introspection-1.52.1.
-
-Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
----
- Makefile.am | 2 ++
- m4/introspection.m4 | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 98 insertions(+)
- create mode 100644 m4/introspection.m4
-
-diff --git a/Makefile.am b/Makefile.am
-index 01f0a4bae8f3..d7ad566dc5f7 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1,5 +1,7 @@
- ## Process this file with automake to produce Makefile.in
-
-+ACLOCAL_AMFLAGS = -I m4
-+
- SUBDIRS = actions data src docs po test
-
- NULL =
-diff --git a/m4/introspection.m4 b/m4/introspection.m4
-new file mode 100644
-index 000000000000..d89c3d907d9c
---- /dev/null
-+++ b/m4/introspection.m4
-@@ -0,0 +1,96 @@
-+dnl -*- mode: autoconf -*-
-+dnl Copyright 2009 Johan Dahlin
-+dnl
-+dnl This file is free software; the author(s) gives unlimited
-+dnl permission to copy and/or distribute it, with or without
-+dnl modifications, as long as this notice is preserved.
-+dnl
-+
-+# serial 1
-+
-+m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
-+[
-+ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
-+ AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
-+ AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
-+
-+ dnl enable/disable introspection
-+ m4_if([$2], [require],
-+ [dnl
-+ enable_introspection=yes
-+ ],[dnl
-+ AC_ARG_ENABLE(introspection,
-+ AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
-+ [Enable introspection for this build]),,
-+ [enable_introspection=auto])
-+ ])dnl
-+
-+ AC_MSG_CHECKING([for gobject-introspection])
-+
-+ dnl presence/version checking
-+ AS_CASE([$enable_introspection],
-+ [no], [dnl
-+ found_introspection="no (disabled, use --enable-introspection to enable)"
-+ ],dnl
-+ [yes],[dnl
-+ PKG_CHECK_EXISTS([gobject-introspection-1.0],,
-+ AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
-+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
-+ found_introspection=yes,
-+ AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
-+ ],dnl
-+ [auto],[dnl
-+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
-+ dnl Canonicalize enable_introspection
-+ enable_introspection=$found_introspection
-+ ],dnl
-+ [dnl
-+ AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
-+ ])dnl
-+
-+ AC_MSG_RESULT([$found_introspection])
-+
-+ INTROSPECTION_SCANNER=
-+ INTROSPECTION_COMPILER=
-+ INTROSPECTION_GENERATE=
-+ INTROSPECTION_GIRDIR=
-+ INTROSPECTION_TYPELIBDIR=
-+ if test "x$found_introspection" = "xyes"; then
-+ INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
-+ INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
-+ INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
-+ INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
-+ INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
-+ INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
-+ INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
-+ INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
-+ fi
-+ AC_SUBST(INTROSPECTION_SCANNER)
-+ AC_SUBST(INTROSPECTION_COMPILER)
-+ AC_SUBST(INTROSPECTION_GENERATE)
-+ AC_SUBST(INTROSPECTION_GIRDIR)
-+ AC_SUBST(INTROSPECTION_TYPELIBDIR)
-+ AC_SUBST(INTROSPECTION_CFLAGS)
-+ AC_SUBST(INTROSPECTION_LIBS)
-+ AC_SUBST(INTROSPECTION_MAKEFILE)
-+
-+ AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
-+])
-+
-+
-+dnl Usage:
-+dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
-+
-+AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
-+[
-+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
-+])
-+
-+dnl Usage:
-+dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
-+
-+
-+AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
-+[
-+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
-+])
diff --git a/patches/polkit-0.105/0101-Add-a-systemd-.service-file.patch b/patches/polkit-0.105/0101-Add-a-systemd-.service-file.patch
deleted file mode 100644
index abb26ccf0..000000000
--- a/patches/polkit-0.105/0101-Add-a-systemd-.service-file.patch
+++ /dev/null
@@ -1,121 +0,0 @@
-From: David Zeuthen <davidz@redhat.com>
-Date: Wed, 23 May 2012 16:16:20 -0400
-Subject: [PATCH] Add a systemd .service file
-
-Signed-off-by: David Zeuthen <davidz@redhat.com>
----
- Makefile.am | 7 ++++++-
- configure.ac | 16 +++++++++++++++-
- data/Makefile.am | 13 ++++++++++++-
- data/org.freedesktop.PolicyKit1.service.in | 1 +
- data/polkit.service.in | 8 ++++++++
- 5 files changed, 42 insertions(+), 3 deletions(-)
- create mode 100644 data/polkit.service.in
-
-diff --git a/Makefile.am b/Makefile.am
-index d7ad566dc5f7..f66424040277 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -11,7 +11,12 @@ EXTRA_DIST = \
- $(NULL)
-
- # xsltproc barfs on 'make distcheck'; disable for now
--DISTCHECK_CONFIGURE_FLAGS=--disable-man-pages --disable-gtk-doc --disable-introspection
-+DISTCHECK_CONFIGURE_FLAGS= \
-+ --disable-man-pages \
-+ --disable-gtk-doc \
-+ --disable-introspection \
-+ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
-+ $(NULL)
-
- sign : dist
- gpg --armor --detach-sign --output polkit-$(VERSION).tar.gz.sign polkit-$(VERSION).tar.gz
-diff --git a/configure.ac b/configure.ac
-index f55ddb7fa002..e1a514599d0e 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -180,6 +180,19 @@ AC_SUBST(SYSTEMD_CFLAGS)
- AC_SUBST(SYSTEMD_LIBS)
- AM_CONDITIONAL(HAVE_SYSTEMD, [test "$have_systemd" = "yes"], [Using systemd])
-
-+dnl ---------------------------------------------------------------------------
-+dnl - systemd unit / service files
-+dnl ---------------------------------------------------------------------------
-+
-+AC_ARG_WITH([systemdsystemunitdir],
-+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
-+ [],
-+ [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
-+if test "x$with_systemdsystemunitdir" != "xno"; then
-+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
-+fi
-+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$systemdsystemunitdir"])
-+
- dnl ---------------------------------------------------------------------------
- dnl - Select which authentication framework to use
- dnl ---------------------------------------------------------------------------
-@@ -484,7 +497,8 @@ echo "
- Distribution/OS: ${with_os_type}
- Authentication framework: ${POLKIT_AUTHFW}
- Session tracking: ${SESSION_TRACKING}
-- PAM support: ${have_pam}"
-+ PAM support: ${have_pam}
-+ systemdsystemunitdir: ${systemdsystemunitdir}"
-
- if test "$have_pam" = yes ; then
- echo "
-diff --git a/data/Makefile.am b/data/Makefile.am
-index ec41433b48d9..17e829b97421 100644
---- a/data/Makefile.am
-+++ b/data/Makefile.am
-@@ -20,15 +20,26 @@ endif
- pkgconfigdir = $(libdir)/pkgconfig
- pkgconfig_DATA = polkit-gobject-1.pc polkit-backend-1.pc polkit-agent-1.pc
-
-+
-+systemdservice_in_files = polkit.service.in
-+
-+if HAVE_SYSTEMD
-+systemdservicedir = $(systemdsystemunitdir)
-+systemdservice_DATA = $(systemdservice_in_files:.service.in=.service)
-+$(systemdservice_DATA): $(systemdservice_in_files) Makefile
-+ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
-+endif
-+
- CLEANFILES = $(BUILT_SOURCES)
-
- EXTRA_DIST = \
- org.freedesktop.PolicyKit1.Authority.xml \
- org.freedesktop.PolicyKit1.AuthenticationAgent.xml \
- $(service_in_files) \
-+ $(systemdservice_in_files) \
- $(dbusconf_DATA) \
- $(NULL)
-
-
- clean-local :
-- rm -f *~ $(service_DATA)
-+ rm -f *~ $(service_DATA) $(systemdservice_DATA)
-diff --git a/data/org.freedesktop.PolicyKit1.service.in b/data/org.freedesktop.PolicyKit1.service.in
-index b6cd02b6e47c..fbceb3ffe31a 100644
---- a/data/org.freedesktop.PolicyKit1.service.in
-+++ b/data/org.freedesktop.PolicyKit1.service.in
-@@ -2,3 +2,4 @@
- Name=org.freedesktop.PolicyKit1
- Exec=@libexecdir@/polkitd --no-debug
- User=root
-+SystemdService=polkit.service
-diff --git a/data/polkit.service.in b/data/polkit.service.in
-new file mode 100644
-index 000000000000..efd29481d847
---- /dev/null
-+++ b/data/polkit.service.in
-@@ -0,0 +1,8 @@
-+[Unit]
-+Description=Authorization Manager
-+Documentation=man:polkit(8)
-+
-+[Service]
-+Type=dbus
-+BusName=org.freedesktop.PolicyKit1
-+ExecStart=@libexecdir@/polkitd --no-debug
diff --git a/patches/polkit-0.105/autogen.sh b/patches/polkit-0.105/autogen.sh
deleted file mode 120000
index 9f8a4cb7d..000000000
--- a/patches/polkit-0.105/autogen.sh
+++ /dev/null
@@ -1 +0,0 @@
-../autogen.sh \ No newline at end of file
diff --git a/patches/polkit-0.105/series b/patches/polkit-0.105/series
deleted file mode 100644
index 107495884..000000000
--- a/patches/polkit-0.105/series
+++ /dev/null
@@ -1,50 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-#tag:debian --start-number 1
-0001-0.106-agenthelper-pam-Fix-newline-trimming-code.patch
-0002-0.108-build-Fix-.gir-generation-for-parallel-make.patch
-0003-0.110-Set-XAUTHORITY-environment-variable-if-is-unse.patch
-0004-0.110-Fix-build-on-GNU-Hurd.patch
-0005-0.111-pkexec-Set-process-environment-from-pam_getenv.patch
-0006-0.111-Fix-a-memory-leak.patch
-0007-0.112-Use-GOnce-for-interface-type-registration.patch
-0008-0.112-polkitunixprocess-Deprecate-racy-APIs.patch
-0009-0.112-pkcheck-Support-process-pid-start-time-uid-syn.patch
-0010-0.113-Port-internals-non-deprecated-PolkitProcess-AP.patch
-0011-0.113-pkexec-Work-around-systemd-injecting-broken-XD.patch
-0012-0.113-PolkitAgentSession-fix-race-between-child-and-.patch
-0013-0.113-polkitd-Fix-problem-with-removing-non-existent.patch
-0014-0.113-PolkitSystemBusName-Add-public-API-to-retrieve.patch
-0015-0.113-Fixed-compilation-problem-in-the-backend.patch
-0016-0.113-Don-t-discard-error-data-returned-by-polkit_sy.patch
-0017-0.113-sessionmonitor-systemd-Deduplicate-code-paths.patch
-0018-0.113-sessionmonitor-systemd-prepare-for-D-Bus-user-.patch
-0019-0.113-Refuse-duplicate-user-arguments-to-pkexec.patch
-0020-0.113-authority-Fix-memory-leak-in-EnumerateActions-.patch
-0021-0.113-CVE-2015-3218-backend-Handle-invalid-object-pa.patch
-0022-0.113-sessionmonitor-systemd-Use-sd_uid_get_state-to.patch
-0023-0.113-Fix-a-possible-NULL-dereference.patch
-0024-0.113-Remove-a-redundant-assignment.patch
-0025-0.113-Fix-duplicate-GError-use-when-uid-is-missing.patch
-0026-0.113-Fix-a-crash-when-two-authentication-requests-a.patch
-0027-0.113-CVE-2015-4625-Use-unpredictable-cookie-values-.patch
-0028-0.113-CVE-2015-4625-Bind-use-of-cookies-to-specific-.patch
-0029-0.113-docs-Update-for-changes-to-uid-binding-Authent.patch
-0030-0.113-Fix-a-per-authorization-memory-leak.patch
-0031-0.113-Fix-a-memory-leak-when-registering-an-authenti.patch
-0032-0.113-CVE-2015-3255-Fix-GHashTable-usage.patch
-0033-0.113-Fix-use-after-free-in-polkitagentsession.c.patch
-0034-0.114-Fix-multi-line-pam-text-info.patch
-0035-0.114-Refactor-send_to_helper-usage.patch
-0036-0.114-Support-polkit-session-agent-running-outside-u.patch
-0037-0.115-Fix-CVE-2018-1116-Trusting-client-supplied-UID.patch
-0038-0.116-Allow-negative-uids-gids-in-PolkitUnixUser-and.patch
-0039-0.116-Allow-uid-of-1-for-a-PolkitUnixProcess.patch
-0040-Revert-Default-to-AdminIdentities-unix-group-wheel-f.patch
-0041-Build-against-libsystemd.patch
-0042-Move-D-Bus-policy-file-to-usr-share-dbus-1-system.d.patch
-0043-0.116-backend-Compare-PolkitUnixProcess-uids-for-tem.patch
-#tag:ptxdist --start-number 100
-0100-automake-add-missing-conditional-HAVE_INTROSPECTION.patch
-0101-Add-a-systemd-.service-file.patch
-# 6f0039b018c1c5a63bb80b750d1301dd - git-ptx-patches magic
diff --git a/patches/polkit-124/0001-build-install-polkit-agent-1-library-with-libs-only.patch b/patches/polkit-124/0001-build-install-polkit-agent-1-library-with-libs-only.patch
new file mode 100644
index 000000000..460128a19
--- /dev/null
+++ b/patches/polkit-124/0001-build-install-polkit-agent-1-library-with-libs-only.patch
@@ -0,0 +1,65 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Wed, 10 Apr 2024 16:53:02 +0200
+Subject: [PATCH] build: install polkit-agent-1 library with libs-only
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ src/meson.build | 2 +-
+ src/polkitagent/meson.build | 30 ++++++++++++++++--------------
+ 2 files changed, 17 insertions(+), 15 deletions(-)
+
+diff --git a/src/meson.build b/src/meson.build
+index 985d0b08a729..f584e9e0d074 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -4,9 +4,9 @@ symbol_map = meson.current_source_dir() / 'symbol.map'
+ ldflags = cc.get_supported_link_arguments('-Wl,--version-script,@0@'.format(symbol_map))
+
+ subdir('polkit')
++subdir('polkitagent')
+ if not get_option('libs-only')
+ subdir('polkitbackend')
+- subdir('polkitagent')
+ subdir('programs')
+ endif
+
+diff --git a/src/polkitagent/meson.build b/src/polkitagent/meson.build
+index bee38201d53e..a69e96b6c265 100644
+--- a/src/polkitagent/meson.build
++++ b/src/polkitagent/meson.build
+@@ -101,19 +101,21 @@ if enable_introspection
+ )
+ endif
+
+-sources = files(
+- 'polkitagenthelperprivate.c',
+- 'polkitagenthelper-@0@.c'.format(auth_fw),
+-)
++if not get_option('libs-only')
++ sources = files(
++ 'polkitagenthelperprivate.c',
++ 'polkitagenthelper-@0@.c'.format(auth_fw),
++ )
+
+-deps = auth_deps + [libpolkit_gobject_dep]
++ deps = auth_deps + [libpolkit_gobject_dep]
+
+-executable(
+- '@0@-agent-helper-@1@'.format(meson.project_name(), pk_api_version),
+- sources,
+- include_directories: top_inc,
+- dependencies: deps,
+- c_args: '-D_POLKIT_COMPILATION',
+- install: true,
+- install_dir: pk_libprivdir,
+-)
++ executable(
++ '@0@-agent-helper-@1@'.format(meson.project_name(), pk_api_version),
++ sources,
++ include_directories: top_inc,
++ dependencies: deps,
++ c_args: '-D_POLKIT_COMPILATION',
++ install: true,
++ install_dir: pk_libprivdir,
++ )
++endif
diff --git a/patches/polkit-124/0002-build-libpolkit-agent-1-does-not-use-expat.patch b/patches/polkit-124/0002-build-libpolkit-agent-1-does-not-use-expat.patch
new file mode 100644
index 000000000..ca97aad79
--- /dev/null
+++ b/patches/polkit-124/0002-build-libpolkit-agent-1-does-not-use-expat.patch
@@ -0,0 +1,21 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Wed, 10 Apr 2024 17:16:11 +0200
+Subject: [PATCH] build: libpolkit-agent-1 does not use expat
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ src/polkitagent/meson.build | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/polkitagent/meson.build b/src/polkitagent/meson.build
+index a69e96b6c265..c6f9758588da 100644
+--- a/src/polkitagent/meson.build
++++ b/src/polkitagent/meson.build
+@@ -36,7 +36,6 @@ sources = enum_sources + marshal_sources + files(
+ )
+
+ deps = [
+- expat_dep,
+ gio_unix_dep,
+ libpolkit_gobject_dep,
+ ]
diff --git a/patches/polkit-124/0003-build-libexpat-is-not-needed-with-libs-only.patch b/patches/polkit-124/0003-build-libexpat-is-not-needed-with-libs-only.patch
new file mode 100644
index 000000000..60abcc5a7
--- /dev/null
+++ b/patches/polkit-124/0003-build-libexpat-is-not-needed-with-libs-only.patch
@@ -0,0 +1,34 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Wed, 10 Apr 2024 17:20:16 +0200
+Subject: [PATCH] build: libexpat is not needed with libs-only
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ meson.build | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 2f81c907d81b..c1cff386bd2d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -130,16 +130,16 @@ gio_unix_dep = dependency('gio-unix-2.0', version: glib_req_version)
+ glib_dep = dependency('glib-2.0', version: glib_req_version)
+ gobject_dep = dependency('gobject-2.0', version: glib_req_version)
+
+-expat_dep = dependency('expat')
+-assert(cc.has_header('expat.h', dependencies: expat_dep), 'Can\'t find expat.h. Please install expat.')
+-assert(cc.has_function('XML_ParserCreate', dependencies: expat_dep), 'Can\'t find expat library. Please install expat.')
+-
+ duktape_req_version = '>= 2.2.0'
+
+ js_engine = get_option('js_engine')
+ libs_only = get_option('libs-only')
+ if libs_only
+ js_engine = ''
++else
++ expat_dep = dependency('expat')
++ assert(cc.has_header('expat.h', dependencies: expat_dep), 'Can\'t find expat.h. Please install expat.')
++ assert(cc.has_function('XML_ParserCreate', dependencies: expat_dep), 'Can\'t find expat library. Please install expat.')
+ endif
+
+ if js_engine == 'duktape'
diff --git a/patches/polkit-124/series b/patches/polkit-124/series
new file mode 100644
index 000000000..a06955a11
--- /dev/null
+++ b/patches/polkit-124/series
@@ -0,0 +1,6 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-build-install-polkit-agent-1-library-with-libs-only.patch
+0002-build-libpolkit-agent-1-does-not-use-expat.patch
+0003-build-libexpat-is-not-needed-with-libs-only.patch
+# 7672d71e4f4da0138c96774538c6b704 - git-ptx-patches magic
diff --git a/patches/portmap_6.0/portmap_6.0-fix-disable-tcpwrapper.diff b/patches/portmap_6.0/portmap_6.0-fix-disable-tcpwrapper.diff
deleted file mode 100644
index d2aa99674..000000000
--- a/patches/portmap_6.0/portmap_6.0-fix-disable-tcpwrapper.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Robert Schwebel <r.schwebel@pengutronix.de>
-Subject: Include tcpd.h only if HOST_ACCESS is selected
-
-Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
----
- pmap_check.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-Index: b/pmap_check.c
-===================================================================
---- a/pmap_check.c
-+++ b/pmap_check.c
-@@ -44,7 +44,9 @@
- #include <netinet/in.h>
- #include <rpc/rpcent.h>
- #endif
-+#ifdef HOSTS_ACCESS
- #include <tcpd.h>
-+#endif
- #include <arpa/inet.h>
- #include <grp.h>
-
diff --git a/patches/portmap_6.0/series b/patches/portmap_6.0/series
deleted file mode 100644
index b26da3e09..000000000
--- a/patches/portmap_6.0/series
+++ /dev/null
@@ -1 +0,0 @@
-portmap_6.0-fix-disable-tcpwrapper.diff
diff --git a/patches/libpcap-1.8.1/autogen.sh b/patches/powertop-v2.15/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/libpcap-1.8.1/autogen.sh
+++ b/patches/powertop-v2.15/autogen.sh
diff --git a/patches/ppp-2.4.7/0001-abort-on-errors-in-subdir-builds.patch b/patches/ppp-2.4.7/0001-abort-on-errors-in-subdir-builds.patch
deleted file mode 100644
index c6a76ce65..000000000
--- a/patches/ppp-2.4.7/0001-abort-on-errors-in-subdir-builds.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From: Martin von Gagern <Martin.vGagern@gmx.net>
-Date: Sat, 9 Aug 2014 22:44:45 -0400
-Subject: [PATCH] abort on errors in subdir builds
-
-The current recursive loops do not check the exit status of make
-in subdirs which leads to `make` passing even when a subdir failed
-to compile or install.
-
-URL: https://bugs.gentoo.org/334727
-Signed-off-by: Martin von Gagern <Martin.vGagern@gmx.net>
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/Makefile.linux | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
-index ab8cf50d9472..8a90e393a057 100644
---- a/pppd/plugins/Makefile.linux
-+++ b/pppd/plugins/Makefile.linux
-@@ -27,7 +27,7 @@ include .depend
- endif
-
- all: $(PLUGINS)
-- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
-+ for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit $$?; done
-
- %.so: %.c
- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
-@@ -37,12 +37,12 @@ VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
- install: $(PLUGINS)
- $(INSTALL) -d $(LIBDIR)
- $(INSTALL) $? $(LIBDIR)
-- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install; done
-+ for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install || exit $$?; done
-
- clean:
- rm -f *.o *.so *.a
-- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean; done
-+ for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean || exit $$?; done
-
- depend:
- $(CPP) -M $(CFLAGS) *.c >.depend
-- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend; done
-+ for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend || exit $$?; done
diff --git a/patches/ppp-2.4.7/0002-scripts-Avoid-killing-wrong-pppd.patch b/patches/ppp-2.4.7/0002-scripts-Avoid-killing-wrong-pppd.patch
deleted file mode 100644
index dc24c228e..000000000
--- a/patches/ppp-2.4.7/0002-scripts-Avoid-killing-wrong-pppd.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From: radaiming <radaiming@gmail.com>
-Date: Sat, 13 Dec 2014 14:42:34 +0800
-Subject: [PATCH] scripts: Avoid killing wrong pppd
-
- poff could kill other pppd processes when there are many pppd
- running on different serial port.
-
- Signed-off-by: Ming Dai <radaiming@gmail.com>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- scripts/poff | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/scripts/poff b/scripts/poff
-index 3f55a7f40010..5b45d98a2b6a 100644
---- a/scripts/poff
-+++ b/scripts/poff
-@@ -91,7 +91,7 @@ if test "$#" -eq 0 -o "$MODE" = "all" ; then
- fi
-
- # There is an argument, so kill the pppd started on that provider.
--PID=`ps axw | grep "[ /]pppd call $1" | awk '{print $1}'`
-+PID=`ps axw | grep "[ /]pppd call $1" | grep -w "$1" | awk '{print $1}'`
- if test -n "$PID" ; then
- $KILL -$SIG $PID || {
- echo "$0: $KILL failed. None ${DONE}."
diff --git a/patches/ppp-2.4.7/0003-pppd-Fix-sign-extension-when-displaying-bytes-in-oct.patch b/patches/ppp-2.4.7/0003-pppd-Fix-sign-extension-when-displaying-bytes-in-oct.patch
deleted file mode 100644
index 2bd23b921..000000000
--- a/patches/ppp-2.4.7/0003-pppd-Fix-sign-extension-when-displaying-bytes-in-oct.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: "Philip A. Prindeville" <philipp@redfish-solutions.com>
-Date: Fri, 19 Dec 2014 17:52:58 -0700
-Subject: [PATCH] pppd: Fix sign-extension when displaying bytes in octal
-
-print_string() displays characters as \\%.03o but without first
-casting it from "char" to "unsigned char" so it gets sign-extended
-to an int. This causes output like \37777777630 instead of \230.
-
-Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/utils.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pppd/utils.c b/pppd/utils.c
-index 29bf970905d5..3ac1b60926d2 100644
---- a/pppd/utils.c
-+++ b/pppd/utils.c
-@@ -625,7 +625,7 @@ print_string(p, len, printer, arg)
- printer(arg, "\\t");
- break;
- default:
-- printer(arg, "\\%.3o", c);
-+ printer(arg, "\\%.3o", (unsigned char) c);
- }
- }
- }
diff --git a/patches/ppp-2.4.7/0004-Suppress-false-error-message-on-PPPoE-disconnect.patch b/patches/ppp-2.4.7/0004-Suppress-false-error-message-on-PPPoE-disconnect.patch
deleted file mode 100644
index 6d4bd5c10..000000000
--- a/patches/ppp-2.4.7/0004-Suppress-false-error-message-on-PPPoE-disconnect.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Simon Farnsworth <simon@farnz.org.uk>
-Date: Sun, 1 Mar 2015 11:49:06 +0000
-Subject: [PATCH] Suppress false error message on PPPoE disconnect
-
-Once the kernel handles PPPoE PADTs correctly[1], a PADT triggered
-disconnect will result in EALREADY when pppd tries to clear the session ID.
-
-Simply ignore the error if, and only if, the error is EALREADY
-
-[1] https://patchwork.ozlabs.org/patch/444717/
-
-Signed-off-by: Simon Farnsworth <simon@farnz.org.uk>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/rp-pppoe/plugin.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
-index a8c2bb4f4a6a..da50cdf2b9d3 100644
---- a/pppd/plugins/rp-pppoe/plugin.c
-+++ b/pppd/plugins/rp-pppoe/plugin.c
-@@ -270,7 +270,7 @@ PPPOEDisconnectDevice(void)
- memcpy(sp.sa_addr.pppoe.dev, conn->ifName, IFNAMSIZ);
- memcpy(sp.sa_addr.pppoe.remote, conn->peerEth, ETH_ALEN);
- if (connect(conn->sessionSocket, (struct sockaddr *) &sp,
-- sizeof(struct sockaddr_pppox)) < 0)
-+ sizeof(struct sockaddr_pppox)) < 0 && errno != EALREADY)
- error("Failed to disconnect PPPoE socket: %d %m", errno);
- close(conn->sessionSocket);
- /* don't send PADT?? */
diff --git a/patches/ppp-2.4.7/0005-Send-PADT-on-PPPoE-disconnect.patch b/patches/ppp-2.4.7/0005-Send-PADT-on-PPPoE-disconnect.patch
deleted file mode 100644
index 28efdfc71..000000000
--- a/patches/ppp-2.4.7/0005-Send-PADT-on-PPPoE-disconnect.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Simon Farnsworth <simon@farnz.org.uk>
-Date: Sun, 1 Mar 2015 11:53:58 +0000
-Subject: [PATCH] Send PADT on PPPoE disconnect
-
-Once we've terminated the PPP session, there is no chance of a PPP layer
-disconnect. Some PPPoE relays don't detect the PPP session going down, and
-depend on a long timeout or a PPPoE PADT to terminate the session.
-
-Send a PADT on disconnect to work around these buggy relays.
-
-Signed-off-by: Simon Farnsworth <simon@farnz.org.uk>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/rp-pppoe/plugin.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
-index da50cdf2b9d3..c89be94250bc 100644
---- a/pppd/plugins/rp-pppoe/plugin.c
-+++ b/pppd/plugins/rp-pppoe/plugin.c
-@@ -273,9 +273,10 @@ PPPOEDisconnectDevice(void)
- sizeof(struct sockaddr_pppox)) < 0 && errno != EALREADY)
- error("Failed to disconnect PPPoE socket: %d %m", errno);
- close(conn->sessionSocket);
-- /* don't send PADT?? */
-- if (conn->discoverySocket >= 0)
-+ if (conn->discoverySocket >= 0) {
-+ sendPADT(conn, NULL);
- close(conn->discoverySocket);
-+ }
- }
-
- static void
diff --git a/patches/ppp-2.4.7/0006-pppd-ipxcp-Prevent-buffer-overrun-on-remote-router-n.patch b/patches/ppp-2.4.7/0006-pppd-ipxcp-Prevent-buffer-overrun-on-remote-router-n.patch
deleted file mode 100644
index 7d98127c2..000000000
--- a/patches/ppp-2.4.7/0006-pppd-ipxcp-Prevent-buffer-overrun-on-remote-router-n.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Paul Mackerras <paulus@samba.org>
-Date: Fri, 14 Aug 2015 17:56:26 +1000
-Subject: [PATCH] pppd: ipxcp: Prevent buffer overrun on remote router name
-
-This fixes an if condition to prevent a possible 1-byte overrun
-on ipxcp_hisoptions[0].name.
-
-Reported-by: "Sabas Rosales, Blanca E" <blanca.e.sabas.rosales@intel.com>
-Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/ipxcp.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pppd/ipxcp.c b/pppd/ipxcp.c
-index 7b2343e15537..aaff10f76200 100644
---- a/pppd/ipxcp.c
-+++ b/pppd/ipxcp.c
-@@ -1194,7 +1194,7 @@ ipxcp_reqci(f, inp, len, reject_if_disagree)
- case IPX_ROUTER_NAME:
- if (cilen >= CILEN_NAME) {
- int name_size = cilen - CILEN_NAME;
-- if (name_size > sizeof (ho->name))
-+ if (name_size >= sizeof (ho->name))
- name_size = sizeof (ho->name) - 1;
- memset (ho->name, 0, sizeof (ho->name));
- memcpy (ho->name, p, name_size);
diff --git a/patches/ppp-2.4.7/0007-pppd-Fix-ccp_options.mppe-type.patch b/patches/ppp-2.4.7/0007-pppd-Fix-ccp_options.mppe-type.patch
deleted file mode 100644
index 475edae24..000000000
--- a/patches/ppp-2.4.7/0007-pppd-Fix-ccp_options.mppe-type.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Sylvain Rochet <gradator@gradator.net>
-Date: Wed, 25 Mar 2015 00:25:18 +0100
-Subject: [PATCH] pppd: Fix ccp_options.mppe type
-
-This corrects the type of ccp_options.mppe; it is actually a bitfield of
-MPPE_OPT_* and not a boolean.
-
-Signed-off-by: Sylvain Rochet <gradator@gradator.net>
-Signed-off-by: Paul Mackerras <paulus@samba.org>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/ccp.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pppd/ccp.h b/pppd/ccp.h
-index 6f4a2fee0a2c..76446db007c0 100644
---- a/pppd/ccp.h
-+++ b/pppd/ccp.h
-@@ -37,7 +37,7 @@ typedef struct ccp_options {
- bool predictor_2; /* do Predictor-2? */
- bool deflate_correct; /* use correct code for deflate? */
- bool deflate_draft; /* use draft RFC code for deflate? */
-- bool mppe; /* do MPPE? */
-+ u_char mppe; /* MPPE bitfield */
- u_short bsd_bits; /* # bits/code for BSD Compress */
- u_short deflate_size; /* lg(window size) for Deflate */
- short method; /* code for chosen compression method */
diff --git a/patches/ppp-2.4.7/0008-pppd-Fix-ccp_cilen-calculated-size-if-both-deflate_c.patch b/patches/ppp-2.4.7/0008-pppd-Fix-ccp_cilen-calculated-size-if-both-deflate_c.patch
deleted file mode 100644
index d73b4de32..000000000
--- a/patches/ppp-2.4.7/0008-pppd-Fix-ccp_cilen-calculated-size-if-both-deflate_c.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Sylvain Rochet <gradator@gradator.net>
-Date: Tue, 24 Mar 2015 21:21:40 +0100
-Subject: [PATCH] pppd: Fix ccp_cilen calculated size if both deflate_correct
- and deflate_draft are enabled
-
-This fixes a bug where ccp_cilen() will return 4 bytes less than
-necessary for the addci buffer if both deflate_correct and
-deflate_draft are enabled.
-
-Signed-off-by: Sylvain Rochet <gradator@gradator.net>
-Signed-off-by: Paul Mackerras <paulus@samba.org>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/ccp.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/pppd/ccp.c b/pppd/ccp.c
-index 5814f358eb44..7d7922afcfc0 100644
---- a/pppd/ccp.c
-+++ b/pppd/ccp.c
-@@ -676,7 +676,8 @@ ccp_cilen(f)
- ccp_options *go = &ccp_gotoptions[f->unit];
-
- return (go->bsd_compress? CILEN_BSD_COMPRESS: 0)
-- + (go->deflate? CILEN_DEFLATE: 0)
-+ + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0)
-+ + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0)
- + (go->predictor_1? CILEN_PREDICTOR_1: 0)
- + (go->predictor_2? CILEN_PREDICTOR_2: 0)
- + (go->mppe? CILEN_MPPE: 0);
diff --git a/patches/ppp-2.4.7/0009-Fix-a-typo-in-comment.-Diff-from-Yuuichi-Someya.patch b/patches/ppp-2.4.7/0009-Fix-a-typo-in-comment.-Diff-from-Yuuichi-Someya.patch
deleted file mode 100644
index 39af8cf33..000000000
--- a/patches/ppp-2.4.7/0009-Fix-a-typo-in-comment.-Diff-from-Yuuichi-Someya.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: YASUOKA Masahiko <yasuoka@yasuoka.net>
-Date: Wed, 16 Mar 2016 13:39:19 +0900
-Subject: [PATCH] Fix a typo in comment. Diff from Yuuichi Someya.
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/fsm.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pppd/fsm.c b/pppd/fsm.c
-index c200cc3a8438..e9bd34f0e8f4 100644
---- a/pppd/fsm.c
-+++ b/pppd/fsm.c
-@@ -468,7 +468,7 @@ fsm_rconfreq(f, id, inp, len)
- f->nakloops = 0;
-
- } else {
-- /* we sent CONFACK or CONFREJ */
-+ /* we sent CONFNAK or CONFREJ */
- if (f->state != ACKRCVD)
- f->state = REQSENT;
- if( code == CONFNAK )
diff --git a/patches/ppp-2.4.7/0010-plog-count-only-relevant-lines-from-syslog.patch b/patches/ppp-2.4.7/0010-plog-count-only-relevant-lines-from-syslog.patch
deleted file mode 100644
index c9d56cdbb..000000000
--- a/patches/ppp-2.4.7/0010-plog-count-only-relevant-lines-from-syslog.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Dmitry Deshevoy <mityada@gmail.com>
-Date: Thu, 31 Mar 2016 23:39:32 +0400
-Subject: [PATCH] plog: count only relevant lines from syslog
-
-Closes paulusmack/ppp#42
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- scripts/plog | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/scripts/plog b/scripts/plog
-index 84d2c7340cc6..7cb53346413d 100644
---- a/scripts/plog
-+++ b/scripts/plog
-@@ -3,5 +3,5 @@
- if [ -s /var/log/ppp.log ]; then
- exec tail "$@" /var/log/ppp.log
- else
-- exec tail "$@" /var/log/syslog | grep ' \(pppd\|chat\)\['
-+ exec grep ' \(pppd\|chat\)\[' /var/log/syslog | tail "$@"
- fi
diff --git a/patches/ppp-2.4.7/0011-Change-include-from-sys-errno.h-to-errno.h.patch b/patches/ppp-2.4.7/0011-Change-include-from-sys-errno.h-to-errno.h.patch
deleted file mode 100644
index ed313eeaa..000000000
--- a/patches/ppp-2.4.7/0011-Change-include-from-sys-errno.h-to-errno.h.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Stefan Nickl <Stefan.Nickl@gmail.com>
-Date: Wed, 10 Aug 2016 21:32:21 +0200
-Subject: [PATCH] Change include from sys/errno.h to errno.h
-
-According to POSIX, the canonical location for errno.h is on the top level.
-
-Signed-off-by: Stefan Nickl <Stefan.Nickl@gmail.com>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/sys-linux.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
-index e5e9baf8821f..908aa4f22297 100644
---- a/pppd/sys-linux.c
-+++ b/pppd/sys-linux.c
-@@ -73,12 +73,12 @@
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/time.h>
--#include <sys/errno.h>
- #include <sys/file.h>
- #include <sys/stat.h>
- #include <sys/utsname.h>
- #include <sys/sysmacros.h>
-
-+#include <errno.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <syslog.h>
diff --git a/patches/ppp-2.4.7/0012-pppd-allow-use-of-arbitrary-interface-names.patch b/patches/ppp-2.4.7/0012-pppd-allow-use-of-arbitrary-interface-names.patch
deleted file mode 100644
index 26d56de1d..000000000
--- a/patches/ppp-2.4.7/0012-pppd-allow-use-of-arbitrary-interface-names.patch
+++ /dev/null
@@ -1,214 +0,0 @@
-From: Paul Mackerras <paulus@samba.org>
-Date: Tue, 23 Aug 2016 16:10:21 +1000
-Subject: [PATCH] pppd: allow use of arbitrary interface names
-
-This is a modified version of a patch from openSUSE that enables PPP interfaces
-to be called arbitrary names, rather than simply pppX where X is the unit
-number.
-
-The modifications from the stock openSUSE patch are:
- refresh patch on top of 018_ip up_option.diff
-- fix a printf format-string vulnerability in pppd/main.c:set_ifunit()
-- clarify the pppd.8 manpage additions
-- patch pppstats/pppstats.c to query renamed interfaces without complaint
-
-Origin: SUSE
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458646
-Forwarded: no
-Reviewed-by: Chris Boot <bootc@debian.org>
-Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/main.c | 16 ++++++----------
- pppd/options.c | 5 +++++
- pppd/pppd.8 | 8 +++++++-
- pppd/pppd.h | 11 +++++++++++
- pppd/sys-linux.c | 15 +++++++++++++++
- pppstats/pppstats.c | 12 ++++++------
- 6 files changed, 50 insertions(+), 17 deletions(-)
-
-diff --git a/pppd/main.c b/pppd/main.c
-index 6d50d1bac1d9..f1986ed68d0b 100644
---- a/pppd/main.c
-+++ b/pppd/main.c
-@@ -124,7 +124,7 @@
- static const char rcsid[] = RCSID;
-
- /* interface vars */
--char ifname[32]; /* Interface name */
-+char ifname[MAXIFNAMELEN]; /* Interface name */
- int ifunit; /* Interface unit number */
-
- struct channel *the_channel;
-@@ -298,13 +298,6 @@ struct protent *protocols[] = {
- NULL
- };
-
--/*
-- * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
-- */
--#if !defined(PPP_DRV_NAME)
--#define PPP_DRV_NAME "ppp"
--#endif /* !defined(PPP_DRV_NAME) */
--
- int
- main(argc, argv)
- int argc;
-@@ -737,8 +730,11 @@ void
- set_ifunit(iskey)
- int iskey;
- {
-- info("Using interface %s%d", PPP_DRV_NAME, ifunit);
-- slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
-+ if (req_ifname[0] != '\0')
-+ slprintf(ifname, sizeof(ifname), "%s", req_ifname);
-+ else
-+ slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
-+ info("Using interface %s", ifname);
- script_setenv("IFNAME", ifname, iskey);
- if (iskey) {
- create_pidfile(getpid()); /* write pid to file */
-diff --git a/pppd/options.c b/pppd/options.c
-index f66b7657bc31..91da515ac533 100644
---- a/pppd/options.c
-+++ b/pppd/options.c
-@@ -114,6 +114,7 @@ char linkname[MAXPATHLEN]; /* logical name for link */
- bool tune_kernel; /* may alter kernel settings */
- int connect_delay = 1000; /* wait this many ms after connect script */
- int req_unit = -1; /* requested interface unit */
-+char req_ifname[MAXIFNAMELEN]; /* requested interface name */
- bool multilink = 0; /* Enable multilink operation */
- char *bundle_name = NULL; /* bundle name for multilink */
- bool dump_options; /* print out option values */
-@@ -283,6 +284,10 @@ option_t general_options[] = {
- "PPP interface unit number to use if possible",
- OPT_PRIO | OPT_LLIMIT, 0, 0 },
-
-+ { "ifname", o_string, req_ifname,
-+ "Set PPP interface name",
-+ OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, MAXIFNAMELEN },
-+
- { "dump", o_bool, &dump_options,
- "Print out option values after parsing all options", 1 },
- { "dryrun", o_bool, &dryrun,
-diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index e2768b135273..64659cf867b2 100644
---- a/pppd/pppd.8
-+++ b/pppd/pppd.8
-@@ -1073,7 +1073,13 @@ under Linux and FreeBSD 2.2.8 and later.
- .TP
- .B unit \fInum
- Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound
--connections.
-+connections. If the unit is already in use a dynamically allocated number will
-+be used.
-+.TP
-+.B ifname \fIstring
-+Set the ppp interface name for outbound connections. If the interface name is
-+already in use, or if the name cannot be used for any other reason, pppd will
-+terminate.
- .TP
- .B unset \fIname
- Remove a variable from the environment variable for scripts that are
-diff --git a/pppd/pppd.h b/pppd/pppd.h
-index 247fa153739b..1a1bf0b99582 100644
---- a/pppd/pppd.h
-+++ b/pppd/pppd.h
-@@ -80,6 +80,16 @@
- #define MAXARGS 1 /* max # args to a command */
- #define MAXNAMELEN 256 /* max length of hostname or name for auth */
- #define MAXSECRETLEN 256 /* max length of password or secret */
-+#define MAXIFNAMELEN 32 /* max length of interface name; or use IFNAMSIZ, can we
-+ always include net/if.h? */
-+
-+/*
-+ * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
-+ * Where should PPP_DRV_NAME come from? Do we include it here?
-+ */
-+#if !defined(PPP_DRV_NAME)
-+#define PPP_DRV_NAME "ppp"
-+#endif /* !defined(PPP_DRV_NAME) */
-
- /*
- * Option descriptor structure.
-@@ -318,6 +328,7 @@ extern bool tune_kernel; /* May alter kernel settings as necessary */
- extern int connect_delay; /* Time to delay after connect script */
- extern int max_data_rate; /* max bytes/sec through charshunt */
- extern int req_unit; /* interface unit number to use */
-+extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
- extern bool multilink; /* enable multilink operation */
- extern bool noendpoint; /* don't send or accept endpt. discrim. */
- extern char *bundle_name; /* bundle name for multilink */
-diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
-index 908aa4f22297..9b2f293024ac 100644
---- a/pppd/sys-linux.c
-+++ b/pppd/sys-linux.c
-@@ -641,6 +641,21 @@ static int make_ppp_unit()
- }
- if (x < 0)
- error("Couldn't create new ppp unit: %m");
-+
-+ if (x == 0 && req_ifname[0] != '\0') {
-+ struct ifreq ifr;
-+ char t[MAXIFNAMELEN];
-+ memset(&ifr, 0, sizeof(struct ifreq));
-+ slprintf(t, sizeof(t), "%s%d", PPP_DRV_NAME, ifunit);
-+ strncpy(ifr.ifr_name, t, IF_NAMESIZE);
-+ strncpy(ifr.ifr_newname, req_ifname, IF_NAMESIZE);
-+ x = ioctl(sock_fd, SIOCSIFNAME, &ifr);
-+ if (x < 0)
-+ error("Couldn't rename interface %s to %s: %m", t, req_ifname);
-+ else
-+ info("Renamed interface %s to %s", t, req_ifname);
-+ }
-+
- return x;
- }
-
-diff --git a/pppstats/pppstats.c b/pppstats/pppstats.c
-index 6367988eb96b..46cb9c24942b 100644
---- a/pppstats/pppstats.c
-+++ b/pppstats/pppstats.c
-@@ -88,7 +88,6 @@ int aflag; /* print absolute values, not deltas */
- int dflag; /* print data rates, not bytes */
- int interval, count;
- int infinite;
--int unit;
- int s; /* socket or /dev/ppp file descriptor */
- int signalled; /* set if alarm goes off "early" */
- char *progname;
-@@ -449,6 +448,7 @@ main(argc, argv)
- {
- int c;
- #ifdef STREAMS
-+ int unit;
- char *dev;
- #endif
-
-@@ -506,11 +506,6 @@ main(argc, argv)
- if (argc > 0)
- interface = argv[0];
-
-- if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
-- fprintf(stderr, "%s: invalid interface '%s' specified\n",
-- progname, interface);
-- }
--
- #ifndef STREAMS
- {
- struct ifreq ifr;
-@@ -535,6 +530,11 @@ main(argc, argv)
- }
-
- #else /* STREAMS */
-+ if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
-+ fprintf(stderr, "%s: invalid interface '%s' specified\n",
-+ progname, interface);
-+ }
-+
- #ifdef __osf__
- dev = "/dev/streams/ppp";
- #else
diff --git a/patches/ppp-2.4.7/0013-pppd-Remove-unused-declaration-of-ttyname.patch b/patches/ppp-2.4.7/0013-pppd-Remove-unused-declaration-of-ttyname.patch
deleted file mode 100644
index 2199e7f7d..000000000
--- a/patches/ppp-2.4.7/0013-pppd-Remove-unused-declaration-of-ttyname.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: George Burgess IV <george@gbiv.net>
-Date: Fri, 9 Sep 2016 17:36:54 -0700
-Subject: [PATCH] pppd: Remove unused declaration of ttyname.
-
-Signed-off-by: George Burgess IV <george@gbiv.net>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/main.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/pppd/main.c b/pppd/main.c
-index f1986ed68d0b..76b67d2485b7 100644
---- a/pppd/main.c
-+++ b/pppd/main.c
-@@ -257,7 +257,6 @@ static void cleanup_db __P((void));
- static void handle_events __P((void));
- void print_link_stats __P((void));
-
--extern char *ttyname __P((int));
- extern char *getlogin __P((void));
- int main __P((int, char *[]));
-
diff --git a/patches/ppp-2.4.7/0014-pppd-Provide-error-implementation-in-pppoe-discovery.patch b/patches/ppp-2.4.7/0014-pppd-Provide-error-implementation-in-pppoe-discovery.patch
deleted file mode 100644
index 39fc3d4f6..000000000
--- a/patches/ppp-2.4.7/0014-pppd-Provide-error-implementation-in-pppoe-discovery.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From: Stefan Nickl <Stefan.Nickl@gmail.com>
-Date: Wed, 10 Aug 2016 16:52:12 +0200
-Subject: [PATCH] pppd: Provide error() implementation in pppoe-discovery
-
-The pppoe-discovery program calls error() from the CHECK_ROOM macro
-defined in pppoe.h. Since pppoe-discovery is a standalone program not
-linked with the rest of pppd, the only way this could build is by
-linking to glibc's proprietary error(3) function instead of the function
-of the same name (but with different arguments) defined in pppd/utils.c.
-
-So with glibc this builds, but will probably crash when the assertion is
-triggered. As the assertion is unlikely to fail, nobody has noticed.
-
-The build however fails with musl libc or uClibc since they don't
-provide the doppelganger.
-
-Signed-off-by: Stefan Nickl <Stefan.Nickl@gmail.com>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/rp-pppoe/pppoe-discovery.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
-index 3d3bf4eecc81..55037dffb023 100644
---- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
-+++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
-@@ -9,6 +9,7 @@
- *
- */
-
-+#include <stdarg.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
-@@ -55,6 +56,14 @@ void die(int status)
- exit(status);
- }
-
-+void error(char *fmt, ...)
-+{
-+ va_list pvar;
-+ va_start(pvar, fmt);
-+ vfprintf(stderr, fmt, pvar);
-+ va_end(pvar);
-+}
-+
- /* Initialize frame types to RFC 2516 values. Some broken peers apparently
- use different frame types... sigh... */
-
diff --git a/patches/ppp-2.4.7/0015-pppoe-include-netinet-in.h-before-linux-in.h.patch b/patches/ppp-2.4.7/0015-pppoe-include-netinet-in.h-before-linux-in.h.patch
deleted file mode 100644
index b24e5ef58..000000000
--- a/patches/ppp-2.4.7/0015-pppoe-include-netinet-in.h-before-linux-in.h.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From: Lubomir Rintel <lkundrak@v3.sk>
-Date: Mon, 9 Jan 2017 13:34:23 +0000
-Subject: [PATCH] pppoe: include netinet/in.h before linux/in.h
-
-This fixes builds with newer kernels. Basically, <netinet/in.h> needs to be
-included before <linux/in.h> otherwise the earlier, unaware of the latter,
-tries to redefine symbols and structures. Also, <linux/if_pppox.h> doesn't work
-alone anymore, since it pulls the headers in the wrong order, so we better
-include <netinet/in.h> early.
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/rp-pppoe/pppoe.h | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
-index 9ab2eee3914c..c4aaa6e68856 100644
---- a/pppd/plugins/rp-pppoe/pppoe.h
-+++ b/pppd/plugins/rp-pppoe/pppoe.h
-@@ -47,6 +47,10 @@
- #include <sys/socket.h>
- #endif
-
-+/* This has to be included before Linux 4.8's linux/in.h
-+ * gets dragged in. */
-+#include <netinet/in.h>
-+
- /* Ugly header files on some Linux boxes... */
- #if defined(HAVE_LINUX_IF_H)
- #include <linux/if.h>
-@@ -84,8 +88,6 @@ typedef unsigned long UINT32_t;
- #include <linux/if_ether.h>
- #endif
-
--#include <netinet/in.h>
--
- #ifdef HAVE_NETINET_IF_ETHER_H
- #include <sys/types.h>
-
-@@ -98,7 +100,6 @@ typedef unsigned long UINT32_t;
- #endif
-
-
--
- /* Ethernet frame types according to RFC 2516 */
- #define ETH_PPPOE_DISCOVERY 0x8863
- #define ETH_PPPOE_SESSION 0x8864
diff --git a/patches/ppp-2.4.7/0016-adaptive_echos.patch b/patches/ppp-2.4.7/0016-adaptive_echos.patch
deleted file mode 100644
index c0f222824..000000000
--- a/patches/ppp-2.4.7/0016-adaptive_echos.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] adaptive_echos
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/lcp.c | 19 +++++++++++++++++++
- pppd/pppd.8 | 5 +++++
- 2 files changed, 24 insertions(+)
-
-diff --git a/pppd/lcp.c b/pppd/lcp.c
-index 8ed2778bfb67..c97a64b7774f 100644
---- a/pppd/lcp.c
-+++ b/pppd/lcp.c
-@@ -73,6 +73,7 @@ static void lcp_delayed_up __P((void *));
- */
- int lcp_echo_interval = 0; /* Interval between LCP echo-requests */
- int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */
-+bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */
- bool lax_recv = 0; /* accept control chars in asyncmap */
- bool noendpoint = 0; /* don't send/accept endpoint discriminator */
-
-@@ -151,6 +152,8 @@ static option_t lcp_option_list[] = {
- OPT_PRIO },
- { "lcp-echo-interval", o_int, &lcp_echo_interval,
- "Set time in seconds between LCP echo requests", OPT_PRIO },
-+ { "lcp-echo-adaptive", o_bool, &lcp_echo_adaptive,
-+ "Suppress LCP echo requests if traffic was received", 1 },
- { "lcp-restart", o_int, &lcp_fsm[0].timeouttime,
- "Set time in seconds between LCP retransmissions", OPT_PRIO },
- { "lcp-max-terminate", o_int, &lcp_fsm[0].maxtermtransmits,
-@@ -2331,6 +2334,22 @@ LcpSendEchoRequest (f)
- }
- }
-
-+ /*
-+ * If adaptive echos have been enabled, only send the echo request if
-+ * no traffic was received since the last one.
-+ */
-+ if (lcp_echo_adaptive) {
-+ static unsigned int last_pkts_in = 0;
-+
-+ update_link_stats(f->unit);
-+ link_stats_valid = 0;
-+
-+ if (link_stats.pkts_in != last_pkts_in) {
-+ last_pkts_in = link_stats.pkts_in;
-+ return;
-+ }
-+ }
-+
- /*
- * Make and send the echo request frame.
- */
-diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index 64659cf867b2..ec8bfd5c0617 100644
---- a/pppd/pppd.8
-+++ b/pppd/pppd.8
-@@ -558,6 +558,11 @@ to 1) if the \fIproxyarp\fR option is used, and will enable the
- dynamic IP address option (i.e. set /proc/sys/net/ipv4/ip_dynaddr to
- 1) in demand mode if the local address changes.
- .TP
-+.B lcp\-echo\-adaptive
-+If this option is used with the \fIlcp\-echo\-failure\fR option then
-+pppd will send LCP echo\-request frames only if no traffic was received
-+from the peer since the last echo\-request was sent.
-+.TP
- .B lcp\-echo\-failure \fIn
- If this option is given, pppd will presume the peer to be dead
- if \fIn\fR LCP echo\-requests are sent without receiving a valid LCP
diff --git a/patches/ppp-2.4.7/0017-Makefiles-cleanup.patch b/patches/ppp-2.4.7/0017-Makefiles-cleanup.patch
deleted file mode 100644
index ff9096f70..000000000
--- a/patches/ppp-2.4.7/0017-Makefiles-cleanup.patch
+++ /dev/null
@@ -1,296 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] Makefiles cleanup
-
-Factor-out $COPTS and $LDOPTS to allow distributions to easily override
-them. Properly use $LDFLAGS when linking and $CFLAGS when compiling.
-Do not strip the installed binaries: this should be done by the
-packaging system if required.
-
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- chat/Makefile.linux | 5 +++--
- pppd/Makefile.linux | 7 ++++---
- pppd/plugins/Makefile.linux | 4 ++--
- pppd/plugins/pppoatm/Makefile.linux | 4 ++--
- pppd/plugins/pppol2tp/Makefile.linux | 4 ++--
- pppd/plugins/radius/Makefile.linux | 16 +++++++++-------
- pppd/plugins/rp-pppoe/Makefile.linux | 10 ++++++----
- pppdump/Makefile.linux | 9 ++++++---
- pppstats/Makefile.linux | 7 ++++---
- 9 files changed, 38 insertions(+), 28 deletions(-)
-
-diff --git a/chat/Makefile.linux b/chat/Makefile.linux
-index 1065ac519576..a41d485b4168 100644
---- a/chat/Makefile.linux
-+++ b/chat/Makefile.linux
-@@ -12,20 +12,21 @@ CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4)
-
- COPTS= -O2 -g -pipe
- CFLAGS= $(COPTS) $(CDEFS)
-+LDFLAGS=$(LDOPTS)
-
- INSTALL= install
-
- all: chat
-
- chat: chat.o
-- $(CC) -o chat chat.o
-+ $(CC) $(LDFLAGS) -o chat chat.o
-
- chat.o: chat.c
- $(CC) -c $(CFLAGS) -o chat.o chat.c
-
- install: chat
- mkdir -p $(BINDIR) $(MANDIR)
-- $(INSTALL) -s -c chat $(BINDIR)
-+ $(INSTALL) -c chat $(BINDIR)
- $(INSTALL) -c -m 644 chat.8 $(MANDIR)
-
- clean:
-diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index a74c914fd3ac..16b3ee879791 100644
---- a/pppd/Makefile.linux
-+++ b/pppd/Makefile.linux
-@@ -83,6 +83,7 @@ INCLUDE_DIRS= -I../include
- COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
-
- CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
-+LDFLAGS=$(LDOPTS)
-
- ifdef CHAPMS
- CFLAGS += -DCHAPMS=1
-@@ -102,7 +103,7 @@ ifdef USE_SRP
- CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
- LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
- TARGETS += srp-entry
--EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
-+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
- MANPAGES += srp-entry.8
- EXTRACLEAN += srp-entry.o
- NEEDDES=y
-@@ -208,13 +209,13 @@ all: $(TARGETS)
- install: pppd
- mkdir -p $(BINDIR) $(MANDIR)
- $(EXTRAINSTALL)
-- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
-+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
- if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
- chmod o-rx,u+s $(BINDIR)/pppd; fi
- $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
-
- pppd: $(PPPDOBJS)
-- $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
-+ $(CC) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
-
- srp-entry: srp-entry.c
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
-diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
-index 8a90e393a057..0f9d37d2953b 100644
---- a/pppd/plugins/Makefile.linux
-+++ b/pppd/plugins/Makefile.linux
-@@ -1,7 +1,7 @@
- #CC = gcc
- COPTS = -O2 -g
- CFLAGS = $(COPTS) -I.. -I../../include -fPIC
--LDFLAGS = -shared
-+LDFLAGS = $(LDOPTS)
- INSTALL = install
-
- DESTDIR = $(INSTROOT)@DESTDIR@
-@@ -30,7 +30,7 @@ all: $(PLUGINS)
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit $$?; done
-
- %.so: %.c
-- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
-+ $(CC) -o $@ $(LDFLAGS) -shared $(CFLAGS) $^
-
- VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
-
-diff --git a/pppd/plugins/pppoatm/Makefile.linux b/pppd/plugins/pppoatm/Makefile.linux
-index 20f62e631d23..002603c6cbef 100644
---- a/pppd/plugins/pppoatm/Makefile.linux
-+++ b/pppd/plugins/pppoatm/Makefile.linux
-@@ -1,7 +1,7 @@
- #CC = gcc
- COPTS = -O2 -g
- CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC
--LDFLAGS = -shared
-+LDFLAGS = $(LDOPTS)
- INSTALL = install
-
- #***********************************************************************
-@@ -33,7 +33,7 @@ endif
- all: $(PLUGIN)
-
- $(PLUGIN): $(PLUGIN_OBJS)
-- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
-+ $(CC) $(LDFLAGS) -o $@ -shared $^ $(LIBS)
-
- install: all
- $(INSTALL) -d -m 755 $(LIBDIR)
-diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux
-index ea3538e22d56..de5cc12e79c3 100644
---- a/pppd/plugins/pppol2tp/Makefile.linux
-+++ b/pppd/plugins/pppol2tp/Makefile.linux
-@@ -1,7 +1,7 @@
- #CC = gcc
- COPTS = -O2 -g
- CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC
--LDFLAGS = -shared
-+LDFLAGS = $(LDOPTS)
- INSTALL = install
-
- #***********************************************************************
-@@ -16,7 +16,7 @@ PLUGINS := pppol2tp.so openl2tp.so
- all: $(PLUGINS)
-
- %.so: %.o
-- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
-+ $(CC) $(LDFLAGS) -o $@ -shared $^ $(LIBS)
-
- install: all
- $(INSTALL) -d -m 755 $(LIBDIR)
-diff --git a/pppd/plugins/radius/Makefile.linux b/pppd/plugins/radius/Makefile.linux
-index 24ed3e580c4d..436ff2fd0c23 100644
---- a/pppd/plugins/radius/Makefile.linux
-+++ b/pppd/plugins/radius/Makefile.linux
-@@ -12,7 +12,9 @@ VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
- INSTALL = install
-
- PLUGIN=radius.so radattr.so radrealms.so
--CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
-+COPTS=-g -O2
-+CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
-+LDFLAGS= $(LDOPTS)
-
- # Uncomment the next line to include support for Microsoft's
- # MS-CHAP authentication protocol.
-@@ -36,20 +38,20 @@ all: $(PLUGIN)
-
- install: all
- $(INSTALL) -d -m 755 $(LIBDIR)
-- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
-- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
-- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
-+ $(INSTALL) -c -m 755 radius.so $(LIBDIR)
-+ $(INSTALL) -c -m 755 radattr.so $(LIBDIR)
-+ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
- $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
- $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
-
- radius.so: radius.o libradiusclient.a
-- $(CC) -o radius.so -shared radius.o libradiusclient.a
-+ $(CC) $(LDFLAGS) -o radius.so -shared radius.o libradiusclient.a
-
- radattr.so: radattr.o
-- $(CC) -o radattr.so -shared radattr.o
-+ $(CC) $(LDFLAGS) -o radattr.so -shared radattr.o
-
- radrealms.so: radrealms.o
-- $(CC) -o radrealms.so -shared radrealms.o
-+ $(CC) $(LDFLAGS) -o radrealms.so -shared radrealms.o
-
- CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
- clientid.o sendserver.o lock.o util.o md5.o
-diff --git a/pppd/plugins/rp-pppoe/Makefile.linux b/pppd/plugins/rp-pppoe/Makefile.linux
-index 5d7a2719545d..00e0af6da20c 100644
---- a/pppd/plugins/rp-pppoe/Makefile.linux
-+++ b/pppd/plugins/rp-pppoe/Makefile.linux
-@@ -27,10 +27,12 @@ RP_VERSION=3.8p
-
- COPTS=-O2 -g
- CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"'
-+LDFLAGS=$(LDOPTS)
-+
- all: rp-pppoe.so pppoe-discovery
-
- pppoe-discovery: pppoe-discovery.o debug.o
-- $(CC) -o pppoe-discovery pppoe-discovery.o debug.o
-+ $(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
-
- pppoe-discovery.o: pppoe-discovery.c
- $(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c
-@@ -39,13 +41,13 @@ debug.o: debug.c
- $(CC) $(CFLAGS) -c -o debug.o debug.c
-
- rp-pppoe.so: plugin.o discovery.o if.o common.o
-- $(CC) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
-+ $(CC) $(LDFLAGS) -o rp-pppoe.so -shared $^
-
- install: all
- $(INSTALL) -d -m 755 $(LIBDIR)
-- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
-+ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
- $(INSTALL) -d -m 755 $(BINDIR)
-- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
-+ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
-
- clean:
- rm -f *.o *.so pppoe-discovery
-diff --git a/pppdump/Makefile.linux b/pppdump/Makefile.linux
-index ac028f6bf4f0..65e5c14914fb 100644
---- a/pppdump/Makefile.linux
-+++ b/pppdump/Makefile.linux
-@@ -2,7 +2,10 @@ DESTDIR = $(INSTROOT)@DESTDIR@
- BINDIR = $(DESTDIR)/sbin
- MANDIR = $(DESTDIR)/share/man/man8
-
--CFLAGS= -O -I../include/net
-+COPTS=-O2 -g
-+CFLAGS= $(COPTS) -I../include/net
-+LDFLAGS=$(LDOPTS)
-+
- OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
-
- INSTALL= install
-@@ -10,12 +13,12 @@ INSTALL= install
- all: pppdump
-
- pppdump: $(OBJS)
-- $(CC) -o pppdump $(OBJS)
-+ $(CC) $(LDFLAGS) -o pppdump $(OBJS)
-
- clean:
- rm -f pppdump $(OBJS) *~
-
- install:
- mkdir -p $(BINDIR) $(MANDIR)
-- $(INSTALL) -s -c pppdump $(BINDIR)
-+ $(INSTALL) -c pppdump $(BINDIR)
- $(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
-diff --git a/pppstats/Makefile.linux b/pppstats/Makefile.linux
-index cca6f0f61d87..9ec8e803665a 100644
---- a/pppstats/Makefile.linux
-+++ b/pppstats/Makefile.linux
-@@ -10,23 +10,24 @@ PPPSTATSRCS = pppstats.c
- PPPSTATOBJS = pppstats.o
-
- #CC = gcc
--COPTS = -O
-+COPTS = -O2 -g
- COMPILE_FLAGS = -I../include
- LIBS =
-
- INSTALL= install
-
- CFLAGS = $(COPTS) $(COMPILE_FLAGS)
-+LDFLAGS= $(LDOPTS)
-
- all: pppstats
-
- install: pppstats
- -mkdir -p $(MANDIR)
-- $(INSTALL) -s -c pppstats $(BINDIR)
-+ $(INSTALL) -c pppstats $(BINDIR)
- $(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
-
- pppstats: $(PPPSTATSRCS)
-- $(CC) $(CFLAGS) -o pppstats pppstats.c $(LIBS)
-+ $(CC) $(LDFLAGS) $(CFLAGS) -o pppstats pppstats.c $(LIBS)
-
- clean:
- rm -f pppstats *~ #* core
diff --git a/patches/ppp-2.4.7/0018-Bug-306261-pppd-does-not-properly-close-dev-ppp-on-p.patch b/patches/ppp-2.4.7/0018-Bug-306261-pppd-does-not-properly-close-dev-ppp-on-p.patch
deleted file mode 100644
index 41669d12a..000000000
--- a/patches/ppp-2.4.7/0018-Bug-306261-pppd-does-not-properly-close-dev-ppp-on-p.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From: Simon Peter <dn.tlp@gmx.net>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] Bug#306261: pppd does not properly close /dev/ppp on persist
-
-When using the kernel PPPoE driver, pppd never
-closes /dev/ppp when the link has come down.
-
-It opens superfluous fds to the device each time it re-opens the
-connection, with the unclosed ones falsely reported always ready for
-data by select().
-
-This makes pppd eat up 100% CPU time after the first persist because of
-the always instantly returning select() on the unclosed fds.
-
-The problem also occurs with the upstream version, but does not occur
-when a pty/tty device is used for the ppp connection.
-
-
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/sys-linux.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
-index 9b2f293024ac..6d29dc8e8594 100644
---- a/pppd/sys-linux.c
-+++ b/pppd/sys-linux.c
-@@ -458,6 +458,13 @@ int generic_establish_ppp (int fd)
- if (new_style_driver) {
- int flags;
-
-+ /* if a ppp_fd is already open, close it first */
-+ if(ppp_fd > 0) {
-+ close(ppp_fd);
-+ remove_fd(ppp_fd);
-+ ppp_fd = -1;
-+ }
-+
- /* Open an instance of /dev/ppp and connect the channel to it */
- if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) {
- error("Couldn't get channel number: %m");
diff --git a/patches/ppp-2.4.7/0019-Bug-284382-ppp-linkpidfile-is-not-created-upon-detac.patch b/patches/ppp-2.4.7/0019-Bug-284382-ppp-linkpidfile-is-not-created-upon-detac.patch
deleted file mode 100644
index f785c75d8..000000000
--- a/patches/ppp-2.4.7/0019-Bug-284382-ppp-linkpidfile-is-not-created-upon-detac.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From: "herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] Bug#284382: ppp: linkpidfile is not created upon detachment
-
-Package: ppp
-Version: 2.4.2+20040428-2
-Severity: wishlist
-
-When pppd detaches from the parent normally, that is, without nodetach
-or updetach set, the linkpidfile is not created even when linkname is
-set.
-
-This is because the create_linkpidfile call in detach() is only made
-if the linkpidfile is filled in. However, linkpidfile is never filled
-in until create_linkpidfile has been called.
-
-IMHO the call should be made uncondtionally in detach() since
-create_linkpidfile does its own check on linkname anyway.
-
-Please note that the version of pppd in woody always wrote the
-linkpidfile after detaching. It did so in main() however. That
-call has now been removed which is why I'm seeing this problem.
-
-[...]
-
---
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/main.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/pppd/main.c b/pppd/main.c
-index 76b67d2485b7..8e31365f0c58 100644
---- a/pppd/main.c
-+++ b/pppd/main.c
-@@ -765,8 +765,7 @@ detach()
- /* update pid files if they have been written already */
- if (pidfilename[0])
- create_pidfile(pid);
-- if (linkpidfile[0])
-- create_linkpidfile(pid);
-+ create_linkpidfile(pid);
- exit(0); /* parent dies */
- }
- setsid();
diff --git a/patches/ppp-2.4.7/0022-cosmetic-cleanup-of-the-pppoatm-plugin.patch b/patches/ppp-2.4.7/0022-cosmetic-cleanup-of-the-pppoatm-plugin.patch
deleted file mode 100644
index ee22c74b6..000000000
--- a/patches/ppp-2.4.7/0022-cosmetic-cleanup-of-the-pppoatm-plugin.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] cosmetic cleanup of the pppoatm plugin
-
-Removed some debugging messages and generally cleaned up the source.
-
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/pppoatm/pppoatm.c | 23 +++++++++++++----------
- 1 file changed, 13 insertions(+), 10 deletions(-)
-
-diff --git a/pppd/plugins/pppoatm/pppoatm.c b/pppd/plugins/pppoatm/pppoatm.c
-index a7560e9fb0c6..90d0c9a85d9f 100644
---- a/pppd/plugins/pppoatm/pppoatm.c
-+++ b/pppd/plugins/pppoatm/pppoatm.c
-@@ -70,18 +70,20 @@ static int setdevname_pppoatm(const char *cp, const char **argv, int doit)
- {
- struct sockaddr_atmpvc addr;
- extern struct stat devstat;
-+
- if (device_got_set)
- return 0;
-- //info("PPPoATM setdevname_pppoatm: '%s'", cp);
-+
- memset(&addr, 0, sizeof addr);
- if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr),
-- T2A_PVC | T2A_NAME) < 0) {
-- if(doit)
-- info("atm does not recognize: %s", cp);
-+ T2A_PVC | T2A_NAME | T2A_WILDCARD) < 0) {
-+ if (doit)
-+ info("cannot parse the ATM address: %s", cp);
- return 0;
-- }
-- if (!doit) return 1;
-- //if (!dev_set_ok()) return -1;
-+ }
-+ if (!doit)
-+ return 1;
-+
- memcpy(&pvcaddr, &addr, sizeof pvcaddr);
- strlcpy(devnam, cp, sizeof devnam);
- devstat.st_mode = S_IFSOCK;
-@@ -93,7 +95,6 @@ static int setdevname_pppoatm(const char *cp, const char **argv, int doit)
- lcp_allowoptions[0].neg_asyncmap = 0;
- lcp_wantoptions[0].neg_pcompression = 0;
- }
-- info("PPPoATM setdevname_pppoatm - SUCCESS:%s", cp);
- device_got_set = 1;
- return 1;
- }
-@@ -108,6 +109,7 @@ static void no_device_given_pppoatm(void)
- static void set_line_discipline_pppoatm(int fd)
- {
- struct atm_backend_ppp be;
-+
- be.backend_num = ATM_BACKEND_PPP;
- if (!llc_encaps)
- be.encaps = PPPOATM_ENCAPS_VC;
-@@ -115,6 +117,7 @@ static void set_line_discipline_pppoatm(int fd)
- be.encaps = PPPOATM_ENCAPS_LLC;
- else
- be.encaps = PPPOATM_ENCAPS_AUTODETECT;
-+
- if (ioctl(fd, ATM_SETBACKEND, &be) < 0)
- fatal("ioctl(ATM_SETBACKEND): %m");
- }
-@@ -172,7 +175,7 @@ static void disconnect_pppoatm(void)
-
- void plugin_init(void)
- {
--#if defined(__linux__)
-+#ifdef linux
- extern int new_style_driver; /* From sys-linux.c */
- if (!ppp_available() && !new_style_driver)
- fatal("Kernel doesn't support ppp_generic - "
-@@ -180,9 +183,9 @@ void plugin_init(void)
- #else
- fatal("No PPPoATM support on this OS");
- #endif
-- info("PPPoATM plugin_init");
- add_options(pppoa_options);
- }
-+
- struct channel pppoa_channel = {
- options: pppoa_options,
- process_extra_options: NULL,
diff --git a/patches/ppp-2.4.7/0023-pppoe_noads.patch b/patches/ppp-2.4.7/0023-pppoe_noads.patch
deleted file mode 100644
index b4712de17..000000000
--- a/patches/ppp-2.4.7/0023-pppoe_noads.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] pppoe_noads
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/rp-pppoe/plugin.c | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
-index c89be94250bc..7804b184f0cb 100644
---- a/pppd/plugins/rp-pppoe/plugin.c
-+++ b/pppd/plugins/rp-pppoe/plugin.c
-@@ -377,9 +377,6 @@ plugin_init(void)
- }
-
- add_options(Options);
--
-- info("RP-PPPoE plugin version %s compiled against pppd %s",
-- RP_VERSION, VERSION);
- }
-
- void pppoe_check_options(void)
diff --git a/patches/ppp-2.4.7/0024-make-_PATH_CONNERRS-world-readable.patch b/patches/ppp-2.4.7/0024-make-_PATH_CONNERRS-world-readable.patch
deleted file mode 100644
index 557b16901..000000000
--- a/patches/ppp-2.4.7/0024-make-_PATH_CONNERRS-world-readable.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] make _PATH_CONNERRS world readable
-
-There is nothing security-sensitive there.
-
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/main.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pppd/main.c b/pppd/main.c
-index 8e31365f0c58..ed544315c1df 100644
---- a/pppd/main.c
-+++ b/pppd/main.c
-@@ -1673,7 +1673,7 @@ device_script(program, in, out, dont_wait)
- if (log_to_fd >= 0)
- errfd = log_to_fd;
- else
-- errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0600);
-+ errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0644);
-
- ++conn_running;
- pid = safe_fork(in, out, errfd);
diff --git a/patches/ppp-2.4.7/0025-Correct-unkown-unknown-typo.patch b/patches/ppp-2.4.7/0025-Correct-unkown-unknown-typo.patch
deleted file mode 100644
index febfaf869..000000000
--- a/patches/ppp-2.4.7/0025-Correct-unkown-unknown-typo.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] Correct unkown => unknown typo
-
-Author: Chris Boot <bootc@debian.org>
-Last-Update: 2013-09-09
-
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/radius/config.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/pppd/plugins/radius/config.c b/pppd/plugins/radius/config.c
-index a29e5e8da909..f892ca7b1bf5 100644
---- a/pppd/plugins/radius/config.c
-+++ b/pppd/plugins/radius/config.c
-@@ -271,7 +271,7 @@ char *rc_conf_str(char *optname)
- option = find_option(optname, OT_STR);
-
- if (option == NULL)
-- fatal("rc_conf_str: unkown config option requested: %s", optname);
-+ fatal("rc_conf_str: unknown config option requested: %s", optname);
- return (char *)option->val;
- }
-
-@@ -282,7 +282,7 @@ int rc_conf_int(char *optname)
- option = find_option(optname, OT_INT|OT_AUO);
-
- if (option == NULL)
-- fatal("rc_conf_int: unkown config option requested: %s", optname);
-+ fatal("rc_conf_int: unknown config option requested: %s", optname);
- return *((int *)option->val);
- }
-
-@@ -293,7 +293,7 @@ SERVER *rc_conf_srv(char *optname)
- option = find_option(optname, OT_SRV);
-
- if (option == NULL)
-- fatal("rc_conf_srv: unkown config option requested: %s", optname);
-+ fatal("rc_conf_srv: unknown config option requested: %s", optname);
- return (SERVER *)option->val;
- }
-
diff --git a/patches/ppp-2.4.7/0026-pppoe-custom-host-uniq-tag.patch b/patches/ppp-2.4.7/0026-pppoe-custom-host-uniq-tag.patch
deleted file mode 100644
index 5cf266d10..000000000
--- a/patches/ppp-2.4.7/0026-pppoe-custom-host-uniq-tag.patch
+++ /dev/null
@@ -1,302 +0,0 @@
-From: Matteo Croce <matteo@openwrt.org>
-Date: Sat, 21 Nov 2015 18:45:43 +0100
-Subject: [PATCH] pppoe: custom host-uniq tag
-
-Add pppoe 'host-uniq' option to set an arbitrary
-host-uniq tag instead of the pppd pid.
-Some ISPs use such tag to authenticate the CPE,
-so it must be set to a proper value to connect.
-
-Signed-off-by: Matteo Croce <matteo@openwrt.org>
-Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/rp-pppoe/common.c | 14 ++++-----
- pppd/plugins/rp-pppoe/discovery.c | 51 +++++++++++++--------------------
- pppd/plugins/rp-pppoe/plugin.c | 7 ++++-
- pppd/plugins/rp-pppoe/pppoe-discovery.c | 38 +++++++++++++++---------
- pppd/plugins/rp-pppoe/pppoe.h | 31 +++++++++++++++++++-
- 5 files changed, 86 insertions(+), 55 deletions(-)
-
-diff --git a/pppd/plugins/rp-pppoe/common.c b/pppd/plugins/rp-pppoe/common.c
-index 89c633c773f9..8f175ece345b 100644
---- a/pppd/plugins/rp-pppoe/common.c
-+++ b/pppd/plugins/rp-pppoe/common.c
-@@ -119,15 +119,11 @@ sendPADT(PPPoEConnection *conn, char const *msg)
- conn->session = 0;
-
- /* If we're using Host-Uniq, copy it over */
-- if (conn->useHostUniq) {
-- PPPoETag hostUniq;
-- pid_t pid = getpid();
-- hostUniq.type = htons(TAG_HOST_UNIQ);
-- hostUniq.length = htons(sizeof(pid));
-- memcpy(hostUniq.payload, &pid, sizeof(pid));
-- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
-- cursor += sizeof(pid) + TAG_HDR_SIZE;
-- plen += sizeof(pid) + TAG_HDR_SIZE;
-+ if (conn->hostUniq.length) {
-+ int len = ntohs(conn->hostUniq.length);
-+ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
-+ cursor += len + TAG_HDR_SIZE;
-+ plen += len + TAG_HDR_SIZE;
- }
-
- /* Copy error message */
-diff --git a/pppd/plugins/rp-pppoe/discovery.c b/pppd/plugins/rp-pppoe/discovery.c
-index 04877cb8295f..5db8d0defc37 100644
---- a/pppd/plugins/rp-pppoe/discovery.c
-+++ b/pppd/plugins/rp-pppoe/discovery.c
-@@ -80,13 +80,10 @@ static void
- parseForHostUniq(UINT16_t type, UINT16_t len, unsigned char *data,
- void *extra)
- {
-- int *val = (int *) extra;
-- if (type == TAG_HOST_UNIQ && len == sizeof(pid_t)) {
-- pid_t tmp;
-- memcpy(&tmp, data, len);
-- if (tmp == getpid()) {
-- *val = 1;
-- }
-+ PPPoETag *tag = extra;
-+
-+ if (type == TAG_HOST_UNIQ && len == ntohs(tag->length)) {
-+ tag->length = memcmp(data, tag->payload, len);
- }
- }
-
-@@ -104,16 +101,16 @@ parseForHostUniq(UINT16_t type, UINT16_t len, unsigned char *data,
- static int
- packetIsForMe(PPPoEConnection *conn, PPPoEPacket *packet)
- {
-- int forMe = 0;
-+ PPPoETag hostUniq = conn->hostUniq;
-
- /* If packet is not directed to our MAC address, forget it */
- if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0;
-
- /* If we're not using the Host-Unique tag, then accept the packet */
-- if (!conn->useHostUniq) return 1;
-+ if (!conn->hostUniq.length) return 1;
-
-- parsePacket(packet, parseForHostUniq, &forMe);
-- return forMe;
-+ parsePacket(packet, parseForHostUniq, &hostUniq);
-+ return !hostUniq.length;
- }
-
- /**********************************************************************
-@@ -301,16 +298,12 @@ sendPADI(PPPoEConnection *conn)
- }
-
- /* If we're using Host-Uniq, copy it over */
-- if (conn->useHostUniq) {
-- PPPoETag hostUniq;
-- pid_t pid = getpid();
-- hostUniq.type = htons(TAG_HOST_UNIQ);
-- hostUniq.length = htons(sizeof(pid));
-- memcpy(hostUniq.payload, &pid, sizeof(pid));
-- CHECK_ROOM(cursor, packet.payload, sizeof(pid) + TAG_HDR_SIZE);
-- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
-- cursor += sizeof(pid) + TAG_HDR_SIZE;
-- plen += sizeof(pid) + TAG_HDR_SIZE;
-+ if (conn->hostUniq.length) {
-+ int len = ntohs(conn->hostUniq.length);
-+ CHECK_ROOM(cursor, packet.payload, len + TAG_HDR_SIZE);
-+ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
-+ cursor += len + TAG_HDR_SIZE;
-+ plen += len + TAG_HDR_SIZE;
- }
-
- /* Add our maximum MTU/MRU */
-@@ -478,16 +471,12 @@ sendPADR(PPPoEConnection *conn)
- cursor += namelen + TAG_HDR_SIZE;
-
- /* If we're using Host-Uniq, copy it over */
-- if (conn->useHostUniq) {
-- PPPoETag hostUniq;
-- pid_t pid = getpid();
-- hostUniq.type = htons(TAG_HOST_UNIQ);
-- hostUniq.length = htons(sizeof(pid));
-- memcpy(hostUniq.payload, &pid, sizeof(pid));
-- CHECK_ROOM(cursor, packet.payload, sizeof(pid)+TAG_HDR_SIZE);
-- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
-- cursor += sizeof(pid) + TAG_HDR_SIZE;
-- plen += sizeof(pid) + TAG_HDR_SIZE;
-+ if (conn->hostUniq.length) {
-+ int len = ntohs(conn->hostUniq.length);
-+ CHECK_ROOM(cursor, packet.payload, len+TAG_HDR_SIZE);
-+ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
-+ cursor += len + TAG_HDR_SIZE;
-+ plen += len + TAG_HDR_SIZE;
- }
-
- /* Add our maximum MTU/MRU */
-diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
-index 7804b184f0cb..12778d0d9991 100644
---- a/pppd/plugins/rp-pppoe/plugin.c
-+++ b/pppd/plugins/rp-pppoe/plugin.c
-@@ -68,6 +68,7 @@ static char *existingSession = NULL;
- static int printACNames = 0;
- static char *pppoe_reqd_mac = NULL;
- unsigned char pppoe_reqd_mac_addr[6];
-+static char *host_uniq = NULL;
-
- static int PPPoEDevnameHook(char *cmd, char **argv, int doit);
- static option_t Options[] = {
-@@ -85,6 +86,8 @@ static option_t Options[] = {
- "Be verbose about discovered access concentrators"},
- { "pppoe-mac", o_string, &pppoe_reqd_mac,
- "Only connect to specified MAC address" },
-+ { "host-uniq", o_string, &host_uniq,
-+ "Specify custom Host-Uniq" },
- { NULL }
- };
- int (*OldDevnameHook)(char *cmd, char **argv, int doit) = NULL;
-@@ -110,7 +113,6 @@ PPPOEInitDevice(void)
- conn->ifName = devnam;
- conn->discoverySocket = -1;
- conn->sessionSocket = -1;
-- conn->useHostUniq = 1;
- conn->printACNames = printACNames;
- conn->discoveryTimeout = PADI_TIMEOUT;
- return 1;
-@@ -166,6 +168,9 @@ PPPOEConnectDevice(void)
- if (lcp_wantoptions[0].mru > ifr.ifr_mtu - TOTAL_OVERHEAD)
- lcp_wantoptions[0].mru = ifr.ifr_mtu - TOTAL_OVERHEAD;
-
-+ if (host_uniq && !parseHostUniq(host_uniq, &conn->hostUniq))
-+ fatal("Illegal value for host-uniq option");
-+
- conn->acName = acName;
- conn->serviceName = pppd_pppoe_service;
- strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam));
-diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
-index 55037dffb023..ff4c487ffaa9 100644
---- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
-+++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
-@@ -356,7 +356,7 @@ packetIsForMe(PPPoEConnection *conn, PPPoEPacket *packet)
- if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0;
-
- /* If we're not using the Host-Unique tag, then accept the packet */
-- if (!conn->useHostUniq) return 1;
-+ if (!conn->hostUniq.length) return 1;
-
- parsePacket(packet, parseForHostUniq, &forMe);
- return forMe;
-@@ -482,16 +482,12 @@ sendPADI(PPPoEConnection *conn)
- cursor += namelen + TAG_HDR_SIZE;
-
- /* If we're using Host-Uniq, copy it over */
-- if (conn->useHostUniq) {
-- PPPoETag hostUniq;
-- pid_t pid = getpid();
-- hostUniq.type = htons(TAG_HOST_UNIQ);
-- hostUniq.length = htons(sizeof(pid));
-- memcpy(hostUniq.payload, &pid, sizeof(pid));
-- CHECK_ROOM(cursor, packet.payload, sizeof(pid) + TAG_HDR_SIZE);
-- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
-- cursor += sizeof(pid) + TAG_HDR_SIZE;
-- plen += sizeof(pid) + TAG_HDR_SIZE;
-+ if (conn->hostUniq.length) {
-+ int len = ntohs(conn->hostUniq.length);
-+ CHECK_ROOM(cursor, packet.payload, len + TAG_HDR_SIZE);
-+ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
-+ cursor += len + TAG_HDR_SIZE;
-+ plen += len + TAG_HDR_SIZE;
- }
-
- packet.length = htons(plen);
-@@ -653,7 +649,7 @@ int main(int argc, char *argv[])
-
- memset(conn, 0, sizeof(PPPoEConnection));
-
-- while ((opt = getopt(argc, argv, "I:D:VUAS:C:h")) > 0) {
-+ while ((opt = getopt(argc, argv, "I:D:VUW:AS:C:h")) > 0) {
- switch(opt) {
- case 'S':
- conn->serviceName = xstrdup(optarg);
-@@ -662,7 +658,23 @@ int main(int argc, char *argv[])
- conn->acName = xstrdup(optarg);
- break;
- case 'U':
-- conn->useHostUniq = 1;
-+ if(conn->hostUniq.length) {
-+ fprintf(stderr, "-U and -W are mutually exclusive\n");
-+ exit(EXIT_FAILURE);
-+ }
-+ char pidbuf[5];
-+ snprintf(pidbuf, sizeof(pidbuf), "%04x", getpid());
-+ parseHostUniq(pidbuf, &conn->hostUniq);
-+ break;
-+ case 'W':
-+ if(conn->hostUniq.length) {
-+ fprintf(stderr, "-U and -W are mutually exclusive\n");
-+ exit(EXIT_FAILURE);
-+ }
-+ if (!parseHostUniq(optarg, &conn->hostUniq)) {
-+ fprintf(stderr, "Invalid host-uniq argument: %s\n", optarg);
-+ exit(EXIT_FAILURE);
-+ }
- break;
- case 'D':
- conn->debugFile = fopen(optarg, "w");
-diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
-index c4aaa6e68856..08026f577028 100644
---- a/pppd/plugins/rp-pppoe/pppoe.h
-+++ b/pppd/plugins/rp-pppoe/pppoe.h
-@@ -21,6 +21,8 @@
-
- #include <stdio.h> /* For FILE */
- #include <sys/types.h> /* For pid_t */
-+#include <ctype.h>
-+#include <string.h>
-
- /* How do we access raw Ethernet devices? */
- #undef USE_LINUX_PACKET
-@@ -236,7 +238,7 @@ typedef struct PPPoEConnectionStruct {
- char *serviceName; /* Desired service name, if any */
- char *acName; /* Desired AC name, if any */
- int synchronous; /* Use synchronous PPP */
-- int useHostUniq; /* Use Host-Uniq tag */
-+ PPPoETag hostUniq; /* Use Host-Uniq tag */
- int printACNames; /* Just print AC names */
- FILE *debugFile; /* Debug file for dumping packets */
- int numPADOs; /* Number of PADO packets received */
-@@ -292,6 +294,33 @@ void pppoe_printpkt(PPPoEPacket *packet,
- void (*printer)(void *, char *, ...), void *arg);
- void pppoe_log_packet(const char *prefix, PPPoEPacket *packet);
-
-+static inline int parseHostUniq(const char *uniq, PPPoETag *tag)
-+{
-+ int i, len = strlen(uniq);
-+
-+#define hex(x) \
-+ (((x) <= '9') ? ((x) - '0') : \
-+ (((x) <= 'F') ? ((x) - 'A' + 10) : \
-+ ((x) - 'a' + 10)))
-+
-+ if (len % 2)
-+ return 0;
-+
-+ for (i = 0; i < len; i += 2)
-+ {
-+ if (!isxdigit(uniq[i]) || !isxdigit(uniq[i+1]))
-+ return 0;
-+
-+ tag->payload[i / 2] = (char)(16 * hex(uniq[i]) + hex(uniq[i+1]));
-+ }
-+
-+#undef hex
-+
-+ tag->type = htons(TAG_HOST_UNIQ);
-+ tag->length = htons(len / 2);
-+ return 1;
-+}
-+
- #define SET_STRING(var, val) do { if (var) free(var); var = strDup(val); } while(0);
-
- #define CHECK_ROOM(cursor, start, len) \
diff --git a/patches/ppp-2.4.7/0027-Add-replacedefaultroute-option.patch b/patches/ppp-2.4.7/0027-Add-replacedefaultroute-option.patch
deleted file mode 100644
index 19f931b12..000000000
--- a/patches/ppp-2.4.7/0027-Add-replacedefaultroute-option.patch
+++ /dev/null
@@ -1,324 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] Add replacedefaultroute option
-
-Adds an option to pppd to control whether to replace existing default routes
-when using the 'defaultroute' option.
-
-If defaultroute and replacedefaultroute are both set, pppd replaces an existing
-default route with the new default route. The old default route is restored when
-the connection is taken down.
-
-Origin: vendor, https://build.opensuse.org/source/network/ppp/ppp-2.4.2-cifdefroute.diff?rev=7a0fdeff0b29437dd7f4581c95c7255a
-Forwarded: no
-Reviewed-by: Chris Boot <bootc@debian.org>
-Last-Update: 2014-01-26
-
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/ipcp.c | 45 +++++++++++++++++++++++++++----
- pppd/ipcp.h | 1 +
- pppd/pppd.8 | 12 ++++++++-
- pppd/pppd.h | 4 +++
- pppd/sys-linux.c | 82 +++++++++++++++++++++++++++++++++++++++++++++-----------
- 5 files changed, 123 insertions(+), 21 deletions(-)
-
-diff --git a/pppd/ipcp.c b/pppd/ipcp.c
-index e9738fe4d894..c8fe279d4ede 100644
---- a/pppd/ipcp.c
-+++ b/pppd/ipcp.c
-@@ -198,6 +198,16 @@ static option_t ipcp_option_list[] = {
- "disable defaultroute option", OPT_ALIAS | OPT_A2CLR,
- &ipcp_wantoptions[0].default_route },
-
-+#ifdef __linux__
-+ { "replacedefaultroute", o_bool,
-+ &ipcp_wantoptions[0].replace_default_route,
-+ "Replace default route", 1
-+ },
-+ { "noreplacedefaultroute", o_bool,
-+ &ipcp_allowoptions[0].replace_default_route,
-+ "Never replace default route", OPT_A2COPY,
-+ &ipcp_wantoptions[0].replace_default_route },
-+#endif
- { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
- "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
- { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp,
-@@ -271,7 +281,7 @@ struct protent ipcp_protent = {
- ip_active_pkt
- };
-
--static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t));
-+static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool));
- static void ipcp_script __P((char *, int)); /* Run an up/down script */
- static void ipcp_script_done __P((void *));
-
-@@ -1761,7 +1771,12 @@ ip_demand_conf(u)
- if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
- return 0;
- if (wo->default_route)
-+#ifndef __linux__
- if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr))
-+#else
-+ if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr,
-+ wo->replace_default_route))
-+#endif
- default_route_set[u] = 1;
- if (wo->proxy_arp)
- if (sifproxyarp(u, wo->hisaddr))
-@@ -1849,7 +1864,8 @@ ipcp_up(f)
- */
- if (demand) {
- if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) {
-- ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr);
-+ ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr,
-+ wo->replace_default_route);
- if (go->ouraddr != wo->ouraddr) {
- warn("Local IP address changed to %I", go->ouraddr);
- script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0);
-@@ -1874,7 +1890,12 @@ ipcp_up(f)
-
- /* assign a default route through the interface if required */
- if (ipcp_wantoptions[f->unit].default_route)
-+#ifndef __linux__
- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
-+#else
-+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
-+ wo->replace_default_route))
-+#endif
- default_route_set[f->unit] = 1;
-
- /* Make a proxy ARP entry if requested. */
-@@ -1924,7 +1945,12 @@ ipcp_up(f)
-
- /* assign a default route through the interface if required */
- if (ipcp_wantoptions[f->unit].default_route)
-+#ifndef __linux__
- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
-+#else
-+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
-+ wo->replace_default_route))
-+#endif
- default_route_set[f->unit] = 1;
-
- /* Make a proxy ARP entry if requested. */
-@@ -2002,7 +2028,7 @@ ipcp_down(f)
- sifnpmode(f->unit, PPP_IP, NPMODE_DROP);
- sifdown(f->unit);
- ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr,
-- ipcp_hisoptions[f->unit].hisaddr);
-+ ipcp_hisoptions[f->unit].hisaddr, 0);
- }
-
- /* Execute the ip-down script */
-@@ -2018,16 +2044,25 @@ ipcp_down(f)
- * proxy arp entries, etc.
- */
- static void
--ipcp_clear_addrs(unit, ouraddr, hisaddr)
-+ipcp_clear_addrs(unit, ouraddr, hisaddr, replacedefaultroute)
- int unit;
- u_int32_t ouraddr; /* local address */
- u_int32_t hisaddr; /* remote address */
-+ bool replacedefaultroute;
- {
- if (proxy_arp_set[unit]) {
- cifproxyarp(unit, hisaddr);
- proxy_arp_set[unit] = 0;
- }
-- if (default_route_set[unit]) {
-+ /* If replacedefaultroute, sifdefaultroute will be called soon
-+ * with replacedefaultroute set and that will overwrite the current
-+ * default route. This is the case only when doing demand, otherwise
-+ * during demand, this cifdefaultroute would restore the old default
-+ * route which is not what we want in this case. In the non-demand
-+ * case, we'll delete the default route and restore the old if there
-+ * is one saved by an sifdefaultroute with replacedefaultroute.
-+ */
-+ if (!replacedefaultroute && default_route_set[unit]) {
- cifdefaultroute(unit, ouraddr, hisaddr);
- default_route_set[unit] = 0;
- }
-diff --git a/pppd/ipcp.h b/pppd/ipcp.h
-index 6cf14c990578..7ecfa79d8668 100644
---- a/pppd/ipcp.h
-+++ b/pppd/ipcp.h
-@@ -70,6 +70,7 @@ typedef struct ipcp_options {
- bool old_addrs; /* Use old (IP-Addresses) option? */
- bool req_addr; /* Ask peer to send IP address? */
- bool default_route; /* Assign default route through interface? */
-+ bool replace_default_route; /* Replace default route through interface? */
- bool proxy_arp; /* Make proxy ARP entry for peer? */
- bool neg_vj; /* Van Jacobson Compression? */
- bool old_vj; /* use old (short) form of VJ option? */
-diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index ec8bfd5c0617..481aa8be672b 100644
---- a/pppd/pppd.8
-+++ b/pppd/pppd.8
-@@ -121,6 +121,11 @@ the gateway, when IPCP negotiation is successfully completed.
- This entry is removed when the PPP connection is broken. This option
- is privileged if the \fInodefaultroute\fR option has been specified.
- .TP
-+.B replacedefaultroute
-+This option is a flag to the defaultroute option. If defaultroute is
-+set and this flag is also set, pppd replaces an existing default route
-+with the new default route.
-+.TP
- .B disconnect \fIscript
- Execute the command specified by \fIscript\fR, by passing it to a
- shell, after
-@@ -739,7 +744,12 @@ disable both forms of hardware flow control.
- .TP
- .B nodefaultroute
- Disable the \fIdefaultroute\fR option. The system administrator who
--wishes to prevent users from creating default routes with pppd
-+wishes to prevent users from adding a default route with pppd
-+can do so by placing this option in the /etc/ppp/options file.
-+.TP
-+.B noreplacedefaultroute
-+Disable the \fIreplacedefaultroute\fR option. The system administrator who
-+wishes to prevent users from replacing a default route with pppd
- can do so by placing this option in the /etc/ppp/options file.
- .TP
- .B nodeflate
-diff --git a/pppd/pppd.h b/pppd/pppd.h
-index 1a1bf0b99582..7495df657fe9 100644
---- a/pppd/pppd.h
-+++ b/pppd/pppd.h
-@@ -676,7 +676,11 @@ int sif6addr __P((int, eui64_t, eui64_t));
- int cif6addr __P((int, eui64_t, eui64_t));
- /* Remove an IPv6 address from i/f */
- #endif
-+#ifndef __linux__
- int sifdefaultroute __P((int, u_int32_t, u_int32_t));
-+#else
-+int sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt));
-+#endif
- /* Create default route through i/f */
- int cifdefaultroute __P((int, u_int32_t, u_int32_t));
- /* Delete default route through i/f */
-diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
-index 6d29dc8e8594..3f0bbc33c605 100644
---- a/pppd/sys-linux.c
-+++ b/pppd/sys-linux.c
-@@ -207,6 +207,8 @@ static unsigned char inbuf[512]; /* buffer for chars read from loopback */
- static int if_is_up; /* Interface has been marked up */
- static int if6_is_up; /* Interface has been marked up for IPv6, to help differentiate */
- static int have_default_route; /* Gateway for default route added */
-+static struct rtentry old_def_rt; /* Old default route */
-+static int default_rt_repl_rest; /* replace and restore old default rt */
- static u_int32_t proxy_arp_addr; /* Addr for proxy arp entry added */
- static char proxy_arp_dev[16]; /* Device for proxy arp entry */
- static u_int32_t our_old_addr; /* for detecting address changes */
-@@ -1567,6 +1569,9 @@ static int read_route_table(struct rtentry *rt)
- p = NULL;
- }
-
-+ SET_SA_FAMILY (rt->rt_dst, AF_INET);
-+ SET_SA_FAMILY (rt->rt_gateway, AF_INET);
-+
- SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16);
- SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16);
- SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
-@@ -1636,22 +1641,53 @@ int have_route_to(u_int32_t addr)
- /********************************************************************
- *
- * sifdefaultroute - assign a default route through the address given.
-- */
--
--int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
--{
-- struct rtentry rt;
--
-- if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
-- if (rt.rt_flags & RTF_GATEWAY)
-- error("not replacing existing default route via %I",
-- SIN_ADDR(rt.rt_gateway));
-- else
-- error("not replacing existing default route through %s",
-- rt.rt_dev);
-- return 0;
-+ *
-+ * If the global default_rt_repl_rest flag is set, then this function
-+ * already replaced the original system defaultroute with some other
-+ * route and it should just replace the current defaultroute with
-+ * another one, without saving the current route. Use: demand mode,
-+ * when pppd sets first a defaultroute it it's temporary ppp0 addresses
-+ * and then changes the temporary addresses to the addresses for the real
-+ * ppp connection when it has come up.
-+ */
-+
-+int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway, bool replace)
-+{
-+ struct rtentry rt, tmp_rt;
-+ struct rtentry *del_rt = NULL;
-+
-+ if (default_rt_repl_rest) {
-+ /* We have already reclaced the original defaultroute, if we
-+ * are called again, we will delete the current default route
-+ * and set the new default route in this function.
-+ * - this is normally only the case the doing demand: */
-+ if (defaultroute_exists( &tmp_rt ))
-+ del_rt = &tmp_rt;
-+ } else if ( defaultroute_exists( &old_def_rt ) &&
-+ strcmp( old_def_rt.rt_dev, ifname ) != 0) {
-+ /* We did not yet replace an existing default route, let's
-+ * check if we should save and replace a default route:
-+ */
-+ u_int32_t old_gateway = SIN_ADDR(old_def_rt.rt_gateway);
-+
-+ if (old_gateway != gateway) {
-+ if (!replace) {
-+ error("not replacing default route to %s [%I]",
-+ old_def_rt.rt_dev, old_gateway);
-+ return 0;
-+ } else {
-+ // we need to copy rt_dev because we need it permanent too:
-+ char * tmp_dev = malloc(strlen(old_def_rt.rt_dev)+1);
-+ strcpy(tmp_dev, old_def_rt.rt_dev);
-+ old_def_rt.rt_dev = tmp_dev;
-+
-+ notice("replacing old default route to %s [%I]",
-+ old_def_rt.rt_dev, old_gateway);
-+ default_rt_repl_rest = 1;
-+ del_rt = &old_def_rt;
-+ }
-+ }
- }
--
- memset (&rt, 0, sizeof (rt));
- SET_SA_FAMILY (rt.rt_dst, AF_INET);
-
-@@ -1668,6 +1704,12 @@ int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
- error("default route ioctl(SIOCADDRT): %m");
- return 0;
- }
-+ if (default_rt_repl_rest && del_rt)
-+ if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) {
-+ if ( ! ok_error ( errno ))
-+ error("del old default route ioctl(SIOCDELRT): %m(%d)", errno);
-+ return 0;
-+ }
-
- have_default_route = 1;
- return 1;
-@@ -1703,6 +1745,16 @@ int cifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
- return 0;
- }
- }
-+ if (default_rt_repl_rest) {
-+ notice("restoring old default route to %s [%I]",
-+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
-+ if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) {
-+ if ( ! ok_error ( errno ))
-+ error("restore default route ioctl(SIOCADDRT): %m(%d)", errno);
-+ return 0;
-+ }
-+ default_rt_repl_rest = 0;
-+ }
-
- return 1;
- }
diff --git a/patches/ppp-2.4.7/0029-add-support-for-the-Framed-MTU-Radius-attribute.patch b/patches/ppp-2.4.7/0029-add-support-for-the-Framed-MTU-Radius-attribute.patch
deleted file mode 100644
index 3cd1b78e7..000000000
--- a/patches/ppp-2.4.7/0029-add-support-for-the-Framed-MTU-Radius-attribute.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] add support for the Framed-MTU Radius attribute
-
-http://ppp.samba.org/cgi-bin/ppp-bugs/incoming?id=1532
-
-From: klepikov_a@up.ua
-To: ppp-bugs@ppp.samba.org
-Subject: Radius plugin does not set MTU on ppp interface
-Date: Mon, 22 Jan 2007 12:36:59 +0000 (GMT)
-
-Full_Name: Alexander Klepikov
-Version: 2.4.3
-OS: rhl 7.3 (2.4.20-28.7bigmem)
-Submission from: (NULL) (213.130.21.73)
-
-
-This patch allows radius plugin to deal with Framed-MTU Radius attribute and to
-set MTU on interface.
-
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/radius/radius.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c
-index 4ba5f523ea07..06e00590b635 100644
---- a/pppd/plugins/radius/radius.c
-+++ b/pppd/plugins/radius/radius.c
-@@ -651,6 +651,9 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
- memcpy(rstate.class, vp->strvalue, rstate.class_len);
- } /* else too big for our buffer - ignore it */
- break;
-+ case PW_FRAMED_MTU:
-+ netif_set_mtu(rstate.client_port,MIN(netif_get_mtu(rstate.client_port),vp->lvalue));
-+ break;
- }
-
-
diff --git a/patches/ppp-2.4.7/0030-018_ip-up_option.patch b/patches/ppp-2.4.7/0030-018_ip-up_option.patch
deleted file mode 100644
index 06cb2e5bb..000000000
--- a/patches/ppp-2.4.7/0030-018_ip-up_option.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] 018_ip up_option
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/ipcp.c | 8 ++++----
- pppd/main.c | 3 +++
- pppd/options.c | 9 +++++++++
- pppd/pppd.h | 2 ++
- 4 files changed, 18 insertions(+), 4 deletions(-)
-
-diff --git a/pppd/ipcp.c b/pppd/ipcp.c
-index dceca807542a..d6e0e2a699fe 100644
---- a/pppd/ipcp.c
-+++ b/pppd/ipcp.c
-@@ -1984,7 +1984,7 @@ ipcp_up(f)
- */
- if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
- ipcp_script_state = s_up;
-- ipcp_script(_PATH_IPUP, 0);
-+ ipcp_script(path_ipup, 0);
- }
- }
-
-@@ -2034,7 +2034,7 @@ ipcp_down(f)
- /* Execute the ip-down script */
- if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
- ipcp_script_state = s_down;
-- ipcp_script(_PATH_IPDOWN, 0);
-+ ipcp_script(path_ipdown, 0);
- }
- }
-
-@@ -2097,13 +2097,13 @@ ipcp_script_done(arg)
- case s_up:
- if (ipcp_fsm[0].state != OPENED) {
- ipcp_script_state = s_down;
-- ipcp_script(_PATH_IPDOWN, 0);
-+ ipcp_script(path_ipdown, 0);
- }
- break;
- case s_down:
- if (ipcp_fsm[0].state == OPENED) {
- ipcp_script_state = s_up;
-- ipcp_script(_PATH_IPUP, 0);
-+ ipcp_script(path_ipup, 0);
- }
- break;
- }
-diff --git a/pppd/main.c b/pppd/main.c
-index ed544315c1df..9164a1eb0f95 100644
---- a/pppd/main.c
-+++ b/pppd/main.c
-@@ -308,6 +308,9 @@ main(argc, argv)
- struct protent *protp;
- char numbuf[16];
-
-+ strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
-+ strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
-+
- link_stats_valid = 0;
- new_phase(PHASE_INITIALIZE);
-
-diff --git a/pppd/options.c b/pppd/options.c
-index 91da515ac533..a8f3aa4590a3 100644
---- a/pppd/options.c
-+++ b/pppd/options.c
-@@ -114,6 +114,8 @@ char linkname[MAXPATHLEN]; /* logical name for link */
- bool tune_kernel; /* may alter kernel settings */
- int connect_delay = 1000; /* wait this many ms after connect script */
- int req_unit = -1; /* requested interface unit */
-+char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
-+char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
- char req_ifname[MAXIFNAMELEN]; /* requested interface name */
- bool multilink = 0; /* Enable multilink operation */
- char *bundle_name = NULL; /* bundle name for multilink */
-@@ -304,6 +306,13 @@ option_t general_options[] = {
- "Unset user environment variable",
- OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint },
-
-+ { "ip-up-script", o_string, path_ipup,
-+ "Set pathname of ip-up script",
-+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
-+ { "ip-down-script", o_string, path_ipdown,
-+ "Set pathname of ip-down script",
-+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
-+
- #ifdef HAVE_MULTILINK
- { "multilink", o_bool, &multilink,
- "Enable multilink operation", OPT_PRIO | 1 },
-diff --git a/pppd/pppd.h b/pppd/pppd.h
-index e65106d4c126..b11670586244 100644
---- a/pppd/pppd.h
-+++ b/pppd/pppd.h
-@@ -328,6 +328,8 @@ extern bool tune_kernel; /* May alter kernel settings as necessary */
- extern int connect_delay; /* Time to delay after connect script */
- extern int max_data_rate; /* max bytes/sec through charshunt */
- extern int req_unit; /* interface unit number to use */
-+extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
-+extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
- extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
- extern bool multilink; /* enable multilink operation */
- extern bool noendpoint; /* don't send or accept endpt. discrim. */
diff --git a/patches/ppp-2.4.7/0031-ppp-2.4.2-stripMSdomain.patch b/patches/ppp-2.4.7/0031-ppp-2.4.2-stripMSdomain.patch
deleted file mode 100644
index 32629026c..000000000
--- a/patches/ppp-2.4.7/0031-ppp-2.4.2-stripMSdomain.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] ppp-2.4.2-stripMSdomain
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/chap-new.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/pppd/chap-new.c b/pppd/chap-new.c
-index 2714bff64785..7fd7087a5e2c 100644
---- a/pppd/chap-new.c
-+++ b/pppd/chap-new.c
-@@ -58,6 +58,7 @@ int (*chap_verify_hook)(char *name, char *ourname, int id,
- int chap_timeout_time = 3;
- int chap_max_transmits = 10;
- int chap_rechallenge_time = 0;
-+int chapms_strip_domain = 0;
-
- /*
- * Command-line options.
-@@ -69,6 +70,8 @@ static option_t chap_option_list[] = {
- "Set max #xmits for challenge", OPT_PRIO },
- { "chap-interval", o_int, &chap_rechallenge_time,
- "Set interval for rechallenge", OPT_PRIO },
-+ { "chapms-strip-domain", o_bool, &chapms_strip_domain,
-+ "Strip the domain prefix before the Username", 1 },
- { NULL }
- };
-
-@@ -336,6 +339,14 @@ chap_handle_response(struct chap_server_state *ss, int id,
- /* Null terminate and clean remote name. */
- slprintf(rname, sizeof(rname), "%.*v", len, name);
- name = rname;
-+
-+ /* strip the MS domain name */
-+ if (chapms_strip_domain && strrchr(rname, '\\')) {
-+ char tmp[MAXNAMELEN+1];
-+
-+ strcpy(tmp, strrchr(rname, '\\') + 1);
-+ strcpy(rname, tmp);
-+ }
- }
-
- if (chap_verify_hook)
diff --git a/patches/ppp-2.4.7/0032-export-CALL_FILE-to-the-link-scripts.patch b/patches/ppp-2.4.7/0032-export-CALL_FILE-to-the-link-scripts.patch
deleted file mode 100644
index 6a2e17088..000000000
--- a/patches/ppp-2.4.7/0032-export-CALL_FILE-to-the-link-scripts.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:50 +0200
-Subject: [PATCH] export $CALL_FILE to the link scripts
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/options.c | 1 +
- pppd/pppd.8 | 3 +++
- 2 files changed, 4 insertions(+)
-
-diff --git a/pppd/options.c b/pppd/options.c
-index a8f3aa4590a3..340797386dd6 100644
---- a/pppd/options.c
-+++ b/pppd/options.c
-@@ -1482,6 +1482,7 @@ callfile(argv)
- if ((fname = (char *) malloc(l)) == NULL)
- novm("call file name");
- slprintf(fname, l, "%s%s", _PATH_PEERFILES, arg);
-+ script_setenv("CALL_FILE", arg, 0);
-
- ok = options_from_file(fname, 1, 1, 1);
-
-diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index 481aa8be672b..848ca8a16b77 100644
---- a/pppd/pppd.8
-+++ b/pppd/pppd.8
-@@ -1662,6 +1662,9 @@ the connection.
- .B LINKNAME
- The logical name of the link, set with the \fIlinkname\fR option.
- .TP
-+.B CALL_FILE
-+The value of the \fIcall\fR option.
-+.TP
- .B DNS1
- If the peer supplies DNS server addresses, this variable is set to the
- first DNS server address supplied (whether or not the usepeerdns
diff --git a/patches/ppp-2.4.7/0033-ipv6-accept-remote.patch b/patches/ppp-2.4.7/0033-ipv6-accept-remote.patch
deleted file mode 100644
index 01376cf14..000000000
--- a/patches/ppp-2.4.7/0033-ipv6-accept-remote.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:50 +0200
-Subject: [PATCH] ipv6-accept-remote
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/ipv6cp.c | 5 ++++-
- pppd/ipv6cp.h | 3 ++-
- pppd/pppd.8 | 5 +++++
- 3 files changed, 11 insertions(+), 2 deletions(-)
-
-diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c
-index c1602f41c206..432170462196 100644
---- a/pppd/ipv6cp.c
-+++ b/pppd/ipv6cp.c
-@@ -245,6 +245,8 @@ static option_t ipv6cp_option_list[] = {
-
- { "ipv6cp-accept-local", o_bool, &ipv6cp_allowoptions[0].accept_local,
- "Accept peer's interface identifier for us", 1 },
-+ { "ipv6cp-accept-remote", o_bool, &ipv6cp_allowoptions[0].accept_remote,
-+ "Accept peer's interface identifier for itself", 1 },
-
- { "ipv6cp-use-ipaddr", o_bool, &ipv6cp_allowoptions[0].use_ip,
- "Use (default) IPv4 address as interface identifier", 1 },
-@@ -435,6 +437,7 @@ ipv6cp_init(unit)
- memset(ao, 0, sizeof(*ao));
-
- wo->accept_local = 1;
-+ wo->accept_remote = 1;
- wo->neg_ifaceid = 1;
- ao->neg_ifaceid = 1;
-
-@@ -960,7 +963,7 @@ ipv6cp_reqci(f, inp, len, reject_if_disagree)
- orc = CONFREJ; /* Reject CI */
- break;
- }
-- if (!eui64_iszero(wo->hisid) &&
-+ if (!eui64_iszero(wo->hisid) && !wo->accept_remote &&
- !eui64_equals(ifaceid, wo->hisid) &&
- eui64_iszero(go->hisid)) {
-
-diff --git a/pppd/ipv6cp.h b/pppd/ipv6cp.h
-index 2f4c06ddc189..1617707ebbde 100644
---- a/pppd/ipv6cp.h
-+++ b/pppd/ipv6cp.h
-@@ -150,7 +150,8 @@
- typedef struct ipv6cp_options {
- int neg_ifaceid; /* Negotiate interface identifier? */
- int req_ifaceid; /* Ask peer to send interface identifier? */
-- int accept_local; /* accept peer's value for iface id? */
-+ int accept_local; /* accept peer's value for our iface id? */
-+ int accept_remote; /* accept peer's value for his iface id? */
- int opt_local; /* ourtoken set by option */
- int opt_remote; /* histoken set by option */
- int use_ip; /* use IP as interface identifier */
-diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index 848ca8a16b77..65bbe721f761 100644
---- a/pppd/pppd.8
-+++ b/pppd/pppd.8
-@@ -463,6 +463,11 @@ With this option, pppd will accept the peer's idea of our local IPv6
- interface identifier, even if the local IPv6 interface identifier
- was specified in an option.
- .TP
-+.B ipv6cp\-accept\-remote
-+With this option, pppd will accept the peer's idea of its (remote)
-+IPv6 interface identifier, even if the remote IPv6 interface
-+identifier was specified in an option.
-+.TP
- .B ipv6cp\-max\-configure \fIn
- Set the maximum number of IPv6CP configure-request transmissions to
- \fIn\fR (default 10).
diff --git a/patches/ppp-2.4.7/0034-fix-a-potential-buffer-overflow-in-clientid.c-rc_map.patch b/patches/ppp-2.4.7/0034-fix-a-potential-buffer-overflow-in-clientid.c-rc_map.patch
deleted file mode 100644
index 2a8a029df..000000000
--- a/patches/ppp-2.4.7/0034-fix-a-potential-buffer-overflow-in-clientid.c-rc_map.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:50 +0200
-Subject: [PATCH] fix a potential buffer overflow in clientid.c:rc_map2id()
-
-This fixes the following compile-time warning when building with
--D_FORTIFY_SOURCE=2:
-
-In file included from /usr/include/string.h:638:0,
- from ./includes.h:26,
- from clientid.c:12:
-In function 'strncat',
- inlined from 'rc_map2id' at clientid.c:113:9:
-/usr/include/i386-linux-gnu/bits/string3.h:150:3: warning: call to
-__builtin___strncat_chk might overflow destination buffer [enabled by default]
- return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
- ^
-
-Origin: vendor, https://build.opensuse.org/source/network/ppp/ppp-2.4.4-strncatfix.patch?rev=7a0fdeff0b29437dd7f4581c95c7255a
-Forwarded: no
-Reviewed-by: Chris Boot <bootc@debian.org>
-Last-Update: 2014-01-12
-
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/radius/clientid.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pppd/plugins/radius/clientid.c b/pppd/plugins/radius/clientid.c
-index d49579c43cc3..7de021139b56 100644
---- a/pppd/plugins/radius/clientid.c
-+++ b/pppd/plugins/radius/clientid.c
-@@ -110,7 +110,7 @@ UINT4 rc_map2id(char *name)
- if (*name != '/')
- strcpy(ttyname, "/dev/");
-
-- strncat(ttyname, name, sizeof(ttyname));
-+ strncat(ttyname, name, sizeof(ttyname)-strlen(ttyname)-1);
-
- for(p = map2id_list; p; p = p->next)
- if (!strcmp(ttyname, p->name)) return p->id;
diff --git a/patches/ppp-2.4.7/0037-Fix-buffer-overflow-in-rc_mksid.patch b/patches/ppp-2.4.7/0037-Fix-buffer-overflow-in-rc_mksid.patch
deleted file mode 100644
index e21f129ad..000000000
--- a/patches/ppp-2.4.7/0037-Fix-buffer-overflow-in-rc_mksid.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:50 +0200
-Subject: [PATCH] Fix buffer overflow in rc_mksid()
-
- rc_mksid converts the PID of pppd to hex to generate a pseudo-unique string.
- .
- If the process id is bigger than 65535 (FFFF), its hex representation will be
- longer than 4 characters, resulting in a buffer overflow.
- .
- The bug can be exploited to cause a remote DoS.
- .
-Author: Emanuele Rocca <ema@debian.org>
-Bug-Debian: https://bugs.debian.org/782450
-Last-Update: <2015-04-14>
-
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/plugins/radius/util.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pppd/plugins/radius/util.c b/pppd/plugins/radius/util.c
-index 6f976a712951..166bd5f31d7a 100644
---- a/pppd/plugins/radius/util.c
-+++ b/pppd/plugins/radius/util.c
-@@ -77,7 +77,7 @@ rc_mksid (void)
- static unsigned short int cnt = 0;
- sprintf (buf, "%08lX%04X%02hX",
- (unsigned long int) time (NULL),
-- (unsigned int) getpid (),
-+ (unsigned int) getpid () % 65535,
- cnt & 0xFF);
- cnt++;
- return buf;
diff --git a/patches/ppp-2.4.7/0038-EAP-TLS-authentication-support-for-PPP.patch b/patches/ppp-2.4.7/0038-EAP-TLS-authentication-support-for-PPP.patch
deleted file mode 100644
index bd462d4f8..000000000
--- a/patches/ppp-2.4.7/0038-EAP-TLS-authentication-support-for-PPP.patch
+++ /dev/null
@@ -1,3383 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:50 +0200
-Subject: [PATCH] EAP-TLS authentication support for PPP
-
-Origin: https://www.nikhef.nl/~janjust/ppp/download.html
-Bug-Debian: https://bugs.debian.org/602503
-Bug-Ubuntu: https://launchpad.net/bugs/643417
-Forwarded: not-needed
-Author: Jan Just Keijser <janjust@nikhef.nl>
-Last-Update: 2018-11-04
-
-This patch is based on ppp-2.4.7-eaptls-mppe-1.102.patch, with the following
-changes:
-
- - Patch refreshed to remove fuzz.
- - Trailing spaces removed.
-
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- README.eap-tls | 291 +++++++++
- etc.ppp/eaptls-client | 10 +
- etc.ppp/eaptls-server | 11 +
- etc.ppp/openssl.cnf | 14 +
- linux/Makefile.top | 6 +-
- pppd/Makefile.linux | 12 +
- pppd/auth.c | 413 ++++++++++++-
- pppd/ccp.c | 20 +-
- pppd/chap-md5.c | 4 +
- pppd/eap-tls.c | 1383 +++++++++++++++++++++++++++++++++++++++++++
- pppd/eap-tls.h | 107 ++++
- pppd/eap.c | 463 ++++++++++++++-
- pppd/eap.h | 32 +-
- pppd/md5.c | 4 +
- pppd/md5.h | 3 +
- pppd/pathnames.h | 7 +
- pppd/plugins/Makefile.linux | 3 +
- pppd/plugins/passprompt.c | 3 +
- pppd/plugins/passwordfd.c | 4 +
- pppd/pppd.8 | 33 ++
- pppd/pppd.h | 9 +
- 21 files changed, 2825 insertions(+), 7 deletions(-)
- create mode 100644 README.eap-tls
- create mode 100644 etc.ppp/eaptls-client
- create mode 100644 etc.ppp/eaptls-server
- create mode 100644 etc.ppp/openssl.cnf
- create mode 100644 pppd/eap-tls.c
- create mode 100644 pppd/eap-tls.h
-
-diff --git a/README.eap-tls b/README.eap-tls
-new file mode 100644
-index 000000000000..107e84db5e81
---- /dev/null
-+++ b/README.eap-tls
-@@ -0,0 +1,291 @@
-+EAP-TLS authentication support for PPP
-+======================================
-+
-+1. Intro
-+
-+ The Extensible Authentication Protocol (EAP; RFC 3748) is a
-+ security protocol that can be used with PPP. It provides a means
-+ to plug in multiple optional authentication methods.
-+
-+ Transport Level Security (TLS; RFC 5216) provides for mutual
-+ authentication, integrity-protected ciphersuite negotiation and
-+ key exchange between two endpoints. It also provides for optional
-+ MPPE encryption.
-+
-+ EAP-TLS (RFC 2716) incapsulates the TLS messages in EAP packets,
-+ allowing TLS mutual authentication to be used as a generic EAP
-+ mechanism. It also provides optional encryption using the MPPE
-+ protocol.
-+
-+ This patch provide EAP-TLS support to pppd.
-+ This authentication method can be used in both client or server
-+ mode.
-+
-+2. Building
-+
-+ To build pppd with EAP-TLS support, OpenSSL (http://www.openssl.org)
-+ is required. Any version from 0.9.7 should work.
-+
-+ Configure, compile, and install as usual.
-+
-+3. Configuration
-+
-+ On the client side there are two ways to configure EAP-TLS:
-+
-+ 1. supply the appropriate 'ca', 'cert' and 'key' command-line parameters
-+
-+ 2. edit the /etc/ppp/eaptls-client file.
-+ Insert a line for each system with which you use EAP-TLS.
-+ The line is composed of this fields separated by tab:
-+
-+ - Client name
-+ The name used by the client for authentication, can be *
-+ - Server name
-+ The name of the server, can be *
-+ - Client certificate file
-+ The file containing the certificate chain for the
-+ client in PEM format
-+ - Server certificate file
-+ If you want to specify the certificate that the
-+ server is allowed to use, put the certificate file name.
-+ Else put a dash '-'.
-+ - CA certificate file
-+ The file containing the trusted CA certificates in PEM
-+ format.
-+ - Client private key file
-+ The file containing the client private key in PEM format.
-+
-+
-+ On the server side edit the /etc/ppp/eaptls-server file.
-+ Insert a line for each system with which you use EAP-TLS.
-+ The line is composed of this fields separated by tab:
-+
-+ - Client name
-+ The name used by the client for authentication, can be *
-+ - Server name
-+ The name of the server, can be *
-+ - Client certificate file
-+ If you want to specify the certificate that the
-+ client is allowed to use, put the certificate file name.
-+ Else put a dash '-'.
-+ - Server certificate file
-+ The file containing the certificate chain for the
-+ server in PEM format
-+ - CA certificate file
-+ The file containing the trusted CA certificates in PEM format.
-+ - Client private key file
-+ The file containing the server private key in PEM format.
-+ - addresses
-+ A list of IP addresses the client is allowed to use.
-+
-+
-+ OpenSSL engine support is included starting with v0.95 of this patch.
-+ Currently the only engine tested is the 'pkcs11' engine (hardware token
-+ support). To use the 'pksc11' engine:
-+ - Use a special private key fileiname in the /etc/ppp/eaptls-client file:
-+ <engine>:<identifier>
-+ e.g.
-+ pkcs11:123456
-+
-+ - The certificate can also be loaded from the 'pkcs11' engine using
-+ a special client certificate filename in the /etc/ppp/eaptls-client file:
-+ <engine>:<identifier>
-+ e.g.
-+ pkcs11:123456
-+
-+ - Create an /etc/ppp/openssl.cnf file to load the right OpenSSL engine prior
-+ to starting 'pppd'. A sample openssl.cnf file is
-+
-+ openssl_conf = openssl_def
-+
-+ [ openssl_def ]
-+ engines = engine_section
-+
-+ [ engine_section ]
-+ pkcs11 = pkcs11_section
-+
-+ [ pkcs11_section ]
-+ engine_id = pkcs11
-+ dynamic_path = /usr/lib64/openssl/engines/engine_pkcs11.so
-+ MODULE_PATH = /usr/lib64/libeTPkcs11.so
-+ init = 0
-+
-+ - There are two ways to specify a password/PIN for the PKCS11 engine:
-+ - inside the openssl.cnf file using
-+ PIN = your-secret-pin
-+ Note The keyword 'PIN' is case sensitive!
-+ - Using the 'password' in the ppp options file.
-+ From v0.97 of the eap-tls patch the password can also be supplied
-+ using the appropriate 'eaptls_passwd_hook' (see plugins/passprompt.c
-+ for an example).
-+
-+
-+4. Options
-+
-+ These pppd options are available:
-+
-+ ca <ca-file>
-+ Use the CA public certificate found in <ca-file> in PEM format
-+ cert <cert-file>
-+ Use the client public certificate found in <cert-file> in PEM format
-+ or in engine:engine_id format
-+ key <key-file>
-+ Use the client private key found in <key-file> in PEM format
-+ or in engine:engine_id format
-+ crl <crl-file>
-+ Use the Certificate Revocation List (CRL) file <crl-file> in PEM format.
-+ crl-dir <dir>
-+ Use CRL files from directory <dir>. It contains CRL files in PEM
-+ format and each file contains a CRL. The files are looked up
-+ by the issuer name hash value. Use the c_rehash utility
-+ to create necessary links.
-+ need-peer-eap
-+ If the peer doesn't ask us to authenticate or doesn't use eap
-+ to authenticate us, disconnect.
-+
-+ Note:
-+ password-encrypted certificates can be used as of v0.94 of this
-+ patch. The password for the eap-tls.key file is specified using
-+ the regular
-+ password ....
-+ statement in the ppp options file, or by using the appropriate
-+ plugin which supplies a 'eaptls_passwd_hook' routine.
-+
-+5. Connecting
-+
-+ If you're setting up a pppd server, edit the EAP-TLS configuration file
-+ as written above and then run pppd with the 'auth' option to authenticate
-+ the client. The EAP-TLS method will be used if the other eap methods can't
-+ be used (no secrets).
-+
-+ If you're setting up a client, edit the configuration file and then run
-+ pppd with 'remotename' option to specify the server name. Add the
-+ 'need-peer-eap' option if you want to be sure the peer ask you to
-+ authenticate (and to use eap) and to disconnect if it doesn't.
-+
-+6. Example
-+
-+ The following example can be used to connect a Linux client with the 'pptp'
-+ package to a Linux server running the 'pptpd' (PoPToP) package. The server
-+ was configured with a certificate with name (CN) 'pptp-server', the client
-+ was configured with a certificate with name (CN) 'pptp-client', both
-+ signed by the same Certificate Authority (CA).
-+
-+ Server side:
-+ - /etc/pptpd.conf file:
-+ option /etc/ppp/options-pptpd-eaptls
-+ localip 172.16.1.1
-+ remoteip 172.16.1.10-20
-+ - /etc/ppp/options-pptpd-eaptls file:
-+ name pptp-server
-+ lock
-+ mtu 1500
-+ mru 1450
-+ auth
-+ lcp-echo-failure 3
-+ lcp-echo-interval 5
-+ nodeflate
-+ nobsdcomp
-+ nopredictor1
-+ nopcomp
-+ noaccomp
-+
-+ require-eap
-+ require-mppe-128
-+
-+ crl /home/janjust/ppp/keys/crl.pem
-+
-+ debug
-+ logfile /tmp/pppd.log
-+
-+ - /etc/ppp/eaptls-server file:
-+ * pptp-server - /etc/ppp/pptp-server.crt /etc/ppp/ca.crt /etc/ppp/pptp-server.key *
-+
-+ - On the server, run
-+ pptdp --conf /etc/pptpd.conf
-+
-+ Client side:
-+ - Run
-+ pppd noauth require-eap require-mppe-128 \
-+ ipcp-accept-local ipcp-accept-remote noipdefault \
-+ cert /etc/ppp/keys/pptp-client.crt \
-+ key /etc/ppp/keys/pptp-client.key \
-+ ca /etc/ppp/keys/ca.crt \
-+ name pptp-client remotename pptp-server \
-+ debug logfile /tmp/pppd.log
-+ pty "pptp pptp-server.example.com --nolaunchpppd"
-+
-+ Check /var/log/messages and the files /tmp/pppd.log on both sides for debugging info.
-+
-+7. Notes
-+
-+ This is experimental code.
-+ Send suggestions and comments to Jan Just Keijser <janjust@nikhef.nl>
-+
-+8. Changelog of ppp-<>-eaptls-mppe-* patches
-+
-+v0.7 (22-Nov-2005)
-+ - First version of the patch to include MPPE support
-+ - ppp-2.4.3 only
-+v0.9 (25-Jul-2006)
-+ - Bug fixes
-+ - First version for ppp-2.4.4
-+v0.91 (03-Sep-2006)
-+ - Added missing #include for md5.h
-+ - Last version for ppp-2.4.3
-+v0.92 (22-Apr-2008)
-+ - Fix for openssl 0.9.8 issue with md5 function overload.
-+v0.93 (14-Aug-2008)
-+ - Make sure 'noauth' option can be used to bypass server certificate verification.
-+v0.94 (15-Oct-2008)
-+ - Added support for password-protected private keys by (ab)using the 'password' field.
-+v0.95 (23-Dec-2009)
-+ - First version with OpenSSL engine support.
-+v0.96 (27-Jan-2010)
-+ - Added fully functional support for OpenSSL engines (PKCS#11)
-+ - First version for ppp-2.4.5
-+v0.97 (20-Apr-2010)
-+ - Some bug fixes for v0.96
-+ - Added support for entering the password via a plugin. The sample plugin
-+ .../pppd/plugins/passprompt.c has been extended with EAP-TLS support.
-+ The "old" methods using the password option or the /etc/ppp/openssl.cnf file still work.
-+ - Added support for specifying the client CA, certificate and private key on the command-line
-+ or via the ppp config file.
-+v0.98 (20-Apr-2010)
-+ - Fix initialisation bug when using ca/cert/key command-line options.
-+ - Last version for ppp-2.4.4
-+v0.99 (05-Oct-2010)
-+ - Fix coredump when using multilink option.
-+v0.991 (08-Aug-2011)
-+ - Fix compilation issue with openssl 1.0.
-+v0.992 (01-Dec-2011)
-+ - Fix compilation issue with eaptls_check_hook and passwordfd plugin.
-+v0.993 (24-Apr-2012)
-+ - Fix compilation issue when EAP_TLS=n in pppd/Makefile.
-+v0.994 (11-Jun-2012)
-+ - Fix compilation issue on Ubuntu 11.10.
-+v0.995 (27-May-2014)
-+ - Add support for a CRL file using the command-line option 'crl'
-+ (prior only 'crl-dir' was supported).
-+ - Fix segfault when pkcs11 enginename was not specified correctly.
-+ - Fix segfault when client was misconfigured.
-+ - Disable SSL Session Ticket support as Windows 8 does not support this.
-+v0.996 (28-May-2014)
-+ - Fix minor bug where SessionTicket message was printed as 'Unknown SSL3 code 4'
-+ - Add EAP-TLS-specific options to pppd.8 manual page.
-+ - Updated README.eap-tls file with new options and provide an example.
-+v0.997 (19-Jun-2014)
-+ - Change SSL_OP_NO_TICKETS to SSL_OP_NO_TICKET
-+ - Fix bug in initialisation code with fragmented packets.
-+v0.998 (13-Mar-2015)
-+ - Add fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023620
-+v0.999 (11-May-2017)
-+ - Add support for OpenSSL 1.1: the code will now compile against OpenSSL 1.0.x or 1.1.x.
-+v1.101 (1-Jun-2018)
-+ - Fix vulnerabilities CVE-2018-11574.
-+v1.102 (2-Nov-2018)
-+ - Add TLS 1.2 support. Windows 7/8 will connect using TLS 1.0, Windows 10 clients using TLS 1.2.
-+ This works both when compiling against OpenSSL 1.0.1+ and 1.1+.
-+ - Print warning when certificate is either not yet valid or has expired.
-+ - Perform better peer certificate checks.
-+ - Allow certificate chain files to be used.
-diff --git a/etc.ppp/eaptls-client b/etc.ppp/eaptls-client
-new file mode 100644
-index 000000000000..7782f0e2a065
---- /dev/null
-+++ b/etc.ppp/eaptls-client
-@@ -0,0 +1,10 @@
-+# Parameters for authentication using EAP-TLS (client)
-+
-+# client name (can be *)
-+# server name (can be *)
-+# client certificate file (required)
-+# server certificate file (optional, if unused put '-')
-+# CA certificate file (required)
-+# client private key file (required)
-+
-+#client server /root/cert/client.crt - /root/cert/ca.crt /root/cert/client.key
-diff --git a/etc.ppp/eaptls-server b/etc.ppp/eaptls-server
-new file mode 100644
-index 000000000000..fa53cbd197cf
---- /dev/null
-+++ b/etc.ppp/eaptls-server
-@@ -0,0 +1,11 @@
-+# Parameters for authentication using EAP-TLS (server)
-+
-+# client name (can be *)
-+# server name (can be *)
-+# client certificate file (optional, if unused put '-')
-+# server certificate file (required)
-+# CA certificate file (required)
-+# server private key file (required)
-+# allowed addresses (required, can be *)
-+
-+#client server - /root/cert/server.crt /root/cert/ca.crt /root/cert/server.key 192.168.1.0/24
-diff --git a/etc.ppp/openssl.cnf b/etc.ppp/openssl.cnf
-new file mode 100644
-index 000000000000..dd32f305d680
---- /dev/null
-+++ b/etc.ppp/openssl.cnf
-@@ -0,0 +1,14 @@
-+openssl_conf = openssl_def
-+
-+[ openssl_def ]
-+engines = engine_section
-+
-+[ engine_section ]
-+pkcs11 = pkcs11_section
-+
-+[ pkcs11_section ]
-+engine_id = pkcs11
-+dynamic_path = /usr/lib64/openssl/engines/engine_pkcs11.so
-+MODULE_PATH = /usr/lib64/libeTPkcs11.so
-+init = 0
-+
-diff --git a/linux/Makefile.top b/linux/Makefile.top
-index f63d45e58a78..894f8f32c9e4 100644
---- a/linux/Makefile.top
-+++ b/linux/Makefile.top
-@@ -26,7 +26,7 @@ install-progs:
- cd pppdump; $(MAKE) $(MFLAGS) install
-
- install-etcppp: $(ETCDIR) $(ETCDIR)/options $(ETCDIR)/pap-secrets \
-- $(ETCDIR)/chap-secrets
-+ $(ETCDIR)/chap-secrets $(ETCDIR)/eaptls-server $(ETCDIR)/eaptls-client
-
- install-devel:
- cd pppd; $(MAKE) $(MFLAGS) install-devel
-@@ -37,6 +37,10 @@ $(ETCDIR)/pap-secrets:
- $(INSTALL) -c -m 600 etc.ppp/pap-secrets $@
- $(ETCDIR)/chap-secrets:
- $(INSTALL) -c -m 600 etc.ppp/chap-secrets $@
-+$(ETCDIR)/eaptls-server:
-+ $(INSTALL) -c -m 600 etc.ppp/eaptls-server $@
-+$(ETCDIR)/eaptls-client:
-+ $(INSTALL) -c -m 600 etc.ppp/eaptls-client $@
-
- $(BINDIR):
- $(INSTALL) -d -m 755 $@
-diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index 5549145e5791..4a11d5fea748 100644
---- a/pppd/Makefile.linux
-+++ b/pppd/Makefile.linux
-@@ -76,6 +76,9 @@ CBCP=y
- # Use libutil
- USE_LIBUTIL=y
-
-+# Enable EAP-TLS authentication (requires libssl and libcrypto)
-+USE_EAPTLS=y
-+
- MAXOCTETS=y
-
- INCLUDE_DIRS= -I../include
-@@ -116,6 +119,15 @@ HEADERS += sha1.h
- PPPDOBJS += sha1.o
- endif
-
-+# EAP-TLS
-+ifdef USE_EAPTLS
-+CFLAGS += -DUSE_EAPTLS=1 -I/usr/kerberos/include
-+LIBS += -lssl -lcrypto
-+PPPDSRC += eap-tls.c
-+HEADERS += eap-tls.h
-+PPPDOBJS += eap-tls.o
-+endif
-+
- ifdef HAS_SHADOW
- CFLAGS += -DHAS_SHADOW
- #LIBS += -lshadow $(LIBS)
-diff --git a/pppd/auth.c b/pppd/auth.c
-index 4271af687102..45065c58bfcc 100644
---- a/pppd/auth.c
-+++ b/pppd/auth.c
-@@ -109,6 +109,9 @@
- #include "upap.h"
- #include "chap-new.h"
- #include "eap.h"
-+#ifdef USE_EAPTLS
-+#include "eap-tls.h"
-+#endif
- #ifdef CBCP_SUPPORT
- #include "cbcp.h"
- #endif
-@@ -183,6 +186,11 @@ int (*chap_check_hook) __P((void)) = NULL;
- /* Hook for a plugin to get the CHAP password for authenticating us */
- int (*chap_passwd_hook) __P((char *user, char *passwd)) = NULL;
-
-+#ifdef USE_EAPTLS
-+/* Hook for a plugin to get the EAP-TLS password for authenticating us */
-+int (*eaptls_passwd_hook) __P((char *user, char *passwd)) = NULL;
-+#endif
-+
- /* Hook for a plugin to say whether it is OK if the peer
- refuses to authenticate. */
- int (*null_auth_hook) __P((struct wordlist **paddrs,
-@@ -238,6 +246,14 @@ bool explicit_remote = 0; /* User specified explicit remote name */
- bool explicit_user = 0; /* Set if "user" option supplied */
- bool explicit_passwd = 0; /* Set if "password" option supplied */
- char remote_name[MAXNAMELEN]; /* Peer's name for authentication */
-+#ifdef USE_EAPTLS
-+char *cacert_file = NULL; /* CA certificate file (pem format) */
-+char *cert_file = NULL; /* client certificate file (pem format) */
-+char *privkey_file = NULL; /* client private key file (pem format) */
-+char *crl_dir = NULL; /* directory containing CRL files */
-+char *crl_file = NULL; /* Certificate Revocation List (CRL) file (pem format) */
-+bool need_peer_eap = 0; /* Require peer to authenticate us */
-+#endif
-
- static char *uafname; /* name of most recent +ua file */
-
-@@ -254,6 +270,19 @@ static int have_pap_secret __P((int *));
- static int have_chap_secret __P((char *, char *, int, int *));
- static int have_srp_secret __P((char *client, char *server, int need_ip,
- int *lacks_ipp));
-+
-+#ifdef USE_EAPTLS
-+static int have_eaptls_secret_server
-+__P((char *client, char *server, int need_ip, int *lacks_ipp));
-+static int have_eaptls_secret_client __P((char *client, char *server));
-+static int scan_authfile_eaptls __P((FILE * f, char *client, char *server,
-+ char *cli_cert, char *serv_cert,
-+ char *ca_cert, char *pk,
-+ struct wordlist ** addrs,
-+ struct wordlist ** opts,
-+ char *filename, int flags));
-+#endif
-+
- static int ip_addr_check __P((u_int32_t, struct permitted_ip *));
- static int scan_authfile __P((FILE *, char *, char *, char *,
- struct wordlist **, struct wordlist **,
-@@ -401,6 +430,15 @@ option_t auth_options[] = {
- "Set telephone number(s) which are allowed to connect",
- OPT_PRIV | OPT_A2LIST },
-
-+#ifdef USE_EAPTLS
-+ { "ca", o_string, &cacert_file, "EAP-TLS CA certificate in PEM format" },
-+ { "cert", o_string, &cert_file, "EAP-TLS client certificate in PEM format" },
-+ { "key", o_string, &privkey_file, "EAP-TLS client private key in PEM format" },
-+ { "crl-dir", o_string, &crl_dir, "Use CRLs in directory" },
-+ { "crl", o_string, &crl_file, "Use specific CRL file" },
-+ { "need-peer-eap", o_bool, &need_peer_eap,
-+ "Require the peer to authenticate us", 1 },
-+#endif /* USE_EAPTLS */
- { NULL }
- };
-
-@@ -730,6 +768,9 @@ link_established(unit)
- lcp_options *wo = &lcp_wantoptions[unit];
- lcp_options *go = &lcp_gotoptions[unit];
- lcp_options *ho = &lcp_hisoptions[unit];
-+#ifdef USE_EAPTLS
-+ lcp_options *ao = &lcp_allowoptions[unit];
-+#endif
- int i;
- struct protent *protp;
-
-@@ -764,6 +805,22 @@ link_established(unit)
- }
- }
-
-+#ifdef USE_EAPTLS
-+ if (need_peer_eap && !ao->neg_eap) {
-+ warn("eap required to authenticate us but no suitable secrets");
-+ lcp_close(unit, "couldn't negotiate eap");
-+ status = EXIT_AUTH_TOPEER_FAILED;
-+ return;
-+ }
-+
-+ if (need_peer_eap && !ho->neg_eap) {
-+ warn("peer doesn't want to authenticate us with eap");
-+ lcp_close(unit, "couldn't negotiate eap");
-+ status = EXIT_PEER_AUTH_FAILED;
-+ return;
-+ }
-+#endif
-+
- new_phase(PHASE_AUTHENTICATE);
- auth = 0;
- if (go->neg_eap) {
-@@ -1277,6 +1334,15 @@ auth_check_options()
- our_name, 1, &lacks_ip);
- }
-
-+#ifdef USE_EAPTLS
-+ if (!can_auth && wo->neg_eap) {
-+ can_auth =
-+ have_eaptls_secret_server((explicit_remote ? remote_name :
-+ NULL), our_name, 1, &lacks_ip);
-+
-+ }
-+#endif
-+
- if (auth_required && !can_auth && noauth_addrs == NULL) {
- if (default_auth) {
- option_error(
-@@ -1331,7 +1397,11 @@ auth_reset(unit)
- passwd[0] != 0 ||
- (hadchap == 1 || (hadchap == -1 && have_chap_secret(user,
- (explicit_remote? remote_name: NULL), 0, NULL))) ||
-- have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL));
-+ have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)
-+#ifdef USE_EAPTLS
-+ || have_eaptls_secret_client(user, (explicit_remote? remote_name: NULL))
-+#endif
-+ );
-
- hadchap = -1;
- if (go->neg_upap && !uselogin && !have_pap_secret(NULL))
-@@ -1346,8 +1416,14 @@ auth_reset(unit)
- !have_chap_secret((explicit_remote? remote_name: NULL), our_name,
- 1, NULL))) &&
- !have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1,
-- NULL))
-+ NULL)
-+#ifdef USE_EAPTLS
-+ && !have_eaptls_secret_server((explicit_remote? remote_name: NULL),
-+ our_name, 1, NULL)
-+#endif
-+ )
- go->neg_eap = 0;
-+
- }
-
-
-@@ -1707,6 +1783,7 @@ have_srp_secret(client, server, need_ip, lacks_ipp)
- }
-
-
-+
- /*
- * get_secret - open the CHAP secret file and return the secret
- * for authenticating the given client on the given server.
-@@ -2359,3 +2436,335 @@ auth_script(script)
-
- auth_script_pid = run_program(script, argv, 0, auth_script_done, NULL, 0);
- }
-+
-+
-+#ifdef USE_EAPTLS
-+static int
-+have_eaptls_secret_server(client, server, need_ip, lacks_ipp)
-+ char *client;
-+ char *server;
-+ int need_ip;
-+ int *lacks_ipp;
-+{
-+ FILE *f;
-+ int ret;
-+ char *filename;
-+ struct wordlist *addrs;
-+ char servcertfile[MAXWORDLEN];
-+ char clicertfile[MAXWORDLEN];
-+ char cacertfile[MAXWORDLEN];
-+ char pkfile[MAXWORDLEN];
-+
-+ filename = _PATH_EAPTLSSERVFILE;
-+ f = fopen(filename, "r");
-+ if (f == NULL)
-+ return 0;
-+
-+ if (client != NULL && client[0] == 0)
-+ client = NULL;
-+ else if (server != NULL && server[0] == 0)
-+ server = NULL;
-+
-+ ret =
-+ scan_authfile_eaptls(f, client, server, clicertfile, servcertfile,
-+ cacertfile, pkfile, &addrs, NULL, filename,
-+ 0);
-+
-+ fclose(f);
-+
-+/*
-+ if (ret >= 0 && !eaptls_init_ssl(1, cacertfile, servcertfile,
-+ clicertfile, pkfile))
-+ ret = -1;
-+*/
-+
-+ if (ret >= 0 && need_ip && !some_ip_ok(addrs)) {
-+ if (lacks_ipp != 0)
-+ *lacks_ipp = 1;
-+ ret = -1;
-+ }
-+ if (addrs != 0)
-+ free_wordlist(addrs);
-+
-+ return ret >= 0;
-+}
-+
-+
-+static int
-+have_eaptls_secret_client(client, server)
-+ char *client;
-+ char *server;
-+{
-+ FILE *f;
-+ int ret;
-+ char *filename;
-+ struct wordlist *addrs = NULL;
-+ char servcertfile[MAXWORDLEN];
-+ char clicertfile[MAXWORDLEN];
-+ char cacertfile[MAXWORDLEN];
-+ char pkfile[MAXWORDLEN];
-+
-+ if (client != NULL && client[0] == 0)
-+ client = NULL;
-+ else if (server != NULL && server[0] == 0)
-+ server = NULL;
-+
-+ if (cacert_file && cert_file && privkey_file)
-+ return 1;
-+
-+ filename = _PATH_EAPTLSCLIFILE;
-+ f = fopen(filename, "r");
-+ if (f == NULL)
-+ return 0;
-+
-+ ret =
-+ scan_authfile_eaptls(f, client, server, clicertfile, servcertfile,
-+ cacertfile, pkfile, &addrs, NULL, filename,
-+ 0);
-+ fclose(f);
-+
-+/*
-+ if (ret >= 0 && !eaptls_init_ssl(0, cacertfile, clicertfile,
-+ servcertfile, pkfile))
-+ ret = -1;
-+*/
-+
-+ if (addrs != 0)
-+ free_wordlist(addrs);
-+
-+ return ret >= 0;
-+}
-+
-+
-+static int
-+scan_authfile_eaptls(f, client, server, cli_cert, serv_cert, ca_cert, pk,
-+ addrs, opts, filename, flags)
-+ FILE *f;
-+ char *client;
-+ char *server;
-+ char *cli_cert;
-+ char *serv_cert;
-+ char *ca_cert;
-+ char *pk;
-+ struct wordlist **addrs;
-+ struct wordlist **opts;
-+ char *filename;
-+ int flags;
-+{
-+ int newline;
-+ int got_flag, best_flag;
-+ struct wordlist *ap, *addr_list, *alist, **app;
-+ char word[MAXWORDLEN];
-+
-+ if (addrs != NULL)
-+ *addrs = NULL;
-+ if (opts != NULL)
-+ *opts = NULL;
-+ addr_list = NULL;
-+ if (!getword(f, word, &newline, filename))
-+ return -1; /* file is empty??? */
-+ newline = 1;
-+ best_flag = -1;
-+ for (;;) {
-+ /*
-+ * Skip until we find a word at the start of a line.
-+ */
-+ while (!newline && getword(f, word, &newline, filename));
-+ if (!newline)
-+ break; /* got to end of file */
-+
-+ /*
-+ * Got a client - check if it's a match or a wildcard.
-+ */
-+ got_flag = 0;
-+ if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) {
-+ newline = 0;
-+ continue;
-+ }
-+ if (!ISWILD(word))
-+ got_flag = NONWILD_CLIENT;
-+
-+ /*
-+ * Now get a server and check if it matches.
-+ */
-+ if (!getword(f, word, &newline, filename))
-+ break;
-+ if (newline)
-+ continue;
-+ if (!ISWILD(word)) {
-+ if (server != NULL && strcmp(word, server) != 0)
-+ continue;
-+ got_flag |= NONWILD_SERVER;
-+ }
-+
-+ /*
-+ * Got some sort of a match - see if it's better than what
-+ * we have already.
-+ */
-+ if (got_flag <= best_flag)
-+ continue;
-+
-+ /*
-+ * Get the cli_cert
-+ */
-+ if (!getword(f, word, &newline, filename))
-+ break;
-+ if (newline)
-+ continue;
-+ if (strcmp(word, "-") != 0) {
-+ strlcpy(cli_cert, word, MAXWORDLEN);
-+ } else
-+ cli_cert[0] = 0;
-+
-+ /*
-+ * Get serv_cert
-+ */
-+ if (!getword(f, word, &newline, filename))
-+ break;
-+ if (newline)
-+ continue;
-+ if (strcmp(word, "-") != 0) {
-+ strlcpy(serv_cert, word, MAXWORDLEN);
-+ } else
-+ serv_cert[0] = 0;
-+
-+ /*
-+ * Get ca_cert
-+ */
-+ if (!getword(f, word, &newline, filename))
-+ break;
-+ if (newline)
-+ continue;
-+ strlcpy(ca_cert, word, MAXWORDLEN);
-+
-+ /*
-+ * Get pk
-+ */
-+ if (!getword(f, word, &newline, filename))
-+ break;
-+ if (newline)
-+ continue;
-+ strlcpy(pk, word, MAXWORDLEN);
-+
-+
-+ /*
-+ * Now read address authorization info and make a wordlist.
-+ */
-+ app = &alist;
-+ for (;;) {
-+ if (!getword(f, word, &newline, filename) || newline)
-+ break;
-+ ap = (struct wordlist *)
-+ malloc(sizeof(struct wordlist) + strlen(word) + 1);
-+ if (ap == NULL)
-+ novm("authorized addresses");
-+ ap->word = (char *) (ap + 1);
-+ strcpy(ap->word, word);
-+ *app = ap;
-+ app = &ap->next;
-+ }
-+ *app = NULL;
-+ /*
-+ * This is the best so far; remember it.
-+ */
-+ best_flag = got_flag;
-+ if (addr_list)
-+ free_wordlist(addr_list);
-+ addr_list = alist;
-+
-+ if (!newline)
-+ break;
-+ }
-+
-+ /* scan for a -- word indicating the start of options */
-+ for (app = &addr_list; (ap = *app) != NULL; app = &ap->next)
-+ if (strcmp(ap->word, "--") == 0)
-+ break;
-+ /* ap = start of options */
-+ if (ap != NULL) {
-+ ap = ap->next; /* first option */
-+ free(*app); /* free the "--" word */
-+ *app = NULL; /* terminate addr list */
-+ }
-+ if (opts != NULL)
-+ *opts = ap;
-+ else if (ap != NULL)
-+ free_wordlist(ap);
-+ if (addrs != NULL)
-+ *addrs = addr_list;
-+ else if (addr_list != NULL)
-+ free_wordlist(addr_list);
-+
-+ return best_flag;
-+}
-+
-+
-+int
-+get_eaptls_secret(unit, client, server, clicertfile, servcertfile,
-+ cacertfile, pkfile, am_server)
-+ int unit;
-+ char *client;
-+ char *server;
-+ char *clicertfile;
-+ char *servcertfile;
-+ char *cacertfile;
-+ char *pkfile;
-+ int am_server;
-+{
-+ FILE *fp;
-+ int ret;
-+ char *filename = NULL;
-+ struct wordlist *addrs = NULL;
-+ struct wordlist *opts = NULL;
-+
-+ /* in client mode the ca+cert+privkey can also be specified as options */
-+ if (!am_server && cacert_file && cert_file && privkey_file )
-+ {
-+ strlcpy( clicertfile, cert_file, MAXWORDLEN );
-+ strlcpy( cacertfile, cacert_file, MAXWORDLEN );
-+ strlcpy( pkfile, privkey_file, MAXWORDLEN );
-+ servcertfile[0] = '\0';
-+ }
-+ else
-+ {
-+ filename = (am_server ? _PATH_EAPTLSSERVFILE : _PATH_EAPTLSCLIFILE);
-+ addrs = NULL;
-+
-+ fp = fopen(filename, "r");
-+ if (fp == NULL)
-+ {
-+ error("Can't open eap-tls secret file %s: %m", filename);
-+ return 0;
-+ }
-+
-+ check_access(fp, filename);
-+
-+ ret = scan_authfile_eaptls(fp, client, server, clicertfile, servcertfile,
-+ cacertfile, pkfile, &addrs, &opts, filename, 0);
-+
-+ fclose(fp);
-+
-+ if (ret < 0) return 0;
-+ }
-+
-+ if (eaptls_passwd_hook)
-+ {
-+ dbglog( "Calling eaptls password hook" );
-+ if ( (*eaptls_passwd_hook)(pkfile, passwd) < 0)
-+ {
-+ error("Unable to obtain EAP-TLS password for %s (%s) from plugin",
-+ client, pkfile);
-+ return 0;
-+ }
-+ }
-+ if (am_server)
-+ set_allowed_addrs(unit, addrs, opts);
-+ else if (opts != NULL)
-+ free_wordlist(opts);
-+ if (addrs != NULL)
-+ free_wordlist(addrs);
-+
-+ return 1;
-+}
-+#endif
-+
-diff --git a/pppd/ccp.c b/pppd/ccp.c
-index 7d7922afcfc0..0a93b15aeef3 100644
---- a/pppd/ccp.c
-+++ b/pppd/ccp.c
-@@ -540,6 +540,9 @@ ccp_resetci(f)
- if (go->mppe) {
- ccp_options *ao = &ccp_allowoptions[f->unit];
- int auth_mschap_bits = auth_done[f->unit];
-+#ifdef USE_EAPTLS
-+ int auth_eap_bits = auth_done[f->unit];
-+#endif
- int numbits;
-
- /*
-@@ -567,8 +570,23 @@ ccp_resetci(f)
- lcp_close(f->unit, "MPPE required but not available");
- return;
- }
-+
-+#ifdef USE_EAPTLS
-+ /*
-+ * MPPE is also possible in combination with EAP-TLS.
-+ * It is not possible to detect if we're doing EAP or EAP-TLS
-+ * at this stage, hence we accept all forms of EAP. If TLS is
-+ * not used then the MPPE keys will not be derived anyway.
-+ */
-+ /* Leave only the eap auth bits set */
-+ auth_eap_bits &= (EAP_WITHPEER | EAP_PEER );
-+
-+ if ((numbits == 0) && (auth_eap_bits == 0)) {
-+ error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed.");
-+#else
- if (!numbits) {
-- error("MPPE required, but MS-CHAP[v2] auth not performed.");
-+ error("MPPE required, but MS-CHAP[v2] auth not performed.");
-+#endif
- lcp_close(f->unit, "MPPE required but not available");
- return;
- }
-diff --git a/pppd/chap-md5.c b/pppd/chap-md5.c
-index 77dd4ecc7059..269b52cb2041 100644
---- a/pppd/chap-md5.c
-+++ b/pppd/chap-md5.c
-@@ -36,7 +36,11 @@
- #include "chap-new.h"
- #include "chap-md5.h"
- #include "magic.h"
-+#ifdef USE_EAPTLS
-+#include "eap-tls.h"
-+#else
- #include "md5.h"
-+#endif /* USE_EAPTLS */
-
- #define MD5_HASH_SIZE 16
- #define MD5_MIN_CHALLENGE 16
-diff --git a/pppd/eap-tls.c b/pppd/eap-tls.c
-new file mode 100644
-index 000000000000..df4bc1b996c9
---- /dev/null
-+++ b/pppd/eap-tls.c
-@@ -0,0 +1,1383 @@
-+/* * eap-tls.c - EAP-TLS implementation for PPP
-+ *
-+ * Copyright (c) Beniamino Galvani 2005 All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ *
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in
-+ * the documentation and/or other materials provided with the
-+ * distribution.
-+ *
-+ * 3. The name(s) of the authors of this software must not be used to
-+ * endorse or promote products derived from this software without
-+ * prior written permission.
-+ *
-+ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
-+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-+ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ *
-+ */
-+
-+#include <string.h>
-+#include <unistd.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+
-+#include <openssl/conf.h>
-+#include <openssl/engine.h>
-+#include <openssl/hmac.h>
-+#include <openssl/err.h>
-+#include <openssl/x509v3.h>
-+
-+#include "pppd.h"
-+#include "eap.h"
-+#include "eap-tls.h"
-+#include "fsm.h"
-+#include "lcp.h"
-+#include "pathnames.h"
-+
-+/* The openssl configuration file and engines can be loaded only once */
-+static CONF *ssl_config = NULL;
-+static ENGINE *cert_engine = NULL;
-+static ENGINE *pkey_engine = NULL;
-+
-+#ifdef MPPE
-+
-+#define EAPTLS_MPPE_KEY_LEN 32
-+
-+/*
-+ * The following stuff is only needed if SSL_export_keying_material() is not available
-+ */
-+
-+#if OPENSSL_VERSION_NUMBER < 0x10001000L
-+
-+/*
-+ * https://wiki.openssl.org/index.php/1.1_API_Changes
-+ * tries to provide some guidance but ultimately falls short.
-+ *
-+ */
-+
-+static void HMAC_CTX_free(HMAC_CTX *ctx)
-+{
-+ if (ctx != NULL) {
-+ HMAC_CTX_cleanup(ctx);
-+ OPENSSL_free(ctx);
-+ }
-+}
-+
-+static HMAC_CTX *HMAC_CTX_new(void)
-+{
-+ HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
-+ if (ctx != NULL)
-+ HMAC_CTX_init(ctx);
-+ return ctx;
-+}
-+
-+static size_t SSL_get_client_random(const SSL *ssl, unsigned char *out,
-+ size_t outlen)
-+{
-+ if (outlen == 0)
-+ return sizeof(ssl->s3->client_random);
-+ if (outlen > sizeof(ssl->s3->client_random))
-+ outlen = sizeof(ssl->s3->client_random);
-+ memcpy(out, ssl->s3->client_random, outlen);
-+ return outlen;
-+}
-+
-+static size_t SSL_get_server_random(const SSL *ssl, unsigned char *out,
-+ size_t outlen)
-+{
-+ if (outlen == 0)
-+ return sizeof(ssl->s3->server_random);
-+ if (outlen > sizeof(ssl->s3->server_random))
-+ outlen = sizeof(ssl->s3->server_random);
-+ memcpy(out, ssl->s3->server_random, outlen);
-+ return outlen;
-+}
-+
-+static size_t SSL_SESSION_get_master_key(const SSL_SESSION *session,
-+ unsigned char *out, size_t outlen)
-+{
-+ if (outlen == 0)
-+ return session->master_key_length;
-+ if (outlen > session->master_key_length)
-+ outlen = session->master_key_length;
-+ memcpy(out, session->master_key, outlen);
-+ return outlen;
-+}
-+
-+
-+/*
-+ * TLS PRF from RFC 2246
-+ */
-+static void P_hash(const EVP_MD *evp_md,
-+ const unsigned char *secret, unsigned int secret_len,
-+ const unsigned char *seed, unsigned int seed_len,
-+ unsigned char *out, unsigned int out_len)
-+{
-+ HMAC_CTX *ctx_a, *ctx_out;
-+ unsigned char a[HMAC_MAX_MD_CBLOCK];
-+ unsigned int size;
-+
-+ ctx_a = HMAC_CTX_new();
-+ ctx_out = HMAC_CTX_new();
-+ HMAC_Init_ex(ctx_a, secret, secret_len, evp_md, NULL);
-+ HMAC_Init_ex(ctx_out, secret, secret_len, evp_md, NULL);
-+
-+ size = HMAC_size(ctx_out);
-+
-+ /* Calculate A(1) */
-+ HMAC_Update(ctx_a, seed, seed_len);
-+ HMAC_Final(ctx_a, a, NULL);
-+
-+ while (1) {
-+ /* Calculate next part of output */
-+ HMAC_Update(ctx_out, a, size);
-+ HMAC_Update(ctx_out, seed, seed_len);
-+
-+ /* Check if last part */
-+ if (out_len < size) {
-+ HMAC_Final(ctx_out, a, NULL);
-+ memcpy(out, a, out_len);
-+ break;
-+ }
-+
-+ /* Place digest in output buffer */
-+ HMAC_Final(ctx_out, out, NULL);
-+ HMAC_Init_ex(ctx_out, NULL, 0, NULL, NULL);
-+ out += size;
-+ out_len -= size;
-+
-+ /* Calculate next A(i) */
-+ HMAC_Init_ex(ctx_a, NULL, 0, NULL, NULL);
-+ HMAC_Update(ctx_a, a, size);
-+ HMAC_Final(ctx_a, a, NULL);
-+ }
-+
-+ HMAC_CTX_free(ctx_a);
-+ HMAC_CTX_free(ctx_out);
-+ memset(a, 0, sizeof(a));
-+}
-+
-+static void PRF(const unsigned char *secret, unsigned int secret_len,
-+ const unsigned char *seed, unsigned int seed_len,
-+ unsigned char *out, unsigned char *buf, unsigned int out_len)
-+{
-+ unsigned int i;
-+ unsigned int len = (secret_len + 1) / 2;
-+ const unsigned char *s1 = secret;
-+ const unsigned char *s2 = secret + (secret_len - len);
-+
-+ P_hash(EVP_md5(), s1, len, seed, seed_len, out, out_len);
-+ P_hash(EVP_sha1(), s2, len, seed, seed_len, buf, out_len);
-+
-+ for (i=0; i < out_len; i++) {
-+ out[i] ^= buf[i];
-+ }
-+}
-+
-+static int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
-+ const char *label, size_t llen,
-+ const unsigned char *p, size_t plen,
-+ int use_context)
-+{
-+ unsigned char seed[64 + 2*SSL3_RANDOM_SIZE];
-+ unsigned char buf[4*EAPTLS_MPPE_KEY_LEN];
-+ unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH];
-+ size_t master_key_length;
-+ unsigned char *pp;
-+
-+ pp = seed;
-+
-+ memcpy(pp, label, llen);
-+ pp += llen;
-+
-+ llen += SSL_get_client_random(s, pp, SSL3_RANDOM_SIZE);
-+ pp += SSL3_RANDOM_SIZE;
-+
-+ llen += SSL_get_server_random(s, pp, SSL3_RANDOM_SIZE);
-+
-+ master_key_length = SSL_SESSION_get_master_key(SSL_get_session(s), master_key,
-+ sizeof(master_key));
-+ PRF(master_key, master_key_length, seed, llen, out, buf, olen);
-+
-+ return 1;
-+}
-+
-+#endif /* OPENSSL_VERSION_NUMBER < 0x10001000L */
-+
-+
-+/*
-+ * OpenSSL 1.1+ introduced a generic TLS_method()
-+ * For older releases we substitute the appropriate method
-+ */
-+
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+
-+#define TLS_method SSLv23_method
-+
-+#define SSL3_RT_HEADER 0x100
-+
-+#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
-+
-+
-+/*
-+ * Generate keys according to RFC 2716 and add to reply
-+ */
-+void eaptls_gen_mppe_keys(struct eaptls_session *ets, const char *prf_label,
-+ int client)
-+{
-+ unsigned char out[4*EAPTLS_MPPE_KEY_LEN];
-+ size_t prf_size = strlen(prf_label);
-+ unsigned char *p;
-+
-+ if (SSL_export_keying_material(ets->ssl, out, sizeof(out), prf_label, prf_size, NULL, 0, 0) != 1)
-+ {
-+ warn( "EAP-TLS: Failed generating keying material" );
-+ return;
-+ }
-+
-+ /*
-+ * We now have the master send and receive keys.
-+ * From these, generate the session send and receive keys.
-+ * (see RFC3079 / draft-ietf-pppext-mppe-keys-03.txt for details)
-+ */
-+ if (client)
-+ {
-+ p = out;
-+ BCOPY( p, mppe_send_key, sizeof(mppe_send_key) );
-+ p += EAPTLS_MPPE_KEY_LEN;
-+ BCOPY( p, mppe_recv_key, sizeof(mppe_recv_key) );
-+ }
-+ else
-+ {
-+ p = out;
-+ BCOPY( p, mppe_recv_key, sizeof(mppe_recv_key) );
-+ p += EAPTLS_MPPE_KEY_LEN;
-+ BCOPY( p, mppe_send_key, sizeof(mppe_send_key) );
-+ }
-+
-+ mppe_keys_set = 1;
-+}
-+
-+#endif
-+
-+void log_ssl_errors( void )
-+{
-+ unsigned long ssl_err = ERR_get_error();
-+
-+ if (ssl_err != 0)
-+ dbglog("EAP-TLS SSL error stack:");
-+ while (ssl_err != 0) {
-+ dbglog( ERR_error_string( ssl_err, NULL ) );
-+ ssl_err = ERR_get_error();
-+ }
-+}
-+
-+
-+int password_callback (char *buf, int size, int rwflag, void *u)
-+{
-+ if (buf)
-+ {
-+ strncpy (buf, passwd, size);
-+ return strlen (buf);
-+ }
-+ return 0;
-+}
-+
-+
-+CONF *eaptls_ssl_load_config( void )
-+{
-+ CONF *config;
-+ int ret_code;
-+ long error_line = 33;
-+
-+ config = NCONF_new( NULL );
-+ dbglog( "Loading OpenSSL config file" );
-+ ret_code = NCONF_load( config, _PATH_OPENSSLCONFFILE, &error_line );
-+ if (ret_code == 0)
-+ {
-+ warn( "EAP-TLS: Error in OpenSSL config file %s at line %d", _PATH_OPENSSLCONFFILE, error_line );
-+ NCONF_free( config );
-+ config = NULL;
-+ ERR_clear_error();
-+ }
-+
-+ dbglog( "Loading OpenSSL built-ins" );
-+ ENGINE_load_builtin_engines();
-+ OPENSSL_load_builtin_modules();
-+
-+ dbglog( "Loading OpenSSL configured modules" );
-+ if (CONF_modules_load( config, NULL, 0 ) <= 0 )
-+ {
-+ warn( "EAP-TLS: Error loading OpenSSL modules" );
-+ log_ssl_errors();
-+ config = NULL;
-+ }
-+
-+ return config;
-+}
-+
-+ENGINE *eaptls_ssl_load_engine( char *engine_name )
-+{
-+ ENGINE *e = NULL;
-+
-+ dbglog( "Enabling OpenSSL auto engines" );
-+ ENGINE_register_all_complete();
-+
-+ dbglog( "Loading OpenSSL '%s' engine support", engine_name );
-+ e = ENGINE_by_id( engine_name );
-+ if (!e)
-+ {
-+ dbglog( "EAP-TLS: Cannot load '%s' engine support, trying 'dynamic'", engine_name );
-+ e = ENGINE_by_id( "dynamic" );
-+ if (e)
-+ {
-+ if (!ENGINE_ctrl_cmd_string(e, "SO_PATH", engine_name, 0)
-+ || !ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0))
-+ {
-+ warn( "EAP-TLS: Error loading dynamic engine '%s'", engine_name );
-+ log_ssl_errors();
-+ ENGINE_free(e);
-+ e = NULL;
-+ }
-+ }
-+ else
-+ {
-+ warn( "EAP-TLS: Cannot load dynamic engine support" );
-+ }
-+ }
-+
-+ if (e)
-+ {
-+ dbglog( "Initialising engine" );
-+ if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
-+ {
-+ warn( "EAP-TLS: Cannot use that engine" );
-+ log_ssl_errors();
-+ ENGINE_free(e);
-+ e = NULL;
-+ }
-+ }
-+
-+ return e;
-+}
-+
-+/*
-+ * Initialize the SSL stacks and tests if certificates, key and crl
-+ * for client or server use can be loaded.
-+ */
-+SSL_CTX *eaptls_init_ssl(int init_server, char *cacertfile,
-+ char *certfile, char *peer_certfile, char *privkeyfile)
-+{
-+ char *cert_engine_name = NULL;
-+ char *cert_identifier = NULL;
-+ char *pkey_engine_name = NULL;
-+ char *pkey_identifier = NULL;
-+ SSL_CTX *ctx;
-+ SSL *ssl;
-+ X509_STORE *certstore;
-+ X509_LOOKUP *lookup;
-+ X509 *tmp;
-+ int ret;
-+
-+ /*
-+ * Without these can't continue
-+ */
-+ if (!cacertfile[0])
-+ {
-+ error("EAP-TLS: CA certificate missing");
-+ return NULL;
-+ }
-+
-+ if (!certfile[0])
-+ {
-+ error("EAP-TLS: User certificate missing");
-+ return NULL;
-+ }
-+
-+ if (!privkeyfile[0])
-+ {
-+ error("EAP-TLS: User private key missing");
-+ return NULL;
-+ }
-+
-+ SSL_library_init();
-+ SSL_load_error_strings();
-+
-+ ctx = SSL_CTX_new(TLS_method());
-+
-+ if (!ctx) {
-+ error("EAP-TLS: Cannot initialize SSL CTX context");
-+ goto fail;
-+ }
-+
-+ /* if the certificate filename is of the form engine:id. e.g.
-+ pkcs11:12345
-+ then we try to load and use this engine.
-+ If the certificate filename starts with a / or . then we
-+ ALWAYS assume it is a file and not an engine/pkcs11 identifier
-+ */
-+ if ( index( certfile, '/' ) == NULL && index( certfile, '.') == NULL )
-+ {
-+ cert_identifier = index( certfile, ':' );
-+
-+ if (cert_identifier)
-+ {
-+ cert_engine_name = certfile;
-+ *cert_identifier = '\0';
-+ cert_identifier++;
-+
-+ dbglog( "Found certificate engine '%s'", cert_engine_name );
-+ dbglog( "Found certificate identifier '%s'", cert_identifier );
-+ }
-+ }
-+
-+ /* if the privatekey filename is of the form engine:id. e.g.
-+ pkcs11:12345
-+ then we try to load and use this engine.
-+ If the privatekey filename starts with a / or . then we
-+ ALWAYS assume it is a file and not an engine/pkcs11 identifier
-+ */
-+ if ( index( privkeyfile, '/' ) == NULL && index( privkeyfile, '.') == NULL )
-+ {
-+ pkey_identifier = index( privkeyfile, ':' );
-+
-+ if (pkey_identifier)
-+ {
-+ pkey_engine_name = privkeyfile;
-+ *pkey_identifier = '\0';
-+ pkey_identifier++;
-+
-+ dbglog( "Found privatekey engine '%s'", pkey_engine_name );
-+ dbglog( "Found privatekey identifier '%s'", pkey_identifier );
-+ }
-+ }
-+
-+ if (cert_identifier && pkey_identifier)
-+ {
-+ if (strlen( cert_identifier ) == 0)
-+ {
-+ if (strlen( pkey_identifier ) == 0)
-+ error( "EAP-TLS: both the certificate and privatekey identifiers are missing!" );
-+ else
-+ {
-+ dbglog( "Substituting privatekey identifier for certificate identifier" );
-+ cert_identifier = pkey_identifier;
-+ }
-+ }
-+ else
-+ {
-+ if (strlen( pkey_identifier ) == 0)
-+ {
-+ dbglog( "Substituting certificate identifier for privatekey identifier" );
-+ pkey_identifier = cert_identifier;
-+ }
-+ }
-+
-+ }
-+
-+ /* load the openssl config file only once */
-+ if (!ssl_config)
-+ {
-+ if (cert_engine_name || pkey_engine_name)
-+ ssl_config = eaptls_ssl_load_config();
-+
-+ if (ssl_config && cert_engine_name)
-+ cert_engine = eaptls_ssl_load_engine( cert_engine_name );
-+
-+ if (ssl_config && pkey_engine_name)
-+ {
-+ /* don't load the same engine twice */
-+ if ( cert_engine && strcmp( cert_engine_name, pkey_engine_name) == 0 )
-+ pkey_engine = cert_engine;
-+ else
-+ pkey_engine = eaptls_ssl_load_engine( pkey_engine_name );
-+ }
-+ }
-+
-+ SSL_CTX_set_default_passwd_cb (ctx, password_callback);
-+
-+ if (!SSL_CTX_load_verify_locations(ctx, cacertfile, NULL))
-+ {
-+ error("EAP-TLS: Cannot load or verify CA file %s", cacertfile);
-+ goto fail;
-+ }
-+
-+ if (init_server)
-+ SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(cacertfile));
-+
-+ if (cert_engine)
-+ {
-+ struct
-+ {
-+ const char *s_slot_cert_id;
-+ X509 *cert;
-+ } cert_info;
-+
-+ cert_info.s_slot_cert_id = cert_identifier;
-+ cert_info.cert = NULL;
-+
-+ if (!ENGINE_ctrl_cmd( cert_engine, "LOAD_CERT_CTRL", 0, &cert_info, NULL, 0 ) )
-+ {
-+ error( "EAP-TLS: Error loading certificate with id '%s' from engine", cert_identifier );
-+ goto fail;
-+ }
-+
-+ if (cert_info.cert)
-+ {
-+ dbglog( "Got the certificate, adding it to SSL context" );
-+ dbglog( "subject = %s", X509_NAME_oneline( X509_get_subject_name( cert_info.cert ), NULL, 0 ) );
-+ if (SSL_CTX_use_certificate(ctx, cert_info.cert) <= 0)
-+ {
-+ error("EAP-TLS: Cannot use PKCS11 certificate %s", cert_identifier);
-+ goto fail;
-+ }
-+ }
-+ else
-+ {
-+ warn("EAP-TLS: Cannot load PKCS11 key %s", cert_identifier);
-+ log_ssl_errors();
-+ }
-+ }
-+ else
-+ {
-+ if (!SSL_CTX_use_certificate_chain_file(ctx, certfile))
-+ {
-+ error( "EAP-TLS: Cannot use public certificate %s", certfile );
-+ goto fail;
-+ }
-+ }
-+
-+
-+ /*
-+ * Check the Before and After dates of the certificate
-+ */
-+ ssl = SSL_new(ctx);
-+ tmp = SSL_get_certificate(ssl);
-+
-+ ret = X509_cmp_time(X509_get_notBefore(tmp), NULL);
-+ if (ret == 0)
-+ {
-+ warn( "EAP-TLS: Failed to read certificate notBefore field.");
-+ }
-+ if (ret > 0)
-+ {
-+ warn( "EAP-TLS: Your certificate is not yet valid!");
-+ }
-+
-+ ret = X509_cmp_time(X509_get_notAfter(tmp), NULL);
-+ if (ret == 0)
-+ {
-+ warn( "EAP-TLS: Failed to read certificate notAfter field.");
-+ }
-+ if (ret < 0)
-+ {
-+ warn( "EAP-TLS: Your certificate has expired!");
-+ }
-+ SSL_free(ssl);
-+
-+ if (pkey_engine)
-+ {
-+ EVP_PKEY *pkey = NULL;
-+ PW_CB_DATA cb_data;
-+
-+ cb_data.password = passwd;
-+ cb_data.prompt_info = pkey_identifier;
-+
-+ dbglog( "Loading private key '%s' from engine", pkey_identifier );
-+ pkey = ENGINE_load_private_key(pkey_engine, pkey_identifier, NULL, &cb_data);
-+ if (pkey)
-+ {
-+ dbglog( "Got the private key, adding it to SSL context" );
-+ if (SSL_CTX_use_PrivateKey(ctx, pkey) <= 0)
-+ {
-+ error("EAP-TLS: Cannot use PKCS11 key %s", pkey_identifier);
-+ goto fail;
-+ }
-+ }
-+ else
-+ {
-+ warn("EAP-TLS: Cannot load PKCS11 key %s", pkey_identifier);
-+ log_ssl_errors();
-+ }
-+ }
-+ else
-+ {
-+ if (!SSL_CTX_use_PrivateKey_file(ctx, privkeyfile, SSL_FILETYPE_PEM))
-+ {
-+ error("EAP-TLS: Cannot use private key %s", privkeyfile);
-+ goto fail;
-+ }
-+ }
-+
-+ if (SSL_CTX_check_private_key(ctx) != 1) {
-+ error("EAP-TLS: Private key %s fails security check", privkeyfile);
-+ goto fail;
-+ }
-+
-+ /* Explicitly set the NO_TICKETS flag to support Win7/Win8 clients */
-+ SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3
-+#ifdef SSL_OP_NO_TICKET
-+ | SSL_OP_NO_TICKET
-+#endif
-+ );
-+
-+ SSL_CTX_set_verify_depth(ctx, 5);
-+ SSL_CTX_set_verify(ctx,
-+ SSL_VERIFY_PEER |
-+ SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
-+ &ssl_verify_callback);
-+
-+ if (crl_dir) {
-+ if (!(certstore = SSL_CTX_get_cert_store(ctx))) {
-+ error("EAP-TLS: Failed to get certificate store");
-+ goto fail;
-+ }
-+
-+ if (!(lookup =
-+ X509_STORE_add_lookup(certstore, X509_LOOKUP_hash_dir()))) {
-+ error("EAP-TLS: Store lookup for CRL failed");
-+
-+ goto fail;
-+ }
-+
-+ X509_LOOKUP_add_dir(lookup, crl_dir, X509_FILETYPE_PEM);
-+ X509_STORE_set_flags(certstore, X509_V_FLAG_CRL_CHECK);
-+ }
-+
-+ if (crl_file) {
-+ FILE *fp = NULL;
-+ X509_CRL *crl = NULL;
-+
-+ fp = fopen(crl_file, "r");
-+ if (!fp) {
-+ error("EAP-TLS: Cannot open CRL file '%s'", crl_file);
-+ goto fail;
-+ }
-+
-+ crl = PEM_read_X509_CRL(fp, NULL, NULL, NULL);
-+ if (!crl) {
-+ error("EAP-TLS: Cannot read CRL file '%s'", crl_file);
-+ goto fail;
-+ }
-+
-+ if (!(certstore = SSL_CTX_get_cert_store(ctx))) {
-+ error("EAP-TLS: Failed to get certificate store");
-+ goto fail;
-+ }
-+ if (!X509_STORE_add_crl(certstore, crl)) {
-+ error("EAP-TLS: Cannot add CRL to certificate store");
-+ goto fail;
-+ }
-+ X509_STORE_set_flags(certstore, X509_V_FLAG_CRL_CHECK);
-+
-+ }
-+
-+ /*
-+ * If a peer certificate file was specified, it must be valid, else fail
-+ */
-+ if (peer_certfile[0]) {
-+ if (!(tmp = get_X509_from_file(peer_certfile))) {
-+ error("EAP-TLS: Error loading client certificate from file %s",
-+ peer_certfile);
-+ goto fail;
-+ }
-+ X509_free(tmp);
-+ }
-+
-+ return ctx;
-+
-+fail:
-+ log_ssl_errors();
-+ SSL_CTX_free(ctx);
-+ return NULL;
-+}
-+
-+/*
-+ * Determine the maximum packet size by looking at the LCP handshake
-+ */
-+
-+int eaptls_get_mtu(int unit)
-+{
-+ int mtu, mru;
-+
-+ lcp_options *wo = &lcp_wantoptions[unit];
-+ lcp_options *go = &lcp_gotoptions[unit];
-+ lcp_options *ho = &lcp_hisoptions[unit];
-+ lcp_options *ao = &lcp_allowoptions[unit];
-+
-+ mtu = ho->neg_mru? ho->mru: PPP_MRU;
-+ mru = go->neg_mru? MAX(wo->mru, go->mru): PPP_MRU;
-+ mtu = MIN(MIN(mtu, mru), ao->mru)- PPP_HDRLEN - 10;
-+
-+ dbglog("MTU = %d", mtu);
-+ return mtu;
-+}
-+
-+
-+/*
-+ * Init the ssl handshake (server mode)
-+ */
-+int eaptls_init_ssl_server(eap_state * esp)
-+{
-+ struct eaptls_session *ets;
-+ char servcertfile[MAXWORDLEN];
-+ char clicertfile[MAXWORDLEN];
-+ char cacertfile[MAXWORDLEN];
-+ char pkfile[MAXWORDLEN];
-+ /*
-+ * Allocate new eaptls session
-+ */
-+ esp->es_server.ea_session = malloc(sizeof(struct eaptls_session));
-+ if (!esp->es_server.ea_session)
-+ fatal("Allocation error");
-+ ets = esp->es_server.ea_session;
-+
-+ if (!esp->es_server.ea_peer) {
-+ error("EAP-TLS: Error: client name not set (BUG)");
-+ return 0;
-+ }
-+
-+ strncpy(ets->peer, esp->es_server.ea_peer, MAXWORDLEN);
-+
-+ dbglog( "getting eaptls secret" );
-+ if (!get_eaptls_secret(esp->es_unit, esp->es_server.ea_peer,
-+ esp->es_server.ea_name, clicertfile,
-+ servcertfile, cacertfile, pkfile, 1)) {
-+ error( "EAP-TLS: Cannot get secret/password for client \"%s\", server \"%s\"",
-+ esp->es_server.ea_peer, esp->es_server.ea_name );
-+ return 0;
-+ }
-+
-+ ets->mtu = eaptls_get_mtu(esp->es_unit);
-+
-+ ets->ctx = eaptls_init_ssl(1, cacertfile, servcertfile, clicertfile, pkfile);
-+ if (!ets->ctx)
-+ goto fail;
-+
-+ if (!(ets->ssl = SSL_new(ets->ctx)))
-+ goto fail;
-+
-+ /*
-+ * Set auto-retry to avoid timeouts on BIO_read
-+ */
-+ SSL_set_mode(ets->ssl, SSL_MODE_AUTO_RETRY);
-+
-+ /*
-+ * Initialize the BIOs we use to read/write to ssl engine
-+ */
-+ ets->into_ssl = BIO_new(BIO_s_mem());
-+ ets->from_ssl = BIO_new(BIO_s_mem());
-+ SSL_set_bio(ets->ssl, ets->into_ssl, ets->from_ssl);
-+
-+ SSL_set_msg_callback(ets->ssl, ssl_msg_callback);
-+ SSL_set_msg_callback_arg(ets->ssl, ets);
-+
-+ /*
-+ * Attach the session struct to the connection, so we can later
-+ * retrieve it when doing certificate verification
-+ */
-+ SSL_set_ex_data(ets->ssl, 0, ets);
-+
-+ SSL_set_accept_state(ets->ssl);
-+
-+ ets->data = NULL;
-+ ets->datalen = 0;
-+ ets->alert_sent = 0;
-+ ets->alert_recv = 0;
-+
-+ /*
-+ * If we specified the client certificate file, store it in ets->peercertfile,
-+ * so we can check it later in ssl_verify_callback()
-+ */
-+ if (clicertfile[0])
-+ strncpy(&ets->peercertfile[0], clicertfile, MAXWORDLEN);
-+ else
-+ ets->peercertfile[0] = 0;
-+
-+ return 1;
-+
-+fail:
-+ SSL_CTX_free(ets->ctx);
-+ return 0;
-+}
-+
-+/*
-+ * Init the ssl handshake (client mode)
-+ */
-+int eaptls_init_ssl_client(eap_state * esp)
-+{
-+ struct eaptls_session *ets;
-+ char servcertfile[MAXWORDLEN];
-+ char clicertfile[MAXWORDLEN];
-+ char cacertfile[MAXWORDLEN];
-+ char pkfile[MAXWORDLEN];
-+
-+ /*
-+ * Allocate new eaptls session
-+ */
-+ esp->es_client.ea_session = malloc(sizeof(struct eaptls_session));
-+ if (!esp->es_client.ea_session)
-+ fatal("Allocation error");
-+ ets = esp->es_client.ea_session;
-+
-+ /*
-+ * If available, copy server name in ets; it will be used in cert
-+ * verify
-+ */
-+ if (esp->es_client.ea_peer)
-+ strncpy(ets->peer, esp->es_client.ea_peer, MAXWORDLEN);
-+ else
-+ ets->peer[0] = 0;
-+
-+ ets->mtu = eaptls_get_mtu(esp->es_unit);
-+
-+ dbglog( "calling get_eaptls_secret" );
-+ if (!get_eaptls_secret(esp->es_unit, esp->es_client.ea_name,
-+ ets->peer, clicertfile,
-+ servcertfile, cacertfile, pkfile, 0)) {
-+ error( "EAP-TLS: Cannot get secret/password for client \"%s\", server \"%s\"",
-+ esp->es_client.ea_name, ets->peer );
-+ return 0;
-+ }
-+
-+ dbglog( "calling eaptls_init_ssl" );
-+ ets->ctx = eaptls_init_ssl(0, cacertfile, clicertfile, servcertfile, pkfile);
-+ if (!ets->ctx)
-+ goto fail;
-+
-+ ets->ssl = SSL_new(ets->ctx);
-+
-+ if (!ets->ssl)
-+ goto fail;
-+
-+ /*
-+ * Initialize the BIOs we use to read/write to ssl engine
-+ */
-+ dbglog( "Initializing SSL BIOs" );
-+ ets->into_ssl = BIO_new(BIO_s_mem());
-+ ets->from_ssl = BIO_new(BIO_s_mem());
-+ SSL_set_bio(ets->ssl, ets->into_ssl, ets->from_ssl);
-+
-+ SSL_set_msg_callback(ets->ssl, ssl_msg_callback);
-+ SSL_set_msg_callback_arg(ets->ssl, ets);
-+
-+ /*
-+ * Attach the session struct to the connection, so we can later
-+ * retrieve it when doing certificate verification
-+ */
-+ SSL_set_ex_data(ets->ssl, 0, ets);
-+
-+ SSL_set_connect_state(ets->ssl);
-+
-+ ets->data = NULL;
-+ ets->datalen = 0;
-+ ets->alert_sent = 0;
-+ ets->alert_recv = 0;
-+
-+ /*
-+ * If we specified the server certificate file, store it in
-+ * ets->peercertfile, so we can check it later in
-+ * ssl_verify_callback()
-+ */
-+ if (servcertfile[0])
-+ strncpy(ets->peercertfile, servcertfile, MAXWORDLEN);
-+ else
-+ ets->peercertfile[0] = 0;
-+
-+ return 1;
-+
-+fail:
-+ dbglog( "eaptls_init_ssl_client: fail" );
-+ SSL_CTX_free(ets->ctx);
-+ return 0;
-+
-+}
-+
-+void eaptls_free_session(struct eaptls_session *ets)
-+{
-+ if (ets->ssl)
-+ SSL_free(ets->ssl);
-+
-+ if (ets->ctx)
-+ SSL_CTX_free(ets->ctx);
-+
-+ free(ets);
-+}
-+
-+/*
-+ * Handle a received packet, reassembling fragmented messages and
-+ * passing them to the ssl engine
-+ */
-+int eaptls_receive(struct eaptls_session *ets, u_char * inp, int len)
-+{
-+ u_char flags;
-+ u_int tlslen = 0;
-+ u_char dummy[65536];
-+
-+ if (len < 1) {
-+ warn("EAP-TLS: received no or invalid data");
-+ return 1;
-+ }
-+
-+ GETCHAR(flags, inp);
-+ len--;
-+
-+ if (flags & EAP_TLS_FLAGS_LI && len > 4) {
-+ /*
-+ * LenghtIncluded flag set -> this is the first packet of a message
-+ */
-+
-+ /*
-+ * the first 4 octets are the length of the EAP-TLS message
-+ */
-+ GETLONG(tlslen, inp);
-+ len -= 4;
-+
-+ if (!ets->data) {
-+
-+ if (tlslen > EAP_TLS_MAX_LEN) {
-+ error("EAP-TLS: TLS message length > %d, truncated", EAP_TLS_MAX_LEN);
-+ tlslen = EAP_TLS_MAX_LEN;
-+ }
-+
-+ /*
-+ * Allocate memory for the whole message
-+ */
-+ ets->data = malloc(tlslen);
-+ if (!ets->data)
-+ fatal("EAP-TLS: allocation error\n");
-+
-+ ets->datalen = 0;
-+ ets->tlslen = tlslen;
-+ }
-+ else
-+ warn("EAP-TLS: non-first LI packet? that's odd...");
-+ }
-+ else if (!ets->data) {
-+ /*
-+ * A non fragmented message without LI flag
-+ */
-+
-+ ets->data = malloc(len);
-+ if (!ets->data)
-+ fatal("EAP-TLS: allocation error\n");
-+
-+ ets->datalen = 0;
-+ ets->tlslen = len;
-+ }
-+
-+ if (flags & EAP_TLS_FLAGS_MF)
-+ ets->frag = 1;
-+ else
-+ ets->frag = 0;
-+
-+ if (len < 0) {
-+ warn("EAP-TLS: received malformed data");
-+ return 1;
-+ }
-+
-+ if (len + ets->datalen > ets->tlslen) {
-+ warn("EAP-TLS: received data > TLS message length");
-+ return 1;
-+ }
-+
-+ BCOPY(inp, ets->data + ets->datalen, len);
-+ ets->datalen += len;
-+
-+ if (!ets->frag) {
-+
-+ /*
-+ * If we have the whole message, pass it to ssl
-+ */
-+
-+ if (ets->datalen != ets->tlslen) {
-+ warn("EAP-TLS: received data != TLS message length");
-+ return 1;
-+ }
-+
-+ if (BIO_write(ets->into_ssl, ets->data, ets->datalen) == -1)
-+ log_ssl_errors();
-+
-+ SSL_read(ets->ssl, dummy, 65536);
-+
-+ free(ets->data);
-+ ets->data = NULL;
-+ ets->datalen = 0;
-+ }
-+
-+ return 0;
-+}
-+
-+/*
-+ * Return an eap-tls packet in outp.
-+ * A TLS message read from the ssl engine is buffered in ets->data.
-+ * At each call we control if there is buffered data and send a
-+ * packet of mtu bytes.
-+ */
-+int eaptls_send(struct eaptls_session *ets, u_char ** outp)
-+{
-+ bool first = 0;
-+ int size;
-+ u_char fromtls[65536];
-+ int res;
-+ u_char *start;
-+
-+ start = *outp;
-+
-+ if (!ets->data) {
-+
-+ if(!ets->alert_sent)
-+ SSL_read(ets->ssl, fromtls, 65536);
-+
-+ /*
-+ * Read from ssl
-+ */
-+ if ((res = BIO_read(ets->from_ssl, fromtls, 65536)) == -1)
-+ {
-+ warn("EAP-TLS send: No data from BIO_read");
-+ return 1;
-+ }
-+
-+ ets->datalen = res;
-+
-+ ets->data = malloc(ets->datalen);
-+ BCOPY(fromtls, ets->data, ets->datalen);
-+
-+ ets->offset = 0;
-+ first = 1;
-+
-+ }
-+
-+ size = ets->datalen - ets->offset;
-+
-+ if (size > ets->mtu) {
-+ size = ets->mtu;
-+ ets->frag = 1;
-+ } else
-+ ets->frag = 0;
-+
-+ PUTCHAR(EAPT_TLS, *outp);
-+
-+ /*
-+ * Set right flags and length if necessary
-+ */
-+ if (ets->frag && first) {
-+ PUTCHAR(EAP_TLS_FLAGS_LI | EAP_TLS_FLAGS_MF, *outp);
-+ PUTLONG(ets->datalen, *outp);
-+ } else if (ets->frag) {
-+ PUTCHAR(EAP_TLS_FLAGS_MF, *outp);
-+ } else
-+ PUTCHAR(0, *outp);
-+
-+ /*
-+ * Copy the data in outp
-+ */
-+ BCOPY(ets->data + ets->offset, *outp, size);
-+ INCPTR(size, *outp);
-+
-+ /*
-+ * Copy the packet in retransmission buffer
-+ */
-+ BCOPY(start, &ets->rtx[0], *outp - start);
-+ ets->rtx_len = *outp - start;
-+
-+ ets->offset += size;
-+
-+ if (ets->offset >= ets->datalen) {
-+
-+ /*
-+ * The whole message has been sent
-+ */
-+
-+ free(ets->data);
-+ ets->data = NULL;
-+ ets->datalen = 0;
-+ ets->offset = 0;
-+ }
-+
-+ return 0;
-+}
-+
-+/*
-+ * Get the sent packet from the retransmission buffer
-+ */
-+void eaptls_retransmit(struct eaptls_session *ets, u_char ** outp)
-+{
-+ BCOPY(ets->rtx, *outp, ets->rtx_len);
-+ INCPTR(ets->rtx_len, *outp);
-+}
-+
-+/*
-+ * Verify a certificate.
-+ * Most of the work (signatures and issuer attributes checking)
-+ * is done by ssl; we check the CN in the peer certificate
-+ * against the peer name.
-+ */
-+int ssl_verify_callback(int ok, X509_STORE_CTX * ctx)
-+{
-+ char subject[256];
-+ char cn_str[256];
-+ X509 *peer_cert;
-+ int err, depth;
-+ SSL *ssl;
-+ struct eaptls_session *ets;
-+
-+ peer_cert = X509_STORE_CTX_get_current_cert(ctx);
-+ err = X509_STORE_CTX_get_error(ctx);
-+ depth = X509_STORE_CTX_get_error_depth(ctx);
-+
-+ dbglog("certificate verify depth: %d", depth);
-+
-+ if (auth_required && !ok) {
-+ X509_NAME_oneline(X509_get_subject_name(peer_cert),
-+ subject, 256);
-+
-+ X509_NAME_get_text_by_NID(X509_get_subject_name(peer_cert),
-+ NID_commonName, cn_str, 256);
-+
-+ dbglog("Certificate verification error:\n depth: %d CN: %s"
-+ "\n err: %d (%s)\n", depth, cn_str, err,
-+ X509_verify_cert_error_string(err));
-+
-+ return 0;
-+ }
-+
-+ ssl = X509_STORE_CTX_get_ex_data(ctx,
-+ SSL_get_ex_data_X509_STORE_CTX_idx());
-+
-+ ets = (struct eaptls_session *)SSL_get_ex_data(ssl, 0);
-+
-+ if (ets == NULL) {
-+ error("Error: SSL_get_ex_data returned NULL");
-+ return 0;
-+ }
-+
-+ log_ssl_errors();
-+
-+ if (!depth) { /* This is the peer certificate */
-+
-+ X509_NAME_oneline(X509_get_subject_name(peer_cert),
-+ subject, 256);
-+
-+ X509_NAME_get_text_by_NID(X509_get_subject_name(peer_cert),
-+ NID_commonName, cn_str, 256);
-+
-+ /*
-+ * If acting as client and the name of the server wasn't specified
-+ * explicitely, we can't verify the server authenticity
-+ */
-+ if (!ets->peer[0]) {
-+ warn("Peer name not specified: no check");
-+ return ok;
-+ }
-+
-+ /*
-+ * Check the CN
-+ */
-+ if (strcmp(cn_str, ets->peer)) {
-+ error
-+ ("Certificate verification error: CN (%s) != peer_name (%s)",
-+ cn_str, ets->peer);
-+ return 0;
-+ }
-+
-+ warn("Certificate CN: %s , peer name %s", cn_str, ets->peer);
-+
-+ /*
-+ * If a peer certificate file was specified, here we check it
-+ */
-+ if (ets->peercertfile[0]) {
-+ if (ssl_cmp_certs(&ets->peercertfile[0], peer_cert)
-+ != 0) {
-+ error
-+ ("Peer certificate doesn't match stored certificate");
-+ return 0;
-+ }
-+ }
-+ }
-+
-+ return ok;
-+}
-+
-+/*
-+ * Compare a certificate with the one stored in a file
-+ */
-+int ssl_cmp_certs(char *filename, X509 * a)
-+{
-+ X509 *b;
-+ int ret;
-+
-+ if (!(b = get_X509_from_file(filename)))
-+ return 1;
-+
-+ ret = X509_cmp(a, b);
-+ X509_free(b);
-+
-+ return ret;
-+
-+}
-+
-+X509 *get_X509_from_file(char *filename)
-+{
-+ FILE *fp;
-+ X509 *ret;
-+
-+ if (!(fp = fopen(filename, "r")))
-+ return NULL;
-+
-+ ret = PEM_read_X509(fp, NULL, NULL, NULL);
-+
-+ fclose(fp);
-+
-+ return ret;
-+}
-+
-+/*
-+ * Every sent & received message this callback function is invoked,
-+ * so we know when alert messages have arrived or are sent and
-+ * we can print debug information about TLS handshake.
-+ */
-+void
-+ssl_msg_callback(int write_p, int version, int content_type,
-+ const void *buf, size_t len, SSL * ssl, void *arg)
-+{
-+ char string[256];
-+ struct eaptls_session *ets = (struct eaptls_session *)arg;
-+ unsigned char code;
-+ const unsigned char*msg = buf;
-+ int hvers = msg[1] << 8 | msg[2];
-+
-+ if(write_p)
-+ strcpy(string, " -> ");
-+ else
-+ strcpy(string, " <- ");
-+
-+ switch(content_type) {
-+
-+ case SSL3_RT_HEADER:
-+ strcat(string, "SSL/TLS Header: ");
-+ switch(hvers) {
-+ case SSL3_VERSION:
-+ strcat(string, "SSL 3.0");
-+ break;
-+ case TLS1_VERSION:
-+ strcat(string, "TLS 1.0");
-+ break;
-+ case TLS1_1_VERSION:
-+ strcat(string, "TLS 1.1");
-+ break;
-+ case TLS1_2_VERSION:
-+ strcat(string, "TLS 1.2");
-+ break;
-+ default:
-+ strcat(string, "Unknown version");
-+ }
-+ break;
-+
-+ case SSL3_RT_ALERT:
-+ strcat(string, "Alert: ");
-+ code = msg[1];
-+
-+ if (write_p) {
-+ ets->alert_sent = 1;
-+ ets->alert_sent_desc = code;
-+ } else {
-+ ets->alert_recv = 1;
-+ ets->alert_recv_desc = code;
-+ }
-+
-+ strcat(string, SSL_alert_desc_string_long(code));
-+ break;
-+
-+ case SSL3_RT_CHANGE_CIPHER_SPEC:
-+ strcat(string, "ChangeCipherSpec");
-+ break;
-+
-+ case SSL3_RT_HANDSHAKE:
-+
-+ strcat(string, "Handshake: ");
-+ code = msg[0];
-+
-+ switch(code) {
-+ case SSL3_MT_HELLO_REQUEST:
-+ strcat(string,"Hello Request");
-+ break;
-+ case SSL3_MT_CLIENT_HELLO:
-+ strcat(string,"Client Hello");
-+ break;
-+ case SSL3_MT_SERVER_HELLO:
-+ strcat(string,"Server Hello");
-+ break;
-+#ifdef SSL3_MT_NEWSESSION_TICKET
-+ case SSL3_MT_NEWSESSION_TICKET:
-+ strcat(string,"New Session Ticket");
-+ break;
-+#endif
-+ case SSL3_MT_CERTIFICATE:
-+ strcat(string,"Certificate");
-+ break;
-+ case SSL3_MT_SERVER_KEY_EXCHANGE:
-+ strcat(string,"Server Key Exchange");
-+ break;
-+ case SSL3_MT_CERTIFICATE_REQUEST:
-+ strcat(string,"Certificate Request");
-+ break;
-+ case SSL3_MT_SERVER_DONE:
-+ strcat(string,"Server Hello Done");
-+ break;
-+ case SSL3_MT_CERTIFICATE_VERIFY:
-+ strcat(string,"Certificate Verify");
-+ break;
-+ case SSL3_MT_CLIENT_KEY_EXCHANGE:
-+ strcat(string,"Client Key Exchange");
-+ break;
-+ case SSL3_MT_FINISHED:
-+ strcat(string,"Finished: ");
-+ hvers = SSL_version(ssl);
-+ switch(hvers) {
-+ case SSL3_VERSION:
-+ strcat(string, "SSL 3.0");
-+ break;
-+ case TLS1_VERSION:
-+ strcat(string, "TLS 1.0");
-+ break;
-+ case TLS1_1_VERSION:
-+ strcat(string, "TLS 1.1");
-+ break;
-+ case TLS1_2_VERSION:
-+ strcat(string, "TLS 1.2");
-+ break;
-+ default:
-+ strcat(string, "Unknown version");
-+ }
-+ break;
-+ default:
-+ sprintf( string, "Handshake: Unknown SSL3 code received: %d", code );
-+ }
-+ break;
-+
-+ default:
-+ sprintf( string, "SSL message contains unknown content type: %d", content_type );
-+
-+ }
-+
-+ /* Alert messages must always be displayed */
-+ if(content_type == SSL3_RT_ALERT)
-+ error("%s", string);
-+ else
-+ dbglog("%s", string);
-+}
-+
-diff --git a/pppd/eap-tls.h b/pppd/eap-tls.h
-new file mode 100644
-index 000000000000..2d45a0b83a0c
---- /dev/null
-+++ b/pppd/eap-tls.h
-@@ -0,0 +1,107 @@
-+/*
-+ * eap-tls.h
-+ *
-+ * Copyright (c) Beniamino Galvani 2005 All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ *
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in
-+ * the documentation and/or other materials provided with the
-+ * distribution.
-+ *
-+ * 3. The name(s) of the authors of this software must not be used to
-+ * endorse or promote products derived from this software without
-+ * prior written permission.
-+ *
-+ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
-+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-+ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ *
-+ */
-+
-+#ifndef __EAP_TLS_H__
-+#define __EAP_TLS_H__
-+
-+#include "eap.h"
-+
-+#include <openssl/ssl.h>
-+#include <openssl/bio.h>
-+#include <openssl/md5.h>
-+
-+#define EAP_TLS_FLAGS_LI 128 /* length included flag */
-+#define EAP_TLS_FLAGS_MF 64 /* more fragments flag */
-+#define EAP_TLS_FLAGS_START 32 /* start flag */
-+
-+#define EAP_TLS_MAX_LEN 65536 /* max eap tls packet size */
-+
-+struct eaptls_session
-+{
-+ u_char *data; /* buffered data */
-+ int datalen; /* buffered data len */
-+ int offset; /* from where to send */
-+ int tlslen; /* total length of tls data */
-+ bool frag; /* packet is fragmented */
-+ SSL_CTX *ctx;
-+ SSL *ssl; /* ssl connection */
-+ BIO *from_ssl;
-+ BIO *into_ssl;
-+ char peer[MAXWORDLEN]; /* peer name */
-+ char peercertfile[MAXWORDLEN];
-+ bool alert_sent;
-+ u_char alert_sent_desc;
-+ bool alert_recv;
-+ u_char alert_recv_desc;
-+ char rtx[65536]; /* retransmission buffer */
-+ int rtx_len;
-+ int mtu; /* unit mtu */
-+};
-+
-+typedef struct pw_cb_data
-+{
-+ const void *password;
-+ const char *prompt_info;
-+} PW_CB_DATA;
-+
-+
-+int ssl_verify_callback(int, X509_STORE_CTX *);
-+void ssl_msg_callback(int write_p, int version, int ct, const void *buf,
-+ size_t len, SSL * ssl, void *arg);
-+
-+X509 *get_X509_from_file(char *filename);
-+int ssl_cmp_certs(char *filename, X509 * a);
-+
-+SSL_CTX *eaptls_init_ssl(int init_server, char *cacertfile,
-+ char *certfile, char *peer_certfile, char *privkeyfile);
-+int eaptls_init_ssl_server(eap_state * esp);
-+int eaptls_init_ssl_client(eap_state * esp);
-+void eaptls_free_session(struct eaptls_session *ets);
-+
-+int eaptls_receive(struct eaptls_session *ets, u_char * inp, int len);
-+int eaptls_send(struct eaptls_session *ets, u_char ** outp);
-+void eaptls_retransmit(struct eaptls_session *ets, u_char ** outp);
-+
-+int get_eaptls_secret(int unit, char *client, char *server,
-+ char *clicertfile, char *servcertfile, char *cacertfile,
-+ char *pkfile, int am_server);
-+
-+#ifdef MPPE
-+#include "mppe.h" /* MPPE_MAX_KEY_LEN */
-+extern u_char mppe_send_key[MPPE_MAX_KEY_LEN];
-+extern u_char mppe_recv_key[MPPE_MAX_KEY_LEN];
-+extern int mppe_keys_set;
-+
-+void eaptls_gen_mppe_keys(struct eaptls_session *ets, const char *prf_label, int client);
-+
-+#endif
-+
-+#endif
-diff --git a/pppd/eap.c b/pppd/eap.c
-index 6ea6c1f8bff6..032407c3dbb2 100644
---- a/pppd/eap.c
-+++ b/pppd/eap.c
-@@ -43,6 +43,11 @@
- * Based on draft-ietf-pppext-eap-srp-03.txt.
- */
-
-+/*
-+ * Modification by Beniamino Galvani, Mar 2005
-+ * Implemented EAP-TLS authentication
-+ */
-+
- #define RCSID "$Id: eap.c,v 1.4 2004/11/09 22:39:25 paulus Exp $"
-
- /*
-@@ -62,8 +67,12 @@
-
- #include "pppd.h"
- #include "pathnames.h"
--#include "md5.h"
- #include "eap.h"
-+#ifdef USE_EAPTLS
-+#include "eap-tls.h"
-+#else
-+#include "md5.h"
-+#endif /* USE_EAPTLS */
-
- #ifdef USE_SRP
- #include <t_pwd.h>
-@@ -209,6 +218,9 @@ int unit;
- esp->es_server.ea_id = (u_char)(drand48() * 0x100);
- esp->es_client.ea_timeout = EAP_DEFREQTIME;
- esp->es_client.ea_maxrequests = EAP_DEFALLOWREQ;
-+#ifdef USE_EAPTLS
-+ esp->es_client.ea_using_eaptls = 0;
-+#endif /* USE_EAPTLS */
- }
-
- /*
-@@ -436,8 +448,16 @@ int status;
- u_char vals[2];
- struct b64state bs;
- #endif /* USE_SRP */
-+#ifdef USE_EAPTLS
-+ struct eaptls_session *ets;
-+ int secret_len;
-+ char secret[MAXWORDLEN];
-+#endif /* USE_EAPTLS */
-
- esp->es_server.ea_timeout = esp->es_savedtime;
-+#ifdef USE_EAPTLS
-+ esp->es_server.ea_prev_state = esp->es_server.ea_state;
-+#endif /* USE_EAPTLS */
- switch (esp->es_server.ea_state) {
- case eapBadAuth:
- return;
-@@ -562,9 +582,79 @@ int status;
- break;
- }
- #endif /* USE_SRP */
-+#ifdef USE_EAPTLS
-+ if (!get_secret(esp->es_unit, esp->es_server.ea_peer,
-+ esp->es_server.ea_name, secret, &secret_len, 1)) {
-+
-+ esp->es_server.ea_state = eapTlsStart;
-+ break;
-+ }
-+#endif /* USE_EAPTLS */
-+
- esp->es_server.ea_state = eapMD5Chall;
- break;
-
-+#ifdef USE_EAPTLS
-+ case eapTlsStart:
-+ /* Initialize ssl session */
-+ if(!eaptls_init_ssl_server(esp)) {
-+ esp->es_server.ea_state = eapBadAuth;
-+ break;
-+ }
-+
-+ esp->es_server.ea_state = eapTlsRecv;
-+ break;
-+
-+ case eapTlsRecv:
-+ ets = (struct eaptls_session *) esp->es_server.ea_session;
-+
-+ if(ets->alert_sent) {
-+ esp->es_server.ea_state = eapTlsSendAlert;
-+ break;
-+ }
-+
-+ if (status) {
-+ esp->es_server.ea_state = eapBadAuth;
-+ break;
-+ }
-+ ets = (struct eaptls_session *) esp->es_server.ea_session;
-+
-+ if(ets->frag)
-+ esp->es_server.ea_state = eapTlsSendAck;
-+ else
-+ esp->es_server.ea_state = eapTlsSend;
-+ break;
-+
-+ case eapTlsSend:
-+ ets = (struct eaptls_session *) esp->es_server.ea_session;
-+
-+ if(ets->frag)
-+ esp->es_server.ea_state = eapTlsRecvAck;
-+ else
-+ if(SSL_is_init_finished(ets->ssl))
-+ esp->es_server.ea_state = eapTlsRecvClient;
-+ else
-+ esp->es_server.ea_state = eapTlsRecv;
-+ break;
-+
-+ case eapTlsSendAck:
-+ esp->es_server.ea_state = eapTlsRecv;
-+ break;
-+
-+ case eapTlsRecvAck:
-+ if (status) {
-+ esp->es_server.ea_state = eapBadAuth;
-+ break;
-+ }
-+
-+ esp->es_server.ea_state = eapTlsSend;
-+ break;
-+
-+ case eapTlsSendAlert:
-+ esp->es_server.ea_state = eapTlsRecvAlertAck;
-+ break;
-+#endif /* USE_EAPTLS */
-+
- case eapSRP1:
- #ifdef USE_SRP
- ts = (struct t_server *)esp->es_server.ea_session;
-@@ -718,6 +808,30 @@ eap_state *esp;
- INCPTR(esp->es_server.ea_namelen, outp);
- break;
-
-+#ifdef USE_EAPTLS
-+ case eapTlsStart:
-+ PUTCHAR(EAPT_TLS, outp);
-+ PUTCHAR(EAP_TLS_FLAGS_START, outp);
-+ eap_figure_next_state(esp, 0);
-+ break;
-+
-+ case eapTlsSend:
-+ eaptls_send(esp->es_server.ea_session, &outp);
-+ eap_figure_next_state(esp, 0);
-+ break;
-+
-+ case eapTlsSendAck:
-+ PUTCHAR(EAPT_TLS, outp);
-+ PUTCHAR(0, outp);
-+ eap_figure_next_state(esp, 0);
-+ break;
-+
-+ case eapTlsSendAlert:
-+ eaptls_send(esp->es_server.ea_session, &outp);
-+ eap_figure_next_state(esp, 0);
-+ break;
-+#endif /* USE_EAPTLS */
-+
- #ifdef USE_SRP
- case eapSRP1:
- PUTCHAR(EAPT_SRP, outp);
-@@ -904,11 +1018,57 @@ static void
- eap_server_timeout(arg)
- void *arg;
- {
-+#ifdef USE_EAPTLS
-+ u_char *outp;
-+ u_char *lenloc;
-+ int outlen;
-+#endif /* USE_EAPTLS */
-+
- eap_state *esp = (eap_state *) arg;
-
- if (!eap_server_active(esp))
- return;
-
-+#ifdef USE_EAPTLS
-+ switch(esp->es_server.ea_prev_state) {
-+
-+ /*
-+ * In eap-tls the state changes after a request, so we return to
-+ * previous state ...
-+ */
-+ case(eapTlsStart):
-+ case(eapTlsSendAck):
-+ esp->es_server.ea_state = esp->es_server.ea_prev_state;
-+ break;
-+
-+ /*
-+ * ... or resend the stored data
-+ */
-+ case(eapTlsSend):
-+ case(eapTlsSendAlert):
-+ outp = outpacket_buf;
-+ MAKEHEADER(outp, PPP_EAP);
-+ PUTCHAR(EAP_REQUEST, outp);
-+ PUTCHAR(esp->es_server.ea_id, outp);
-+ lenloc = outp;
-+ INCPTR(2, outp);
-+
-+ eaptls_retransmit(esp->es_server.ea_session, &outp);
-+
-+ outlen = (outp - outpacket_buf) - PPP_HDRLEN;
-+ PUTSHORT(outlen, lenloc);
-+ output(esp->es_unit, outpacket_buf, outlen + PPP_HDRLEN);
-+ esp->es_server.ea_requests++;
-+
-+ if (esp->es_server.ea_timeout > 0)
-+ TIMEOUT(eap_server_timeout, esp, esp->es_server.ea_timeout);
-+
-+ return;
-+ default:
-+ break;
-+ }
-+#endif /* USE_EAPTLS */
-+
- /* EAP ID number must not change on timeout. */
- eap_send_request(esp);
- }
-@@ -1166,6 +1326,81 @@ u_char *str;
- }
- #endif /* USE_SRP */
-
-+#ifdef USE_EAPTLS
-+/*
-+ * Send an EAP-TLS response message with tls data
-+ */
-+static void
-+eap_tls_response(esp, id)
-+eap_state *esp;
-+u_char id;
-+{
-+ u_char *outp;
-+ int outlen;
-+ u_char *lenloc;
-+
-+ outp = outpacket_buf;
-+
-+ MAKEHEADER(outp, PPP_EAP);
-+
-+ PUTCHAR(EAP_RESPONSE, outp);
-+ PUTCHAR(id, outp);
-+
-+ lenloc = outp;
-+ INCPTR(2, outp);
-+
-+ /*
-+ If the id in the request is unchanged, we must retransmit
-+ the old data
-+ */
-+ if(id == esp->es_client.ea_id)
-+ eaptls_retransmit(esp->es_client.ea_session, &outp);
-+ else
-+ eaptls_send(esp->es_client.ea_session, &outp);
-+
-+ outlen = (outp - outpacket_buf) - PPP_HDRLEN;
-+ PUTSHORT(outlen, lenloc);
-+
-+ output(esp->es_unit, outpacket_buf, PPP_HDRLEN + outlen);
-+
-+ esp->es_client.ea_id = id;
-+
-+}
-+
-+/*
-+ * Send an EAP-TLS ack
-+ */
-+static void
-+eap_tls_sendack(esp, id)
-+eap_state *esp;
-+u_char id;
-+{
-+ u_char *outp;
-+ int outlen;
-+ u_char *lenloc;
-+
-+ outp = outpacket_buf;
-+
-+ MAKEHEADER(outp, PPP_EAP);
-+
-+ PUTCHAR(EAP_RESPONSE, outp);
-+ PUTCHAR(id, outp);
-+ esp->es_client.ea_id = id;
-+
-+ lenloc = outp;
-+ INCPTR(2, outp);
-+
-+ PUTCHAR(EAPT_TLS, outp);
-+ PUTCHAR(0, outp);
-+
-+ outlen = (outp - outpacket_buf) - PPP_HDRLEN;
-+ PUTSHORT(outlen, lenloc);
-+
-+ output(esp->es_unit, outpacket_buf, PPP_HDRLEN + outlen);
-+
-+}
-+#endif /* USE_EAPTLS */
-+
- static void
- eap_send_nak(esp, id, type)
- eap_state *esp;
-@@ -1320,6 +1555,11 @@ int len;
- char rhostname[256];
- MD5_CTX mdContext;
- u_char hash[MD5_SIGNATURE_SIZE];
-+#ifdef USE_EAPTLS
-+ u_char flags;
-+ struct eaptls_session *ets = esp->es_client.ea_session;
-+#endif /* USE_EAPTLS */
-+
- #ifdef USE_SRP
- struct t_client *tc;
- struct t_num sval, gval, Nval, *Ap, Bval;
-@@ -1456,6 +1696,100 @@ int len;
- esp->es_client.ea_namelen);
- break;
-
-+#ifdef USE_EAPTLS
-+ case EAPT_TLS:
-+
-+ switch(esp->es_client.ea_state) {
-+
-+ case eapListen:
-+
-+ if (len < 1) {
-+ error("EAP: received EAP-TLS Listen packet with no data");
-+ /* Bogus request; wait for something real. */
-+ return;
-+ }
-+ GETCHAR(flags, inp);
-+ if(flags & EAP_TLS_FLAGS_START){
-+
-+ esp->es_client.ea_using_eaptls = 1;
-+
-+ if (explicit_remote){
-+ esp->es_client.ea_peer = strdup(remote_name);
-+ esp->es_client.ea_peerlen = strlen(remote_name);
-+ } else
-+ esp->es_client.ea_peer = NULL;
-+
-+ /* Init ssl session */
-+ if(!eaptls_init_ssl_client(esp)) {
-+ dbglog("cannot init ssl");
-+ eap_send_nak(esp, id, EAPT_TLS);
-+ esp->es_client.ea_using_eaptls = 0;
-+ break;
-+ }
-+
-+ ets = esp->es_client.ea_session;
-+ eap_tls_response(esp, id);
-+ esp->es_client.ea_state = (ets->frag ? eapTlsRecvAck :
-+ eapTlsRecv);
-+ break;
-+ }
-+
-+ /* The server has sent a bad start packet. */
-+ eap_send_nak(esp, id, EAPT_TLS);
-+ break;
-+
-+ case eapTlsRecvAck:
-+ eap_tls_response(esp, id);
-+ esp->es_client.ea_state = (ets->frag ? eapTlsRecvAck :
-+ eapTlsRecv);
-+ break;
-+
-+ case eapTlsRecv:
-+ if (len < 1) {
-+ error("EAP: discarding EAP-TLS Receive packet with no data");
-+ /* Bogus request; wait for something real. */
-+ return;
-+ }
-+ eaptls_receive(ets, inp, len);
-+
-+ if(ets->frag) {
-+ eap_tls_sendack(esp, id);
-+ esp->es_client.ea_state = eapTlsRecv;
-+ break;
-+ }
-+
-+ if(ets->alert_recv) {
-+ eap_tls_sendack(esp, id);
-+ esp->es_client.ea_state = eapTlsRecvFailure;
-+ break;
-+ }
-+
-+ /* Check if TLS handshake is finished */
-+ if(SSL_is_init_finished(ets->ssl)){
-+#ifdef MPPE
-+ eaptls_gen_mppe_keys( ets, "client EAP encryption", 1 );
-+#endif
-+ eaptls_free_session(ets);
-+ eap_tls_sendack(esp, id);
-+ esp->es_client.ea_state = eapTlsRecvSuccess;
-+ break;
-+ }
-+
-+ eap_tls_response(esp,id);
-+ esp->es_client.ea_state = (ets->frag ? eapTlsRecvAck :
-+ eapTlsRecv);
-+
-+ break;
-+
-+ default:
-+ eap_send_nak(esp, id, EAPT_TLS);
-+ esp->es_client.ea_using_eaptls = 0;
-+ break;
-+ }
-+
-+ break;
-+#endif /* USE_EAPTLS */
-+
- #ifdef USE_SRP
- case EAPT_SRP:
- if (len < 1) {
-@@ -1737,6 +2071,11 @@ int len;
- u_char dig[SHA_DIGESTSIZE];
- #endif /* USE_SRP */
-
-+#ifdef USE_EAPTLS
-+ struct eaptls_session *ets;
-+ u_char flags;
-+#endif /* USE_EAPTLS */
-+
- if (esp->es_server.ea_id != id) {
- dbglog("EAP: discarding Response %d; expected ID %d", id,
- esp->es_server.ea_id);
-@@ -1776,6 +2115,64 @@ int len;
- eap_figure_next_state(esp, 0);
- break;
-
-+#ifdef USE_EAPTLS
-+ case EAPT_TLS:
-+ switch(esp->es_server.ea_state) {
-+
-+ case eapTlsRecv:
-+
-+ ets = (struct eaptls_session *) esp->es_server.ea_session;
-+ eap_figure_next_state(esp,
-+ eaptls_receive(esp->es_server.ea_session, inp, len));
-+
-+ if(ets->alert_recv) {
-+ eap_send_failure(esp);
-+ break;
-+ }
-+ break;
-+
-+ case eapTlsRecvAck:
-+ if(len > 1) {
-+ dbglog("EAP-TLS ACK with extra data");
-+ }
-+ eap_figure_next_state(esp, 0);
-+ break;
-+
-+ case eapTlsRecvClient:
-+ /* Receive authentication response from client */
-+
-+ if (len > 0) {
-+ GETCHAR(flags, inp);
-+
-+ if(len == 1 && !flags) { /* Ack = ok */
-+#ifdef MPPE
-+ eaptls_gen_mppe_keys( esp->es_server.ea_session, "client EAP encryption", 0 );
-+#endif
-+ eap_send_success(esp);
-+ }
-+ else { /* failure */
-+ warn("Server authentication failed");
-+ eap_send_failure(esp);
-+ }
-+ }
-+ else
-+ warn("Bogus EAP-TLS packet received from client");
-+
-+ eaptls_free_session(esp->es_server.ea_session);
-+
-+ break;
-+
-+ case eapTlsRecvAlertAck:
-+ eap_send_failure(esp);
-+ break;
-+
-+ default:
-+ eap_figure_next_state(esp, 1);
-+ break;
-+ }
-+ break;
-+#endif /* USE_EAPTLS */
-+
- case EAPT_NOTIFICATION:
- dbglog("EAP unexpected Notification; response discarded");
- break;
-@@ -1807,6 +2204,13 @@ int len;
- esp->es_server.ea_state = eapMD5Chall;
- break;
-
-+#ifdef USE_EAPTLS
-+ /* Send EAP-TLS start packet */
-+ case EAPT_TLS:
-+ esp->es_server.ea_state = eapTlsStart;
-+ break;
-+#endif /* USE_EAPTLS */
-+
- default:
- dbglog("EAP: peer requesting unknown Type %d", vallen);
- switch (esp->es_server.ea_state) {
-@@ -2018,13 +2422,27 @@ u_char *inp;
- int id;
- int len;
- {
-- if (esp->es_client.ea_state != eapOpen && !eap_client_active(esp)) {
-+ if (esp->es_client.ea_state != eapOpen && !eap_client_active(esp)
-+#ifdef USE_EAPTLS
-+ && esp->es_client.ea_state != eapTlsRecvSuccess
-+#endif /* USE_EAPTLS */
-+ ) {
- dbglog("EAP unexpected success message in state %s (%d)",
- eap_state_name(esp->es_client.ea_state),
- esp->es_client.ea_state);
- return;
- }
-
-+#ifdef USE_EAPTLS
-+ if(esp->es_client.ea_using_eaptls && esp->es_client.ea_state !=
-+ eapTlsRecvSuccess) {
-+ dbglog("EAP-TLS unexpected success message in state %s (%d)",
-+ eap_state_name(esp->es_client.ea_state),
-+ esp->es_client.ea_state);
-+ return;
-+ }
-+#endif /* USE_EAPTLS */
-+
- if (esp->es_client.ea_timeout > 0) {
- UNTIMEOUT(eap_client_timeout, (void *)esp);
- }
-@@ -2150,6 +2568,9 @@ void *arg;
- int code, id, len, rtype, vallen;
- u_char *pstart;
- u_int32_t uval;
-+#ifdef USE_EAPTLS
-+ u_char flags;
-+#endif /* USE_EAPTLS */
-
- if (inlen < EAP_HEADERLEN)
- return (0);
-@@ -2214,6 +2635,24 @@ void *arg;
- }
- break;
-
-+#ifdef USE_EAPTLS
-+ case EAPT_TLS:
-+ if (len < 1)
-+ break;
-+ GETCHAR(flags, inp);
-+ len--;
-+
-+ if(flags == 0 && len == 0){
-+ printer(arg, " Ack");
-+ break;
-+ }
-+
-+ printer(arg, flags & EAP_TLS_FLAGS_LI ? " L":" -");
-+ printer(arg, flags & EAP_TLS_FLAGS_MF ? "M":"-");
-+ printer(arg, flags & EAP_TLS_FLAGS_START ? "S":"- ");
-+ break;
-+#endif /* USE_EAPTLS */
-+
- case EAPT_SRP:
- if (len < 3)
- goto truncated;
-@@ -2325,6 +2764,25 @@ void *arg;
- }
- break;
-
-+#ifdef USE_EAPTLS
-+ case EAPT_TLS:
-+ if (len < 1)
-+ break;
-+ GETCHAR(flags, inp);
-+ len--;
-+
-+ if(flags == 0 && len == 0){
-+ printer(arg, " Ack");
-+ break;
-+ }
-+
-+ printer(arg, flags & EAP_TLS_FLAGS_LI ? " L":" -");
-+ printer(arg, flags & EAP_TLS_FLAGS_MF ? "M":"-");
-+ printer(arg, flags & EAP_TLS_FLAGS_START ? "S":"- ");
-+
-+ break;
-+#endif /* USE_EAPTLS */
-+
- case EAPT_NAK:
- if (len <= 0) {
- printer(arg, " <missing hint>");
-@@ -2426,3 +2884,4 @@ void *arg;
-
- return (inp - pstart);
- }
-+
-diff --git a/pppd/eap.h b/pppd/eap.h
-index 199d1849b826..087baad83eed 100644
---- a/pppd/eap.h
-+++ b/pppd/eap.h
-@@ -84,6 +84,16 @@ enum eap_state_code {
- eapClosed, /* Authentication not in use */
- eapListen, /* Client ready (and timer running) */
- eapIdentify, /* EAP Identify sent */
-+ eapTlsStart, /* Send EAP-TLS start packet */
-+ eapTlsRecv, /* Receive EAP-TLS tls data */
-+ eapTlsSendAck, /* Send EAP-TLS ack */
-+ eapTlsSend, /* Send EAP-TLS tls data */
-+ eapTlsRecvAck, /* Receive EAP-TLS ack */
-+ eapTlsRecvClient, /* Receive EAP-TLS auth response from client*/
-+ eapTlsSendAlert, /* Send EAP-TLS tls alert (server)*/
-+ eapTlsRecvAlertAck, /* Receive EAP-TLS ack after sending alert */
-+ eapTlsRecvSuccess, /* Receive EAP success */
-+ eapTlsRecvFailure, /* Receive EAP failure */
- eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */
- eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */
- eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */
-@@ -95,9 +105,18 @@ enum eap_state_code {
-
- #define EAP_STATES \
- "Initial", "Pending", "Closed", "Listen", "Identify", \
-+ "TlsStart", "TlsRecv", "TlsSendAck", "TlsSend", "TlsRecvAck", "TlsRecvClient",\
-+ "TlsSendAlert", "TlsRecvAlertAck" , "TlsRecvSuccess", "TlsRecvFailure", \
- "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth"
-
--#define eap_client_active(esp) ((esp)->es_client.ea_state == eapListen)
-+#ifdef USE_EAPTLS
-+#define eap_client_active(esp) ((esp)->es_client.ea_state != eapInitial &&\
-+ (esp)->es_client.ea_state != eapPending &&\
-+ (esp)->es_client.ea_state != eapClosed)
-+#else
-+#define eap_client_active(esp) ((esp)->es_client.ea_state == eapListen)
-+#endif /* USE_EAPTLS */
-+
- #define eap_server_active(esp) \
- ((esp)->es_server.ea_state >= eapIdentify && \
- (esp)->es_server.ea_state <= eapMD5Chall)
-@@ -112,11 +131,17 @@ struct eap_auth {
- u_short ea_namelen; /* Length of our name */
- u_short ea_peerlen; /* Length of peer's name */
- enum eap_state_code ea_state;
-+#ifdef USE_EAPTLS
-+ enum eap_state_code ea_prev_state;
-+#endif
- u_char ea_id; /* Current id */
- u_char ea_requests; /* Number of Requests sent/received */
- u_char ea_responses; /* Number of Responses */
- u_char ea_type; /* One of EAPT_* */
- u_int32_t ea_keyflags; /* SRP shared key usage flags */
-+#ifdef USE_EAPTLS
-+ bool ea_using_eaptls;
-+#endif
- };
-
- /*
-@@ -139,7 +164,12 @@ typedef struct eap_state {
- * Timeouts.
- */
- #define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */
-+#ifdef USE_EAPTLS
-+#define EAP_DEFTRANSMITS 30 /* max # times to transmit */
-+ /* certificates can be long ... */
-+#else
- #define EAP_DEFTRANSMITS 10 /* max # times to transmit */
-+#endif /* USE_EAPTLS */
- #define EAP_DEFREQTIME 20 /* Time to wait for peer request */
- #define EAP_DEFALLOWREQ 20 /* max # times to accept requests */
-
-diff --git a/pppd/md5.c b/pppd/md5.c
-index f1291ce1bd72..6f8f7207c592 100644
---- a/pppd/md5.c
-+++ b/pppd/md5.c
-@@ -33,6 +33,8 @@
- ***********************************************************************
- */
-
-+#ifndef USE_EAPTLS
-+
- #include <string.h>
- #include "md5.h"
-
-@@ -305,3 +307,5 @@ UINT4 *in;
- ** End of md5.c **
- ******************************** (cut) ********************************
- */
-+#endif /* USE_EAPTLS */
-+
-diff --git a/pppd/md5.h b/pppd/md5.h
-index 71e8b00e2dde..14d712171c5e 100644
---- a/pppd/md5.h
-+++ b/pppd/md5.h
-@@ -36,6 +36,7 @@
- ** documentation and/or software. **
- ***********************************************************************
- */
-+#ifndef USE_EAPTLS
-
- #ifndef __MD5_INCLUDE__
-
-@@ -63,3 +64,5 @@ void MD5_Final (unsigned char hash[], MD5_CTX *mdContext);
-
- #define __MD5_INCLUDE__
- #endif /* __MD5_INCLUDE__ */
-+
-+#endif /* USE_EAPTLS */
-diff --git a/pppd/pathnames.h b/pppd/pathnames.h
-index 46972601fc92..72c2f5b191ee 100644
---- a/pppd/pathnames.h
-+++ b/pppd/pathnames.h
-@@ -21,6 +21,13 @@
- #define _PATH_UPAPFILE _ROOT_PATH "/etc/ppp/pap-secrets"
- #define _PATH_CHAPFILE _ROOT_PATH "/etc/ppp/chap-secrets"
- #define _PATH_SRPFILE _ROOT_PATH "/etc/ppp/srp-secrets"
-+
-+#ifdef USE_EAPTLS
-+#define _PATH_EAPTLSCLIFILE _ROOT_PATH "/etc/ppp/eaptls-client"
-+#define _PATH_EAPTLSSERVFILE _ROOT_PATH "/etc/ppp/eaptls-server"
-+#define _PATH_OPENSSLCONFFILE _ROOT_PATH "/etc/ppp/openssl.cnf"
-+#endif /* USE_EAPTLS */
-+
- #define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options"
- #define _PATH_IPUP _ROOT_PATH "/etc/ppp/ip-up"
- #define _PATH_IPDOWN _ROOT_PATH "/etc/ppp/ip-down"
-diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
-index 0f9d37d2953b..bc29968d44c9 100644
---- a/pppd/plugins/Makefile.linux
-+++ b/pppd/plugins/Makefile.linux
-@@ -4,6 +4,9 @@ CFLAGS = $(COPTS) -I.. -I../../include -fPIC
- LDFLAGS = $(LDOPTS)
- INSTALL = install
-
-+# EAP-TLS
-+CFLAGS += -DUSE_EAPTLS=1
-+
- DESTDIR = $(INSTROOT)@DESTDIR@
- BINDIR = $(DESTDIR)/sbin
- MANDIR = $(DESTDIR)/share/man/man8
-diff --git a/pppd/plugins/passprompt.c b/pppd/plugins/passprompt.c
-index babb6dc31bab..6ba73cae2795 100644
---- a/pppd/plugins/passprompt.c
-+++ b/pppd/plugins/passprompt.c
-@@ -107,4 +107,7 @@ void plugin_init(void)
- {
- add_options(options);
- pap_passwd_hook = promptpass;
-+#ifdef USE_EAPTLS
-+ eaptls_passwd_hook = promptpass;
-+#endif
- }
-diff --git a/pppd/plugins/passwordfd.c b/pppd/plugins/passwordfd.c
-index d718f3bdf81d..c3f9793e41a0 100644
---- a/pppd/plugins/passwordfd.c
-+++ b/pppd/plugins/passwordfd.c
-@@ -79,4 +79,8 @@ void plugin_init (void)
-
- chap_check_hook = pwfd_check;
- chap_passwd_hook = pwfd_passwd;
-+
-+#ifdef USE_EAPTLS
-+ eaptls_passwd_hook = pwfd_passwd;
-+#endif
- }
-diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index 65bbe721f761..8afa2d1186e2 100644
---- a/pppd/pppd.8
-+++ b/pppd/pppd.8
-@@ -253,6 +253,12 @@ Alternatively, a value of 0 for \fInr\fR or \fInt\fR disables
- compression in the corresponding direction. Use \fInobsdcomp\fR or
- \fIbsdcomp 0\fR to disable BSD-Compress compression entirely.
- .TP
-+.B ca \fIca-file
-+(EAP-TLS) Use the file \fIca-file\fR as the X.509 Certificate Authority
-+(CA) file (in PEM format), needed for setting up an EAP-TLS connection.
-+This option is used on the client-side in conjunction with the \fBcert\fR
-+and \fBkey\fR options.
-+.TP
- .B cdtrcts
- Use a non-standard hardware flow control (i.e. DTR/CTS) to control
- the flow of data on the serial port. If neither the \fIcrtscts\fR,
-@@ -264,6 +270,12 @@ RTS output. Such serial ports use this mode to implement true
- bi-directional flow control. The sacrifice is that this flow
- control mode does not permit using DTR as a modem control line.
- .TP
-+.B cert \fIcertfile
-+(EAP-TLS) Use the file \fIcertfile\fR as the X.509 certificate (in PEM
-+format), needed for setting up an EAP-TLS connection. This option is
-+used on the client-side in conjunction with the \fBca\fR and
-+\fBkey\fR options.
-+.TP
- .B chap\-interval \fIn
- If this option is given, pppd will rechallenge the peer every \fIn\fR
- seconds.
-@@ -292,6 +304,18 @@ negotiation by sending its first LCP packet. The default value is
- 1000 (1 second). This wait period only applies if the \fBconnect\fR
- or \fBpty\fR option is used.
- .TP
-+.B crl \fIfilename
-+(EAP-TLS) Use the file \fIfilename\fR as the Certificate Revocation List
-+to check for the validity of the peer's certificate. This option is not
-+mandatory for setting up an EAP-TLS connection. Also see the \fBcrl-dir\fR
-+option.
-+.TP
-+.B crl-dir \fIdirectory
-+(EAP-TLS) Use the directory \fIdirectory\fR to scan for CRL files in
-+has format ($hash.r0) to check for the validity of the peer's certificate.
-+This option is not mandatory for setting up an EAP-TLS connection.
-+Also see the \fBcrl\fR option.
-+.TP
- .B debug
- Enables connection debugging facilities.
- If this option is given, pppd will log the contents of all
-@@ -561,6 +585,12 @@ transmitted packets be printed. On most systems, messages printed by
- the kernel are logged by syslog(1) to a file as directed in the
- /etc/syslog.conf configuration file.
- .TP
-+.B key \fIkeyfile
-+(EAP-TLS) Use the file \fIkeyfile\fR as the private key file (in PEM
-+format), needed for setting up an EAP-TLS connection. This option is
-+used on the client-side in conjunction with the \fBca\fR and
-+\fBcert\fR options.
-+.TP
- .B ktune
- Enables pppd to alter kernel settings as appropriate. Under Linux,
- pppd will enable IP forwarding (i.e. set /proc/sys/net/ipv4/ip_forward
-@@ -724,6 +754,9 @@ name to \fIname\fR.)
- Disable Address/Control compression in both directions (send and
- receive).
- .TP
-+.B need-peer-eap
-+(EAP-TLS) Require the peer to verify our authentication credentials.
-+.TP
- .B noauth
- Do not require the peer to authenticate itself. This option is
- privileged.
-diff --git a/pppd/pppd.h b/pppd/pppd.h
-index 567d702181ca..195cbe3c6ffb 100644
---- a/pppd/pppd.h
-+++ b/pppd/pppd.h
-@@ -338,6 +338,11 @@ extern bool dump_options; /* print out option values */
- extern bool dryrun; /* check everything, print options, exit */
- extern int child_wait; /* # seconds to wait for children at end */
-
-+#ifdef USE_EAPTLS
-+extern char *crl_dir;
-+extern char *crl_file;
-+#endif /* USE_EAPTLS */
-+
- #ifdef MAXOCTETS
- extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */
- extern int maxoctets_dir; /* Direction :
-@@ -758,6 +763,10 @@ extern int (*chap_check_hook) __P((void));
- extern int (*chap_passwd_hook) __P((char *user, char *passwd));
- extern void (*multilink_join_hook) __P((void));
-
-+#ifdef USE_EAPTLS
-+extern int (*eaptls_passwd_hook) __P((char *user, char *passwd));
-+#endif
-+
- /* Let a plugin snoop sent and received packets. Useful for L2TP */
- extern void (*snoop_recv_hook) __P((unsigned char *p, int len));
- extern void (*snoop_send_hook) __P((unsigned char *p, int len));
diff --git a/patches/ppp-2.4.7/0040-pppd-Use-openssl-for-the-DES-instead-of-the-libcrypt.patch b/patches/ppp-2.4.7/0040-pppd-Use-openssl-for-the-DES-instead-of-the-libcrypt.patch
deleted file mode 100644
index bf83278a9..000000000
--- a/patches/ppp-2.4.7/0040-pppd-Use-openssl-for-the-DES-instead-of-the-libcrypt.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
-Date: Fri, 6 Apr 2018 14:27:18 +0200
-Subject: [PATCH] pppd: Use openssl for the DES instead of the libcrypt / glibc
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-[https://github.com/paulusmack/ppp/commit/3c7b86229f7bd2600d74db14b1fe5b3896be3875]
-
-It seems the latest glibc (in Fedora glibc-2.27.9000-12.fc29) dropped
-libcrypt. The libxcrypt standalone package can be used instead, but
-it dropped the old setkey/encrypt API which ppp uses for DES. There
-is support for using openssl in pppcrypt.c, but it contains typos
-preventing it from compiling and seems to be written for an ancient
-openssl version.
-
-This updates the code to use current openssl.
-
-[paulus@ozlabs.org - wrote the commit description, fixed comment in
- Makefile.linux.]
-
-Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
-Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
-
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/Makefile.linux | 7 ++++---
- pppd/pppcrypt.c | 18 +++++++++---------
- 2 files changed, 13 insertions(+), 12 deletions(-)
-
-diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index 58a634ce8c3b..cb9d4f9dcf22 100644
---- a/pppd/Makefile.linux
-+++ b/pppd/Makefile.linux
-@@ -35,10 +35,10 @@ endif
- COPTS = -O2 -pipe -Wall -g
- LIBS = -lcrypto
-
--# Uncomment the next 2 lines to include support for Microsoft's
-+# Uncomment the next line to include support for Microsoft's
- # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
- CHAPMS=y
--USE_CRYPT=y
-+#USE_CRYPT=y
- # Don't use MSLANMAN unless you really know what you're doing.
- #MSLANMAN=y
- # Uncomment the next line to include support for MPPE. CHAPMS (above) must
-@@ -138,7 +138,8 @@ endif
-
- ifdef NEEDDES
- ifndef USE_CRYPT
--LIBS += -ldes $(LIBS)
-+CFLAGS += -I/usr/include/openssl
-+LIBS += -lcrypto
- else
- CFLAGS += -DUSE_CRYPT=1
- endif
-diff --git a/pppd/pppcrypt.c b/pppd/pppcrypt.c
-index 8b85b13276ab..6b35375edc5e 100644
---- a/pppd/pppcrypt.c
-+++ b/pppd/pppcrypt.c
-@@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key with parity bits added */
- des_key[7] = Get7Bits(key, 49);
-
- #ifndef USE_CRYPT
-- des_set_odd_parity((des_cblock *)des_key);
-+ DES_set_odd_parity((DES_cblock *)des_key);
- #endif
- }
-
-@@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */
- }
-
- #else /* USE_CRYPT */
--static des_key_schedule key_schedule;
-+static DES_key_schedule key_schedule;
-
- bool
- DesSetkey(key)
- u_char *key;
- {
-- des_cblock des_key;
-+ DES_cblock des_key;
- MakeKey(key, des_key);
-- des_set_key(&des_key, key_schedule);
-+ DES_set_key(&des_key, &key_schedule);
- return (1);
- }
-
- bool
--DesEncrypt(clear, key, cipher)
-+DesEncrypt(clear, cipher)
- u_char *clear; /* IN 8 octets */
- u_char *cipher; /* OUT 8 octets */
- {
-- des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher,
-- key_schedule, 1);
-+ DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher,
-+ &key_schedule, 1);
- return (1);
- }
-
-@@ -185,8 +185,8 @@ DesDecrypt(cipher, clear)
- u_char *cipher; /* IN 8 octets */
- u_char *clear; /* OUT 8 octets */
- {
-- des_ecb_encrypt((des_cblock *)cipher, (des_cblock *)clear,
-- key_schedule, 0);
-+ DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear,
-+ &key_schedule, 0);
- return (1);
- }
-
diff --git a/patches/ppp-2.4.7/series b/patches/ppp-2.4.7/series
deleted file mode 100644
index 6aeaf1984..000000000
--- a/patches/ppp-2.4.7/series
+++ /dev/null
@@ -1,46 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-abort-on-errors-in-subdir-builds.patch
-0002-scripts-Avoid-killing-wrong-pppd.patch
-0003-pppd-Fix-sign-extension-when-displaying-bytes-in-oct.patch
-0004-Suppress-false-error-message-on-PPPoE-disconnect.patch
-0005-Send-PADT-on-PPPoE-disconnect.patch
-0006-pppd-ipxcp-Prevent-buffer-overrun-on-remote-router-n.patch
-0007-pppd-Fix-ccp_options.mppe-type.patch
-0008-pppd-Fix-ccp_cilen-calculated-size-if-both-deflate_c.patch
-0009-Fix-a-typo-in-comment.-Diff-from-Yuuichi-Someya.patch
-0010-plog-count-only-relevant-lines-from-syslog.patch
-0011-Change-include-from-sys-errno.h-to-errno.h.patch
-0012-pppd-allow-use-of-arbitrary-interface-names.patch
-0013-pppd-Remove-unused-declaration-of-ttyname.patch
-0014-pppd-Provide-error-implementation-in-pppoe-discovery.patch
-0015-pppoe-include-netinet-in.h-before-linux-in.h.patch
-0016-adaptive_echos.patch
-0017-Makefiles-cleanup.patch
-0018-Bug-306261-pppd-does-not-properly-close-dev-ppp-on-p.patch
-0019-Bug-284382-ppp-linkpidfile-is-not-created-upon-detac.patch
-0020-support-building-pppdump-with-the-system-zlib.patch
-0021-disable-unneeded-code-in-the-pppoatm-plugin.patch
-0022-cosmetic-cleanup-of-the-pppoatm-plugin.patch
-0023-pppoe_noads.patch
-0024-make-_PATH_CONNERRS-world-readable.patch
-0025-Correct-unkown-unknown-typo.patch
-0026-pppoe-custom-host-uniq-tag.patch
-0027-Add-replacedefaultroute-option.patch
-0028-ppp-2.3.11-oedod.dif.patch
-0029-add-support-for-the-Framed-MTU-Radius-attribute.patch
-0030-018_ip-up_option.patch
-0031-ppp-2.4.2-stripMSdomain.patch
-0032-export-CALL_FILE-to-the-link-scripts.patch
-0033-ipv6-accept-remote.patch
-0034-fix-a-potential-buffer-overflow-in-clientid.c-rc_map.patch
-0035-resolv.conf_no_log.patch
-0036-Debian-specific-changes.patch
-0037-Fix-buffer-overflow-in-rc_mksid.patch
-0038-EAP-TLS-authentication-support-for-PPP.patch
-0039-Replace-vendored-hash-functions-with-libcrypto.patch
-0040-pppd-Use-openssl-for-the-DES-instead-of-the-libcrypt.patch
-#tag:ptx --start-number 100
-0100-pppd-make-makefile-sysroot-aware.patch
-0101-pppd-make-the-self-made-configure-cross-aware.patch
-# b0e349fd34b2aac1a9ba4ffb38f43be0 - git-ptx-patches magic
diff --git a/patches/ppp-2.4.9/0001-configure-Allow-commas-in-the-CFLAGS-220.patch b/patches/ppp-2.4.9/0001-configure-Allow-commas-in-the-CFLAGS-220.patch
new file mode 100644
index 000000000..c83b64b1c
--- /dev/null
+++ b/patches/ppp-2.4.9/0001-configure-Allow-commas-in-the-CFLAGS-220.patch
@@ -0,0 +1,28 @@
+From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
+Date: Fri, 8 Jan 2021 02:43:46 +0100
+Subject: [PATCH] configure: Allow commas in the CFLAGS (#220)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It allows e.g. the following:
+./configure --cflags='-Wp,-D_FORTIFY_SOURCE=2'
+
+Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index f977663fd8db..b0c3d2b49122 100755
+--- a/configure
++++ b/configure
+@@ -123,7 +123,7 @@ mkmkf() {
+ echo " $2 <= $1"
+ sed -e "s,@DESTDIR@,$DESTDIR,g" -e "s,@SYSCONF@,$SYSCONF,g" \
+ -e "s,@CROSS_COMPILE@,$CROSS_COMPILE,g" -e "s,@CC@,$CC,g" \
+- -e "s,@CFLAGS@,$CFLAGS,g" $1 >$2
++ -e "s|@CFLAGS@|$CFLAGS|g" $1 >$2
+ fi
+ }
+
diff --git a/patches/ppp-2.4.9/0002-pppd-Fix-compilation-with-older-glibc-or-kernel-head.patch b/patches/ppp-2.4.9/0002-pppd-Fix-compilation-with-older-glibc-or-kernel-head.patch
new file mode 100644
index 000000000..33cf002db
--- /dev/null
+++ b/patches/ppp-2.4.9/0002-pppd-Fix-compilation-with-older-glibc-or-kernel-head.patch
@@ -0,0 +1,55 @@
+From: pali <7141871+pali@users.noreply.github.com>
+Date: Mon, 15 Feb 2021 07:54:01 +0100
+Subject: [PATCH] pppd: Fix compilation with older glibc or kernel headers
+ (#248)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+glibc versions prior to 2.24 do not define SOL_NETLINK and linux kernel
+versions prior to 4.3 do not define NETLINK_CAP_ACK. So add fallback
+definitions for these macros into pppd/sys-linux.c file.
+
+Also extend description why we call SOL_NETLINK/NETLINK_CAP_ACK option.
+
+Signed-off-by: Pali Rohár <pali@kernel.org>
+---
+ pppd/sys-linux.c | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
+index 85033d97124f..50c4f2dab403 100644
+--- a/pppd/sys-linux.c
++++ b/pppd/sys-linux.c
+@@ -125,6 +125,14 @@
+ #include <linux/netlink.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/if_addr.h>
++/* glibc versions prior to 2.24 do not define SOL_NETLINK */
++#ifndef SOL_NETLINK
++#define SOL_NETLINK 270
++#endif
++/* linux kernel versions prior to 4.3 do not define/support NETLINK_CAP_ACK */
++#ifndef NETLINK_CAP_ACK
++#define NETLINK_CAP_ACK 10
++#endif
+ #endif
+
+ #include "pppd.h"
+@@ -2843,7 +2851,15 @@ static int append_peer_ipv6_address(unsigned int iface, struct in6_addr *local_a
+ if (fd < 0)
+ return 0;
+
+- /* do not ask for error message content */
++ /*
++ * Tell kernel to not send to us payload of acknowledgment error message.
++ * NETLINK_CAP_ACK option is supported since Linux kernel version 4.3 and
++ * older kernel versions always send full payload in acknowledgment netlink
++ * message. We ignore payload of this message as we need only error code,
++ * to check if our set remote peer address request succeeded or failed.
++ * So ignore return value from the following setsockopt() call as setting
++ * option NETLINK_CAP_ACK means for us just a kernel hint / optimization.
++ */
+ one = 1;
+ setsockopt(fd, SOL_NETLINK, NETLINK_CAP_ACK, &one, sizeof(one));
+
diff --git a/patches/ppp-2.4.7/0020-support-building-pppdump-with-the-system-zlib.patch b/patches/ppp-2.4.9/0100-support-building-pppdump-with-the-system-zlib.patch
index ef8265d43..383be9d60 100644
--- a/patches/ppp-2.4.7/0020-support-building-pppdump-with-the-system-zlib.patch
+++ b/patches/ppp-2.4.9/0100-support-building-pppdump-with-the-system-zlib.patch
@@ -1,19 +1,25 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
+From: Alexander Dahl <ada@thorsis.com>
+Date: Wed, 16 Jun 2021 18:22:48 +0200
Subject: [PATCH] support building pppdump with the system zlib
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
+Forwarded: https://github.com/paulusmack/ppp/pull/189
+but nacked: "it caused compile failures (on Fedora at least), which
+reminded me that the zlib.c here is not the same as upstream; it has
+extra functions that I added a long time ago."
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+
+Imported from ppp_2.4.9-1+1.debian.tar.xz
+
+Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
pppdump/Makefile.linux | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/pppdump/Makefile.linux b/pppdump/Makefile.linux
-index 65e5c14914fb..87777fab5e94 100644
+index a94187fa9e29..de7e574d10e1 100644
--- a/pppdump/Makefile.linux
+++ b/pppdump/Makefile.linux
-@@ -2,18 +2,42 @@ DESTDIR = $(INSTROOT)@DESTDIR@
+@@ -6,15 +6,39 @@ DESTDIR = $(INSTROOT)@DESTDIR@
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
@@ -21,10 +27,7 @@ index 65e5c14914fb..87777fab5e94 100644
+DO_BSD_COMPRESS=y
+HAVE_ZLIB=n
+
- COPTS=-O2 -g
- CFLAGS= $(COPTS) -I../include/net
- LDFLAGS=$(LDOPTS)
-
+ CFLAGS = $(COPTS) -I../include/net
-OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
+OBJS = pppdump.o
+LIBS =
@@ -40,14 +43,14 @@ index 65e5c14914fb..87777fab5e94 100644
+else
+CFLAGS += -DDO_DEFLATE=0
+endif
-+
+
+ifdef DO_BSD_COMPRESS
+CFLAGS += -DDO_BSD_COMPRESS=1
+OBJS += bsd-comp.o
+else
+CFLAGS += -DDO_BSD_COMPRESS=0
+endif
-
++
INSTALL= install
all: pppdump
diff --git a/patches/ppp-2.4.7/0021-disable-unneeded-code-in-the-pppoatm-plugin.patch b/patches/ppp-2.4.9/0101-disable-unneeded-code-in-the-pppoatm-plugin.patch
index 2fb9c5573..882c913aa 100644
--- a/patches/ppp-2.4.7/0021-disable-unneeded-code-in-the-pppoatm-plugin.patch
+++ b/patches/ppp-2.4.9/0101-disable-unneeded-code-in-the-pppoatm-plugin.patch
@@ -1,5 +1,5 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
+From: Alexander Dahl <ada@thorsis.com>
+Date: Wed, 16 Jun 2021 18:22:48 +0200
Subject: [PATCH] disable unneeded code in the pppoatm plugin
This patch halves the size of the PPPoA plugin by disabling features
@@ -13,9 +13,9 @@ plugin with the real libatm. I really doubt anybody cares, anyway.
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
+Imported from ppp_2.4.9-1+1.debian.tar.xz
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
pppd/plugins/pppoatm/Makefile.linux | 4 ++++
pppd/plugins/pppoatm/pppoatm.c | 4 ++++
@@ -23,10 +23,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
3 files changed, 12 insertions(+)
diff --git a/pppd/plugins/pppoatm/Makefile.linux b/pppd/plugins/pppoatm/Makefile.linux
-index 002603c6cbef..76d81aced70a 100644
+index d3a8086b69ea..036b193637df 100644
--- a/pppd/plugins/pppoatm/Makefile.linux
+++ b/pppd/plugins/pppoatm/Makefile.linux
-@@ -25,9 +25,13 @@ ifdef HAVE_LIBATM
+@@ -26,9 +26,13 @@ ifdef HAVE_LIBATM
LIBS := -latm
else
CFLAGS += -I.
@@ -41,10 +41,10 @@ index 002603c6cbef..76d81aced70a 100644
#*********
all: $(PLUGIN)
diff --git a/pppd/plugins/pppoatm/pppoatm.c b/pppd/plugins/pppoatm/pppoatm.c
-index d693350bc473..a7560e9fb0c6 100644
+index 5a3ecd61b6a2..90d0c9a85d9f 100644
--- a/pppd/plugins/pppoatm/pppoatm.c
+++ b/pppd/plugins/pppoatm/pppoatm.c
-@@ -142,8 +142,12 @@ static int connect_pppoatm(void)
+@@ -145,8 +145,12 @@ static int connect_pppoatm(void)
qos.txtp.traffic_class = qos.rxtp.traffic_class = ATM_UBR;
/* TODO: support simplified QoS setting */
if (qosstr != NULL)
diff --git a/patches/ppp-2.4.9/0102-pppoe_noads.patch b/patches/ppp-2.4.9/0102-pppoe_noads.patch
new file mode 100644
index 000000000..6629d4194
--- /dev/null
+++ b/patches/ppp-2.4.9/0102-pppoe_noads.patch
@@ -0,0 +1,24 @@
+From: Alexander Dahl <ada@thorsis.com>
+Date: Wed, 16 Jun 2021 18:22:48 +0200
+Subject: [PATCH] pppoe_noads
+
+Imported from ppp_2.4.9-1+1.debian.tar.xz
+
+Signed-off-by: Alexander Dahl <ada@thorsis.com>
+---
+ pppd/plugins/pppoe/plugin.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/pppd/plugins/pppoe/plugin.c b/pppd/plugins/pppoe/plugin.c
+index de9b8166ce7b..58fbdf95be3f 100644
+--- a/pppd/plugins/pppoe/plugin.c
++++ b/pppd/plugins/pppoe/plugin.c
+@@ -412,8 +412,6 @@ plugin_init(void)
+ }
+
+ add_options(Options);
+-
+- info("PPPoE plugin from pppd %s", VERSION);
+ }
+
+ void pppoe_check_options(void)
diff --git a/patches/ppp-2.4.7/0028-ppp-2.3.11-oedod.dif.patch b/patches/ppp-2.4.9/0103-Forwarded-https-github.com-paulusmack-ppp-issues-187.patch
index 8151c3be2..38eb5b791 100644
--- a/patches/ppp-2.4.7/0028-ppp-2.3.11-oedod.dif.patch
+++ b/patches/ppp-2.4.9/0103-Forwarded-https-github.com-paulusmack-ppp-issues-187.patch
@@ -1,10 +1,22 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:49 +0200
-Subject: [PATCH] ppp-2.3.11-oedod.dif
+From: Alexander Dahl <ada@thorsis.com>
+Date: Wed, 16 Jun 2021 18:22:48 +0200
+Subject: [PATCH] Forwarded: https://github.com/paulusmack/ppp/issues/187
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
+Upstream said:
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+"
+Hmmm, dial-on-demand was never tested with the sync option, and in fact I don't
+know what devices would use that option.
+
+To be accepted, the patch would need a sign-off and a description that
+explained the changes in the patch - in particular, what the large lump of code
+added to demand_rexmit() is doing.
+"
+
+
+Imported from ppp_2.4.9-1+1.debian.tar.xz
+
+Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
pppd/demand.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
pppd/ipcp.c | 2 +-
@@ -13,7 +25,7 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
4 files changed, 101 insertions(+), 4 deletions(-)
diff --git a/pppd/demand.c b/pppd/demand.c
-index 5e57658ea831..3eddf3016d98 100644
+index 289c9f8fdd57..4c61444d3968 100644
--- a/pppd/demand.c
+++ b/pppd/demand.c
@@ -36,6 +36,8 @@
@@ -34,7 +46,7 @@ index 5e57658ea831..3eddf3016d98 100644
#ifdef PPP_FILTER
#include <pcap-bpf.h>
#endif
-@@ -221,6 +225,14 @@ loop_chars(p, n)
+@@ -218,6 +222,14 @@ loop_chars(unsigned char *p, int n)
int c, rv;
rv = 0;
@@ -49,14 +61,12 @@ index 5e57658ea831..3eddf3016d98 100644
for (; n > 0; --n) {
c = *p++;
if (c == PPP_FLAG) {
-@@ -299,17 +311,102 @@ loop_frame(frame, len)
+@@ -294,16 +306,101 @@ loop_frame(unsigned char *frame, int len)
* loopback, now that the real serial link is up.
*/
void
--demand_rexmit(proto)
-+demand_rexmit(proto, newip)
- int proto;
-+ u_int32_t newip;
+-demand_rexmit(int proto)
++demand_rexmit(int proto, u_int32_t newip)
{
struct packet *pkt, *prev, *nextpkt;
+ unsigned short checksum;
@@ -69,9 +79,11 @@ index 5e57658ea831..3eddf3016d98 100644
prev = NULL;
pkt = pend_q;
pend_q = NULL;
++
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
-+ select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */
++ select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Second */
++
for (; pkt != NULL; pkt = nextpkt) {
nextpkt = pkt->next;
if (PPP_PROTOCOL(pkt->data) == proto) {
@@ -83,7 +95,6 @@ index 5e57658ea831..3eddf3016d98 100644
+ if (checksum == 0xFFFF) {
+ checksum = 0;
+ }
-+
+
+ if (pkt->data[13] == 17) {
+ pkt_checksum = *((unsigned short *) (pkt->data+10+iphdr));
@@ -154,10 +165,10 @@ index 5e57658ea831..3eddf3016d98 100644
free(pkt);
} else {
diff --git a/pppd/ipcp.c b/pppd/ipcp.c
-index c8fe279d4ede..dceca807542a 100644
+index 302ca40b4c83..3ac26a08032a 100644
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
-@@ -1904,7 +1904,7 @@ ipcp_up(f)
+@@ -1850,7 +1850,7 @@ ipcp_up(fsm *f)
proxy_arp_set[f->unit] = 1;
}
@@ -167,12 +178,12 @@ index c8fe279d4ede..dceca807542a 100644
} else {
diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c
-index 356ff84ead41..c1602f41c206 100644
+index 431cb62211bf..a32b0002e10d 100644
--- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c
-@@ -1232,7 +1232,7 @@ ipv6cp_up(f)
- }
-
+@@ -1253,7 +1253,7 @@ ipv6cp_up(fsm *f)
+ if (sif6defaultroute(f->unit, go->ourid, ho->hisid))
+ default_route_set[f->unit] = 1;
}
- demand_rexmit(PPP_IPV6);
+ demand_rexmit(PPP_IPV6,0);
@@ -180,15 +191,15 @@ index 356ff84ead41..c1602f41c206 100644
} else {
diff --git a/pppd/pppd.h b/pppd/pppd.h
-index 7495df657fe9..e65106d4c126 100644
+index 612902f55d0d..10a9977598aa 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
-@@ -594,7 +594,7 @@ void demand_conf __P((void)); /* config interface(s) for demand-dial */
- void demand_block __P((void)); /* set all NPs to queue up packets */
- void demand_unblock __P((void)); /* set all NPs to pass packets */
- void demand_discard __P((void)); /* set all NPs to discard packets */
--void demand_rexmit __P((int)); /* retransmit saved frames for an NP */
-+void demand_rexmit __P((int, u_int32_t)); /* retransmit saved frames for an NP*/
- int loop_chars __P((unsigned char *, int)); /* process chars from loopback */
- int loop_frame __P((unsigned char *, int)); /* should we bring link up? */
+@@ -598,7 +598,7 @@ void demand_conf(void); /* config interface(s) for demand-dial */
+ void demand_block(void); /* set all NPs to queue up packets */
+ void demand_unblock(void); /* set all NPs to pass packets */
+ void demand_discard(void); /* set all NPs to discard packets */
+-void demand_rexmit(int); /* retransmit saved frames for an NP */
++void demand_rexmit(int, u_int32_t); /* retransmit saved frames for an NP */
+ int loop_chars(unsigned char *, int); /* process chars from loopback */
+ int loop_frame(unsigned char *, int); /* should we bring link up? */
diff --git a/patches/ppp-2.4.7/0035-resolv.conf_no_log.patch b/patches/ppp-2.4.9/0104-resolv.conf_no_log.patch
index aea6b2082..66265aa6c 100644
--- a/patches/ppp-2.4.7/0035-resolv.conf_no_log.patch
+++ b/patches/ppp-2.4.9/0104-resolv.conf_no_log.patch
@@ -1,19 +1,19 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:50 +0200
+From: Alexander Dahl <ada@thorsis.com>
+Date: Wed, 16 Jun 2021 18:22:48 +0200
Subject: [PATCH] resolv.conf_no_log
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
+Imported from ppp_2.4.9-1+1.debian.tar.xz
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
pppd/ipcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pppd/ipcp.c b/pppd/ipcp.c
-index d6e0e2a699fe..b81b2fd0a29f 100644
+index 3ac26a08032a..ce002262bb34 100644
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
-@@ -2152,7 +2152,7 @@ create_resolv(peerdns1, peerdns2)
+@@ -2093,7 +2093,7 @@ create_resolv(u_int32_t peerdns1, u_int32_t peerdns2)
f = fopen(_PATH_RESOLV, "w");
if (f == NULL) {
diff --git a/patches/ppp-2.4.7/0036-Debian-specific-changes.patch b/patches/ppp-2.4.9/0105-Debian-specific-changes.patch
index 9576af118..86bba35f9 100644
--- a/patches/ppp-2.4.7/0036-Debian-specific-changes.patch
+++ b/patches/ppp-2.4.9/0105-Debian-specific-changes.patch
@@ -1,23 +1,27 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:50 +0200
+From: Alexander Dahl <ada@thorsis.com>
+Date: Wed, 16 Jun 2021 18:22:49 +0200
Subject: [PATCH] Debian-specific changes.
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
+Imported from ppp_2.4.9-1+1.debian.tar.xz
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
- pppd/Makefile.linux | 6 ++----
+ pppd/Makefile.linux | 6 +++---
pppd/pathnames.h | 2 +-
pppd/pppd.h | 2 +-
pppdump/Makefile.linux | 4 ++--
- 4 files changed, 6 insertions(+), 8 deletions(-)
+ 4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index 16b3ee879791..5549145e5791 100644
+index 22837c50415e..bbb476827cea 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
-@@ -61,14 +61,14 @@ HAVE_MULTILINK=y
- USE_TDB=y
+@@ -64,17 +64,17 @@ USE_TDB=y
+ # Uncomment the next line to enable Type=notify services in systemd
+ # If enabled, and the user sets the up_sdnotify option, then
+ # pppd will not detach and will notify systemd when up.
+-#SYSTEMD=y
++SYSTEMD=y
HAS_SHADOW=y
-#USE_PAM=y
@@ -33,23 +37,11 @@ index 16b3ee879791..5549145e5791 100644
# Enable EAP SRP-SHA1 authentication (requires libsrp)
#USE_SRP=y
-@@ -178,11 +178,9 @@ LIBS += -ldl
- endif
-
- ifdef FILTER
--ifneq ($(wildcard /usr/include/pcap-bpf.h),)
- LIBS += -lpcap
- CFLAGS += -DPPP_FILTER
- endif
--endif
-
- ifdef HAVE_INET6
- PPPDSRCS += ipv6cp.c eui64.c
diff --git a/pppd/pathnames.h b/pppd/pathnames.h
-index a33f0466c9d6..46972601fc92 100644
+index 524d608ce12c..2df61354f40e 100644
--- a/pppd/pathnames.h
+++ b/pppd/pathnames.h
-@@ -28,7 +28,7 @@
+@@ -33,7 +33,7 @@
#define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up"
#define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down"
#define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options."
@@ -59,10 +51,10 @@ index a33f0466c9d6..46972601fc92 100644
#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf"
diff --git a/pppd/pppd.h b/pppd/pppd.h
-index b11670586244..567d702181ca 100644
+index 10a9977598aa..a14483b76acc 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
-@@ -870,7 +870,7 @@ extern void (*snoop_send_hook) __P((unsigned char *p, int len));
+@@ -879,7 +879,7 @@ extern void (*snoop_send_hook)(unsigned char *p, int len);
|| defined(DEBUGCHAP) || defined(DEBUG) || defined(DEBUGIPV6CP)
#define LOG_PPP LOG_LOCAL2
#else
@@ -72,10 +64,10 @@ index b11670586244..567d702181ca 100644
#endif /* LOG_PPP */
diff --git a/pppdump/Makefile.linux b/pppdump/Makefile.linux
-index 87777fab5e94..1eeeafe20111 100644
+index de7e574d10e1..04b1c10b34c7 100644
--- a/pppdump/Makefile.linux
+++ b/pppdump/Makefile.linux
-@@ -2,9 +2,9 @@ DESTDIR = $(INSTROOT)@DESTDIR@
+@@ -6,9 +6,9 @@ DESTDIR = $(INSTROOT)@DESTDIR@
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
@@ -85,5 +77,5 @@ index 87777fab5e94..1eeeafe20111 100644
-HAVE_ZLIB=n
+HAVE_ZLIB=y
- COPTS=-O2 -g
- CFLAGS= $(COPTS) -I../include/net
+ CFLAGS = $(COPTS) -I../include/net
+ OBJS = pppdump.o
diff --git a/patches/ppp-2.4.7/0039-Replace-vendored-hash-functions-with-libcrypto.patch b/patches/ppp-2.4.9/0106-Replace-vendored-hash-functions-with-libcrypto.patch
index a08af544a..8597cf9a5 100644
--- a/patches/ppp-2.4.7/0039-Replace-vendored-hash-functions-with-libcrypto.patch
+++ b/patches/ppp-2.4.9/0106-Replace-vendored-hash-functions-with-libcrypto.patch
@@ -1,5 +1,5 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 28 Sep 2019 08:11:50 +0200
+From: Alexander Dahl <ada@thorsis.com>
+Date: Wed, 16 Jun 2021 18:22:49 +0200
Subject: [PATCH] Replace vendored hash functions with libcrypto
Bug-Debian: https://bugs.debian.org/826625
@@ -14,24 +14,24 @@ preferable both due to the patch being slightly less invasive and also because
of our use of the EAP-TLS patch which requires OpenSSL.
-Imported from ppp_2.4.7-2+4.1.debian.tar.xz
+Imported from ppp_2.4.9-1+1.debian.tar.xz
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
- pppd/Makefile.linux | 25 ++--
+ pppd/Makefile.linux | 28 +---
pppd/chap-md5.c | 2 +-
pppd/chap_ms.c | 40 ++----
- pppd/eap.c | 2 +-
- pppd/md4.c | 299 -----------------------------------------
- pppd/md4.h | 64 ---------
- pppd/md5.c | 311 -------------------------------------------
- pppd/md5.h | 68 ----------
+ pppd/eap.c | 3 +-
+ pppd/md4.c | 290 -----------------------------------------
+ pppd/md4.h | 55 --------
+ pppd/md5.c | 299 -------------------------------------------
+ pppd/md5.h | 65 ----------
pppd/plugins/radius/md5.c | 2 +-
pppd/plugins/radius/radius.c | 2 +-
pppd/plugins/winbind.c | 2 +-
- pppd/sha1.c | 170 -----------------------
+ pppd/sha1.c | 171 -------------------------
pppd/sha1.h | 31 -----
- 13 files changed, 28 insertions(+), 990 deletions(-)
+ 13 files changed, 27 insertions(+), 963 deletions(-)
delete mode 100644 pppd/md4.c
delete mode 100644 pppd/md4.h
delete mode 100644 pppd/md5.c
@@ -40,10 +40,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
delete mode 100644 pppd/sha1.h
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index 4a11d5fea748..58a634ce8c3b 100644
+index bbb476827cea..bc01e3fd2a24 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
-@@ -11,16 +11,16 @@ INCDIR = $(DESTDIR)/include
+@@ -15,16 +15,16 @@ INCDIR = $(DESTDIR)/include
TARGETS = pppd
@@ -64,16 +64,16 @@ index 4a11d5fea748..58a634ce8c3b 100644
ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \
eap.o chap-md5.o session.o
-@@ -33,7 +33,7 @@ endif
- # CC = gcc
- #
- COPTS = -O2 -pipe -Wall -g
--LIBS =
-+LIBS = -lcrypto
+@@ -34,7 +34,7 @@ ifeq (.depend,$(wildcard .depend))
+ include .depend
+ endif
+
+-LIBS = -lrt
++LIBS = -lrt -lcrypto
- # Uncomment the next 2 lines to include support for Microsoft's
+ # Uncomment the next line to include support for Microsoft's
# MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
-@@ -91,8 +91,8 @@ LDFLAGS=$(LDOPTS)
+@@ -98,8 +98,8 @@ CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
ifdef CHAPMS
CFLAGS += -DCHAPMS=1
NEEDDES=y
@@ -84,12 +84,11 @@ index 4a11d5fea748..58a634ce8c3b 100644
ifdef MSLANMAN
CFLAGS += -DMSLANMAN=1
endif
-@@ -104,25 +104,18 @@ endif
- # EAP SRP-SHA1
+@@ -113,26 +113,17 @@ endif
ifdef USE_SRP
CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
--LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
-+LIBS += -lsrp -L/usr/local/ssl/lib
+ LIBS += -lsrp -L/usr/local/ssl/lib
+-NEEDCRYPTOLIB = y
TARGETS += srp-entry
EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
MANPAGES += srp-entry.8
@@ -106,27 +105,50 @@ index 4a11d5fea748..58a634ce8c3b 100644
# EAP-TLS
ifdef USE_EAPTLS
- CFLAGS += -DUSE_EAPTLS=1 -I/usr/kerberos/include
--LIBS += -lssl -lcrypto
-+LIBS += -lssl
+ CFLAGS += -DUSE_EAPTLS=1
+ LIBS += -lssl
+-NEEDCRYPTOLIB = y
PPPDSRC += eap-tls.c
HEADERS += eap-tls.h
PPPDOBJS += eap-tls.o
+@@ -156,7 +147,6 @@ endif
+ ifdef NEEDDES
+ ifndef USE_CRYPT
+ CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
+-NEEDCRYPTOLIB = y
+ else
+ CFLAGS += -DUSE_CRYPT=1
+ endif
+@@ -164,10 +154,6 @@ PPPDOBJS += pppcrypt.o
+ HEADERS += pppcrypt.h
+ endif
+
+-ifdef NEEDCRYPTOLIB
+-LIBS += -lcrypto
+-endif
+-
+ # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
+ ifdef USE_PAM
+ CFLAGS += -DUSE_PAM
diff --git a/pppd/chap-md5.c b/pppd/chap-md5.c
-index 269b52cb2041..7f7967a56842 100644
+index 77dd4ecc7059..d86564aa865a 100644
--- a/pppd/chap-md5.c
+++ b/pppd/chap-md5.c
-@@ -39,7 +39,7 @@
- #ifdef USE_EAPTLS
- #include "eap-tls.h"
- #else
--#include "md5.h"
+@@ -32,11 +32,11 @@
+
+ #include <stdlib.h>
+ #include <string.h>
+#include <openssl/md5.h>
- #endif /* USE_EAPTLS */
+ #include "pppd.h"
+ #include "chap-new.h"
+ #include "chap-md5.h"
+ #include "magic.h"
+-#include "md5.h"
#define MD5_HASH_SIZE 16
+ #define MD5_MIN_CHALLENGE 16
diff --git a/pppd/chap_ms.c b/pppd/chap_ms.c
-index c2bd00f9c6f7..19edb85d27a8 100644
+index e6b84f203fc3..64848f20f660 100644
--- a/pppd/chap_ms.c
+++ b/pppd/chap_ms.c
@@ -89,8 +89,8 @@
@@ -140,7 +162,7 @@ index c2bd00f9c6f7..19edb85d27a8 100644
#include "pppcrypt.h"
#include "magic.h"
-@@ -535,8 +535,8 @@ ChallengeHash(u_char PeerChallenge[16], u_char *rchallenge,
+@@ -536,8 +536,8 @@ ChallengeHash(u_char PeerChallenge[16], u_char *rchallenge,
char *username, u_char Challenge[8])
{
@@ -151,7 +173,7 @@ index c2bd00f9c6f7..19edb85d27a8 100644
char *user;
/* remove domain from "domain\username" */
-@@ -574,23 +574,11 @@ ascii2unicode(char ascii[], int ascii_len, u_char unicode[])
+@@ -575,23 +575,11 @@ ascii2unicode(char ascii[], int ascii_len, u_char unicode[])
static void
NTPasswordHash(u_char *secret, int secret_len, u_char hash[MD4_SIGNATURE_SIZE])
{
@@ -178,7 +200,7 @@ index c2bd00f9c6f7..19edb85d27a8 100644
}
-@@ -671,8 +659,8 @@ GenerateAuthenticatorResponse(u_char PasswordHashHash[MD4_SIGNATURE_SIZE],
+@@ -672,8 +660,8 @@ GenerateAuthenticatorResponse(u_char PasswordHashHash[MD4_SIGNATURE_SIZE],
0x6E };
int i;
@@ -189,7 +211,7 @@ index c2bd00f9c6f7..19edb85d27a8 100644
u_char Challenge[8];
SHA1_Init(&sha1Context);
-@@ -725,8 +713,8 @@ GenerateAuthenticatorResponsePlain
+@@ -726,8 +714,8 @@ GenerateAuthenticatorResponsePlain
void
mppe_set_keys(u_char *rchallenge, u_char PasswordHashHash[MD4_SIGNATURE_SIZE])
{
@@ -200,7 +222,7 @@ index c2bd00f9c6f7..19edb85d27a8 100644
SHA1_Init(&sha1Context);
SHA1_Update(&sha1Context, PasswordHashHash, MD4_SIGNATURE_SIZE);
-@@ -769,9 +757,9 @@ void
+@@ -770,9 +758,9 @@ void
mppe_set_keys2(u_char PasswordHashHash[MD4_SIGNATURE_SIZE],
u_char NTResponse[24], int IsServer)
{
@@ -214,24 +236,27 @@ index c2bd00f9c6f7..19edb85d27a8 100644
u_char SHApad1[40] =
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/pppd/eap.c b/pppd/eap.c
-index 032407c3dbb2..35d111015ff3 100644
+index 79146557bd32..d987888d9f20 100644
--- a/pppd/eap.c
+++ b/pppd/eap.c
-@@ -71,7 +71,7 @@
- #ifdef USE_EAPTLS
- #include "eap-tls.h"
- #else
--#include "md5.h"
+@@ -59,9 +59,10 @@
+ #include <assert.h>
+ #include <errno.h>
+
+#include <openssl/md5.h>
- #endif /* USE_EAPTLS */
++
+ #include "pppd.h"
+ #include "pathnames.h"
+-#include "md5.h"
+ #include "eap.h"
- #ifdef USE_SRP
+ #ifdef CHAPMS
diff --git a/pppd/md4.c b/pppd/md4.c
deleted file mode 100644
-index d943e8885f2d..000000000000
+index 42a9b2e75d6e..000000000000
--- a/pppd/md4.c
+++ /dev/null
-@@ -1,299 +0,0 @@
+@@ -1,290 +0,0 @@
-/*
-** ********************************************************************
-** md4.c -- Implementation of MD4 Message Digest Algorithm **
@@ -321,8 +346,7 @@ index d943e8885f2d..000000000000
-** This is a user-callable routine.
-*/
-void
--MD4Print(MDp)
--MD4_CTX *MDp;
+-MD4Print(MD4_CTX *MDp)
-{
- int i,j;
- for (i=0;i<4;i++)
@@ -335,8 +359,7 @@ index d943e8885f2d..000000000000
-** This is a user-callable routine.
-*/
-void
--MD4Init(MDp)
--MD4_CTX *MDp;
+-MD4Init(MD4_CTX *MDp)
-{
- int i;
- MDp->buffer[0] = I0;
@@ -354,9 +377,7 @@ index d943e8885f2d..000000000000
-** This routine is not user-callable.
-*/
-static void
--MDblock(MDp,Xb)
--MD4_CTX *MDp;
--unsigned char *Xb;
+-MDblock(MD4_CTX *MDp, unsigned char *Xb)
-{
- register unsigned int tmp, A, B, C, D;
- unsigned int X[16];
@@ -440,10 +461,7 @@ index d943e8885f2d..000000000000
-** if desired.
-*/
-void
--MD4Update(MDp,X,count)
--MD4_CTX *MDp;
--unsigned char *X;
--unsigned int count;
+-MD4Update(MD4_CTX *MDp, unsigned char *X, unsigned int count)
-{
- unsigned int i, tmp, bit, byte, mask;
- unsigned char XX[64];
@@ -511,9 +529,7 @@ index d943e8885f2d..000000000000
-** Finish up MD4 computation and return message digest.
-*/
-void
--MD4Final(buf, MD)
--unsigned char *buf;
--MD4_CTX *MD;
+-MD4Final(unsigned char *buf, MD4_CTX *MD)
-{
- int i, j;
- unsigned int w;
@@ -533,10 +549,10 @@ index d943e8885f2d..000000000000
-****************************(cut)***********************************/
diff --git a/pppd/md4.h b/pppd/md4.h
deleted file mode 100644
-index 80e8f9a2acca..000000000000
+index b6fc3f561faa..000000000000
--- a/pppd/md4.h
+++ /dev/null
-@@ -1,64 +0,0 @@
+@@ -1,55 +0,0 @@
-
-/*
-** ********************************************************************
@@ -547,15 +563,6 @@ index 80e8f9a2acca..000000000000
-** ********************************************************************
-*/
-
--#ifndef __P
--# if defined(__STDC__) || defined(__GNUC__)
--# define __P(x) x
--# else
--# define __P(x) ()
--# endif
--#endif
--
--
-/* MDstruct is the data structure for a message digest computation.
-*/
-typedef struct {
@@ -568,7 +575,7 @@ index 80e8f9a2acca..000000000000
-** Initialize the MD4_CTX prepatory to doing a message digest
-** computation.
-*/
--extern void MD4Init __P((MD4_CTX *MD));
+-extern void MD4Init(MD4_CTX *MD);
-
-/* MD4Update(MD,X,count)
-** Input: X -- a pointer to an array of unsigned characters.
@@ -582,7 +589,7 @@ index 80e8f9a2acca..000000000000
-** every MD computation should end with one call to MD4Update with a
-** count less than 512. Zero is OK for a count.
-*/
--extern void MD4Update __P((MD4_CTX *MD, unsigned char *X, unsigned int count));
+-extern void MD4Update(MD4_CTX *MD, unsigned char *X, unsigned int count);
-
-/* MD4Print(MD)
-** Prints message digest buffer MD as 32 hexadecimal digits.
@@ -590,23 +597,23 @@ index 80e8f9a2acca..000000000000
-** of buffer[3].
-** Each byte is printed with high-order hexadecimal digit first.
-*/
--extern void MD4Print __P((MD4_CTX *));
+-extern void MD4Print(MD4_CTX *);
-
-/* MD4Final(buf, MD)
-** Returns message digest from MD and terminates the message
-** digest computation.
-*/
--extern void MD4Final __P((unsigned char *, MD4_CTX *));
+-extern void MD4Final(unsigned char *, MD4_CTX *);
-
-/*
-** End of md4.h
-****************************(cut)***********************************/
diff --git a/pppd/md5.c b/pppd/md5.c
deleted file mode 100644
-index 6f8f7207c592..000000000000
+index f7988e64141a..000000000000
--- a/pppd/md5.c
+++ /dev/null
-@@ -1,311 +0,0 @@
+@@ -1,299 +0,0 @@
-
-
-/*
@@ -642,8 +649,6 @@ index 6f8f7207c592..000000000000
- ***********************************************************************
- */
-
--#ifndef USE_EAPTLS
--
-#include <string.h>
-#include "md5.h"
-
@@ -713,8 +718,7 @@ index 6f8f7207c592..000000000000
-/* The routine MD5_Init initializes the message-digest context
- mdContext. All fields are set to zero.
- */
--void MD5_Init (mdContext)
--MD5_CTX *mdContext;
+-void MD5_Init (MD5_CTX *mdContext)
-{
- mdContext->i[0] = mdContext->i[1] = (UINT4)0;
-
@@ -730,10 +734,7 @@ index 6f8f7207c592..000000000000
- account for the presence of each of the characters inBuf[0..inLen-1]
- in the message whose digest is being computed.
- */
--void MD5_Update (mdContext, inBuf, inLen)
--MD5_CTX *mdContext;
--unsigned char *inBuf;
--unsigned int inLen;
+-void MD5_Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen)
-{
- UINT4 in[16];
- int mdi;
@@ -768,9 +769,7 @@ index 6f8f7207c592..000000000000
-/* The routine MD5Final terminates the message-digest computation and
- ends with the desired message digest in mdContext->digest[0...15].
- */
--void MD5_Final (hash, mdContext)
--unsigned char hash[];
--MD5_CTX *mdContext;
+-void MD5_Final (unsigned char hash[], MD5_CTX *mdContext)
-{
- UINT4 in[16];
- int mdi;
@@ -811,9 +810,7 @@ index 6f8f7207c592..000000000000
-
-/* Basic MD5 step. Transforms buf based on in.
- */
--static void Transform (buf, in)
--UINT4 *buf;
--UINT4 *in;
+-static void Transform (UINT4 *buf, UINT4 *in)
-{
- UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3];
-
@@ -916,14 +913,12 @@ index 6f8f7207c592..000000000000
- ** End of md5.c **
- ******************************** (cut) ********************************
- */
--#endif /* USE_EAPTLS */
--
diff --git a/pppd/md5.h b/pppd/md5.h
deleted file mode 100644
-index 14d712171c5e..000000000000
+index 71e8b00e2dde..000000000000
--- a/pppd/md5.h
+++ /dev/null
-@@ -1,68 +0,0 @@
+@@ -1,65 +0,0 @@
-/*
- ***********************************************************************
- ** md5.h -- header file for implementation of MD5 **
@@ -962,7 +957,6 @@ index 14d712171c5e..000000000000
- ** documentation and/or software. **
- ***********************************************************************
- */
--#ifndef USE_EAPTLS
-
-#ifndef __MD5_INCLUDE__
-
@@ -990,8 +984,6 @@ index 14d712171c5e..000000000000
-
-#define __MD5_INCLUDE__
-#endif /* __MD5_INCLUDE__ */
--
--#endif /* USE_EAPTLS */
diff --git a/pppd/plugins/radius/md5.c b/pppd/plugins/radius/md5.c
index 8af03aa3713e..90d9b025d211 100644
--- a/pppd/plugins/radius/md5.c
@@ -1006,7 +998,7 @@ index 8af03aa3713e..90d9b025d211 100644
void rc_md5_calc (unsigned char *output, unsigned char *input, unsigned int inlen)
{
diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c
-index 06e00590b635..60282d9b2b9c 100644
+index c5798316719a..d5d63698a6dc 100644
--- a/pppd/plugins/radius/radius.c
+++ b/pppd/plugins/radius/radius.c
@@ -31,7 +31,7 @@ static char const RCSID[] =
@@ -1019,7 +1011,7 @@ index 06e00590b635..60282d9b2b9c 100644
#endif
#include "radiusclient.h"
diff --git a/pppd/plugins/winbind.c b/pppd/plugins/winbind.c
-index bb05acd87dce..5f87a317b677 100644
+index 0c395c34711a..6320645ac994 100644
--- a/pppd/plugins/winbind.c
+++ b/pppd/plugins/winbind.c
@@ -38,7 +38,7 @@
@@ -1033,10 +1025,10 @@ index bb05acd87dce..5f87a317b677 100644
#include "ipcp.h"
diff --git a/pppd/sha1.c b/pppd/sha1.c
deleted file mode 100644
-index f4f975cf516f..000000000000
+index 4e51cee506c2..000000000000
--- a/pppd/sha1.c
+++ /dev/null
-@@ -1,170 +0,0 @@
+@@ -1,171 +0,0 @@
-/*
- * ftp://ftp.funet.fi/pub/crypt/hash/sha/sha1.c
- *
@@ -1056,6 +1048,7 @@ index f4f975cf516f..000000000000
-/* #define SHA1HANDSOFF * Copies data before messing with it. */
-
-#include <string.h>
+-#include <time.h>
-#include <netinet/in.h> /* htonl() */
-#include <net/ppp_defs.h>
-#include "sha1.h"
diff --git a/patches/ppp-2.4.7/0100-pppd-make-makefile-sysroot-aware.patch b/patches/ppp-2.4.9/0200-pppd-make-makefile-sysroot-aware.patch
index c205b15ed..11020e0cc 100644
--- a/patches/ppp-2.4.7/0100-pppd-make-makefile-sysroot-aware.patch
+++ b/patches/ppp-2.4.9/0200-pppd-make-makefile-sysroot-aware.patch
@@ -13,14 +13,14 @@ Signed-off-by: Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- pppd/Makefile.linux | 10 ++++------
- 1 file changed, 4 insertions(+), 6 deletions(-)
+ pppd/Makefile.linux | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index cb9d4f9dcf22..ea0a7f02766b 100644
+index bc01e3fd2a24..9b0119463c1f 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
-@@ -103,8 +103,8 @@ endif
+@@ -111,8 +111,8 @@ endif
# EAP SRP-SHA1
ifdef USE_SRP
@@ -31,32 +31,12 @@ index cb9d4f9dcf22..ea0a7f02766b 100644
TARGETS += srp-entry
EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
MANPAGES += srp-entry.8
-@@ -114,7 +114,7 @@ endif
-
- # EAP-TLS
- ifdef USE_EAPTLS
--CFLAGS += -DUSE_EAPTLS=1 -I/usr/kerberos/include
-+CFLAGS += -DUSE_EAPTLS=1
- LIBS += -lssl
- PPPDSRC += eap-tls.c
- HEADERS += eap-tls.h
-@@ -126,10 +126,8 @@ CFLAGS += -DHAS_SHADOW
- #LIBS += -lshadow $(LIBS)
- endif
-
--ifneq ($(wildcard /usr/include/crypt.h),)
- CFLAGS += -DHAVE_CRYPT_H=1
- LIBS += -lcrypt
--endif
-
- ifdef USE_LIBUTIL
- CFLAGS += -DHAVE_LOGWTMP=1
-@@ -138,7 +136,7 @@ endif
+@@ -146,7 +146,7 @@ endif
ifdef NEEDDES
ifndef USE_CRYPT
--CFLAGS += -I/usr/include/openssl
+-CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
+CFLAGS += -I$(SYSROOT)/usr/include/openssl
- LIBS += -lcrypto
else
CFLAGS += -DUSE_CRYPT=1
+ endif
diff --git a/patches/ppp-2.4.7/0101-pppd-make-the-self-made-configure-cross-aware.patch b/patches/ppp-2.4.9/0201-pppd-make-the-self-made-configure-cross-aware.patch
index f57361a4c..590cf3ae4 100644
--- a/patches/ppp-2.4.7/0101-pppd-make-the-self-made-configure-cross-aware.patch
+++ b/patches/ppp-2.4.9/0201-pppd-make-the-self-made-configure-cross-aware.patch
@@ -11,11 +11,11 @@ Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
-index 6a55e0f08be4..3886564fa495 100755
+index b0c3d2b49122..4bc6a18fad32 100755
--- a/configure
+++ b/configure
-@@ -14,6 +14,16 @@ SYSCONF=/etc
- # fi
+@@ -15,6 +15,16 @@ release=`uname -r`
+ arch=`uname -m`
state="unknown"
+if [ -n $TARGET_OS ]; then
@@ -32,10 +32,10 @@ index 6a55e0f08be4..3886564fa495 100755
Linux)
makext="linux";
diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
-index bc29968d44c9..e010ad215981 100644
+index 6403e3d477e3..375be764e19a 100644
--- a/pppd/plugins/Makefile.linux
+++ b/pppd/plugins/Makefile.linux
-@@ -47,5 +47,5 @@ clean:
+@@ -49,5 +49,5 @@ clean:
for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean || exit $$?; done
depend:
diff --git a/patches/ppp-2.4.9/series b/patches/ppp-2.4.9/series
new file mode 100644
index 000000000..4028f0892
--- /dev/null
+++ b/patches/ppp-2.4.9/series
@@ -0,0 +1,17 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+#tag:upstream --start-number 1
+0001-configure-Allow-commas-in-the-CFLAGS-220.patch
+0002-pppd-Fix-compilation-with-older-glibc-or-kernel-head.patch
+#tag:debian --start-number 100
+0100-support-building-pppdump-with-the-system-zlib.patch
+0101-disable-unneeded-code-in-the-pppoatm-plugin.patch
+0102-pppoe_noads.patch
+0103-Forwarded-https-github.com-paulusmack-ppp-issues-187.patch
+0104-resolv.conf_no_log.patch
+0105-Debian-specific-changes.patch
+0106-Replace-vendored-hash-functions-with-libcrypto.patch
+#tag:ptx --start-number 200
+0200-pppd-make-makefile-sysroot-aware.patch
+0201-pppd-make-the-self-made-configure-cross-aware.patch
+# 9c9016a8956cf8c0dc84ee8dbe803cf3 - git-ptx-patches magic
diff --git a/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch b/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch
deleted file mode 100644
index 97498dc22..000000000
--- a/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-Date: Mon, 3 Dec 2018 13:55:02 +0100
-Subject: [PATCH] Makefile: fix installation to empty DESTDIR
-
-When DESTDIR is empty, or at least does not contain usr/bin or
-usr/include, the installation fails, because install does not create
-those intermediate directories:
-
-$ make DESTDIR=/tmp/koin install
-install -m 755 -t /tmp/koin/usr/bin ppsfind ppstest ppsctl ppswatch ppsldisc
-install: failed to access '/tmp/koin/usr/bin': No such file or directory
-
-Using the -D option of install fixes this:
-
-$ make DESTDIR=/tmp/koin install
-install -D -m 755 -t /tmp/koin/usr/bin ppsfind ppstest ppsctl ppswatch ppsldisc
-install -D -m 644 -t /tmp/koin/usr/include/sys timepps.h
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-Origin: upstream; https://github.com/redlab-i/pps-tools/commit/b3eae485a8c759d1ce1727076b2c287deb5f24e1
-Signed-off-by: Roland Hieber <rhi@pengutronix.de>
----
- Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 939466885e9f..30672f79585c 100644
---- a/Makefile
-+++ b/Makefile
-@@ -19,8 +19,8 @@ include .depend
- endif
-
- install : all
-- install -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
-- install -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
-+ install -D -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
-+ install -D -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
-
- uninstall :
- for f in $(TARGETS); do rm $(DESTDIR)/usr/bin/$$f; done
diff --git a/patches/pps-tools-1.0.2/series b/patches/pps-tools-1.0.2/series
deleted file mode 100644
index 7b3c77623..000000000
--- a/patches/pps-tools-1.0.2/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Makefile-fix-installation-to-empty-DESTDIR.patch
-# eb24c32ce10c0f011f2d37488c8de58c - git-ptx-patches magic
diff --git a/patches/pps-tools-1.0.3/0001-Makefile-Remove-obstructive-use-of-SYSROOT-variable.patch b/patches/pps-tools-1.0.3/0001-Makefile-Remove-obstructive-use-of-SYSROOT-variable.patch
new file mode 100644
index 000000000..6bb31aff6
--- /dev/null
+++ b/patches/pps-tools-1.0.3/0001-Makefile-Remove-obstructive-use-of-SYSROOT-variable.patch
@@ -0,0 +1,29 @@
+From: Christian Melki <christian.melki@t2data.com>
+Date: Sat, 29 Jan 2022 19:22:44 +0100
+Subject: [PATCH] Makefile: Remove obstructive use of SYSROOT variable.
+
+Ptxdist declares a SYSROOT env variable which is picked up here.
+But it is used as a cc --sysroot variable.
+This offsets searches for std headers and causes breakage.
+Remove it. Not needed.
+
+Signed-off-by: Christian Melki <christian.melki@t2data.com>
+---
+ Makefile | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index a57a325bc133..30672f79585c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,10 +3,6 @@ TARGETS = ppstest ppsctl ppswatch ppsldisc
+ CFLAGS += -Wall -O2 -D_GNU_SOURCE
+ CFLAGS += -ggdb
+ CFLAGS += -fPIC
+-ifdef SYSROOT
+-CFLAGS += --sysroot $(SYSROOT)
+-endif
+-
+ LDLIBS += -lm
+
+ # -- Actions section --
diff --git a/patches/pps-tools-1.0.3/series b/patches/pps-tools-1.0.3/series
new file mode 100644
index 000000000..8376d9c98
--- /dev/null
+++ b/patches/pps-tools-1.0.3/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Makefile-Remove-obstructive-use-of-SYSROOT-variable.patch
+# 7d2c06910f16bd177a79768e6f4195f6 - git-ptx-patches magic
diff --git a/patches/procps-ng-4.0.4/0001-build-sys-Add-systemd-elogind-to-w.patch b/patches/procps-ng-4.0.4/0001-build-sys-Add-systemd-elogind-to-w.patch
new file mode 100644
index 000000000..6eb5de4e1
--- /dev/null
+++ b/patches/procps-ng-4.0.4/0001-build-sys-Add-systemd-elogind-to-w.patch
@@ -0,0 +1,42 @@
+From: Craig Small <csmall@dropbear.xyz>
+Date: Thu, 31 Aug 2023 22:24:23 +1000
+Subject: [PATCH] build-sys: Add systemd/elogind to w
+
+Depending on the compiler flags, w needs to be explictly linked
+to libsystemd or elogind even though libproc2 is linked to it.
+
+Signed-off-by: Craig Small <csmall@dropbear.xyz>
+---
+ Makefile.am | 7 +++++++
+ NEWS | 3 +++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index f70c8fb1eb49..ddfc0141d869 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -149,6 +149,13 @@ endif
+
+ dist_man_MANS += man/w.1
+ src_w_SOURCES = src/w.c local/fileutils.c
++src_w_LDADD = $(LDADD)
++if WITH_SYSTEMD
++src_w_LDADD += @SYSTEMD_LIBS@
++endif
++if WITH_ELOGIND
++src_w_LDADD += @ELOGIND_LIBS@
++endif
+ else
+ EXTRA_DIST += man/w.1
+ endif
+diff --git a/NEWS b/NEWS
+index 3f2158d40683..4ad9f74e8c2e 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,3 +1,6 @@
++procps-ng-NEXT
++---------------
++
+ procps-ng-4.0.4
+ ---------------
+ * library (API & ABI unchanged)
diff --git a/patches/libtremor-1.0.3/autogen.sh b/patches/procps-ng-4.0.4/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/libtremor-1.0.3/autogen.sh
+++ b/patches/procps-ng-4.0.4/autogen.sh
diff --git a/patches/procps-ng-4.0.4/series b/patches/procps-ng-4.0.4/series
new file mode 100644
index 000000000..fecb289bb
--- /dev/null
+++ b/patches/procps-ng-4.0.4/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-build-sys-Add-systemd-elogind-to-w.patch
+# c14bc921db0bebb737d88875f00cb44f - git-ptx-patches magic
diff --git a/patches/pyDataMatrixScanner/0001-load-lib-from-global-dir.patch b/patches/pyDataMatrixScanner/0001-load-lib-from-global-dir.patch
deleted file mode 100644
index a0b6f1172..000000000
--- a/patches/pyDataMatrixScanner/0001-load-lib-from-global-dir.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 26 May 2011 18:46:14 +0200
-Subject: [PATCH] load lib from global dir
-
-The relative path does only work when the library is built in the same
-directory as the application, which is not the case if we install
-everything.
-
-Forwarded: no
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pyv4l2.py | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/pyv4l2.py b/pyv4l2.py
-index af0ccea..15b090a 100755
---- a/pyv4l2.py
-+++ b/pyv4l2.py
-@@ -10,7 +10,7 @@ import os
- import Image as PILImage
- from cStringIO import StringIO
-
--lib = cdll.LoadLibrary("./libpyv4l2.so")
-+lib = cdll.LoadLibrary("libpyv4l2.so")
- lib.Error.restype = c_char_p
- lib.MMap.restype = c_void_p
- lib.GetStandard.restype = c_longlong
---
-1.7.5.1
-
diff --git a/patches/pyDataMatrixScanner/series b/patches/pyDataMatrixScanner/series
deleted file mode 100644
index 39d8f8431..000000000
--- a/patches/pyDataMatrixScanner/series
+++ /dev/null
@@ -1,3 +0,0 @@
-# generated by git-ptx-patches
-0001-load-lib-from-global-dir.patch
-# c34c1f2acf1c5f61acbcdec0e33aadb8 - git-ptx-patches magic
diff --git a/patches/pyside-qt4.8+1.2.2/0001-only-add-qaccessibleevent_wrapper.cpp-if-accessible-.patch b/patches/pyside-qt4.8+1.2.2/0001-only-add-qaccessibleevent_wrapper.cpp-if-accessible-.patch
deleted file mode 100644
index d3575867c..000000000
--- a/patches/pyside-qt4.8+1.2.2/0001-only-add-qaccessibleevent_wrapper.cpp-if-accessible-.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 26 Jan 2011 01:20:31 +0100
-Subject: [PATCH] only add qaccessibleevent_wrapper.cpp if accessible is
- enabled
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- PySide/QtGui/CMakeLists.txt | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
-index 6e147067f8aa..94d4787d57ff 100644
---- a/PySide/QtGui/CMakeLists.txt
-+++ b/PySide/QtGui/CMakeLists.txt
-@@ -86,6 +86,13 @@ check_qt_class(QtGui QMacStyle QtGui_OPTIONAL_SRC QtGui_DROPPED
-
- qt4_wrap_cpp(QPYTEXTOBJECT_MOC "${pyside_SOURCE_DIR}/qpytextobject.h")
-
-+if (QT_QCONFIG MATCHES "accessibility")
-+set(QtGui_accessible_SRC
-+${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qaccessibleevent_wrapper.cpp)
-+else()
-+set(QtGui_accessible_SRC )
-+endif ()
-+
- set(QtGui_SRC
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractbutton_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractgraphicsshapeitem_wrapper.cpp
-@@ -98,7 +105,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractspinbox_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstracttextdocumentlayout_paintcontext_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstracttextdocumentlayout_selection_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstracttextdocumentlayout_wrapper.cpp
--${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qaccessibleevent_wrapper.cpp
-+${QtGui_accessible_SRC}
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qactionevent_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qactiongroup_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qaction_wrapper.cpp
diff --git a/patches/pyside-qt4.8+1.2.2/0002-add-include-iostream.patch b/patches/pyside-qt4.8+1.2.2/0002-add-include-iostream.patch
deleted file mode 100644
index 48c6b6b1b..000000000
--- a/patches/pyside-qt4.8+1.2.2/0002-add-include-iostream.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Fri, 28 Jan 2011 16:03:10 +0100
-Subject: [PATCH] add "#include <iostream>"
-
-Without it std::copy() is undefined when Qt is build without stl.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- libpyside/dynamicqmetaobject.cpp | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
-index e88e3dfdfcec..a2db462a0104 100644
---- a/libpyside/dynamicqmetaobject.cpp
-+++ b/libpyside/dynamicqmetaobject.cpp
-@@ -35,6 +35,7 @@
- #include <QLinkedList>
- #include <QObject>
- #include <cstring>
-+#include <iostream>
- #include <QDebug>
- #include <QMetaMethod>
- #include <shiboken.h>
diff --git a/patches/pyside-qt4.8+1.2.2/0003-add-qws-support.patch b/patches/pyside-qt4.8+1.2.2/0003-add-qws-support.patch
deleted file mode 100644
index ee13ed6e3..000000000
--- a/patches/pyside-qt4.8+1.2.2/0003-add-qws-support.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Mon, 20 Jun 2011 21:42:41 +0200
-Subject: [PATCH] add qws support
-
-based on a patch from OpenEmbedded:
-http://cgit.openembedded.net/cgit.cgi/openembedded/tree/recipes/pyside/python-pyside-embedded/support-qws.patch
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- CMakeLists.txt | 4 ++++
- PySide/QtCore/typesystem_core_qws.xml | 26 ++++++++++++++++++++++++++
- PySide/QtGui/typesystem_gui_common.xml | 2 ++
- PySide/QtGui/typesystem_gui_qws.xml | 26 ++++++++++++++++++++++++++
- 4 files changed, 58 insertions(+)
- create mode 100644 PySide/QtCore/typesystem_core_qws.xml
- create mode 100644 PySide/QtGui/typesystem_gui_qws.xml
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 9e0e3d07e2e3..0e7d85025376 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -88,6 +88,7 @@ set(ENABLE_X11 "0")
- set(ENABLE_MAC "0")
- set(ENABLE_WIN "0")
- set(ENABLE_SIMULATOR "0")
-+set(ENABLE_QWS "0")
- if(Q_WS_X11)
- set(ENABLE_X11 "1")
- if(Q_WS_MAEMO_5)
-@@ -104,6 +105,9 @@ elseif(Q_WS_WIN)
- elseif(Q_WS_SIMULATOR)
- set(ENABLE_SIMULATOR "1")
- set(AUTO_OS "simulator")
-+elseif(Q_WS_QWS)
-+ set(ENABLE_QWS "1")
-+ set(AUTO_OS "qws")
- else()
- message(FATAL_ERROR "OS not supported")
- endif()
-diff --git a/PySide/QtCore/typesystem_core_qws.xml b/PySide/QtCore/typesystem_core_qws.xml
-new file mode 100644
-index 000000000000..eba223c73097
---- /dev/null
-+++ b/PySide/QtCore/typesystem_core_qws.xml
-@@ -0,0 +1,26 @@
-+<?xml version="1.0"?>
-+<!--
-+ This file is part of PySide project.
-+ Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-+ Contact: PySide team <contact@pyside.org>
-+
-+ This library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ This library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with this library; if not, write to the Free Software
-+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+-->
-+<typesystem package="PySide.QtCore">
-+ <primitive-type name="Qt::HANDLE" target-lang-api-name="PyLong">
-+ <!-- FIXME APIExtractor or shiboken do not support multiple includes by primitive type -->
-+ <include file-name="QTextDocument" location="global"/>
-+ </primitive-type>
-+</typesystem>
-diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
-index 711d7cc3a352..e7d00eac6df8 100644
---- a/PySide/QtGui/typesystem_gui_common.xml
-+++ b/PySide/QtGui/typesystem_gui_common.xml
-@@ -5635,6 +5635,8 @@
- <modify-function signature="QApplication(int&amp;,char**,bool,int)" remove="all"/>
- <modify-function signature="QApplication(int&amp;,char**,QApplication::Type,int)" remove="all"/>
- <!-- ### -->
-+ <!-- QWS: FIXME: really fix this -->
-+ <modify-function signature="setArgs(int,char**)" remove="all"/>
-
- <!-- ownership control transfer to qApp -->
- <modify-function signature="setStyle(QStyle*)">
-diff --git a/PySide/QtGui/typesystem_gui_qws.xml b/PySide/QtGui/typesystem_gui_qws.xml
-new file mode 100644
-index 000000000000..d4a4793ad496
---- /dev/null
-+++ b/PySide/QtGui/typesystem_gui_qws.xml
-@@ -0,0 +1,26 @@
-+<?xml version="1.0"?>
-+<!--
-+ This file is part of PySide project.
-+ Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-+ Contact: PySide team <contact@pyside.org>
-+
-+ This library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ This library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with this library; if not, write to the Free Software
-+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+-->
-+<typesystem package="PySide.QtGui">
-+ <value-type name="QCursor">
-+ <!-- Does not exist on QWS -->
-+ <modify-function signature="QCursor(Qt::HANDLE)" remove="all"/>
-+ </value-type>
-+</typesystem>
diff --git a/patches/pyside-qt4.8+1.2.2/series b/patches/pyside-qt4.8+1.2.2/series
deleted file mode 100644
index cce9c351b..000000000
--- a/patches/pyside-qt4.8+1.2.2/series
+++ /dev/null
@@ -1,6 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-only-add-qaccessibleevent_wrapper.cpp-if-accessible-.patch
-0002-add-include-iostream.patch
-0003-add-qws-support.patch
-# edb0310fe7e30ecdc0404f3b02598af7 - git-ptx-patches magic
diff --git a/patches/python_rplicmp-1.0/0001-build-files-correctly.patch b/patches/python_rplicmp-1.0/0001-build-files-correctly.patch
deleted file mode 100644
index 5f314751c..000000000
--- a/patches/python_rplicmp-1.0/0001-build-files-correctly.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 4 Jun 2015 22:04:44 +0200
-Subject: [PATCH] build files correctly
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- setup.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index c06dd85be917..b18627353ebd 100644
---- a/setup.py
-+++ b/setup.py
-@@ -4,8 +4,8 @@ from Cython.Distutils import build_ext
-
- ext_modules=[
- Extension("RplIcmp",
-- ["RplIcmp.pyx", "tinyICMPlib.pxd"],
-- extra_link_args=["caplib.o", "icmplib.o", "-lcap"],
-+ ["RplIcmp.pyx", "tinyICMPlib.pxd", "caplib.c", "icmplib.c"],
-+ extra_link_args=["-lcap"],
- )
- ]
-
diff --git a/patches/python_rplicmp-1.0/series b/patches/python_rplicmp-1.0/series
deleted file mode 100644
index 5f447e6ab..000000000
--- a/patches/python_rplicmp-1.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-build-files-correctly.patch
-# 6a48180e8222a7764da81c77cb9dd128 - git-ptx-patches magic
diff --git a/patches/pytz-2020.1/0001-use-system-timezone-data.patch b/patches/pytz-2023.3/0001-use-system-timezone-data.patch
index 113ff9ae9..113ff9ae9 100644
--- a/patches/pytz-2020.1/0001-use-system-timezone-data.patch
+++ b/patches/pytz-2023.3/0001-use-system-timezone-data.patch
diff --git a/patches/pytz-2020.1/series b/patches/pytz-2023.3/series
index 5e91bdc15..5e91bdc15 100644
--- a/patches/pytz-2020.1/series
+++ b/patches/pytz-2023.3/series
diff --git a/patches/pyyaml-3.12/0001-setup.py-remove-overcomplicated-setup-resulting-in-w.patch b/patches/pyyaml-3.12/0001-setup.py-remove-overcomplicated-setup-resulting-in-w.patch
deleted file mode 100644
index af96199ab..000000000
--- a/patches/pyyaml-3.12/0001-setup.py-remove-overcomplicated-setup-resulting-in-w.patch
+++ /dev/null
@@ -1,324 +0,0 @@
-From: Bastian Stender <bst@pengutronix.de>
-Date: Mon, 29 Jan 2018 16:18:38 +0100
-Subject: [PATCH] setup.py: remove overcomplicated setup resulting in wrong
- paths
-
-All these checks are unnecessary with ptxdist. These checks make
-wrong assumptions about install paths resulting in absolute paths
-concatenated to DistroKit/platform-qemu/packages/pyyaml-3.12/.
-
-Signed-off-by: Bastian Stender <bst@pengutronix.de>
----
- setup.py | 290 +++------------------------------------------------------------
- 1 file changed, 10 insertions(+), 280 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index 9dc5e8d4855a..d65b5a7b46c2 100644
---- a/setup.py
-+++ b/setup.py
-@@ -35,281 +35,11 @@ CLASSIFIERS = [
- "Topic :: Text Processing :: Markup",
- ]
-
-+from distutils.core import setup
-+from distutils.extension import Extension
-+from Cython.Distutils import build_ext
-
--LIBYAML_CHECK = """
--#include <yaml.h>
--
--int main(void) {
-- yaml_parser_t parser;
-- yaml_emitter_t emitter;
--
-- yaml_parser_initialize(&parser);
-- yaml_parser_delete(&parser);
--
-- yaml_emitter_initialize(&emitter);
-- yaml_emitter_delete(&emitter);
--
-- return 0;
--}
--"""
--
--
--import sys, os.path, platform
--
--from distutils import log
--from distutils.core import setup, Command
--from distutils.core import Distribution as _Distribution
--from distutils.core import Extension as _Extension
--from distutils.dir_util import mkpath
--from distutils.command.build_ext import build_ext as _build_ext
--from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm
--from distutils.errors import DistutilsError, CompileError, LinkError, DistutilsPlatformError
--
--if 'setuptools.extension' in sys.modules:
-- _Extension = sys.modules['setuptools.extension']._Extension
-- sys.modules['distutils.core'].Extension = _Extension
-- sys.modules['distutils.extension'].Extension = _Extension
-- sys.modules['distutils.command.build_ext'].Extension = _Extension
--
--with_cython = False
--try:
-- from Cython.Distutils.extension import Extension as _Extension
-- from Cython.Distutils import build_ext as _build_ext
-- with_cython = True
--except ImportError:
-- pass
--
--try:
-- from wheel.bdist_wheel import bdist_wheel
--except ImportError:
-- bdist_wheel = None
--
--
--class Distribution(_Distribution):
--
-- def __init__(self, attrs=None):
-- _Distribution.__init__(self, attrs)
-- if not self.ext_modules:
-- return
-- for idx in range(len(self.ext_modules)-1, -1, -1):
-- ext = self.ext_modules[idx]
-- if not isinstance(ext, Extension):
-- continue
-- setattr(self, ext.attr_name, None)
-- self.global_options = [
-- (ext.option_name, None,
-- "include %s (default if %s is available)"
-- % (ext.feature_description, ext.feature_name)),
-- (ext.neg_option_name, None,
-- "exclude %s" % ext.feature_description),
-- ] + self.global_options
-- self.negative_opt = self.negative_opt.copy()
-- self.negative_opt[ext.neg_option_name] = ext.option_name
--
-- def has_ext_modules(self):
-- if not self.ext_modules:
-- return False
-- for ext in self.ext_modules:
-- with_ext = self.ext_status(ext)
-- if with_ext is None or with_ext:
-- return True
-- return False
--
-- def ext_status(self, ext):
-- implementation = platform.python_implementation()
-- if implementation != 'CPython':
-- return False
-- if isinstance(ext, Extension):
-- with_ext = getattr(self, ext.attr_name)
-- return with_ext
-- else:
-- return True
--
--
--class Extension(_Extension):
--
-- def __init__(self, name, sources, feature_name, feature_description,
-- feature_check, **kwds):
-- if not with_cython:
-- for filename in sources[:]:
-- base, ext = os.path.splitext(filename)
-- if ext == '.pyx':
-- sources.remove(filename)
-- sources.append('%s.c' % base)
-- _Extension.__init__(self, name, sources, **kwds)
-- self.feature_name = feature_name
-- self.feature_description = feature_description
-- self.feature_check = feature_check
-- self.attr_name = 'with_' + feature_name.replace('-', '_')
-- self.option_name = 'with-' + feature_name
-- self.neg_option_name = 'without-' + feature_name
--
--
--class build_ext(_build_ext):
--
-- def run(self):
-- optional = True
-- disabled = True
-- for ext in self.extensions:
-- with_ext = self.distribution.ext_status(ext)
-- if with_ext is None:
-- disabled = False
-- elif with_ext:
-- optional = False
-- disabled = False
-- break
-- if disabled:
-- return
-- try:
-- _build_ext.run(self)
-- except DistutilsPlatformError:
-- exc = sys.exc_info()[1]
-- if optional:
-- log.warn(str(exc))
-- log.warn("skipping build_ext")
-- else:
-- raise
--
-- def get_source_files(self):
-- self.check_extensions_list(self.extensions)
-- filenames = []
-- for ext in self.extensions:
-- if with_cython:
-- self.cython_sources(ext.sources, ext)
-- for filename in ext.sources:
-- filenames.append(filename)
-- base = os.path.splitext(filename)[0]
-- for ext in ['c', 'h', 'pyx', 'pxd']:
-- filename = '%s.%s' % (base, ext)
-- if filename not in filenames and os.path.isfile(filename):
-- filenames.append(filename)
-- return filenames
--
-- def get_outputs(self):
-- self.check_extensions_list(self.extensions)
-- outputs = []
-- for ext in self.extensions:
-- fullname = self.get_ext_fullname(ext.name)
-- filename = os.path.join(self.build_lib,
-- self.get_ext_filename(fullname))
-- if os.path.isfile(filename):
-- outputs.append(filename)
-- return outputs
--
-- def build_extensions(self):
-- self.check_extensions_list(self.extensions)
-- for ext in self.extensions:
-- with_ext = self.distribution.ext_status(ext)
-- if with_ext is None:
-- with_ext = self.check_extension_availability(ext)
-- if not with_ext:
-- continue
-- if with_cython:
-- ext.sources = self.cython_sources(ext.sources, ext)
-- self.build_extension(ext)
--
-- def check_extension_availability(self, ext):
-- cache = os.path.join(self.build_temp, 'check_%s.out' % ext.feature_name)
-- if not self.force and os.path.isfile(cache):
-- data = open(cache).read().strip()
-- if data == '1':
-- return True
-- elif data == '0':
-- return False
-- mkpath(self.build_temp)
-- src = os.path.join(self.build_temp, 'check_%s.c' % ext.feature_name)
-- open(src, 'w').write(ext.feature_check)
-- log.info("checking if %s is compilable" % ext.feature_name)
-- try:
-- [obj] = self.compiler.compile([src],
-- macros=ext.define_macros+[(undef,) for undef in ext.undef_macros],
-- include_dirs=ext.include_dirs,
-- extra_postargs=(ext.extra_compile_args or []),
-- depends=ext.depends)
-- except CompileError:
-- log.warn("")
-- log.warn("%s is not found or a compiler error: forcing --%s"
-- % (ext.feature_name, ext.neg_option_name))
-- log.warn("(if %s is installed correctly, you may need to"
-- % ext.feature_name)
-- log.warn(" specify the option --include-dirs or uncomment and")
-- log.warn(" modify the parameter include_dirs in setup.cfg)")
-- open(cache, 'w').write('0\n')
-- return False
-- prog = 'check_%s' % ext.feature_name
-- log.info("checking if %s is linkable" % ext.feature_name)
-- try:
-- self.compiler.link_executable([obj], prog,
-- output_dir=self.build_temp,
-- libraries=ext.libraries,
-- library_dirs=ext.library_dirs,
-- runtime_library_dirs=ext.runtime_library_dirs,
-- extra_postargs=(ext.extra_link_args or []))
-- except LinkError:
-- log.warn("")
-- log.warn("%s is not found or a linker error: forcing --%s"
-- % (ext.feature_name, ext.neg_option_name))
-- log.warn("(if %s is installed correctly, you may need to"
-- % ext.feature_name)
-- log.warn(" specify the option --library-dirs or uncomment and")
-- log.warn(" modify the parameter library_dirs in setup.cfg)")
-- open(cache, 'w').write('0\n')
-- return False
-- open(cache, 'w').write('1\n')
-- return True
--
--
--class bdist_rpm(_bdist_rpm):
--
-- def _make_spec_file(self):
-- argv0 = sys.argv[0]
-- features = []
-- for ext in self.distribution.ext_modules:
-- if not isinstance(ext, Extension):
-- continue
-- with_ext = getattr(self.distribution, ext.attr_name)
-- if with_ext is None:
-- continue
-- if with_ext:
-- features.append('--'+ext.option_name)
-- else:
-- features.append('--'+ext.neg_option_name)
-- sys.argv[0] = ' '.join([argv0]+features)
-- spec_file = _bdist_rpm._make_spec_file(self)
-- sys.argv[0] = argv0
-- return spec_file
--
--
--class test(Command):
--
-- user_options = []
--
-- def initialize_options(self):
-- pass
--
-- def finalize_options(self):
-- pass
--
-- def run(self):
-- build_cmd = self.get_finalized_command('build')
-- build_cmd.run()
-- sys.path.insert(0, build_cmd.build_lib)
-- if sys.version_info[0] < 3:
-- sys.path.insert(0, 'tests/lib')
-- else:
-- sys.path.insert(0, 'tests/lib3')
-- import test_all
-- if not test_all.main([]):
-- raise DistutilsError("Tests failed")
--
--
--cmdclass = {
-- 'build_ext': build_ext,
-- 'bdist_rpm': bdist_rpm,
-- 'test': test,
--}
--if bdist_wheel:
-- cmdclass['bdist_wheel'] = bdist_wheel
-+import sys, os.path
-
-
- if __name__ == '__main__':
-@@ -329,13 +59,13 @@ if __name__ == '__main__':
-
- package_dir={'': {2: 'lib', 3: 'lib3'}[sys.version_info[0]]},
- packages=['yaml'],
-- ext_modules=[
-- Extension('_yaml', ['ext/_yaml.pyx'],
-- 'libyaml', "LibYAML bindings", LIBYAML_CHECK,
-- libraries=['yaml']),
-+
-+ ext_modules = [
-+ Extension( "_yaml", ["ext/_yaml.pyx"], libraries = ["yaml"] )
- ],
-
-- distclass=Distribution,
-- cmdclass=cmdclass,
-+ cmdclass={
-+ 'build_ext': build_ext,
-+ },
- )
-
diff --git a/patches/pyyaml-3.12/series b/patches/pyyaml-3.12/series
deleted file mode 100644
index 03ecdd494..000000000
--- a/patches/pyyaml-3.12/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-setup.py-remove-overcomplicated-setup-resulting-in-w.patch
-# 0889f93d4365cb044851381b29479e78 - git-ptx-patches magic
diff --git a/patches/pyzmq-14.1.0/0001-HACK-setup.py-avoid-rpath-with-sysroot.patch b/patches/pyzmq-14.1.0/0001-HACK-setup.py-avoid-rpath-with-sysroot.patch
deleted file mode 100644
index 3df3af6d5..000000000
--- a/patches/pyzmq-14.1.0/0001-HACK-setup.py-avoid-rpath-with-sysroot.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 20 May 2017 19:05:18 +0200
-Subject: [PATCH] HACK: setup.py: avoid rpath with sysroot
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- setup.py | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index 6cb58a3fedd9..ca348f89fd50 100755
---- a/setup.py
-+++ b/setup.py
-@@ -217,10 +217,6 @@ def settings_from_prefix(prefix=None, bundle_libzmq_dylib=False):
- # settings['extra_link_args'] = ['-Wl,-rpath','-Wl,$ORIGIN/..']
- else:
- settings['runtime_library_dirs'] += ['$ORIGIN/..']
-- elif sys.platform != 'darwin':
-- settings['runtime_library_dirs'] += [
-- os.path.abspath(x) for x in settings['library_dirs']
-- ]
-
- return settings
-
diff --git a/patches/pyzmq-14.1.0/series b/patches/pyzmq-14.1.0/series
deleted file mode 100644
index 6404f91be..000000000
--- a/patches/pyzmq-14.1.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-HACK-setup.py-avoid-rpath-with-sysroot.patch
-# 70c3d355f2a155d9a0207f0f2f054e39 - git-ptx-patches magic
diff --git a/patches/qemu-5.2.0/series b/patches/qemu-5.2.0/series
deleted file mode 100644
index 1391c59a3..000000000
--- a/patches/qemu-5.2.0/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-9pfs-allow-real-symlinks-for-security_model-mapped-f.patch
-0002-let-ninja-use-the-jobserver.patch
-# 6589ce05416d41350e29bf44a65fb980 - git-ptx-patches magic
diff --git a/patches/qemu-8.2.2/0001-linux-user-x86_64-Handle-the-vsyscall-page-in-open_s.patch b/patches/qemu-8.2.2/0001-linux-user-x86_64-Handle-the-vsyscall-page-in-open_s.patch
new file mode 100644
index 000000000..a91a32996
--- /dev/null
+++ b/patches/qemu-8.2.2/0001-linux-user-x86_64-Handle-the-vsyscall-page-in-open_s.patch
@@ -0,0 +1,57 @@
+From 4ef1f559f270c66b3ffc23f6c845ff3d008c6356 Mon Sep 17 00:00:00 2001
+From: Richard Henderson <richard.henderson@linaro.org>
+Date: Sat, 24 Feb 2024 02:29:41 +0000
+Subject: [PATCH] linux-user/x86_64: Handle the vsyscall page in
+ open_self_maps_{2,4}
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is the only case in which we expect to have no host memory backing
+for a guest memory page, because in general linux user processes cannot
+map any pages in the top half of the 64-bit address space.
+
+Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2170
+Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
+Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
+---
+ linux-user/syscall.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index e384e1424890..bc8c06522f88 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -7994,6 +7994,10 @@ static void open_self_maps_4(const struct open_self_maps_data *d,
+ path = "[heap]";
+ } else if (start == info->vdso) {
+ path = "[vdso]";
++#ifdef TARGET_X86_64
++ } else if (start == TARGET_VSYSCALL_PAGE) {
++ path = "[vsyscall]";
++#endif
+ }
+
+ /* Except null device (MAP_ANON), adjust offset for this fragment. */
+@@ -8082,6 +8086,18 @@ static int open_self_maps_2(void *opaque, target_ulong guest_start,
+ uintptr_t host_start = (uintptr_t)g2h_untagged(guest_start);
+ uintptr_t host_last = (uintptr_t)g2h_untagged(guest_end - 1);
+
++#ifdef TARGET_X86_64
++ /*
++ * Because of the extremely high position of the page within the guest
++ * virtual address space, this is not backed by host memory at all.
++ * Therefore the loop below would fail. This is the only instance
++ * of not having host backing memory.
++ */
++ if (guest_start == TARGET_VSYSCALL_PAGE) {
++ return open_self_maps_3(opaque, guest_start, guest_end, flags);
++ }
++#endif
++
+ while (1) {
+ IntervalTreeNode *n =
+ interval_tree_iter_first(d->host_maps, host_start, host_start);
+--
+2.39.2
+
diff --git a/patches/qemu-5.2.0/0001-9pfs-allow-real-symlinks-for-security_model-mapped-f.patch b/patches/qemu-8.2.2/0100-9pfs-allow-real-symlinks-for-security_model-mapped-f.patch
index b4107d92a..46b75f8a9 100644
--- a/patches/qemu-5.2.0/0001-9pfs-allow-real-symlinks-for-security_model-mapped-f.patch
+++ b/patches/qemu-8.2.2/0100-9pfs-allow-real-symlinks-for-security_model-mapped-f.patch
@@ -7,14 +7,14 @@ same filesystem with security_model=mapped-file and security_model=none.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
- hw/9pfs/9p-local.c | 44 +++++++++++++++++++++++++++++---------------
- 1 file changed, 29 insertions(+), 15 deletions(-)
+ hw/9pfs/9p-local.c | 40 +++++++++++++++++++++++++++-------------
+ 1 file changed, 27 insertions(+), 13 deletions(-)
diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
-index af52c1daac85..94595b2009f8 100644
+index 1b1f3b9ec81e..d900dccaacb1 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
-@@ -455,8 +455,7 @@ static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
+@@ -462,8 +462,7 @@ static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
{
ssize_t tsize = -1;
@@ -24,15 +24,15 @@ index af52c1daac85..94595b2009f8 100644
int fd;
fd = local_open_nofollow(fs_ctx, fs_path->data, O_RDONLY, 0);
-@@ -468,6 +467,7 @@ static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
- } while (tsize == -1 && errno == EINTR);
+@@ -473,6 +472,7 @@ static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
+ tsize = RETRY_ON_EINTR(read(fd, (void *)buf, bufsz));
close_preserve_errno(fd);
} else if ((fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) ||
+ (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) ||
(fs_ctx->export_flags & V9FS_SM_NONE)) {
char *dirpath = g_path_get_dirname(fs_path->data);
char *name = g_path_get_basename(fs_path->data);
-@@ -479,6 +479,17 @@ static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
+@@ -484,6 +484,17 @@ static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
}
tsize = readlinkat(dirfd, name, buf, bufsz);
@@ -50,7 +50,7 @@ index af52c1daac85..94595b2009f8 100644
close_preserve_errno(dirfd);
out:
g_free(name);
-@@ -881,20 +892,23 @@ static int local_symlink(FsContext *fs_ctx, const char *oldpath,
+@@ -899,18 +910,21 @@ static int local_symlink(FsContext *fs_ctx, const char *oldpath,
int fd;
ssize_t oldpath_size, write_size;
@@ -61,9 +61,7 @@ index af52c1daac85..94595b2009f8 100644
- }
- /* Write the oldpath (target) to the file. */
- oldpath_size = strlen(oldpath);
-- do {
-- write_size = write(fd, (void *)oldpath, oldpath_size);
-- } while (write_size == -1 && errno == EINTR);
+- write_size = RETRY_ON_EINTR(write(fd, (void *)oldpath, oldpath_size));
- close_preserve_errno(fd);
+ if (fs_ctx->export_flags & V9FS_SM_MAPPED ||
+ (symlinkat(oldpath, dirfd, name) != 0)) {
@@ -74,9 +72,7 @@ index af52c1daac85..94595b2009f8 100644
+ }
+ /* Write the oldpath (target) to the file. */
+ oldpath_size = strlen(oldpath);
-+ do {
-+ write_size = write(fd, (void *)oldpath, oldpath_size);
-+ } while (write_size == -1 && errno == EINTR);
++ write_size = RETRY_ON_EINTR(write(fd, (void *)oldpath, oldpath_size));
+ close_preserve_errno(fd);
- if (write_size != oldpath_size) {
@@ -85,5 +81,5 @@ index af52c1daac85..94595b2009f8 100644
+ goto err_end;
+ }
}
- /* Set cleint credentials in symlink's xattr */
+ /* Set client credentials in symlink's xattr */
credp->fc_mode = credp->fc_mode | S_IFLNK;
diff --git a/patches/qemu-5.2.0/0002-let-ninja-use-the-jobserver.patch b/patches/qemu-8.2.2/0101-let-ninja-use-the-jobserver.patch
index f6c77ce16..a1524c1d9 100644
--- a/patches/qemu-5.2.0/0002-let-ninja-use-the-jobserver.patch
+++ b/patches/qemu-8.2.2/0101-let-ninja-use-the-jobserver.patch
@@ -11,15 +11,15 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index 76dbb917f5cd..031d1781ab31 100644
+index 5d48dfac18a3..61a291a95903 100644
--- a/Makefile
+++ b/Makefile
-@@ -151,7 +151,7 @@ MAKE.k = $(findstring k,$(firstword $(MAKEFLAGS)))
- MAKE.q = $(findstring q,$(firstword $(MAKEFLAGS)))
+@@ -142,7 +142,7 @@ MAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS))))
+ MAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS))))
MAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \
- $(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS)))) \
+ $(filter-out -j, $(lastword $(filter -l% -j%, $(MAKEFLAGS)))) \
-
+ -d keepdepfile
ninja-cmd-goals = $(or $(MAKECMDGOALS), all)
- ninja-cmd-goals += $(foreach t, $(.tests), $(.test.deps.$t))
+ ninja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))
diff --git a/patches/qemu-8.2.2/series b/patches/qemu-8.2.2/series
new file mode 100644
index 000000000..8912ba0c6
--- /dev/null
+++ b/patches/qemu-8.2.2/series
@@ -0,0 +1,8 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+#tag:upstream --start-number 1
+0001-linux-user-x86_64-Handle-the-vsyscall-page-in-open_s.patch
+#tag:ptxdist --start-number 100
+0100-9pfs-allow-real-symlinks-for-security_model-mapped-f.patch
+0101-let-ninja-use-the-jobserver.patch
+# e07b440a88f02f8ec66d73afd7a82c61 - git-ptx-patches magic
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0001-mkspec-for-ptxdist.patch b/patches/qt-everywhere-opensource-src-4.8.7/0001-mkspec-for-ptxdist.patch
deleted file mode 100644
index de80ee2f0..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0001-mkspec-for-ptxdist.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Fri, 8 Oct 2010 20:13:39 +0200
-Subject: [PATCH] mkspec for ptxdist
-
-Add a mkspec for ptxdist:
-- qplatformdefs.h
- Include the generic qplatformdefs.h
-- qmake.conf.in
- Used to generate qmake.conf with the correct toolchain.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- mkspecs/linux-ptx-g++/qmake.conf.in | 41 +++++++++++++++++++++++++++++++
- mkspecs/linux-ptx-g++/qplatformdefs.h | 2 ++
- mkspecs/qws/linux-ptx-g++/qmake.conf.in | 32 ++++++++++++++++++++++++
- mkspecs/qws/linux-ptx-g++/qplatformdefs.h | 2 ++
- 4 files changed, 77 insertions(+)
- create mode 100644 mkspecs/linux-ptx-g++/qmake.conf.in
- create mode 100644 mkspecs/linux-ptx-g++/qplatformdefs.h
- create mode 100644 mkspecs/qws/linux-ptx-g++/qmake.conf.in
- create mode 100644 mkspecs/qws/linux-ptx-g++/qplatformdefs.h
-
-diff --git a/mkspecs/linux-ptx-g++/qmake.conf.in b/mkspecs/linux-ptx-g++/qmake.conf.in
-new file mode 100644
-index 000000000000..c3e015018a7d
---- /dev/null
-+++ b/mkspecs/linux-ptx-g++/qmake.conf.in
-@@ -0,0 +1,41 @@
-+#
-+# qmake configuration for linux-ptx-g++
-+#
-+
-+
-+include(../common/gcc-base-unix.conf)
-+include(../common/g++-unix.conf)
-+include(../common/linux.conf)
-+
-+MAKEFILE_GENERATOR = UNIX
-+TEMPLATE = app
-+CONFIG += qt warn_on release incremental link_prl
-+QT += core gui network
-+QMAKE_INCREMENTAL_STYLE = sublib
-+
-+# modifications to g++.conf
-+QMAKE_CC = @COMPILER_PREFIX@gcc
-+QMAKE_CFLAGS = -pipe @CPPFLAGS@ @CFLAGS@
-+QMAKE_CXX = @COMPILER_PREFIX@g++
-+QMAKE_CXXFLAGS = -pipe @CPPFLAGS@ @CXXFLAGS@
-+QMAKE_INCDIR = @INCDIR@
-+QMAKE_LIBDIR = @LIBDIR@
-+
-+QMAKE_LINK = @COMPILER_PREFIX@g++
-+QMAKE_LINK_SHLIB = @COMPILER_PREFIX@g++
-+QMAKE_LFLAGS = @LDFLAGS@
-+
-+QMAKE_INCDIR_X11 =
-+QMAKE_LIBDIR_X11 =
-+QMAKE_INCDIR_OPENGL =
-+QMAKE_LIBDIR_OPENGL =
-+QMAKE_LIBS_OPENGL_ES1CL = @QMAKE_LIBS_OPENGL_ES1CL@
-+QMAKE_LIBS_OPENGL_ES1 = @QMAKE_LIBS_OPENGL_ES1@
-+QMAKE_LIBS_OPENGL_ES2 = @QMAKE_LIBS_OPENGL_ES2@
-+
-+# modifications to linux.conf
-+QMAKE_AR = @COMPILER_PREFIX@ar cqs
-+QMAKE_OBJCOPY = @COMPILER_PREFIX@objcopy
-+QMAKE_STRIP = @COMPILER_PREFIX@strip
-+
-+load(qt_config)
-diff --git a/mkspecs/linux-ptx-g++/qplatformdefs.h b/mkspecs/linux-ptx-g++/qplatformdefs.h
-new file mode 100644
-index 000000000000..05c77d16fda6
---- /dev/null
-+++ b/mkspecs/linux-ptx-g++/qplatformdefs.h
-@@ -0,0 +1,2 @@
-+
-+#include "../linux-g++/qplatformdefs.h"
-diff --git a/mkspecs/qws/linux-ptx-g++/qmake.conf.in b/mkspecs/qws/linux-ptx-g++/qmake.conf.in
-new file mode 100644
-index 000000000000..b52d5e730904
---- /dev/null
-+++ b/mkspecs/qws/linux-ptx-g++/qmake.conf.in
-@@ -0,0 +1,32 @@
-+#
-+# qmake configuration for linux-ptx-g++
-+#
-+
-+
-+include(../../common/gcc-base-unix.conf)
-+include(../../common/g++-unix.conf)
-+include(../../common/linux.conf)
-+include(../../common/qws.conf)
-+
-+# modifications to g++.conf
-+QMAKE_CC = @COMPILER_PREFIX@gcc
-+QMAKE_CFLAGS = -pipe @CPPFLAGS@ @CFLAGS@
-+QMAKE_CXX = @COMPILER_PREFIX@g++
-+QMAKE_CXXFLAGS = -pipe @CPPFLAGS@ @CXXFLAGS@
-+QMAKE_INCDIR = @INCDIR@
-+QMAKE_LIBDIR = @LIBDIR@
-+
-+QMAKE_LINK = @COMPILER_PREFIX@g++
-+QMAKE_LINK_SHLIB = @COMPILER_PREFIX@g++
-+QMAKE_LFLAGS = @LDFLAGS@
-+
-+QMAKE_LIBS_OPENGL_ES1CL = @QMAKE_LIBS_OPENGL_ES1CL@
-+QMAKE_LIBS_OPENGL_ES1 = @QMAKE_LIBS_OPENGL_ES1@
-+QMAKE_LIBS_OPENGL_ES2 = @QMAKE_LIBS_OPENGL_ES2@
-+
-+# modifications to linux.conf
-+QMAKE_AR = @COMPILER_PREFIX@ar cqs
-+QMAKE_OBJCOPY = @COMPILER_PREFIX@objcopy
-+QMAKE_STRIP = @COMPILER_PREFIX@strip
-+
-+load(qt_config)
-diff --git a/mkspecs/qws/linux-ptx-g++/qplatformdefs.h b/mkspecs/qws/linux-ptx-g++/qplatformdefs.h
-new file mode 100644
-index 000000000000..e10ebcfcc3d9
---- /dev/null
-+++ b/mkspecs/qws/linux-ptx-g++/qplatformdefs.h
-@@ -0,0 +1,2 @@
-+
-+#include "../../linux-g++/qplatformdefs.h"
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0002-disable-ordered-compiling.patch b/patches/qt-everywhere-opensource-src-4.8.7/0002-disable-ordered-compiling.patch
deleted file mode 100644
index 6a0027530..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0002-disable-ordered-compiling.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Fri, 8 Oct 2010 20:13:40 +0200
-Subject: [PATCH] disable ordered compiling.
-
-By default all modules are compiled in a predefined order. This breaks when
-building not all modules. This patch disables ordered building. As a result
-qmake generates the correct dependancies.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- examples/examples.pro | 4 ++++
- projects.pro | 1 -
- src/src.pro | 8 ++++++--
- 3 files changed, 10 insertions(+), 3 deletions(-)
-
-diff --git a/examples/examples.pro b/examples/examples.pro
-index f7d5306f54e2..67b4cf826a7c 100644
---- a/examples/examples.pro
-+++ b/examples/examples.pro
-@@ -51,6 +51,10 @@ contains(DEFINES, QT_NO_GESTURES): SUBDIRS -= gestures
- SUBDIRS += multimedia
- }
-
-+contains(QT_CONFIG, webkit) {
-+ SUBDIRS += webkit
-+}
-+
- contains(QT_CONFIG, script): SUBDIRS += script
-
- contains(QT_CONFIG, phonon):!static: SUBDIRS += phonon
-diff --git a/projects.pro b/projects.pro
-index a2bc4b3be1b5..839670d029e9 100644
---- a/projects.pro
-+++ b/projects.pro
-@@ -2,7 +2,6 @@
- # Main projectfile
- #####################################################################
-
--CONFIG += ordered
- TEMPLATE = subdirs
-
- cross_compile: CONFIG += nostrip
-diff --git a/src/src.pro b/src/src.pro
-index b9e48f418d0c..4b1cf0db0e4d 100644
---- a/src/src.pro
-+++ b/src/src.pro
-@@ -100,12 +100,13 @@ src_declarative.target = sub-declarative
- src_qt3support.depends = src_gui src_xml src_network src_sql
- src_tools_idc.depends = src_corelib # target defined in tools.pro
- src_tools_uic3.depends = src_qt3support src_xml # target defined in tools.pro
-- src_phonon.depends = src_gui
-+ src_phonon.depends = src_gui src_network
- src_multimedia.depends = src_gui
- contains(QT_CONFIG, opengl):src_multimedia.depends += src_opengl
- src_activeqt.depends = src_tools_idc src_gui
- src_declarative.depends = src_gui src_script src_network
-- src_plugins.depends = src_gui src_sql src_svg
-+ src_plugins.depends = src_gui src_sql
-+ contains(QT_CONFIG, svg):src_plugins.depends += src_svg
- contains(QT_CONFIG, multimedia):src_plugins.depends += src_multimedia
- contains(QT_CONFIG, declarative):src_plugins.depends += src_declarative
- src_s60installs.depends = $$TOOLS_SUBDIRS $$SRC_SUBDIRS
-@@ -114,6 +115,7 @@ src_declarative.target = sub-declarative
- contains(QT_CONFIG, webkit) {
- src_webkit.depends = src_gui src_sql src_network
- contains(QT_CONFIG, xmlpatterns): src_webkit.depends += src_xmlpatterns
-+ contains(QT_CONFIG, phonon): src_webkit.depends += src_phonon
- src_imports.depends += src_webkit
- }
- contains(QT_CONFIG, qt3support): src_plugins.depends += src_qt3support
-@@ -133,6 +135,8 @@ src_declarative.target = sub-declarative
- contains(QT_CONFIG, svg) {
- src_declarative.depends += src_svg
- }
-+ contains(QT_CONFIG, declarative):src_plugins.depends += src_declarative
-+ contains(QT_CONFIG, phonon):src_plugins.depends += src_phonon
- }
-
-
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0003-Hack-hide-cursor-during-startup.patch b/patches/qt-everywhere-opensource-src-4.8.7/0003-Hack-hide-cursor-during-startup.patch
deleted file mode 100644
index 06772bcf0..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0003-Hack-hide-cursor-during-startup.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Fri, 8 Oct 2010 20:13:40 +0200
-Subject: [PATCH] Hack: hide cursor during startup
-
-This will hide the cursor during application startup.
-To keep it hidden the application must call
-QApplication::setOverrideCursor(Qt::BlankCursor);
-Otherwise the cursor returns when the mouse is moved.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/gui/embedded/qwscursor_qws.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/gui/embedded/qwscursor_qws.cpp b/src/gui/embedded/qwscursor_qws.cpp
-index 6b13076653cd..475ea26d8f8c 100644
---- a/src/gui/embedded/qwscursor_qws.cpp
-+++ b/src/gui/embedded/qwscursor_qws.cpp
-@@ -344,7 +344,7 @@ void QWSServerPrivate::initializeCursor()
-
- // default cursor
- cursor = 0;
-- setCursor(QWSCursor::systemCursor(Qt::ArrowCursor));
-+ setCursor(QWSCursor::systemCursor(Qt::BlankCursor));
- #endif
- q->sendMouseEvent(QPoint(swidth/2, sheight/2), 0);
- }
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0004-add-missing-subdirs.patch b/patches/qt-everywhere-opensource-src-4.8.7/0004-add-missing-subdirs.patch
deleted file mode 100644
index cf6024ee8..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0004-add-missing-subdirs.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Fri, 8 Oct 2010 20:13:40 +0200
-Subject: [PATCH] add missing subdirs
-
-SUBDIRS is not set correctly in several places in examples
-This patch fixes it.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- examples/declarative/modelviews/modelviews.pro | 1 +
- examples/examples.pro | 2 +-
- examples/itemviews/itemviews.pro | 4 +++-
- examples/tutorials/tutorials.pro | 1 +
- 4 files changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/examples/declarative/modelviews/modelviews.pro b/examples/declarative/modelviews/modelviews.pro
-index 00e07fec030e..7f7d673346f9 100644
---- a/examples/declarative/modelviews/modelviews.pro
-+++ b/examples/declarative/modelviews/modelviews.pro
-@@ -1,6 +1,7 @@
- TEMPLATE = subdirs
-
- SUBDIRS += \
-+ abstractitemmodel \
- objectlistmodel \
- stringlistmodel \
- abstractitemmodel \
-diff --git a/examples/examples.pro b/examples/examples.pro
-index 67b4cf826a7c..e67030a17357 100644
---- a/examples/examples.pro
-+++ b/examples/examples.pro
-@@ -72,7 +72,7 @@ contains(QT_CONFIG, declarative): SUBDIRS += declarative helper
- win32:!win32-g++*: SUBDIRS += activeqt
- contains(QT_CONFIG, xmlpatterns):!contains(QT_CONFIG, no-gui): SUBDIRS += xmlpatterns
- contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
--contains(QT_CONFIG, concurrent): SUBDIRS += qtconcurrent
-+!contains(DEFINES, QT_NO_CONCURRENT): SUBDIRS += qtconcurrent
-
- # install
- sources.files = README *.pro
-diff --git a/examples/itemviews/itemviews.pro b/examples/itemviews/itemviews.pro
-index 137599ca6553..547694d9f50a 100644
---- a/examples/itemviews/itemviews.pro
-+++ b/examples/itemviews/itemviews.pro
-@@ -2,6 +2,7 @@ TEMPLATE = subdirs
- SUBDIRS = addressbook \
- basicsortfiltermodel \
- chart \
-+ coloreditorfactory \
- combowidgetmapper \
- customsortfiltermodel \
- dirview \
-@@ -13,7 +14,8 @@ SUBDIRS = addressbook \
- simpledommodel \
- simpletreemodel \
- simplewidgetmapper \
-- spinboxdelegate
-+ spinboxdelegate \
-+ stardelegate
-
- # install
- sources.files = README *.pro
-diff --git a/examples/tutorials/tutorials.pro b/examples/tutorials/tutorials.pro
-index ba1769deb459..cb1ca6ea382b 100644
---- a/examples/tutorials/tutorials.pro
-+++ b/examples/tutorials/tutorials.pro
-@@ -1,5 +1,6 @@
- TEMPLATE = subdirs
- SUBDIRS = \
-+ widgets \
- addressbook \
- modelview \
- threads
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0005-Fix-dnd-issue-on-QWS.patch b/patches/qt-everywhere-opensource-src-4.8.7/0005-Fix-dnd-issue-on-QWS.patch
deleted file mode 100644
index dbd4c3770..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0005-Fix-dnd-issue-on-QWS.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Fri, 8 Oct 2010 20:13:40 +0200
-Subject: [PATCH] Fix dnd issue on QWS
-
-An overrideCursor set in the application can be messed up by
-dnd stuff. As a result, the cursor gets stuck at Qt::ForbiddenCursor
-This patch seems to fix it, but I'm not sure if it breaks anything.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/gui/kernel/qdnd_qws.cpp | 9 +++------
- 1 file changed, 3 insertions(+), 6 deletions(-)
-
-diff --git a/src/gui/kernel/qdnd_qws.cpp b/src/gui/kernel/qdnd_qws.cpp
-index a925fdfe1b65..22dd43d31e80 100644
---- a/src/gui/kernel/qdnd_qws.cpp
-+++ b/src/gui/kernel/qdnd_qws.cpp
-@@ -162,10 +162,10 @@ void QDragManager::updateCursor()
- }
- } else {
- QCursor *overrideCursor = QApplication::overrideCursor();
-- if (!overrideCursor || overrideCursor->shape() != Qt::ForbiddenCursor) {
-+ if (restoreCursor && (!overrideCursor || overrideCursor->shape() != Qt::ForbiddenCursor)) {
- QApplication::changeOverrideCursor(QCursor(Qt::ForbiddenCursor));
-- currentActionForOverrideCursor = Qt::IgnoreAction;
- }
-+ currentActionForOverrideCursor = Qt::IgnoreAction;
- if (qt_qws_dnd_deco)
- qt_qws_dnd_deco->hide();
- }
-@@ -246,7 +246,6 @@ bool QDragManager::eventFilter(QObject *o, QEvent *e)
- willDrop = false;
- global_accepted_action = Qt::IgnoreAction;
- updateCursor();
-- restoreCursor = true;
- object->d_func()->target = 0;
- }
- if (cw && cw->acceptDrops()) {
-@@ -257,7 +256,6 @@ bool QDragManager::eventFilter(QObject *o, QEvent *e)
- willDrop = dee.isAccepted() && dee.dropAction() != Qt::IgnoreAction;
- global_accepted_action = willDrop ? dee.dropAction() : Qt::IgnoreAction;
- updateCursor();
-- restoreCursor = true;
- }
- } else if (cw) {
- QDragMoveEvent dme(cw->mapFromGlobal(me->globalPos()), possible_actions, dropData,
-@@ -281,8 +279,8 @@ bool QDragManager::eventFilter(QObject *o, QEvent *e)
- case QEvent::MouseButtonRelease:
- {
- qApp->removeEventFilter(this);
-+ willDrop = false;
- if (restoreCursor) {
-- willDrop = false;
- #ifndef QT_NO_CURSOR
- QApplication::restoreOverrideCursor();
- #endif
-@@ -336,7 +334,6 @@ Qt::DropAction QDragManager::drag(QDrag *o)
- willDrop = false;
- updatePixmap();
- updateCursor();
-- restoreCursor = true;
- object->d_func()->target = 0;
- qApp->installEventFilter(this);
-
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0006-qmake-make-sure-local-include-dirs-come-first.patch b/patches/qt-everywhere-opensource-src-4.8.7/0006-qmake-make-sure-local-include-dirs-come-first.patch
deleted file mode 100644
index 398c0ae51..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0006-qmake-make-sure-local-include-dirs-come-first.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 2 Feb 2011 18:00:51 +0100
-Subject: [PATCH] qmake: make sure local include dirs come first.
-
-This fixes the issue where a pcre.h from a include path from
-CXXFLAGS is used instead of the one in webkit.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- qmake/generators/unix/unixmake.cpp | 2 +-
- qmake/generators/unix/unixmake2.cpp | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
-index 0f06b814e4d6..5f7556832c4e 100644
---- a/qmake/generators/unix/unixmake.cpp
-+++ b/qmake/generators/unix/unixmake.cpp
-@@ -246,7 +246,7 @@ UnixMakefileGenerator::init()
- cflags += " $(CFLAGS)";
- else
- cflags += " $(" + comps[i] + "FLAGS)";
-- compile_flag += cflags + " $(INCPATH)";
-+ compile_flag += " $(INCPATH)" + cflags;
-
- QString compiler = comps[i];
- if (compiler == "C")
-diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
-index 50af9d23e1d7..aecd61d0ed18 100644
---- a/qmake/generators/unix/unixmake2.cpp
-+++ b/qmake/generators/unix/unixmake2.cpp
-@@ -999,7 +999,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
- compiler = "$(CXX)";
-
- // compile command
-- t << "\n\t" << compiler << cflags << " $(INCPATH) " << pchFlags << endl << endl;
-+ t << "\n\t" << compiler << " $(INCPATH) " << cflags << " " << pchFlags << endl << endl;
- }
- }
-
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0007-phonon-fix-colors-for-video-on-qgraphicsview.patch b/patches/qt-everywhere-opensource-src-4.8.7/0007-phonon-fix-colors-for-video-on-qgraphicsview.patch
deleted file mode 100644
index 6f834ad2b..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0007-phonon-fix-colors-for-video-on-qgraphicsview.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 3 Feb 2011 11:24:22 +0100
-Subject: [PATCH] phonon: fix colors for video on qgraphicsview
-
-patch from http://bugreports.qt.nokia.com/browse/QTBUG-8737
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/3rdparty/phonon/gstreamer/qwidgetvideosink.cpp | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
-diff --git a/src/3rdparty/phonon/gstreamer/qwidgetvideosink.cpp b/src/3rdparty/phonon/gstreamer/qwidgetvideosink.cpp
-index 89d5a9db9e63..85080014b1e7 100644
---- a/src/3rdparty/phonon/gstreamer/qwidgetvideosink.cpp
-+++ b/src/3rdparty/phonon/gstreamer/qwidgetvideosink.cpp
-@@ -18,6 +18,7 @@
- #include <QApplication>
- #include "videowidget.h"
- #include "qwidgetvideosink.h"
-+#include <gst/video/video.h>
-
- QT_BEGIN_NAMESPACE
-
-@@ -106,11 +107,7 @@ static GstStaticPadTemplate template_factory_rgb =
- GST_STATIC_PAD_TEMPLATE("sink",
- GST_PAD_SINK,
- GST_PAD_ALWAYS,
-- GST_STATIC_CAPS("video/x-raw-rgb, "
-- "framerate = (fraction) [ 0, MAX ], "
-- "width = (int) [ 1, MAX ], "
-- "height = (int) [ 1, MAX ],"
-- "bpp = (int) 32"));
-+ GST_STATIC_CAPS(GST_VIDEO_CAPS_xRGB_HOST_ENDIAN));
-
- template <VideoFormat FMT>
- struct template_factory;
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0008-don-t-build-webkit-tests.patch b/patches/qt-everywhere-opensource-src-4.8.7/0008-don-t-build-webkit-tests.patch
deleted file mode 100644
index a45563d73..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0008-don-t-build-webkit-tests.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Mon, 17 Oct 2011 19:34:55 +0200
-Subject: [PATCH] don't build webkit tests
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/3rdparty/webkit/Source/WebKit.pro | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/src/3rdparty/webkit/Source/WebKit.pro b/src/3rdparty/webkit/Source/WebKit.pro
-index 9be0f4aff9c9..eee88fea1f1e 100644
---- a/src/3rdparty/webkit/Source/WebKit.pro
-+++ b/src/3rdparty/webkit/Source/WebKit.pro
-@@ -15,19 +15,15 @@ SUBDIRS += WebKit/qt/QtWebKit.pro
-
- webkit2 {
- exists($$PWD/WebKit2/WebProcess.pro): SUBDIRS += WebKit2/WebProcess.pro
-- exists($$PWD/WebKit2/UIProcess/API/qt/tests): SUBDIRS += WebKit2/UIProcess/API/qt/tests
- }
-
- contains(QT_CONFIG, declarative) {
- exists($$PWD/WebKit/qt/declarative): SUBDIRS += WebKit/qt/declarative
- }
-
--exists($$PWD/WebKit/qt/tests): SUBDIRS += WebKit/qt/tests
--
- build-qtscript {
- SUBDIRS += \
- JavaScriptCore/qt/api/QtScript.pro \
-- JavaScriptCore/qt/tests \
- JavaScriptCore/qt/benchmarks
- }
-
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0009-fix-build-issues-with-gcc6.patch b/patches/qt-everywhere-opensource-src-4.8.7/0009-fix-build-issues-with-gcc6.patch
deleted file mode 100644
index 1c40eb8b3..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0009-fix-build-issues-with-gcc6.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From: Than Ngo <than@redhat.com>
-Date: Thu, 20 Oct 2016 11:15:33 +0200
-Subject: [PATCH] fix build issues with gcc6
-
-This patch solves two issues:
- - Use the correct key for the compiler.
- - Avoid a shift overflow.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure | 4 ++--
- src/xmlpatterns/api/qcoloroutput_p.h | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/configure b/configure
-index 10ad7ca0b0b7..a8e6dc141eda 100755
---- a/configure
-+++ b/configure
-@@ -7734,7 +7734,7 @@ case "$XPLATFORM" in
- *-g++*)
- # Check gcc's version
- case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
-- 5*|4*|3.4*)
-+ 8*|7*|6*|5*|4*|3.4*)
- ;;
- 3.3*)
- canBuildWebKit="no"
-@@ -8050,7 +8050,7 @@ g++*)
- 3.*)
- COMPILER_VERSION="3.*"
- ;;
-- 5*|4.*)
-+ 8*|7*|6*|5*|4.*)
- COMPILER_VERSION="4"
- ;;
- *)
-diff --git a/src/xmlpatterns/api/qcoloroutput_p.h b/src/xmlpatterns/api/qcoloroutput_p.h
-index 7911e8962501..be284d14096e 100644
---- a/src/xmlpatterns/api/qcoloroutput_p.h
-+++ b/src/xmlpatterns/api/qcoloroutput_p.h
-@@ -70,8 +70,8 @@ namespace QPatternist
- ForegroundShift = 10,
- BackgroundShift = 20,
- SpecialShift = 20,
-- ForegroundMask = ((1 << ForegroundShift) - 1) << ForegroundShift,
-- BackgroundMask = ((1 << BackgroundShift) - 1) << BackgroundShift
-+ ForegroundMask = 0x1f << ForegroundShift,
-+ BackgroundMask = 0x7 << BackgroundShift
- };
-
- public:
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0010-configure-handle-gcc-9.x.patch b/patches/qt-everywhere-opensource-src-4.8.7/0010-configure-handle-gcc-9.x.patch
deleted file mode 100644
index cebdfe002..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0010-configure-handle-gcc-9.x.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sat, 18 Apr 2020 10:52:34 +0200
-Subject: [PATCH] configure: handle gcc 9.x
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- configure | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure b/configure
-index a8e6dc141eda..39c895b091f3 100755
---- a/configure
-+++ b/configure
-@@ -7734,7 +7734,7 @@ case "$XPLATFORM" in
- *-g++*)
- # Check gcc's version
- case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
-- 8*|7*|6*|5*|4*|3.4*)
-+ 9*|8*|7*|6*|5*|4*|3.4*)
- ;;
- 3.3*)
- canBuildWebKit="no"
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/0011-Redo-the-Q_FOREACH-loop-control-without-GCC-statemen.patch b/patches/qt-everywhere-opensource-src-4.8.7/0011-Redo-the-Q_FOREACH-loop-control-without-GCC-statemen.patch
deleted file mode 100644
index dadc0a6c5..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/0011-Redo-the-Q_FOREACH-loop-control-without-GCC-statemen.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From: Thiago Macieira <thiago.macieira@intel.com>
-Date: Tue, 11 Feb 2014 16:17:46 -0800
-Subject: [PATCH] Redo the Q_FOREACH loop control without GCC statement
- expressions
-
-It's possible to do without them, which probably makes the number of
-supported compilers a lot bigger: they just need to support decltype()
-or __typeof__.
-
-That includes the Intel compiler. The old code was also apparently
-working, but no one had realized the old workaround for some old version
-was still in place.
-
-The loop overhead is more or less the same. I have not done benchmarks,
-but inspection of the generated assembly shows more or less the same
-number of instructions.
-
-Change-Id: I32d499c84a6ddd19d994b49f17a469acb5c3a3f1
-Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
-Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-
-Backported to Qt 4
----
- src/corelib/global/qglobal.h | 20 +++++++++++++++-----
- 1 file changed, 15 insertions(+), 5 deletions(-)
-
-diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
-index 20d88328cbcd..34ba4c2d99f3 100644
---- a/src/corelib/global/qglobal.h
-+++ b/src/corelib/global/qglobal.h
-@@ -2482,22 +2482,32 @@ typedef uint Flags;
-
- #endif /* Q_NO_TYPESAFE_FLAGS */
-
--#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT)
-+#if (defined(Q_CC_GNU) && !defined(Q_CC_RVCT))
- /* make use of typeof-extension */
- template <typename T>
- class QForeachContainer {
- public:
-- inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { }
-+ inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { }
- const T c;
- int brk;
- typename T::const_iterator i, e;
-+ int control;
- };
-
-+// Explanation of the control word:
-+// - it's initialized to 1
-+// - that means both the inner and outer loops start
-+// - if there were no breaks, at the end of the inner loop, it's set to 0, which
-+// causes it to exit (the inner loop is run exactly once)
-+// - at the end of the outer loop, it's inverted, so it becomes 1 again, allowing
-+// the outer loop to continue executing
-+// - if there was a break inside the inner loop, it will exit with control still
-+// set to 1; in that case, the outer loop will invert it to 0 and will exit too
- #define Q_FOREACH(variable, container) \
- for (QForeachContainer<__typeof__(container)> _container_(container); \
-- !_container_.brk && _container_.i != _container_.e; \
-- __extension__ ({ ++_container_.brk; ++_container_.i; })) \
-- for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;}))
-+ _container_.control && _container_.i != _container_.e; \
-+ ++_container_.i, _container_.control ^= 1) \
-+ for (variable = *_container_.i; _container_.control; _container_.control = 0)
-
- #else
-
diff --git a/patches/qt-everywhere-opensource-src-4.8.7/series b/patches/qt-everywhere-opensource-src-4.8.7/series
deleted file mode 100644
index 132648d15..000000000
--- a/patches/qt-everywhere-opensource-src-4.8.7/series
+++ /dev/null
@@ -1,14 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-mkspec-for-ptxdist.patch
-0002-disable-ordered-compiling.patch
-0003-Hack-hide-cursor-during-startup.patch
-0004-add-missing-subdirs.patch
-0005-Fix-dnd-issue-on-QWS.patch
-0006-qmake-make-sure-local-include-dirs-come-first.patch
-0007-phonon-fix-colors-for-video-on-qgraphicsview.patch
-0008-don-t-build-webkit-tests.patch
-0009-fix-build-issues-with-gcc6.patch
-0010-configure-handle-gcc-9.x.patch
-0011-Redo-the-Q_FOREACH-loop-control-without-GCC-statemen.patch
-# cf4f9c7eb098ba6eecc69bcfa3b924aa - git-ptx-patches magic
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0001-CVE-2023-4863-5.15.patch b/patches/qt-everywhere-opensource-src-5.15.12/0001-CVE-2023-4863-5.15.patch
new file mode 100644
index 000000000..9d5b9fdf3
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0001-CVE-2023-4863-5.15.patch
@@ -0,0 +1,3767 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 16 Oct 2023 10:13:21 +0200
+Subject: [PATCH] CVE-2023-4863-5.15
+
+Imported from https://download.qt.io/archive/qt/5.15/
+---
+ qtimageformats/src/3rdparty/libwebp.pri | 3 +
+ qtimageformats/src/3rdparty/libwebp/AUTHORS | 4 +
+ qtimageformats/src/3rdparty/libwebp/ChangeLog | 220 ++++++++++++++++
+ qtimageformats/src/3rdparty/libwebp/NEWS | 27 ++
+ ...0001-Fix-Windows-build-for-clang-and-neon.patch | 20 +-
+ .../src/3rdparty/libwebp/qt_attribution.json | 3 +-
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv.c | 59 +++--
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv.h | 40 ++-
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c | 14 +
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.h | 22 ++
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.c | 2 +-
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.h | 7 +-
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c | 18 +-
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.h | 7 +-
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c | 1 -
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h | 2 +-
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv_neon.c | 9 +-
+ .../src/3rdparty/libwebp/sharpyuv/sharpyuv_sse2.c | 7 +-
+ .../src/3rdparty/libwebp/src/dec/tree_dec.c | 3 +-
+ .../src/3rdparty/libwebp/src/dec/vp8_dec.c | 2 +
+ .../src/3rdparty/libwebp/src/dec/vp8i_dec.h | 4 +-
+ .../src/3rdparty/libwebp/src/dec/vp8l_dec.c | 48 ++--
+ .../src/3rdparty/libwebp/src/dec/vp8li_dec.h | 2 +-
+ .../src/3rdparty/libwebp/src/dec/webp_dec.c | 35 ++-
+ .../src/3rdparty/libwebp/src/demux/demux.c | 4 +-
+ .../3rdparty/libwebp/src/dsp/alpha_processing.c | 1 +
+ .../libwebp/src/dsp/alpha_processing_sse2.c | 12 +-
+ .../libwebp/src/dsp/alpha_processing_sse41.c | 2 +-
+ qtimageformats/src/3rdparty/libwebp/src/dsp/cost.c | 1 +
+ .../src/3rdparty/libwebp/src/dsp/cost_neon.c | 4 +-
+ qtimageformats/src/3rdparty/libwebp/src/dsp/cpu.c | 8 +-
+ qtimageformats/src/3rdparty/libwebp/src/dsp/cpu.h | 40 ++-
+ qtimageformats/src/3rdparty/libwebp/src/dsp/dec.c | 1 +
+ .../src/3rdparty/libwebp/src/dsp/dec_neon.c | 4 +-
+ .../src/3rdparty/libwebp/src/dsp/dec_sse2.c | 93 +++----
+ .../src/3rdparty/libwebp/src/dsp/dec_sse41.c | 2 +-
+ qtimageformats/src/3rdparty/libwebp/src/dsp/enc.c | 1 +
+ .../src/3rdparty/libwebp/src/dsp/enc_neon.c | 11 +-
+ .../src/3rdparty/libwebp/src/dsp/enc_sse2.c | 293 +++++++++++++++------
+ .../src/3rdparty/libwebp/src/dsp/filters.c | 1 +
+ .../src/3rdparty/libwebp/src/dsp/lossless.c | 13 +-
+ .../src/3rdparty/libwebp/src/dsp/lossless_enc.c | 19 +-
+ .../3rdparty/libwebp/src/dsp/lossless_enc_neon.c | 2 +-
+ .../3rdparty/libwebp/src/dsp/lossless_enc_sse2.c | 8 +-
+ .../src/3rdparty/libwebp/src/dsp/lossless_neon.c | 2 +-
+ .../src/3rdparty/libwebp/src/dsp/lossless_sse2.c | 88 +++----
+ .../src/3rdparty/libwebp/src/dsp/lossless_sse41.c | 7 +-
+ qtimageformats/src/3rdparty/libwebp/src/dsp/neon.h | 4 +-
+ .../src/3rdparty/libwebp/src/dsp/quant.h | 13 +-
+ .../src/3rdparty/libwebp/src/dsp/rescaler.c | 1 +
+ .../src/3rdparty/libwebp/src/dsp/rescaler_sse2.c | 6 +-
+ qtimageformats/src/3rdparty/libwebp/src/dsp/ssim.c | 1 +
+ .../src/3rdparty/libwebp/src/dsp/upsampling.c | 1 +
+ .../src/3rdparty/libwebp/src/dsp/upsampling_neon.c | 2 +-
+ .../src/3rdparty/libwebp/src/dsp/upsampling_sse2.c | 2 +-
+ qtimageformats/src/3rdparty/libwebp/src/dsp/yuv.c | 1 +
+ .../src/3rdparty/libwebp/src/dsp/yuv_sse2.c | 13 +-
+ .../src/3rdparty/libwebp/src/dsp/yuv_sse41.c | 6 +-
+ .../src/3rdparty/libwebp/src/enc/alpha_enc.c | 20 +-
+ .../src/3rdparty/libwebp/src/enc/analysis_enc.c | 12 +-
+ .../libwebp/src/enc/backward_references_enc.c | 9 +-
+ .../src/3rdparty/libwebp/src/enc/frame_enc.c | 8 +-
+ .../src/3rdparty/libwebp/src/enc/picture_csp_enc.c | 34 +--
+ .../3rdparty/libwebp/src/enc/picture_rescale_enc.c | 20 +-
+ .../src/3rdparty/libwebp/src/enc/syntax_enc.c | 6 +-
+ .../src/3rdparty/libwebp/src/enc/vp8i_enc.h | 4 +-
+ .../src/3rdparty/libwebp/src/enc/vp8l_enc.c | 49 ++--
+ .../src/3rdparty/libwebp/src/enc/webp_enc.c | 10 +-
+ qtimageformats/src/3rdparty/libwebp/src/mux/muxi.h | 4 +-
+ .../src/3rdparty/libwebp/src/mux/muxread.c | 7 +-
+ .../libwebp/src/utils/bit_reader_inl_utils.h | 4 +-
+ .../3rdparty/libwebp/src/utils/bit_reader_utils.c | 3 +-
+ .../3rdparty/libwebp/src/utils/bit_reader_utils.h | 3 +-
+ .../src/3rdparty/libwebp/src/utils/huffman_utils.c | 99 +++++--
+ .../src/3rdparty/libwebp/src/utils/huffman_utils.h | 27 +-
+ .../src/3rdparty/libwebp/src/utils/utils.h | 12 +-
+ .../src/3rdparty/libwebp/src/webp/decode.h | 5 +-
+ .../3rdparty/libwebp/src/webp/format_constants.h | 2 +-
+ .../src/3rdparty/libwebp/src/webp/types.h | 6 +-
+ .../src/plugins/imageformats/webp/CMakeLists.txt | 1 +
+ 80 files changed, 1113 insertions(+), 458 deletions(-)
+ create mode 100644 qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c
+ create mode 100644 qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.h
+
+diff --git a/qtimageformats/src/3rdparty/libwebp.pri b/qtimageformats/src/3rdparty/libwebp.pri
+index 7c41f8f7c56f..c91b2d061049 100644
+--- a/qtimageformats/src/3rdparty/libwebp.pri
++++ b/qtimageformats/src/3rdparty/libwebp.pri
+@@ -1,3 +1,5 @@
++CONFIG += compile_included_sources
++
+ INCLUDEPATH += \
+ $$PWD/libwebp \
+ $$PWD/libwebp/sharpyuv \
+@@ -11,6 +13,7 @@ INCLUDEPATH += \
+
+ SOURCES += \
+ $$PWD/libwebp/sharpyuv/sharpyuv.c \
++ $$PWD/libwebp/sharpyuv/sharpyuv_cpu.c \
+ $$PWD/libwebp/sharpyuv/sharpyuv_csp.c \
+ $$PWD/libwebp/sharpyuv/sharpyuv_dsp.c \
+ $$PWD/libwebp/sharpyuv/sharpyuv_gamma.c \
+diff --git a/qtimageformats/src/3rdparty/libwebp/AUTHORS b/qtimageformats/src/3rdparty/libwebp/AUTHORS
+index 3efcbe25b654..8359b20da9d5 100644
+--- a/qtimageformats/src/3rdparty/libwebp/AUTHORS
++++ b/qtimageformats/src/3rdparty/libwebp/AUTHORS
+@@ -11,11 +11,13 @@ Contributors:
+ - Djordje Pesut (djordje dot pesut at imgtec dot com)
+ - Frank Barchard (fbarchard at google dot com)
+ - Hui Su (huisu at google dot com)
++- H. Vetinari (h dot vetinari at gmx dot com)
+ - Ilya Kurdyukov (jpegqs at gmail dot com)
+ - Ingvar Stepanyan (rreverser at google dot com)
+ - James Zern (jzern at google dot com)
+ - Jan Engelhardt (jengelh at medozas dot de)
+ - Jehan (jehan at girinstud dot io)
++- Jeremy Maitin-Shepard (jbms at google dot com)
+ - Johann Koenig (johann dot koenig at duck dot com)
+ - Jovan Zelincevic (jovan dot zelincevic at imgtec dot com)
+ - Jyrki Alakuijala (jyrki at google dot com)
+@@ -30,6 +32,7 @@ Contributors:
+ - Mislav Bradac (mislavm at google dot com)
+ - Nico Weber (thakis at chromium dot org)
+ - Noel Chromium (noel at chromium dot org)
++- Nozomi Isozaki (nontan at pixiv dot co dot jp)
+ - Oliver Wolff (oliver dot wolff at qt dot io)
+ - Owen Rodley (orodley at google dot com)
+ - Parag Salasakar (img dot mips1 at gmail dot com)
+@@ -45,6 +48,7 @@ Contributors:
+ - Somnath Banerjee (somnath dot banerjee at gmail dot com)
+ - Sriraman Tallam (tmsriram at google dot com)
+ - Tamar Levy (tamar dot levy at intel dot com)
++- Thiago Perrotta (tperrotta at google dot com)
+ - Timothy Gu (timothygu99 at gmail dot com)
+ - Urvang Joshi (urvang at google dot com)
+ - Vikas Arora (vikasa at google dot com)
+diff --git a/qtimageformats/src/3rdparty/libwebp/ChangeLog b/qtimageformats/src/3rdparty/libwebp/ChangeLog
+index c7655f29d74a..33ec48633ce1 100644
+--- a/qtimageformats/src/3rdparty/libwebp/ChangeLog
++++ b/qtimageformats/src/3rdparty/libwebp/ChangeLog
+@@ -1,8 +1,228 @@
++1ace578c update NEWS
++63234c42 bump version to 1.3.2
++2af26267 Fix OOB write in BuildHuffmanTable.
++fd7bb21c update ChangeLog (tag: v1.3.1-rc2, tag: v1.3.1)
++e1adea50 update NEWS
++43393320 enc/*: normalize WebPEncodingSetError() calls
++287fdefe enc/*: add missing WebPEncodingSetError() calls
++c3bd7cff EncodeAlphaInternal: add missing error check
++d49cfbb3 vp8l_enc,WriteImage: add missing error check
++2e5a9ec3 muxread,MuxImageParse: add missing error checks
++ebb6f949 cmake,emscripten: explicitly set stack size
++59a2b1f9 WebPDecodeYUV: check u/v/stride/uv_stride ptrs
++8e965ccb Call png_get_channels() to see if image has alpha
++7f0a3419 update ChangeLog (tag: v1.3.1-rc1)
++bab7efbe update NEWS
++7138bf8f bump version to 1.3.1
++435b4ded update AUTHORS
++47351229 update .mailmap
++ff6c7f4e CONTRIBUTING.md: add C style / cmake-format notes
++dd530437 add .cmake-format.py
++adbe2cb1 cmake,cosmetics: apply cmake-format
++15b36508 doc/webp-container-spec: rm future codec comment
++c369c4bf doc/webp-lossless-bitstream-spec: improve link text
++1de35f47 doc/webp-container-spec: don't use 'currently'
++bb06a16e doc/webp-container-spec: prefer present tense
++9f38b71e doc/webp-lossless-bitstream-spec: prefer present tense
++7acb6b82 doc/webp-container-spec: avoid i.e. & e.g.
++4967e7cd doc/webp-lossless-bitstream-spec: avoid i.e. & e.g.
++e3366659 Merge "Do not find_package image libraries if not needed." into main
++428588ef clarify single leaf node trees and use of canonical prefix coding
++709ec152 Do not find_package image libraries if not needed.
++8dd80ef8 fuzz_utils.h: lower kFuzzPxLimit w/ASan
++8f187b9f Clean message calls in CMake
++cba30078 WebPConfig.cmake.in: use calculated include path
++6cf9a76a Merge "webp-lossless-bitstream-spec: remove use of 'dynamics'" into main
++740943b2 Merge "Specialize and optimize ITransform_SSE2 using do_two" into main
++2d547e24 Compare kFuzzPxLimit to max_num_operations
++ac42dde1 Specialize and optimize ITransform_SSE2 using do_two
++17e0ef1d webp-lossless-bitstream-spec: remove use of 'dynamics'
++ed274371 neon.h,cosmetics: clear a couple lint warnings
++3fb82947 cpu.h,cosmetics: segment defines
++0c496a4f cpu.h: add WEBP_AARCH64
++8151f388 move VP8GetCPUInfo declaration to cpu.c
++916548c2 Make kFuzzPxLimit sanitizer dependent
++4070b271 advanced_api_fuzzer: reduce scaling limit
++761f49c3 Merge "webp-lossless-bitstream-spec: add missing bits to ABNF" into main
++84d04c48 webp-lossless-bitstream-spec: add missing bits to ABNF
++0696e1a7 advanced_api_fuzzer: reduce scaling limit
++93d88aa2 Merge "deps.cmake: remove unneeded header checks" into main
++118e0035 deps.cmake: remove unneeded header checks
++4c3d7018 webp-lossless-bitstream-spec: condense normal-prefix-code
++a6a09b32 webp-lossless-bitstream-spec: fix 2 code typos
++50ac4f7c Merge "cpu.h: enable NEON w/_M_ARM64EC" into main
++4b7d7b4f Add contribution instructions
++0afbd97b cpu.h: enable NEON w/_M_ARM64EC
++349f4353 Merge changes Ibd89e56b,Ic57e7f84,I89096614 into main
++8f7513b7 upsampling_neon.c: fix WEBP_SWAP_16BIT_CSP check
++cbf624b5 advanced_api_fuzzer: reduce scaling limit
++89edfdd1 Skip slow scaling in libwebp advanced_api_fuzzer
++859f19f7 Reduce libwebp advanced_api_fuzzer threshold
++a4f04835 Merge changes Ic389aaa2,I329ccd79 into main
++1275fac8 Makefile.vc: fix img2webp link w/dynamic cfg
++2fe27bb9 img2webp: normalize help output
++24bed3d9 cwebp: reflow -near_lossless help text
++0825faa4 img2webp: add -sharp_yuv/-near_lossless
++d64e6d7d Merge "PaletteSortModifiedZeng: fix leak on error" into main
++0e12a22d Merge "EncodeAlphaInternal: clear result->bw on error" into main
++0edbb6ea PaletteSortModifiedZeng: fix leak on error
++41ffe04e Merge "Update yapf style from "chromium" to "yapf"" into main
++2d9d9265 Update yapf style from "chromium" to "yapf"
++a486d800 EncodeAlphaInternal: clear result->bw on error
++1347a32d Skip big scaled advanced_api_fuzzer
++52b6f067 Fix scaling limit in advanced_api_fuzzer.c
++73618428 Limit scaling in libwebp advanced_api_fuzzer.c
++b54d21a0 Merge "CMakeLists.txt: allow CMAKE_INSTALL_RPATH to be set empty" into main
++31c28db5 libwebp{,demux,mux}.pc.in: Requires -> Requires.private
++d9a505ff CMakeLists.txt: allow CMAKE_INSTALL_RPATH to be set empty
++bdf33d03 Merge tag 'v1.3.0'
++b5577769 update ChangeLog (tag: v1.3.0-rc1, tag: v1.3.0)
++0ba77244 update NEWS
++e763eb1e bump version to 1.3.0
++2a8686fc update AUTHORS
++106a57c1 Merge "*/Android.mk: add a check for NDK_ROOT" into main
++c5e841c4 Merge "extras: WebpToSDL -> WebPToSDL" into main
++dbc30715 Merge "xcframeworkbuild.sh: bump MACOSX_CATALYST_MIN_VERSION" into main
++6fc1a9f9 */Android.mk: add a check for NDK_ROOT
++d3e151fc doc/api.md,webp_js/README.md: Webp -> WebP
++ed92a626 extras: WebpToSDL -> WebPToSDL
++6eb0189b xcframeworkbuild.sh: bump MACOSX_CATALYST_MIN_VERSION
++1d58575b CMake: align .pc variables with autoconf
++e5fe2cfc webp-lossless-bitstream-spec,cosmetics: reflow paragraphs
++0ceeeab9 webp-lossless-bitstream-spec: add amendment note
++607611cd Merge "webp-container-spec: normalize section title case" into main
++f853685e lossless: SUBTRACT_GREEN -> SUBTRACT_GREEN_TRANSFORM
++786497e4 webp-lossless-bitstream-spec: fix inv color txfm description
++c6ac672d webp-lossless-bitstream-spec: fix num_code_lengths check
++b5700efb webp-lossless-bitstream-spec,cosmetics: grammar/capitalization
++d8ed8c11 webp-container-spec: normalize section title case
++52ec0b8f Merge changes Ie975dbb5,Ifc8c93af,I6ca7c5d6,I2e8d66f5,I152477b8 into main
++5097ef62 webp-container-spec,cosmetics: grammar/capitalization
++e3ba2b1f webp-lossless-bitstream-spec,cosmetics: reflow abstract
++1e8e3ded webp-lossless-bitstream-spec: reword abstract re alpha
++017cb6fa webp-container-spec,cosmetics: normalize range syntax
++f6a4684b webp-lossless-bitstream-spec,cosmetics: normalize range syntax
++54ebd5a3 webp-lossless-bitstream-spec: limit dist map lut to 69 cols
++44741f9c webp-lossless-bitstream-spec: fix dist mapping example
++fad0ece7 pnmdec.c: use snprintf instead of sprintf
++3f73e8f7 sharpyuv: add SharpYuvGetVersion()
++ce2f2d66 SharpYuvConvert: fix a race on SharpYuvGetCPUInfo
++a458e308 sharpyuv_dsp.h: restore sharpyuv_cpu.h include
++9ba800a7 Merge changes Id72fbf3b,Ic59d23a2 into main
++979c0ebb sharpyuv: add SharpYuvGetCPUInfo
++8bab09a4 Merge "*.pc.in: rename lib_prefix to webp_libname_prefix" into main
++769387c5 cpu.c,cosmetics: fix a typo
++a02978c2 sharpyuv/Makefile.am+cmake: add missing -lm
++28aedcb9 *.pc.in: rename lib_prefix to webp_libname_prefix
++c42e6d5a configure.ac: export an empty lib_prefix variable
++dfc843aa Merge "*.pc.in: add lib prefix to lib names w/MSVC" into main
++2498209b *.pc.in: add lib prefix to lib names w/MSVC
++ac252b61 Merge "analysis_enc.c: fix a dead store warning" into main
++56944762 analysis_enc.c: fix a dead store warning
++d34f9b99 Merge "webp-lossless-bitstream-spec: convert BNF to ABNF" into main
++dc05b4db Merge changes I96bc063c,I45880467,If9e18e5a,I6ee938e4,I0a410b28, ... into main
++83270c7f webp-container-spec: add prose for rendering process
++73b19b64 webp-container-spec: note reserved fields MUST be ignored
++57101d3f webp-lossless-bitstream-spec: improve 'small' color table stmt
++dfd32e45 webp-container-spec: remove redundant sentence
++8a6185dd doc/webp-*: fix some punctuation, grammar
++72776530 webp-lossless-bitstream-spec: convert BNF to ABNF
++d992bb08 cmake: rename cpufeatures target to cpufeatures-webp
++3ed2b275 webp-container-spec: clarify background color note
++951c292d webp-container-spec: come too late -> out of order
++902dd787 webp-container-spec: prefer hex literals
++a8f6b5ee webp-container-spec: change SHOULD to MUST w/ANIM chunk
++1dc59435 webp-container-spec: add unknown fields MUST be ignored
++280a810f webp-container-spec: make padding byte=0 a MUST
++41f0bf68 webp-container-spec: update note on trailing data
++6bdd36db webp-container-spec: clarify Chunk Size is in bytes
++87e36c48 Merge "webp_js/README.md,cosmetics: reflow some lines" into main
++5b01f321 Merge "Update Windows makefile to build libsharpyuv library." into main
++19b1a71c webp_js/README.md,cosmetics: reflow some lines
++780db756 Update Windows makefile to build libsharpyuv library.
++e407d4b3 CMakeLists.txt: replace GLUT_glut_LIBRARY w/GLUT::GLUT
++abf73d62 Merge "WebPConfig.cmake.in: add find_dependency(Threads)" into main
++25807fb4 Merge "cmake: restore compatibility with cmake < 3.12" into main
++5dbc4bfa WebPConfig.cmake.in: add find_dependency(Threads)
++b2a175dd Merge "Update wasm instructions." into main
++cb90f76b Update wasm instructions.
++02d15258 cmake: restore compatibility with cmake < 3.12
++5ba046e2 CMake: add_definitions -> add_compile_options
++e68765af dsp,neon: use vaddv in a few more places
++e8f83de2 Set libsharpyuv include dir to 'webp' subdirectory.
++15a91ab1 cmake,cosmetics: apply cmake-format
++0dd49d1a CMakeLists.txt: set @ONLY in configure_file() calls
++62b1bfe8 Merge changes I2877e7bb,I777cad70,I15af7d1a,I686e6740,If10538a9, ... into main
++95c8fe5f Merge changes Iecea3603,I9dc228ab into main
++e7c805cf picture_csp_enc.c: remove SafeInitSharpYuv
++6af8845a sharpyuv: prefer webp/types.h
++639619ce cmake: fix dll exports
++782ed48c sharpyuv,SharpYuvInit: add mutex protection when available
++cad0d5ad sharyuv_{neon,sse2}.c: merge WEBP_USE_* sections
++ef70ee06 add a few missing <stddef.h> includes for NULL
++f0f9eda4 sharpyuv.h: remove <inttypes.h>
++9b902cba Merge "picture_csp_enc.c,CheckNonOpaque: rm unneeded local" into main
++9c1d457c cmake/cpu.cmake: remove unused variable
++9ac25bcb CMakeLists.txt,win32: match naming convention used by nmake
++76c353ba picture_csp_enc.c,CheckNonOpaque: rm unneeded local
++5000de54 Merge "cwebp: fix WebPPictureHasTransparency call" into main
++e1729309 Merge "WebPPictureHasTransparency: add missing pointer check" into main
++00ff988a vp8l_enc,AddSingleSubGreen: clear int sanitizer warnings
++e2fecc22 dsp/lossless_enc.c: clear int sanitizer warnings
++129cf9e9 dsp/lossless.c: clear int sanitizer warnings
++ad7d1753 dsp/lossless_enc.c: clear int sanitizer warnings
++5037220e VP8LSubtractGreenFromBlueAndRed_C: clear int sanitizer warnings
++2ee786c7 upsampling_sse2.c: clear int sanitizer warnings
++4cc157d4 ParseOptionalChunks: clear int sanitizer warning
++892cf033 BuildHuffmanTable: clear int sanitizer warning
++3a9a4d45 VP8GetSigned: clear int sanitizer warnings
++704a3d0a dsp/lossless.c: quiet int sanitizer warnings
++1a6c109c WebPPictureHasTransparency: add missing pointer check
++c626e7d5 cwebp: fix WebPPictureHasTransparency call
++866e349c Merge tag 'v1.2.4'
++c170df38 Merge "Create libsharpyuv.a in makefile.unix." into main
++9d7ff74a Create libsharpyuv.a in makefile.unix.
++0d1f1254 update ChangeLog (tag: v1.2.4)
++fcbc2d78 Merge "doc/*.txt: restrict code to 69 columns" into main
++4ad0e189 Merge "webp-container-spec.txt: normalize fourcc spelling" into main
+ 980d2488 update NEWS
+ 9fde8127 bump version to 1.2.4
++7a0a9935 doc/*.txt: restrict code to 69 columns
++c040a615 webp-container-spec.txt: normalize fourcc spelling
++aff1c546 dsp,x86: normalize types w/_mm_cvtsi128_si32 calls
++ab540ae0 dsp,x86: normalize types w/_mm_cvtsi32_si128 calls
++8980362e dsp,x86: normalize types w/_mm_set* calls (2)
+ e626925c lossless: fix crunch mode w/WEBP_REDUCE_SIZE
++83539239 dsp,x86: normalize types w/_mm_set* calls
++8a4576ce webp-container-spec.txt: replace &amp; with &
++db870881 Merge "webp-container-spec.txt: make reserved 0 values a MUST" into main
++01d7d378 webp-lossless-bitstream-spec: number all sections
++337cf69f webp-lossless-bitstream-spec: mv Nomenclature after Intro
++79be856e Merge changes I7111d1f7,I872cd62c into main
++5b87983a webp-container-spec.txt: make reserved 0 values a MUST
++bd939123 Merge changes I7a25b1a6,I51b2c2a0,I87d0cbcf,I6ec60af6,I0a3fe9dc into main
++04764b56 libwebp.pc: add libsharpyuv to requires
++7deee810 libsharpyuv: add pkg-config file
++1a64a7e6 webp-container-spec.txt: clarify some SHOULDs
++bec2c88a webp-container-spec.txt: move ChunkHeader to terminology
++c9359332 webp-container-spec.txt: clarify 'VP8 '/'XMP ' fourccs
++70fe3063 webp-container-spec.txt: rightsize table entries
++ddbf3f3f webp-container-spec.txt: update 'key words' text
++c151e95b utils.h,WEBP_ALIGN: make bitmask unsigned
++748e92bb add WebPInt32ToMem
++3fe15b67 Merge "Build libsharpyuv as a full installable library." into main
++4f402f34 add WebPMemToInt32
++a3b68c19 Build libsharpyuv as a full installable library.
++b4994eaa CMake: set rpath for shared objects
++94cd7117 Merge "CMake: fix dylib versioning" into main
++e91451b6 Fix the lossless specs a bit more.
++231bdfb7 CMake: fix dylib versioning
+ bfad7ab5 CMakeLists.txt: correct libwebpmux name in WebPConfig.cmake
+ c2e3fd30 Revert "cmake: fix webpmux lib name for cmake linking"
++7366f7f3 Merge "lossless: fix crunch mode w/WEBP_REDUCE_SIZE" into main
++84163d9d lossless: fix crunch mode w/WEBP_REDUCE_SIZE
++d01c1eb3 webp-lossless-bitstream-spec,cosmetics: normalize capitalization
++8813ca8e Merge tag 'v1.2.3'
+ 3c4a0fbf update ChangeLog (tag: v1.2.3)
+ 56a480e8 dsp/cpu.h: add missing extern "C"
+ 62b45bdd update ChangeLog (tag: v1.2.3-rc1)
+diff --git a/qtimageformats/src/3rdparty/libwebp/NEWS b/qtimageformats/src/3rdparty/libwebp/NEWS
+index c2bf3899987a..47f8451482e0 100644
+--- a/qtimageformats/src/3rdparty/libwebp/NEWS
++++ b/qtimageformats/src/3rdparty/libwebp/NEWS
+@@ -1,3 +1,30 @@
++- 9/13/2023: version 1.3.2
++ This is a binary compatible release.
++ * security fix for lossless decoder (chromium: #1479274, CVE-2023-4863)
++
++- 6/23/2023: version 1.3.1
++ This is a binary compatible release.
++ * security fixes for lossless encoder (#603, chromium: #1420107, #1455619,
++ CVE-2023-1999)
++ * improve error reporting through WebPPicture error codes
++ * fix upsampling for RGB565 and RGBA4444 in NEON builds
++ * img2webp: add -sharp_yuv & -near_lossless
++ * Windows builds:
++ - fix compatibility with clang-cl (#607)
++ - improve Arm64 performance with cl.exe
++ - add Arm64EC support
++ * fix webp_js with emcc >= 3.1.27 (stack size change, #614)
++ * CMake fixes (#592, #610, #612)
++ * further updates to the container and lossless bitstream docs (#581, #611)
++
++- 12/16/2022: version 1.3.0
++ This is a binary compatible release.
++ * add libsharpyuv, which exposes -sharp_yuv/config.use_sharp_yuv
++ functionality to other libraries; libwebp now depends on this library
++ * major updates to the container and lossless bitstream docs (#448, #546,
++ #551)
++ * miscellaneous warning, bug & build fixes (#576, #583, #584)
++
+ - 8/4/2022: version 1.2.4
+ This is a binary compatible release.
+ * restore CMake libwebpmux target name for compatibility with 1.2.2 (#575)
+diff --git a/qtimageformats/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-neon.patch b/qtimageformats/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-neon.patch
+index 2b46f5bec641..d72147658721 100644
+--- a/qtimageformats/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-neon.patch
++++ b/qtimageformats/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-neon.patch
+@@ -1,5 +1,5 @@
+ diff --git a/src/3rdparty/libwebp/src/dsp/cpu.h b/src/3rdparty/libwebp/src/dsp/cpu.h
+-index 57a40d8..8cf3e92 100644
++index c86540f..581ecbd 100644
+ --- a/src/3rdparty/libwebp/src/dsp/cpu.h
+ +++ b/src/3rdparty/libwebp/src/dsp/cpu.h
+ @@ -14,6 +14,8 @@
+@@ -8,10 +8,10 @@ index 57a40d8..8cf3e92 100644
+
+ +#include <qglobal.h>
+ +
++ #include <stddef.h>
++
+ #ifdef HAVE_CONFIG_H
+- #include "src/webp/config.h"
+- #endif
+-@@ -43,12 +45,12 @@
++@@ -48,12 +50,12 @@
+
+ #if !defined(HAVE_CONFIG_H)
+ #if defined(_MSC_VER) && _MSC_VER > 1310 && \
+@@ -26,13 +26,13 @@ index 57a40d8..8cf3e92 100644
+ #define WEBP_MSC_SSE41 // Visual C++ SSE4.1 targets
+ #endif
+ #endif
+-@@ -97,7 +99,8 @@
+- // arm_neon.h. Compile errors were seen with Visual Studio 2019 16.4 with
++@@ -106,7 +108,8 @@
+ // vtbl4_u8(); a fix was made in 16.6.
+- #if defined(_MSC_VER) && ((_MSC_VER >= 1700 && defined(_M_ARM)) || \
+-- (_MSC_VER >= 1926 && defined(_M_ARM64)))
+-+ (_MSC_VER >= 1926 && defined(_M_ARM64))) && \
+-+ !defined(__clang__) && (QT_CONFIG_neon == 1)
++ #if defined(_MSC_VER) && \
++ ((_MSC_VER >= 1700 && defined(_M_ARM)) || \
++- (_MSC_VER >= 1926 && (defined(_M_ARM64) || defined(_M_ARM64EC))))
+++ (_MSC_VER >= 1926 && (defined(_M_ARM64) || defined(_M_ARM64EC)))) && \
+++ !defined(__clang__) && (QT_CONFIG_neon == 1)
+ #define WEBP_USE_NEON
+ #define WEBP_USE_INTRINSICS
+ #endif
+diff --git a/qtimageformats/src/3rdparty/libwebp/qt_attribution.json b/qtimageformats/src/3rdparty/libwebp/qt_attribution.json
+index 75ba3764c72f..f1ddc6e1ff90 100644
+--- a/qtimageformats/src/3rdparty/libwebp/qt_attribution.json
++++ b/qtimageformats/src/3rdparty/libwebp/qt_attribution.json
+@@ -6,7 +6,8 @@
+
+ "Description": "WebP is a new image format that provides lossless and lossy compression for images on the web.",
+ "Homepage": "https://developers.google.com/speed/webp/",
+- "Version": "1.2.4",
++ "Version": "1.3.2",
++ "DownloadLocation": "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.2.tar.gz",
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseId": "BSD-3-Clause",
+ "LicenseFile": "COPYING",
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv.c b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv.c
+index 8b3ab7216b45..a07456488843 100644
+--- a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv.c
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv.c
+@@ -15,15 +15,21 @@
+
+ #include <assert.h>
+ #include <limits.h>
+-#include <math.h>
++#include <stddef.h>
+ #include <stdlib.h>
+ #include <string.h>
+
+ #include "src/webp/types.h"
+-#include "src/dsp/cpu.h"
++#include "sharpyuv/sharpyuv_cpu.h"
+ #include "sharpyuv/sharpyuv_dsp.h"
+ #include "sharpyuv/sharpyuv_gamma.h"
+
++//------------------------------------------------------------------------------
++
++int SharpYuvGetVersion(void) {
++ return SHARPYUV_VERSION;
++}
++
+ //------------------------------------------------------------------------------
+ // Sharp RGB->YUV conversion
+
+@@ -414,24 +420,46 @@ static int DoSharpArgbToYuv(const uint8_t* r_ptr, const uint8_t* g_ptr,
+ }
+ #undef SAFE_ALLOC
+
++#if defined(WEBP_USE_THREAD) && !defined(_WIN32)
++#include <pthread.h> // NOLINT
++
++#define LOCK_ACCESS \
++ static pthread_mutex_t sharpyuv_lock = PTHREAD_MUTEX_INITIALIZER; \
++ if (pthread_mutex_lock(&sharpyuv_lock)) return
++#define UNLOCK_ACCESS_AND_RETURN \
++ do { \
++ (void)pthread_mutex_unlock(&sharpyuv_lock); \
++ return; \
++ } while (0)
++#else // !(defined(WEBP_USE_THREAD) && !defined(_WIN32))
++#define LOCK_ACCESS do {} while (0)
++#define UNLOCK_ACCESS_AND_RETURN return
++#endif // defined(WEBP_USE_THREAD) && !defined(_WIN32)
++
+ // Hidden exported init function.
+-// By default SharpYuvConvert calls it with NULL. If needed, users can declare
+-// it as extern and call it with a VP8CPUInfo function.
+-extern void SharpYuvInit(VP8CPUInfo cpu_info_func);
++// By default SharpYuvConvert calls it with SharpYuvGetCPUInfo. If needed,
++// users can declare it as extern and call it with an alternate VP8CPUInfo
++// function.
++extern VP8CPUInfo SharpYuvGetCPUInfo;
++SHARPYUV_EXTERN void SharpYuvInit(VP8CPUInfo cpu_info_func);
+ void SharpYuvInit(VP8CPUInfo cpu_info_func) {
+ static volatile VP8CPUInfo sharpyuv_last_cpuinfo_used =
+ (VP8CPUInfo)&sharpyuv_last_cpuinfo_used;
+- const int initialized =
+- (sharpyuv_last_cpuinfo_used != (VP8CPUInfo)&sharpyuv_last_cpuinfo_used);
+- if (cpu_info_func == NULL && initialized) return;
+- if (sharpyuv_last_cpuinfo_used == cpu_info_func) return;
+-
+- SharpYuvInitDsp(cpu_info_func);
+- if (!initialized) {
+- SharpYuvInitGammaTables();
++ LOCK_ACCESS;
++ // Only update SharpYuvGetCPUInfo when called from external code to avoid a
++ // race on reading the value in SharpYuvConvert().
++ if (cpu_info_func != (VP8CPUInfo)&SharpYuvGetCPUInfo) {
++ SharpYuvGetCPUInfo = cpu_info_func;
++ }
++ if (sharpyuv_last_cpuinfo_used == SharpYuvGetCPUInfo) {
++ UNLOCK_ACCESS_AND_RETURN;
+ }
+
+- sharpyuv_last_cpuinfo_used = cpu_info_func;
++ SharpYuvInitDsp();
++ SharpYuvInitGammaTables();
++
++ sharpyuv_last_cpuinfo_used = SharpYuvGetCPUInfo;
++ UNLOCK_ACCESS_AND_RETURN;
+ }
+
+ int SharpYuvConvert(const void* r_ptr, const void* g_ptr,
+@@ -467,7 +495,8 @@ int SharpYuvConvert(const void* r_ptr, const void* g_ptr,
+ // Stride should be even for uint16_t buffers.
+ return 0;
+ }
+- SharpYuvInit(NULL);
++ // The address of the function pointer is used to avoid a read race.
++ SharpYuvInit((VP8CPUInfo)&SharpYuvGetCPUInfo);
+
+ // Add scaling factor to go from rgb_bit_depth to yuv_bit_depth, to the
+ // rgb->yuv conversion matrix.
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv.h b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv.h
+index 9386ea21850a..7b9904d6f956 100644
+--- a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv.h
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv.h
+@@ -12,16 +12,32 @@
+ #ifndef WEBP_SHARPYUV_SHARPYUV_H_
+ #define WEBP_SHARPYUV_SHARPYUV_H_
+
+-#include <inttypes.h>
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
++#ifndef SHARPYUV_EXTERN
++#ifdef WEBP_EXTERN
++#define SHARPYUV_EXTERN WEBP_EXTERN
++#else
++// This explicitly marks library functions and allows for changing the
++// signature for e.g., Windows DLL builds.
++#if defined(__GNUC__) && __GNUC__ >= 4
++#define SHARPYUV_EXTERN extern __attribute__((visibility("default")))
++#else
++#if defined(_MSC_VER) && defined(WEBP_DLL)
++#define SHARPYUV_EXTERN __declspec(dllexport)
++#else
++#define SHARPYUV_EXTERN extern
++#endif /* _MSC_VER && WEBP_DLL */
++#endif /* __GNUC__ >= 4 */
++#endif /* WEBP_EXTERN */
++#endif /* SHARPYUV_EXTERN */
++
+ // SharpYUV API version following the convention from semver.org
+ #define SHARPYUV_VERSION_MAJOR 0
+-#define SHARPYUV_VERSION_MINOR 1
+-#define SHARPYUV_VERSION_PATCH 0
++#define SHARPYUV_VERSION_MINOR 2
++#define SHARPYUV_VERSION_PATCH 1
+ // Version as a uint32_t. The major number is the high 8 bits.
+ // The minor number is the middle 8 bits. The patch number is the low 16 bits.
+ #define SHARPYUV_MAKE_VERSION(MAJOR, MINOR, PATCH) \
+@@ -30,6 +46,10 @@ extern "C" {
+ SHARPYUV_MAKE_VERSION(SHARPYUV_VERSION_MAJOR, SHARPYUV_VERSION_MINOR, \
+ SHARPYUV_VERSION_PATCH)
+
++// Returns the library's version number, packed in hexadecimal. See
++// SHARPYUV_VERSION.
++SHARPYUV_EXTERN int SharpYuvGetVersion(void);
++
+ // RGB to YUV conversion matrix, in 16 bit fixed point.
+ // y = rgb_to_y[0] * r + rgb_to_y[1] * g + rgb_to_y[2] * b + rgb_to_y[3]
+ // u = rgb_to_u[0] * r + rgb_to_u[1] * g + rgb_to_u[2] * b + rgb_to_u[3]
+@@ -65,11 +85,13 @@ typedef struct {
+ // adjacent pixels on the y, u and v channels. If yuv_bit_depth > 8, they
+ // should be multiples of 2.
+ // width, height: width and height of the image in pixels
+-int SharpYuvConvert(const void* r_ptr, const void* g_ptr, const void* b_ptr,
+- int rgb_step, int rgb_stride, int rgb_bit_depth,
+- void* y_ptr, int y_stride, void* u_ptr, int u_stride,
+- void* v_ptr, int v_stride, int yuv_bit_depth, int width,
+- int height, const SharpYuvConversionMatrix* yuv_matrix);
++SHARPYUV_EXTERN int SharpYuvConvert(const void* r_ptr, const void* g_ptr,
++ const void* b_ptr, int rgb_step,
++ int rgb_stride, int rgb_bit_depth,
++ void* y_ptr, int y_stride, void* u_ptr,
++ int u_stride, void* v_ptr, int v_stride,
++ int yuv_bit_depth, int width, int height,
++ const SharpYuvConversionMatrix* yuv_matrix);
+
+ // TODO(b/194336375): Add YUV444 to YUV420 conversion. Maybe also add 422
+ // support (it's rarely used in practice, especially for images).
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c
+new file mode 100644
+index 000000000000..29425a0c4918
+--- /dev/null
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c
+@@ -0,0 +1,14 @@
++// Copyright 2022 Google Inc. All Rights Reserved.
++//
++// Use of this source code is governed by a BSD-style license
++// that can be found in the COPYING file in the root of the source
++// tree. An additional intellectual property rights grant can be found
++// in the file PATENTS. All contributing project authors may
++// be found in the AUTHORS file in the root of the source tree.
++// -----------------------------------------------------------------------------
++//
++#include "sharpyuv/sharpyuv_cpu.h"
++
++// Include src/dsp/cpu.c to create SharpYuvGetCPUInfo from VP8GetCPUInfo. The
++// function pointer is renamed in sharpyuv_cpu.h.
++#include "src/dsp/cpu.c"
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.h b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.h
+new file mode 100644
+index 000000000000..176ca3eb1682
+--- /dev/null
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.h
+@@ -0,0 +1,22 @@
++// Copyright 2022 Google Inc. All Rights Reserved.
++//
++// Use of this source code is governed by a BSD-style license
++// that can be found in the COPYING file in the root of the source
++// tree. An additional intellectual property rights grant can be found
++// in the file PATENTS. All contributing project authors may
++// be found in the AUTHORS file in the root of the source tree.
++// -----------------------------------------------------------------------------
++//
++#ifndef WEBP_SHARPYUV_SHARPYUV_CPU_H_
++#define WEBP_SHARPYUV_SHARPYUV_CPU_H_
++
++#include "sharpyuv/sharpyuv.h"
++
++// Avoid exporting SharpYuvGetCPUInfo in shared object / DLL builds.
++// SharpYuvInit() replaces the use of the function pointer.
++#undef WEBP_EXTERN
++#define WEBP_EXTERN extern
++#define VP8GetCPUInfo SharpYuvGetCPUInfo
++#include "src/dsp/cpu.h"
++
++#endif // WEBP_SHARPYUV_SHARPYUV_CPU_H_
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.c b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.c
+index 5334fa64fa93..0ad22be9458c 100644
+--- a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.c
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.c
+@@ -13,7 +13,7 @@
+
+ #include <assert.h>
+ #include <math.h>
+-#include <string.h>
++#include <stddef.h>
+
+ static int ToFixed16(float f) { return (int)floor(f * (1 << 16) + 0.5f); }
+
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.h b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.h
+index 63c99ef5cd5b..3214e3ac6075 100644
+--- a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.h
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.h
+@@ -35,8 +35,9 @@ typedef struct {
+ } SharpYuvColorSpace;
+
+ // Fills in 'matrix' for the given YUVColorSpace.
+-void SharpYuvComputeConversionMatrix(const SharpYuvColorSpace* yuv_color_space,
+- SharpYuvConversionMatrix* matrix);
++SHARPYUV_EXTERN void SharpYuvComputeConversionMatrix(
++ const SharpYuvColorSpace* yuv_color_space,
++ SharpYuvConversionMatrix* matrix);
+
+ // Enums for precomputed conversion matrices.
+ typedef enum {
+@@ -49,7 +50,7 @@ typedef enum {
+ } SharpYuvMatrixType;
+
+ // Returns a pointer to a matrix for one of the predefined colorspaces.
+-const SharpYuvConversionMatrix* SharpYuvGetConversionMatrix(
++SHARPYUV_EXTERN const SharpYuvConversionMatrix* SharpYuvGetConversionMatrix(
+ SharpYuvMatrixType matrix_type);
+
+ #ifdef __cplusplus
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c
+index 956fa7ce5506..0da3efc0b813 100644
+--- a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c
+@@ -16,7 +16,7 @@
+ #include <assert.h>
+ #include <stdlib.h>
+
+-#include "src/dsp/cpu.h"
++#include "sharpyuv/sharpyuv_cpu.h"
+
+ //-----------------------------------------------------------------------------
+
+@@ -72,26 +72,28 @@ void (*SharpYuvFilterRow)(const int16_t* A, const int16_t* B, int len,
+ const uint16_t* best_y, uint16_t* out,
+ int bit_depth);
+
++extern VP8CPUInfo SharpYuvGetCPUInfo;
+ extern void InitSharpYuvSSE2(void);
+ extern void InitSharpYuvNEON(void);
+
+-void SharpYuvInitDsp(VP8CPUInfo cpu_info_func) {
+- (void)cpu_info_func;
+-
++void SharpYuvInitDsp(void) {
+ #if !WEBP_NEON_OMIT_C_CODE
+ SharpYuvUpdateY = SharpYuvUpdateY_C;
+ SharpYuvUpdateRGB = SharpYuvUpdateRGB_C;
+ SharpYuvFilterRow = SharpYuvFilterRow_C;
+ #endif
+
++ if (SharpYuvGetCPUInfo != NULL) {
+ #if defined(WEBP_HAVE_SSE2)
+- if (cpu_info_func == NULL || cpu_info_func(kSSE2)) {
+- InitSharpYuvSSE2();
+- }
++ if (SharpYuvGetCPUInfo(kSSE2)) {
++ InitSharpYuvSSE2();
++ }
+ #endif // WEBP_HAVE_SSE2
++ }
+
+ #if defined(WEBP_HAVE_NEON)
+- if (WEBP_NEON_OMIT_C_CODE || cpu_info_func == NULL || cpu_info_func(kNEON)) {
++ if (WEBP_NEON_OMIT_C_CODE ||
++ (SharpYuvGetCPUInfo != NULL && SharpYuvGetCPUInfo(kNEON))) {
+ InitSharpYuvNEON();
+ }
+ #endif // WEBP_HAVE_NEON
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.h b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.h
+index e561d8d3d040..805fbadbf657 100644
+--- a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.h
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.h
+@@ -12,9 +12,8 @@
+ #ifndef WEBP_SHARPYUV_SHARPYUV_DSP_H_
+ #define WEBP_SHARPYUV_SHARPYUV_DSP_H_
+
+-#include <stdint.h>
+-
+-#include "src/dsp/cpu.h"
++#include "sharpyuv/sharpyuv_cpu.h"
++#include "src/webp/types.h"
+
+ extern uint64_t (*SharpYuvUpdateY)(const uint16_t* src, const uint16_t* ref,
+ uint16_t* dst, int len, int bit_depth);
+@@ -24,6 +23,6 @@ extern void (*SharpYuvFilterRow)(const int16_t* A, const int16_t* B, int len,
+ const uint16_t* best_y, uint16_t* out,
+ int bit_depth);
+
+-void SharpYuvInitDsp(VP8CPUInfo cpu_info_func);
++void SharpYuvInitDsp(void);
+
+ #endif // WEBP_SHARPYUV_SHARPYUV_DSP_H_
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c
+index 05b5436f831b..20ab2da6bcbf 100644
+--- a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c
+@@ -13,7 +13,6 @@
+
+ #include <assert.h>
+ #include <math.h>
+-#include <stdint.h>
+
+ #include "src/webp/types.h"
+
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h
+index 2f1a3ff4a03e..d13aff59e185 100644
+--- a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h
+@@ -12,7 +12,7 @@
+ #ifndef WEBP_SHARPYUV_SHARPYUV_GAMMA_H_
+ #define WEBP_SHARPYUV_SHARPYUV_GAMMA_H_
+
+-#include <stdint.h>
++#include "src/webp/types.h"
+
+ #ifdef __cplusplus
+ extern "C" {
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_neon.c b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_neon.c
+index 5cf6aaffb07d..5840914865e0 100644
+--- a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_neon.c
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_neon.c
+@@ -17,11 +17,6 @@
+ #include <assert.h>
+ #include <stdlib.h>
+ #include <arm_neon.h>
+-#endif
+-
+-extern void InitSharpYuvNEON(void);
+-
+-#if defined(WEBP_USE_NEON)
+
+ static uint16_t clip_NEON(int v, int max) {
+ return (v < 0) ? 0 : (v > max) ? max : (uint16_t)v;
+@@ -169,6 +164,8 @@ static void SharpYuvFilterRow_NEON(const int16_t* A, const int16_t* B, int len,
+
+ //------------------------------------------------------------------------------
+
++extern void InitSharpYuvNEON(void);
++
+ WEBP_TSAN_IGNORE_FUNCTION void InitSharpYuvNEON(void) {
+ SharpYuvUpdateY = SharpYuvUpdateY_NEON;
+ SharpYuvUpdateRGB = SharpYuvUpdateRGB_NEON;
+@@ -177,6 +174,8 @@ WEBP_TSAN_IGNORE_FUNCTION void InitSharpYuvNEON(void) {
+
+ #else // !WEBP_USE_NEON
+
++extern void InitSharpYuvNEON(void);
++
+ void InitSharpYuvNEON(void) {}
+
+ #endif // WEBP_USE_NEON
+diff --git a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_sse2.c b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_sse2.c
+index 19438737480a..9744d1bb6cfe 100644
+--- a/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_sse2.c
++++ b/qtimageformats/src/3rdparty/libwebp/sharpyuv/sharpyuv_sse2.c
+@@ -16,11 +16,6 @@
+ #if defined(WEBP_USE_SSE2)
+ #include <stdlib.h>
+ #include <emmintrin.h>
+-#endif
+-
+-extern void InitSharpYuvSSE2(void);
+-
+-#if defined(WEBP_USE_SSE2)
+
+ static uint16_t clip_SSE2(int v, int max) {
+ return (v < 0) ? 0 : (v > max) ? max : (uint16_t)v;
+@@ -199,6 +194,8 @@ WEBP_TSAN_IGNORE_FUNCTION void InitSharpYuvSSE2(void) {
+ }
+ #else // !WEBP_USE_SSE2
+
++extern void InitSharpYuvSSE2(void);
++
+ void InitSharpYuvSSE2(void) {}
+
+ #endif // WEBP_USE_SSE2
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dec/tree_dec.c b/qtimageformats/src/3rdparty/libwebp/src/dec/tree_dec.c
+index 1c6fdea27cc6..243460595329 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dec/tree_dec.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dec/tree_dec.c
+@@ -12,10 +12,11 @@
+ // Author: Skal (pascal.massimino@gmail.com)
+
+ #include "src/dec/vp8i_dec.h"
++#include "src/dsp/cpu.h"
+ #include "src/utils/bit_reader_inl_utils.h"
+
+ #if !defined(USE_GENERIC_TREE)
+-#if !defined(__arm__) && !defined(_M_ARM) && !defined(__aarch64__)
++#if !defined(__arm__) && !defined(_M_ARM) && !WEBP_AARCH64
+ // using a table is ~1-2% slower on ARM. Prefer the coded-tree approach then.
+ #define USE_GENERIC_TREE 1 // ALTERNATE_CODE
+ #else
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dec/vp8_dec.c b/qtimageformats/src/3rdparty/libwebp/src/dec/vp8_dec.c
+index 2003935ec464..20b92e84c4fc 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dec/vp8_dec.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dec/vp8_dec.c
+@@ -494,6 +494,8 @@ static int GetCoeffsAlt(VP8BitReader* const br,
+ return 16;
+ }
+
++extern VP8CPUInfo VP8GetCPUInfo;
++
+ WEBP_DSP_INIT_FUNC(InitGetCoeffs) {
+ if (VP8GetCPUInfo != NULL && VP8GetCPUInfo(kSlowSSSE3)) {
+ GetCoeffs = GetCoeffsAlt;
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dec/vp8i_dec.h b/qtimageformats/src/3rdparty/libwebp/src/dec/vp8i_dec.h
+index 30c1bd3ef9ba..7929fd7506a4 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dec/vp8i_dec.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/dec/vp8i_dec.h
+@@ -31,8 +31,8 @@ extern "C" {
+
+ // version numbers
+ #define DEC_MAJ_VERSION 1
+-#define DEC_MIN_VERSION 2
+-#define DEC_REV_VERSION 4
++#define DEC_MIN_VERSION 3
++#define DEC_REV_VERSION 2
+
+ // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
+ // Constraints are: We need to store one 16x16 block of luma samples (y),
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dec/vp8l_dec.c b/qtimageformats/src/3rdparty/libwebp/src/dec/vp8l_dec.c
+index 13480551282e..7995313fa19c 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dec/vp8l_dec.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dec/vp8l_dec.c
+@@ -253,11 +253,11 @@ static int ReadHuffmanCodeLengths(
+ int symbol;
+ int max_symbol;
+ int prev_code_len = DEFAULT_CODE_LENGTH;
+- HuffmanCode table[1 << LENGTHS_TABLE_BITS];
++ HuffmanTables tables;
+
+- if (!VP8LBuildHuffmanTable(table, LENGTHS_TABLE_BITS,
+- code_length_code_lengths,
+- NUM_CODE_LENGTH_CODES)) {
++ if (!VP8LHuffmanTablesAllocate(1 << LENGTHS_TABLE_BITS, &tables) ||
++ !VP8LBuildHuffmanTable(&tables, LENGTHS_TABLE_BITS,
++ code_length_code_lengths, NUM_CODE_LENGTH_CODES)) {
+ goto End;
+ }
+
+@@ -277,7 +277,7 @@ static int ReadHuffmanCodeLengths(
+ int code_len;
+ if (max_symbol-- == 0) break;
+ VP8LFillBitWindow(br);
+- p = &table[VP8LPrefetchBits(br) & LENGTHS_TABLE_MASK];
++ p = &tables.curr_segment->start[VP8LPrefetchBits(br) & LENGTHS_TABLE_MASK];
+ VP8LSetBitPos(br, br->bit_pos_ + p->bits);
+ code_len = p->value;
+ if (code_len < kCodeLengthLiterals) {
+@@ -300,6 +300,7 @@ static int ReadHuffmanCodeLengths(
+ ok = 1;
+
+ End:
++ VP8LHuffmanTablesDeallocate(&tables);
+ if (!ok) dec->status_ = VP8_STATUS_BITSTREAM_ERROR;
+ return ok;
+ }
+@@ -307,7 +308,8 @@ static int ReadHuffmanCodeLengths(
+ // 'code_lengths' is pre-allocated temporary buffer, used for creating Huffman
+ // tree.
+ static int ReadHuffmanCode(int alphabet_size, VP8LDecoder* const dec,
+- int* const code_lengths, HuffmanCode* const table) {
++ int* const code_lengths,
++ HuffmanTables* const table) {
+ int ok = 0;
+ int size = 0;
+ VP8LBitReader* const br = &dec->br_;
+@@ -362,8 +364,7 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
+ VP8LMetadata* const hdr = &dec->hdr_;
+ uint32_t* huffman_image = NULL;
+ HTreeGroup* htree_groups = NULL;
+- HuffmanCode* huffman_tables = NULL;
+- HuffmanCode* huffman_table = NULL;
++ HuffmanTables* huffman_tables = &hdr->huffman_tables_;
+ int num_htree_groups = 1;
+ int num_htree_groups_max = 1;
+ int max_alphabet_size = 0;
+@@ -372,6 +373,10 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
+ int* mapping = NULL;
+ int ok = 0;
+
++ // Check the table has been 0 initialized (through InitMetadata).
++ assert(huffman_tables->root.start == NULL);
++ assert(huffman_tables->curr_segment == NULL);
++
+ if (allow_recursion && VP8LReadBits(br, 1)) {
+ // use meta Huffman codes.
+ const int huffman_precision = VP8LReadBits(br, 3) + 2;
+@@ -434,16 +439,15 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
+
+ code_lengths = (int*)WebPSafeCalloc((uint64_t)max_alphabet_size,
+ sizeof(*code_lengths));
+- huffman_tables = (HuffmanCode*)WebPSafeMalloc(num_htree_groups * table_size,
+- sizeof(*huffman_tables));
+ htree_groups = VP8LHtreeGroupsNew(num_htree_groups);
+
+- if (htree_groups == NULL || code_lengths == NULL || huffman_tables == NULL) {
++ if (htree_groups == NULL || code_lengths == NULL ||
++ !VP8LHuffmanTablesAllocate(num_htree_groups * table_size,
++ huffman_tables)) {
+ dec->status_ = VP8_STATUS_OUT_OF_MEMORY;
+ goto Error;
+ }
+
+- huffman_table = huffman_tables;
+ for (i = 0; i < num_htree_groups_max; ++i) {
+ // If the index "i" is unused in the Huffman image, just make sure the
+ // coefficients are valid but do not store them.
+@@ -468,19 +472,20 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
+ int max_bits = 0;
+ for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {
+ int alphabet_size = kAlphabetSize[j];
+- htrees[j] = huffman_table;
+ if (j == 0 && color_cache_bits > 0) {
+ alphabet_size += (1 << color_cache_bits);
+ }
+- size = ReadHuffmanCode(alphabet_size, dec, code_lengths, huffman_table);
++ size =
++ ReadHuffmanCode(alphabet_size, dec, code_lengths, huffman_tables);
++ htrees[j] = huffman_tables->curr_segment->curr_table;
+ if (size == 0) {
+ goto Error;
+ }
+ if (is_trivial_literal && kLiteralMap[j] == 1) {
+- is_trivial_literal = (huffman_table->bits == 0);
++ is_trivial_literal = (htrees[j]->bits == 0);
+ }
+- total_size += huffman_table->bits;
+- huffman_table += size;
++ total_size += htrees[j]->bits;
++ huffman_tables->curr_segment->curr_table += size;
+ if (j <= ALPHA) {
+ int local_max_bits = code_lengths[0];
+ int k;
+@@ -515,14 +520,13 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
+ hdr->huffman_image_ = huffman_image;
+ hdr->num_htree_groups_ = num_htree_groups;
+ hdr->htree_groups_ = htree_groups;
+- hdr->huffman_tables_ = huffman_tables;
+
+ Error:
+ WebPSafeFree(code_lengths);
+ WebPSafeFree(mapping);
+ if (!ok) {
+ WebPSafeFree(huffman_image);
+- WebPSafeFree(huffman_tables);
++ VP8LHuffmanTablesDeallocate(huffman_tables);
+ VP8LHtreeGroupsFree(htree_groups);
+ }
+ return ok;
+@@ -1336,7 +1340,7 @@ static int ReadTransform(int* const xsize, int const* ysize,
+ ok = ok && ExpandColorMap(num_colors, transform);
+ break;
+ }
+- case SUBTRACT_GREEN:
++ case SUBTRACT_GREEN_TRANSFORM:
+ break;
+ default:
+ assert(0); // can't happen
+@@ -1358,7 +1362,7 @@ static void ClearMetadata(VP8LMetadata* const hdr) {
+ assert(hdr != NULL);
+
+ WebPSafeFree(hdr->huffman_image_);
+- WebPSafeFree(hdr->huffman_tables_);
++ VP8LHuffmanTablesDeallocate(&hdr->huffman_tables_);
+ VP8LHtreeGroupsFree(hdr->htree_groups_);
+ VP8LColorCacheClear(&hdr->color_cache_);
+ VP8LColorCacheClear(&hdr->saved_color_cache_);
+@@ -1673,7 +1677,7 @@ int VP8LDecodeImage(VP8LDecoder* const dec) {
+
+ if (dec == NULL) return 0;
+
+- assert(dec->hdr_.huffman_tables_ != NULL);
++ assert(dec->hdr_.huffman_tables_.root.start != NULL);
+ assert(dec->hdr_.htree_groups_ != NULL);
+ assert(dec->hdr_.num_htree_groups_ > 0);
+
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dec/vp8li_dec.h b/qtimageformats/src/3rdparty/libwebp/src/dec/vp8li_dec.h
+index 72b2e8612084..32540a4b88a0 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dec/vp8li_dec.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/dec/vp8li_dec.h
+@@ -51,7 +51,7 @@ typedef struct {
+ uint32_t* huffman_image_;
+ int num_htree_groups_;
+ HTreeGroup* htree_groups_;
+- HuffmanCode* huffman_tables_;
++ HuffmanTables huffman_tables_;
+ } VP8LMetadata;
+
+ typedef struct VP8LDecoder VP8LDecoder;
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dec/webp_dec.c b/qtimageformats/src/3rdparty/libwebp/src/dec/webp_dec.c
+index 77a54c55d287..f557868b9985 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dec/webp_dec.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dec/webp_dec.c
+@@ -179,7 +179,7 @@ static VP8StatusCode ParseOptionalChunks(const uint8_t** const data,
+ return VP8_STATUS_BITSTREAM_ERROR; // Not a valid chunk size.
+ }
+ // For odd-sized chunk-payload, there's one byte padding at the end.
+- disk_chunk_size = (CHUNK_HEADER_SIZE + chunk_size + 1) & ~1;
++ disk_chunk_size = (CHUNK_HEADER_SIZE + chunk_size + 1) & ~1u;
+ total_size += disk_chunk_size;
+
+ // Check that total bytes skipped so far does not exceed riff_size.
+@@ -658,19 +658,26 @@ uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size,
+ uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size,
+ int* width, int* height, uint8_t** u, uint8_t** v,
+ int* stride, int* uv_stride) {
+- WebPDecBuffer output; // only to preserve the side-infos
+- uint8_t* const out = Decode(MODE_YUV, data, data_size,
+- width, height, &output);
+-
+- if (out != NULL) {
+- const WebPYUVABuffer* const buf = &output.u.YUVA;
+- *u = buf->u;
+- *v = buf->v;
+- *stride = buf->y_stride;
+- *uv_stride = buf->u_stride;
+- assert(buf->u_stride == buf->v_stride);
+- }
+- return out;
++ // data, width and height are checked by Decode().
++ if (u == NULL || v == NULL || stride == NULL || uv_stride == NULL) {
++ return NULL;
++ }
++
++ {
++ WebPDecBuffer output; // only to preserve the side-infos
++ uint8_t* const out = Decode(MODE_YUV, data, data_size,
++ width, height, &output);
++
++ if (out != NULL) {
++ const WebPYUVABuffer* const buf = &output.u.YUVA;
++ *u = buf->u;
++ *v = buf->v;
++ *stride = buf->y_stride;
++ *uv_stride = buf->u_stride;
++ assert(buf->u_stride == buf->v_stride);
++ }
++ return out;
++ }
+ }
+
+ static void DefaultFeatures(WebPBitstreamFeatures* const features) {
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/demux/demux.c b/qtimageformats/src/3rdparty/libwebp/src/demux/demux.c
+index 41387ec2d657..4b0d3f59e913 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/demux/demux.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/demux/demux.c
+@@ -24,8 +24,8 @@
+ #include "src/webp/format_constants.h"
+
+ #define DMUX_MAJ_VERSION 1
+-#define DMUX_MIN_VERSION 2
+-#define DMUX_REV_VERSION 4
++#define DMUX_MIN_VERSION 3
++#define DMUX_REV_VERSION 2
+
+ typedef struct {
+ size_t start_; // start location of the data
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing.c
+index 1892929a431b..1d152f24dada 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing.c
+@@ -425,6 +425,7 @@ void (*WebPAlphaReplace)(uint32_t* src, int length, uint32_t color);
+ //------------------------------------------------------------------------------
+ // Init function
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void WebPInitAlphaProcessingMIPSdspR2(void);
+ extern void WebPInitAlphaProcessingSSE2(void);
+ extern void WebPInitAlphaProcessingSSE41(void);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing_sse2.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing_sse2.c
+index a5f8c9f7c766..f0843d0febcf 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing_sse2.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing_sse2.c
+@@ -26,8 +26,8 @@ static int DispatchAlpha_SSE2(const uint8_t* WEBP_RESTRICT alpha,
+ uint32_t alpha_and = 0xff;
+ int i, j;
+ const __m128i zero = _mm_setzero_si128();
+- const __m128i rgb_mask = _mm_set1_epi32(0xffffff00u); // to preserve RGB
+- const __m128i all_0xff = _mm_set_epi32(0, 0, ~0u, ~0u);
++ const __m128i rgb_mask = _mm_set1_epi32((int)0xffffff00); // to preserve RGB
++ const __m128i all_0xff = _mm_set_epi32(0, 0, ~0, ~0);
+ __m128i all_alphas = all_0xff;
+
+ // We must be able to access 3 extra bytes after the last written byte
+@@ -106,8 +106,8 @@ static int ExtractAlpha_SSE2(const uint8_t* WEBP_RESTRICT argb, int argb_stride,
+ // value is not 0xff if any of the alpha[] is not equal to 0xff.
+ uint32_t alpha_and = 0xff;
+ int i, j;
+- const __m128i a_mask = _mm_set1_epi32(0xffu); // to preserve alpha
+- const __m128i all_0xff = _mm_set_epi32(0, 0, ~0u, ~0u);
++ const __m128i a_mask = _mm_set1_epi32(0xff); // to preserve alpha
++ const __m128i all_0xff = _mm_set_epi32(0, 0, ~0, ~0);
+ __m128i all_alphas = all_0xff;
+
+ // We must be able to access 3 extra bytes after the last written byte
+@@ -178,7 +178,7 @@ static int ExtractAlpha_SSE2(const uint8_t* WEBP_RESTRICT argb, int argb_stride,
+ static void ApplyAlphaMultiply_SSE2(uint8_t* rgba, int alpha_first,
+ int w, int h, int stride) {
+ const __m128i zero = _mm_setzero_si128();
+- const __m128i kMult = _mm_set1_epi16(0x8081u);
++ const __m128i kMult = _mm_set1_epi16((short)0x8081);
+ const __m128i kMask = _mm_set_epi16(0, 0xff, 0xff, 0, 0, 0xff, 0xff, 0);
+ const int kSpan = 4;
+ while (h-- > 0) {
+@@ -267,7 +267,7 @@ static int HasAlpha32b_SSE2(const uint8_t* src, int length) {
+ }
+
+ static void AlphaReplace_SSE2(uint32_t* src, int length, uint32_t color) {
+- const __m128i m_color = _mm_set1_epi32(color);
++ const __m128i m_color = _mm_set1_epi32((int)color);
+ const __m128i zero = _mm_setzero_si128();
+ int i = 0;
+ for (; i + 8 <= length; i += 8) {
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing_sse41.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing_sse41.c
+index cdf877ce49ff..1156ac3417b2 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing_sse41.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/alpha_processing_sse41.c
+@@ -26,7 +26,7 @@ static int ExtractAlpha_SSE41(const uint8_t* WEBP_RESTRICT argb,
+ // value is not 0xff if any of the alpha[] is not equal to 0xff.
+ uint32_t alpha_and = 0xff;
+ int i, j;
+- const __m128i all_0xff = _mm_set1_epi32(~0u);
++ const __m128i all_0xff = _mm_set1_epi32(~0);
+ __m128i all_alphas = all_0xff;
+
+ // We must be able to access 3 extra bytes after the last written byte
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/cost.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/cost.c
+index 460ec4f2a764..73d2140177cb 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/cost.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/cost.c
+@@ -374,6 +374,7 @@ static void SetResidualCoeffs_C(const int16_t* const coeffs,
+ VP8GetResidualCostFunc VP8GetResidualCost;
+ VP8SetResidualCoeffsFunc VP8SetResidualCoeffs;
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void VP8EncDspCostInitMIPS32(void);
+ extern void VP8EncDspCostInitMIPSdspR2(void);
+ extern void VP8EncDspCostInitSSE2(void);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/cost_neon.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/cost_neon.c
+index 8cc8ce58aa14..6582669cb3f9 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/cost_neon.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/cost_neon.c
+@@ -29,7 +29,7 @@ static void SetResidualCoeffs_NEON(const int16_t* const coeffs,
+ const uint8x16_t eob = vcombine_u8(vqmovn_u16(eob_0), vqmovn_u16(eob_1));
+ const uint8x16_t masked = vandq_u8(eob, vld1q_u8(position));
+
+-#ifdef __aarch64__
++#if WEBP_AARCH64
+ res->last = vmaxvq_u8(masked) - 1;
+ #else
+ const uint8x8_t eob_8x8 = vmax_u8(vget_low_u8(masked), vget_high_u8(masked));
+@@ -43,7 +43,7 @@ static void SetResidualCoeffs_NEON(const int16_t* const coeffs,
+
+ vst1_lane_s32(&res->last, vreinterpret_s32_u32(eob_32x2), 0);
+ --res->last;
+-#endif // __aarch64__
++#endif // WEBP_AARCH64
+
+ res->coeffs = coeffs;
+ }
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/cpu.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/cpu.c
+index a4ba7f2cb70e..2234c77b3568 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/cpu.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/cpu.c
+@@ -173,6 +173,7 @@ static int x86CPUInfo(CPUFeature feature) {
+ }
+ return 0;
+ }
++WEBP_EXTERN VP8CPUInfo VP8GetCPUInfo;
+ VP8CPUInfo VP8GetCPUInfo = x86CPUInfo;
+ #elif defined(WEBP_ANDROID_NEON) // NB: needs to be before generic NEON test.
+ static int AndroidCPUInfo(CPUFeature feature) {
+@@ -184,6 +185,7 @@ static int AndroidCPUInfo(CPUFeature feature) {
+ }
+ return 0;
+ }
++WEBP_EXTERN VP8CPUInfo VP8GetCPUInfo;
+ VP8CPUInfo VP8GetCPUInfo = AndroidCPUInfo;
+ #elif defined(EMSCRIPTEN) // also needs to be before generic NEON test
+ // Use compile flags as an indicator of SIMD support instead of a runtime check.
+@@ -208,11 +210,12 @@ static int wasmCPUInfo(CPUFeature feature) {
+ }
+ return 0;
+ }
++WEBP_EXTERN VP8CPUInfo VP8GetCPUInfo;
+ VP8CPUInfo VP8GetCPUInfo = wasmCPUInfo;
+ #elif defined(WEBP_HAVE_NEON)
+ // In most cases this function doesn't check for NEON support (it's assumed by
+ // the configuration), but enables turning off NEON at runtime, for testing
+-// purposes, by setting VP8DecGetCPUInfo = NULL.
++// purposes, by setting VP8GetCPUInfo = NULL.
+ static int armCPUInfo(CPUFeature feature) {
+ if (feature != kNEON) return 0;
+ #if defined(__linux__) && defined(WEBP_HAVE_NEON_RTCD)
+@@ -236,6 +239,7 @@ static int armCPUInfo(CPUFeature feature) {
+ return 1;
+ #endif
+ }
++WEBP_EXTERN VP8CPUInfo VP8GetCPUInfo;
+ VP8CPUInfo VP8GetCPUInfo = armCPUInfo;
+ #elif defined(WEBP_USE_MIPS32) || defined(WEBP_USE_MIPS_DSP_R2) || \
+ defined(WEBP_USE_MSA)
+@@ -247,7 +251,9 @@ static int mipsCPUInfo(CPUFeature feature) {
+ }
+
+ }
++WEBP_EXTERN VP8CPUInfo VP8GetCPUInfo;
+ VP8CPUInfo VP8GetCPUInfo = mipsCPUInfo;
+ #else
++WEBP_EXTERN VP8CPUInfo VP8GetCPUInfo;
+ VP8CPUInfo VP8GetCPUInfo = NULL;
+ #endif
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/cpu.h b/qtimageformats/src/3rdparty/libwebp/src/dsp/cpu.h
+index 8cf3e924a5d8..581ecbd76c2b 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/cpu.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/cpu.h
+@@ -16,6 +16,8 @@
+
+ #include <qglobal.h>
+
++#include <stddef.h>
++
+ #ifdef HAVE_CONFIG_H
+ #include "src/webp/config.h"
+ #endif
+@@ -43,6 +45,9 @@
+ #define __has_builtin(x) 0
+ #endif
+
++//------------------------------------------------------------------------------
++// x86 defines.
++
+ #if !defined(HAVE_CONFIG_H)
+ #if defined(_MSC_VER) && _MSC_VER > 1310 && \
+ (defined(_M_X64) || defined(_M_IX86)) && !defined(__clang__)
+@@ -80,6 +85,9 @@
+ #undef WEBP_MSC_SSE41
+ #undef WEBP_MSC_SSE2
+
++//------------------------------------------------------------------------------
++// Arm defines.
++
+ // The intrinsics currently cause compiler errors with arm-nacl-gcc and the
+ // inline assembly would need to be modified for use with Native Client.
+ #if ((defined(__ARM_NEON__) || defined(__aarch64__)) && \
+@@ -98,17 +106,27 @@
+ // inclusion of arm64_neon.h; Visual Studio 2019 includes this file in
+ // arm_neon.h. Compile errors were seen with Visual Studio 2019 16.4 with
+ // vtbl4_u8(); a fix was made in 16.6.
+-#if defined(_MSC_VER) && ((_MSC_VER >= 1700 && defined(_M_ARM)) || \
+- (_MSC_VER >= 1926 && defined(_M_ARM64))) && \
+- !defined(__clang__) && (QT_CONFIG_neon == 1)
++#if defined(_MSC_VER) && \
++ ((_MSC_VER >= 1700 && defined(_M_ARM)) || \
++ (_MSC_VER >= 1926 && (defined(_M_ARM64) || defined(_M_ARM64EC)))) && \
++ !defined(__clang__) && (QT_CONFIG_neon == 1)
+ #define WEBP_USE_NEON
+ #define WEBP_USE_INTRINSICS
+ #endif
+
++#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
++#define WEBP_AARCH64 1
++#else
++#define WEBP_AARCH64 0
++#endif
++
+ #if defined(WEBP_USE_NEON) && !defined(WEBP_HAVE_NEON)
+ #define WEBP_HAVE_NEON
+ #endif
+
++//------------------------------------------------------------------------------
++// MIPS defines.
++
+ #if defined(__mips__) && !defined(__mips64) && defined(__mips_isa_rev) && \
+ (__mips_isa_rev >= 1) && (__mips_isa_rev < 6)
+ #define WEBP_USE_MIPS32
+@@ -124,6 +142,8 @@
+ #define WEBP_USE_MSA
+ #endif
+
++//------------------------------------------------------------------------------
++
+ #ifndef WEBP_DSP_OMIT_C_CODE
+ #define WEBP_DSP_OMIT_C_CODE 1
+ #endif
+@@ -134,13 +154,14 @@
+ #define WEBP_NEON_OMIT_C_CODE 0
+ #endif
+
+-#if !(LOCAL_CLANG_PREREQ(3, 8) || LOCAL_GCC_PREREQ(4, 8) || \
+- defined(__aarch64__))
++#if !(LOCAL_CLANG_PREREQ(3, 8) || LOCAL_GCC_PREREQ(4, 8) || WEBP_AARCH64)
+ #define WEBP_NEON_WORK_AROUND_GCC 1
+ #else
+ #define WEBP_NEON_WORK_AROUND_GCC 0
+ #endif
+
++//------------------------------------------------------------------------------
++
+ // This macro prevents thread_sanitizer from reporting known concurrent writes.
+ #define WEBP_TSAN_IGNORE_FUNCTION
+ #if defined(__has_feature)
+@@ -242,16 +263,7 @@ typedef enum {
+ kMSA
+ } CPUFeature;
+
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-
+ // returns true if the CPU supports the feature.
+ typedef int (*VP8CPUInfo)(CPUFeature feature);
+-WEBP_EXTERN VP8CPUInfo VP8GetCPUInfo;
+-
+-#ifdef __cplusplus
+-} // extern "C"
+-#endif
+
+ #endif // WEBP_DSP_CPU_H_
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/dec.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/dec.c
+index 537c70128246..33d8df8a621f 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/dec.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/dec.c
+@@ -734,6 +734,7 @@ VP8SimpleFilterFunc VP8SimpleHFilter16i;
+ void (*VP8DitherCombine8x8)(const uint8_t* dither, uint8_t* dst,
+ int dst_stride);
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void VP8DspInitSSE2(void);
+ extern void VP8DspInitSSE41(void);
+ extern void VP8DspInitNEON(void);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_neon.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_neon.c
+index fa851707e265..22784cf15ae9 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_neon.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_neon.c
+@@ -1428,7 +1428,7 @@ static WEBP_INLINE void DC8_NEON(uint8_t* dst, int do_top, int do_left) {
+
+ if (do_top) {
+ const uint8x8_t A = vld1_u8(dst - BPS); // top row
+-#if defined(__aarch64__)
++#if WEBP_AARCH64
+ const uint16_t p2 = vaddlv_u8(A);
+ sum_top = vdupq_n_u16(p2);
+ #else
+@@ -1511,7 +1511,7 @@ static WEBP_INLINE void DC16_NEON(uint8_t* dst, int do_top, int do_left) {
+
+ if (do_top) {
+ const uint8x16_t A = vld1q_u8(dst - BPS); // top row
+-#if defined(__aarch64__)
++#if WEBP_AARCH64
+ const uint16_t p3 = vaddlvq_u8(A);
+ sum_top = vdupq_n_u16(p3);
+ #else
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_sse2.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_sse2.c
+index 873aa59e8a97..01e6bcb636f0 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_sse2.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_sse2.c
+@@ -158,10 +158,10 @@ static void Transform_SSE2(const int16_t* in, uint8_t* dst, int do_two) {
+ dst3 = _mm_loadl_epi64((__m128i*)(dst + 3 * BPS));
+ } else {
+ // Load four bytes/pixels per line.
+- dst0 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 0 * BPS));
+- dst1 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 1 * BPS));
+- dst2 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 2 * BPS));
+- dst3 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 3 * BPS));
++ dst0 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 0 * BPS));
++ dst1 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 1 * BPS));
++ dst2 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 2 * BPS));
++ dst3 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 3 * BPS));
+ }
+ // Convert to 16b.
+ dst0 = _mm_unpacklo_epi8(dst0, zero);
+@@ -187,10 +187,10 @@ static void Transform_SSE2(const int16_t* in, uint8_t* dst, int do_two) {
+ _mm_storel_epi64((__m128i*)(dst + 3 * BPS), dst3);
+ } else {
+ // Store four bytes/pixels per line.
+- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(dst0));
+- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(dst1));
+- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(dst2));
+- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(dst3));
++ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(dst0));
++ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(dst1));
++ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(dst2));
++ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(dst3));
+ }
+ }
+ }
+@@ -213,10 +213,10 @@ static void TransformAC3(const int16_t* in, uint8_t* dst) {
+ const __m128i m3 = _mm_subs_epi16(B, d4);
+ const __m128i zero = _mm_setzero_si128();
+ // Load the source pixels.
+- __m128i dst0 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 0 * BPS));
+- __m128i dst1 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 1 * BPS));
+- __m128i dst2 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 2 * BPS));
+- __m128i dst3 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 3 * BPS));
++ __m128i dst0 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 0 * BPS));
++ __m128i dst1 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 1 * BPS));
++ __m128i dst2 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 2 * BPS));
++ __m128i dst3 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 3 * BPS));
+ // Convert to 16b.
+ dst0 = _mm_unpacklo_epi8(dst0, zero);
+ dst1 = _mm_unpacklo_epi8(dst1, zero);
+@@ -233,10 +233,10 @@ static void TransformAC3(const int16_t* in, uint8_t* dst) {
+ dst2 = _mm_packus_epi16(dst2, dst2);
+ dst3 = _mm_packus_epi16(dst3, dst3);
+ // Store the results.
+- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(dst0));
+- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(dst1));
+- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(dst2));
+- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(dst3));
++ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(dst0));
++ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(dst1));
++ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(dst2));
++ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(dst3));
+ }
+ #undef MUL
+ #endif // USE_TRANSFORM_AC3
+@@ -477,11 +477,11 @@ static WEBP_INLINE void Load8x4_SSE2(const uint8_t* const b, int stride,
+ // A0 = 63 62 61 60 23 22 21 20 43 42 41 40 03 02 01 00
+ // A1 = 73 72 71 70 33 32 31 30 53 52 51 50 13 12 11 10
+ const __m128i A0 = _mm_set_epi32(
+- WebPMemToUint32(&b[6 * stride]), WebPMemToUint32(&b[2 * stride]),
+- WebPMemToUint32(&b[4 * stride]), WebPMemToUint32(&b[0 * stride]));
++ WebPMemToInt32(&b[6 * stride]), WebPMemToInt32(&b[2 * stride]),
++ WebPMemToInt32(&b[4 * stride]), WebPMemToInt32(&b[0 * stride]));
+ const __m128i A1 = _mm_set_epi32(
+- WebPMemToUint32(&b[7 * stride]), WebPMemToUint32(&b[3 * stride]),
+- WebPMemToUint32(&b[5 * stride]), WebPMemToUint32(&b[1 * stride]));
++ WebPMemToInt32(&b[7 * stride]), WebPMemToInt32(&b[3 * stride]),
++ WebPMemToInt32(&b[5 * stride]), WebPMemToInt32(&b[1 * stride]));
+
+ // B0 = 53 43 52 42 51 41 50 40 13 03 12 02 11 01 10 00
+ // B1 = 73 63 72 62 71 61 70 60 33 23 32 22 31 21 30 20
+@@ -540,7 +540,7 @@ static WEBP_INLINE void Store4x4_SSE2(__m128i* const x,
+ uint8_t* dst, int stride) {
+ int i;
+ for (i = 0; i < 4; ++i, dst += stride) {
+- WebPUint32ToMem(dst, _mm_cvtsi128_si32(*x));
++ WebPInt32ToMem(dst, _mm_cvtsi128_si32(*x));
+ *x = _mm_srli_si128(*x, 4);
+ }
+ }
+@@ -908,10 +908,10 @@ static void VE4_SSE2(uint8_t* dst) { // vertical
+ const __m128i lsb = _mm_and_si128(_mm_xor_si128(ABCDEFGH, CDEFGH00), one);
+ const __m128i b = _mm_subs_epu8(a, lsb);
+ const __m128i avg = _mm_avg_epu8(b, BCDEFGH0);
+- const uint32_t vals = _mm_cvtsi128_si32(avg);
++ const int vals = _mm_cvtsi128_si32(avg);
+ int i;
+ for (i = 0; i < 4; ++i) {
+- WebPUint32ToMem(dst + i * BPS, vals);
++ WebPInt32ToMem(dst + i * BPS, vals);
+ }
+ }
+
+@@ -925,10 +925,10 @@ static void LD4_SSE2(uint8_t* dst) { // Down-Left
+ const __m128i lsb = _mm_and_si128(_mm_xor_si128(ABCDEFGH, CDEFGHH0), one);
+ const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
+ const __m128i abcdefg = _mm_avg_epu8(avg2, BCDEFGH0);
+- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcdefg ));
+- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
+- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
+- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
++ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcdefg ));
++ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
++ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
++ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
+ }
+
+ static void VR4_SSE2(uint8_t* dst) { // Vertical-Right
+@@ -946,10 +946,10 @@ static void VR4_SSE2(uint8_t* dst) { // Vertical-Right
+ const __m128i lsb = _mm_and_si128(_mm_xor_si128(IXABCD, ABCD0), one);
+ const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
+ const __m128i efgh = _mm_avg_epu8(avg2, XABCD);
+- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcd ));
+- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( efgh ));
+- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1)));
+- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1)));
++ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcd ));
++ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( efgh ));
++ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1)));
++ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1)));
+
+ // these two are hard to implement in SSE2, so we keep the C-version:
+ DST(0, 2) = AVG3(J, I, X);
+@@ -970,11 +970,12 @@ static void VL4_SSE2(uint8_t* dst) { // Vertical-Left
+ const __m128i abbc = _mm_or_si128(ab, bc);
+ const __m128i lsb2 = _mm_and_si128(abbc, lsb1);
+ const __m128i avg4 = _mm_subs_epu8(avg3, lsb2);
+- const uint32_t extra_out = _mm_cvtsi128_si32(_mm_srli_si128(avg4, 4));
+- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( avg1 ));
+- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( avg4 ));
+- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg1, 1)));
+- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg4, 1)));
++ const uint32_t extra_out =
++ (uint32_t)_mm_cvtsi128_si32(_mm_srli_si128(avg4, 4));
++ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( avg1 ));
++ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( avg4 ));
++ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg1, 1)));
++ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg4, 1)));
+
+ // these two are hard to get and irregular
+ DST(3, 2) = (extra_out >> 0) & 0xff;
+@@ -990,7 +991,7 @@ static void RD4_SSE2(uint8_t* dst) { // Down-right
+ const uint32_t K = dst[-1 + 2 * BPS];
+ const uint32_t L = dst[-1 + 3 * BPS];
+ const __m128i LKJI_____ =
+- _mm_cvtsi32_si128(L | (K << 8) | (J << 16) | (I << 24));
++ _mm_cvtsi32_si128((int)(L | (K << 8) | (J << 16) | (I << 24)));
+ const __m128i LKJIXABCD = _mm_or_si128(LKJI_____, ____XABCD);
+ const __m128i KJIXABCD_ = _mm_srli_si128(LKJIXABCD, 1);
+ const __m128i JIXABCD__ = _mm_srli_si128(LKJIXABCD, 2);
+@@ -998,10 +999,10 @@ static void RD4_SSE2(uint8_t* dst) { // Down-right
+ const __m128i lsb = _mm_and_si128(_mm_xor_si128(JIXABCD__, LKJIXABCD), one);
+ const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
+ const __m128i abcdefg = _mm_avg_epu8(avg2, KJIXABCD_);
+- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32( abcdefg ));
+- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
+- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
+- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
++ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32( abcdefg ));
++ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
++ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
++ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
+ }
+
+ #undef DST
+@@ -1015,13 +1016,13 @@ static WEBP_INLINE void TrueMotion_SSE2(uint8_t* dst, int size) {
+ const __m128i zero = _mm_setzero_si128();
+ int y;
+ if (size == 4) {
+- const __m128i top_values = _mm_cvtsi32_si128(WebPMemToUint32(top));
++ const __m128i top_values = _mm_cvtsi32_si128(WebPMemToInt32(top));
+ const __m128i top_base = _mm_unpacklo_epi8(top_values, zero);
+ for (y = 0; y < 4; ++y, dst += BPS) {
+ const int val = dst[-1] - top[-1];
+ const __m128i base = _mm_set1_epi16(val);
+ const __m128i out = _mm_packus_epi16(_mm_add_epi16(base, top_base), zero);
+- WebPUint32ToMem(dst, _mm_cvtsi128_si32(out));
++ WebPInt32ToMem(dst, _mm_cvtsi128_si32(out));
+ }
+ } else if (size == 8) {
+ const __m128i top_values = _mm_loadl_epi64((const __m128i*)top);
+@@ -1062,7 +1063,7 @@ static void VE16_SSE2(uint8_t* dst) {
+ static void HE16_SSE2(uint8_t* dst) { // horizontal
+ int j;
+ for (j = 16; j > 0; --j) {
+- const __m128i values = _mm_set1_epi8(dst[-1]);
++ const __m128i values = _mm_set1_epi8((char)dst[-1]);
+ _mm_storeu_si128((__m128i*)dst, values);
+ dst += BPS;
+ }
+@@ -1070,7 +1071,7 @@ static void HE16_SSE2(uint8_t* dst) { // horizontal
+
+ static WEBP_INLINE void Put16_SSE2(uint8_t v, uint8_t* dst) {
+ int j;
+- const __m128i values = _mm_set1_epi8(v);
++ const __m128i values = _mm_set1_epi8((char)v);
+ for (j = 0; j < 16; ++j) {
+ _mm_storeu_si128((__m128i*)(dst + j * BPS), values);
+ }
+@@ -1130,7 +1131,7 @@ static void VE8uv_SSE2(uint8_t* dst) { // vertical
+ // helper for chroma-DC predictions
+ static WEBP_INLINE void Put8x8uv_SSE2(uint8_t v, uint8_t* dst) {
+ int j;
+- const __m128i values = _mm_set1_epi8(v);
++ const __m128i values = _mm_set1_epi8((char)v);
+ for (j = 0; j < 8; ++j) {
+ _mm_storel_epi64((__m128i*)(dst + j * BPS), values);
+ }
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_sse41.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_sse41.c
+index 8f18506d54bf..08a363027226 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_sse41.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/dec_sse41.c
+@@ -23,7 +23,7 @@ static void HE16_SSE41(uint8_t* dst) { // horizontal
+ int j;
+ const __m128i kShuffle3 = _mm_set1_epi8(3);
+ for (j = 16; j > 0; --j) {
+- const __m128i in = _mm_cvtsi32_si128(WebPMemToUint32(dst - 4));
++ const __m128i in = _mm_cvtsi32_si128(WebPMemToInt32(dst - 4));
+ const __m128i values = _mm_shuffle_epi8(in, kShuffle3);
+ _mm_storeu_si128((__m128i*)dst, values);
+ dst += BPS;
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/enc.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/enc.c
+index ea47a3fd9547..2ba97ba8d661 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/enc.c
+@@ -732,6 +732,7 @@ VP8QuantizeBlockWHT VP8EncQuantizeBlockWHT;
+ VP8BlockCopy VP8Copy4x4;
+ VP8BlockCopy VP8Copy16x8;
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void VP8EncDspInitSSE2(void);
+ extern void VP8EncDspInitSSE41(void);
+ extern void VP8EncDspInitNEON(void);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/enc_neon.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/enc_neon.c
+index 601962ba76b6..714800367ba7 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/enc_neon.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/enc_neon.c
+@@ -764,9 +764,14 @@ static WEBP_INLINE void AccumulateSSE16_NEON(const uint8_t* const a,
+
+ // Horizontal sum of all four uint32_t values in 'sum'.
+ static int SumToInt_NEON(uint32x4_t sum) {
++#if WEBP_AARCH64
++ return (int)vaddvq_u32(sum);
++#else
+ const uint64x2_t sum2 = vpaddlq_u32(sum);
+- const uint64_t sum3 = vgetq_lane_u64(sum2, 0) + vgetq_lane_u64(sum2, 1);
+- return (int)sum3;
++ const uint32x2_t sum3 = vadd_u32(vreinterpret_u32_u64(vget_low_u64(sum2)),
++ vreinterpret_u32_u64(vget_high_u64(sum2)));
++ return (int)vget_lane_u32(sum3, 0);
++#endif
+ }
+
+ static int SSE16x16_NEON(const uint8_t* a, const uint8_t* b) {
+@@ -860,7 +865,7 @@ static int QuantizeBlock_NEON(int16_t in[16], int16_t out[16],
+ uint8x8x4_t shuffles;
+ // vtbl?_u8 are marked unavailable for iOS arm64 with Xcode < 6.3, use
+ // non-standard versions there.
+-#if defined(__APPLE__) && defined(__aarch64__) && \
++#if defined(__APPLE__) && WEBP_AARCH64 && \
+ defined(__apple_build_version__) && (__apple_build_version__< 6020037)
+ uint8x16x2_t all_out;
+ INIT_VECTOR2(all_out, vreinterpretq_u8_s16(out0), vreinterpretq_u8_s16(out1));
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/enc_sse2.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/enc_sse2.c
+index b2e78ed9411f..010624a2f712 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/enc_sse2.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/enc_sse2.c
+@@ -25,9 +25,160 @@
+ //------------------------------------------------------------------------------
+ // Transforms (Paragraph 14.4)
+
+-// Does one or two inverse transforms.
+-static void ITransform_SSE2(const uint8_t* ref, const int16_t* in, uint8_t* dst,
+- int do_two) {
++// Does one inverse transform.
++static void ITransform_One_SSE2(const uint8_t* ref, const int16_t* in,
++ uint8_t* dst) {
++ // This implementation makes use of 16-bit fixed point versions of two
++ // multiply constants:
++ // K1 = sqrt(2) * cos (pi/8) ~= 85627 / 2^16
++ // K2 = sqrt(2) * sin (pi/8) ~= 35468 / 2^16
++ //
++ // To be able to use signed 16-bit integers, we use the following trick to
++ // have constants within range:
++ // - Associated constants are obtained by subtracting the 16-bit fixed point
++ // version of one:
++ // k = K - (1 << 16) => K = k + (1 << 16)
++ // K1 = 85267 => k1 = 20091
++ // K2 = 35468 => k2 = -30068
++ // - The multiplication of a variable by a constant become the sum of the
++ // variable and the multiplication of that variable by the associated
++ // constant:
++ // (x * K) >> 16 = (x * (k + (1 << 16))) >> 16 = ((x * k ) >> 16) + x
++ const __m128i k1k2 = _mm_set_epi16(-30068, -30068, -30068, -30068,
++ 20091, 20091, 20091, 20091);
++ const __m128i k2k1 = _mm_set_epi16(20091, 20091, 20091, 20091,
++ -30068, -30068, -30068, -30068);
++ const __m128i zero = _mm_setzero_si128();
++ const __m128i zero_four = _mm_set_epi16(0, 0, 0, 0, 4, 4, 4, 4);
++ __m128i T01, T23;
++
++ // Load and concatenate the transform coefficients.
++ const __m128i in01 = _mm_loadu_si128((const __m128i*)&in[0]);
++ const __m128i in23 = _mm_loadu_si128((const __m128i*)&in[8]);
++ // a00 a10 a20 a30 a01 a11 a21 a31
++ // a02 a12 a22 a32 a03 a13 a23 a33
++
++ // Vertical pass and subsequent transpose.
++ {
++ const __m128i in1 = _mm_unpackhi_epi64(in01, in01);
++ const __m128i in3 = _mm_unpackhi_epi64(in23, in23);
++
++ // First pass, c and d calculations are longer because of the "trick"
++ // multiplications.
++ // c = MUL(in1, K2) - MUL(in3, K1) = MUL(in1, k2) - MUL(in3, k1) + in1 - in3
++ // d = MUL(in1, K1) + MUL(in3, K2) = MUL(in1, k1) + MUL(in3, k2) + in1 + in3
++ const __m128i a_d3 = _mm_add_epi16(in01, in23);
++ const __m128i b_c3 = _mm_sub_epi16(in01, in23);
++ const __m128i c1d1 = _mm_mulhi_epi16(in1, k2k1);
++ const __m128i c2d2 = _mm_mulhi_epi16(in3, k1k2);
++ const __m128i c3 = _mm_unpackhi_epi64(b_c3, b_c3);
++ const __m128i c4 = _mm_sub_epi16(c1d1, c2d2);
++ const __m128i c = _mm_add_epi16(c3, c4);
++ const __m128i d4u = _mm_add_epi16(c1d1, c2d2);
++ const __m128i du = _mm_add_epi16(a_d3, d4u);
++ const __m128i d = _mm_unpackhi_epi64(du, du);
++
++ // Second pass.
++ const __m128i comb_ab = _mm_unpacklo_epi64(a_d3, b_c3);
++ const __m128i comb_dc = _mm_unpacklo_epi64(d, c);
++
++ const __m128i tmp01 = _mm_add_epi16(comb_ab, comb_dc);
++ const __m128i tmp32 = _mm_sub_epi16(comb_ab, comb_dc);
++ const __m128i tmp23 = _mm_shuffle_epi32(tmp32, _MM_SHUFFLE(1, 0, 3, 2));
++
++ const __m128i transpose_0 = _mm_unpacklo_epi16(tmp01, tmp23);
++ const __m128i transpose_1 = _mm_unpackhi_epi16(tmp01, tmp23);
++ // a00 a20 a01 a21 a02 a22 a03 a23
++ // a10 a30 a11 a31 a12 a32 a13 a33
++
++ T01 = _mm_unpacklo_epi16(transpose_0, transpose_1);
++ T23 = _mm_unpackhi_epi16(transpose_0, transpose_1);
++ // a00 a10 a20 a30 a01 a11 a21 a31
++ // a02 a12 a22 a32 a03 a13 a23 a33
++ }
++
++ // Horizontal pass and subsequent transpose.
++ {
++ const __m128i T1 = _mm_unpackhi_epi64(T01, T01);
++ const __m128i T3 = _mm_unpackhi_epi64(T23, T23);
++
++ // First pass, c and d calculations are longer because of the "trick"
++ // multiplications.
++ const __m128i dc = _mm_add_epi16(T01, zero_four);
++
++ // c = MUL(T1, K2) - MUL(T3, K1) = MUL(T1, k2) - MUL(T3, k1) + T1 - T3
++ // d = MUL(T1, K1) + MUL(T3, K2) = MUL(T1, k1) + MUL(T3, k2) + T1 + T3
++ const __m128i a_d3 = _mm_add_epi16(dc, T23);
++ const __m128i b_c3 = _mm_sub_epi16(dc, T23);
++ const __m128i c1d1 = _mm_mulhi_epi16(T1, k2k1);
++ const __m128i c2d2 = _mm_mulhi_epi16(T3, k1k2);
++ const __m128i c3 = _mm_unpackhi_epi64(b_c3, b_c3);
++ const __m128i c4 = _mm_sub_epi16(c1d1, c2d2);
++ const __m128i c = _mm_add_epi16(c3, c4);
++ const __m128i d4u = _mm_add_epi16(c1d1, c2d2);
++ const __m128i du = _mm_add_epi16(a_d3, d4u);
++ const __m128i d = _mm_unpackhi_epi64(du, du);
++
++ // Second pass.
++ const __m128i comb_ab = _mm_unpacklo_epi64(a_d3, b_c3);
++ const __m128i comb_dc = _mm_unpacklo_epi64(d, c);
++
++ const __m128i tmp01 = _mm_add_epi16(comb_ab, comb_dc);
++ const __m128i tmp32 = _mm_sub_epi16(comb_ab, comb_dc);
++ const __m128i tmp23 = _mm_shuffle_epi32(tmp32, _MM_SHUFFLE(1, 0, 3, 2));
++
++ const __m128i shifted01 = _mm_srai_epi16(tmp01, 3);
++ const __m128i shifted23 = _mm_srai_epi16(tmp23, 3);
++ // a00 a01 a02 a03 a10 a11 a12 a13
++ // a20 a21 a22 a23 a30 a31 a32 a33
++
++ const __m128i transpose_0 = _mm_unpacklo_epi16(shifted01, shifted23);
++ const __m128i transpose_1 = _mm_unpackhi_epi16(shifted01, shifted23);
++ // a00 a20 a01 a21 a02 a22 a03 a23
++ // a10 a30 a11 a31 a12 a32 a13 a33
++
++ T01 = _mm_unpacklo_epi16(transpose_0, transpose_1);
++ T23 = _mm_unpackhi_epi16(transpose_0, transpose_1);
++ // a00 a10 a20 a30 a01 a11 a21 a31
++ // a02 a12 a22 a32 a03 a13 a23 a33
++ }
++
++ // Add inverse transform to 'ref' and store.
++ {
++ // Load the reference(s).
++ __m128i ref01, ref23, ref0123;
++ int32_t buf[4];
++
++ // Load four bytes/pixels per line.
++ const __m128i ref0 = _mm_cvtsi32_si128(WebPMemToInt32(&ref[0 * BPS]));
++ const __m128i ref1 = _mm_cvtsi32_si128(WebPMemToInt32(&ref[1 * BPS]));
++ const __m128i ref2 = _mm_cvtsi32_si128(WebPMemToInt32(&ref[2 * BPS]));
++ const __m128i ref3 = _mm_cvtsi32_si128(WebPMemToInt32(&ref[3 * BPS]));
++ ref01 = _mm_unpacklo_epi32(ref0, ref1);
++ ref23 = _mm_unpacklo_epi32(ref2, ref3);
++
++ // Convert to 16b.
++ ref01 = _mm_unpacklo_epi8(ref01, zero);
++ ref23 = _mm_unpacklo_epi8(ref23, zero);
++ // Add the inverse transform(s).
++ ref01 = _mm_add_epi16(ref01, T01);
++ ref23 = _mm_add_epi16(ref23, T23);
++ // Unsigned saturate to 8b.
++ ref0123 = _mm_packus_epi16(ref01, ref23);
++
++ _mm_storeu_si128((__m128i *)buf, ref0123);
++
++ // Store four bytes/pixels per line.
++ WebPInt32ToMem(&dst[0 * BPS], buf[0]);
++ WebPInt32ToMem(&dst[1 * BPS], buf[1]);
++ WebPInt32ToMem(&dst[2 * BPS], buf[2]);
++ WebPInt32ToMem(&dst[3 * BPS], buf[3]);
++ }
++}
++
++// Does two inverse transforms.
++static void ITransform_Two_SSE2(const uint8_t* ref, const int16_t* in,
++ uint8_t* dst) {
+ // This implementation makes use of 16-bit fixed point versions of two
+ // multiply constants:
+ // K1 = sqrt(2) * cos (pi/8) ~= 85627 / 2^16
+@@ -49,33 +200,21 @@ static void ITransform_SSE2(const uint8_t* ref, const int16_t* in, uint8_t* dst,
+ __m128i T0, T1, T2, T3;
+
+ // Load and concatenate the transform coefficients (we'll do two inverse
+- // transforms in parallel). In the case of only one inverse transform, the
+- // second half of the vectors will just contain random value we'll never
+- // use nor store.
++ // transforms in parallel).
+ __m128i in0, in1, in2, in3;
+ {
+- in0 = _mm_loadl_epi64((const __m128i*)&in[0]);
+- in1 = _mm_loadl_epi64((const __m128i*)&in[4]);
+- in2 = _mm_loadl_epi64((const __m128i*)&in[8]);
+- in3 = _mm_loadl_epi64((const __m128i*)&in[12]);
+- // a00 a10 a20 a30 x x x x
+- // a01 a11 a21 a31 x x x x
+- // a02 a12 a22 a32 x x x x
+- // a03 a13 a23 a33 x x x x
+- if (do_two) {
+- const __m128i inB0 = _mm_loadl_epi64((const __m128i*)&in[16]);
+- const __m128i inB1 = _mm_loadl_epi64((const __m128i*)&in[20]);
+- const __m128i inB2 = _mm_loadl_epi64((const __m128i*)&in[24]);
+- const __m128i inB3 = _mm_loadl_epi64((const __m128i*)&in[28]);
+- in0 = _mm_unpacklo_epi64(in0, inB0);
+- in1 = _mm_unpacklo_epi64(in1, inB1);
+- in2 = _mm_unpacklo_epi64(in2, inB2);
+- in3 = _mm_unpacklo_epi64(in3, inB3);
+- // a00 a10 a20 a30 b00 b10 b20 b30
+- // a01 a11 a21 a31 b01 b11 b21 b31
+- // a02 a12 a22 a32 b02 b12 b22 b32
+- // a03 a13 a23 a33 b03 b13 b23 b33
+- }
++ const __m128i tmp0 = _mm_loadu_si128((const __m128i*)&in[0]);
++ const __m128i tmp1 = _mm_loadu_si128((const __m128i*)&in[8]);
++ const __m128i tmp2 = _mm_loadu_si128((const __m128i*)&in[16]);
++ const __m128i tmp3 = _mm_loadu_si128((const __m128i*)&in[24]);
++ in0 = _mm_unpacklo_epi64(tmp0, tmp2);
++ in1 = _mm_unpackhi_epi64(tmp0, tmp2);
++ in2 = _mm_unpacklo_epi64(tmp1, tmp3);
++ in3 = _mm_unpackhi_epi64(tmp1, tmp3);
++ // a00 a10 a20 a30 b00 b10 b20 b30
++ // a01 a11 a21 a31 b01 b11 b21 b31
++ // a02 a12 a22 a32 b02 b12 b22 b32
++ // a03 a13 a23 a33 b03 b13 b23 b33
+ }
+
+ // Vertical pass and subsequent transpose.
+@@ -148,19 +287,11 @@ static void ITransform_SSE2(const uint8_t* ref, const int16_t* in, uint8_t* dst,
+ const __m128i zero = _mm_setzero_si128();
+ // Load the reference(s).
+ __m128i ref0, ref1, ref2, ref3;
+- if (do_two) {
+- // Load eight bytes/pixels per line.
+- ref0 = _mm_loadl_epi64((const __m128i*)&ref[0 * BPS]);
+- ref1 = _mm_loadl_epi64((const __m128i*)&ref[1 * BPS]);
+- ref2 = _mm_loadl_epi64((const __m128i*)&ref[2 * BPS]);
+- ref3 = _mm_loadl_epi64((const __m128i*)&ref[3 * BPS]);
+- } else {
+- // Load four bytes/pixels per line.
+- ref0 = _mm_cvtsi32_si128(WebPMemToUint32(&ref[0 * BPS]));
+- ref1 = _mm_cvtsi32_si128(WebPMemToUint32(&ref[1 * BPS]));
+- ref2 = _mm_cvtsi32_si128(WebPMemToUint32(&ref[2 * BPS]));
+- ref3 = _mm_cvtsi32_si128(WebPMemToUint32(&ref[3 * BPS]));
+- }
++ // Load eight bytes/pixels per line.
++ ref0 = _mm_loadl_epi64((const __m128i*)&ref[0 * BPS]);
++ ref1 = _mm_loadl_epi64((const __m128i*)&ref[1 * BPS]);
++ ref2 = _mm_loadl_epi64((const __m128i*)&ref[2 * BPS]);
++ ref3 = _mm_loadl_epi64((const __m128i*)&ref[3 * BPS]);
+ // Convert to 16b.
+ ref0 = _mm_unpacklo_epi8(ref0, zero);
+ ref1 = _mm_unpacklo_epi8(ref1, zero);
+@@ -176,20 +307,21 @@ static void ITransform_SSE2(const uint8_t* ref, const int16_t* in, uint8_t* dst,
+ ref1 = _mm_packus_epi16(ref1, ref1);
+ ref2 = _mm_packus_epi16(ref2, ref2);
+ ref3 = _mm_packus_epi16(ref3, ref3);
+- // Store the results.
+- if (do_two) {
+- // Store eight bytes/pixels per line.
+- _mm_storel_epi64((__m128i*)&dst[0 * BPS], ref0);
+- _mm_storel_epi64((__m128i*)&dst[1 * BPS], ref1);
+- _mm_storel_epi64((__m128i*)&dst[2 * BPS], ref2);
+- _mm_storel_epi64((__m128i*)&dst[3 * BPS], ref3);
+- } else {
+- // Store four bytes/pixels per line.
+- WebPUint32ToMem(&dst[0 * BPS], _mm_cvtsi128_si32(ref0));
+- WebPUint32ToMem(&dst[1 * BPS], _mm_cvtsi128_si32(ref1));
+- WebPUint32ToMem(&dst[2 * BPS], _mm_cvtsi128_si32(ref2));
+- WebPUint32ToMem(&dst[3 * BPS], _mm_cvtsi128_si32(ref3));
+- }
++ // Store eight bytes/pixels per line.
++ _mm_storel_epi64((__m128i*)&dst[0 * BPS], ref0);
++ _mm_storel_epi64((__m128i*)&dst[1 * BPS], ref1);
++ _mm_storel_epi64((__m128i*)&dst[2 * BPS], ref2);
++ _mm_storel_epi64((__m128i*)&dst[3 * BPS], ref3);
++ }
++}
++
++// Does one or two inverse transforms.
++static void ITransform_SSE2(const uint8_t* ref, const int16_t* in, uint8_t* dst,
++ int do_two) {
++ if (do_two) {
++ ITransform_Two_SSE2(ref, in, dst);
++ } else {
++ ITransform_One_SSE2(ref, in, dst);
+ }
+ }
+
+@@ -481,7 +613,7 @@ static void CollectHistogram_SSE2(const uint8_t* ref, const uint8_t* pred,
+ // helper for chroma-DC predictions
+ static WEBP_INLINE void Put8x8uv_SSE2(uint8_t v, uint8_t* dst) {
+ int j;
+- const __m128i values = _mm_set1_epi8(v);
++ const __m128i values = _mm_set1_epi8((char)v);
+ for (j = 0; j < 8; ++j) {
+ _mm_storel_epi64((__m128i*)(dst + j * BPS), values);
+ }
+@@ -489,7 +621,7 @@ static WEBP_INLINE void Put8x8uv_SSE2(uint8_t v, uint8_t* dst) {
+
+ static WEBP_INLINE void Put16_SSE2(uint8_t v, uint8_t* dst) {
+ int j;
+- const __m128i values = _mm_set1_epi8(v);
++ const __m128i values = _mm_set1_epi8((char)v);
+ for (j = 0; j < 16; ++j) {
+ _mm_store_si128((__m128i*)(dst + j * BPS), values);
+ }
+@@ -540,7 +672,7 @@ static WEBP_INLINE void VerticalPred_SSE2(uint8_t* dst,
+ static WEBP_INLINE void HE8uv_SSE2(uint8_t* dst, const uint8_t* left) {
+ int j;
+ for (j = 0; j < 8; ++j) {
+- const __m128i values = _mm_set1_epi8(left[j]);
++ const __m128i values = _mm_set1_epi8((char)left[j]);
+ _mm_storel_epi64((__m128i*)dst, values);
+ dst += BPS;
+ }
+@@ -549,7 +681,7 @@ static WEBP_INLINE void HE8uv_SSE2(uint8_t* dst, const uint8_t* left) {
+ static WEBP_INLINE void HE16_SSE2(uint8_t* dst, const uint8_t* left) {
+ int j;
+ for (j = 0; j < 16; ++j) {
+- const __m128i values = _mm_set1_epi8(left[j]);
++ const __m128i values = _mm_set1_epi8((char)left[j]);
+ _mm_store_si128((__m128i*)dst, values);
+ dst += BPS;
+ }
+@@ -722,10 +854,10 @@ static WEBP_INLINE void VE4_SSE2(uint8_t* dst,
+ const __m128i lsb = _mm_and_si128(_mm_xor_si128(ABCDEFGH, CDEFGH00), one);
+ const __m128i b = _mm_subs_epu8(a, lsb);
+ const __m128i avg = _mm_avg_epu8(b, BCDEFGH0);
+- const uint32_t vals = _mm_cvtsi128_si32(avg);
++ const int vals = _mm_cvtsi128_si32(avg);
+ int i;
+ for (i = 0; i < 4; ++i) {
+- WebPUint32ToMem(dst + i * BPS, vals);
++ WebPInt32ToMem(dst + i * BPS, vals);
+ }
+ }
+
+@@ -760,10 +892,10 @@ static WEBP_INLINE void LD4_SSE2(uint8_t* dst,
+ const __m128i lsb = _mm_and_si128(_mm_xor_si128(ABCDEFGH, CDEFGHH0), one);
+ const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
+ const __m128i abcdefg = _mm_avg_epu8(avg2, BCDEFGH0);
+- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcdefg ));
+- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
+- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
+- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
++ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcdefg ));
++ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
++ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
++ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
+ }
+
+ static WEBP_INLINE void VR4_SSE2(uint8_t* dst,
+@@ -782,10 +914,10 @@ static WEBP_INLINE void VR4_SSE2(uint8_t* dst,
+ const __m128i lsb = _mm_and_si128(_mm_xor_si128(IXABCD, ABCD0), one);
+ const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
+ const __m128i efgh = _mm_avg_epu8(avg2, XABCD);
+- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcd ));
+- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( efgh ));
+- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1)));
+- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1)));
++ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcd ));
++ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( efgh ));
++ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1)));
++ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1)));
+
+ // these two are hard to implement in SSE2, so we keep the C-version:
+ DST(0, 2) = AVG3(J, I, X);
+@@ -807,11 +939,12 @@ static WEBP_INLINE void VL4_SSE2(uint8_t* dst,
+ const __m128i abbc = _mm_or_si128(ab, bc);
+ const __m128i lsb2 = _mm_and_si128(abbc, lsb1);
+ const __m128i avg4 = _mm_subs_epu8(avg3, lsb2);
+- const uint32_t extra_out = _mm_cvtsi128_si32(_mm_srli_si128(avg4, 4));
+- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( avg1 ));
+- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( avg4 ));
+- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg1, 1)));
+- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg4, 1)));
++ const uint32_t extra_out =
++ (uint32_t)_mm_cvtsi128_si32(_mm_srli_si128(avg4, 4));
++ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( avg1 ));
++ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( avg4 ));
++ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg1, 1)));
++ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg4, 1)));
+
+ // these two are hard to get and irregular
+ DST(3, 2) = (extra_out >> 0) & 0xff;
+@@ -829,10 +962,10 @@ static WEBP_INLINE void RD4_SSE2(uint8_t* dst,
+ const __m128i lsb = _mm_and_si128(_mm_xor_si128(JIXABCD__, LKJIXABCD), one);
+ const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
+ const __m128i abcdefg = _mm_avg_epu8(avg2, KJIXABCD_);
+- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32( abcdefg ));
+- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
+- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
+- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
++ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32( abcdefg ));
++ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
++ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
++ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
+ }
+
+ static WEBP_INLINE void HU4_SSE2(uint8_t* dst, const uint8_t* top) {
+@@ -875,14 +1008,14 @@ static WEBP_INLINE void HD4_SSE2(uint8_t* dst, const uint8_t* top) {
+
+ static WEBP_INLINE void TM4_SSE2(uint8_t* dst, const uint8_t* top) {
+ const __m128i zero = _mm_setzero_si128();
+- const __m128i top_values = _mm_cvtsi32_si128(WebPMemToUint32(top));
++ const __m128i top_values = _mm_cvtsi32_si128(WebPMemToInt32(top));
+ const __m128i top_base = _mm_unpacklo_epi8(top_values, zero);
+ int y;
+ for (y = 0; y < 4; ++y, dst += BPS) {
+ const int val = top[-2 - y] - top[-1];
+ const __m128i base = _mm_set1_epi16(val);
+ const __m128i out = _mm_packus_epi16(_mm_add_epi16(base, top_base), zero);
+- WebPUint32ToMem(dst, _mm_cvtsi128_si32(out));
++ WebPInt32ToMem(dst, _mm_cvtsi128_si32(out));
+ }
+ }
+
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/filters.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/filters.c
+index 4506567ba363..85eee5098f00 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/filters.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/filters.c
+@@ -233,6 +233,7 @@ static void GradientUnfilter_C(const uint8_t* prev, const uint8_t* in,
+ WebPFilterFunc WebPFilters[WEBP_FILTER_LAST];
+ WebPUnfilterFunc WebPUnfilters[WEBP_FILTER_LAST];
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void VP8FiltersInitMIPSdspR2(void);
+ extern void VP8FiltersInitMSA(void);
+ extern void VP8FiltersInitNEON(void);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless.c
+index 84a54296fd6a..9f8120945397 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless.c
+@@ -49,7 +49,7 @@ static WEBP_INLINE uint32_t Clip255(uint32_t a) {
+ }
+
+ static WEBP_INLINE int AddSubtractComponentFull(int a, int b, int c) {
+- return Clip255(a + b - c);
++ return Clip255((uint32_t)(a + b - c));
+ }
+
+ static WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1,
+@@ -66,7 +66,7 @@ static WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1,
+ }
+
+ static WEBP_INLINE int AddSubtractComponentHalf(int a, int b) {
+- return Clip255(a + (a - b) / 2);
++ return Clip255((uint32_t)(a + (a - b) / 2));
+ }
+
+ static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1,
+@@ -293,10 +293,10 @@ void VP8LTransformColorInverse_C(const VP8LMultipliers* const m,
+ const uint32_t red = argb >> 16;
+ int new_red = red & 0xff;
+ int new_blue = argb & 0xff;
+- new_red += ColorTransformDelta(m->green_to_red_, green);
++ new_red += ColorTransformDelta((int8_t)m->green_to_red_, green);
+ new_red &= 0xff;
+- new_blue += ColorTransformDelta(m->green_to_blue_, green);
+- new_blue += ColorTransformDelta(m->red_to_blue_, (int8_t)new_red);
++ new_blue += ColorTransformDelta((int8_t)m->green_to_blue_, green);
++ new_blue += ColorTransformDelta((int8_t)m->red_to_blue_, (int8_t)new_red);
+ new_blue &= 0xff;
+ dst[i] = (argb & 0xff00ff00u) | (new_red << 16) | (new_blue);
+ }
+@@ -395,7 +395,7 @@ void VP8LInverseTransform(const VP8LTransform* const transform,
+ assert(row_start < row_end);
+ assert(row_end <= transform->ysize_);
+ switch (transform->type_) {
+- case SUBTRACT_GREEN:
++ case SUBTRACT_GREEN_TRANSFORM:
+ VP8LAddGreenToBlueAndRed(in, (row_end - row_start) * width, out);
+ break;
+ case PREDICTOR_TRANSFORM:
+@@ -588,6 +588,7 @@ VP8LConvertFunc VP8LConvertBGRAToBGR;
+ VP8LMapARGBFunc VP8LMapColor32b;
+ VP8LMapAlphaFunc VP8LMapColor8b;
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void VP8LDspInitSSE2(void);
+ extern void VP8LDspInitSSE41(void);
+ extern void VP8LDspInitNEON(void);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc.c
+index de6c4ace5f0d..cde1280617b0 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc.c
+@@ -522,11 +522,11 @@ static void GetCombinedEntropyUnrefined_C(const uint32_t X[],
+ void VP8LSubtractGreenFromBlueAndRed_C(uint32_t* argb_data, int num_pixels) {
+ int i;
+ for (i = 0; i < num_pixels; ++i) {
+- const int argb = argb_data[i];
++ const int argb = (int)argb_data[i];
+ const int green = (argb >> 8) & 0xff;
+ const uint32_t new_r = (((argb >> 16) & 0xff) - green) & 0xff;
+ const uint32_t new_b = (((argb >> 0) & 0xff) - green) & 0xff;
+- argb_data[i] = (argb & 0xff00ff00u) | (new_r << 16) | new_b;
++ argb_data[i] = ((uint32_t)argb & 0xff00ff00u) | (new_r << 16) | new_b;
+ }
+ }
+
+@@ -547,10 +547,10 @@ void VP8LTransformColor_C(const VP8LMultipliers* const m, uint32_t* data,
+ const int8_t red = U32ToS8(argb >> 16);
+ int new_red = red & 0xff;
+ int new_blue = argb & 0xff;
+- new_red -= ColorTransformDelta(m->green_to_red_, green);
++ new_red -= ColorTransformDelta((int8_t)m->green_to_red_, green);
+ new_red &= 0xff;
+- new_blue -= ColorTransformDelta(m->green_to_blue_, green);
+- new_blue -= ColorTransformDelta(m->red_to_blue_, red);
++ new_blue -= ColorTransformDelta((int8_t)m->green_to_blue_, green);
++ new_blue -= ColorTransformDelta((int8_t)m->red_to_blue_, red);
+ new_blue &= 0xff;
+ data[i] = (argb & 0xff00ff00u) | (new_red << 16) | (new_blue);
+ }
+@@ -560,7 +560,7 @@ static WEBP_INLINE uint8_t TransformColorRed(uint8_t green_to_red,
+ uint32_t argb) {
+ const int8_t green = U32ToS8(argb >> 8);
+ int new_red = argb >> 16;
+- new_red -= ColorTransformDelta(green_to_red, green);
++ new_red -= ColorTransformDelta((int8_t)green_to_red, green);
+ return (new_red & 0xff);
+ }
+
+@@ -569,9 +569,9 @@ static WEBP_INLINE uint8_t TransformColorBlue(uint8_t green_to_blue,
+ uint32_t argb) {
+ const int8_t green = U32ToS8(argb >> 8);
+ const int8_t red = U32ToS8(argb >> 16);
+- uint8_t new_blue = argb & 0xff;
+- new_blue -= ColorTransformDelta(green_to_blue, green);
+- new_blue -= ColorTransformDelta(red_to_blue, red);
++ int new_blue = argb & 0xff;
++ new_blue -= ColorTransformDelta((int8_t)green_to_blue, green);
++ new_blue -= ColorTransformDelta((int8_t)red_to_blue, red);
+ return (new_blue & 0xff);
+ }
+
+@@ -791,6 +791,7 @@ VP8LBundleColorMapFunc VP8LBundleColorMap;
+ VP8LPredictorAddSubFunc VP8LPredictorsSub[16];
+ VP8LPredictorAddSubFunc VP8LPredictorsSub_C[16];
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void VP8LEncDspInitSSE2(void);
+ extern void VP8LEncDspInitSSE41(void);
+ extern void VP8LEncDspInitNEON(void);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c
+index 7c7b73f8b692..e32c7961a239 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c
+@@ -25,7 +25,7 @@
+
+ // vtbl?_u8 are marked unavailable for iOS arm64 with Xcode < 6.3, use
+ // non-standard versions there.
+-#if defined(__APPLE__) && defined(__aarch64__) && \
++#if defined(__APPLE__) && WEBP_AARCH64 && \
+ defined(__apple_build_version__) && (__apple_build_version__< 6020037)
+ #define USE_VTBLQ
+ #endif
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c
+index 948001a3d556..66cbaab7720a 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c
+@@ -54,8 +54,8 @@ static void TransformColor_SSE2(const VP8LMultipliers* const m,
+ const __m128i mults_rb = MK_CST_16(CST_5b(m->green_to_red_),
+ CST_5b(m->green_to_blue_));
+ const __m128i mults_b2 = MK_CST_16(CST_5b(m->red_to_blue_), 0);
+- const __m128i mask_ag = _mm_set1_epi32(0xff00ff00); // alpha-green masks
+- const __m128i mask_rb = _mm_set1_epi32(0x00ff00ff); // red-blue masks
++ const __m128i mask_ag = _mm_set1_epi32((int)0xff00ff00); // alpha-green masks
++ const __m128i mask_rb = _mm_set1_epi32(0x00ff00ff); // red-blue masks
+ int i;
+ for (i = 0; i + 4 <= num_pixels; i += 4) {
+ const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]); // argb
+@@ -376,7 +376,7 @@ static void BundleColorMap_SSE2(const uint8_t* const row, int width, int xbits,
+ break;
+ }
+ case 2: {
+- const __m128i mask_or = _mm_set1_epi32(0xff000000);
++ const __m128i mask_or = _mm_set1_epi32((int)0xff000000);
+ const __m128i mul_cst = _mm_set1_epi16(0x0104);
+ const __m128i mask_mul = _mm_set1_epi16(0x0f00);
+ for (x = 0; x + 16 <= width; x += 16, dst += 4) {
+@@ -427,7 +427,7 @@ static WEBP_INLINE void Average2_m128i(const __m128i* const a0,
+ static void PredictorSub0_SSE2(const uint32_t* in, const uint32_t* upper,
+ int num_pixels, uint32_t* out) {
+ int i;
+- const __m128i black = _mm_set1_epi32(ARGB_BLACK);
++ const __m128i black = _mm_set1_epi32((int)ARGB_BLACK);
+ for (i = 0; i + 4 <= num_pixels; i += 4) {
+ const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]);
+ const __m128i res = _mm_sub_epi8(src, black);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_neon.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_neon.c
+index 89e3e013a081..ddc9b61711e3 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_neon.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_neon.c
+@@ -498,7 +498,7 @@ static void PredictorAdd13_NEON(const uint32_t* in, const uint32_t* upper,
+
+ // vtbl?_u8 are marked unavailable for iOS arm64 with Xcode < 6.3, use
+ // non-standard versions there.
+-#if defined(__APPLE__) && defined(__aarch64__) && \
++#if defined(__APPLE__) && WEBP_AARCH64 && \
+ defined(__apple_build_version__) && (__apple_build_version__< 6020037)
+ #define USE_VTBLQ
+ #endif
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_sse2.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_sse2.c
+index 396cb0bdfcc3..4b6a532c239c 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_sse2.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_sse2.c
+@@ -27,23 +27,22 @@ static WEBP_INLINE uint32_t ClampedAddSubtractFull_SSE2(uint32_t c0,
+ uint32_t c1,
+ uint32_t c2) {
+ const __m128i zero = _mm_setzero_si128();
+- const __m128i C0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c0), zero);
+- const __m128i C1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c1), zero);
+- const __m128i C2 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c2), zero);
++ const __m128i C0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c0), zero);
++ const __m128i C1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c1), zero);
++ const __m128i C2 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c2), zero);
+ const __m128i V1 = _mm_add_epi16(C0, C1);
+ const __m128i V2 = _mm_sub_epi16(V1, C2);
+ const __m128i b = _mm_packus_epi16(V2, V2);
+- const uint32_t output = _mm_cvtsi128_si32(b);
+- return output;
++ return (uint32_t)_mm_cvtsi128_si32(b);
+ }
+
+ static WEBP_INLINE uint32_t ClampedAddSubtractHalf_SSE2(uint32_t c0,
+ uint32_t c1,
+ uint32_t c2) {
+ const __m128i zero = _mm_setzero_si128();
+- const __m128i C0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c0), zero);
+- const __m128i C1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c1), zero);
+- const __m128i B0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c2), zero);
++ const __m128i C0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c0), zero);
++ const __m128i C1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c1), zero);
++ const __m128i B0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c2), zero);
+ const __m128i avg = _mm_add_epi16(C1, C0);
+ const __m128i A0 = _mm_srli_epi16(avg, 1);
+ const __m128i A1 = _mm_sub_epi16(A0, B0);
+@@ -52,16 +51,15 @@ static WEBP_INLINE uint32_t ClampedAddSubtractHalf_SSE2(uint32_t c0,
+ const __m128i A3 = _mm_srai_epi16(A2, 1);
+ const __m128i A4 = _mm_add_epi16(A0, A3);
+ const __m128i A5 = _mm_packus_epi16(A4, A4);
+- const uint32_t output = _mm_cvtsi128_si32(A5);
+- return output;
++ return (uint32_t)_mm_cvtsi128_si32(A5);
+ }
+
+ static WEBP_INLINE uint32_t Select_SSE2(uint32_t a, uint32_t b, uint32_t c) {
+ int pa_minus_pb;
+ const __m128i zero = _mm_setzero_si128();
+- const __m128i A0 = _mm_cvtsi32_si128(a);
+- const __m128i B0 = _mm_cvtsi32_si128(b);
+- const __m128i C0 = _mm_cvtsi32_si128(c);
++ const __m128i A0 = _mm_cvtsi32_si128((int)a);
++ const __m128i B0 = _mm_cvtsi32_si128((int)b);
++ const __m128i C0 = _mm_cvtsi32_si128((int)c);
+ const __m128i AC0 = _mm_subs_epu8(A0, C0);
+ const __m128i CA0 = _mm_subs_epu8(C0, A0);
+ const __m128i BC0 = _mm_subs_epu8(B0, C0);
+@@ -94,8 +92,8 @@ static WEBP_INLINE void Average2_uint32_SSE2(const uint32_t a0,
+ __m128i* const avg) {
+ // (a + b) >> 1 = ((a + b + 1) >> 1) - ((a ^ b) & 1)
+ const __m128i ones = _mm_set1_epi8(1);
+- const __m128i A0 = _mm_cvtsi32_si128(a0);
+- const __m128i A1 = _mm_cvtsi32_si128(a1);
++ const __m128i A0 = _mm_cvtsi32_si128((int)a0);
++ const __m128i A1 = _mm_cvtsi32_si128((int)a1);
+ const __m128i avg1 = _mm_avg_epu8(A0, A1);
+ const __m128i one = _mm_and_si128(_mm_xor_si128(A0, A1), ones);
+ *avg = _mm_sub_epi8(avg1, one);
+@@ -103,8 +101,8 @@ static WEBP_INLINE void Average2_uint32_SSE2(const uint32_t a0,
+
+ static WEBP_INLINE __m128i Average2_uint32_16_SSE2(uint32_t a0, uint32_t a1) {
+ const __m128i zero = _mm_setzero_si128();
+- const __m128i A0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a0), zero);
+- const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a1), zero);
++ const __m128i A0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)a0), zero);
++ const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)a1), zero);
+ const __m128i sum = _mm_add_epi16(A1, A0);
+ return _mm_srli_epi16(sum, 1);
+ }
+@@ -112,19 +110,18 @@ static WEBP_INLINE __m128i Average2_uint32_16_SSE2(uint32_t a0, uint32_t a1) {
+ static WEBP_INLINE uint32_t Average2_SSE2(uint32_t a0, uint32_t a1) {
+ __m128i output;
+ Average2_uint32_SSE2(a0, a1, &output);
+- return _mm_cvtsi128_si32(output);
++ return (uint32_t)_mm_cvtsi128_si32(output);
+ }
+
+ static WEBP_INLINE uint32_t Average3_SSE2(uint32_t a0, uint32_t a1,
+ uint32_t a2) {
+ const __m128i zero = _mm_setzero_si128();
+ const __m128i avg1 = Average2_uint32_16_SSE2(a0, a2);
+- const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a1), zero);
++ const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)a1), zero);
+ const __m128i sum = _mm_add_epi16(avg1, A1);
+ const __m128i avg2 = _mm_srli_epi16(sum, 1);
+ const __m128i A2 = _mm_packus_epi16(avg2, avg2);
+- const uint32_t output = _mm_cvtsi128_si32(A2);
+- return output;
++ return (uint32_t)_mm_cvtsi128_si32(A2);
+ }
+
+ static WEBP_INLINE uint32_t Average4_SSE2(uint32_t a0, uint32_t a1,
+@@ -134,8 +131,7 @@ static WEBP_INLINE uint32_t Average4_SSE2(uint32_t a0, uint32_t a1,
+ const __m128i sum = _mm_add_epi16(avg2, avg1);
+ const __m128i avg3 = _mm_srli_epi16(sum, 1);
+ const __m128i A0 = _mm_packus_epi16(avg3, avg3);
+- const uint32_t output = _mm_cvtsi128_si32(A0);
+- return output;
++ return (uint32_t)_mm_cvtsi128_si32(A0);
+ }
+
+ static uint32_t Predictor5_SSE2(const uint32_t* const left,
+@@ -192,7 +188,7 @@ static uint32_t Predictor13_SSE2(const uint32_t* const left,
+ static void PredictorAdd0_SSE2(const uint32_t* in, const uint32_t* upper,
+ int num_pixels, uint32_t* out) {
+ int i;
+- const __m128i black = _mm_set1_epi32(ARGB_BLACK);
++ const __m128i black = _mm_set1_epi32((int)ARGB_BLACK);
+ for (i = 0; i + 4 <= num_pixels; i += 4) {
+ const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]);
+ const __m128i res = _mm_add_epi8(src, black);
+@@ -208,7 +204,7 @@ static void PredictorAdd0_SSE2(const uint32_t* in, const uint32_t* upper,
+ static void PredictorAdd1_SSE2(const uint32_t* in, const uint32_t* upper,
+ int num_pixels, uint32_t* out) {
+ int i;
+- __m128i prev = _mm_set1_epi32(out[-1]);
++ __m128i prev = _mm_set1_epi32((int)out[-1]);
+ for (i = 0; i + 4 <= num_pixels; i += 4) {
+ // a | b | c | d
+ const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]);
+@@ -285,12 +281,12 @@ GENERATE_PREDICTOR_2(9, upper[i + 1])
+ #undef GENERATE_PREDICTOR_2
+
+ // Predictor10: average of (average of (L,TL), average of (T, TR)).
+-#define DO_PRED10(OUT) do { \
+- __m128i avgLTL, avg; \
+- Average2_m128i(&L, &TL, &avgLTL); \
+- Average2_m128i(&avgTTR, &avgLTL, &avg); \
+- L = _mm_add_epi8(avg, src); \
+- out[i + (OUT)] = _mm_cvtsi128_si32(L); \
++#define DO_PRED10(OUT) do { \
++ __m128i avgLTL, avg; \
++ Average2_m128i(&L, &TL, &avgLTL); \
++ Average2_m128i(&avgTTR, &avgLTL, &avg); \
++ L = _mm_add_epi8(avg, src); \
++ out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(L); \
+ } while (0)
+
+ #define DO_PRED10_SHIFT do { \
+@@ -303,7 +299,7 @@ GENERATE_PREDICTOR_2(9, upper[i + 1])
+ static void PredictorAdd10_SSE2(const uint32_t* in, const uint32_t* upper,
+ int num_pixels, uint32_t* out) {
+ int i;
+- __m128i L = _mm_cvtsi32_si128(out[-1]);
++ __m128i L = _mm_cvtsi32_si128((int)out[-1]);
+ for (i = 0; i + 4 <= num_pixels; i += 4) {
+ __m128i src = _mm_loadu_si128((const __m128i*)&in[i]);
+ __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]);
+@@ -336,7 +332,7 @@ static void PredictorAdd10_SSE2(const uint32_t* in, const uint32_t* upper,
+ const __m128i B = _mm_andnot_si128(mask, T); \
+ const __m128i pred = _mm_or_si128(A, B); /* pred = (pa > b)? L : T*/ \
+ L = _mm_add_epi8(src, pred); \
+- out[i + (OUT)] = _mm_cvtsi128_si32(L); \
++ out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(L); \
+ } while (0)
+
+ #define DO_PRED11_SHIFT do { \
+@@ -351,7 +347,7 @@ static void PredictorAdd11_SSE2(const uint32_t* in, const uint32_t* upper,
+ int num_pixels, uint32_t* out) {
+ int i;
+ __m128i pa;
+- __m128i L = _mm_cvtsi32_si128(out[-1]);
++ __m128i L = _mm_cvtsi32_si128((int)out[-1]);
+ for (i = 0; i + 4 <= num_pixels; i += 4) {
+ __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]);
+ __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]);
+@@ -384,12 +380,12 @@ static void PredictorAdd11_SSE2(const uint32_t* in, const uint32_t* upper,
+ #undef DO_PRED11_SHIFT
+
+ // Predictor12: ClampedAddSubtractFull.
+-#define DO_PRED12(DIFF, LANE, OUT) do { \
+- const __m128i all = _mm_add_epi16(L, (DIFF)); \
+- const __m128i alls = _mm_packus_epi16(all, all); \
+- const __m128i res = _mm_add_epi8(src, alls); \
+- out[i + (OUT)] = _mm_cvtsi128_si32(res); \
+- L = _mm_unpacklo_epi8(res, zero); \
++#define DO_PRED12(DIFF, LANE, OUT) do { \
++ const __m128i all = _mm_add_epi16(L, (DIFF)); \
++ const __m128i alls = _mm_packus_epi16(all, all); \
++ const __m128i res = _mm_add_epi8(src, alls); \
++ out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(res); \
++ L = _mm_unpacklo_epi8(res, zero); \
+ } while (0)
+
+ #define DO_PRED12_SHIFT(DIFF, LANE) do { \
+@@ -402,7 +398,7 @@ static void PredictorAdd12_SSE2(const uint32_t* in, const uint32_t* upper,
+ int num_pixels, uint32_t* out) {
+ int i;
+ const __m128i zero = _mm_setzero_si128();
+- const __m128i L8 = _mm_cvtsi32_si128(out[-1]);
++ const __m128i L8 = _mm_cvtsi32_si128((int)out[-1]);
+ __m128i L = _mm_unpacklo_epi8(L8, zero);
+ for (i = 0; i + 4 <= num_pixels; i += 4) {
+ // Load 4 pixels at a time.
+@@ -468,7 +464,7 @@ static void TransformColorInverse_SSE2(const VP8LMultipliers* const m,
+ const __m128i mults_b2 = MK_CST_16(CST(red_to_blue_), 0);
+ #undef MK_CST_16
+ #undef CST
+- const __m128i mask_ag = _mm_set1_epi32(0xff00ff00); // alpha-green masks
++ const __m128i mask_ag = _mm_set1_epi32((int)0xff00ff00); // alpha-green masks
+ int i;
+ for (i = 0; i + 4 <= num_pixels; i += 4) {
+ const __m128i in = _mm_loadu_si128((const __m128i*)&src[i]); // argb
+@@ -532,7 +528,7 @@ static void ConvertBGRAToRGB_SSE2(const uint32_t* src, int num_pixels,
+
+ static void ConvertBGRAToRGBA_SSE2(const uint32_t* src,
+ int num_pixels, uint8_t* dst) {
+- const __m128i red_blue_mask = _mm_set1_epi32(0x00ff00ffu);
++ const __m128i red_blue_mask = _mm_set1_epi32(0x00ff00ff);
+ const __m128i* in = (const __m128i*)src;
+ __m128i* out = (__m128i*)dst;
+ while (num_pixels >= 8) {
+@@ -561,7 +557,7 @@ static void ConvertBGRAToRGBA_SSE2(const uint32_t* src,
+ static void ConvertBGRAToRGBA4444_SSE2(const uint32_t* src,
+ int num_pixels, uint8_t* dst) {
+ const __m128i mask_0x0f = _mm_set1_epi8(0x0f);
+- const __m128i mask_0xf0 = _mm_set1_epi8(0xf0);
++ const __m128i mask_0xf0 = _mm_set1_epi8((char)0xf0);
+ const __m128i* in = (const __m128i*)src;
+ __m128i* out = (__m128i*)dst;
+ while (num_pixels >= 8) {
+@@ -596,8 +592,8 @@ static void ConvertBGRAToRGBA4444_SSE2(const uint32_t* src,
+
+ static void ConvertBGRAToRGB565_SSE2(const uint32_t* src,
+ int num_pixels, uint8_t* dst) {
+- const __m128i mask_0xe0 = _mm_set1_epi8(0xe0);
+- const __m128i mask_0xf8 = _mm_set1_epi8(0xf8);
++ const __m128i mask_0xe0 = _mm_set1_epi8((char)0xe0);
++ const __m128i mask_0xf8 = _mm_set1_epi8((char)0xf8);
+ const __m128i mask_0x07 = _mm_set1_epi8(0x07);
+ const __m128i* in = (const __m128i*)src;
+ __m128i* out = (__m128i*)dst;
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_sse41.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_sse41.c
+index b0d6daa7fed3..bb7ce7611fa9 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_sse41.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/lossless_sse41.c
+@@ -25,11 +25,12 @@ static void TransformColorInverse_SSE41(const VP8LMultipliers* const m,
+ int num_pixels, uint32_t* dst) {
+ // sign-extended multiplying constants, pre-shifted by 5.
+ #define CST(X) (((int16_t)(m->X << 8)) >> 5) // sign-extend
+- const __m128i mults_rb = _mm_set1_epi32((uint32_t)CST(green_to_red_) << 16 |
+- (CST(green_to_blue_) & 0xffff));
++ const __m128i mults_rb =
++ _mm_set1_epi32((int)((uint32_t)CST(green_to_red_) << 16 |
++ (CST(green_to_blue_) & 0xffff)));
+ const __m128i mults_b2 = _mm_set1_epi32(CST(red_to_blue_));
+ #undef CST
+- const __m128i mask_ag = _mm_set1_epi32(0xff00ff00);
++ const __m128i mask_ag = _mm_set1_epi32((int)0xff00ff00);
+ const __m128i perm1 = _mm_setr_epi8(-1, 1, -1, 1, -1, 5, -1, 5,
+ -1, 9, -1, 9, -1, 13, -1, 13);
+ const __m128i perm2 = _mm_setr_epi8(-1, 2, -1, -1, -1, 6, -1, -1,
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/neon.h b/qtimageformats/src/3rdparty/libwebp/src/dsp/neon.h
+index c591f9b9a78e..14acb4044ba6 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/neon.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/neon.h
+@@ -21,7 +21,7 @@
+ // Right now, some intrinsics functions seem slower, so we disable them
+ // everywhere except newer clang/gcc or aarch64 where the inline assembly is
+ // incompatible.
+-#if LOCAL_CLANG_PREREQ(3,8) || LOCAL_GCC_PREREQ(4,9) || defined(__aarch64__)
++#if LOCAL_CLANG_PREREQ(3, 8) || LOCAL_GCC_PREREQ(4, 9) || WEBP_AARCH64
+ #define WEBP_USE_INTRINSICS // use intrinsics when possible
+ #endif
+
+@@ -46,7 +46,7 @@
+ // if using intrinsics, this flag avoids some functions that make gcc-4.6.3
+ // crash ("internal compiler error: in immed_double_const, at emit-rtl.").
+ // (probably similar to gcc.gnu.org/bugzilla/show_bug.cgi?id=48183)
+-#if !(LOCAL_CLANG_PREREQ(3,8) || LOCAL_GCC_PREREQ(4,8) || defined(__aarch64__))
++#if !(LOCAL_CLANG_PREREQ(3, 8) || LOCAL_GCC_PREREQ(4, 8) || WEBP_AARCH64)
+ #define WORK_AROUND_GCC
+ #endif
+
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/quant.h b/qtimageformats/src/3rdparty/libwebp/src/dsp/quant.h
+index 5e8dba8d19e8..bf7734cb11d5 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/quant.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/quant.h
+@@ -21,10 +21,15 @@
+
+ #define IsFlat IsFlat_NEON
+
+-static uint32x2_t horizontal_add_uint32x4(const uint32x4_t a) {
++static uint32_t horizontal_add_uint32x4(const uint32x4_t a) {
++#if WEBP_AARCH64
++ return vaddvq_u32(a);
++#else
+ const uint64x2_t b = vpaddlq_u32(a);
+- return vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)),
+- vreinterpret_u32_u64(vget_high_u64(b)));
++ const uint32x2_t c = vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)),
++ vreinterpret_u32_u64(vget_high_u64(b)));
++ return vget_lane_u32(c, 0);
++#endif
+ }
+
+ static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks,
+@@ -45,7 +50,7 @@ static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks,
+
+ levels += 16;
+ }
+- return thresh >= (int32_t)vget_lane_u32(horizontal_add_uint32x4(sum), 0);
++ return thresh >= (int)horizontal_add_uint32x4(sum);
+ }
+
+ #else
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/rescaler.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/rescaler.c
+index 14620ce4f1e5..325d8be1808b 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/rescaler.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/rescaler.c
+@@ -197,6 +197,7 @@ WebPRescalerImportRowFunc WebPRescalerImportRowShrink;
+ WebPRescalerExportRowFunc WebPRescalerExportRowExpand;
+ WebPRescalerExportRowFunc WebPRescalerExportRowShrink;
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void WebPRescalerDspInitSSE2(void);
+ extern void WebPRescalerDspInitMIPS32(void);
+ extern void WebPRescalerDspInitMIPSdspR2(void);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/rescaler_sse2.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/rescaler_sse2.c
+index d7effea16ea2..3f18e94e9359 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/rescaler_sse2.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/rescaler_sse2.c
+@@ -85,7 +85,7 @@ static void RescalerImportRowExpand_SSE2(WebPRescaler* const wrk,
+ const __m128i mult = _mm_cvtsi32_si128(((x_add - accum) << 16) | accum);
+ const __m128i out = _mm_madd_epi16(cur_pixels, mult);
+ assert(sizeof(*frow) == sizeof(uint32_t));
+- WebPUint32ToMem((uint8_t*)frow, _mm_cvtsi128_si32(out));
++ WebPInt32ToMem((uint8_t*)frow, _mm_cvtsi128_si32(out));
+ frow += 1;
+ if (frow >= frow_end) break;
+ accum -= wrk->x_sub;
+@@ -132,7 +132,7 @@ static void RescalerImportRowShrink_SSE2(WebPRescaler* const wrk,
+ __m128i base = zero;
+ accum += wrk->x_add;
+ while (accum > 0) {
+- const __m128i A = _mm_cvtsi32_si128(WebPMemToUint32(src));
++ const __m128i A = _mm_cvtsi32_si128(WebPMemToInt32(src));
+ src += 4;
+ base = _mm_unpacklo_epi8(A, zero);
+ // To avoid overflow, we need: base * x_add / x_sub < 32768
+@@ -198,7 +198,7 @@ static WEBP_INLINE void ProcessRow_SSE2(const __m128i* const A0,
+ const __m128i* const mult,
+ uint8_t* const dst) {
+ const __m128i rounder = _mm_set_epi32(0, ROUNDER, 0, ROUNDER);
+- const __m128i mask = _mm_set_epi32(0xffffffffu, 0, 0xffffffffu, 0);
++ const __m128i mask = _mm_set_epi32(~0, 0, ~0, 0);
+ const __m128i B0 = _mm_mul_epu32(*A0, *mult);
+ const __m128i B1 = _mm_mul_epu32(*A1, *mult);
+ const __m128i B2 = _mm_mul_epu32(*A2, *mult);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/ssim.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/ssim.c
+index f85c2e6e5b54..9a1341ed9585 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/ssim.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/ssim.c
+@@ -137,6 +137,7 @@ VP8SSIMGetClippedFunc VP8SSIMGetClipped;
+ VP8AccumulateSSEFunc VP8AccumulateSSE;
+ #endif
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void VP8SSIMDspInitSSE2(void);
+
+ WEBP_DSP_INIT_FUNC(VP8SSIMDspInit) {
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling.c
+index 87f771f3eb51..983b9c42d36c 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling.c
+@@ -215,6 +215,7 @@ static void EmptyYuv444Func(const uint8_t* y,
+
+ WebPYUV444Converter WebPYUV444Converters[MODE_LAST];
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void WebPInitYUV444ConvertersMIPSdspR2(void);
+ extern void WebPInitYUV444ConvertersSSE2(void);
+ extern void WebPInitYUV444ConvertersSSE41(void);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling_neon.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling_neon.c
+index 6ba71a7de537..bbc000ca2d38 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling_neon.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling_neon.c
+@@ -111,7 +111,7 @@ static const int16_t kCoeffs1[4] = { 19077, 26149, 6419, 13320 };
+ vst4_u8(out, v255_r_g_b); \
+ } while (0)
+
+-#if !defined(WEBP_SWAP_16BIT_CSP)
++#if (WEBP_SWAP_16BIT_CSP == 0)
+ #define ZIP_U8(lo, hi) vzip_u8((lo), (hi))
+ #else
+ #define ZIP_U8(lo, hi) vzip_u8((hi), (lo))
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling_sse2.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling_sse2.c
+index 340f1e2ac238..08b6d0b1cfb8 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling_sse2.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/upsampling_sse2.c
+@@ -121,7 +121,7 @@ static void FUNC_NAME(const uint8_t* top_y, const uint8_t* bottom_y, \
+ int uv_pos, pos; \
+ /* 16byte-aligned array to cache reconstructed u and v */ \
+ uint8_t uv_buf[14 * 32 + 15] = { 0 }; \
+- uint8_t* const r_u = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~15); \
++ uint8_t* const r_u = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~(uintptr_t)15); \
+ uint8_t* const r_v = r_u + 32; \
+ \
+ assert(top_y != NULL); \
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv.c
+index d16c13d3ca3c..8a04b85d82dd 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv.c
+@@ -70,6 +70,7 @@ void WebPSamplerProcessPlane(const uint8_t* y, int y_stride,
+
+ WebPSamplerRowFunc WebPSamplers[MODE_LAST];
+
++extern VP8CPUInfo VP8GetCPUInfo;
+ extern void WebPInitSamplersSSE2(void);
+ extern void WebPInitSamplersSSE41(void);
+ extern void WebPInitSamplersMIPS32(void);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv_sse2.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv_sse2.c
+index 970bbb788407..01a48f9af2c6 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv_sse2.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv_sse2.c
+@@ -15,10 +15,12 @@
+
+ #if defined(WEBP_USE_SSE2)
+
+-#include "src/dsp/common_sse2.h"
+ #include <stdlib.h>
+ #include <emmintrin.h>
+
++#include "src/dsp/common_sse2.h"
++#include "src/utils/utils.h"
++
+ //-----------------------------------------------------------------------------
+ // Convert spans of 32 pixels to various RGB formats for the fancy upsampler.
+
+@@ -74,7 +76,7 @@ static WEBP_INLINE __m128i Load_HI_16_SSE2(const uint8_t* src) {
+ // Load and replicate the U/V samples
+ static WEBP_INLINE __m128i Load_UV_HI_8_SSE2(const uint8_t* src) {
+ const __m128i zero = _mm_setzero_si128();
+- const __m128i tmp0 = _mm_cvtsi32_si128(*(const uint32_t*)src);
++ const __m128i tmp0 = _mm_cvtsi32_si128(WebPMemToInt32(src));
+ const __m128i tmp1 = _mm_unpacklo_epi8(zero, tmp0);
+ return _mm_unpacklo_epi16(tmp1, tmp1); // replicate samples
+ }
+@@ -130,7 +132,7 @@ static WEBP_INLINE void PackAndStore4444_SSE2(const __m128i* const R,
+ const __m128i rg0 = _mm_packus_epi16(*B, *A);
+ const __m128i ba0 = _mm_packus_epi16(*R, *G);
+ #endif
+- const __m128i mask_0xf0 = _mm_set1_epi8(0xf0);
++ const __m128i mask_0xf0 = _mm_set1_epi8((char)0xf0);
+ const __m128i rb1 = _mm_unpacklo_epi8(rg0, ba0); // rbrbrbrbrb...
+ const __m128i ga1 = _mm_unpackhi_epi8(rg0, ba0); // gagagagaga...
+ const __m128i rb2 = _mm_and_si128(rb1, mask_0xf0);
+@@ -147,9 +149,10 @@ static WEBP_INLINE void PackAndStore565_SSE2(const __m128i* const R,
+ const __m128i r0 = _mm_packus_epi16(*R, *R);
+ const __m128i g0 = _mm_packus_epi16(*G, *G);
+ const __m128i b0 = _mm_packus_epi16(*B, *B);
+- const __m128i r1 = _mm_and_si128(r0, _mm_set1_epi8(0xf8));
++ const __m128i r1 = _mm_and_si128(r0, _mm_set1_epi8((char)0xf8));
+ const __m128i b1 = _mm_and_si128(_mm_srli_epi16(b0, 3), _mm_set1_epi8(0x1f));
+- const __m128i g1 = _mm_srli_epi16(_mm_and_si128(g0, _mm_set1_epi8(0xe0)), 5);
++ const __m128i g1 =
++ _mm_srli_epi16(_mm_and_si128(g0, _mm_set1_epi8((char)0xe0)), 5);
+ const __m128i g2 = _mm_slli_epi16(_mm_and_si128(g0, _mm_set1_epi8(0x1c)), 3);
+ const __m128i rg = _mm_or_si128(r1, g1);
+ const __m128i gb = _mm_or_si128(g2, b1);
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv_sse41.c b/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv_sse41.c
+index 579d1f7402c2..f79b802e4712 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv_sse41.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/dsp/yuv_sse41.c
+@@ -15,10 +15,12 @@
+
+ #if defined(WEBP_USE_SSE41)
+
+-#include "src/dsp/common_sse41.h"
+ #include <stdlib.h>
+ #include <smmintrin.h>
+
++#include "src/dsp/common_sse41.h"
++#include "src/utils/utils.h"
++
+ //-----------------------------------------------------------------------------
+ // Convert spans of 32 pixels to various RGB formats for the fancy upsampler.
+
+@@ -74,7 +76,7 @@ static WEBP_INLINE __m128i Load_HI_16_SSE41(const uint8_t* src) {
+ // Load and replicate the U/V samples
+ static WEBP_INLINE __m128i Load_UV_HI_8_SSE41(const uint8_t* src) {
+ const __m128i zero = _mm_setzero_si128();
+- const __m128i tmp0 = _mm_cvtsi32_si128(*(const uint32_t*)src);
++ const __m128i tmp0 = _mm_cvtsi32_si128(WebPMemToInt32(src));
+ const __m128i tmp1 = _mm_unpacklo_epi8(zero, tmp0);
+ return _mm_unpacklo_epi16(tmp1, tmp1); // replicate samples
+ }
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/enc/alpha_enc.c b/qtimageformats/src/3rdparty/libwebp/src/enc/alpha_enc.c
+index f7c02690e3cf..26f003485aa2 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/enc/alpha_enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/enc/alpha_enc.c
+@@ -13,6 +13,7 @@
+
+ #include <assert.h>
+ #include <stdlib.h>
++#include <string.h>
+
+ #include "src/enc/vp8i_enc.h"
+ #include "src/dsp/dsp.h"
+@@ -140,6 +141,11 @@ static int EncodeAlphaInternal(const uint8_t* const data, int width, int height,
+ !reduce_levels, &tmp_bw, &result->stats);
+ if (ok) {
+ output = VP8LBitWriterFinish(&tmp_bw);
++ if (tmp_bw.error_) {
++ VP8LBitWriterWipeOut(&tmp_bw);
++ memset(&result->bw, 0, sizeof(result->bw));
++ return 0;
++ }
+ output_size = VP8LBitWriterNumBytes(&tmp_bw);
+ if (output_size > data_size) {
+ // compressed size is larger than source! Revert to uncompressed mode.
+@@ -148,6 +154,7 @@ static int EncodeAlphaInternal(const uint8_t* const data, int width, int height,
+ }
+ } else {
+ VP8LBitWriterWipeOut(&tmp_bw);
++ memset(&result->bw, 0, sizeof(result->bw));
+ return 0;
+ }
+ }
+@@ -162,7 +169,7 @@ static int EncodeAlphaInternal(const uint8_t* const data, int width, int height,
+ header = method | (filter << 2);
+ if (reduce_levels) header |= ALPHA_PREPROCESSED_LEVELS << 4;
+
+- VP8BitWriterInit(&result->bw, ALPHA_HEADER_LEN + output_size);
++ if (!VP8BitWriterInit(&result->bw, ALPHA_HEADER_LEN + output_size)) ok = 0;
+ ok = ok && VP8BitWriterAppend(&result->bw, &header, ALPHA_HEADER_LEN);
+ ok = ok && VP8BitWriterAppend(&result->bw, output, output_size);
+
+@@ -312,11 +319,11 @@ static int EncodeAlpha(VP8Encoder* const enc,
+ assert(filter >= WEBP_FILTER_NONE && filter <= WEBP_FILTER_FAST);
+
+ if (quality < 0 || quality > 100) {
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_INVALID_CONFIGURATION);
+ }
+
+ if (method < ALPHA_NO_COMPRESSION || method > ALPHA_LOSSLESS_COMPRESSION) {
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_INVALID_CONFIGURATION);
+ }
+
+ if (method == ALPHA_NO_COMPRESSION) {
+@@ -326,7 +333,7 @@ static int EncodeAlpha(VP8Encoder* const enc,
+
+ quant_alpha = (uint8_t*)WebPSafeMalloc(1ULL, data_size);
+ if (quant_alpha == NULL) {
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+
+ // Extract alpha data (width x height) from raw_data (stride x height).
+@@ -346,6 +353,9 @@ static int EncodeAlpha(VP8Encoder* const enc,
+ ok = ApplyFiltersAndEncode(quant_alpha, width, height, data_size, method,
+ filter, reduce_levels, effort_level, output,
+ output_size, pic->stats);
++ if (!ok) {
++ WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY); // imprecise
++ }
+ #if !defined(WEBP_DISABLE_STATS)
+ if (pic->stats != NULL) { // need stats?
+ pic->stats->coded_size += (int)(*output_size);
+@@ -405,7 +415,7 @@ int VP8EncStartAlpha(VP8Encoder* const enc) {
+ WebPWorker* const worker = &enc->alpha_worker_;
+ // Makes sure worker is good to go.
+ if (!WebPGetWorkerInterface()->Reset(worker)) {
+- return 0;
++ return WebPEncodingSetError(enc->pic_, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ WebPGetWorkerInterface()->Launch(worker);
+ return 1;
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/enc/analysis_enc.c b/qtimageformats/src/3rdparty/libwebp/src/enc/analysis_enc.c
+index ebb784261c63..962eaa998f87 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/enc/analysis_enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/enc/analysis_enc.c
+@@ -391,12 +391,14 @@ static int DoSegmentsJob(void* arg1, void* arg2) {
+ return ok;
+ }
+
++#ifdef WEBP_USE_THREAD
+ static void MergeJobs(const SegmentJob* const src, SegmentJob* const dst) {
+ int i;
+ for (i = 0; i <= MAX_ALPHA; ++i) dst->alphas[i] += src->alphas[i];
+ dst->alpha += src->alpha;
+ dst->uv_alpha += src->uv_alpha;
+ }
++#endif
+
+ // initialize the job struct with some tasks to perform
+ static void InitSegmentJob(VP8Encoder* const enc, SegmentJob* const job,
+@@ -425,10 +427,10 @@ int VP8EncAnalyze(VP8Encoder* const enc) {
+ (enc->method_ <= 1); // for method 0 - 1, we need preds_[] to be filled.
+ if (do_segments) {
+ const int last_row = enc->mb_h_;
+- // We give a little more than a half work to the main thread.
+- const int split_row = (9 * last_row + 15) >> 4;
+ const int total_mb = last_row * enc->mb_w_;
+ #ifdef WEBP_USE_THREAD
++ // We give a little more than a half work to the main thread.
++ const int split_row = (9 * last_row + 15) >> 4;
+ const int kMinSplitRow = 2; // minimal rows needed for mt to be worth it
+ const int do_mt = (enc->thread_level_ > 0) && (split_row >= kMinSplitRow);
+ #else
+@@ -438,6 +440,7 @@ int VP8EncAnalyze(VP8Encoder* const enc) {
+ WebPGetWorkerInterface();
+ SegmentJob main_job;
+ if (do_mt) {
++#ifdef WEBP_USE_THREAD
+ SegmentJob side_job;
+ // Note the use of '&' instead of '&&' because we must call the functions
+ // no matter what.
+@@ -455,6 +458,7 @@ int VP8EncAnalyze(VP8Encoder* const enc) {
+ }
+ worker_interface->End(&side_job.worker);
+ if (ok) MergeJobs(&side_job, &main_job); // merge results together
++#endif // WEBP_USE_THREAD
+ } else {
+ // Even for single-thread case, we use the generic Worker tools.
+ InitSegmentJob(enc, &main_job, 0, last_row);
+@@ -470,6 +474,10 @@ int VP8EncAnalyze(VP8Encoder* const enc) {
+ } else { // Use only one default segment.
+ ResetAllMBInfo(enc);
+ }
++ if (!ok) {
++ return WebPEncodingSetError(enc->pic_,
++ VP8_ENC_ERROR_OUT_OF_MEMORY); // imprecise
++ }
+ return ok;
+ }
+
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/enc/backward_references_enc.c b/qtimageformats/src/3rdparty/libwebp/src/enc/backward_references_enc.c
+index 49a0fac0345b..dc98bf171943 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/enc/backward_references_enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/enc/backward_references_enc.c
+@@ -283,8 +283,7 @@ int VP8LHashChainFill(VP8LHashChain* const p, int quality,
+ hash_to_first_index =
+ (int32_t*)WebPSafeMalloc(HASH_SIZE, sizeof(*hash_to_first_index));
+ if (hash_to_first_index == NULL) {
+- WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+
+ percent_range = remaining_percent / 2;
+@@ -1050,8 +1049,7 @@ int VP8LGetBackwardReferences(
+ refs_best = GetBackwardReferencesLowEffort(
+ width, height, argb, cache_bits_best, hash_chain, refs);
+ if (refs_best == NULL) {
+- WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ // Set it in first position.
+ BackwardRefsSwap(refs_best, &refs[0]);
+@@ -1059,8 +1057,7 @@ int VP8LGetBackwardReferences(
+ if (!GetBackwardReferences(width, height, argb, quality, lz77_types_to_try,
+ cache_bits_max, do_no_cache, hash_chain, refs,
+ cache_bits_best)) {
+- WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ }
+
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/enc/frame_enc.c b/qtimageformats/src/3rdparty/libwebp/src/enc/frame_enc.c
+index b93d9e5b9914..9a98dc1f3ee3 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/enc/frame_enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/enc/frame_enc.c
+@@ -689,7 +689,7 @@ static int PreLoopInitialize(VP8Encoder* const enc) {
+ }
+ if (!ok) {
+ VP8EncFreeBitWriters(enc); // malloc error occurred
+- WebPEncodingSetError(enc->pic_, VP8_ENC_ERROR_OUT_OF_MEMORY);
++ return WebPEncodingSetError(enc->pic_, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ return ok;
+ }
+@@ -719,6 +719,7 @@ static int PostLoopFinalize(VP8EncIterator* const it, int ok) {
+ } else {
+ // Something bad happened -> need to do some memory cleanup.
+ VP8EncFreeBitWriters(enc);
++ return WebPEncodingSetError(enc->pic_, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ return ok;
+ }
+@@ -754,6 +755,11 @@ int VP8EncLoop(VP8Encoder* const enc) {
+ // *then* decide how to code the skip decision if there's one.
+ if (!VP8Decimate(&it, &info, rd_opt) || dont_use_skip) {
+ CodeResiduals(it.bw_, &it, &info);
++ if (it.bw_->error_) {
++ // enc->pic_->error_code is set in PostLoopFinalize().
++ ok = 0;
++ break;
++ }
+ } else { // reset predictors after a skip
+ ResetAfterSkip(&it);
+ }
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/enc/picture_csp_enc.c b/qtimageformats/src/3rdparty/libwebp/src/enc/picture_csp_enc.c
+index fabebcf2026b..a9280e6c3050 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/enc/picture_csp_enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/enc/picture_csp_enc.c
+@@ -69,10 +69,12 @@ static int CheckNonOpaque(const uint8_t* alpha, int width, int height,
+ int WebPPictureHasTransparency(const WebPPicture* picture) {
+ if (picture == NULL) return 0;
+ if (picture->use_argb) {
+- const int alpha_offset = ALPHA_OFFSET;
+- return CheckNonOpaque((const uint8_t*)picture->argb + alpha_offset,
+- picture->width, picture->height,
+- 4, picture->argb_stride * sizeof(*picture->argb));
++ if (picture->argb != NULL) {
++ return CheckNonOpaque((const uint8_t*)picture->argb + ALPHA_OFFSET,
++ picture->width, picture->height,
++ 4, picture->argb_stride * sizeof(*picture->argb));
++ }
++ return 0;
+ }
+ return CheckNonOpaque(picture->a, picture->width, picture->height,
+ 1, picture->a_stride);
+@@ -96,6 +98,7 @@ static int kLinearToGammaTab[GAMMA_TAB_SIZE + 1];
+ static uint16_t kGammaToLinearTab[256];
+ static volatile int kGammaTablesOk = 0;
+ static void InitGammaTables(void);
++extern VP8CPUInfo VP8GetCPUInfo;
+
+ WEBP_DSP_INIT_FUNC(InitGammaTables) {
+ if (!kGammaTablesOk) {
+@@ -170,21 +173,6 @@ static const int kMinDimensionIterativeConversion = 4;
+ //------------------------------------------------------------------------------
+ // Main function
+
+-extern void SharpYuvInit(VP8CPUInfo cpu_info_func);
+-
+-static void SafeInitSharpYuv(void) {
+-#if defined(WEBP_USE_THREAD) && !defined(_WIN32)
+- static pthread_mutex_t initsharpyuv_lock = PTHREAD_MUTEX_INITIALIZER;
+- if (pthread_mutex_lock(&initsharpyuv_lock)) return;
+-#endif
+-
+- SharpYuvInit(VP8GetCPUInfo);
+-
+-#if defined(WEBP_USE_THREAD) && !defined(_WIN32)
+- (void)pthread_mutex_unlock(&initsharpyuv_lock);
+-#endif
+-}
+-
+ static int PreprocessARGB(const uint8_t* r_ptr,
+ const uint8_t* g_ptr,
+ const uint8_t* b_ptr,
+@@ -481,6 +469,8 @@ static WEBP_INLINE void ConvertRowsToUV(const uint16_t* rgb,
+ }
+ }
+
++extern void SharpYuvInit(VP8CPUInfo cpu_info_func);
++
+ static int ImportYUVAFromRGBA(const uint8_t* r_ptr,
+ const uint8_t* g_ptr,
+ const uint8_t* b_ptr,
+@@ -516,7 +506,7 @@ static int ImportYUVAFromRGBA(const uint8_t* r_ptr,
+ }
+
+ if (use_iterative_conversion) {
+- SafeInitSharpYuv();
++ SharpYuvInit(VP8GetCPUInfo);
+ if (!PreprocessARGB(r_ptr, g_ptr, b_ptr, step, rgb_stride, picture)) {
+ return 0;
+ }
+@@ -545,7 +535,9 @@ static int ImportYUVAFromRGBA(const uint8_t* r_ptr,
+ WebPInitConvertARGBToYUV();
+ InitGammaTables();
+
+- if (tmp_rgb == NULL) return 0; // malloc error
++ if (tmp_rgb == NULL) {
++ return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY);
++ }
+
+ // Downsample Y/U/V planes, two rows at a time
+ for (y = 0; y < (height >> 1); ++y) {
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c b/qtimageformats/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c
+index 839f91cacc03..ea90d825484e 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c
+@@ -137,7 +137,9 @@ int WebPPictureCrop(WebPPicture* pic,
+ PictureGrabSpecs(pic, &tmp);
+ tmp.width = width;
+ tmp.height = height;
+- if (!WebPPictureAlloc(&tmp)) return 0;
++ if (!WebPPictureAlloc(&tmp)) {
++ return WebPEncodingSetError(pic, tmp.error_code);
++ }
+
+ if (!pic->use_argb) {
+ const int y_offset = top * pic->y_stride + left;
+@@ -212,26 +214,28 @@ int WebPPictureRescale(WebPPicture* picture, int width, int height) {
+ prev_height = picture->height;
+ if (!WebPRescalerGetScaledDimensions(
+ prev_width, prev_height, &width, &height)) {
+- return 0;
++ return WebPEncodingSetError(picture, VP8_ENC_ERROR_BAD_DIMENSION);
+ }
+
+ PictureGrabSpecs(picture, &tmp);
+ tmp.width = width;
+ tmp.height = height;
+- if (!WebPPictureAlloc(&tmp)) return 0;
++ if (!WebPPictureAlloc(&tmp)) {
++ return WebPEncodingSetError(picture, tmp.error_code);
++ }
+
+ if (!picture->use_argb) {
+ work = (rescaler_t*)WebPSafeMalloc(2ULL * width, sizeof(*work));
+ if (work == NULL) {
+ WebPPictureFree(&tmp);
+- return 0;
++ return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ // If present, we need to rescale alpha first (for AlphaMultiplyY).
+ if (picture->a != NULL) {
+ WebPInitAlphaProcessing();
+ if (!RescalePlane(picture->a, prev_width, prev_height, picture->a_stride,
+ tmp.a, width, height, tmp.a_stride, work, 1)) {
+- return 0;
++ return WebPEncodingSetError(picture, VP8_ENC_ERROR_BAD_DIMENSION);
+ }
+ }
+
+@@ -246,14 +250,14 @@ int WebPPictureRescale(WebPPicture* picture, int width, int height) {
+ !RescalePlane(picture->v, HALVE(prev_width), HALVE(prev_height),
+ picture->uv_stride, tmp.v, HALVE(width), HALVE(height),
+ tmp.uv_stride, work, 1)) {
+- return 0;
++ return WebPEncodingSetError(picture, VP8_ENC_ERROR_BAD_DIMENSION);
+ }
+ AlphaMultiplyY(&tmp, 1);
+ } else {
+ work = (rescaler_t*)WebPSafeMalloc(2ULL * width * 4, sizeof(*work));
+ if (work == NULL) {
+ WebPPictureFree(&tmp);
+- return 0;
++ return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ // In order to correctly interpolate colors, we need to apply the alpha
+ // weighting first (black-matting), scale the RGB values, and remove
+@@ -263,7 +267,7 @@ int WebPPictureRescale(WebPPicture* picture, int width, int height) {
+ if (!RescalePlane((const uint8_t*)picture->argb, prev_width, prev_height,
+ picture->argb_stride * 4, (uint8_t*)tmp.argb, width,
+ height, tmp.argb_stride * 4, work, 4)) {
+- return 0;
++ return WebPEncodingSetError(picture, VP8_ENC_ERROR_BAD_DIMENSION);
+ }
+ AlphaMultiplyARGB(&tmp, 1);
+ }
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/enc/syntax_enc.c b/qtimageformats/src/3rdparty/libwebp/src/enc/syntax_enc.c
+index e18cf650cab2..9b8f524d6981 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/enc/syntax_enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/enc/syntax_enc.c
+@@ -258,7 +258,10 @@ static int EmitPartitionsSize(const VP8Encoder* const enc,
+ buf[3 * p + 1] = (part_size >> 8) & 0xff;
+ buf[3 * p + 2] = (part_size >> 16) & 0xff;
+ }
+- return p ? pic->writer(buf, 3 * p, pic) : 1;
++ if (p && !pic->writer(buf, 3 * p, pic)) {
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_WRITE);
++ }
++ return 1;
+ }
+
+ //------------------------------------------------------------------------------
+@@ -381,6 +384,7 @@ int VP8EncWrite(VP8Encoder* const enc) {
+
+ enc->coded_size_ = (int)(CHUNK_HEADER_SIZE + riff_size);
+ ok = ok && WebPReportProgress(pic, final_percent, &enc->percent_);
++ if (!ok) WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_WRITE);
+ return ok;
+ }
+
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/enc/vp8i_enc.h b/qtimageformats/src/3rdparty/libwebp/src/enc/vp8i_enc.h
+index 71f76702ae2e..0864fbf1f51f 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/enc/vp8i_enc.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/enc/vp8i_enc.h
+@@ -31,8 +31,8 @@ extern "C" {
+
+ // version numbers
+ #define ENC_MAJ_VERSION 1
+-#define ENC_MIN_VERSION 2
+-#define ENC_REV_VERSION 4
++#define ENC_MIN_VERSION 3
++#define ENC_REV_VERSION 2
+
+ enum { MAX_LF_LEVELS = 64, // Maximum loop filter level
+ MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/qtimageformats/src/3rdparty/libwebp/src/enc/vp8l_enc.c
+index 2b345df6105c..3a8ec3dd1ec5 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/enc/vp8l_enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/enc/vp8l_enc.c
+@@ -196,8 +196,7 @@ static int CoOccurrenceBuild(const WebPPicture* const pic,
+ uint32_t palette_sorted[MAX_PALETTE_SIZE];
+ lines = (uint32_t*)WebPSafeMalloc(2 * pic->width, sizeof(*lines));
+ if (lines == NULL) {
+- WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ line_top = &lines[0];
+ line_current = &lines[pic->width];
+@@ -255,10 +254,10 @@ static int PaletteSortModifiedZeng(
+ cooccurrence =
+ (uint32_t*)WebPSafeCalloc(num_colors * num_colors, sizeof(*cooccurrence));
+ if (cooccurrence == NULL) {
+- WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ if (!CoOccurrenceBuild(pic, palette_sorted, num_colors, cooccurrence)) {
++ WebPSafeFree(cooccurrence);
+ return 0;
+ }
+
+@@ -361,10 +360,11 @@ typedef enum {
+ kHistoTotal // Must be last.
+ } HistoIx;
+
+-static void AddSingleSubGreen(int p, uint32_t* const r, uint32_t* const b) {
+- const int green = p >> 8; // The upper bits are masked away later.
+- ++r[((p >> 16) - green) & 0xff];
+- ++b[((p >> 0) - green) & 0xff];
++static void AddSingleSubGreen(uint32_t p,
++ uint32_t* const r, uint32_t* const b) {
++ const int green = (int)p >> 8; // The upper bits are masked away later.
++ ++r[(((int)p >> 16) - green) & 0xff];
++ ++b[(((int)p >> 0) - green) & 0xff];
+ }
+
+ static void AddSingle(uint32_t p,
+@@ -1011,8 +1011,7 @@ static int StoreImageToBitMask(
+ VP8LRefsCursorNext(&c);
+ }
+ if (bw->error_) {
+- WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ return 1;
+ }
+@@ -1296,7 +1295,10 @@ static int EncodeImageInternal(
+ }
+ }
+ tokens = (HuffmanTreeToken*)WebPSafeMalloc(max_tokens, sizeof(*tokens));
+- if (tokens == NULL) goto Error;
++ if (tokens == NULL) {
++ WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
++ goto Error;
++ }
+ for (i = 0; i < 5 * histogram_image_size; ++i) {
+ HuffmanTreeCode* const codes = &huffman_codes[i];
+ StoreHuffmanCode(bw, huff_tree, tokens, codes);
+@@ -1354,7 +1356,7 @@ static int EncodeImageInternal(
+ static void ApplySubtractGreen(VP8LEncoder* const enc, int width, int height,
+ VP8LBitWriter* const bw) {
+ VP8LPutBits(bw, TRANSFORM_PRESENT, 1);
+- VP8LPutBits(bw, SUBTRACT_GREEN, 2);
++ VP8LPutBits(bw, SUBTRACT_GREEN_TRANSFORM, 2);
+ VP8LSubtractGreenFromBlueAndRed(enc->argb_, width * height);
+ }
+
+@@ -1447,18 +1449,21 @@ static int WriteImage(const WebPPicture* const pic, VP8LBitWriter* const bw,
+ const size_t vp8l_size = VP8L_SIGNATURE_SIZE + webpll_size;
+ const size_t pad = vp8l_size & 1;
+ const size_t riff_size = TAG_SIZE + CHUNK_HEADER_SIZE + vp8l_size + pad;
++ *coded_size = 0;
++
++ if (bw->error_) {
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
++ }
+
+ if (!WriteRiffHeader(pic, riff_size, vp8l_size) ||
+ !pic->writer(webpll_data, webpll_size, pic)) {
+- WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_WRITE);
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_WRITE);
+ }
+
+ if (pad) {
+ const uint8_t pad_byte[1] = { 0 };
+ if (!pic->writer(pad_byte, 1, pic)) {
+- WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_WRITE);
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_WRITE);
+ }
+ }
+ *coded_size = CHUNK_HEADER_SIZE + riff_size;
+@@ -1503,8 +1508,7 @@ static int AllocateTransformBuffer(VP8LEncoder* const enc, int width,
+ ClearTransformBuffer(enc);
+ mem = (uint32_t*)WebPSafeMalloc(mem_size, sizeof(*mem));
+ if (mem == NULL) {
+- WebPEncodingSetError(enc->pic_, VP8_ENC_ERROR_OUT_OF_MEMORY);
+- return 0;
++ return WebPEncodingSetError(enc->pic_, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+ enc->transform_mem_ = mem;
+ enc->transform_mem_size_ = (size_t)mem_size;
+@@ -1612,8 +1616,7 @@ static int ApplyPalette(const uint32_t* src, uint32_t src_stride, uint32_t* dst,
+ int x, y;
+
+ if (tmp_row == NULL) {
+- WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+
+ if (palette_size < APPLY_PALETTE_GREEDY_MAX) {
+@@ -1967,9 +1970,8 @@ int VP8LEncodeStream(const WebPConfig* const config,
+ int ok_main;
+
+ if (enc_main == NULL || !VP8LBitWriterInit(&bw_side, 0)) {
+- WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ VP8LEncoderDelete(enc_main);
+- return 0;
++ return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY);
+ }
+
+ // Avoid "garbage value" error from Clang's static analysis tool.
+@@ -2116,8 +2118,7 @@ int VP8LEncodeImage(const WebPConfig* const config,
+ if (picture == NULL) return 0;
+
+ if (config == NULL || picture->argb == NULL) {
+- WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER);
+- return 0;
++ return WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER);
+ }
+
+ width = picture->width;
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/enc/webp_enc.c b/qtimageformats/src/3rdparty/libwebp/src/enc/webp_enc.c
+index 9620e0507066..583fe6a8bbd6 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/enc/webp_enc.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/enc/webp_enc.c
+@@ -307,7 +307,10 @@ int WebPEncodingSetError(const WebPPicture* const pic,
+ WebPEncodingError error) {
+ assert((int)error < VP8_ENC_ERROR_LAST);
+ assert((int)error >= VP8_ENC_OK);
+- ((WebPPicture*)pic)->error_code = error;
++ // The oldest error reported takes precedence over the new one.
++ if (pic->error_code == VP8_ENC_OK) {
++ ((WebPPicture*)pic)->error_code = error;
++ }
+ return 0;
+ }
+
+@@ -317,8 +320,7 @@ int WebPReportProgress(const WebPPicture* const pic,
+ *percent_store = percent;
+ if (pic->progress_hook && !pic->progress_hook(percent, pic)) {
+ // user abort requested
+- WebPEncodingSetError(pic, VP8_ENC_ERROR_USER_ABORT);
+- return 0;
++ return WebPEncodingSetError(pic, VP8_ENC_ERROR_USER_ABORT);
+ }
+ }
+ return 1; // ok
+@@ -329,7 +331,7 @@ int WebPEncode(const WebPConfig* config, WebPPicture* pic) {
+ int ok = 0;
+ if (pic == NULL) return 0;
+
+- WebPEncodingSetError(pic, VP8_ENC_OK); // all ok so far
++ pic->error_code = VP8_ENC_OK; // all ok so far
+ if (config == NULL) { // bad params
+ return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER);
+ }
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/mux/muxi.h b/qtimageformats/src/3rdparty/libwebp/src/mux/muxi.h
+index 0f4af1784d77..afc59543533b 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/mux/muxi.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/mux/muxi.h
+@@ -28,8 +28,8 @@ extern "C" {
+ // Defines and constants.
+
+ #define MUX_MAJ_VERSION 1
+-#define MUX_MIN_VERSION 2
+-#define MUX_REV_VERSION 4
++#define MUX_MIN_VERSION 3
++#define MUX_REV_VERSION 2
+
+ // Chunk object.
+ typedef struct WebPChunk WebPChunk;
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/mux/muxread.c b/qtimageformats/src/3rdparty/libwebp/src/mux/muxread.c
+index 80050396e1fe..9862ec68eea6 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/mux/muxread.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/mux/muxread.c
+@@ -116,9 +116,12 @@ static int MuxImageParse(const WebPChunk* const chunk, int copy_data,
+ // Each of ANMF chunk contain a header at the beginning. So, its size should
+ // be at least 'hdr_size'.
+ if (size < hdr_size) goto Fail;
+- ChunkAssignData(&subchunk, &temp, copy_data, chunk->tag_);
++ if (ChunkAssignData(&subchunk, &temp, copy_data,
++ chunk->tag_) != WEBP_MUX_OK) {
++ goto Fail;
++ }
+ }
+- ChunkSetHead(&subchunk, &wpi->header_);
++ if (ChunkSetHead(&subchunk, &wpi->header_) != WEBP_MUX_OK) goto Fail;
+ wpi->is_partial_ = 1; // Waiting for ALPH and/or VP8/VP8L chunks.
+
+ // Rest of the chunks.
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_inl_utils.h b/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_inl_utils.h
+index 404b9a6d8c93..24f3af7b5454 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_inl_utils.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_inl_utils.h
+@@ -148,9 +148,9 @@ int VP8GetSigned(VP8BitReader* WEBP_RESTRICT const br, int v,
+ const range_t value = (range_t)(br->value_ >> pos);
+ const int32_t mask = (int32_t)(split - value) >> 31; // -1 or 0
+ br->bits_ -= 1;
+- br->range_ += mask;
++ br->range_ += (range_t)mask;
+ br->range_ |= 1;
+- br->value_ -= (bit_t)((split + 1) & mask) << pos;
++ br->value_ -= (bit_t)((split + 1) & (uint32_t)mask) << pos;
+ BT_TRACK(br);
+ return (v ^ mask) - mask;
+ }
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_utils.c b/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_utils.c
+index 857cd6098882..a26557aa49f9 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_utils.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_utils.c
+@@ -15,6 +15,7 @@
+ #include "src/webp/config.h"
+ #endif
+
++#include "src/dsp/cpu.h"
+ #include "src/utils/bit_reader_inl_utils.h"
+ #include "src/utils/utils.h"
+
+@@ -121,7 +122,7 @@ int32_t VP8GetSignedValue(VP8BitReader* const br, int bits,
+
+ #define VP8L_LOG8_WBITS 4 // Number of bytes needed to store VP8L_WBITS bits.
+
+-#if defined(__arm__) || defined(_M_ARM) || defined(__aarch64__) || \
++#if defined(__arm__) || defined(_M_ARM) || WEBP_AARCH64 || \
+ defined(__i386__) || defined(_M_IX86) || \
+ defined(__x86_64__) || defined(_M_X64)
+ #define VP8L_USE_FAST_LOAD
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_utils.h b/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_utils.h
+index e64156e31817..25ff31e5d97a 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_utils.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/utils/bit_reader_utils.h
+@@ -19,6 +19,7 @@
+ #ifdef _MSC_VER
+ #include <stdlib.h> // _byteswap_ulong
+ #endif
++#include "src/dsp/cpu.h"
+ #include "src/webp/types.h"
+
+ // Warning! This macro triggers quite some MACRO wizardry around func signature!
+@@ -64,7 +65,7 @@ extern "C" {
+ #define BITS 56
+ #elif defined(__arm__) || defined(_M_ARM) // ARM
+ #define BITS 24
+-#elif defined(__aarch64__) // ARM 64bit
++#elif WEBP_AARCH64 // ARM 64bit
+ #define BITS 56
+ #elif defined(__mips__) // MIPS
+ #define BITS 24
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/utils/huffman_utils.c b/qtimageformats/src/3rdparty/libwebp/src/utils/huffman_utils.c
+index 0cba0fbb7d4f..cf73abd437d0 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/utils/huffman_utils.c
++++ b/qtimageformats/src/3rdparty/libwebp/src/utils/huffman_utils.c
+@@ -142,7 +142,7 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
+
+ {
+ int step; // step size to replicate values in current table
+- uint32_t low = -1; // low bits for current root entry
++ uint32_t low = 0xffffffffu; // low bits for current root entry
+ uint32_t mask = total_size - 1; // mask for low bits
+ uint32_t key = 0; // reversed prefix code
+ int num_nodes = 1; // number of Huffman tree nodes
+@@ -177,21 +177,24 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
+ if (num_open < 0) {
+ return 0;
+ }
+- if (root_table == NULL) continue;
+ for (; count[len] > 0; --count[len]) {
+ HuffmanCode code;
+ if ((key & mask) != low) {
+- table += table_size;
++ if (root_table != NULL) table += table_size;
+ table_bits = NextTableBitSize(count, len, root_bits);
+ table_size = 1 << table_bits;
+ total_size += table_size;
+ low = key & mask;
+- root_table[low].bits = (uint8_t)(table_bits + root_bits);
+- root_table[low].value = (uint16_t)((table - root_table) - low);
++ if (root_table != NULL) {
++ root_table[low].bits = (uint8_t)(table_bits + root_bits);
++ root_table[low].value = (uint16_t)((table - root_table) - low);
++ }
++ }
++ if (root_table != NULL) {
++ code.bits = (uint8_t)(len - root_bits);
++ code.value = (uint16_t)sorted[symbol++];
++ ReplicateValue(&table[key >> root_bits], step, table_size, code);
+ }
+- code.bits = (uint8_t)(len - root_bits);
+- code.value = (uint16_t)sorted[symbol++];
+- ReplicateValue(&table[key >> root_bits], step, table_size, code);
+ key = GetNextKey(key, len);
+ }
+ }
+@@ -211,25 +214,83 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
+ ((1 << MAX_CACHE_BITS) + NUM_LITERAL_CODES + NUM_LENGTH_CODES)
+ // Cut-off value for switching between heap and stack allocation.
+ #define SORTED_SIZE_CUTOFF 512
+-int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
++int VP8LBuildHuffmanTable(HuffmanTables* const root_table, int root_bits,
+ const int code_lengths[], int code_lengths_size) {
+- int total_size;
++ const int total_size =
++ BuildHuffmanTable(NULL, root_bits, code_lengths, code_lengths_size, NULL);
+ assert(code_lengths_size <= MAX_CODE_LENGTHS_SIZE);
+- if (root_table == NULL) {
+- total_size = BuildHuffmanTable(NULL, root_bits,
+- code_lengths, code_lengths_size, NULL);
+- } else if (code_lengths_size <= SORTED_SIZE_CUTOFF) {
++ if (total_size == 0 || root_table == NULL) return total_size;
++
++ if (root_table->curr_segment->curr_table + total_size >=
++ root_table->curr_segment->start + root_table->curr_segment->size) {
++ // If 'root_table' does not have enough memory, allocate a new segment.
++ // The available part of root_table->curr_segment is left unused because we
++ // need a contiguous buffer.
++ const int segment_size = root_table->curr_segment->size;
++ struct HuffmanTablesSegment* next =
++ (HuffmanTablesSegment*)WebPSafeMalloc(1, sizeof(*next));
++ if (next == NULL) return 0;
++ // Fill the new segment.
++ // We need at least 'total_size' but if that value is small, it is better to
++ // allocate a big chunk to prevent more allocations later. 'segment_size' is
++ // therefore chosen (any other arbitrary value could be chosen).
++ next->size = total_size > segment_size ? total_size : segment_size;
++ next->start =
++ (HuffmanCode*)WebPSafeMalloc(next->size, sizeof(*next->start));
++ if (next->start == NULL) {
++ WebPSafeFree(next);
++ return 0;
++ }
++ next->curr_table = next->start;
++ next->next = NULL;
++ // Point to the new segment.
++ root_table->curr_segment->next = next;
++ root_table->curr_segment = next;
++ }
++ if (code_lengths_size <= SORTED_SIZE_CUTOFF) {
+ // use local stack-allocated array.
+ uint16_t sorted[SORTED_SIZE_CUTOFF];
+- total_size = BuildHuffmanTable(root_table, root_bits,
+- code_lengths, code_lengths_size, sorted);
+- } else { // rare case. Use heap allocation.
++ BuildHuffmanTable(root_table->curr_segment->curr_table, root_bits,
++ code_lengths, code_lengths_size, sorted);
++ } else { // rare case. Use heap allocation.
+ uint16_t* const sorted =
+ (uint16_t*)WebPSafeMalloc(code_lengths_size, sizeof(*sorted));
+ if (sorted == NULL) return 0;
+- total_size = BuildHuffmanTable(root_table, root_bits,
+- code_lengths, code_lengths_size, sorted);
++ BuildHuffmanTable(root_table->curr_segment->curr_table, root_bits,
++ code_lengths, code_lengths_size, sorted);
+ WebPSafeFree(sorted);
+ }
+ return total_size;
+ }
++
++int VP8LHuffmanTablesAllocate(int size, HuffmanTables* huffman_tables) {
++ // Have 'segment' point to the first segment for now, 'root'.
++ HuffmanTablesSegment* const root = &huffman_tables->root;
++ huffman_tables->curr_segment = root;
++ // Allocate root.
++ root->start = (HuffmanCode*)WebPSafeMalloc(size, sizeof(*root->start));
++ if (root->start == NULL) return 0;
++ root->curr_table = root->start;
++ root->next = NULL;
++ root->size = size;
++ return 1;
++}
++
++void VP8LHuffmanTablesDeallocate(HuffmanTables* const huffman_tables) {
++ HuffmanTablesSegment *current, *next;
++ if (huffman_tables == NULL) return;
++ // Free the root node.
++ current = &huffman_tables->root;
++ next = current->next;
++ WebPSafeFree(current->start);
++ current->start = NULL;
++ current->next = NULL;
++ current = next;
++ // Free the following nodes.
++ while (current != NULL) {
++ next = current->next;
++ WebPSafeFree(current->start);
++ WebPSafeFree(current);
++ current = next;
++ }
++}
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/utils/huffman_utils.h b/qtimageformats/src/3rdparty/libwebp/src/utils/huffman_utils.h
+index 13b7ad1ac40c..98415c532895 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/utils/huffman_utils.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/utils/huffman_utils.h
+@@ -43,6 +43,29 @@ typedef struct {
+ // or non-literal symbol otherwise
+ } HuffmanCode32;
+
++// Contiguous memory segment of HuffmanCodes.
++typedef struct HuffmanTablesSegment {
++ HuffmanCode* start;
++ // Pointer to where we are writing into the segment. Starts at 'start' and
++ // cannot go beyond 'start' + 'size'.
++ HuffmanCode* curr_table;
++ // Pointer to the next segment in the chain.
++ struct HuffmanTablesSegment* next;
++ int size;
++} HuffmanTablesSegment;
++
++// Chained memory segments of HuffmanCodes.
++typedef struct HuffmanTables {
++ HuffmanTablesSegment root;
++ // Currently processed segment. At first, this is 'root'.
++ HuffmanTablesSegment* curr_segment;
++} HuffmanTables;
++
++// Allocates a HuffmanTables with 'size' contiguous HuffmanCodes. Returns 0 on
++// memory allocation error, 1 otherwise.
++int VP8LHuffmanTablesAllocate(int size, HuffmanTables* huffman_tables);
++void VP8LHuffmanTablesDeallocate(HuffmanTables* const huffman_tables);
++
+ #define HUFFMAN_PACKED_BITS 6
+ #define HUFFMAN_PACKED_TABLE_SIZE (1u << HUFFMAN_PACKED_BITS)
+
+@@ -78,9 +101,7 @@ void VP8LHtreeGroupsFree(HTreeGroup* const htree_groups);
+ // the huffman table.
+ // Returns built table size or 0 in case of error (invalid tree or
+ // memory error).
+-// If root_table is NULL, it returns 0 if a lookup cannot be built, something
+-// > 0 otherwise (but not the table size).
+-int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
++int VP8LBuildHuffmanTable(HuffmanTables* const root_table, int root_bits,
+ const int code_lengths[], int code_lengths_size);
+
+ #ifdef __cplusplus
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/utils/utils.h b/qtimageformats/src/3rdparty/libwebp/src/utils/utils.h
+index ef04f108fec1..c5ee87335717 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/utils/utils.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/utils/utils.h
+@@ -64,7 +64,8 @@ WEBP_EXTERN void WebPSafeFree(void* const ptr);
+ // Alignment
+
+ #define WEBP_ALIGN_CST 31
+-#define WEBP_ALIGN(PTR) (((uintptr_t)(PTR) + WEBP_ALIGN_CST) & ~WEBP_ALIGN_CST)
++#define WEBP_ALIGN(PTR) (((uintptr_t)(PTR) + WEBP_ALIGN_CST) & \
++ ~(uintptr_t)WEBP_ALIGN_CST)
+
+ #include <string.h>
+ // memcpy() is the safe way of moving potentially unaligned 32b memory.
+@@ -73,10 +74,19 @@ static WEBP_INLINE uint32_t WebPMemToUint32(const uint8_t* const ptr) {
+ memcpy(&A, ptr, sizeof(A));
+ return A;
+ }
++
++static WEBP_INLINE int32_t WebPMemToInt32(const uint8_t* const ptr) {
++ return (int32_t)WebPMemToUint32(ptr);
++}
++
+ static WEBP_INLINE void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) {
+ memcpy(ptr, &val, sizeof(val));
+ }
+
++static WEBP_INLINE void WebPInt32ToMem(uint8_t* const ptr, int val) {
++ WebPUint32ToMem(ptr, (uint32_t)val);
++}
++
+ //------------------------------------------------------------------------------
+ // Reading/writing data.
+
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/webp/decode.h b/qtimageformats/src/3rdparty/libwebp/src/webp/decode.h
+index d98247509a8c..0177b1208975 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/webp/decode.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/webp/decode.h
+@@ -81,10 +81,11 @@ WEBP_EXTERN uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size,
+ // returned is the Y samples buffer. Upon return, *u and *v will point to
+ // the U and V chroma data. These U and V buffers need NOT be passed to
+ // WebPFree(), unlike the returned Y luma one. The dimension of the U and V
+-// planes are both (*width + 1) / 2 and (*height + 1)/ 2.
++// planes are both (*width + 1) / 2 and (*height + 1) / 2.
+ // Upon return, the Y buffer has a stride returned as '*stride', while U and V
+ // have a common stride returned as '*uv_stride'.
+-// Return NULL in case of error.
++// 'width' and 'height' may be NULL, the other pointers must not be.
++// Returns NULL in case of error.
+ // (*) Also named Y'CbCr. See: https://en.wikipedia.org/wiki/YCbCr
+ WEBP_EXTERN uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size,
+ int* width, int* height,
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/webp/format_constants.h b/qtimageformats/src/3rdparty/libwebp/src/webp/format_constants.h
+index eca6981a47d0..999035c5d265 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/webp/format_constants.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/webp/format_constants.h
+@@ -55,7 +55,7 @@
+ typedef enum {
+ PREDICTOR_TRANSFORM = 0,
+ CROSS_COLOR_TRANSFORM = 1,
+- SUBTRACT_GREEN = 2,
++ SUBTRACT_GREEN_TRANSFORM = 2,
+ COLOR_INDEXING_TRANSFORM = 3
+ } VP8LImageTransformType;
+
+diff --git a/qtimageformats/src/3rdparty/libwebp/src/webp/types.h b/qtimageformats/src/3rdparty/libwebp/src/webp/types.h
+index 47f7f2b00706..f255432e413c 100644
+--- a/qtimageformats/src/3rdparty/libwebp/src/webp/types.h
++++ b/qtimageformats/src/3rdparty/libwebp/src/webp/types.h
+@@ -42,7 +42,11 @@ typedef long long int int64_t;
+ # if defined(__GNUC__) && __GNUC__ >= 4
+ # define WEBP_EXTERN extern __attribute__ ((visibility ("default")))
+ # else
+-# define WEBP_EXTERN extern
++# if defined(_MSC_VER) && defined(WEBP_DLL)
++# define WEBP_EXTERN __declspec(dllexport)
++# else
++# define WEBP_EXTERN extern
++# endif
+ # endif /* __GNUC__ >= 4 */
+ #endif /* WEBP_EXTERN */
+
+diff --git a/qtimageformats/src/plugins/imageformats/webp/CMakeLists.txt b/qtimageformats/src/plugins/imageformats/webp/CMakeLists.txt
+index 25aa0c9650a4..fbbcc1c1bf2b 100644
+--- a/qtimageformats/src/plugins/imageformats/webp/CMakeLists.txt
++++ b/qtimageformats/src/plugins/imageformats/webp/CMakeLists.txt
+@@ -30,6 +30,7 @@ qt_internal_extend_target(QWebpPlugin CONDITION QT_FEATURE_system_webp
+ qt_internal_extend_target(QWebpPlugin CONDITION NOT QT_FEATURE_system_webp
+ SOURCES
+ ../../../3rdparty/libwebp/sharpyuv/sharpyuv.c
++ ../../../3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c
+ ../../../3rdparty/libwebp/sharpyuv/sharpyuv_csp.c
+ ../../../3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c
+ ../../../3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0002-CVE-2023-24607-qtbase-5.15.diff.patch b/patches/qt-everywhere-opensource-src-5.15.12/0002-CVE-2023-24607-qtbase-5.15.diff.patch
new file mode 100644
index 000000000..55fd1e198
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0002-CVE-2023-24607-qtbase-5.15.diff.patch
@@ -0,0 +1,337 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 16 Oct 2023 10:13:21 +0200
+Subject: [PATCH] CVE-2023-24607-qtbase-5.15.diff
+
+Imported from https://download.qt.io/archive/qt/5.15/
+---
+ qtbase/src/plugins/sqldrivers/odbc/qsql_odbc.cpp | 206 +++++++++++++----------
+ 1 file changed, 118 insertions(+), 88 deletions(-)
+
+diff --git a/qtbase/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/qtbase/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
+index 5f51de384348..6cac60d03d2a 100644
+--- a/qtbase/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
++++ b/qtbase/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
+@@ -92,23 +92,39 @@ inline static QString fromSQLTCHAR(const QVarLengthArray<SQLTCHAR>& input, int s
+ return result;
+ }
+
++template <size_t SizeOfChar = sizeof(SQLTCHAR)>
++void toSQLTCHARImpl(QVarLengthArray<SQLTCHAR> &result, const QString &input); // primary template undefined
++
++template <typename Container>
++void do_append(QVarLengthArray<SQLTCHAR> &result, const Container &c)
++{
++ result.append(reinterpret_cast<const SQLTCHAR *>(c.data()), c.size());
++}
++
++template <>
++void toSQLTCHARImpl<1>(QVarLengthArray<SQLTCHAR> &result, const QString &input)
++{
++ const auto u8 = input.toUtf8();
++ do_append(result, u8);
++}
++
++template <>
++void toSQLTCHARImpl<2>(QVarLengthArray<SQLTCHAR> &result, const QString &input)
++{
++ do_append(result, input);
++}
++
++template <>
++void toSQLTCHARImpl<4>(QVarLengthArray<SQLTCHAR> &result, const QString &input)
++{
++ const auto u32 = input.toUcs4();
++ do_append(result, u32);
++}
++
+ inline static QVarLengthArray<SQLTCHAR> toSQLTCHAR(const QString &input)
+ {
+ QVarLengthArray<SQLTCHAR> result;
+- result.resize(input.size());
+- switch(sizeof(SQLTCHAR)) {
+- case 1:
+- memcpy(result.data(), input.toUtf8().data(), input.size());
+- break;
+- case 2:
+- memcpy(result.data(), input.unicode(), input.size() * 2);
+- break;
+- case 4:
+- memcpy(result.data(), input.toUcs4().data(), input.size() * 4);
+- break;
+- default:
+- qCritical("sizeof(SQLTCHAR) is %d. Don't know how to handle this.", int(sizeof(SQLTCHAR)));
+- }
++ toSQLTCHARImpl(result, input);
+ result.append(0); // make sure it's null terminated, doesn't matter if it already is, it does if it isn't.
+ return result;
+ }
+@@ -763,6 +779,14 @@ QChar QODBCDriverPrivate::quoteChar()
+ return quote;
+ }
+
++static SQLRETURN qt_string_SQLSetConnectAttr(SQLHDBC handle, SQLINTEGER attr, const QString &val)
++{
++ auto encoded = toSQLTCHAR(val);
++ return SQLSetConnectAttr(handle, attr,
++ encoded.data(),
++ SQLINTEGER(encoded.size() * sizeof(SQLTCHAR))); // size in bytes
++}
++
+
+ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts)
+ {
+@@ -798,10 +822,7 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts)
+ v = val.toUInt();
+ r = SQLSetConnectAttr(hDbc, SQL_ATTR_LOGIN_TIMEOUT, (SQLPOINTER) size_t(v), 0);
+ } else if (opt.toUpper() == QLatin1String("SQL_ATTR_CURRENT_CATALOG")) {
+- val.utf16(); // 0 terminate
+- r = SQLSetConnectAttr(hDbc, SQL_ATTR_CURRENT_CATALOG,
+- toSQLTCHAR(val).data(),
+- val.length()*sizeof(SQLTCHAR));
++ r = qt_string_SQLSetConnectAttr(hDbc, SQL_ATTR_CURRENT_CATALOG, val);
+ } else if (opt.toUpper() == QLatin1String("SQL_ATTR_METADATA_ID")) {
+ if (val.toUpper() == QLatin1String("SQL_TRUE")) {
+ v = SQL_TRUE;
+@@ -816,10 +837,7 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts)
+ v = val.toUInt();
+ r = SQLSetConnectAttr(hDbc, SQL_ATTR_PACKET_SIZE, (SQLPOINTER) size_t(v), 0);
+ } else if (opt.toUpper() == QLatin1String("SQL_ATTR_TRACEFILE")) {
+- val.utf16(); // 0 terminate
+- r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACEFILE,
+- toSQLTCHAR(val).data(),
+- val.length()*sizeof(SQLTCHAR));
++ r = qt_string_SQLSetConnectAttr(hDbc, SQL_ATTR_TRACEFILE, val);
+ } else if (opt.toUpper() == QLatin1String("SQL_ATTR_TRACE")) {
+ if (val.toUpper() == QLatin1String("SQL_OPT_TRACE_OFF")) {
+ v = SQL_OPT_TRACE_OFF;
+@@ -1022,9 +1040,12 @@ bool QODBCResult::reset (const QString& query)
+ return false;
+ }
+
+- r = SQLExecDirect(d->hStmt,
+- toSQLTCHAR(query).data(),
+- (SQLINTEGER) query.length());
++ {
++ auto encoded = toSQLTCHAR(query);
++ r = SQLExecDirect(d->hStmt,
++ encoded.data(),
++ SQLINTEGER(encoded.size()));
++ }
+ if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO && r!= SQL_NO_DATA) {
+ setLastError(qMakeError(QCoreApplication::translate("QODBCResult",
+ "Unable to execute statement"), QSqlError::StatementError, d));
+@@ -1371,9 +1392,12 @@ bool QODBCResult::prepare(const QString& query)
+ return false;
+ }
+
+- r = SQLPrepare(d->hStmt,
+- toSQLTCHAR(query).data(),
+- (SQLINTEGER) query.length());
++ {
++ auto encoded = toSQLTCHAR(query);
++ r = SQLPrepare(d->hStmt,
++ encoded.data(),
++ SQLINTEGER(encoded.size()));
++ }
+
+ if (r != SQL_SUCCESS) {
+ setLastError(qMakeError(QCoreApplication::translate("QODBCResult",
+@@ -1401,7 +1425,7 @@ bool QODBCResult::exec()
+ SQLCloseCursor(d->hStmt);
+
+ QVector<QVariant>& values = boundValues();
+- QVector<QByteArray> tmpStorage(values.count(), QByteArray()); // holds temporary buffers
++ QVector<QByteArray> tmpStorage(values.count(), QByteArray()); // targets for SQLBindParameter()
+ QVarLengthArray<SQLLEN, 32> indicators(values.count());
+ memset(indicators.data(), 0, indicators.size() * sizeof(SQLLEN));
+
+@@ -1580,35 +1604,36 @@ bool QODBCResult::exec()
+ case QVariant::String:
+ if (d->unicode) {
+ QByteArray &ba = tmpStorage[i];
+- QString str = val.toString();
++ {
++ const auto encoded = toSQLTCHAR(val.toString());
++ ba = QByteArray(reinterpret_cast<const char *>(encoded.data()),
++ encoded.size() * sizeof(SQLTCHAR));
++ }
++
+ if (*ind != SQL_NULL_DATA)
+- *ind = str.length() * sizeof(SQLTCHAR);
+- int strSize = str.length() * sizeof(SQLTCHAR);
++ *ind = ba.size();
+
+ if (bindValueType(i) & QSql::Out) {
+- const QVarLengthArray<SQLTCHAR> a(toSQLTCHAR(str));
+- ba = QByteArray((const char *)a.constData(), a.size() * sizeof(SQLTCHAR));
+ r = SQLBindParameter(d->hStmt,
+ i + 1,
+ qParamType[bindValueType(i) & QSql::InOut],
+ SQL_C_TCHAR,
+- strSize > 254 ? SQL_WLONGVARCHAR : SQL_WVARCHAR,
++ ba.size() > 254 ? SQL_WLONGVARCHAR : SQL_WVARCHAR,
+ 0, // god knows... don't change this!
+ 0,
+- ba.data(),
++ const_cast<char *>(ba.constData()), // don't detach
+ ba.size(),
+ ind);
+ break;
+ }
+- ba = QByteArray ((const char *)toSQLTCHAR(str).constData(), str.size()*sizeof(SQLTCHAR));
+ r = SQLBindParameter(d->hStmt,
+ i + 1,
+ qParamType[bindValueType(i) & QSql::InOut],
+ SQL_C_TCHAR,
+- strSize > 254 ? SQL_WLONGVARCHAR : SQL_WVARCHAR,
+- strSize,
++ ba.size() > 254 ? SQL_WLONGVARCHAR : SQL_WVARCHAR,
++ ba.size(),
+ 0,
+- const_cast<char *>(ba.constData()),
++ const_cast<char *>(ba.constData()), // don't detach
+ ba.size(),
+ ind);
+ break;
+@@ -1716,10 +1741,11 @@ bool QODBCResult::exec()
+ case QVariant::String:
+ if (d->unicode) {
+ if (bindValueType(i) & QSql::Out) {
+- const QByteArray &first = tmpStorage.at(i);
+- QVarLengthArray<SQLTCHAR> array;
+- array.append((const SQLTCHAR *)first.constData(), first.size());
+- values[i] = fromSQLTCHAR(array, first.size()/sizeof(SQLTCHAR));
++ const QByteArray &bytes = tmpStorage.at(i);
++ const auto strSize = bytes.size() / int(sizeof(SQLTCHAR));
++ QVarLengthArray<SQLTCHAR> string(strSize);
++ memcpy(string.data(), bytes.data(), strSize * sizeof(SQLTCHAR));
++ values[i] = fromSQLTCHAR(string);
+ }
+ break;
+ }
+@@ -1966,14 +1992,16 @@ bool QODBCDriver::open(const QString & db,
+ SQLSMALLINT cb;
+ QVarLengthArray<SQLTCHAR> connOut(1024);
+ memset(connOut.data(), 0, connOut.size() * sizeof(SQLTCHAR));
+- r = SQLDriverConnect(d->hDbc,
+- NULL,
+- toSQLTCHAR(connQStr).data(),
+- (SQLSMALLINT)connQStr.length(),
+- connOut.data(),
+- 1024,
+- &cb,
+- /*SQL_DRIVER_NOPROMPT*/0);
++ {
++ auto encoded = toSQLTCHAR(connQStr);
++ r = SQLDriverConnect(d->hDbc,
++ nullptr,
++ encoded.data(), SQLSMALLINT(encoded.size()),
++ connOut.data(),
++ 1024,
++ &cb,
++ /*SQL_DRIVER_NOPROMPT*/0);
++ }
+
+ if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) {
+ setLastError(qMakeError(tr("Unable to connect"), QSqlError::ConnectionError, d));
+@@ -2352,17 +2380,15 @@ QStringList QODBCDriver::tables(QSql::TableType type) const
+ if (tableType.isEmpty())
+ return tl;
+
+- QString joinedTableTypeString = tableType.join(QLatin1Char(','));
++ {
++ auto joinedTableTypeString = toSQLTCHAR(tableType.join(u','));
+
+- r = SQLTables(hStmt,
+- NULL,
+- 0,
+- NULL,
+- 0,
+- NULL,
+- 0,
+- toSQLTCHAR(joinedTableTypeString).data(),
+- joinedTableTypeString.length() /* characters, not bytes */);
++ r = SQLTables(hStmt,
++ nullptr, 0,
++ nullptr, 0,
++ nullptr, 0,
++ joinedTableTypeString.data(), joinedTableTypeString.size());
++ }
+
+ if (r != SQL_SUCCESS)
+ qSqlWarning(QLatin1String("QODBCDriver::tables Unable to execute table list"), d);
+@@ -2436,28 +2462,30 @@ QSqlIndex QODBCDriver::primaryIndex(const QString& tablename) const
+ SQL_ATTR_CURSOR_TYPE,
+ (SQLPOINTER)SQL_CURSOR_FORWARD_ONLY,
+ SQL_IS_UINTEGER);
+- r = SQLPrimaryKeys(hStmt,
+- catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).data(),
+- catalog.length(),
+- schema.length() == 0 ? NULL : toSQLTCHAR(schema).data(),
+- schema.length(),
+- toSQLTCHAR(table).data(),
+- table.length() /* in characters, not in bytes */);
++ {
++ auto c = toSQLTCHAR(catalog);
++ auto s = toSQLTCHAR(schema);
++ auto t = toSQLTCHAR(table);
++ r = SQLPrimaryKeys(hStmt,
++ catalog.isEmpty() ? nullptr : c.data(), c.size(),
++ schema.isEmpty() ? nullptr : s.data(), s.size(),
++ t.data(), t.size());
++ }
+
+ // if the SQLPrimaryKeys() call does not succeed (e.g the driver
+ // does not support it) - try an alternative method to get hold of
+ // the primary index (e.g MS Access and FoxPro)
+ if (r != SQL_SUCCESS) {
+- r = SQLSpecialColumns(hStmt,
+- SQL_BEST_ROWID,
+- catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).data(),
+- catalog.length(),
+- schema.length() == 0 ? NULL : toSQLTCHAR(schema).data(),
+- schema.length(),
+- toSQLTCHAR(table).data(),
+- table.length(),
+- SQL_SCOPE_CURROW,
+- SQL_NULLABLE);
++ auto c = toSQLTCHAR(catalog);
++ auto s = toSQLTCHAR(schema);
++ auto t = toSQLTCHAR(table);
++ r = SQLSpecialColumns(hStmt,
++ SQL_BEST_ROWID,
++ catalog.isEmpty() ? nullptr : c.data(), c.size(),
++ schema.isEmpty() ? nullptr : s.data(), s.size(),
++ t.data(), t.size(),
++ SQL_SCOPE_CURROW,
++ SQL_NULLABLE);
+
+ if (r != SQL_SUCCESS) {
+ qSqlWarning(QLatin1String("QODBCDriver::primaryIndex: Unable to execute primary key list"), d);
+@@ -2538,15 +2566,17 @@ QSqlRecord QODBCDriver::record(const QString& tablename) const
+ SQL_ATTR_CURSOR_TYPE,
+ (SQLPOINTER)SQL_CURSOR_FORWARD_ONLY,
+ SQL_IS_UINTEGER);
+- r = SQLColumns(hStmt,
+- catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).data(),
+- catalog.length(),
+- schema.length() == 0 ? NULL : toSQLTCHAR(schema).data(),
+- schema.length(),
+- toSQLTCHAR(table).data(),
+- table.length(),
+- NULL,
+- 0);
++ {
++ auto c = toSQLTCHAR(catalog);
++ auto s = toSQLTCHAR(schema);
++ auto t = toSQLTCHAR(table);
++ r = SQLColumns(hStmt,
++ catalog.isEmpty() ? nullptr : c.data(), c.size(),
++ schema.isEmpty() ? nullptr : s.data(), s.size(),
++ t.data(), t.size(),
++ nullptr,
++ 0);
++ }
+ if (r != SQL_SUCCESS)
+ qSqlWarning(QLatin1String("QODBCDriver::record: Unable to execute column list"), d);
+
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0003-CVE-2023-32573-qtsvg-5.15.diff.patch b/patches/qt-everywhere-opensource-src-5.15.12/0003-CVE-2023-32573-qtsvg-5.15.diff.patch
new file mode 100644
index 000000000..b96825c16
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0003-CVE-2023-32573-qtsvg-5.15.diff.patch
@@ -0,0 +1,46 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 16 Oct 2023 10:13:22 +0200
+Subject: [PATCH] CVE-2023-32573-qtsvg-5.15.diff
+
+Imported from https://download.qt.io/archive/qt/5.15/
+---
+ qtsvg/src/svg/qsvgfont_p.h | 5 ++---
+ qtsvg/src/svg/qsvghandler.cpp | 2 +-
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/qtsvg/src/svg/qsvgfont_p.h b/qtsvg/src/svg/qsvgfont_p.h
+index fd0a3fab8f17..fcffbe85b5e5 100644
+--- a/qtsvg/src/svg/qsvgfont_p.h
++++ b/qtsvg/src/svg/qsvgfont_p.h
+@@ -74,6 +74,7 @@ public:
+ class Q_SVG_PRIVATE_EXPORT QSvgFont : public QSvgRefCounted
+ {
+ public:
++ static constexpr qreal DEFAULT_UNITS_PER_EM = 1000;
+ QSvgFont(qreal horizAdvX);
+
+ void setFamilyName(const QString &name);
+@@ -86,9 +87,7 @@ public:
+ void draw(QPainter *p, const QPointF &point, const QString &str, qreal pixelSize, Qt::Alignment alignment) const;
+ public:
+ QString m_familyName;
+- qreal m_unitsPerEm;
+- qreal m_ascent;
+- qreal m_descent;
++ qreal m_unitsPerEm = DEFAULT_UNITS_PER_EM;
+ qreal m_horizAdvX;
+ QHash<QChar, QSvgGlyph> m_glyphs;
+ };
+diff --git a/qtsvg/src/svg/qsvghandler.cpp b/qtsvg/src/svg/qsvghandler.cpp
+index c229c3b5dc1f..dd9b7164030d 100644
+--- a/qtsvg/src/svg/qsvghandler.cpp
++++ b/qtsvg/src/svg/qsvghandler.cpp
+@@ -2668,7 +2668,7 @@ static bool parseFontFaceNode(QSvgStyleProperty *parent,
+
+ qreal unitsPerEm = toDouble(unitsPerEmStr);
+ if (!unitsPerEm)
+- unitsPerEm = 1000;
++ unitsPerEm = QSvgFont::DEFAULT_UNITS_PER_EM;
+
+ if (!name.isEmpty())
+ font->setFamilyName(name);
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0004-CVE-2023-32762-qtbase-5.15.diff.patch b/patches/qt-everywhere-opensource-src-5.15.12/0004-CVE-2023-32762-qtbase-5.15.diff.patch
new file mode 100644
index 000000000..903db17a3
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0004-CVE-2023-32762-qtbase-5.15.diff.patch
@@ -0,0 +1,24 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 16 Oct 2023 10:13:22 +0200
+Subject: [PATCH] CVE-2023-32762-qtbase-5.15.diff
+
+Imported from https://download.qt.io/archive/qt/5.15/
+---
+ qtbase/src/network/access/qhsts.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/qtbase/src/network/access/qhsts.cpp b/qtbase/src/network/access/qhsts.cpp
+index 0cef0ad3dc01..be7ef7ff58f5 100644
+--- a/qtbase/src/network/access/qhsts.cpp
++++ b/qtbase/src/network/access/qhsts.cpp
+@@ -364,8 +364,8 @@ quoted-pair = "\" CHAR
+ bool QHstsHeaderParser::parse(const QList<QPair<QByteArray, QByteArray>> &headers)
+ {
+ for (const auto &h : headers) {
+- // We use '==' since header name was already 'trimmed' for us:
+- if (h.first == "Strict-Transport-Security") {
++ // We compare directly because header name was already 'trimmed' for us:
++ if (h.first.compare("Strict-Transport-Security", Qt::CaseInsensitive) == 0) {
+ header = h.second;
+ // RFC6797, 8.1:
+ //
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0005-CVE-2023-32763-qtbase-5.15.diff.patch b/patches/qt-everywhere-opensource-src-5.15.12/0005-CVE-2023-32763-qtbase-5.15.diff.patch
new file mode 100644
index 000000000..3cbc6c256
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0005-CVE-2023-32763-qtbase-5.15.diff.patch
@@ -0,0 +1,59 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 16 Oct 2023 10:13:23 +0200
+Subject: [PATCH] CVE-2023-32763-qtbase-5.15.diff
+
+Imported from https://download.qt.io/archive/qt/5.15/
+---
+ qtbase/src/gui/painting/qfixed_p.h | 9 +++++++++
+ qtbase/src/gui/text/qtextlayout.cpp | 9 ++++++---
+ 2 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/qtbase/src/gui/painting/qfixed_p.h b/qtbase/src/gui/painting/qfixed_p.h
+index 846592881c20..57d750a4b3c8 100644
+--- a/qtbase/src/gui/painting/qfixed_p.h
++++ b/qtbase/src/gui/painting/qfixed_p.h
+@@ -54,6 +54,7 @@
+ #include <QtGui/private/qtguiglobal_p.h>
+ #include "QtCore/qdebug.h"
+ #include "QtCore/qpoint.h"
++#include <QtCore/private/qnumeric_p.h>
+ #include "QtCore/qsize.h"
+
+ QT_BEGIN_NAMESPACE
+@@ -182,6 +183,14 @@ Q_DECL_CONSTEXPR inline bool operator<(int i, const QFixed &f) { return i * 64 <
+ Q_DECL_CONSTEXPR inline bool operator>(const QFixed &f, int i) { return f.value() > i * 64; }
+ Q_DECL_CONSTEXPR inline bool operator>(int i, const QFixed &f) { return i * 64 > f.value(); }
+
++inline bool qAddOverflow(QFixed v1, QFixed v2, QFixed *r)
++{
++ int val;
++ bool result = add_overflow(v1.value(), v2.value(), &val);
++ r->setValue(val);
++ return result;
++}
++
+ #ifndef QT_NO_DEBUG_STREAM
+ inline QDebug &operator<<(QDebug &dbg, const QFixed &f)
+ { return dbg << f.toReal(); }
+diff --git a/qtbase/src/gui/text/qtextlayout.cpp b/qtbase/src/gui/text/qtextlayout.cpp
+index 30f07ba69b5a..627b4662b3d9 100644
+--- a/qtbase/src/gui/text/qtextlayout.cpp
++++ b/qtbase/src/gui/text/qtextlayout.cpp
+@@ -2163,11 +2163,14 @@ found:
+ eng->maxWidth = qMax(eng->maxWidth, line.textWidth);
+ } else {
+ eng->minWidth = qMax(eng->minWidth, lbh.minw);
+- eng->maxWidth += line.textWidth;
++ if (qAddOverflow(eng->maxWidth, line.textWidth, &eng->maxWidth))
++ eng->maxWidth = QFIXED_MAX;
+ }
+
+- if (line.textWidth > 0 && item < eng->layoutData->items.size())
+- eng->maxWidth += lbh.spaceData.textWidth;
++ if (line.textWidth > 0 && item < eng->layoutData->items.size()) {
++ if (qAddOverflow(eng->maxWidth, lbh.spaceData.textWidth, &eng->maxWidth))
++ eng->maxWidth = QFIXED_MAX;
++ }
+
+ line.textWidth += trailingSpace;
+ if (lbh.spaceData.length) {
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0006-CVE-2023-33285-qtbase-5.15.diff.patch b/patches/qt-everywhere-opensource-src-5.15.12/0006-CVE-2023-33285-qtbase-5.15.diff.patch
new file mode 100644
index 000000000..975a8a14c
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0006-CVE-2023-33285-qtbase-5.15.diff.patch
@@ -0,0 +1,79 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 16 Oct 2023 10:13:23 +0200
+Subject: [PATCH] CVE-2023-33285-qtbase-5.15.diff
+
+Imported from https://download.qt.io/archive/qt/5.15/
+---
+ qtbase/src/network/kernel/qdnslookup_unix.cpp | 31 +++++++++++++++++++++------
+ 1 file changed, 25 insertions(+), 6 deletions(-)
+
+diff --git a/qtbase/src/network/kernel/qdnslookup_unix.cpp b/qtbase/src/network/kernel/qdnslookup_unix.cpp
+index 12b40fc35dda..99e999d436c9 100644
+--- a/qtbase/src/network/kernel/qdnslookup_unix.cpp
++++ b/qtbase/src/network/kernel/qdnslookup_unix.cpp
+@@ -227,7 +227,6 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
+ // responseLength in case of error, we still can extract the
+ // exact error code from the response.
+ HEADER *header = (HEADER*)response;
+- const int answerCount = ntohs(header->ancount);
+ switch (header->rcode) {
+ case NOERROR:
+ break;
+@@ -260,18 +259,31 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
+ return;
+ }
+
+- // Skip the query host, type (2 bytes) and class (2 bytes).
+ char host[PACKETSZ], answer[PACKETSZ];
+ unsigned char *p = response + sizeof(HEADER);
+- int status = local_dn_expand(response, response + responseLength, p, host, sizeof(host));
+- if (status < 0) {
++ int status;
++
++ if (ntohs(header->qdcount) == 1) {
++ // Skip the query host, type (2 bytes) and class (2 bytes).
++ status = local_dn_expand(response, response + responseLength, p, host, sizeof(host));
++ if (status < 0) {
++ reply->error = QDnsLookup::InvalidReplyError;
++ reply->errorString = tr("Could not expand domain name");
++ return;
++ }
++ if ((p - response) + status + 4 >= responseLength)
++ header->qdcount = 0xffff; // invalid reply below
++ else
++ p += status + 4;
++ }
++ if (ntohs(header->qdcount) > 1) {
+ reply->error = QDnsLookup::InvalidReplyError;
+- reply->errorString = tr("Could not expand domain name");
++ reply->errorString = tr("Invalid reply received");
+ return;
+ }
+- p += status + 4;
+
+ // Extract results.
++ const int answerCount = ntohs(header->ancount);
+ int answerIndex = 0;
+ while ((p < response + responseLength) && (answerIndex < answerCount)) {
+ status = local_dn_expand(response, response + responseLength, p, host, sizeof(host));
+@@ -283,6 +295,11 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
+ const QString name = QUrl::fromAce(host);
+
+ p += status;
++
++ if ((p - response) + 10 > responseLength) {
++ // probably just a truncated reply, return what we have
++ return;
++ }
+ const quint16 type = (p[0] << 8) | p[1];
+ p += 2; // RR type
+ p += 2; // RR class
+@@ -290,6 +307,8 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
+ p += 4;
+ const quint16 size = (p[0] << 8) | p[1];
+ p += 2;
++ if ((p - response) + size > responseLength)
++ return; // truncated
+
+ if (type == QDnsLookup::A) {
+ if (size != 4) {
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0007-CVE-2023-34410-qtbase-5.15.diff.patch b/patches/qt-everywhere-opensource-src-5.15.12/0007-CVE-2023-34410-qtbase-5.15.diff.patch
new file mode 100644
index 000000000..9c57607da
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0007-CVE-2023-34410-qtbase-5.15.diff.patch
@@ -0,0 +1,66 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 16 Oct 2023 10:13:24 +0200
+Subject: [PATCH] CVE-2023-34410-qtbase-5.15.diff
+
+Imported from https://download.qt.io/archive/qt/5.15/
+---
+ qtbase/src/network/ssl/qsslsocket.cpp | 5 +++++
+ qtbase/src/network/ssl/qsslsocket_schannel.cpp | 22 ++++++++++++++++++++++
+ 2 files changed, 27 insertions(+)
+
+diff --git a/qtbase/src/network/ssl/qsslsocket.cpp b/qtbase/src/network/ssl/qsslsocket.cpp
+index 5bb6e7ee4aed..2a0b3a4f1d13 100644
+--- a/qtbase/src/network/ssl/qsslsocket.cpp
++++ b/qtbase/src/network/ssl/qsslsocket.cpp
+@@ -2221,6 +2221,10 @@ QSslSocketPrivate::QSslSocketPrivate()
+ , flushTriggered(false)
+ {
+ QSslConfigurationPrivate::deepCopyDefaultConfiguration(&configuration);
++ // If the global configuration doesn't allow root certificates to be loaded
++ // on demand then we have to disable it for this socket as well.
++ if (!configuration.allowRootCertOnDemandLoading)
++ allowRootCertOnDemandLoading = false;
+ }
+
+ /*!
+@@ -2470,6 +2474,7 @@ void QSslConfigurationPrivate::deepCopyDefaultConfiguration(QSslConfigurationPri
+ ptr->sessionProtocol = global->sessionProtocol;
+ ptr->ciphers = global->ciphers;
+ ptr->caCertificates = global->caCertificates;
++ ptr->allowRootCertOnDemandLoading = global->allowRootCertOnDemandLoading;
+ ptr->protocol = global->protocol;
+ ptr->peerVerifyMode = global->peerVerifyMode;
+ ptr->peerVerifyDepth = global->peerVerifyDepth;
+diff --git a/qtbase/src/network/ssl/qsslsocket_schannel.cpp b/qtbase/src/network/ssl/qsslsocket_schannel.cpp
+index c956ce3c2bfe..d1b23af29b83 100644
+--- a/qtbase/src/network/ssl/qsslsocket_schannel.cpp
++++ b/qtbase/src/network/ssl/qsslsocket_schannel.cpp
+@@ -1880,6 +1880,28 @@ bool QSslSocketBackendPrivate::verifyCertContext(CERT_CONTEXT *certContext)
+ if (configuration.peerVerifyDepth > 0 && DWORD(configuration.peerVerifyDepth) < verifyDepth)
+ verifyDepth = DWORD(configuration.peerVerifyDepth);
+
++ const auto &caCertificates = q->sslConfiguration().caCertificates();
++
++ if (!rootCertOnDemandLoadingAllowed()
++ && !(chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_PARTIAL_CHAIN)
++ && (q->peerVerifyMode() == QSslSocket::VerifyPeer
++ || (isClient && q->peerVerifyMode() == QSslSocket::AutoVerifyPeer))) {
++ // When verifying a peer Windows "helpfully" builds a chain that
++ // may include roots from the system store. But we don't want that if
++ // the user has set their own CA certificates.
++ // Since Windows claims this is not a partial chain the root is included
++ // and we have to check that it is one of our configured CAs.
++ CERT_CHAIN_ELEMENT *element = chain->rgpElement[chain->cElement - 1];
++ QSslCertificate certificate = getCertificateFromChainElement(element);
++ if (!caCertificates.contains(certificate)) {
++ auto error = QSslError(QSslError::CertificateUntrusted, certificate);
++ sslErrors += error;
++ emit q->peerVerifyError(error);
++ if (q->state() != QAbstractSocket::ConnectedState)
++ return false;
++ }
++ }
++
+ for (DWORD i = 0; i < verifyDepth; i++) {
+ CERT_CHAIN_ELEMENT *element = chain->rgpElement[i];
+ QSslCertificate certificate = getCertificateFromChainElement(element);
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0008-CVE-2023-37369-qtbase-5.15.diff.patch b/patches/qt-everywhere-opensource-src-5.15.12/0008-CVE-2023-37369-qtbase-5.15.diff.patch
new file mode 100644
index 000000000..f80d4e2f8
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0008-CVE-2023-37369-qtbase-5.15.diff.patch
@@ -0,0 +1,214 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 16 Oct 2023 10:13:24 +0200
+Subject: [PATCH] CVE-2023-37369-qtbase-5.15.diff
+
+Imported from https://download.qt.io/archive/qt/5.15/
+---
+ qtbase/src/corelib/serialization/qxmlstream.cpp | 39 ++++++++++++++++---------
+ qtbase/src/corelib/serialization/qxmlstream.g | 25 ++++++++++++++--
+ qtbase/src/corelib/serialization/qxmlstream_p.h | 25 ++++++++++++++--
+ 3 files changed, 69 insertions(+), 20 deletions(-)
+
+diff --git a/qtbase/src/corelib/serialization/qxmlstream.cpp b/qtbase/src/corelib/serialization/qxmlstream.cpp
+index 0ac554817879..561f3107a95e 100644
+--- a/qtbase/src/corelib/serialization/qxmlstream.cpp
++++ b/qtbase/src/corelib/serialization/qxmlstream.cpp
+@@ -1302,15 +1302,18 @@ inline int QXmlStreamReaderPrivate::fastScanContentCharList()
+ return n;
+ }
+
+-inline int QXmlStreamReaderPrivate::fastScanName(int *prefix)
++// Fast scan an XML attribute name (e.g. "xml:lang").
++inline QXmlStreamReaderPrivate::FastScanNameResult
++QXmlStreamReaderPrivate::fastScanName(Value *val)
+ {
+ int n = 0;
+ uint c;
+ while ((c = getChar()) != StreamEOF) {
+ if (n >= 4096) {
+ // This is too long to be a sensible name, and
+- // can exhaust memory
+- return 0;
++ // can exhaust memory, or the range of decltype(*prefix)
++ raiseNamePrefixTooLongError();
++ return {};
+ }
+ switch (c) {
+ case '\n':
+@@ -1339,23 +1342,23 @@ inline int QXmlStreamReaderPrivate::fastScanName(int *prefix)
+ case '+':
+ case '*':
+ putChar(c);
+- if (prefix && *prefix == n+1) {
+- *prefix = 0;
++ if (val && val->prefix == n + 1) {
++ val->prefix = 0;
+ putChar(':');
+ --n;
+ }
+- return n;
++ return FastScanNameResult(n);
+ case ':':
+- if (prefix) {
+- if (*prefix == 0) {
+- *prefix = n+2;
++ if (val) {
++ if (val->prefix == 0) {
++ val->prefix = n + 2;
+ } else { // only one colon allowed according to the namespace spec.
+ putChar(c);
+- return n;
++ return FastScanNameResult(n);
+ }
+ } else {
+ putChar(c);
+- return n;
++ return FastScanNameResult(n);
+ }
+ Q_FALLTHROUGH();
+ default:
+@@ -1364,12 +1367,12 @@ inline int QXmlStreamReaderPrivate::fastScanName(int *prefix)
+ }
+ }
+
+- if (prefix)
+- *prefix = 0;
++ if (val)
++ val->prefix = 0;
+ int pos = textBuffer.size() - n;
+ putString(textBuffer, pos);
+ textBuffer.resize(pos);
+- return 0;
++ return FastScanNameResult(0);
+ }
+
+ enum NameChar { NameBeginning, NameNotBeginning, NotName };
+@@ -1878,6 +1881,14 @@ void QXmlStreamReaderPrivate::raiseWellFormedError(const QString &message)
+ raiseError(QXmlStreamReader::NotWellFormedError, message);
+ }
+
++void QXmlStreamReaderPrivate::raiseNamePrefixTooLongError()
++{
++ // TODO: add a ImplementationLimitsExceededError and use it instead
++ raiseError(QXmlStreamReader::NotWellFormedError,
++ QXmlStream::tr("Length of XML attribute name exceeds implemnetation limits (4KiB "
++ "characters)."));
++}
++
+ void QXmlStreamReaderPrivate::parseError()
+ {
+
+diff --git a/qtbase/src/corelib/serialization/qxmlstream.g b/qtbase/src/corelib/serialization/qxmlstream.g
+index 4321fed68a47..8c6a1a588706 100644
+--- a/qtbase/src/corelib/serialization/qxmlstream.g
++++ b/qtbase/src/corelib/serialization/qxmlstream.g
+@@ -516,7 +516,16 @@ public:
+ int fastScanLiteralContent();
+ int fastScanSpace();
+ int fastScanContentCharList();
+- int fastScanName(int *prefix = nullptr);
++
++ struct FastScanNameResult {
++ FastScanNameResult() : ok(false) {}
++ explicit FastScanNameResult(int len) : addToLen(len), ok(true) { }
++ operator bool() { return ok; }
++ int operator*() { Q_ASSERT(ok); return addToLen; }
++ int addToLen;
++ bool ok;
++ };
++ FastScanNameResult fastScanName(Value *val = nullptr);
+ inline int fastScanNMTOKEN();
+
+
+@@ -525,6 +534,7 @@ public:
+
+ void raiseError(QXmlStreamReader::Error error, const QString& message = QString());
+ void raiseWellFormedError(const QString &message);
++ void raiseNamePrefixTooLongError();
+
+ QXmlStreamEntityResolver *entityResolver;
+
+@@ -1811,7 +1821,12 @@ space_opt ::= space;
+ qname ::= LETTER;
+ /.
+ case $rule_number: {
+- sym(1).len += fastScanName(&sym(1).prefix);
++ Value &val = sym(1);
++ if (auto res = fastScanName(&val))
++ val.len += *res;
++ else
++ return false;
++
+ if (atEnd) {
+ resume($rule_number);
+ return false;
+@@ -1822,7 +1837,11 @@ qname ::= LETTER;
+ name ::= LETTER;
+ /.
+ case $rule_number:
+- sym(1).len += fastScanName();
++ if (auto res = fastScanName())
++ sym(1).len += *res;
++ else
++ return false;
++
+ if (atEnd) {
+ resume($rule_number);
+ return false;
+diff --git a/qtbase/src/corelib/serialization/qxmlstream_p.h b/qtbase/src/corelib/serialization/qxmlstream_p.h
+index e5bde7b98e6d..b01484cac3c6 100644
+--- a/qtbase/src/corelib/serialization/qxmlstream_p.h
++++ b/qtbase/src/corelib/serialization/qxmlstream_p.h
+@@ -1005,7 +1005,16 @@ public:
+ int fastScanLiteralContent();
+ int fastScanSpace();
+ int fastScanContentCharList();
+- int fastScanName(int *prefix = nullptr);
++
++ struct FastScanNameResult {
++ FastScanNameResult() : ok(false) {}
++ explicit FastScanNameResult(int len) : addToLen(len), ok(true) { }
++ operator bool() { return ok; }
++ int operator*() { Q_ASSERT(ok); return addToLen; }
++ int addToLen;
++ bool ok;
++ };
++ FastScanNameResult fastScanName(Value *val = nullptr);
+ inline int fastScanNMTOKEN();
+
+
+@@ -1014,6 +1023,7 @@ public:
+
+ void raiseError(QXmlStreamReader::Error error, const QString& message = QString());
+ void raiseWellFormedError(const QString &message);
++ void raiseNamePrefixTooLongError();
+
+ QXmlStreamEntityResolver *entityResolver;
+
+@@ -1939,7 +1949,12 @@ bool QXmlStreamReaderPrivate::parse()
+ break;
+
+ case 262: {
+- sym(1).len += fastScanName(&sym(1).prefix);
++ Value &val = sym(1);
++ if (auto res = fastScanName(&val))
++ val.len += *res;
++ else
++ return false;
++
+ if (atEnd) {
+ resume(262);
+ return false;
+@@ -1947,7 +1962,11 @@ bool QXmlStreamReaderPrivate::parse()
+ } break;
+
+ case 263:
+- sym(1).len += fastScanName();
++ if (auto res = fastScanName())
++ sym(1).len += *res;
++ else
++ return false;
++
+ if (atEnd) {
+ resume(263);
+ return false;
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0009-CVE-2023-38197-qtbase-5.15.diff.patch b/patches/qt-everywhere-opensource-src-5.15.12/0009-CVE-2023-38197-qtbase-5.15.diff.patch
new file mode 100644
index 000000000..182593dd5
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0009-CVE-2023-38197-qtbase-5.15.diff.patch
@@ -0,0 +1,229 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 16 Oct 2023 10:13:25 +0200
+Subject: [PATCH] CVE-2023-38197-qtbase-5.15.diff
+
+Imported from https://download.qt.io/archive/qt/5.15/
+---
+ qtbase/src/corelib/serialization/qxmlstream.cpp | 144 ++++++++++++++++++++++--
+ qtbase/src/corelib/serialization/qxmlstream_p.h | 11 ++
+ 2 files changed, 147 insertions(+), 8 deletions(-)
+
+diff --git a/qtbase/src/corelib/serialization/qxmlstream.cpp b/qtbase/src/corelib/serialization/qxmlstream.cpp
+index 561f3107a95e..fdca35529777 100644
+--- a/qtbase/src/corelib/serialization/qxmlstream.cpp
++++ b/qtbase/src/corelib/serialization/qxmlstream.cpp
+@@ -160,7 +160,7 @@ enum { StreamEOF = ~0U };
+ addData() or by waiting for it to arrive on the device().
+
+ \value UnexpectedElementError The parser encountered an element
+- that was different to those it expected.
++ or token that was different to those it expected.
+
+ */
+
+@@ -295,13 +295,34 @@ QXmlStreamEntityResolver *QXmlStreamReader::entityResolver() const
+
+ QXmlStreamReader is a well-formed XML 1.0 parser that does \e not
+ include external parsed entities. As long as no error occurs, the
+- application code can thus be assured that the data provided by the
+- stream reader satisfies the W3C's criteria for well-formed XML. For
+- example, you can be certain that all tags are indeed nested and
+- closed properly, that references to internal entities have been
+- replaced with the correct replacement text, and that attributes have
+- been normalized or added according to the internal subset of the
+- DTD.
++ application code can thus be assured, that
++ \list
++ \li the data provided by the stream reader satisfies the W3C's
++ criteria for well-formed XML,
++ \li tokens are provided in a valid order.
++ \endlist
++
++ Unless QXmlStreamReader raises an error, it guarantees the following:
++ \list
++ \li All tags are nested and closed properly.
++ \li References to internal entities have been replaced with the
++ correct replacement text.
++ \li Attributes have been normalized or added according to the
++ internal subset of the \l DTD.
++ \li Tokens of type \l StartDocument happen before all others,
++ aside from comments and processing instructions.
++ \li At most one DOCTYPE element (a token of type \l DTD) is present.
++ \li If present, the DOCTYPE appears before all other elements,
++ aside from StartDocument, comments and processing instructions.
++ \endlist
++
++ In particular, once any token of type \l StartElement, \l EndElement,
++ \l Characters, \l EntityReference or \l EndDocument is seen, no
++ tokens of type StartDocument or DTD will be seen. If one is present in
++ the input stream, out of order, an error is raised.
++
++ \note The token types \l Comment and \l ProcessingInstruction may appear
++ anywhere in the stream.
+
+ If an error occurs while parsing, atEnd() and hasError() return
+ true, and error() returns the error that occurred. The functions
+@@ -620,6 +641,7 @@ QXmlStreamReader::TokenType QXmlStreamReader::readNext()
+ d->token = -1;
+ return readNext();
+ }
++ d->checkToken();
+ return d->type;
+ }
+
+@@ -740,6 +762,14 @@ static const short QXmlStreamReader_tokenTypeString_indices[] = {
+ };
+
+
++static const char QXmlStreamReader_XmlContextString[] =
++ "Prolog\0"
++ "Body\0";
++
++static const short QXmlStreamReader_XmlContextString_indices[] = {
++ 0, 7
++};
++
+ /*!
+ \property QXmlStreamReader::namespaceProcessing
+ The namespace-processing flag of the stream reader
+@@ -775,6 +805,16 @@ QString QXmlStreamReader::tokenString() const
+ QXmlStreamReader_tokenTypeString_indices[d->type]);
+ }
+
++/*!
++ \internal
++ \return \param ctxt (Prolog/Body) as a string.
++ */
++QString contextString(QXmlStreamReaderPrivate::XmlContext ctxt)
++{
++ return QLatin1String(QXmlStreamReader_XmlContextString +
++ QXmlStreamReader_XmlContextString_indices[static_cast<int>(ctxt)]);
++}
++
+ #endif // QT_NO_XMLSTREAMREADER
+
+ QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack()
+@@ -866,6 +906,8 @@ void QXmlStreamReaderPrivate::init()
+
+ type = QXmlStreamReader::NoToken;
+ error = QXmlStreamReader::NoError;
++ currentContext = XmlContext::Prolog;
++ foundDTD = false;
+ }
+
+ /*
+@@ -4061,6 +4103,92 @@ void QXmlStreamWriter::writeCurrentToken(const QXmlStreamReader &reader)
+ }
+ }
+
++static bool isTokenAllowedInContext(QXmlStreamReader::TokenType type,
++ QXmlStreamReaderPrivate::XmlContext loc)
++{
++ switch (type) {
++ case QXmlStreamReader::StartDocument:
++ case QXmlStreamReader::DTD:
++ return loc == QXmlStreamReaderPrivate::XmlContext::Prolog;
++
++ case QXmlStreamReader::StartElement:
++ case QXmlStreamReader::EndElement:
++ case QXmlStreamReader::Characters:
++ case QXmlStreamReader::EntityReference:
++ case QXmlStreamReader::EndDocument:
++ return loc == QXmlStreamReaderPrivate::XmlContext::Body;
++
++ case QXmlStreamReader::Comment:
++ case QXmlStreamReader::ProcessingInstruction:
++ return true;
++
++ case QXmlStreamReader::NoToken:
++ case QXmlStreamReader::Invalid:
++ return false;
++ default:
++ return false;
++ }
++}
++
++/*!
++ \internal
++ \brief QXmlStreamReader::isValidToken
++ \return \c true if \param type is a valid token type.
++ \return \c false if \param type is an unexpected token,
++ which indicates a non-well-formed or invalid XML stream.
++ */
++bool QXmlStreamReaderPrivate::isValidToken(QXmlStreamReader::TokenType type)
++{
++ // Don't change currentContext, if Invalid or NoToken occur in the prolog
++ if (type == QXmlStreamReader::Invalid || type == QXmlStreamReader::NoToken)
++ return false;
++
++ // If a token type gets rejected in the body, there is no recovery
++ const bool result = isTokenAllowedInContext(type, currentContext);
++ if (result || currentContext == XmlContext::Body)
++ return result;
++
++ // First non-Prolog token observed => switch context to body and check again.
++ currentContext = XmlContext::Body;
++ return isTokenAllowedInContext(type, currentContext);
++}
++
++/*!
++ \internal
++ Checks token type and raises an error, if it is invalid
++ in the current context (prolog/body).
++ */
++void QXmlStreamReaderPrivate::checkToken()
++{
++ Q_Q(QXmlStreamReader);
++
++ // The token type must be consumed, to keep track if the body has been reached.
++ const XmlContext context = currentContext;
++ const bool ok = isValidToken(type);
++
++ // Do nothing if an error has been raised already (going along with an unexpected token)
++ if (error != QXmlStreamReader::Error::NoError)
++ return;
++
++ if (!ok) {
++ raiseError(QXmlStreamReader::UnexpectedElementError,
++ QLatin1String("Unexpected token type %1 in %2.")
++ .arg(q->tokenString(), contextString(context)));
++ return;
++ }
++
++ if (type != QXmlStreamReader::DTD)
++ return;
++
++ // Raise error on multiple DTD tokens
++ if (foundDTD) {
++ raiseError(QXmlStreamReader::UnexpectedElementError,
++ QLatin1String("Found second DTD token in %1.").arg(contextString(context)));
++ } else {
++ foundDTD = true;
++ }
++}
++
+ /*!
+ \fn bool QXmlStreamAttributes::hasAttribute(const QString &qualifiedName) const
+ \since 4.5
+diff --git a/qtbase/src/corelib/serialization/qxmlstream_p.h b/qtbase/src/corelib/serialization/qxmlstream_p.h
+index b01484cac3c6..be7b1fe66555 100644
+--- a/qtbase/src/corelib/serialization/qxmlstream_p.h
++++ b/qtbase/src/corelib/serialization/qxmlstream_p.h
+@@ -804,6 +804,17 @@ public:
+ #endif
+ bool atEnd;
+
++ enum class XmlContext
++ {
++ Prolog,
++ Body,
++ };
++
++ XmlContext currentContext = XmlContext::Prolog;
++ bool foundDTD = false;
++ bool isValidToken(QXmlStreamReader::TokenType type);
++ void checkToken();
++
+ /*!
+ \sa setType()
+ */
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0010-CVE-2023-43114-5.15.patch b/patches/qt-everywhere-opensource-src-5.15.12/0010-CVE-2023-43114-5.15.patch
new file mode 100644
index 000000000..333832e27
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0010-CVE-2023-43114-5.15.patch
@@ -0,0 +1,126 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 16 Oct 2023 10:13:25 +0200
+Subject: [PATCH] CVE-2023-43114-5.15
+
+Imported from https://download.qt.io/archive/qt/5.15/
+---
+ .../fontdatabases/windows/qwindowsfontdatabase.cpp | 67 ++++++++++++++++------
+ 1 file changed, 51 insertions(+), 16 deletions(-)
+
+diff --git a/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
+index 09d2d916fe47..0e6fe5eb847a 100644
+--- a/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
++++ b/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
+@@ -1471,36 +1471,70 @@ QT_WARNING_POP
+ return fontEngine;
+ }
+
+-static QList<quint32> getTrueTypeFontOffsets(const uchar *fontData)
++static QList<quint32> getTrueTypeFontOffsets(const uchar *fontData, const uchar *fileEndSentinel)
+ {
+ QList<quint32> offsets;
+- const quint32 headerTag = *reinterpret_cast<const quint32 *>(fontData);
++ if (fileEndSentinel - fontData < 12) {
++ qCWarning(lcQpaFonts) << "Corrupted font data detected";
++ return offsets;
++ }
++
++ const quint32 headerTag = qFromUnaligned<quint32>(fontData);
+ if (headerTag != MAKE_TAG('t', 't', 'c', 'f')) {
+ if (headerTag != MAKE_TAG(0, 1, 0, 0)
+ && headerTag != MAKE_TAG('O', 'T', 'T', 'O')
+ && headerTag != MAKE_TAG('t', 'r', 'u', 'e')
+- && headerTag != MAKE_TAG('t', 'y', 'p', '1'))
++ && headerTag != MAKE_TAG('t', 'y', 'p', '1')) {
+ return offsets;
++ }
+ offsets << 0;
+ return offsets;
+ }
++
++ const quint32 maximumNumFonts = 0xffff;
+ const quint32 numFonts = qFromBigEndian<quint32>(fontData + 8);
+- for (uint i = 0; i < numFonts; ++i) {
+- offsets << qFromBigEndian<quint32>(fontData + 12 + i * 4);
++ if (numFonts > maximumNumFonts) {
++ qCWarning(lcQpaFonts) << "Font collection of" << numFonts << "fonts is too large. Aborting.";
++ return offsets;
+ }
++
++ if (quintptr(fileEndSentinel - fontData) > 12 + (numFonts - 1) * 4) {
++ for (quint32 i = 0; i < numFonts; ++i)
++ offsets << qFromBigEndian<quint32>(fontData + 12 + i * 4);
++ } else {
++ qCWarning(lcQpaFonts) << "Corrupted font data detected";
++ }
++
+ return offsets;
+ }
+
+-static void getFontTable(const uchar *fileBegin, const uchar *data, quint32 tag, const uchar **table, quint32 *length)
++static void getFontTable(const uchar *fileBegin, const uchar *fileEndSentinel, const uchar *data, quint32 tag, const uchar **table, quint32 *length)
+ {
+- const quint16 numTables = qFromBigEndian<quint16>(data + 4);
+- for (uint i = 0; i < numTables; ++i) {
+- const quint32 offset = 12 + 16 * i;
+- if (*reinterpret_cast<const quint32 *>(data + offset) == tag) {
+- *table = fileBegin + qFromBigEndian<quint32>(data + offset + 8);
+- *length = qFromBigEndian<quint32>(data + offset + 12);
+- return;
++ if (fileEndSentinel - data >= 6) {
++ const quint16 numTables = qFromBigEndian<quint16>(data + 4);
++ if (fileEndSentinel - data >= 28 + 16 * (numTables - 1)) {
++ for (quint32 i = 0; i < numTables; ++i) {
++ const quint32 offset = 12 + 16 * i;
++ if (qFromUnaligned<quint32>(data + offset) == tag) {
++ const quint32 tableOffset = qFromBigEndian<quint32>(data + offset + 8);
++ if (quintptr(fileEndSentinel - fileBegin) <= tableOffset) {
++ qCWarning(lcQpaFonts) << "Corrupted font data detected";
++ break;
++ }
++ *table = fileBegin + tableOffset;
++ *length = qFromBigEndian<quint32>(data + offset + 12);
++ if (quintptr(fileEndSentinel - *table) < *length) {
++ qCWarning(lcQpaFonts) << "Corrupted font data detected";
++ break;
++ }
++ return;
++ }
++ }
++ } else {
++ qCWarning(lcQpaFonts) << "Corrupted font data detected";
+ }
++ } else {
++ qCWarning(lcQpaFonts) << "Corrupted font data detected";
+ }
+ *table = 0;
+ *length = 0;
+@@ -1513,8 +1547,9 @@ static void getFamiliesAndSignatures(const QByteArray &fontData,
+ QVector<QFontValues> *values)
+ {
+ const uchar *data = reinterpret_cast<const uchar *>(fontData.constData());
++ const uchar *dataEndSentinel = data + fontData.size();
+
+- QList<quint32> offsets = getTrueTypeFontOffsets(data);
++ QList<quint32> offsets = getTrueTypeFontOffsets(data, dataEndSentinel);
+ if (offsets.isEmpty())
+ return;
+
+@@ -1522,7 +1557,7 @@ static void getFamiliesAndSignatures(const QByteArray &fontData,
+ const uchar *font = data + offsets.at(i);
+ const uchar *table;
+ quint32 length;
+- getFontTable(data, font, MAKE_TAG('n', 'a', 'm', 'e'), &table, &length);
++ getFontTable(data, dataEndSentinel, font, MAKE_TAG('n', 'a', 'm', 'e'), &table, &length);
+ if (!table)
+ continue;
+ QFontNames names = qt_getCanonicalFontNames(table, length);
+@@ -1532,7 +1567,7 @@ static void getFamiliesAndSignatures(const QByteArray &fontData,
+ families->append(std::move(names));
+
+ if (values || signatures)
+- getFontTable(data, font, MAKE_TAG('O', 'S', '/', '2'), &table, &length);
++ getFontTable(data, dataEndSentinel, font, MAKE_TAG('O', 'S', '/', '2'), &table, &length);
+
+ if (values) {
+ QFontValues fontValues;
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0011-xkb-fix-build-with-libxkbcommon-1.6.0-and-later.patch b/patches/qt-everywhere-opensource-src-5.15.12/0011-xkb-fix-build-with-libxkbcommon-1.6.0-and-later.patch
new file mode 100644
index 000000000..169fccf6f
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0011-xkb-fix-build-with-libxkbcommon-1.6.0-and-later.patch
@@ -0,0 +1,38 @@
+From: Liang Qi <liang.qi@qt.io>
+Date: Tue, 10 Oct 2023 14:08:48 +0200
+Subject: [PATCH] xkb: fix build with libxkbcommon 1.6.0 and later
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+A few XKB_KEY_dead_* defines got removed from 1.6.0. See also
+https://github.com/xkbcommon/libxkbcommon/blob/6073565903488cb5b9a8d37fdc4a7c2f9d7ad04d/NEWS#L9-L14
+https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/70/diffs?commit_id=cb44799b72f611eb4c9d7cc185bc3b09e070be08
+
+Pick-to: 6.6 6.5 6.2 5.15
+Fixes: QTBUG-117950
+Change-Id: I55861868f2bb29c553d68365fa9b9b6ed01c9aea
+Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
+---
+ qtbase/src/platformsupport/input/xkbcommon/qxkbcommon.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/qtbase/src/platformsupport/input/xkbcommon/qxkbcommon.cpp b/qtbase/src/platformsupport/input/xkbcommon/qxkbcommon.cpp
+index 7bfacf4abe16..cc46275dce39 100644
+--- a/qtbase/src/platformsupport/input/xkbcommon/qxkbcommon.cpp
++++ b/qtbase/src/platformsupport/input/xkbcommon/qxkbcommon.cpp
+@@ -273,10 +273,14 @@ static constexpr const auto KeyTbl = qMakeArray(
+ Xkb2Qt<XKB_KEY_dead_small_schwa, Qt::Key_Dead_Small_Schwa>,
+ Xkb2Qt<XKB_KEY_dead_capital_schwa, Qt::Key_Dead_Capital_Schwa>,
+ Xkb2Qt<XKB_KEY_dead_greek, Qt::Key_Dead_Greek>,
++/* The following four XKB_KEY_dead keys got removed in libxkbcommon 1.6.0
++ The define check is kind of version check here. */
++#ifdef XKB_KEY_dead_lowline
+ Xkb2Qt<XKB_KEY_dead_lowline, Qt::Key_Dead_Lowline>,
+ Xkb2Qt<XKB_KEY_dead_aboveverticalline, Qt::Key_Dead_Aboveverticalline>,
+ Xkb2Qt<XKB_KEY_dead_belowverticalline, Qt::Key_Dead_Belowverticalline>,
+ Xkb2Qt<XKB_KEY_dead_longsolidusoverlay, Qt::Key_Dead_Longsolidusoverlay>,
++#endif
+
+ // Special keys from X.org - This include multimedia keys,
+ // wireless/bluetooth/uwb keys, special launcher keys, etc.
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0100-qtwebengine-chromium-skia-Fix-build-with-gcc-12.patch b/patches/qt-everywhere-opensource-src-5.15.12/0100-qtwebengine-chromium-skia-Fix-build-with-gcc-12.patch
new file mode 100644
index 000000000..659027a4d
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0100-qtwebengine-chromium-skia-Fix-build-with-gcc-12.patch
@@ -0,0 +1,61 @@
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Mon, 16 May 2022 20:01:49 +0000
+Subject: [PATCH] qtwebengine: chromium: skia: Fix build with gcc-12
+
+* fixes:
+/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/qtwebengine/5.15.8+gitAUTOINC+73e76f9e86_48a205f9e0-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 --sysroot=/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/qtwebengine/5.15.8+gitAUTOINC+73e76f9e86_48a205f9e0-r0/recipe-sysroot -MMD -MF obj/skia/skia/SkParseColor.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -DCR_SYSROOT_HASH=5f64b417e1018dcf8fcc81dc2714e0f264b9b911 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_GL -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_USE_LIBGIFCODEC -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DSKIA_IMPLEMENTATION=1 -DSK_GAMMA_EXPONENT=1.2 -DSK_GAMMA_CONTRAST=0.2 -DSK_DEFAULT_FONT_CACHE_LIMIT=20971520 -DWEBP_EXTERN=extern -DUSE_SYSTEM_LIBJPEG -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -Igen -I../../../../git/src/3rdparty/chromium -I../../../../git/src/3rdparty/chromium/third_party/skia -I../../../../git/src/3rdparty/chromium/third_party/libgifcodec -I../../../../git/src/3rdparty/chromium/third_party/vulkan/include -I../../../../git/src/3rdparty/chromium/third_party/vulkan_headers/include -I../../../../git/src/3rdparty/chromium/third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen -Igen -I../../../../git/src/3rdparty/chromium/third_party/libwebp/src -Igen -I../../../../git/src/3rdparty/chromium/third_party/abseil-cpp -I../../../../git/src/3rdparty/chromium/third_party/boringssl/src/include -I../../../../git/src/3rdparty/chromium/third_party/protobuf/src -Igen/protoc_out -I../../../../git/src/3rdparty/chromium/third_party/icu/source/common -I../../../../git/src/3rdparty/chromium/third_party/icu/source/i18n -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -m64 -fno-omit-frame-pointer -g1 -fvisibility=hidden -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -I/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/qtwebengine/5.15.8+gitAUTOINC+73e76f9e86_48a205f9e0-r0/recipe-sysroot/usr/include/libpng16 -I/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/qtwebengine/5.15.8+gitAUTOINC+73e76f9e86_48a205f9e0-r0/recipe-sysroot/usr/include/freetype2 -I/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/qtwebengine/5.15.8+gitAUTOINC+73e76f9e86_48a205f9e0-r0/recipe-sysroot/usr/include/libpng16 -std=gnu++14 -fno-exceptions -fno-rtti --sysroot=../../../../recipe-sysroot -fvisibility-inlines-hidden -std=c++17 -Wno-narrowing -Wno-class-memaccess -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type -Wno-deprecated-copy -c ../../../../git/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp -o obj/skia/skia/SkParseColor.o
+../../../../git/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp: In static member function 'static const char* SkParse::FindNamedColor(const char*, size_t, SkColor*)':
+../../../../git/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp:300:49: error: no matching function for call to 'begin(const char* const [140])'
+ 300 | const auto rec = std::lower_bound(std::begin(gColorNames),
+ | ~~~~~~~~~~^~~~~~~~~~~~~
+In file included from ../../../../recipe-sysroot/usr/include/c++/12.1.0/utility:73,
+ from ../../../../git/src/3rdparty/chromium/third_party/skia/include/core/SkImageInfo.h:11,
+ from ../../../../git/src/3rdparty/chromium/third_party/skia/include/core/SkColor.h:11,
+ from ../../../../git/src/3rdparty/chromium/third_party/skia/include/utils/SkParse.h:13,
+ from ../../../../git/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp:9:
+../../../../recipe-sysroot/usr/include/c++/12.1.0/initializer_list:90:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
+ 90 | begin(initializer_list<_Tp> __ils) noexcept
+ | ^~~~~
+../../../../recipe-sysroot/usr/include/c++/12.1.0/initializer_list:90:5: note: template argument deduction/substitution failed:
+../../../../git/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp:300:49: note: mismatched types 'std::initializer_list<_Tp>' and 'const char* const*'
+ 300 | const auto rec = std::lower_bound(std::begin(gColorNames),
+ | ~~~~~~~~~~^~~~~~~~~~~~~
+../../../../git/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp:301:49: error: no matching function for call to 'end(const char* const [140])'
+ 301 | std::end (gColorNames),
+ | ~~~~~~~~~~^~~~~~~~~~~~~
+../../../../recipe-sysroot/usr/include/c++/12.1.0/initializer_list:101:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
+ 101 | end(initializer_list<_Tp> __ils) noexcept
+ | ^~~
+../../../../recipe-sysroot/usr/include/c++/12.1.0/initializer_list:101:5: note: template argument deduction/substitution failed:
+../../../../git/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp:301:49: note: mismatched types 'std::initializer_list<_Tp>' and 'const char* const*'
+ 301 | std::end (gColorNames),
+ | ~~~~~~~~~~^~~~~~~~~~~~~
+../../../../git/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp:307:24: error: no matching function for call to 'end(const char* const [140])'
+ 307 | if (rec == std::end(gColorNames) || 0 != strcmp(name, *rec)) {
+ | ~~~~~~~~^~~~~~~~~~~~~
+../../../../recipe-sysroot/usr/include/c++/12.1.0/initializer_list:101:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
+ 101 | end(initializer_list<_Tp> __ils) noexcept
+ | ^~~
+../../../../recipe-sysroot/usr/include/c++/12.1.0/initializer_list:101:5: note: template argument deduction/substitution failed:
+../../../../git/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp:307:24: note: mismatched types 'std::initializer_list<_Tp>' and 'const char* const*'
+ 307 | if (rec == std::end(gColorNames) || 0 != strcmp(name, *rec)) {
+ | ~~~~~~~~^~~~~~~~~~~~~
+[67/9144] CXX obj/skia/skia/GrClipStack.o
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ .../src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp b/qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
+index 7260365b2c67..cd07eb486501 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
++++ b/qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp
+@@ -7,6 +7,7 @@
+
+
+ #include "include/utils/SkParse.h"
++#include <vector>
+
+ static constexpr const char* gColorNames[] = {
+ "aliceblue",
diff --git a/patches/qt-everywhere-src-5.15.2/0003-qt3d-link-with-latomic-if-necessary.patch b/patches/qt-everywhere-opensource-src-5.15.12/0101-qt3d-link-with-latomic-if-necessary.patch
index 6445dc4f4..6445dc4f4 100644
--- a/patches/qt-everywhere-src-5.15.2/0003-qt3d-link-with-latomic-if-necessary.patch
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0101-qt3d-link-with-latomic-if-necessary.patch
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0102-qt5-qtwebengine-fix-gcc13-errors.patch b/patches/qt-everywhere-opensource-src-5.15.12/0102-qt5-qtwebengine-fix-gcc13-errors.patch
new file mode 100644
index 000000000..1df3c0d89
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0102-qt5-qtwebengine-fix-gcc13-errors.patch
@@ -0,0 +1,268 @@
+From: Fabian Pfitzner <f.pfitzner@pengutronix.de>
+Date: Tue, 7 Nov 2023 15:22:29 +0100
+Subject: [PATCH] qt5 qtwebengine: fix gcc13 errors
+
+newer toolchains based on gcc13 will throw errors like
+
+../../../../../qt-everywhere-opensource-src-5.15.11/qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h:34:33: error: found ':' in nested-name-specifier, expected '::'
+ 34 | enum class FormatConversionChar : uint8_t;
+ | ^
+ | ::
+
+which is due to a missing include. the file cstdint.h defines the types
+necessary by qtwebengine and therefore this patch includes the file
+where needed.
+
+Signed-off-by: Fabian Pfitzner <f.pfitzner@pengutronix.de>
+---
+ qtwebengine/src/3rdparty/chromium/base/debug/profiler.h | 1 +
+ .../chromium/content/public/browser/browsing_data_remover_delegate.h | 1 +
+ .../3rdparty/chromium/device/base/synchronization/one_writer_seqlock.cc | 2 ++
+ .../src/3rdparty/chromium/device/bluetooth/public/cpp/bluetooth_uuid.h | 1 +
+ .../src/3rdparty/chromium/gpu/command_buffer/common/webgpu_cmd_enums.h | 2 ++
+ qtwebengine/src/3rdparty/chromium/gpu/config/device_perf_info.h | 1 +
+ qtwebengine/src/3rdparty/chromium/gpu/config/gpu_feature_info.h | 1 +
+ qtwebengine/src/3rdparty/chromium/gpu/config/gpu_preferences.h | 1 +
+ qtwebengine/src/3rdparty/chromium/net/cookies/cookie_inclusion_status.h | 1 +
+ .../third_party/abseil-cpp/absl/strings/internal/str_format/extension.h | 1 +
+ .../3rdparty/chromium/third_party/angle/include/GLSLANG/ShaderVars.h | 1 +
+ .../src/3rdparty/chromium/third_party/angle/src/common/angleutils.h | 1 +
+ .../breakpad/breakpad/src/client/linux/handler/minidump_descriptor.h | 1 +
+ .../chromium/third_party/perfetto/include/perfetto/ext/base/uuid.h | 1 +
+ qtwebengine/src/3rdparty/chromium/third_party/webrtc/call/rtp_demuxer.h | 1 +
+ .../chromium/third_party/webrtc/rtc_base/third_party/base64/base64.h | 1 +
+ qtwebengine/src/3rdparty/chromium/v8/src/base/logging.h | 1 +
+ qtwebengine/src/3rdparty/chromium/v8/src/base/macros.h | 1 +
+ .../src/3rdparty/chromium/v8/src/inspector/v8-string-conversions.h | 1 +
+ 19 files changed, 21 insertions(+)
+
+diff --git a/qtwebengine/src/3rdparty/chromium/base/debug/profiler.h b/qtwebengine/src/3rdparty/chromium/base/debug/profiler.h
+index 1229e06234c5..c7ed55e70f7a 100644
+--- a/qtwebengine/src/3rdparty/chromium/base/debug/profiler.h
++++ b/qtwebengine/src/3rdparty/chromium/base/debug/profiler.h
+@@ -5,6 +5,7 @@
+ #ifndef BASE_DEBUG_PROFILER_H_
+ #define BASE_DEBUG_PROFILER_H_
+
++#include <cstdint>
+ #include <stddef.h>
+
+ #include <string>
+diff --git a/qtwebengine/src/3rdparty/chromium/content/public/browser/browsing_data_remover_delegate.h b/qtwebengine/src/3rdparty/chromium/content/public/browser/browsing_data_remover_delegate.h
+index 3896bc6e786e..b93843dc16bf 100644
+--- a/qtwebengine/src/3rdparty/chromium/content/public/browser/browsing_data_remover_delegate.h
++++ b/qtwebengine/src/3rdparty/chromium/content/public/browser/browsing_data_remover_delegate.h
+@@ -5,6 +5,7 @@
+ #ifndef CONTENT_PUBLIC_BROWSER_BROWSING_DATA_REMOVER_DELEGATE_H_
+ #define CONTENT_PUBLIC_BROWSER_BROWSING_DATA_REMOVER_DELEGATE_H_
+
++#include <cstdint>
+ #include <string>
+ #include <vector>
+ #include "base/callback_forward.h"
+diff --git a/qtwebengine/src/3rdparty/chromium/device/base/synchronization/one_writer_seqlock.cc b/qtwebengine/src/3rdparty/chromium/device/base/synchronization/one_writer_seqlock.cc
+index 213b6301c052..98266a16c613 100644
+--- a/qtwebengine/src/3rdparty/chromium/device/base/synchronization/one_writer_seqlock.cc
++++ b/qtwebengine/src/3rdparty/chromium/device/base/synchronization/one_writer_seqlock.cc
+@@ -2,6 +2,8 @@
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+
++#include <cstdint>
++
+ #include "device/base/synchronization/one_writer_seqlock.h"
+
+ namespace device {
+diff --git a/qtwebengine/src/3rdparty/chromium/device/bluetooth/public/cpp/bluetooth_uuid.h b/qtwebengine/src/3rdparty/chromium/device/bluetooth/public/cpp/bluetooth_uuid.h
+index 0c27ae710596..b64f82f75484 100644
+--- a/qtwebengine/src/3rdparty/chromium/device/bluetooth/public/cpp/bluetooth_uuid.h
++++ b/qtwebengine/src/3rdparty/chromium/device/bluetooth/public/cpp/bluetooth_uuid.h
+@@ -5,6 +5,7 @@
+ #ifndef DEVICE_BLUETOOTH_PUBLIC_CPP_BLUETOOTH_UUID_H_
+ #define DEVICE_BLUETOOTH_PUBLIC_CPP_BLUETOOTH_UUID_H_
+
++#include <cstdint>
+ #include <string>
+ #include <vector>
+
+diff --git a/qtwebengine/src/3rdparty/chromium/gpu/command_buffer/common/webgpu_cmd_enums.h b/qtwebengine/src/3rdparty/chromium/gpu/command_buffer/common/webgpu_cmd_enums.h
+index 83615b30c8ab..8fa9fb1f6d57 100644
+--- a/qtwebengine/src/3rdparty/chromium/gpu/command_buffer/common/webgpu_cmd_enums.h
++++ b/qtwebengine/src/3rdparty/chromium/gpu/command_buffer/common/webgpu_cmd_enums.h
+@@ -5,6 +5,8 @@
+ #ifndef GPU_COMMAND_BUFFER_COMMON_WEBGPU_CMD_ENUMS_H_
+ #define GPU_COMMAND_BUFFER_COMMON_WEBGPU_CMD_ENUMS_H_
+
++#include <cstdint>
++
+ namespace gpu {
+ namespace webgpu {
+
+diff --git a/qtwebengine/src/3rdparty/chromium/gpu/config/device_perf_info.h b/qtwebengine/src/3rdparty/chromium/gpu/config/device_perf_info.h
+index e33874ba3bd0..824a207a2243 100644
+--- a/qtwebengine/src/3rdparty/chromium/gpu/config/device_perf_info.h
++++ b/qtwebengine/src/3rdparty/chromium/gpu/config/device_perf_info.h
+@@ -5,6 +5,7 @@
+ #ifndef GPU_CONFIG_DEVICE_PERF_INFO_H_
+ #define GPU_CONFIG_DEVICE_PERF_INFO_H_
+
++#include <cstdint>
+ #include <string>
+ #include <vector>
+
+diff --git a/qtwebengine/src/3rdparty/chromium/gpu/config/gpu_feature_info.h b/qtwebengine/src/3rdparty/chromium/gpu/config/gpu_feature_info.h
+index 027f1a5af3e0..70759b2ae47c 100644
+--- a/qtwebengine/src/3rdparty/chromium/gpu/config/gpu_feature_info.h
++++ b/qtwebengine/src/3rdparty/chromium/gpu/config/gpu_feature_info.h
+@@ -5,6 +5,7 @@
+ #ifndef GPU_CONFIG_GPU_FEATURE_INFO_H_
+ #define GPU_CONFIG_GPU_FEATURE_INFO_H_
+
++#include <cstdint>
+ #include <string>
+ #include <vector>
+
+diff --git a/qtwebengine/src/3rdparty/chromium/gpu/config/gpu_preferences.h b/qtwebengine/src/3rdparty/chromium/gpu/config/gpu_preferences.h
+index 6b8587151d61..e2bc6b90f2fd 100644
+--- a/qtwebengine/src/3rdparty/chromium/gpu/config/gpu_preferences.h
++++ b/qtwebengine/src/3rdparty/chromium/gpu/config/gpu_preferences.h
+@@ -5,6 +5,7 @@
+ #ifndef GPU_CONFIG_GPU_PREFERENCES_H_
+ #define GPU_CONFIG_GPU_PREFERENCES_H_
+
++#include <cstdint>
+ #include <stddef.h>
+ #include <string>
+ #include <vector>
+diff --git a/qtwebengine/src/3rdparty/chromium/net/cookies/cookie_inclusion_status.h b/qtwebengine/src/3rdparty/chromium/net/cookies/cookie_inclusion_status.h
+index 9e506b555012..cfb03bfe2b30 100644
+--- a/qtwebengine/src/3rdparty/chromium/net/cookies/cookie_inclusion_status.h
++++ b/qtwebengine/src/3rdparty/chromium/net/cookies/cookie_inclusion_status.h
+@@ -5,6 +5,7 @@
+ #ifndef NET_COOKIES_COOKIE_INCLUSION_STATUS_H_
+ #define NET_COOKIES_COOKIE_INCLUSION_STATUS_H_
+
++#include <cstdint>
+ #include <string>
+ #include <vector>
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h b/qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h
+index a9b9e137deb2..562327f1c401 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h
++++ b/qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h
+@@ -18,6 +18,7 @@
+
+ #include <limits.h>
+
++#include <cstdint>
+ #include <cstddef>
+ #include <cstring>
+ #include <ostream>
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/angle/include/GLSLANG/ShaderVars.h b/qtwebengine/src/3rdparty/chromium/third_party/angle/include/GLSLANG/ShaderVars.h
+index 9911546b90d0..0178796c46d8 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/angle/include/GLSLANG/ShaderVars.h
++++ b/qtwebengine/src/3rdparty/chromium/third_party/angle/include/GLSLANG/ShaderVars.h
+@@ -10,6 +10,7 @@
+ #ifndef GLSLANG_SHADERVARS_H_
+ #define GLSLANG_SHADERVARS_H_
+
++#include <cstdint>
+ #include <algorithm>
+ #include <array>
+ #include <string>
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/angle/src/common/angleutils.h b/qtwebengine/src/3rdparty/chromium/third_party/angle/src/common/angleutils.h
+index f669d7df3082..8f391fdd72cb 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/angle/src/common/angleutils.h
++++ b/qtwebengine/src/3rdparty/chromium/third_party/angle/src/common/angleutils.h
+@@ -15,6 +15,7 @@
+ # include "absl/container/flat_hash_map.h"
+ #endif // defined(ANGLE_USE_ABSEIL)
+
++#include <cstdint>
+ #include <climits>
+ #include <cstdarg>
+ #include <cstddef>
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/minidump_descriptor.h b/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/minidump_descriptor.h
+index c7e4f2b3787f..85e8c4b04b95 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/minidump_descriptor.h
++++ b/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/minidump_descriptor.h
+@@ -30,6 +30,7 @@
+ #ifndef CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_
+ #define CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_
+
++#include <cstdint>
+ #include <assert.h>
+ #include <sys/types.h>
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/uuid.h b/qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/uuid.h
+index 1b4c53815bc4..359d5ebdd24d 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/uuid.h
++++ b/qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/uuid.h
+@@ -17,6 +17,7 @@
+ #ifndef INCLUDE_PERFETTO_EXT_BASE_UUID_H_
+ #define INCLUDE_PERFETTO_EXT_BASE_UUID_H_
+
++#include <cstdint>
+ #include <array>
+ #include <string>
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/webrtc/call/rtp_demuxer.h b/qtwebengine/src/3rdparty/chromium/third_party/webrtc/call/rtp_demuxer.h
+index 3aa7e9df2681..3cfc8d6a3e9d 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/webrtc/call/rtp_demuxer.h
++++ b/qtwebengine/src/3rdparty/chromium/third_party/webrtc/call/rtp_demuxer.h
+@@ -11,6 +11,7 @@
+ #ifndef CALL_RTP_DEMUXER_H_
+ #define CALL_RTP_DEMUXER_H_
+
++#include <cstdint>
+ #include <map>
+ #include <set>
+ #include <string>
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/third_party/base64/base64.h b/qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/third_party/base64/base64.h
+index 7a936f23e782..21951a1d2401 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/third_party/base64/base64.h
++++ b/qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/third_party/base64/base64.h
+@@ -12,6 +12,7 @@
+ #ifndef RTC_BASE_THIRD_PARTY_BASE64_BASE64_H_
+ #define RTC_BASE_THIRD_PARTY_BASE64_BASE64_H_
+
++#include <cstdint>
+ #include <string>
+ #include <vector>
+
+diff --git a/qtwebengine/src/3rdparty/chromium/v8/src/base/logging.h b/qtwebengine/src/3rdparty/chromium/v8/src/base/logging.h
+index fe39f988225e..dbe130581cb1 100644
+--- a/qtwebengine/src/3rdparty/chromium/v8/src/base/logging.h
++++ b/qtwebengine/src/3rdparty/chromium/v8/src/base/logging.h
+@@ -5,6 +5,7 @@
+ #ifndef V8_BASE_LOGGING_H_
+ #define V8_BASE_LOGGING_H_
+
++#include <cstdint>
+ #include <cstring>
+ #include <sstream>
+ #include <string>
+diff --git a/qtwebengine/src/3rdparty/chromium/v8/src/base/macros.h b/qtwebengine/src/3rdparty/chromium/v8/src/base/macros.h
+index 37cab78f08fc..4220eacbbbfc 100644
+--- a/qtwebengine/src/3rdparty/chromium/v8/src/base/macros.h
++++ b/qtwebengine/src/3rdparty/chromium/v8/src/base/macros.h
+@@ -5,6 +5,7 @@
+ #ifndef V8_BASE_MACROS_H_
+ #define V8_BASE_MACROS_H_
+
++#include <cstdint>
+ #include <limits>
+ #include <type_traits>
+
+diff --git a/qtwebengine/src/3rdparty/chromium/v8/src/inspector/v8-string-conversions.h b/qtwebengine/src/3rdparty/chromium/v8/src/inspector/v8-string-conversions.h
+index c1d69c18f0a8..eb33c6816a58 100644
+--- a/qtwebengine/src/3rdparty/chromium/v8/src/inspector/v8-string-conversions.h
++++ b/qtwebengine/src/3rdparty/chromium/v8/src/inspector/v8-string-conversions.h
+@@ -5,6 +5,7 @@
+ #ifndef V8_INSPECTOR_V8_STRING_CONVERSIONS_H_
+ #define V8_INSPECTOR_V8_STRING_CONVERSIONS_H_
+
++#include <cstdint>
+ #include <string>
+
+ // Conversion routines between UT8 and UTF16, used by string-16.{h,cc}. You may
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0103-Rename-x11-Present-Pixmap-to-x11-Present-PresentPixm.patch b/patches/qt-everywhere-opensource-src-5.15.12/0103-Rename-x11-Present-Pixmap-to-x11-Present-PresentPixm.patch
new file mode 100644
index 000000000..bb1020324
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0103-Rename-x11-Present-Pixmap-to-x11-Present-PresentPixm.patch
@@ -0,0 +1,31 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sun, 3 Mar 2024 22:45:12 +0100
+Subject: [PATCH] Rename x11::Present::Pixmap to x11::Present::PresentPixmap to
+ work around a name conflict
+
+Taken from Chromium upstream commit
+d930397e823acc642ab532f490fe17a7a0099554 ("[XProto] Add simplified
+request syntax").
+
+Without this, building may fail with:
+
+gen/ui/gfx/x/present.h:223:16: error: declaration of 'x11::Future<void> x11::Present::Pixmap(const PixmapRequest&)' changes meaning of 'Pixmap' [-Wchanges-meaning] gen/ui/gfx/x/present.h:205:5: note: used here to mean 'enum class x11::Pixmap'
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ .../src/3rdparty/chromium/third_party/xcbproto/src/src/present.xml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/xcbproto/src/src/present.xml b/qtwebengine/src/3rdparty/chromium/third_party/xcbproto/src/src/present.xml
+index fb06e73f02fc..f20c11eb2c02 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/xcbproto/src/src/present.xml
++++ b/qtwebengine/src/3rdparty/chromium/third_party/xcbproto/src/src/present.xml
+@@ -89,7 +89,7 @@ OF THIS SOFTWARE.
+ </reply>
+ </request>
+
+- <request name="Pixmap" opcode="1">
++ <request name="PresentPixmap" opcode="1">
+ <required_start_align align="8" />
+ <field type="WINDOW" name="window" />
+ <field type="PIXMAP" name="pixmap" />
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0200-replace-Python-2-with-Python-3-in-the-build-system.patch b/patches/qt-everywhere-opensource-src-5.15.12/0200-replace-Python-2-with-Python-3-in-the-build-system.patch
new file mode 100644
index 000000000..fd4c799ea
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0200-replace-Python-2-with-Python-3-in-the-build-system.patch
@@ -0,0 +1,176 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 17 Nov 2023 15:11:30 +0100
+Subject: [PATCH] replace Python 2 with Python 3 in the build system
+
+Imported from Debian.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ qtwebengine/configure.pri | 29 ++++-----------------------
+ qtwebengine/mkspecs/features/functions.prf | 6 +++---
+ qtwebengine/src/buildtools/config/support.pri | 10 ++++-----
+ qtwebengine/src/buildtools/configure.json | 18 ++++++++---------
+ 4 files changed, 21 insertions(+), 42 deletions(-)
+
+diff --git a/qtwebengine/configure.pri b/qtwebengine/configure.pri
+index e072961f0574..b5d6902a91d5 100644
+--- a/qtwebengine/configure.pri
++++ b/qtwebengine/configure.pri
+@@ -6,23 +6,6 @@ QTWEBENGINE_SOURCE_TREE = $$PWD
+
+ equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe
+
+-defineTest(isPythonVersionSupported) {
+- python = $$system_quote($$system_path($$1))
+- python_version = $$system('$$python -c "import sys; print(sys.version_info[0:3])"')
+- python_version ~= s/[()]//g
+- python_version = $$split(python_version, ',')
+- python_major_version = $$first(python_version)
+- greaterThan(python_major_version, 2) {
+- qtLog("Python version 3 is not supported by Chromium.")
+- return(false)
+- }
+- python_minor_version = $$member(python_version, 1)
+- python_patch_version = $$member(python_version, 2)
+- greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true)
+- qtLog("Unsupported python version: $${python_major_version}.$${python_minor_version}.$${python_patch_version}.")
+- return(false)
+-}
+-
+ defineTest(qtConfTest_detectJumboBuild) {
+ mergeLimit = $$eval(config.input.merge_limit)
+ mergeLimit = $$find(mergeLimit, "\\d")
+@@ -52,22 +35,18 @@ defineTest(qtConfReport_jumboBuild) {
+ qtConfReportPadded($${1}, $$mergeLimit)
+ }
+
+-defineTest(qtConfTest_detectPython2) {
+- python = $$qtConfFindInPath("python2$$EXE_SUFFIX")
++defineTest(qtConfTest_detectPython3) {
++ python = $$qtConfFindInPath("python3$$EXE_SUFFIX")
+ isEmpty(python) {
+- qtLog("'python2$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.")
++ qtLog("'python3$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.")
+ python = $$qtConfFindInPath("python$$EXE_SUFFIX")
+ }
+ isEmpty(python) {
+ qtLog("'python$$EXE_SUFFIX' not found in PATH. Giving up.")
+ return(false)
+ }
+- !isPythonVersionSupported($$python) {
+- qtLog("A suitable Python 2 executable could not be located.")
+- return(false)
+- }
+
+- # Make tests.python2.location available in configure.json.
++ # Make tests.python3.location available in configure.json.
+ $${1}.location = $$clean_path($$python)
+ export($${1}.location)
+ $${1}.cache += location
+diff --git a/qtwebengine/mkspecs/features/functions.prf b/qtwebengine/mkspecs/features/functions.prf
+index 7f630588a10c..951f4d277d16 100644
+--- a/qtwebengine/mkspecs/features/functions.prf
++++ b/qtwebengine/mkspecs/features/functions.prf
+@@ -44,11 +44,11 @@ defineReplace(which) {
+
+ # Returns the unquoted path to the python executable.
+ defineReplace(pythonPath) {
+- isEmpty(QMAKE_PYTHON2) {
++ isEmpty(QMAKE_PYTHON3) {
+ # Fallback for building QtWebEngine with Qt < 5.8
+- QMAKE_PYTHON2 = python
++ QMAKE_PYTHON3 = python
+ }
+- return($$QMAKE_PYTHON2)
++ return($$QMAKE_PYTHON3)
+ }
+
+ # Returns the python executable for use with shell / make targets.
+diff --git a/qtwebengine/src/buildtools/config/support.pri b/qtwebengine/src/buildtools/config/support.pri
+index e7f869a15f9f..3a5743c9d164 100644
+--- a/qtwebengine/src/buildtools/config/support.pri
++++ b/qtwebengine/src/buildtools/config/support.pri
+@@ -21,7 +21,7 @@ defineReplace(qtwebengine_checkWebEngineCoreError) {
+ !qtwebengine_checkForGperf(QtWebEngine):return(false)
+ !qtwebengine_checkForBison(QtWebEngine):return(false)
+ !qtwebengine_checkForFlex(QtWebEngine):return(false)
+- !qtwebengine_checkForPython2(QtWebEngine):return(false)
++ !qtwebengine_checkForPython3(QtWebEngine):return(false)
+ !qtwebengine_checkForNodejs(QtWebEngine):return(false)
+ !qtwebengine_checkForSanitizer(QtWebEngine):return(false)
+ linux:!qtwebengine_checkForPkgCfg(QtWebEngine):return(false)
+@@ -51,7 +51,7 @@ defineReplace(qtwebengine_checkPdfError) {
+ !qtwebengine_checkForGperf(QtPdf):return(false)
+ !qtwebengine_checkForBison(QtPdf):return(false)
+ !qtwebengine_checkForFlex(QtPdf):return(false)
+- !qtwebengine_checkForPython2(QtPdf):return(false)
++ !qtwebengine_checkForPython3(QtPdf):return(false)
+ !qtwebengine_checkForSanitizer(QtPdf):return(false)
+ linux:!qtwebengine_checkForPkgCfg(QtPdf):return(false)
+ linux:!qtwebengine_checkForHostPkgCfg(QtPdf):return(false)
+@@ -143,10 +143,10 @@ defineTest(qtwebengine_checkForFlex) {
+ return(true)
+ }
+
+-defineTest(qtwebengine_checkForPython2) {
++defineTest(qtwebengine_checkForPython3) {
+ module = $$1
+- !qtConfig(webengine-python2) {
+- qtwebengine_skipBuild("Python version 2 (2.7.5 or later) is required to build $${module}.")
++ !qtConfig(webengine-python3) {
++ qtwebengine_skipBuild("Python version 3 is required to build $${module}.")
+ return(false)
+ }
+ return(true)
+diff --git a/qtwebengine/src/buildtools/configure.json b/qtwebengine/src/buildtools/configure.json
+index 88d1790c17c4..c9cf1b4b0aaf 100644
+--- a/qtwebengine/src/buildtools/configure.json
++++ b/qtwebengine/src/buildtools/configure.json
+@@ -295,9 +295,9 @@
+ "label": "system ninja",
+ "type": "detectNinja"
+ },
+- "webengine-python2": {
+- "label": "python2",
+- "type": "detectPython2",
++ "webengine-python3": {
++ "label": "python3",
++ "type": "detectPython3",
+ "log": "location"
+ },
+ "webengine-winversion": {
+@@ -374,7 +374,7 @@
+ && features.webengine-gperf
+ && features.webengine-bison
+ && features.webengine-flex
+- && features.webengine-python2
++ && features.webengine-python3
+ && features.webengine-nodejs
+ && (!config.sanitizer || features.webengine-sanitizer)
+ && (!config.linux || features.pkg-config)
+@@ -400,7 +400,7 @@
+ && features.webengine-gperf
+ && features.webengine-bison
+ && features.webengine-flex
+- && features.webengine-python2
++ && features.webengine-python3
+ && (!config.sanitizer || features.webengine-sanitizer)
+ && (!config.linux || features.pkg-config)
+ && (!config.linux || features.webengine-host-pkg-config)
+@@ -423,12 +423,12 @@
+ "autoDetect": "features.private_tests",
+ "output": [ "privateFeature" ]
+ },
+- "webengine-python2": {
+- "label": "python2",
+- "condition": "tests.webengine-python2",
++ "webengine-python3": {
++ "label": "python3",
++ "condition": "tests.webengine-python3",
+ "output": [
+ "privateFeature",
+- { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python2.location" }
++ { "type": "varAssign", "name": "QMAKE_PYTHON3", "value": "tests.webengine-python3.location" }
+ ]
+ },
+ "webengine-gperf": {
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0201-update-Chromium-code-for-compatibility-with-Python-3.patch b/patches/qt-everywhere-opensource-src-5.15.12/0201-update-Chromium-code-for-compatibility-with-Python-3.patch
new file mode 100644
index 000000000..977d336d9
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0201-update-Chromium-code-for-compatibility-with-Python-3.patch
@@ -0,0 +1,1874 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 17 Nov 2023 15:12:45 +0100
+Subject: [PATCH] update Chromium code for compatibility with Python 3
+
+Imported from Debian. Originally from:
+https://github.com/archlinux/svntogit-packages/blob/packages/qt5-webengine/trunk/qt5-webengine-chromium-python3.patch
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ .../3rdparty/chromium/build/print_python_deps.py | 4 +-
+ .../resources/protobufs/binary_proto_generator.py | 8 +--
+ .../browser/tracing/generate_trace_viewer_grd.py | 2 +-
+ .../chromium/mojo/public/tools/bindings/BUILD.gn | 2 +
+ .../public/tools/bindings/gen_data_files_list.py | 8 +--
+ .../bindings/generators/mojom_java_generator.py | 4 ++
+ .../public/tools/mojom/mojom/generate/generator.py | 14 ++--
+ .../public/tools/mojom/mojom/generate/module.py | 3 +-
+ .../mojom/mojom/generate/template_expander.py | 12 ++--
+ .../bindings/scripts/bind_gen/blink_v8_bridge.py | 6 +-
+ .../scripts/bind_gen/callback_interface.py | 2 +-
+ .../bindings/scripts/bind_gen/code_node.py | 10 +--
+ .../bindings/scripts/bind_gen/codegen_expr.py | 15 ++--
+ .../bindings/scripts/bind_gen/codegen_format.py | 2 +-
+ .../bindings/scripts/bind_gen/codegen_utils.py | 2 +-
+ .../bindings/scripts/bind_gen/dictionary.py | 2 +-
+ .../bindings/scripts/bind_gen/interface.py | 82 ++++++++++++----------
+ .../bindings/scripts/bind_gen/mako_renderer.py | 2 +-
+ .../bindings/scripts/bind_gen/style_format.py | 9 ++-
+ .../bindings/scripts/bind_gen/task_queue.py | 5 +-
+ .../renderer/bindings/scripts/code_generator.py | 10 +++
+ .../scripts/generate_origin_trial_features.py | 4 +-
+ .../renderer/bindings/scripts/idl_definitions.py | 8 ++-
+ .../blink/renderer/bindings/scripts/idl_reader.py | 4 +-
+ .../blink/renderer/bindings/scripts/idl_types.py | 2 +-
+ .../blink/renderer/bindings/scripts/utilities.py | 28 ++++----
+ .../renderer/bindings/scripts/v8_interface.py | 9 +--
+ .../blink/renderer/bindings/scripts/v8_methods.py | 4 ++
+ .../renderer/bindings/scripts/v8_utilities.py | 2 +-
+ .../bindings/scripts/web_idl/callback_interface.py | 12 ++--
+ .../renderer/bindings/scripts/web_idl/database.py | 2 +-
+ .../renderer/bindings/scripts/web_idl/exposure.py | 5 +-
+ .../bindings/scripts/web_idl/function_like.py | 28 ++++----
+ .../bindings/scripts/web_idl/idl_compiler.py | 21 +++---
+ .../renderer/bindings/scripts/web_idl/interface.py | 45 +++++++-----
+ .../bindings/scripts/web_idl/ir_builder.py | 29 +++++---
+ .../renderer/bindings/scripts/web_idl/make_copy.py | 7 ++
+ .../renderer/bindings/scripts/web_idl/namespace.py | 12 ++--
+ .../bindings/templates/dictionary_v8.cc.tmpl | 8 +--
+ .../scripts/core/css/make_style_shorthands.py | 23 +++---
+ .../css/properties/make_css_property_instances.py | 4 +-
+ .../blink/renderer/build/scripts/gperf.py | 2 +-
+ .../blink/renderer/build/scripts/in_file.py | 2 +-
+ .../blink/renderer/build/scripts/in_generator.py | 5 ++
+ .../build/scripts/make_runtime_features.py | 2 +-
+ .../scripts/templates/element_factory.cc.tmpl | 4 +-
+ .../scripts/templates/element_type_helpers.cc.tmpl | 4 +-
+ .../scripts/templates/element_type_helpers.h.tmpl | 2 +-
+ .../renderer/build/scripts/templates/macros.tmpl | 4 +-
+ .../scripts/templates/make_qualified_names.h.tmpl | 4 +-
+ .../third_party/dawn/generator/generator_lib.py | 4 ++
+ .../third_party/devtools-frontend/src/BUILD.gn | 2 +
+ .../src/scripts/build/build_inspector_overlay.py | 3 +-
+ .../scripts/build/build_release_applications.py | 9 +--
+ .../src/scripts/build/generate_devtools_grd.py | 4 +-
+ .../src/scripts/build/modular_build.py | 6 +-
+ .../3rdparty/chromium/third_party/jinja2/tests.py | 2 +-
+ .../chromium/tools/metrics/ukm/gen_builders.py | 5 +-
+ .../chromium/ui/ozone/generate_constructor_list.py | 13 ++--
+ .../ui/ozone/generate_ozone_platform_list.py | 26 ++++---
+ 60 files changed, 333 insertions(+), 231 deletions(-)
+
+diff --git a/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py b/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py
+index fd29c0972c9a..2a0118563e50 100755
+--- a/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py
++++ b/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.7
++#!/usr/bin/python3
+ # Copyright 2016 The Chromium Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+@@ -152,7 +152,7 @@ def main():
+
+ # Trybots run with vpython as default Python, but with a different config
+ # from //.vpython. To make the is_vpython test work, and to match the behavior
+- # of dev machines, the shebang line must be run with python2.7.
++ # of dev machines, the shebang line must be run with python3.
+ #
+ # E.g. $HOME/.vpython-root/dd50d3/bin/python
+ # E.g. /b/s/w/ir/cache/vpython/ab5c79/bin/python
+diff --git a/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py b/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
+index 7422ead96971..16365515f26b 100755
+--- a/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
++++ b/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
+@@ -7,7 +7,7 @@
+ Converts a given ASCII proto into a binary resource.
+
+ """
+-
++from __future__ import print_function
+ import abc
+ import imp
+ import optparse
+@@ -196,12 +196,12 @@ class BinaryProtoGenerator:
+ self._ImportProtoModules(opts.path)
+
+ if not self.VerifyArgs(opts):
+- print "Wrong arguments"
++ print("Wrong arguments")
+ return 1
+
+ try:
+ self._GenerateBinaryProtos(opts)
+ except Exception as e:
+- print "ERROR: Failed to render binary version of %s:\n %s\n%s" % (
+- opts.infile, str(e), traceback.format_exc())
++ print("ERROR: Failed to render binary version of %s:\n %s\n%s" %
++ (opts.infile, str(e), traceback.format_exc()))
+ return 1
+diff --git a/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py b/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py
+index 037f9497dc26..be393d21f901 100755
+--- a/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py
++++ b/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py
+@@ -74,7 +74,7 @@ def main(argv):
+ for filename in parsed_args.source_files:
+ add_file_to_grd(doc, os.path.basename(filename))
+
+- with open(parsed_args.output_filename, 'w') as output_file:
++ with open(parsed_args.output_filename, 'wb') as output_file:
+ output_file.write(doc.toxml(encoding='UTF-8'))
+
+
+diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn
+index fc04b5dd0b1f..708958e438ba 100644
+--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn
+@@ -2,9 +2,11 @@
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+
++import("//build/config/python.gni")
+ import("//mojo/public/tools/bindings/mojom.gni")
+ import("//third_party/jinja2/jinja2.gni")
+
++# TODO(crbug.com/1194274): Investigate nondeterminism in Py3 builds.
+ action("precompile_templates") {
+ sources = mojom_generator_sources
+ sources += [
+diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py
+index 79c9e50efcee..8b78d0924185 100644
+--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py
++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py
+@@ -18,7 +18,6 @@ import os
+ import re
+ import sys
+
+-from cStringIO import StringIO
+ from optparse import OptionParser
+
+ sys.path.insert(
+@@ -41,12 +40,9 @@ def main():
+ pattern = re.compile(options.pattern)
+ files = [f for f in os.listdir(options.directory) if pattern.match(f)]
+
+- stream = StringIO()
+- for f in files:
+- print(f, file=stream)
++ contents = '\n'.join(f for f in files) + '\n'
++ WriteFile(contents, options.output)
+
+- WriteFile(stream.getvalue(), options.output)
+- stream.close()
+
+ if __name__ == '__main__':
+ sys.exit(main())
+diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py
+index 96b2fdfae0c5..00b9dccd00c3 100644
+--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py
++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py
+@@ -25,6 +25,10 @@ sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir,
+ 'build', 'android', 'gyp'))
+ from util import build_utils
+
++# TODO(crbug.com/1174969): Remove this once Python2 is obsoleted.
++if sys.version_info.major != 2:
++ basestring = str
++ long = int
+
+ GENERATOR_PREFIX = 'java'
+
+diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py
+index de62260a5c9d..4a1c73fcf82f 100644
+--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py
++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py
+@@ -136,9 +136,14 @@ class Stylizer(object):
+
+ def WriteFile(contents, full_path):
+ # If |contents| is same with the file content, we skip updating.
++ if not isinstance(contents, bytes):
++ data = contents.encode('utf8')
++ else:
++ data = contents
++
+ if os.path.isfile(full_path):
+ with open(full_path, 'rb') as destination_file:
+- if destination_file.read() == contents:
++ if destination_file.read() == data:
+ return
+
+ # Make sure the containing directory exists.
+@@ -146,11 +151,8 @@ def WriteFile(contents, full_path):
+ fileutil.EnsureDirectoryExists(full_dir)
+
+ # Dump the data to disk.
+- with open(full_path, "wb") as f:
+- if not isinstance(contents, bytes):
+- f.write(contents.encode('utf-8'))
+- else:
+- f.write(contents)
++ with open(full_path, 'wb') as f:
++ f.write(data)
+
+
+ def AddComputedData(module):
+diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py
+index ebbc9b322eae..3d026429bbc1 100644
+--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py
++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py
+@@ -398,7 +398,8 @@ class Field(object):
+
+
+ class StructField(Field):
+- pass
++ def __hash__(self):
++ return super(Field, self).__hash__()
+
+
+ class UnionField(Field):
+diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py
+index 7a3005602465..8d9e26fb7f61 100644
+--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py
++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py
+@@ -75,9 +75,9 @@ def PrecompileTemplates(generator_modules, output_dir):
+ os.path.dirname(module.__file__), generator.GetTemplatePrefix())
+ ]))
+ jinja_env.filters.update(generator.GetFilters())
+- jinja_env.compile_templates(
+- os.path.join(output_dir, "%s.zip" % generator.GetTemplatePrefix()),
+- extensions=["tmpl"],
+- zip="stored",
+- py_compile=True,
+- ignore_errors=False)
++ jinja_env.compile_templates(os.path.join(
++ output_dir, "%s.zip" % generator.GetTemplatePrefix()),
++ extensions=["tmpl"],
++ zip="stored",
++ py_compile=sys.version_info.major < 3,
++ ignore_errors=False)
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py
+index 3225ecca6e40..fc078d31b552 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py
+@@ -344,7 +344,7 @@ def make_default_value_expr(idl_type, default_value):
+ """
+ assert default_value.is_type_compatible_with(idl_type)
+
+- class DefaultValueExpr:
++ class DefaultValueExpr(object):
+ _ALLOWED_SYMBOLS_IN_DEPS = ("isolate")
+
+ def __init__(self, initializer_expr, initializer_deps,
+@@ -502,7 +502,7 @@ def make_v8_to_blink_value(blink_var_name,
+ assert isinstance(blink_var_name, str)
+ assert isinstance(v8_value_expr, str)
+ assert isinstance(idl_type, web_idl.IdlType)
+- assert (argument_index is None or isinstance(argument_index, (int, long)))
++ assert (argument_index is None or isinstance(argument_index, int))
+ assert (default_value is None
+ or isinstance(default_value, web_idl.LiteralConstant))
+
+@@ -622,7 +622,7 @@ def make_v8_to_blink_value_variadic(blink_var_name, v8_array,
+ """
+ assert isinstance(blink_var_name, str)
+ assert isinstance(v8_array, str)
+- assert isinstance(v8_array_start_index, (int, long))
++ assert isinstance(v8_array_start_index, int)
+ assert isinstance(idl_type, web_idl.IdlType)
+
+ pattern = ("auto&& ${{{_1}}} = "
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py
+index 4a6df5130687..8b51f23a4093 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py
+@@ -177,7 +177,7 @@ def generate_callback_interface(callback_interface_identifier):
+ prop_install_mode=PropInstallMode.UNCONDITIONAL,
+ trampoline_var_name=None,
+ attribute_entries=[],
+- constant_entries=filter(is_unconditional, constant_entries),
++ constant_entries=list(filter(is_unconditional, constant_entries)),
+ exposed_construct_entries=[],
+ operation_entries=[])
+ (install_interface_template_decl, install_interface_template_def,
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py
+index 52972fefe206..e5ae9d9629e2 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py
+@@ -503,13 +503,13 @@ class CompositeNode(CodeNode):
+ gensym_kwargs = {}
+ template_vars = {}
+ for arg in args:
+- assert isinstance(arg, (CodeNode, int, long, str))
++ assert isinstance(arg, (CodeNode, int, str))
+ gensym = CodeNode.gensym()
+ gensym_args.append("${{{}}}".format(gensym))
+ template_vars[gensym] = arg
+ for key, value in kwargs.items():
+- assert isinstance(key, (int, long, str))
+- assert isinstance(value, (CodeNode, int, long, str))
++ assert isinstance(key, (int, str))
++ assert isinstance(value, (CodeNode, int, str))
+ gensym = CodeNode.gensym()
+ gensym_kwargs[key] = "${{{}}}".format(gensym)
+ template_vars[gensym] = value
+@@ -602,7 +602,7 @@ class ListNode(CodeNode):
+ def insert(self, index, node):
+ if node is None:
+ return
+- assert isinstance(index, (int, long))
++ assert isinstance(index, int)
+ assert isinstance(node, CodeNode)
+ assert node.outer is None and node.prev is None
+
+@@ -721,7 +721,7 @@ class SymbolScopeNode(SequenceNode):
+ if not scope_chains:
+ return counts
+
+- self_index = iter(scope_chains).next().index(self)
++ self_index = next(iter(scope_chains)).index(self)
+ scope_chains = map(
+ lambda scope_chain: scope_chain[self_index + 1:], scope_chains)
+ scope_to_likeliness = {}
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py
+index a229a6c71c91..5fa288dabf2a 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py
+@@ -109,7 +109,7 @@ def expr_and(terms):
+
+ if any(term.is_always_false for term in terms):
+ return _Expr(False)
+- terms = filter(lambda x: not x.is_always_true, terms)
++ terms = list(filter(lambda x: not x.is_always_true, terms))
+ if not terms:
+ return _Expr(True)
+ if len(terms) == 1:
+@@ -124,7 +124,7 @@ def expr_or(terms):
+
+ if any(term.is_always_true for term in terms):
+ return _Expr(True)
+- terms = filter(lambda x: not x.is_always_false, terms)
++ terms = list(filter(lambda x: not x.is_always_false, terms))
+ if not terms:
+ return _Expr(False)
+ if len(terms) == 1:
+@@ -222,7 +222,7 @@ def expr_from_exposure(exposure,
+ elif exposure.only_in_secure_contexts is False:
+ secure_context_term = _Expr(True)
+ else:
+- terms = map(ref_enabled, exposure.only_in_secure_contexts)
++ terms = list(map(ref_enabled, exposure.only_in_secure_contexts))
+ secure_context_term = expr_or(
+ [_Expr("${is_in_secure_context}"),
+ expr_not(expr_and(terms))])
+@@ -275,10 +275,11 @@ def expr_from_exposure(exposure,
+
+ # [ContextEnabled]
+ if exposure.context_enabled_features:
+- terms = map(
+- lambda feature: _Expr(
+- "${{context_feature_settings}}->is{}Enabled()".format(
+- feature)), exposure.context_enabled_features)
++ terms = list(
++ map(
++ lambda feature: _Expr(
++ "${{context_feature_settings}}->is{}Enabled()".format(
++ feature)), exposure.context_enabled_features))
+ context_enabled_terms.append(
+ expr_and([_Expr("${context_feature_settings}"),
+ expr_or(terms)]))
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py
+index 87d26eec3ca9..f3e9d38247e0 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py
+@@ -23,7 +23,7 @@ class _TemplateFormatter(string.Formatter):
+ self._template_formatter_indexing_count_ = 0
+
+ def get_value(self, key, args, kwargs):
+- if isinstance(key, (int, long)):
++ if isinstance(key, int):
+ return args[key]
+ assert isinstance(key, str)
+ if not key:
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py
+index 2bcc4fed49a7..e72282aa6963 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py
+@@ -116,4 +116,4 @@ def write_code_node_to_file(code_node, filepath):
+ # stderr=format_result.error_message))
+ #
+ # web_idl.file_io.write_to_file_if_changed(filepath, format_result.contents)
+- web_idl.file_io.write_to_file_if_changed(filepath, rendered_text)
++ web_idl.file_io.write_to_file_if_changed(filepath, rendered_text.encode('utf-8'))
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py
+index b39f01004100..4d68202296b5 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py
+@@ -993,7 +993,7 @@ def make_dict_trace_func(cg_context):
+ _2 = _blink_member_name(member).value_var
+ return TextNode(_format(pattern, _1=_1, _2=_2))
+
+- body.extend(map(make_trace_member_node, own_members))
++ body.extend(list(map(make_trace_member_node, own_members)))
+ body.append(TextNode("BaseClass::Trace(visitor);"))
+
+ return func_decl, func_def
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py
+index 10ff30656ad6..bfdf7128aace 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py
+@@ -582,7 +582,7 @@ def _make_blink_api_call(code_node,
+ overriding_args=None):
+ assert isinstance(code_node, SymbolScopeNode)
+ assert isinstance(cg_context, CodeGenContext)
+- assert num_of_args is None or isinstance(num_of_args, (int, long))
++ assert num_of_args is None or isinstance(num_of_args, int)
+ assert (overriding_args is None
+ or (isinstance(overriding_args, (list, tuple))
+ and all(isinstance(arg, str) for arg in overriding_args)))
+@@ -1196,8 +1196,10 @@ def make_overload_dispatcher(cg_context):
+ did_use_break = did_use_break or can_fail
+
+ conditional = expr_or(
+- map(lambda item: expr_from_exposure(item.function_like.exposure),
+- items))
++ list(
++ map(
++ lambda item: expr_from_exposure(item.function_like.exposure
++ ), items)))
+ if not conditional.is_always_true:
+ node = CxxUnlikelyIfNode(cond=conditional, body=node)
+
+@@ -4642,7 +4644,7 @@ class _PropEntryConstructorGroup(_PropEntryBase):
+ def __init__(self, is_context_dependent, exposure_conditional, world,
+ constructor_group, ctor_callback_name, ctor_func_length):
+ assert isinstance(ctor_callback_name, str)
+- assert isinstance(ctor_func_length, (int, long))
++ assert isinstance(ctor_func_length, int)
+
+ _PropEntryBase.__init__(self, is_context_dependent,
+ exposure_conditional, world, constructor_group)
+@@ -4670,7 +4672,7 @@ class _PropEntryOperationGroup(_PropEntryBase):
+ op_func_length,
+ no_alloc_direct_callback_name=None):
+ assert isinstance(op_callback_name, str)
+- assert isinstance(op_func_length, (int, long))
++ assert isinstance(op_func_length, int)
+
+ _PropEntryBase.__init__(self, is_context_dependent,
+ exposure_conditional, world, operation_group)
+@@ -5175,9 +5177,9 @@ def make_install_interface_template(cg_context, function_name, class_name, api_c
+ ])
+
+ if class_like.identifier == "CSSStyleDeclaration":
+- css_properties = filter(
+- lambda attr: "CSSProperty" in attr.extended_attributes,
+- class_like.attributes)
++ css_properties = list(
++ filter(lambda attr: "CSSProperty" in attr.extended_attributes,
++ class_like.attributes))
+ if css_properties:
+ prop_name_list = "".join(
+ map(lambda attr: "\"{}\", ".format(attr.identifier),
+@@ -5567,8 +5569,8 @@ ${instance_object} = ${v8_context}->Global()->GetPrototype().As<v8::Object>();\
+ "V8DOMConfiguration::InstallConstants(${isolate}, "
+ "${interface_template}, ${prototype_template}, "
+ "kConstantCallbackTable, base::size(kConstantCallbackTable));")
+- constant_callback_entries = filter(lambda entry: entry.const_callback_name,
+- constant_entries)
++ constant_callback_entries = list(filter(lambda entry: entry.const_callback_name,
++ constant_entries))
+ install_properties(table_name, constant_callback_entries,
+ _make_constant_callback_registration_table,
+ installer_call_text)
+@@ -5584,8 +5586,8 @@ ${instance_object} = ${v8_context}->Global()->GetPrototype().As<v8::Object>();\
+ "V8DOMConfiguration::InstallConstants(${isolate}, "
+ "${interface_template}, ${prototype_template}, "
+ "kConstantValueTable, base::size(kConstantValueTable));")
+- constant_value_entries = filter(
+- lambda entry: not entry.const_callback_name, constant_entries)
++ constant_value_entries = list(filter(
++ lambda entry: not entry.const_callback_name, constant_entries))
+ install_properties(table_name, constant_value_entries,
+ _make_constant_value_registration_table,
+ installer_call_text)
+@@ -6336,8 +6338,8 @@ def make_v8_context_snapshot_api(cg_context, component, attribute_entries,
+ assert isinstance(component, web_idl.Component)
+
+ derived_interfaces = cg_context.interface.deriveds
+- derived_names = map(lambda interface: interface.identifier,
+- derived_interfaces)
++ derived_names = list(
++ map(lambda interface: interface.identifier, derived_interfaces))
+ derived_names.append(cg_context.interface.identifier)
+ if not ("Window" in derived_names or "HTMLDocument" in derived_names):
+ return None, None
+@@ -6411,9 +6413,11 @@ def _make_v8_context_snapshot_get_reference_table_function(
+ collect_callbacks(named_properties_object_callback_defs)
+ collect_callbacks(cross_origin_property_callback_defs)
+
+- entry_nodes = map(
+- lambda name: TextNode("reinterpret_cast<intptr_t>({}),".format(name)),
+- filter(None, callback_names))
++ entry_nodes = list(
++ map(
++ lambda name: TextNode("reinterpret_cast<intptr_t>({}),".format(name
++ )),
++ filter(None, callback_names)))
+ table_node = ListNode([
+ TextNode("using namespace ${class_name}Callbacks;"),
+ TextNode("static const intptr_t kReferenceTable[] = {"),
+@@ -6451,10 +6455,11 @@ def _make_v8_context_snapshot_install_props_per_context_function(
+ class_name=None,
+ prop_install_mode=PropInstallMode.V8_CONTEXT_SNAPSHOT,
+ trampoline_var_name=None,
+- attribute_entries=filter(selector, attribute_entries),
+- constant_entries=filter(selector, constant_entries),
+- exposed_construct_entries=filter(selector, exposed_construct_entries),
+- operation_entries=filter(selector, operation_entries))
++ attribute_entries=list(filter(selector, attribute_entries)),
++ constant_entries=list(filter(selector, constant_entries)),
++ exposed_construct_entries=list(
++ filter(selector, exposed_construct_entries)),
++ operation_entries=list(filter(selector, operation_entries)))
+
+ return func_decl, func_def
+
+@@ -6810,11 +6815,11 @@ def generate_interface(interface_identifier):
+ class_name=impl_class_name,
+ prop_install_mode=PropInstallMode.UNCONDITIONAL,
+ trampoline_var_name=tp_install_unconditional_props,
+- attribute_entries=filter(is_unconditional, attribute_entries),
+- constant_entries=filter(is_unconditional, constant_entries),
+- exposed_construct_entries=filter(is_unconditional,
+- exposed_construct_entries),
+- operation_entries=filter(is_unconditional, operation_entries))
++ attribute_entries=list(filter(is_unconditional, attribute_entries)),
++ constant_entries=list(filter(is_unconditional, constant_entries)),
++ exposed_construct_entries=list(
++ filter(is_unconditional, exposed_construct_entries)),
++ operation_entries=list(filter(is_unconditional, operation_entries)))
+ (install_context_independent_props_decl,
+ install_context_independent_props_def,
+ install_context_independent_props_trampoline) = make_install_properties(
+@@ -6823,11 +6828,14 @@ def generate_interface(interface_identifier):
+ class_name=impl_class_name,
+ prop_install_mode=PropInstallMode.CONTEXT_INDEPENDENT,
+ trampoline_var_name=tp_install_context_independent_props,
+- attribute_entries=filter(is_context_independent, attribute_entries),
+- constant_entries=filter(is_context_independent, constant_entries),
+- exposed_construct_entries=filter(is_context_independent,
+- exposed_construct_entries),
+- operation_entries=filter(is_context_independent, operation_entries))
++ attribute_entries=list(
++ filter(is_context_independent, attribute_entries)),
++ constant_entries=list(filter(is_context_independent,
++ constant_entries)),
++ exposed_construct_entries=list(
++ filter(is_context_independent, exposed_construct_entries)),
++ operation_entries=list(
++ filter(is_context_independent, operation_entries)))
+ (install_context_dependent_props_decl, install_context_dependent_props_def,
+ install_context_dependent_props_trampoline) = make_install_properties(
+ cg_context,
+@@ -6835,11 +6843,13 @@ def generate_interface(interface_identifier):
+ class_name=impl_class_name,
+ prop_install_mode=PropInstallMode.CONTEXT_DEPENDENT,
+ trampoline_var_name=tp_install_context_dependent_props,
+- attribute_entries=filter(is_context_dependent, attribute_entries),
+- constant_entries=filter(is_context_dependent, constant_entries),
+- exposed_construct_entries=filter(is_context_dependent,
+- exposed_construct_entries),
+- operation_entries=filter(is_context_dependent, operation_entries))
++ attribute_entries=list(filter(is_context_dependent,
++ attribute_entries)),
++ constant_entries=list(filter(is_context_dependent, constant_entries)),
++ exposed_construct_entries=list(
++ filter(is_context_dependent, exposed_construct_entries)),
++ operation_entries=list(filter(is_context_dependent,
++ operation_entries)))
+ (install_interface_template_decl, install_interface_template_def,
+ install_interface_template_trampoline) = make_install_interface_template(
+ cg_context,
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py
+index b4c705538632..f3a2fcd772d0 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py
+@@ -105,7 +105,7 @@ class MakoRenderer(object):
+ on_error = self._caller_stack_on_error
+ if (len(current) <= len(on_error)
+ and all(current[i] == on_error[i]
+- for i in xrange(len(current)))):
++ for i in range(len(current)))):
+ pass # Error happened in a deeper caller.
+ else:
+ self._caller_stack_on_error = list(self._caller_stack)
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py
+index dc3493cc394b..017d3d47bb37 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py
+@@ -70,8 +70,13 @@ def gn_format(contents, filename=None):
+
+
+ def _invoke_format_command(command_line, filename, contents):
+- proc = subprocess.Popen(
+- command_line, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
++ kwargs = {}
++ if sys.version_info.major != 2:
++ kwargs['encoding'] = 'utf-8'
++ proc = subprocess.Popen(command_line,
++ stdin=subprocess.PIPE,
++ stdout=subprocess.PIPE,
++ **kwargs)
+ stdout_output, stderr_output = proc.communicate(input=contents)
+ exit_code = proc.wait()
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py
+index 0d8f4c0f3037..e666a9b668ec 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py
+@@ -2,6 +2,7 @@
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+
++import functools
+ import multiprocessing
+
+ from .package_initializer import package_initializer
+@@ -76,7 +77,7 @@ class TaskQueue(object):
+ if not report_progress:
+ return
+
+- done_count = reduce(
++ done_count = functools.reduce(
+ lambda count, worker_task: count + bool(worker_task.ready()),
+ self._worker_tasks, 0)
+ report_progress(len(self._worker_tasks), done_count)
+@@ -85,4 +86,4 @@ class TaskQueue(object):
+ def _task_queue_run_tasks(tasks):
+ for task in tasks:
+ func, args, kwargs = task
+- apply(func, args, kwargs)
++ func(*args, **kwargs)
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py
+index e8280be72130..e49e6eb965e5 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py
+@@ -13,6 +13,7 @@ import re
+ import sys
+
+ from idl_types import set_ancestors, IdlType
++from itertools import groupby
+ from v8_globals import includes
+ from v8_interface import constant_filters
+ from v8_types import set_component_dirs
+@@ -43,6 +44,7 @@ TEMPLATES_DIR = os.path.normpath(
+ # after path[0] == invoking script dir
+ sys.path.insert(1, THIRD_PARTY_DIR)
+ import jinja2
++from jinja2.filters import make_attrgetter, environmentfilter
+
+
+ def generate_indented_conditional(code, conditional):
+@@ -88,6 +90,13 @@ def runtime_enabled_if(code, name):
+ return generate_indented_conditional(code, function)
+
+
++@environmentfilter
++def do_stringify_key_group_by(environment, value, attribute):
++ expr = make_attrgetter(environment, attribute)
++ key = lambda item: '' if expr(item) is None else str(expr(item))
++ return groupby(sorted(value, key=key), expr)
++
++
+ def initialize_jinja_env(cache_dir):
+ jinja_env = jinja2.Environment(
+ loader=jinja2.FileSystemLoader(TEMPLATES_DIR),
+@@ -117,6 +126,7 @@ def initialize_jinja_env(cache_dir):
+ })
+ jinja_env.filters.update(constant_filters())
+ jinja_env.filters.update(method_filters())
++ jinja_env.filters["stringifykeygroupby"] = do_stringify_key_group_by
+ return jinja_env
+
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py
+index 130004eae837..04c0fabcef2c 100755
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py
+@@ -80,7 +80,7 @@ def read_idl_file(reader, idl_filename):
+ assert len(interfaces) == 1, (
+ "Expected one interface in file %r, found %d" %
+ (idl_filename, len(interfaces)))
+- return (interfaces.values()[0], includes)
++ return (list(interfaces.values())[0], includes)
+
+
+ def interface_is_global(interface):
+@@ -281,7 +281,7 @@ def main():
+
+ info_provider = create_component_info_provider(
+ os.path.normpath(options.info_dir), options.target_component)
+- idl_filenames = map(str.strip, open(options.idl_files_list))
++ idl_filenames = list(map(str.strip, open(options.idl_files_list)))
+
+ generate_origin_trial_features(info_provider, options, idl_filenames)
+ return 0
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py
+index 14e6e9d3f87b..b027818aef2d 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py
+@@ -394,7 +394,8 @@ class IdlInterface(object):
+ else:
+ raise ValueError('Unrecognized node class: %s' % child_class)
+
+- if len(filter(None, [self.iterable, self.maplike, self.setlike])) > 1:
++ if len(list(filter(None,
++ [self.iterable, self.maplike, self.setlike]))) > 1:
+ raise ValueError(
+ 'Interface can only have one of iterable<>, maplike<> and setlike<>.'
+ )
+@@ -512,6 +513,9 @@ class IdlAttribute(TypedObject):
+ def accept(self, visitor):
+ visitor.visit_attribute(self)
+
++ def __lt__(self, other):
++ return self.name < other.name
++
+
+ ################################################################################
+ # Constants
+@@ -852,7 +856,7 @@ class IdlIncludes(object):
+ ################################################################################
+
+
+-class Exposure:
++class Exposure(object):
+ """An Exposure holds one Exposed or RuntimeEnabled condition.
+ Each exposure has two properties: exposed and runtime_enabled.
+ Exposure(e, r) corresponds to [Exposed(e r)]. Exposure(e) corresponds to
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py
+index 8d72865a6cab..b80eebdcd61e 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py
+@@ -55,8 +55,8 @@ def validate_blink_idl_definitions(idl_filename, idl_file_basename,
+ definitions. There is no filename convention in this case.
+ - Otherwise, an IDL file is invalid.
+ """
+- targets = (
+- definitions.interfaces.values() + definitions.dictionaries.values())
++ targets = (list(definitions.interfaces.values()) +
++ list(definitions.dictionaries.values()))
+ number_of_targets = len(targets)
+ if number_of_targets > 1:
+ raise Exception(
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py
+index cd4f0c3513b2..ab95e9c0b082 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py
+@@ -349,7 +349,7 @@ class IdlUnionType(IdlTypeBase):
+ return True
+
+ def single_matching_member_type(self, predicate):
+- matching_types = filter(predicate, self.flattened_member_types)
++ matching_types = list(filter(predicate, self.flattened_member_types))
+ if len(matching_types) > 1:
+ raise ValueError('%s is ambiguous.' % self.name)
+ return matching_types[0] if matching_types else None
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py
+index e1677ee7bd6e..3c5006f064f3 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py
+@@ -196,8 +196,9 @@ class ComponentInfoProviderModules(ComponentInfoProvider):
+
+ @property
+ def callback_functions(self):
+- return dict(self._component_info_core['callback_functions'].items() +
+- self._component_info_modules['callback_functions'].items())
++ return dict(
++ list(self._component_info_core['callback_functions'].items()) +
++ list(self._component_info_modules['callback_functions'].items()))
+
+ @property
+ def specifier_for_export(self):
+@@ -209,8 +210,8 @@ class ComponentInfoProviderModules(ComponentInfoProvider):
+
+
+ def load_interfaces_info_overall_pickle(info_dir):
+- with open(os.path.join(info_dir,
+- 'interfaces_info.pickle')) as interface_info_file:
++ with open(os.path.join(info_dir, 'interfaces_info.pickle'),
++ mode='rb') as interface_info_file:
+ return pickle.load(interface_info_file)
+
+
+@@ -236,23 +237,20 @@ def merge_dict_recursively(target, diff):
+
+ def create_component_info_provider_core(info_dir):
+ interfaces_info = load_interfaces_info_overall_pickle(info_dir)
+- with open(
+- os.path.join(info_dir, 'core',
+- 'component_info_core.pickle')) as component_info_file:
++ with open(os.path.join(info_dir, 'core', 'component_info_core.pickle'),
++ mode='rb') as component_info_file:
+ component_info = pickle.load(component_info_file)
+ return ComponentInfoProviderCore(interfaces_info, component_info)
+
+
+ def create_component_info_provider_modules(info_dir):
+ interfaces_info = load_interfaces_info_overall_pickle(info_dir)
+- with open(
+- os.path.join(info_dir, 'core',
+- 'component_info_core.pickle')) as component_info_file:
++ with open(os.path.join(info_dir, 'core', 'component_info_core.pickle'),
++ mode='rb') as component_info_file:
+ component_info_core = pickle.load(component_info_file)
+- with open(
+- os.path.join(
+- info_dir, 'modules',
+- 'component_info_modules.pickle')) as component_info_file:
++ with open(os.path.join(info_dir, 'modules',
++ 'component_info_modules.pickle'),
++ mode='rb') as component_info_file:
+ component_info_modules = pickle.load(component_info_file)
+ return ComponentInfoProviderModules(interfaces_info, component_info_core,
+ component_info_modules)
+@@ -356,7 +354,7 @@ def write_pickle_file(pickle_filename, data):
+ pickle_filename = abs(pickle_filename)
+ # If |data| is same with the file content, we skip updating.
+ if os.path.isfile(pickle_filename):
+- with open(pickle_filename) as pickle_file:
++ with open(pickle_filename, 'rb') as pickle_file:
+ try:
+ if pickle.load(pickle_file) == data:
+ return
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py
+index a43260414db6..a85b03abe750 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py
+@@ -189,7 +189,7 @@ def context_enabled_features(attributes):
+ return sorted([
+ member for member in members
+ if member.get(KEY) and not member.get('exposed_test')
+- ])
++ ], key=lambda item: item['name'])
+
+ def member_filter_by_name(members, name):
+ return [member for member in members if member[KEY] == name]
+@@ -612,7 +612,8 @@ def interface_context(interface, interfaces, component_info):
+ sorted(
+ origin_trial_features(interface, context['constants'],
+ context['attributes'], context['methods']) +
+- context_enabled_features(context['attributes'])),
++ context_enabled_features(context['attributes']),
++ key=lambda item: item['name']),
+ })
+ if context['optional_features']:
+ includes.add('platform/bindings/v8_per_context_data.h')
+@@ -1356,9 +1357,9 @@ def resolution_tests_methods(effective_overloads):
+
+ # Extract argument and IDL type to simplify accessing these in each loop.
+ arguments = [method['arguments'][index] for method in methods]
+- arguments_methods = zip(arguments, methods)
++ arguments_methods = list(zip(arguments, methods))
+ idl_types = [argument['idl_type_object'] for argument in arguments]
+- idl_types_methods = zip(idl_types, methods)
++ idl_types_methods = list(zip(idl_types, methods))
+
+ # We can’t do a single loop through all methods or simply sort them, because
+ # a method may be listed in multiple steps of the resolution algorithm, and
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py
+index 5f1f89a3defd..6ee8a4077987 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py
+@@ -46,6 +46,10 @@ import v8_types
+ import v8_utilities
+ from v8_utilities import (has_extended_attribute_value, is_unforgeable)
+
++# TODO: Remove this once Python2 is obsoleted.
++if sys.version_info.major != 2:
++ basestring = str
++
+
+ def method_is_visible(method, interface_is_partial):
+ if 'overloads' in method:
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py
+index 2ecd69233208..fcfc48371b1d 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py
+@@ -271,7 +271,7 @@ EXPOSED_WORKERS = set([
+ ])
+
+
+-class ExposureSet:
++class ExposureSet(object):
+ """An ExposureSet is a collection of Exposure instructions."""
+
+ def __init__(self, exposures=None):
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py
+index 13fb7c7068d8..b73b7710687e 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py
+@@ -91,11 +91,13 @@ class CallbackInterface(UserDefinedType, WithExtendedAttributes,
+ for operation_ir in ir.operations
+ ])
+ self._operation_groups = tuple([
+- OperationGroup(
+- operation_group_ir,
+- filter(lambda x: x.identifier == operation_group_ir.identifier,
+- self._operations),
+- owner=self) for operation_group_ir in ir.operation_groups
++ OperationGroup(operation_group_ir,
++ list(
++ filter(
++ lambda x: x.identifier == operation_group_ir
++ .identifier, self._operations)),
++ owner=self)
++ for operation_group_ir in ir.operation_groups
+ ])
+
+ @property
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py
+index c92cf48eb2ab..f5d591294495 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py
+@@ -156,4 +156,4 @@ class Database(object):
+ return self._view_by_kind(Database._Kind.UNION)
+
+ def _view_by_kind(self, kind):
+- return self._impl.find_by_kind(kind).values()
++ return list(self._impl.find_by_kind(kind).values())
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py
+index abaeef39c306..e36cf7439ae5 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py
+@@ -8,8 +8,11 @@ from .runtime_enabled_features import RuntimeEnabledFeatures
+ class _Feature(str):
+ """Represents a runtime-enabled feature."""
+
++ def __new__(cls, value):
++ return str.__new__(cls, value)
++
+ def __init__(self, value):
+- str.__init__(self, value)
++ str.__init__(self)
+ self._is_context_dependent = (
+ RuntimeEnabledFeatures.is_context_dependent(self))
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py
+index 648c70d803da..1712f19c6727 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py
+@@ -71,8 +71,9 @@ class FunctionLike(WithIdentifier):
+ def num_of_required_arguments(self):
+ """Returns the number of required arguments."""
+ return len(
+- filter(lambda arg: not (arg.is_optional or arg.is_variadic),
+- self.arguments))
++ list(
++ filter(lambda arg: not (arg.is_optional or arg.is_variadic),
++ self.arguments)))
+
+
+ class OverloadGroup(WithIdentifier):
+@@ -171,8 +172,7 @@ class OverloadGroup(WithIdentifier):
+ Returns the effective overload set.
+ https://heycam.github.io/webidl/#compute-the-effective-overload-set
+ """
+- assert argument_count is None or isinstance(argument_count,
+- (int, long))
++ assert argument_count is None or isinstance(argument_count, int)
+
+ N = argument_count
+ S = []
+@@ -188,21 +188,21 @@ class OverloadGroup(WithIdentifier):
+
+ S.append(
+ OverloadGroup.EffectiveOverloadItem(
+- X, map(lambda arg: arg.idl_type, X.arguments),
+- map(lambda arg: arg.optionality, X.arguments)))
++ X, list(map(lambda arg: arg.idl_type, X.arguments)),
++ list(map(lambda arg: arg.optionality, X.arguments))))
+
+ if X.is_variadic:
+- for i in xrange(n, max(maxarg, N)):
+- t = map(lambda arg: arg.idl_type, X.arguments)
+- o = map(lambda arg: arg.optionality, X.arguments)
+- for _ in xrange(n, i + 1):
++ for i in range(n, max(maxarg, N)):
++ t = list(map(lambda arg: arg.idl_type, X.arguments))
++ o = list(map(lambda arg: arg.optionality, X.arguments))
++ for _ in range(n, i + 1):
+ t.append(X.arguments[-1].idl_type)
+ o.append(X.arguments[-1].optionality)
+ S.append(OverloadGroup.EffectiveOverloadItem(X, t, o))
+
+- t = map(lambda arg: arg.idl_type, X.arguments)
+- o = map(lambda arg: arg.optionality, X.arguments)
+- for i in xrange(n - 1, -1, -1):
++ t = list(map(lambda arg: arg.idl_type, X.arguments))
++ o = list(map(lambda arg: arg.optionality, X.arguments))
++ for i in range(n - 1, -1, -1):
+ if X.arguments[i].optionality == IdlType.Optionality.REQUIRED:
+ break
+ S.append(OverloadGroup.EffectiveOverloadItem(X, t[:i], o[:i]))
+@@ -222,7 +222,7 @@ class OverloadGroup(WithIdentifier):
+ for item in items)
+ assert len(items) > 1
+
+- for index in xrange(len(items[0].type_list)):
++ for index in range(len(items[0].type_list)):
+ # Assume that the given items are valid, and we only need to test
+ # the two types.
+ if OverloadGroup.are_distinguishable_types(
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py
+index c5ee2bd8a3d6..58315072480d 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py
+@@ -149,8 +149,8 @@ class IdlCompiler(object):
+ for old_ir in old_irs:
+ new_ir = make_copy(old_ir)
+ self._ir_map.add(new_ir)
+- new_ir.attributes = filter(not_disabled, new_ir.attributes)
+- new_ir.operations = filter(not_disabled, new_ir.operations)
++ new_ir.attributes = list(filter(not_disabled, new_ir.attributes))
++ new_ir.operations = list(filter(not_disabled, new_ir.operations))
+
+ def _record_defined_in_partial_and_mixin(self):
+ old_irs = self._ir_map.irs_of_kinds(
+@@ -231,7 +231,7 @@ class IdlCompiler(object):
+ only_to_members_of_partial_or_mixin=False)
+ propagate_to_exposure(propagate)
+
+- map(process_member_like, ir.iter_all_members())
++ list(map(process_member_like, ir.iter_all_members()))
+
+ def process_member_like(ir):
+ propagate = functools.partial(propagate_extattr, ir=ir)
+@@ -257,7 +257,7 @@ class IdlCompiler(object):
+
+ self._ir_map.move_to_new_phase()
+
+- map(process_interface_like, old_irs)
++ list(map(process_interface_like, old_irs))
+
+ def _determine_blink_headers(self):
+ irs = self._ir_map.irs_of_kinds(
+@@ -422,9 +422,9 @@ class IdlCompiler(object):
+ assert not new_interface.deriveds
+ derived_set = identifier_to_derived_set.get(
+ new_interface.identifier, set())
+- new_interface.deriveds = map(
+- lambda id_: self._ref_to_idl_def_factory.create(id_),
+- sorted(derived_set))
++ new_interface.deriveds = list(
++ map(lambda id_: self._ref_to_idl_def_factory.create(id_),
++ sorted(derived_set)))
+
+ def _supplement_missing_html_constructor_operation(self):
+ # Temporary mitigation of misuse of [HTMLConstructor]
+@@ -553,7 +553,8 @@ class IdlCompiler(object):
+ self._ir_map.add(new_ir)
+
+ for group in new_ir.iter_all_overload_groups():
+- exposures = map(lambda overload: overload.exposure, group)
++ exposures = list(map(lambda overload: overload.exposure,
++ group))
+
+ # [Exposed]
+ if any(not exposure.global_names_and_features
+@@ -653,8 +654,8 @@ class IdlCompiler(object):
+ constructs = set()
+ for global_name in global_names:
+ constructs.update(exposed_map.get(global_name, []))
+- new_ir.exposed_constructs = map(
+- self._ref_to_idl_def_factory.create, sorted(constructs))
++ new_ir.exposed_constructs = list(
++ map(self._ref_to_idl_def_factory.create, sorted(constructs)))
+
+ assert not new_ir.legacy_window_aliases
+ if new_ir.identifier != 'Window':
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py
+index 65d24e529d10..067ef2eb0b2a 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py
+@@ -180,8 +180,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo,
+ self._constructor_groups = tuple([
+ ConstructorGroup(
+ group_ir,
+- filter(lambda x: x.identifier == group_ir.identifier,
+- self._constructors),
++ list(
++ filter(lambda x: x.identifier == group_ir.identifier,
++ self._constructors)),
+ owner=self) for group_ir in ir.constructor_groups
+ ])
+ assert len(self._constructor_groups) <= 1
+@@ -192,8 +193,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo,
+ self._named_constructor_groups = tuple([
+ ConstructorGroup(
+ group_ir,
+- filter(lambda x: x.identifier == group_ir.identifier,
+- self._named_constructors),
++ list(
++ filter(lambda x: x.identifier == group_ir.identifier,
++ self._named_constructors)),
+ owner=self) for group_ir in ir.named_constructor_groups
+ ])
+ self._operations = tuple([
+@@ -203,22 +205,23 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo,
+ self._operation_groups = tuple([
+ OperationGroup(
+ group_ir,
+- filter(lambda x: x.identifier == group_ir.identifier,
+- self._operations),
++ list(
++ filter(lambda x: x.identifier == group_ir.identifier,
++ self._operations)),
+ owner=self) for group_ir in ir.operation_groups
+ ])
+ self._exposed_constructs = tuple(ir.exposed_constructs)
+ self._legacy_window_aliases = tuple(ir.legacy_window_aliases)
+ self._indexed_and_named_properties = None
+- indexed_and_named_property_operations = filter(
+- lambda x: x.is_indexed_or_named_property_operation,
+- self._operations)
++ indexed_and_named_property_operations = list(
++ filter(lambda x: x.is_indexed_or_named_property_operation,
++ self._operations))
+ if indexed_and_named_property_operations:
+ self._indexed_and_named_properties = IndexedAndNamedProperties(
+ indexed_and_named_property_operations, owner=self)
+ self._stringifier = None
+- stringifier_operation_irs = filter(lambda x: x.is_stringifier,
+- ir.operations)
++ stringifier_operation_irs = list(
++ filter(lambda x: x.is_stringifier, ir.operations))
+ if stringifier_operation_irs:
+ assert len(stringifier_operation_irs) == 1
+ op_ir = make_copy(stringifier_operation_irs[0])
+@@ -231,8 +234,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo,
+ attribute = None
+ if operation.stringifier_attribute:
+ attr_id = operation.stringifier_attribute
+- attributes = filter(lambda x: x.identifier == attr_id,
+- self._attributes)
++ attributes = list(
++ filter(lambda x: x.identifier == attr_id,
++ self._attributes))
+ assert len(attributes) == 1
+ attribute = attributes[0]
+ self._stringifier = Stringifier(operation, attribute, owner=self)
+@@ -578,8 +582,9 @@ class Iterable(WithDebugInfo):
+ self._operation_groups = tuple([
+ OperationGroup(
+ group_ir,
+- filter(lambda x: x.identifier == group_ir.identifier,
+- self._operations),
++ list(
++ filter(lambda x: x.identifier == group_ir.identifier,
++ self._operations)),
+ owner=owner) for group_ir in ir.operation_groups
+ ])
+
+@@ -666,8 +671,9 @@ class Maplike(WithDebugInfo):
+ self._operation_groups = tuple([
+ OperationGroup(
+ group_ir,
+- filter(lambda x: x.identifier == group_ir.identifier,
+- self._operations),
++ list(
++ filter(lambda x: x.identifier == group_ir.identifier,
++ self._operations)),
+ owner=owner) for group_ir in ir.operation_groups
+ ])
+
+@@ -755,8 +761,9 @@ class Setlike(WithDebugInfo):
+ self._operation_groups = tuple([
+ OperationGroup(
+ group_ir,
+- filter(lambda x: x.identifier == group_ir.identifier,
+- self._operations),
++ list(
++ filter(lambda x: x.identifier == group_ir.identifier,
++ self._operations)),
+ owner=owner) for group_ir in ir.operation_groups
+ ])
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py
+index e9aeff4ab822..d80554d603ed 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py
+@@ -2,6 +2,8 @@
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+
++import sys
++
+ from .argument import Argument
+ from .ast_group import AstGroup
+ from .attribute import Attribute
+@@ -30,6 +32,11 @@ from .operation import Operation
+ from .typedef import Typedef
+
+
++# TODO: Remove this once Python2 is obsoleted.
++if sys.version_info.major != 2:
++ long = int
++
++
+ def load_and_register_idl_definitions(filepaths, register_ir,
+ create_ref_to_idl_def, idl_type_factory):
+ """
+@@ -160,7 +167,7 @@ class _IRBuilder(object):
+ child_nodes = list(node.GetChildren())
+ extended_attributes = self._take_extended_attributes(child_nodes)
+
+- members = map(self._build_interface_member, child_nodes)
++ members = list(map(self._build_interface_member, child_nodes))
+ attributes = []
+ constants = []
+ operations = []
+@@ -302,7 +309,7 @@ class _IRBuilder(object):
+ child_nodes = list(node.GetChildren())
+ inherited = self._take_inheritance(child_nodes)
+ extended_attributes = self._take_extended_attributes(child_nodes)
+- own_members = map(self._build_dictionary_member, child_nodes)
++ own_members = list(map(self._build_dictionary_member, child_nodes))
+
+ return Dictionary.IR(
+ identifier=Identifier(node.GetName()),
+@@ -336,7 +343,7 @@ class _IRBuilder(object):
+
+ child_nodes = list(node.GetChildren())
+ extended_attributes = self._take_extended_attributes(child_nodes)
+- members = map(self._build_interface_member, child_nodes)
++ members = list(map(self._build_interface_member, child_nodes))
+ constants = []
+ operations = []
+ for member in members:
+@@ -456,8 +463,8 @@ class _IRBuilder(object):
+ assert len(child_nodes) == 1
+ child = child_nodes[0]
+ if child.GetClass() == 'Arguments':
+- arguments = map(build_extattr_argument,
+- child.GetChildren())
++ arguments = list(
++ map(build_extattr_argument, child.GetChildren()))
+ elif child.GetClass() == 'Call':
+ assert len(child.GetChildren()) == 1
+ grand_child = child.GetChildren()[0]
+@@ -486,7 +493,9 @@ class _IRBuilder(object):
+
+ assert node.GetClass() == 'ExtAttributes'
+ return ExtendedAttributes(
+- filter(None, map(build_extended_attribute, node.GetChildren())))
++ list(
++ filter(None, map(build_extended_attribute,
++ node.GetChildren()))))
+
+ def _build_inheritance(self, node):
+ assert node.GetClass() == 'Inherit'
+@@ -506,7 +515,7 @@ class _IRBuilder(object):
+
+ def _build_iterable(self, node):
+ assert node.GetClass() == 'Iterable'
+- types = map(self._build_type, node.GetChildren())
++ types = list(map(self._build_type, node.GetChildren()))
+ assert len(types) == 1 or len(types) == 2
+ if len(types) == 1: # value iterator
+ key_type, value_type = (None, types[0])
+@@ -584,7 +593,7 @@ class _IRBuilder(object):
+ def _build_maplike(self, node, interface_identifier):
+ assert node.GetClass() == 'Maplike'
+ assert isinstance(interface_identifier, Identifier)
+- types = map(self._build_type, node.GetChildren())
++ types = list(map(self._build_type, node.GetChildren()))
+ assert len(types) == 2
+ key_type, value_type = types
+ is_readonly = bool(node.GetProperty('READONLY'))
+@@ -676,7 +685,7 @@ class _IRBuilder(object):
+ def _build_setlike(self, node, interface_identifier):
+ assert node.GetClass() == 'Setlike'
+ assert isinstance(interface_identifier, Identifier)
+- types = map(self._build_type, node.GetChildren())
++ types = list(map(self._build_type, node.GetChildren()))
+ assert len(types) == 1
+ value_type = types[0]
+ is_readonly = bool(node.GetProperty('READONLY'))
+@@ -838,7 +847,7 @@ class _IRBuilder(object):
+
+ def build_union_type(node, extended_attributes):
+ return self._idl_type_factory.union_type(
+- member_types=map(self._build_type, node.GetChildren()),
++ member_types=list(map(self._build_type, node.GetChildren())),
+ is_optional=is_optional,
+ extended_attributes=extended_attributes,
+ debug_info=self._build_debug_info(node))
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py
+index a7a2b11f3f01..2f6b61300ffb 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py
+@@ -3,6 +3,13 @@
+ # found in the LICENSE file.
+
+
++import sys
++
++# TODO: Remove this once Python2 is obsoleted.
++if sys.version_info.major != 2:
++ long = int
++ basestring = str
++
+ def make_copy(obj, memo=None):
+ """
+ Creates a copy of the given object, which should be an IR or part of IR.
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py
+index eeabef97cbe3..bd7e98907f3b 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py
+@@ -107,11 +107,13 @@ class Namespace(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo,
+ for operation_ir in ir.operations
+ ])
+ self._operation_groups = tuple([
+- OperationGroup(
+- operation_group_ir,
+- filter(lambda x: x.identifier == operation_group_ir.identifier,
+- self._operations),
+- owner=self) for operation_group_ir in ir.operation_groups
++ OperationGroup(operation_group_ir,
++ list(
++ filter(
++ lambda x: x.identifier == operation_group_ir
++ .identifier, self._operations)),
++ owner=self)
++ for operation_group_ir in ir.operation_groups
+ ])
+
+ @property
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl
+index 0add9c45a382..dc910f6d227c 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl
+@@ -59,9 +59,9 @@ void {{v8_class}}::ToImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8_value, {
+ DCHECK(executionContext);
+ {% endif %}{# has_origin_trial_members #}
+ {% endif %}{# members #}
+- {% for origin_trial_test, origin_trial_member_list in members | groupby('origin_trial_feature_name') %}
++ {% for origin_trial_test, origin_trial_member_list in members | stringifykeygroupby('origin_trial_feature_name') %}
+ {% filter origin_trial_enabled(origin_trial_test, "executionContext") %}
+- {% for feature_name, member_list in origin_trial_member_list | groupby('runtime_enabled_feature_name') %}
++ {% for feature_name, member_list in origin_trial_member_list | stringifykeygroupby('runtime_enabled_feature_name') %}
+ {% filter runtime_enabled(feature_name) %}
+ {% for member in member_list %}
+ v8::Local<v8::Value> {{member.v8_value}};
+@@ -147,9 +147,9 @@ bool toV8{{cpp_class}}(const {{cpp_class}}* impl, v8::Local<v8::Object> dictiona
+ DCHECK(executionContext);
+ {% endif %}{# has_origin_trial_members #}
+ {% endif %}{# members #}
+- {% for origin_trial_test, origin_trial_member_list in members | groupby('origin_trial_feature_name') %}
++ {% for origin_trial_test, origin_trial_member_list in members | stringifykeygroupby('origin_trial_feature_name') %}
+ {% filter origin_trial_enabled(origin_trial_test, "executionContext") %}
+- {% for feature_name, member_list in origin_trial_member_list | groupby('runtime_enabled_feature_name') %}
++ {% for feature_name, member_list in origin_trial_member_list | stringifykeygroupby('runtime_enabled_feature_name') %}
+ {% filter runtime_enabled(feature_name) %}
+ {% for member in member_list %}
+ v8::Local<v8::Value> {{member.v8_value}};
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py
+index 1799cd5a153b..5f43ffabc26c 100755
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py
+@@ -71,7 +71,7 @@ class Expansion(object):
+ def enabled_longhands(self):
+ include = lambda longhand: not longhand[
+ 'runtime_flag'] or self.is_enabled(longhand['runtime_flag'])
+- return filter(include, self._longhands)
++ return list(filter(include, self._longhands))
+
+ @property
+ def index(self):
+@@ -87,8 +87,9 @@ class Expansion(object):
+
+ def create_expansions(longhands):
+ flags = collect_runtime_flags(longhands)
+- expansions = map(lambda mask: Expansion(longhands, flags, mask),
+- range(1 << len(flags)))
++ expansions = list(
++ map(lambda mask: Expansion(longhands, flags, mask),
++ range(1 << len(flags))))
+ assert len(expansions) > 0
+ # We generate 2^N expansions for N flags, so enforce some limit.
+ assert len(flags) <= 4, 'Too many runtime flags for a single shorthand'
+@@ -114,14 +115,14 @@ class StylePropertyShorthandWriter(json5_generator.Writer):
+
+ self._longhand_dictionary = defaultdict(list)
+ for property_ in json5_properties.shorthands:
+- property_['longhand_enum_keys'] = map(enum_key_for_css_property,
+- property_['longhands'])
+- property_['longhand_property_ids'] = map(id_for_css_property,
+- property_['longhands'])
+-
+- longhands = map(
+- lambda name: json5_properties.properties_by_name[name],
+- property_['longhands'])
++ property_['longhand_enum_keys'] = list(
++ map(enum_key_for_css_property, property_['longhands']))
++ property_['longhand_property_ids'] = list(
++ map(id_for_css_property, property_['longhands']))
++
++ longhands = list(
++ map(lambda name: json5_properties.properties_by_name[name],
++ property_['longhands']))
+ property_['expansions'] = create_expansions(longhands)
+ for longhand_enum_key in property_['longhand_enum_keys']:
+ self._longhand_dictionary[longhand_enum_key].append(property_)
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py
+index 75030ac577eb..f72aadee17de 100755
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py
+@@ -42,8 +42,8 @@ class CSSPropertyInstancesWriter(json5_generator.Writer):
+ aliases = self._css_properties.aliases
+
+ # Lists of PropertyClassData.
+- self._property_classes_by_id = map(self.get_class, properties)
+- self._alias_classes_by_id = map(self.get_class, aliases)
++ self._property_classes_by_id = list(map(self.get_class, properties))
++ self._alias_classes_by_id = list(map(self.get_class, aliases))
+
+ # Sort by enum value.
+ self._property_classes_by_id.sort(key=lambda t: t.enum_value)
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py
+index 5ee49056be41..db72660d4718 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py
+@@ -95,7 +95,7 @@ def main():
+
+ open(args.output_file, 'wb').write(
+ generate_gperf(gperf_path,
+- open(infile).read(), gperf_args))
++ open(infile).read(), gperf_args).encode('utf-8'))
+
+
+ if __name__ == '__main__':
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py
+index 28adc050f1ed..58113483e572 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py
+@@ -66,7 +66,7 @@ class InFile(object):
+ self._defaults = defaults
+ self._valid_values = copy.deepcopy(
+ valid_values if valid_values else {})
+- self._parse(map(str.strip, lines))
++ self._parse(list(map(str.strip, lines)))
+
+ @classmethod
+ def load_from_files(self, file_paths, defaults, valid_values,
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py
+index e46740a2e85c..ab1981ad1e38 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py
+@@ -32,10 +32,15 @@ import os
+ import os.path
+ import shlex
+ import shutil
++import sys
+ import optparse
+
+ from in_file import InFile
+
++# TODO: Remove this once Python2 is obsoleted.
++if sys.version_info.major != 2:
++ basestring = str
++
+
+ #########################################################
+ # This is now deprecated - use json5_generator.py instead
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py
+index cafe8d94a8e9..6925a4fa580a 100755
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py
+@@ -138,7 +138,7 @@ class RuntimeFeatureWriter(BaseRuntimeFeatureWriter):
+ except Exception:
+ # If trouble unpickling, overwrite
+ pass
+- with open(os.path.abspath(file_name), 'w') as pickle_file:
++ with open(os.path.abspath(file_name), 'wb') as pickle_file:
+ pickle.dump(features_map, pickle_file)
+
+ def _template_inputs(self):
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl
+index dc3f44c5b103..3eefcf9f0ee4 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl
+@@ -26,7 +26,7 @@ using {{namespace}}FunctionMap = HashMap<AtomicString, {{namespace}}ConstructorF
+
+ static {{namespace}}FunctionMap* g_{{namespace|lower}}_constructors = nullptr;
+
+-{% for tag in tags|sort if not tag.noConstructor %}
++{% for tag in tags|sort(attribute='name') if not tag.noConstructor %}
+ static {{namespace}}Element* {{namespace}}{{tag.name.to_upper_camel_case()}}Constructor(
+ Document& document, const CreateElementFlags flags) {
+ {% if tag.runtimeEnabled %}
+@@ -52,7 +52,7 @@ static void Create{{namespace}}FunctionMap() {
+ // Empty array initializer lists are illegal [dcl.init.aggr] and will not
+ // compile in MSVC. If tags list is empty, add check to skip this.
+ static const Create{{namespace}}FunctionMapData data[] = {
+- {% for tag in tags|sort if not tag.noConstructor %}
++ {% for tag in tags|sort(attribute='name') if not tag.noConstructor %}
+ { {{cpp_namespace}}::{{tag|symbol}}Tag, {{namespace}}{{tag.name.to_upper_camel_case()}}Constructor },
+ {% endfor %}
+ };
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.cc.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.cc.tmpl
+index 9bfc489e048b..5f86184e8790 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.cc.tmpl
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.cc.tmpl
+@@ -22,7 +22,7 @@ HTMLTypeMap CreateHTMLTypeMap() {
+ const char* name;
+ HTMLElementType type;
+ } kTags[] = {
+- {% for tag in tags|sort %}
++ {% for tag in tags|sort(attribute='name') %}
+ { "{{tag.name}}", HTMLElementType::k{{tag.js_interface}} },
+ {% endfor %}
+ };
+@@ -42,7 +42,7 @@ HTMLElementType htmlElementTypeForTag(const AtomicString& tagName, const Documen
+ if (it == html_type_map.end())
+ return HTMLElementType::kHTMLUnknownElement;
+
+- {% for tag in tags|sort %}
++ {% for tag in tags|sort(attribute='name') %}
+ {% if tag.runtimeEnabled %}
+ if (tagName == "{{tag.name}}") {
+ if (!RuntimeEnabledFeatures::{{tag.runtimeEnabled}}Enabled(document->GetExecutionContext())) {
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl
+index 1b5297d52dc0..edecc81d9d48 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl
+@@ -15,7 +15,7 @@ namespace blink {
+ class Document;
+
+ // Type checking.
+-{% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %}
++{% for tag in tags|sort(attribute='name') if not tag.multipleTagNames and not tag.noTypeHelpers %}
+ class {{tag.interface}};
+ template <>
+ inline bool IsElementOfType<const {{tag.interface}}>(const Node& node) {
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl
+index 0244433af2e8..dcdbb02a56c3 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl
+@@ -25,7 +25,7 @@
+
+
+ {% macro trie_leaf(index, object, return_macro, lowercase_data) %}
+-{% set name, value = object.items()[0] %}
++{% set name, value = (object.items()|list)[0] %}
+ {% if name|length %}
+ if (
+ {%- for c in name -%}
+@@ -45,7 +45,7 @@ return {{ return_macro(value) }};
+
+
+ {% macro trie_switch(trie, index, return_macro, lowercase_data) %}
+-{% if trie|length == 1 and trie.values()[0] is string %}
++{% if trie|length == 1 and (trie.values()|list)[0] is string %}
+ {{ trie_leaf(index, trie, return_macro, lowercase_data) -}}
+ {% else %}
+ {% if lowercase_data %}
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl
+index cb05c6c43157..bd5566b03e7e 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl
++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl
+@@ -24,12 +24,12 @@ namespace {{cpp_namespace}} {
+ {{symbol_export}}extern const WTF::AtomicString& {{namespace_prefix}}NamespaceURI;
+
+ // Tags
+-{% for tag in tags|sort %}
++{% for tag in tags|sort(attribute='name') %}
+ {{symbol_export}}extern const blink::{{namespace}}QualifiedName& {{tag|symbol}}Tag;
+ {% endfor %}
+
+ // Attributes
+-{% for attr in attrs|sort %}
++{% for attr in attrs|sort(attribute='name') %}
+ {{symbol_export}}extern const blink::QualifiedName& {{attr|symbol}}Attr;
+ {% endfor %}
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py b/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py
+index 5e3734d78336..e3d46bd194f2 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py
+@@ -201,6 +201,10 @@ def _compute_python_dependencies(root_dir=None):
+
+ paths = set()
+ for path in module_paths:
++ # Builtin/namespaced modules may return None for the file path.
++ if not path:
++ continue
++
+ path = os.path.abspath(path)
+
+ if not path.startswith(root_dir):
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn
+index cd488e88b60f..ea1dc3d9a793 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn
+@@ -2,6 +2,8 @@
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+
++import("//build/config/python.gni")
++
+ import("//third_party/blink/public/public_features.gni")
+ import("./all_devtools_files.gni")
+ import("./all_devtools_modules.gni")
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py
+index d6666e8b74fa..0f7a661e6325 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py
+@@ -45,7 +45,8 @@ def rollup(input_path, output_path, filename, max_size, rollup_plugin):
+ ['--format', 'iife', '-n', 'InspectorOverlay'] + ['--input', target] +
+ ['--plugin', rollup_plugin],
+ stdout=subprocess.PIPE,
+- stderr=subprocess.PIPE)
++ stderr=subprocess.PIPE,
++ text=True)
+ out, error = rollup_process.communicate()
+ if not out:
+ raise Exception("rollup failed: " + error)
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py
+index fa8e73d34af2..7d0b84b21717 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py
+@@ -10,7 +10,7 @@ Builds applications in release mode:
+ and the application loader into a single script.
+ """
+
+-from cStringIO import StringIO
++from io import StringIO
+ from os import path
+ from os.path import join
+ import copy
+@@ -145,8 +145,7 @@ class ReleaseBuilder(object):
+ resource_content = read_file(path.join(self.application_dir, resource_name))
+ if not (resource_name.endswith('.html')
+ or resource_name.endswith('md')):
+- resource_content += resource_source_url(resource_name).encode(
+- 'utf-8')
++ resource_content += resource_source_url(resource_name)
+ resource_content = resource_content.replace('\\', '\\\\')
+ resource_content = resource_content.replace('\n', '\\n')
+ resource_content = resource_content.replace('"', '\\"')
+@@ -173,7 +172,9 @@ class ReleaseBuilder(object):
+ def _concatenate_application_script(self, output):
+ output.write('Root.allDescriptors.push(...%s);' % self._release_module_descriptors())
+ if self.descriptors.extends:
+- output.write('Root.applicationDescriptor.modules.push(...%s);' % json.dumps(self.descriptors.application.values()))
++ output.write(
++ 'Root.applicationDescriptor.modules.push(...%s);' %
++ json.dumps(list(self.descriptors.application.values())))
+ else:
+ output.write('Root.applicationDescriptor = %s;' % self.descriptors.application_json())
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py
+index be510c48d76c..c6a59c902982 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py
+@@ -123,7 +123,7 @@ def main(argv):
+
+ try:
+ os.makedirs(path.join(output_directory, 'Images'))
+- except OSError, e:
++ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise e
+
+@@ -147,7 +147,7 @@ def main(argv):
+ shutil.copy(path.join(dirname, filename), path.join(output_directory, 'Images'))
+ add_file_to_grd(doc, path.join('Images', filename))
+
+- with open(parsed_args.output_filename, 'w') as output_file:
++ with open(parsed_args.output_filename, 'wb') as output_file:
+ output_file.write(doc.toxml(encoding='UTF-8'))
+
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py
+index 0ba695d3810c..bb1da2f9f8da 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py
+@@ -7,6 +7,8 @@
+ Utilities for the modular DevTools build.
+ """
+
++from __future__ import print_function
++
+ import collections
+ from os import path
+ import os
+@@ -40,7 +42,7 @@ def load_and_parse_json(filename):
+ try:
+ return json.loads(read_file(filename))
+ except:
+- print 'ERROR: Failed to parse %s' % filename
++ print('ERROR: Failed to parse %s' % filename)
+ raise
+
+ class Descriptors:
+@@ -57,7 +59,7 @@ class Descriptors:
+
+ def application_json(self):
+ result = dict()
+- result['modules'] = self.application.values()
++ result['modules'] = list(self.application.values())
+ return json.dumps(result)
+
+ def all_compiled_files(self):
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py b/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py
+index 0adc3d4dbcbb..b14f85ff148c 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py
++++ b/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py
+@@ -10,7 +10,7 @@
+ """
+ import operator
+ import re
+-from collections import Mapping
++from collections.abc import Mapping
+ from jinja2.runtime import Undefined
+ from jinja2._compat import text_type, string_types, integer_types
+ import decimal
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py b/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py
+index f9f61d90a561..44e46fae8cca 100755
+--- a/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py
++++ b/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py
+@@ -48,9 +48,10 @@ def ReadFilteredData(path):
+ data = ukm_model.UKM_XML_TYPE.Parse(ukm_file.read())
+ event_tag = ukm_model._EVENT_TYPE.tag
+ metric_tag = ukm_model._METRIC_TYPE.tag
+- data[event_tag] = filter(ukm_model.IsNotObsolete, data[event_tag])
++ data[event_tag] = list(filter(ukm_model.IsNotObsolete, data[event_tag]))
+ for event in data[event_tag]:
+- event[metric_tag] = filter(ukm_model.IsNotObsolete, event[metric_tag])
++ event[metric_tag] = list(
++ filter(ukm_model.IsNotObsolete, event[metric_tag]))
+ return data
+
+
+diff --git a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py
+index 8d800636c979..04fa18e93dfd 100755
+--- a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py
++++ b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py
+@@ -45,12 +45,15 @@ Example Output: ./ui/ozone/generate_constructor_list.py \
+ } // namespace ui
+ """
+
++try:
++ from StringIO import StringIO # for Python 2
++except ImportError:
++ from io import StringIO # for Python 3
+ import optparse
+ import os
+ import collections
+ import re
+ import sys
+-import string
+
+
+ def GetTypedefName(typename):
+@@ -68,7 +71,7 @@ def GetConstructorName(typename, platform):
+ This is just "Create" + typename + platform.
+ """
+
+- return 'Create' + typename + string.capitalize(platform)
++ return 'Create' + typename + platform.capitalize()
+
+
+ def GenerateConstructorList(out, namespace, export, typenames, platforms,
+@@ -163,12 +166,14 @@ def main(argv):
+ sys.exit(1)
+
+ # Write to standard output or file specified by --output_cc.
+- out_cc = sys.stdout
++ out_cc = getattr(sys.stdout, 'buffer', sys.stdout)
+ if options.output_cc:
+ out_cc = open(options.output_cc, 'wb')
+
+- GenerateConstructorList(out_cc, options.namespace, options.export,
++ out_cc_str = StringIO()
++ GenerateConstructorList(out_cc_str, options.namespace, options.export,
+ typenames, platforms, includes, usings)
++ out_cc.write(out_cc_str.getvalue().encode('utf-8'))
+
+ if options.output_cc:
+ out_cc.close()
+diff --git a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py
+index d47c398259b9..2702b68b9bdd 100755
+--- a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py
++++ b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py
+@@ -49,12 +49,15 @@ Example Output: ./generate_ozone_platform_list.py --default wayland dri wayland
+
+ """
+
++try:
++ from StringIO import StringIO # for Python 2
++except ImportError:
++ from io import StringIO # for Python 3
+ import optparse
+ import os
+ import collections
+ import re
+ import sys
+-import string
+
+
+ def GetConstantName(name):
+@@ -63,7 +66,7 @@ def GetConstantName(name):
+ We just capitalize the platform name and prepend "CreateOzonePlatform".
+ """
+
+- return 'kPlatform' + string.capitalize(name)
++ return 'kPlatform' + name.capitalize()
+
+
+ def GeneratePlatformListText(out, platforms):
+@@ -149,9 +152,9 @@ def main(argv):
+ platforms.insert(0, options.default)
+
+ # Write to standard output or file specified by --output_{cc,h}.
+- out_cc = sys.stdout
+- out_h = sys.stdout
+- out_txt = sys.stdout
++ out_cc = getattr(sys.stdout, 'buffer', sys.stdout)
++ out_h = getattr(sys.stdout, 'buffer', sys.stdout)
++ out_txt = getattr(sys.stdout, 'buffer', sys.stdout)
+ if options.output_cc:
+ out_cc = open(options.output_cc, 'wb')
+ if options.output_h:
+@@ -159,9 +162,16 @@ def main(argv):
+ if options.output_txt:
+ out_txt = open(options.output_txt, 'wb')
+
+- GeneratePlatformListText(out_txt, platforms)
+- GeneratePlatformListHeader(out_h, platforms)
+- GeneratePlatformListSource(out_cc, platforms)
++ out_txt_str = StringIO()
++ out_h_str = StringIO()
++ out_cc_str = StringIO()
++
++ GeneratePlatformListText(out_txt_str, platforms)
++ out_txt.write(out_txt_str.getvalue().encode('utf-8'))
++ GeneratePlatformListHeader(out_h_str, platforms)
++ out_h.write(out_h_str.getvalue().encode('utf-8'))
++ GeneratePlatformListSource(out_cc_str, platforms)
++ out_cc.write(out_cc_str.getvalue().encode('utf-8'))
+
+ if options.output_cc:
+ out_cc.close()
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0202-fix-build-with-Python-3.11.patch b/patches/qt-everywhere-opensource-src-5.15.12/0202-fix-build-with-Python-3.11.patch
new file mode 100644
index 000000000..0cc64cb6a
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0202-fix-build-with-Python-3.11.patch
@@ -0,0 +1,61 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 17 Nov 2023 15:13:50 +0100
+Subject: [PATCH] fix build with Python 3.11
+
+Imported from Debian.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ qtwebengine/src/3rdparty/chromium/tools/grit/grit/util.py | 2 +-
+ qtwebengine/src/3rdparty/chromium/tools/metrics/structured/model.py | 2 +-
+ qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/ukm_model.py | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/grit/grit/util.py b/qtwebengine/src/3rdparty/chromium/tools/grit/grit/util.py
+index 528d766ad6b3..6e8cdb0ebfa6 100644
+--- a/qtwebengine/src/3rdparty/chromium/tools/grit/grit/util.py
++++ b/qtwebengine/src/3rdparty/chromium/tools/grit/grit/util.py
+@@ -211,7 +211,7 @@ def ReadFile(filename, encoding):
+ mode = 'rb'
+ encoding = None
+ else:
+- mode = 'rU'
++ mode = 'r'
+
+ with io.open(abs(filename), mode, encoding=encoding) as f:
+ return f.read()
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/metrics/structured/model.py b/qtwebengine/src/3rdparty/chromium/tools/metrics/structured/model.py
+index 2d90bf20c677..befea2eda7ce 100644
+--- a/qtwebengine/src/3rdparty/chromium/tools/metrics/structured/model.py
++++ b/qtwebengine/src/3rdparty/chromium/tools/metrics/structured/model.py
+@@ -26,7 +26,7 @@ _METRIC_TYPE = models.ObjectNodeType(
+ 'metric',
+ attributes=[
+ ('name', unicode, r'^[A-Za-z0-9_.]+$'),
+- ('kind', unicode, r'^(?i)(|hashed-string|int)$'),
++ ('kind', unicode, r'(?i)^(|hashed-string|int)$'),
+ ],
+ alphabetization=[
+ (_OBSOLETE_TYPE.tag, lambda _: 1),
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/ukm_model.py b/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/ukm_model.py
+index ec24dd57360f..57decab3ccce 100644
+--- a/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/ukm_model.py
++++ b/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/ukm_model.py
+@@ -42,7 +42,7 @@ _INDEX_TYPE = models.ObjectNodeType(
+ _STATISTICS_TYPE = models.ObjectNodeType(
+ 'statistics',
+ attributes=[
+- ('export', str, r'^(?i)(|true|false)$'),
++ ('export', str, r'(?i)^(|true|false)$'),
+ ],
+ children=[
+ models.ChildType(_QUANTILES_TYPE.tag, _QUANTILES_TYPE, multiple=False),
+@@ -94,7 +94,7 @@ _EVENT_TYPE = models.ObjectNodeType(
+ 'event',
+ attributes=[
+ ('name', str, r'^[A-Za-z0-9.]+$'),
+- ('singular', str, r'^(?i)(|true|false)$'),
++ ('singular', str, r'(?i)^(|true|false)$'),
+ ],
+ alphabetization=[
+ (_OBSOLETE_TYPE.tag, _KEEP_ORDER),
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0203-remove-dependencies-on-third_party-catapult.patch b/patches/qt-everywhere-opensource-src-5.15.12/0203-remove-dependencies-on-third_party-catapult.patch
new file mode 100644
index 000000000..2d6e6992b
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0203-remove-dependencies-on-third_party-catapult.patch
@@ -0,0 +1,9973 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 17 Nov 2023 15:35:49 +0100
+Subject: [PATCH] remove dependencies on third_party catapult
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ qtwebengine/src/3rdparty/chromium/BUILD.gn | 11 -
+ .../src/3rdparty/chromium/chrome/chrome_paks.gni | 2 -
+ .../chrome/common/extensions/docs/server2/BUILD.gn | 2 -
+ .../src/3rdparty/chromium/chrome/test/BUILD.gn | 6 -
+ .../src/3rdparty/chromium/content/browser/BUILD.gn | 1 -
+ .../chromium/content/browser/tracing/tracing_ui.cc | 3 -
+ .../src/3rdparty/chromium/content/shell/BUILD.gn | 2 -
+ .../src/3rdparty/chromium/fuchsia/engine/BUILD.gn | 2 -
+ .../src/3rdparty/chromium/headless/BUILD.gn | 2 -
+ .../3rdparty/chromium/mojo/public/tools/BUILD.gn | 1 -
+ qtwebengine/src/3rdparty/chromium/testing/BUILD.gn | 1 -
+ .../breakpad/breakpad/autotools/config.sub | 2678 ++++++++++----------
+ .../breakpad/breakpad/autotools/ltmain.sh | 2 +-
+ .../chromium/third_party/icu/source/config.sub | 2666 +++++++++----------
+ .../third_party/nasm/autoconf/helpers/config.sub | 729 +++---
+ .../chromium/third_party/sqlite/src/config.sub | 689 ++---
+ .../chromium/third_party/sqlite/src/configure | 18 +-
+ .../chromium/third_party/sqlite/src/ltmain.sh | 2 +-
+ .../chromium/third_party/webrtc/test/BUILD.gn | 5 -
+ .../3rdparty/chromium/tools/binary_size/BUILD.gn | 1 -
+ .../src/3rdparty/chromium/tools/grit/BUILD.gn | 1 -
+ .../chromium/tools/gritsettings/resource_ids.spec | 6 -
+ .../src/3rdparty/chromium/tools/metrics/BUILD.gn | 1 -
+ .../tools/perf/chrome_telemetry_build/BUILD.gn | 3 -
+ .../perf/core/perfetto_binary_roller/BUILD.gn | 1 -
+ .../src/3rdparty/chromium/tools/polymer/BUILD.gn | 1 -
+ .../src/3rdparty/chromium/v8/tools/BUILD.gn | 4 -
+ .../src/3rdparty/chromium/weblayer/shell/BUILD.gn | 2 -
+ qtwebengine/src/core/qtwebengine_resources.gni | 2 -
+ 29 files changed, 3579 insertions(+), 3265 deletions(-)
+
+diff --git a/qtwebengine/src/3rdparty/chromium/BUILD.gn b/qtwebengine/src/3rdparty/chromium/BUILD.gn
+index 8d9657d545c4..59e9447f4560 100644
+--- a/qtwebengine/src/3rdparty/chromium/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/BUILD.gn
+@@ -239,7 +239,6 @@ group("gn_all") {
+ "//media/capture:capture_unittests",
+ "//media/cast:cast_unittests",
+ "//third_party/angle/src/tests:angle_white_box_tests",
+- "//third_party/catapult/telemetry:bitmaptools($host_toolchain)",
+ ]
+ } else if (is_ios && !use_qt) {
+ deps += [
+@@ -354,7 +353,6 @@ group("gn_all") {
+ "//net/android:net_junit_tests",
+ "//services:services_junit_tests",
+ "//testing/android/junit:junit_unit_tests",
+- "//third_party/catapult/devil",
+ "//third_party/smhasher:murmurhash3",
+ "//tools/android:android_tools",
+ "//tools/android:memconsumer",
+@@ -959,7 +957,6 @@ if (is_chromeos) {
+ "//third_party/dawn/src/tests:dawn_unittests",
+
+ # Blocked on https://github.com/catapult-project/catapult/issues/2297
+- #"//third_party/catapult/telemetry:bitmaptools",
+ "//tools/perf/clear_system_cache",
+ "//ui/ozone/gl:ozone_gl_unittests",
+ ]
+@@ -1037,7 +1034,6 @@ if (!is_ios && !use_qt) {
+ data_deps = [
+ "//chrome:chrome",
+ "//chrome/test/chromedriver",
+- "//third_party/catapult/third_party/typ",
+ ]
+ if (is_win) {
+ data_deps += [ "//build/win:copy_cdb_to_output" ]
+@@ -1084,7 +1080,6 @@ if (!is_ios && !use_qt) {
+ "//third_party/blink/public:blink_devtools_inspector_resources",
+ "//third_party/blink/public/mojom:mojom_platform_js_data_deps",
+ "//third_party/blink/renderer/core/html:js_files_for_form_controls_web_tests",
+- "//third_party/catapult/third_party/typ",
+ "//third_party/mesa_headers",
+ "//tools/imagediff",
+ ]
+@@ -1152,7 +1147,6 @@ if (!is_ios && !use_qt) {
+
+ if (is_android) {
+ data += [
+- "//third_party/catapult/",
+ "//build/android/",
+ ]
+ }
+@@ -1259,11 +1253,6 @@ if (!is_ios && !use_qt) {
+ "//third_party/blink/web_tests/StaleTestExpectations",
+ "//third_party/blink/web_tests/TestExpectations",
+ "//third_party/blink/web_tests/VirtualTestSuites",
+- "//third_party/catapult/common/py_utils/",
+- "//third_party/catapult/devil/",
+- "//third_party/catapult/dependency_manager/",
+- "//third_party/catapult/third_party/zipfile/",
+- "//third_party/catapult/third_party/typ/",
+ "//third_party/depot_tools/pylint",
+ "//third_party/depot_tools/pylint-1.5",
+ "//third_party/depot_tools/pylint_main.py",
+diff --git a/qtwebengine/src/3rdparty/chromium/chrome/chrome_paks.gni b/qtwebengine/src/3rdparty/chromium/chrome/chrome_paks.gni
+index 9323a774a565..0362b6501aaf 100644
+--- a/qtwebengine/src/3rdparty/chromium/chrome/chrome_paks.gni
++++ b/qtwebengine/src/3rdparty/chromium/chrome/chrome_paks.gni
+@@ -94,7 +94,6 @@ template("chrome_extra_paks") {
+ "$root_gen_dir/chrome/common_resources.pak",
+ "$root_gen_dir/components/autofill/core/browser/autofill_address_rewriter_resources.pak",
+ "$root_gen_dir/components/components_resources.pak",
+- "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
+ "$root_gen_dir/content/content_resources.pak",
+ "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
+ "$root_gen_dir/net/net_resources.pak",
+@@ -110,7 +109,6 @@ template("chrome_extra_paks") {
+ "//components/autofill/core/browser:autofill_address_rewriter_resources",
+ "//components/resources",
+ "//content:content_resources",
+- "//content/browser/tracing:resources",
+ "//mojo/public/js:resources",
+ "//net:net_resources",
+ "//skia:skia_resources",
+diff --git a/qtwebengine/src/3rdparty/chromium/chrome/common/extensions/docs/server2/BUILD.gn b/qtwebengine/src/3rdparty/chromium/chrome/common/extensions/docs/server2/BUILD.gn
+index 9da6184763ff..2f2203ab590a 100644
+--- a/qtwebengine/src/3rdparty/chromium/chrome/common/extensions/docs/server2/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/chrome/common/extensions/docs/server2/BUILD.gn
+@@ -38,6 +38,4 @@ group("extension_docserver_python_unittests") {
+ "//tools/json_comment_eater/json_comment_eater.py",
+ "//tools/json_schema_compiler/",
+ ]
+-
+- data_deps = [ "//third_party/catapult/third_party/typ" ]
+ }
+diff --git a/qtwebengine/src/3rdparty/chromium/chrome/test/BUILD.gn b/qtwebengine/src/3rdparty/chromium/chrome/test/BUILD.gn
+index 1a369fa56d2e..eb5bc9676fb9 100644
+--- a/qtwebengine/src/3rdparty/chromium/chrome/test/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/chrome/test/BUILD.gn
+@@ -7103,8 +7103,6 @@ if (!is_fuchsia && !is_android) {
+ "//chrome/test/data/password/captured_sites/",
+ "//chrome/test/data/web_page_replay_go_helper_scripts/automation_helper.js",
+ "//components/test/data/autofill/web_page_replay_support_files/",
+- "//third_party/catapult/telemetry/telemetry/bin/",
+- "//third_party/catapult/web_page_replay_go/deterministic.js",
+ ]
+
+ if (is_linux || is_chromeos || is_win) {
+@@ -7141,7 +7139,6 @@ if (!is_fuchsia && !is_android) {
+
+ # TODO(uwyiming@chromium.org) create a gn target for Web Page Replay Go (WPR Go) and only WPR Go.
+ # So that test targets requiring WPR Go does not pull down the whole telemetry tool chain.
+- "//third_party/catapult:telemetry_chrome_test_support",
+ "//third_party/hunspell",
+ "//third_party/icu",
+ "//third_party/libpng",
+@@ -7171,7 +7168,6 @@ if (!is_fuchsia && !is_android) {
+ deps = [ "//tools/perf/chrome_telemetry_build:telemetry_chrome_test" ]
+
+ data = [
+- "//third_party/catapult/telemetry/telemetry/internal/bin/",
+ "//tools/perf/run_telemetry_tests",
+
+ # For isolate contract.
+@@ -7189,7 +7185,6 @@ if (!is_fuchsia && !is_android) {
+ group("telemetry_gpu_unittests") {
+ testonly = true
+ deps = [
+- "//third_party/catapult:telemetry_chrome_test_support",
+ "//tools/metrics:metrics_python_tests",
+ ]
+ data = [
+@@ -7313,7 +7308,6 @@ if (is_mac || is_win || is_android) {
+ "//testing/scripts",
+ "//testing/test_env.py",
+ "//testing/xvfb.py",
+- "//third_party/catapult",
+ "//tools",
+ ]
+ }
+diff --git a/qtwebengine/src/3rdparty/chromium/content/browser/BUILD.gn b/qtwebengine/src/3rdparty/chromium/content/browser/BUILD.gn
+index 1466f33d462d..51039e0da19e 100644
+--- a/qtwebengine/src/3rdparty/chromium/content/browser/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/content/browser/BUILD.gn
+@@ -2169,7 +2169,6 @@ jumbo_static_library("browser") {
+ if (!is_android) {
+ deps += [
+ "//components/vector_icons",
+- "//content/browser/tracing:resources",
+ ]
+ }
+
+diff --git a/qtwebengine/src/3rdparty/chromium/content/browser/tracing/tracing_ui.cc b/qtwebengine/src/3rdparty/chromium/content/browser/tracing/tracing_ui.cc
+index 2bffb5eb3b02..8965922dfba3 100644
+--- a/qtwebengine/src/3rdparty/chromium/content/browser/tracing/tracing_ui.cc
++++ b/qtwebengine/src/3rdparty/chromium/content/browser/tracing/tracing_ui.cc
+@@ -27,7 +27,6 @@
+ #include "base/strings/stringprintf.h"
+ #include "base/trace_event/trace_event.h"
+ #include "base/values.h"
+-#include "content/browser/tracing/grit/tracing_resources.h"
+ #include "content/browser/tracing/tracing_controller_impl.h"
+ #include "content/public/browser/browser_context.h"
+ #include "content/public/browser/browser_thread.h"
+@@ -242,8 +241,6 @@ TracingUI::TracingUI(WebUI* web_ui)
+ WebUIDataSource* source = WebUIDataSource::Create(kChromeUITracingHost);
+ source->DisableTrustedTypesCSP();
+ source->UseStringsJs();
+- source->SetDefaultResource(IDR_TRACING_HTML);
+- source->AddResourcePath("tracing.js", IDR_TRACING_JS);
+ source->SetRequestFilter(base::BindRepeating(OnShouldHandleRequest),
+ base::BindRepeating(OnTracingRequest));
+ WebUIDataSource::Add(browser_context, source);
+diff --git a/qtwebengine/src/3rdparty/chromium/content/shell/BUILD.gn b/qtwebengine/src/3rdparty/chromium/content/shell/BUILD.gn
+index 56c0e8b48e38..6e4ffbe962dc 100644
+--- a/qtwebengine/src/3rdparty/chromium/content/shell/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/content/shell/BUILD.gn
+@@ -390,7 +390,6 @@ repack("pak") {
+ sources = [
+ "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
+ "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
+- "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
+ "$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
+ "$root_gen_dir/content/content_resources.pak",
+ "$root_gen_dir/content/dev_ui_content_resources.pak",
+@@ -413,7 +412,6 @@ repack("pak") {
+ "//content:dev_ui_content_resources",
+ "//content/app/resources",
+ "//content/browser/resources/media:media_internals_resources",
+- "//content/browser/tracing:resources",
+ "//content/browser/webrtc/resources",
+ "//mojo/public/js:resources",
+ "//net:net_resources",
+diff --git a/qtwebengine/src/3rdparty/chromium/fuchsia/engine/BUILD.gn b/qtwebengine/src/3rdparty/chromium/fuchsia/engine/BUILD.gn
+index a502b7fc2732..39df2a7028ad 100644
+--- a/qtwebengine/src/3rdparty/chromium/fuchsia/engine/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/fuchsia/engine/BUILD.gn
+@@ -43,7 +43,6 @@ repack("web_engine_pak") {
+ "$root_gen_dir/components/components_resources.pak",
+ "$root_gen_dir/components/strings/components_strings_en-US.pak",
+ "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
+- "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
+ "$root_gen_dir/content/content_resources.pak",
+ "$root_gen_dir/content/dev_ui_content_resources.pak",
+ "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
+@@ -66,7 +65,6 @@ repack("web_engine_pak") {
+ "//content:content_resources",
+ "//content:dev_ui_content_resources",
+ "//content/app/resources",
+- "//content/browser/tracing:resources",
+ "//gpu/command_buffer/service",
+ "//mojo/public/js:resources",
+ "//net:net_resources",
+diff --git a/qtwebengine/src/3rdparty/chromium/headless/BUILD.gn b/qtwebengine/src/3rdparty/chromium/headless/BUILD.gn
+index d2ab76aed326..15e4b78009d9 100644
+--- a/qtwebengine/src/3rdparty/chromium/headless/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/headless/BUILD.gn
+@@ -37,7 +37,6 @@ repack("pak") {
+ "$root_gen_dir/components/components_resources.pak",
+ "$root_gen_dir/components/strings/components_strings_en-US.pak",
+ "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
+- "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
+ "$root_gen_dir/content/content_resources.pak",
+ "$root_gen_dir/content/dev_ui_content_resources.pak",
+ "$root_gen_dir/headless/headless_lib_resources.pak",
+@@ -65,7 +64,6 @@ repack("pak") {
+ "//content:content_resources",
+ "//content:dev_ui_content_resources",
+ "//content/app/resources",
+- "//content/browser/tracing:resources",
+ "//mojo/public/js:resources",
+ "//net:net_resources",
+ "//third_party/blink/public:resources",
+diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/BUILD.gn b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/BUILD.gn
+index 4c68350b3996..1cc01256f002 100644
+--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/BUILD.gn
+@@ -14,5 +14,4 @@ group("mojo_python_unittests") {
+ "//testing/xvfb.py",
+ ]
+ deps = [ "//mojo/public/tools/mojom/mojom:tests" ]
+- data_deps = [ "//third_party/catapult/third_party/typ/" ]
+ }
+diff --git a/qtwebengine/src/3rdparty/chromium/testing/BUILD.gn b/qtwebengine/src/3rdparty/chromium/testing/BUILD.gn
+index 56ebf8d46c9f..7d51bc0ccf74 100644
+--- a/qtwebengine/src/3rdparty/chromium/testing/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/testing/BUILD.gn
+@@ -27,7 +27,6 @@ group("run_perf_test") {
+
+ data_deps = [
+ ":test_scripts_shared",
+- "//third_party/catapult/tracing:convert_chart_json",
+ ]
+
+ if (is_android) {
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/autotools/config.sub b/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/autotools/config.sub
+index 87abeab6cdfc..de4259e40479 100755
+--- a/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/autotools/config.sub
++++ b/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/autotools/config.sub
+@@ -1,12 +1,14 @@
+ #! /bin/sh
+ # Configuration validation subroutine script.
+-# Copyright 1992-2017 Free Software Foundation, Inc.
++# Copyright 1992-2023 Free Software Foundation, Inc.
+
+-timestamp='2017-02-07'
++# shellcheck disable=SC2006,SC2268 # see below for rationale
++
++timestamp='2023-01-21'
+
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 3 of the License, or
++# the Free Software Foundation, either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful, but
+@@ -15,7 +17,7 @@ timestamp='2017-02-07'
+ # General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program; if not, see <http://www.gnu.org/licenses/>.
++# along with this program; if not, see <https://www.gnu.org/licenses/>.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+@@ -33,7 +35,7 @@ timestamp='2017-02-07'
+ # Otherwise, we print the canonical config type on stdout and succeed.
+
+ # You can get the latest version of this script from:
+-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
++# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+
+ # This file is supposed to be the same for all GNU packages
+ # and recognize all the CPU types, system types and aliases
+@@ -50,6 +52,13 @@ timestamp='2017-02-07'
+ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+ # It is wrong to echo any other type of specification.
+
++# The "shellcheck disable" line above the timestamp inhibits complaints
++# about features and limitations of the classic Bourne shell that were
++# superseded or lifted in POSIX. However, this script identifies a wide
++# variety of pre-POSIX systems that do not have POSIX shells at all, and
++# even some reasonably current systems (Solaris 10 as case-in-point) still
++# have a pre-POSIX /bin/sh.
++
+ me=`echo "$0" | sed -e 's,.*/,,'`
+
+ usage="\
+@@ -57,7 +66,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
+
+ Canonicalize a configuration name.
+
+-Operation modes:
++Options:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+@@ -67,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
+ version="\
+ GNU config.sub ($timestamp)
+
+-Copyright 1992-2017 Free Software Foundation, Inc.
++Copyright 1992-2023 Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -89,12 +98,12 @@ while test $# -gt 0 ; do
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+- echo "$me: invalid option $1$help"
++ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+- echo $1
++ echo "$1"
+ exit ;;
+
+ * )
+@@ -110,1247 +119,1186 @@ case $# in
+ exit 1;;
+ esac
+
+-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+-# Here we must recognize all the valid KERNEL-OS combinations.
+-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+-case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+- kopensolaris*-gnu* | cloudabi*-eabi* | \
+- storm-chaos* | os2-emx* | rtmk-nova*)
+- os=-$maybe_os
+- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+- ;;
+- android-linux)
+- os=-linux-android
+- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+- ;;
+- *)
+- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+- if [ $basic_machine != $1 ]
+- then os=`echo $1 | sed 's/.*-/-/'`
+- else os=; fi
+- ;;
+-esac
++# Split fields of configuration type
++# shellcheck disable=SC2162
++saved_IFS=$IFS
++IFS="-" read field1 field2 field3 field4 <<EOF
++$1
++EOF
++IFS=$saved_IFS
+
+-### Let's recognize common machines as not being operating systems so
+-### that things like config.sub decstation-3100 work. We also
+-### recognize some manufacturers as not being operating systems, so we
+-### can provide default operating systems below.
+-case $os in
+- -sun*os*)
+- # Prevent following clause from handling this invalid input.
+- ;;
+- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+- -apple | -axis | -knuth | -cray | -microblaze*)
+- os=
+- basic_machine=$1
+- ;;
+- -bluegene*)
+- os=-cnk
+- ;;
+- -sim | -cisco | -oki | -wec | -winbond)
+- os=
+- basic_machine=$1
+- ;;
+- -scout)
+- ;;
+- -wrs)
+- os=-vxworks
+- basic_machine=$1
+- ;;
+- -chorusos*)
+- os=-chorusos
+- basic_machine=$1
+- ;;
+- -chorusrdb)
+- os=-chorusrdb
+- basic_machine=$1
+- ;;
+- -hiux*)
+- os=-hiuxwe2
+- ;;
+- -sco6)
+- os=-sco5v6
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco5)
+- os=-sco3.2v5
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco4)
+- os=-sco3.2v4
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco3.2.[4-9]*)
+- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco3.2v[4-9]*)
+- # Don't forget version if it is 3.2v4 or newer.
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco5v6*)
+- # Don't forget version if it is 3.2v4 or newer.
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco*)
+- os=-sco3.2v2
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -udk*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -isc)
+- os=-isc2.2
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -clix*)
+- basic_machine=clipper-intergraph
+- ;;
+- -isc*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -lynx*178)
+- os=-lynxos178
+- ;;
+- -lynx*5)
+- os=-lynxos5
+- ;;
+- -lynx*)
+- os=-lynxos
++# Separate into logical components for further validation
++case $1 in
++ *-*-*-*-*)
++ echo Invalid configuration \`"$1"\': more than four components >&2
++ exit 1
+ ;;
+- -ptx*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
++ *-*-*-*)
++ basic_machine=$field1-$field2
++ basic_os=$field3-$field4
+ ;;
+- -windowsnt*)
+- os=`echo $os | sed -e 's/windowsnt/winnt/'`
++ *-*-*)
++ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
++ # parts
++ maybe_os=$field2-$field3
++ case $maybe_os in
++ nto-qnx* | linux-* | uclinux-uclibc* \
++ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
++ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
++ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*)
++ basic_machine=$field1
++ basic_os=$maybe_os
++ ;;
++ android-linux)
++ basic_machine=$field1-unknown
++ basic_os=linux-android
++ ;;
++ *)
++ basic_machine=$field1-$field2
++ basic_os=$field3
++ ;;
++ esac
+ ;;
+- -psos*)
+- os=-psos
++ *-*)
++ # A lone config we happen to match not fitting any pattern
++ case $field1-$field2 in
++ decstation-3100)
++ basic_machine=mips-dec
++ basic_os=
++ ;;
++ *-*)
++ # Second component is usually, but not always the OS
++ case $field2 in
++ # Prevent following clause from handling this valid os
++ sun*os*)
++ basic_machine=$field1
++ basic_os=$field2
++ ;;
++ zephyr*)
++ basic_machine=$field1-unknown
++ basic_os=$field2
++ ;;
++ # Manufacturers
++ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
++ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
++ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
++ | convergent* | ncr* | news | 32* | 3600* | 3100* \
++ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
++ | ultra | tti* | harris | dolphin | highlevel | gould \
++ | cbm | ns | masscomp | apple | axis | knuth | cray \
++ | microblaze* | sim | cisco \
++ | oki | wec | wrs | winbond)
++ basic_machine=$field1-$field2
++ basic_os=
++ ;;
++ *)
++ basic_machine=$field1
++ basic_os=$field2
++ ;;
++ esac
++ ;;
++ esac
+ ;;
+- -mint | -mint[0-9]*)
+- basic_machine=m68k-atari
+- os=-mint
++ *)
++ # Convert single-component short-hands not valid as part of
++ # multi-component configurations.
++ case $field1 in
++ 386bsd)
++ basic_machine=i386-pc
++ basic_os=bsd
++ ;;
++ a29khif)
++ basic_machine=a29k-amd
++ basic_os=udi
++ ;;
++ adobe68k)
++ basic_machine=m68010-adobe
++ basic_os=scout
++ ;;
++ alliant)
++ basic_machine=fx80-alliant
++ basic_os=
++ ;;
++ altos | altos3068)
++ basic_machine=m68k-altos
++ basic_os=
++ ;;
++ am29k)
++ basic_machine=a29k-none
++ basic_os=bsd
++ ;;
++ amdahl)
++ basic_machine=580-amdahl
++ basic_os=sysv
++ ;;
++ amiga)
++ basic_machine=m68k-unknown
++ basic_os=
++ ;;
++ amigaos | amigados)
++ basic_machine=m68k-unknown
++ basic_os=amigaos
++ ;;
++ amigaunix | amix)
++ basic_machine=m68k-unknown
++ basic_os=sysv4
++ ;;
++ apollo68)
++ basic_machine=m68k-apollo
++ basic_os=sysv
++ ;;
++ apollo68bsd)
++ basic_machine=m68k-apollo
++ basic_os=bsd
++ ;;
++ aros)
++ basic_machine=i386-pc
++ basic_os=aros
++ ;;
++ aux)
++ basic_machine=m68k-apple
++ basic_os=aux
++ ;;
++ balance)
++ basic_machine=ns32k-sequent
++ basic_os=dynix
++ ;;
++ blackfin)
++ basic_machine=bfin-unknown
++ basic_os=linux
++ ;;
++ cegcc)
++ basic_machine=arm-unknown
++ basic_os=cegcc
++ ;;
++ convex-c1)
++ basic_machine=c1-convex
++ basic_os=bsd
++ ;;
++ convex-c2)
++ basic_machine=c2-convex
++ basic_os=bsd
++ ;;
++ convex-c32)
++ basic_machine=c32-convex
++ basic_os=bsd
++ ;;
++ convex-c34)
++ basic_machine=c34-convex
++ basic_os=bsd
++ ;;
++ convex-c38)
++ basic_machine=c38-convex
++ basic_os=bsd
++ ;;
++ cray)
++ basic_machine=j90-cray
++ basic_os=unicos
++ ;;
++ crds | unos)
++ basic_machine=m68k-crds
++ basic_os=
++ ;;
++ da30)
++ basic_machine=m68k-da30
++ basic_os=
++ ;;
++ decstation | pmax | pmin | dec3100 | decstatn)
++ basic_machine=mips-dec
++ basic_os=
++ ;;
++ delta88)
++ basic_machine=m88k-motorola
++ basic_os=sysv3
++ ;;
++ dicos)
++ basic_machine=i686-pc
++ basic_os=dicos
++ ;;
++ djgpp)
++ basic_machine=i586-pc
++ basic_os=msdosdjgpp
++ ;;
++ ebmon29k)
++ basic_machine=a29k-amd
++ basic_os=ebmon
++ ;;
++ es1800 | OSE68k | ose68k | ose | OSE)
++ basic_machine=m68k-ericsson
++ basic_os=ose
++ ;;
++ gmicro)
++ basic_machine=tron-gmicro
++ basic_os=sysv
++ ;;
++ go32)
++ basic_machine=i386-pc
++ basic_os=go32
++ ;;
++ h8300hms)
++ basic_machine=h8300-hitachi
++ basic_os=hms
++ ;;
++ h8300xray)
++ basic_machine=h8300-hitachi
++ basic_os=xray
++ ;;
++ h8500hms)
++ basic_machine=h8500-hitachi
++ basic_os=hms
++ ;;
++ harris)
++ basic_machine=m88k-harris
++ basic_os=sysv3
++ ;;
++ hp300 | hp300hpux)
++ basic_machine=m68k-hp
++ basic_os=hpux
++ ;;
++ hp300bsd)
++ basic_machine=m68k-hp
++ basic_os=bsd
++ ;;
++ hppaosf)
++ basic_machine=hppa1.1-hp
++ basic_os=osf
++ ;;
++ hppro)
++ basic_machine=hppa1.1-hp
++ basic_os=proelf
++ ;;
++ i386mach)
++ basic_machine=i386-mach
++ basic_os=mach
++ ;;
++ isi68 | isi)
++ basic_machine=m68k-isi
++ basic_os=sysv
++ ;;
++ m68knommu)
++ basic_machine=m68k-unknown
++ basic_os=linux
++ ;;
++ magnum | m3230)
++ basic_machine=mips-mips
++ basic_os=sysv
++ ;;
++ merlin)
++ basic_machine=ns32k-utek
++ basic_os=sysv
++ ;;
++ mingw64)
++ basic_machine=x86_64-pc
++ basic_os=mingw64
++ ;;
++ mingw32)
++ basic_machine=i686-pc
++ basic_os=mingw32
++ ;;
++ mingw32ce)
++ basic_machine=arm-unknown
++ basic_os=mingw32ce
++ ;;
++ monitor)
++ basic_machine=m68k-rom68k
++ basic_os=coff
++ ;;
++ morphos)
++ basic_machine=powerpc-unknown
++ basic_os=morphos
++ ;;
++ moxiebox)
++ basic_machine=moxie-unknown
++ basic_os=moxiebox
++ ;;
++ msdos)
++ basic_machine=i386-pc
++ basic_os=msdos
++ ;;
++ msys)
++ basic_machine=i686-pc
++ basic_os=msys
++ ;;
++ mvs)
++ basic_machine=i370-ibm
++ basic_os=mvs
++ ;;
++ nacl)
++ basic_machine=le32-unknown
++ basic_os=nacl
++ ;;
++ ncr3000)
++ basic_machine=i486-ncr
++ basic_os=sysv4
++ ;;
++ netbsd386)
++ basic_machine=i386-pc
++ basic_os=netbsd
++ ;;
++ netwinder)
++ basic_machine=armv4l-rebel
++ basic_os=linux
++ ;;
++ news | news700 | news800 | news900)
++ basic_machine=m68k-sony
++ basic_os=newsos
++ ;;
++ news1000)
++ basic_machine=m68030-sony
++ basic_os=newsos
++ ;;
++ necv70)
++ basic_machine=v70-nec
++ basic_os=sysv
++ ;;
++ nh3000)
++ basic_machine=m68k-harris
++ basic_os=cxux
++ ;;
++ nh[45]000)
++ basic_machine=m88k-harris
++ basic_os=cxux
++ ;;
++ nindy960)
++ basic_machine=i960-intel
++ basic_os=nindy
++ ;;
++ mon960)
++ basic_machine=i960-intel
++ basic_os=mon960
++ ;;
++ nonstopux)
++ basic_machine=mips-compaq
++ basic_os=nonstopux
++ ;;
++ os400)
++ basic_machine=powerpc-ibm
++ basic_os=os400
++ ;;
++ OSE68000 | ose68000)
++ basic_machine=m68000-ericsson
++ basic_os=ose
++ ;;
++ os68k)
++ basic_machine=m68k-none
++ basic_os=os68k
++ ;;
++ paragon)
++ basic_machine=i860-intel
++ basic_os=osf
++ ;;
++ parisc)
++ basic_machine=hppa-unknown
++ basic_os=linux
++ ;;
++ psp)
++ basic_machine=mipsallegrexel-sony
++ basic_os=psp
++ ;;
++ pw32)
++ basic_machine=i586-unknown
++ basic_os=pw32
++ ;;
++ rdos | rdos64)
++ basic_machine=x86_64-pc
++ basic_os=rdos
++ ;;
++ rdos32)
++ basic_machine=i386-pc
++ basic_os=rdos
++ ;;
++ rom68k)
++ basic_machine=m68k-rom68k
++ basic_os=coff
++ ;;
++ sa29200)
++ basic_machine=a29k-amd
++ basic_os=udi
++ ;;
++ sei)
++ basic_machine=mips-sei
++ basic_os=seiux
++ ;;
++ sequent)
++ basic_machine=i386-sequent
++ basic_os=
++ ;;
++ sps7)
++ basic_machine=m68k-bull
++ basic_os=sysv2
++ ;;
++ st2000)
++ basic_machine=m68k-tandem
++ basic_os=
++ ;;
++ stratus)
++ basic_machine=i860-stratus
++ basic_os=sysv4
++ ;;
++ sun2)
++ basic_machine=m68000-sun
++ basic_os=
++ ;;
++ sun2os3)
++ basic_machine=m68000-sun
++ basic_os=sunos3
++ ;;
++ sun2os4)
++ basic_machine=m68000-sun
++ basic_os=sunos4
++ ;;
++ sun3)
++ basic_machine=m68k-sun
++ basic_os=
++ ;;
++ sun3os3)
++ basic_machine=m68k-sun
++ basic_os=sunos3
++ ;;
++ sun3os4)
++ basic_machine=m68k-sun
++ basic_os=sunos4
++ ;;
++ sun4)
++ basic_machine=sparc-sun
++ basic_os=
++ ;;
++ sun4os3)
++ basic_machine=sparc-sun
++ basic_os=sunos3
++ ;;
++ sun4os4)
++ basic_machine=sparc-sun
++ basic_os=sunos4
++ ;;
++ sun4sol2)
++ basic_machine=sparc-sun
++ basic_os=solaris2
++ ;;
++ sun386 | sun386i | roadrunner)
++ basic_machine=i386-sun
++ basic_os=
++ ;;
++ sv1)
++ basic_machine=sv1-cray
++ basic_os=unicos
++ ;;
++ symmetry)
++ basic_machine=i386-sequent
++ basic_os=dynix
++ ;;
++ t3e)
++ basic_machine=alphaev5-cray
++ basic_os=unicos
++ ;;
++ t90)
++ basic_machine=t90-cray
++ basic_os=unicos
++ ;;
++ toad1)
++ basic_machine=pdp10-xkl
++ basic_os=tops20
++ ;;
++ tpf)
++ basic_machine=s390x-ibm
++ basic_os=tpf
++ ;;
++ udi29k)
++ basic_machine=a29k-amd
++ basic_os=udi
++ ;;
++ ultra3)
++ basic_machine=a29k-nyu
++ basic_os=sym1
++ ;;
++ v810 | necv810)
++ basic_machine=v810-nec
++ basic_os=none
++ ;;
++ vaxv)
++ basic_machine=vax-dec
++ basic_os=sysv
++ ;;
++ vms)
++ basic_machine=vax-dec
++ basic_os=vms
++ ;;
++ vsta)
++ basic_machine=i386-pc
++ basic_os=vsta
++ ;;
++ vxworks960)
++ basic_machine=i960-wrs
++ basic_os=vxworks
++ ;;
++ vxworks68)
++ basic_machine=m68k-wrs
++ basic_os=vxworks
++ ;;
++ vxworks29k)
++ basic_machine=a29k-wrs
++ basic_os=vxworks
++ ;;
++ xbox)
++ basic_machine=i686-pc
++ basic_os=mingw32
++ ;;
++ ymp)
++ basic_machine=ymp-cray
++ basic_os=unicos
++ ;;
++ *)
++ basic_machine=$1
++ basic_os=
++ ;;
++ esac
+ ;;
+ esac
+
+-# Decode aliases for certain CPU-COMPANY combinations.
++# Decode 1-component or ad-hoc basic machines
+ case $basic_machine in
+- # Recognize the basic CPU types without company name.
+- # Some are omitted here because they have special meanings below.
+- 1750a | 580 \
+- | a29k \
+- | aarch64 | aarch64_be \
+- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+- | am33_2.0 \
+- | arc | arceb \
+- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+- | avr | avr32 \
+- | ba \
+- | be32 | be64 \
+- | bfin \
+- | c4x | c8051 | clipper \
+- | d10v | d30v | dlx | dsp16xx \
+- | e2k | epiphany \
+- | fido | fr30 | frv | ft32 \
+- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+- | hexagon \
+- | i370 | i860 | i960 | ia64 \
+- | ip2k | iq2000 \
+- | k1om \
+- | le32 | le64 \
+- | lm32 \
+- | m32c | m32r | m32rle | m68000 | m68k | m88k \
+- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+- | mips | mipsbe | mipseb | mipsel | mipsle \
+- | mips16 \
+- | mips64 | mips64el \
+- | mips64octeon | mips64octeonel \
+- | mips64orion | mips64orionel \
+- | mips64r5900 | mips64r5900el \
+- | mips64vr | mips64vrel \
+- | mips64vr4100 | mips64vr4100el \
+- | mips64vr4300 | mips64vr4300el \
+- | mips64vr5000 | mips64vr5000el \
+- | mips64vr5900 | mips64vr5900el \
+- | mipsisa32 | mipsisa32el \
+- | mipsisa32r2 | mipsisa32r2el \
+- | mipsisa32r6 | mipsisa32r6el \
+- | mipsisa64 | mipsisa64el \
+- | mipsisa64r2 | mipsisa64r2el \
+- | mipsisa64r6 | mipsisa64r6el \
+- | mipsisa64sb1 | mipsisa64sb1el \
+- | mipsisa64sr71k | mipsisa64sr71kel \
+- | mipsr5900 | mipsr5900el \
+- | mipstx39 | mipstx39el \
+- | mn10200 | mn10300 \
+- | moxie \
+- | mt \
+- | msp430 \
+- | nds32 | nds32le | nds32be \
+- | nios | nios2 | nios2eb | nios2el \
+- | ns16k | ns32k \
+- | open8 | or1k | or1knd | or32 \
+- | pdp10 | pdp11 | pj | pjl \
+- | powerpc | powerpc64 | powerpc64le | powerpcle \
+- | pru \
+- | pyramid \
+- | riscv32 | riscv64 \
+- | rl78 | rx \
+- | score \
+- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+- | sh64 | sh64le \
+- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+- | spu \
+- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+- | ubicom32 \
+- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+- | visium \
+- | we32k \
+- | x86 | xc16x | xstormy16 | xtensa \
+- | z8k | z80)
+- basic_machine=$basic_machine-unknown
+- ;;
+- c54x)
+- basic_machine=tic54x-unknown
+- ;;
+- c55x)
+- basic_machine=tic55x-unknown
+- ;;
+- c6x)
+- basic_machine=tic6x-unknown
+- ;;
+- leon|leon[3-9])
+- basic_machine=sparc-$basic_machine
+- ;;
+- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+- basic_machine=$basic_machine-unknown
+- os=-none
++ # Here we handle the default manufacturer of certain CPU types. It is in
++ # some cases the only manufacturer, in others, it is the most popular.
++ w89k)
++ cpu=hppa1.1
++ vendor=winbond
+ ;;
+- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
++ op50n)
++ cpu=hppa1.1
++ vendor=oki
+ ;;
+- ms1)
+- basic_machine=mt-unknown
++ op60c)
++ cpu=hppa1.1
++ vendor=oki
+ ;;
+-
+- strongarm | thumb | xscale)
+- basic_machine=arm-unknown
++ ibm*)
++ cpu=i370
++ vendor=ibm
+ ;;
+- xgate)
+- basic_machine=$basic_machine-unknown
+- os=-none
++ orion105)
++ cpu=clipper
++ vendor=highlevel
+ ;;
+- xscaleeb)
+- basic_machine=armeb-unknown
++ mac | mpw | mac-mpw)
++ cpu=m68k
++ vendor=apple
+ ;;
+-
+- xscaleel)
+- basic_machine=armel-unknown
++ pmac | pmac-mpw)
++ cpu=powerpc
++ vendor=apple
+ ;;
+
+- # We use `pc' rather than `unknown'
+- # because (1) that's what they normally are, and
+- # (2) the word "unknown" tends to confuse beginning users.
+- i*86 | x86_64)
+- basic_machine=$basic_machine-pc
+- ;;
+- # Object if more than one company name word.
+- *-*-*)
+- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+- exit 1
+- ;;
+- # Recognize the basic CPU types with company name.
+- 580-* \
+- | a29k-* \
+- | aarch64-* | aarch64_be-* \
+- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+- | avr-* | avr32-* \
+- | ba-* \
+- | be32-* | be64-* \
+- | bfin-* | bs2000-* \
+- | c[123]* | c30-* | [cjt]90-* | c4x-* \
+- | c8051-* | clipper-* | craynv-* | cydra-* \
+- | d10v-* | d30v-* | dlx-* \
+- | e2k-* | elxsi-* \
+- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+- | h8300-* | h8500-* \
+- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+- | hexagon-* \
+- | i*86-* | i860-* | i960-* | ia64-* \
+- | ip2k-* | iq2000-* \
+- | k1om-* \
+- | le32-* | le64-* \
+- | lm32-* \
+- | m32c-* | m32r-* | m32rle-* \
+- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+- | microblaze-* | microblazeel-* \
+- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+- | mips16-* \
+- | mips64-* | mips64el-* \
+- | mips64octeon-* | mips64octeonel-* \
+- | mips64orion-* | mips64orionel-* \
+- | mips64r5900-* | mips64r5900el-* \
+- | mips64vr-* | mips64vrel-* \
+- | mips64vr4100-* | mips64vr4100el-* \
+- | mips64vr4300-* | mips64vr4300el-* \
+- | mips64vr5000-* | mips64vr5000el-* \
+- | mips64vr5900-* | mips64vr5900el-* \
+- | mipsisa32-* | mipsisa32el-* \
+- | mipsisa32r2-* | mipsisa32r2el-* \
+- | mipsisa32r6-* | mipsisa32r6el-* \
+- | mipsisa64-* | mipsisa64el-* \
+- | mipsisa64r2-* | mipsisa64r2el-* \
+- | mipsisa64r6-* | mipsisa64r6el-* \
+- | mipsisa64sb1-* | mipsisa64sb1el-* \
+- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+- | mipsr5900-* | mipsr5900el-* \
+- | mipstx39-* | mipstx39el-* \
+- | mmix-* \
+- | mt-* \
+- | msp430-* \
+- | nds32-* | nds32le-* | nds32be-* \
+- | nios-* | nios2-* | nios2eb-* | nios2el-* \
+- | none-* | np1-* | ns16k-* | ns32k-* \
+- | open8-* \
+- | or1k*-* \
+- | orion-* \
+- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+- | pru-* \
+- | pyramid-* \
+- | riscv32-* | riscv64-* \
+- | rl78-* | romp-* | rs6000-* | rx-* \
+- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+- | sparclite-* \
+- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
+- | tahoe-* \
+- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+- | tile*-* \
+- | tron-* \
+- | ubicom32-* \
+- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+- | vax-* \
+- | visium-* \
+- | we32k-* \
+- | x86-* | x86_64-* | xc16x-* | xps100-* \
+- | xstormy16-* | xtensa*-* \
+- | ymp-* \
+- | z8k-* | z80-*)
+- ;;
+- # Recognize the basic CPU types without company name, with glob match.
+- xtensa*)
+- basic_machine=$basic_machine-unknown
+- ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+- 386bsd)
+- basic_machine=i386-unknown
+- os=-bsd
+- ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+- basic_machine=m68000-att
++ cpu=m68000
++ vendor=att
+ ;;
+ 3b*)
+- basic_machine=we32k-att
+- ;;
+- a29khif)
+- basic_machine=a29k-amd
+- os=-udi
+- ;;
+- abacus)
+- basic_machine=abacus-unknown
+- ;;
+- adobe68k)
+- basic_machine=m68010-adobe
+- os=-scout
+- ;;
+- alliant | fx80)
+- basic_machine=fx80-alliant
+- ;;
+- altos | altos3068)
+- basic_machine=m68k-altos
+- ;;
+- am29k)
+- basic_machine=a29k-none
+- os=-bsd
+- ;;
+- amd64)
+- basic_machine=x86_64-pc
+- ;;
+- amd64-*)
+- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- amdahl)
+- basic_machine=580-amdahl
+- os=-sysv
+- ;;
+- amiga | amiga-*)
+- basic_machine=m68k-unknown
+- ;;
+- amigaos | amigados)
+- basic_machine=m68k-unknown
+- os=-amigaos
+- ;;
+- amigaunix | amix)
+- basic_machine=m68k-unknown
+- os=-sysv4
+- ;;
+- apollo68)
+- basic_machine=m68k-apollo
+- os=-sysv
+- ;;
+- apollo68bsd)
+- basic_machine=m68k-apollo
+- os=-bsd
+- ;;
+- aros)
+- basic_machine=i386-pc
+- os=-aros
+- ;;
+- asmjs)
+- basic_machine=asmjs-unknown
+- ;;
+- aux)
+- basic_machine=m68k-apple
+- os=-aux
+- ;;
+- balance)
+- basic_machine=ns32k-sequent
+- os=-dynix
+- ;;
+- blackfin)
+- basic_machine=bfin-unknown
+- os=-linux
+- ;;
+- blackfin-*)
+- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=-linux
++ cpu=we32k
++ vendor=att
+ ;;
+ bluegene*)
+- basic_machine=powerpc-ibm
+- os=-cnk
+- ;;
+- c54x-*)
+- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- c55x-*)
+- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- c6x-*)
+- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- c90)
+- basic_machine=c90-cray
+- os=-unicos
+- ;;
+- cegcc)
+- basic_machine=arm-unknown
+- os=-cegcc
+- ;;
+- convex-c1)
+- basic_machine=c1-convex
+- os=-bsd
+- ;;
+- convex-c2)
+- basic_machine=c2-convex
+- os=-bsd
+- ;;
+- convex-c32)
+- basic_machine=c32-convex
+- os=-bsd
+- ;;
+- convex-c34)
+- basic_machine=c34-convex
+- os=-bsd
+- ;;
+- convex-c38)
+- basic_machine=c38-convex
+- os=-bsd
+- ;;
+- cray | j90)
+- basic_machine=j90-cray
+- os=-unicos
+- ;;
+- craynv)
+- basic_machine=craynv-cray
+- os=-unicosmp
+- ;;
+- cr16 | cr16-*)
+- basic_machine=cr16-unknown
+- os=-elf
+- ;;
+- crds | unos)
+- basic_machine=m68k-crds
+- ;;
+- crisv32 | crisv32-* | etraxfs*)
+- basic_machine=crisv32-axis
+- ;;
+- cris | cris-* | etrax*)
+- basic_machine=cris-axis
+- ;;
+- crx)
+- basic_machine=crx-unknown
+- os=-elf
+- ;;
+- da30 | da30-*)
+- basic_machine=m68k-da30
+- ;;
+- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+- basic_machine=mips-dec
++ cpu=powerpc
++ vendor=ibm
++ basic_os=cnk
+ ;;
+ decsystem10* | dec10*)
+- basic_machine=pdp10-dec
+- os=-tops10
++ cpu=pdp10
++ vendor=dec
++ basic_os=tops10
+ ;;
+ decsystem20* | dec20*)
+- basic_machine=pdp10-dec
+- os=-tops20
++ cpu=pdp10
++ vendor=dec
++ basic_os=tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+- basic_machine=m68k-motorola
++ cpu=m68k
++ vendor=motorola
+ ;;
+- delta88)
+- basic_machine=m88k-motorola
+- os=-sysv3
+- ;;
+- dicos)
+- basic_machine=i686-pc
+- os=-dicos
+- ;;
+- djgpp)
+- basic_machine=i586-pc
+- os=-msdosdjgpp
+- ;;
+- dpx20 | dpx20-*)
+- basic_machine=rs6000-bull
+- os=-bosx
+- ;;
+- dpx2* | dpx2*-bull)
+- basic_machine=m68k-bull
+- os=-sysv3
+- ;;
+- e500v[12])
+- basic_machine=powerpc-unknown
+- os=$os"spe"
+- ;;
+- e500v[12]-*)
+- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=$os"spe"
+- ;;
+- ebmon29k)
+- basic_machine=a29k-amd
+- os=-ebmon
+- ;;
+- elxsi)
+- basic_machine=elxsi-elxsi
+- os=-bsd
++ dpx2*)
++ cpu=m68k
++ vendor=bull
++ basic_os=sysv3
+ ;;
+ encore | umax | mmax)
+- basic_machine=ns32k-encore
++ cpu=ns32k
++ vendor=encore
+ ;;
+- es1800 | OSE68k | ose68k | ose | OSE)
+- basic_machine=m68k-ericsson
+- os=-ose
++ elxsi)
++ cpu=elxsi
++ vendor=elxsi
++ basic_os=${basic_os:-bsd}
+ ;;
+ fx2800)
+- basic_machine=i860-alliant
++ cpu=i860
++ vendor=alliant
+ ;;
+ genix)
+- basic_machine=ns32k-ns
+- ;;
+- gmicro)
+- basic_machine=tron-gmicro
+- os=-sysv
+- ;;
+- go32)
+- basic_machine=i386-pc
+- os=-go32
++ cpu=ns32k
++ vendor=ns
+ ;;
+ h3050r* | hiux*)
+- basic_machine=hppa1.1-hitachi
+- os=-hiuxwe2
+- ;;
+- h8300hms)
+- basic_machine=h8300-hitachi
+- os=-hms
+- ;;
+- h8300xray)
+- basic_machine=h8300-hitachi
+- os=-xray
+- ;;
+- h8500hms)
+- basic_machine=h8500-hitachi
+- os=-hms
+- ;;
+- harris)
+- basic_machine=m88k-harris
+- os=-sysv3
+- ;;
+- hp300-*)
+- basic_machine=m68k-hp
+- ;;
+- hp300bsd)
+- basic_machine=m68k-hp
+- os=-bsd
+- ;;
+- hp300hpux)
+- basic_machine=m68k-hp
+- os=-hpux
++ cpu=hppa1.1
++ vendor=hitachi
++ basic_os=hiuxwe2
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+- basic_machine=hppa1.0-hp
++ cpu=hppa1.0
++ vendor=hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+- basic_machine=m68000-hp
++ cpu=m68000
++ vendor=hp
+ ;;
+ hp9k3[2-9][0-9])
+- basic_machine=m68k-hp
++ cpu=m68k
++ vendor=hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+- basic_machine=hppa1.0-hp
++ cpu=hppa1.0
++ vendor=hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+- basic_machine=hppa1.1-hp
++ cpu=hppa1.1
++ vendor=hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+- basic_machine=hppa1.1-hp
++ cpu=hppa1.1
++ vendor=hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+- basic_machine=hppa1.1-hp
++ cpu=hppa1.1
++ vendor=hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+- basic_machine=hppa1.1-hp
++ cpu=hppa1.1
++ vendor=hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+- basic_machine=hppa1.0-hp
+- ;;
+- hppa-next)
+- os=-nextstep3
+- ;;
+- hppaosf)
+- basic_machine=hppa1.1-hp
+- os=-osf
+- ;;
+- hppro)
+- basic_machine=hppa1.1-hp
+- os=-proelf
+- ;;
+- i370-ibm* | ibm*)
+- basic_machine=i370-ibm
++ cpu=hppa1.0
++ vendor=hp
+ ;;
+ i*86v32)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-sysv32
++ cpu=`echo "$1" | sed -e 's/86.*/86/'`
++ vendor=pc
++ basic_os=sysv32
+ ;;
+ i*86v4*)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-sysv4
++ cpu=`echo "$1" | sed -e 's/86.*/86/'`
++ vendor=pc
++ basic_os=sysv4
+ ;;
+ i*86v)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-sysv
++ cpu=`echo "$1" | sed -e 's/86.*/86/'`
++ vendor=pc
++ basic_os=sysv
+ ;;
+ i*86sol2)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-solaris2
++ cpu=`echo "$1" | sed -e 's/86.*/86/'`
++ vendor=pc
++ basic_os=solaris2
+ ;;
+- i386mach)
+- basic_machine=i386-mach
+- os=-mach
+- ;;
+- i386-vsta | vsta)
+- basic_machine=i386-unknown
+- os=-vsta
++ j90 | j90-cray)
++ cpu=j90
++ vendor=cray
++ basic_os=${basic_os:-unicos}
+ ;;
+ iris | iris4d)
+- basic_machine=mips-sgi
+- case $os in
+- -irix*)
++ cpu=mips
++ vendor=sgi
++ case $basic_os in
++ irix*)
+ ;;
+ *)
+- os=-irix4
++ basic_os=irix4
+ ;;
+ esac
+ ;;
+- isi68 | isi)
+- basic_machine=m68k-isi
+- os=-sysv
+- ;;
+- leon-*|leon[3-9]-*)
+- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+- ;;
+- m68knommu)
+- basic_machine=m68k-unknown
+- os=-linux
+- ;;
+- m68knommu-*)
+- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=-linux
+- ;;
+- m88k-omron*)
+- basic_machine=m88k-omron
+- ;;
+- magnum | m3230)
+- basic_machine=mips-mips
+- os=-sysv
+- ;;
+- merlin)
+- basic_machine=ns32k-utek
+- os=-sysv
+- ;;
+- microblaze*)
+- basic_machine=microblaze-xilinx
+- ;;
+- mingw64)
+- basic_machine=x86_64-pc
+- os=-mingw64
+- ;;
+- mingw32)
+- basic_machine=i686-pc
+- os=-mingw32
+- ;;
+- mingw32ce)
+- basic_machine=arm-unknown
+- os=-mingw32ce
+- ;;
+ miniframe)
+- basic_machine=m68000-convergent
+- ;;
+- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+- basic_machine=m68k-atari
+- os=-mint
+- ;;
+- mips3*-*)
+- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+- ;;
+- mips3*)
+- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
++ cpu=m68000
++ vendor=convergent
+ ;;
+- monitor)
+- basic_machine=m68k-rom68k
+- os=-coff
+- ;;
+- morphos)
+- basic_machine=powerpc-unknown
+- os=-morphos
+- ;;
+- moxiebox)
+- basic_machine=moxie-unknown
+- os=-moxiebox
+- ;;
+- msdos)
+- basic_machine=i386-pc
+- os=-msdos
+- ;;
+- ms1-*)
+- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+- ;;
+- msys)
+- basic_machine=i686-pc
+- os=-msys
+- ;;
+- mvs)
+- basic_machine=i370-ibm
+- os=-mvs
+- ;;
+- nacl)
+- basic_machine=le32-unknown
+- os=-nacl
+- ;;
+- ncr3000)
+- basic_machine=i486-ncr
+- os=-sysv4
+- ;;
+- netbsd386)
+- basic_machine=i386-unknown
+- os=-netbsd
+- ;;
+- netwinder)
+- basic_machine=armv4l-rebel
+- os=-linux
+- ;;
+- news | news700 | news800 | news900)
+- basic_machine=m68k-sony
+- os=-newsos
+- ;;
+- news1000)
+- basic_machine=m68030-sony
+- os=-newsos
++ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
++ cpu=m68k
++ vendor=atari
++ basic_os=mint
+ ;;
+ news-3600 | risc-news)
+- basic_machine=mips-sony
+- os=-newsos
+- ;;
+- necv70)
+- basic_machine=v70-nec
+- os=-sysv
+- ;;
+- next | m*-next )
+- basic_machine=m68k-next
+- case $os in
+- -nextstep* )
++ cpu=mips
++ vendor=sony
++ basic_os=newsos
++ ;;
++ next | m*-next)
++ cpu=m68k
++ vendor=next
++ case $basic_os in
++ openstep*)
++ ;;
++ nextstep*)
+ ;;
+- -ns2*)
+- os=-nextstep2
++ ns2*)
++ basic_os=nextstep2
+ ;;
+ *)
+- os=-nextstep3
++ basic_os=nextstep3
+ ;;
+ esac
+ ;;
+- nh3000)
+- basic_machine=m68k-harris
+- os=-cxux
+- ;;
+- nh[45]000)
+- basic_machine=m88k-harris
+- os=-cxux
+- ;;
+- nindy960)
+- basic_machine=i960-intel
+- os=-nindy
+- ;;
+- mon960)
+- basic_machine=i960-intel
+- os=-mon960
+- ;;
+- nonstopux)
+- basic_machine=mips-compaq
+- os=-nonstopux
+- ;;
+ np1)
+- basic_machine=np1-gould
+- ;;
+- neo-tandem)
+- basic_machine=neo-tandem
+- ;;
+- nse-tandem)
+- basic_machine=nse-tandem
+- ;;
+- nsr-tandem)
+- basic_machine=nsr-tandem
+- ;;
+- nsx-tandem)
+- basic_machine=nsx-tandem
++ cpu=np1
++ vendor=gould
+ ;;
+ op50n-* | op60c-*)
+- basic_machine=hppa1.1-oki
+- os=-proelf
+- ;;
+- openrisc | openrisc-*)
+- basic_machine=or32-unknown
+- ;;
+- os400)
+- basic_machine=powerpc-ibm
+- os=-os400
+- ;;
+- OSE68000 | ose68000)
+- basic_machine=m68000-ericsson
+- os=-ose
+- ;;
+- os68k)
+- basic_machine=m68k-none
+- os=-os68k
++ cpu=hppa1.1
++ vendor=oki
++ basic_os=proelf
+ ;;
+ pa-hitachi)
+- basic_machine=hppa1.1-hitachi
+- os=-hiuxwe2
+- ;;
+- paragon)
+- basic_machine=i860-intel
+- os=-osf
+- ;;
+- parisc)
+- basic_machine=hppa-unknown
+- os=-linux
+- ;;
+- parisc-*)
+- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=-linux
++ cpu=hppa1.1
++ vendor=hitachi
++ basic_os=hiuxwe2
+ ;;
+ pbd)
+- basic_machine=sparc-tti
++ cpu=sparc
++ vendor=tti
+ ;;
+ pbb)
+- basic_machine=m68k-tti
+- ;;
+- pc532 | pc532-*)
+- basic_machine=ns32k-pc532
+- ;;
+- pc98)
+- basic_machine=i386-pc
+- ;;
+- pc98-*)
+- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentium | p5 | k5 | k6 | nexgen | viac3)
+- basic_machine=i586-pc
+- ;;
+- pentiumpro | p6 | 6x86 | athlon | athlon_*)
+- basic_machine=i686-pc
+- ;;
+- pentiumii | pentium2 | pentiumiii | pentium3)
+- basic_machine=i686-pc
++ cpu=m68k
++ vendor=tti
+ ;;
+- pentium4)
+- basic_machine=i786-pc
+- ;;
+- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentiumpro-* | p6-* | 6x86-* | athlon-*)
+- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentium4-*)
+- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
++ pc532)
++ cpu=ns32k
++ vendor=pc532
+ ;;
+ pn)
+- basic_machine=pn-gould
+- ;;
+- power) basic_machine=power-ibm
+- ;;
+- ppc | ppcbe) basic_machine=powerpc-unknown
+- ;;
+- ppc-* | ppcbe-*)
+- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- ppcle | powerpclittle)
+- basic_machine=powerpcle-unknown
+- ;;
+- ppcle-* | powerpclittle-*)
+- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
++ cpu=pn
++ vendor=gould
+ ;;
+- ppc64) basic_machine=powerpc64-unknown
+- ;;
+- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- ppc64le | powerpc64little)
+- basic_machine=powerpc64le-unknown
+- ;;
+- ppc64le-* | powerpc64little-*)
+- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
++ power)
++ cpu=power
++ vendor=ibm
+ ;;
+ ps2)
+- basic_machine=i386-ibm
+- ;;
+- pw32)
+- basic_machine=i586-unknown
+- os=-pw32
+- ;;
+- rdos | rdos64)
+- basic_machine=x86_64-pc
+- os=-rdos
+- ;;
+- rdos32)
+- basic_machine=i386-pc
+- os=-rdos
+- ;;
+- rom68k)
+- basic_machine=m68k-rom68k
+- os=-coff
++ cpu=i386
++ vendor=ibm
+ ;;
+ rm[46]00)
+- basic_machine=mips-siemens
++ cpu=mips
++ vendor=siemens
+ ;;
+ rtpc | rtpc-*)
+- basic_machine=romp-ibm
+- ;;
+- s390 | s390-*)
+- basic_machine=s390-ibm
++ cpu=romp
++ vendor=ibm
+ ;;
+- s390x | s390x-*)
+- basic_machine=s390x-ibm
+- ;;
+- sa29200)
+- basic_machine=a29k-amd
+- os=-udi
++ sde)
++ cpu=mipsisa32
++ vendor=sde
++ basic_os=${basic_os:-elf}
+ ;;
+- sb1)
+- basic_machine=mipsisa64sb1-unknown
++ simso-wrs)
++ cpu=sparclite
++ vendor=wrs
++ basic_os=vxworks
+ ;;
+- sb1el)
+- basic_machine=mipsisa64sb1el-unknown
++ tower | tower-32)
++ cpu=m68k
++ vendor=ncr
+ ;;
+- sde)
+- basic_machine=mipsisa32-sde
+- os=-elf
++ vpp*|vx|vx-*)
++ cpu=f301
++ vendor=fujitsu
+ ;;
+- sei)
+- basic_machine=mips-sei
+- os=-seiux
++ w65)
++ cpu=w65
++ vendor=wdc
+ ;;
+- sequent)
+- basic_machine=i386-sequent
++ w89k-*)
++ cpu=hppa1.1
++ vendor=winbond
++ basic_os=proelf
+ ;;
+- sh)
+- basic_machine=sh-hitachi
+- os=-hms
++ none)
++ cpu=none
++ vendor=none
+ ;;
+- sh5el)
+- basic_machine=sh5le-unknown
++ leon|leon[3-9])
++ cpu=sparc
++ vendor=$basic_machine
+ ;;
+- sh64)
+- basic_machine=sh64-unknown
++ leon-*|leon[3-9]-*)
++ cpu=sparc
++ vendor=`echo "$basic_machine" | sed 's/-.*//'`
+ ;;
+- sparclite-wrs | simso-wrs)
+- basic_machine=sparclite-wrs
+- os=-vxworks
++
++ *-*)
++ # shellcheck disable=SC2162
++ saved_IFS=$IFS
++ IFS="-" read cpu vendor <<EOF
++$basic_machine
++EOF
++ IFS=$saved_IFS
+ ;;
+- sps7)
+- basic_machine=m68k-bull
+- os=-sysv2
++ # We use `pc' rather than `unknown'
++ # because (1) that's what they normally are, and
++ # (2) the word "unknown" tends to confuse beginning users.
++ i*86 | x86_64)
++ cpu=$basic_machine
++ vendor=pc
+ ;;
+- spur)
+- basic_machine=spur-unknown
++ # These rules are duplicated from below for sake of the special case above;
++ # i.e. things that normalized to x86 arches should also default to "pc"
++ pc98)
++ cpu=i386
++ vendor=pc
+ ;;
+- st2000)
+- basic_machine=m68k-tandem
++ x64 | amd64)
++ cpu=x86_64
++ vendor=pc
+ ;;
+- stratus)
+- basic_machine=i860-stratus
+- os=-sysv4
++ # Recognize the basic CPU types without company name.
++ *)
++ cpu=$basic_machine
++ vendor=unknown
+ ;;
+- strongarm-* | thumb-*)
+- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
++esac
++
++unset -v basic_machine
++
++# Decode basic machines in the full and proper CPU-Company form.
++case $cpu-$vendor in
++ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
++ # some cases the only manufacturer, in others, it is the most popular.
++ craynv-unknown)
++ vendor=cray
++ basic_os=${basic_os:-unicosmp}
+ ;;
+- sun2)
+- basic_machine=m68000-sun
++ c90-unknown | c90-cray)
++ vendor=cray
++ basic_os=${Basic_os:-unicos}
+ ;;
+- sun2os3)
+- basic_machine=m68000-sun
+- os=-sunos3
++ fx80-unknown)
++ vendor=alliant
+ ;;
+- sun2os4)
+- basic_machine=m68000-sun
+- os=-sunos4
++ romp-unknown)
++ vendor=ibm
+ ;;
+- sun3os3)
+- basic_machine=m68k-sun
+- os=-sunos3
++ mmix-unknown)
++ vendor=knuth
+ ;;
+- sun3os4)
+- basic_machine=m68k-sun
+- os=-sunos4
++ microblaze-unknown | microblazeel-unknown)
++ vendor=xilinx
+ ;;
+- sun4os3)
+- basic_machine=sparc-sun
+- os=-sunos3
++ rs6000-unknown)
++ vendor=ibm
+ ;;
+- sun4os4)
+- basic_machine=sparc-sun
+- os=-sunos4
++ vax-unknown)
++ vendor=dec
+ ;;
+- sun4sol2)
+- basic_machine=sparc-sun
+- os=-solaris2
++ pdp11-unknown)
++ vendor=dec
+ ;;
+- sun3 | sun3-*)
+- basic_machine=m68k-sun
++ we32k-unknown)
++ vendor=att
+ ;;
+- sun4)
+- basic_machine=sparc-sun
++ cydra-unknown)
++ vendor=cydrome
+ ;;
+- sun386 | sun386i | roadrunner)
+- basic_machine=i386-sun
++ i370-ibm*)
++ vendor=ibm
+ ;;
+- sv1)
+- basic_machine=sv1-cray
+- os=-unicos
++ orion-unknown)
++ vendor=highlevel
+ ;;
+- symmetry)
+- basic_machine=i386-sequent
+- os=-dynix
++ xps-unknown | xps100-unknown)
++ cpu=xps100
++ vendor=honeywell
+ ;;
+- t3e)
+- basic_machine=alphaev5-cray
+- os=-unicos
++
++ # Here we normalize CPU types with a missing or matching vendor
++ armh-unknown | armh-alt)
++ cpu=armv7l
++ vendor=alt
++ basic_os=${basic_os:-linux-gnueabihf}
+ ;;
+- t90)
+- basic_machine=t90-cray
+- os=-unicos
++ dpx20-unknown | dpx20-bull)
++ cpu=rs6000
++ vendor=bull
++ basic_os=${basic_os:-bosx}
+ ;;
+- tile*)
+- basic_machine=$basic_machine-unknown
+- os=-linux-gnu
++
++ # Here we normalize CPU types irrespective of the vendor
++ amd64-*)
++ cpu=x86_64
+ ;;
+- tx39)
+- basic_machine=mipstx39-unknown
++ blackfin-*)
++ cpu=bfin
++ basic_os=linux
+ ;;
+- tx39el)
+- basic_machine=mipstx39el-unknown
++ c54x-*)
++ cpu=tic54x
+ ;;
+- toad1)
+- basic_machine=pdp10-xkl
+- os=-tops20
++ c55x-*)
++ cpu=tic55x
+ ;;
+- tower | tower-32)
+- basic_machine=m68k-ncr
++ c6x-*)
++ cpu=tic6x
+ ;;
+- tpf)
+- basic_machine=s390x-ibm
+- os=-tpf
++ e500v[12]-*)
++ cpu=powerpc
++ basic_os=${basic_os}"spe"
+ ;;
+- udi29k)
+- basic_machine=a29k-amd
+- os=-udi
++ mips3*-*)
++ cpu=mips64
+ ;;
+- ultra3)
+- basic_machine=a29k-nyu
+- os=-sym1
++ ms1-*)
++ cpu=mt
+ ;;
+- v810 | necv810)
+- basic_machine=v810-nec
+- os=-none
++ m68knommu-*)
++ cpu=m68k
++ basic_os=linux
+ ;;
+- vaxv)
+- basic_machine=vax-dec
+- os=-sysv
++ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
++ cpu=s12z
+ ;;
+- vms)
+- basic_machine=vax-dec
+- os=-vms
++ openrisc-*)
++ cpu=or32
+ ;;
+- vpp*|vx|vx-*)
+- basic_machine=f301-fujitsu
++ parisc-*)
++ cpu=hppa
++ basic_os=linux
+ ;;
+- vxworks960)
+- basic_machine=i960-wrs
+- os=-vxworks
++ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
++ cpu=i586
+ ;;
+- vxworks68)
+- basic_machine=m68k-wrs
+- os=-vxworks
++ pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
++ cpu=i686
+ ;;
+- vxworks29k)
+- basic_machine=a29k-wrs
+- os=-vxworks
++ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
++ cpu=i686
+ ;;
+- w65*)
+- basic_machine=w65-wdc
+- os=-none
++ pentium4-*)
++ cpu=i786
+ ;;
+- w89k-*)
+- basic_machine=hppa1.1-winbond
+- os=-proelf
++ pc98-*)
++ cpu=i386
+ ;;
+- xbox)
+- basic_machine=i686-pc
+- os=-mingw32
++ ppc-* | ppcbe-*)
++ cpu=powerpc
+ ;;
+- xps | xps100)
+- basic_machine=xps100-honeywell
++ ppcle-* | powerpclittle-*)
++ cpu=powerpcle
+ ;;
+- xscale-* | xscalee[bl]-*)
+- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
++ ppc64-*)
++ cpu=powerpc64
+ ;;
+- ymp)
+- basic_machine=ymp-cray
+- os=-unicos
++ ppc64le-* | powerpc64little-*)
++ cpu=powerpc64le
+ ;;
+- z8k-*-coff)
+- basic_machine=z8k-unknown
+- os=-sim
++ sb1-*)
++ cpu=mipsisa64sb1
+ ;;
+- z80-*-coff)
+- basic_machine=z80-unknown
+- os=-sim
++ sb1el-*)
++ cpu=mipsisa64sb1el
+ ;;
+- none)
+- basic_machine=none-none
+- os=-none
++ sh5e[lb]-*)
++ cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
+ ;;
+-
+-# Here we handle the default manufacturer of certain CPU types. It is in
+-# some cases the only manufacturer, in others, it is the most popular.
+- w89k)
+- basic_machine=hppa1.1-winbond
++ spur-*)
++ cpu=spur
+ ;;
+- op50n)
+- basic_machine=hppa1.1-oki
++ strongarm-* | thumb-*)
++ cpu=arm
+ ;;
+- op60c)
+- basic_machine=hppa1.1-oki
++ tx39-*)
++ cpu=mipstx39
+ ;;
+- romp)
+- basic_machine=romp-ibm
++ tx39el-*)
++ cpu=mipstx39el
+ ;;
+- mmix)
+- basic_machine=mmix-knuth
++ x64-*)
++ cpu=x86_64
+ ;;
+- rs6000)
+- basic_machine=rs6000-ibm
++ xscale-* | xscalee[bl]-*)
++ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
+ ;;
+- vax)
+- basic_machine=vax-dec
++ arm64-* | aarch64le-*)
++ cpu=aarch64
+ ;;
+- pdp10)
+- # there are many clones, so DEC is not a safe bet
+- basic_machine=pdp10-unknown
++
++ # Recognize the canonical CPU Types that limit and/or modify the
++ # company names they are paired with.
++ cr16-*)
++ basic_os=${basic_os:-elf}
+ ;;
+- pdp11)
+- basic_machine=pdp11-dec
++ crisv32-* | etraxfs*-*)
++ cpu=crisv32
++ vendor=axis
+ ;;
+- we32k)
+- basic_machine=we32k-att
++ cris-* | etrax*-*)
++ cpu=cris
++ vendor=axis
+ ;;
+- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+- basic_machine=sh-unknown
++ crx-*)
++ basic_os=${basic_os:-elf}
+ ;;
+- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+- basic_machine=sparc-sun
++ neo-tandem)
++ cpu=neo
++ vendor=tandem
+ ;;
+- cydra)
+- basic_machine=cydra-cydrome
++ nse-tandem)
++ cpu=nse
++ vendor=tandem
+ ;;
+- orion)
+- basic_machine=orion-highlevel
++ nsr-tandem)
++ cpu=nsr
++ vendor=tandem
+ ;;
+- orion105)
+- basic_machine=clipper-highlevel
++ nsv-tandem)
++ cpu=nsv
++ vendor=tandem
+ ;;
+- mac | mpw | mac-mpw)
+- basic_machine=m68k-apple
++ nsx-tandem)
++ cpu=nsx
++ vendor=tandem
+ ;;
+- pmac | pmac-mpw)
+- basic_machine=powerpc-apple
++ mipsallegrexel-sony)
++ cpu=mipsallegrexel
++ vendor=sony
+ ;;
+- *-unknown)
+- # Make sure to match an already-canonicalized machine name.
++ tile*-*)
++ basic_os=${basic_os:-linux-gnu}
+ ;;
++
+ *)
+- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+- exit 1
++ # Recognize the canonical CPU types that are allowed with any
++ # company name.
++ case $cpu in
++ 1750a | 580 \
++ | a29k \
++ | aarch64 | aarch64_be \
++ | abacus \
++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
++ | alphapca5[67] | alpha64pca5[67] \
++ | am33_2.0 \
++ | amdgcn \
++ | arc | arceb | arc32 | arc64 \
++ | arm | arm[lb]e | arme[lb] | armv* \
++ | avr | avr32 \
++ | asmjs \
++ | ba \
++ | be32 | be64 \
++ | bfin | bpf | bs2000 \
++ | c[123]* | c30 | [cjt]90 | c4x \
++ | c8051 | clipper | craynv | csky | cydra \
++ | d10v | d30v | dlx | dsp16xx \
++ | e2k | elxsi | epiphany \
++ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
++ | h8300 | h8500 \
++ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
++ | hexagon \
++ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
++ | ip2k | iq2000 \
++ | k1om \
++ | le32 | le64 \
++ | lm32 \
++ | loongarch32 | loongarch64 \
++ | m32c | m32r | m32rle \
++ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
++ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
++ | m88110 | m88k | maxq | mb | mcore | mep | metag \
++ | microblaze | microblazeel \
++ | mips | mipsbe | mipseb | mipsel | mipsle \
++ | mips16 \
++ | mips64 | mips64eb | mips64el \
++ | mips64octeon | mips64octeonel \
++ | mips64orion | mips64orionel \
++ | mips64r5900 | mips64r5900el \
++ | mips64vr | mips64vrel \
++ | mips64vr4100 | mips64vr4100el \
++ | mips64vr4300 | mips64vr4300el \
++ | mips64vr5000 | mips64vr5000el \
++ | mips64vr5900 | mips64vr5900el \
++ | mipsisa32 | mipsisa32el \
++ | mipsisa32r2 | mipsisa32r2el \
++ | mipsisa32r3 | mipsisa32r3el \
++ | mipsisa32r5 | mipsisa32r5el \
++ | mipsisa32r6 | mipsisa32r6el \
++ | mipsisa64 | mipsisa64el \
++ | mipsisa64r2 | mipsisa64r2el \
++ | mipsisa64r3 | mipsisa64r3el \
++ | mipsisa64r5 | mipsisa64r5el \
++ | mipsisa64r6 | mipsisa64r6el \
++ | mipsisa64sb1 | mipsisa64sb1el \
++ | mipsisa64sr71k | mipsisa64sr71kel \
++ | mipsr5900 | mipsr5900el \
++ | mipstx39 | mipstx39el \
++ | mmix \
++ | mn10200 | mn10300 \
++ | moxie \
++ | mt \
++ | msp430 \
++ | nds32 | nds32le | nds32be \
++ | nfp \
++ | nios | nios2 | nios2eb | nios2el \
++ | none | np1 | ns16k | ns32k | nvptx \
++ | open8 \
++ | or1k* \
++ | or32 \
++ | orion \
++ | picochip \
++ | pdp10 | pdp11 | pj | pjl | pn | power \
++ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
++ | pru \
++ | pyramid \
++ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
++ | rl78 | romp | rs6000 | rx \
++ | s390 | s390x \
++ | score \
++ | sh | shl \
++ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
++ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
++ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
++ | sparclite \
++ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
++ | spu \
++ | tahoe \
++ | thumbv7* \
++ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
++ | tron \
++ | ubicom32 \
++ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
++ | vax \
++ | visium \
++ | w65 \
++ | wasm32 | wasm64 \
++ | we32k \
++ | x86 | x86_64 | xc16x | xgate | xps100 \
++ | xstormy16 | xtensa* \
++ | ymp \
++ | z8k | z80)
++ ;;
++
++ *)
++ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
++ exit 1
++ ;;
++ esac
+ ;;
+ esac
+
+ # Here we canonicalize certain aliases for manufacturers.
+-case $basic_machine in
+- *-digital*)
+- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
++case $vendor in
++ digital*)
++ vendor=dec
+ ;;
+- *-commodore*)
+- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
++ commodore*)
++ vendor=cbm
+ ;;
+ *)
+ ;;
+@@ -1358,203 +1306,219 @@ esac
+
+ # Decode manufacturer-specific aliases for certain operating systems.
+
+-if [ x"$os" != x"" ]
++if test x$basic_os != x
+ then
+-case $os in
+- # First match some system type aliases
+- # that might get confused with valid system types.
+- # -solaris* is a basic system type, with this one exception.
+- -auroraux)
+- os=-auroraux
++
++# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
++# set os.
++case $basic_os in
++ gnu/linux*)
++ kernel=linux
++ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
++ ;;
++ os2-emx)
++ kernel=os2
++ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
++ ;;
++ nto-qnx*)
++ kernel=nto
++ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
++ ;;
++ *-*)
++ # shellcheck disable=SC2162
++ saved_IFS=$IFS
++ IFS="-" read kernel os <<EOF
++$basic_os
++EOF
++ IFS=$saved_IFS
++ ;;
++ # Default OS when just kernel was specified
++ nto*)
++ kernel=nto
++ os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
++ ;;
++ linux*)
++ kernel=linux
++ os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
++ ;;
++ managarm*)
++ kernel=managarm
++ os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
+ ;;
+- -solaris1 | -solaris1.*)
+- os=`echo $os | sed -e 's|solaris1|sunos4|'`
++ *)
++ kernel=
++ os=$basic_os
+ ;;
+- -solaris)
+- os=-solaris2
++esac
++
++# Now, normalize the OS (knowing we just have one component, it's not a kernel,
++# etc.)
++case $os in
++ # First match some system type aliases that might get confused
++ # with valid system types.
++ # solaris* is a basic system type, with this one exception.
++ auroraux)
++ os=auroraux
+ ;;
+- -svr4*)
+- os=-sysv4
++ bluegene*)
++ os=cnk
+ ;;
+- -unixware*)
+- os=-sysv4.2uw
++ solaris1 | solaris1.*)
++ os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
+ ;;
+- -gnu/linux*)
+- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
++ solaris)
++ os=solaris2
+ ;;
+- # First accept the basic system types.
+- # The portable systems comes first.
+- # Each alternative MUST END IN A *, to match a version number.
+- # -sysv* is not here because it comes later, after sysvr4.
+- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+- | -sym* | -kopensolaris* | -plan9* \
+- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+- | -aos* | -aros* | -cloudabi* | -sortix* \
+- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+- | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
+- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+- | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
+- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
+- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+- | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
+- # Remember, each alternative MUST END IN *, to match a version number.
+- ;;
+- -qnx*)
+- case $basic_machine in
+- x86-* | i*86-*)
+- ;;
+- *)
+- os=-nto$os
+- ;;
+- esac
++ unixware*)
++ os=sysv4.2uw
+ ;;
+- -nto-qnx*)
++ # es1800 is here to avoid being matched by es* (a different OS)
++ es1800*)
++ os=ose
+ ;;
+- -nto*)
+- os=`echo $os | sed -e 's|nto|nto-qnx|'`
++ # Some version numbers need modification
++ chorusos*)
++ os=chorusos
+ ;;
+- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
++ isc)
++ os=isc2.2
+ ;;
+- -mac*)
+- os=`echo $os | sed -e 's|mac|macos|'`
++ sco6)
++ os=sco5v6
+ ;;
+- -linux-dietlibc)
+- os=-linux-dietlibc
++ sco5)
++ os=sco3.2v5
+ ;;
+- -linux*)
+- os=`echo $os | sed -e 's|linux|linux-gnu|'`
++ sco4)
++ os=sco3.2v4
+ ;;
+- -sunos5*)
+- os=`echo $os | sed -e 's|sunos5|solaris2|'`
++ sco3.2.[4-9]*)
++ os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
+ ;;
+- -sunos6*)
+- os=`echo $os | sed -e 's|sunos6|solaris3|'`
++ sco*v* | scout)
++ # Don't match below
+ ;;
+- -opened*)
+- os=-openedition
++ sco*)
++ os=sco3.2v2
+ ;;
+- -os400*)
+- os=-os400
++ psos*)
++ os=psos
+ ;;
+- -wince*)
+- os=-wince
++ qnx*)
++ os=qnx
+ ;;
+- -osfrose*)
+- os=-osfrose
++ hiux*)
++ os=hiuxwe2
+ ;;
+- -osf*)
+- os=-osf
++ lynx*178)
++ os=lynxos178
+ ;;
+- -utek*)
+- os=-bsd
++ lynx*5)
++ os=lynxos5
+ ;;
+- -dynix*)
+- os=-bsd
++ lynxos*)
++ # don't get caught up in next wildcard
+ ;;
+- -acis*)
+- os=-aos
++ lynx*)
++ os=lynxos
+ ;;
+- -atheos*)
+- os=-atheos
++ mac[0-9]*)
++ os=`echo "$os" | sed -e 's|mac|macos|'`
+ ;;
+- -syllable*)
+- os=-syllable
++ opened*)
++ os=openedition
+ ;;
+- -386bsd)
+- os=-bsd
++ os400*)
++ os=os400
+ ;;
+- -ctix* | -uts*)
+- os=-sysv
++ sunos5*)
++ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
+ ;;
+- -nova*)
+- os=-rtmk-nova
++ sunos6*)
++ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
+ ;;
+- -ns2 )
+- os=-nextstep2
++ wince*)
++ os=wince
+ ;;
+- -nsk*)
+- os=-nsk
++ utek*)
++ os=bsd
+ ;;
+- # Preserve the version number of sinix5.
+- -sinix5.*)
+- os=`echo $os | sed -e 's|sinix|sysv|'`
++ dynix*)
++ os=bsd
+ ;;
+- -sinix*)
+- os=-sysv4
++ acis*)
++ os=aos
+ ;;
+- -tpf*)
+- os=-tpf
++ atheos*)
++ os=atheos
+ ;;
+- -triton*)
+- os=-sysv3
++ syllable*)
++ os=syllable
+ ;;
+- -oss*)
+- os=-sysv3
++ 386bsd)
++ os=bsd
+ ;;
+- -svr4)
+- os=-sysv4
++ ctix* | uts*)
++ os=sysv
+ ;;
+- -svr3)
+- os=-sysv3
++ nova*)
++ os=rtmk-nova
+ ;;
+- -sysvr4)
+- os=-sysv4
++ ns2)
++ os=nextstep2
+ ;;
+- # This must come after -sysvr4.
+- -sysv*)
++ # Preserve the version number of sinix5.
++ sinix5.*)
++ os=`echo "$os" | sed -e 's|sinix|sysv|'`
+ ;;
+- -ose*)
+- os=-ose
++ sinix*)
++ os=sysv4
+ ;;
+- -es1800*)
+- os=-ose
++ tpf*)
++ os=tpf
+ ;;
+- -xenix)
+- os=-xenix
++ triton*)
++ os=sysv3
+ ;;
+- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+- os=-mint
++ oss*)
++ os=sysv3
+ ;;
+- -aros*)
+- os=-aros
++ svr4*)
++ os=sysv4
+ ;;
+- -zvmoe)
+- os=-zvmoe
++ svr3)
++ os=sysv3
+ ;;
+- -dicos*)
+- os=-dicos
++ sysvr4)
++ os=sysv4
+ ;;
+- -nacl*)
++ ose*)
++ os=ose
+ ;;
+- -ios)
++ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
++ os=mint
+ ;;
+- -none)
++ dicos*)
++ os=dicos
++ ;;
++ pikeos*)
++ # Until real need of OS specific support for
++ # particular features comes up, bare metal
++ # configurations are quite functional.
++ case $cpu in
++ arm*)
++ os=eabi
++ ;;
++ *)
++ os=elf
++ ;;
++ esac
+ ;;
+ *)
+- # Get rid of the `-' at the beginning of $os.
+- os=`echo $os | sed 's/[^-]*-//'`
+- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+- exit 1
++ # No normalization, but not necessarily accepted, that comes below.
+ ;;
+ esac
++
+ else
+
+ # Here we handle the default operating systems that come with various machines.
+@@ -1567,264 +1531,376 @@ else
+ # will signal an error saying that MANUFACTURER isn't an operating
+ # system, and we'll never get to this point.
+
+-case $basic_machine in
++kernel=
++case $cpu-$vendor in
+ score-*)
+- os=-elf
++ os=elf
+ ;;
+ spu-*)
+- os=-elf
++ os=elf
+ ;;
+ *-acorn)
+- os=-riscix1.2
++ os=riscix1.2
+ ;;
+ arm*-rebel)
+- os=-linux
++ kernel=linux
++ os=gnu
+ ;;
+ arm*-semi)
+- os=-aout
++ os=aout
+ ;;
+ c4x-* | tic4x-*)
+- os=-coff
++ os=coff
+ ;;
+ c8051-*)
+- os=-elf
++ os=elf
++ ;;
++ clipper-intergraph)
++ os=clix
+ ;;
+ hexagon-*)
+- os=-elf
++ os=elf
+ ;;
+ tic54x-*)
+- os=-coff
++ os=coff
+ ;;
+ tic55x-*)
+- os=-coff
++ os=coff
+ ;;
+ tic6x-*)
+- os=-coff
++ os=coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+- os=-tops20
++ os=tops20
+ ;;
+ pdp11-*)
+- os=-none
++ os=none
+ ;;
+ *-dec | vax-*)
+- os=-ultrix4.2
++ os=ultrix4.2
+ ;;
+ m68*-apollo)
+- os=-domain
++ os=domain
+ ;;
+ i386-sun)
+- os=-sunos4.0.2
++ os=sunos4.0.2
+ ;;
+ m68000-sun)
+- os=-sunos3
++ os=sunos3
+ ;;
+ m68*-cisco)
+- os=-aout
++ os=aout
+ ;;
+ mep-*)
+- os=-elf
++ os=elf
+ ;;
+ mips*-cisco)
+- os=-elf
++ os=elf
+ ;;
+ mips*-*)
+- os=-elf
++ os=elf
+ ;;
+ or32-*)
+- os=-coff
++ os=coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+- os=-sysv3
++ os=sysv3
+ ;;
+ sparc-* | *-sun)
+- os=-sunos4.1.1
++ os=sunos4.1.1
+ ;;
+ pru-*)
+- os=-elf
++ os=elf
+ ;;
+ *-be)
+- os=-beos
+- ;;
+- *-haiku)
+- os=-haiku
++ os=beos
+ ;;
+ *-ibm)
+- os=-aix
++ os=aix
+ ;;
+ *-knuth)
+- os=-mmixware
++ os=mmixware
+ ;;
+ *-wec)
+- os=-proelf
++ os=proelf
+ ;;
+ *-winbond)
+- os=-proelf
++ os=proelf
+ ;;
+ *-oki)
+- os=-proelf
++ os=proelf
+ ;;
+ *-hp)
+- os=-hpux
++ os=hpux
+ ;;
+ *-hitachi)
+- os=-hiux
++ os=hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+- os=-sysv
++ os=sysv
+ ;;
+ *-cbm)
+- os=-amigaos
++ os=amigaos
+ ;;
+ *-dg)
+- os=-dgux
++ os=dgux
+ ;;
+ *-dolphin)
+- os=-sysv3
++ os=sysv3
+ ;;
+ m68k-ccur)
+- os=-rtu
++ os=rtu
+ ;;
+ m88k-omron*)
+- os=-luna
++ os=luna
+ ;;
+- *-next )
+- os=-nextstep
++ *-next)
++ os=nextstep
+ ;;
+ *-sequent)
+- os=-ptx
++ os=ptx
+ ;;
+ *-crds)
+- os=-unos
++ os=unos
+ ;;
+ *-ns)
+- os=-genix
++ os=genix
+ ;;
+ i370-*)
+- os=-mvs
+- ;;
+- *-next)
+- os=-nextstep3
++ os=mvs
+ ;;
+ *-gould)
+- os=-sysv
++ os=sysv
+ ;;
+ *-highlevel)
+- os=-bsd
++ os=bsd
+ ;;
+ *-encore)
+- os=-bsd
++ os=bsd
+ ;;
+ *-sgi)
+- os=-irix
++ os=irix
+ ;;
+ *-siemens)
+- os=-sysv4
++ os=sysv4
+ ;;
+ *-masscomp)
+- os=-rtu
++ os=rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+- os=-uxpv
++ os=uxpv
+ ;;
+ *-rom68k)
+- os=-coff
++ os=coff
+ ;;
+ *-*bug)
+- os=-coff
++ os=coff
+ ;;
+ *-apple)
+- os=-macos
++ os=macos
+ ;;
+ *-atari*)
+- os=-mint
++ os=mint
++ ;;
++ *-wrs)
++ os=vxworks
+ ;;
+ *)
+- os=-none
++ os=none
+ ;;
+ esac
++
+ fi
+
++# Now, validate our (potentially fixed-up) OS.
++case $os in
++ # Sometimes we do "kernel-libc", so those need to count as OSes.
++ musl* | newlib* | relibc* | uclibc*)
++ ;;
++ # Likewise for "kernel-abi"
++ eabi* | gnueabi*)
++ ;;
++ # VxWorks passes extra cpu info in the 4th filed.
++ simlinux | simwindows | spe)
++ ;;
++ # Now accept the basic system types.
++ # The portable systems comes first.
++ # Each alternative MUST end in a * to match a version number.
++ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
++ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
++ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
++ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
++ | hiux* | abug | nacl* | netware* | windows* \
++ | os9* | macos* | osx* | ios* \
++ | mpw* | magic* | mmixware* | mon960* | lnews* \
++ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
++ | aos* | aros* | cloudabi* | sortix* | twizzler* \
++ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
++ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
++ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
++ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
++ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
++ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
++ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
++ | udi* | lites* | ieee* | go32* | aux* | hcos* \
++ | chorusrdb* | cegcc* | glidix* | serenity* \
++ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
++ | midipix* | mingw32* | mingw64* | mint* \
++ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
++ | interix* | uwin* | mks* | rhapsody* | darwin* \
++ | openstep* | oskit* | conix* | pw32* | nonstopux* \
++ | storm-chaos* | tops10* | tenex* | tops20* | its* \
++ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
++ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
++ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
++ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
++ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
++ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
++ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
++ | fiwix* | mlibc* )
++ ;;
++ # This one is extra strict with allowed versions
++ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
++ # Don't forget version if it is 3.2v4 or newer.
++ ;;
++ none)
++ ;;
++ kernel* )
++ # Restricted further below
++ ;;
++ *)
++ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
++ exit 1
++ ;;
++esac
++
++# As a final step for OS-related things, validate the OS-kernel combination
++# (given a valid OS), if there is a kernel.
++case $kernel-$os in
++ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
++ | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* )
++ ;;
++ uclinux-uclibc* )
++ ;;
++ managarm-mlibc* | managarm-kernel* )
++ ;;
++ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
++ # These are just libc implementations, not actual OSes, and thus
++ # require a kernel.
++ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
++ exit 1
++ ;;
++ -kernel* )
++ echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2
++ exit 1
++ ;;
++ *-kernel* )
++ echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2
++ exit 1
++ ;;
++ kfreebsd*-gnu* | kopensolaris*-gnu*)
++ ;;
++ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
++ ;;
++ nto-qnx*)
++ ;;
++ os2-emx)
++ ;;
++ *-eabi* | *-gnueabi*)
++ ;;
++ -*)
++ # Blank kernel with real OS is always fine.
++ ;;
++ *-*)
++ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
++ exit 1
++ ;;
++esac
++
+ # Here we handle the case where we know the os, and the CPU type, but not the
+ # manufacturer. We pick the logical manufacturer.
+-vendor=unknown
+-case $basic_machine in
+- *-unknown)
+- case $os in
+- -riscix*)
++case $vendor in
++ unknown)
++ case $cpu-$os in
++ *-riscix*)
+ vendor=acorn
+ ;;
+- -sunos*)
++ *-sunos*)
+ vendor=sun
+ ;;
+- -cnk*|-aix*)
++ *-cnk* | *-aix*)
+ vendor=ibm
+ ;;
+- -beos*)
++ *-beos*)
+ vendor=be
+ ;;
+- -hpux*)
++ *-hpux*)
+ vendor=hp
+ ;;
+- -mpeix*)
++ *-mpeix*)
+ vendor=hp
+ ;;
+- -hiux*)
++ *-hiux*)
+ vendor=hitachi
+ ;;
+- -unos*)
++ *-unos*)
+ vendor=crds
+ ;;
+- -dgux*)
++ *-dgux*)
+ vendor=dg
+ ;;
+- -luna*)
++ *-luna*)
+ vendor=omron
+ ;;
+- -genix*)
++ *-genix*)
+ vendor=ns
+ ;;
+- -mvs* | -opened*)
++ *-clix*)
++ vendor=intergraph
++ ;;
++ *-mvs* | *-opened*)
++ vendor=ibm
++ ;;
++ *-os400*)
+ vendor=ibm
+ ;;
+- -os400*)
++ s390-* | s390x-*)
+ vendor=ibm
+ ;;
+- -ptx*)
++ *-ptx*)
+ vendor=sequent
+ ;;
+- -tpf*)
++ *-tpf*)
+ vendor=ibm
+ ;;
+- -vxsim* | -vxworks* | -windiss*)
++ *-vxsim* | *-vxworks* | *-windiss*)
+ vendor=wrs
+ ;;
+- -aux*)
++ *-aux*)
+ vendor=apple
+ ;;
+- -hms*)
++ *-hms*)
+ vendor=hitachi
+ ;;
+- -mpw* | -macos*)
++ *-mpw* | *-macos*)
+ vendor=apple
+ ;;
+- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
+ vendor=atari
+ ;;
+- -vos*)
++ *-vos*)
+ vendor=stratus
+ ;;
+ esac
+- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+ esac
+
+-echo $basic_machine$os
++echo "$cpu-$vendor-${kernel:+$kernel-}$os"
+ exit
+
+ # Local variables:
+-# eval: (add-hook 'write-file-hooks 'time-stamp)
++# eval: (add-hook 'before-save-hook 'time-stamp)
+ # time-stamp-start: "timestamp='"
+ # time-stamp-format: "%:y-%02m-%02d"
+ # time-stamp-end: "'"
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/autotools/ltmain.sh b/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/autotools/ltmain.sh
+index a72f2fd78bfc..84776e95f5dc 100755
+--- a/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/autotools/ltmain.sh
++++ b/qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/autotools/ltmain.sh
+@@ -5564,7 +5564,7 @@ func_mode_link ()
+ *)
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+- need_relink=yes
++ need_relink="no"
+ fi
+ ;;
+ esac
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/icu/source/config.sub b/qtwebengine/src/3rdparty/chromium/third_party/icu/source/config.sub
+index fb5794786954..de4259e40479 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/icu/source/config.sub
++++ b/qtwebengine/src/3rdparty/chromium/third_party/icu/source/config.sub
+@@ -1,12 +1,14 @@
+ #! /bin/sh
+ # Configuration validation subroutine script.
+-# Copyright 1992-2017 Free Software Foundation, Inc.
++# Copyright 1992-2023 Free Software Foundation, Inc.
+
+-timestamp='2017-11-04'
++# shellcheck disable=SC2006,SC2268 # see below for rationale
++
++timestamp='2023-01-21'
+
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 3 of the License, or
++# the Free Software Foundation, either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful, but
+@@ -33,7 +35,7 @@ timestamp='2017-11-04'
+ # Otherwise, we print the canonical config type on stdout and succeed.
+
+ # You can get the latest version of this script from:
+-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
++# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+
+ # This file is supposed to be the same for all GNU packages
+ # and recognize all the CPU types, system types and aliases
+@@ -50,6 +52,13 @@ timestamp='2017-11-04'
+ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+ # It is wrong to echo any other type of specification.
+
++# The "shellcheck disable" line above the timestamp inhibits complaints
++# about features and limitations of the classic Bourne shell that were
++# superseded or lifted in POSIX. However, this script identifies a wide
++# variety of pre-POSIX systems that do not have POSIX shells at all, and
++# even some reasonably current systems (Solaris 10 as case-in-point) still
++# have a pre-POSIX /bin/sh.
++
+ me=`echo "$0" | sed -e 's,.*/,,'`
+
+ usage="\
+@@ -67,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
+ version="\
+ GNU config.sub ($timestamp)
+
+-Copyright 1992-2017 Free Software Foundation, Inc.
++Copyright 1992-2023 Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -89,12 +98,12 @@ while test $# -gt 0 ; do
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+- echo "$me: invalid option $1$help"
++ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+- echo $1
++ echo "$1"
+ exit ;;
+
+ * )
+@@ -110,1251 +119,1186 @@ case $# in
+ exit 1;;
+ esac
+
+-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+-# Here we must recognize all the valid KERNEL-OS combinations.
+-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+-case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+- kopensolaris*-gnu* | cloudabi*-eabi* | \
+- storm-chaos* | os2-emx* | rtmk-nova*)
+- os=-$maybe_os
+- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+- ;;
+- android-linux)
+- os=-linux-android
+- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+- ;;
+- *)
+- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+- if [ $basic_machine != $1 ]
+- then os=`echo $1 | sed 's/.*-/-/'`
+- else os=; fi
+- ;;
+-esac
++# Split fields of configuration type
++# shellcheck disable=SC2162
++saved_IFS=$IFS
++IFS="-" read field1 field2 field3 field4 <<EOF
++$1
++EOF
++IFS=$saved_IFS
+
+-### Let's recognize common machines as not being operating systems so
+-### that things like config.sub decstation-3100 work. We also
+-### recognize some manufacturers as not being operating systems, so we
+-### can provide default operating systems below.
+-case $os in
+- -sun*os*)
+- # Prevent following clause from handling this invalid input.
+- ;;
+- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+- -apple | -axis | -knuth | -cray | -microblaze*)
+- os=
+- basic_machine=$1
+- ;;
+- -bluegene*)
+- os=-cnk
+- ;;
+- -sim | -cisco | -oki | -wec | -winbond)
+- os=
+- basic_machine=$1
+- ;;
+- -scout)
+- ;;
+- -wrs)
+- os=-vxworks
+- basic_machine=$1
+- ;;
+- -chorusos*)
+- os=-chorusos
+- basic_machine=$1
+- ;;
+- -chorusrdb)
+- os=-chorusrdb
+- basic_machine=$1
+- ;;
+- -hiux*)
+- os=-hiuxwe2
+- ;;
+- -sco6)
+- os=-sco5v6
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco5)
+- os=-sco3.2v5
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco4)
+- os=-sco3.2v4
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco3.2.[4-9]*)
+- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco3.2v[4-9]*)
+- # Don't forget version if it is 3.2v4 or newer.
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco5v6*)
+- # Don't forget version if it is 3.2v4 or newer.
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco*)
+- os=-sco3.2v2
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -udk*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -isc)
+- os=-isc2.2
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -clix*)
+- basic_machine=clipper-intergraph
+- ;;
+- -isc*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -lynx*178)
+- os=-lynxos178
+- ;;
+- -lynx*5)
+- os=-lynxos5
++# Separate into logical components for further validation
++case $1 in
++ *-*-*-*-*)
++ echo Invalid configuration \`"$1"\': more than four components >&2
++ exit 1
+ ;;
+- -lynx*)
+- os=-lynxos
++ *-*-*-*)
++ basic_machine=$field1-$field2
++ basic_os=$field3-$field4
+ ;;
+- -ptx*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
++ *-*-*)
++ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
++ # parts
++ maybe_os=$field2-$field3
++ case $maybe_os in
++ nto-qnx* | linux-* | uclinux-uclibc* \
++ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
++ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
++ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*)
++ basic_machine=$field1
++ basic_os=$maybe_os
++ ;;
++ android-linux)
++ basic_machine=$field1-unknown
++ basic_os=linux-android
++ ;;
++ *)
++ basic_machine=$field1-$field2
++ basic_os=$field3
++ ;;
++ esac
+ ;;
+- -psos*)
+- os=-psos
++ *-*)
++ # A lone config we happen to match not fitting any pattern
++ case $field1-$field2 in
++ decstation-3100)
++ basic_machine=mips-dec
++ basic_os=
++ ;;
++ *-*)
++ # Second component is usually, but not always the OS
++ case $field2 in
++ # Prevent following clause from handling this valid os
++ sun*os*)
++ basic_machine=$field1
++ basic_os=$field2
++ ;;
++ zephyr*)
++ basic_machine=$field1-unknown
++ basic_os=$field2
++ ;;
++ # Manufacturers
++ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
++ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
++ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
++ | convergent* | ncr* | news | 32* | 3600* | 3100* \
++ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
++ | ultra | tti* | harris | dolphin | highlevel | gould \
++ | cbm | ns | masscomp | apple | axis | knuth | cray \
++ | microblaze* | sim | cisco \
++ | oki | wec | wrs | winbond)
++ basic_machine=$field1-$field2
++ basic_os=
++ ;;
++ *)
++ basic_machine=$field1
++ basic_os=$field2
++ ;;
++ esac
++ ;;
++ esac
+ ;;
+- -mint | -mint[0-9]*)
+- basic_machine=m68k-atari
+- os=-mint
++ *)
++ # Convert single-component short-hands not valid as part of
++ # multi-component configurations.
++ case $field1 in
++ 386bsd)
++ basic_machine=i386-pc
++ basic_os=bsd
++ ;;
++ a29khif)
++ basic_machine=a29k-amd
++ basic_os=udi
++ ;;
++ adobe68k)
++ basic_machine=m68010-adobe
++ basic_os=scout
++ ;;
++ alliant)
++ basic_machine=fx80-alliant
++ basic_os=
++ ;;
++ altos | altos3068)
++ basic_machine=m68k-altos
++ basic_os=
++ ;;
++ am29k)
++ basic_machine=a29k-none
++ basic_os=bsd
++ ;;
++ amdahl)
++ basic_machine=580-amdahl
++ basic_os=sysv
++ ;;
++ amiga)
++ basic_machine=m68k-unknown
++ basic_os=
++ ;;
++ amigaos | amigados)
++ basic_machine=m68k-unknown
++ basic_os=amigaos
++ ;;
++ amigaunix | amix)
++ basic_machine=m68k-unknown
++ basic_os=sysv4
++ ;;
++ apollo68)
++ basic_machine=m68k-apollo
++ basic_os=sysv
++ ;;
++ apollo68bsd)
++ basic_machine=m68k-apollo
++ basic_os=bsd
++ ;;
++ aros)
++ basic_machine=i386-pc
++ basic_os=aros
++ ;;
++ aux)
++ basic_machine=m68k-apple
++ basic_os=aux
++ ;;
++ balance)
++ basic_machine=ns32k-sequent
++ basic_os=dynix
++ ;;
++ blackfin)
++ basic_machine=bfin-unknown
++ basic_os=linux
++ ;;
++ cegcc)
++ basic_machine=arm-unknown
++ basic_os=cegcc
++ ;;
++ convex-c1)
++ basic_machine=c1-convex
++ basic_os=bsd
++ ;;
++ convex-c2)
++ basic_machine=c2-convex
++ basic_os=bsd
++ ;;
++ convex-c32)
++ basic_machine=c32-convex
++ basic_os=bsd
++ ;;
++ convex-c34)
++ basic_machine=c34-convex
++ basic_os=bsd
++ ;;
++ convex-c38)
++ basic_machine=c38-convex
++ basic_os=bsd
++ ;;
++ cray)
++ basic_machine=j90-cray
++ basic_os=unicos
++ ;;
++ crds | unos)
++ basic_machine=m68k-crds
++ basic_os=
++ ;;
++ da30)
++ basic_machine=m68k-da30
++ basic_os=
++ ;;
++ decstation | pmax | pmin | dec3100 | decstatn)
++ basic_machine=mips-dec
++ basic_os=
++ ;;
++ delta88)
++ basic_machine=m88k-motorola
++ basic_os=sysv3
++ ;;
++ dicos)
++ basic_machine=i686-pc
++ basic_os=dicos
++ ;;
++ djgpp)
++ basic_machine=i586-pc
++ basic_os=msdosdjgpp
++ ;;
++ ebmon29k)
++ basic_machine=a29k-amd
++ basic_os=ebmon
++ ;;
++ es1800 | OSE68k | ose68k | ose | OSE)
++ basic_machine=m68k-ericsson
++ basic_os=ose
++ ;;
++ gmicro)
++ basic_machine=tron-gmicro
++ basic_os=sysv
++ ;;
++ go32)
++ basic_machine=i386-pc
++ basic_os=go32
++ ;;
++ h8300hms)
++ basic_machine=h8300-hitachi
++ basic_os=hms
++ ;;
++ h8300xray)
++ basic_machine=h8300-hitachi
++ basic_os=xray
++ ;;
++ h8500hms)
++ basic_machine=h8500-hitachi
++ basic_os=hms
++ ;;
++ harris)
++ basic_machine=m88k-harris
++ basic_os=sysv3
++ ;;
++ hp300 | hp300hpux)
++ basic_machine=m68k-hp
++ basic_os=hpux
++ ;;
++ hp300bsd)
++ basic_machine=m68k-hp
++ basic_os=bsd
++ ;;
++ hppaosf)
++ basic_machine=hppa1.1-hp
++ basic_os=osf
++ ;;
++ hppro)
++ basic_machine=hppa1.1-hp
++ basic_os=proelf
++ ;;
++ i386mach)
++ basic_machine=i386-mach
++ basic_os=mach
++ ;;
++ isi68 | isi)
++ basic_machine=m68k-isi
++ basic_os=sysv
++ ;;
++ m68knommu)
++ basic_machine=m68k-unknown
++ basic_os=linux
++ ;;
++ magnum | m3230)
++ basic_machine=mips-mips
++ basic_os=sysv
++ ;;
++ merlin)
++ basic_machine=ns32k-utek
++ basic_os=sysv
++ ;;
++ mingw64)
++ basic_machine=x86_64-pc
++ basic_os=mingw64
++ ;;
++ mingw32)
++ basic_machine=i686-pc
++ basic_os=mingw32
++ ;;
++ mingw32ce)
++ basic_machine=arm-unknown
++ basic_os=mingw32ce
++ ;;
++ monitor)
++ basic_machine=m68k-rom68k
++ basic_os=coff
++ ;;
++ morphos)
++ basic_machine=powerpc-unknown
++ basic_os=morphos
++ ;;
++ moxiebox)
++ basic_machine=moxie-unknown
++ basic_os=moxiebox
++ ;;
++ msdos)
++ basic_machine=i386-pc
++ basic_os=msdos
++ ;;
++ msys)
++ basic_machine=i686-pc
++ basic_os=msys
++ ;;
++ mvs)
++ basic_machine=i370-ibm
++ basic_os=mvs
++ ;;
++ nacl)
++ basic_machine=le32-unknown
++ basic_os=nacl
++ ;;
++ ncr3000)
++ basic_machine=i486-ncr
++ basic_os=sysv4
++ ;;
++ netbsd386)
++ basic_machine=i386-pc
++ basic_os=netbsd
++ ;;
++ netwinder)
++ basic_machine=armv4l-rebel
++ basic_os=linux
++ ;;
++ news | news700 | news800 | news900)
++ basic_machine=m68k-sony
++ basic_os=newsos
++ ;;
++ news1000)
++ basic_machine=m68030-sony
++ basic_os=newsos
++ ;;
++ necv70)
++ basic_machine=v70-nec
++ basic_os=sysv
++ ;;
++ nh3000)
++ basic_machine=m68k-harris
++ basic_os=cxux
++ ;;
++ nh[45]000)
++ basic_machine=m88k-harris
++ basic_os=cxux
++ ;;
++ nindy960)
++ basic_machine=i960-intel
++ basic_os=nindy
++ ;;
++ mon960)
++ basic_machine=i960-intel
++ basic_os=mon960
++ ;;
++ nonstopux)
++ basic_machine=mips-compaq
++ basic_os=nonstopux
++ ;;
++ os400)
++ basic_machine=powerpc-ibm
++ basic_os=os400
++ ;;
++ OSE68000 | ose68000)
++ basic_machine=m68000-ericsson
++ basic_os=ose
++ ;;
++ os68k)
++ basic_machine=m68k-none
++ basic_os=os68k
++ ;;
++ paragon)
++ basic_machine=i860-intel
++ basic_os=osf
++ ;;
++ parisc)
++ basic_machine=hppa-unknown
++ basic_os=linux
++ ;;
++ psp)
++ basic_machine=mipsallegrexel-sony
++ basic_os=psp
++ ;;
++ pw32)
++ basic_machine=i586-unknown
++ basic_os=pw32
++ ;;
++ rdos | rdos64)
++ basic_machine=x86_64-pc
++ basic_os=rdos
++ ;;
++ rdos32)
++ basic_machine=i386-pc
++ basic_os=rdos
++ ;;
++ rom68k)
++ basic_machine=m68k-rom68k
++ basic_os=coff
++ ;;
++ sa29200)
++ basic_machine=a29k-amd
++ basic_os=udi
++ ;;
++ sei)
++ basic_machine=mips-sei
++ basic_os=seiux
++ ;;
++ sequent)
++ basic_machine=i386-sequent
++ basic_os=
++ ;;
++ sps7)
++ basic_machine=m68k-bull
++ basic_os=sysv2
++ ;;
++ st2000)
++ basic_machine=m68k-tandem
++ basic_os=
++ ;;
++ stratus)
++ basic_machine=i860-stratus
++ basic_os=sysv4
++ ;;
++ sun2)
++ basic_machine=m68000-sun
++ basic_os=
++ ;;
++ sun2os3)
++ basic_machine=m68000-sun
++ basic_os=sunos3
++ ;;
++ sun2os4)
++ basic_machine=m68000-sun
++ basic_os=sunos4
++ ;;
++ sun3)
++ basic_machine=m68k-sun
++ basic_os=
++ ;;
++ sun3os3)
++ basic_machine=m68k-sun
++ basic_os=sunos3
++ ;;
++ sun3os4)
++ basic_machine=m68k-sun
++ basic_os=sunos4
++ ;;
++ sun4)
++ basic_machine=sparc-sun
++ basic_os=
++ ;;
++ sun4os3)
++ basic_machine=sparc-sun
++ basic_os=sunos3
++ ;;
++ sun4os4)
++ basic_machine=sparc-sun
++ basic_os=sunos4
++ ;;
++ sun4sol2)
++ basic_machine=sparc-sun
++ basic_os=solaris2
++ ;;
++ sun386 | sun386i | roadrunner)
++ basic_machine=i386-sun
++ basic_os=
++ ;;
++ sv1)
++ basic_machine=sv1-cray
++ basic_os=unicos
++ ;;
++ symmetry)
++ basic_machine=i386-sequent
++ basic_os=dynix
++ ;;
++ t3e)
++ basic_machine=alphaev5-cray
++ basic_os=unicos
++ ;;
++ t90)
++ basic_machine=t90-cray
++ basic_os=unicos
++ ;;
++ toad1)
++ basic_machine=pdp10-xkl
++ basic_os=tops20
++ ;;
++ tpf)
++ basic_machine=s390x-ibm
++ basic_os=tpf
++ ;;
++ udi29k)
++ basic_machine=a29k-amd
++ basic_os=udi
++ ;;
++ ultra3)
++ basic_machine=a29k-nyu
++ basic_os=sym1
++ ;;
++ v810 | necv810)
++ basic_machine=v810-nec
++ basic_os=none
++ ;;
++ vaxv)
++ basic_machine=vax-dec
++ basic_os=sysv
++ ;;
++ vms)
++ basic_machine=vax-dec
++ basic_os=vms
++ ;;
++ vsta)
++ basic_machine=i386-pc
++ basic_os=vsta
++ ;;
++ vxworks960)
++ basic_machine=i960-wrs
++ basic_os=vxworks
++ ;;
++ vxworks68)
++ basic_machine=m68k-wrs
++ basic_os=vxworks
++ ;;
++ vxworks29k)
++ basic_machine=a29k-wrs
++ basic_os=vxworks
++ ;;
++ xbox)
++ basic_machine=i686-pc
++ basic_os=mingw32
++ ;;
++ ymp)
++ basic_machine=ymp-cray
++ basic_os=unicos
++ ;;
++ *)
++ basic_machine=$1
++ basic_os=
++ ;;
++ esac
+ ;;
+ esac
+
+-# Decode aliases for certain CPU-COMPANY combinations.
++# Decode 1-component or ad-hoc basic machines
+ case $basic_machine in
+- # Recognize the basic CPU types without company name.
+- # Some are omitted here because they have special meanings below.
+- 1750a | 580 \
+- | a29k \
+- | aarch64 | aarch64_be \
+- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+- | am33_2.0 \
+- | arc | arceb \
+- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+- | avr | avr32 \
+- | ba \
+- | be32 | be64 \
+- | bfin \
+- | c4x | c8051 | clipper \
+- | d10v | d30v | dlx | dsp16xx \
+- | e2k | epiphany \
+- | fido | fr30 | frv | ft32 \
+- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+- | hexagon \
+- | i370 | i860 | i960 | ia16 | ia64 \
+- | ip2k | iq2000 \
+- | k1om \
+- | le32 | le64 \
+- | lm32 \
+- | m32c | m32r | m32rle | m68000 | m68k | m88k \
+- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+- | mips | mipsbe | mipseb | mipsel | mipsle \
+- | mips16 \
+- | mips64 | mips64el \
+- | mips64octeon | mips64octeonel \
+- | mips64orion | mips64orionel \
+- | mips64r5900 | mips64r5900el \
+- | mips64vr | mips64vrel \
+- | mips64vr4100 | mips64vr4100el \
+- | mips64vr4300 | mips64vr4300el \
+- | mips64vr5000 | mips64vr5000el \
+- | mips64vr5900 | mips64vr5900el \
+- | mipsisa32 | mipsisa32el \
+- | mipsisa32r2 | mipsisa32r2el \
+- | mipsisa32r6 | mipsisa32r6el \
+- | mipsisa64 | mipsisa64el \
+- | mipsisa64r2 | mipsisa64r2el \
+- | mipsisa64r6 | mipsisa64r6el \
+- | mipsisa64sb1 | mipsisa64sb1el \
+- | mipsisa64sr71k | mipsisa64sr71kel \
+- | mipsr5900 | mipsr5900el \
+- | mipstx39 | mipstx39el \
+- | mn10200 | mn10300 \
+- | moxie \
+- | mt \
+- | msp430 \
+- | nds32 | nds32le | nds32be \
+- | nios | nios2 | nios2eb | nios2el \
+- | ns16k | ns32k \
+- | open8 | or1k | or1knd | or32 \
+- | pdp10 | pdp11 | pj | pjl \
+- | powerpc | powerpc64 | powerpc64le | powerpcle \
+- | pru \
+- | pyramid \
+- | riscv32 | riscv64 \
+- | rl78 | rx \
+- | score \
+- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+- | sh64 | sh64le \
+- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+- | spu \
+- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+- | ubicom32 \
+- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+- | visium \
+- | wasm32 \
+- | x86 | xc16x | xstormy16 | xtensa \
+- | z8k | z80)
+- basic_machine=$basic_machine-unknown
+- ;;
+- c54x)
+- basic_machine=tic54x-unknown
+- ;;
+- c55x)
+- basic_machine=tic55x-unknown
+- ;;
+- c6x)
+- basic_machine=tic6x-unknown
+- ;;
+- leon|leon[3-9])
+- basic_machine=sparc-$basic_machine
++ # Here we handle the default manufacturer of certain CPU types. It is in
++ # some cases the only manufacturer, in others, it is the most popular.
++ w89k)
++ cpu=hppa1.1
++ vendor=winbond
+ ;;
+- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+- basic_machine=$basic_machine-unknown
+- os=-none
++ op50n)
++ cpu=hppa1.1
++ vendor=oki
+ ;;
+- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
++ op60c)
++ cpu=hppa1.1
++ vendor=oki
+ ;;
+- ms1)
+- basic_machine=mt-unknown
++ ibm*)
++ cpu=i370
++ vendor=ibm
+ ;;
+-
+- strongarm | thumb | xscale)
+- basic_machine=arm-unknown
+- ;;
+- xgate)
+- basic_machine=$basic_machine-unknown
+- os=-none
++ orion105)
++ cpu=clipper
++ vendor=highlevel
+ ;;
+- xscaleeb)
+- basic_machine=armeb-unknown
++ mac | mpw | mac-mpw)
++ cpu=m68k
++ vendor=apple
+ ;;
+-
+- xscaleel)
+- basic_machine=armel-unknown
++ pmac | pmac-mpw)
++ cpu=powerpc
++ vendor=apple
+ ;;
+
+- # We use `pc' rather than `unknown'
+- # because (1) that's what they normally are, and
+- # (2) the word "unknown" tends to confuse beginning users.
+- i*86 | x86_64)
+- basic_machine=$basic_machine-pc
+- ;;
+- # Object if more than one company name word.
+- *-*-*)
+- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+- exit 1
+- ;;
+- # Recognize the basic CPU types with company name.
+- 580-* \
+- | a29k-* \
+- | aarch64-* | aarch64_be-* \
+- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+- | avr-* | avr32-* \
+- | ba-* \
+- | be32-* | be64-* \
+- | bfin-* | bs2000-* \
+- | c[123]* | c30-* | [cjt]90-* | c4x-* \
+- | c8051-* | clipper-* | craynv-* | cydra-* \
+- | d10v-* | d30v-* | dlx-* \
+- | e2k-* | elxsi-* \
+- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+- | h8300-* | h8500-* \
+- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+- | hexagon-* \
+- | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
+- | ip2k-* | iq2000-* \
+- | k1om-* \
+- | le32-* | le64-* \
+- | lm32-* \
+- | m32c-* | m32r-* | m32rle-* \
+- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+- | microblaze-* | microblazeel-* \
+- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+- | mips16-* \
+- | mips64-* | mips64el-* \
+- | mips64octeon-* | mips64octeonel-* \
+- | mips64orion-* | mips64orionel-* \
+- | mips64r5900-* | mips64r5900el-* \
+- | mips64vr-* | mips64vrel-* \
+- | mips64vr4100-* | mips64vr4100el-* \
+- | mips64vr4300-* | mips64vr4300el-* \
+- | mips64vr5000-* | mips64vr5000el-* \
+- | mips64vr5900-* | mips64vr5900el-* \
+- | mipsisa32-* | mipsisa32el-* \
+- | mipsisa32r2-* | mipsisa32r2el-* \
+- | mipsisa32r6-* | mipsisa32r6el-* \
+- | mipsisa64-* | mipsisa64el-* \
+- | mipsisa64r2-* | mipsisa64r2el-* \
+- | mipsisa64r6-* | mipsisa64r6el-* \
+- | mipsisa64sb1-* | mipsisa64sb1el-* \
+- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+- | mipsr5900-* | mipsr5900el-* \
+- | mipstx39-* | mipstx39el-* \
+- | mmix-* \
+- | mt-* \
+- | msp430-* \
+- | nds32-* | nds32le-* | nds32be-* \
+- | nios-* | nios2-* | nios2eb-* | nios2el-* \
+- | none-* | np1-* | ns16k-* | ns32k-* \
+- | open8-* \
+- | or1k*-* \
+- | orion-* \
+- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+- | pru-* \
+- | pyramid-* \
+- | riscv32-* | riscv64-* \
+- | rl78-* | romp-* | rs6000-* | rx-* \
+- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+- | sparclite-* \
+- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
+- | tahoe-* \
+- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+- | tile*-* \
+- | tron-* \
+- | ubicom32-* \
+- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+- | vax-* \
+- | visium-* \
+- | wasm32-* \
+- | we32k-* \
+- | x86-* | x86_64-* | xc16x-* | xps100-* \
+- | xstormy16-* | xtensa*-* \
+- | ymp-* \
+- | z8k-* | z80-*)
+- ;;
+- # Recognize the basic CPU types without company name, with glob match.
+- xtensa*)
+- basic_machine=$basic_machine-unknown
+- ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+- 386bsd)
+- basic_machine=i386-unknown
+- os=-bsd
+- ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+- basic_machine=m68000-att
++ cpu=m68000
++ vendor=att
+ ;;
+ 3b*)
+- basic_machine=we32k-att
+- ;;
+- a29khif)
+- basic_machine=a29k-amd
+- os=-udi
+- ;;
+- abacus)
+- basic_machine=abacus-unknown
+- ;;
+- adobe68k)
+- basic_machine=m68010-adobe
+- os=-scout
+- ;;
+- alliant | fx80)
+- basic_machine=fx80-alliant
+- ;;
+- altos | altos3068)
+- basic_machine=m68k-altos
+- ;;
+- am29k)
+- basic_machine=a29k-none
+- os=-bsd
+- ;;
+- amd64)
+- basic_machine=x86_64-pc
+- ;;
+- amd64-*)
+- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- amdahl)
+- basic_machine=580-amdahl
+- os=-sysv
+- ;;
+- amiga | amiga-*)
+- basic_machine=m68k-unknown
+- ;;
+- amigaos | amigados)
+- basic_machine=m68k-unknown
+- os=-amigaos
+- ;;
+- amigaunix | amix)
+- basic_machine=m68k-unknown
+- os=-sysv4
+- ;;
+- apollo68)
+- basic_machine=m68k-apollo
+- os=-sysv
+- ;;
+- apollo68bsd)
+- basic_machine=m68k-apollo
+- os=-bsd
+- ;;
+- aros)
+- basic_machine=i386-pc
+- os=-aros
+- ;;
+- asmjs)
+- basic_machine=asmjs-unknown
+- ;;
+- aux)
+- basic_machine=m68k-apple
+- os=-aux
+- ;;
+- balance)
+- basic_machine=ns32k-sequent
+- os=-dynix
+- ;;
+- blackfin)
+- basic_machine=bfin-unknown
+- os=-linux
+- ;;
+- blackfin-*)
+- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=-linux
++ cpu=we32k
++ vendor=att
+ ;;
+ bluegene*)
+- basic_machine=powerpc-ibm
+- os=-cnk
+- ;;
+- c54x-*)
+- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- c55x-*)
+- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- c6x-*)
+- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- c90)
+- basic_machine=c90-cray
+- os=-unicos
+- ;;
+- cegcc)
+- basic_machine=arm-unknown
+- os=-cegcc
+- ;;
+- convex-c1)
+- basic_machine=c1-convex
+- os=-bsd
+- ;;
+- convex-c2)
+- basic_machine=c2-convex
+- os=-bsd
+- ;;
+- convex-c32)
+- basic_machine=c32-convex
+- os=-bsd
+- ;;
+- convex-c34)
+- basic_machine=c34-convex
+- os=-bsd
+- ;;
+- convex-c38)
+- basic_machine=c38-convex
+- os=-bsd
+- ;;
+- cray | j90)
+- basic_machine=j90-cray
+- os=-unicos
+- ;;
+- craynv)
+- basic_machine=craynv-cray
+- os=-unicosmp
+- ;;
+- cr16 | cr16-*)
+- basic_machine=cr16-unknown
+- os=-elf
+- ;;
+- crds | unos)
+- basic_machine=m68k-crds
+- ;;
+- crisv32 | crisv32-* | etraxfs*)
+- basic_machine=crisv32-axis
+- ;;
+- cris | cris-* | etrax*)
+- basic_machine=cris-axis
+- ;;
+- crx)
+- basic_machine=crx-unknown
+- os=-elf
+- ;;
+- da30 | da30-*)
+- basic_machine=m68k-da30
+- ;;
+- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+- basic_machine=mips-dec
++ cpu=powerpc
++ vendor=ibm
++ basic_os=cnk
+ ;;
+ decsystem10* | dec10*)
+- basic_machine=pdp10-dec
+- os=-tops10
++ cpu=pdp10
++ vendor=dec
++ basic_os=tops10
+ ;;
+ decsystem20* | dec20*)
+- basic_machine=pdp10-dec
+- os=-tops20
++ cpu=pdp10
++ vendor=dec
++ basic_os=tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+- basic_machine=m68k-motorola
+- ;;
+- delta88)
+- basic_machine=m88k-motorola
+- os=-sysv3
+- ;;
+- dicos)
+- basic_machine=i686-pc
+- os=-dicos
+- ;;
+- djgpp)
+- basic_machine=i586-pc
+- os=-msdosdjgpp
+- ;;
+- dpx20 | dpx20-*)
+- basic_machine=rs6000-bull
+- os=-bosx
++ cpu=m68k
++ vendor=motorola
+ ;;
+ dpx2*)
+- basic_machine=m68k-bull
+- os=-sysv3
+- ;;
+- e500v[12])
+- basic_machine=powerpc-unknown
+- os=$os"spe"
+- ;;
+- e500v[12]-*)
+- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=$os"spe"
+- ;;
+- ebmon29k)
+- basic_machine=a29k-amd
+- os=-ebmon
+- ;;
+- elxsi)
+- basic_machine=elxsi-elxsi
+- os=-bsd
++ cpu=m68k
++ vendor=bull
++ basic_os=sysv3
+ ;;
+ encore | umax | mmax)
+- basic_machine=ns32k-encore
++ cpu=ns32k
++ vendor=encore
+ ;;
+- es1800 | OSE68k | ose68k | ose | OSE)
+- basic_machine=m68k-ericsson
+- os=-ose
++ elxsi)
++ cpu=elxsi
++ vendor=elxsi
++ basic_os=${basic_os:-bsd}
+ ;;
+ fx2800)
+- basic_machine=i860-alliant
++ cpu=i860
++ vendor=alliant
+ ;;
+ genix)
+- basic_machine=ns32k-ns
+- ;;
+- gmicro)
+- basic_machine=tron-gmicro
+- os=-sysv
+- ;;
+- go32)
+- basic_machine=i386-pc
+- os=-go32
++ cpu=ns32k
++ vendor=ns
+ ;;
+ h3050r* | hiux*)
+- basic_machine=hppa1.1-hitachi
+- os=-hiuxwe2
+- ;;
+- h8300hms)
+- basic_machine=h8300-hitachi
+- os=-hms
+- ;;
+- h8300xray)
+- basic_machine=h8300-hitachi
+- os=-xray
+- ;;
+- h8500hms)
+- basic_machine=h8500-hitachi
+- os=-hms
+- ;;
+- harris)
+- basic_machine=m88k-harris
+- os=-sysv3
+- ;;
+- hp300-*)
+- basic_machine=m68k-hp
+- ;;
+- hp300bsd)
+- basic_machine=m68k-hp
+- os=-bsd
+- ;;
+- hp300hpux)
+- basic_machine=m68k-hp
+- os=-hpux
++ cpu=hppa1.1
++ vendor=hitachi
++ basic_os=hiuxwe2
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+- basic_machine=hppa1.0-hp
++ cpu=hppa1.0
++ vendor=hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+- basic_machine=m68000-hp
++ cpu=m68000
++ vendor=hp
+ ;;
+ hp9k3[2-9][0-9])
+- basic_machine=m68k-hp
++ cpu=m68k
++ vendor=hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+- basic_machine=hppa1.0-hp
++ cpu=hppa1.0
++ vendor=hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+- basic_machine=hppa1.1-hp
++ cpu=hppa1.1
++ vendor=hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+- basic_machine=hppa1.1-hp
++ cpu=hppa1.1
++ vendor=hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+- basic_machine=hppa1.1-hp
++ cpu=hppa1.1
++ vendor=hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+- basic_machine=hppa1.1-hp
++ cpu=hppa1.1
++ vendor=hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+- basic_machine=hppa1.0-hp
+- ;;
+- hppa-next)
+- os=-nextstep3
+- ;;
+- hppaosf)
+- basic_machine=hppa1.1-hp
+- os=-osf
+- ;;
+- hppro)
+- basic_machine=hppa1.1-hp
+- os=-proelf
+- ;;
+- i370-ibm* | ibm*)
+- basic_machine=i370-ibm
++ cpu=hppa1.0
++ vendor=hp
+ ;;
+ i*86v32)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-sysv32
++ cpu=`echo "$1" | sed -e 's/86.*/86/'`
++ vendor=pc
++ basic_os=sysv32
+ ;;
+ i*86v4*)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-sysv4
++ cpu=`echo "$1" | sed -e 's/86.*/86/'`
++ vendor=pc
++ basic_os=sysv4
+ ;;
+ i*86v)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-sysv
++ cpu=`echo "$1" | sed -e 's/86.*/86/'`
++ vendor=pc
++ basic_os=sysv
+ ;;
+ i*86sol2)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-solaris2
++ cpu=`echo "$1" | sed -e 's/86.*/86/'`
++ vendor=pc
++ basic_os=solaris2
+ ;;
+- i386mach)
+- basic_machine=i386-mach
+- os=-mach
+- ;;
+- i386-vsta | vsta)
+- basic_machine=i386-unknown
+- os=-vsta
++ j90 | j90-cray)
++ cpu=j90
++ vendor=cray
++ basic_os=${basic_os:-unicos}
+ ;;
+ iris | iris4d)
+- basic_machine=mips-sgi
+- case $os in
+- -irix*)
++ cpu=mips
++ vendor=sgi
++ case $basic_os in
++ irix*)
+ ;;
+ *)
+- os=-irix4
++ basic_os=irix4
+ ;;
+ esac
+ ;;
+- isi68 | isi)
+- basic_machine=m68k-isi
+- os=-sysv
+- ;;
+- leon-*|leon[3-9]-*)
+- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+- ;;
+- m68knommu)
+- basic_machine=m68k-unknown
+- os=-linux
+- ;;
+- m68knommu-*)
+- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=-linux
+- ;;
+- m88k-omron*)
+- basic_machine=m88k-omron
+- ;;
+- magnum | m3230)
+- basic_machine=mips-mips
+- os=-sysv
+- ;;
+- merlin)
+- basic_machine=ns32k-utek
+- os=-sysv
+- ;;
+- microblaze*)
+- basic_machine=microblaze-xilinx
+- ;;
+- mingw64)
+- basic_machine=x86_64-pc
+- os=-mingw64
+- ;;
+- mingw32)
+- basic_machine=i686-pc
+- os=-mingw32
+- ;;
+- mingw32ce)
+- basic_machine=arm-unknown
+- os=-mingw32ce
+- ;;
+ miniframe)
+- basic_machine=m68000-convergent
+- ;;
+- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+- basic_machine=m68k-atari
+- os=-mint
+- ;;
+- mips3*-*)
+- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+- ;;
+- mips3*)
+- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+- ;;
+- monitor)
+- basic_machine=m68k-rom68k
+- os=-coff
+- ;;
+- morphos)
+- basic_machine=powerpc-unknown
+- os=-morphos
++ cpu=m68000
++ vendor=convergent
+ ;;
+- moxiebox)
+- basic_machine=moxie-unknown
+- os=-moxiebox
+- ;;
+- msdos)
+- basic_machine=i386-pc
+- os=-msdos
+- ;;
+- ms1-*)
+- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+- ;;
+- msys)
+- basic_machine=i686-pc
+- os=-msys
+- ;;
+- mvs)
+- basic_machine=i370-ibm
+- os=-mvs
+- ;;
+- nacl)
+- basic_machine=le32-unknown
+- os=-nacl
+- ;;
+- ncr3000)
+- basic_machine=i486-ncr
+- os=-sysv4
+- ;;
+- netbsd386)
+- basic_machine=i386-unknown
+- os=-netbsd
+- ;;
+- netwinder)
+- basic_machine=armv4l-rebel
+- os=-linux
+- ;;
+- news | news700 | news800 | news900)
+- basic_machine=m68k-sony
+- os=-newsos
+- ;;
+- news1000)
+- basic_machine=m68030-sony
+- os=-newsos
++ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
++ cpu=m68k
++ vendor=atari
++ basic_os=mint
+ ;;
+ news-3600 | risc-news)
+- basic_machine=mips-sony
+- os=-newsos
+- ;;
+- necv70)
+- basic_machine=v70-nec
+- os=-sysv
++ cpu=mips
++ vendor=sony
++ basic_os=newsos
+ ;;
+ next | m*-next)
+- basic_machine=m68k-next
+- case $os in
+- -nextstep* )
++ cpu=m68k
++ vendor=next
++ case $basic_os in
++ openstep*)
++ ;;
++ nextstep*)
+ ;;
+- -ns2*)
+- os=-nextstep2
++ ns2*)
++ basic_os=nextstep2
+ ;;
+ *)
+- os=-nextstep3
++ basic_os=nextstep3
+ ;;
+ esac
+ ;;
+- nh3000)
+- basic_machine=m68k-harris
+- os=-cxux
+- ;;
+- nh[45]000)
+- basic_machine=m88k-harris
+- os=-cxux
+- ;;
+- nindy960)
+- basic_machine=i960-intel
+- os=-nindy
+- ;;
+- mon960)
+- basic_machine=i960-intel
+- os=-mon960
+- ;;
+- nonstopux)
+- basic_machine=mips-compaq
+- os=-nonstopux
+- ;;
+ np1)
+- basic_machine=np1-gould
+- ;;
+- neo-tandem)
+- basic_machine=neo-tandem
+- ;;
+- nse-tandem)
+- basic_machine=nse-tandem
+- ;;
+- nsr-tandem)
+- basic_machine=nsr-tandem
+- ;;
+- nsx-tandem)
+- basic_machine=nsx-tandem
++ cpu=np1
++ vendor=gould
+ ;;
+ op50n-* | op60c-*)
+- basic_machine=hppa1.1-oki
+- os=-proelf
+- ;;
+- openrisc | openrisc-*)
+- basic_machine=or32-unknown
+- ;;
+- os400)
+- basic_machine=powerpc-ibm
+- os=-os400
+- ;;
+- OSE68000 | ose68000)
+- basic_machine=m68000-ericsson
+- os=-ose
+- ;;
+- os68k)
+- basic_machine=m68k-none
+- os=-os68k
++ cpu=hppa1.1
++ vendor=oki
++ basic_os=proelf
+ ;;
+ pa-hitachi)
+- basic_machine=hppa1.1-hitachi
+- os=-hiuxwe2
+- ;;
+- paragon)
+- basic_machine=i860-intel
+- os=-osf
+- ;;
+- parisc)
+- basic_machine=hppa-unknown
+- os=-linux
+- ;;
+- parisc-*)
+- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=-linux
++ cpu=hppa1.1
++ vendor=hitachi
++ basic_os=hiuxwe2
+ ;;
+ pbd)
+- basic_machine=sparc-tti
++ cpu=sparc
++ vendor=tti
+ ;;
+ pbb)
+- basic_machine=m68k-tti
+- ;;
+- pc532 | pc532-*)
+- basic_machine=ns32k-pc532
+- ;;
+- pc98)
+- basic_machine=i386-pc
+- ;;
+- pc98-*)
+- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentium | p5 | k5 | k6 | nexgen | viac3)
+- basic_machine=i586-pc
+- ;;
+- pentiumpro | p6 | 6x86 | athlon | athlon_*)
+- basic_machine=i686-pc
+- ;;
+- pentiumii | pentium2 | pentiumiii | pentium3)
+- basic_machine=i686-pc
+- ;;
+- pentium4)
+- basic_machine=i786-pc
+- ;;
+- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
++ cpu=m68k
++ vendor=tti
+ ;;
+- pentiumpro-* | p6-* | 6x86-* | athlon-*)
+- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentium4-*)
+- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
++ pc532)
++ cpu=ns32k
++ vendor=pc532
+ ;;
+ pn)
+- basic_machine=pn-gould
+- ;;
+- power) basic_machine=power-ibm
+- ;;
+- ppc | ppcbe) basic_machine=powerpc-unknown
+- ;;
+- ppc-* | ppcbe-*)
+- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- ppcle | powerpclittle)
+- basic_machine=powerpcle-unknown
+- ;;
+- ppcle-* | powerpclittle-*)
+- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- ppc64) basic_machine=powerpc64-unknown
+- ;;
+- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- ppc64le | powerpc64little)
+- basic_machine=powerpc64le-unknown
++ cpu=pn
++ vendor=gould
+ ;;
+- ppc64le-* | powerpc64little-*)
+- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
++ power)
++ cpu=power
++ vendor=ibm
+ ;;
+ ps2)
+- basic_machine=i386-ibm
+- ;;
+- pw32)
+- basic_machine=i586-unknown
+- os=-pw32
+- ;;
+- rdos | rdos64)
+- basic_machine=x86_64-pc
+- os=-rdos
+- ;;
+- rdos32)
+- basic_machine=i386-pc
+- os=-rdos
+- ;;
+- rom68k)
+- basic_machine=m68k-rom68k
+- os=-coff
++ cpu=i386
++ vendor=ibm
+ ;;
+ rm[46]00)
+- basic_machine=mips-siemens
++ cpu=mips
++ vendor=siemens
+ ;;
+ rtpc | rtpc-*)
+- basic_machine=romp-ibm
+- ;;
+- s390 | s390-*)
+- basic_machine=s390-ibm
+- ;;
+- s390x | s390x-*)
+- basic_machine=s390x-ibm
+- ;;
+- sa29200)
+- basic_machine=a29k-amd
+- os=-udi
+- ;;
+- sb1)
+- basic_machine=mipsisa64sb1-unknown
+- ;;
+- sb1el)
+- basic_machine=mipsisa64sb1el-unknown
++ cpu=romp
++ vendor=ibm
+ ;;
+ sde)
+- basic_machine=mipsisa32-sde
+- os=-elf
++ cpu=mipsisa32
++ vendor=sde
++ basic_os=${basic_os:-elf}
+ ;;
+- sei)
+- basic_machine=mips-sei
+- os=-seiux
++ simso-wrs)
++ cpu=sparclite
++ vendor=wrs
++ basic_os=vxworks
+ ;;
+- sequent)
+- basic_machine=i386-sequent
++ tower | tower-32)
++ cpu=m68k
++ vendor=ncr
+ ;;
+- sh)
+- basic_machine=sh-hitachi
+- os=-hms
++ vpp*|vx|vx-*)
++ cpu=f301
++ vendor=fujitsu
+ ;;
+- sh5el)
+- basic_machine=sh5le-unknown
++ w65)
++ cpu=w65
++ vendor=wdc
+ ;;
+- sh64)
+- basic_machine=sh64-unknown
++ w89k-*)
++ cpu=hppa1.1
++ vendor=winbond
++ basic_os=proelf
+ ;;
+- sparclite-wrs | simso-wrs)
+- basic_machine=sparclite-wrs
+- os=-vxworks
++ none)
++ cpu=none
++ vendor=none
+ ;;
+- sps7)
+- basic_machine=m68k-bull
+- os=-sysv2
++ leon|leon[3-9])
++ cpu=sparc
++ vendor=$basic_machine
+ ;;
+- spur)
+- basic_machine=spur-unknown
++ leon-*|leon[3-9]-*)
++ cpu=sparc
++ vendor=`echo "$basic_machine" | sed 's/-.*//'`
+ ;;
+- st2000)
+- basic_machine=m68k-tandem
++
++ *-*)
++ # shellcheck disable=SC2162
++ saved_IFS=$IFS
++ IFS="-" read cpu vendor <<EOF
++$basic_machine
++EOF
++ IFS=$saved_IFS
+ ;;
+- stratus)
+- basic_machine=i860-stratus
+- os=-sysv4
++ # We use `pc' rather than `unknown'
++ # because (1) that's what they normally are, and
++ # (2) the word "unknown" tends to confuse beginning users.
++ i*86 | x86_64)
++ cpu=$basic_machine
++ vendor=pc
+ ;;
+- strongarm-* | thumb-*)
+- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
++ # These rules are duplicated from below for sake of the special case above;
++ # i.e. things that normalized to x86 arches should also default to "pc"
++ pc98)
++ cpu=i386
++ vendor=pc
++ ;;
++ x64 | amd64)
++ cpu=x86_64
++ vendor=pc
+ ;;
+- sun2)
+- basic_machine=m68000-sun
++ # Recognize the basic CPU types without company name.
++ *)
++ cpu=$basic_machine
++ vendor=unknown
+ ;;
+- sun2os3)
+- basic_machine=m68000-sun
+- os=-sunos3
++esac
++
++unset -v basic_machine
++
++# Decode basic machines in the full and proper CPU-Company form.
++case $cpu-$vendor in
++ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
++ # some cases the only manufacturer, in others, it is the most popular.
++ craynv-unknown)
++ vendor=cray
++ basic_os=${basic_os:-unicosmp}
+ ;;
+- sun2os4)
+- basic_machine=m68000-sun
+- os=-sunos4
++ c90-unknown | c90-cray)
++ vendor=cray
++ basic_os=${Basic_os:-unicos}
+ ;;
+- sun3os3)
+- basic_machine=m68k-sun
+- os=-sunos3
++ fx80-unknown)
++ vendor=alliant
+ ;;
+- sun3os4)
+- basic_machine=m68k-sun
+- os=-sunos4
++ romp-unknown)
++ vendor=ibm
+ ;;
+- sun4os3)
+- basic_machine=sparc-sun
+- os=-sunos3
++ mmix-unknown)
++ vendor=knuth
+ ;;
+- sun4os4)
+- basic_machine=sparc-sun
+- os=-sunos4
++ microblaze-unknown | microblazeel-unknown)
++ vendor=xilinx
+ ;;
+- sun4sol2)
+- basic_machine=sparc-sun
+- os=-solaris2
++ rs6000-unknown)
++ vendor=ibm
+ ;;
+- sun3 | sun3-*)
+- basic_machine=m68k-sun
++ vax-unknown)
++ vendor=dec
+ ;;
+- sun4)
+- basic_machine=sparc-sun
++ pdp11-unknown)
++ vendor=dec
+ ;;
+- sun386 | sun386i | roadrunner)
+- basic_machine=i386-sun
++ we32k-unknown)
++ vendor=att
+ ;;
+- sv1)
+- basic_machine=sv1-cray
+- os=-unicos
++ cydra-unknown)
++ vendor=cydrome
+ ;;
+- symmetry)
+- basic_machine=i386-sequent
+- os=-dynix
++ i370-ibm*)
++ vendor=ibm
+ ;;
+- t3e)
+- basic_machine=alphaev5-cray
+- os=-unicos
++ orion-unknown)
++ vendor=highlevel
+ ;;
+- t90)
+- basic_machine=t90-cray
+- os=-unicos
++ xps-unknown | xps100-unknown)
++ cpu=xps100
++ vendor=honeywell
+ ;;
+- tile*)
+- basic_machine=$basic_machine-unknown
+- os=-linux-gnu
++
++ # Here we normalize CPU types with a missing or matching vendor
++ armh-unknown | armh-alt)
++ cpu=armv7l
++ vendor=alt
++ basic_os=${basic_os:-linux-gnueabihf}
+ ;;
+- tx39)
+- basic_machine=mipstx39-unknown
++ dpx20-unknown | dpx20-bull)
++ cpu=rs6000
++ vendor=bull
++ basic_os=${basic_os:-bosx}
+ ;;
+- tx39el)
+- basic_machine=mipstx39el-unknown
++
++ # Here we normalize CPU types irrespective of the vendor
++ amd64-*)
++ cpu=x86_64
+ ;;
+- toad1)
+- basic_machine=pdp10-xkl
+- os=-tops20
++ blackfin-*)
++ cpu=bfin
++ basic_os=linux
+ ;;
+- tower | tower-32)
+- basic_machine=m68k-ncr
++ c54x-*)
++ cpu=tic54x
+ ;;
+- tpf)
+- basic_machine=s390x-ibm
+- os=-tpf
++ c55x-*)
++ cpu=tic55x
+ ;;
+- udi29k)
+- basic_machine=a29k-amd
+- os=-udi
++ c6x-*)
++ cpu=tic6x
+ ;;
+- ultra3)
+- basic_machine=a29k-nyu
+- os=-sym1
++ e500v[12]-*)
++ cpu=powerpc
++ basic_os=${basic_os}"spe"
+ ;;
+- v810 | necv810)
+- basic_machine=v810-nec
+- os=-none
++ mips3*-*)
++ cpu=mips64
+ ;;
+- vaxv)
+- basic_machine=vax-dec
+- os=-sysv
++ ms1-*)
++ cpu=mt
+ ;;
+- vms)
+- basic_machine=vax-dec
+- os=-vms
++ m68knommu-*)
++ cpu=m68k
++ basic_os=linux
+ ;;
+- vpp*|vx|vx-*)
+- basic_machine=f301-fujitsu
++ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
++ cpu=s12z
+ ;;
+- vxworks960)
+- basic_machine=i960-wrs
+- os=-vxworks
++ openrisc-*)
++ cpu=or32
+ ;;
+- vxworks68)
+- basic_machine=m68k-wrs
+- os=-vxworks
++ parisc-*)
++ cpu=hppa
++ basic_os=linux
+ ;;
+- vxworks29k)
+- basic_machine=a29k-wrs
+- os=-vxworks
++ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
++ cpu=i586
+ ;;
+- wasm32)
+- basic_machine=wasm32-unknown
++ pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
++ cpu=i686
+ ;;
+- w65*)
+- basic_machine=w65-wdc
+- os=-none
++ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
++ cpu=i686
+ ;;
+- w89k-*)
+- basic_machine=hppa1.1-winbond
+- os=-proelf
++ pentium4-*)
++ cpu=i786
+ ;;
+- x64)
+- basic_machine=x86_64-pc
++ pc98-*)
++ cpu=i386
+ ;;
+- xbox)
+- basic_machine=i686-pc
+- os=-mingw32
++ ppc-* | ppcbe-*)
++ cpu=powerpc
+ ;;
+- xps | xps100)
+- basic_machine=xps100-honeywell
++ ppcle-* | powerpclittle-*)
++ cpu=powerpcle
+ ;;
+- xscale-* | xscalee[bl]-*)
+- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
++ ppc64-*)
++ cpu=powerpc64
+ ;;
+- ymp)
+- basic_machine=ymp-cray
+- os=-unicos
++ ppc64le-* | powerpc64little-*)
++ cpu=powerpc64le
+ ;;
+- z8k-*-coff)
+- basic_machine=z8k-unknown
+- os=-sim
++ sb1-*)
++ cpu=mipsisa64sb1
+ ;;
+- z80-*-coff)
+- basic_machine=z80-unknown
+- os=-sim
++ sb1el-*)
++ cpu=mipsisa64sb1el
+ ;;
+- none)
+- basic_machine=none-none
+- os=-none
++ sh5e[lb]-*)
++ cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
+ ;;
+-
+-# Here we handle the default manufacturer of certain CPU types. It is in
+-# some cases the only manufacturer, in others, it is the most popular.
+- w89k)
+- basic_machine=hppa1.1-winbond
++ spur-*)
++ cpu=spur
+ ;;
+- op50n)
+- basic_machine=hppa1.1-oki
++ strongarm-* | thumb-*)
++ cpu=arm
+ ;;
+- op60c)
+- basic_machine=hppa1.1-oki
++ tx39-*)
++ cpu=mipstx39
+ ;;
+- romp)
+- basic_machine=romp-ibm
++ tx39el-*)
++ cpu=mipstx39el
+ ;;
+- mmix)
+- basic_machine=mmix-knuth
++ x64-*)
++ cpu=x86_64
+ ;;
+- rs6000)
+- basic_machine=rs6000-ibm
++ xscale-* | xscalee[bl]-*)
++ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
+ ;;
+- vax)
+- basic_machine=vax-dec
++ arm64-* | aarch64le-*)
++ cpu=aarch64
+ ;;
+- pdp10)
+- # there are many clones, so DEC is not a safe bet
+- basic_machine=pdp10-unknown
++
++ # Recognize the canonical CPU Types that limit and/or modify the
++ # company names they are paired with.
++ cr16-*)
++ basic_os=${basic_os:-elf}
+ ;;
+- pdp11)
+- basic_machine=pdp11-dec
++ crisv32-* | etraxfs*-*)
++ cpu=crisv32
++ vendor=axis
+ ;;
+- we32k)
+- basic_machine=we32k-att
++ cris-* | etrax*-*)
++ cpu=cris
++ vendor=axis
+ ;;
+- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+- basic_machine=sh-unknown
++ crx-*)
++ basic_os=${basic_os:-elf}
+ ;;
+- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+- basic_machine=sparc-sun
++ neo-tandem)
++ cpu=neo
++ vendor=tandem
+ ;;
+- cydra)
+- basic_machine=cydra-cydrome
++ nse-tandem)
++ cpu=nse
++ vendor=tandem
+ ;;
+- orion)
+- basic_machine=orion-highlevel
++ nsr-tandem)
++ cpu=nsr
++ vendor=tandem
+ ;;
+- orion105)
+- basic_machine=clipper-highlevel
++ nsv-tandem)
++ cpu=nsv
++ vendor=tandem
+ ;;
+- mac | mpw | mac-mpw)
+- basic_machine=m68k-apple
++ nsx-tandem)
++ cpu=nsx
++ vendor=tandem
+ ;;
+- pmac | pmac-mpw)
+- basic_machine=powerpc-apple
++ mipsallegrexel-sony)
++ cpu=mipsallegrexel
++ vendor=sony
+ ;;
+- *-unknown)
+- # Make sure to match an already-canonicalized machine name.
++ tile*-*)
++ basic_os=${basic_os:-linux-gnu}
+ ;;
++
+ *)
+- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+- exit 1
++ # Recognize the canonical CPU types that are allowed with any
++ # company name.
++ case $cpu in
++ 1750a | 580 \
++ | a29k \
++ | aarch64 | aarch64_be \
++ | abacus \
++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
++ | alphapca5[67] | alpha64pca5[67] \
++ | am33_2.0 \
++ | amdgcn \
++ | arc | arceb | arc32 | arc64 \
++ | arm | arm[lb]e | arme[lb] | armv* \
++ | avr | avr32 \
++ | asmjs \
++ | ba \
++ | be32 | be64 \
++ | bfin | bpf | bs2000 \
++ | c[123]* | c30 | [cjt]90 | c4x \
++ | c8051 | clipper | craynv | csky | cydra \
++ | d10v | d30v | dlx | dsp16xx \
++ | e2k | elxsi | epiphany \
++ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
++ | h8300 | h8500 \
++ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
++ | hexagon \
++ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
++ | ip2k | iq2000 \
++ | k1om \
++ | le32 | le64 \
++ | lm32 \
++ | loongarch32 | loongarch64 \
++ | m32c | m32r | m32rle \
++ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
++ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
++ | m88110 | m88k | maxq | mb | mcore | mep | metag \
++ | microblaze | microblazeel \
++ | mips | mipsbe | mipseb | mipsel | mipsle \
++ | mips16 \
++ | mips64 | mips64eb | mips64el \
++ | mips64octeon | mips64octeonel \
++ | mips64orion | mips64orionel \
++ | mips64r5900 | mips64r5900el \
++ | mips64vr | mips64vrel \
++ | mips64vr4100 | mips64vr4100el \
++ | mips64vr4300 | mips64vr4300el \
++ | mips64vr5000 | mips64vr5000el \
++ | mips64vr5900 | mips64vr5900el \
++ | mipsisa32 | mipsisa32el \
++ | mipsisa32r2 | mipsisa32r2el \
++ | mipsisa32r3 | mipsisa32r3el \
++ | mipsisa32r5 | mipsisa32r5el \
++ | mipsisa32r6 | mipsisa32r6el \
++ | mipsisa64 | mipsisa64el \
++ | mipsisa64r2 | mipsisa64r2el \
++ | mipsisa64r3 | mipsisa64r3el \
++ | mipsisa64r5 | mipsisa64r5el \
++ | mipsisa64r6 | mipsisa64r6el \
++ | mipsisa64sb1 | mipsisa64sb1el \
++ | mipsisa64sr71k | mipsisa64sr71kel \
++ | mipsr5900 | mipsr5900el \
++ | mipstx39 | mipstx39el \
++ | mmix \
++ | mn10200 | mn10300 \
++ | moxie \
++ | mt \
++ | msp430 \
++ | nds32 | nds32le | nds32be \
++ | nfp \
++ | nios | nios2 | nios2eb | nios2el \
++ | none | np1 | ns16k | ns32k | nvptx \
++ | open8 \
++ | or1k* \
++ | or32 \
++ | orion \
++ | picochip \
++ | pdp10 | pdp11 | pj | pjl | pn | power \
++ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
++ | pru \
++ | pyramid \
++ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
++ | rl78 | romp | rs6000 | rx \
++ | s390 | s390x \
++ | score \
++ | sh | shl \
++ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
++ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
++ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
++ | sparclite \
++ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
++ | spu \
++ | tahoe \
++ | thumbv7* \
++ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
++ | tron \
++ | ubicom32 \
++ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
++ | vax \
++ | visium \
++ | w65 \
++ | wasm32 | wasm64 \
++ | we32k \
++ | x86 | x86_64 | xc16x | xgate | xps100 \
++ | xstormy16 | xtensa* \
++ | ymp \
++ | z8k | z80)
++ ;;
++
++ *)
++ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
++ exit 1
++ ;;
++ esac
+ ;;
+ esac
+
+ # Here we canonicalize certain aliases for manufacturers.
+-case $basic_machine in
+- *-digital*)
+- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
++case $vendor in
++ digital*)
++ vendor=dec
+ ;;
+- *-commodore*)
+- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
++ commodore*)
++ vendor=cbm
+ ;;
+ *)
+ ;;
+@@ -1362,203 +1306,219 @@ esac
+
+ # Decode manufacturer-specific aliases for certain operating systems.
+
+-if [ x"$os" != x"" ]
++if test x$basic_os != x
+ then
++
++# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
++# set os.
++case $basic_os in
++ gnu/linux*)
++ kernel=linux
++ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
++ ;;
++ os2-emx)
++ kernel=os2
++ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
++ ;;
++ nto-qnx*)
++ kernel=nto
++ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
++ ;;
++ *-*)
++ # shellcheck disable=SC2162
++ saved_IFS=$IFS
++ IFS="-" read kernel os <<EOF
++$basic_os
++EOF
++ IFS=$saved_IFS
++ ;;
++ # Default OS when just kernel was specified
++ nto*)
++ kernel=nto
++ os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
++ ;;
++ linux*)
++ kernel=linux
++ os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
++ ;;
++ managarm*)
++ kernel=managarm
++ os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
++ ;;
++ *)
++ kernel=
++ os=$basic_os
++ ;;
++esac
++
++# Now, normalize the OS (knowing we just have one component, it's not a kernel,
++# etc.)
+ case $os in
+ # First match some system type aliases that might get confused
+ # with valid system types.
+- # -solaris* is a basic system type, with this one exception.
+- -auroraux)
+- os=-auroraux
++ # solaris* is a basic system type, with this one exception.
++ auroraux)
++ os=auroraux
+ ;;
+- -solaris1 | -solaris1.*)
+- os=`echo $os | sed -e 's|solaris1|sunos4|'`
+- ;;
+- -solaris)
+- os=-solaris2
++ bluegene*)
++ os=cnk
+ ;;
+- -svr4*)
+- os=-sysv4
++ solaris1 | solaris1.*)
++ os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
+ ;;
+- -unixware*)
+- os=-sysv4.2uw
++ solaris)
++ os=solaris2
+ ;;
+- -gnu/linux*)
+- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
++ unixware*)
++ os=sysv4.2uw
+ ;;
+- # Now accept the basic system types.
+- # The portable systems comes first.
+- # Each alternative MUST end in a * to match a version number.
+- # -sysv* is not here because it comes later, after sysvr4.
+- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+- | -sym* | -kopensolaris* | -plan9* \
+- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+- | -aos* | -aros* | -cloudabi* | -sortix* \
+- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+- | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
+- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+- | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
+- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
+- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+- | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
+- # Remember, each alternative MUST END IN *, to match a version number.
+- ;;
+- -qnx*)
+- case $basic_machine in
+- x86-* | i*86-*)
+- ;;
+- *)
+- os=-nto$os
+- ;;
+- esac
++ # es1800 is here to avoid being matched by es* (a different OS)
++ es1800*)
++ os=ose
+ ;;
+- -nto-qnx*)
++ # Some version numbers need modification
++ chorusos*)
++ os=chorusos
+ ;;
+- -nto*)
+- os=`echo $os | sed -e 's|nto|nto-qnx|'`
++ isc)
++ os=isc2.2
+ ;;
+- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
++ sco6)
++ os=sco5v6
+ ;;
+- -mac*)
+- os=`echo $os | sed -e 's|mac|macos|'`
++ sco5)
++ os=sco3.2v5
+ ;;
+- -linux-dietlibc)
+- os=-linux-dietlibc
++ sco4)
++ os=sco3.2v4
+ ;;
+- -linux*)
+- os=`echo $os | sed -e 's|linux|linux-gnu|'`
++ sco3.2.[4-9]*)
++ os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
+ ;;
+- -sunos5*)
+- os=`echo $os | sed -e 's|sunos5|solaris2|'`
++ sco*v* | scout)
++ # Don't match below
+ ;;
+- -sunos6*)
+- os=`echo $os | sed -e 's|sunos6|solaris3|'`
++ sco*)
++ os=sco3.2v2
+ ;;
+- -opened*)
+- os=-openedition
++ psos*)
++ os=psos
+ ;;
+- -os400*)
+- os=-os400
++ qnx*)
++ os=qnx
+ ;;
+- -wince*)
+- os=-wince
++ hiux*)
++ os=hiuxwe2
+ ;;
+- -osfrose*)
+- os=-osfrose
++ lynx*178)
++ os=lynxos178
+ ;;
+- -osf*)
+- os=-osf
++ lynx*5)
++ os=lynxos5
+ ;;
+- -utek*)
+- os=-bsd
++ lynxos*)
++ # don't get caught up in next wildcard
+ ;;
+- -dynix*)
+- os=-bsd
++ lynx*)
++ os=lynxos
+ ;;
+- -acis*)
+- os=-aos
++ mac[0-9]*)
++ os=`echo "$os" | sed -e 's|mac|macos|'`
+ ;;
+- -atheos*)
+- os=-atheos
++ opened*)
++ os=openedition
+ ;;
+- -syllable*)
+- os=-syllable
++ os400*)
++ os=os400
+ ;;
+- -386bsd)
+- os=-bsd
++ sunos5*)
++ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
+ ;;
+- -ctix* | -uts*)
+- os=-sysv
++ sunos6*)
++ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
+ ;;
+- -nova*)
+- os=-rtmk-nova
++ wince*)
++ os=wince
+ ;;
+- -ns2)
+- os=-nextstep2
++ utek*)
++ os=bsd
+ ;;
+- -nsk*)
+- os=-nsk
++ dynix*)
++ os=bsd
+ ;;
+- # Preserve the version number of sinix5.
+- -sinix5.*)
+- os=`echo $os | sed -e 's|sinix|sysv|'`
++ acis*)
++ os=aos
+ ;;
+- -sinix*)
+- os=-sysv4
++ atheos*)
++ os=atheos
+ ;;
+- -tpf*)
+- os=-tpf
++ syllable*)
++ os=syllable
+ ;;
+- -triton*)
+- os=-sysv3
++ 386bsd)
++ os=bsd
+ ;;
+- -oss*)
+- os=-sysv3
++ ctix* | uts*)
++ os=sysv
+ ;;
+- -svr4)
+- os=-sysv4
++ nova*)
++ os=rtmk-nova
+ ;;
+- -svr3)
+- os=-sysv3
++ ns2)
++ os=nextstep2
+ ;;
+- -sysvr4)
+- os=-sysv4
++ # Preserve the version number of sinix5.
++ sinix5.*)
++ os=`echo "$os" | sed -e 's|sinix|sysv|'`
+ ;;
+- # This must come after -sysvr4.
+- -sysv*)
++ sinix*)
++ os=sysv4
+ ;;
+- -ose*)
+- os=-ose
++ tpf*)
++ os=tpf
+ ;;
+- -es1800*)
+- os=-ose
++ triton*)
++ os=sysv3
+ ;;
+- -xenix)
+- os=-xenix
++ oss*)
++ os=sysv3
+ ;;
+- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+- os=-mint
++ svr4*)
++ os=sysv4
+ ;;
+- -aros*)
+- os=-aros
++ svr3)
++ os=sysv3
+ ;;
+- -zvmoe)
+- os=-zvmoe
++ sysvr4)
++ os=sysv4
+ ;;
+- -dicos*)
+- os=-dicos
++ ose*)
++ os=ose
+ ;;
+- -nacl*)
++ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
++ os=mint
+ ;;
+- -ios)
++ dicos*)
++ os=dicos
+ ;;
+- -none)
++ pikeos*)
++ # Until real need of OS specific support for
++ # particular features comes up, bare metal
++ # configurations are quite functional.
++ case $cpu in
++ arm*)
++ os=eabi
++ ;;
++ *)
++ os=elf
++ ;;
++ esac
+ ;;
+ *)
+- # Get rid of the `-' at the beginning of $os.
+- os=`echo $os | sed 's/[^-]*-//'`
+- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+- exit 1
++ # No normalization, but not necessarily accepted, that comes below.
+ ;;
+ esac
++
+ else
+
+ # Here we handle the default operating systems that come with various machines.
+@@ -1571,264 +1531,376 @@ else
+ # will signal an error saying that MANUFACTURER isn't an operating
+ # system, and we'll never get to this point.
+
+-case $basic_machine in
++kernel=
++case $cpu-$vendor in
+ score-*)
+- os=-elf
++ os=elf
+ ;;
+ spu-*)
+- os=-elf
++ os=elf
+ ;;
+ *-acorn)
+- os=-riscix1.2
++ os=riscix1.2
+ ;;
+ arm*-rebel)
+- os=-linux
++ kernel=linux
++ os=gnu
+ ;;
+ arm*-semi)
+- os=-aout
++ os=aout
+ ;;
+ c4x-* | tic4x-*)
+- os=-coff
++ os=coff
+ ;;
+ c8051-*)
+- os=-elf
++ os=elf
++ ;;
++ clipper-intergraph)
++ os=clix
+ ;;
+ hexagon-*)
+- os=-elf
++ os=elf
+ ;;
+ tic54x-*)
+- os=-coff
++ os=coff
+ ;;
+ tic55x-*)
+- os=-coff
++ os=coff
+ ;;
+ tic6x-*)
+- os=-coff
++ os=coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+- os=-tops20
++ os=tops20
+ ;;
+ pdp11-*)
+- os=-none
++ os=none
+ ;;
+ *-dec | vax-*)
+- os=-ultrix4.2
++ os=ultrix4.2
+ ;;
+ m68*-apollo)
+- os=-domain
++ os=domain
+ ;;
+ i386-sun)
+- os=-sunos4.0.2
++ os=sunos4.0.2
+ ;;
+ m68000-sun)
+- os=-sunos3
++ os=sunos3
+ ;;
+ m68*-cisco)
+- os=-aout
++ os=aout
+ ;;
+ mep-*)
+- os=-elf
++ os=elf
+ ;;
+ mips*-cisco)
+- os=-elf
++ os=elf
+ ;;
+ mips*-*)
+- os=-elf
++ os=elf
+ ;;
+ or32-*)
+- os=-coff
++ os=coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+- os=-sysv3
++ os=sysv3
+ ;;
+ sparc-* | *-sun)
+- os=-sunos4.1.1
++ os=sunos4.1.1
+ ;;
+ pru-*)
+- os=-elf
++ os=elf
+ ;;
+ *-be)
+- os=-beos
+- ;;
+- *-haiku)
+- os=-haiku
++ os=beos
+ ;;
+ *-ibm)
+- os=-aix
++ os=aix
+ ;;
+ *-knuth)
+- os=-mmixware
++ os=mmixware
+ ;;
+ *-wec)
+- os=-proelf
++ os=proelf
+ ;;
+ *-winbond)
+- os=-proelf
++ os=proelf
+ ;;
+ *-oki)
+- os=-proelf
++ os=proelf
+ ;;
+ *-hp)
+- os=-hpux
++ os=hpux
+ ;;
+ *-hitachi)
+- os=-hiux
++ os=hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+- os=-sysv
++ os=sysv
+ ;;
+ *-cbm)
+- os=-amigaos
++ os=amigaos
+ ;;
+ *-dg)
+- os=-dgux
++ os=dgux
+ ;;
+ *-dolphin)
+- os=-sysv3
++ os=sysv3
+ ;;
+ m68k-ccur)
+- os=-rtu
++ os=rtu
+ ;;
+ m88k-omron*)
+- os=-luna
++ os=luna
+ ;;
+ *-next)
+- os=-nextstep
++ os=nextstep
+ ;;
+ *-sequent)
+- os=-ptx
++ os=ptx
+ ;;
+ *-crds)
+- os=-unos
++ os=unos
+ ;;
+ *-ns)
+- os=-genix
++ os=genix
+ ;;
+ i370-*)
+- os=-mvs
+- ;;
+- *-next)
+- os=-nextstep3
++ os=mvs
+ ;;
+ *-gould)
+- os=-sysv
++ os=sysv
+ ;;
+ *-highlevel)
+- os=-bsd
++ os=bsd
+ ;;
+ *-encore)
+- os=-bsd
++ os=bsd
+ ;;
+ *-sgi)
+- os=-irix
++ os=irix
+ ;;
+ *-siemens)
+- os=-sysv4
++ os=sysv4
+ ;;
+ *-masscomp)
+- os=-rtu
++ os=rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+- os=-uxpv
++ os=uxpv
+ ;;
+ *-rom68k)
+- os=-coff
++ os=coff
+ ;;
+ *-*bug)
+- os=-coff
++ os=coff
+ ;;
+ *-apple)
+- os=-macos
++ os=macos
+ ;;
+ *-atari*)
+- os=-mint
++ os=mint
++ ;;
++ *-wrs)
++ os=vxworks
+ ;;
+ *)
+- os=-none
++ os=none
+ ;;
+ esac
++
+ fi
+
++# Now, validate our (potentially fixed-up) OS.
++case $os in
++ # Sometimes we do "kernel-libc", so those need to count as OSes.
++ musl* | newlib* | relibc* | uclibc*)
++ ;;
++ # Likewise for "kernel-abi"
++ eabi* | gnueabi*)
++ ;;
++ # VxWorks passes extra cpu info in the 4th filed.
++ simlinux | simwindows | spe)
++ ;;
++ # Now accept the basic system types.
++ # The portable systems comes first.
++ # Each alternative MUST end in a * to match a version number.
++ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
++ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
++ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
++ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
++ | hiux* | abug | nacl* | netware* | windows* \
++ | os9* | macos* | osx* | ios* \
++ | mpw* | magic* | mmixware* | mon960* | lnews* \
++ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
++ | aos* | aros* | cloudabi* | sortix* | twizzler* \
++ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
++ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
++ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
++ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
++ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
++ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
++ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
++ | udi* | lites* | ieee* | go32* | aux* | hcos* \
++ | chorusrdb* | cegcc* | glidix* | serenity* \
++ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
++ | midipix* | mingw32* | mingw64* | mint* \
++ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
++ | interix* | uwin* | mks* | rhapsody* | darwin* \
++ | openstep* | oskit* | conix* | pw32* | nonstopux* \
++ | storm-chaos* | tops10* | tenex* | tops20* | its* \
++ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
++ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
++ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
++ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
++ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
++ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
++ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
++ | fiwix* | mlibc* )
++ ;;
++ # This one is extra strict with allowed versions
++ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
++ # Don't forget version if it is 3.2v4 or newer.
++ ;;
++ none)
++ ;;
++ kernel* )
++ # Restricted further below
++ ;;
++ *)
++ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
++ exit 1
++ ;;
++esac
++
++# As a final step for OS-related things, validate the OS-kernel combination
++# (given a valid OS), if there is a kernel.
++case $kernel-$os in
++ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
++ | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* )
++ ;;
++ uclinux-uclibc* )
++ ;;
++ managarm-mlibc* | managarm-kernel* )
++ ;;
++ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
++ # These are just libc implementations, not actual OSes, and thus
++ # require a kernel.
++ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
++ exit 1
++ ;;
++ -kernel* )
++ echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2
++ exit 1
++ ;;
++ *-kernel* )
++ echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2
++ exit 1
++ ;;
++ kfreebsd*-gnu* | kopensolaris*-gnu*)
++ ;;
++ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
++ ;;
++ nto-qnx*)
++ ;;
++ os2-emx)
++ ;;
++ *-eabi* | *-gnueabi*)
++ ;;
++ -*)
++ # Blank kernel with real OS is always fine.
++ ;;
++ *-*)
++ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
++ exit 1
++ ;;
++esac
++
+ # Here we handle the case where we know the os, and the CPU type, but not the
+ # manufacturer. We pick the logical manufacturer.
+-vendor=unknown
+-case $basic_machine in
+- *-unknown)
+- case $os in
+- -riscix*)
++case $vendor in
++ unknown)
++ case $cpu-$os in
++ *-riscix*)
+ vendor=acorn
+ ;;
+- -sunos*)
++ *-sunos*)
+ vendor=sun
+ ;;
+- -cnk*|-aix*)
++ *-cnk* | *-aix*)
+ vendor=ibm
+ ;;
+- -beos*)
++ *-beos*)
+ vendor=be
+ ;;
+- -hpux*)
++ *-hpux*)
+ vendor=hp
+ ;;
+- -mpeix*)
++ *-mpeix*)
+ vendor=hp
+ ;;
+- -hiux*)
++ *-hiux*)
+ vendor=hitachi
+ ;;
+- -unos*)
++ *-unos*)
+ vendor=crds
+ ;;
+- -dgux*)
++ *-dgux*)
+ vendor=dg
+ ;;
+- -luna*)
++ *-luna*)
+ vendor=omron
+ ;;
+- -genix*)
++ *-genix*)
+ vendor=ns
+ ;;
+- -mvs* | -opened*)
++ *-clix*)
++ vendor=intergraph
++ ;;
++ *-mvs* | *-opened*)
++ vendor=ibm
++ ;;
++ *-os400*)
+ vendor=ibm
+ ;;
+- -os400*)
++ s390-* | s390x-*)
+ vendor=ibm
+ ;;
+- -ptx*)
++ *-ptx*)
+ vendor=sequent
+ ;;
+- -tpf*)
++ *-tpf*)
+ vendor=ibm
+ ;;
+- -vxsim* | -vxworks* | -windiss*)
++ *-vxsim* | *-vxworks* | *-windiss*)
+ vendor=wrs
+ ;;
+- -aux*)
++ *-aux*)
+ vendor=apple
+ ;;
+- -hms*)
++ *-hms*)
+ vendor=hitachi
+ ;;
+- -mpw* | -macos*)
++ *-mpw* | *-macos*)
+ vendor=apple
+ ;;
+- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
+ vendor=atari
+ ;;
+- -vos*)
++ *-vos*)
+ vendor=stratus
+ ;;
+ esac
+- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+ esac
+
+-echo $basic_machine$os
++echo "$cpu-$vendor-${kernel:+$kernel-}$os"
+ exit
+
+ # Local variables:
+-# eval: (add-hook 'write-file-functions 'time-stamp)
++# eval: (add-hook 'before-save-hook 'time-stamp)
+ # time-stamp-start: "timestamp='"
+ # time-stamp-format: "%:y-%02m-%02d"
+ # time-stamp-end: "'"
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/nasm/autoconf/helpers/config.sub b/qtwebengine/src/3rdparty/chromium/third_party/nasm/autoconf/helpers/config.sub
+index b51fb8cdb69e..de4259e40479 100755
+--- a/qtwebengine/src/3rdparty/chromium/third_party/nasm/autoconf/helpers/config.sub
++++ b/qtwebengine/src/3rdparty/chromium/third_party/nasm/autoconf/helpers/config.sub
+@@ -1,12 +1,14 @@
+ #! /bin/sh
+ # Configuration validation subroutine script.
+-# Copyright 1992-2018 Free Software Foundation, Inc.
++# Copyright 1992-2023 Free Software Foundation, Inc.
+
+-timestamp='2018-08-29'
++# shellcheck disable=SC2006,SC2268 # see below for rationale
++
++timestamp='2023-01-21'
+
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 3 of the License, or
++# the Free Software Foundation, either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful, but
+@@ -33,7 +35,7 @@ timestamp='2018-08-29'
+ # Otherwise, we print the canonical config type on stdout and succeed.
+
+ # You can get the latest version of this script from:
+-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
++# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+
+ # This file is supposed to be the same for all GNU packages
+ # and recognize all the CPU types, system types and aliases
+@@ -50,6 +52,13 @@ timestamp='2018-08-29'
+ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+ # It is wrong to echo any other type of specification.
+
++# The "shellcheck disable" line above the timestamp inhibits complaints
++# about features and limitations of the classic Bourne shell that were
++# superseded or lifted in POSIX. However, this script identifies a wide
++# variety of pre-POSIX systems that do not have POSIX shells at all, and
++# even some reasonably current systems (Solaris 10 as case-in-point) still
++# have a pre-POSIX /bin/sh.
++
+ me=`echo "$0" | sed -e 's,.*/,,'`
+
+ usage="\
+@@ -67,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
+ version="\
+ GNU config.sub ($timestamp)
+
+-Copyright 1992-2018 Free Software Foundation, Inc.
++Copyright 1992-2023 Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -89,7 +98,7 @@ while test $# -gt 0 ; do
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+- echo "$me: invalid option $1$help"
++ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+
+ *local*)
+@@ -111,9 +120,12 @@ case $# in
+ esac
+
+ # Split fields of configuration type
+-IFS="-" read -r field1 field2 field3 field4 <<EOF
++# shellcheck disable=SC2162
++saved_IFS=$IFS
++IFS="-" read field1 field2 field3 field4 <<EOF
+ $1
+ EOF
++IFS=$saved_IFS
+
+ # Separate into logical components for further validation
+ case $1 in
+@@ -123,37 +135,36 @@ case $1 in
+ ;;
+ *-*-*-*)
+ basic_machine=$field1-$field2
+- os=$field3-$field4
++ basic_os=$field3-$field4
+ ;;
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # parts
+ maybe_os=$field2-$field3
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+- | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
++ nto-qnx* | linux-* | uclinux-uclibc* \
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+- | storm-chaos* | os2-emx* | rtmk-nova*)
++ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*)
+ basic_machine=$field1
+- os=$maybe_os
++ basic_os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+- os=linux-android
++ basic_os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+- os=$field3
++ basic_os=$field3
+ ;;
+ esac
+ ;;
+ *-*)
+- # A lone config we happen to match not fitting any patern
++ # A lone config we happen to match not fitting any pattern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+- os=
++ basic_os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+@@ -161,7 +172,11 @@ case $1 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+- os=$field2
++ basic_os=$field2
++ ;;
++ zephyr*)
++ basic_machine=$field1-unknown
++ basic_os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+@@ -174,11 +189,11 @@ case $1 in
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+- os=
++ basic_os=
+ ;;
+ *)
+ basic_machine=$field1
+- os=$field2
++ basic_os=$field2
+ ;;
+ esac
+ ;;
+@@ -190,450 +205,451 @@ case $1 in
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+- os=bsd
++ basic_os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+- os=udi
++ basic_os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+- os=scout
++ basic_os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+- os=
++ basic_os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+- os=
++ basic_os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+- os=bsd
++ basic_os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+- os=sysv
++ basic_os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+- os=
++ basic_os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+- os=amigaos
++ basic_os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+- os=sysv4
++ basic_os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+- os=sysv
++ basic_os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+- os=bsd
++ basic_os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+- os=aros
++ basic_os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+- os=aux
++ basic_os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+- os=dynix
++ basic_os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+- os=linux
++ basic_os=linux
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+- os=cegcc
++ basic_os=cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+- os=bsd
++ basic_os=bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+- os=bsd
++ basic_os=bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+- os=bsd
++ basic_os=bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+- os=bsd
++ basic_os=bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+- os=bsd
++ basic_os=bsd
+ ;;
+ cray)
+ basic_machine=j90-cray
+- os=unicos
++ basic_os=unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+- os=
++ basic_os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+- os=
++ basic_os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+- os=
++ basic_os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+- os=sysv3
++ basic_os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+- os=dicos
++ basic_os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+- os=msdosdjgpp
++ basic_os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+- os=ebmon
++ basic_os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+- os=ose
++ basic_os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+- os=sysv
++ basic_os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+- os=go32
++ basic_os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+- os=hms
++ basic_os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+- os=xray
++ basic_os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+- os=hms
++ basic_os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+- os=sysv3
++ basic_os=sysv3
+ ;;
+- hp300)
++ hp300 | hp300hpux)
+ basic_machine=m68k-hp
++ basic_os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+- os=bsd
+- ;;
+- hp300hpux)
+- basic_machine=m68k-hp
+- os=hpux
++ basic_os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+- os=osf
++ basic_os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+- os=proelf
++ basic_os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+- os=mach
+- ;;
+- vsta)
+- basic_machine=i386-pc
+- os=vsta
++ basic_os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+- os=sysv
++ basic_os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+- os=linux
++ basic_os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+- os=sysv
++ basic_os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+- os=sysv
++ basic_os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+- os=mingw64
++ basic_os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+- os=mingw32
++ basic_os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+- os=mingw32ce
++ basic_os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+- os=coff
++ basic_os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+- os=morphos
++ basic_os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+- os=moxiebox
++ basic_os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+- os=msdos
++ basic_os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+- os=msys
++ basic_os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+- os=mvs
++ basic_os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+- os=nacl
++ basic_os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+- os=sysv4
++ basic_os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+- os=netbsd
++ basic_os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+- os=linux
++ basic_os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+- os=newsos
++ basic_os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+- os=newsos
++ basic_os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+- os=sysv
++ basic_os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+- os=cxux
++ basic_os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+- os=cxux
++ basic_os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+- os=nindy
++ basic_os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+- os=mon960
++ basic_os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+- os=nonstopux
++ basic_os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+- os=os400
++ basic_os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+- os=ose
++ basic_os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+- os=os68k
++ basic_os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+- os=osf
++ basic_os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+- os=linux
++ basic_os=linux
++ ;;
++ psp)
++ basic_machine=mipsallegrexel-sony
++ basic_os=psp
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+- os=pw32
++ basic_os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+- os=rdos
++ basic_os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+- os=rdos
++ basic_os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+- os=coff
++ basic_os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+- os=udi
++ basic_os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+- os=seiux
++ basic_os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+- os=
++ basic_os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+- os=sysv2
++ basic_os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+- os=
++ basic_os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+- os=sysv4
++ basic_os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+- os=
++ basic_os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+- os=sunos3
++ basic_os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+- os=sunos4
++ basic_os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+- os=
++ basic_os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+- os=sunos3
++ basic_os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+- os=sunos4
++ basic_os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+- os=
++ basic_os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+- os=sunos3
++ basic_os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+- os=sunos4
++ basic_os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+- os=solaris2
++ basic_os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+- os=
++ basic_os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+- os=unicos
++ basic_os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+- os=dynix
++ basic_os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+- os=unicos
++ basic_os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+- os=unicos
++ basic_os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+- os=tops20
++ basic_os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+- os=tpf
++ basic_os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+- os=udi
++ basic_os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+- os=sym1
++ basic_os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+- os=none
++ basic_os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+- os=sysv
++ basic_os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+- os=vms
++ basic_os=vms
++ ;;
++ vsta)
++ basic_machine=i386-pc
++ basic_os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+- os=vxworks
++ basic_os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+- os=vxworks
++ basic_os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+- os=vxworks
++ basic_os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+- os=mingw32
++ basic_os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+- os=unicos
++ basic_os=unicos
+ ;;
+ *)
+ basic_machine=$1
+- os=
++ basic_os=
+ ;;
+ esac
+ ;;
+@@ -685,17 +701,17 @@ case $basic_machine in
+ bluegene*)
+ cpu=powerpc
+ vendor=ibm
+- os=cnk
++ basic_os=cnk
+ ;;
+ decsystem10* | dec10*)
+ cpu=pdp10
+ vendor=dec
+- os=tops10
++ basic_os=tops10
+ ;;
+ decsystem20* | dec20*)
+ cpu=pdp10
+ vendor=dec
+- os=tops20
++ basic_os=tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+@@ -705,7 +721,7 @@ case $basic_machine in
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+- os=sysv3
++ basic_os=sysv3
+ ;;
+ encore | umax | mmax)
+ cpu=ns32k
+@@ -714,7 +730,7 @@ case $basic_machine in
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+- os=${os:-bsd}
++ basic_os=${basic_os:-bsd}
+ ;;
+ fx2800)
+ cpu=i860
+@@ -727,7 +743,7 @@ case $basic_machine in
+ h3050r* | hiux*)
+ cpu=hppa1.1
+ vendor=hitachi
+- os=hiuxwe2
++ basic_os=hiuxwe2
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ cpu=hppa1.0
+@@ -770,36 +786,36 @@ case $basic_machine in
+ i*86v32)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+- os=sysv32
++ basic_os=sysv32
+ ;;
+ i*86v4*)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+- os=sysv4
++ basic_os=sysv4
+ ;;
+ i*86v)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+- os=sysv
++ basic_os=sysv
+ ;;
+ i*86sol2)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+- os=solaris2
++ basic_os=solaris2
+ ;;
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+- os=${os:-unicos}
++ basic_os=${basic_os:-unicos}
+ ;;
+ iris | iris4d)
+ cpu=mips
+ vendor=sgi
+- case $os in
++ case $basic_os in
+ irix*)
+ ;;
+ *)
+- os=irix4
++ basic_os=irix4
+ ;;
+ esac
+ ;;
+@@ -810,24 +826,26 @@ case $basic_machine in
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+- os=mint
++ basic_os=mint
+ ;;
+ news-3600 | risc-news)
+ cpu=mips
+ vendor=sony
+- os=newsos
++ basic_os=newsos
+ ;;
+ next | m*-next)
+ cpu=m68k
+ vendor=next
+- case $os in
+- nextstep* )
++ case $basic_os in
++ openstep*)
++ ;;
++ nextstep*)
+ ;;
+ ns2*)
+- os=nextstep2
++ basic_os=nextstep2
+ ;;
+ *)
+- os=nextstep3
++ basic_os=nextstep3
+ ;;
+ esac
+ ;;
+@@ -838,12 +856,12 @@ case $basic_machine in
+ op50n-* | op60c-*)
+ cpu=hppa1.1
+ vendor=oki
+- os=proelf
++ basic_os=proelf
+ ;;
+ pa-hitachi)
+ cpu=hppa1.1
+ vendor=hitachi
+- os=hiuxwe2
++ basic_os=hiuxwe2
+ ;;
+ pbd)
+ cpu=sparc
+@@ -880,12 +898,12 @@ case $basic_machine in
+ sde)
+ cpu=mipsisa32
+ vendor=sde
+- os=${os:-elf}
++ basic_os=${basic_os:-elf}
+ ;;
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+- os=vxworks
++ basic_os=vxworks
+ ;;
+ tower | tower-32)
+ cpu=m68k
+@@ -902,7 +920,7 @@ case $basic_machine in
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+- os=proelf
++ basic_os=proelf
+ ;;
+ none)
+ cpu=none
+@@ -918,9 +936,12 @@ case $basic_machine in
+ ;;
+
+ *-*)
+- IFS="-" read -r cpu vendor <<EOF
++ # shellcheck disable=SC2162
++ saved_IFS=$IFS
++ IFS="-" read cpu vendor <<EOF
+ $basic_machine
+ EOF
++ IFS=$saved_IFS
+ ;;
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+@@ -950,15 +971,15 @@ unset -v basic_machine
+
+ # Decode basic machines in the full and proper CPU-Company form.
+ case $cpu-$vendor in
+- # Here we handle the default manufacturer of certain CPU types in cannonical form. It is in
++ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ craynv-unknown)
+ vendor=cray
+- os=${os:-unicosmp}
++ basic_os=${basic_os:-unicosmp}
+ ;;
+ c90-unknown | c90-cray)
+ vendor=cray
+- os=${os:-unicos}
++ basic_os=${Basic_os:-unicos}
+ ;;
+ fx80-unknown)
+ vendor=alliant
+@@ -999,10 +1020,15 @@ case $cpu-$vendor in
+ ;;
+
+ # Here we normalize CPU types with a missing or matching vendor
++ armh-unknown | armh-alt)
++ cpu=armv7l
++ vendor=alt
++ basic_os=${basic_os:-linux-gnueabihf}
++ ;;
+ dpx20-unknown | dpx20-bull)
+ cpu=rs6000
+ vendor=bull
+- os=${os:-bosx}
++ basic_os=${basic_os:-bosx}
+ ;;
+
+ # Here we normalize CPU types irrespective of the vendor
+@@ -1011,7 +1037,7 @@ case $cpu-$vendor in
+ ;;
+ blackfin-*)
+ cpu=bfin
+- os=linux
++ basic_os=linux
+ ;;
+ c54x-*)
+ cpu=tic54x
+@@ -1024,7 +1050,7 @@ case $cpu-$vendor in
+ ;;
+ e500v[12]-*)
+ cpu=powerpc
+- os=$os"spe"
++ basic_os=${basic_os}"spe"
+ ;;
+ mips3*-*)
+ cpu=mips64
+@@ -1034,7 +1060,7 @@ case $cpu-$vendor in
+ ;;
+ m68knommu-*)
+ cpu=m68k
+- os=linux
++ basic_os=linux
+ ;;
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+ cpu=s12z
+@@ -1044,12 +1070,12 @@ case $cpu-$vendor in
+ ;;
+ parisc-*)
+ cpu=hppa
+- os=linux
++ basic_os=linux
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ cpu=i586
+ ;;
+- pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
++ pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
+ cpu=i686
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+@@ -1100,11 +1126,14 @@ case $cpu-$vendor in
+ xscale-* | xscalee[bl]-*)
+ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
+ ;;
++ arm64-* | aarch64le-*)
++ cpu=aarch64
++ ;;
+
+- # Recognize the cannonical CPU Types that limit and/or modify the
++ # Recognize the canonical CPU Types that limit and/or modify the
+ # company names they are paired with.
+ cr16-*)
+- os=${os:-elf}
++ basic_os=${basic_os:-elf}
+ ;;
+ crisv32-* | etraxfs*-*)
+ cpu=crisv32
+@@ -1115,7 +1144,7 @@ case $cpu-$vendor in
+ vendor=axis
+ ;;
+ crx-*)
+- os=${os:-elf}
++ basic_os=${basic_os:-elf}
+ ;;
+ neo-tandem)
+ cpu=neo
+@@ -1137,20 +1166,16 @@ case $cpu-$vendor in
+ cpu=nsx
+ vendor=tandem
+ ;;
+- s390-*)
+- cpu=s390
+- vendor=ibm
+- ;;
+- s390x-*)
+- cpu=s390x
+- vendor=ibm
++ mipsallegrexel-sony)
++ cpu=mipsallegrexel
++ vendor=sony
+ ;;
+ tile*-*)
+- os=${os:-linux-gnu}
++ basic_os=${basic_os:-linux-gnu}
+ ;;
+
+ *)
+- # Recognize the cannonical CPU types that are allowed with any
++ # Recognize the canonical CPU types that are allowed with any
+ # company name.
+ case $cpu in
+ 1750a | 580 \
+@@ -1161,13 +1186,14 @@ case $cpu-$vendor in
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+ | alphapca5[67] | alpha64pca5[67] \
+ | am33_2.0 \
+- | arc | arceb \
+- | arm | arm[lb]e | arme[lb] | armv* \
++ | amdgcn \
++ | arc | arceb | arc32 | arc64 \
++ | arm | arm[lb]e | arme[lb] | armv* \
+ | avr | avr32 \
+ | asmjs \
+ | ba \
+ | be32 | be64 \
+- | bfin | bs2000 \
++ | bfin | bpf | bs2000 \
+ | c[123]* | c30 | [cjt]90 | c4x \
+ | c8051 | clipper | craynv | csky | cydra \
+ | d10v | d30v | dlx | dsp16xx \
+@@ -1181,14 +1207,15 @@ case $cpu-$vendor in
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
++ | loongarch32 | loongarch64 \
+ | m32c | m32r | m32rle \
+- | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \
+- | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \
++ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
++ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
+ | microblaze | microblazeel \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+- | mips64 | mips64el \
++ | mips64 | mips64eb | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+@@ -1199,9 +1226,13 @@ case $cpu-$vendor in
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
++ | mipsisa32r3 | mipsisa32r3el \
++ | mipsisa32r5 | mipsisa32r5el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
++ | mipsisa64r3 | mipsisa64r3el \
++ | mipsisa64r5 | mipsisa64r5el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+@@ -1215,32 +1246,37 @@ case $cpu-$vendor in
+ | nds32 | nds32le | nds32be \
+ | nfp \
+ | nios | nios2 | nios2eb | nios2el \
+- | none | np1 | ns16k | ns32k \
++ | none | np1 | ns16k | ns32k | nvptx \
+ | open8 \
+ | or1k* \
+ | or32 \
+ | orion \
++ | picochip \
+ | pdp10 | pdp11 | pj | pjl | pn | power \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pru \
+ | pyramid \
+- | riscv | riscv32 | riscv64 \
++ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
+ | rl78 | romp | rs6000 | rx \
++ | s390 | s390x \
+ | score \
+- | sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
++ | sh | shl \
++ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+ | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | spu \
+ | tahoe \
++ | thumbv7* \
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tron \
+ | ubicom32 \
+- | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
++ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+ | vax \
+ | visium \
+- | wasm32 \
++ | w65 \
++ | wasm32 | wasm64 \
+ | we32k \
+ | x86 | x86_64 | xc16x | xgate | xps100 \
+ | xstormy16 | xtensa* \
+@@ -1270,8 +1306,53 @@ esac
+
+ # Decode manufacturer-specific aliases for certain operating systems.
+
+-if [ x$os != x ]
++if test x$basic_os != x
+ then
++
++# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
++# set os.
++case $basic_os in
++ gnu/linux*)
++ kernel=linux
++ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
++ ;;
++ os2-emx)
++ kernel=os2
++ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
++ ;;
++ nto-qnx*)
++ kernel=nto
++ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
++ ;;
++ *-*)
++ # shellcheck disable=SC2162
++ saved_IFS=$IFS
++ IFS="-" read kernel os <<EOF
++$basic_os
++EOF
++ IFS=$saved_IFS
++ ;;
++ # Default OS when just kernel was specified
++ nto*)
++ kernel=nto
++ os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
++ ;;
++ linux*)
++ kernel=linux
++ os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
++ ;;
++ managarm*)
++ kernel=managarm
++ os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
++ ;;
++ *)
++ kernel=
++ os=$basic_os
++ ;;
++esac
++
++# Now, normalize the OS (knowing we just have one component, it's not a kernel,
++# etc.)
+ case $os in
+ # First match some system type aliases that might get confused
+ # with valid system types.
+@@ -1283,7 +1364,7 @@ case $os in
+ os=cnk
+ ;;
+ solaris1 | solaris1.*)
+- os=`echo $os | sed -e 's|solaris1|sunos4|'`
++ os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
+ ;;
+ solaris)
+ os=solaris2
+@@ -1291,9 +1372,6 @@ case $os in
+ unixware*)
+ os=sysv4.2uw
+ ;;
+- gnu/linux*)
+- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+- ;;
+ # es1800 is here to avoid being matched by es* (a different OS)
+ es1800*)
+ os=ose
+@@ -1315,12 +1393,9 @@ case $os in
+ os=sco3.2v4
+ ;;
+ sco3.2.[4-9]*)
+- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
++ os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
+ ;;
+- sco3.2v[4-9]* | sco5v6*)
+- # Don't forget version if it is 3.2v4 or newer.
+- ;;
+- scout)
++ sco*v* | scout)
+ # Don't match below
+ ;;
+ sco*)
+@@ -1329,77 +1404,25 @@ case $os in
+ psos*)
+ os=psos
+ ;;
+- # Now accept the basic system types.
+- # The portable systems comes first.
+- # Each alternative MUST end in a * to match a version number.
+- # sysv* is not here because it comes later, after sysvr4.
+- gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+- | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
+- | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+- | sym* | kopensolaris* | plan9* \
+- | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+- | aos* | aros* | cloudabi* | sortix* \
+- | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+- | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+- | knetbsd* | mirbsd* | netbsd* \
+- | bitrig* | openbsd* | solidbsd* | libertybsd* \
+- | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+- | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+- | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+- | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+- | chorusrdb* | cegcc* | glidix* \
+- | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+- | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+- | linux-newlib* | linux-musl* | linux-uclibc* \
+- | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+- | interix* | uwin* | mks* | rhapsody* | darwin* \
+- | openstep* | oskit* | conix* | pw32* | nonstopux* \
+- | storm-chaos* | tops10* | tenex* | tops20* | its* \
+- | os2* | vos* | palmos* | uclinux* | nucleus* \
+- | morphos* | superux* | rtmk* | windiss* \
+- | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+- | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+- | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+- | midnightbsd*)
+- # Remember, each alternative MUST END IN *, to match a version number.
+- ;;
+ qnx*)
+- case $cpu in
+- x86 | i*86)
+- ;;
+- *)
+- os=nto-$os
+- ;;
+- esac
++ os=qnx
+ ;;
+ hiux*)
+ os=hiuxwe2
+ ;;
+- nto-qnx*)
+- ;;
+- nto*)
+- os=`echo $os | sed -e 's|nto|nto-qnx|'`
+- ;;
+- sim | xray | os68k* | v88r* \
+- | windows* | osx | abug | netware* | os9* \
+- | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
+- ;;
+- linux-dietlibc)
+- os=linux-dietlibc
+- ;;
+- linux*)
+- os=`echo $os | sed -e 's|linux|linux-gnu|'`
+- ;;
+ lynx*178)
+ os=lynxos178
+ ;;
+ lynx*5)
+ os=lynxos5
+ ;;
++ lynxos*)
++ # don't get caught up in next wildcard
++ ;;
+ lynx*)
+ os=lynxos
+ ;;
+- mac*)
++ mac[0-9]*)
+ os=`echo "$os" | sed -e 's|mac|macos|'`
+ ;;
+ opened*)
+@@ -1444,12 +1467,9 @@ case $os in
+ ns2)
+ os=nextstep2
+ ;;
+- nsk*)
+- os=nsk
+- ;;
+ # Preserve the version number of sinix5.
+ sinix5.*)
+- os=`echo $os | sed -e 's|sinix|sysv|'`
++ os=`echo "$os" | sed -e 's|sinix|sysv|'`
+ ;;
+ sinix*)
+ os=sysv4
+@@ -1472,18 +1492,12 @@ case $os in
+ sysvr4)
+ os=sysv4
+ ;;
+- # This must come after sysvr4.
+- sysv*)
+- ;;
+ ose*)
+ os=ose
+ ;;
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+ os=mint
+ ;;
+- zvmoe)
+- os=zvmoe
+- ;;
+ dicos*)
+ os=dicos
+ ;;
+@@ -1500,19 +1514,11 @@ case $os in
+ ;;
+ esac
+ ;;
+- nacl*)
+- ;;
+- ios)
+- ;;
+- none)
+- ;;
+- *-eabi)
+- ;;
+ *)
+- echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
+- exit 1
++ # No normalization, but not necessarily accepted, that comes below.
+ ;;
+ esac
++
+ else
+
+ # Here we handle the default operating systems that come with various machines.
+@@ -1525,6 +1531,7 @@ else
+ # will signal an error saying that MANUFACTURER isn't an operating
+ # system, and we'll never get to this point.
+
++kernel=
+ case $cpu-$vendor in
+ score-*)
+ os=elf
+@@ -1536,7 +1543,8 @@ case $cpu-$vendor in
+ os=riscix1.2
+ ;;
+ arm*-rebel)
+- os=linux
++ kernel=linux
++ os=gnu
+ ;;
+ arm*-semi)
+ os=aout
+@@ -1702,84 +1710,193 @@ case $cpu-$vendor in
+ os=none
+ ;;
+ esac
++
+ fi
+
++# Now, validate our (potentially fixed-up) OS.
++case $os in
++ # Sometimes we do "kernel-libc", so those need to count as OSes.
++ musl* | newlib* | relibc* | uclibc*)
++ ;;
++ # Likewise for "kernel-abi"
++ eabi* | gnueabi*)
++ ;;
++ # VxWorks passes extra cpu info in the 4th filed.
++ simlinux | simwindows | spe)
++ ;;
++ # Now accept the basic system types.
++ # The portable systems comes first.
++ # Each alternative MUST end in a * to match a version number.
++ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
++ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
++ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
++ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
++ | hiux* | abug | nacl* | netware* | windows* \
++ | os9* | macos* | osx* | ios* \
++ | mpw* | magic* | mmixware* | mon960* | lnews* \
++ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
++ | aos* | aros* | cloudabi* | sortix* | twizzler* \
++ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
++ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
++ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
++ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
++ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
++ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
++ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
++ | udi* | lites* | ieee* | go32* | aux* | hcos* \
++ | chorusrdb* | cegcc* | glidix* | serenity* \
++ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
++ | midipix* | mingw32* | mingw64* | mint* \
++ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
++ | interix* | uwin* | mks* | rhapsody* | darwin* \
++ | openstep* | oskit* | conix* | pw32* | nonstopux* \
++ | storm-chaos* | tops10* | tenex* | tops20* | its* \
++ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
++ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
++ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
++ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
++ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
++ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
++ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
++ | fiwix* | mlibc* )
++ ;;
++ # This one is extra strict with allowed versions
++ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
++ # Don't forget version if it is 3.2v4 or newer.
++ ;;
++ none)
++ ;;
++ kernel* )
++ # Restricted further below
++ ;;
++ *)
++ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
++ exit 1
++ ;;
++esac
++
++# As a final step for OS-related things, validate the OS-kernel combination
++# (given a valid OS), if there is a kernel.
++case $kernel-$os in
++ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
++ | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* )
++ ;;
++ uclinux-uclibc* )
++ ;;
++ managarm-mlibc* | managarm-kernel* )
++ ;;
++ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
++ # These are just libc implementations, not actual OSes, and thus
++ # require a kernel.
++ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
++ exit 1
++ ;;
++ -kernel* )
++ echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2
++ exit 1
++ ;;
++ *-kernel* )
++ echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2
++ exit 1
++ ;;
++ kfreebsd*-gnu* | kopensolaris*-gnu*)
++ ;;
++ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
++ ;;
++ nto-qnx*)
++ ;;
++ os2-emx)
++ ;;
++ *-eabi* | *-gnueabi*)
++ ;;
++ -*)
++ # Blank kernel with real OS is always fine.
++ ;;
++ *-*)
++ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
++ exit 1
++ ;;
++esac
++
+ # Here we handle the case where we know the os, and the CPU type, but not the
+ # manufacturer. We pick the logical manufacturer.
+ case $vendor in
+ unknown)
+- case $os in
+- riscix*)
++ case $cpu-$os in
++ *-riscix*)
+ vendor=acorn
+ ;;
+- sunos*)
++ *-sunos*)
+ vendor=sun
+ ;;
+- cnk*|-aix*)
++ *-cnk* | *-aix*)
+ vendor=ibm
+ ;;
+- beos*)
++ *-beos*)
+ vendor=be
+ ;;
+- hpux*)
++ *-hpux*)
+ vendor=hp
+ ;;
+- mpeix*)
++ *-mpeix*)
+ vendor=hp
+ ;;
+- hiux*)
++ *-hiux*)
+ vendor=hitachi
+ ;;
+- unos*)
++ *-unos*)
+ vendor=crds
+ ;;
+- dgux*)
++ *-dgux*)
+ vendor=dg
+ ;;
+- luna*)
++ *-luna*)
+ vendor=omron
+ ;;
+- genix*)
++ *-genix*)
+ vendor=ns
+ ;;
+- clix*)
++ *-clix*)
+ vendor=intergraph
+ ;;
+- mvs* | opened*)
++ *-mvs* | *-opened*)
++ vendor=ibm
++ ;;
++ *-os400*)
+ vendor=ibm
+ ;;
+- os400*)
++ s390-* | s390x-*)
+ vendor=ibm
+ ;;
+- ptx*)
++ *-ptx*)
+ vendor=sequent
+ ;;
+- tpf*)
++ *-tpf*)
+ vendor=ibm
+ ;;
+- vxsim* | vxworks* | windiss*)
++ *-vxsim* | *-vxworks* | *-windiss*)
+ vendor=wrs
+ ;;
+- aux*)
++ *-aux*)
+ vendor=apple
+ ;;
+- hms*)
++ *-hms*)
+ vendor=hitachi
+ ;;
+- mpw* | macos*)
++ *-mpw* | *-macos*)
+ vendor=apple
+ ;;
+- *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
++ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
+ vendor=atari
+ ;;
+- vos*)
++ *-vos*)
+ vendor=stratus
+ ;;
+ esac
+ ;;
+ esac
+
+-echo "$cpu-$vendor-$os"
++echo "$cpu-$vendor-${kernel:+$kernel-}$os"
+ exit
+
+ # Local variables:
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/config.sub b/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/config.sub
+index 5b158ac41c9a..de4259e40479 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/config.sub
++++ b/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/config.sub
+@@ -1,12 +1,14 @@
+ #! /bin/sh
+ # Configuration validation subroutine script.
+-# Copyright 1992-2019 Free Software Foundation, Inc.
++# Copyright 1992-2023 Free Software Foundation, Inc.
+
+-timestamp='2019-05-23'
++# shellcheck disable=SC2006,SC2268 # see below for rationale
++
++timestamp='2023-01-21'
+
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 3 of the License, or
++# the Free Software Foundation, either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful, but
+@@ -33,7 +35,7 @@ timestamp='2019-05-23'
+ # Otherwise, we print the canonical config type on stdout and succeed.
+
+ # You can get the latest version of this script from:
+-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
++# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+
+ # This file is supposed to be the same for all GNU packages
+ # and recognize all the CPU types, system types and aliases
+@@ -50,6 +52,13 @@ timestamp='2019-05-23'
+ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+ # It is wrong to echo any other type of specification.
+
++# The "shellcheck disable" line above the timestamp inhibits complaints
++# about features and limitations of the classic Bourne shell that were
++# superseded or lifted in POSIX. However, this script identifies a wide
++# variety of pre-POSIX systems that do not have POSIX shells at all, and
++# even some reasonably current systems (Solaris 10 as case-in-point) still
++# have a pre-POSIX /bin/sh.
++
+ me=`echo "$0" | sed -e 's,.*/,,'`
+
+ usage="\
+@@ -67,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
+ version="\
+ GNU config.sub ($timestamp)
+
+-Copyright 1992-2019 Free Software Foundation, Inc.
++Copyright 1992-2023 Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -112,9 +121,11 @@ esac
+
+ # Split fields of configuration type
+ # shellcheck disable=SC2162
++saved_IFS=$IFS
+ IFS="-" read field1 field2 field3 field4 <<EOF
+ $1
+ EOF
++IFS=$saved_IFS
+
+ # Separate into logical components for further validation
+ case $1 in
+@@ -124,28 +135,27 @@ case $1 in
+ ;;
+ *-*-*-*)
+ basic_machine=$field1-$field2
+- os=$field3-$field4
++ basic_os=$field3-$field4
+ ;;
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # parts
+ maybe_os=$field2-$field3
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+- | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
++ nto-qnx* | linux-* | uclinux-uclibc* \
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+- | storm-chaos* | os2-emx* | rtmk-nova*)
++ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*)
+ basic_machine=$field1
+- os=$maybe_os
++ basic_os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+- os=linux-android
++ basic_os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+- os=$field3
++ basic_os=$field3
+ ;;
+ esac
+ ;;
+@@ -154,7 +164,7 @@ case $1 in
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+- os=
++ basic_os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+@@ -162,7 +172,11 @@ case $1 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+- os=$field2
++ basic_os=$field2
++ ;;
++ zephyr*)
++ basic_machine=$field1-unknown
++ basic_os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+@@ -175,11 +189,11 @@ case $1 in
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+- os=
++ basic_os=
+ ;;
+ *)
+ basic_machine=$field1
+- os=$field2
++ basic_os=$field2
+ ;;
+ esac
+ ;;
+@@ -191,450 +205,451 @@ case $1 in
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+- os=bsd
++ basic_os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+- os=udi
++ basic_os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+- os=scout
++ basic_os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+- os=
++ basic_os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+- os=
++ basic_os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+- os=bsd
++ basic_os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+- os=sysv
++ basic_os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+- os=
++ basic_os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+- os=amigaos
++ basic_os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+- os=sysv4
++ basic_os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+- os=sysv
++ basic_os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+- os=bsd
++ basic_os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+- os=aros
++ basic_os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+- os=aux
++ basic_os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+- os=dynix
++ basic_os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+- os=linux
++ basic_os=linux
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+- os=cegcc
++ basic_os=cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+- os=bsd
++ basic_os=bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+- os=bsd
++ basic_os=bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+- os=bsd
++ basic_os=bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+- os=bsd
++ basic_os=bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+- os=bsd
++ basic_os=bsd
+ ;;
+ cray)
+ basic_machine=j90-cray
+- os=unicos
++ basic_os=unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+- os=
++ basic_os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+- os=
++ basic_os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+- os=
++ basic_os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+- os=sysv3
++ basic_os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+- os=dicos
++ basic_os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+- os=msdosdjgpp
++ basic_os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+- os=ebmon
++ basic_os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+- os=ose
++ basic_os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+- os=sysv
++ basic_os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+- os=go32
++ basic_os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+- os=hms
++ basic_os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+- os=xray
++ basic_os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+- os=hms
++ basic_os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+- os=sysv3
++ basic_os=sysv3
+ ;;
+- hp300)
++ hp300 | hp300hpux)
+ basic_machine=m68k-hp
++ basic_os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+- os=bsd
+- ;;
+- hp300hpux)
+- basic_machine=m68k-hp
+- os=hpux
++ basic_os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+- os=osf
++ basic_os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+- os=proelf
++ basic_os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+- os=mach
+- ;;
+- vsta)
+- basic_machine=i386-pc
+- os=vsta
++ basic_os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+- os=sysv
++ basic_os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+- os=linux
++ basic_os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+- os=sysv
++ basic_os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+- os=sysv
++ basic_os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+- os=mingw64
++ basic_os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+- os=mingw32
++ basic_os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+- os=mingw32ce
++ basic_os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+- os=coff
++ basic_os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+- os=morphos
++ basic_os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+- os=moxiebox
++ basic_os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+- os=msdos
++ basic_os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+- os=msys
++ basic_os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+- os=mvs
++ basic_os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+- os=nacl
++ basic_os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+- os=sysv4
++ basic_os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+- os=netbsd
++ basic_os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+- os=linux
++ basic_os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+- os=newsos
++ basic_os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+- os=newsos
++ basic_os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+- os=sysv
++ basic_os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+- os=cxux
++ basic_os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+- os=cxux
++ basic_os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+- os=nindy
++ basic_os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+- os=mon960
++ basic_os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+- os=nonstopux
++ basic_os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+- os=os400
++ basic_os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+- os=ose
++ basic_os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+- os=os68k
++ basic_os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+- os=osf
++ basic_os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+- os=linux
++ basic_os=linux
++ ;;
++ psp)
++ basic_machine=mipsallegrexel-sony
++ basic_os=psp
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+- os=pw32
++ basic_os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+- os=rdos
++ basic_os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+- os=rdos
++ basic_os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+- os=coff
++ basic_os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+- os=udi
++ basic_os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+- os=seiux
++ basic_os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+- os=
++ basic_os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+- os=sysv2
++ basic_os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+- os=
++ basic_os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+- os=sysv4
++ basic_os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+- os=
++ basic_os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+- os=sunos3
++ basic_os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+- os=sunos4
++ basic_os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+- os=
++ basic_os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+- os=sunos3
++ basic_os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+- os=sunos4
++ basic_os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+- os=
++ basic_os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+- os=sunos3
++ basic_os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+- os=sunos4
++ basic_os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+- os=solaris2
++ basic_os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+- os=
++ basic_os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+- os=unicos
++ basic_os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+- os=dynix
++ basic_os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+- os=unicos
++ basic_os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+- os=unicos
++ basic_os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+- os=tops20
++ basic_os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+- os=tpf
++ basic_os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+- os=udi
++ basic_os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+- os=sym1
++ basic_os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+- os=none
++ basic_os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+- os=sysv
++ basic_os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+- os=vms
++ basic_os=vms
++ ;;
++ vsta)
++ basic_machine=i386-pc
++ basic_os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+- os=vxworks
++ basic_os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+- os=vxworks
++ basic_os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+- os=vxworks
++ basic_os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+- os=mingw32
++ basic_os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+- os=unicos
++ basic_os=unicos
+ ;;
+ *)
+ basic_machine=$1
+- os=
++ basic_os=
+ ;;
+ esac
+ ;;
+@@ -686,17 +701,17 @@ case $basic_machine in
+ bluegene*)
+ cpu=powerpc
+ vendor=ibm
+- os=cnk
++ basic_os=cnk
+ ;;
+ decsystem10* | dec10*)
+ cpu=pdp10
+ vendor=dec
+- os=tops10
++ basic_os=tops10
+ ;;
+ decsystem20* | dec20*)
+ cpu=pdp10
+ vendor=dec
+- os=tops20
++ basic_os=tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+@@ -706,7 +721,7 @@ case $basic_machine in
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+- os=sysv3
++ basic_os=sysv3
+ ;;
+ encore | umax | mmax)
+ cpu=ns32k
+@@ -715,7 +730,7 @@ case $basic_machine in
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+- os=${os:-bsd}
++ basic_os=${basic_os:-bsd}
+ ;;
+ fx2800)
+ cpu=i860
+@@ -728,7 +743,7 @@ case $basic_machine in
+ h3050r* | hiux*)
+ cpu=hppa1.1
+ vendor=hitachi
+- os=hiuxwe2
++ basic_os=hiuxwe2
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ cpu=hppa1.0
+@@ -771,36 +786,36 @@ case $basic_machine in
+ i*86v32)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+- os=sysv32
++ basic_os=sysv32
+ ;;
+ i*86v4*)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+- os=sysv4
++ basic_os=sysv4
+ ;;
+ i*86v)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+- os=sysv
++ basic_os=sysv
+ ;;
+ i*86sol2)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+- os=solaris2
++ basic_os=solaris2
+ ;;
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+- os=${os:-unicos}
++ basic_os=${basic_os:-unicos}
+ ;;
+ iris | iris4d)
+ cpu=mips
+ vendor=sgi
+- case $os in
++ case $basic_os in
+ irix*)
+ ;;
+ *)
+- os=irix4
++ basic_os=irix4
+ ;;
+ esac
+ ;;
+@@ -811,26 +826,26 @@ case $basic_machine in
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+- os=mint
++ basic_os=mint
+ ;;
+ news-3600 | risc-news)
+ cpu=mips
+ vendor=sony
+- os=newsos
++ basic_os=newsos
+ ;;
+ next | m*-next)
+ cpu=m68k
+ vendor=next
+- case $os in
++ case $basic_os in
+ openstep*)
+ ;;
+ nextstep*)
+ ;;
+ ns2*)
+- os=nextstep2
++ basic_os=nextstep2
+ ;;
+ *)
+- os=nextstep3
++ basic_os=nextstep3
+ ;;
+ esac
+ ;;
+@@ -841,12 +856,12 @@ case $basic_machine in
+ op50n-* | op60c-*)
+ cpu=hppa1.1
+ vendor=oki
+- os=proelf
++ basic_os=proelf
+ ;;
+ pa-hitachi)
+ cpu=hppa1.1
+ vendor=hitachi
+- os=hiuxwe2
++ basic_os=hiuxwe2
+ ;;
+ pbd)
+ cpu=sparc
+@@ -883,12 +898,12 @@ case $basic_machine in
+ sde)
+ cpu=mipsisa32
+ vendor=sde
+- os=${os:-elf}
++ basic_os=${basic_os:-elf}
+ ;;
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+- os=vxworks
++ basic_os=vxworks
+ ;;
+ tower | tower-32)
+ cpu=m68k
+@@ -905,7 +920,7 @@ case $basic_machine in
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+- os=proelf
++ basic_os=proelf
+ ;;
+ none)
+ cpu=none
+@@ -922,9 +937,11 @@ case $basic_machine in
+
+ *-*)
+ # shellcheck disable=SC2162
++ saved_IFS=$IFS
+ IFS="-" read cpu vendor <<EOF
+ $basic_machine
+ EOF
++ IFS=$saved_IFS
+ ;;
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+@@ -958,11 +975,11 @@ case $cpu-$vendor in
+ # some cases the only manufacturer, in others, it is the most popular.
+ craynv-unknown)
+ vendor=cray
+- os=${os:-unicosmp}
++ basic_os=${basic_os:-unicosmp}
+ ;;
+ c90-unknown | c90-cray)
+ vendor=cray
+- os=${os:-unicos}
++ basic_os=${Basic_os:-unicos}
+ ;;
+ fx80-unknown)
+ vendor=alliant
+@@ -1003,10 +1020,15 @@ case $cpu-$vendor in
+ ;;
+
+ # Here we normalize CPU types with a missing or matching vendor
++ armh-unknown | armh-alt)
++ cpu=armv7l
++ vendor=alt
++ basic_os=${basic_os:-linux-gnueabihf}
++ ;;
+ dpx20-unknown | dpx20-bull)
+ cpu=rs6000
+ vendor=bull
+- os=${os:-bosx}
++ basic_os=${basic_os:-bosx}
+ ;;
+
+ # Here we normalize CPU types irrespective of the vendor
+@@ -1015,7 +1037,7 @@ case $cpu-$vendor in
+ ;;
+ blackfin-*)
+ cpu=bfin
+- os=linux
++ basic_os=linux
+ ;;
+ c54x-*)
+ cpu=tic54x
+@@ -1028,7 +1050,7 @@ case $cpu-$vendor in
+ ;;
+ e500v[12]-*)
+ cpu=powerpc
+- os=$os"spe"
++ basic_os=${basic_os}"spe"
+ ;;
+ mips3*-*)
+ cpu=mips64
+@@ -1038,7 +1060,7 @@ case $cpu-$vendor in
+ ;;
+ m68knommu-*)
+ cpu=m68k
+- os=linux
++ basic_os=linux
+ ;;
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+ cpu=s12z
+@@ -1048,12 +1070,12 @@ case $cpu-$vendor in
+ ;;
+ parisc-*)
+ cpu=hppa
+- os=linux
++ basic_os=linux
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ cpu=i586
+ ;;
+- pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
++ pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
+ cpu=i686
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+@@ -1104,11 +1126,14 @@ case $cpu-$vendor in
+ xscale-* | xscalee[bl]-*)
+ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
+ ;;
++ arm64-* | aarch64le-*)
++ cpu=aarch64
++ ;;
+
+ # Recognize the canonical CPU Types that limit and/or modify the
+ # company names they are paired with.
+ cr16-*)
+- os=${os:-elf}
++ basic_os=${basic_os:-elf}
+ ;;
+ crisv32-* | etraxfs*-*)
+ cpu=crisv32
+@@ -1119,7 +1144,7 @@ case $cpu-$vendor in
+ vendor=axis
+ ;;
+ crx-*)
+- os=${os:-elf}
++ basic_os=${basic_os:-elf}
+ ;;
+ neo-tandem)
+ cpu=neo
+@@ -1141,16 +1166,12 @@ case $cpu-$vendor in
+ cpu=nsx
+ vendor=tandem
+ ;;
+- s390-*)
+- cpu=s390
+- vendor=ibm
+- ;;
+- s390x-*)
+- cpu=s390x
+- vendor=ibm
++ mipsallegrexel-sony)
++ cpu=mipsallegrexel
++ vendor=sony
+ ;;
+ tile*-*)
+- os=${os:-linux-gnu}
++ basic_os=${basic_os:-linux-gnu}
+ ;;
+
+ *)
+@@ -1166,8 +1187,8 @@ case $cpu-$vendor in
+ | alphapca5[67] | alpha64pca5[67] \
+ | am33_2.0 \
+ | amdgcn \
+- | arc | arceb \
+- | arm | arm[lb]e | arme[lb] | armv* \
++ | arc | arceb | arc32 | arc64 \
++ | arm | arm[lb]e | arme[lb] | armv* \
+ | avr | avr32 \
+ | asmjs \
+ | ba \
+@@ -1186,6 +1207,7 @@ case $cpu-$vendor in
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
++ | loongarch32 | loongarch64 \
+ | m32c | m32r | m32rle \
+ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+@@ -1204,9 +1226,13 @@ case $cpu-$vendor in
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
++ | mipsisa32r3 | mipsisa32r3el \
++ | mipsisa32r5 | mipsisa32r5el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
++ | mipsisa64r3 | mipsisa64r3el \
++ | mipsisa64r5 | mipsisa64r5el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+@@ -1230,8 +1256,9 @@ case $cpu-$vendor in
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pru \
+ | pyramid \
+- | riscv | riscv32 | riscv64 \
++ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
+ | rl78 | romp | rs6000 | rx \
++ | s390 | s390x \
+ | score \
+ | sh | shl \
+ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+@@ -1241,6 +1268,7 @@ case $cpu-$vendor in
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | spu \
+ | tahoe \
++ | thumbv7* \
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tron \
+ | ubicom32 \
+@@ -1278,8 +1306,53 @@ esac
+
+ # Decode manufacturer-specific aliases for certain operating systems.
+
+-if [ x$os != x ]
++if test x$basic_os != x
+ then
++
++# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
++# set os.
++case $basic_os in
++ gnu/linux*)
++ kernel=linux
++ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
++ ;;
++ os2-emx)
++ kernel=os2
++ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
++ ;;
++ nto-qnx*)
++ kernel=nto
++ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
++ ;;
++ *-*)
++ # shellcheck disable=SC2162
++ saved_IFS=$IFS
++ IFS="-" read kernel os <<EOF
++$basic_os
++EOF
++ IFS=$saved_IFS
++ ;;
++ # Default OS when just kernel was specified
++ nto*)
++ kernel=nto
++ os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
++ ;;
++ linux*)
++ kernel=linux
++ os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
++ ;;
++ managarm*)
++ kernel=managarm
++ os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
++ ;;
++ *)
++ kernel=
++ os=$basic_os
++ ;;
++esac
++
++# Now, normalize the OS (knowing we just have one component, it's not a kernel,
++# etc.)
+ case $os in
+ # First match some system type aliases that might get confused
+ # with valid system types.
+@@ -1291,7 +1364,7 @@ case $os in
+ os=cnk
+ ;;
+ solaris1 | solaris1.*)
+- os=`echo $os | sed -e 's|solaris1|sunos4|'`
++ os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
+ ;;
+ solaris)
+ os=solaris2
+@@ -1299,9 +1372,6 @@ case $os in
+ unixware*)
+ os=sysv4.2uw
+ ;;
+- gnu/linux*)
+- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+- ;;
+ # es1800 is here to avoid being matched by es* (a different OS)
+ es1800*)
+ os=ose
+@@ -1323,12 +1393,9 @@ case $os in
+ os=sco3.2v4
+ ;;
+ sco3.2.[4-9]*)
+- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+- ;;
+- sco3.2v[4-9]* | sco5v6*)
+- # Don't forget version if it is 3.2v4 or newer.
++ os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
+ ;;
+- scout)
++ sco*v* | scout)
+ # Don't match below
+ ;;
+ sco*)
+@@ -1337,77 +1404,25 @@ case $os in
+ psos*)
+ os=psos
+ ;;
+- # Now accept the basic system types.
+- # The portable systems comes first.
+- # Each alternative MUST end in a * to match a version number.
+- # sysv* is not here because it comes later, after sysvr4.
+- gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+- | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
+- | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+- | sym* | kopensolaris* | plan9* \
+- | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+- | aos* | aros* | cloudabi* | sortix* \
+- | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+- | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+- | knetbsd* | mirbsd* | netbsd* \
+- | bitrig* | openbsd* | solidbsd* | libertybsd* \
+- | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+- | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+- | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+- | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+- | chorusrdb* | cegcc* | glidix* \
+- | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+- | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+- | linux-newlib* | linux-musl* | linux-uclibc* \
+- | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+- | interix* | uwin* | mks* | rhapsody* | darwin* \
+- | openstep* | oskit* | conix* | pw32* | nonstopux* \
+- | storm-chaos* | tops10* | tenex* | tops20* | its* \
+- | os2* | vos* | palmos* | uclinux* | nucleus* \
+- | morphos* | superux* | rtmk* | windiss* \
+- | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+- | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+- | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+- | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi*)
+- # Remember, each alternative MUST END IN *, to match a version number.
+- ;;
+ qnx*)
+- case $cpu in
+- x86 | i*86)
+- ;;
+- *)
+- os=nto-$os
+- ;;
+- esac
++ os=qnx
+ ;;
+ hiux*)
+ os=hiuxwe2
+ ;;
+- nto-qnx*)
+- ;;
+- nto*)
+- os=`echo $os | sed -e 's|nto|nto-qnx|'`
+- ;;
+- sim | xray | os68k* | v88r* \
+- | windows* | osx | abug | netware* | os9* \
+- | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
+- ;;
+- linux-dietlibc)
+- os=linux-dietlibc
+- ;;
+- linux*)
+- os=`echo $os | sed -e 's|linux|linux-gnu|'`
+- ;;
+ lynx*178)
+ os=lynxos178
+ ;;
+ lynx*5)
+ os=lynxos5
+ ;;
++ lynxos*)
++ # don't get caught up in next wildcard
++ ;;
+ lynx*)
+ os=lynxos
+ ;;
+- mac*)
++ mac[0-9]*)
+ os=`echo "$os" | sed -e 's|mac|macos|'`
+ ;;
+ opened*)
+@@ -1452,12 +1467,9 @@ case $os in
+ ns2)
+ os=nextstep2
+ ;;
+- nsk*)
+- os=nsk
+- ;;
+ # Preserve the version number of sinix5.
+ sinix5.*)
+- os=`echo $os | sed -e 's|sinix|sysv|'`
++ os=`echo "$os" | sed -e 's|sinix|sysv|'`
+ ;;
+ sinix*)
+ os=sysv4
+@@ -1480,18 +1492,12 @@ case $os in
+ sysvr4)
+ os=sysv4
+ ;;
+- # This must come after sysvr4.
+- sysv*)
+- ;;
+ ose*)
+ os=ose
+ ;;
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+ os=mint
+ ;;
+- zvmoe)
+- os=zvmoe
+- ;;
+ dicos*)
+ os=dicos
+ ;;
+@@ -1508,19 +1514,11 @@ case $os in
+ ;;
+ esac
+ ;;
+- nacl*)
+- ;;
+- ios)
+- ;;
+- none)
+- ;;
+- *-eabi)
+- ;;
+ *)
+- echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
+- exit 1
++ # No normalization, but not necessarily accepted, that comes below.
+ ;;
+ esac
++
+ else
+
+ # Here we handle the default operating systems that come with various machines.
+@@ -1533,6 +1531,7 @@ else
+ # will signal an error saying that MANUFACTURER isn't an operating
+ # system, and we'll never get to this point.
+
++kernel=
+ case $cpu-$vendor in
+ score-*)
+ os=elf
+@@ -1544,7 +1543,8 @@ case $cpu-$vendor in
+ os=riscix1.2
+ ;;
+ arm*-rebel)
+- os=linux
++ kernel=linux
++ os=gnu
+ ;;
+ arm*-semi)
+ os=aout
+@@ -1710,84 +1710,193 @@ case $cpu-$vendor in
+ os=none
+ ;;
+ esac
++
+ fi
+
++# Now, validate our (potentially fixed-up) OS.
++case $os in
++ # Sometimes we do "kernel-libc", so those need to count as OSes.
++ musl* | newlib* | relibc* | uclibc*)
++ ;;
++ # Likewise for "kernel-abi"
++ eabi* | gnueabi*)
++ ;;
++ # VxWorks passes extra cpu info in the 4th filed.
++ simlinux | simwindows | spe)
++ ;;
++ # Now accept the basic system types.
++ # The portable systems comes first.
++ # Each alternative MUST end in a * to match a version number.
++ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
++ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
++ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
++ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
++ | hiux* | abug | nacl* | netware* | windows* \
++ | os9* | macos* | osx* | ios* \
++ | mpw* | magic* | mmixware* | mon960* | lnews* \
++ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
++ | aos* | aros* | cloudabi* | sortix* | twizzler* \
++ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
++ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
++ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
++ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
++ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
++ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
++ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
++ | udi* | lites* | ieee* | go32* | aux* | hcos* \
++ | chorusrdb* | cegcc* | glidix* | serenity* \
++ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
++ | midipix* | mingw32* | mingw64* | mint* \
++ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
++ | interix* | uwin* | mks* | rhapsody* | darwin* \
++ | openstep* | oskit* | conix* | pw32* | nonstopux* \
++ | storm-chaos* | tops10* | tenex* | tops20* | its* \
++ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
++ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
++ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
++ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
++ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
++ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
++ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
++ | fiwix* | mlibc* )
++ ;;
++ # This one is extra strict with allowed versions
++ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
++ # Don't forget version if it is 3.2v4 or newer.
++ ;;
++ none)
++ ;;
++ kernel* )
++ # Restricted further below
++ ;;
++ *)
++ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
++ exit 1
++ ;;
++esac
++
++# As a final step for OS-related things, validate the OS-kernel combination
++# (given a valid OS), if there is a kernel.
++case $kernel-$os in
++ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
++ | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* )
++ ;;
++ uclinux-uclibc* )
++ ;;
++ managarm-mlibc* | managarm-kernel* )
++ ;;
++ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
++ # These are just libc implementations, not actual OSes, and thus
++ # require a kernel.
++ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
++ exit 1
++ ;;
++ -kernel* )
++ echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2
++ exit 1
++ ;;
++ *-kernel* )
++ echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2
++ exit 1
++ ;;
++ kfreebsd*-gnu* | kopensolaris*-gnu*)
++ ;;
++ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
++ ;;
++ nto-qnx*)
++ ;;
++ os2-emx)
++ ;;
++ *-eabi* | *-gnueabi*)
++ ;;
++ -*)
++ # Blank kernel with real OS is always fine.
++ ;;
++ *-*)
++ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
++ exit 1
++ ;;
++esac
++
+ # Here we handle the case where we know the os, and the CPU type, but not the
+ # manufacturer. We pick the logical manufacturer.
+ case $vendor in
+ unknown)
+- case $os in
+- riscix*)
++ case $cpu-$os in
++ *-riscix*)
+ vendor=acorn
+ ;;
+- sunos*)
++ *-sunos*)
+ vendor=sun
+ ;;
+- cnk*|-aix*)
++ *-cnk* | *-aix*)
+ vendor=ibm
+ ;;
+- beos*)
++ *-beos*)
+ vendor=be
+ ;;
+- hpux*)
++ *-hpux*)
+ vendor=hp
+ ;;
+- mpeix*)
++ *-mpeix*)
+ vendor=hp
+ ;;
+- hiux*)
++ *-hiux*)
+ vendor=hitachi
+ ;;
+- unos*)
++ *-unos*)
+ vendor=crds
+ ;;
+- dgux*)
++ *-dgux*)
+ vendor=dg
+ ;;
+- luna*)
++ *-luna*)
+ vendor=omron
+ ;;
+- genix*)
++ *-genix*)
+ vendor=ns
+ ;;
+- clix*)
++ *-clix*)
+ vendor=intergraph
+ ;;
+- mvs* | opened*)
++ *-mvs* | *-opened*)
++ vendor=ibm
++ ;;
++ *-os400*)
+ vendor=ibm
+ ;;
+- os400*)
++ s390-* | s390x-*)
+ vendor=ibm
+ ;;
+- ptx*)
++ *-ptx*)
+ vendor=sequent
+ ;;
+- tpf*)
++ *-tpf*)
+ vendor=ibm
+ ;;
+- vxsim* | vxworks* | windiss*)
++ *-vxsim* | *-vxworks* | *-windiss*)
+ vendor=wrs
+ ;;
+- aux*)
++ *-aux*)
+ vendor=apple
+ ;;
+- hms*)
++ *-hms*)
+ vendor=hitachi
+ ;;
+- mpw* | macos*)
++ *-mpw* | *-macos*)
+ vendor=apple
+ ;;
+- *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
++ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
+ vendor=atari
+ ;;
+- vos*)
++ *-vos*)
+ vendor=stratus
+ ;;
+ esac
+ ;;
+ esac
+
+-echo "$cpu-$vendor-$os"
++echo "$cpu-$vendor-${kernel:+$kernel-}$os"
+ exit
+
+ # Local variables:
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/configure b/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/configure
+index 367b1485f20a..4665b719dfa8 100755
+--- a/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/configure
++++ b/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/configure
+@@ -7450,7 +7450,7 @@ _LT_EOF
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
++ cat $export_symbols | sed -e "s/\(.*\)/'"$ac_symprfx"'\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+@@ -7464,7 +7464,7 @@ _LT_EOF
+ archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
++ cat $export_symbols | sed -e "s/\(.*\)/'"$ac_symprfx"'\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+@@ -8526,7 +8526,7 @@ version_type=none
+ dynamic_linker="$host_os ld.so"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib"
+ need_lib_prefix=unknown
+-hardcode_into_libs=no
++hardcode_into_libs="no"
+
+ # when you set need_version to no, make sure it does not cause -set_version
+ # flags to be left without arguments
+@@ -12660,8 +12660,8 @@ module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quot
+ with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
+ allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+ no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+-hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+-hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
++hardcode_libdir_flag_spec=""
++hardcode_libdir_flag_spec_ld=""
+ hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
+ hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
+ hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
+@@ -12691,7 +12691,7 @@ postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_su
+ postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+ finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+ finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
+-hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
++hardcode_into_libs="no"
+ sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+ sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+ hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
+@@ -13642,7 +13642,7 @@ finish_cmds=$lt_finish_cmds
+ finish_eval=$lt_finish_eval
+
+ # Whether we should hardcode library paths into libraries.
+-hardcode_into_libs=$hardcode_into_libs
++hardcode_into_libs="no"
+
+ # Compile-time system search path for libraries.
+ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+@@ -13732,11 +13732,11 @@ no_undefined_flag=$lt_no_undefined_flag
+
+ # Flag to hardcode \$libdir into a binary during linking.
+ # This must work even if \$libdir does not exist
+-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
++hardcode_libdir_flag_spec=""
+
+ # If ld is used when linking, flag to hardcode \$libdir into a binary
+ # during linking. This must work even if \$libdir does not exist.
+-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
++hardcode_libdir_flag_spec_ld=""
+
+ # Whether we need a single "-rpath" flag with a separated argument.
+ hardcode_libdir_separator=$lt_hardcode_libdir_separator
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/ltmain.sh b/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/ltmain.sh
+index 0634c4bccce1..d3ad4932fa96 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/ltmain.sh
++++ b/qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/ltmain.sh
+@@ -5571,7 +5571,7 @@ func_mode_link ()
+ *)
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+- need_relink=yes
++ need_relink="no"
+ fi
+ ;;
+ esac
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/webrtc/test/BUILD.gn b/qtwebengine/src/3rdparty/chromium/third_party/webrtc/test/BUILD.gn
+index 58d3dab5219d..48328298d2ea 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/webrtc/test/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/third_party/webrtc/test/BUILD.gn
+@@ -258,10 +258,6 @@ rtc_library("perf_test") {
+ absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
+ if (rtc_enable_protobuf) {
+ sources += [ "testsupport/perf_test_histogram_writer.cc" ]
+- deps += [
+- "//third_party/catapult/tracing/tracing:histogram",
+- "//third_party/catapult/tracing/tracing:reserved_infos",
+- ]
+ } else {
+ sources += [ "testsupport/perf_test_histogram_writer_no_protobuf.cc" ]
+ }
+@@ -566,7 +562,6 @@ if (rtc_include_tests) {
+
+ if (rtc_enable_protobuf) {
+ sources += [ "testsupport/perf_test_histogram_writer_unittest.cc" ]
+- deps += [ "//third_party/catapult/tracing/tracing:histogram" ]
+ }
+
+ data = test_support_unittests_resources
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/binary_size/BUILD.gn b/qtwebengine/src/3rdparty/chromium/tools/binary_size/BUILD.gn
+index e6806bf77544..2c985d15fab4 100644
+--- a/qtwebengine/src/3rdparty/chromium/tools/binary_size/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/tools/binary_size/BUILD.gn
+@@ -18,7 +18,6 @@ python_library("binary_size_trybot_py") {
+ python_library("sizes_py") {
+ testonly = true
+ pydeps_file = "sizes.pydeps"
+- data_deps = [ "//third_party/catapult/tracing:convert_chart_json" ]
+ }
+
+ if (is_linux || is_chromeos) {
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/grit/BUILD.gn b/qtwebengine/src/3rdparty/chromium/tools/grit/BUILD.gn
+index 1cd3c75b553f..60c4cf2f77ac 100644
+--- a/qtwebengine/src/3rdparty/chromium/tools/grit/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/tools/grit/BUILD.gn
+@@ -33,7 +33,6 @@ group("grit_python_unittests") {
+ "//testing/scripts/run_isolated_script_test.py",
+ "//testing/xvfb.py",
+ "//tools/grit/",
+- "//third_party/catapult/third_party/typ/",
+ ]
+ }
+
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/gritsettings/resource_ids.spec b/qtwebengine/src/3rdparty/chromium/tools/gritsettings/resource_ids.spec
+index d0a4545514c9..80b0bf1737bd 100644
+--- a/qtwebengine/src/3rdparty/chromium/tools/gritsettings/resource_ids.spec
++++ b/qtwebengine/src/3rdparty/chromium/tools/gritsettings/resource_ids.spec
+@@ -499,12 +499,6 @@
+ "content/shell/shell_resources.grd": {
+ "includes": [2940],
+ },
+-
+- # This file is generated during the build.
+- "<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd": {
+- "META": {"sizes": {"includes": [20],}},
+- "includes": [2960],
+- },
+ # END content/ section.
+
+ # START ios/web/ section.
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/metrics/BUILD.gn b/qtwebengine/src/3rdparty/chromium/tools/metrics/BUILD.gn
+index 846d5248bfae..cb57d2bdae17 100644
+--- a/qtwebengine/src/3rdparty/chromium/tools/metrics/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/tools/metrics/BUILD.gn
+@@ -56,7 +56,6 @@ group("metrics_python_tests") {
+ "//testing/scripts/common.py",
+ "//testing/xvfb.py",
+ "//testing/test_env.py",
+- "//third_party/catapult/third_party/typ/",
+
+ # Scripts we depend on. Their unit tests are also included.
+ "//tools/json_comment_eater/json_comment_eater.py",
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/perf/chrome_telemetry_build/BUILD.gn b/qtwebengine/src/3rdparty/chromium/tools/perf/chrome_telemetry_build/BUILD.gn
+index 280bb754c2c7..c287fdcebb36 100644
+--- a/qtwebengine/src/3rdparty/chromium/tools/perf/chrome_telemetry_build/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/tools/perf/chrome_telemetry_build/BUILD.gn
+@@ -107,7 +107,6 @@ group("telemetry_chrome_test_without_chrome") {
+ "//tools/perf/core/", # chrome_telemetry_build/ depends on core/
+ ]
+ data_deps = [
+- "//third_party/catapult:telemetry_chrome_test_support",
+ "//tools/metrics:metrics_python_tests",
+ ]
+
+@@ -151,7 +150,5 @@ group("telemetry_chrome_test_without_chrome") {
+ "//build/android:devil_chromium_py",
+ "//build/android:stack_tools",
+ ]
+- } else if (!is_fuchsia) {
+- data_deps += [ "//third_party/catapult/telemetry:bitmaptools" ]
+ }
+ }
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/perf/core/perfetto_binary_roller/BUILD.gn b/qtwebengine/src/3rdparty/chromium/tools/perf/core/perfetto_binary_roller/BUILD.gn
+index 7fe48cba1438..e9c7f0261a5e 100644
+--- a/qtwebengine/src/3rdparty/chromium/tools/perf/core/perfetto_binary_roller/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/tools/perf/core/perfetto_binary_roller/BUILD.gn
+@@ -7,7 +7,6 @@ import("//build/util/generate_wrapper.gni")
+ generate_wrapper("upload_trace_processor") {
+ testonly = true
+ data_deps = [
+- "//third_party/catapult:telemetry_chrome_test_support",
+ "//third_party/perfetto/src/trace_processor:trace_processor_shell",
+ ]
+ data = [
+diff --git a/qtwebengine/src/3rdparty/chromium/tools/polymer/BUILD.gn b/qtwebengine/src/3rdparty/chromium/tools/polymer/BUILD.gn
+index 092066b7c045..d115144cd61f 100644
+--- a/qtwebengine/src/3rdparty/chromium/tools/polymer/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/tools/polymer/BUILD.gn
+@@ -10,6 +10,5 @@ group("polymer_tools_python_unittests") {
+ "//testing/scripts/run_isolated_script_test.py",
+ "//testing/xvfb.py",
+ "//tools/polymer/",
+- "//third_party/catapult/third_party/typ/",
+ ]
+ }
+diff --git a/qtwebengine/src/3rdparty/chromium/v8/tools/BUILD.gn b/qtwebengine/src/3rdparty/chromium/v8/tools/BUILD.gn
+index 2f8197dd3697..83304b6342b8 100644
+--- a/qtwebengine/src/3rdparty/chromium/v8/tools/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/v8/tools/BUILD.gn
+@@ -31,10 +31,6 @@ group("v8_android_test_runner_deps") {
+
+ if (is_android && !build_with_chromium) {
+ data_deps = [ "//build/android:test_runner_py" ]
+- data = [
+- # This is used by android.py, but not included by test_runner_py above.
+- "//third_party/catapult/devil/devil/android/perf/",
+- ]
+ }
+ }
+
+diff --git a/qtwebengine/src/3rdparty/chromium/weblayer/shell/BUILD.gn b/qtwebengine/src/3rdparty/chromium/weblayer/shell/BUILD.gn
+index 66984a7da54f..1815fad623df 100644
+--- a/qtwebengine/src/3rdparty/chromium/weblayer/shell/BUILD.gn
++++ b/qtwebengine/src/3rdparty/chromium/weblayer/shell/BUILD.gn
+@@ -161,7 +161,6 @@ repack("support_pak") {
+ "$root_gen_dir/components/strings/components_locale_settings_en-US.pak",
+ "$root_gen_dir/components/strings/components_strings_en-US.pak",
+ "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
+- "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
+ "$root_gen_dir/content/content_resources.pak",
+ "$root_gen_dir/content/dev_ui_content_resources.pak",
+ "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
+@@ -182,7 +181,6 @@ repack("support_pak") {
+ "//content:content_resources",
+ "//content:dev_ui_content_resources",
+ "//content/app/resources",
+- "//content/browser/tracing:resources",
+ "//mojo/public/js:resources",
+ "//net:net_resources",
+ "//third_party/blink/public:resources",
+diff --git a/qtwebengine/src/core/qtwebengine_resources.gni b/qtwebengine/src/core/qtwebengine_resources.gni
+index 3bf1a5d572c1..29fd2603cd3c 100644
+--- a/qtwebengine/src/core/qtwebengine_resources.gni
++++ b/qtwebengine/src/core/qtwebengine_resources.gni
+@@ -27,7 +27,6 @@ repack("qtwebengine_repack_resources") {
+ "$root_gen_dir/components/components_resources.pak",
+ "$root_gen_dir/components/dev_ui_components_resources.pak",
+ "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
+- "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
+ "$root_gen_dir/content/content_resources.pak",
+ "$root_gen_dir/content/dev_ui_content_resources.pak",
+ "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
+@@ -44,7 +43,6 @@ repack("qtwebengine_repack_resources") {
+ "//components/resources:components_resources_grit",
+ "//components/resources:dev_ui_components_resources_grit",
+ "//content/browser/resources/media:media_internals_resources",
+- "//content/browser/tracing:resources",
+ "//content:content_resources_grit",
+ "//content:dev_ui_content_resources_grit",
+ "//mojo/public/js:resources",
diff --git a/patches/qt-everywhere-src-5.15.2/0001-qtwayland-use-QT_EGL_NO_X11-and-qt_egl_p.h-everywher.patch b/patches/qt-everywhere-opensource-src-5.15.12/0300-qtwayland-use-QT_EGL_NO_X11-and-qt_egl_p.h-everywher.patch
index 218dc7e79..218dc7e79 100644
--- a/patches/qt-everywhere-src-5.15.2/0001-qtwayland-use-QT_EGL_NO_X11-and-qt_egl_p.h-everywher.patch
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0300-qtwayland-use-QT_EGL_NO_X11-and-qt_egl_p.h-everywher.patch
diff --git a/patches/qt-everywhere-src-5.15.2/0002-videonode-egl-use-QT_EGL_NO_X11-and-qt_egl_p.h.patch b/patches/qt-everywhere-opensource-src-5.15.12/0301-videonode-egl-use-QT_EGL_NO_X11-and-qt_egl_p.h.patch
index f17db71aa..f17db71aa 100644
--- a/patches/qt-everywhere-src-5.15.2/0002-videonode-egl-use-QT_EGL_NO_X11-and-qt_egl_p.h.patch
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0301-videonode-egl-use-QT_EGL_NO_X11-and-qt_egl_p.h.patch
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/0302-qtbase-fix-building-with-mesa-22.3.0.patch b/patches/qt-everywhere-opensource-src-5.15.12/0302-qtbase-fix-building-with-mesa-22.3.0.patch
new file mode 100644
index 000000000..b875de868
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0302-qtbase-fix-building-with-mesa-22.3.0.patch
@@ -0,0 +1,40 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sun, 4 Dec 2022 13:18:18 +0100
+Subject: [PATCH] qtbase: fix building with mesa 22.3.0
+
+X11 support is now disabled by default in the EGL headers.
+So explicitly enable it when QT_EGL_NO_X11 is not defined.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ qtbase/src/gui/configure.json | 3 ++-
+ qtbase/src/platformsupport/eglconvenience/qt_egl_p.h | 2 ++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/qtbase/src/gui/configure.json b/qtbase/src/gui/configure.json
+index 1f08795c57b4..12c95742d2da 100644
+--- a/qtbase/src/gui/configure.json
++++ b/qtbase/src/gui/configure.json
+@@ -834,7 +834,8 @@
+ "// embedded devices, are not intended to be used together with X. EGL support",
+ "// has to be disabled in plugins like xcb in this case since the native display,",
+ "// window and pixmap types will be different than what an X-based platform",
+- "// plugin would expect."
++ "// plugin would expect.",
++ "#define USE_X11"
+ ],
+ "include": [ "EGL/egl.h", "X11/Xlib.h" ],
+ "main": [
+diff --git a/qtbase/src/platformsupport/eglconvenience/qt_egl_p.h b/qtbase/src/platformsupport/eglconvenience/qt_egl_p.h
+index bf37d07fd805..1dff731e7f78 100644
+--- a/qtbase/src/platformsupport/eglconvenience/qt_egl_p.h
++++ b/qtbase/src/platformsupport/eglconvenience/qt_egl_p.h
+@@ -61,6 +61,8 @@
+ # if !defined(Q_OS_INTEGRITY)
+ # define WIN_INTERFACE_CUSTOM // NV
+ # endif // Q_OS_INTEGRITY
++#else // QT_EGL_NO_X11
++# define USE_X11
+ #endif // QT_EGL_NO_X11
+
+ #ifdef QT_EGL_WAYLAND
diff --git a/patches/qt-everywhere-src-5.15.2/0005-ptxdist-qtwebengine-allow-building-with-ptxdist.patch b/patches/qt-everywhere-opensource-src-5.15.12/0400-ptxdist-qtwebengine-allow-building-with-ptxdist.patch
index ce0652dc7..ce0652dc7 100644
--- a/patches/qt-everywhere-src-5.15.2/0005-ptxdist-qtwebengine-allow-building-with-ptxdist.patch
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0400-ptxdist-qtwebengine-allow-building-with-ptxdist.patch
diff --git a/patches/qt-everywhere-src-5.15.2/0006-ptxdist-qtwebengine-let-ninja-use-the-jobserver.patch b/patches/qt-everywhere-opensource-src-5.15.12/0401-ptxdist-qtwebengine-let-ninja-use-the-jobserver.patch
index ebbb05a24..0476d8117 100644
--- a/patches/qt-everywhere-src-5.15.2/0006-ptxdist-qtwebengine-let-ninja-use-the-jobserver.patch
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0401-ptxdist-qtwebengine-let-ninja-use-the-jobserver.patch
@@ -10,15 +10,15 @@ Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qtwebengine/src/core/gn_run.pro b/qtwebengine/src/core/gn_run.pro
-index 3d6fda80eaa3..73b15dd15731 100644
+index 9f6e64504ef1..b7e082ebd193 100644
--- a/qtwebengine/src/core/gn_run.pro
+++ b/qtwebengine/src/core/gn_run.pro
-@@ -51,7 +51,7 @@ build_pass|!debug_and_release {
- ninjaflags = $$(NINJAFLAGS)
- isEmpty(ninjaflags):!silent: ninjaflags = "-v"
+@@ -75,7 +75,7 @@ build_pass|!debug_and_release {
+ !system($$gn_run) {
+ error("GN run error!")
+ }
+- runninja.commands = $$NINJA $$ninjaflags \$\(NINJAJOBS\) -C $$gn_build_root QtWebEngineCore
++ runninja.commands = +$$NINJA $$ninjaflags \$\(NINJAJOBS\) -C $$gn_build_root QtWebEngineCore
+ }
+ }
-- runninja.commands = $$NINJA $$ninjaflags \$\(NINJAJOBS\) -C $$gn_build_root QtWebEngineCore
-+ runninja.commands = +$$NINJA $$ninjaflags \$\(NINJAJOBS\) -C $$gn_build_root QtWebEngineCore
- QMAKE_EXTRA_TARGETS += runninja
-
- build_pass:build_all: default_target.target = all
diff --git a/patches/qt-everywhere-src-5.15.2/0007-HACK-qtwebengine-workaround-for-too-long-file-names.patch b/patches/qt-everywhere-opensource-src-5.15.12/0402-HACK-qtwebengine-workaround-for-too-long-file-names.patch
index be6f6378d..be6f6378d 100644
--- a/patches/qt-everywhere-src-5.15.2/0007-HACK-qtwebengine-workaround-for-too-long-file-names.patch
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0402-HACK-qtwebengine-workaround-for-too-long-file-names.patch
diff --git a/patches/qt-everywhere-src-5.15.2/0004-eglfs_kms-device-ordering-robustness.patch b/patches/qt-everywhere-opensource-src-5.15.12/0500-eglfs_kms-device-ordering-robustness.patch
index 0532aa660..0532aa660 100644
--- a/patches/qt-everywhere-src-5.15.2/0004-eglfs_kms-device-ordering-robustness.patch
+++ b/patches/qt-everywhere-opensource-src-5.15.12/0500-eglfs_kms-device-ordering-robustness.patch
diff --git a/patches/qt-everywhere-opensource-src-5.15.12/series b/patches/qt-everywhere-opensource-src-5.15.12/series
new file mode 100644
index 000000000..fd3773d21
--- /dev/null
+++ b/patches/qt-everywhere-opensource-src-5.15.12/series
@@ -0,0 +1,35 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+#tag:upstream --start-number 1
+0001-CVE-2023-4863-5.15.patch
+0002-CVE-2023-24607-qtbase-5.15.diff.patch
+0003-CVE-2023-32573-qtsvg-5.15.diff.patch
+0004-CVE-2023-32762-qtbase-5.15.diff.patch
+0005-CVE-2023-32763-qtbase-5.15.diff.patch
+0006-CVE-2023-33285-qtbase-5.15.diff.patch
+0007-CVE-2023-34410-qtbase-5.15.diff.patch
+0008-CVE-2023-37369-qtbase-5.15.diff.patch
+0009-CVE-2023-38197-qtbase-5.15.diff.patch
+0010-CVE-2023-43114-5.15.patch
+0011-xkb-fix-build-with-libxkbcommon-1.6.0-and-later.patch
+#tag:build --start-number 100
+0100-qtwebengine-chromium-skia-Fix-build-with-gcc-12.patch
+0101-qt3d-link-with-latomic-if-necessary.patch
+0102-qt5-qtwebengine-fix-gcc13-errors.patch
+0103-Rename-x11-Present-Pixmap-to-x11-Present-PresentPixm.patch
+#tag:python3 --start-number 200
+0200-replace-Python-2-with-Python-3-in-the-build-system.patch
+0201-update-Chromium-code-for-compatibility-with-Python-3.patch
+0202-fix-build-with-Python-3.11.patch
+0203-remove-dependencies-on-third_party-catapult.patch
+#tag:no-x11 --start-number 300
+0300-qtwayland-use-QT_EGL_NO_X11-and-qt_egl_p.h-everywher.patch
+0301-videonode-egl-use-QT_EGL_NO_X11-and-qt_egl_p.h.patch
+0302-qtbase-fix-building-with-mesa-22.3.0.patch
+#tag:ptxdist --start-number 400
+0400-ptxdist-qtwebengine-allow-building-with-ptxdist.patch
+0401-ptxdist-qtwebengine-let-ninja-use-the-jobserver.patch
+0402-HACK-qtwebengine-workaround-for-too-long-file-names.patch
+#tag:kms --start-number 500
+0500-eglfs_kms-device-ordering-robustness.patch
+# 8476be8c0300ddf6ed6fd7e18b43decb - git-ptx-patches magic
diff --git a/patches/qt-everywhere-src-5.15.2/0008-qtbase-include-limits-where-necessary.patch b/patches/qt-everywhere-src-5.15.2/0008-qtbase-include-limits-where-necessary.patch
deleted file mode 100644
index 33138cc36..000000000
--- a/patches/qt-everywhere-src-5.15.2/0008-qtbase-include-limits-where-necessary.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From: Lucas Stach <l.stach@pengutronix.de>
-Date: Sat, 1 May 2021 00:57:24 +0200
-Subject: [PATCH] qtbase: include limits where necessary
-
-Upstream fixes:
-https://code.qt.io/cgit/qt/qtbase.git/commit/?id=813a928c7c3cf986
-https://code.qt.io/cgit/qt/qtbase.git/commit/?id=9c56d4da2ff631a8
-
-Fixes build with GCC11, which changed internal includes so that
-limits isn't implicitly pulled in some cases.
-
-Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
----
- qtbase/src/corelib/global/qendian.h | 2 ++
- qtbase/src/corelib/global/qfloat16.h | 1 +
- qtbase/src/corelib/text/qbytearraymatcher.h | 2 ++
- qtbase/src/corelib/tools/qoffsetstringarray_p.h | 1 +
- 4 files changed, 6 insertions(+)
-
-diff --git a/qtbase/src/corelib/global/qendian.h b/qtbase/src/corelib/global/qendian.h
-index 257efbbdbecf..a97776c761b7 100644
---- a/qtbase/src/corelib/global/qendian.h
-+++ b/qtbase/src/corelib/global/qendian.h
-@@ -44,6 +44,8 @@
- #include <QtCore/qfloat16.h>
- #include <QtCore/qglobal.h>
-
-+#include <limits>
-+
- // include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems
- #include <stdlib.h>
- #include <string.h>
-diff --git a/qtbase/src/corelib/global/qfloat16.h b/qtbase/src/corelib/global/qfloat16.h
-index c7a9c87af322..5302be072ed8 100644
---- a/qtbase/src/corelib/global/qfloat16.h
-+++ b/qtbase/src/corelib/global/qfloat16.h
-@@ -43,6 +43,7 @@
-
- #include <QtCore/qglobal.h>
- #include <QtCore/qmetatype.h>
-+#include <limits>
- #include <string.h>
-
- #if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__AVX2__) && !defined(__F16C__)
-diff --git a/qtbase/src/corelib/text/qbytearraymatcher.h b/qtbase/src/corelib/text/qbytearraymatcher.h
-index 0eedfc1d2035..f5f9bef7b87c 100644
---- a/qtbase/src/corelib/text/qbytearraymatcher.h
-+++ b/qtbase/src/corelib/text/qbytearraymatcher.h
-@@ -42,6 +42,8 @@
-
- #include <QtCore/qbytearray.h>
-
-+#include <limits>
-+
- QT_BEGIN_NAMESPACE
-
-
-diff --git a/qtbase/src/corelib/tools/qoffsetstringarray_p.h b/qtbase/src/corelib/tools/qoffsetstringarray_p.h
-index 4dd9e9603bc1..8b3fbfe55985 100644
---- a/qtbase/src/corelib/tools/qoffsetstringarray_p.h
-+++ b/qtbase/src/corelib/tools/qoffsetstringarray_p.h
-@@ -53,6 +53,7 @@
-
- #include "private/qglobal_p.h"
-
-+#include <limits>
- #include <tuple>
- #include <array>
-
diff --git a/patches/qt-everywhere-src-5.15.2/series b/patches/qt-everywhere-src-5.15.2/series
deleted file mode 100644
index 226529352..000000000
--- a/patches/qt-everywhere-src-5.15.2/series
+++ /dev/null
@@ -1,11 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-qtwayland-use-QT_EGL_NO_X11-and-qt_egl_p.h-everywher.patch
-0002-videonode-egl-use-QT_EGL_NO_X11-and-qt_egl_p.h.patch
-0003-qt3d-link-with-latomic-if-necessary.patch
-0004-eglfs_kms-device-ordering-robustness.patch
-0005-ptxdist-qtwebengine-allow-building-with-ptxdist.patch
-0006-ptxdist-qtwebengine-let-ninja-use-the-jobserver.patch
-0007-HACK-qtwebengine-workaround-for-too-long-file-names.patch
-0008-qtbase-include-limits-where-necessary.patch
-# 0339a08cc8ad82af4c6542508057d7e7 - git-ptx-patches magic
diff --git a/patches/qt-everywhere-src-6.6.2/0100-qtwebengine-gn-fix-building-with-newer-compilers.patch b/patches/qt-everywhere-src-6.6.2/0100-qtwebengine-gn-fix-building-with-newer-compilers.patch
new file mode 100644
index 000000000..ea988d57e
--- /dev/null
+++ b/patches/qt-everywhere-src-6.6.2/0100-qtwebengine-gn-fix-building-with-newer-compilers.patch
@@ -0,0 +1,47 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sat, 9 Mar 2024 10:03:58 +0100
+Subject: [PATCH] qtwebengine: gn: fix building with newer compilers
+
+Without this, uint8_t is not defined with newer compilers and building
+fails with:
+
+.../gn/src/base/containers/span.h:393:12: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
+.../gn/src/base/containers/span.h:393:75: error: template argument 1 is invalid
+.../gn/src/base/containers/span.h: In function 'int base::as_bytes(span<T, Extent>)':
+.../gn/src/base/containers/span.h:395:34: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
+.../gn/src/base/containers/span.h:395:34: error: expected '>' before 'uint8_t'
+.../gn/src/base/containers/span.h:395:34: error: expected '(' before 'uint8_t'
+.../gn/src/base/containers/span.h:395:34: error: 'uint8_t' was not declared in this scope
+.../gn/src/base/containers/span.h:395:34: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
+.../gn/src/base/containers/span.h:395:42: error: expected primary-expression before '>' token
+.../gn/src/base/containers/span.h:395:69: error: expected ')' before '}' token
+.../gn/src/base/containers/span.h: At global scope:
+.../gn/src/base/containers/span.h:401:6: error: 'uint8_t' was not declared in this scope
+.../gn/src/base/containers/span.h:401:6: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
+.../gn/src/base/containers/span.h:401:69: error: template argument 1 is invalid
+.../gn/src/base/containers/span.h: In function 'int base::as_writable_bytes(span<T, Extent>)':
+.../gn/src/base/containers/span.h:403:28: error: 'uint8_t' does not name a type
+.../gn/src/base/containers/span.h:403:28: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
+.../gn/src/base/containers/span.h:403:35: error: expected '>' before '*' token
+.../gn/src/base/containers/span.h:403:35: error: expected '(' before '*' token
+.../gn/src/base/containers/span.h:403:36: error: expected primary-expression before '>' token
+.../gn/src/base/containers/span.h:403:63: error: expected ')' before '}' token
+.../gn/src/base/containers/span.h:403:63: error: cannot convert '<brace-enclosed initializer list>' to 'int' in return
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ qtwebengine/src/3rdparty/gn/src/base/containers/span.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/qtwebengine/src/3rdparty/gn/src/base/containers/span.h b/qtwebengine/src/3rdparty/gn/src/base/containers/span.h
+index 4af83b44bcb4..8fc90e189709 100644
+--- a/qtwebengine/src/3rdparty/gn/src/base/containers/span.h
++++ b/qtwebengine/src/3rdparty/gn/src/base/containers/span.h
+@@ -9,6 +9,7 @@
+
+ #include <algorithm>
+ #include <array>
++#include <cstdint>
+ #include <iterator>
+ #include <string_view>
+ #include <type_traits>
diff --git a/patches/qt-everywhere-src-6.6.2/0200-HACK-qtwebengine-workaround-for-too-long-file-names.patch b/patches/qt-everywhere-src-6.6.2/0200-HACK-qtwebengine-workaround-for-too-long-file-names.patch
new file mode 100644
index 000000000..944709e1f
--- /dev/null
+++ b/patches/qt-everywhere-src-6.6.2/0200-HACK-qtwebengine-workaround-for-too-long-file-names.patch
@@ -0,0 +1,39 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 7 Nov 2017 10:20:09 +0100
+Subject: [PATCH] HACK: qtwebengine: workaround for too long file names
+
+Without this building fails with:
+ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_v8_bindings_modules_v8_generated_init_partial__XXX_path_to_the_bsp_platform_XX_build-target_qt-everywhere-opensource-src-5.9.2-build_qtwebengine_src_toolchain_target__rule.rsp): Unable to create file. File name too long
+
+Hack taken from the upstream bugreport:
+https://bugreports.qt.io/browse/QTBUG-59769
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ qtwebengine/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/qtwebengine/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc b/qtwebengine/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc
+index 6e1d2abf1dc1..5cb59e841f38 100644
+--- a/qtwebengine/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc
++++ b/qtwebengine/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc
+@@ -125,9 +125,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() {
+ // strictly necessary for regular one-shot actions, but it's easier to
+ // just always define unique_name.
+ std::string rspfile = custom_rule_name;
++
++ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end
++ //please note ".$unique_name" is not used at the moment
++ int pos = 0;
++ std::string delimiter("_");
++ while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos)
++ rspfile = rspfile.substr(0,pos);
++
+ if (!target_->sources().empty())
+ rspfile += ".$unique_name";
+ rspfile += ".rsp";
++
+ out_ << " rspfile = " << rspfile << std::endl;
+
+ // Response file contents.
diff --git a/patches/qt-everywhere-src-6.6.2/0201-HACK-don-t-complain-about-unnecessary-host-tools.patch b/patches/qt-everywhere-src-6.6.2/0201-HACK-don-t-complain-about-unnecessary-host-tools.patch
new file mode 100644
index 000000000..3d7069104
--- /dev/null
+++ b/patches/qt-everywhere-src-6.6.2/0201-HACK-don-t-complain-about-unnecessary-host-tools.patch
@@ -0,0 +1,59 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 8 Jul 2022 16:59:49 +0200
+Subject: [PATCH] HACK: don't complain about unnecessary host-tools
+
+The cross build will fail if those tools are not available, but they are
+not actually needed at buildtime.
+
+This avoids building unnecessary stuff in host-qt6.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ qtdeclarative/tools/CMakeLists.txt | 7 +++++--
+ qtquick3d/tools/CMakeLists.txt | 2 ++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/qtdeclarative/tools/CMakeLists.txt b/qtdeclarative/tools/CMakeLists.txt
+index b86d3251a3ad..2dbbdc1e0caf 100644
+--- a/qtdeclarative/tools/CMakeLists.txt
++++ b/qtdeclarative/tools/CMakeLists.txt
+@@ -38,9 +38,12 @@ if(QT_FEATURE_qml_preview AND QT_FEATURE_thread AND NOT ANDROID AND NOT WASM AND
+ endif()
+ if(QT_BUILD_SHARED_LIBS AND QT_FEATURE_thread AND TARGET Qt::Quick AND NOT ANDROID AND NOT WASM AND NOT IOS AND NOT rtems)
+ add_subdirectory(qmlscene)
+- add_subdirectory(qmltime)
++ if (NOT CMAKE_CROSSCOMPILING)
++ add_subdirectory(qmltime)
++ endif()
+ endif()
+ if(QT_BUILD_SHARED_LIBS
++ AND NOT CMAKE_CROSSCOMPILING
+ AND QT_FEATURE_process
+ AND QT_FEATURE_regularexpression
+ AND QT_FEATURE_thread
+@@ -68,7 +71,7 @@ if(TARGET Qt::Quick
+ AND NOT rtems)
+ add_subdirectory(qmleasing)
+ endif()
+-if(QT_FEATURE_thread AND TARGET Qt::QuickTest AND NOT ANDROID AND NOT WASM AND NOT rtems)
++if(QT_FEATURE_thread AND TARGET Qt::QuickTest AND NOT ANDROID AND NOT WASM AND NOT rtems AND NOT CMAKE_CROSSCOMPILING)
+ add_subdirectory(qmltestrunner)
+ endif()
+ if(QT_FEATURE_private_tests AND QT_FEATURE_thread AND NOT ANDROID AND NOT WASM AND NOT IOS AND NOT rtems)
+diff --git a/qtquick3d/tools/CMakeLists.txt b/qtquick3d/tools/CMakeLists.txt
+index 144af64c1095..6a40010a4330 100644
+--- a/qtquick3d/tools/CMakeLists.txt
++++ b/qtquick3d/tools/CMakeLists.txt
+@@ -1,6 +1,7 @@
+ # Copyright (C) 2022 The Qt Company Ltd.
+ # SPDX-License-Identifier: BSD-3-Clause
+
++if (NOT CMAKE_CROSSCOMPILING)
+ add_subdirectory(balsam)
+ if(TARGET Qt::Widgets)
+ if(TARGET Qt::Concurrent)
+@@ -18,3 +19,4 @@ endif()
+ add_subdirectory(instancer)
+ add_subdirectory(shapegen)
+ add_subdirectory(materialeditor)
++endif()
diff --git a/patches/qt-everywhere-src-6.6.2/0202-ptxdist-qtwebengine-allow-building-with-ptxdist.patch b/patches/qt-everywhere-src-6.6.2/0202-ptxdist-qtwebengine-allow-building-with-ptxdist.patch
new file mode 100644
index 000000000..9136996d6
--- /dev/null
+++ b/patches/qt-everywhere-src-6.6.2/0202-ptxdist-qtwebengine-allow-building-with-ptxdist.patch
@@ -0,0 +1,26 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 8 Jul 2022 17:01:15 +0200
+Subject: [PATCH] ptxdist: qtwebengine: allow building with ptxdist
+
+The buildsystem detects some hardware features from CXXFLAGS.
+With ptxdist the relevant flags are hidden in the toolchain defaults, so
+inject them via environment variable.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ qtwebengine/cmake/Functions.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/qtwebengine/cmake/Functions.cmake b/qtwebengine/cmake/Functions.cmake
+index 923f78dbdfcb..33aefea614fd 100644
+--- a/qtwebengine/cmake/Functions.cmake
++++ b/qtwebengine/cmake/Functions.cmake
+@@ -725,7 +725,7 @@ function(extract_cflag result cflag)
+ list(APPEND cflags ${CMAKE_CXX_COMPILER_ARG${i}})
+ math(EXPR i "${i} + 1")
+ endwhile()
+- list(APPEND cflags ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS})
++ list(APPEND cflags ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} $ENV{PTX_CMAKE_CFLAGS})
+ string(REPLACE ";" " " cflags "${cflags}")
+ message(DEBUG "Found cflags: ${cflags}")
+ if(cflags MATCHES "-${cflag}=([^ ]+)")
diff --git a/patches/qt-everywhere-src-6.6.2/0203-fix-building-with-QT_FEATURE_qml_devtools-disabled.patch b/patches/qt-everywhere-src-6.6.2/0203-fix-building-with-QT_FEATURE_qml_devtools-disabled.patch
new file mode 100644
index 000000000..7f9925a5c
--- /dev/null
+++ b/patches/qt-everywhere-src-6.6.2/0203-fix-building-with-QT_FEATURE_qml_devtools-disabled.patch
@@ -0,0 +1,29 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Nov 2022 20:05:57 +0100
+Subject: [PATCH] fix building with QT_FEATURE_qml_devtools disabled
+
+Without this, building fails with:
+
+CMake Error at qtbase/cmake/QtPluginHelpers.cmake:496 (message):
+ The plug-in 'QmlLintQuickPlugin' does not belong to any Qt module.
+Call Stack (most recent call first):
+ qtbase/cmake/QtPluginHelpers.cmake:189 (qt_internal_get_module_for_plugin)
+ qtdeclarative/src/plugins/qmllint/quick/CMakeLists.txt:1 (qt_internal_add_plugin)
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ qtdeclarative/src/plugins/CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/qtdeclarative/src/plugins/CMakeLists.txt b/qtdeclarative/src/plugins/CMakeLists.txt
+index 548ef486f014..54058d431934 100644
+--- a/qtdeclarative/src/plugins/CMakeLists.txt
++++ b/qtdeclarative/src/plugins/CMakeLists.txt
+@@ -10,4 +10,6 @@ if(TARGET Qt::Quick)
+ add_subdirectory(scenegraph)
+ endif()
+
+-add_subdirectory(qmllint)
++if(QT_FEATURE_qml_devtools)
++ add_subdirectory(qmllint)
++endif()
diff --git a/patches/qt-everywhere-src-6.6.2/series b/patches/qt-everywhere-src-6.6.2/series
new file mode 100644
index 000000000..ca0365f45
--- /dev/null
+++ b/patches/qt-everywhere-src-6.6.2/series
@@ -0,0 +1,11 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+#tag:upstream --start-number 1
+#tag:build --start-number 100
+0100-qtwebengine-gn-fix-building-with-newer-compilers.patch
+#tag:ptxdist --start-number 200
+0200-HACK-qtwebengine-workaround-for-too-long-file-names.patch
+0201-HACK-don-t-complain-about-unnecessary-host-tools.patch
+0202-ptxdist-qtwebengine-allow-building-with-ptxdist.patch
+0203-fix-building-with-QT_FEATURE_qml_devtools-disabled.patch
+# e03d0404bad7decacab58c834de428aa - git-ptx-patches magic
diff --git a/patches/qwt-6.0.1/0001-fix-prefix.patch b/patches/qwt-6.0.1/0001-fix-prefix.patch
deleted file mode 100644
index 970114863..000000000
--- a/patches/qwt-6.0.1/0001-fix-prefix.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 3 Aug 2011 16:09:23 +0200
-Subject: [PATCH] fix prefix
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- qwtconfig.pri | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/qwtconfig.pri b/qwtconfig.pri
-index b0d2110..86265e1 100644
---- a/qwtconfig.pri
-+++ b/qwtconfig.pri
-@@ -19,7 +19,7 @@ QWT_VERSION = $${QWT_VER_MAJ}.$${QWT_VER_MIN}.$${QWT_VER_PAT}
- QWT_INSTALL_PREFIX = $$[QT_INSTALL_PREFIX]
-
- unix {
-- QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION
-+ QWT_INSTALL_PREFIX = /usr
- }
-
- win32 {
diff --git a/patches/qwt-6.0.1/0002-disable-designer-plugins.patch b/patches/qwt-6.0.1/0002-disable-designer-plugins.patch
deleted file mode 100644
index a919b9473..000000000
--- a/patches/qwt-6.0.1/0002-disable-designer-plugins.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 3 Aug 2011 16:09:42 +0200
-Subject: [PATCH] disable designer plugins
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- qwtconfig.pri | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/qwtconfig.pri b/qwtconfig.pri
-index 86265e1..54f8059 100644
---- a/qwtconfig.pri
-+++ b/qwtconfig.pri
-@@ -98,7 +98,7 @@ QWT_CONFIG += QwtMathML
- # Otherwise you have to build it from the designer directory.
- ######################################################################
-
--QWT_CONFIG += QwtDesigner
-+# QWT_CONFIG += QwtDesigner
-
- ######################################################################
- # If you want to auto build the examples, enable the line below
diff --git a/patches/qwt-6.0.1/0003-disable-svg-by-default.patch b/patches/qwt-6.0.1/0003-disable-svg-by-default.patch
deleted file mode 100644
index 74d42fafb..000000000
--- a/patches/qwt-6.0.1/0003-disable-svg-by-default.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 3 Aug 2011 15:08:05 +0200
-Subject: [PATCH] disable svg by default
-
-it can be enabled with QWT_CONFIG+=QwtSvg as qmake option.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- qwtconfig.pri | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/qwtconfig.pri b/qwtconfig.pri
-index 54f8059..32117ee 100644
---- a/qwtconfig.pri
-+++ b/qwtconfig.pri
-@@ -79,7 +79,7 @@ QWT_CONFIG += QwtWidgets
- # export a plot to a SVG document
- ######################################################################
-
--QWT_CONFIG += QwtSvg
-+# QWT_CONFIG += QwtSvg
-
- ######################################################################
- # You can use the MathML renderer of the Qt solutions package to
diff --git a/patches/qwt-6.0.1/0004-Disable-the-textengines-to-be-less-depended-on-the-Q.patch b/patches/qwt-6.0.1/0004-Disable-the-textengines-to-be-less-depended-on-the-Q.patch
deleted file mode 100644
index f14d312e7..000000000
--- a/patches/qwt-6.0.1/0004-Disable-the-textengines-to-be-less-depended-on-the-Q.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Juergen Beisert <jbe@pengutronix.de>
-Date: Fri, 26 Aug 2011 12:19:33 +0200
-Subject: [PATCH] Disable the textengines to be less depended on the Qt
- config.
-
-If the textengines are built, it ends with an error message:
-
-make[3]: Entering directory `[...]/platform/build-target/qwt-6.0.1/textengines/mathml'
-compiling qwt_mml_document.cpp
-qwt_mml_document.cpp:5:20: fatal error: QDomNode: No such file or directory
-compilation terminated.
-make[3]: *** [obj/qwt_mml_document.o] Error 1
-
-As the PTXdist rule file only installs the library and not the tools, they can
-be disabled.
-
-Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
----
- qwt.pro | 3 +--
- 1 files changed, 1 insertions(+), 2 deletions(-)
-
-diff --git a/qwt.pro b/qwt.pro
-index 4ab4c08..950c182 100644
---- a/qwt.pro
-+++ b/qwt.pro
-@@ -13,8 +13,7 @@ TEMPLATE = subdirs
- CONFIG += ordered
-
- SUBDIRS = \
-- src \
-- textengines
-+ src
-
- contains(QWT_CONFIG, QwtDesigner ) {
- SUBDIRS += designer
diff --git a/patches/qwt-6.0.1/series b/patches/qwt-6.0.1/series
deleted file mode 100644
index cf545f65a..000000000
--- a/patches/qwt-6.0.1/series
+++ /dev/null
@@ -1,7 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-fix-prefix.patch
-0002-disable-designer-plugins.patch
-0003-disable-svg-by-default.patch
-0004-Disable-the-textengines-to-be-less-depended-on-the-Q.patch
-# 8284e163940123ec689fea7298eb4cb1 - git-ptx-patches magic
diff --git a/patches/readline-8.0/0001-rl-attribute.patch b/patches/readline-8.2/0001-rl-attribute.patch
index 7f8f9ec3f..f7b2f150f 100644
--- a/patches/readline-8.0/0001-rl-attribute.patch
+++ b/patches/readline-8.2/0001-rl-attribute.patch
@@ -14,11 +14,11 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/readline.h b/readline.h
-index da782716af2a..5858147b2e8d 100644
+index cac269f0b433..ec50816f8d39 100644
--- a/readline.h
+++ b/readline.h
-@@ -393,7 +393,7 @@ extern int rl_reset_line_state PARAMS((void));
- extern int rl_crlf PARAMS((void));
+@@ -405,7 +405,7 @@ extern void rl_deactivate_mark (void);
+ extern int rl_mark_active_p (void);
#if defined (USE_VARARGS) && defined (PREFER_STDARG)
-extern int rl_message (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
diff --git a/patches/readline-8.0/0002-rl-header.patch b/patches/readline-8.2/0002-rl-header.patch
index 108957d3d..ad5cd2f93 100644
--- a/patches/readline-8.0/0002-rl-header.patch
+++ b/patches/readline-8.2/0002-rl-header.patch
@@ -14,7 +14,7 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2 files changed, 2 insertions(+)
diff --git a/history.h b/history.h
-index cc3de29a6423..24cd63ce111c 100644
+index 5208f9a463b2..ed4e4f7b24f2 100644
--- a/history.h
+++ b/history.h
@@ -32,6 +32,7 @@ extern "C" {
@@ -26,7 +26,7 @@ index cc3de29a6423..24cd63ce111c 100644
# include <readline/rltypedefs.h>
#endif
diff --git a/readline.h b/readline.h
-index 5858147b2e8d..7d4ecd2346fa 100644
+index ec50816f8d39..fd9bf5d81d5f 100644
--- a/readline.h
+++ b/readline.h
@@ -32,6 +32,7 @@ extern "C" {
diff --git a/patches/readline-8.0/0003-rl-no-rpath.patch b/patches/readline-8.2/0003-rl-no-rpath.patch
index 0f49199e5..f503f3830 100644
--- a/patches/readline-8.0/0003-rl-no-rpath.patch
+++ b/patches/readline-8.2/0003-rl-no-rpath.patch
@@ -13,10 +13,10 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/support/shobj-conf b/support/shobj-conf
-index 7920f1b5cb90..7ac9c9fb311d 100644
+index cd7634dfa624..029123a64c64 100644
--- a/support/shobj-conf
+++ b/support/shobj-conf
-@@ -128,7 +128,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*-gentoo)
+@@ -128,7 +128,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*|midnightbsd*|freebsd*|dragonfly*)
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
diff --git a/patches/readline-8.0/0004-rlfe-history.patch b/patches/readline-8.2/0004-rlfe-history.patch
index 1bd44d33f..1bd44d33f 100644
--- a/patches/readline-8.0/0004-rlfe-history.patch
+++ b/patches/readline-8.2/0004-rlfe-history.patch
diff --git a/patches/readline-8.0/0005-always-link-against-our-termcap-libraries.patch b/patches/readline-8.2/0005-always-link-against-our-termcap-libraries.patch
index 20cac9fe5..afaa67648 100644
--- a/patches/readline-8.0/0005-always-link-against-our-termcap-libraries.patch
+++ b/patches/readline-8.2/0005-always-link-against-our-termcap-libraries.patch
@@ -14,7 +14,7 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/shlib/Makefile.in b/shlib/Makefile.in
-index f2ec3e46b7ba..3298008abec4 100644
+index d138524ce9ee..ee46f9806332 100644
--- a/shlib/Makefile.in
+++ b/shlib/Makefile.in
@@ -174,11 +174,11 @@ unsupported:
diff --git a/patches/readline-8.0/series b/patches/readline-8.2/series
index 5b5cd2fea..5b5cd2fea 100644
--- a/patches/readline-8.0/series
+++ b/patches/readline-8.2/series
diff --git a/patches/redis-7.2.2/0001-Support-systemd-and-set-a-data-directory.patch b/patches/redis-7.2.2/0001-Support-systemd-and-set-a-data-directory.patch
new file mode 100644
index 000000000..dde2a41a6
--- /dev/null
+++ b/patches/redis-7.2.2/0001-Support-systemd-and-set-a-data-directory.patch
@@ -0,0 +1,30 @@
+From: Clemens Gruber <clemens.gruber@pqgruber.com>
+Date: Mon, 15 Nov 2021 16:21:31 +0100
+Subject: [PATCH] Support systemd and set a data directory
+
+---
+ redis.conf | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/redis.conf b/redis.conf
+index 97f077b0d0aa..abc03980de3e 100644
+--- a/redis.conf
++++ b/redis.conf
+@@ -324,7 +324,7 @@ daemonize no
+ # The default is "no". To run under upstart/systemd, you can simply uncomment
+ # the line below:
+ #
+-# supervised auto
++supervised auto
+
+ # If a pid file is specified, Redis writes it where specified at startup
+ # and removes it at exit.
+@@ -507,7 +507,7 @@ rdb-del-sync-files no
+ # The Append Only File will also be created inside this directory.
+ #
+ # Note that you must specify a directory here, not a file name.
+-dir ./
++dir /var/lib/redis/
+
+ ################################# REPLICATION #################################
+
diff --git a/patches/redis-7.2.2/series b/patches/redis-7.2.2/series
new file mode 100644
index 000000000..1a299f8b7
--- /dev/null
+++ b/patches/redis-7.2.2/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Support-systemd-and-set-a-data-directory.patch
+# a122637ab2789578ffe3ff7cc6f22faf - git-ptx-patches magic
diff --git a/patches/libxslt-1.1.34/autogen.sh b/patches/rng-tools-6.14/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/libxslt-1.1.34/autogen.sh
+++ b/patches/rng-tools-6.14/autogen.sh
diff --git a/patches/rng-tools-6.5/0001-Buildsystem-fix-autotools-setup.patch b/patches/rng-tools-6.5/0001-Buildsystem-fix-autotools-setup.patch
deleted file mode 100644
index 9f03d86a0..000000000
--- a/patches/rng-tools-6.5/0001-Buildsystem-fix-autotools-setup.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Juergen Borleis <jbe@pengutronix.de>
-Date: Mon, 15 Oct 2018 12:51:16 +0200
-Subject: [PATCH] Buildsystem: fix autotools setup
-
-Using 'gnu' forces the existence of various files, which are not present
-in this repository ('README' for example).
-
-Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index b1544d9aefcb..6eaed1071869 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -21,7 +21,7 @@ AC_INIT(rng-tools, 6.5, [Neil Horman <nhorman@tuxdriver.com>])
- AC_PREREQ(2.52)
- AC_CONFIG_SRCDIR([rngd.c])
- AC_CANONICAL_TARGET
--AM_INIT_AUTOMAKE([gnu])
-+AM_INIT_AUTOMAKE([foreign])
- AC_CONFIG_HEADERS([rng-tools-config.h])
- AC_CONFIG_MACRO_DIRS([m4])
-
diff --git a/patches/rng-tools-6.5/autogen.sh b/patches/rng-tools-6.5/autogen.sh
deleted file mode 120000
index 9f8a4cb7d..000000000
--- a/patches/rng-tools-6.5/autogen.sh
+++ /dev/null
@@ -1 +0,0 @@
-../autogen.sh \ No newline at end of file
diff --git a/patches/rng-tools-6.5/series b/patches/rng-tools-6.5/series
deleted file mode 100644
index 48616bf45..000000000
--- a/patches/rng-tools-6.5/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-Buildsystem-fix-autotools-setup.patch
-# 05372db98be6dd445f49fca3ec398a6f - git-ptx-patches magic
diff --git a/patches/samba-4.14.6/0001-HACK-never-use-libunwind.patch b/patches/samba-4.14.6/0001-HACK-never-use-libunwind.patch
new file mode 100644
index 000000000..d3f04556a
--- /dev/null
+++ b/patches/samba-4.14.6/0001-HACK-never-use-libunwind.patch
@@ -0,0 +1,46 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Thu, 15 Jul 2021 13:30:48 +0200
+Subject: [PATCH] HACK: never use libunwind
+
+The check is broken. libunwind is found by pkg-config, but the cflags are
+not used so libunwind.h is not found. This breaks building:
+
+../../lib/util/fault.c: In function 'log_stack_trace':
+../../lib/util/fault.c:228:2: error: unknown type name 'unw_cursor_t'
+../../lib/util/fault.c:229:2: error: unknown type name 'unw_context_t'; did you mean 'ucontext_t'?
+../../lib/util/fault.c:233:2: error: unknown type name 'unw_word_t'
+../../lib/util/fault.c:237:6: warning: implicit declaration of function 'unw_getcontext' [-Wimplicit-function-declaration]
+../../lib/util/fault.c:241:6: warning: implicit declaration of function 'unw_init_local' [-Wimplicit-function-declaration]
+../../lib/util/fault.c:249:6: warning: implicit declaration of function 'unw_get_reg' [-Wimplicit-function-declaration]
+../../lib/util/fault.c:249:27: error: 'UNW_REG_IP' undeclared (first use in this function)
+../../lib/util/fault.c:249:27: note: each undeclared identifier is reported only once for each function it appears in
+../../lib/util/fault.c:250:27: error: 'UNW_REG_SP' undeclared (first use in this function)
+../../lib/util/fault.c:252:14: warning: implicit declaration of function 'unw_get_proc_name'; did you mean 'rep_getprogname'? [-Wimplicit-function-declaration]
+../../lib/util/fault.c:256:12: error: 'UNW_ENOMEM' undeclared (first use in this function); did you mean 'ENOMEM'?
+../../lib/util/fault.c:271:11: warning: implicit declaration of function 'unw_step' [-Wimplicit-function-declaration]
+
+So just don't try to use libunwind at all.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ lib/util/wscript_configure | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/lib/util/wscript_configure b/lib/util/wscript_configure
+index d4450d25b985..389c70d1b3ac 100644
+--- a/lib/util/wscript_configure
++++ b/lib/util/wscript_configure
+@@ -11,13 +11,6 @@ conf.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo', checklibc=True, h
+ conf.CHECK_HEADERS('execinfo.h')
+
+ conf.SET_TARGET_TYPE('LIBUNWIND', 'EMPTY')
+-if conf.check_cfg(package='libunwind-generic',
+- args='--cflags --libs',
+- msg='Checking for libunwind',
+- uselib_store='LIBUNWIND',
+- mandatory=False):
+- if conf.CHECK_HEADERS('libunwind.h'):
+- conf.SET_TARGET_TYPE('LIBUNWIND', 'SYSLIB')
+
+ conf.CHECK_STRUCTURE_MEMBER('struct statvfs', 'f_frsize', define='HAVE_FRSIZE', headers='sys/statvfs.h')
+
diff --git a/patches/samba-4.14.6/series b/patches/samba-4.14.6/series
new file mode 100644
index 000000000..7955d1a40
--- /dev/null
+++ b/patches/samba-4.14.6/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-HACK-never-use-libunwind.patch
+# 5db8dc2bd592ed4522a243e73a29125b - git-ptx-patches magic
diff --git a/patches/scikit-learn-1.3.1/0001-setup.py-don-t-try-to-import-numpy-scipy-at-build-ti.patch b/patches/scikit-learn-1.3.1/0001-setup.py-don-t-try-to-import-numpy-scipy-at-build-ti.patch
new file mode 100644
index 000000000..3638cdef5
--- /dev/null
+++ b/patches/scikit-learn-1.3.1/0001-setup.py-don-t-try-to-import-numpy-scipy-at-build-ti.patch
@@ -0,0 +1,28 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 20 Nov 2023 12:58:14 +0100
+Subject: [PATCH] setup.py: don't try to import numpy & scipy at build time
+ when cross-compiling
+
+It will fail because of binary plugins that are built for the target.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ setup.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index f78b7ec3545a..2b8a20ae4013 100755
+--- a/setup.py
++++ b/setup.py
+@@ -619,8 +619,9 @@ def setup_package():
+ % (required_version, platform.python_version(), sys.executable)
+ )
+
+- check_package_status("numpy", min_deps.NUMPY_MIN_VERSION)
+- check_package_status("scipy", min_deps.SCIPY_MIN_VERSION)
++ if "PYTHON_CROSSENV" not in os.environ:
++ check_package_status("numpy", min_deps.NUMPY_MIN_VERSION)
++ check_package_status("scipy", min_deps.SCIPY_MIN_VERSION)
+
+ _check_cython_version()
+ metadata["ext_modules"] = configure_extension_modules()
diff --git a/patches/scikit-learn-1.3.1/series b/patches/scikit-learn-1.3.1/series
new file mode 100644
index 000000000..cefec29ec
--- /dev/null
+++ b/patches/scikit-learn-1.3.1/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-setup.py-don-t-try-to-import-numpy-scipy-at-build-ti.patch
+# d83a3e58ead61a9fd1984f1baaed7a71 - git-ptx-patches magic
diff --git a/patches/scipy-1.11.3/0001-BLD-special-fix-dependencies-for-_ellip_harm_2-19168.patch b/patches/scipy-1.11.3/0001-BLD-special-fix-dependencies-for-_ellip_harm_2-19168.patch
new file mode 100644
index 000000000..7bd240437
--- /dev/null
+++ b/patches/scipy-1.11.3/0001-BLD-special-fix-dependencies-for-_ellip_harm_2-19168.patch
@@ -0,0 +1,34 @@
+From: Ben Boeckel <mathstuf@users.noreply.github.com>
+Date: Fri, 1 Sep 2023 08:38:28 +0000
+Subject: [PATCH] BLD: special: fix dependencies for `_ellip_harm_2` (#19168)
+
+Generating the source for `_ellip_harm_2` requires the
+`cython_special.pxd` header to be generated. So add a dependency for
+this.
+
+Closes gh-19167
+
+Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
+---
+ scipy/special/meson.build | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scipy/special/meson.build b/scipy/special/meson.build
+index e7e25aa54e83..900064410381 100644
+--- a/scipy/special/meson.build
++++ b/scipy/special/meson.build
+@@ -318,12 +318,12 @@ cython_special_pxd = custom_target('_dummy_cython_special.pxd',
+ uf_cython_gen = generator(cython,
+ arguments : cython_args,
+ output : '@BASENAME@.c',
+- depends : [_cython_tree, _ufuncs_pxi_pxd_sources])
++ depends : [_cython_tree, _ufuncs_pxi_pxd_sources, cython_special_pxd])
+
+ uf_cython_gen_cpp = generator(cython,
+ arguments : cython_cplus_args,
+ output : '@BASENAME@.cpp',
+- depends : [_cython_tree, _ufuncs_pxi_pxd_sources])
++ depends : [_cython_tree, _ufuncs_pxi_pxd_sources, cython_special_pxd])
+
+ py3.extension_module('_ufuncs',
+ [
diff --git a/patches/scipy-1.11.3/0100-add-option-to-specify-python-binary-for-code-generat.patch b/patches/scipy-1.11.3/0100-add-option-to-specify-python-binary-for-code-generat.patch
new file mode 100644
index 000000000..7fca92e29
--- /dev/null
+++ b/patches/scipy-1.11.3/0100-add-option-to-specify-python-binary-for-code-generat.patch
@@ -0,0 +1,43 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 20 Nov 2023 12:48:45 +0100
+Subject: [PATCH] add option to specify python binary for code generators
+
+The code generators need Cython and that is only available with
+cross-python3.
+By default find_installation() returns the Python that is used to run
+meson. In PTXdist that is the system Python, so add an option to allow
+another Python to be used.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ meson.build | 7 ++++++-
+ meson_options.txt | 1 +
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index e2b5672b7cc3..14f2ec3c919b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -20,7 +20,12 @@ project(
+
+ # https://mesonbuild.com/Python-module.html
+ py_mod = import('python')
+-py3 = py_mod.find_installation(pure: false)
++python = get_option('python3')
++if python != ''
++ py3 = py_mod.find_installation(python, pure: false)
++else
++ py3 = py_mod.find_installation(pure: false)
++endif
+ py3_dep = py3.dependency()
+
+ # Emit a warning for 32-bit Python installs on Windows; users are getting
+diff --git a/meson_options.txt b/meson_options.txt
+index 3257cb8a8ff5..ba1dc5a2b5d9 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -10,3 +10,4 @@ option('use-pythran', type: 'boolean', value: true,
+ description: 'If set to false, disables using Pythran (it falls back ' +
+ 'to either pure Python code or Cython code, depending on ' +
+ 'the implementation).')
++option('python3', type: 'string', description: 'Python binary for code generators')
diff --git a/patches/scipy-1.11.3/series b/patches/scipy-1.11.3/series
new file mode 100644
index 000000000..149ab30a9
--- /dev/null
+++ b/patches/scipy-1.11.3/series
@@ -0,0 +1,6 @@
+# generated by git-ptx-patches
+#tag:upstream --start-number 1
+0001-BLD-special-fix-dependencies-for-_ellip_harm_2-19168.patch
+#tag:ptxdist --start-number 100
+0100-add-option-to-specify-python-binary-for-code-generat.patch
+# 820a884dcdeae43ba806fbe91783cd05 - git-ptx-patches magic
diff --git a/patches/screen-4.5.0/0001-don-t-link-against-libelf.patch b/patches/screen-4.5.0/0001-don-t-link-against-libelf.patch
deleted file mode 100644
index 3ca43101f..000000000
--- a/patches/screen-4.5.0/0001-don-t-link-against-libelf.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 27 Mar 2011 15:19:15 +0200
-Subject: [PATCH] don't link against libelf
-
-libelf is not used. It's just some broken configure check.
-Patch from gentoo.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-[osterlad: Update locations for version 4.5.0]
-Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
----
- configure.ac | 8 --------
- 1 file changed, 8 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index ffe2e372426c..d88af75af665 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -202,14 +202,6 @@ AC_EGREP_CPP(yes,
- #endif
- ], LIBS="$LIBS -lsocket -linet";seqptx=1)
-
--oldlibs="$LIBS"
--LIBS="$LIBS -lelf"
--AC_CHECKING(SVR4)
--AC_TRY_LINK([#include <utmpx.h>
--],,
--[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
--[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
--,LIBS="$oldlibs")
- AC_CHECK_HEADERS([stropts.h string.h strings.h])
-
- AC_CHECKING(for Solaris 2.x)
diff --git a/patches/screen-4.5.0/0002-remove-configure-AC_TRY_RUN-tests.patch b/patches/screen-4.5.0/0002-remove-configure-AC_TRY_RUN-tests.patch
deleted file mode 100644
index 4efbde11f..000000000
--- a/patches/screen-4.5.0/0002-remove-configure-AC_TRY_RUN-tests.patch
+++ /dev/null
@@ -1,727 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 27 Mar 2011 15:22:02 +0200
-Subject: [PATCH] remove configure AC_TRY_RUN tests
-
-AC_TRY_RUN fails when cross-compiling.
-
-Not for upstream.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-[osterlad: Update locations for version 4.5.0]
-Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
----
- configure.ac | 651 +----------------------------------------------------------
- 1 file changed, 9 insertions(+), 642 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index d88af75af665..155b34c7ecce 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -48,31 +48,6 @@ AC_PROG_GCC_TRADITIONAL
- AC_ISC_POSIX
- AC_USE_SYSTEM_EXTENSIONS
-
--AC_TRY_RUN(main(){exit(0);},,[
--if test $CC != cc ; then
--AC_NOTE(Your $CC failed - restarting with CC=cc)
--AC_NOTE()
--CC=cc
--export CC
--exec $0 $configure_args
--fi
--])
--
--AC_TRY_RUN(main(){exit(0);},,
--exec 5>&2
--eval $ac_link
--AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;)
--AC_NOTE($ac_compile)
--AC_MSG_ERROR(Can't run the compiler - sorry))
--
--AC_TRY_RUN([
--main()
--{
-- int __something_strange_();
-- __something_strange_(0);
--}
--],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
--
- AC_PROG_AWK
-
- AC_PROG_INSTALL
-@@ -295,353 +270,6 @@ AC_CHECKING(select with $LIBS)
- AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],,
- AC_MSG_ERROR(!!! no select - no screen))
- )
--dnl
--dnl **** FIFO tests ****
--dnl
--
--AC_CHECKING(fifos)
--AC_TRY_RUN([
--/* For select - According to POSIX 1003.1-2001 */
--#include <sys/select.h>
--
--/* For select - According to earlier standards */
--#include <sys/time.h>
--#include <sys/types.h>
--#include <unistd.h>
--
--#include <sys/stat.h>
--#include <fcntl.h>
--
--#ifndef O_NONBLOCK
--#define O_NONBLOCK O_NDELAY
--#endif
--#ifndef S_IFIFO
--#define S_IFIFO 0010000
--#endif
--
--char *fin = "/tmp/conftest$$";
--
--main()
--{
-- struct stat stb;
-- fd_set f;
--
-- (void)alarm(5);
-- unlink(fin);
--#ifdef POSIX
-- if (mkfifo(fin, 0777))
--#else
-- if (mknod(fin, S_IFIFO|0777, 0))
--#endif
-- exit(1);
-- if (stat(fin, &stb) || (stb.st_mode & S_IFIFO) != S_IFIFO)
-- exit(1);
-- close(0);
--#ifdef __386BSD__
-- /*
-- * The next test fails under 386BSD, but screen works using fifos.
-- * Fifos in O_RDWR mode are only used for the BROKEN_PIPE case and for
-- * the select() configuration test.
-- */
-- exit(0);
--#endif
-- if (open(fin, O_RDONLY | O_NONBLOCK))
-- exit(1);
-- if (fork() == 0)
-- {
-- close(0);
-- if (open(fin, O_WRONLY | O_NONBLOCK))
-- exit(1);
-- close(0);
-- if (open(fin, O_WRONLY | O_NONBLOCK))
-- exit(1);
-- if (write(0, "TEST", 4) == -1)
-- exit(1);
-- exit(0);
-- }
-- FD_SET(0, &f);
-- if (select(1, &f, 0, 0, 0) == -1)
-- exit(1);
-- exit(0);
--}
--], AC_NOTE(- your fifos are usable) fifo=1,
--AC_NOTE(- your fifos are not usable))
--rm -f /tmp/conftest*
--
--if test -n "$fifo"; then
--AC_CHECKING(for broken fifo implementation)
--AC_TRY_RUN([
--/* For select - According to POSIX 1003.1-2001 */
--#include <sys/select.h>
--
--/* For select - According to earlier standards */
--#include <sys/time.h>
--#include <sys/types.h>
--#include <unistd.h>
--
--#include <sys/stat.h>
--#include <fcntl.h>
--
--#ifndef O_NONBLOCK
--#define O_NONBLOCK O_NDELAY
--#endif
--#ifndef S_IFIFO
--#define S_IFIFO 0010000
--#endif
--
--char *fin = "/tmp/conftest$$";
--
--main()
--{
-- struct timeval tv;
-- fd_set f;
--
--#ifdef POSIX
-- if (mkfifo(fin, 0600))
--#else
-- if (mknod(fin, S_IFIFO|0600, 0))
--#endif
-- exit(1);
-- close(0);
-- if (open(fin, O_RDONLY|O_NONBLOCK))
-- exit(1);
-- FD_SET(0, &f);
-- tv.tv_sec = 1;
-- tv.tv_usec = 0;
-- if (select(1, &f, 0, 0, &tv))
-- exit(1);
-- exit(0);
--}
--], AC_NOTE(- your implementation is ok),
--AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
--rm -f /tmp/conftest*
--fi
--
--dnl
--dnl **** SOCKET tests ****
--dnl
--dnl may need LIBS="$LIBS -lsocket" here
--dnl
--
--AC_CHECKING(sockets)
--AC_TRY_RUN([
--/* For select - According to POSIX 1003.1-2001 */
--#include <sys/select.h>
--
--/* For select - According to earlier standards */
--#include <sys/time.h>
--#include <sys/types.h>
--#include <unistd.h>
--
--#include <sys/stat.h>
--#include <fcntl.h>
--#include <sys/socket.h>
--#include <sys/un.h>
--
--char *son = "/tmp/conftest$$";
--
--main()
--{
-- int s1, s2, l;
-- struct sockaddr_un a;
-- fd_set f;
--
-- (void)alarm(5);
-- if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-- exit(1);
-- a.sun_family = AF_UNIX;
-- strcpy(a.sun_path, son);
-- (void) unlink(son);
-- if (bind(s1, (struct sockaddr *) &a, strlen(son)+2) == -1)
-- exit(1);
-- if (listen(s1, 2))
-- exit(1);
-- if (fork() == 0)
-- {
-- if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-- kill(getppid(), 3);
-- (void)connect(s2, (struct sockaddr *)&a, strlen(son) + 2);
-- if (write(s2, "HELLO", 5) == -1)
-- kill(getppid(), 3);
-- exit(0);
-- }
-- l = sizeof(a);
-- close(0);
-- if (accept(s1, &a, &l))
-- exit(1);
-- FD_SET(0, &f);
-- if (select(1, &f, 0, 0, 0) == -1)
-- exit(1);
-- exit(0);
--}
--], AC_NOTE(- your sockets are usable) sock=1,
--AC_NOTE(- your sockets are not usable))
--rm -f /tmp/conftest*
--
--if test -n "$sock"; then
--AC_CHECKING(socket implementation)
--AC_TRY_RUN([
--/* For select - According to POSIX 1003.1-2001 */
--#include <sys/select.h>
--
--/* For select - According to earlier standards */
--#include <sys/time.h>
--#include <sys/types.h>
--#include <unistd.h>
--
--#include <sys/stat.h>
--#include <sys/socket.h>
--#include <sys/un.h>
--
--char *son = "/tmp/conftest$$";
--
--main()
--{
-- int s;
-- struct stat stb;
-- struct sockaddr_un a;
-- if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-- exit(0);
-- a.sun_family = AF_UNIX;
-- strcpy(a.sun_path, son);
-- (void) unlink(son);
-- if (bind(s, (struct sockaddr *) &a, strlen(son)+2) == -1)
-- exit(0);
-- if (stat(son, &stb))
-- exit(1);
-- close(s);
-- exit(0);
--}
--],AC_NOTE(- you are normal),
--AC_NOTE(- unix domain sockets are not kept in the filesystem)
--AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
--rm -f /tmp/conftest*
--fi
--
--
--dnl
--dnl **** choose sockets or fifos ****
--dnl
--if test -n "$fifo"; then
-- if test -n "$sock"; then
-- if test -n "$nore"; then
-- AC_NOTE(- hmmm... better take the fifos)
-- AC_DEFINE(NAMEDPIPE)
-- elif test -n "$fifobr"; then
-- AC_NOTE(- as your fifos are broken lets use the sockets.)
-- else
-- AC_NOTE(- both sockets and fifos usable. let's take sockets.)
-- fi
-- else
-- AC_NOTE(- using named pipes, of course)
-- AC_DEFINE(NAMEDPIPE)
-- fi
--elif test -n "$sock"; then
-- AC_NOTE(- using unix-domain sockets, of course)
--else
-- AC_MSG_ERROR(you have neither usable sockets nor usable pipes -> no screen)
--fi
--
--dnl
--dnl **** check the select implementation ****
--dnl
--
--AC_CHECKING(select return value)
--AC_TRY_RUN([
--/* For select - According to POSIX 1003.1-2001 */
--#include <sys/select.h>
--
--/* For select - According to earlier standards */
--#include <sys/time.h>
--#include <sys/types.h>
--#include <unistd.h>
--
--#include <sys/stat.h>
--#include <fcntl.h>
--
--char *nam = "/tmp/conftest$$";
--
--#ifdef NAMEDPIPE
--
--#ifndef O_NONBLOCK
--#define O_NONBLOCK O_NDELAY
--#endif
--#ifndef S_IFIFO
--#define S_IFIFO 0010000
--#endif
--
--
--main()
--{
-- fd_set f;
--
--#ifdef __FreeBSD__
--/* From Andrew A. Chernov (ache@astral.msk.su):
-- * opening RDWR fifo fails in BSD 4.4, but select return values are
-- * right.
-- */
-- exit(0);
--#endif
-- (void)alarm(5);
--#ifdef POSIX
-- if (mkfifo(nam, 0777))
--#else
-- if (mknod(nam, S_IFIFO|0777, 0))
--#endif
-- exit(1);
-- close(0);
-- if (open(nam, O_RDWR | O_NONBLOCK))
-- exit(1);
-- if (write(0, "TEST", 4) == -1)
-- exit(1);
--
--#else
--
--#include <sys/types.h>
--#include <sys/socket.h>
--#include <sys/un.h>
--
--main()
--{
-- int s1, s2, l;
-- struct sockaddr_un a;
-- fd_set f;
--
-- (void)alarm(5);
-- if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-- exit(1);
-- a.sun_family = AF_UNIX;
-- strcpy(a.sun_path, nam);
-- (void) unlink(nam);
-- if (bind(s1, (struct sockaddr *) &a, strlen(nam)+2) == -1)
-- exit(1);
-- if (listen(s1, 2))
-- exit(1);
-- if (fork() == 0)
-- {
-- if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-- kill(getppid(), 3);
-- (void)connect(s2, (struct sockaddr *)&a, strlen(nam) + 2);
-- if (write(s2, "HELLO", 5) == -1)
-- kill(getppid(), 3);
-- exit(0);
-- }
-- l = sizeof(a);
-- close(0);
-- if (accept(s1, (struct sockaddr *)&a, &l))
-- exit(1);
--#endif
--
--
-- FD_SET(0, &f);
-- if (select(1, &f, 0, 0, 0) == -1)
-- exit(1);
-- if (select(1, &f, &f, 0, 0) != 2)
-- exit(1);
-- exit(0);
--}
--],AC_NOTE(- select is ok),
--AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
-
- dnl
- dnl **** termcap or terminfo ****
-@@ -678,12 +306,8 @@ AC_CHECKING(libtinfo)
- AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
- AC_MSG_ERROR(!!! no tgetent - no screen)))))))))
-
--AC_TRY_RUN([
--main()
--{
-- exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
--}], AC_NOTE(- you use the termcap database),
--AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
-+AC_DEFINE(TERMINFO))
-+
- AC_CHECKING(ospeed)
- AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
-
-@@ -734,95 +358,6 @@ AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
- AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
- fi
-
--dnl **** pty mode/group handling ****
--dnl
--dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222
--AC_ARG_WITH(pty-mode, [ --with-pty-mode=mode default mode for ptys], [ ptymode="${withval}" ])
--AC_ARG_WITH(pty-group, [ --with-pty-group=group default group for ptys], [ ptygrp="${withval}" ])
--test -n "$ptymode" || ptymode=0620
--if test -n "$ptygrp" ; then
--AC_DEFINE_UNQUOTED(PTYMODE, $ptymode)
--AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
--else
--
--AC_CHECKING(default tty permissions/group)
--rm -f conftest_grp
--AC_TRY_RUN([
--#include <sys/types.h>
--#include <sys/stat.h>
--#include <stdio.h>
--main()
--{
-- struct stat sb;
-- char *x,*ttyname();
-- int om, m;
-- FILE *fp;
--
-- if (!(x = ttyname(0))) exit(1);
-- if (stat(x, &sb)) exit(1);
-- om = sb.st_mode;
-- if (om & 002) exit(0);
-- m = system("mesg y");
-- if (m == -1 || m == 127) exit(1);
-- if (stat(x, &sb)) exit(1);
-- m = sb.st_mode;
-- if (chmod(x, om)) exit(1);
-- if (m & 002) exit(0);
-- if (sb.st_gid == getgid()) exit(1);
-- if (!(fp=fopen("conftest_grp", "w")))
-- exit(1);
-- fprintf(fp, "%d\n", sb.st_gid);
-- fclose(fp);
-- exit(0);
--}
--],[
-- if test -f conftest_grp; then
-- ptygrp=`cat conftest_grp`
-- AC_NOTE([- pty mode: $ptymode, group: $ptygrp])
-- AC_DEFINE_UNQUOTED(PTYMODE, $ptymode)
-- AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
-- else
-- AC_NOTE(- ptys are world accessable)
-- fi
--],[
-- WRITEPATH=''
-- XTERMPATH=''
-- AC_PATH_PROG(WRITEPATH, write)
-- AC_PATH_PROG(XTERMPATH, xterm)
-- found=
-- if test -n "$WRITEPATH$XTERMPATH"; then
-- findfollow=
-- lsfollow=
-- found=`find $WRITEPATH $XTERMPATH -follow -print 2>/dev/null`
-- if test -n "$found"; then
-- findfollow=-follow
-- lsfollow=L
-- fi
-- if test -n "$XTERMPATH"; then
-- ptygrpn=`ls -l$lsfollow $XTERMPATH | sed -n -e 1p | $AWK '{print $4}'`
-- if test tty != "$ptygrpn"; then
-- XTERMPATH=
-- fi
-- fi
-- fi
-- if test -n "$WRITEPATH$XTERMPATH"; then
-- found=`find $WRITEPATH $XTERMPATH $findfollow -perm -2000 -print`
-- if test -n "$found"; then
-- ptygrp=`ls -ln$lsfollow $found | sed -n -e 1p | $AWK '{print $4}'`
-- AC_NOTE([- pty mode: $ptymode, group: $ptygrp])
-- AC_DEFINE_UNQUOTED(PTYMODE, $ptymode)
-- AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
-- else
-- AC_NOTE(- ptys are world accessable)
-- fi
-- else
-- AC_NOTE(- can't determine - assume ptys are world accessable)
-- fi
-- ]
--)
--rm -f conftest_grp
--fi
--
- dnl
- dnl **** utmp handling ****
- dnl
-@@ -895,101 +430,6 @@ AC_DEFINE(LOADAV_GETLOADAVG) load=1, LIBS="$olibs")
- fi
- )
-
--if test -z "$load" ; then
--AC_EGREP_CPP(yes,
--[#if defined(NeXT) || defined(apollo) || defined(linux)
-- yes;
--#endif
--], load=1)
--fi
--if test -z "$load" ; then
--AC_CHECKING(for kernelfile)
--for core in /unix /vmunix /dynix /hp-ux /xelos /dev/ksyms /kernel/unix /kernel/genunix /unicos /mach /netbsd /386bsd /dgux /bsd /stand/vmunix; do
-- if test -f $core || test -c $core; then
-- break
-- fi
--done
--if test ! -f $core && test ! -c $core ; then
-- AC_NOTE(- no kernelfile found)
--else
-- AC_NOTE(- using kernelfile '$core')
-- if test -r $core ; then
-- AC_DEFINE_UNQUOTED(LOADAV_UNIX,"$core")
-- AC_CHECK_HEADER(nlist.h,
-- [AC_DEFINE(NLIST_STRUCT)
-- AC_CHECKING(n_un in struct nlist)
-- AC_TRY_COMPILE([#include <nlist.h>],
-- [struct nlist n; n.n_un.n_name = 0;],
-- AC_DEFINE(NLIST_NAME_UNION))])
--
-- AC_CHECKING(for nlist declaration)
-- AC_EGREP_CPP([nlist(( | )( | )*.*\(|\()],[
--#ifdef NLIST_STRUCT
--# include <nlist.h>
--#else
--# include <a.out.h>
--#endif
--],AC_DEFINE(NLIST_DECLARED))
--
-- AC_CHECKING(for avenrun symbol)
-- nlist64=
-- for av in avenrun _avenrun _Loadavg avenrun _avenrun _Loadavg; do
-- AC_TRY_RUN([
--#include <sys/types.h>
--#ifdef NLIST_STRUCT
--#include <nlist.h>
--#else
--#include <a.out.h>
--#endif
--
--$nlist64
--
--struct nlist nl[2];
--
--main()
--{
--#if !defined(_AUX_SOURCE) && !defined(AUX)
--# ifdef NLIST_NAME_UNION
-- nl[0].n_un.n_name = "$av";
--# else
-- nl[0].n_name = "$av";
--# endif
--#else
-- strncpy(nl[0].n_name, "$av", sizeof(nl[0].n_name));
--#endif
-- nlist(LOADAV_UNIX, nl);
-- if (nl[0].n_value == 0)
-- exit(1);
-- exit(0);
--}
-- ],avensym=$av;break)
-- if test "$av" = _Loadavg; then
-- nlist64='#define nlist nlist64'
-- fi
-- done
-- if test -z "$avensym" ; then
-- AC_NOTE(- no avenrun symbol found)
-- else
-- AC_NOTE(- using avenrun symbol '$avensym')
-- AC_DEFINE_UNQUOTED(LOADAV_AVENRUN,"$avensym")
-- if test -n "$nlist64"; then
-- AC_NOTE(- used nlist64 to find it)
-- AC_DEFINE(LOADAV_USE_NLIST64)
-- fi
-- load=1
-- fi
-- else
-- AC_NOTE( Can't configure the load average display feature)
-- AC_NOTE( because $core is not readable by you.)
-- AC_NOTE( To configure the load average display feature,)
-- AC_NOTE( re-run configure as root if possible.)
-- AC_NOTE( If you are not the system administrator then disregard)
-- AC_NOTE( this warning. You can still use screen without)
-- AC_NOTE( the load average display feature.)
-- fi
--fi
--fi
--
- AC_PROGRAM_SOURCE([
- #include <sys/types.h>
- #include <sys/param.h>
-@@ -1061,41 +501,8 @@ sigset(0, (void (*)())0);
- sigset(0, (int (*)())0);
- #endif
- ], AC_DEFINE(USESIGSET))
--AC_CHECKING(signal implementation)
--AC_TRY_RUN([
--#include <sys/types.h>
--#include <signal.h>
--
--#ifndef SIGCLD
--#define SIGCLD SIGCHLD
--#endif
--#ifdef USESIGSET
--#define signal sigset
--#endif
--
--int got;
-
--#ifdef SIGVOID
--void
--#endif
--hand()
--{
-- got++;
--}
--
--main()
--{
-- /* on hpux we use sigvec to get bsd signals */
--#ifdef __hpux
-- (void)signal(SIGCLD, hand);
-- kill(getpid(), SIGCLD);
-- kill(getpid(), SIGCLD);
-- if (got < 2)
-- exit(1);
--#endif
-- exit(0);
--}
--],,AC_DEFINE(SYSVSIGS))
-+AC_DEFINE(SYSVSIGS)
-
- fi
-
-@@ -1163,50 +570,12 @@ AC_CHECKING(fdwalk)
- AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
-
- AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments)
--AC_TRY_RUN([
--main() {
-- char buf[10];
-- strcpy(buf, "abcdefghi");
-- bcopy(buf, buf + 2, 3);
-- if (strncmp(buf, "ababcf", 6))
-- exit(1);
-- strcpy(buf, "abcdefghi");
-- bcopy(buf + 2, buf, 3);
-- if (strncmp(buf, "cdedef", 6))
-- exit(1);
-- exit(0); /* libc version works properly. */
--}], AC_DEFINE(USEBCOPY))
--
--AC_TRY_RUN([
--#define bcopy(s,d,l) memmove(d,s,l)
--main() {
-- char buf[10];
-- strcpy(buf, "abcdefghi");
-- bcopy(buf, buf + 2, 3);
-- if (strncmp(buf, "ababcf", 6))
-- exit(1);
-- strcpy(buf, "abcdefghi");
-- bcopy(buf + 2, buf, 3);
-- if (strncmp(buf, "cdedef", 6))
-- exit(1);
-- exit(0); /* libc version works properly. */
--}], AC_DEFINE(USEMEMMOVE))
--
--
--AC_TRY_RUN([
--#define bcopy(s,d,l) memcpy(d,s,l)
--main() {
-- char buf[10];
-- strcpy(buf, "abcdefghi");
-- bcopy(buf, buf + 2, 3);
-- if (strncmp(buf, "ababcf", 6))
-- exit(1);
-- strcpy(buf, "abcdefghi");
-- bcopy(buf + 2, buf, 3);
-- if (strncmp(buf, "cdedef", 6))
-- exit(1);
-- exit(0); /* libc version works properly. */
--}], AC_DEFINE(USEMEMCPY))
-+AC_DEFINE(USEBCOPY)
-+
-+AC_DEFINE(USEMEMMOVE)
-+
-+
-+AC_DEFINE(USEMEMCPY)
-
- AC_SYS_LONG_FILE_NAMES
-
-@@ -1292,8 +661,6 @@ fi
- dnl Ptx bug workaround -- insert -lc after -ltermcap
- test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq"
-
--AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.))
--
- ETCSCREENRC=
- AC_MSG_CHECKING(for the global screenrc file)
- AC_ARG_WITH(sys-screenrc, [ --with-sys-screenrc=path to the global screenrc file], [ ETCSCREENRC="${withval}" ])
diff --git a/patches/screen-4.5.0/0003-autoconf-cleanup.patch b/patches/screen-4.5.0/0003-autoconf-cleanup.patch
deleted file mode 100644
index fda6c9423..000000000
--- a/patches/screen-4.5.0/0003-autoconf-cleanup.patch
+++ /dev/null
@@ -1,397 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 27 Mar 2011 15:23:55 +0200
-Subject: [PATCH] autoconf cleanup
-
-update to latest autoconf syntax
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-[osterlad: update locations for version 4.5.0]
-Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
----
- configure.ac | 116 +++++++++++++++++++++++++++++------------------------------
- 1 file changed, 58 insertions(+), 58 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 155b34c7ecce..b87a9a44eb20 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -77,7 +77,7 @@ AC_ARG_ENABLE(socket-dir,
- esac
- ])
- AC_MSG_RESULT(${SOCKDIR})
-- AC_DEFINE_UNQUOTED(SOCKDIR, $SOCKDIR)
-+ AC_DEFINE_UNQUOTED(SOCKDIR, $SOCKDIR,[SOCKDIR])
- ]
- )
-
-@@ -86,18 +86,18 @@ dnl
- dnl **** special unix variants ****
- dnl
- if test -n "$ISC"; then
-- AC_DEFINE(ISC) LIBS="$LIBS -linet"
-+ AC_DEFINE([ISC],[1],[ISC]) LIBS="$LIBS -linet"
- fi
-
- dnl AC_CHECKING(for OSF1)
- dnl if test -f /bin/uname ; then
- dnl if test `/bin/uname` = OSF1 || test -f /osf_boot; then
--dnl AC_DEFINE(OSF1) # this disables MIPS again....
-+dnl AC_DEFINE([OSF1],[1],[OSF1]) # this disables MIPS again....
- dnl fi
- dnl fi
-
- if test -f /sysV68 ; then
--AC_DEFINE(sysV68)
-+AC_DEFINE([sysV68],[1],[sysV68])
- fi
-
- AC_CHECKING(for MIPS)
-@@ -110,7 +110,7 @@ AC_TRY_LINK(,,,LIBS="$oldlibs")
- dnl
- dnl
- if test -r /dev/ptc; then
--AC_DEFINE(MIPS)
-+AC_DEFINE([MIPS],[1],[MIPS])
- AC_CHECKING(wait3)
- AC_TRY_LINK(,[wait3();], ,
- AC_CHECKING(wait2)
-@@ -119,7 +119,7 @@ dnl John Rouillard (rouilj@sni-usa.com):
- dnl need -I/usr/include/bsd in RISCOS otherwise sockets are broken, no
- dnl job control etc.
- dnl Detect RISCOS if wait2 is present, but not wait3.
--AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd"
-+AC_DEFINE([USE_WAIT2],[1],[USE_WAIT2]) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd"
- ))
- fi
- fi
-@@ -136,7 +136,7 @@ if test -f /usr/lib/libpyr.a ; then
- oldlibs="$LIBS"
- LIBS="$LIBS -lpyr"
- AC_CHECKING(Pyramid OSX)
--AC_TRY_LINK(,[open_controlling_pty("")], AC_DEFINE(OSX), LIBS="$oldlibs")
-+AC_TRY_LINK(,[open_controlling_pty("")], AC_DEFINE([OSX],[1],[OSX]), LIBS="$oldlibs")
- fi
-
- dnl ghazi@caip.rutgers.edu (Kaveh R. Ghazi):
-@@ -161,14 +161,14 @@ main () {
- #ifdef _POSIX_VERSION
- yes;
- #endif
--], AC_NOTE(- you have a POSIX system) AC_DEFINE(POSIX) posix=1)
-+], AC_NOTE(- you have a POSIX system) AC_DEFINE([POSIX],[1],[POSIX]) posix=1)
- fi
-
- AC_CHECKING(for System V)
- AC_TRY_COMPILE(
- [#include <sys/types.h>
- #include <signal.h>
--#include <fcntl.h>], [int x = SIGCHLD | FNDELAY;], , AC_DEFINE(SYSV))
-+#include <fcntl.h>], [int x = SIGCHLD | FNDELAY;], , AC_DEFINE([SYSV],[1],[SYSV]))
-
- AC_CHECKING(for sequent/ptx)
- AC_EGREP_CPP(yes,
-@@ -193,16 +193,16 @@ dnl (currently not used)
- dnl
- dnl AC_CHECKING(for pid_t)
- dnl AC_EGREP_CPP(pid_t,[#include <sys/types.h>
--dnl ],AC_DEFINE(PID_T_DEFINED))
-+dnl ],AC_DEFINE([PID_T_DEFINED],[1],[PID_T_DEFINED]))
- dnl
- dnl AC_CHECKING(for sig_t)
- dnl AC_EGREP_CPP(sig_t,[#include <sys/types.h>
- dnl #include <signal.h>
--dnl ],AC_DEFINE(SIG_T_DEFINED))
-+dnl ],AC_DEFINE([SIG_T_DEFINED],[1],[SIG_T_DEFINED]))
- dnl
- dnl AC_CHECKING(for uid_t)
- dnl AC_EGREP_CPP(uid_t,[#include <sys/types.h>
--dnl ],AC_DEFINE(UID_T_DEFINED))
-+dnl ],AC_DEFINE([UID_T_DEFINED],[1],[UID_T_DEFINED]))
- dnl
-
- dnl
-@@ -224,7 +224,7 @@ setpgrp();
- int y = TIOCNOTTY;
- #endif
- #endif
--], AC_NOTE(- you have jobcontrol) AC_DEFINE(BSDJOBS), AC_NOTE(- you don't have jobcontrol))
-+], AC_NOTE(- you have jobcontrol) AC_DEFINE([BSDJOBS],[1],[BSDJOBS]), AC_NOTE(- you don't have jobcontrol))
-
- dnl
- dnl **** setresuid(), setreuid(), seteuid() ****
-@@ -236,7 +236,7 @@ setresuid(0, 0, 0);
- AC_CHECKING(setreuid)
- AC_TRY_LINK(,[
- setreuid(0, 0);
--], AC_DEFINE(HAVE_SETREUID))
-+], AC_DEFINE(HAVE_SETREUID,[1],[HAVE_SETREUID]))
- dnl
- dnl seteuid() check:
- dnl linux seteuid was broken before V1.1.11
-@@ -250,7 +250,7 @@ seteuid_is_broken(0);
- #else
- seteuid(0);
- #endif
--], AC_DEFINE(HAVE_SETEUID))
-+], AC_DEFINE([HAVE_SETEUID],[1],[HAVE_SETEUID]))
-
- dnl execvpe
- AC_CHECKING(execvpe)
-@@ -306,23 +306,23 @@ AC_CHECKING(libtinfo)
- AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
- AC_MSG_ERROR(!!! no tgetent - no screen)))))))))
-
--AC_DEFINE(TERMINFO))
-+AC_DEFINE([TERMINFO],[1],[TERMINFO])
-
- AC_CHECKING(ospeed)
--AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
-+AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE([NEED_OSPEED],[1],[NEED_OSPEED]))
-
- dnl
- dnl **** PTY specific things ****
- dnl
- AC_CHECKING(for /dev/ptc)
- if test -r /dev/ptc; then
--AC_DEFINE(HAVE_DEV_PTC)
-+AC_DEFINE([HAVE_DEV_PTC],[1],[HAVE_DEV_PTC])
- fi
-
- AC_CHECKING(for SVR4 ptys)
- sysvr4ptys=
- if test -c /dev/ptmx ; then
--AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
-+AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE([HAVE_SVR4_PTYS],[1],[HAVE_SVR4_PTYS])
- sysvr4ptys=1])
- fi
-
-@@ -331,7 +331,7 @@ AC_CHECK_FUNCS(getpt)
- dnl check for openpty()
- if test -z "$sysvr4ptys"; then
- AC_CHECK_FUNCS(openpty,,
--[AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])])
-+[AC_CHECK_LIB(util,openpty, [AC_DEFINE([HAVE_OPENPTY],[1],[HAVE_OPENPTY])] [LIBS="$LIBS -lutil"])])
- fi
-
- AC_CHECKING(for ptyranges)
-@@ -354,8 +354,8 @@ dnl fi
- if test "$ptys" != "$pdir/pty??" ; then
- p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
- p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
--AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
--AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
-+AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0",[PTYRANGE0])
-+AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1",[PTYRANGE1])
- fi
-
- dnl
-@@ -375,7 +375,7 @@ AC_TRY_LINK([
- #define pututline _pututline
- #endif
- ],
--[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT),
-+[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE([GETUTENT],[1],[GETUTENT]),
- olibs="$LIBS"
- LIBS="$LIBS -lgen"
- AC_CHECKING(getutent with -lgen)
-@@ -392,7 +392,7 @@ AC_TRY_LINK([
- #define pututline _pututline
- #endif
- ],
--[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT), LIBS="$olibs")
-+[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE([GETUTENT],[1],[GETUTENT]), LIBS="$olibs")
- )
- AC_CHECKING(ut_host)
- AC_TRY_COMPILE([
-@@ -404,10 +404,10 @@ AC_TRY_COMPILE([
- #else
- #include <utmp.h>
- #endif
--],[struct utmp u; u.ut_host[0] = 0;], AC_DEFINE(UTHOST))
-+],[struct utmp u; u.ut_host[0] = 0;], AC_DEFINE([UTHOST],[1],[UTHOST]))
- AC_CHECK_HEADER(utempter.h, have_utempter=yes, have_utempter=no)
- if test "$have_utempter" = yes; then
-- AC_DEFINE(HAVE_UTEMPTER)
-+ AC_DEFINE([HAVE_UTEMPTER],[1],[HAVE_UTEMPTER])
- LIBS="$LIBS -lutempter"
- fi
-
-@@ -420,13 +420,13 @@ test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
-
- AC_CHECKING(getloadavg)
- AC_TRY_LINK(,[getloadavg((double *)0, 0);],
--AC_DEFINE(LOADAV_GETLOADAVG) load=1,
-+AC_DEFINE([LOADAV_GETLOADAVG],[1],[LOADAV_GETLOADAVG]) load=1,
- if test -f /usr/lib/libkvm.a ; then
- olibs="$LIBS"
- LIBS="$LIBS -lkvm"
- AC_CHECKING(getloadavg with -lkvm)
- AC_TRY_LINK(,[getloadavg((double *)0, 0);],
--AC_DEFINE(LOADAV_GETLOADAVG) load=1, LIBS="$olibs")
-+AC_DEFINE([LOADAV_GETLOADAVG],[1],[LOADAV_GETLOADAVG]) load=1, LIBS="$olibs")
- fi
- )
-
-@@ -466,10 +466,10 @@ loadnum=3
- #endif
- ])
-
--if test -n "$load" ; then AC_DEFINE(LOADAV) fi
--if test -n "$loadtype" ; then AC_DEFINE_UNQUOTED(LOADAV_TYPE,$loadtype) fi
--if test -n "$loadnum" ; then AC_DEFINE_UNQUOTED(LOADAV_NUM,$loadnum) fi
--if test -n "$loadscale" ; then AC_DEFINE_UNQUOTED(LOADAV_SCALE,$loadscale) fi
-+if test -n "$load" ; then AC_DEFINE([LOADAV],[1],[LOADAV]) fi
-+if test -n "$loadtype" ; then AC_DEFINE_UNQUOTED(LOADAV_TYPE,$loadtype,[LOADAV_TYPE]) fi
-+if test -n "$loadnum" ; then AC_DEFINE_UNQUOTED(LOADAV_NUM,$loadnum,[LOADAV_NUM]) fi
-+if test -n "$loadscale" ; then AC_DEFINE_UNQUOTED(LOADAV_SCALE,$loadscale,[LOADAV_SCALE]) fi
-
- dnl
- dnl **** signal handling ****
-@@ -478,7 +478,7 @@ if test -n "$posix" ; then
-
- dnl POSIX has reliable signals with void return type.
- AC_NOTE(assuming posix signal definition)
--AC_DEFINE(SIGVOID)
-+AC_DEFINE([SIGVOID],[1],[SIGVOID])
-
- else
-
-@@ -489,7 +489,7 @@ AC_TRY_COMPILE(
- #ifdef signal
- #undef signal
- #endif
--extern void (*signal ()) ();], [int i;], AC_DEFINE(SIGVOID))
-+extern void (*signal ()) ();], [int i;], AC_DEFINE([SIGVOID],[1],[SIGVOID]))
- AC_CHECKING(sigset)
- AC_TRY_LINK([
- #include <sys/types.h>
-@@ -500,9 +500,9 @@ sigset(0, (void (*)())0);
- #else
- sigset(0, (int (*)())0);
- #endif
--], AC_DEFINE(USESIGSET))
-+], AC_DEFINE([USESIGSET],[1],[USESIGSET]))
-
--AC_DEFINE(SYSVSIGS)
-+AC_DEFINE([SYSVSIGS],[1],[SYSVSIGS])
-
- fi
-
-@@ -528,7 +528,7 @@ AC_TRY_LINK(,[closelog();], , [oldlibs="$LIBS"
- LIBS="$LIBS -lbsd"
- AC_CHECKING(syslog in libbsd.a)
- AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs"
--AC_NOTE(- bad news: syslog missing.) AC_DEFINE(NOSYSLOG)])])
-+AC_NOTE(- bad news: syslog missing.) AC_DEFINE([NOSYSLOG],[1],[NOSYSLOG])])])
-
- AC_EGREP_CPP(yes,
- [#ifdef M_UNIX
-@@ -548,39 +548,39 @@ AC_TRY_COMPILE([#include <sys/types.h>
- #ifdef WEXITSTATUS
- y = WEXITSTATUS(x);
- #endif
--],AC_DEFINE(BSDWAIT))
-+],AC_DEFINE([BSDWAIT],[1],[BSDWAIT]))
-
- if test -z "$butterfly"; then
- AC_CHECKING(for termio or termios)
--AC_TRY_CPP([#include <termio.h>], AC_DEFINE(TERMIO),
-+AC_TRY_CPP([#include <termio.h>], AC_DEFINE([TERMIO],[1],[TERMIO]),
- if test -n "$posix"; then
--AC_TRY_CPP([#include <termios.h>], AC_DEFINE(TERMIO))
-+AC_TRY_CPP([#include <termios.h>], AC_DEFINE([TERMIO],[1],[TERMIO]))
- fi
- )
- fi
-
--dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW))
-+dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE([SHADOWPW],[1],[SHADOWPW]))
- AC_CHECKING(getspnam)
--AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
-+AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE([SHADOWPW],[1],[SHADOWPW]))
-
- AC_CHECKING(getttyent)
--AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT))
-+AC_TRY_LINK(,[getttyent();], AC_DEFINE([GETTTYENT],[1],[GETTTYENT]))
-
- AC_CHECKING(fdwalk)
--AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
-+AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE([HAVE_FDWALK],[1],[HAVE_FDWALK]))
-
- AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments)
--AC_DEFINE(USEBCOPY)
-+AC_DEFINE([USEBCOPY],[1],[USEBCOPY])
-
--AC_DEFINE(USEMEMMOVE)
-+AC_DEFINE([USEMEMMOVE],[1],[USEMEMMOVE])
-
-
--AC_DEFINE(USEMEMCPY)
-+AC_DEFINE([USEMEMCPY],[1],[USEMEMCPY])
-
- AC_SYS_LONG_FILE_NAMES
-
- AC_MSG_CHECKING(for vsprintf)
--AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
-+AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);], AC_MSG_RESULT(yes);AC_DEFINE([USEVARARGS],[1],[USEVARARGS]), AC_MSG_RESULT(no))
-
- AC_HEADER_DIRENT
-
-@@ -600,21 +600,21 @@ if test -z "$ac_setenv_args"; then
- ], ac_setenv_args=2)
- fi
- if test -n "$ac_setenv_args"; then
-- AC_DEFINE(USESETENV)
-+ AC_DEFINE([USESETENV],[1],[USESETENV])
- if test "$ac_setenv_args" = 3; then
-- AC_DEFINE(HAVE_SETENV_3)
-+ AC_DEFINE([HAVE_SETENV_3],[1],[HAVE_SETENV_3])
- elif test "$ac_setenv_args" = 2; then
-- AC_DEFINE(HAVE_SETENV_2)
-+ AC_DEFINE([HAVE_SETENV_2],[1],[HAVE_SETENV_2])
- fi
- else
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING(for putenv)
-- AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE(NEEDPUTENV))
-+ AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE([NEEDPUTENV],[1],[NEEDPUTENV]))
- fi
- AC_MSG_CHECKING([for nl_langinfo(CODESET)])
- AC_TRY_LINK([
- #include <langinfo.h>
--],[nl_langinfo(CODESET);], AC_MSG_RESULT(yes);AC_DEFINE(HAVE_NL_LANGINFO), AC_MSG_RESULT(no))
-+],[nl_langinfo(CODESET);], AC_MSG_RESULT(yes);AC_DEFINE([HAVE_NL_LANGINFO],[1],[HAVE_NL_LANGINFO]), AC_MSG_RESULT(no))
-
- AC_SEARCH_LIBS(gethostname, nsl)
-
-@@ -629,25 +629,25 @@ if test "$enable_pam" = "yes"; then
- pam_start(0, 0, 0, 0);
- pam_authenticate(0, 0);
- pam_end(0,0);
-- ], AC_MSG_RESULT(yes);AC_DEFINE(USE_PAM),
-+ ], AC_MSG_RESULT(yes);AC_DEFINE([USE_PAM],[1],[USE_PAM]),
- AC_MSG_RESULT(no);LIBS="$oldlibs")
- fi
-
- AC_ARG_ENABLE(use_locale, [ --enable-use-locale use localized month/day names])
- if test "$enable_use_locale" = "yes"; then
-- AC_DEFINE(USE_LOCALE)
-+ AC_DEFINE([USE_LOCALE],[1],[USE_LOCALE])
- fi
- AC_ARG_ENABLE(telnet, [ --enable-telnet enable builtin telnet])
- if test "$enable_telnet" = "yes"; then
-- AC_DEFINE(BUILTIN_TELNET)
-+ AC_DEFINE([BUILTIN_TELNET],[1],[BUILTIN_TELNET])
- fi
- AC_ARG_ENABLE(colors256, [ --enable-colors256 enable support for 256 colors])
- if test "$enable_colors256" = "yes"; then
-- AC_DEFINE(COLORS256)
-+ AC_DEFINE([COLORS256],[1],[COLORS256])
- fi
- AC_ARG_ENABLE(rxvt_osc, [ --enable-rxvt_osc enable support for rxvt OSC codes])
- if test "$enable_rxvt_osc" = "yes"; then
-- AC_DEFINE(RXVT_OSC)
-+ AC_DEFINE([RXVT_OSC],[1],[RXVT_OSC])
- fi
-
- dnl
diff --git a/patches/screen-4.5.0/0004-Fix-some-typos-found-by-Lintian.patch b/patches/screen-4.5.0/0004-Fix-some-typos-found-by-Lintian.patch
deleted file mode 100644
index b368f44ec..000000000
--- a/patches/screen-4.5.0/0004-Fix-some-typos-found-by-Lintian.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From: Axel Beckert <abe@debian.org>
-Date: Mon, 3 Jul 2017 10:41:19 +0200
-Subject: [PATCH] Fix some typos found by Lintian
-
-Forwarded: no
-Bug-Debian: https://bugs.debian.org/741141
----
- acls.c | 4 ++--
- doc/screen.1 | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/acls.c b/acls.c
-index 3b1669cf4a93..514e0fc4716d 100644
---- a/acls.c
-+++ b/acls.c
-@@ -578,7 +578,7 @@ char *name, *pw1, *pw2;
- }
-
- debug2("syslog(LOG_NOTICE, \"screen %s: \"su %s\" ", SockPath, name);
-- debug2("%s for \"%s\"\n", sorry ? "failed" : "succeded", (*up)->u_name);
-+ debug2("%s for \"%s\"\n", sorry ? "failed" : "succeeded", (*up)->u_name);
- #ifndef NOSYSLOG
- # ifdef BSD_42
- openlog("screen", LOG_PID);
-@@ -586,7 +586,7 @@ char *name, *pw1, *pw2;
- openlog("screen", LOG_PID, LOG_AUTH);
- # endif /* BSD_42 */
- syslog(LOG_NOTICE, "%s: \"su %s\" %s for \"%s\"", SockPath, name,
-- sorry ? "failed" : "succeded", (*up)->u_name);
-+ sorry ? "failed" : "succeeded", (*up)->u_name);
- closelog();
- #else
- debug("NOT LOGGED.\n");
-diff --git a/doc/screen.1 b/doc/screen.1
-index 23b4d7b1202a..0fe8d0e533c2 100644
---- a/doc/screen.1
-+++ b/doc/screen.1
-@@ -1356,8 +1356,8 @@ non-whitespace character on the line.
- \fBB\fP, \fBE\fP move the cursor WORD by WORD (as in vi).
- .br
- .ti -2n
--.\"\fBf\fP,\fBt\fP, \fBF\fP, \fBT\fP move the cursor forward/backward to the next occurence of the target.
--\fBf/F\fP, \fBt/T\fP move the cursor forward/backward to the next occurence of the target. (eg, '3fy' will
-+.\"\fBf\fP,\fBt\fP, \fBF\fP, \fBT\fP move the cursor forward/backward to the next occurrence of the target.
-+\fBf/F\fP, \fBt/T\fP move the cursor forward/backward to the next occurrence of the target. (eg, '3fy' will
- move the cursor to the 3rd 'y' to the right.)
- .br
- .ti -2n
diff --git a/patches/screen-4.5.0/0005-show-encoding-in-hardstatus.patch b/patches/screen-4.5.0/0005-show-encoding-in-hardstatus.patch
deleted file mode 100644
index 123c37cce..000000000
--- a/patches/screen-4.5.0/0005-show-encoding-in-hardstatus.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From: Yi-Jheng Lin <yzlin@cs.nctu.edu.tw>
-Date: Mon, 3 Jul 2017 10:42:52 +0200
-Subject: [PATCH] show encoding in hardstatus
-
-Origin: https://svnweb.freebsd.org/ports/head/sysutils/screen/files/opt-showencoding?view=markup
-Reviewed-By: rascov <rascov@rascov.tw>
-Reviewed-By: Dustin Kirkland <kirkland@ubuntu.com>
-Last-Update: Wed Feb 11 05:51:31 CST 2009
-Bug-FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=124492
-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/screen/+bug/286810
-Bug-Debian: https://bugs.debian.org/533498
----
- process.c | 1 +
- screen.c | 13 +++++++++++++
- 2 files changed, 14 insertions(+)
-
-diff --git a/process.c b/process.c
-index 63c85b1a0a65..304ce0e691de 100644
---- a/process.c
-+++ b/process.c
-@@ -3783,6 +3783,7 @@ int key;
- {
- WinSwitchEncoding(fore, n);
- ResetCharsets(fore);
-+ RedisplayDisplays(0);
- }
- else if (i && display)
- D_encoding = n;
-diff --git a/screen.c b/screen.c
-index 64650e9b2edc..7cad20626f2b 100644
---- a/screen.c
-+++ b/screen.c
-@@ -2761,6 +2761,19 @@ char *MakeWinMsgEv(char *str, struct win *win, int esc, int padlen, struct event
- p += strlen(p) - 1;
- break;
-
-+ #ifdef ENCODINGS
-+ case 'e':
-+ *p = 0;
-+ D_encoding = nwin_options.encoding > 0 ? nwin_options.encoding : 0;
-+ if (win && win->w_encoding)
-+ {
-+ *p++ = ' ';
-+ strcpy(p, EncodingName(win->w_encoding));
-+ }
-+ p += strlen(p) - 1;
-+ break;
-+ #endif
-+
- case '{':
- {
- char rbuf[128];
diff --git a/patches/screen-4.5.0/0006-Unbreak-several-useful-keybindings.patch b/patches/screen-4.5.0/0006-Unbreak-several-useful-keybindings.patch
deleted file mode 100644
index 830f2a78d..000000000
--- a/patches/screen-4.5.0/0006-Unbreak-several-useful-keybindings.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Loic Minier <lool@dooz.org>
-Date: Mon, 3 Jul 2017 10:44:57 +0200
-Subject: [PATCH] Unbreak several useful keybindings.
-
-Bugs-Debian: https://bugs.debian.org/484647
----
- termcap.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/termcap.c b/termcap.c
-index ae89d175bc2c..57ed43a6d096 100644
---- a/termcap.c
-+++ b/termcap.c
-@@ -552,8 +552,6 @@ int map;
- else
- break;
- }
-- if (n < KMAP_KEYS)
-- domap = 1;
- if (map == 0 && domap)
- return 0;
- if (map && !domap)
diff --git a/patches/screen-4.5.0/0007-Fix-privilege-escalation-by-reverting-upstream-commi.patch b/patches/screen-4.5.0/0007-Fix-privilege-escalation-by-reverting-upstream-commi.patch
deleted file mode 100644
index 134934f3d..000000000
--- a/patches/screen-4.5.0/0007-Fix-privilege-escalation-by-reverting-upstream-commi.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Axel Beckert <abe@debian.org>
-Date: Mon, 3 Jul 2017 10:46:08 +0200
-Subject: [PATCH] Fix privilege escalation by reverting upstream commit
- 5460f5d2
-
-Bug-Debian: https://bugs.debian.org/852484
-Bug-CVE: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5618
-Bug: https://savannah.gnu.org/bugs/?50142
- https://lists.gnu.org/archive/html/screen-devel/2017-01/msg00025.html
----
- screen.c | 6 ------
- 1 file changed, 6 deletions(-)
-
-diff --git a/screen.c b/screen.c
-index 7cad20626f2b..e60d0a712fb5 100644
---- a/screen.c
-+++ b/screen.c
-@@ -673,12 +673,6 @@ int main(int ac, char** av)
- Panic(0, "-L: logfile name can not start with \"-\" symbol");
- if (strlen(screenlogfile) > PATH_MAX)
- Panic(0, "-L: logfile name too long. (max. %d char)", PATH_MAX);
--
-- FILE *w_check;
-- if ((w_check = fopen(screenlogfile, "w")) == NULL)
-- Panic(0, "-L: logfile name access problem");
-- else
-- fclose(w_check);
- }
- nwin_options.Lflag = 1;
- break;
diff --git a/patches/screen-4.5.0/0008-Fix-terminal-garbage-in-Debian-Installer-over-serial.patch b/patches/screen-4.5.0/0008-Fix-terminal-garbage-in-Debian-Installer-over-serial.patch
deleted file mode 100644
index a174ea10c..000000000
--- a/patches/screen-4.5.0/0008-Fix-terminal-garbage-in-Debian-Installer-over-serial.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Samuel Thibault <sthibault@debian.org>
-Date: Mon, 3 Jul 2017 10:47:14 +0200
-Subject: [PATCH] Fix terminal garbage in Debian Installer over serial line
-
-Reviewed-By: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
-Bug-Debian: https://bugs.debian.org/857808
-Bug: https://savannah.gnu.org/bugs/?50588
----
- termcap.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/termcap.c b/termcap.c
-index 57ed43a6d096..1b15e63a3192 100644
---- a/termcap.c
-+++ b/termcap.c
-@@ -486,6 +486,8 @@ int he;
-
- D_tcinited = 1;
- MakeTermcap(0);
-+ /* Make sure libterm uses external term properties for our tputs() calls. */
-+ e_tgetent(tbuf, D_termname);
- #ifdef MAPKEYS
- CheckEscape();
- #endif
diff --git a/patches/screen-4.5.0/0009-Ignore-logfile-s-name-that-begins-with-the-symbol.patch b/patches/screen-4.5.0/0009-Ignore-logfile-s-name-that-begins-with-the-symbol.patch
deleted file mode 100644
index d789f56db..000000000
--- a/patches/screen-4.5.0/0009-Ignore-logfile-s-name-that-begins-with-the-symbol.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From: Alexander Naumov <alexander_naumov@opensuse.org>
-Date: Mon, 3 Jul 2017 10:48:05 +0200
-Subject: [PATCH] Ignore logfile's name that begins with the "-" symbol
-
- This fixes the API:
- .
- To enable logging we use -L option. But in case of
- default logfile name (screenlog.0) we will need to
- define it anyway. Because screen will try to interpret
- next option as a parameter for -L option (which is
- logfile name). It will fails ALWAYS, because next
- parameter will always start with "-" symbol...
- what is not permited for logfile name of course.
- .
- For example:
- .
- $ screen -L -D -m ./configure
- .
- In this case logfile name is screenlog.0, because "-D"
- will not be interpreted by screen as a name of logfile.
-Bug-Debian: https://bugs.debian.org/863095
-Bug: https://savannah.gnu.org/bugs/?50440
-Reviewd-By: Axel Beckert <abe@debian.org>
----
- doc/screen.1 | 4 ++--
- doc/screen.texinfo | 4 +++-
- screen.c | 7 +++++--
- 3 files changed, 10 insertions(+), 5 deletions(-)
-
-diff --git a/doc/screen.1 b/doc/screen.1
-index 0fe8d0e533c2..ee210346dab8 100644
---- a/doc/screen.1
-+++ b/doc/screen.1
-@@ -262,8 +262,8 @@ Ask your system administrator if you are not sure. Remove sessions with the
- tells
- .I screen
- to turn on automatic output logging for the windows. By default, logfile's name
--is screenlog.1. You can sets new name: add it right after -L option e.g. "screen
---L my_logfile".
-+is screenlog.0. You can set new name: add it right after -L option e.g. "screen
-+-L my_logfile". Keep in mind that name can not start with "-" symbol.
- .TP 5
- .B \-m
- causes
-diff --git a/doc/screen.texinfo b/doc/screen.texinfo
-index 2ff39b08a79c..c94993edd2ed 100644
---- a/doc/screen.texinfo
-+++ b/doc/screen.texinfo
-@@ -334,7 +334,9 @@ Remove sessions with the @samp{-wipe} option.
-
- @item -L
- Tell @code{screen} to turn on automatic output logging for the
--windows.
-+windows. By default, logfile's name is screenlog.0. You can set new name:
-+add it right after -L option e.g. "screen -L my_logfile". Keep in mind
-+that name can not start with "-" symbol.
-
- @item -m
- Tell @code{screen} to ignore the @code{$STY} environment variable. When
-diff --git a/screen.c b/screen.c
-index e60d0a712fb5..07f0c1387e32 100644
---- a/screen.c
-+++ b/screen.c
-@@ -669,8 +669,11 @@ int main(int ac, char** av)
- case 'L':
- if (--ac != 0) {
- screenlogfile = SaveStr(*++av);
-- if (screenlogfile[0] == '-')
-- Panic(0, "-L: logfile name can not start with \"-\" symbol");
-+ if (screenlogfile[0] == '-') {
-+ screenlogfile = SaveStr("screenlog.%n");
-+ av--;
-+ ac++;
-+ }
- if (strlen(screenlogfile) > PATH_MAX)
- Panic(0, "-L: logfile name too long. (max. %d char)", PATH_MAX);
- }
diff --git a/patches/screen-4.5.0/autogen.sh b/patches/screen-4.5.0/autogen.sh
deleted file mode 100755
index 9e73c8d20..000000000
--- a/patches/screen-4.5.0/autogen.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-autoconf \
- --force \
- --warnings=cross \
- --warnings=syntax \
- --warnings=obsolete \
- --warnings=unsupported
-
diff --git a/patches/screen-4.5.0/series b/patches/screen-4.5.0/series
deleted file mode 100644
index b2f09ec5b..000000000
--- a/patches/screen-4.5.0/series
+++ /dev/null
@@ -1,12 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-don-t-link-against-libelf.patch
-0002-remove-configure-AC_TRY_RUN-tests.patch
-0003-autoconf-cleanup.patch
-0004-Fix-some-typos-found-by-Lintian.patch
-0005-show-encoding-in-hardstatus.patch
-0006-Unbreak-several-useful-keybindings.patch
-0007-Fix-privilege-escalation-by-reverting-upstream-commi.patch
-0008-Fix-terminal-garbage-in-Debian-Installer-over-serial.patch
-0009-Ignore-logfile-s-name-that-begins-with-the-symbol.patch
-# ccc52b9b8b2bf27ae19c5efb5999fc70 - git-ptx-patches magic
diff --git a/patches/screen-4.9.1/0001-comm.h-now-depends-on-term.h.patch b/patches/screen-4.9.1/0001-comm.h-now-depends-on-term.h.patch
new file mode 100644
index 000000000..6b364c26d
--- /dev/null
+++ b/patches/screen-4.9.1/0001-comm.h-now-depends-on-term.h.patch
@@ -0,0 +1,24 @@
+From: Mike Gerwitz <mike@mikegerwitz.com>
+Date: Tue, 24 Dec 2013 22:16:31 -0500
+Subject: [PATCH] comm.h now depends on term.h
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Patch retrieved and updated from:
+http://git.savannah.gnu.org/cgit/screen.git/commit/?id=39c5f1c]
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 26ec40450bdb..4bc364671904 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -133,7 +133,7 @@ kmapdef.c: term.h
+ tty.c: tty.sh
+ sh $(srcdir)/tty.sh tty.c
+
+-comm.h: comm.c comm.sh config.h
++comm.h: comm.c comm.sh config.h term.h
+ AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
+
+ osdef.h: osdef.sh config.h osdef.h.in
diff --git a/patches/screen-4.9.1/0002-comm.h-needed-for-list_-display-generic-.o.patch b/patches/screen-4.9.1/0002-comm.h-needed-for-list_-display-generic-.o.patch
new file mode 100644
index 000000000..f51639ef1
--- /dev/null
+++ b/patches/screen-4.9.1/0002-comm.h-needed-for-list_-display-generic-.o.patch
@@ -0,0 +1,31 @@
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 3 Oct 2018 22:29:32 +0200
+Subject: [PATCH] comm.h needed for list_{display,generic}.o
+
+comm.h is needed to build list_display.o and list_generic.o otherwise
+parallel builds will sometimes fail
+
+Fixes:
+ - http://autobuild.buildroot.org/results/43105f14857dbe72d8878fc7b3db67f7bdca93cc
+ - http://autobuild.buildroot.org/results/47f4ecbec1355285633df287fc9c4e7cccde9378
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://savannah.gnu.org/bugs/index.php?54776]
+---
+ Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 4bc364671904..8bfcac6f8412 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -350,7 +350,7 @@ layout.o: layout.h viewport.h canvas.h layout.c config.h screen.h os.h osdef.h a
+ viewport.o: layout.h viewport.h canvas.h viewport.c config.h screen.h os.h osdef.h ansi.h acls.h \
+ comm.h layer.h term.h image.h display.h window.h extern.h \
+ braille.h
+-list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h
+-list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h
++list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h comm.h
++list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h comm.h
+ list_window.o: list_generic.h list_window.c window.h layer.h screen.h osdef.h comm.h
+
diff --git a/patches/screen-4.9.1/0003-suppress_remap.patch b/patches/screen-4.9.1/0003-suppress_remap.patch
new file mode 100644
index 000000000..fda63e90c
--- /dev/null
+++ b/patches/screen-4.9.1/0003-suppress_remap.patch
@@ -0,0 +1,24 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 7 Jan 2022 12:53:57 +0100
+Subject: [PATCH] suppress_remap
+
+Imported from screen_4.8.0-7.debian.tar.xz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ termcap.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/termcap.c b/termcap.c
+index 26c8f5a96589..29684cf974f7 100644
+--- a/termcap.c
++++ b/termcap.c
+@@ -553,8 +553,6 @@ int map;
+ else
+ break;
+ }
+- if (n < KMAP_KEYS)
+- domap = 1;
+ if (map == 0 && domap)
+ return 0;
+ if (map && !domap)
diff --git a/patches/libyaml-0.1.7/autogen.sh b/patches/screen-4.9.1/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/libyaml-0.1.7/autogen.sh
+++ b/patches/screen-4.9.1/autogen.sh
diff --git a/patches/screen-4.9.1/series b/patches/screen-4.9.1/series
new file mode 100644
index 000000000..bf7060df3
--- /dev/null
+++ b/patches/screen-4.9.1/series
@@ -0,0 +1,6 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-comm.h-now-depends-on-term.h.patch
+0002-comm.h-needed-for-list_-display-generic-.o.patch
+0003-suppress_remap.patch
+# 086ac9b43abed5bb61eef564f1ac00d9 - git-ptx-patches magic
diff --git a/patches/setuptools-rust-1.5.2/series b/patches/setuptools-rust-1.5.2/series
new file mode 100644
index 000000000..b69a0d2bb
--- /dev/null
+++ b/patches/setuptools-rust-1.5.2/series
@@ -0,0 +1 @@
+use-Literal-from-typing.patch
diff --git a/patches/setuptools-rust-1.5.2/use-Literal-from-typing.patch b/patches/setuptools-rust-1.5.2/use-Literal-from-typing.patch
new file mode 100644
index 000000000..186a0279e
--- /dev/null
+++ b/patches/setuptools-rust-1.5.2/use-Literal-from-typing.patch
@@ -0,0 +1,53 @@
+From b3ac96d620caae2834770f5a744db507846868c6 Mon Sep 17 00:00:00 2001
+From: Artur Wiebe <artur@4wiebe.de>
+Date: Mon, 27 Mar 2023 14:49:44 +0200
+Subject: [PATCH] use Literal from typing
+
+---
+ setuptools_rust/build.py | 2 +-
+ setuptools_rust/extension.py | 2 +-
+ setuptools_rust/setuptools_ext.py | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/setuptools_rust/build.py b/setuptools_rust/build.py
+index 21c1975..ff94cb0 100644
+--- a/setuptools_rust/build.py
++++ b/setuptools_rust/build.py
+@@ -23,7 +23,7 @@ import pkg_resources
+ from setuptools.command.build import build as CommandBuild # type: ignore[import]
+ from setuptools.command.build_ext import build_ext as CommandBuildExt
+ from setuptools.command.build_ext import get_abi3_suffix
+-from typing_extensions import Literal
++from typing import Literal
+
+ from ._utils import format_called_process_error
+ from .command import RustCommand
+diff --git a/setuptools_rust/extension.py b/setuptools_rust/extension.py
+index f7a09d1..537a8db 100644
+--- a/setuptools_rust/extension.py
++++ b/setuptools_rust/extension.py
+@@ -9,7 +9,7 @@ from functools import lru_cache
+ from typing import Any, Dict, List, NewType, Optional, Sequence, Union, cast
+
+ from semantic_version import SimpleSpec
+-from typing_extensions import Literal
++from typing import Literal
+
+ from ._utils import format_called_process_error
+
+diff --git a/setuptools_rust/setuptools_ext.py b/setuptools_rust/setuptools_ext.py
+index 8ce281e..943b2e9 100644
+--- a/setuptools_rust/setuptools_ext.py
++++ b/setuptools_rust/setuptools_ext.py
+@@ -11,7 +11,7 @@ from setuptools.command.install_lib import install_lib
+ from setuptools.command.install_scripts import install_scripts
+ from setuptools.command.sdist import sdist
+ from setuptools.dist import Distribution
+-from typing_extensions import Literal
++from typing import Literal
+
+ from .extension import RustBin, RustExtension
+
+--
+2.39.2
+
diff --git a/patches/shiboken-1.2.2/0001-cmake-allow-specifying-the-preferred-Python2-version.patch b/patches/shiboken-1.2.2/0001-cmake-allow-specifying-the-preferred-Python2-version.patch
deleted file mode 100644
index 2a7dd2232..000000000
--- a/patches/shiboken-1.2.2/0001-cmake-allow-specifying-the-preferred-Python2-version.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 15 Mar 2012 08:55:26 +0100
-Subject: [PATCH] cmake: allow specifying the preferred Python2 version
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- cmake/Modules/FindPythonInterpWithDebug.cmake | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/cmake/Modules/FindPythonInterpWithDebug.cmake b/cmake/Modules/FindPythonInterpWithDebug.cmake
-index 7722d956917e..06c5aff02580 100644
---- a/cmake/Modules/FindPythonInterpWithDebug.cmake
-+++ b/cmake/Modules/FindPythonInterpWithDebug.cmake
-@@ -1,4 +1,4 @@
--find_program(PYTHON_EXECUTABLE NAMES python2.7 python2.6 python2.5)
-+find_program(PYTHON_EXECUTABLE NAMES ${Python_PREFERRED_VERSION} python2.7 python2.6 python2.5)
-
- if (NOT PYTHON_EXECUTABLE)
- find_package(PythonInterp REQUIRED)
diff --git a/patches/shiboken-1.2.2/0002-cmake-allow-specifying-the-preferred-Python3-version.patch b/patches/shiboken-1.2.2/0002-cmake-allow-specifying-the-preferred-Python3-version.patch
deleted file mode 100644
index 2d985e42d..000000000
--- a/patches/shiboken-1.2.2/0002-cmake-allow-specifying-the-preferred-Python3-version.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Bastian Stender <bst@pengutronix.de>
-Date: Fri, 26 Jan 2018 14:27:23 +0100
-Subject: [PATCH] cmake: allow specifying the preferred Python3 version
-
-Signed-off-by: Bastian Stender <bst@pengutronix.de>
----
- cmake/Modules/FindPython3Interp.cmake | 4 ++--
- cmake/Modules/FindPython3Libs.cmake | 4 +++-
- 2 files changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/cmake/Modules/FindPython3Interp.cmake b/cmake/Modules/FindPython3Interp.cmake
-index 373982e210a3..ad38c6697bc8 100644
---- a/cmake/Modules/FindPython3Interp.cmake
-+++ b/cmake/Modules/FindPython3Interp.cmake
-@@ -20,7 +20,7 @@
- # License text for the above reference.)
-
- FIND_PROGRAM(PYTHON3_EXECUTABLE
-- NAMES python3.2mu python3.2m python3.2u python3.2 python3.1 python3.0 python3
-+ NAMES ${Python3_PREFERRED_VERSION} python3.2mu python3.2m python3.2u python3.2 python3.1 python3.0 python3
- PATHS
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.2\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.1\\InstallPath]
-@@ -28,7 +28,7 @@ FIND_PROGRAM(PYTHON3_EXECUTABLE
- )
-
- FIND_PROGRAM(PYTHON3_DBG_EXECUTABLE
-- NAMES python3.2dmu python3.2dm python3.2du python3.2d python3.1-dbg python3.0-dbg python3-dbg
-+ NAMES ${Python3_PREFERRED_VERSION} python3.2dmu python3.2dm python3.2du python3.2d python3.1-dbg python3.0-dbg python3-dbg
- PATHS
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.2\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.1\\InstallPath]
-diff --git a/cmake/Modules/FindPython3Libs.cmake b/cmake/Modules/FindPython3Libs.cmake
-index 20a82ba07d59..e1789438a4b9 100644
---- a/cmake/Modules/FindPython3Libs.cmake
-+++ b/cmake/Modules/FindPython3Libs.cmake
-@@ -27,7 +27,9 @@ INCLUDE(CMakeFindFrameworks)
- # Search for the python framework on Apple.
- # CMAKE_FIND_FRAMEWORKS(Python)
-
--FOREACH(_CURRENT_VERSION 3.4 3.3 3.2 3.1 3.0)
-+STRING(REPLACE "python" "" Python3_PREFERRED_VERSION_NUMBER ${Python3_PREFERRED_VERSION})
-+
-+FOREACH(_CURRENT_VERSION ${Python3_PREFERRED_VERSION_NUMBER} 3.4 3.3 3.2 3.1 3.0)
- IF(_CURRENT_VERSION GREATER 3.1)
- SET(_32FLAGS "m" "u" "mu" "dm" "du" "dmu" "")
- ELSE()
diff --git a/patches/shiboken-1.2.2/series b/patches/shiboken-1.2.2/series
deleted file mode 100644
index 35630db2b..000000000
--- a/patches/shiboken-1.2.2/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-cmake-allow-specifying-the-preferred-Python2-version.patch
-0002-cmake-allow-specifying-the-preferred-Python3-version.patch
-# 51481bffa6f992fb0f955bd13139b6db - git-ptx-patches magic
diff --git a/patches/sockperf-3.10/0001-Fixed-AArch32-compilation.patch b/patches/sockperf-3.10/0001-Fixed-AArch32-compilation.patch
new file mode 100644
index 000000000..5d15e2787
--- /dev/null
+++ b/patches/sockperf-3.10/0001-Fixed-AArch32-compilation.patch
@@ -0,0 +1,69 @@
+From: =?UTF-8?q?Sven=20P=C3=BCschel?= <s.pueschel@pengutronix.de>
+Date: Mon, 13 Feb 2023 10:16:51 +0100
+Subject: [PATCH] Fixed AArch32 compilation
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+sockperf added support for AArch64, but at the same time it broke AArch32 support,
+as this wasn't catched by a compiler macro anymore and resulted in trying to assemble a rdtsc instruction.
+
+See https://github.com/Mellanox/sockperf/commit/d84e8179f8ab007c7a19dfe263691b0429df7565
+and https://github.com/Mellanox/sockperf/pull/187
+
+Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
+---
+ src/sockperf.cpp | 9 +++++++++
+ src/ticks_os.h | 5 +++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/src/sockperf.cpp b/src/sockperf.cpp
+index 293d21747592..5d6ee4141b35 100644
+--- a/src/sockperf.cpp
++++ b/src/sockperf.cpp
+@@ -2205,6 +2205,13 @@ static int parse_common_opt(const AOPT_OBJECT *common_obj) {
+ #endif /* DEFINED_TLS */
+ }
+
++#if defined(__arm__) && !defined(__aarch64__)
++ if (!s_user_params.b_no_rdtsc) {
++ log_msg("AArch32 target build does not support rdtsc, use --no-rdtsc");
++ rc = SOCKPERF_ERR_BAD_ARGUMENT;
++ }
++#endif
++
+ // resolve address: -i, -p and --tcp options must be processed before
+ if (!rc) {
+ int res = resolve_sockaddr(host_str, port_str, s_user_params.sock_type,
+@@ -3868,6 +3875,7 @@ packet pace limit = %d",
+ log_dbg("+INFO: taking time, using the given settings, consumes %.3lf nsec",
+ (double)(end - start).toNsec() / SIZE);
+
++#if !defined(__arm__) || defined(__aarch64__)
+ ticks_t tstart = 0, tend = 0;
+ tstart = os_gettimeoftsc();
+
+@@ -3878,6 +3886,7 @@ packet pace limit = %d",
+ double ticks_per_second = (double)get_tsc_rate_per_second();
+ log_dbg("+INFO: taking rdtsc directly consumes %.3lf nsec",
+ tdelta / SIZE * 1000 * 1000 * 1000 / ticks_per_second);
++#endif
+
+ // step #5: check is user defined a specific SEED value to be used in all rand() calls
+ // if no seed value is provided, the rand() function is automatically seeded with a value of
+diff --git a/src/ticks_os.h b/src/ticks_os.h
+index 0f23b2c6f6f5..8750e0374245 100644
+--- a/src/ticks_os.h
++++ b/src/ticks_os.h
+@@ -99,6 +99,11 @@ inline ticks_t os_gettimeoftsc() {
+ asm volatile("isb" : : : "memory");
+ asm volatile("mrs %0, cntvct_el0" : "=r" (ret));
+ return ret;
++#elif defined(__arm__)
++ // so the compiler will not complain. for
++ // AArch32 compile, this inline is not used
++ // since rdtsc is only supported in an optional timer extension
++ upper_32 = lower_32 = 0;
+ #else
+ // ReaD Time Stamp Counter (RDTCS)
+ __asm__ __volatile__("rdtsc" : "=a"(lower_32), "=d"(upper_32));
diff --git a/patches/sockperf-3.10/series b/patches/sockperf-3.10/series
new file mode 100644
index 000000000..5f59ae930
--- /dev/null
+++ b/patches/sockperf-3.10/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Fixed-AArch32-compilation.patch
+# 84265c4b5947716cec9ccf808fa7f92e - git-ptx-patches magic
diff --git a/patches/softhsm-2.6.1/0001-Prevent-accessing-of-global-c-objects-once-they-are-.patch b/patches/softhsm-2.6.1/0001-Prevent-accessing-of-global-c-objects-once-they-are-.patch
new file mode 100644
index 000000000..51ac0b36a
--- /dev/null
+++ b/patches/softhsm-2.6.1/0001-Prevent-accessing-of-global-c-objects-once-they-are-.patch
@@ -0,0 +1,673 @@
+From: Neil Horman <nhorman@openssl.org>
+Date: Fri, 27 Oct 2023 14:57:37 -0400
+Subject: [PATCH] Prevent accessing of global c++ objects once they are deleted
+
+Use the global integer objects_deleted to detect when SoftHSM instance is gone.
+The destruction of the std::unique_ptr object cannot be modified directly
+so use the SoftHSM destructor instead.
+
+The destructor is also called in C_Finalize() when the global object is
+reset, so clear objects_deleted in this case. Otherwice C_Initialize()
+after C_Finalize() will fail.
+
+Fixes (Maybe) #729.
+---
+ src/lib/SoftHSM.cpp | 5 ++
+ src/lib/main.cpp | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 143 insertions(+)
+
+diff --git a/src/lib/SoftHSM.cpp b/src/lib/SoftHSM.cpp
+index 0a0c32cc68dc..384bd4336b44 100644
+--- a/src/lib/SoftHSM.cpp
++++ b/src/lib/SoftHSM.cpp
+@@ -88,6 +88,8 @@
+
+ // Initialise the one-and-only instance
+
++int objects_deleted = 0;
++
+ #ifdef HAVE_CXX11
+
+ std::unique_ptr<MutexFactory> MutexFactory::instance(nullptr);
+@@ -367,6 +369,8 @@ void SoftHSM::reset()
+ {
+ if (instance.get())
+ instance.reset();
++
++ objects_deleted = 0;
+ }
+
+ // Constructor
+@@ -406,6 +410,7 @@ SoftHSM::~SoftHSM()
+
+ isInitialised = false;
+
++ objects_deleted = 1;
+ resetMutexFactoryCallbacks();
+ }
+
+diff --git a/src/lib/main.cpp b/src/lib/main.cpp
+index 2dfd0eb87164..e89f18c1096e 100644
+--- a/src/lib/main.cpp
++++ b/src/lib/main.cpp
+@@ -49,6 +49,8 @@
+ #define PKCS_API
+ #endif
+
++extern int objects_deleted;
++
+ // PKCS #11 function list
+ static CK_FUNCTION_LIST functionList =
+ {
+@@ -130,6 +132,8 @@ PKCS_API CK_RV C_Initialize(CK_VOID_PTR pInitArgs)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_Initialize(pInitArgs);
+ }
+ catch (...)
+@@ -145,6 +149,8 @@ PKCS_API CK_RV C_Finalize(CK_VOID_PTR pReserved)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_Finalize(pReserved);
+ }
+ catch (...)
+@@ -160,6 +166,8 @@ PKCS_API CK_RV C_GetInfo(CK_INFO_PTR pInfo)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetInfo(pInfo);
+ }
+ catch (...)
+@@ -175,6 +183,8 @@ PKCS_API CK_RV C_GetFunctionList(CK_FUNCTION_LIST_PTR_PTR ppFunctionList)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ if (ppFunctionList == NULL_PTR) return CKR_ARGUMENTS_BAD;
+
+ *ppFunctionList = &functionList;
+@@ -194,6 +204,8 @@ PKCS_API CK_RV C_GetSlotList(CK_BBOOL tokenPresent, CK_SLOT_ID_PTR pSlotList, CK
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetSlotList(tokenPresent, pSlotList, pulCount);
+ }
+ catch (...)
+@@ -209,6 +221,8 @@ PKCS_API CK_RV C_GetSlotInfo(CK_SLOT_ID slotID, CK_SLOT_INFO_PTR pInfo)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetSlotInfo(slotID, pInfo);
+ }
+ catch (...)
+@@ -224,6 +238,8 @@ PKCS_API CK_RV C_GetTokenInfo(CK_SLOT_ID slotID, CK_TOKEN_INFO_PTR pInfo)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetTokenInfo(slotID, pInfo);
+ }
+ catch (...)
+@@ -239,6 +255,8 @@ PKCS_API CK_RV C_GetMechanismList(CK_SLOT_ID slotID, CK_MECHANISM_TYPE_PTR pMech
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetMechanismList(slotID, pMechanismList, pulCount);
+ }
+ catch (...)
+@@ -254,6 +272,8 @@ PKCS_API CK_RV C_GetMechanismInfo(CK_SLOT_ID slotID, CK_MECHANISM_TYPE type, CK_
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetMechanismInfo(slotID, type, pInfo);
+ }
+ catch (...)
+@@ -269,6 +289,8 @@ PKCS_API CK_RV C_InitToken(CK_SLOT_ID slotID, CK_UTF8CHAR_PTR pPin, CK_ULONG ulP
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_InitToken(slotID, pPin, ulPinLen, pLabel);
+ }
+ catch (...)
+@@ -284,6 +306,8 @@ PKCS_API CK_RV C_InitPIN(CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pPin, CK_UL
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_InitPIN(hSession, pPin, ulPinLen);
+ }
+ catch (...)
+@@ -299,6 +323,8 @@ PKCS_API CK_RV C_SetPIN(CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pOldPin, CK_
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_SetPIN(hSession, pOldPin, ulOldLen, pNewPin, ulNewLen);
+ }
+ catch (...)
+@@ -314,6 +340,8 @@ PKCS_API CK_RV C_OpenSession(CK_SLOT_ID slotID, CK_FLAGS flags, CK_VOID_PTR pApp
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_OpenSession(slotID, flags, pApplication, notify, phSession);
+ }
+ catch (...)
+@@ -329,6 +357,8 @@ PKCS_API CK_RV C_CloseSession(CK_SESSION_HANDLE hSession)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_CloseSession(hSession);
+ }
+ catch (...)
+@@ -344,6 +374,8 @@ PKCS_API CK_RV C_CloseAllSessions(CK_SLOT_ID slotID)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_CloseAllSessions(slotID);
+ }
+ catch (...)
+@@ -359,6 +391,8 @@ PKCS_API CK_RV C_GetSessionInfo(CK_SESSION_HANDLE hSession, CK_SESSION_INFO_PTR
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetSessionInfo(hSession, pInfo);
+ }
+ catch (...)
+@@ -374,6 +408,8 @@ PKCS_API CK_RV C_GetOperationState(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pOper
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetOperationState(hSession, pOperationState, pulOperationStateLen);
+ }
+ catch (...)
+@@ -389,6 +425,8 @@ PKCS_API CK_RV C_SetOperationState(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pOper
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_SetOperationState(hSession, pOperationState, ulOperationStateLen, hEncryptionKey, hAuthenticationKey);
+ }
+ catch (...)
+@@ -404,6 +442,8 @@ PKCS_API CK_RV C_Login(CK_SESSION_HANDLE hSession, CK_USER_TYPE userType, CK_UTF
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_Login(hSession, userType, pPin, ulPinLen);
+ }
+ catch (...)
+@@ -419,6 +459,8 @@ PKCS_API CK_RV C_Logout(CK_SESSION_HANDLE hSession)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_Logout(hSession);
+ }
+ catch (...)
+@@ -434,6 +476,8 @@ PKCS_API CK_RV C_CreateObject(CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemp
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_CreateObject(hSession, pTemplate, ulCount, phObject);
+ }
+ catch (...)
+@@ -449,6 +493,8 @@ PKCS_API CK_RV C_CopyObject(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_CopyObject(hSession, hObject, pTemplate, ulCount, phNewObject);
+ }
+ catch (...)
+@@ -464,6 +510,8 @@ PKCS_API CK_RV C_DestroyObject(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObj
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DestroyObject(hSession, hObject);
+ }
+ catch (...)
+@@ -479,6 +527,8 @@ PKCS_API CK_RV C_GetObjectSize(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObj
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetObjectSize(hSession, hObject, pulSize);
+ }
+ catch (...)
+@@ -494,6 +544,8 @@ PKCS_API CK_RV C_GetAttributeValue(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetAttributeValue(hSession, hObject, pTemplate, ulCount);
+ }
+ catch (...)
+@@ -509,6 +561,8 @@ PKCS_API CK_RV C_SetAttributeValue(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_SetAttributeValue(hSession, hObject, pTemplate, ulCount);
+ }
+ catch (...)
+@@ -524,6 +578,8 @@ PKCS_API CK_RV C_FindObjectsInit(CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pT
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_FindObjectsInit(hSession, pTemplate, ulCount);
+ }
+ catch (...)
+@@ -539,6 +595,8 @@ PKCS_API CK_RV C_FindObjects(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE_PTR ph
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_FindObjects(hSession, phObject, ulMaxObjectCount, pulObjectCount);
+ }
+ catch (...)
+@@ -554,6 +612,8 @@ PKCS_API CK_RV C_FindObjectsFinal(CK_SESSION_HANDLE hSession)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_FindObjectsFinal(hSession);
+ }
+ catch (...)
+@@ -569,6 +629,8 @@ PKCS_API CK_RV C_EncryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMecha
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_EncryptInit(hSession, pMechanism, hObject);
+ }
+ catch (...)
+@@ -584,6 +646,8 @@ PKCS_API CK_RV C_Encrypt(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_Encrypt(hSession, pData, ulDataLen, pEncryptedData, pulEncryptedDataLen);
+ }
+ catch (...)
+@@ -599,6 +663,8 @@ PKCS_API CK_RV C_EncryptUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_EncryptUpdate(hSession, pData, ulDataLen, pEncryptedData, pulEncryptedDataLen);
+ }
+ catch (...)
+@@ -614,6 +680,8 @@ PKCS_API CK_RV C_EncryptFinal(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncrypted
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_EncryptFinal(hSession, pEncryptedData, pulEncryptedDataLen);
+ }
+ catch (...)
+@@ -629,6 +697,8 @@ PKCS_API CK_RV C_DecryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMecha
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DecryptInit(hSession, pMechanism, hObject);
+ }
+ catch (...)
+@@ -644,6 +714,8 @@ PKCS_API CK_RV C_Decrypt(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedData,
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_Decrypt(hSession, pEncryptedData, ulEncryptedDataLen, pData, pulDataLen);
+ }
+ catch (...)
+@@ -659,6 +731,8 @@ PKCS_API CK_RV C_DecryptUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncrypte
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DecryptUpdate(hSession, pEncryptedData, ulEncryptedDataLen, pData, pDataLen);
+ }
+ catch (...)
+@@ -674,6 +748,8 @@ PKCS_API CK_RV C_DecryptFinal(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DecryptFinal(hSession, pData, pDataLen);
+ }
+ catch (...)
+@@ -689,6 +765,8 @@ PKCS_API CK_RV C_DigestInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechan
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DigestInit(hSession, pMechanism);
+ }
+ catch (...)
+@@ -704,6 +782,8 @@ PKCS_API CK_RV C_Digest(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_Digest(hSession, pData, ulDataLen, pDigest, pulDigestLen);
+ }
+ catch (...)
+@@ -719,6 +799,8 @@ PKCS_API CK_RV C_DigestUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DigestUpdate(hSession, pPart, ulPartLen);
+ }
+ catch (...)
+@@ -734,6 +816,8 @@ PKCS_API CK_RV C_DigestKey(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DigestKey(hSession, hObject);
+ }
+ catch (...)
+@@ -749,6 +833,8 @@ PKCS_API CK_RV C_DigestFinal(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pDigest, CK
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DigestFinal(hSession, pDigest, pulDigestLen);
+ }
+ catch (...)
+@@ -764,6 +850,8 @@ PKCS_API CK_RV C_SignInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanis
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_SignInit(hSession, pMechanism, hKey);
+ }
+ catch (...)
+@@ -779,6 +867,8 @@ PKCS_API CK_RV C_Sign(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ul
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_Sign(hSession, pData, ulDataLen, pSignature, pulSignatureLen);
+ }
+ catch (...)
+@@ -794,6 +884,8 @@ PKCS_API CK_RV C_SignUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_UL
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_SignUpdate(hSession, pPart, ulPartLen);
+ }
+ catch (...)
+@@ -809,6 +901,8 @@ PKCS_API CK_RV C_SignFinal(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature, C
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_SignFinal(hSession, pSignature, pulSignatureLen);
+ }
+ catch (...)
+@@ -824,6 +918,8 @@ PKCS_API CK_RV C_SignRecoverInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pM
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_SignRecoverInit(hSession, pMechanism, hKey);
+ }
+ catch (...)
+@@ -839,6 +935,8 @@ PKCS_API CK_RV C_SignRecover(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_U
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_SignRecover(hSession, pData, ulDataLen, pSignature, pulSignatureLen);
+ }
+ catch (...)
+@@ -854,6 +952,8 @@ PKCS_API CK_RV C_VerifyInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechan
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_VerifyInit(hSession, pMechanism, hKey);
+ }
+ catch (...)
+@@ -869,6 +969,8 @@ PKCS_API CK_RV C_Verify(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_Verify(hSession, pData, ulDataLen, pSignature, ulSignatureLen);
+ }
+ catch (...)
+@@ -884,6 +986,8 @@ PKCS_API CK_RV C_VerifyUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_VerifyUpdate(hSession, pPart, ulPartLen);
+ }
+ catch (...)
+@@ -899,6 +1003,8 @@ PKCS_API CK_RV C_VerifyFinal(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature,
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_VerifyFinal(hSession, pSignature, ulSignatureLen);
+ }
+ catch (...)
+@@ -914,6 +1020,8 @@ PKCS_API CK_RV C_VerifyRecoverInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_VerifyRecoverInit(hSession, pMechanism, hKey);
+ }
+ catch (...)
+@@ -929,6 +1037,8 @@ PKCS_API CK_RV C_VerifyRecover(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignatur
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_VerifyRecover(hSession, pSignature, ulSignatureLen, pData, pulDataLen);
+ }
+ catch (...)
+@@ -944,6 +1054,8 @@ PKCS_API CK_RV C_DigestEncryptUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPa
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DigestEncryptUpdate(hSession, pPart, ulPartLen, pEncryptedPart, pulEncryptedPartLen);
+ }
+ catch (...)
+@@ -959,6 +1071,8 @@ PKCS_API CK_RV C_DecryptDigestUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPa
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DecryptDigestUpdate(hSession, pPart, ulPartLen, pDecryptedPart, pulDecryptedPartLen);
+ }
+ catch (...)
+@@ -974,6 +1088,8 @@ PKCS_API CK_RV C_SignEncryptUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_SignEncryptUpdate(hSession, pPart, ulPartLen, pEncryptedPart, pulEncryptedPartLen);
+ }
+ catch (...)
+@@ -989,6 +1105,8 @@ PKCS_API CK_RV C_DecryptVerifyUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEn
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DecryptVerifyUpdate(hSession, pEncryptedPart, ulEncryptedPartLen, pPart, pulPartLen);
+ }
+ catch (...)
+@@ -1004,6 +1122,8 @@ PKCS_API CK_RV C_GenerateKey(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMecha
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GenerateKey(hSession, pMechanism, pTemplate, ulCount, phKey);
+ }
+ catch (...)
+@@ -1029,6 +1149,8 @@ PKCS_API CK_RV C_GenerateKeyPair
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GenerateKeyPair(hSession, pMechanism, pPublicKeyTemplate, ulPublicKeyAttributeCount, pPrivateKeyTemplate, ulPrivateKeyAttributeCount, phPublicKey, phPrivateKey);
+ }
+ catch (...)
+@@ -1052,6 +1174,8 @@ PKCS_API CK_RV C_WrapKey
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_WrapKey(hSession, pMechanism, hWrappingKey, hKey, pWrappedKey, pulWrappedKeyLen);
+ }
+ catch (...)
+@@ -1077,6 +1201,8 @@ PKCS_API CK_RV C_UnwrapKey
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_UnwrapKey(hSession, pMechanism, hUnwrappingKey, pWrappedKey, ulWrappedKeyLen, pTemplate, ulCount, phKey);
+ }
+ catch (...)
+@@ -1100,6 +1226,8 @@ PKCS_API CK_RV C_DeriveKey
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_DeriveKey(hSession, pMechanism, hBaseKey, pTemplate, ulCount, phKey);
+ }
+ catch (...)
+@@ -1115,6 +1243,8 @@ PKCS_API CK_RV C_SeedRandom(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSeed, CK_UL
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_SeedRandom(hSession, pSeed, ulSeedLen);
+ }
+ catch (...)
+@@ -1130,6 +1260,8 @@ PKCS_API CK_RV C_GenerateRandom(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pRandomD
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GenerateRandom(hSession, pRandomData, ulRandomLen);
+ }
+ catch (...)
+@@ -1145,6 +1277,8 @@ PKCS_API CK_RV C_GetFunctionStatus(CK_SESSION_HANDLE hSession)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_GetFunctionStatus(hSession);
+ }
+ catch (...)
+@@ -1160,6 +1294,8 @@ PKCS_API CK_RV C_CancelFunction(CK_SESSION_HANDLE hSession)
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_CancelFunction(hSession);
+ }
+ catch (...)
+@@ -1175,6 +1311,8 @@ PKCS_API CK_RV C_WaitForSlotEvent(CK_FLAGS flags, CK_SLOT_ID_PTR pSlot, CK_VOID_
+ {
+ try
+ {
++ if (objects_deleted == 1)
++ return CKR_FUNCTION_FAILED;
+ return SoftHSM::i()->C_WaitForSlotEvent(flags, pSlot, pReserved);
+ }
+ catch (...)
diff --git a/patches/softhsm-2.6.1/series b/patches/softhsm-2.6.1/series
new file mode 100644
index 000000000..01fa21a99
--- /dev/null
+++ b/patches/softhsm-2.6.1/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Prevent-accessing-of-global-c-objects-once-they-are-.patch
+# 4e7b13f384378f31b3cf250e0be9d4c0 - git-ptx-patches magic
diff --git a/patches/squashfs4.4/0001-squashfs-tools-fix-build-failure-against-gcc-10.patch b/patches/squashfs4.4/0001-squashfs-tools-fix-build-failure-against-gcc-10.patch
deleted file mode 100644
index 3c6db8fff..000000000
--- a/patches/squashfs4.4/0001-squashfs-tools-fix-build-failure-against-gcc-10.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Sun, 26 Jan 2020 18:35:13 +0000
-Subject: [PATCH] squashfs-tools: fix build failure against gcc-10
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-On gcc-10 (and gcc-9 -fno-common) build fails as:
-
-```
-cc ... -o mksquashfs
-ld: read_fs.o:(.bss+0x0):
- multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
-ld: read_fs.o:(.bss+0x8):
- multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
-```
-
-gcc-10 will change the default from -fcommon to fno-common:
-https://gcc.gnu.org/PR85678.
-
-The error also happens if CFLAGS=-fno-common passed explicitly.
-
-Reported-by: Toralf Förster
-Bug: https://bugs.gentoo.org/706456
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
----
- squashfs-tools/mksquashfs.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
-index 1beefef70495..b650306360fb 100644
---- a/squashfs-tools/mksquashfs.h
-+++ b/squashfs-tools/mksquashfs.h
-@@ -143,7 +143,7 @@ struct append_file {
- #endif
-
- extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
--struct cache *bwriter_buffer, *fwriter_buffer;
-+extern struct cache *bwriter_buffer, *fwriter_buffer;
- extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
- *to_frag, *locked_fragment, *to_process_frag;
- extern struct append_file **file_mapping;
diff --git a/patches/squashfs4.4/series b/patches/squashfs4.4/series
deleted file mode 100644
index 32a7a8465..000000000
--- a/patches/squashfs4.4/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-squashfs-tools-fix-build-failure-against-gcc-10.patch
-# a4fb95a1d871f88525f2f224d1306058 - git-ptx-patches magic
diff --git a/patches/squashfs4.5.1/0001-don-t-try-to-generate-manpages.patch b/patches/squashfs4.5.1/0001-don-t-try-to-generate-manpages.patch
new file mode 100644
index 000000000..1dd1d6c43
--- /dev/null
+++ b/patches/squashfs4.5.1/0001-don-t-try-to-generate-manpages.patch
@@ -0,0 +1,21 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Thu, 15 Dec 2022 12:19:04 +0100
+Subject: [PATCH] don't try to generate manpages
+
+The script tries to execute mksquashfs which does not work for
+cross-compiling.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ squashfs-tools/Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/squashfs-tools/Makefile b/squashfs-tools/Makefile
+index 8b80b8a68c1b..3d147735f506 100755
+--- a/squashfs-tools/Makefile
++++ b/squashfs-tools/Makefile
+@@ -422,4 +422,3 @@ install: mksquashfs unsquashfs
+ cp unsquashfs $(INSTALL_DIR)
+ ln -fs unsquashfs $(INSTALL_DIR)/sqfscat
+ ln -fs mksquashfs $(INSTALL_DIR)/sqfstar
+- ../generate-manpages/install-manpages.sh $(shell pwd)/.. "$(INSTALL_MANPAGES_DIR)"
diff --git a/patches/squashfs4.5.1/series b/patches/squashfs4.5.1/series
new file mode 100644
index 000000000..107a293f5
--- /dev/null
+++ b/patches/squashfs4.5.1/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-don-t-try-to-generate-manpages.patch
+# 44bb5fb8b1cd672d1996e5c3879b55b2 - git-ptx-patches magic
diff --git a/patches/svgalib-1.9.25/0001-svgalib-disable-obsolete-drivers.patch b/patches/svgalib-1.9.25/0001-svgalib-disable-obsolete-drivers.patch
index dd628f4cc..9cf838e0c 100644
--- a/patches/svgalib-1.9.25/0001-svgalib-disable-obsolete-drivers.patch
+++ b/patches/svgalib-1.9.25/0001-svgalib-disable-obsolete-drivers.patch
@@ -1,17 +1,16 @@
-From 60de25f20cfe9516a1cf77e717c463f4668bc264 Mon Sep 17 00:00:00 2001
From: Robert Schwebel <r.schwebel@pengutronix.de>
Date: Thu, 16 Jun 2011 15:52:02 +0200
-Subject: [PATCH 1/3] svgalib: disable obsolete drivers
+Subject: [PATCH] svgalib: disable obsolete drivers
We only use fbdev and svga drivers in ptxdist.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
- Makefile.cfg | 116 +++++++++++++++++++++++++++++-----------------------------
- 1 files changed, 58 insertions(+), 58 deletions(-)
+ Makefile.cfg | 116 +++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 58 insertions(+), 58 deletions(-)
diff --git a/Makefile.cfg b/Makefile.cfg
-index 6bc93d1..46c409c 100644
+index 6bc93d161a68..46c409c08ea5 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -151,78 +151,78 @@ INSTALLMODULE = installmodule
@@ -151,6 +150,3 @@ index 6bc93d1..46c409c 100644
#INCLUDE_FBDEV_DRIVER_TEST = y
---
-1.7.5.3
-
diff --git a/patches/svgalib-1.9.25/0002-svgalib-patch-taken-from-open-embedded.patch b/patches/svgalib-1.9.25/0002-svgalib-patch-taken-from-open-embedded.patch
index ae41680cd..098e81fd7 100644
--- a/patches/svgalib-1.9.25/0002-svgalib-patch-taken-from-open-embedded.patch
+++ b/patches/svgalib-1.9.25/0002-svgalib-patch-taken-from-open-embedded.patch
@@ -1,7 +1,6 @@
-From 0f014aa5cfea99e48365a7c9c83b192f34faf114 Mon Sep 17 00:00:00 2001
From: Robert Schwebel <r.schwebel@pengutronix.de>
Date: Thu, 16 Jun 2011 16:30:29 +0200
-Subject: [PATCH 2/3] svgalib: patch taken from open embedded
+Subject: [PATCH] svgalib: patch taken from open embedded
... with the usual bad patch quality. Needs to be cleaned up.
@@ -16,20 +15,20 @@ Subject: [PATCH 2/3] svgalib: patch taken from open embedded
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
- kernel/svgalib_helper/Makefile | 2 +-
- kernel/svgalib_helper/Makefile.alt | 9 ++--
- kernel/svgalib_helper/Makefile.alt.orig | 84 +++++++++++++++++++++++++++++++
- kernel/svgalib_helper/kernel26compat.h | 42 ++++++++++++++--
- kernel/svgalib_helper/main.c | 30 ++++++++---
- lrmi-0.6m/lrmi.c | 8 +++
- lrmi-0.9/lrmi.c | 7 +++
- src/lrmi.6.c | 7 +++
- src/lrmi.9.c | 7 +++
+ kernel/svgalib_helper/Makefile | 2 +-
+ kernel/svgalib_helper/Makefile.alt | 9 ++--
+ kernel/svgalib_helper/Makefile.alt.orig | 84 +++++++++++++++++++++++++++++++++
+ kernel/svgalib_helper/kernel26compat.h | 42 +++++++++++++++--
+ kernel/svgalib_helper/main.c | 30 ++++++++----
+ lrmi-0.6m/lrmi.c | 8 ++++
+ lrmi-0.9/lrmi.c | 7 +++
+ src/lrmi.6.c | 7 +++
+ src/lrmi.9.c | 7 +++
9 files changed, 179 insertions(+), 17 deletions(-)
create mode 100644 kernel/svgalib_helper/Makefile.alt.orig
diff --git a/kernel/svgalib_helper/Makefile b/kernel/svgalib_helper/Makefile
-index f81511e..f9f4b4c 100644
+index f81511e16b11..f9f4b4c1ab05 100644
--- a/kernel/svgalib_helper/Makefile
+++ b/kernel/svgalib_helper/Makefile
@@ -25,7 +25,7 @@ else
@@ -42,7 +41,7 @@ index f81511e..f9f4b4c 100644
ifneq ($(CLASS_SIMPLE),)
CLASS_CFLAGS = -DCLASS_SIMPLE=1
diff --git a/kernel/svgalib_helper/Makefile.alt b/kernel/svgalib_helper/Makefile.alt
-index c78c169..778a35d 100644
+index c78c1693852b..778a35dfd03e 100644
--- a/kernel/svgalib_helper/Makefile.alt
+++ b/kernel/svgalib_helper/Makefile.alt
@@ -37,7 +37,7 @@ CFLAGS += $(INCLUDES)
@@ -77,7 +76,7 @@ index c78c169..778a35d 100644
rm -f /dev/svgalib_helper* /dev/svga_helper* /dev/svga /dev/svga?
diff --git a/kernel/svgalib_helper/Makefile.alt.orig b/kernel/svgalib_helper/Makefile.alt.orig
new file mode 100644
-index 0000000..c78c169
+index 000000000000..c78c1693852b
--- /dev/null
+++ b/kernel/svgalib_helper/Makefile.alt.orig
@@ -0,0 +1,84 @@
@@ -166,7 +165,7 @@ index 0000000..c78c169
+include .depend
+endif
diff --git a/kernel/svgalib_helper/kernel26compat.h b/kernel/svgalib_helper/kernel26compat.h
-index 01c3ab7..d671e12 100644
+index 01c3ab76339f..d671e1287570 100644
--- a/kernel/svgalib_helper/kernel26compat.h
+++ b/kernel/svgalib_helper/kernel26compat.h
@@ -10,7 +10,7 @@
@@ -251,7 +250,7 @@ index 01c3ab7..d671e12 100644
+# define IRQF_SHARED SA_SHIRQ
+#endif
diff --git a/kernel/svgalib_helper/main.c b/kernel/svgalib_helper/main.c
-index 1a7cdf1..36a4e56 100644
+index 1a7cdf18363f..36a4e56341d8 100644
--- a/kernel/svgalib_helper/main.c
+++ b/kernel/svgalib_helper/main.c
@@ -1,5 +1,3 @@
@@ -342,7 +341,7 @@ index 1a7cdf1..36a4e56 100644
diff --git a/lrmi-0.6m/lrmi.c b/lrmi-0.6m/lrmi.c
-index 8ed72f6..1a48045 100644
+index 8ed72f601cb7..1a4804556fc6 100644
--- a/lrmi-0.6m/lrmi.c
+++ b/lrmi-0.6m/lrmi.c
@@ -170,6 +170,14 @@ LRMI_free_real(void *m)
@@ -361,7 +360,7 @@ index 8ed72f6..1a48045 100644
#define DEFAULT_STACK_SIZE 0x1000
#define RETURN_TO_32_INT 255
diff --git a/lrmi-0.9/lrmi.c b/lrmi-0.9/lrmi.c
-index 892a63a..a299d69 100644
+index 892a63a9b39b..a299d69fff45 100644
--- a/lrmi-0.9/lrmi.c
+++ b/lrmi-0.9/lrmi.c
@@ -203,6 +203,13 @@ LRMI_free_real(void *m)
@@ -379,7 +378,7 @@ index 892a63a..a299d69 100644
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#define DEFAULT_VM86_FLAGS (PSL_I | PSL_IOPL)
diff --git a/src/lrmi.6.c b/src/lrmi.6.c
-index 75df7df..f713172 100644
+index 75df7df6a3d7..f7131724d177 100644
--- a/src/lrmi.6.c
+++ b/src/lrmi.6.c
@@ -169,6 +169,13 @@ LRMI_free_real(void *m)
@@ -397,7 +396,7 @@ index 75df7df..f713172 100644
#define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK)
#define DEFAULT_STACK_SIZE 0x1000
diff --git a/src/lrmi.9.c b/src/lrmi.9.c
-index 09cc6ae..3a83c5b 100644
+index 09cc6ae98805..3a83c5bb97dd 100644
--- a/src/lrmi.9.c
+++ b/src/lrmi.9.c
@@ -206,6 +206,13 @@ LRMI_free_real(void *m)
@@ -414,6 +413,3 @@ index 09cc6ae..3a83c5b 100644
#define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK)
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#define DEFAULT_VM86_FLAGS (PSL_I | PSL_IOPL)
---
-1.7.5.3
-
diff --git a/patches/svgalib-1.9.25/0003-svgalib-search-also-in-local-sharedlib-dir.patch b/patches/svgalib-1.9.25/0003-svgalib-search-also-in-local-sharedlib-dir.patch
index 76e495ed2..fa5211517 100644
--- a/patches/svgalib-1.9.25/0003-svgalib-search-also-in-local-sharedlib-dir.patch
+++ b/patches/svgalib-1.9.25/0003-svgalib-search-also-in-local-sharedlib-dir.patch
@@ -1,14 +1,13 @@
-From 57639dc85bf498e6ba147f274f5608c2ab715dc8 Mon Sep 17 00:00:00 2001
From: Robert Schwebel <r.schwebel@pengutronix.de>
Date: Thu, 16 Jun 2011 16:49:07 +0200
-Subject: [PATCH 3/3] svgalib: search also in local sharedlib dir
+Subject: [PATCH] svgalib: search also in local sharedlib dir
---
- demos/Makefile | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ demos/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/demos/Makefile b/demos/Makefile
-index f7052f3..37ef13b 100644
+index f7052f399bdd..37ef13be9faa 100644
--- a/demos/Makefile
+++ b/demos/Makefile
@@ -29,7 +29,7 @@ PROGS = fun testgl speedtest mousetest vgatest scrolltest testlinear \
@@ -20,6 +19,3 @@ index f7052f3..37ef13b 100644
endif
ifndef LIBS
LIBS = ../staticlib/libvgagl.a ../staticlib/libvga.a -lm
---
-1.7.5.3
-
diff --git a/patches/svgalib-1.9.25/0004-don-t-try-to-change-ld.so.conf-or-run-ldconfig.patch b/patches/svgalib-1.9.25/0004-don-t-try-to-change-ld.so.conf-or-run-ldconfig.patch
new file mode 100644
index 000000000..f80b8ab84
--- /dev/null
+++ b/patches/svgalib-1.9.25/0004-don-t-try-to-change-ld.so.conf-or-run-ldconfig.patch
@@ -0,0 +1,24 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 27 Jan 2023 10:02:38 +0100
+Subject: [PATCH] don't try to change ld.so.conf or run ldconfig
+
+It's unnecessary and doesn't work.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Makefile | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 38a324445c9b..4c32b5046cc5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -99,8 +99,6 @@ installsharedlib: $(SHAREDLIBS) $(SVGALIBSHAREDSTUBS)
+ (cd $(sharedlibdir); \
+ ln -sf $$foo `echo $$foo | sed 's/\.so\..*/.so/'` ); \
+ done
+- @./fixldsoconf
+- -ldconfig
+
+ installstaticlib: static
+ @echo Installing static libraries in $(libdir).
diff --git a/patches/svgalib-1.9.25/series b/patches/svgalib-1.9.25/series
index 793c9dfbb..3b89a3204 100644
--- a/patches/svgalib-1.9.25/series
+++ b/patches/svgalib-1.9.25/series
@@ -1,3 +1,7 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
0001-svgalib-disable-obsolete-drivers.patch
0002-svgalib-patch-taken-from-open-embedded.patch
0003-svgalib-search-also-in-local-sharedlib-dir.patch
+0004-don-t-try-to-change-ld.so.conf-or-run-ldconfig.patch
+# 4c02c504583d93a41790c1d6e226b2b6 - git-ptx-patches magic
diff --git a/patches/tcp_wrappers_7.6/series b/patches/tcp_wrappers_7.6/series
deleted file mode 100644
index a1196b028..000000000
--- a/patches/tcp_wrappers_7.6/series
+++ /dev/null
@@ -1,2 +0,0 @@
-tcp_wrappers_7.6-ptx1.diff
-tcp_wrappers-7.6-gcc34-1.patch
diff --git a/patches/tcp_wrappers_7.6/tcp_wrappers-7.6-gcc34-1.patch b/patches/tcp_wrappers_7.6/tcp_wrappers-7.6-gcc34-1.patch
deleted file mode 100644
index 52b1e1777..000000000
--- a/patches/tcp_wrappers_7.6/tcp_wrappers-7.6-gcc34-1.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Subject: [patch] fix 'conflicting types' bug
-From: Robert Schwebel <r.schwebel@pengutronix.de>
-
-Fix this:
-
-scaffold.c:28: error: conflicting types for 'malloc'
-scaffold.c:28: error: conflicting types for 'malloc'
-
-This patch was taken from LFS:
-http://www.linuxfromscratch.org/patches/downloads/tcp_wrappers/tcp_wrappers-7.6-gcc34-1.patch
-
-Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
-
----
-
----
- scaffold.c | 1 -
- 1 file changed, 1 deletion(-)
-
-Index: tcp_wrappers_7.6/scaffold.c
-===================================================================
---- tcp_wrappers_7.6.orig/scaffold.c
-+++ tcp_wrappers_7.6/scaffold.c
-@@ -25,7 +25,6 @@ static char sccs_id[] = "@(#) scaffold.c
- #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
- #endif
-
--extern char *malloc();
-
- /* Application-specific. */
-
diff --git a/patches/tcp_wrappers_7.6/tcp_wrappers_7.6-ptx1.diff b/patches/tcp_wrappers_7.6/tcp_wrappers_7.6-ptx1.diff
deleted file mode 100644
index 41b499990..000000000
--- a/patches/tcp_wrappers_7.6/tcp_wrappers_7.6-ptx1.diff
+++ /dev/null
@@ -1,31 +0,0 @@
----
- Makefile | 2 +-
- percent_m.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-Index: tcp_wrappers_7.6/Makefile
-===================================================================
---- tcp_wrappers_7.6.orig/Makefile
-+++ tcp_wrappers_7.6/Makefile
-@@ -44,7 +44,7 @@ what:
- #REAL_DAEMON_DIR=/usr/etc
- #
- # SysV.4 Solaris 2.x OSF AIX
--#REAL_DAEMON_DIR=/usr/sbin
-+REAL_DAEMON_DIR=/usr/sbin
- #
- # BSD 4.4
- #REAL_DAEMON_DIR=/usr/libexec
-Index: tcp_wrappers_7.6/percent_m.c
-===================================================================
---- tcp_wrappers_7.6.orig/percent_m.c
-+++ tcp_wrappers_7.6/percent_m.c
-@@ -14,7 +14,7 @@ static char sccsid[] = "@(#) percent_m.c
-
- extern int errno;
- #ifndef SYS_ERRLIST_DEFINED
--extern char *sys_errlist[];
-+extern __const char *__const sys_errlist[];
- extern int sys_nerr;
- #endif
-
diff --git a/patches/thttpd-2.25b/0001-rename-getline-local_getline.patch b/patches/thttpd-2.25b/0001-rename-getline-local_getline.patch
deleted file mode 100644
index 46eff186e..000000000
--- a/patches/thttpd-2.25b/0001-rename-getline-local_getline.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Sun, 13 Feb 2011 22:47:34 +0100
-Subject: [PATCH] rename getline -> local_getline
-
-fixes a compile error with new toolchain:
-
-htpasswd.c:52:12: error: conflicting types for 'getline'
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- extras/htpasswd.c | 4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/extras/htpasswd.c b/extras/htpasswd.c
-index e01ea1d..9bcae4b 100644
---- a/extras/htpasswd.c
-+++ b/extras/htpasswd.c
-@@ -49,7 +49,7 @@ static void getword(char *word, char *line, char stop) {
- while((line[y++] = line[x++]));
- }
-
--static int getline(char *s, int n, FILE *f) {
-+static int local_getline(char *s, int n, FILE *f) {
- register int i=0;
-
- while(1) {
-@@ -189,7 +189,7 @@ int main(int argc, char *argv[]) {
- strcpy(user,argv[2]);
-
- found = 0;
-- while(!(getline(line,MAX_STRING_LEN,f))) {
-+ while(!(local_getline(line,MAX_STRING_LEN,f))) {
- if(found || (line[0] == '#') || (!line[0])) {
- putline(tfp,line);
- continue;
---
-1.7.2.3
-
diff --git a/patches/thttpd-2.25b/series b/patches/thttpd-2.25b/series
deleted file mode 100644
index b24d4dd40..000000000
--- a/patches/thttpd-2.25b/series
+++ /dev/null
@@ -1,3 +0,0 @@
-# generated by git-ptx-patches
-0001-rename-getline-local_getline.patch
-# 50452dc3179ed951c75a375716e84c73 - git-ptx-patches magic
diff --git a/patches/tree-2.1.0/0100-Makefile-Correct-prefix-handling-and-installation.patch b/patches/tree-2.1.0/0100-Makefile-Correct-prefix-handling-and-installation.patch
new file mode 100644
index 000000000..60fe88f94
--- /dev/null
+++ b/patches/tree-2.1.0/0100-Makefile-Correct-prefix-handling-and-installation.patch
@@ -0,0 +1,76 @@
+From: Christian Melki <christian.melki@t2data.com>
+Date: Wed, 4 Jan 2023 11:22:17 +0100
+Subject: [PATCH] Makefile: Correct prefix handling and installation
+
+Curly braces won't work.
+Just minimal effort variable handling cleaning.
+
+Signed-off-by: Christian Melki <christian.melki@t2data.com>
+---
+ Makefile | 19 ++++++++-----------
+ 1 file changed, 8 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 752e55002c59..2a8e2a62b068 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,10 +23,9 @@ INSTALL=install
+
+ VERSION=2.1.0
+ TREE_DEST=tree
+-DESTDIR=${PREFIX}/bin
+ MAN=tree.1
+-# Probably needs to be ${PREFIX}/share/man for most systems now
+-MANDIR=${PREFIX}/man
++BINDIR=$(PREFIX)/bin
++MANDIR=$(PREFIX)/man/man1
+ OBJS=tree.o list.o hash.o color.o file.o filter.o info.o unix.o xml.o json.o html.o strverscmp.o
+
+ # Uncomment options below for your particular OS:
+@@ -51,7 +50,6 @@ CFLAGS+=-O3 -std=c11 -pedantic -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=6
+ #CC=cc
+ #CFLAGS+=-xO0 -v
+ #LDFLAGS+=
+-#MANDIR=${prefix}/share/man
+
+ # Uncomment for Cygwin:
+ #CFLAGS+=-O2 -Wall -fomit-frame-pointer
+@@ -63,22 +61,20 @@ CFLAGS+=-O3 -std=c11 -pedantic -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=6
+ #CC=cc
+ #CFLAGS+=-O2 -Wall -fomit-frame-pointer -no-cpp-precomp
+ #LDFLAGS+=
+-#MANDIR=${PREFIX}/share/man
+
+ # Uncomment for HP/UX:
+-#prefix=/opt
++#PREFIX=/opt
+ #CC=cc
+ # manpage of mbsrtowcs() requires C99 and the two defines
+ #CFLAGS+=+w -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200112 -AC99
+ #LDFLAGS+=
+-#MANDIR=${PREFIX}/share/man
+
+ # Uncomment for OS/2:
+ #CFLAGS+=-02 -Wall -fomit-frame-pointer -Zomf -Zsmall-conv
+ #LDFLAGS+=-s -Zomf -Zsmall-conv
+
+ # Uncomment for HP NonStop:
+-#prefix = /opt
++#PREFIX=/opt
+ #CC=c89
+ #CFLAGS+=-Wextensions -WIEEE_float -g -Wnowarn=1506 -D_XOPEN_SOURCE_EXTENDED=1 \
+ # -Wallow_cplusplus_comments
+@@ -104,9 +100,10 @@ clean:
+
+ install: tree
+ $(INSTALL) -d $(DESTDIR)
+- $(INSTALL) -d $(MANDIR)/man1
+- $(INSTALL) $(TREE_DEST) $(DESTDIR)/$(TREE_DEST); \
+- $(INSTALL) -m 644 doc/$(MAN) $(MANDIR)/man1/$(MAN)
++ $(INSTALL) -d $(DESTDIR)$(BINDIR)
++ $(INSTALL) -d $(DESTDIR)$(MANDIR)
++ $(INSTALL) $(TREE_DEST) $(DESTDIR)$(BINDIR)/$(TREE_DEST)
++ $(INSTALL) -m 644 doc/$(MAN) $(DESTDIR)$(MANDIR)/$(MAN)
+
+ distclean:
+ rm -f *.o *~
diff --git a/patches/tree-2.1.0/series b/patches/tree-2.1.0/series
new file mode 100644
index 000000000..4096d016c
--- /dev/null
+++ b/patches/tree-2.1.0/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+#tag:ptx --start-number 100
+0100-Makefile-Correct-prefix-handling-and-installation.patch
+# c6afa65ff4fa8096eb1f7c44d7fc7341 - git-ptx-patches magic
diff --git a/patches/unstrung-1.11.0/0001-main-interface-needs-argument.patch b/patches/unstrung-1.11.0/0001-main-interface-needs-argument.patch
deleted file mode 100644
index 33022ead6..000000000
--- a/patches/unstrung-1.11.0/0001-main-interface-needs-argument.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Alexander Aring <aar@pengutronix.de>
-Date: Tue, 26 Apr 2016 11:25:24 +0200
-Subject: [PATCH] main: interface needs argument
-
-The interface argument needs an argument otherwise optarg is NULL.
-
-Signed-off-by: Alexander Aring <aar@pengutronix.de>
----
- programs/sunshine/main.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/programs/sunshine/main.cpp b/programs/sunshine/main.cpp
-index 2128eb616fac..b005ccf42fd9 100644
---- a/programs/sunshine/main.cpp
-+++ b/programs/sunshine/main.cpp
-@@ -34,7 +34,7 @@ char *progname;
- static struct option const longopts[] =
- {
- { "help", 0, 0, '?'},
-- { "interface", 0, 0, 'i'},
-+ { "interface", 1, 0, 'i'},
- { "daemon", 0, 0, 'D'},
- { "prefix", 1, NULL, 'p'},
- { "ignore-pio",0, NULL, 'P'},
diff --git a/patches/unstrung-1.11.0/0002-main-remove-double-dagid-entry.patch b/patches/unstrung-1.11.0/0002-main-remove-double-dagid-entry.patch
deleted file mode 100644
index 802b7ea85..000000000
--- a/patches/unstrung-1.11.0/0002-main-remove-double-dagid-entry.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Alexander Aring <aar@pengutronix.de>
-Date: Tue, 26 Apr 2016 11:25:44 +0200
-Subject: [PATCH] main: remove double dagid entry
-
-Signed-off-by: Alexander Aring <aar@pengutronix.de>
----
- programs/sunshine/main.cpp | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/programs/sunshine/main.cpp b/programs/sunshine/main.cpp
-index b005ccf42fd9..98911c888ade 100644
---- a/programs/sunshine/main.cpp
-+++ b/programs/sunshine/main.cpp
-@@ -47,7 +47,6 @@ static struct option const longopts[] =
- { "sleep", 1, NULL, OPTION_SLEEP},
- { "interval", 1, NULL, 'W'},
- { "dagid", 1, NULL, 'G'},
-- { "dagid", 1, NULL, 'G'},
- { "rank", 1, NULL, 'R'},
- { "kill", 0, 0, 'K'},
- { "verbose", 0, 0, 'v'},
diff --git a/patches/unstrung-1.11.0/series b/patches/unstrung-1.11.0/series
deleted file mode 100644
index 21a45d9af..000000000
--- a/patches/unstrung-1.11.0/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-main-interface-needs-argument.patch
-0002-main-remove-double-dagid-entry.patch
-# 248ced0a83ec2ee376156e1599d6779f - git-ptx-patches magic
diff --git a/patches/ustr-1.0.4/0001-makefile-make-it-possible-to-overwrite-binary-checks.patch b/patches/ustr-1.0.4/0001-makefile-make-it-possible-to-overwrite-binary-checks.patch
deleted file mode 100644
index 0f0b51891..000000000
--- a/patches/ustr-1.0.4/0001-makefile-make-it-possible-to-overwrite-binary-checks.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From: Wolfram Sang <w.sang@pengutronix.de>
-Date: Mon, 14 Jan 2013 13:20:11 +0100
-Subject: [PATCH] makefile: make it possible to overwrite binary checks
-
-ustr tries to determine 64bit and vsnprintf features by compiling and running
-test programs. Use value defined in ptxdist. Assume stdint.h as always there,
-as we are on linux.
-
-Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- Makefile | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 7a0f31795067..9eab99bbe19b 100644
---- a/Makefile
-+++ b/Makefile
-@@ -457,12 +457,24 @@ ustr-import: ustr-import.in autoconf_64b autoconf_vsnprintf
-
- # Use CFLAGS so that CFLAGS="... -m32" does the right thing
- autoconf_64b: autoconf_64b.c
-+ifdef SZ64
-+ $(HIDE)echo "Faking: auto configuration test: 64bit=$(SZ64)"
-+ $(HIDE)echo "echo $(SZ64)" > $@
-+ $(HIDE)chmod +x $@
-+else
- $(HIDE)echo Compiling: auto configuration test: 64bit
- $(HIDE)$(CC) $(CFLAGS) -o $@ $<
-+endif
-
- autoconf_vsnprintf: autoconf_vsnprintf.c
-+ifdef VSNP
-+ $(HIDE)echo "Faking: auto configuration test: vsnprintf=$(VSNP)"
-+ $(HIDE)echo "echo $(VSNP)" > $@
-+ $(HIDE)chmod +x $@
-+else
- $(HIDE)echo Compiling: auto configuration test: vsnprintf
- $(HIDE)$(CC) -o $@ $<
-+endif
-
- # Use LDFLAGS for LDFLAGS="-m32"
- $(OPT_LIB_SHARED): $(LIB_SHARED_OPT)
-@@ -484,7 +496,7 @@ libustr-debug.a: $(LIB_STATIC_DBG)
-
- ustr-conf.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf
- $(HIDE)echo Creating $@
-- $(HIDE)have_stdint_h=0; dbg1=0; dbg2=0; \
-+ $(HIDE)have_stdint_h=1; dbg1=0; dbg2=0; \
- sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \
- if test -f "/usr/include/stdint.h"; then have_stdint_h=1; fi; \
- if test -f "$(prefix)/include/stdint.h"; then have_stdint_h=1; fi; \
-@@ -493,7 +505,7 @@ ustr-conf.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf
-
- ustr-conf-debug.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf
- $(HIDE)echo Creating $@
-- $(HIDE)have_stdint_h=0; dbg1=1; dbg2=1; \
-+ $(HIDE)have_stdint_h=1; dbg1=1; dbg2=1; \
- sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \
- if test -f "/usr/include/stdint.h"; then have_stdint_h=1; fi; \
- if test -f "$(prefix)/include/stdint.h"; then have_stdint_h=1; fi; \
diff --git a/patches/ustr-1.0.4/0002-fixes-gnu-inline.patch b/patches/ustr-1.0.4/0002-fixes-gnu-inline.patch
deleted file mode 100644
index 6f5c7d9f5..000000000
--- a/patches/ustr-1.0.4/0002-fixes-gnu-inline.patch
+++ /dev/null
@@ -1,875 +0,0 @@
-From: =?UTF-8?q?V=C3=A1clav=20Ovs=C3=ADk?= <vaclav.ovsik@gmail.com>
-Date: Wed, 2 Dec 2015 10:00:56 +0100
-Subject: [PATCH] fixes/gnu-inline
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This patch adds `__attribute__ ((gnu_inline))' into prototype macros
-before `inline' to force GNU89 behaviour of inline functions
-in C99 mode.
-See http://www.gnu.org/software/gcc/gcc-5/porting_to.html
-
-Signed-off-by: Václav Ovsík <vaclav.ovsik@gmail.com>
----
- ustr-b-dbg-code.c | 8 ++++----
- ustr-b-opt-code.c | 8 ++++----
- ustr-cmp-dbg-code.c | 8 ++++----
- ustr-cmp-opt-code.c | 8 ++++----
- ustr-compiler.h | 4 ++--
- ustr-fmt-dbg-code.c | 8 ++++----
- ustr-fmt-opt-code.c | 8 ++++----
- ustr-ins-dbg-code.c | 8 ++++----
- ustr-ins-opt-code.c | 8 ++++----
- ustr-io-dbg-code.c | 8 ++++----
- ustr-io-opt-code.c | 8 ++++----
- ustr-main-dbg-code.c | 2 +-
- ustr-main-opt-code.c | 2 +-
- ustr-parse-dbg-code.c | 8 ++++----
- ustr-parse-opt-code.c | 8 ++++----
- ustr-pool-dbg-code.c | 8 ++++----
- ustr-pool-opt-code.c | 8 ++++----
- ustr-replace-dbg-code.c | 8 ++++----
- ustr-replace-opt-code.c | 8 ++++----
- ustr-sc-dbg-code.c | 8 ++++----
- ustr-sc-opt-code.c | 8 ++++----
- ustr-set-dbg-code.c | 8 ++++----
- ustr-set-opt-code.c | 8 ++++----
- ustr-split-dbg-code.c | 8 ++++----
- ustr-split-opt-code.c | 8 ++++----
- ustr-spn-dbg-code.c | 8 ++++----
- ustr-spn-opt-code.c | 8 ++++----
- ustr-srch-dbg-code.c | 8 ++++----
- ustr-srch-opt-code.c | 8 ++++----
- ustr-sub-dbg-code.c | 8 ++++----
- ustr-sub-opt-code.c | 8 ++++----
- ustr-utf8-dbg-code.c | 8 ++++----
- ustr-utf8-opt-code.c | 8 ++++----
- 33 files changed, 124 insertions(+), 124 deletions(-)
-
-diff --git a/ustr-b-dbg-code.c b/ustr-b-dbg-code.c
-index 4a7fdac3f68b..60e383e7db36 100644
---- a/ustr-b-dbg-code.c
-+++ b/ustr-b-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-b.h"
-diff --git a/ustr-b-opt-code.c b/ustr-b-opt-code.c
-index 45e9e87c522f..4011898e341e 100644
---- a/ustr-b-opt-code.c
-+++ b/ustr-b-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-b.h"
-diff --git a/ustr-cmp-dbg-code.c b/ustr-cmp-dbg-code.c
-index 7b8af33c0c3b..4c3adc241566 100644
---- a/ustr-cmp-dbg-code.c
-+++ b/ustr-cmp-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-cmp.h"
-diff --git a/ustr-cmp-opt-code.c b/ustr-cmp-opt-code.c
-index 2076d1cd9831..ff5d02c09b17 100644
---- a/ustr-cmp-opt-code.c
-+++ b/ustr-cmp-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-cmp.h"
-diff --git a/ustr-compiler.h b/ustr-compiler.h
-index 9e7127697db3..38ae0268c631 100644
---- a/ustr-compiler.h
-+++ b/ustr-compiler.h
-@@ -92,7 +92,7 @@
- #endif
-
- #if USTR_CONF_COMPILE_USE_INLINE
--#define USTR__INLINE inline
-+#define USTR__INLINE __attribute__ ((gnu_inline)) inline
- #else
- #define USTR__INLINE /* no inline */
- #endif
-@@ -123,7 +123,7 @@
- # if USTR_CONF_INCLUDE_CODEONLY_HEADERS
- # define USTR_CONF_II_PROTO static USTR__INLINE
- # else
--# define USTR_CONF_II_PROTO extern inline
-+# define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- # endif
- #endif
-
-diff --git a/ustr-fmt-dbg-code.c b/ustr-fmt-dbg-code.c
-index 4249bb127ee3..1f147a0e3afa 100644
---- a/ustr-fmt-dbg-code.c
-+++ b/ustr-fmt-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-fmt.h"
-diff --git a/ustr-fmt-opt-code.c b/ustr-fmt-opt-code.c
-index c73e3752ac03..989b29f24827 100644
---- a/ustr-fmt-opt-code.c
-+++ b/ustr-fmt-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-fmt.h"
-diff --git a/ustr-ins-dbg-code.c b/ustr-ins-dbg-code.c
-index 39f9bba6561d..4c6d5ea0dd8a 100644
---- a/ustr-ins-dbg-code.c
-+++ b/ustr-ins-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-fmt.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
-@@ -17,5 +17,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-ins.h"
-diff --git a/ustr-ins-opt-code.c b/ustr-ins-opt-code.c
-index 1aca8276e1e7..859b44d638ac 100644
---- a/ustr-ins-opt-code.c
-+++ b/ustr-ins-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-fmt.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
-@@ -17,5 +17,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-ins.h"
-diff --git a/ustr-io-dbg-code.c b/ustr-io-dbg-code.c
-index c361c936da01..d42e43f0286d 100644
---- a/ustr-io-dbg-code.c
-+++ b/ustr-io-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-io.h"
-diff --git a/ustr-io-opt-code.c b/ustr-io-opt-code.c
-index b1b452564237..ae8de8774eeb 100644
---- a/ustr-io-opt-code.c
-+++ b/ustr-io-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-io.h"
-diff --git a/ustr-main-dbg-code.c b/ustr-main-dbg-code.c
-index 4b821ce96788..abaa53a814cb 100644
---- a/ustr-main-dbg-code.c
-+++ b/ustr-main-dbg-code.c
-@@ -7,5 +7,5 @@
- #define USTR_CONF_E_PROTO extern
- #define USTR_CONF_I_PROTO
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
-diff --git a/ustr-main-opt-code.c b/ustr-main-opt-code.c
-index 233fb60d05c8..7ef6e988cb45 100644
---- a/ustr-main-opt-code.c
-+++ b/ustr-main-opt-code.c
-@@ -7,5 +7,5 @@
- #define USTR_CONF_E_PROTO extern
- #define USTR_CONF_I_PROTO
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
-diff --git a/ustr-parse-dbg-code.c b/ustr-parse-dbg-code.c
-index c9653afc35fa..6e1707d1082a 100644
---- a/ustr-parse-dbg-code.c
-+++ b/ustr-parse-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-parse.h"
-diff --git a/ustr-parse-opt-code.c b/ustr-parse-opt-code.c
-index 0c8df4db34ae..fc96db23d3a0 100644
---- a/ustr-parse-opt-code.c
-+++ b/ustr-parse-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-parse.h"
-diff --git a/ustr-pool-dbg-code.c b/ustr-pool-dbg-code.c
-index adf751990a8d..957f9ca65b43 100644
---- a/ustr-pool-dbg-code.c
-+++ b/ustr-pool-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-pool.h"
-diff --git a/ustr-pool-opt-code.c b/ustr-pool-opt-code.c
-index 2b0367c13022..c1b24131e03d 100644
---- a/ustr-pool-opt-code.c
-+++ b/ustr-pool-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-pool.h"
-diff --git a/ustr-replace-dbg-code.c b/ustr-replace-dbg-code.c
-index fe0218730dfc..90531ac4ad51 100644
---- a/ustr-replace-dbg-code.c
-+++ b/ustr-replace-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-set.h"
- #include "ustr-srch.h"
-@@ -19,5 +19,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-replace.h"
-diff --git a/ustr-replace-opt-code.c b/ustr-replace-opt-code.c
-index e76b3bbf0468..6232753831a4 100644
---- a/ustr-replace-opt-code.c
-+++ b/ustr-replace-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-set.h"
- #include "ustr-srch.h"
-@@ -19,5 +19,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-replace.h"
-diff --git a/ustr-sc-dbg-code.c b/ustr-sc-dbg-code.c
-index 0011c63b3074..d7ce3174d79c 100644
---- a/ustr-sc-dbg-code.c
-+++ b/ustr-sc-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-spn.h"
- #include "ustr-utf8.h"
-@@ -18,5 +18,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-sc.h"
-diff --git a/ustr-sc-opt-code.c b/ustr-sc-opt-code.c
-index 7cb81ba5d8be..4a97ed9109c9 100644
---- a/ustr-sc-opt-code.c
-+++ b/ustr-sc-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-spn.h"
- #include "ustr-utf8.h"
-@@ -18,5 +18,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-sc.h"
-diff --git a/ustr-set-dbg-code.c b/ustr-set-dbg-code.c
-index 023875ac5058..cf7707140b5a 100644
---- a/ustr-set-dbg-code.c
-+++ b/ustr-set-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-fmt.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
-@@ -17,5 +17,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-set.h"
-diff --git a/ustr-set-opt-code.c b/ustr-set-opt-code.c
-index e72688898885..34dcaf6849d0 100644
---- a/ustr-set-opt-code.c
-+++ b/ustr-set-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-fmt.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
-@@ -17,5 +17,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-set.h"
-diff --git a/ustr-split-dbg-code.c b/ustr-split-dbg-code.c
-index 03e5ca51cbfb..e40d2a599740 100644
---- a/ustr-split-dbg-code.c
-+++ b/ustr-split-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-set.h"
- #include "ustr-spn.h"
-@@ -19,5 +19,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-split.h"
-diff --git a/ustr-split-opt-code.c b/ustr-split-opt-code.c
-index d64e3003e61a..74f4b1c46327 100644
---- a/ustr-split-opt-code.c
-+++ b/ustr-split-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-set.h"
- #include "ustr-spn.h"
-@@ -19,5 +19,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-split.h"
-diff --git a/ustr-spn-dbg-code.c b/ustr-spn-dbg-code.c
-index ff97432885c7..b0b09d4dee5d 100644
---- a/ustr-spn-dbg-code.c
-+++ b/ustr-spn-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-srch.h"
- #include "ustr-utf8.h"
-@@ -18,5 +18,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-spn.h"
-diff --git a/ustr-spn-opt-code.c b/ustr-spn-opt-code.c
-index 3ff0a079bb5f..92c5ccc40a8d 100644
---- a/ustr-spn-opt-code.c
-+++ b/ustr-spn-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-srch.h"
- #include "ustr-utf8.h"
-@@ -18,5 +18,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-spn.h"
-diff --git a/ustr-srch-dbg-code.c b/ustr-srch-dbg-code.c
-index 40e4dbfb230f..0f4da216dd7f 100644
---- a/ustr-srch-dbg-code.c
-+++ b/ustr-srch-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-cmp-internal.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
-@@ -17,6 +17,6 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-srch.h"
-
-diff --git a/ustr-srch-opt-code.c b/ustr-srch-opt-code.c
-index 635464d1ab82..8dde13dde4ae 100644
---- a/ustr-srch-opt-code.c
-+++ b/ustr-srch-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-cmp-internal.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
-@@ -17,6 +17,6 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-srch.h"
-
-diff --git a/ustr-sub-dbg-code.c b/ustr-sub-dbg-code.c
-index f994716564d2..b1712e6b40e7 100644
---- a/ustr-sub-dbg-code.c
-+++ b/ustr-sub-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-fmt.h"
- #include "ustr-ins.h"
-@@ -19,5 +19,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-sub.h"
-diff --git a/ustr-sub-opt-code.c b/ustr-sub-opt-code.c
-index 8cdb4ebe741b..91780c790450 100644
---- a/ustr-sub-opt-code.c
-+++ b/ustr-sub-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #include "ustr-fmt.h"
- #include "ustr-ins.h"
-@@ -19,5 +19,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-sub.h"
-diff --git a/ustr-utf8-dbg-code.c b/ustr-utf8-dbg-code.c
-index 2666fc26f7b8..30786e991055 100644
---- a/ustr-utf8-dbg-code.c
-+++ b/ustr-utf8-dbg-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf-debug.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-utf8.h"
-diff --git a/ustr-utf8-opt-code.c b/ustr-utf8-opt-code.c
-index 91fa75401178..abdf4c0727f2 100644
---- a/ustr-utf8-opt-code.c
-+++ b/ustr-utf8-opt-code.c
-@@ -3,11 +3,11 @@
- #include "ustr-conf.h"
- #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
- #define USTR_CONF_e_PROTO extern
--#define USTR_CONF_i_PROTO extern inline
-+#define USTR_CONF_i_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_E_PROTO extern
--#define USTR_CONF_I_PROTO extern inline
-+#define USTR_CONF_I_PROTO extern __attribute__ ((gnu_inline)) inline
- #define USTR_CONF_EI_PROTO extern
--#define USTR_CONF_II_PROTO extern inline
-+#define USTR_CONF_II_PROTO extern __attribute__ ((gnu_inline)) inline
- #include "ustr-main.h"
- #undef USTR_CONF_INCLUDE_CODEONLY_HEADERS
- #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
-@@ -16,5 +16,5 @@
- #undef USTR_CONF_I_PROTO
- #define USTR_CONF_I_PROTO
- #undef USTR_CONF_II_PROTO
--#define USTR_CONF_II_PROTO inline
-+#define USTR_CONF_II_PROTO __attribute__ ((gnu_inline)) inline
- #include "ustr-utf8.h"
diff --git a/patches/ustr-1.0.4/series b/patches/ustr-1.0.4/series
deleted file mode 100644
index b4cf0691b..000000000
--- a/patches/ustr-1.0.4/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-makefile-make-it-possible-to-overwrite-binary-checks.patch
-0002-fixes-gnu-inline.patch
-# a5d3b61715d72e5bada7c2b16481b1b7 - git-ptx-patches magic
diff --git a/patches/valgrind-3.16.1/autogen.sh b/patches/valgrind-3.16.1/autogen.sh
deleted file mode 120000
index 9f8a4cb7d..000000000
--- a/patches/valgrind-3.16.1/autogen.sh
+++ /dev/null
@@ -1 +0,0 @@
-../autogen.sh \ No newline at end of file
diff --git a/patches/valgrind-3.16.1/0001-configure.ac-allow-all-arm-don-t-restrict-to-armv7.patch b/patches/valgrind-3.22.0/0001-configure.ac-allow-all-arm-don-t-restrict-to-armv7.patch
index 454fc3512..74722f044 100644
--- a/patches/valgrind-3.16.1/0001-configure.ac-allow-all-arm-don-t-restrict-to-armv7.patch
+++ b/patches/valgrind-3.22.0/0001-configure.ac-allow-all-arm-don-t-restrict-to-armv7.patch
@@ -10,10 +10,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
-index b86e802204ee..c5c1eccfe3b4 100755
+index bf024aca7374..2944d81213ae 100755
--- a/configure.ac
+++ b/configure.ac
-@@ -252,7 +252,7 @@ case "${host_cpu}" in
+@@ -271,7 +271,7 @@ case "${host_cpu}" in
ARCH_MAX="s390x"
;;
diff --git a/patches/valgrind-3.16.1/0002-make-kernel-version-a-autoconf-cache-variable.patch b/patches/valgrind-3.22.0/0002-make-kernel-version-a-autoconf-cache-variable.patch
index d1fc29d46..996320e74 100644
--- a/patches/valgrind-3.16.1/0002-make-kernel-version-a-autoconf-cache-variable.patch
+++ b/patches/valgrind-3.22.0/0002-make-kernel-version-a-autoconf-cache-variable.patch
@@ -8,10 +8,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
-index c5c1eccfe3b4..54518bfa0cc5 100755
+index 2944d81213ae..baa13198cecf 100755
--- a/configure.ac
+++ b/configure.ac
-@@ -345,16 +345,17 @@ case "${host_os}" in
+@@ -364,16 +364,17 @@ case "${host_os}" in
# Ok, this is linux. Check the kernel version
AC_MSG_CHECKING([for the kernel version])
diff --git a/patches/mobile-broadband-provider-info-20190618/autogen.sh b/patches/valgrind-3.22.0/autogen.sh
index 9f8a4cb7d..9f8a4cb7d 120000
--- a/patches/mobile-broadband-provider-info-20190618/autogen.sh
+++ b/patches/valgrind-3.22.0/autogen.sh
diff --git a/patches/valgrind-3.16.1/series b/patches/valgrind-3.22.0/series
index ce22fcaa7..ce22fcaa7 100644
--- a/patches/valgrind-3.16.1/series
+++ b/patches/valgrind-3.22.0/series
diff --git a/patches/vkrunner-2023-10-29-g93cbb7b1cca7/0001-Add-Cargo.lock.patch b/patches/vkrunner-2023-10-29-g93cbb7b1cca7/0001-Add-Cargo.lock.patch
new file mode 100644
index 000000000..5258acb97
--- /dev/null
+++ b/patches/vkrunner-2023-10-29-g93cbb7b1cca7/0001-Add-Cargo.lock.patch
@@ -0,0 +1,460 @@
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Fri, 8 Mar 2024 11:08:17 +0100
+Subject: [PATCH] Add Cargo.lock
+
+Add missing Cargo.lock.
+---
+ Cargo.lock | 444 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 444 insertions(+)
+ create mode 100644 Cargo.lock
+
+diff --git a/Cargo.lock b/Cargo.lock
+new file mode 100644
+index 000000000000..cfa55bc79c86
+--- /dev/null
++++ b/Cargo.lock
+@@ -0,0 +1,444 @@
++# This file is automatically @generated by Cargo.
++# It is not intended for manual editing.
++version = 3
++
++[[package]]
++name = "aho-corasick"
++version = "1.1.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
++dependencies = [
++ "memchr",
++]
++
++[[package]]
++name = "bindgen"
++version = "0.66.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"
++dependencies = [
++ "bitflags",
++ "cexpr",
++ "clang-sys",
++ "lazy_static",
++ "lazycell",
++ "log",
++ "peeking_take_while",
++ "prettyplease",
++ "proc-macro2",
++ "quote",
++ "regex",
++ "rustc-hash",
++ "shlex",
++ "syn",
++ "which",
++]
++
++[[package]]
++name = "bitflags"
++version = "2.4.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
++
++[[package]]
++name = "cexpr"
++version = "0.6.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
++dependencies = [
++ "nom",
++]
++
++[[package]]
++name = "cfg-if"
++version = "1.0.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
++
++[[package]]
++name = "clang-sys"
++version = "1.6.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
++dependencies = [
++ "glob",
++ "libc",
++ "libloading",
++]
++
++[[package]]
++name = "either"
++version = "1.9.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
++
++[[package]]
++name = "errno"
++version = "0.3.8"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
++dependencies = [
++ "libc",
++ "windows-sys 0.52.0",
++]
++
++[[package]]
++name = "glob"
++version = "0.3.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
++
++[[package]]
++name = "home"
++version = "0.5.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb"
++dependencies = [
++ "windows-sys 0.48.0",
++]
++
++[[package]]
++name = "lazy_static"
++version = "1.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
++
++[[package]]
++name = "lazycell"
++version = "1.3.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
++
++[[package]]
++name = "libc"
++version = "0.2.150"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
++
++[[package]]
++name = "libloading"
++version = "0.7.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
++dependencies = [
++ "cfg-if",
++ "winapi",
++]
++
++[[package]]
++name = "linux-raw-sys"
++version = "0.4.11"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829"
++
++[[package]]
++name = "log"
++version = "0.4.20"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
++
++[[package]]
++name = "memchr"
++version = "2.6.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
++
++[[package]]
++name = "minimal-lexical"
++version = "0.2.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
++
++[[package]]
++name = "nom"
++version = "7.1.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
++dependencies = [
++ "memchr",
++ "minimal-lexical",
++]
++
++[[package]]
++name = "once_cell"
++version = "1.18.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
++
++[[package]]
++name = "peeking_take_while"
++version = "0.1.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
++
++[[package]]
++name = "prettyplease"
++version = "0.2.15"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d"
++dependencies = [
++ "proc-macro2",
++ "syn",
++]
++
++[[package]]
++name = "proc-macro2"
++version = "1.0.70"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
++dependencies = [
++ "unicode-ident",
++]
++
++[[package]]
++name = "quote"
++version = "1.0.33"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
++dependencies = [
++ "proc-macro2",
++]
++
++[[package]]
++name = "regex"
++version = "1.10.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
++dependencies = [
++ "aho-corasick",
++ "memchr",
++ "regex-automata",
++ "regex-syntax",
++]
++
++[[package]]
++name = "regex-automata"
++version = "0.4.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
++dependencies = [
++ "aho-corasick",
++ "memchr",
++ "regex-syntax",
++]
++
++[[package]]
++name = "regex-syntax"
++version = "0.8.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
++
++[[package]]
++name = "rustc-hash"
++version = "1.1.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
++
++[[package]]
++name = "rustix"
++version = "0.38.25"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e"
++dependencies = [
++ "bitflags",
++ "errno",
++ "libc",
++ "linux-raw-sys",
++ "windows-sys 0.48.0",
++]
++
++[[package]]
++name = "shlex"
++version = "1.2.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380"
++
++[[package]]
++name = "syn"
++version = "2.0.39"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "unicode-ident",
++]
++
++[[package]]
++name = "unicode-ident"
++version = "1.0.12"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
++
++[[package]]
++name = "vkrunner"
++version = "0.1.0"
++dependencies = [
++ "bindgen",
++]
++
++[[package]]
++name = "which"
++version = "4.4.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
++dependencies = [
++ "either",
++ "home",
++ "once_cell",
++ "rustix",
++]
++
++[[package]]
++name = "winapi"
++version = "0.3.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
++dependencies = [
++ "winapi-i686-pc-windows-gnu",
++ "winapi-x86_64-pc-windows-gnu",
++]
++
++[[package]]
++name = "winapi-i686-pc-windows-gnu"
++version = "0.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
++
++[[package]]
++name = "winapi-x86_64-pc-windows-gnu"
++version = "0.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
++
++[[package]]
++name = "windows-sys"
++version = "0.48.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
++dependencies = [
++ "windows-targets 0.48.5",
++]
++
++[[package]]
++name = "windows-sys"
++version = "0.52.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
++dependencies = [
++ "windows-targets 0.52.0",
++]
++
++[[package]]
++name = "windows-targets"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
++dependencies = [
++ "windows_aarch64_gnullvm 0.48.5",
++ "windows_aarch64_msvc 0.48.5",
++ "windows_i686_gnu 0.48.5",
++ "windows_i686_msvc 0.48.5",
++ "windows_x86_64_gnu 0.48.5",
++ "windows_x86_64_gnullvm 0.48.5",
++ "windows_x86_64_msvc 0.48.5",
++]
++
++[[package]]
++name = "windows-targets"
++version = "0.52.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
++dependencies = [
++ "windows_aarch64_gnullvm 0.52.0",
++ "windows_aarch64_msvc 0.52.0",
++ "windows_i686_gnu 0.52.0",
++ "windows_i686_msvc 0.52.0",
++ "windows_x86_64_gnu 0.52.0",
++ "windows_x86_64_gnullvm 0.52.0",
++ "windows_x86_64_msvc 0.52.0",
++]
++
++[[package]]
++name = "windows_aarch64_gnullvm"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
++
++[[package]]
++name = "windows_aarch64_gnullvm"
++version = "0.52.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
++
++[[package]]
++name = "windows_aarch64_msvc"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
++
++[[package]]
++name = "windows_aarch64_msvc"
++version = "0.52.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
++
++[[package]]
++name = "windows_i686_gnu"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
++
++[[package]]
++name = "windows_i686_gnu"
++version = "0.52.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
++
++[[package]]
++name = "windows_i686_msvc"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
++
++[[package]]
++name = "windows_i686_msvc"
++version = "0.52.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
++
++[[package]]
++name = "windows_x86_64_gnu"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
++
++[[package]]
++name = "windows_x86_64_gnu"
++version = "0.52.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
++
++[[package]]
++name = "windows_x86_64_gnullvm"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
++
++[[package]]
++name = "windows_x86_64_gnullvm"
++version = "0.52.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
++
++[[package]]
++name = "windows_x86_64_msvc"
++version = "0.48.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
++
++[[package]]
++name = "windows_x86_64_msvc"
++version = "0.52.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
diff --git a/patches/vkrunner-2023-10-29-g93cbb7b1cca7/series b/patches/vkrunner-2023-10-29-g93cbb7b1cca7/series
new file mode 100644
index 000000000..3b863cc9f
--- /dev/null
+++ b/patches/vkrunner-2023-10-29-g93cbb7b1cca7/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Add-Cargo.lock.patch
+# 7f2fb2f3edeebbcf0cc685b2b48b1f36 - git-ptx-patches magic
diff --git a/patches/weston-13.0.1/0001-HACK-don-t-build-tests.patch b/patches/weston-13.0.1/0001-HACK-don-t-build-tests.patch
new file mode 100644
index 000000000..5a24e11b1
--- /dev/null
+++ b/patches/weston-13.0.1/0001-HACK-don-t-build-tests.patch
@@ -0,0 +1,23 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 26 May 2023 11:41:19 +0200
+Subject: [PATCH] HACK: don't build tests
+
+The tests can introduce additional dependencies (e.g. xcb-cursor for xwayland)
+that are not otherwise needed. The tests are not used in ptxdist anyways, so
+just don't build them.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ tests/meson.build | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/meson.build b/tests/meson.build
+index 1d59a93e121c..b7c4412bfdf8 100644
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -1,3 +1,5 @@
++subdir_done()
++
+ plugin_test_shell_desktop = shared_library(
+ 'weston-test-desktop-shell',
+ 'weston-test-desktop-shell.c',
diff --git a/patches/weston-13.0.1/series b/patches/weston-13.0.1/series
new file mode 100644
index 000000000..a5dc0b485
--- /dev/null
+++ b/patches/weston-13.0.1/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-HACK-don-t-build-tests.patch
+# 4082f10e9dae6df168955b4fa61a61b3 - git-ptx-patches magic
diff --git a/patches/xf86-input-tslib-0.0.6/0001-fix-segfault.patch b/patches/xf86-input-tslib-0.0.6/0001-fix-segfault.patch
deleted file mode 100644
index aa2b747c5..000000000
--- a/patches/xf86-input-tslib-0.0.6/0001-fix-segfault.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 14 Jun 2012 23:27:04 +0200
-Subject: [PATCH] fix segfault
-
-Based on a patch from Debian.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/tslib.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/src/tslib.c b/src/tslib.c
-index 08923b2..065e6cf 100644
---- a/src/tslib.c
-+++ b/src/tslib.c
-@@ -103,8 +103,6 @@ KeyControlProc(DeviceIntPtr pDev, KeybdCtrl * ctrl)
- static void
- PointerControlProc(DeviceIntPtr dev, PtrCtrl * ctrl)
- {
-- ErrorF("%s\n", __FUNCTION__);
-- return;
- }
-
- static Bool
-@@ -406,6 +404,8 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
- xf86MotionHistoryAllocate(pInfo);
- #endif
-
-+ if (!InitPtrFeedbackClassDeviceStruct(device, PointerControlProc))
-+ return !Success;
- break;
-
- case DEVICE_ON:
-@@ -435,6 +435,7 @@ xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
- xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
- ts_close(priv->ts);
- xfree(pInfo->private);
-+ pInfo->private = NULL;
- xf86DeleteInput(pInfo, 0);
- }
-
diff --git a/patches/xf86-input-tslib-0.0.6/0002-add-support-for-ABI-12.patch b/patches/xf86-input-tslib-0.0.6/0002-add-support-for-ABI-12.patch
deleted file mode 100644
index 9275daea3..000000000
--- a/patches/xf86-input-tslib-0.0.6/0002-add-support-for-ABI-12.patch
+++ /dev/null
@@ -1,213 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 14 Jun 2012 23:27:43 +0200
-Subject: [PATCH] add support for ABI 12
-
-Based on the patch from Debian.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/tslib.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++------------
- 1 file changed, 67 insertions(+), 16 deletions(-)
-
-diff --git a/src/tslib.c b/src/tslib.c
-index 065e6cf..0446148 100644
---- a/src/tslib.c
-+++ b/src/tslib.c
-@@ -69,6 +69,13 @@
- #define DEFAULT_HEIGHT 240
- #define DEFAULT_WIDTH 320
-
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
-+#define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options), NULL)
-+#else
-+#define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options))
-+#endif
-+
-+
- enum { TSLIB_ROTATE_NONE=0, TSLIB_ROTATE_CW=270, TSLIB_ROTATE_UD=180, TSLIB_ROTATE_CCW=90 };
-
- enum button_state { BUTTON_NOT_PRESSED = 0, BUTTON_1_PRESSED = 1, BUTTON_3_CLICK = 3, BUTTON_3_CLICKED=4, BUTTON_EMULATION_OFF=-1 };
-@@ -106,7 +113,7 @@ PointerControlProc(DeviceIntPtr dev, PtrCtrl * ctrl)
- }
-
- static Bool
--ConvertProc( LocalDevicePtr local,
-+ConvertProc( InputInfoPtr local,
- int first,
- int num,
- int v0,
-@@ -135,7 +142,7 @@ struct timeval TimevalDiff(struct timeval a, struct timeval b)
- return t;
- }
-
--static void ReadInput (LocalDevicePtr local)
-+static void ReadInput (InputInfoPtr local)
- {
- struct ts_priv *priv = (struct ts_priv *) (local->private);
- struct ts_sample samp;
-@@ -382,7 +389,11 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
- axiswidth - 1, /* max val */
- axiswidth, /* resolution */
- 0, /* min_res */
-- axiswidth); /* max_res */
-+ axiswidth /* max_res */
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
-+ ,Absolute
-+#endif
-+ );
-
- InitValuatorAxisStruct(device, 1,
- #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
-@@ -392,7 +403,11 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
- axisheight - 1, /* max val */
- axisheight, /* resolution */
- 0, /* min_res */
-- axisheight); /* max_res */
-+ axisheight /* max_res */
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
-+ ,Absolute
-+#endif
-+ );
-
- if (InitProximityClassDeviceStruct (device) == FALSE) {
- ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n");
-@@ -434,7 +449,7 @@ xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
- ErrorF("%s\n", __FUNCTION__);
- xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
- ts_close(priv->ts);
-- xfree(pInfo->private);
-+ free(pInfo->private);
- pInfo->private = NULL;
- xf86DeleteInput(pInfo, 0);
- }
-@@ -444,47 +459,61 @@ xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
- *
- * called when the module subsection is found in XF86Config
- */
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
-+static int
-+xf86TslibInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
-+#else
- static InputInfoPtr
- xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
-+#endif
- {
- struct ts_priv *priv;
- char *s;
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
- InputInfoPtr pInfo;
-+#endif
-
-- priv = xcalloc (1, sizeof (struct ts_priv));
-+ priv = calloc (1, sizeof (struct ts_priv));
- if (!priv)
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
- return NULL;
-+#else
-+ return BadValue;
-+#endif
-
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
- if (!(pInfo = xf86AllocateInput(drv, 0))) {
-- xfree(priv);
-+ free(priv);
- return NULL;
- }
-
- /* Initialise the InputInfoRec. */
- pInfo->name = dev->identifier;
-- pInfo->type_name = XI_TOUCHSCREEN;
- pInfo->flags =
- XI86_KEYBOARD_CAPABLE | XI86_POINTER_CAPABLE |
- XI86_SEND_DRAG_EVENTS;
-- pInfo->device_control = xf86TslibControlProc;
-- pInfo->read_input = ReadInput;
- #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
- pInfo->motion_history_proc = xf86GetMotionEvents;
- pInfo->history_size = 0;
- #endif
-- pInfo->control_proc = NULL;
-+ pInfo->conf_idev = dev;
- pInfo->close_proc = NULL;
-- pInfo->switch_mode = NULL;
- pInfo->conversion_proc = ConvertProc;
- pInfo->reverse_conversion_proc = NULL;
-- pInfo->dev = NULL;
- pInfo->private_flags = 0;
- pInfo->always_core_feedback = 0;
-- pInfo->conf_idev = dev;
-+#endif
-+
-+ pInfo->type_name = XI_TOUCHSCREEN;
-+ pInfo->control_proc = NULL;
-+ pInfo->read_input = ReadInput;
-+ pInfo->device_control = xf86TslibControlProc;
-+ pInfo->switch_mode = NULL;
- pInfo->private = priv;
-+ pInfo->dev = NULL;
-
- /* Collect the options, and process the common options. */
-- xf86CollectInputOptions(pInfo, NULL, NULL);
-+ COLLECT_INPUT_OPTIONS(pInfo, NULL);
- xf86ProcessCommonOptions(pInfo, pInfo->options);
-
- priv->screen_num = xf86SetIntOption(pInfo->options, "ScreenNumber", 0 );
-@@ -510,23 +539,39 @@ xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
- priv->rotate = TSLIB_ROTATE_NONE;
- }
-
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
- s = xf86CheckStrOption(dev->commonOptions, "path", NULL);
-+#else
-+ s = xf86CheckStrOption(pInfo->options, "path", NULL);
-+#endif
- if (!s)
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
- s = xf86CheckStrOption(dev->commonOptions, "Device", NULL);
-+#else
-+ s = xf86CheckStrOption(pInfo->options, "Device", NULL);
-+#endif
-
- priv->ts = ts_open(s, 1);
-- xfree(s);
-+ free(s);
-
- if (!priv->ts) {
- ErrorF("ts_open failed (device=%s)\n",s);
- xf86DeleteInput(pInfo, 0);
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
- return NULL;
-+#else
-+ return BadValue;
-+#endif
- }
-
- if (ts_config(priv->ts)) {
- ErrorF("ts_config failed\n");
- xf86DeleteInput(pInfo, 0);
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
- return NULL;
-+#else
-+ return BadValue;
-+#endif
- }
-
- pInfo->fd = ts_fd(priv->ts);
-@@ -536,11 +581,17 @@ xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
- priv->state = BUTTON_EMULATION_OFF;
- }
-
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
- /* Mark the device configured */
- pInfo->flags |= XI86_CONFIGURED;
-+#endif
-
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
- /* Return the configured device */
- return (pInfo);
-+#else
-+ return Success;
-+#endif
- }
-
- _X_EXPORT InputDriverRec TSLIB = {
diff --git a/patches/xf86-input-tslib-0.0.6/0003-fix-name-collision-with-Xorg-macro.patch b/patches/xf86-input-tslib-0.0.6/0003-fix-name-collision-with-Xorg-macro.patch
deleted file mode 100644
index 0795ac398..000000000
--- a/patches/xf86-input-tslib-0.0.6/0003-fix-name-collision-with-Xorg-macro.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Mon, 18 Jun 2012 09:25:09 +0200
-Subject: [PATCH] fix name collision with Xorg macro
-
-If xorg-server is compiled with --enable-tslib (for kdrive) then
-xorg-server.h contains '#define TSLIB 1'.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- src/tslib.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/tslib.c b/src/tslib.c
-index 0446148..4824fc4 100644
---- a/src/tslib.c
-+++ b/src/tslib.c
-@@ -594,7 +594,7 @@ xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
- #endif
- }
-
--_X_EXPORT InputDriverRec TSLIB = {
-+_X_EXPORT InputDriverRec TSLIB_REC = {
- 1, /* driver version */
- "tslib", /* driver name */
- NULL, /* identify */
-@@ -631,7 +631,7 @@ static pointer xf86TslibPlug(pointer module, pointer options, int *errmaj, int *
- {
- static Bool Initialised = FALSE;
-
-- xf86AddInputDriver(&TSLIB, module, 0);
-+ xf86AddInputDriver(&TSLIB_REC, module, 0);
-
- return module;
- }
diff --git a/patches/xf86-input-tslib-0.0.6/series b/patches/xf86-input-tslib-0.0.6/series
deleted file mode 100644
index 18216ee47..000000000
--- a/patches/xf86-input-tslib-0.0.6/series
+++ /dev/null
@@ -1,6 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-fix-segfault.patch
-0002-add-support-for-ABI-12.patch
-0003-fix-name-collision-with-Xorg-macro.patch
-# fd8f57a2d8b01331dcdfb70b7bf274a4 - git-ptx-patches magic
diff --git a/patches/xf86-video-fbdev-0.5.0/0001-xf86-video-fbdev-add-option-to-leave-timings-alone.patch b/patches/xf86-video-fbdev-0.5.0/0001-xf86-video-fbdev-add-option-to-leave-timings-alone.patch
deleted file mode 100644
index 58e97918f..000000000
--- a/patches/xf86-video-fbdev-0.5.0/0001-xf86-video-fbdev-add-option-to-leave-timings-alone.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Sascha Hauer <s.hauer@pengutronix.de>
-Date: Fri, 8 Aug 2014 14:47:18 +0200
-Subject: [PATCH] xf86-video-fbdev: add option to leave timings alone
-
-Xorg tries to set the timing values in the framebuffer device. Add an
-option to tell X to leave the timing values untouched.
-
-Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
----
- src/fbdev.c | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/src/fbdev.c b/src/fbdev.c
-index f25ef72204f0..35a3c60f7835 100644
---- a/src/fbdev.c
-+++ b/src/fbdev.c
-@@ -125,6 +125,7 @@ typedef enum {
- OPTION_SHADOW_FB,
- OPTION_ROTATE,
- OPTION_FBDEV,
-+ OPTION_DONT_SET_TIMING,
- OPTION_DEBUG
- } FBDevOpts;
-
-@@ -132,6 +133,7 @@ static const OptionInfoRec FBDevOptions[] = {
- { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE },
- { OPTION_FBDEV, "fbdev", OPTV_STRING, {0}, FALSE },
-+ { OPTION_DONT_SET_TIMING, "DontSetTiming", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_DEBUG, "debug", OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE }
- };
-@@ -589,9 +591,11 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
- }
-
- /* select video modes */
--
-- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "checking modes against framebuffer device...\n");
-- fbdevHWSetVideoModes(pScrn);
-+ if( xf86ReturnOptValBool(fPtr->Options, OPTION_DONT_SET_TIMING, FALSE) == FALSE ) {
-+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "checking modes against framebuffer device...\n");
-+ fbdevHWSetVideoModes(pScrn);
-+ } else
-+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ignoring fb timing settings.");
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "checking modes against monitor...\n");
- {
diff --git a/patches/xf86-video-fbdev-0.5.0/0002-Fix-build-error-when-building-with-xserver-built-usi.patch b/patches/xf86-video-fbdev-0.5.0/0002-Fix-build-error-when-building-with-xserver-built-usi.patch
deleted file mode 100644
index 570cef6ca..000000000
--- a/patches/xf86-video-fbdev-0.5.0/0002-Fix-build-error-when-building-with-xserver-built-usi.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Tuomo Rinne <tuomo.rinne@pm.me>
-Date: Mon, 14 Jan 2019 22:33:42 +0000
-Subject: [PATCH] Fix build error when building with xserver built using meson
-
----
- src/fbdev.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/fbdev.c b/src/fbdev.c
-index 35a3c60f7835..78c27f92f777 100644
---- a/src/fbdev.c
-+++ b/src/fbdev.c
-@@ -1014,7 +1014,7 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
- fPtr->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = FBDevCloseScreen;
-
--#if XV
-+#ifdef XV
- {
- XF86VideoAdaptorPtr *ptr;
-
diff --git a/patches/xf86-video-fbdev-0.5.0/series b/patches/xf86-video-fbdev-0.5.0/series
deleted file mode 100644
index e73c99134..000000000
--- a/patches/xf86-video-fbdev-0.5.0/series
+++ /dev/null
@@ -1,5 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-xf86-video-fbdev-add-option-to-leave-timings-alone.patch
-0002-Fix-build-error-when-building-with-xserver-built-usi.patch
-# bc6c6b007eeb8b7f989816469a5faa45 - git-ptx-patches magic
diff --git a/patches/xf86-video-intel-2.99.917-892-gc6cb1b199598/autogen.sh b/patches/xf86-video-intel-2.99.917-892-gc6cb1b199598/autogen.sh
deleted file mode 120000
index 9f8a4cb7d..000000000
--- a/patches/xf86-video-intel-2.99.917-892-gc6cb1b199598/autogen.sh
+++ /dev/null
@@ -1 +0,0 @@
-../autogen.sh \ No newline at end of file
diff --git a/patches/xorg-server-1.20.10/0001-xf86bigfont-always-include-unistd.h.patch b/patches/xorg-server-1.20.10/0001-xf86bigfont-always-include-unistd.h.patch
deleted file mode 100644
index f34b1eb18..000000000
--- a/patches/xorg-server-1.20.10/0001-xf86bigfont-always-include-unistd.h.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 28 May 2015 23:47:37 +0200
-Subject: [PATCH] xf86bigfont: always include unistd.h
-
-Otherwise compiling can fail with:
-
-xf86bigfont.c: In function 'ProcXF86BigfontQueryVersion':
-xf86bigfont.c:287:9: error: implicit declaration of function 'geteuid' [-Werror=implicit-function-declaration]
-xf86bigfont.c:287:9: warning: nested extern declaration of 'geteuid' [-Wnested-externs]
-xf86bigfont.c:288:9: error: implicit declaration of function 'getegid' [-Werror=implicit-function-declaration]
-xf86bigfont.c:288:9: warning: nested extern declaration of 'getegid' [-Wnested-externs]
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- Xext/xf86bigfont.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
-index 529595bb7544..91c733c86fcd 100644
---- a/Xext/xf86bigfont.c
-+++ b/Xext/xf86bigfont.c
-@@ -39,6 +39,7 @@
- #endif
-
- #include <sys/types.h>
-+#include <unistd.h>
- #ifdef HAS_SHM
- #ifdef SVR4
- #include <sys/sysmacros.h>
-@@ -51,7 +52,6 @@
- #include <sys/shm.h>
- #include <sys/stat.h>
- #include <stdlib.h>
--#include <unistd.h>
- #include <time.h>
- #include <errno.h>
- #endif
diff --git a/patches/xorg-server-1.20.10/series b/patches/xorg-server-1.20.10/series
deleted file mode 100644
index 47238ab69..000000000
--- a/patches/xorg-server-1.20.10/series
+++ /dev/null
@@ -1,4 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-xf86bigfont-always-include-unistd.h.patch
-# 25545eb055796221183d2418bb8d79dc - git-ptx-patches magic