aboutsummaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/Config.in24
-rw-r--r--package/Config.in.host2
-rw-r--r--package/Makefile.in3
-rw-r--r--package/abootimg/Config.in2
-rw-r--r--package/abootimg/abootimg.hash2
-rw-r--r--package/abootimg/abootimg.mk5
-rw-r--r--package/acpid/acpid.mk2
-rw-r--r--package/aircrack-ng/Config.in1
-rw-r--r--package/alsa-lib/0002-dlmisc-the-snd_plugin_dir_set.patch34
-rw-r--r--package/alsa-lib/0002-fix-build-with-disable-ucm.patch43
-rw-r--r--package/alsa-lib/0003-control-empty-fix-the-static-build.patch29
-rw-r--r--package/alsa-lib/alsa-lib.hash2
-rw-r--r--package/alsa-lib/alsa-lib.mk2
-rw-r--r--package/alsa-plugins/Config.in8
-rw-r--r--package/alsa-plugins/alsa-plugins.hash4
-rw-r--r--package/alsa-plugins/alsa-plugins.mk32
-rw-r--r--package/apache/0004-server-log.c-ap_log_pid-Use-a-temporary-file-then-re.patch77
-rw-r--r--package/apache/apache.hash4
-rw-r--r--package/apache/apache.mk5
-rw-r--r--package/apcupsd/apcupsd.mk1
-rw-r--r--package/apg/Config.in6
-rw-r--r--package/apg/apg.hash3
-rw-r--r--package/apg/apg.mk21
-rw-r--r--package/apitrace/0001-dlsym-Fix-build-under-uClibc.patch31
-rw-r--r--package/apitrace/0001-thirdparty-libbacktrace-backtrace-h-include-config.h.patch40
-rw-r--r--package/apitrace/0002-Support-libc-that-don-t-have-RTLD_DEEPBIND.patch25
-rw-r--r--package/apitrace/0003-CMakeLists.txt-respect-BUILD_TESTING-OFF.patch104
-rw-r--r--package/apitrace/Config.in6
-rw-r--r--package/apitrace/apitrace.hash4
-rw-r--r--package/apitrace/apitrace.mk2
-rw-r--r--package/apr-util/apr-util.mk12
-rw-r--r--package/assimp/0002-closes-2733-update-of-zlip-to-fix-gcc-build-for-v9-2-0-32-bit.patch1638
-rw-r--r--package/assimp/0002-contrib-zip-fix-ssize_t-typedef-mismatch-for-musl-co.patch50
-rw-r--r--package/assimp/0003-closes-2954-upgrade-to-latest-greatest.patch243
-rw-r--r--package/assimp/0003-contrib-zlib-disable-dynamic-library-building.patch31
-rw-r--r--package/assimp/Config.in5
-rw-r--r--package/assimp/assimp.mk3
-rw-r--r--package/audit/0001-Fix-audispd-path-in-auditd.conf.patch32
-rw-r--r--package/audit/0002-Add-substitue-functions-for-strndupa-rawmemchr.patch133
-rw-r--r--package/audit/0003-Header-definitions-need-to-be-external-when-building.patch28
-rw-r--r--package/audit/S02auditd4
-rw-r--r--package/audit/audit.hash6
-rw-r--r--package/audit/audit.mk2
-rw-r--r--package/avahi/0001-Fix-NULL-pointer-crashes-from-175.patch152
-rw-r--r--package/avahi/avahi.mk4
-rw-r--r--package/batman-adv/batman-adv.hash4
-rw-r--r--package/batman-adv/batman-adv.mk2
-rw-r--r--package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch33
-rw-r--r--package/bind/bind.mk1
-rw-r--r--package/binutils/2.32/0010-bfd-elf32-or1k-fix-ld-assert.patch35
-rw-r--r--package/binutils/2.32/0010-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch59
-rw-r--r--package/binutils/2.32/0011-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch256
-rw-r--r--package/binutils/2.32/0012-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch61
-rw-r--r--package/binutils/2.32/0013-or1k-Support-large-plt_relocs-when-generating-plt-en.patch500
-rw-r--r--package/binutils/2.32/0014-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch50
-rw-r--r--package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch59
-rw-r--r--package/binutils/2.34/0003-bfd-elf32-or1k-fix-ld-assert.patch35
-rw-r--r--package/binutils/2.34/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch59
-rw-r--r--package/binutils/2.34/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch256
-rw-r--r--package/binutils/2.34/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch61
-rw-r--r--package/binutils/2.34/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch500
-rw-r--r--package/binutils/2.34/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch50
-rw-r--r--package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch59
-rw-r--r--package/binutils/2.35.2/0003-bfd-elf32-or1k-fix-ld-assert.patch35
-rw-r--r--package/binutils/2.35.2/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch59
-rw-r--r--package/binutils/2.35.2/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch256
-rw-r--r--package/binutils/2.35.2/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch61
-rw-r--r--package/binutils/2.35.2/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch500
-rw-r--r--package/binutils/2.35.2/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch50
-rw-r--r--package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch59
-rw-r--r--package/binutils/2.36.1/0003-bfd-elf32-or1k-fix-ld-assert.patch35
-rw-r--r--package/binutils/2.36.1/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch59
-rw-r--r--package/binutils/2.36.1/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch256
-rw-r--r--package/binutils/2.36.1/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch61
-rw-r--r--package/binutils/2.36.1/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch500
-rw-r--r--package/binutils/2.36.1/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch50
-rw-r--r--package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch59
-rw-r--r--package/bird/0001-Nest-Fix-build-without-protocols.patch28
-rw-r--r--package/bird/0002-Added-missing-extern.patch34
-rw-r--r--package/bird/Config.in5
-rw-r--r--package/bird/bird.hash4
-rw-r--r--package/bird/bird.mk12
-rw-r--r--package/bitcoin/bitcoin.hash4
-rw-r--r--package/bitcoin/bitcoin.mk2
-rw-r--r--package/blktrace/0001-btt-make-device-devno-use-PATH_MAX-to-avoid-overflow.patch146
-rw-r--r--package/blktrace/blktrace.hash6
-rw-r--r--package/blktrace/blktrace.mk7
-rw-r--r--package/bluez-alsa/Config.in6
-rw-r--r--package/bluez-alsa/bluez-alsa.hash2
-rw-r--r--package/bluez-alsa/bluez-alsa.mk2
-rw-r--r--package/bluez5_utils-headers/bluez5_utils-headers.mk2
-rw-r--r--package/bluez5_utils/0001-tools-mesh-cfgtest-include-limits.h.patch33
-rw-r--r--package/bluez5_utils/Config.in51
-rw-r--r--package/bluez5_utils/bluez5_utils.hash3
-rw-r--r--package/bluez5_utils/bluez5_utils.mk3
-rw-r--r--package/bmap-tools/Config.in44
-rw-r--r--package/bmap-tools/Config.in.host12
-rw-r--r--package/bmap-tools/bmap-tools.hash3
-rw-r--r--package/bmap-tools/bmap-tools.mk14
-rw-r--r--package/boinc/boinc.mk1
-rw-r--r--package/boost/0002-src-event-cpp-fix-build-on-riscv32.patch42
-rw-r--r--package/boost/boost.mk2
-rw-r--r--package/botan/Config.in2
-rw-r--r--package/bullet/Config.in7
-rw-r--r--package/busybox/0003-update_passwd-fix-context-variable.patch41
-rw-r--r--package/busybox/0004-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch58
-rw-r--r--package/busybox/busybox.hash4
-rw-r--r--package/busybox/busybox.mk5
-rw-r--r--package/cage/cage.hash2
-rw-r--r--package/cage/cage.mk7
-rw-r--r--package/can-utils/can-utils.hash2
-rw-r--r--package/can-utils/can-utils.mk2
-rw-r--r--package/capnproto/0001-mutex-Fix-build-on-32-bit-architectures-using-64-bit-time_t.patch37
-rw-r--r--package/cegui/0001-src-Exceptions.cpp-check-if-execinfo-header-is-avail.patch33
-rw-r--r--package/cegui/0002-cegui-src-IconvStringTranscoder.cpp-use-cast-notatio.patch34
-rw-r--r--package/cegui/cegui.hash2
-rw-r--r--package/cegui/cegui.mk27
-rw-r--r--package/checkpolicy/checkpolicy.hash2
-rw-r--r--package/checkpolicy/checkpolicy.mk4
-rw-r--r--package/chrony/chrony.mk2
-rw-r--r--package/chrony/chrony.service4
-rw-r--r--package/civetweb/civetweb.hash4
-rw-r--r--package/civetweb/civetweb.mk2
-rw-r--r--package/clamav/clamav.hash2
-rw-r--r--package/clamav/clamav.mk3
-rw-r--r--package/clapack/Config.in15
-rw-r--r--package/cog/cog.hash8
-rw-r--r--package/cog/cog.mk2
-rw-r--r--package/connman/connman.hash2
-rw-r--r--package/connman/connman.mk2
-rw-r--r--package/cryptsetup/cryptsetup.mk6
-rw-r--r--package/cutelyst/0001-server-CMakeLists.txt-don-t-override-CMAKE_EXE_LINKE.patch31
-rw-r--r--package/daemon/0001-daemon-fix-build-with-musl-libc-again.patch46
-rw-r--r--package/daemon/0001-fix-musl.patch18
-rw-r--r--package/daemon/0002-Fix-build-with-NDEBUG-defined.patch46
-rw-r--r--package/daemon/daemon.hash4
-rw-r--r--package/daemon/daemon.mk2
-rw-r--r--package/daq3/0001-add-disable-example.patch49
-rw-r--r--package/daq3/Config.in14
-rw-r--r--package/daq3/daq3.hash6
-rw-r--r--package/daq3/daq3.mk31
-rw-r--r--package/darkhttpd/0001-Declare-vars-outside-of-for-loop-for-std-c90.patch39
-rw-r--r--package/darkhttpd/darkhttpd.hash4
-rw-r--r--package/darkhttpd/darkhttpd.mk5
-rw-r--r--package/dbus-glib/dbus-glib.hash4
-rw-r--r--package/dbus-glib/dbus-glib.mk2
-rw-r--r--package/dc3dd/Config.in2
-rw-r--r--package/delve/delve.hash4
-rw-r--r--package/delve/delve.mk2
-rw-r--r--package/dhcp/dhcp.hash6
-rw-r--r--package/dhcp/dhcp.mk6
-rw-r--r--package/directfb/Config.in2
-rw-r--r--package/dmalloc/dmalloc.mk6
-rw-r--r--package/dnsmasq/dnsmasq.mk1
-rw-r--r--package/docker-cli/docker-cli.hash2
-rw-r--r--package/docker-cli/docker-cli.mk2
-rw-r--r--package/docker-compose/Config.in7
-rw-r--r--package/docker-engine/Config.in2
-rw-r--r--package/docker-engine/docker-engine.hash2
-rw-r--r--package/docker-engine/docker-engine.mk2
-rw-r--r--package/dovecot-pigeonhole/dovecot-pigeonhole.hash2
-rw-r--r--package/dovecot-pigeonhole/dovecot-pigeonhole.mk2
-rw-r--r--package/dovecot/dovecot.hash2
-rw-r--r--package/dovecot/dovecot.mk6
-rw-r--r--package/dt-utils/dt-utils.hash2
-rw-r--r--package/dt-utils/dt-utils.mk2
-rw-r--r--package/duktape/duktape.mk4
-rw-r--r--package/duktape/duktape.pc.in10
-rw-r--r--package/e2fsprogs/e2fsprogs.mk1
-rw-r--r--package/ebtables/0002-ebtables.h-restore-KERNEL_64_USERSPACE_32-checks.patch105
-rw-r--r--package/ebtables/0003-configure.ac-add-option-enable-kernel-64-userland-32.patch51
-rw-r--r--package/ebtables/ebtables.mk6
-rw-r--r--package/edk2-platforms/Config.in8
-rw-r--r--package/edk2-platforms/edk2-platforms.hash3
-rw-r--r--package/edk2-platforms/edk2-platforms.mk22
-rw-r--r--package/efibootmgr/0002-remove-extra-decl.patch28
-rw-r--r--package/efibootmgr/Config.in2
-rw-r--r--package/efibootmgr/efibootmgr.hash4
-rw-r--r--package/efibootmgr/efibootmgr.mk2
-rw-r--r--package/efl/Config.in1
-rw-r--r--package/ell/ell.hash2
-rw-r--r--package/ell/ell.mk2
-rw-r--r--package/enlightenment/enlightenment.mk1
-rw-r--r--package/enscript/enscript.mk1
-rw-r--r--package/environment-setup/environment-setup.mk4
-rw-r--r--package/erofs-utils/0001-erofs-utils-manpage-only-install-erofsfuse.1-with-th.patch32
-rw-r--r--package/erofs-utils/erofs-utils.hash2
-rw-r--r--package/erofs-utils/erofs-utils.mk2
-rw-r--r--package/ethtool/ethtool.hash2
-rw-r--r--package/ethtool/ethtool.mk2
-rw-r--r--package/exempi/exempi.mk1
-rw-r--r--package/exiv2/0001-add-BUILD_WITH_STACK_PROTECTOR-option.patch52
-rw-r--r--package/exiv2/0001-cmake-compilerFlags.cmake-properly-detect-availabili.patch58
-rw-r--r--package/exiv2/exiv2.hash4
-rw-r--r--package/exiv2/exiv2.mk9
-rw-r--r--package/expat/expat.hash8
-rw-r--r--package/expat/expat.mk2
-rw-r--r--package/fb-test-app/fb-test-app.hash2
-rw-r--r--package/fb-test-app/fb-test-app.mk5
-rw-r--r--package/fbgrab/fbgrab.hash2
-rw-r--r--package/fbgrab/fbgrab.mk2
-rw-r--r--package/feh/feh.mk1
-rw-r--r--package/ffmpeg/0003-libavutil-Fix-mips-build.patch72
-rw-r--r--package/filemq/filemq.hash2
-rw-r--r--package/filemq/filemq.mk2
-rw-r--r--package/findutils/findutils.hash4
-rw-r--r--package/findutils/findutils.mk3
-rw-r--r--package/flac/flac.mk2
-rw-r--r--package/flannel/Config.in2
-rw-r--r--package/flannel/flannel.hash2
-rw-r--r--package/flannel/flannel.mk6
-rw-r--r--package/flare-engine/flare-engine.mk12
-rw-r--r--package/flatbuffers/flatbuffers.hash2
-rw-r--r--package/flatbuffers/flatbuffers.mk2
-rw-r--r--package/flatcc/flatcc.mk2
-rw-r--r--package/fluidsynth/fluidsynth.hash2
-rw-r--r--package/fluidsynth/fluidsynth.mk3
-rw-r--r--package/freerdp/Config.in1
-rw-r--r--package/freescale-imx/imx-gpu-viv/Config.in5
-rw-r--r--package/frr/frr.mk2
-rw-r--r--package/fuse-overlayfs/fuse-overlayfs.hash2
-rw-r--r--package/fuse-overlayfs/fuse-overlayfs.mk2
-rw-r--r--package/gawk/gawk.mk6
-rw-r--r--package/gcc/10.3.0/0002-or1k-Add-mcmodel-option-to-handle-large-GOTs.patch200
-rw-r--r--package/gcc/10.3.0/0003-or1k-Use-cmodel-large-when-building-crtstuff.patch60
-rw-r--r--package/gcc/9.3.0/0001-xtensa-fix-PR-target-91880.patch50
-rw-r--r--package/gcc/9.3.0/0004-gcc-Makefile.in-move-SELFTEST_DEPS-before-including-.patch81
-rw-r--r--package/gcc/9.4.0/0001-or1k-Fix-issue-with-set_got-clobbering-LR-r9.patch (renamed from package/gcc/9.3.0/0002-or1k-Fix-issue-with-set_got-clobbering-LR-r9.patch)4
-rw-r--r--package/gcc/9.4.0/0002-gcc-define-_REENTRANT-for-OpenRISC-when-pthread-is-p.patch (renamed from package/gcc/9.3.0/0003-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch)6
-rw-r--r--package/gcc/9.4.0/0003-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch (renamed from package/gcc/9.3.0/0005-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch)28
-rw-r--r--package/gcc/9.4.0/0004-or1k-Add-mcmodel-option-to-handle-large-GOTs.patch201
-rw-r--r--package/gcc/9.4.0/0005-or1k-Use-cmodel-large-when-building-crtstuff.patch60
-rw-r--r--package/gcc/Config.in.host34
-rw-r--r--package/gcc/gcc.hash6
-rw-r--r--package/gcc/gcc.mk2
-rw-r--r--package/gcnano-binaries/gcnano-binaries.hash2
-rw-r--r--package/gcnano-binaries/gcnano-binaries.mk12
-rw-r--r--package/gcr/gcr.hash6
-rw-r--r--package/gcr/gcr.mk20
-rw-r--r--package/gd/gd.mk2
-rw-r--r--package/gdb/9.2/0007-gdb-configure.tgt-build-gdbserver-with-m68k-and-ucli.patch41
-rw-r--r--package/gdb/Config.in4
-rw-r--r--package/gdb/Config.in.host12
-rw-r--r--package/gdk-pixbuf/0001-meson.build-link-with-lintl-if-needed.patch45
-rw-r--r--package/gdk-pixbuf/0002-gdk-pixbuf-gdk-pixbuf-io.c-fix-build-without-gmodule.patch41
-rw-r--r--package/gdk-pixbuf/Config.in2
-rw-r--r--package/gdk-pixbuf/gdk-pixbuf.hash5
-rw-r--r--package/gdk-pixbuf/gdk-pixbuf.mk2
-rw-r--r--package/gerbera/gerbera.hash2
-rw-r--r--package/gerbera/gerbera.mk6
-rw-r--r--package/gesftpserver/gesftpserver.mk4
-rw-r--r--package/glibc/2.33-46-gedfd11197ecf3629bbb4b66c5814da09a61a7f9f/glibc.hash (renamed from package/glibc/2.32-37-g760e1d287825fa91d4d5a0cc921340c740d803e2/glibc.hash)2
-rw-r--r--package/glibc/glibc.mk2
-rw-r--r--package/gnuchess/gnuchess.hash2
-rw-r--r--package/gnuchess/gnuchess.mk2
-rw-r--r--package/gnupg2/0001-dirmngr-Fix-build-with--disable-ldap.patch43
-rw-r--r--package/gnupg2/gnupg2.hash8
-rw-r--r--package/gnupg2/gnupg2.mk2
-rw-r--r--package/gnuplot/gnuplot.hash8
-rw-r--r--package/gnuplot/gnuplot.mk2
-rw-r--r--package/gnutls/gnutls.mk1
-rw-r--r--package/go-bootstrap/go-bootstrap.hash2
-rw-r--r--package/go-bootstrap/go-bootstrap.mk8
-rw-r--r--package/go/go.hash2
-rw-r--r--package/go/go.mk2
-rw-r--r--package/gobject-introspection/0001-disable-tests.patch2
-rw-r--r--package/gobject-introspection/0002-Add-rpath-links-to-ccompiler.patch2
-rw-r--r--package/gobject-introspection/Config.in1
-rw-r--r--package/gobject-introspection/gobject-introspection.hash9
-rw-r--r--package/gobject-introspection/gobject-introspection.mk12
-rw-r--r--package/gptfdisk/0001-gptcurses-partially-revert-Tweaks-for-building-on-th.patch2
-rw-r--r--package/gptfdisk/gptfdisk.hash7
-rw-r--r--package/gptfdisk/gptfdisk.mk2
-rw-r--r--package/gqrx/Config.in2
-rw-r--r--package/gqrx/gqrx.hash2
-rw-r--r--package/gqrx/gqrx.mk2
-rw-r--r--package/granite/0001-meson-add-introspection-option.patch73
-rw-r--r--package/granite/granite.hash2
-rw-r--r--package/granite/granite.mk11
-rw-r--r--package/grpc/grpc.hash2
-rw-r--r--package/grpc/grpc.mk3
-rw-r--r--package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk2
-rw-r--r--package/gstreamer1/gst1-plugins-base/0002-gstgl-Fix-build-when-Meson-0.58.0rc1.patch51
-rw-r--r--package/gstreamer1/gst1-rtsp-server/gst1-rtsp-server.mk2
-rw-r--r--package/gstreamer1/gstreamer1/gstreamer1.mk2
-rw-r--r--package/gtest/gtest.hash4
-rw-r--r--package/gtest/gtest.mk42
-rw-r--r--package/gumbo-parser/Config.in10
-rw-r--r--package/gumbo-parser/gumbo-parser.hash5
-rw-r--r--package/gumbo-parser/gumbo-parser.mk14
-rw-r--r--package/gupnp-av/gupnp-av.hash6
-rw-r--r--package/gupnp-av/gupnp-av.mk14
-rw-r--r--package/gupnp/0001-Revert-build-Always-build-gupnp-binding-tool-manpage.patch60
-rw-r--r--package/gupnp/0001-doc-Check-for-stylesheet-existence-on-doc-build.patch73
-rw-r--r--package/gupnp/gupnp.hash4
-rw-r--r--package/gupnp/gupnp.mk2
-rw-r--r--package/haproxy/haproxy.hash4
-rw-r--r--package/haproxy/haproxy.mk4
-rw-r--r--package/harfbuzz/0001-meson.build-check-for-pthread.h.patch9
-rw-r--r--package/harfbuzz/harfbuzz.hash4
-rw-r--r--package/harfbuzz/harfbuzz.mk4
-rw-r--r--package/hdparm/Config.in4
-rw-r--r--package/hdparm/hdparm.hash7
-rw-r--r--package/hdparm/hdparm.mk4
-rw-r--r--package/heirloom-mailx/Config.in2
-rw-r--r--package/heirloom-mailx/heirloom-mailx.mk2
-rw-r--r--package/hostapd/0003-Include-stdbool.h-to-allow-C99-bool-to-be-used.patch32
-rw-r--r--package/hostapd/0004-ASN.1-Add-helper-functions-for-recognizing-tag-value.patch37
-rw-r--r--package/hostapd/Config.in2
-rw-r--r--package/hostapd/hostapd.hash1
-rw-r--r--package/hostapd/hostapd.mk6
-rw-r--r--package/hwloc/hwloc.mk23
-rw-r--r--package/i2c-tools/i2c-tools.mk1
-rw-r--r--package/i2pd/i2pd.hash4
-rw-r--r--package/i2pd/i2pd.mk2
-rw-r--r--package/icu/icu.hash2
-rw-r--r--package/icu/icu.mk2
-rw-r--r--package/iftop/0002-Rename-pcap_filter-to-iftop_pcap_filter.patch51
-rw-r--r--package/imagemagick/imagemagick.hash2
-rw-r--r--package/imagemagick/imagemagick.mk2
-rw-r--r--package/imlib2/imlib2.hash8
-rw-r--r--package/imlib2/imlib2.mk2
-rw-r--r--package/intel-gmmlib/0001-Drop-hardening-related-flags.patch28
-rw-r--r--package/intel-gmmlib/intel-gmmlib.hash4
-rw-r--r--package/intel-gmmlib/intel-gmmlib.mk2
-rw-r--r--package/intel-mediadriver/0001-Drop-hardening-related-flags.patch38
-rw-r--r--package/intel-mediadriver/0002-build-fix-Werror=format-overflow-under-gcc-10.patch162
-rw-r--r--package/intel-mediadriver/0002-cmrtlib-linux-CMakelists.txt-respect-MEDIA_BUILD_FAT.patch51
-rw-r--r--package/intel-mediadriver/Config.in6
-rw-r--r--package/intel-mediadriver/intel-mediadriver.hash4
-rw-r--r--package/intel-mediadriver/intel-mediadriver.mk10
-rw-r--r--package/intel-mediasdk/Config.in5
-rw-r--r--package/intel-mediasdk/intel-mediasdk.hash4
-rw-r--r--package/intel-mediasdk/intel-mediasdk.mk2
-rw-r--r--package/intel-microcode/intel-microcode.hash4
-rw-r--r--package/intel-microcode/intel-microcode.mk2
-rw-r--r--package/iperf3/iperf3.hash6
-rw-r--r--package/iperf3/iperf3.mk2
-rw-r--r--package/iproute2/0001-devlink-update-include-files.patch55
-rw-r--r--package/iproute2/0001-lib-fs-fix-issue-when-name-open-_to_handle_at-is-not.patch114
-rw-r--r--package/iproute2/iproute2.hash2
-rw-r--r--package/iproute2/iproute2.mk2
-rw-r--r--package/jh71xx-tools/Config.in.host7
-rw-r--r--package/jh71xx-tools/jh71xx-tools.hash3
-rw-r--r--package/jh71xx-tools/jh71xx-tools.mk20
-rw-r--r--package/jquery-validation/jquery-validation.hash4
-rw-r--r--package/jquery-validation/jquery-validation.mk6
-rw-r--r--package/keepalived/0001-core-Fix-compiling-on-RHEL-9.patch34
-rw-r--r--package/keepalived/keepalived.mk1
-rw-r--r--package/kexec/0001-kexec-tools-Remove-duplicate-definition-of-ramdisk.patch32
-rw-r--r--package/kismet/0001-Add-getter-to-read-database-values-as-long-long.patch28
-rw-r--r--package/kismet/0001-nrf_51822.h-fix-build-on-sparc.patch59
-rw-r--r--package/kismet/0002-boost-asio-Use-eventfd-function-with-uClibc.patch66
-rw-r--r--package/kismet/Config.in18
-rw-r--r--package/kismet/kismet.hash2
-rw-r--r--package/kismet/kismet.mk5
-rw-r--r--package/kodi-inputstream-adaptive/kodi-inputstream-adaptive.hash2
-rw-r--r--package/kodi-inputstream-adaptive/kodi-inputstream-adaptive.mk2
-rw-r--r--package/kodi-inputstream-ffmpegdirect/kodi-inputstream-ffmpegdirect.hash2
-rw-r--r--package/kodi-inputstream-ffmpegdirect/kodi-inputstream-ffmpegdirect.mk2
-rw-r--r--package/kodi-peripheral-joystick/kodi-peripheral-joystick.hash2
-rw-r--r--package/kodi-peripheral-joystick/kodi-peripheral-joystick.mk2
-rw-r--r--package/kodi-pvr-argustv/kodi-pvr-argustv.hash2
-rw-r--r--package/kodi-pvr-argustv/kodi-pvr-argustv.mk2
-rw-r--r--package/kodi-pvr-dvblink/kodi-pvr-dvblink.hash2
-rw-r--r--package/kodi-pvr-dvblink/kodi-pvr-dvblink.mk2
-rw-r--r--package/kodi-pvr-dvbviewer/kodi-pvr-dvbviewer.hash2
-rw-r--r--package/kodi-pvr-dvbviewer/kodi-pvr-dvbviewer.mk2
-rw-r--r--package/kodi-pvr-filmon/kodi-pvr-filmon.hash2
-rw-r--r--package/kodi-pvr-filmon/kodi-pvr-filmon.mk2
-rw-r--r--package/kodi-pvr-hdhomerun/kodi-pvr-hdhomerun.hash2
-rw-r--r--package/kodi-pvr-hdhomerun/kodi-pvr-hdhomerun.mk2
-rw-r--r--package/kodi-pvr-hts/kodi-pvr-hts.hash2
-rw-r--r--package/kodi-pvr-hts/kodi-pvr-hts.mk2
-rw-r--r--package/kodi-pvr-iptvsimple/kodi-pvr-iptvsimple.hash2
-rw-r--r--package/kodi-pvr-iptvsimple/kodi-pvr-iptvsimple.mk2
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0001-Revert-Removed-no-more-supported-C-17-declaration-ke.patch29
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0002-Remove-p8-os-includes.patch157
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0003-Use-kodi-StringUtils.patch124
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0004-Remove-SAFE_DELETE.patch289
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0005-Use-thread-sleep_for-instead-of-p8-time-utils.patch308
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0006-Use-std-thread-std-mutex-condition_variable-instead-.patch673
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0007-Remove-charset-converter-dependency.patch55
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0008-Remove-p8-platform-dependency.patch74
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0009-Travis-changes-for-cpp17.patch28
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0010-Remove-register-keyword-as-no-longer-valid-in-CPP17.patch23
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/0011-changelog-and-version-v8.1.1.patch42
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/kodi-pvr-mediaportal-tvserver.hash2
-rw-r--r--package/kodi-pvr-mediaportal-tvserver/kodi-pvr-mediaportal-tvserver.mk2
-rw-r--r--package/kodi-pvr-nextpvr/kodi-pvr-nextpvr.hash2
-rw-r--r--package/kodi-pvr-nextpvr/kodi-pvr-nextpvr.mk2
-rw-r--r--package/kodi-pvr-njoy/kodi-pvr-njoy.hash2
-rw-r--r--package/kodi-pvr-njoy/kodi-pvr-njoy.mk2
-rw-r--r--package/kodi-pvr-pctv/kodi-pvr-pctv.hash2
-rw-r--r--package/kodi-pvr-pctv/kodi-pvr-pctv.mk2
-rw-r--r--package/kodi-pvr-stalker/kodi-pvr-stalker.hash2
-rw-r--r--package/kodi-pvr-stalker/kodi-pvr-stalker.mk2
-rw-r--r--package/kodi-pvr-vbox/kodi-pvr-vbox.hash2
-rw-r--r--package/kodi-pvr-vbox/kodi-pvr-vbox.mk2
-rw-r--r--package/kodi-pvr-vdr-vnsi/kodi-pvr-vdr-vnsi.hash2
-rw-r--r--package/kodi-pvr-vdr-vnsi/kodi-pvr-vdr-vnsi.mk2
-rw-r--r--package/kodi-pvr-vuplus/kodi-pvr-vuplus.hash2
-rw-r--r--package/kodi-pvr-vuplus/kodi-pvr-vuplus.mk2
-rw-r--r--package/kodi-pvr-wmc/kodi-pvr-wmc.hash2
-rw-r--r--package/kodi-pvr-wmc/kodi-pvr-wmc.mk2
-rw-r--r--package/kodi-visualisation-matrix/kodi-visualisation-matrix.hash2
-rw-r--r--package/kodi-visualisation-matrix/kodi-visualisation-matrix.mk2
-rw-r--r--package/kodi-visualisation-shadertoy/kodi-visualisation-shadertoy.hash2
-rw-r--r--package/kodi-visualisation-shadertoy/kodi-visualisation-shadertoy.mk2
-rw-r--r--package/kodi-visualisation-spectrum/kodi-visualisation-spectrum.hash2
-rw-r--r--package/kodi-visualisation-spectrum/kodi-visualisation-spectrum.mk2
-rw-r--r--package/kodi-visualisation-starburst/kodi-visualisation-starburst.hash2
-rw-r--r--package/kodi-visualisation-starburst/kodi-visualisation-starburst.mk2
-rw-r--r--package/kodi-visualisation-waveform/kodi-visualisation-waveform.hash2
-rw-r--r--package/kodi-visualisation-waveform/kodi-visualisation-waveform.mk2
-rw-r--r--package/kodi/Config.in19
-rw-r--r--package/kodi/kodi.mk11
-rw-r--r--package/lapack/Config.in16
-rw-r--r--package/less/less.hash4
-rw-r--r--package/less/less.mk3
-rw-r--r--package/libabseil-cpp/libabseil-cpp.hash2
-rw-r--r--package/libabseil-cpp/libabseil-cpp.mk2
-rw-r--r--package/libass/libass.hash2
-rw-r--r--package/libass/libass.mk2
-rw-r--r--package/libassuan/libassuan.hash6
-rw-r--r--package/libassuan/libassuan.mk2
-rw-r--r--package/libatomic_ops/Config.in7
-rw-r--r--package/libbluray/libbluray.hash4
-rw-r--r--package/libbluray/libbluray.mk6
-rw-r--r--package/libbpf/Config.in31
-rw-r--r--package/libbpf/libbpf.hash5
-rw-r--r--package/libbpf/libbpf.mk40
-rw-r--r--package/libcamera/0001-libcamera-add-dependencies-to-libcamera_dep.patch37
-rw-r--r--package/libcap/0001-Permit-compilation-with-std-c89.patch123
-rw-r--r--package/libcap/libcap.hash4
-rw-r--r--package/libcap/libcap.mk2
-rw-r--r--package/libconfig/0001-Add-disable-doc-option.patch54
-rw-r--r--package/libconfig/libconfig.hash2
-rw-r--r--package/libconfig/libconfig.mk8
-rw-r--r--package/libcurl/0001-bearssl-remove-incorrect-const-on-variable-that-is-m.patch32
-rw-r--r--package/libcurl/Config.in1
-rw-r--r--package/libcurl/libcurl.hash4
-rw-r--r--package/libcurl/libcurl.mk8
-rw-r--r--package/libcutl/libcutl.mk1
-rw-r--r--package/libdrm/libdrm.hash8
-rw-r--r--package/libdrm/libdrm.mk2
-rw-r--r--package/libdvdcss/libdvdcss.hash8
-rw-r--r--package/libdvdcss/libdvdcss.mk2
-rw-r--r--package/libdvdnav/libdvdnav.hash12
-rw-r--r--package/libdvdnav/libdvdnav.mk2
-rw-r--r--package/libdvdread/libdvdread.hash12
-rw-r--r--package/libdvdread/libdvdread.mk2
-rw-r--r--package/libeXosip2/libeXosip2.mk2
-rw-r--r--package/libepoxy/libepoxy.hash6
-rw-r--r--package/libepoxy/libepoxy.mk2
-rw-r--r--package/libesmtp/Config.in2
-rw-r--r--package/libesmtp/libesmtp.mk2
-rw-r--r--package/libffi/libffi.mk1
-rw-r--r--package/libfreefare/Config.in1
-rw-r--r--package/libfuse/libfuse.mk1
-rw-r--r--package/libfuse3/libfuse3.hash2
-rw-r--r--package/libfuse3/libfuse3.mk7
-rw-r--r--package/libgcrypt/libgcrypt.hash6
-rw-r--r--package/libgcrypt/libgcrypt.mk2
-rw-r--r--package/libgeos/Config.in4
-rw-r--r--package/libgit2/libgit2.mk1
-rw-r--r--package/libglib2/0001-fix-compile-time-atomic-detection.patch12
-rw-r--r--package/libglib2/0002-allow-explicit-disabling-of-tests.patch37
-rw-r--r--package/libglib2/0002-remove-cpp-requirement.patch (renamed from package/libglib2/0003-remove-cpp-requirement.patch)6
-rw-r--r--package/libglib2/0003-Add-Wno-format-nonliteral-to-compiler-arguments.patch (renamed from package/libglib2/0004-Add-Wno-format-nonliteral-to-compiler-arguments.patch)7
-rw-r--r--package/libglib2/libglib2.hash4
-rw-r--r--package/libglib2/libglib2.mk16
-rw-r--r--package/libglu/libglu.hash10
-rw-r--r--package/libglu/libglu.mk2
-rw-r--r--package/libgpg-error/0001-build-Fix-generation-of-lock-obj-pub.native.h-for-cr.patch34
-rw-r--r--package/libgpg-error/0001-configure.ac-fix-build-without-threads.patch54
-rw-r--r--package/libgpg-error/0002-build-Fix-disable-threads.patch39
-rw-r--r--package/libgpg-error/libgpg-error.hash6
-rw-r--r--package/libgpg-error/libgpg-error.mk4
-rw-r--r--package/libgtk2/libgtk2.mk2
-rw-r--r--package/libgtk3/0001-no-gtk-doc.patch2
-rw-r--r--package/libgtk3/libgtk3.hash4
-rw-r--r--package/libgtk3/libgtk3.mk4
-rw-r--r--package/libgudev/libgudev.hash6
-rw-r--r--package/libgudev/libgudev.mk13
-rw-r--r--package/libhtp/libhtp.hash2
-rw-r--r--package/libhtp/libhtp.mk2
-rw-r--r--package/libical/libical.mk1
-rw-r--r--package/libidn/libidn.hash2
-rw-r--r--package/libidn/libidn.mk3
-rw-r--r--package/libidn2/libidn2.hash10
-rw-r--r--package/libidn2/libidn2.mk3
-rw-r--r--package/libiec61850/0001-use-poll.h-instead-of-sys-poll.h.patch33
-rw-r--r--package/libiec61850/0002-serial_port_linux-Add-missing-include-sys-time.h.patch32
-rw-r--r--package/libiec61850/0003-COTP-fixed-possible-heap-buffer-overflow-when-handling-message.patch27
-rw-r--r--package/libiec61850/libiec61850.hash2
-rw-r--r--package/libiec61850/libiec61850.mk5
-rw-r--r--package/libinput/libinput.hash8
-rw-r--r--package/libinput/libinput.mk2
-rw-r--r--package/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch42
-rw-r--r--package/libkrb5/Config.in3
-rw-r--r--package/libkrb5/libkrb5.mk15
-rw-r--r--package/libksba/libksba.hash4
-rw-r--r--package/libksba/libksba.mk2
-rw-r--r--package/libldns/libldns.mk2
-rw-r--r--package/libmbim/libmbim.hash2
-rw-r--r--package/libmbim/libmbim.mk5
-rw-r--r--package/libmdbx/libmdbx.hash2
-rw-r--r--package/libmdbx/libmdbx.mk2
-rw-r--r--package/libmicrohttpd/libmicrohttpd.hash2
-rw-r--r--package/libmicrohttpd/libmicrohttpd.mk2
-rw-r--r--package/libmms/libmms.mk1
-rw-r--r--package/libmodbus/libmodbus.mk1
-rw-r--r--package/libmodsecurity/0001-Fail-when-CANONICAL_HOST-cannot-be-determined.patch31
-rw-r--r--package/libmodsecurity/0002-test-for-uClinux-in-configure-script.patch28
-rw-r--r--package/libmodsecurity/Config.in6
-rw-r--r--package/libmodsecurity/libmodsecurity.hash6
-rw-r--r--package/libmodsecurity/libmodsecurity.mk7
-rw-r--r--package/libmspack/libmspack.mk7
-rw-r--r--package/libndp/0001-ndptool.c-Fix-musl-build.patch30
-rw-r--r--package/libndp/libndp.hash4
-rw-r--r--package/libndp/libndp.mk2
-rw-r--r--package/libnice/libnice.hash8
-rw-r--r--package/libnice/libnice.mk25
-rw-r--r--package/libnids/libnids.mk5
-rw-r--r--package/libnss/libnss.hash4
-rw-r--r--package/libnss/libnss.mk2
-rw-r--r--package/libopenh264/0003-codec-common-inc-asmdefs_mmi.h-fix-mips32-build.patch89
-rw-r--r--package/libopenssl/Config.in95
-rw-r--r--package/libopenssl/libopenssl.mk23
-rw-r--r--package/liboping/liboping.mk1
-rw-r--r--package/libostree/libostree.hash2
-rw-r--r--package/libostree/libostree.mk2
-rw-r--r--package/libpcap/libpcap.hash4
-rw-r--r--package/libpcap/libpcap.mk2
-rw-r--r--package/libpsl/Config.in12
-rw-r--r--package/libpsl/libpsl.hash6
-rw-r--r--package/libpsl/libpsl.mk27
-rw-r--r--package/libqb/Config.in12
-rw-r--r--package/libqb/libqb.hash3
-rw-r--r--package/libqb/libqb.mk20
-rw-r--r--package/libqmi/0001-libqmi-fix-build-when-ARPHRD_RAWIP-isn-t-defined-in-.patch39
-rw-r--r--package/libqmi/libqmi.hash2
-rw-r--r--package/libqmi/libqmi.mk2
-rw-r--r--package/libraw/0001-Add-Libs.private-to-libraw.pc.patch67
-rw-r--r--package/libraw/Config.in2
-rw-r--r--package/librelp/librelp.mk1
-rw-r--r--package/libressl/libressl.hash2
-rw-r--r--package/libressl/libressl.mk3
-rw-r--r--package/librsvg/librsvg.hash4
-rw-r--r--package/librsvg/librsvg.mk2
-rw-r--r--package/libsamplerate/libsamplerate.mk1
-rw-r--r--package/libselinux/0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch2
-rw-r--r--package/libselinux/0003-libselinux-rename-gettid-to-something-which-never-conflicts.patch71
-rw-r--r--package/libselinux/0003-libselinux-utils-getseuser.c-fix-build-with-gcc-4.8.patch47
-rw-r--r--package/libselinux/libselinux.hash2
-rw-r--r--package/libselinux/libselinux.mk4
-rw-r--r--package/libsemanage/libsemanage.hash2
-rw-r--r--package/libsemanage/libsemanage.mk4
-rw-r--r--package/libsepol/Config.in4
-rw-r--r--package/libsepol/libsepol.hash4
-rw-r--r--package/libsepol/libsepol.mk4
-rw-r--r--package/libsndfile/0001-double64_init-Check-psf-sf.channels-against-upper-bo.patch39
-rw-r--r--package/libsndfile/0002-Check-MAX_CHANNELS-in-sndfile-deinterleave.patch36
-rw-r--r--package/libsndfile/0003-a-ulaw-fix-multiple-buffer-overflows-432.patch96
-rw-r--r--package/libsndfile/0004-src-wav.c-Fix-heap-read-overflow.patch35
-rw-r--r--package/libsndfile/0005-wav_write_header-don-t-read-past-the-array-end.patch33
-rw-r--r--package/libsndfile/0006-src-aiff.c-Fix-a-buffer-read-overflow.patch29
-rw-r--r--package/libsndfile/0007-FLAC-Fix-a-buffer-read-overrun.patch68
-rw-r--r--package/libsndfile/0008-src-flac.c-Fix-a-buffer-read-overflow.patch54
-rw-r--r--package/libsndfile/0009-src-flac-c-Fix-another-memory-leak.patch32
-rw-r--r--package/libsndfile/0010-src-common-c-Fix-heap-buffer-overflows-when-writing-strings-in.patch92
-rw-r--r--package/libsndfile/libsndfile.hash4
-rw-r--r--package/libsndfile/libsndfile.mk36
-rw-r--r--package/libsoup/0001-Revert-tld-parser-use-Python-3.patch27
-rw-r--r--package/libsoup/0001-meson.build-set-c_std-to-gnu99.patch40
-rw-r--r--package/libsoup/Config.in7
-rw-r--r--package/libsoup/libsoup.hash4
-rw-r--r--package/libsoup/libsoup.mk51
-rw-r--r--package/libssh/Config.in1
-rw-r--r--package/libssh2/Config.in1
-rw-r--r--package/libtasn1/libtasn1.hash6
-rw-r--r--package/libtasn1/libtasn1.mk4
-rw-r--r--package/libtirpc/0003-Automatically-generate-XDR-header-files-from-.x-sour.patch1001
-rw-r--r--package/libtirpc/0004-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch1653
-rw-r--r--package/libtirpc/libtirpc.hash4
-rw-r--r--package/libtirpc/libtirpc.mk13
-rw-r--r--package/libtorrent/Config.in1
-rw-r--r--package/libubootenv/0001-src-CMakeLists.txt-do-not-force-the-build-of-a-share.patch11
-rw-r--r--package/libubootenv/libubootenv.hash2
-rw-r--r--package/libubootenv/libubootenv.mk4
-rw-r--r--package/libuci/libuci.hash2
-rw-r--r--package/libuci/libuci.mk5
-rw-r--r--package/libudfread/libudfread.hash2
-rw-r--r--package/libudfread/libudfread.mk2
-rw-r--r--package/libuhttpd/Config.in1
-rw-r--r--package/libuhttpd/libuhttpd.hash2
-rw-r--r--package/libuhttpd/libuhttpd.mk40
-rw-r--r--package/libusb/libusb.mk1
-rw-r--r--package/libuv/libuv.hash2
-rw-r--r--package/libuv/libuv.mk3
-rw-r--r--package/libva-utils/libva-utils.hash6
-rw-r--r--package/libva-utils/libva-utils.mk2
-rw-r--r--package/libva/libva.hash6
-rw-r--r--package/libva/libva.mk2
-rw-r--r--package/libvirt/90-kvm.rules1
-rw-r--r--package/libvirt/Config.in86
-rw-r--r--package/libvirt/S91virtlogd65
-rw-r--r--package/libvirt/S92libvirtd132
-rw-r--r--package/libvirt/libvirt.hash3
-rw-r--r--package/libvirt/libvirt.mk289
-rw-r--r--package/libvncserver/Config.in1
-rw-r--r--package/libwpe/0001-meson-Use-a-partial-dependency-to-pass-EGL-module-fl.patch45
-rw-r--r--package/libwpe/libwpe.hash8
-rw-r--r--package/libwpe/libwpe.mk2
-rw-r--r--package/libxml2/0001-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch36
-rw-r--r--package/libxml2/0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch35
-rw-r--r--package/libxml2/0003-Fix-out-of-bounds-read-with-xmllint--htmlout.patch40
-rw-r--r--package/libxml2/libxml2.hash4
-rw-r--r--package/libxml2/libxml2.mk8
-rw-r--r--package/libxmlrpc/0001-use-correct-curl-config.patch70
-rw-r--r--package/libxmlrpc/Config.in9
-rw-r--r--package/libxmlrpc/libxmlrpc.hash2
-rw-r--r--package/libxmlrpc/libxmlrpc.mk19
-rw-r--r--package/libxslt/0001-Fix-xml2-config-check-in-configure-script.patch31
-rw-r--r--package/libxslt/libxslt.mk2
-rw-r--r--package/links/Config.in8
-rw-r--r--package/links/links.hash2
-rw-r--r--package/links/links.mk2
-rw-r--r--package/linux-firmware/Config.in10
-rw-r--r--package/linux-firmware/linux-firmware.hash8
-rw-r--r--package/linux-firmware/linux-firmware.mk71
-rw-r--r--package/linux-headers/Config.in.host29
-rw-r--r--package/linuxptp/linuxptp.hash8
-rw-r--r--package/linuxptp/linuxptp.mk3
-rw-r--r--package/live555/live555.hash4
-rw-r--r--package/live555/live555.mk2
-rw-r--r--package/llvm/0001-nfc-Fix-missing-include.patch24
-rw-r--r--package/llvm/Config.in6
-rw-r--r--package/llvm/llvm.mk5
-rw-r--r--package/lmbench/0003-TOO_LONG-100-usec-to-prevent-memsize-from-timingout-.patch28
-rw-r--r--package/lmbench/0004-Fix-garbage-pointer-for-lat_rpc-S-localhost.patch25
-rw-r--r--package/localedef/2.32-37-g760e1d287825fa91d4d5a0cc921340c740d803e2/0003-Fix-GCC-11-Warray-parameter-warning-for-__sigsetjmp-.patch155
-rw-r--r--package/localedef/2.32-37-g760e1d287825fa91d4d5a0cc921340c740d803e2/0004-Avoid-Wstringop-overflow-warning-in-pthread_cleanup_.patch125
-rw-r--r--package/lrzsz/lrzsz.mk1
-rw-r--r--package/ltp-testsuite/ltp-testsuite.hash5
-rw-r--r--package/ltp-testsuite/ltp-testsuite.mk5
-rw-r--r--package/lttng-tools/0001-configure.ac-add-disable-tests.patch37
-rw-r--r--package/lttng-tools/lttng-tools.mk3
-rw-r--r--package/lua-livr/lua-livr.hash4
-rw-r--r--package/lua-livr/lua-livr.mk2
-rw-r--r--package/lua-lunix/0001-fix-with-uClibc.patch28
-rw-r--r--package/lua-lunix/0002-remove-link-with-librt.patch36
-rw-r--r--package/lua-lunix/Config.in6
-rw-r--r--package/lua-lunix/lua-lunix.hash3
-rw-r--r--package/lua-lunix/lua-lunix.mk14
-rw-r--r--package/lua-rotas/lua-rotas.hash4
-rw-r--r--package/lua-rotas/lua-rotas.mk2
-rw-r--r--package/lua-silva/lua-silva.hash4
-rw-r--r--package/lua-silva/lua-silva.mk2
-rw-r--r--package/lua-testmore/lua-testmore.hash4
-rw-r--r--package/lua-testmore/lua-testmore.mk2
-rw-r--r--package/lua-zlib/Config.in10
-rw-r--r--package/lua-zlib/lua-zlib.hash2
-rw-r--r--package/lua-zlib/lua-zlib.mk12
-rw-r--r--package/lualdap/lualdap.hash2
-rw-r--r--package/lualdap/lualdap.mk2
-rw-r--r--package/luvi/Config.in1
-rw-r--r--package/lvm2/Config.in30
-rw-r--r--package/lvm2/lvm2.mk29
-rw-r--r--package/lz4/0001-Fix-potential-memory-corruption-with-negative-memmov.patch26
-rw-r--r--package/lz4/lz4.mk3
-rw-r--r--package/makedumpfile/0002-makedumpfile.h-fix-build-on-sparc64.patch35
-rw-r--r--package/makedumpfile/makedumpfile.hash2
-rw-r--r--package/makedumpfile/makedumpfile.mk2
-rw-r--r--package/matio/matio.hash6
-rw-r--r--package/matio/matio.mk2
-rw-r--r--package/mbedtls/mbedtls.hash4
-rw-r--r--package/mbedtls/mbedtls.mk2
-rw-r--r--package/mbuffer/mbuffer.hash4
-rw-r--r--package/mbuffer/mbuffer.mk2
-rw-r--r--package/mender-grubenv/mender-grubenv.mk9
-rw-r--r--package/mender/Config.in2
-rw-r--r--package/mender/mender.mk3
-rw-r--r--package/mesa3d-headers/mesa3d-headers.mk6
-rw-r--r--package/mesa3d/0003-vc4-add-meson-option-to-disable-optional-neon-suppor.patch6
-rw-r--r--package/mesa3d/Config.in23
-rw-r--r--package/mesa3d/mesa3d.hash8
-rw-r--r--package/mesa3d/mesa3d.mk7
-rw-r--r--package/meson/meson.hash4
-rw-r--r--package/meson/meson.mk2
-rw-r--r--package/mimic/0001-Fix-linking-on-gcc-10.2.0-or-newer.patch27
-rw-r--r--package/mini-snmpd/mini-snmpd.mk2
-rw-r--r--package/minidlna/minidlna.mk3
-rw-r--r--package/minissdpd/minissdpd.mk1
-rw-r--r--package/minizip/minizip.mk1
-rw-r--r--package/modem-manager/modem-manager.hash2
-rw-r--r--package/modem-manager/modem-manager.mk2
-rw-r--r--package/mono-gtksharp3/0002-Mono-compilation-error-branch.patch25
-rw-r--r--package/mono/mono.mk2
-rw-r--r--package/mosquitto/mosquitto.hash4
-rw-r--r--package/mosquitto/mosquitto.mk2
-rw-r--r--package/mpd/mpd.hash2
-rw-r--r--package/mpd/mpd.mk2
-rw-r--r--package/mpg123/mpg123.hash8
-rw-r--r--package/mpg123/mpg123.mk3
-rw-r--r--package/mpv/Config.in6
-rw-r--r--package/mpv/mpv.hash2
-rw-r--r--package/mpv/mpv.mk34
-rw-r--r--package/msmtp/msmtp.mk1
-rw-r--r--package/mtd/Config.in5
-rw-r--r--package/mtd/mtd.mk1
-rw-r--r--package/mupdf/0001-Bug-703366-Fix-double-free-of-object-during-linearization.patch52
-rw-r--r--package/mupdf/0001-Makefile-add-an-install_libs-target.patch41
-rw-r--r--package/mupdf/Config.in24
-rw-r--r--package/mupdf/mupdf.hash8
-rw-r--r--package/mupdf/mupdf.mk73
-rw-r--r--package/musl/musl.mk1
-rw-r--r--package/mutt/mutt.hash2
-rw-r--r--package/mutt/mutt.mk2
-rw-r--r--package/nano/nano.hash4
-rw-r--r--package/nano/nano.mk2
-rw-r--r--package/nasm/nasm.mk2
-rw-r--r--package/nbd/0001-Also-close-the-file-descriptor-before-returning.patch25
-rw-r--r--package/nbd/nbd.hash10
-rw-r--r--package/nbd/nbd.mk4
-rw-r--r--package/neon/Config.in2
-rw-r--r--package/netatalk/Config.in2
-rw-r--r--package/netperf/netperf.mk2
-rw-r--r--package/netsnmp/Config.in1
-rw-r--r--package/netsnmp/netsnmp.hash3
-rw-r--r--package/netsurf/netsurf.mk1
-rw-r--r--package/nettle/nettle.hash4
-rw-r--r--package/nettle/nettle.mk2
-rw-r--r--package/network-manager/network-manager.hash6
-rw-r--r--package/network-manager/network-manager.mk6
-rw-r--r--package/nfs-utils/Config.in12
-rw-r--r--package/nfs-utils/nfs-utils.hash4
-rw-r--r--package/nfs-utils/nfs-utils.mk28
-rw-r--r--package/nginx-dav-ext/nginx-dav-ext.hash4
-rw-r--r--package/nginx-dav-ext/nginx-dav-ext.mk2
-rw-r--r--package/nginx-modsecurity/Config.in7
-rw-r--r--package/nginx-modsecurity/nginx-modsecurity.hash6
-rw-r--r--package/nginx-modsecurity/nginx-modsecurity.mk2
-rw-r--r--package/nginx-naxsi/nginx-naxsi.hash5
-rw-r--r--package/nginx-naxsi/nginx-naxsi.mk6
-rw-r--r--package/nginx/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch40
-rw-r--r--package/nginx/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch27
-rw-r--r--package/nginx/0009-auto-os-linux-fix-build-with-libxcrypt.patch2
-rw-r--r--package/nginx/Config.in6
-rw-r--r--package/nginx/nginx.hash4
-rw-r--r--package/nginx/nginx.mk6
-rw-r--r--package/nodejs/0002-Fix-build-with-ICU-68.patch101
-rw-r--r--package/nodejs/nodejs.hash4
-rw-r--r--package/nodejs/nodejs.mk2
-rw-r--r--package/ntp/ntpd.service4
-rw-r--r--package/numactl/0002-link-with-latomic-if-needed.patch52
-rw-r--r--package/numactl/numactl.mk4
-rw-r--r--package/odb/odb.mk1
-rw-r--r--package/openal/openal.hash2
-rw-r--r--package/openal/openal.mk4
-rw-r--r--package/openblas/openblas.mk4
-rw-r--r--package/opencv3/opencv3.mk2
-rw-r--r--package/openntpd/ntpd.service4
-rw-r--r--package/openocd/0002-CVE-2018-5704-Prevent-some-forms-of-Cross-Protocol-S.patch50
-rw-r--r--package/openocd/0003-bitbang-Fix-FTBFS-with-GCC-10.patch37
-rw-r--r--package/openocd/Config.in13
-rw-r--r--package/openocd/openocd.hash7
-rw-r--r--package/openocd/openocd.mk6
-rw-r--r--package/openpgm/0002-openpgm-pgm-checksum.c-fix-build-with-32-bits-MMX.patch41
-rw-r--r--package/openssh/openssh.hash4
-rw-r--r--package/openssh/openssh.mk2
-rw-r--r--package/openswan/openswan.mk2
-rw-r--r--package/opentyrian/opentyrian.hash3
-rw-r--r--package/opentyrian/opentyrian.mk5
-rw-r--r--package/openvpn/Config.in1
-rw-r--r--package/openvpn/openvpn.hash2
-rw-r--r--package/openvpn/openvpn.mk3
-rw-r--r--package/opkg-utils/0001-Makefile-seperate-manpages-and-utils-install.patch50
-rw-r--r--package/opkg-utils/opkg-utils.hash2
-rw-r--r--package/opkg-utils/opkg-utils.mk4
-rw-r--r--package/opkg/opkg.hash4
-rw-r--r--package/opkg/opkg.mk4
-rw-r--r--package/oprofile/oprofile.mk1
-rw-r--r--package/optee-benchmark/optee-benchmark.hash4
-rw-r--r--package/optee-benchmark/optee-benchmark.mk2
-rw-r--r--package/optee-client/0001-libckteec-add-missing-unistd.h-for-gid_t.patch31
-rw-r--r--package/optee-client/optee-client.hash4
-rw-r--r--package/optee-client/optee-client.mk2
-rw-r--r--package/optee-examples/optee-examples.hash4
-rw-r--r--package/optee-examples/optee-examples.mk2
-rw-r--r--package/optee-test/optee-test.hash4
-rw-r--r--package/optee-test/optee-test.mk2
-rw-r--r--package/oracle-mysql/oracle-mysql.mk2
-rw-r--r--package/p7zip/0001-CVE-2016-9296.patch25
-rw-r--r--package/p7zip/0002-CVE-2017-17969.patch37
-rw-r--r--package/p7zip/0003-CVE-2018-5996.patch223
-rw-r--r--package/p7zip/0004-Fix-build-with-gcc-10.patch32
-rw-r--r--package/p7zip/p7zip.hash7
-rw-r--r--package/p7zip/p7zip.mk13
-rw-r--r--package/paho-mqtt-c/paho-mqtt-c.hash2
-rw-r--r--package/paho-mqtt-c/paho-mqtt-c.mk2
-rw-r--r--package/pango/pango.hash4
-rw-r--r--package/pango/pango.mk2
-rw-r--r--package/pcre2/pcre2.mk1
-rw-r--r--package/pdbg/pdbg.hash2
-rw-r--r--package/pdbg/pdbg.mk2
-rw-r--r--package/perl-convert-asn1/perl-convert-asn1.hash6
-rw-r--r--package/perl-convert-asn1/perl-convert-asn1.mk4
-rw-r--r--package/perl-crypt-openssl-rsa/Config.in2
-rw-r--r--package/perl-crypt-openssl-rsa/perl-crypt-openssl-rsa.mk3
-rw-r--r--package/perl-data-dump/perl-data-dump.hash6
-rw-r--r--package/perl-data-dump/perl-data-dump.mk6
-rw-r--r--package/perl-data-optlist/perl-data-optlist.hash6
-rw-r--r--package/perl-data-optlist/perl-data-optlist.mk2
-rw-r--r--package/perl-http-message/perl-http-message.hash4
-rw-r--r--package/perl-http-message/perl-http-message.mk2
-rw-r--r--package/perl-io-socket-ssl/perl-io-socket-ssl.hash4
-rw-r--r--package/perl-io-socket-ssl/perl-io-socket-ssl.mk2
-rw-r--r--package/perl-libwww-perl/perl-libwww-perl.hash4
-rw-r--r--package/perl-libwww-perl/perl-libwww-perl.mk2
-rw-r--r--package/perl-mojolicious-plugin-authentication/Config.in2
-rw-r--r--package/perl-mojolicious-plugin-authentication/perl-mojolicious-plugin-authentication.hash4
-rw-r--r--package/perl-mojolicious-plugin-authentication/perl-mojolicious-plugin-authentication.mk2
-rw-r--r--package/perl-mojolicious-plugin-authorization/perl-mojolicious-plugin-authorization.hash6
-rw-r--r--package/perl-mojolicious-plugin-authorization/perl-mojolicious-plugin-authorization.mk2
-rw-r--r--package/perl-mojolicious/perl-mojolicious.hash4
-rw-r--r--package/perl-mojolicious/perl-mojolicious.mk2
-rw-r--r--package/perl-net-dns/perl-net-dns.hash6
-rw-r--r--package/perl-net-dns/perl-net-dns.mk4
-rw-r--r--package/perl-net-ssleay/Config.in1
-rw-r--r--package/perl-net-telnet/perl-net-telnet.hash6
-rw-r--r--package/perl-net-telnet/perl-net-telnet.mk2
-rw-r--r--package/perl-type-tiny/perl-type-tiny.hash4
-rw-r--r--package/perl-type-tiny/perl-type-tiny.mk2
-rw-r--r--package/perl/perl.mk1
-rw-r--r--package/php-amqp/0001-add-build-support-for-php-8.patch54
-rw-r--r--package/php-amqp/0002-more-work-for-php-8.patch1265
-rw-r--r--package/php-amqp/php-amqp.hash4
-rw-r--r--package/php-amqp/php-amqp.mk2
-rw-r--r--package/php-geoip/0001-add-build-support-for-php8.patch35
-rw-r--r--package/php-gnupg/php-gnupg.hash2
-rw-r--r--package/php-gnupg/php-gnupg.mk4
-rw-r--r--package/php-imagick/php-imagick.hash2
-rw-r--r--package/php-imagick/php-imagick.mk4
-rw-r--r--package/php-memcached/php-memcached.hash8
-rw-r--r--package/php-memcached/php-memcached.mk2
-rw-r--r--package/php-ssh2/0001-fix-php_url-fields-usage-for-PHP-7-3.patch302
-rw-r--r--package/php-ssh2/0002-dstogov-Fixed-PHP7-port-Restored-commented-reference-counting.patch746
-rw-r--r--package/php-ssh2/php-ssh2.hash2
-rw-r--r--package/php-ssh2/php-ssh2.mk2
-rw-r--r--package/php-xdebug/php-xdebug.hash4
-rw-r--r--package/php-xdebug/php-xdebug.mk2
-rw-r--r--package/php-yaml/php-yaml.hash4
-rw-r--r--package/php-yaml/php-yaml.mk2
-rw-r--r--package/php-zmq/0001-PHP-7.3-compatibility-and-bugfixes.patch271
-rw-r--r--package/php-zmq/0001-updates-for-php7.4-and-php8.0.patch230
-rw-r--r--package/php-zmq/0002-fix-for-php-7.3.patch43
-rw-r--r--package/php-zmq/0003-fix-for-php-8.0.0beta2.patch40
-rw-r--r--package/php/0001-acinclude.m4-don-t-unset-variables.patch4
-rw-r--r--package/php/0002-iconv-tweak-iconv-detection.patch48
-rw-r--r--package/php/0003-configure-disable-the-phar-tool.patch6
-rw-r--r--package/php/0004-Call-apxs-with-correct-prefix.patch8
-rw-r--r--package/php/0005-allow-opcache-cross-compiling.patch37
-rw-r--r--package/php/Config.ext16
-rw-r--r--package/php/php.hash2
-rw-r--r--package/php/php.mk16
-rw-r--r--package/picocom/picocom.mk1
-rw-r--r--package/pifmrds/0003-Makefile-fix-static-link.patch6
-rw-r--r--package/pifmrds/pifmrds.mk3
-rw-r--r--package/pigz/pigz.mk1
-rw-r--r--package/pipewire/0001-meson-fix-getrandom-detection-for-uclibc.patch49
-rw-r--r--package/pipewire/0001-meson-prefer-libintl-on-FreeBSD.patch46
-rw-r--r--package/pipewire/0002-fix-linking-with-latomic.patch108
-rw-r--r--package/pipewire/Config.in5
-rw-r--r--package/pipewire/pipewire.hash2
-rw-r--r--package/pipewire/pipewire.mk4
-rw-r--r--package/pkg-cmake.mk2
-rw-r--r--package/pkg-generic.mk34
-rw-r--r--package/pkg-meson.mk3
-rw-r--r--package/pngquant/pngquant.mk1
-rw-r--r--package/poco/poco.mk1
-rw-r--r--package/poke/0001-build-do-not-check-for-Tcl-Tk-if-disable-gui-is-spec.patch43
-rw-r--r--package/poke/0002-tentatively-change-cppflags-to-omit-I-prefix-on-cros.patch67
-rw-r--r--package/poke/0003-configure.ac-HELP2MAN-replace-by-true-when-cross-com.patch34
-rw-r--r--package/poke/Config.in28
-rw-r--r--package/poke/poke.hash4
-rw-r--r--package/poke/poke.mk56
-rw-r--r--package/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch11
-rw-r--r--package/policycoreutils/0002-Add-PREFIX-to-host-paths.patch36
-rw-r--r--package/policycoreutils/policycoreutils.hash2
-rw-r--r--package/policycoreutils/policycoreutils.mk6
-rw-r--r--package/polkit/0001-make-netgroup-support-optional.patch41
-rw-r--r--package/polkit/0002-jsauthority-memleak.patch28
-rw-r--r--package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch34
-rw-r--r--package/polkit/Config.in24
-rwxr-xr-xpackage/polkit/S50polkit51
-rw-r--r--package/polkit/polkit.hash4
-rw-r--r--package/polkit/polkit.mk17
-rw-r--r--package/portaudio/portaudio.hash2
-rw-r--r--package/portaudio/portaudio.mk6
-rw-r--r--package/postgis/Config.in4
-rw-r--r--package/postgis/postgis.hash2
-rw-r--r--package/postgis/postgis.mk2
-rw-r--r--package/postgresql/Config.in3
-rw-r--r--package/postgresql/postgresql.hash4
-rw-r--r--package/postgresql/postgresql.mk2
-rw-r--r--package/pppd/Config.in2
-rw-r--r--package/proftpd/Config.in1
-rw-r--r--package/prosody/prosody.hash8
-rw-r--r--package/prosody/prosody.mk2
-rw-r--r--package/protobuf/protobuf.hash2
-rw-r--r--package/protobuf/protobuf.mk2
-rw-r--r--package/proxychains-ng/0001-configure-fix-check_link_silent-test.patch41
-rw-r--r--package/proxychains-ng/proxychains-ng.hash6
-rw-r--r--package/proxychains-ng/proxychains-ng.mk5
-rw-r--r--package/pulseaudio/pulseaudio.mk1
-rw-r--r--package/putty/0002-New-option-to-reject-trivial-success-of-userauth.patch448
-rw-r--r--package/putty/putty.mk3
-rw-r--r--package/pwgen/pwgen.mk1
-rw-r--r--package/python-aioblescan/0001-Move-README-to-reStructured-text.patch35
-rw-r--r--package/python-aioblescan/python-aioblescan.hash4
-rw-r--r--package/python-aioblescan/python-aioblescan.mk4
-rw-r--r--package/python-aiodns/python-aiodns.hash6
-rw-r--r--package/python-aiodns/python-aiodns.mk4
-rw-r--r--package/python-aiohttp/python-aiohttp.hash4
-rw-r--r--package/python-aiohttp/python-aiohttp.mk4
-rw-r--r--package/python-asn1crypto/python-asn1crypto.hash6
-rw-r--r--package/python-asn1crypto/python-asn1crypto.mk4
-rw-r--r--package/python-augeas/0001-Use-CFFI-in-out-of-line-API-mode-49.patch101
-rw-r--r--package/python-augeas/Config.in8
-rw-r--r--package/python-augeas/python-augeas.hash3
-rw-r--r--package/python-augeas/python-augeas.mk21
-rw-r--r--package/python-autobahn/python-autobahn.mk2
-rw-r--r--package/python-bcrypt/Config.in2
-rw-r--r--package/python-bcrypt/python-bcrypt.hash6
-rw-r--r--package/python-bcrypt/python-bcrypt.mk4
-rw-r--r--package/python-bleak/Config.in2
-rw-r--r--package/python-bleak/python-bleak.hash4
-rw-r--r--package/python-bleak/python-bleak.mk4
-rw-r--r--package/python-bluezero/Config.in17
-rw-r--r--package/python-cbor2/Config.in1
-rw-r--r--package/python-cbor2/python-cbor2.hash4
-rw-r--r--package/python-cbor2/python-cbor2.mk4
-rw-r--r--package/python-cchardet/Config.in2
-rw-r--r--package/python-cchardet/python-cchardet.hash4
-rw-r--r--package/python-cchardet/python-cchardet.mk4
-rw-r--r--package/python-certifi/python-certifi.hash6
-rw-r--r--package/python-certifi/python-certifi.mk4
-rw-r--r--package/python-cffi/python-cffi.mk1
-rw-r--r--package/python-cheetah/python-cheetah.hash4
-rw-r--r--package/python-cheetah/python-cheetah.mk4
-rw-r--r--package/python-coherence/0001-Fix-twisted-detection.patch29
-rw-r--r--package/python-coherence/Config.in10
-rw-r--r--package/python-coherence/python-coherence.hash3
-rw-r--r--package/python-coherence/python-coherence.mk13
-rw-r--r--package/python-cryptography/Config.in10
-rw-r--r--package/python-cryptography/python-cryptography.hash6
-rw-r--r--package/python-cryptography/python-cryptography.mk5
-rw-r--r--package/python-cython/python-cython.hash4
-rw-r--r--package/python-cython/python-cython.mk4
-rw-r--r--package/python-dataproperty/Config.in3
-rw-r--r--package/python-dataproperty/python-dataproperty.hash4
-rw-r--r--package/python-dataproperty/python-dataproperty.mk4
-rw-r--r--package/python-dbus-next/Config.in9
-rw-r--r--package/python-dbus-next/python-dbus-next.hash5
-rw-r--r--package/python-dbus-next/python-dbus-next.mk14
-rw-r--r--package/python-django/python-django.hash4
-rw-r--r--package/python-django/python-django.mk4
-rw-r--r--package/python-docker/Config.in8
-rw-r--r--package/python-engineio/python-engineio.mk1
-rw-r--r--package/python-esptool/0001-setup.py-require-wheel-only-when-installing-from-pip.patch36
-rw-r--r--package/python-esptool/python-esptool.hash4
-rw-r--r--package/python-esptool/python-esptool.mk4
-rw-r--r--package/python-falcon/python-falcon.hash4
-rw-r--r--package/python-falcon/python-falcon.mk4
-rw-r--r--package/python-flatbuffers/python-flatbuffers.hash4
-rw-r--r--package/python-flatbuffers/python-flatbuffers.mk4
-rw-r--r--package/python-hyperlink/Config.in1
-rw-r--r--package/python-ibmiotf/Config.in4
-rw-r--r--package/python-idna/Config.in4
-rw-r--r--package/python-idna/python-idna.hash6
-rw-r--r--package/python-idna/python-idna.mk6
-rw-r--r--package/python-influxdb/Config.in1
-rw-r--r--package/python-keyring/python-keyring.mk2
-rw-r--r--package/python-m2crypto/python-m2crypto.hash4
-rw-r--r--package/python-m2crypto/python-m2crypto.mk4
-rw-r--r--package/python-markdown/python-markdown.hash4
-rw-r--r--package/python-markdown/python-markdown.mk4
-rw-r--r--package/python-mwclient/Config.in1
-rw-r--r--package/python-paramiko/Config.in5
-rw-r--r--package/python-passlib/Config.in2
-rw-r--r--package/python-passlib/python-passlib.hash6
-rw-r--r--package/python-passlib/python-passlib.mk4
-rw-r--r--package/python-pillow/python-pillow.hash7
-rw-r--r--package/python-pillow/python-pillow.mk27
-rw-r--r--package/python-pip/python-pip.mk1
-rw-r--r--package/python-protobuf/python-protobuf.hash2
-rw-r--r--package/python-pycares/python-pycares.hash6
-rw-r--r--package/python-pycares/python-pycares.mk4
-rw-r--r--package/python-pycparser/python-pycparser.mk1
-rw-r--r--package/python-pymupdf/Config.in22
-rw-r--r--package/python-pymupdf/python-pymupdf.hash5
-rw-r--r--package/python-pymupdf/python-pymupdf.mk29
-rw-r--r--package/python-pyopenssl/Config.in1
-rw-r--r--package/python-pysftp/Config.in1
-rw-r--r--package/python-pysmb/python-pysmb.hash6
-rw-r--r--package/python-pysmb/python-pysmb.mk4
-rw-r--r--package/python-pytest-asyncio/python-pytest-asyncio.hash4
-rw-r--r--package/python-pytest-asyncio/python-pytest-asyncio.mk4
-rw-r--r--package/python-remi/python-remi.hash2
-rw-r--r--package/python-remi/python-remi.mk4
-rw-r--r--package/python-requests-oauthlib/Config.in1
-rw-r--r--package/python-requests-toolbelt/Config.in1
-rw-r--r--package/python-requests/Config.in8
-rw-r--r--package/python-requests/python-requests.mk2
-rw-r--r--package/python-rpi-ws281x/0001-ws2811.c-fix-build-with-gcc-4.8.patch51
-rw-r--r--package/python-rpi-ws281x/python-rpi-ws281x.hash4
-rw-r--r--package/python-rpi-ws281x/python-rpi-ws281x.mk4
-rw-r--r--package/python-service-identity/Config.in2
-rw-r--r--package/python-six/python-six.mk1
-rw-r--r--package/python-tqdm/python-tqdm.mk2
-rw-r--r--package/python-treq/Config.in1
-rw-r--r--package/python-twisted/Config.in1
-rw-r--r--package/python-txdbus/Config.in1
-rw-r--r--package/python-txtorcon/Config.in2
-rw-r--r--package/python-typing/python-typing.hash4
-rw-r--r--package/python-typing/python-typing.mk4
-rw-r--r--package/python-ubjson/python-ubjson.hash6
-rw-r--r--package/python-ubjson/python-ubjson.mk4
-rw-r--r--package/python-urllib3/python-urllib3.hash4
-rw-r--r--package/python-urllib3/python-urllib3.mk4
-rw-r--r--package/python/python.mk3
l---------package/python3-cffi/python3-cffi.hash1
-rw-r--r--package/python3-cffi/python3-cffi.mk29
-rw-r--r--package/python3-cheetah/python3-cheetah.mk4
l---------package/python3-cryptography/python3-cryptography.hash1
-rw-r--r--package/python3-cryptography/python3-cryptography.mk24
-rw-r--r--package/python3-cython/python3-cython.mk4
l---------package/python3-pip/python3-pip.hash1
-rw-r--r--package/python3-pip/python3-pip.mk19
l---------package/python3-pycparser/python3-pycparser.hash1
-rw-r--r--package/python3-pycparser/python3-pycparser.mk17
-rw-r--r--package/python3-requests/python3-requests.mk2
l---------package/python3-six/python3-six.hash1
-rw-r--r--package/python3-six/python3-six.mk17
-rw-r--r--package/python3/0001-Make-the-build-of-pyc-files-conditional.patch6
-rw-r--r--package/python3/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch2
-rw-r--r--package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch10
-rw-r--r--package/python3/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch2
-rw-r--r--package/python3/0006-Don-t-add-multiarch-paths.patch2
-rw-r--r--package/python3/0007-Abort-on-failed-module-build.patch2
-rw-r--r--package/python3/0011-Override-system-locale-and-set-to-default-when-addin.patch2
-rw-r--r--package/python3/0012-Add-importlib-fix-for-PEP-3147-issue.patch6
-rw-r--r--package/python3/0013-Add-an-option-to-disable-installation-of-test-module.patch6
-rw-r--r--package/python3/0014-Add-an-option-to-disable-pydoc.patch12
-rw-r--r--package/python3/0015-Add-an-option-to-disable-lib2to3.patch14
-rw-r--r--package/python3/0016-Add-option-to-disable-the-sqlite3-module.patch8
-rw-r--r--package/python3/0017-Add-an-option-to-disable-the-tk-module.patch8
-rw-r--r--package/python3/0018-Add-an-option-to-disable-the-curses-module.patch6
-rw-r--r--package/python3/0019-Add-an-option-to-disable-expat.patch8
-rw-r--r--package/python3/0020-Add-an-option-to-disable-CJK-codecs.patch2
-rw-r--r--package/python3/0021-Add-an-option-to-disable-NIS.patch2
-rw-r--r--package/python3/0022-Add-an-option-to-disable-unicodedata.patch2
-rw-r--r--package/python3/0023-Add-an-option-to-disable-IDLE.patch10
-rw-r--r--package/python3/0024-Add-an-option-to-disable-decimal.patch4
-rw-r--r--package/python3/0025-Add-an-option-to-disable-the-ossaudiodev-module.patch2
-rw-r--r--package/python3/0026-Add-an-option-to-disable-openssl-support.patch2
-rw-r--r--package/python3/0027-Add-an-option-to-disable-the-readline-module.patch2
-rw-r--r--package/python3/0028-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch2
-rw-r--r--package/python3/0030-Fix-cross-compiling-the-uuid-module.patch2
-rw-r--r--package/python3/0031-Add-an-option-to-disable-uuid-module.patch2
-rw-r--r--package/python3/0033-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch2
-rw-r--r--package/python3/0034-Add-an-option-to-disable-the-berkeleydb-module.patch30
-rw-r--r--package/python3/0035-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch (renamed from package/python3/0034-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch)0
-rw-r--r--package/python3/Config.in6
-rw-r--r--package/python3/python3.hash6
-rw-r--r--package/python3/python3.mk8
-rw-r--r--package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch2
-rw-r--r--package/qemu/0002-Fix-build-with-64-bits-time_t.patch4
-rw-r--r--package/qemu/0003-hw-usb-host-libusb.c-fix-build-with-kernel-5.0.patch43
-rw-r--r--package/qemu/0003-meson-add-tests-option.patch (renamed from package/qemu/0004-meson-add-tests-option.patch)54
-rw-r--r--package/qemu/Config.in.host1
-rw-r--r--package/qemu/qemu.hash2
-rw-r--r--package/qemu/qemu.mk4
-rw-r--r--package/qpdf/qpdf.mk1
-rw-r--r--package/qpid-proton/0001-c-src-proactor-epoll-internal.h-fix-build-on-musl.patch43
-rw-r--r--package/qpid-proton/0002-PROTON-2355-Fix-build-with-DPROACTOR-none.patch61
-rw-r--r--package/qpid-proton/qpid-proton.hash4
-rw-r--r--package/qpid-proton/qpid-proton.mk6
-rw-r--r--package/qt5/qt5base/0006-Fix-build-with-GCC-11-include-limits.patch53
-rw-r--r--package/qt5/qt5base/0007-Build-fixes-for-GCC-11.patch61
-rw-r--r--package/qt5/qt5base/0008-Add-missing-limits-include.patch32
-rw-r--r--package/qt5/qt5base/Config.in1
-rw-r--r--package/qt5/qt5base/qt5base.mk2
-rw-r--r--package/raspberrypi-usbboot/0001-Makefile-allow-passing-CFLAGS-LDFLAGS.patch18
-rw-r--r--package/raspberrypi-usbboot/0002-Makefile-add-DESTDIR-support.patch51
-rw-r--r--package/raspberrypi-usbboot/0003-main.c-rework-logic-to-find-def1-def2-and-def3-files.patch127
-rw-r--r--package/raspberrypi-usbboot/Config.in.host4
-rw-r--r--package/raspberrypi-usbboot/raspberrypi-usbboot.hash5
-rw-r--r--package/raspberrypi-usbboot/raspberrypi-usbboot.mk7
-rw-r--r--package/re2/re2.hash2
-rw-r--r--package/re2/re2.mk2
-rw-r--r--package/redis/redis.hash2
-rw-r--r--package/redis/redis.mk2
-rw-r--r--package/refpolicy/refpolicy.mk2
-rw-r--r--package/resiprocate/Config.in1
-rw-r--r--package/restorecond/restorecond.hash2
-rw-r--r--package/restorecond/restorecond.mk4
-rw-r--r--package/rhash/0001-configure-allow-cross-compilation.patch57
-rw-r--r--package/rhash/0002-configure-add-uclinux-target.patch36
-rw-r--r--package/rhash/Config.in1
-rw-r--r--package/rhash/rhash.hash6
-rw-r--r--package/rhash/rhash.mk2
-rw-r--r--package/ripgrep/ripgrep.mk3
-rw-r--r--package/rocksdb/0001-build_tools-build_detect_platform-fix-C-tests.patch96
-rw-r--r--package/rocksdb/0002-POWER7-8-compatiblity-fix-CRC32-C-implementation.patch3787
-rw-r--r--package/rocksdb/Config.in10
-rw-r--r--package/rocksdb/rocksdb.hash4
-rw-r--r--package/rocksdb/rocksdb.mk2
-rw-r--r--package/rpcbind/0001-Remove-yellow-pages-support.patch22
-rw-r--r--package/rpcbind/rpcbind.hash2
-rw-r--r--package/rpcbind/rpcbind.mk12
-rw-r--r--package/rpcbind/rpcbind.service10
-rw-r--r--package/rpcbind/rpcbind.socket8
-rw-r--r--package/rpi-firmware/rpi-firmware.hash2
-rw-r--r--package/rpi-firmware/rpi-firmware.mk2
-rw-r--r--package/rpi-userland/rpi-userland.hash2
-rw-r--r--package/rpi-userland/rpi-userland.mk2
-rw-r--r--package/rsync/0001-rsync-ssl-Verify-the-hostname-in-the-certificate-when-using-openssl.patch29
-rw-r--r--package/rsync/rsync.mk3
-rw-r--r--package/rt-tests/0002-Makefile-drop-explicit-undefine-PYLIB-for-compatibil.patch48
-rw-r--r--package/rtl8189fs/0001-include-disable-debug-messages.patch28
-rw-r--r--package/rtl8189fs/rtl8189fs.hash2
-rw-r--r--package/rtl8189fs/rtl8189fs.mk2
-rw-r--r--package/rtl8812au-aircrack-ng/Config.in10
-rw-r--r--package/rtl8812au-aircrack-ng/rtl8812au-aircrack-ng.hash3
-rw-r--r--package/rtl8812au-aircrack-ng/rtl8812au-aircrack-ng.mk18
-rw-r--r--package/rtty/rtty.hash2
-rw-r--r--package/rtty/rtty.mk2
-rw-r--r--package/runc/runc.hash2
-rw-r--r--package/runc/runc.mk2
-rw-r--r--package/rust-bin/rust-bin.hash48
-rw-r--r--package/rustc/Config.in.host104
-rw-r--r--package/rustc/rustc.mk2
-rw-r--r--package/s390-tools/0001-cpumf-lshwc-Fix-compile-errors-due-to-use-of-non-sta.patch135
-rw-r--r--package/s390-tools/0001-osasnmpd-Makefile-fix-cross-compilation.patch41
-rw-r--r--package/s390-tools/0002-cpumf-lshwc-Fix-compile-errors-due-to-use-of-non-sta.patch49
-rw-r--r--package/s390-tools/0002-zkey-Fix-build-error-when-the-compiler-flags-are-overridden.patch54
-rw-r--r--package/s390-tools/s390-tools.hash2
-rw-r--r--package/s390-tools/s390-tools.mk2
-rw-r--r--package/samba4/samba4.hash4
-rw-r--r--package/samba4/samba4.mk2
-rw-r--r--package/sane-backends/0004-backend-microtek-fix-uclibc-compile-include-stdarg.h.patch58
-rw-r--r--package/sane-backends/0005-backend-sm3600-scanutil-fix-uclibc-compile-include-s.patch59
-rw-r--r--package/sbc/0001-sbc_primitives-Fix-build-on-non-x86.patch49
-rw-r--r--package/sbc/sbc.hash6
-rw-r--r--package/sbc/sbc.mk2
-rw-r--r--package/seatd/0001-meson-Support-building-builtin-without-seatd.patch37
-rw-r--r--package/seatd/0002-Add-no-op-session.patch223
-rw-r--r--package/seatd/Config.in22
-rwxr-xr-xpackage/seatd/S70seatd46
-rw-r--r--package/seatd/seatd.hash5
-rw-r--r--package/seatd/seatd.mk53
-rw-r--r--package/selinux-python/selinux-python.hash2
-rw-r--r--package/selinux-python/selinux-python.mk4
-rw-r--r--package/semodule-utils/semodule-utils.hash2
-rw-r--r--package/semodule-utils/semodule-utils.mk4
-rw-r--r--package/setools/0001-Do-not-export-use-setools.InfoFlowAnalysis-and-setoo.patch (renamed from package/setools/0002-Do-not-export-use-setools.InfoFlowAnalysis-and-setoo.patch)19
-rw-r--r--package/setools/0001-remove-werror-flag-from-setup.patch31
-rw-r--r--package/setools/setools.hash2
-rw-r--r--package/setools/setools.mk2
-rw-r--r--package/shellinabox/shellinabox.mk1
-rw-r--r--package/slirp/0001-slirp-check-pkt_len-before-reading-protocol-header.patch60
-rw-r--r--package/slirp/slirp.hash2
-rw-r--r--package/slirp/slirp.mk9
-rw-r--r--package/snmppp/Config.in1
-rw-r--r--package/snort3/Config.in42
-rw-r--r--package/snort3/snort3.hash6
-rw-r--r--package/snort3/snort3.mk57
-rw-r--r--package/sofia-sip/sofia-sip.mk4
-rw-r--r--package/softether/Config.in3
-rw-r--r--package/solarus/0002-Add-a-basic-FindOpenGLES2.cmake.patch48
-rw-r--r--package/solarus/Config.in2
-rw-r--r--package/solarus/solarus.mk9
-rw-r--r--package/spi-tools/spi-tools.hash2
-rw-r--r--package/spi-tools/spi-tools.mk2
-rw-r--r--package/spice/spice.hash2
-rw-r--r--package/spice/spice.mk7
-rw-r--r--package/spidermonkey/0001-allow-newer-autoconf-versions.patch61
-rw-r--r--package/spidermonkey/0002-allow-building-in-tree.patch47
-rw-r--r--package/spidermonkey/0003-allow-unknown-configuration-options.patch35
-rw-r--r--package/spidermonkey/0004-fix-building-with-musl.patch133
-rw-r--r--package/spidermonkey/0005-add-riscv-support.patch121
-rw-r--r--package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch34
-rw-r--r--package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch144
-rw-r--r--package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch66
-rw-r--r--package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch100
-rw-r--r--package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch103
-rw-r--r--package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch28
-rw-r--r--package/spidermonkey/Config.in60
-rw-r--r--package/spidermonkey/spidermonkey.hash3
-rw-r--r--package/spidermonkey/spidermonkey.mk64
-rw-r--r--package/sqlite/Config.in2
-rw-r--r--package/sqlite/sqlite.hash2
-rw-r--r--package/sqlite/sqlite.mk4
-rw-r--r--package/squid/squid.hash8
-rw-r--r--package/squid/squid.mk2
-rw-r--r--package/stellarium/stellarium.hash4
-rw-r--r--package/stellarium/stellarium.mk2
-rw-r--r--package/stm32flash/stm32flash.hash2
-rw-r--r--package/stm32flash/stm32flash.mk2
-rw-r--r--package/strace/0001-disable_ptrace_get_syscall_info-disable_ptrace_getre.patch33
-rw-r--r--package/strace/Config.in6
-rw-r--r--package/strace/strace.hash4
-rw-r--r--package/strace/strace.mk2
-rw-r--r--package/stunnel/stunnel.hash4
-rw-r--r--package/stunnel/stunnel.mk3
-rw-r--r--package/supervisor/supervisor.mk1
-rw-r--r--package/suricata/suricata.hash2
-rw-r--r--package/suricata/suricata.mk2
-rw-r--r--package/swupdate/0001-diskpart-force-kernel-to-reread-partition-table.patch32
-rw-r--r--package/swupdate/0002-Shellscript-stops-before-completing.patch52
-rw-r--r--package/swupdate/swupdate.hash17
-rw-r--r--package/swupdate/swupdate.mk42
-rw-r--r--package/synergy/synergy.mk1
-rw-r--r--package/syslog-ng/syslog-ng.conf2
-rw-r--r--package/syslog-ng/syslog-ng.hash2
-rw-r--r--package/syslog-ng/syslog-ng.mk2
-rw-r--r--package/sysrepo/sysrepo.mk9
-rw-r--r--package/systemd/0001-Add-meson-option-to-disable-urlify.patch67
-rw-r--r--package/systemd/Config.in43
-rw-r--r--package/systemd/systemd.hash4
-rw-r--r--package/systemd/systemd.mk28
-rw-r--r--package/taglib/taglib.mk1
-rw-r--r--package/tclap/tclap.mk1
-rw-r--r--package/tcpdump/tcpdump.hash4
-rw-r--r--package/tcpdump/tcpdump.mk2
-rw-r--r--package/terminology/terminology.mk1
-rw-r--r--package/thermald/thermald.mk1
-rw-r--r--package/thrift/thrift.hash6
-rw-r--r--package/thrift/thrift.mk5
-rw-r--r--package/tiff/tiff.hash4
-rw-r--r--package/tiff/tiff.mk2
-rw-r--r--package/tini/tini.mk1
-rw-r--r--package/tinyproxy/tinyproxy.hash3
-rw-r--r--package/tinyproxy/tinyproxy.mk6
-rw-r--r--package/tinyxml2/tinyxml2.mk1
-rw-r--r--package/tor/tor.hash2
-rw-r--r--package/tor/tor.mk3
-rw-r--r--package/tpm-tools/Config.in1
-rw-r--r--package/tpm2-pkcs11/tpm2-pkcs11.hash2
-rw-r--r--package/tpm2-pkcs11/tpm2-pkcs11.mk2
-rw-r--r--package/tpm2-tools/Config.in7
-rw-r--r--package/tpm2-tools/tpm2-tools.hash4
-rw-r--r--package/tpm2-tools/tpm2-tools.mk7
-rw-r--r--package/tpm2-tss/tpm2-tss.mk2
-rw-r--r--package/transmission/Config.in1
-rw-r--r--package/trinity/0002-net-proto-ip-raw.c-fix-build-with-kernel-5.13.patch37
-rw-r--r--package/trinity/trinity.mk1
-rw-r--r--package/tvheadend/Config.in1
-rw-r--r--package/uacme/uacme.hash2
-rw-r--r--package/uacme/uacme.mk2
-rw-r--r--package/uboot-tools/uboot-tools.hash2
-rw-r--r--package/uboot-tools/uboot-tools.mk7
-rw-r--r--package/uclibc/0001-powerpc-fix-PIE-PIC-builds-with-newer-gcc-binutils-w.patch91
-rw-r--r--package/uclibc/Config.in3
-rw-r--r--package/uclibc/uclibc.mk2
-rw-r--r--package/udisks/0001-fix-build-with-newer-glibc-versions.patch29
-rw-r--r--package/udisks/0002-Fix-systemd-service-file.patch33
-rw-r--r--package/udisks/0003-Fix-compilation-issue-with-missing-sys-sysmacros.h-i.patch81
-rw-r--r--package/udisks/Config.in51
-rw-r--r--package/udisks/udisks.hash4
-rw-r--r--package/udisks/udisks.mk32
-rw-r--r--package/uftrace/Config.in5
-rw-r--r--package/uhd/Config.in4
-rw-r--r--package/unscd/Config.in2
-rw-r--r--package/usbguard/Config.in24
-rw-r--r--package/usbguard/S20usbguard37
-rw-r--r--package/usbguard/usbguard.hash3
-rw-r--r--package/usbguard/usbguard.mk66
-rw-r--r--package/uvw/uvw.hash4
-rw-r--r--package/uvw/uvw.mk2
-rw-r--r--package/vala/0001-dont-add-dirty-to-valac-version.patch17
-rw-r--r--package/vala/vala.hash4
-rw-r--r--package/vala/vala.mk4
-rw-r--r--package/vlc/0002-automake-add-subdir-objects-option.patch (renamed from package/vlc/0003-automake-add-subdir-objects-option.patch)0
-rw-r--r--package/vlc/0002-lua-Define-LUA_COMPAT_APIINTCASTS-for-Lua-5.3.0-comp.patch41
-rw-r--r--package/vlc/0003-build-use-pkg-config-to-get-tremor-libs.patch (renamed from package/vlc/0004-build-use-pkg-config-to-get-tremor-libs.patch)0
-rw-r--r--package/vlc/0004-Fix-build-error-using-uClibc-by-adding-sys-types.h.patch (renamed from package/vlc/0005-Fix-build-error-using-uClibc-by-adding-sys-types.h.patch)0
-rw-r--r--package/vlc/0005-Don-t-assume-strerror_l-is-available.patch (renamed from package/vlc/0006-Don-t-assume-strerror_l-is-available.patch)0
-rw-r--r--package/vlc/0006-posix-remove-ancient-run-time-fallback-to-real-time-.patch (renamed from package/vlc/0007-posix-remove-ancient-run-time-fallback-to-real-time-.patch)0
-rw-r--r--package/vlc/0007-Add-support-for-freerdp2.patch (renamed from package/vlc/0008-Add-support-for-freerdp2.patch)0
-rw-r--r--package/vlc/0008-configure.ac-also-use-AC_PATH_PROG-to-check-for-wayl.patch (renamed from package/vlc/0009-configure.ac-also-use-AC_PATH_PROG-to-check-for-wayl.patch)0
-rw-r--r--package/vlc/0009-modules-video_filter-opencv_example.cpp-fix-build-wi.patch (renamed from package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch)0
-rw-r--r--package/vlc/0010-modules-access-live555.cpp-fix-build-with-live555-20.patch36
-rw-r--r--package/vlc/Config.in2
-rw-r--r--package/vlc/vlc.hash8
-rw-r--r--package/vlc/vlc.mk2
-rw-r--r--package/vtun/Config.in1
-rw-r--r--package/wayland/0001-build-add-option-to-disable-tests.patch74
-rw-r--r--package/wayland/0002-meson-do-not-check-for-c.patch29
-rw-r--r--package/wayland/0002-meson-only-require-cpp-for-tests.patch59
-rw-r--r--package/wayland/wayland.hash8
-rw-r--r--package/wayland/wayland.mk2
-rw-r--r--package/waylandpp/Config.in6
-rw-r--r--package/webkitgtk/Config.in15
-rw-r--r--package/webkitgtk/webkitgtk.hash8
-rw-r--r--package/webkitgtk/webkitgtk.mk3
-rw-r--r--package/weston/Config.in25
-rw-r--r--package/weston/weston.mk32
-rw-r--r--package/wget/Config.in2
-rw-r--r--package/wireless-regdb/wireless-regdb.hash2
-rw-r--r--package/wireless-regdb/wireless-regdb.mk2
-rw-r--r--package/wireshark/wireshark.hash6
-rw-r--r--package/wireshark/wireshark.mk2
-rw-r--r--package/wlroots/Config.in3
-rw-r--r--package/wlroots/wlroots.hash4
-rw-r--r--package/wlroots/wlroots.mk25
-rw-r--r--package/wpa_supplicant/0003-Include-stdbool.h-to-allow-C99-bool-to-be-used.patch32
-rw-r--r--package/wpa_supplicant/0004-ASN.1-Add-helper-functions-for-recognizing-tag-value.patch37
-rw-r--r--package/wpa_supplicant/Config.in2
-rw-r--r--package/wpebackend-fdo/wpebackend-fdo.hash8
-rw-r--r--package/wpebackend-fdo/wpebackend-fdo.mk2
-rw-r--r--package/wpewebkit/0001-Add-ldp-and-stp-support-for-FP-registers-plus-some-b.patch382
-rw-r--r--package/wpewebkit/0001-Fix-build-with-musl.patch79
-rw-r--r--package/wpewebkit/Config.in3
-rw-r--r--package/wpewebkit/wpewebkit.hash8
-rw-r--r--package/wpewebkit/wpewebkit.mk2
-rw-r--r--package/x11r7/libxcb/libxcb.mk1
-rw-r--r--package/x11r7/xdriver_xf86-video-fbturbo/0002-Use-own-thunk-functions-instead-of-fbdevHW-Weak.patch160
-rw-r--r--package/x11r7/xdriver_xf86-video-fbturbo/0003-Update-for-1.20-ABI.patch30
-rw-r--r--package/x11r7/xdriver_xf86-video-fbturbo/0004-xorg.conf-add-mandatory-modules-fb-shadow-fbdevhw.patch53
-rw-r--r--package/x11r7/xdriver_xf86-video-intel/xdriver_xf86-video-intel.hash2
-rw-r--r--package/x11r7/xdriver_xf86-video-intel/xdriver_xf86-video-intel.mk3
-rw-r--r--package/x11r7/xlib_libFS/xlib_libFS.mk2
-rw-r--r--package/x11r7/xlib_libICE/xlib_libICE.mk2
-rw-r--r--package/x11r7/xlib_libX11/xlib_libX11.hash6
-rw-r--r--package/x11r7/xlib_libX11/xlib_libX11.mk2
-rw-r--r--package/x11r7/xlib_libXcursor/xlib_libXcursor.mk2
-rw-r--r--package/x11r7/xlib_libXdmcp/xlib_libXdmcp.mk2
-rw-r--r--package/x11r7/xlib_libXext/xlib_libXext.mk2
-rw-r--r--package/x11r7/xlib_libXfixes/xlib_libXfixes.hash5
-rw-r--r--package/x11r7/xlib_libXfixes/xlib_libXfixes.mk4
-rw-r--r--package/x11r7/xlib_libXfont2/xlib_libXfont2.mk2
-rw-r--r--package/x11r7/xlib_libXinerama/xlib_libXinerama.mk2
-rw-r--r--package/x11r7/xlib_libXpm/xlib_libXpm.mk2
-rw-r--r--package/x11r7/xlib_libXres/xlib_libXres.mk2
-rw-r--r--package/x11r7/xlib_libXt/xlib_libXt.mk2
-rw-r--r--package/x11r7/xlib_libXtst/xlib_libXtst.mk2
-rw-r--r--package/x11r7/xlib_libXxf86dga/xlib_libXxf86dga.mk2
-rw-r--r--package/x11r7/xlib_libXxf86vm/xlib_libXxf86vm.mk2
-rw-r--r--package/x11r7/xlib_libdmx/xlib_libdmx.mk2
-rw-r--r--package/x11vnc/Config.in3
-rw-r--r--package/xmrig/Config.in22
-rw-r--r--package/xmrig/xmrig.hash3
-rw-r--r--package/xmrig/xmrig.mk43
-rw-r--r--package/xterm/xterm.hash2
-rw-r--r--package/xterm/xterm.mk2
-rw-r--r--package/zfs/zfs.hash4
-rw-r--r--package/zfs/zfs.mk2
-rw-r--r--package/zmqpp/zmqpp.mk2
-rw-r--r--package/znc/Config.in1
-rw-r--r--package/zstd/zstd.hash4
-rw-r--r--package/zstd/zstd.mk13
1365 files changed, 19013 insertions, 17621 deletions
diff --git a/package/Config.in b/package/Config.in
index 82b28d2835..12b1323fc2 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -109,6 +109,7 @@ menu "Debugging, profiling and benchmark"
source "package/kvm-unit-tests/Config.in"
source "package/kyua/Config.in"
source "package/latencytop/Config.in"
+ source "package/libbpf/Config.in"
source "package/lmbench/Config.in"
source "package/lsof/Config.in"
source "package/ltp-testsuite/Config.in"
@@ -126,6 +127,7 @@ menu "Debugging, profiling and benchmark"
source "package/pcm-tools/Config.in"
source "package/piglit/Config.in"
source "package/ply/Config.in"
+ source "package/poke/Config.in"
source "package/ptm2human/Config.in"
source "package/pv/Config.in"
source "package/racehound/Config.in"
@@ -194,6 +196,7 @@ menu "Filesystem and flash utilities"
source "package/aufs/Config.in"
source "package/aufs-util/Config.in"
source "package/autofs/Config.in"
+ source "package/bmap-tools/Config.in"
source "package/btrfs-progs/Config.in"
source "package/cifs-utils/Config.in"
source "package/cpio/Config.in"
@@ -373,6 +376,7 @@ comment "X applications"
source "package/gtkperf/Config.in"
source "package/leafpad/Config.in"
source "package/midori/Config.in"
+ source "package/mupdf/Config.in"
source "package/nodm/Config.in"
source "package/pcmanfm/Config.in"
source "package/qt-webkit-kiosk/Config.in"
@@ -460,6 +464,7 @@ endmenu
source "package/dvb-apps/Config.in"
source "package/dvbsnoop/Config.in"
source "package/edid-decode/Config.in"
+ source "package/edk2-platforms/Config.in"
source "package/eudev/Config.in"
source "package/ev3dev-linux-drivers/Config.in"
source "package/evemu/Config.in"
@@ -544,6 +549,7 @@ endmenu
source "package/rtl8189fs/Config.in"
source "package/rtl8723bs/Config.in"
source "package/rtl8723bu/Config.in"
+ source "package/rtl8812au-aircrack-ng/Config.in"
source "package/rtl8821au/Config.in"
source "package/sane-backends/Config.in"
source "package/sdparm/Config.in"
@@ -582,6 +588,7 @@ endmenu
source "package/upower/Config.in"
source "package/usb_modeswitch/Config.in"
source "package/usb_modeswitch_data/Config.in"
+ source "package/usbguard/Config.in"
source "package/usbmount/Config.in"
source "package/usbutils/Config.in"
source "package/w_scan/Config.in"
@@ -673,6 +680,7 @@ menu "Lua libraries/modules"
source "package/lua-livr-extra/Config.in"
source "package/lua-lpeg-patterns/Config.in"
source "package/lua-lunitx/Config.in"
+ source "package/lua-lunix/Config.in"
source "package/lua-lyaml/Config.in"
source "package/lua-markdown/Config.in"
source "package/lua-messagepack/Config.in"
@@ -689,6 +697,7 @@ menu "Lua libraries/modules"
source "package/lua-testmore/Config.in"
source "package/lua-utf8/Config.in"
source "package/lua-valua/Config.in"
+ source "package/lua-zlib/Config.in"
source "package/luabitop/Config.in"
source "package/luadbi/Config.in"
source "package/luadbi-sqlite3/Config.in"
@@ -902,6 +911,7 @@ menu "External python modules"
source "package/python-async-lru/Config.in"
source "package/python-async-timeout/Config.in"
source "package/python-attrs/Config.in"
+ source "package/python-augeas/Config.in"
source "package/python-autobahn/Config.in"
source "package/python-automat/Config.in"
source "package/python-avro/Config.in"
@@ -938,7 +948,6 @@ menu "External python modules"
source "package/python-cheroot/Config.in"
source "package/python-cherrypy/Config.in"
source "package/python-click/Config.in"
- source "package/python-coherence/Config.in"
source "package/python-colorama/Config.in"
source "package/python-colorlog/Config.in"
source "package/python-colorzero/Config.in"
@@ -960,6 +969,7 @@ menu "External python modules"
source "package/python-daphne/Config.in"
source "package/python-dataproperty/Config.in"
source "package/python-dateutil/Config.in"
+ source "package/python-dbus-next/Config.in"
source "package/python-decorator/Config.in"
source "package/python-defusedxml/Config.in"
source "package/python-dialog/Config.in"
@@ -1133,6 +1143,7 @@ menu "External python modules"
source "package/python-pylibftdi/Config.in"
source "package/python-pylru/Config.in"
source "package/python-pymodbus/Config.in"
+ source "package/python-pymupdf/Config.in"
source "package/python-pymysql/Config.in"
source "package/python-pynacl/Config.in"
source "package/python-pyopenssl/Config.in"
@@ -1285,6 +1296,7 @@ menu "Libraries"
menu "Audio/Sound"
source "package/alsa-lib/Config.in"
+ source "package/alsa-plugins/Config.in"
source "package/alure/Config.in"
source "package/aubio/Config.in"
source "package/bcg729/Config.in"
@@ -1625,7 +1637,6 @@ endif
source "package/jszip/Config.in"
source "package/openlayers/Config.in"
source "package/popperjs/Config.in"
- source "package/spidermonkey/Config.in"
source "package/vuejs/Config.in"
endmenu
@@ -1725,6 +1736,7 @@ menu "Networking"
source "package/curlpp/Config.in"
source "package/czmq/Config.in"
source "package/daq/Config.in"
+ source "package/daq3/Config.in"
source "package/davici/Config.in"
source "package/enet/Config.in"
source "package/filemq/Config.in"
@@ -1788,6 +1800,7 @@ menu "Networking"
source "package/libpagekite/Config.in"
source "package/libpcap/Config.in"
source "package/libpjsip/Config.in"
+ source "package/libpsl/Config.in"
source "package/librelp/Config.in"
source "package/librsync/Config.in"
source "package/libshairplay/Config.in"
@@ -1889,6 +1902,7 @@ menu "Other"
source "package/gobject-introspection/Config.in"
source "package/gsl/Config.in"
source "package/gtest/Config.in"
+ source "package/gumbo-parser/Config.in"
source "package/jemalloc/Config.in"
source "package/lapack/Config.in"
source "package/libabseil-cpp/Config.in"
@@ -1930,6 +1944,7 @@ menu "Other"
source "package/libpthread-stubs/Config.in"
source "package/libpthsem/Config.in"
source "package/libpwquality/Config.in"
+ source "package/libqb/Config.in"
source "package/libseccomp/Config.in"
source "package/libsigc/Config.in"
source "package/libsigsegv/Config.in"
@@ -2057,6 +2072,7 @@ menu "Miscellaneous"
source "package/sunwait/Config.in"
source "package/taskd/Config.in"
source "package/wine/Config.in"
+ source "package/xmrig/Config.in"
source "package/xutil_util-macros/Config.in"
endmenu
@@ -2274,6 +2290,7 @@ endif
source "package/sngrep/Config.in"
source "package/snmpclitools/Config.in"
source "package/snort/Config.in"
+ source "package/snort3/Config.in"
source "package/socat/Config.in"
source "package/socketcand/Config.in"
source "package/softether/Config.in"
@@ -2381,6 +2398,7 @@ comment "Shells"
source "package/mksh/Config.in"
source "package/zsh/Config.in"
comment "Utilities"
+ source "package/apg/Config.in"
source "package/at/Config.in"
source "package/bash-completion/Config.in"
source "package/ccrypt/Config.in"
@@ -2455,6 +2473,7 @@ menu "System tools"
source "package/kmod/Config.in"
source "package/kvmtool/Config.in"
source "package/libostree/Config.in"
+ source "package/libvirt/Config.in"
source "package/lxc/Config.in"
source "package/makedumpfile/Config.in"
source "package/mender/Config.in"
@@ -2489,6 +2508,7 @@ menu "System tools"
source "package/scrub/Config.in"
source "package/scrypt/Config.in"
source "package/sdbusplus/Config.in"
+ source "package/seatd/Config.in"
source "package/smack/Config.in"
source "package/start-stop-daemon/Config.in"
source "package/supervisor/Config.in"
diff --git a/package/Config.in.host b/package/Config.in.host
index ba6a68c728..8d443ea255 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -5,6 +5,7 @@ menu "Host utilities"
source "package/android-tools/Config.in.host"
source "package/asn1c/Config.in.host"
source "package/babeltrace2/Config.in.host"
+ source "package/bmap-tools/Config.in.host"
source "package/btrfs-progs/Config.in.host"
source "package/cbootimage/Config.in.host"
source "package/checkpolicy/Config.in.host"
@@ -39,6 +40,7 @@ menu "Host utilities"
source "package/imagemagick/Config.in.host"
source "package/imx-mkimage/Config.in.host"
source "package/imx-usb-loader/Config.in.host"
+ source "package/jh71xx-tools/Config.in.host"
source "package/jq/Config.in.host"
source "package/jsmin/Config.in.host"
source "package/kmod/Config.in.host"
diff --git a/package/Makefile.in b/package/Makefile.in
index f4028bc67c..86db62ba5b 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -136,6 +136,9 @@ endif
ifeq ($(BR2_OPTIMIZE_FAST),y)
TARGET_OPTIMIZATION = -Ofast
endif
+ifeq ($(BR2_ENABLE_DEBUG),)
+TARGET_DEBUGGING = -g0
+endif
ifeq ($(BR2_DEBUG_1),y)
TARGET_DEBUGGING = -g1
endif
diff --git a/package/abootimg/Config.in b/package/abootimg/Config.in
index 30e5bd1fb0..bcd2a082c9 100644
--- a/package/abootimg/Config.in
+++ b/package/abootimg/Config.in
@@ -7,4 +7,4 @@ config BR2_PACKAGE_ABOOTIMG
Tool to manipulate Android Boot Images, either on files
or directly on /dev block devices.
- https://github.com/ggrandou/abootimg
+ https://gitlab.com/ajs124/abootimg
diff --git a/package/abootimg/abootimg.hash b/package/abootimg/abootimg.hash
index fa5282c6c3..141db26860 100644
--- a/package/abootimg/abootimg.hash
+++ b/package/abootimg/abootimg.hash
@@ -1,3 +1,3 @@
# Locally calculated
-sha256 eb8d912bc7b5454c2afd3385fd86f4917d3587c48a6f5ae45df7856d88502cab abootimg-7e127fee6a3981f6b0a50ce9910267cd501e09d4.tar.gz
+sha256 f377da42a57d982cfc22fa75c5a69febdc3e4c1ef43cd0ceaec42e14067e2f37 abootimg-1ebeb393252ab5aeed62e34bc439b6728444f06e-br1.tar.gz
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSE
diff --git a/package/abootimg/abootimg.mk b/package/abootimg/abootimg.mk
index ab6c709318..a07100df5a 100644
--- a/package/abootimg/abootimg.mk
+++ b/package/abootimg/abootimg.mk
@@ -4,8 +4,9 @@
#
################################################################################
-ABOOTIMG_VERSION = 7e127fee6a3981f6b0a50ce9910267cd501e09d4
-ABOOTIMG_SITE = $(call github,ggrandou,abootimg,$(ABOOTIMG_VERSION))
+ABOOTIMG_VERSION = 1ebeb393252ab5aeed62e34bc439b6728444f06e
+ABOOTIMG_SITE = https://gitlab.com/ajs124/abootimg.git
+ABOOTIMG_SITE_METHOD = git
ABOOTIMG_LICENSE = GPL-2.0+
ABOOTIMG_LICENSE_FILES = LICENSE
diff --git a/package/acpid/acpid.mk b/package/acpid/acpid.mk
index ff6e62b5cd..3473e7b5f6 100644
--- a/package/acpid/acpid.mk
+++ b/package/acpid/acpid.mk
@@ -9,6 +9,8 @@ ACPID_SOURCE = acpid-$(ACPID_VERSION).tar.xz
ACPID_SITE = http://downloads.sourceforge.net/project/acpid2
ACPID_LICENSE = GPL-2.0+
ACPID_LICENSE_FILES = COPYING
+ACPID_CPE_ID_VENDOR = tedfelix
+ACPID_CPE_ID_PRODUCT = acpid2
define ACPID_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 0644 package/acpid/acpid.service \
diff --git a/package/aircrack-ng/Config.in b/package/aircrack-ng/Config.in
index f3e2bc4ef1..eb997e8d1b 100644
--- a/package/aircrack-ng/Config.in
+++ b/package/aircrack-ng/Config.in
@@ -5,6 +5,7 @@ config BR2_PACKAGE_AIRCRACK_NG
depends on BR2_INSTALL_LIBSTDCPP
depends on !BR2_STATIC_LIBS # dlfcn.h
select BR2_PACKAGE_OPENSSL if !BR2_PACKAGE_LIBGCRYPT
+ select BR2_PACKAGE_LIBOPENSSL_ENABLE_RC4 if BR2_PACKAGE_LIBOPENSSL
help
A set of tools for auditing wireless networks
diff --git a/package/alsa-lib/0002-dlmisc-the-snd_plugin_dir_set.patch b/package/alsa-lib/0002-dlmisc-the-snd_plugin_dir_set.patch
deleted file mode 100644
index 61d945455c..0000000000
--- a/package/alsa-lib/0002-dlmisc-the-snd_plugin_dir_set.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From ad8c8e5503980295dd8e5e54a6285d2d7e32eb1e Mon Sep 17 00:00:00 2001
-From: Jaroslav Kysela <perex@perex.cz>
-Date: Thu, 22 Oct 2020 20:57:32 +0200
-Subject: [PATCH] dlmisc: the snd_plugin_dir_set / snd_plugin_dir must be
- declared even for \!DL_ORIGIN_AVAILABLE
-
-Fixes: 8580c081c2 ("dlsym: add support for ALSA_PLUGIN_DIR environment variable")
-BugLink: https://github.com/alsa-project/alsa-lib/issues/91
-Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-
-Downloaded from upstream commit
-https://github.com/alsa-project/alsa-lib/commit/ad8c8e5503980295dd8e5e54a6285d2d7e32eb1e
-
-Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
----
- src/dlmisc.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/src/dlmisc.c b/src/dlmisc.c
-index c9517c55..f20eb593 100644
---- a/src/dlmisc.c
-+++ b/src/dlmisc.c
-@@ -42,11 +42,9 @@
- #ifndef PIC
- struct snd_dlsym_link *snd_dlsym_start = NULL;
- #endif
--#ifdef DL_ORIGIN_AVAILABLE
- static int snd_plugin_dir_set = 0;
- static char *snd_plugin_dir = NULL;
- #endif
--#endif
-
- #if defined(DL_ORIGIN_AVAILABLE) && defined(HAVE_LIBPTHREAD)
- static pthread_mutex_t snd_dlpath_mutex = PTHREAD_MUTEX_INITIALIZER;
diff --git a/package/alsa-lib/0002-fix-build-with-disable-ucm.patch b/package/alsa-lib/0002-fix-build-with-disable-ucm.patch
new file mode 100644
index 0000000000..144c8e3fbd
--- /dev/null
+++ b/package/alsa-lib/0002-fix-build-with-disable-ucm.patch
@@ -0,0 +1,43 @@
+From 3fbaea3ff390d4c09adbf5d6ae62fb7b5f3f24f5 Mon Sep 17 00:00:00 2001
+From: Jaroslav Kysela <perex@perex.cz>
+Date: Mon, 28 Jun 2021 12:08:53 +0200
+Subject: [PATCH] fix build with --disable-ucm
+
+Link: https://mailman.alsa-project.org/pipermail/alsa-devel/2021-June/186729.html
+Reported-by: Michael Forney <mforney@mforney.org>
+Signed-off-by: Jaroslav Kysela <perex@perex.cz>
+Upstream: f4f29d42be8b8ad60ea4c5697374adad4bfe6868
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ include/local.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/include/local.h b/include/local.h
+index 4e7d88a0..7cfcec53 100644
+--- a/include/local.h
++++ b/include/local.h
+@@ -374,6 +374,8 @@ int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in,
+ void *INTERNAL(snd_dlopen)(const char *name, int mode, char *errbuf, size_t errbuflen);
+ #endif
+
++#ifdef BUILD_UCM
++
+ const char *uc_mgr_alibcfg_by_device(snd_config_t **config, const char *name);
+
+ static inline int _snd_is_ucm_device(const char *name)
+@@ -381,4 +383,12 @@ static inline int _snd_is_ucm_device(const char *name)
+ return name && name[0] == '_' && name[1] == 'u' && name[2] == 'c' && name[3] == 'm';
+ }
+
++#else
++
++static inline const char *uc_mgr_alibcfg_by_device(snd_config_t **config, const char *name) { return NULL; }
++static inline int _snd_is_ucm_device(const char *name) { return 0; }
++
++
++#endif
++
+ #endif
+--
+2.31.1
+
diff --git a/package/alsa-lib/0003-control-empty-fix-the-static-build.patch b/package/alsa-lib/0003-control-empty-fix-the-static-build.patch
new file mode 100644
index 0000000000..3f5013af3a
--- /dev/null
+++ b/package/alsa-lib/0003-control-empty-fix-the-static-build.patch
@@ -0,0 +1,29 @@
+From 81e7923fbfad45b2f353a4d6e3053af51f5f7d0b Mon Sep 17 00:00:00 2001
+From: Jaroslav Kysela <perex@perex.cz>
+Date: Tue, 15 Jun 2021 23:21:42 +0200
+Subject: [PATCH] control: empty - fix the static build
+
+Reported-by: Jan Palus <atler@pld-linux.org>
+Fixes: https://github.com/alsa-project/alsa-lib/issues/157
+Signed-off-by: Jaroslav Kysela <perex@perex.cz>
+
+[Retrieved from:
+https://github.com/alsa-project/alsa-lib/commit/81e7923fbfad45b2f353a4d6e3053af51f5f7d0b]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ src/control/control_empty.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/control/control_empty.c b/src/control/control_empty.c
+index 49d1026c..c9b048c1 100644
+--- a/src/control/control_empty.c
++++ b/src/control/control_empty.c
+@@ -30,7 +30,7 @@
+
+ #ifndef PIC
+ /* entry for static linking */
+-const char *_snd_module_ctl_empty = "";
++const char *_snd_module_control_empty = "";
+ #endif
+
+ /*! \page control_plugins
diff --git a/package/alsa-lib/alsa-lib.hash b/package/alsa-lib/alsa-lib.hash
index 6e65fb7166..6660c8a104 100644
--- a/package/alsa-lib/alsa-lib.hash
+++ b/package/alsa-lib/alsa-lib.hash
@@ -1,4 +1,4 @@
# Locally calculated
-sha256 f7554be1a56cdff468b58fc1c29b95b64864c590038dd309c7a978c7116908f7 alsa-lib-1.2.4.tar.bz2
+sha256 628421d950cecaf234de3f899d520c0a6923313c964ad751ffac081df331438e alsa-lib-1.2.5.1.tar.bz2
sha256 32434afcc8666ba060e111d715bfdb6c2d5dd8a35fa4d3ab8ad67d8f850d2f2b COPYING
sha256 bfe16cf823bcff261fc6a062c07ee96660e3c39678f42f39a788a68dbc234ced aserver/COPYING
diff --git a/package/alsa-lib/alsa-lib.mk b/package/alsa-lib/alsa-lib.mk
index b1bfaf30e5..c71ad5dd58 100644
--- a/package/alsa-lib/alsa-lib.mk
+++ b/package/alsa-lib/alsa-lib.mk
@@ -4,7 +4,7 @@
#
################################################################################
-ALSA_LIB_VERSION = 1.2.4
+ALSA_LIB_VERSION = 1.2.5.1
ALSA_LIB_SOURCE = alsa-lib-$(ALSA_LIB_VERSION).tar.bz2
ALSA_LIB_SITE = https://www.alsa-project.org/files/pub/lib
ALSA_LIB_LICENSE = LGPL-2.1+ (library), GPL-2.0+ (aserver)
diff --git a/package/alsa-plugins/Config.in b/package/alsa-plugins/Config.in
new file mode 100644
index 0000000000..ee0fb4c1d5
--- /dev/null
+++ b/package/alsa-plugins/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_ALSA_PLUGINS
+ bool "alsa-plugins"
+ depends on BR2_PACKAGE_ALSA_LIB
+ select BR2_PACKAGE_ALSA_LIB_HWDEP
+ help
+ Advanced Linux Sound Architecture Plugins
+
+ http://www.alsa-project.org/
diff --git a/package/alsa-plugins/alsa-plugins.hash b/package/alsa-plugins/alsa-plugins.hash
new file mode 100644
index 0000000000..8ecbd19965
--- /dev/null
+++ b/package/alsa-plugins/alsa-plugins.hash
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256 42eef98433d2c8d11f1deeeb459643619215a75aa5a5bbdd06a794e4c413df20 alsa-plugins-1.2.5.tar.bz2
+sha256 32434afcc8666ba060e111d715bfdb6c2d5dd8a35fa4d3ab8ad67d8f850d2f2b COPYING
+sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c COPYING.GPL
diff --git a/package/alsa-plugins/alsa-plugins.mk b/package/alsa-plugins/alsa-plugins.mk
new file mode 100644
index 0000000000..396f47adaf
--- /dev/null
+++ b/package/alsa-plugins/alsa-plugins.mk
@@ -0,0 +1,32 @@
+################################################################################
+#
+# alsa-plugins
+#
+################################################################################
+
+ALSA_PLUGINS_VERSION = 1.2.5
+ALSA_PLUGINS_SOURCE = alsa-plugins-$(ALSA_PLUGINS_VERSION).tar.bz2
+ALSA_PLUGINS_SITE = https://www.alsa-project.org/files/pub/plugins
+ALSA_PLUGINS_LICENSE = LGPL-2.1+
+ALSA_PLUGINS_LICENSE_FILES = COPYING
+ALSA_PLUGINS_DEPENDENCIES = host-pkgconf alsa-lib
+
+ALSA_PLUGINS_CONF_OPTS = \
+ --disable-jack \
+ --disable-usbstream \
+ --disable-pulseaudio \
+ --disable-libav \
+ --disable-maemo-plugin \
+ --disable-maemo-resource-manager \
+ --with-speex=no
+
+ifeq ($(BR2_PACKAGE_LIBSAMPLERATE),y)
+ALSA_PLUGINS_CONF_OPTS += --enable-samplerate
+ALSA_PLUGINS_DEPENDENCIES += libsamplerate
+ALSA_PLUGINS_LICENSE += , GPL-2.0+ (samplerate plugin)
+ALSA_PLUGINS_LICENSE_FILES += COPYING.GPL
+else
+ALSA_PLUGINS_CONF_OPTS += --disable-samplerate
+endif
+
+$(eval $(autotools-package))
diff --git a/package/apache/0004-server-log.c-ap_log_pid-Use-a-temporary-file-then-re.patch b/package/apache/0004-server-log.c-ap_log_pid-Use-a-temporary-file-then-re.patch
deleted file mode 100644
index af3cd47a30..0000000000
--- a/package/apache/0004-server-log.c-ap_log_pid-Use-a-temporary-file-then-re.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From 5b95d256387b45fbe33f7ee7890ae35afdd5c371 Mon Sep 17 00:00:00 2001
-From: Joe Orton <jorton@apache.org>
-Date: Fri, 13 Mar 2020 14:34:18 +0000
-Subject: [PATCH] * server/log.c (ap_log_pid): Use a temporary file, then
- rename once successfully written; also add error checking. Avoids startup
- failures if a previous httpd invocation crashed while writing the pidfile.
-
-Submitted by: Nicolas Carrier <carrier.nicolas0 gmail.com>, jorton
-Github: closes #100, closes #69
-PR: 63140
-
-git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1875153 13f79535-47bb-0310-9956-ffa450edef68
-Signed-off-by: Nicolas Carrier <nicolas.carrier@orolia.com>
----
- server/log.c | 33 ++++++++++++++++++++++++++-------
- 1 file changed, 26 insertions(+), 7 deletions(-)
-
-diff --git a/server/log.c b/server/log.c
-index f0bde6e4b8..8d54b4e057 100644
---- a/server/log.c
-+++ b/server/log.c
-@@ -1598,6 +1598,9 @@ AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *filename)
- pid_t mypid;
- apr_status_t rv;
- const char *fname;
-+ char *temp_fname;
-+ apr_fileperms_t perms;
-+ char pidstr[64];
-
- if (!filename) {
- return;
-@@ -1626,19 +1629,35 @@ AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *filename)
- fname);
- }
-
-- if ((rv = apr_file_open(&pid_file, fname,
-- APR_WRITE | APR_CREATE | APR_TRUNCATE,
-- APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, p))
-- != APR_SUCCESS) {
-+ temp_fname = apr_pstrcat(p, fname, ".XXXXXX", NULL);
-+ rv = apr_file_mktemp(&pid_file, temp_fname,
-+ APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE, p);
-+ if (rv != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL, APLOGNO(00099)
-- "could not create %s", fname);
-+ "could not create %s", temp_fname);
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, APLOGNO(00100)
- "%s: could not log pid to file %s",
- ap_server_argv0, fname);
- exit(1);
- }
-- apr_file_printf(pid_file, "%" APR_PID_T_FMT APR_EOL_STR, mypid);
-- apr_file_close(pid_file);
-+
-+ apr_snprintf(pidstr, sizeof pidstr, "%" APR_PID_T_FMT APR_EOL_STR, mypid);
-+
-+ perms = APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD;
-+ rv = apr_file_perms_set(temp_fname, perms);
-+ if (rv == APR_SUCCESS)
-+ rv = apr_file_write_full(pid_file, pidstr, strlen(pidstr), NULL);
-+ if (rv == APR_SUCCESS)
-+ rv = apr_file_close(pid_file);
-+ if (rv == APR_SUCCESS)
-+ rv = apr_file_rename(temp_fname, fname, p);
-+ if (rv != APR_SUCCESS) {
-+ ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL, APLOGNO(10231)
-+ "%s: Failed creating pid file %s",
-+ ap_server_argv0, temp_fname);
-+ exit(1);
-+ }
-+
- saved_pid = mypid;
- }
-
---
-2.25.2
-
diff --git a/package/apache/apache.hash b/package/apache/apache.hash
index bd3f6ac7ba..c03934b40a 100644
--- a/package/apache/apache.hash
+++ b/package/apache/apache.hash
@@ -1,5 +1,5 @@
# From http://archive.apache.org/dist/httpd/httpd-2.4.46.tar.bz2.{sha256,sha512}
-sha256 740eddf6e1c641992b22359cabc66e6325868c3c5e2e3f98faf349b61ecf41ea httpd-2.4.46.tar.bz2
-sha512 5936784bb662e9d8a4f7fe38b70c043b468114d931cd10ea831bfe74461ea5856b64f88f42c567ab791fc8907640a99884ba4b6a600f86d661781812735b6f13 httpd-2.4.46.tar.bz2
+sha256 1bc826e7b2e88108c7e4bf43c026636f77a41d849cfb667aa7b5c0b86dbf966c httpd-2.4.48.tar.bz2
+sha512 6c250626f1e7d10428a92d984fd48ff841effcc8705f7816ab71b681bbd51d0012ad158dcd13763fe7d630311f2de258b27574603140d648be42796ab8326724 httpd-2.4.48.tar.bz2
# Locally computed
sha256 47b8c2b6c3309282a99d4a3001575c790fead690cc14734628c4667d2bbffc43 LICENSE
diff --git a/package/apache/apache.mk b/package/apache/apache.mk
index 6b9d18ac00..365dc9a72e 100644
--- a/package/apache/apache.mk
+++ b/package/apache/apache.mk
@@ -4,13 +4,14 @@
#
################################################################################
-APACHE_VERSION = 2.4.46
+APACHE_VERSION = 2.4.48
APACHE_SOURCE = httpd-$(APACHE_VERSION).tar.bz2
APACHE_SITE = http://archive.apache.org/dist/httpd
APACHE_LICENSE = Apache-2.0
APACHE_LICENSE_FILES = LICENSE
APACHE_CPE_ID_VENDOR = apache
APACHE_CPE_ID_PRODUCT = http_server
+APACHE_SELINUX_MODULES = apache
# Needed for mod_php
APACHE_INSTALL_STAGING = YES
# We have a patch touching configure.in and Makefile.in,
@@ -23,7 +24,7 @@ define APACHE_FIXUP_APR_LIBTOOL
$(SED) "s@$(PER_PACKAGE_DIR)/[^/]\+/@$(PER_PACKAGE_DIR)/apache/@g" \
$(STAGING_DIR)/usr/build-1/libtool
endef
-APACHE_POST_CONFIGURE_HOOKS += APACHE_FIXUP_APR_LIBTOOL
+APACHE_POST_PREPARE_HOOKS += APACHE_FIXUP_APR_LIBTOOL
endif
APACHE_CONF_ENV= \
diff --git a/package/apcupsd/apcupsd.mk b/package/apcupsd/apcupsd.mk
index 410bce9aec..9e707e1a5a 100644
--- a/package/apcupsd/apcupsd.mk
+++ b/package/apcupsd/apcupsd.mk
@@ -8,6 +8,7 @@ APCUPSD_VERSION = 3.14.14
APCUPSD_SITE = http://downloads.sourceforge.net/project/apcupsd/apcupsd%20-%20Stable/$(APCUPSD_VERSION)
APCUPSD_LICENSE = GPL-2.0
APCUPSD_LICENSE_FILES = COPYING
+APCUPSD_CPE_ID_VENDOR = apcupsd
APCUPSD_CONF_OPTS = --disable-test
ifneq ($(BR2_PACKAGE_APCUPSD_MODBUS_USB)$(BR2_PACKAGE_APCUPSD_USB),)
diff --git a/package/apg/Config.in b/package/apg/Config.in
new file mode 100644
index 0000000000..94c286a178
--- /dev/null
+++ b/package/apg/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_APG
+ bool "apg"
+ help
+ Automated Password Generator (APG).
+
+ https://github.com/wilx/apg
diff --git a/package/apg/apg.hash b/package/apg/apg.hash
new file mode 100644
index 0000000000..5532289a68
--- /dev/null
+++ b/package/apg/apg.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 89539aa734a47d68124fca5ba7acbe559edc5003b6791f5200ef9e706dd00fe9 apg-2.3.0b.tar.gz
+sha256 5d0c892ea452c3828f1e311637cde4e3a04eb6431554308b3fcdac8c1b330168 COPYING
diff --git a/package/apg/apg.mk b/package/apg/apg.mk
new file mode 100644
index 0000000000..ac4dce77f9
--- /dev/null
+++ b/package/apg/apg.mk
@@ -0,0 +1,21 @@
+################################################################################
+#
+# apg
+#
+################################################################################
+
+APG_VERSION = 2.3.0b
+APG_SITE = $(call github,wilx,apg,v$(APG_VERSION))
+APG_LICENSE = BSD-3-Clause
+APG_LICENSE_FILES = COPYING
+
+define APG_BUILD_CMDS
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(APG_CFLAGS)" \
+ -C $(@D)
+endef
+
+define APG_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/apg $(TARGET_DIR)/usr/bin/apg
+endef
+
+$(eval $(generic-package))
diff --git a/package/apitrace/0001-dlsym-Fix-build-under-uClibc.patch b/package/apitrace/0001-dlsym-Fix-build-under-uClibc.patch
deleted file mode 100644
index bf47bba931..0000000000
--- a/package/apitrace/0001-dlsym-Fix-build-under-uClibc.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 189a3b8397c61ba262a2221885e38dc514c59d94 Mon Sep 17 00:00:00 2001
-From: Paul Cercueil <paul@crapouillou.net>
-Date: Sat, 7 Dec 2019 00:00:57 +0100
-Subject: [PATCH] dlsym: Fix build under uClibc
-
-uClibc defines the __GLIBC__ macro too (I know, right?), so verify that
-__UCLIBC__ is not defined before we can use glibc-specific internal
-functions.
-
-Signed-off-by: Paul Cercueil <paul@crapouillou.net>
-Upstream: https://github.com/apitrace/apitrace/commit/189a3b8397c61ba262a2221885e38dc514c59d94
----
- wrappers/dlsym.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/wrappers/dlsym.cpp b/wrappers/dlsym.cpp
-index 2eda082a..5ab8465b 100644
---- a/wrappers/dlsym.cpp
-+++ b/wrappers/dlsym.cpp
-@@ -34,7 +34,7 @@
- #include "os.hpp"
-
-
--#ifdef __GLIBC__
-+#if defined(__GLIBC__) && !defined(__UCLIBC__)
-
-
- #include <dlfcn.h>
---
-2.24.0
-
diff --git a/package/apitrace/0001-thirdparty-libbacktrace-backtrace-h-include-config.h.patch b/package/apitrace/0001-thirdparty-libbacktrace-backtrace-h-include-config.h.patch
new file mode 100644
index 0000000000..bc76e5e26b
--- /dev/null
+++ b/package/apitrace/0001-thirdparty-libbacktrace-backtrace-h-include-config.h.patch
@@ -0,0 +1,40 @@
+From 36ff87a927092b4d62c587736d7684dea9c82e63 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Mon, 19 Jul 2021 08:27:48 +0200
+Subject: [PATCH] thirdparty/libbacktrace/backtrace/h: include config.h
+
+Build on musl is broken since version 10.0 because the include on
+config.h was removed by
+https://github.com/apitrace/apitrace/commit/1544abf59d68d74977b8b692bea4d7468d65547b:
+
+In file included from /home/buildroot/autobuild/instance-3/output-1/build/apitrace-10.0/thirdparty/libbacktrace/testlib.c:40:
+/home/buildroot/autobuild/instance-3/output-1/build/apitrace-10.0/thirdparty/libbacktrace/backtrace.h:53:10: fatal error: gstdint.h: No such file or directory
+ 53 | #include "gstdint.h"
+ | ^~~~~~~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/a10793d01efa3a1533ba37aa845b9ac2bb1dfb6b
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: not needed
+(https://github.com/apitrace/apitrace/issues/755)]
+---
+ thirdparty/libbacktrace/backtrace.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/thirdparty/libbacktrace/backtrace.h b/thirdparty/libbacktrace/backtrace.h
+index 2814763f..ab7679a0 100644
+--- a/thirdparty/libbacktrace/backtrace.h
++++ b/thirdparty/libbacktrace/backtrace.h
+@@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE. */
+ #ifndef BACKTRACE_H
+ #define BACKTRACE_H
+
++#include "config.h"
++
+ #include <stddef.h>
+ #include <stdio.h>
+
+--
+2.30.2
+
diff --git a/package/apitrace/0002-Support-libc-that-don-t-have-RTLD_DEEPBIND.patch b/package/apitrace/0002-Support-libc-that-don-t-have-RTLD_DEEPBIND.patch
deleted file mode 100644
index e34357428a..0000000000
--- a/package/apitrace/0002-Support-libc-that-don-t-have-RTLD_DEEPBIND.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From d495d15e20bf655afa3be62ada792e8dfc8d29b6 Mon Sep 17 00:00:00 2001
-From: Gleb Mazovetskiy <glex.spb@gmail.com>
-Date: Fri, 13 Dec 2019 13:39:19 +0000
-Subject: [PATCH] Support libc that don't have RTLD_DEEPBIND
-
-[Retrieved from: https://github.com/apitrace/apitrace/pull/646]
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
----
- dispatch/glproc_gl.cpp | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/dispatch/glproc_gl.cpp b/dispatch/glproc_gl.cpp
-index 5d7903a0c..456fcc42e 100644
---- a/dispatch/glproc_gl.cpp
-+++ b/dispatch/glproc_gl.cpp
-@@ -148,6 +148,9 @@ _getPrivateProcAddress(const char *procName)
-
- #else
-
-+#ifndef RTLD_DEEPBIND
-+#define RTLD_DEEPBIND 0
-+#endif
-
- static inline void
- logSymbol(const char *name, void *ptr) {
diff --git a/package/apitrace/0003-CMakeLists.txt-respect-BUILD_TESTING-OFF.patch b/package/apitrace/0003-CMakeLists.txt-respect-BUILD_TESTING-OFF.patch
deleted file mode 100644
index 8cc1f8bb0b..0000000000
--- a/package/apitrace/0003-CMakeLists.txt-respect-BUILD_TESTING-OFF.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From 7f0f1e7e34f997eef697856804dd478b54bb365e Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-Date: Tue, 22 Dec 2020 10:45:21 +0100
-Subject: [PATCH] CMakeLists.txt: respect BUILD_TESTING=OFF
-
-Allow the user to disable unit tests through BUILD_TESTING=OFF:
-https://cmake.org/cmake/help/latest/command/enable_testing.html
-
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-[Upstream status: https://github.com/apitrace/apitrace/pull/698]
----
- CMakeLists.txt | 6 +++++-
- gui/CMakeLists.txt | 6 ++++--
- lib/guids/CMakeLists.txt | 6 ++++--
- lib/os/CMakeLists.txt | 6 ++++--
- lib/trace/CMakeLists.txt | 6 ++++--
- 5 files changed, 21 insertions(+), 9 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 4a07f069..ee401887 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -41,6 +41,8 @@ option (ENABLE_FRAME_POINTER "Disable frame pointer omission" ON)
-
- option (ENABLE_ASAN "Enable Address Sanitizer" OFF)
-
-+option (BUILD_TESTING "Enable unit tests" ON)
-+
- option (ENABLE_TESTS "Enable additional tests" OFF)
-
- if (ANDROID)
-@@ -433,7 +435,9 @@ endmacro ()
- # which subdirectory they are declared
- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-
--enable_testing ()
-+if (BUILD_TESTING)
-+ enable_testing ()
-+endif ()
- if (CMAKE_CROSSCOMPILING)
- add_custom_target (check)
- elseif (DEFINED CMAKE_BUILD_TYPE)
-diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
-index 5baf3552..ad6ee501 100644
---- a/gui/CMakeLists.txt
-+++ b/gui/CMakeLists.txt
-@@ -13,8 +13,10 @@ add_library (qubjson STATIC
- qubjson.cpp
- )
-
--add_gtest (qubjson_test qubjson_test.cpp)
--target_link_libraries (qubjson_test qubjson)
-+if (BUILD_TESTING)
-+ add_gtest (qubjson_test qubjson_test.cpp)
-+ target_link_libraries (qubjson_test qubjson)
-+endif ()
-
- set(qapitrace_SRCS
- apisurface.cpp
-diff --git a/lib/guids/CMakeLists.txt b/lib/guids/CMakeLists.txt
-index ce0f86da..ea28a18f 100644
---- a/lib/guids/CMakeLists.txt
-+++ b/lib/guids/CMakeLists.txt
-@@ -5,5 +5,7 @@ add_library (guids STATIC
- guids.hpp
- )
-
--add_gtest (guids_test guids_test.cpp)
--target_link_libraries (guids_test guids)
-+if (BUILD_TESTING)
-+ add_gtest (guids_test guids_test.cpp)
-+ target_link_libraries (guids_test guids)
-+endif ()
-diff --git a/lib/os/CMakeLists.txt b/lib/os/CMakeLists.txt
-index 222411e0..b7134b57 100644
---- a/lib/os/CMakeLists.txt
-+++ b/lib/os/CMakeLists.txt
-@@ -36,5 +36,7 @@ if (APPLE)
- )
- endif ()
-
--add_gtest (os_thread_test os_thread_test.cpp)
--target_link_libraries (os_thread_test os)
-+if (BUILD_TESTING)
-+ add_gtest (os_thread_test os_thread_test.cpp)
-+ target_link_libraries (os_thread_test os)
-+endif ()
-diff --git a/lib/trace/CMakeLists.txt b/lib/trace/CMakeLists.txt
-index c68bd00f..d95df978 100644
---- a/lib/trace/CMakeLists.txt
-+++ b/lib/trace/CMakeLists.txt
-@@ -34,5 +34,7 @@ target_link_libraries (common
- brotli_dec brotli_common
- )
-
--add_gtest (trace_parser_flags_test trace_parser_flags_test.cpp)
--target_link_libraries (trace_parser_flags_test common)
-+if (BUILD_TESTING)
-+ add_gtest (trace_parser_flags_test trace_parser_flags_test.cpp)
-+ target_link_libraries (trace_parser_flags_test common)
-+endif ()
---
-2.29.2
-
diff --git a/package/apitrace/Config.in b/package/apitrace/Config.in
index 263eec5e7d..44bd696431 100644
--- a/package/apitrace/Config.in
+++ b/package/apitrace/Config.in
@@ -1,8 +1,8 @@
-comment "apitrace needs a toolchain w/ C++, wchar, dynamic library, threads, gcc >= 4.9"
+comment "apitrace needs a toolchain w/ C++, wchar, dynamic library, threads, gcc >= 7"
depends on BR2_USE_MMU
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || \
- !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+ !BR2_TOOLCHAIN_GCC_AT_LEAST_7
config BR2_PACKAGE_APITRACE
bool "apitrace"
@@ -10,7 +10,7 @@ config BR2_PACKAGE_APITRACE
depends on BR2_USE_WCHAR
depends on BR2_INSTALL_LIBSTDCPP
depends on !BR2_STATIC_LIBS # dlfcn.h
- depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+ depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # C++17
depends on BR2_TOOLCHAIN_HAS_THREADS
select BR2_PACKAGE_XLIB_LIBX11 if BR2_PACKAGE_XORG7
select BR2_PACKAGE_LIBPNG
diff --git a/package/apitrace/apitrace.hash b/package/apitrace/apitrace.hash
index 9479f06425..7ccf6cfbe1 100644
--- a/package/apitrace/apitrace.hash
+++ b/package/apitrace/apitrace.hash
@@ -1,3 +1,3 @@
# Locally calculated
-sha256 0eec81ba7d3799622336319785465a2982a0621898842517a07894d7e2aa18eb apitrace-9.0.tar.gz
-sha256 7066bb1b787519c42f8278b77757c21de522cd97755cb30a22759ac401c62260 LICENSE
+sha256 2e57d37af39369d7ce78666acb8afb1a49ec758f683a21077ec39eb0befae4ad apitrace-10.0.tar.gz
+sha256 7066bb1b787519c42f8278b77757c21de522cd97755cb30a22759ac401c62260 LICENSE
diff --git a/package/apitrace/apitrace.mk b/package/apitrace/apitrace.mk
index b962ac01d3..3656a5722b 100644
--- a/package/apitrace/apitrace.mk
+++ b/package/apitrace/apitrace.mk
@@ -4,7 +4,7 @@
#
################################################################################
-APITRACE_VERSION = 9.0
+APITRACE_VERSION = 10.0
APITRACE_SITE = $(call github,apitrace,apitrace,$(APITRACE_VERSION))
APITRACE_LICENSE = MIT
APITRACE_LICENSE_FILES = LICENSE
diff --git a/package/apr-util/apr-util.mk b/package/apr-util/apr-util.mk
index db4df91564..f6ce7ac064 100644
--- a/package/apr-util/apr-util.mk
+++ b/package/apr-util/apr-util.mk
@@ -18,13 +18,17 @@ APR_UTIL_CONF_OPTS = \
APR_UTIL_CONFIG_SCRIPTS = apu-1-config
ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
-define APR_UTIL_FIX_RULES_MK_LIBTOOL
- $(SED) 's,$(PER_PACKAGE_DIR)/apr/,$(PER_PACKAGE_DIR)/apr-util/,g' \
- $(@D)/build/rules.mk
+define APR_UTIL_FIX_LIBTOOL
$(SED) 's,$(PER_PACKAGE_DIR)/apr/,$(PER_PACKAGE_DIR)/apr-util/,g' \
$(STAGING_DIR)/usr/build-1/libtool
endef
-APR_UTIL_POST_CONFIGURE_HOOKS += APR_UTIL_FIX_RULES_MK_LIBTOOL
+APR_UTIL_POST_PREPARE_HOOKS += APR_UTIL_FIX_LIBTOOL
+
+define APR_UTIL_FIX_RULES_MK
+ $(SED) 's,$(PER_PACKAGE_DIR)/apr/,$(PER_PACKAGE_DIR)/apr-util/,g' \
+ $(@D)/build/rules.mk
+endef
+APR_UTIL_POST_CONFIGURE_HOOKS += APR_UTIL_FIX_RULES_MK
endif
# When iconv is available, then use it to provide charset conversion
diff --git a/package/assimp/0002-closes-2733-update-of-zlip-to-fix-gcc-build-for-v9-2-0-32-bit.patch b/package/assimp/0002-closes-2733-update-of-zlip-to-fix-gcc-build-for-v9-2-0-32-bit.patch
new file mode 100644
index 0000000000..4b86cc584f
--- /dev/null
+++ b/package/assimp/0002-closes-2733-update-of-zlip-to-fix-gcc-build-for-v9-2-0-32-bit.patch
@@ -0,0 +1,1638 @@
+From f78446b14aff46db2ef27d062a275b6a01fd68b1 Mon Sep 17 00:00:00 2001
+From: Kim Kulling <kim.kulling@googlemail.com>
+Date: Tue, 19 Nov 2019 20:30:40 +0100
+Subject: [PATCH] closes https://github.com/assimp/assimp/issues/2733: update
+ of zlip to fix gcc build for v9.2.0 32 bit
+
+[Retrieved (and updated to remove .gitignore and appveyor.yml) from:
+https://github.com/assimp/assimp/commit/f78446b14aff46db2ef27d062a275b6a01fd68b1]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ contrib/zip/.gitignore | 2 +
+ contrib/zip/CMakeLists.txt | 83 +++++-
+ contrib/zip/README.md | 12 +-
+ contrib/zip/appveyor.yml | 2 +-
+ contrib/zip/src/miniz.h | 457 ++++++++++++++++++++++++++++----
+ contrib/zip/src/zip.c | 62 +++--
+ contrib/zip/src/zip.h | 457 ++++++++++++++++----------------
+ contrib/zip/test/CMakeLists.txt | 27 +-
+ contrib/zip/test/test.c | 38 ++-
+ contrib/zip/test/test_miniz.c | 25 +-
+ 10 files changed, 821 insertions(+), 344 deletions(-)
+
+diff --git a/contrib/zip/CMakeLists.txt b/contrib/zip/CMakeLists.txt
+index b46dbb1db0..77916d2e14 100644
+--- a/contrib/zip/CMakeLists.txt
++++ b/contrib/zip/CMakeLists.txt
+@@ -1,10 +1,14 @@
+-cmake_minimum_required(VERSION 2.8)
+-project(zip)
+-enable_language(C)
++cmake_minimum_required(VERSION 3.0)
++
++project(zip
++ LANGUAGES C
++ VERSION "0.1.15")
+ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
+
++option(CMAKE_DISABLE_TESTING "Disable test creation" OFF)
++
+ if (MSVC)
+- # Use secure functions by defaualt and suppress warnings about "deprecated" functions
++ # Use secure functions by default and suppress warnings about "deprecated" functions
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_NONSTDC_NO_WARNINGS=1 /D _CRT_SECURE_NO_WARNINGS=1")
+@@ -12,28 +16,80 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
+ "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
+ "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -Werror -pedantic")
++ if(ENABLE_COVERAGE)
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
++ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
++ endif()
+ endif (MSVC)
+
+ # zip
+ set(SRC src/miniz.h src/zip.h src/zip.c)
+ add_library(${PROJECT_NAME} ${SRC})
+-target_include_directories(${PROJECT_NAME} INTERFACE src)
++target_include_directories(${PROJECT_NAME} PUBLIC
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
++ $<INSTALL_INTERFACE:include>
++)
+
+ # test
+ if (NOT CMAKE_DISABLE_TESTING)
+ enable_testing()
+ add_subdirectory(test)
+ find_package(Sanitizers)
+- add_sanitizers(${PROJECT_NAME} test.exe)
+- add_sanitizers(${PROJECT_NAME} test_miniz.exe)
++ add_sanitizers(${PROJECT_NAME} ${test_out} ${test_miniz_out})
+ endif()
+
++####
++# Installation (https://github.com/forexample/package-example) {
++
++set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
++set(INCLUDE_INSTALL_DIR "include")
++
++set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
++
++# Configuration
++set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
++set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake")
++set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
++set(NAMESPACE "${PROJECT_NAME}::")
++
++# Include module with fuction 'write_basic_package_version_file'
++include(CMakePackageConfigHelpers)
++
++# Note: PROJECT_VERSION is used as a VERSION
++write_basic_package_version_file(
++ "${VERSION_CONFIG}" COMPATIBILITY SameMajorVersion
++)
++
++# Use variables:
++# * TARGETS_EXPORT_NAME
++# * PROJECT_NAME
++configure_package_config_file(
++ "cmake/Config.cmake.in"
++ "${PROJECT_CONFIG}"
++ INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}"
++)
++
++install(
++ FILES "${PROJECT_CONFIG}" "${VERSION_CONFIG}"
++ DESTINATION "${CONFIG_INSTALL_DIR}"
++)
++
++install(
++ EXPORT "${TARGETS_EXPORT_NAME}"
++ NAMESPACE "${NAMESPACE}"
++ DESTINATION "${CONFIG_INSTALL_DIR}"
++)
++
++# }
++
+ install(TARGETS ${PROJECT_NAME}
++ EXPORT ${TARGETS_EXPORT_NAME}
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+- COMPONENT library)
+-install(FILES ${PROJECT_SOURCE_DIR}/src/zip.h DESTINATION include)
++ INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR}
++)
++install(FILES ${PROJECT_SOURCE_DIR}/src/zip.h DESTINATION ${INCLUDE_INSTALL_DIR}/zip)
+
+ # uninstall target (https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake)
+ if(NOT TARGET uninstall)
+@@ -45,3 +101,12 @@ if(NOT TARGET uninstall)
+ add_custom_target(uninstall
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake)
+ endif()
++
++find_package(Doxygen)
++if(DOXYGEN_FOUND)
++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
++ add_custom_target(doc
++ ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
++ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
++ COMMENT "Generating API documentation with Doxygen" VERBATIM)
++endif()
+diff --git a/contrib/zip/README.md b/contrib/zip/README.md
+index d5fb8cd203..14eb9a34c8 100644
+--- a/contrib/zip/README.md
++++ b/contrib/zip/README.md
+@@ -71,7 +71,7 @@ int arg = 2;
+ zip_extract("foo.zip", "/tmp", on_extract_entry, &arg);
+ ```
+
+-* Extract a zip entry into memory.
++* Extract a zip entry into memory.
+ ```c
+ void *buf = NULL;
+ size_t bufsize;
+@@ -89,7 +89,7 @@ zip_close(zip);
+ free(buf);
+ ```
+
+-* Extract a zip entry into memory (no internal allocation).
++* Extract a zip entry into memory (no internal allocation).
+ ```c
+ unsigned char *buf;
+ size_t bufsize;
+@@ -110,7 +110,7 @@ zip_close(zip);
+ free(buf);
+ ```
+
+-* Extract a zip entry into memory using callback.
++* Extract a zip entry into memory using callback.
+ ```c
+ struct buffer_t {
+ char *data;
+@@ -144,7 +144,7 @@ free(buf.data);
+ ```
+
+
+-* Extract a zip entry into a file.
++* Extract a zip entry into a file.
+ ```c
+ struct zip_t *zip = zip_open("foo.zip", 0, 'r');
+ {
+@@ -157,7 +157,7 @@ struct zip_t *zip = zip_open("foo.zip", 0, 'r');
+ zip_close(zip);
+ ```
+
+-* List of all zip entries
++* List of all zip entries
+ ```c
+ struct zip_t *zip = zip_open("foo.zip", 0, 'r');
+ int i, n = zip_total_entries(zip);
+@@ -174,7 +174,7 @@ for (i = 0; i < n; ++i) {
+ zip_close(zip);
+ ```
+
+-## Bindings
++# Bindings
+ Compile zip library as a dynamic library.
+ ```shell
+ $ mkdir build
+diff --git a/contrib/zip/src/miniz.h b/contrib/zip/src/miniz.h
+index 2c27a94d8d..c4fcfb83e6 100644
+--- a/contrib/zip/src/miniz.h
++++ b/contrib/zip/src/miniz.h
+@@ -221,6 +221,7 @@
+ #ifndef MINIZ_HEADER_INCLUDED
+ #define MINIZ_HEADER_INCLUDED
+
++#include <stdint.h>
+ #include <stdlib.h>
+
+ // Defines to completely disable specific portions of miniz.c:
+@@ -284,7 +285,8 @@
+ /* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES only if not set */
+ #if !defined(MINIZ_USE_UNALIGNED_LOADS_AND_STORES)
+ #if MINIZ_X86_OR_X64_CPU
+-/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses. */
++/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient
++ * integer loads and stores from unaligned addresses. */
+ #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
+ #define MINIZ_UNALIGNED_USE_MEMCPY
+ #else
+@@ -354,6 +356,44 @@ enum {
+ MZ_FIXED = 4
+ };
+
++/* miniz error codes. Be sure to update mz_zip_get_error_string() if you add or
++ * modify this enum. */
++typedef enum {
++ MZ_ZIP_NO_ERROR = 0,
++ MZ_ZIP_UNDEFINED_ERROR,
++ MZ_ZIP_TOO_MANY_FILES,
++ MZ_ZIP_FILE_TOO_LARGE,
++ MZ_ZIP_UNSUPPORTED_METHOD,
++ MZ_ZIP_UNSUPPORTED_ENCRYPTION,
++ MZ_ZIP_UNSUPPORTED_FEATURE,
++ MZ_ZIP_FAILED_FINDING_CENTRAL_DIR,
++ MZ_ZIP_NOT_AN_ARCHIVE,
++ MZ_ZIP_INVALID_HEADER_OR_CORRUPTED,
++ MZ_ZIP_UNSUPPORTED_MULTIDISK,
++ MZ_ZIP_DECOMPRESSION_FAILED,
++ MZ_ZIP_COMPRESSION_FAILED,
++ MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE,
++ MZ_ZIP_CRC_CHECK_FAILED,
++ MZ_ZIP_UNSUPPORTED_CDIR_SIZE,
++ MZ_ZIP_ALLOC_FAILED,
++ MZ_ZIP_FILE_OPEN_FAILED,
++ MZ_ZIP_FILE_CREATE_FAILED,
++ MZ_ZIP_FILE_WRITE_FAILED,
++ MZ_ZIP_FILE_READ_FAILED,
++ MZ_ZIP_FILE_CLOSE_FAILED,
++ MZ_ZIP_FILE_SEEK_FAILED,
++ MZ_ZIP_FILE_STAT_FAILED,
++ MZ_ZIP_INVALID_PARAMETER,
++ MZ_ZIP_INVALID_FILENAME,
++ MZ_ZIP_BUF_TOO_SMALL,
++ MZ_ZIP_INTERNAL_ERROR,
++ MZ_ZIP_FILE_NOT_FOUND,
++ MZ_ZIP_ARCHIVE_TOO_LARGE,
++ MZ_ZIP_VALIDATION_FAILED,
++ MZ_ZIP_WRITE_CALLBACK_FAILED,
++ MZ_ZIP_TOTAL_ERRORS
++} mz_zip_error;
++
+ // Method
+ #define MZ_DEFLATED 8
+
+@@ -696,6 +736,7 @@ typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs,
+ void *pBuf, size_t n);
+ typedef size_t (*mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs,
+ const void *pBuf, size_t n);
++typedef mz_bool (*mz_file_needs_keepalive)(void *pOpaque);
+
+ struct mz_zip_internal_state_tag;
+ typedef struct mz_zip_internal_state_tag mz_zip_internal_state;
+@@ -707,13 +748,27 @@ typedef enum {
+ MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED = 3
+ } mz_zip_mode;
+
+-typedef struct mz_zip_archive_tag {
++typedef enum {
++ MZ_ZIP_TYPE_INVALID = 0,
++ MZ_ZIP_TYPE_USER,
++ MZ_ZIP_TYPE_MEMORY,
++ MZ_ZIP_TYPE_HEAP,
++ MZ_ZIP_TYPE_FILE,
++ MZ_ZIP_TYPE_CFILE,
++ MZ_ZIP_TOTAL_TYPES
++} mz_zip_type;
++
++typedef struct {
+ mz_uint64 m_archive_size;
+ mz_uint64 m_central_directory_file_ofs;
+- mz_uint m_total_files;
++
++ /* We only support up to UINT32_MAX files in zip64 mode. */
++ mz_uint32 m_total_files;
+ mz_zip_mode m_zip_mode;
++ mz_zip_type m_zip_type;
++ mz_zip_error m_last_error;
+
+- mz_uint m_file_offset_alignment;
++ mz_uint64 m_file_offset_alignment;
+
+ mz_alloc_func m_pAlloc;
+ mz_free_func m_pFree;
+@@ -722,6 +777,7 @@ typedef struct mz_zip_archive_tag {
+
+ mz_file_read_func m_pRead;
+ mz_file_write_func m_pWrite;
++ mz_file_needs_keepalive m_pNeeds_keepalive;
+ void *m_pIO_opaque;
+
+ mz_zip_internal_state *m_pState;
+@@ -1263,6 +1319,9 @@ mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits,
+ int strategy);
+ #endif // #ifndef MINIZ_NO_ZLIB_APIS
+
++#define MZ_UINT16_MAX (0xFFFFU)
++#define MZ_UINT32_MAX (0xFFFFFFFFU)
++
+ #ifdef __cplusplus
+ }
+ #endif
+@@ -1311,6 +1370,11 @@ typedef unsigned char mz_validate_uint64[sizeof(mz_uint64) == 8 ? 1 : -1];
+ ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U))
+ #endif
+
++#define MZ_READ_LE64(p) \
++ (((mz_uint64)MZ_READ_LE32(p)) | \
++ (((mz_uint64)MZ_READ_LE32((const mz_uint8 *)(p) + sizeof(mz_uint32))) \
++ << 32U))
++
+ #ifdef _MSC_VER
+ #define MZ_FORCEINLINE __forceinline
+ #elif defined(__GNUC__)
+@@ -4160,6 +4224,17 @@ enum {
+ MZ_ZIP_LOCAL_DIR_HEADER_SIZE = 30,
+ MZ_ZIP_CENTRAL_DIR_HEADER_SIZE = 46,
+ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE = 22,
++
++ /* ZIP64 archive identifier and record sizes */
++ MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG = 0x06064b50,
++ MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG = 0x07064b50,
++ MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE = 56,
++ MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE = 20,
++ MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID = 0x0001,
++ MZ_ZIP_DATA_DESCRIPTOR_ID = 0x08074b50,
++ MZ_ZIP_DATA_DESCRIPTER_SIZE64 = 24,
++ MZ_ZIP_DATA_DESCRIPTER_SIZE32 = 16,
++
+ // Central directory header record offsets
+ MZ_ZIP_CDH_SIG_OFS = 0,
+ MZ_ZIP_CDH_VERSION_MADE_BY_OFS = 4,
+@@ -4199,6 +4274,31 @@ enum {
+ MZ_ZIP_ECDH_CDIR_SIZE_OFS = 12,
+ MZ_ZIP_ECDH_CDIR_OFS_OFS = 16,
+ MZ_ZIP_ECDH_COMMENT_SIZE_OFS = 20,
++
++ /* ZIP64 End of central directory locator offsets */
++ MZ_ZIP64_ECDL_SIG_OFS = 0, /* 4 bytes */
++ MZ_ZIP64_ECDL_NUM_DISK_CDIR_OFS = 4, /* 4 bytes */
++ MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS = 8, /* 8 bytes */
++ MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS = 16, /* 4 bytes */
++
++ /* ZIP64 End of central directory header offsets */
++ MZ_ZIP64_ECDH_SIG_OFS = 0, /* 4 bytes */
++ MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS = 4, /* 8 bytes */
++ MZ_ZIP64_ECDH_VERSION_MADE_BY_OFS = 12, /* 2 bytes */
++ MZ_ZIP64_ECDH_VERSION_NEEDED_OFS = 14, /* 2 bytes */
++ MZ_ZIP64_ECDH_NUM_THIS_DISK_OFS = 16, /* 4 bytes */
++ MZ_ZIP64_ECDH_NUM_DISK_CDIR_OFS = 20, /* 4 bytes */
++ MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS = 24, /* 8 bytes */
++ MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS = 32, /* 8 bytes */
++ MZ_ZIP64_ECDH_CDIR_SIZE_OFS = 40, /* 8 bytes */
++ MZ_ZIP64_ECDH_CDIR_OFS_OFS = 48, /* 8 bytes */
++ MZ_ZIP_VERSION_MADE_BY_DOS_FILESYSTEM_ID = 0,
++ MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG = 0x10,
++ MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED = 1,
++ MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG = 32,
++ MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION = 64,
++ MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED = 8192,
++ MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8 = 1 << 11
+ };
+
+ typedef struct {
+@@ -4211,7 +4311,24 @@ struct mz_zip_internal_state_tag {
+ mz_zip_array m_central_dir;
+ mz_zip_array m_central_dir_offsets;
+ mz_zip_array m_sorted_central_dir_offsets;
++
++ /* The flags passed in when the archive is initially opened. */
++ uint32_t m_init_flags;
++
++ /* MZ_TRUE if the archive has a zip64 end of central directory headers, etc.
++ */
++ mz_bool m_zip64;
++
++ /* MZ_TRUE if we found zip64 extended info in the central directory (m_zip64
++ * will also be slammed to true too, even if we didn't find a zip64 end of
++ * central dir header, etc.) */
++ mz_bool m_zip64_has_extended_info_fields;
++
++ /* These fields are used by the file, FILE, memory, and memory/heap read/write
++ * helpers. */
+ MZ_FILE *m_pFile;
++ mz_uint64 m_file_archive_start_ofs;
++
+ void *m_pMem;
+ size_t m_mem_size;
+ size_t m_mem_capacity;
+@@ -4363,6 +4480,13 @@ static mz_bool mz_zip_set_file_times(const char *pFilename, time_t access_time,
+ #endif /* #ifndef MINIZ_NO_STDIO */
+ #endif /* #ifndef MINIZ_NO_TIME */
+
++static MZ_FORCEINLINE mz_bool mz_zip_set_error(mz_zip_archive *pZip,
++ mz_zip_error err_num) {
++ if (pZip)
++ pZip->m_last_error = err_num;
++ return MZ_FALSE;
++}
++
+ static mz_bool mz_zip_reader_init_internal(mz_zip_archive *pZip,
+ mz_uint32 flags) {
+ (void)flags;
+@@ -4480,127 +4604,346 @@ mz_zip_reader_sort_central_dir_offsets_by_filename(mz_zip_archive *pZip) {
+ }
+ }
+
+-static mz_bool mz_zip_reader_read_central_dir(mz_zip_archive *pZip,
+- mz_uint32 flags) {
+- mz_uint cdir_size, num_this_disk, cdir_disk_index;
+- mz_uint64 cdir_ofs;
++static mz_bool mz_zip_reader_locate_header_sig(mz_zip_archive *pZip,
++ mz_uint32 record_sig,
++ mz_uint32 record_size,
++ mz_int64 *pOfs) {
+ mz_int64 cur_file_ofs;
+- const mz_uint8 *p;
+ mz_uint32 buf_u32[4096 / sizeof(mz_uint32)];
+ mz_uint8 *pBuf = (mz_uint8 *)buf_u32;
+- mz_bool sort_central_dir =
+- ((flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0);
+- // Basic sanity checks - reject files which are too small, and check the first
+- // 4 bytes of the file to make sure a local header is there.
+- if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
++
++ /* Basic sanity checks - reject files which are too small */
++ if (pZip->m_archive_size < record_size)
+ return MZ_FALSE;
+- // Find the end of central directory record by scanning the file from the end
+- // towards the beginning.
++
++ /* Find the record by scanning the file from the end towards the beginning. */
+ cur_file_ofs =
+ MZ_MAX((mz_int64)pZip->m_archive_size - (mz_int64)sizeof(buf_u32), 0);
+ for (;;) {
+ int i,
+ n = (int)MZ_MIN(sizeof(buf_u32), pZip->m_archive_size - cur_file_ofs);
++
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, n) != (mz_uint)n)
+ return MZ_FALSE;
+- for (i = n - 4; i >= 0; --i)
+- if (MZ_READ_LE32(pBuf + i) == MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG)
+- break;
++
++ for (i = n - 4; i >= 0; --i) {
++ mz_uint s = MZ_READ_LE32(pBuf + i);
++ if (s == record_sig) {
++ if ((pZip->m_archive_size - (cur_file_ofs + i)) >= record_size)
++ break;
++ }
++ }
++
+ if (i >= 0) {
+ cur_file_ofs += i;
+ break;
+ }
++
++ /* Give up if we've searched the entire file, or we've gone back "too far"
++ * (~64kb) */
+ if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >=
+- (0xFFFF + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)))
++ (MZ_UINT16_MAX + record_size)))
+ return MZ_FALSE;
++
+ cur_file_ofs = MZ_MAX(cur_file_ofs - (sizeof(buf_u32) - 3), 0);
+ }
+- // Read and verify the end of central directory record.
++
++ *pOfs = cur_file_ofs;
++ return MZ_TRUE;
++}
++
++static mz_bool mz_zip_reader_read_central_dir(mz_zip_archive *pZip,
++ mz_uint flags) {
++ mz_uint cdir_size = 0, cdir_entries_on_this_disk = 0, num_this_disk = 0,
++ cdir_disk_index = 0;
++ mz_uint64 cdir_ofs = 0;
++ mz_int64 cur_file_ofs = 0;
++ const mz_uint8 *p;
++
++ mz_uint32 buf_u32[4096 / sizeof(mz_uint32)];
++ mz_uint8 *pBuf = (mz_uint8 *)buf_u32;
++ mz_bool sort_central_dir =
++ ((flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0);
++ mz_uint32 zip64_end_of_central_dir_locator_u32
++ [(MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + sizeof(mz_uint32) - 1) /
++ sizeof(mz_uint32)];
++ mz_uint8 *pZip64_locator = (mz_uint8 *)zip64_end_of_central_dir_locator_u32;
++
++ mz_uint32 zip64_end_of_central_dir_header_u32
++ [(MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) /
++ sizeof(mz_uint32)];
++ mz_uint8 *pZip64_end_of_central_dir =
++ (mz_uint8 *)zip64_end_of_central_dir_header_u32;
++
++ mz_uint64 zip64_end_of_central_dir_ofs = 0;
++
++ /* Basic sanity checks - reject files which are too small, and check the first
++ * 4 bytes of the file to make sure a local header is there. */
++ if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
++ return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
++
++ if (!mz_zip_reader_locate_header_sig(
++ pZip, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG,
++ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE, &cur_file_ofs))
++ return mz_zip_set_error(pZip, MZ_ZIP_FAILED_FINDING_CENTRAL_DIR);
++
++ /* Read and verify the end of central directory record. */
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf,
+ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) !=
+ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
+- return MZ_FALSE;
+- if ((MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) !=
+- MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) ||
+- ((pZip->m_total_files =
+- MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS)) !=
+- MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS)))
+- return MZ_FALSE;
++ return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
++
++ if (MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) !=
++ MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG)
++ return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
++
++ if (cur_file_ofs >= (MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE +
++ MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)) {
++ if (pZip->m_pRead(pZip->m_pIO_opaque,
++ cur_file_ofs - MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE,
++ pZip64_locator,
++ MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) ==
++ MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) {
++ if (MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_SIG_OFS) ==
++ MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG) {
++ zip64_end_of_central_dir_ofs = MZ_READ_LE64(
++ pZip64_locator + MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS);
++ if (zip64_end_of_central_dir_ofs >
++ (pZip->m_archive_size - MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
++ return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
++
++ if (pZip->m_pRead(pZip->m_pIO_opaque, zip64_end_of_central_dir_ofs,
++ pZip64_end_of_central_dir,
++ MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) ==
++ MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) {
++ if (MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIG_OFS) ==
++ MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG) {
++ pZip->m_pState->m_zip64 = MZ_TRUE;
++ }
++ }
++ }
++ }
++ }
+
++ pZip->m_total_files = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS);
++ cdir_entries_on_this_disk =
++ MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS);
+ num_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_THIS_DISK_OFS);
+ cdir_disk_index = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS);
++ cdir_size = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_SIZE_OFS);
++ cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS);
++
++ if (pZip->m_pState->m_zip64) {
++ mz_uint32 zip64_total_num_of_disks =
++ MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS);
++ mz_uint64 zip64_cdir_total_entries = MZ_READ_LE64(
++ pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS);
++ mz_uint64 zip64_cdir_total_entries_on_this_disk = MZ_READ_LE64(
++ pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS);
++ mz_uint64 zip64_size_of_end_of_central_dir_record = MZ_READ_LE64(
++ pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS);
++ mz_uint64 zip64_size_of_central_directory =
++ MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_SIZE_OFS);
++
++ if (zip64_size_of_end_of_central_dir_record <
++ (MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE - 12))
++ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
++
++ if (zip64_total_num_of_disks != 1U)
++ return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);
++
++ /* Check for miniz's practical limits */
++ if (zip64_cdir_total_entries > MZ_UINT32_MAX)
++ return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
++
++ pZip->m_total_files = (mz_uint32)zip64_cdir_total_entries;
++
++ if (zip64_cdir_total_entries_on_this_disk > MZ_UINT32_MAX)
++ return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
++
++ cdir_entries_on_this_disk =
++ (mz_uint32)zip64_cdir_total_entries_on_this_disk;
++
++ /* Check for miniz's current practical limits (sorry, this should be enough
++ * for millions of files) */
++ if (zip64_size_of_central_directory > MZ_UINT32_MAX)
++ return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE);
++
++ cdir_size = (mz_uint32)zip64_size_of_central_directory;
++
++ num_this_disk = MZ_READ_LE32(pZip64_end_of_central_dir +
++ MZ_ZIP64_ECDH_NUM_THIS_DISK_OFS);
++
++ cdir_disk_index = MZ_READ_LE32(pZip64_end_of_central_dir +
++ MZ_ZIP64_ECDH_NUM_DISK_CDIR_OFS);
++
++ cdir_ofs =
++ MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_OFS_OFS);
++ }
++
++ if (pZip->m_total_files != cdir_entries_on_this_disk)
++ return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);
++
+ if (((num_this_disk | cdir_disk_index) != 0) &&
+ ((num_this_disk != 1) || (cdir_disk_index != 1)))
+- return MZ_FALSE;
++ return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);
+
+- if ((cdir_size = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_SIZE_OFS)) <
+- pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)
+- return MZ_FALSE;
++ if (cdir_size < pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)
++ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
+
+- cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS);
+ if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size)
+- return MZ_FALSE;
++ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
+
+ pZip->m_central_directory_file_ofs = cdir_ofs;
+
+ if (pZip->m_total_files) {
+ mz_uint i, n;
+-
+- // Read the entire central directory into a heap block, and allocate another
+- // heap block to hold the unsorted central dir file record offsets, and
+- // another to hold the sorted indices.
++ /* Read the entire central directory into a heap block, and allocate another
++ * heap block to hold the unsorted central dir file record offsets, and
++ * possibly another to hold the sorted indices. */
+ if ((!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir, cdir_size,
+ MZ_FALSE)) ||
+ (!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir_offsets,
+ pZip->m_total_files, MZ_FALSE)))
+- return MZ_FALSE;
++ return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
+
+ if (sort_central_dir) {
+ if (!mz_zip_array_resize(pZip,
+ &pZip->m_pState->m_sorted_central_dir_offsets,
+ pZip->m_total_files, MZ_FALSE))
+- return MZ_FALSE;
++ return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
+ }
+
+ if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs,
+ pZip->m_pState->m_central_dir.m_p,
+ cdir_size) != cdir_size)
+- return MZ_FALSE;
++ return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
+
+- // Now create an index into the central directory file records, do some
+- // basic sanity checking on each record, and check for zip64 entries (which
+- // are not yet supported).
++ /* Now create an index into the central directory file records, do some
++ * basic sanity checking on each record */
+ p = (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p;
+ for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i) {
+- mz_uint total_header_size, comp_size, decomp_size, disk_index;
++ mz_uint total_header_size, disk_index, bit_flags, filename_size,
++ ext_data_size;
++ mz_uint64 comp_size, decomp_size, local_header_ofs;
++
+ if ((n < MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) ||
+ (MZ_READ_LE32(p) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG))
+- return MZ_FALSE;
++ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
++
+ MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32,
+ i) =
+ (mz_uint32)(p - (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p);
++
+ if (sort_central_dir)
+ MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_sorted_central_dir_offsets,
+ mz_uint32, i) = i;
++
+ comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS);
+ decomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS);
+- if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) &&
+- (decomp_size != comp_size)) ||
+- (decomp_size && !comp_size) || (decomp_size == 0xFFFFFFFF) ||
+- (comp_size == 0xFFFFFFFF))
+- return MZ_FALSE;
++ local_header_ofs = MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS);
++ filename_size = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
++ ext_data_size = MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS);
++
++ if ((!pZip->m_pState->m_zip64_has_extended_info_fields) &&
++ (ext_data_size) &&
++ (MZ_MAX(MZ_MAX(comp_size, decomp_size), local_header_ofs) ==
++ MZ_UINT32_MAX)) {
++ /* Attempt to find zip64 extended information field in the entry's extra
++ * data */
++ mz_uint32 extra_size_remaining = ext_data_size;
++
++ if (extra_size_remaining) {
++ const mz_uint8 *pExtra_data;
++ void *buf = NULL;
++
++ if (MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + ext_data_size >
++ n) {
++ buf = MZ_MALLOC(ext_data_size);
++ if (buf == NULL)
++ return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
++
++ if (pZip->m_pRead(pZip->m_pIO_opaque,
++ cdir_ofs + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE +
++ filename_size,
++ buf, ext_data_size) != ext_data_size) {
++ MZ_FREE(buf);
++ return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
++ }
++
++ pExtra_data = (mz_uint8 *)buf;
++ } else {
++ pExtra_data = p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size;
++ }
++
++ do {
++ mz_uint32 field_id;
++ mz_uint32 field_data_size;
++
++ if (extra_size_remaining < (sizeof(mz_uint16) * 2)) {
++ MZ_FREE(buf);
++ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
++ }
++
++ field_id = MZ_READ_LE16(pExtra_data);
++ field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16));
++
++ if ((field_data_size + sizeof(mz_uint16) * 2) >
++ extra_size_remaining) {
++ MZ_FREE(buf);
++ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
++ }
++
++ if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID) {
++ /* Ok, the archive didn't have any zip64 headers but it uses a
++ * zip64 extended information field so mark it as zip64 anyway
++ * (this can occur with infozip's zip util when it reads
++ * compresses files from stdin). */
++ pZip->m_pState->m_zip64 = MZ_TRUE;
++ pZip->m_pState->m_zip64_has_extended_info_fields = MZ_TRUE;
++ break;
++ }
++
++ pExtra_data += sizeof(mz_uint16) * 2 + field_data_size;
++ extra_size_remaining =
++ extra_size_remaining - sizeof(mz_uint16) * 2 - field_data_size;
++ } while (extra_size_remaining);
++
++ MZ_FREE(buf);
++ }
++ }
++
++ /* I've seen archives that aren't marked as zip64 that uses zip64 ext
++ * data, argh */
++ if ((comp_size != MZ_UINT32_MAX) && (decomp_size != MZ_UINT32_MAX)) {
++ if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) &&
++ (decomp_size != comp_size)) ||
++ (decomp_size && !comp_size))
++ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
++ }
++
+ disk_index = MZ_READ_LE16(p + MZ_ZIP_CDH_DISK_START_OFS);
+- if ((disk_index != num_this_disk) && (disk_index != 1))
+- return MZ_FALSE;
+- if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) +
+- MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size)
+- return MZ_FALSE;
++ if ((disk_index == MZ_UINT16_MAX) ||
++ ((disk_index != num_this_disk) && (disk_index != 1)))
++ return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);
++
++ if (comp_size != MZ_UINT32_MAX) {
++ if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) +
++ MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size)
++ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
++ }
++
++ bit_flags = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS);
++ if (bit_flags & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED)
++ return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION);
++
+ if ((total_header_size = MZ_ZIP_CENTRAL_DIR_HEADER_SIZE +
+ MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) +
+ MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS) +
+ MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS)) >
+ n)
+- return MZ_FALSE;
++ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
++
+ n -= total_header_size;
+ p += total_header_size;
+ }
+diff --git a/contrib/zip/src/zip.c b/contrib/zip/src/zip.c
+index ff3a8fe1e6..1abcfd8fd1 100644
+--- a/contrib/zip/src/zip.c
++++ b/contrib/zip/src/zip.c
+@@ -24,7 +24,6 @@
+ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) && \
+ (P)[1] == ':')
+ #define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE(P) ? 2 : 0)
+-#define ISSLASH(C) ((C) == '/' || (C) == '\\')
+
+ #else
+
+@@ -48,7 +47,7 @@ int symlink(const char *target, const char *linkpath); // needed on Linux
+ #endif
+
+ #ifndef ISSLASH
+-#define ISSLASH(C) ((C) == '/')
++#define ISSLASH(C) ((C) == '/' || (C) == '\\')
+ #endif
+
+ #define CLEANUP(ptr) \
+@@ -78,26 +77,34 @@ static const char *base_name(const char *name) {
+ return base;
+ }
+
+-static int mkpath(const char *path) {
+- char const *p;
++static int mkpath(char *path) {
++ char *p;
+ char npath[MAX_PATH + 1];
+ int len = 0;
+ int has_device = HAS_DEVICE(path);
+
+ memset(npath, 0, MAX_PATH + 1);
+-
+-#ifdef _WIN32
+- // only on windows fix the path
+- npath[0] = path[0];
+- npath[1] = path[1];
+- len = 2;
+-#endif // _WIN32
+-
++ if (has_device) {
++ // only on windows
++ npath[0] = path[0];
++ npath[1] = path[1];
++ len = 2;
++ }
+ for (p = path + len; *p && len < MAX_PATH; p++) {
+ if (ISSLASH(*p) && ((!has_device && len > 0) || (has_device && len > 2))) {
+- if (MKDIR(npath) == -1)
+- if (errno != EEXIST)
++#if defined(_WIN32) || defined(__WIN32__) || defined(_MSC_VER) || \
++ defined(__MINGW32__)
++#else
++ if ('\\' == *p) {
++ *p = '/';
++ }
++#endif
++
++ if (MKDIR(npath) == -1) {
++ if (errno != EEXIST) {
+ return -1;
++ }
++ }
+ }
+ npath[len++] = *p;
+ }
+@@ -279,7 +286,14 @@ int zip_entry_open(struct zip_t *zip, const char *entryname) {
+ zip->entry.header_offset = zip->archive.m_archive_size;
+ memset(zip->entry.header, 0, MZ_ZIP_LOCAL_DIR_HEADER_SIZE * sizeof(mz_uint8));
+ zip->entry.method = 0;
++
++ // UNIX or APPLE
++#if MZ_PLATFORM == 3 || MZ_PLATFORM == 19
++ // regular file with rw-r--r-- persmissions
++ zip->entry.external_attr = (mz_uint32)(0100644) << 16;
++#else
+ zip->entry.external_attr = 0;
++#endif
+
+ num_alignment_padding_bytes =
+ mz_zip_writer_compute_padding_needed_for_file_alignment(pzip);
+@@ -660,7 +674,7 @@ ssize_t zip_entry_noallocread(struct zip_t *zip, void *buf, size_t bufsize) {
+ }
+
+ if (!mz_zip_reader_extract_to_mem_no_alloc(pzip, (mz_uint)zip->entry.index,
+- buf, bufsize, 0, NULL, 0)) {
++ buf, bufsize, 0, NULL, 0)) {
+ return -1;
+ }
+
+@@ -670,10 +684,7 @@ ssize_t zip_entry_noallocread(struct zip_t *zip, void *buf, size_t bufsize) {
+ int zip_entry_fread(struct zip_t *zip, const char *filename) {
+ mz_zip_archive *pzip = NULL;
+ mz_uint idx;
+-#if defined(_MSC_VER)
+-#else
+ mz_uint32 xattr = 0;
+-#endif
+ mz_zip_archive_file_stat info;
+
+ if (!zip) {
+@@ -875,12 +886,19 @@ int zip_extract(const char *zipname, const char *dir,
+ goto out;
+ }
+
+- if ((((info.m_version_made_by >> 8) == 3) || ((info.m_version_made_by >> 8) == 19)) // if zip is produced on Unix or macOS (3 and 19 from section 4.4.2.2 of zip standard)
+- && info.m_external_attr & (0x20 << 24)) { // and has sym link attribute (0x80 is file, 0x40 is directory)
++ if ((((info.m_version_made_by >> 8) == 3) ||
++ ((info.m_version_made_by >> 8) ==
++ 19)) // if zip is produced on Unix or macOS (3 and 19 from
++ // section 4.4.2.2 of zip standard)
++ && info.m_external_attr &
++ (0x20 << 24)) { // and has sym link attribute (0x80 is file, 0x40
++ // is directory)
+ #if defined(_WIN32) || defined(__WIN32__) || defined(_MSC_VER) || \
+ defined(__MINGW32__)
+-#else
+- if (info.m_uncomp_size > MAX_PATH || !mz_zip_reader_extract_to_mem_no_alloc(&zip_archive, i, symlink_to, MAX_PATH, 0, NULL, 0)) {
++#else
++ if (info.m_uncomp_size > MAX_PATH ||
++ !mz_zip_reader_extract_to_mem_no_alloc(&zip_archive, i, symlink_to,
++ MAX_PATH, 0, NULL, 0)) {
+ goto out;
+ }
+ symlink_to[info.m_uncomp_size] = '\0';
+diff --git a/contrib/zip/src/zip.h b/contrib/zip/src/zip.h
+index 5f39df50ad..a48d64d6de 100644
+--- a/contrib/zip/src/zip.h
++++ b/contrib/zip/src/zip.h
+@@ -20,241 +20,240 @@ extern "C" {
+ #endif
+
+ #if !defined(_SSIZE_T_DEFINED) && !defined(_SSIZE_T_DEFINED_) && \
+- !defined(_SSIZE_T) && !defined(_SSIZE_T_) && !defined(__ssize_t_defined)
+-#define _SSIZE_T
++ !defined(__DEFINED_ssize_t) && !defined(__ssize_t_defined) && \
++ !defined(_SSIZE_T) && !defined(_SSIZE_T_)
++
+ // 64-bit Windows is the only mainstream platform
+ // where sizeof(long) != sizeof(void*)
+ #ifdef _WIN64
+-typedef long long ssize_t; /* byte count or error */
++typedef long long ssize_t; /* byte count or error */
+ #else
+-typedef long ssize_t; /* byte count or error */
++typedef long ssize_t; /* byte count or error */
+ #endif
++
++#define _SSIZE_T_DEFINED
++#define _SSIZE_T_DEFINED_
++#define __DEFINED_ssize_t
++#define __ssize_t_defined
++#define _SSIZE_T
++#define _SSIZE_T_
++
+ #endif
+
+ #ifndef MAX_PATH
+ #define MAX_PATH 32767 /* # chars in a path name including NULL */
+ #endif
+
++/**
++ * @mainpage
++ *
++ * Documenation for @ref zip.
++ */
++
++/**
++ * @addtogroup zip
++ * @{
++ */
++
++/**
++ * Default zip compression level.
++ */
++
+ #define ZIP_DEFAULT_COMPRESSION_LEVEL 6
+
+-/*
+- This data structure is used throughout the library to represent zip archive
+- - forward declaration.
+-*/
++/**
++ * @struct zip_t
++ *
++ * This data structure is used throughout the library to represent zip archive -
++ * forward declaration.
++ */
+ struct zip_t;
+
+-/*
+- Opens zip archive with compression level using the given mode.
+-
+- Args:
+- zipname: zip archive file name.
+- level: compression level (0-9 are the standard zlib-style levels).
+- mode: file access mode.
+- 'r': opens a file for reading/extracting (the file must exists).
+- 'w': creates an empty file for writing.
+- 'a': appends to an existing archive.
+-
+- Returns:
+- The zip archive handler or NULL on error
+-*/
++/**
++ * Opens zip archive with compression level using the given mode.
++ *
++ * @param zipname zip archive file name.
++ * @param level compression level (0-9 are the standard zlib-style levels).
++ * @param mode file access mode.
++ * - 'r': opens a file for reading/extracting (the file must exists).
++ * - 'w': creates an empty file for writing.
++ * - 'a': appends to an existing archive.
++ *
++ * @return the zip archive handler or NULL on error
++ */
+ extern struct zip_t *zip_open(const char *zipname, int level, char mode);
+
+-/*
+- Closes the zip archive, releases resources - always finalize.
+-
+- Args:
+- zip: zip archive handler.
+-*/
++/**
++ * Closes the zip archive, releases resources - always finalize.
++ *
++ * @param zip zip archive handler.
++ */
+ extern void zip_close(struct zip_t *zip);
+
+-/*
+- Opens an entry by name in the zip archive.
+- For zip archive opened in 'w' or 'a' mode the function will append
+- a new entry. In readonly mode the function tries to locate the entry
+- in global dictionary.
+-
+- Args:
+- zip: zip archive handler.
+- entryname: an entry name in local dictionary.
+-
+- Returns:
+- The return code - 0 on success, negative number (< 0) on error.
+-*/
++/**
++ * Opens an entry by name in the zip archive.
++ *
++ * For zip archive opened in 'w' or 'a' mode the function will append
++ * a new entry. In readonly mode the function tries to locate the entry
++ * in global dictionary.
++ *
++ * @param zip zip archive handler.
++ * @param entryname an entry name in local dictionary.
++ *
++ * @return the return code - 0 on success, negative number (< 0) on error.
++ */
+ extern int zip_entry_open(struct zip_t *zip, const char *entryname);
+
+-/*
+- Opens a new entry by index in the zip archive.
+- This function is only valid if zip archive was opened in 'r' (readonly) mode.
+-
+- Args:
+- zip: zip archive handler.
+- index: index in local dictionary.
+-
+- Returns:
+- The return code - 0 on success, negative number (< 0) on error.
+-*/
++/**
++ * Opens a new entry by index in the zip archive.
++ *
++ * This function is only valid if zip archive was opened in 'r' (readonly) mode.
++ *
++ * @param zip zip archive handler.
++ * @param index index in local dictionary.
++ *
++ * @return the return code - 0 on success, negative number (< 0) on error.
++ */
+ extern int zip_entry_openbyindex(struct zip_t *zip, int index);
+
+-/*
+- Closes a zip entry, flushes buffer and releases resources.
+-
+- Args:
+- zip: zip archive handler.
+-
+- Returns:
+- The return code - 0 on success, negative number (< 0) on error.
+-*/
++/**
++ * Closes a zip entry, flushes buffer and releases resources.
++ *
++ * @param zip zip archive handler.
++ *
++ * @return the return code - 0 on success, negative number (< 0) on error.
++ */
+ extern int zip_entry_close(struct zip_t *zip);
+
+-/*
+- Returns a local name of the current zip entry.
+- The main difference between user's entry name and local entry name
+- is optional relative path.
+- Following .ZIP File Format Specification - the path stored MUST not contain
+- a drive or device letter, or a leading slash.
+- All slashes MUST be forward slashes '/' as opposed to backwards slashes '\'
+- for compatibility with Amiga and UNIX file systems etc.
+-
+- Args:
+- zip: zip archive handler.
+-
+- Returns:
+- The pointer to the current zip entry name, or NULL on error.
+-*/
++/**
++ * Returns a local name of the current zip entry.
++ *
++ * The main difference between user's entry name and local entry name
++ * is optional relative path.
++ * Following .ZIP File Format Specification - the path stored MUST not contain
++ * a drive or device letter, or a leading slash.
++ * All slashes MUST be forward slashes '/' as opposed to backwards slashes '\'
++ * for compatibility with Amiga and UNIX file systems etc.
++ *
++ * @param zip: zip archive handler.
++ *
++ * @return the pointer to the current zip entry name, or NULL on error.
++ */
+ extern const char *zip_entry_name(struct zip_t *zip);
+
+-/*
+- Returns an index of the current zip entry.
+-
+- Args:
+- zip: zip archive handler.
+-
+- Returns:
+- The index on success, negative number (< 0) on error.
+-*/
++/**
++ * Returns an index of the current zip entry.
++ *
++ * @param zip zip archive handler.
++ *
++ * @return the index on success, negative number (< 0) on error.
++ */
+ extern int zip_entry_index(struct zip_t *zip);
+
+-/*
+- Determines if the current zip entry is a directory entry.
+-
+- Args:
+- zip: zip archive handler.
+-
+- Returns:
+- The return code - 1 (true), 0 (false), negative number (< 0) on error.
+-*/
++/**
++ * Determines if the current zip entry is a directory entry.
++ *
++ * @param zip zip archive handler.
++ *
++ * @return the return code - 1 (true), 0 (false), negative number (< 0) on
++ * error.
++ */
+ extern int zip_entry_isdir(struct zip_t *zip);
+
+-/*
+- Returns an uncompressed size of the current zip entry.
+-
+- Args:
+- zip: zip archive handler.
+-
+- Returns:
+- The uncompressed size in bytes.
+-*/
++/**
++ * Returns an uncompressed size of the current zip entry.
++ *
++ * @param zip zip archive handler.
++ *
++ * @return the uncompressed size in bytes.
++ */
+ extern unsigned long long zip_entry_size(struct zip_t *zip);
+
+-/*
+- Returns CRC-32 checksum of the current zip entry.
+-
+- Args:
+- zip: zip archive handler.
+-
+- Returns:
+- The CRC-32 checksum.
+-*/
++/**
++ * Returns CRC-32 checksum of the current zip entry.
++ *
++ * @param zip zip archive handler.
++ *
++ * @return the CRC-32 checksum.
++ */
+ extern unsigned int zip_entry_crc32(struct zip_t *zip);
+
+-/*
+- Compresses an input buffer for the current zip entry.
+-
+- Args:
+- zip: zip archive handler.
+- buf: input buffer.
+- bufsize: input buffer size (in bytes).
+-
+- Returns:
+- The return code - 0 on success, negative number (< 0) on error.
+-*/
++/**
++ * Compresses an input buffer for the current zip entry.
++ *
++ * @param zip zip archive handler.
++ * @param buf input buffer.
++ * @param bufsize input buffer size (in bytes).
++ *
++ * @return the return code - 0 on success, negative number (< 0) on error.
++ */
+ extern int zip_entry_write(struct zip_t *zip, const void *buf, size_t bufsize);
+
+-/*
+- Compresses a file for the current zip entry.
+-
+- Args:
+- zip: zip archive handler.
+- filename: input file.
+-
+- Returns:
+- The return code - 0 on success, negative number (< 0) on error.
+-*/
++/**
++ * Compresses a file for the current zip entry.
++ *
++ * @param zip zip archive handler.
++ * @param filename input file.
++ *
++ * @return the return code - 0 on success, negative number (< 0) on error.
++ */
+ extern int zip_entry_fwrite(struct zip_t *zip, const char *filename);
+
+-/*
+- Extracts the current zip entry into output buffer.
+- The function allocates sufficient memory for a output buffer.
+-
+- Args:
+- zip: zip archive handler.
+- buf: output buffer.
+- bufsize: output buffer size (in bytes).
+-
+- Note:
+- - remember to release memory allocated for a output buffer.
+- - for large entries, please take a look at zip_entry_extract function.
+-
+- Returns:
+- The return code - the number of bytes actually read on success.
+- Otherwise a -1 on error.
+-*/
++/**
++ * Extracts the current zip entry into output buffer.
++ *
++ * The function allocates sufficient memory for a output buffer.
++ *
++ * @param zip zip archive handler.
++ * @param buf output buffer.
++ * @param bufsize output buffer size (in bytes).
++ *
++ * @note remember to release memory allocated for a output buffer.
++ * for large entries, please take a look at zip_entry_extract function.
++ *
++ * @return the return code - the number of bytes actually read on success.
++ * Otherwise a -1 on error.
++ */
+ extern ssize_t zip_entry_read(struct zip_t *zip, void **buf, size_t *bufsize);
+
+-/*
+- Extracts the current zip entry into a memory buffer using no memory
+- allocation.
+-
+- Args:
+- zip: zip archive handler.
+- buf: preallocated output buffer.
+- bufsize: output buffer size (in bytes).
+-
+- Note:
+- - ensure supplied output buffer is large enough.
+- - zip_entry_size function (returns uncompressed size for the current entry)
+- can be handy to estimate how big buffer is needed.
+- - for large entries, please take a look at zip_entry_extract function.
+-
+- Returns:
+- The return code - the number of bytes actually read on success.
+- Otherwise a -1 on error (e.g. bufsize is not large enough).
+-*/
+-extern ssize_t zip_entry_noallocread(struct zip_t *zip, void *buf, size_t bufsize);
+-
+-/*
+- Extracts the current zip entry into output file.
+-
+- Args:
+- zip: zip archive handler.
+- filename: output file.
+-
+- Returns:
+- The return code - 0 on success, negative number (< 0) on error.
+-*/
++/**
++ * Extracts the current zip entry into a memory buffer using no memory
++ * allocation.
++ *
++ * @param zip zip archive handler.
++ * @param buf preallocated output buffer.
++ * @param bufsize output buffer size (in bytes).
++ *
++ * @note ensure supplied output buffer is large enough.
++ * zip_entry_size function (returns uncompressed size for the current
++ * entry) can be handy to estimate how big buffer is needed. for large
++ * entries, please take a look at zip_entry_extract function.
++ *
++ * @return the return code - the number of bytes actually read on success.
++ * Otherwise a -1 on error (e.g. bufsize is not large enough).
++ */
++extern ssize_t zip_entry_noallocread(struct zip_t *zip, void *buf,
++ size_t bufsize);
++
++/**
++ * Extracts the current zip entry into output file.
++ *
++ * @param zip zip archive handler.
++ * @param filename output file.
++ *
++ * @return the return code - 0 on success, negative number (< 0) on error.
++ */
+ extern int zip_entry_fread(struct zip_t *zip, const char *filename);
+
+-/*
+- Extracts the current zip entry using a callback function (on_extract).
+-
+- Args:
+- zip: zip archive handler.
+- on_extract: callback function.
+- arg: opaque pointer (optional argument,
+- which you can pass to the on_extract callback)
+-
+- Returns:
+- The return code - 0 on success, negative number (< 0) on error.
++/**
++ * Extracts the current zip entry using a callback function (on_extract).
++ *
++ * @param zip zip archive handler.
++ * @param on_extract callback function.
++ * @param arg opaque pointer (optional argument, which you can pass to the
++ * on_extract callback)
++ *
++ * @return the return code - 0 on success, negative number (< 0) on error.
+ */
+ extern int
+ zip_entry_extract(struct zip_t *zip,
+@@ -262,53 +261,49 @@ zip_entry_extract(struct zip_t *zip,
+ const void *data, size_t size),
+ void *arg);
+
+-/*
+- Returns the number of all entries (files and directories) in the zip archive.
+-
+- Args:
+- zip: zip archive handler.
+-
+- Returns:
+- The return code - the number of entries on success,
+- negative number (< 0) on error.
+-*/
++/**
++ * Returns the number of all entries (files and directories) in the zip archive.
++ *
++ * @param zip zip archive handler.
++ *
++ * @return the return code - the number of entries on success, negative number
++ * (< 0) on error.
++ */
+ extern int zip_total_entries(struct zip_t *zip);
+
+-/*
+- Creates a new archive and puts files into a single zip archive.
+-
+- Args:
+- zipname: zip archive file.
+- filenames: input files.
+- len: number of input files.
+-
+- Returns:
+- The return code - 0 on success, negative number (< 0) on error.
+-*/
++/**
++ * Creates a new archive and puts files into a single zip archive.
++ *
++ * @param zipname zip archive file.
++ * @param filenames input files.
++ * @param len: number of input files.
++ *
++ * @return the return code - 0 on success, negative number (< 0) on error.
++ */
+ extern int zip_create(const char *zipname, const char *filenames[], size_t len);
+
+-/*
+- Extracts a zip archive file into directory.
+-
+- If on_extract_entry is not NULL, the callback will be called after
+- successfully extracted each zip entry.
+- Returning a negative value from the callback will cause abort and return an
+- error. The last argument (void *arg) is optional, which you can use to pass
+- data to the on_extract_entry callback.
+-
+- Args:
+- zipname: zip archive file.
+- dir: output directory.
+- on_extract_entry: on extract callback.
+- arg: opaque pointer.
+-
+- Returns:
+- The return code - 0 on success, negative number (< 0) on error.
+-*/
++/**
++ * Extracts a zip archive file into directory.
++ *
++ * If on_extract_entry is not NULL, the callback will be called after
++ * successfully extracted each zip entry.
++ * Returning a negative value from the callback will cause abort and return an
++ * error. The last argument (void *arg) is optional, which you can use to pass
++ * data to the on_extract_entry callback.
++ *
++ * @param zipname zip archive file.
++ * @param dir output directory.
++ * @param on_extract_entry on extract callback.
++ * @param arg opaque pointer.
++ *
++ * @return the return code - 0 on success, negative number (< 0) on error.
++ */
+ extern int zip_extract(const char *zipname, const char *dir,
+ int (*on_extract_entry)(const char *filename, void *arg),
+ void *arg);
+
++/** @} */
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff --git a/contrib/zip/test/CMakeLists.txt b/contrib/zip/test/CMakeLists.txt
+index 9b2a8db106..cc060b00fe 100644
+--- a/contrib/zip/test/CMakeLists.txt
++++ b/contrib/zip/test/CMakeLists.txt
+@@ -1,19 +1,16 @@
+ cmake_minimum_required(VERSION 2.8)
+
+-if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
+- if(ENABLE_COVERAGE)
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g ")
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs")
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage")
+- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
+- endif()
+-endif ()
+-
+ # test
+-include_directories(../src)
+-add_executable(test.exe test.c ../src/zip.c)
+-add_executable(test_miniz.exe test_miniz.c)
++set(test_out test.out)
++set(test_miniz_out test_miniz.out)
++
++add_executable(${test_out} test.c)
++target_link_libraries(${test_out} zip)
++add_executable(${test_miniz_out} test_miniz.c)
++target_link_libraries(${test_miniz_out} zip)
++
++add_test(NAME ${test_out} COMMAND ${test_out})
++add_test(NAME ${test_miniz_out} COMMAND ${test_miniz_out})
+
+-add_test(NAME test COMMAND test.exe)
+-add_test(NAME test_miniz COMMAND test_miniz.exe)
++set(test_out ${test_out} PARENT_SCOPE)
++set(test_miniz_out ${test_miniz_out} PARENT_SCOPE)
+diff --git a/contrib/zip/test/test.c b/contrib/zip/test/test.c
+index 454430533a..a9b2ddab1e 100644
+--- a/contrib/zip/test/test.c
++++ b/contrib/zip/test/test.c
+@@ -29,6 +29,8 @@
+ #define XFILE "7.txt\0"
+ #define XMODE 0100777
+
++#define UNIXMODE 0100644
++
+ #define UNUSED(x) (void)x
+
+ static int total_entries = 0;
+@@ -102,7 +104,8 @@ static void test_read(void) {
+ assert(0 == zip_entry_close(zip));
+ free(buf);
+ buf = NULL;
+-
++ bufsize = 0;
++
+ assert(0 == zip_entry_open(zip, "test/test-2.txt"));
+ assert(strlen(TESTDATA2) == zip_entry_size(zip));
+ assert(CRC32DATA2 == zip_entry_crc32(zip));
+@@ -131,7 +134,8 @@ static void test_read(void) {
+ assert(0 == zip_entry_close(zip));
+ free(buf);
+ buf = NULL;
+-
++ bufsize = 0;
++
+ buftmp = strlen(TESTDATA1);
+ buf = calloc(buftmp, sizeof(char));
+ assert(0 == zip_entry_open(zip, "test/test-1.txt"));
+@@ -433,6 +437,35 @@ static void test_mtime(void) {
+ remove(ZIPNAME);
+ }
+
++static void test_unix_permissions(void) {
++#if defined(_WIN64) || defined(_WIN32) || defined(__WIN32__)
++#else
++ // UNIX or APPLE
++ struct MZ_FILE_STAT_STRUCT file_stats;
++
++ remove(ZIPNAME);
++
++ struct zip_t *zip = zip_open(ZIPNAME, ZIP_DEFAULT_COMPRESSION_LEVEL, 'w');
++ assert(zip != NULL);
++
++ assert(0 == zip_entry_open(zip, RFILE));
++ assert(0 == zip_entry_write(zip, TESTDATA1, strlen(TESTDATA1)));
++ assert(0 == zip_entry_close(zip));
++
++ zip_close(zip);
++
++ remove(RFILE);
++
++ assert(0 == zip_extract(ZIPNAME, ".", NULL, NULL));
++
++ assert(0 == MZ_FILE_STAT(RFILE, &file_stats));
++ assert(UNIXMODE == file_stats.st_mode);
++
++ remove(RFILE);
++ remove(ZIPNAME);
++#endif
++}
++
+ int main(int argc, char *argv[]) {
+ UNUSED(argc);
+ UNUSED(argv);
+@@ -453,6 +486,7 @@ int main(int argc, char *argv[]) {
+ test_write_permissions();
+ test_exe_permissions();
+ test_mtime();
++ test_unix_permissions();
+
+ remove(ZIPNAME);
+ return 0;
+diff --git a/contrib/zip/test/test_miniz.c b/contrib/zip/test/test_miniz.c
+index ebc0564dc3..babcaecdb6 100644
+--- a/contrib/zip/test/test_miniz.c
++++ b/contrib/zip/test/test_miniz.c
+@@ -23,16 +23,39 @@ int main(int argc, char *argv[]) {
+ uint step = 0;
+ int cmp_status;
+ uLong src_len = (uLong)strlen(s_pStr);
+- uLong cmp_len = compressBound(src_len);
+ uLong uncomp_len = src_len;
++ uLong cmp_len;
+ uint8 *pCmp, *pUncomp;
++ size_t sz;
+ uint total_succeeded = 0;
+ (void)argc, (void)argv;
+
+ printf("miniz.c version: %s\n", MZ_VERSION);
+
+ do {
++ pCmp = (uint8 *)tdefl_compress_mem_to_heap(s_pStr, src_len, &cmp_len, 0);
++ if (!pCmp) {
++ printf("tdefl_compress_mem_to_heap failed\n");
++ return EXIT_FAILURE;
++ }
++ if (src_len <= cmp_len) {
++ printf("tdefl_compress_mem_to_heap failed: from %u to %u bytes\n",
++ (mz_uint32)uncomp_len, (mz_uint32)cmp_len);
++ free(pCmp);
++ return EXIT_FAILURE;
++ }
++
++ sz = tdefl_compress_mem_to_mem(pCmp, cmp_len, s_pStr, src_len, 0);
++ if (sz != cmp_len) {
++ printf("tdefl_compress_mem_to_mem failed: expected %u, got %u\n",
++ (mz_uint32)cmp_len, (mz_uint32)sz);
++ free(pCmp);
++ return EXIT_FAILURE;
++ }
++
+ // Allocate buffers to hold compressed and uncompressed data.
++ free(pCmp);
++ cmp_len = compressBound(src_len);
+ pCmp = (mz_uint8 *)malloc((size_t)cmp_len);
+ pUncomp = (mz_uint8 *)malloc((size_t)src_len);
+ if ((!pCmp) || (!pUncomp)) {
diff --git a/package/assimp/0002-contrib-zip-fix-ssize_t-typedef-mismatch-for-musl-co.patch b/package/assimp/0002-contrib-zip-fix-ssize_t-typedef-mismatch-for-musl-co.patch
deleted file mode 100644
index a9a30c4834..0000000000
--- a/package/assimp/0002-contrib-zip-fix-ssize_t-typedef-mismatch-for-musl-co.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 3fef857a570d1ef2c96401358fe8e239625b48c9 Mon Sep 17 00:00:00 2001
-From: Peter Seiderer <ps.report@gmx.net>
-Date: Fri, 10 Apr 2020 18:11:50 +0200
-Subject: [PATCH] contrib/zip: fix ssize_t typedef mismatch for musl compile
-
-Musl uses defines __DEFINED_ssize_t to indicate ssize_t
-availability. So backport this part of upstream commit [1]
-to fixl musl compile.
-
-https://github.com/assimp/assimp/commit/f78446b14aff46db2ef27d062a275b6a01fd68b1
-
-Signed-off-by: Peter Seiderer <ps.report@gmx.net>
----
- contrib/zip/src/zip.h | 13 +++++++++++--
- 1 file changed, 11 insertions(+), 2 deletions(-)
-
-diff --git a/contrib/zip/src/zip.h b/contrib/zip/src/zip.h
-index 5f39df50..4672eb3e 100644
---- a/contrib/zip/src/zip.h
-+++ b/contrib/zip/src/zip.h
-@@ -20,8 +20,9 @@ extern "C" {
- #endif
-
- #if !defined(_SSIZE_T_DEFINED) && !defined(_SSIZE_T_DEFINED_) && \
-- !defined(_SSIZE_T) && !defined(_SSIZE_T_) && !defined(__ssize_t_defined)
--#define _SSIZE_T
-+ !defined(__DEFINED_ssize_t) && !defined(__ssize_t_defined) && \
-+ !defined(_SSIZE_T) && !defined(_SSIZE_T_)
-+
- // 64-bit Windows is the only mainstream platform
- // where sizeof(long) != sizeof(void*)
- #ifdef _WIN64
-@@ -29,6 +30,14 @@ typedef long long ssize_t; /* byte count or error */
- #else
- typedef long ssize_t; /* byte count or error */
- #endif
-+
-+#define _SSIZE_T_DEFINED
-+#define _SSIZE_T_DEFINED_
-+#define __DEFINED_ssize_t
-+#define __ssize_t_defined
-+#define _SSIZE_T
-+#define _SSIZE_T_
-+
- #endif
-
- #ifndef MAX_PATH
---
-2.26.0
-
diff --git a/package/assimp/0003-closes-2954-upgrade-to-latest-greatest.patch b/package/assimp/0003-closes-2954-upgrade-to-latest-greatest.patch
new file mode 100644
index 0000000000..9bd24630c5
--- /dev/null
+++ b/package/assimp/0003-closes-2954-upgrade-to-latest-greatest.patch
@@ -0,0 +1,243 @@
+From bb3db0ebaffc6b76de256e597ec1d1e4d2a6663f Mon Sep 17 00:00:00 2001
+From: kimkulling <kim.kulling@googlemail.com>
+Date: Mon, 9 Mar 2020 10:51:26 +0100
+Subject: [PATCH] closes https://github.com/assimp/assimp/issues/2954: upgrade
+ to latest greatest.
+
+[Retrieved from:
+https://github.com/assimp/assimp/commit/bb3db0ebaffc6b76de256e597ec1d1e4d2a6663f]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ contrib/zip/CMakeLists.txt | 8 ++----
+ contrib/zip/README.md | 51 +++++++++++++++++++++++++++++++--
+ contrib/zip/src/zip.c | 17 ++++++++++-
+ contrib/zip/src/zip.h | 13 ++++++++-
+ contrib/zip/test/CMakeLists.txt | 5 ----
+ contrib/zip/test/test.c | 4 ++-
+ 6 files changed, 81 insertions(+), 17 deletions(-)
+
+diff --git a/contrib/zip/CMakeLists.txt b/contrib/zip/CMakeLists.txt
+index 77916d2e14..f194649ede 100644
+--- a/contrib/zip/CMakeLists.txt
++++ b/contrib/zip/CMakeLists.txt
+@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
+
+ project(zip
+ LANGUAGES C
+- VERSION "0.1.15")
++ VERSION "0.1.18")
+ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
+
+ option(CMAKE_DISABLE_TESTING "Disable test creation" OFF)
+@@ -16,10 +16,6 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
+ "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
+ "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -Werror -pedantic")
+- if(ENABLE_COVERAGE)
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
+- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
+- endif()
+ endif (MSVC)
+
+ # zip
+@@ -35,7 +31,7 @@ if (NOT CMAKE_DISABLE_TESTING)
+ enable_testing()
+ add_subdirectory(test)
+ find_package(Sanitizers)
+- add_sanitizers(${PROJECT_NAME} ${test_out} ${test_miniz_out})
++ add_sanitizers(${PROJECT_NAME} ${test_out})
+ endif()
+
+ ####
+diff --git a/contrib/zip/README.md b/contrib/zip/README.md
+index 14eb9a34c8..bdd0822b67 100644
+--- a/contrib/zip/README.md
++++ b/contrib/zip/README.md
+@@ -1,10 +1,8 @@
+ ### A portable (OSX/Linux/Windows), simple zip library written in C
+ This is done by hacking awesome [miniz](https://code.google.com/p/miniz) library and layering functions on top of the miniz v1.15 API.
+
+-[![Windows](https://ci.appveyor.com/api/projects/status/bph8dr3jacgmjv32/branch/master?svg=true&label=windows)](https://ci.appveyor.com/project/kuba--/zip)
+-[![Linux](https://travis-ci.org/kuba--/zip.svg?branch=master&label=linux%2fosx)](https://travis-ci.org/kuba--/zip)
++[![Build](https://github.com/kuba--/zip/workflows/build/badge.svg)](https://github.com/kuba--/zip/actions?query=workflow%3Abuild)
+ [![Version](https://badge.fury.io/gh/kuba--%2Fzip.svg)](https://github.com/kuba--/zip/releases)
+-[![Codecov](https://codecov.io/gh/kuba--/zip/branch/master/graph/badge.svg)](https://codecov.io/gh/kuba--/zip)
+
+
+ # The Idea
+@@ -213,6 +211,53 @@ func main() {
+ }
+ ```
+
++### Rust (ffi)
++```rust
++extern crate libc;
++use std::ffi::CString;
++
++#[repr(C)]
++pub struct Zip {
++ _private: [u8; 0],
++}
++
++#[link(name = "zip")]
++extern "C" {
++ fn zip_open(path: *const libc::c_char, level: libc::c_int, mode: libc::c_char) -> *mut Zip;
++ fn zip_close(zip: *mut Zip) -> libc::c_void;
++
++ fn zip_entry_open(zip: *mut Zip, entryname: *const libc::c_char) -> libc::c_int;
++ fn zip_entry_close(zip: *mut Zip) -> libc::c_int;
++ fn zip_entry_write(
++ zip: *mut Zip,
++ buf: *const libc::c_void,
++ bufsize: libc::size_t,
++ ) -> libc::c_int;
++}
++
++fn main() {
++ let path = CString::new("/tmp/test.zip").unwrap();
++ let mode: libc::c_char = 'w' as libc::c_char;
++
++ let entryname = CString::new("test.txt").unwrap();
++ let content = "test content\0";
++
++ unsafe {
++ let zip: *mut Zip = zip_open(path.as_ptr(), 5, mode);
++ {
++ zip_entry_open(zip, entryname.as_ptr());
++ {
++ let buf = content.as_ptr() as *const libc::c_void;
++ let bufsize = content.len() as libc::size_t;
++ zip_entry_write(zip, buf, bufsize);
++ }
++ zip_entry_close(zip);
++ }
++ zip_close(zip);
++ }
++}
++```
++
+ ### Ruby (ffi)
+ Install _ffi_ gem.
+ ```shell
+diff --git a/contrib/zip/src/zip.c b/contrib/zip/src/zip.c
+index 1abcfd8fd1..3b2821e6a3 100644
+--- a/contrib/zip/src/zip.c
++++ b/contrib/zip/src/zip.c
+@@ -222,6 +222,20 @@ void zip_close(struct zip_t *zip) {
+ }
+ }
+
++int zip_is64(struct zip_t *zip) {
++ if (!zip) {
++ // zip_t handler is not initialized
++ return -1;
++ }
++
++ if (!zip->archive.m_pState) {
++ // zip state is not initialized
++ return -1;
++ }
++
++ return (int)zip->archive.m_pState->m_zip64;
++}
++
+ int zip_entry_open(struct zip_t *zip, const char *entryname) {
+ size_t entrylen = 0;
+ mz_zip_archive *pzip = NULL;
+@@ -794,7 +808,8 @@ int zip_create(const char *zipname, const char *filenames[], size_t len) {
+
+ if (MZ_FILE_STAT(name, &file_stat) != 0) {
+ // problem getting information - check errno
+- return -1;
++ status = -1;
++ break;
+ }
+
+ if ((file_stat.st_mode & 0200) == 0) {
+diff --git a/contrib/zip/src/zip.h b/contrib/zip/src/zip.h
+index a48d64d6de..cd3ab5cd00 100644
+--- a/contrib/zip/src/zip.h
++++ b/contrib/zip/src/zip.h
+@@ -21,7 +21,7 @@ extern "C" {
+
+ #if !defined(_SSIZE_T_DEFINED) && !defined(_SSIZE_T_DEFINED_) && \
+ !defined(__DEFINED_ssize_t) && !defined(__ssize_t_defined) && \
+- !defined(_SSIZE_T) && !defined(_SSIZE_T_)
++ !defined(_SSIZE_T) && !defined(_SSIZE_T_) && !defined(_SSIZE_T_DECLARED)
+
+ // 64-bit Windows is the only mainstream platform
+ // where sizeof(long) != sizeof(void*)
+@@ -37,6 +37,7 @@ typedef long ssize_t; /* byte count or error */
+ #define __ssize_t_defined
+ #define _SSIZE_T
+ #define _SSIZE_T_
++#define _SSIZE_T_DECLARED
+
+ #endif
+
+@@ -90,6 +91,16 @@ extern struct zip_t *zip_open(const char *zipname, int level, char mode);
+ */
+ extern void zip_close(struct zip_t *zip);
+
++/**
++ * Determines if the archive has a zip64 end of central directory headers.
++ *
++ * @param zip zip archive handler.
++ *
++ * @return the return code - 1 (true), 0 (false), negative number (< 0) on
++ * error.
++ */
++extern int zip_is64(struct zip_t *zip);
++
+ /**
+ * Opens an entry by name in the zip archive.
+ *
+diff --git a/contrib/zip/test/CMakeLists.txt b/contrib/zip/test/CMakeLists.txt
+index cc060b00fe..1224115858 100644
+--- a/contrib/zip/test/CMakeLists.txt
++++ b/contrib/zip/test/CMakeLists.txt
+@@ -2,15 +2,10 @@ cmake_minimum_required(VERSION 2.8)
+
+ # test
+ set(test_out test.out)
+-set(test_miniz_out test_miniz.out)
+
+ add_executable(${test_out} test.c)
+ target_link_libraries(${test_out} zip)
+-add_executable(${test_miniz_out} test_miniz.c)
+-target_link_libraries(${test_miniz_out} zip)
+
+ add_test(NAME ${test_out} COMMAND ${test_out})
+-add_test(NAME ${test_miniz_out} COMMAND ${test_miniz_out})
+
+ set(test_out ${test_out} PARENT_SCOPE)
+-set(test_miniz_out ${test_miniz_out} PARENT_SCOPE)
+diff --git a/contrib/zip/test/test.c b/contrib/zip/test/test.c
+index a9b2ddab1e..9cc2248ac0 100644
+--- a/contrib/zip/test/test.c
++++ b/contrib/zip/test/test.c
+@@ -47,7 +47,7 @@ static void test_write(void) {
+ assert(CRC32DATA1 == zip_entry_crc32(zip));
+ ++total_entries;
+ assert(0 == zip_entry_close(zip));
+-
++ assert(0 == zip_is64(zip));
+ zip_close(zip);
+ }
+
+@@ -92,6 +92,7 @@ static void test_read(void) {
+ size_t buftmp;
+ struct zip_t *zip = zip_open(ZIPNAME, 0, 'r');
+ assert(zip != NULL);
++ assert(0 == zip_is64(zip));
+
+ assert(0 == zip_entry_open(zip, "test\\test-1.txt"));
+ assert(strlen(TESTDATA1) == zip_entry_size(zip));
+@@ -310,6 +311,7 @@ static void test_fwrite(void) {
+ assert(0 == zip_entry_open(zip, WFILE));
+ assert(0 == zip_entry_fwrite(zip, WFILE));
+ assert(0 == zip_entry_close(zip));
++ assert(0 == zip_is64(zip));
+
+ zip_close(zip);
+ remove(WFILE);
diff --git a/package/assimp/0003-contrib-zlib-disable-dynamic-library-building.patch b/package/assimp/0003-contrib-zlib-disable-dynamic-library-building.patch
deleted file mode 100644
index 8661311be5..0000000000
--- a/package/assimp/0003-contrib-zlib-disable-dynamic-library-building.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 2b8684aded0c383be64bac0fa59e39870252963f Mon Sep 17 00:00:00 2001
-From: Peter Seiderer <ps.report@gmx.net>
-Date: Sun, 12 Apr 2020 18:19:13 +0200
-Subject: [PATCH] contrib/zlib: disable dynamic library building
-
-Fixes compile failure for static only toolchains (and assimp
-links against the static one).
-
-Signed-off-by: Peter Seiderer <ps.report@gmx.net>
----
- contrib/zlib/CMakeLists.txt | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/contrib/zlib/CMakeLists.txt b/contrib/zlib/CMakeLists.txt
-index 9d1fcc94..78346233 100644
---- a/contrib/zlib/CMakeLists.txt
-+++ b/contrib/zlib/CMakeLists.txt
-@@ -195,10 +195,7 @@ if(MINGW)
- set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
- endif(MINGW)
-
--add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
- add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
--set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
--set_target_properties(zlib PROPERTIES SOVERSION 1)
-
- INSTALL( TARGETS zlibstatic
- LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
---
-2.26.0
-
diff --git a/package/assimp/Config.in b/package/assimp/Config.in
index 9bdc054909..c535240efc 100644
--- a/package/assimp/Config.in
+++ b/package/assimp/Config.in
@@ -2,6 +2,7 @@ config BR2_PACKAGE_ASSIMP
bool "assimp"
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_USE_WCHAR
+ depends on BR2_PACKAGE_LIBZLIB
help
Open Asset Import Library (assimp) is a portable Open Source
library to import various well-known 3D model formats in a
@@ -12,4 +13,8 @@ config BR2_PACKAGE_ASSIMP
http://www.assimp.org
comment "assimp needs a toolchain w/ C++, wchar"
+ depends on BR2_PACKAGE_LIBZLIB
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR
+
+comment "assimp needs libzlib"
+ depends on !BR2_PACKAGE_LIBZLIB
diff --git a/package/assimp/assimp.mk b/package/assimp/assimp.mk
index e1b9a23499..eddfbc48b0 100644
--- a/package/assimp/assimp.mk
+++ b/package/assimp/assimp.mk
@@ -8,6 +8,7 @@ ASSIMP_VERSION = 5.0.1
ASSIMP_SITE = $(call github,assimp,assimp,v$(ASSIMP_VERSION))
ASSIMP_LICENSE = BSD-3-Clause
ASSIMP_LICENSE_FILES = LICENSE
+ASSIMP_DEPENDENCIES = zlib
ASSIMP_INSTALL_STAGING = YES
# relocation truncated to fit: R_68K_GOT16O. We also need to disable
@@ -36,7 +37,7 @@ ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
ASSIMP_CXXFLAGS += -O0
endif
-ASSIMP_CONF_OPTS += -DASSIMP_BUILD_ZLIB=ON -DASSIMP_BUILD_TESTS=OFF \
+ASSIMP_CONF_OPTS += -DASSIMP_BUILD_TESTS=OFF \
-DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) $(ASSIMP_CXXFLAGS)"
$(eval $(cmake-package))
diff --git a/package/audit/0001-Fix-audispd-path-in-auditd.conf.patch b/package/audit/0001-Fix-audispd-path-in-auditd.conf.patch
deleted file mode 100644
index ccf45db911..0000000000
--- a/package/audit/0001-Fix-audispd-path-in-auditd.conf.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 6e1fd09f7bc131c8f16d9cc43e2455ba4650c651 Mon Sep 17 00:00:00 2001
-From: Carlos Santos <casantos@datacom.com.br>
-Date: Sat, 3 Nov 2018 08:25:58 -0300
-Subject: [PATCH] Fix audispd path in auditd.conf
-
-audispd is installed at /usr/sbin but the configuration file pointed
-to /sbin, causing auditd to fail on startup.
-
-This patch cannot be sent upstream because audispd does not exist
-anymore on the master branch (it was merged to auditd).
-
-Signed-off-by: Carlos Santos <casantos@datacom.com.br>
----
- init.d/auditd.conf | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/init.d/auditd.conf b/init.d/auditd.conf
-index 4dcda83..998904f 100644
---- a/init.d/auditd.conf
-+++ b/init.d/auditd.conf
-@@ -13,7 +13,7 @@ max_log_file = 8
- num_logs = 5
- priority_boost = 4
- disp_qos = lossy
--dispatcher = /sbin/audispd
-+dispatcher = /usr/sbin/audispd
- name_format = NONE
- ##name = mydomain
- max_log_file_action = ROTATE
---
-2.17.1
-
diff --git a/package/audit/0002-Add-substitue-functions-for-strndupa-rawmemchr.patch b/package/audit/0002-Add-substitue-functions-for-strndupa-rawmemchr.patch
deleted file mode 100644
index ac292c57d1..0000000000
--- a/package/audit/0002-Add-substitue-functions-for-strndupa-rawmemchr.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From c39a071e7c021f6ff3554aca2758e97b47a9777c Mon Sep 17 00:00:00 2001
-From: Steve Grubb <sgrubb@redhat.com>
-Date: Tue, 26 Feb 2019 18:33:33 -0500
-Subject: [PATCH] Add substitue functions for strndupa & rawmemchr
-
-(cherry picked from commit d579a08bb1cde71f939c13ac6b2261052ae9f77e)
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
----
- auparse/auparse.c | 12 +++++++++++-
- auparse/interpret.c | 9 ++++++++-
- configure.ac | 14 +++++++++++++-
- src/ausearch-lol.c | 12 +++++++++++-
- 4 files changed, 43 insertions(+), 4 deletions(-)
-
-diff --git a/auparse/auparse.c b/auparse/auparse.c
-index 650db02..2e1c737 100644
---- a/auparse/auparse.c
-+++ b/auparse/auparse.c
-@@ -1,5 +1,5 @@
- /* auparse.c --
-- * Copyright 2006-08,2012-17 Red Hat Inc., Durham, North Carolina.
-+ * Copyright 2006-08,2012-19 Red Hat Inc., Durham, North Carolina.
- * All Rights Reserved.
- *
- * This library is free software; you can redistribute it and/or
-@@ -1118,6 +1118,16 @@ static int str2event(char *s, au_event_t *e)
- return 0;
- }
-
-+#ifndef HAVE_STRNDUPA
-+static inline char *strndupa(const char *old, size_t n)
-+{
-+ size_t len = strnlen(old, n);
-+ char *tmp = alloca(len + 1);
-+ tmp[len] = 0;
-+ return memcpy(tmp, old, len);
-+}
-+#endif
-+
- /* Returns 0 on success and 1 on error */
- static int extract_timestamp(const char *b, au_event_t *e)
- {
-diff --git a/auparse/interpret.c b/auparse/interpret.c
-index 51c4a5e..67b7b77 100644
---- a/auparse/interpret.c
-+++ b/auparse/interpret.c
-@@ -853,6 +853,13 @@ err_out:
- return print_escaped(id->val);
- }
-
-+// rawmemchr is faster. Let's use it if we have it.
-+#ifdef HAVE_RAWMEMCHR
-+#define STRCHR rawmemchr
-+#else
-+#define STRCHR strchr
-+#endif
-+
- static const char *print_proctitle(const char *val)
- {
- char *out = (char *)print_escaped(val);
-@@ -863,7 +870,7 @@ static const char *print_proctitle(const char *val)
- // Proctitle has arguments separated by NUL bytes
- // We need to write over the NUL bytes with a space
- // so that we can see the arguments
-- while ((ptr = rawmemchr(ptr, '\0'))) {
-+ while ((ptr = STRCHR(ptr, '\0'))) {
- if (ptr >= end)
- break;
- *ptr = ' ';
-diff --git a/configure.ac b/configure.ac
-index 6e345f1..6f3007e 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1,7 +1,7 @@
- dnl
- define([AC_INIT_NOTICE],
- [### Generated automatically using autoconf version] AC_ACVERSION [
--### Copyright 2005-18 Steve Grubb <sgrubb@redhat.com>
-+### Copyright 2005-19 Steve Grubb <sgrubb@redhat.com>
- ###
- ### Permission is hereby granted, free of charge, to any person obtaining a
- ### copy of this software and associated documentation files (the "Software"),
-@@ -72,6 +72,18 @@ dnl; posix_fallocate is used in audisp-remote
- AC_CHECK_FUNCS([posix_fallocate])
- dnl; signalfd is needed for libev
- AC_CHECK_FUNC([signalfd], [], [ AC_MSG_ERROR([The signalfd system call is necessary for auditd]) ])
-+dnl; check if rawmemchr is available
-+AC_CHECK_FUNCS([rawmemchr])
-+dnl; check if strndupa is available
-+AC_LINK_IFELSE(
-+ [AC_LANG_SOURCE(
-+ [[
-+ #define _GNU_SOURCE
-+ #include <string.h>
-+ int main() { (void) strndupa("test", 10); return 0; }]])],
-+ [AC_DEFINE(HAVE_STRNDUPA, 1, [Let us know if we have it or not])],
-+ []
-+)
-
- ALLWARNS=""
- ALLDEBUG="-g"
-diff --git a/src/ausearch-lol.c b/src/ausearch-lol.c
-index 5d17a72..758c33e 100644
---- a/src/ausearch-lol.c
-+++ b/src/ausearch-lol.c
-@@ -1,6 +1,6 @@
- /*
- * ausearch-lol.c - linked list of linked lists library
--* Copyright (c) 2008,2010,2014,2016 Red Hat Inc., Durham, North Carolina.
-+* Copyright (c) 2008,2010,2014,2016,2019 Red Hat Inc., Durham, North Carolina.
- * All Rights Reserved.
- *
- * This software may be freely redistributed and/or modified under the
-@@ -152,6 +152,16 @@ static int compare_event_time(event *e1, event *e2)
- return 0;
- }
-
-+#ifndef HAVE_STRNDUPA
-+static inline char *strndupa(const char *old, size_t n)
-+{
-+ size_t len = strnlen(old, n);
-+ char *tmp = alloca(len + 1);
-+ tmp[len] = 0;
-+ return memcpy(tmp, old, len);
-+}
-+#endif
-+
- /*
- * This function will look at the line and pick out pieces of it.
- */
---
-2.21.0
-
diff --git a/package/audit/0003-Header-definitions-need-to-be-external-when-building.patch b/package/audit/0003-Header-definitions-need-to-be-external-when-building.patch
deleted file mode 100644
index 9a546261df..0000000000
--- a/package/audit/0003-Header-definitions-need-to-be-external-when-building.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 017e6c6ab95df55f34e339d2139def83e5dada1f Mon Sep 17 00:00:00 2001
-From: Steve Grubb <sgrubb@redhat.com>
-Date: Fri, 10 Jan 2020 21:13:50 -0500
-Subject: [PATCH] Header definitions need to be external when building with
- -fno-common (which is default in GCC 10) - Tony Jones
-
-Patch taken from upstream: https://github.com/linux-audit/audit-userspace/commit/017e6c6ab95df55f34e339d2139def83e5dada1f
-Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
----
- src/ausearch-common.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/ausearch-common.h b/src/ausearch-common.h
-index 6669203..3040547 100644
---- a/src/ausearch-common.h
-+++ b/src/ausearch-common.h
-@@ -50,7 +50,7 @@ extern pid_t event_pid;
- extern int event_exact_match;
- extern uid_t event_uid, event_euid, event_loginuid;
- extern const char *event_tuid, *event_teuid, *event_tauid;
--slist *event_node_list;
-+extern slist *event_node_list;
- extern const char *event_comm;
- extern const char *event_filename;
- extern const char *event_hostname;
---
-2.20.1
-
diff --git a/package/audit/S02auditd b/package/audit/S02auditd
index 2ecf0f1df9..0eef881cee 100644
--- a/package/audit/S02auditd
+++ b/package/audit/S02auditd
@@ -18,9 +18,9 @@ start(){
# Create dir to store log files in if one doesn't exist. Create
# the directory with SELinux permissions if possible
- command -v matchpathcon >/dev/null 2>&1
+ command -v selabel_lookup >/dev/null 2>&1
if [ $? = 0 ]; then
- mkdir -p /var/log/audit -Z `matchpathcon -n /var/log/audit`
+ mkdir -p /var/log/audit -Z `selabel_lookup -b file -k /var/log/audit`
else
mkdir -p /var/log/audit
fi
diff --git a/package/audit/audit.hash b/package/audit/audit.hash
index 71e7df7dbc..4ef9a42b0d 100644
--- a/package/audit/audit.hash
+++ b/package/audit/audit.hash
@@ -1,4 +1,4 @@
#Locally computed
-sha256 0e5d4103646e00f8d1981e1cd2faea7a2ae28e854c31a803e907a383c5e2ecb7 audit-2.8.5.tar.gz
-sha256 32b1062f7da84967e7019d01ab805935caa7ab7321a7ced0e30ebe75e5df1670 COPYING
-sha256 f18a0811fa0e220ccbc42f661545e77f0388631e209585ed582a1c693029c6aa COPYING.LIB
+sha256 994c4250d8fd43f3087a3c2ce73461832e30f1e9b278bf5bb03c3e07091155a5 audit-3.0.1.tar.gz
+sha256 32b1062f7da84967e7019d01ab805935caa7ab7321a7ced0e30ebe75e5df1670 COPYING
+sha256 f18a0811fa0e220ccbc42f661545e77f0388631e209585ed582a1c693029c6aa COPYING.LIB
diff --git a/package/audit/audit.mk b/package/audit/audit.mk
index 05a16e6e31..df6650593d 100644
--- a/package/audit/audit.mk
+++ b/package/audit/audit.mk
@@ -4,7 +4,7 @@
#
################################################################################
-AUDIT_VERSION = 2.8.5
+AUDIT_VERSION = 3.0.1
AUDIT_SITE = http://people.redhat.com/sgrubb/audit
AUDIT_LICENSE = GPL-2.0+ (programs), LGPL-2.1+ (libraries)
AUDIT_LICENSE_FILES = COPYING COPYING.LIB
diff --git a/package/avahi/0001-Fix-NULL-pointer-crashes-from-175.patch b/package/avahi/0001-Fix-NULL-pointer-crashes-from-175.patch
new file mode 100644
index 0000000000..7e191e8da7
--- /dev/null
+++ b/package/avahi/0001-Fix-NULL-pointer-crashes-from-175.patch
@@ -0,0 +1,152 @@
+From 9d31939e55280a733d930b15ac9e4dda4497680c Mon Sep 17 00:00:00 2001
+From: Tommi Rantala <tommi.t.rantala@nokia.com>
+Date: Mon, 8 Feb 2021 11:04:43 +0200
+Subject: [PATCH] Fix NULL pointer crashes from #175
+
+avahi-daemon is crashing when running "ping .local".
+The crash is due to failing assertion from NULL pointer.
+Add missing NULL pointer checks to fix it.
+
+Introduced in #175 - merge commit 8f75a045709a780c8cf92a6a21e9d35b593bdecd
+
+[Retrieved from:
+https://github.com/lathiat/avahi/commit/9d31939e55280a733d930b15ac9e4dda4497680c]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ avahi-core/browse-dns-server.c | 5 ++++-
+ avahi-core/browse-domain.c | 5 ++++-
+ avahi-core/browse-service-type.c | 3 +++
+ avahi-core/browse-service.c | 3 +++
+ avahi-core/browse.c | 3 +++
+ avahi-core/resolve-address.c | 5 ++++-
+ avahi-core/resolve-host-name.c | 5 ++++-
+ avahi-core/resolve-service.c | 5 ++++-
+ 8 files changed, 29 insertions(+), 5 deletions(-)
+
+diff --git a/avahi-core/browse-dns-server.c b/avahi-core/browse-dns-server.c
+index 049752e9..c2d914fa 100644
+--- a/avahi-core/browse-dns-server.c
++++ b/avahi-core/browse-dns-server.c
+@@ -343,7 +343,10 @@ AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
+ AvahiSDNSServerBrowser* b;
+
+ b = avahi_s_dns_server_browser_prepare(server, interface, protocol, domain, type, aprotocol, flags, callback, userdata);
++ if (!b)
++ return NULL;
++
+ avahi_s_dns_server_browser_start(b);
+
+ return b;
+-}
+\ No newline at end of file
++}
+diff --git a/avahi-core/browse-domain.c b/avahi-core/browse-domain.c
+index f145d56a..06fa70c0 100644
+--- a/avahi-core/browse-domain.c
++++ b/avahi-core/browse-domain.c
+@@ -253,7 +253,10 @@ AvahiSDomainBrowser *avahi_s_domain_browser_new(
+ AvahiSDomainBrowser *b;
+
+ b = avahi_s_domain_browser_prepare(server, interface, protocol, domain, type, flags, callback, userdata);
++ if (!b)
++ return NULL;
++
+ avahi_s_domain_browser_start(b);
+
+ return b;
+-}
+\ No newline at end of file
++}
+diff --git a/avahi-core/browse-service-type.c b/avahi-core/browse-service-type.c
+index fdd22dcd..b1fc7af8 100644
+--- a/avahi-core/browse-service-type.c
++++ b/avahi-core/browse-service-type.c
+@@ -171,6 +171,9 @@ AvahiSServiceTypeBrowser *avahi_s_service_type_browser_new(
+ AvahiSServiceTypeBrowser *b;
+
+ b = avahi_s_service_type_browser_prepare(server, interface, protocol, domain, flags, callback, userdata);
++ if (!b)
++ return NULL;
++
+ avahi_s_service_type_browser_start(b);
+
+ return b;
+diff --git a/avahi-core/browse-service.c b/avahi-core/browse-service.c
+index 5531360c..63e0275a 100644
+--- a/avahi-core/browse-service.c
++++ b/avahi-core/browse-service.c
+@@ -184,6 +184,9 @@ AvahiSServiceBrowser *avahi_s_service_browser_new(
+ AvahiSServiceBrowser *b;
+
+ b = avahi_s_service_browser_prepare(server, interface, protocol, service_type, domain, flags, callback, userdata);
++ if (!b)
++ return NULL;
++
+ avahi_s_service_browser_start(b);
+
+ return b;
+diff --git a/avahi-core/browse.c b/avahi-core/browse.c
+index 2941e579..e8a915e9 100644
+--- a/avahi-core/browse.c
++++ b/avahi-core/browse.c
+@@ -634,6 +634,9 @@ AvahiSRecordBrowser *avahi_s_record_browser_new(
+ AvahiSRecordBrowser *b;
+
+ b = avahi_s_record_browser_prepare(server, interface, protocol, key, flags, callback, userdata);
++ if (!b)
++ return NULL;
++
+ avahi_s_record_browser_start_query(b);
+
+ return b;
+diff --git a/avahi-core/resolve-address.c b/avahi-core/resolve-address.c
+index ac0b29b1..e61dd242 100644
+--- a/avahi-core/resolve-address.c
++++ b/avahi-core/resolve-address.c
+@@ -286,7 +286,10 @@ AvahiSAddressResolver *avahi_s_address_resolver_new(
+ AvahiSAddressResolver *b;
+
+ b = avahi_s_address_resolver_prepare(server, interface, protocol, address, flags, callback, userdata);
++ if (!b)
++ return NULL;
++
+ avahi_s_address_resolver_start(b);
+
+ return b;
+-}
+\ No newline at end of file
++}
+diff --git a/avahi-core/resolve-host-name.c b/avahi-core/resolve-host-name.c
+index 808b0e72..4e8e5973 100644
+--- a/avahi-core/resolve-host-name.c
++++ b/avahi-core/resolve-host-name.c
+@@ -318,7 +318,10 @@ AvahiSHostNameResolver *avahi_s_host_name_resolver_new(
+ AvahiSHostNameResolver *b;
+
+ b = avahi_s_host_name_resolver_prepare(server, interface, protocol, host_name, aprotocol, flags, callback, userdata);
++ if (!b)
++ return NULL;
++
+ avahi_s_host_name_resolver_start(b);
+
+ return b;
+-}
+\ No newline at end of file
++}
+diff --git a/avahi-core/resolve-service.c b/avahi-core/resolve-service.c
+index 66bf3cae..43771763 100644
+--- a/avahi-core/resolve-service.c
++++ b/avahi-core/resolve-service.c
+@@ -519,7 +519,10 @@ AvahiSServiceResolver *avahi_s_service_resolver_new(
+ AvahiSServiceResolver *b;
+
+ b = avahi_s_service_resolver_prepare(server, interface, protocol, name, type, domain, aprotocol, flags, callback, userdata);
++ if (!b)
++ return NULL;
++
+ avahi_s_service_resolver_start(b);
+
+ return b;
+-}
+\ No newline at end of file
++}
diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
index b71fc189a0..9de6ebc4d2 100644
--- a/package/avahi/avahi.mk
+++ b/package/avahi/avahi.mk
@@ -9,12 +9,16 @@ AVAHI_SITE = https://github.com/lathiat/avahi/releases/download/v$(AVAHI_VERSION
AVAHI_LICENSE = LGPL-2.1+
AVAHI_LICENSE_FILES = LICENSE
AVAHI_CPE_ID_VENDOR = avahi
+AVAHI_SELINUX_MODULES = avahi
AVAHI_INSTALL_STAGING = YES
# CVE-2021-26720 is an issue in avahi-daemon-check-dns.sh, which is
# part of the Debian packaging and not part of upstream avahi
AVAHI_IGNORE_CVES += CVE-2021-26720
+# 0001-Fix-NULL-pointer-crashes-from-175.patch
+AVAHI_IGNORE_CVES += CVE-2021-36217
+
AVAHI_CONF_ENV = \
avahi_cv_sys_cxx_works=yes \
DATADIRNAME=share
diff --git a/package/batman-adv/batman-adv.hash b/package/batman-adv/batman-adv.hash
index 2422723f40..f81df11000 100644
--- a/package/batman-adv/batman-adv.hash
+++ b/package/batman-adv/batman-adv.hash
@@ -1,5 +1,5 @@
-# From https://downloads.open-mesh.org/batman/releases/batman-adv-2021.0/batman-adv-2021.0.tar.gz.sha1
-sha1 7edd4dfb9434f80adf791990d4e383c7ef80a256 batman-adv-2021.0.tar.gz
+# From https://downloads.open-mesh.org/batman/releases/batman-adv-2021.1/batman-adv-2021.1.tar.gz.sha1
+sha1 27a0dc7cb74b868bc0ab52794ecedd0448f0fb61 batman-adv-2021.1.tar.gz
# Hash for license files
sha256 5a989ba580897268373bd516b87b588061f344af773a0f6b038a3d8d2af028a1 batman-adv-2021.0.tar.gz
diff --git a/package/batman-adv/batman-adv.mk b/package/batman-adv/batman-adv.mk
index cb802d6939..e58ac85bef 100644
--- a/package/batman-adv/batman-adv.mk
+++ b/package/batman-adv/batman-adv.mk
@@ -4,7 +4,7 @@
#
################################################################################
-BATMAN_ADV_VERSION = 2021.0
+BATMAN_ADV_VERSION = 2021.1
BATMAN_ADV_SITE = https://downloads.open-mesh.org/batman/stable/sources/batman-adv
BATMAN_ADV_LICENSE = GPL-2.0, MIT (batman_adv.h)
BATMAN_ADV_LICENSE_FILES = LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT
diff --git a/package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch b/package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch
new file mode 100644
index 0000000000..81221c9f66
--- /dev/null
+++ b/package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch
@@ -0,0 +1,33 @@
+From 301ef15aefa6764466c374d07efb511b1c3862cc Mon Sep 17 00:00:00 2001
+From: Nikita Ermakov <coffe92@gmail.com>
+Date: Wed, 20 May 2020 17:57:17 +0300
+Subject: [PATCH] Fix 'undefined reference to __data_start' linker error on
+ RISC-V
+
+Issue #294 (bdwgc).
+
+* include/private/gcconfig.h [RISCV && LINUX] (__data_start): Add
+attribute(weak).
+
+(cherry picked from commit 538562ad01b181f4cc3913da1ac06a77945cd9b9)
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ include/private/gcconfig.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
+index d9d45da1..d6cefa6f 100644
+--- a/include/private/gcconfig.h
++++ b/include/private/gcconfig.h
+@@ -2943,7 +2943,7 @@ EXTERN_C_BEGIN
+ # define ALIGNMENT (CPP_WORDSZ/8)
+ # ifdef LINUX
+ # define OS_TYPE "LINUX"
+- extern int __data_start[];
++ extern int __data_start[] __attribute__((__weak__));
+ # define DATASTART ((ptr_t)__data_start)
+ # define LINUX_STACKBOTTOM
+ # define DYNAMIC_LOADING
+--
+2.30.2
+
diff --git a/package/bind/bind.mk b/package/bind/bind.mk
index d01a557609..a5c246a54a 100644
--- a/package/bind/bind.mk
+++ b/package/bind/bind.mk
@@ -13,6 +13,7 @@ BIND_CONFIG_SCRIPTS = bind9-config isc-config.sh
BIND_LICENSE = MPL-2.0
BIND_LICENSE_FILES = COPYRIGHT
BIND_CPE_ID_VENDOR = isc
+BIND_SELINUX_MODULES = bind
# Only applies to RHEL6.x with DNSSEC validation on
BIND_IGNORE_CVES = CVE-2017-3139
# Library CVE and not used by bind but used by ISC DHCP
diff --git a/package/binutils/2.32/0010-bfd-elf32-or1k-fix-ld-assert.patch b/package/binutils/2.32/0010-bfd-elf32-or1k-fix-ld-assert.patch
deleted file mode 100644
index 824c9ce3e5..0000000000
--- a/package/binutils/2.32/0010-bfd-elf32-or1k-fix-ld-assert.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 93cf62b662499e560812145dd989056fcf14f00e Mon Sep 17 00:00:00 2001
-From: Giulio Benetti <giulio.benetti@benettiengineering.com>
-Date: Mon, 22 Mar 2021 13:30:07 +0100
-Subject: [PATCH] bfd/elf32-or1k: fix ld assert
-
-Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=27624
-
-Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
----
- bfd/elf32-or1k.c | 9 ++++-----
- 1 file changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
-index 2f200b197b..ae508540f5 100644
---- a/bfd/elf32-or1k.c
-+++ b/bfd/elf32-or1k.c
-@@ -2535,11 +2535,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
- if (h->type == STT_FUNC
- || h->needs_plt)
- {
-- if (! bfd_link_pic (info)
-- && !h->def_dynamic
-- && !h->ref_dynamic
-- && h->root.type != bfd_link_hash_undefweak
-- && h->root.type != bfd_link_hash_undefined)
-+ if (h->plt.refcount <= 0
-+ || (SYMBOL_CALLS_LOCAL (info, h)
-+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
-+ && h->root.type == bfd_link_hash_undefweak)))
- {
- /* This case can occur if we saw a PLT reloc in an input
- file, but the symbol was never referred to by a dynamic
---
-2.25.1
-
diff --git a/package/binutils/2.32/0010-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch b/package/binutils/2.32/0010-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch
new file mode 100644
index 0000000000..a67d12789e
--- /dev/null
+++ b/package/binutils/2.32/0010-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch
@@ -0,0 +1,59 @@
+From 788cda9f9447e0fe67e582e8fb5adafd678d08b2 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:14 +0900
+Subject: [PATCH] or1k: Fix issue with plt link failure for local calls
+
+When building protobuf we were seeing the assert failure:
+
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ collect2: error: ld returned 1 exit status
+
+This failure happens while writing out PLT entries, there is a check
+"BFD_ASSERT (h->dynindx != -1)" to confirm all plt entries have dynamic
+symbol attributes. This was failing for symbols that were
+"forced_local" in previous linking code.
+
+The fix adds logic to or1k_elf_adjust_dynamic_symbol to identify
+"forced_local" symbols and exclude them from the the PLT.
+
+bfd/ChangeLog:
+
+ PR 27624
+ * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Change
+ condition used to cleanup plt entries to cleanup forced local
+ entries.
+
+Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 2f200b197b8..1f2c88b0b3a 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -2535,11 +2535,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
+ if (h->type == STT_FUNC
+ || h->needs_plt)
+ {
+- if (! bfd_link_pic (info)
+- && !h->def_dynamic
+- && !h->ref_dynamic
+- && h->root.type != bfd_link_hash_undefweak
+- && h->root.type != bfd_link_hash_undefined)
++ if (h->plt.refcount <= 0
++ || (SYMBOL_CALLS_LOCAL (info, h)
++ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
++ && h->root.type == bfd_link_hash_undefweak)))
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+--
+2.25.1
+
diff --git a/package/binutils/2.32/0011-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch b/package/binutils/2.32/0011-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
new file mode 100644
index 0000000000..5a2b91fe8e
--- /dev/null
+++ b/package/binutils/2.32/0011-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
@@ -0,0 +1,256 @@
+From b10e6230dea0015bf3b7748580b82c551f9a3a4a Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:15 +0900
+Subject: [PATCH] or1k: Implement relocation R_OR1K_GOT_AHI16 for gotha()
+
+The gotha() relocation mnemonic will be outputted by OpenRISC GCC when
+using the -mcmodel=large option. This relocation is used along with
+got() to generate 32-bit GOT offsets. This increases the previous GOT
+offset limit from the previous 16-bit (64K) limit.
+
+This is needed on large binaries where the GOT grows larger than 64k.
+
+bfd/ChangeLog:
+
+ PR 21464
+ * bfd-in2.h: Add BFD_RELOC_OR1K_GOT_AHI16 relocation.
+ * elf32-or1k.c (or1k_elf_howto_table, or1k_reloc_map): Likewise.
+ (or1k_final_link_relocate, or1k_elf_relocate_section,
+ or1k_elf_check_relocs): Likewise.
+ * libbfd.h (bfd_reloc_code_real_names): Likewise.
+ * reloc.c: Likewise.
+
+cpu/ChangeLog:
+
+ PR 21464
+ * or1k.opc (or1k_imm16_relocs, parse_reloc): Define parse logic
+ for gotha() relocation.
+
+include/ChangeLog:
+
+ PR 21464
+ * elf/or1k.h (elf_or1k_reloc_type): Define R_OR1K_GOT_AHI16 number.
+
+opcodes/ChangeLog:
+
+ PR 21464
+ * or1k-asm.c: Regenerate.
+
+gas/ChangeLog:
+
+ PR 21464
+ * testsuite/gas/or1k/reloc-1.s: Add test for new relocation.
+ * testsuite/gas/or1k/reloc-1.d: Add test result for new
+ relocation.
+
+Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
+
+fixup reloc, add tests
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/bfd-in2.h | 1 +
+ bfd/elf32-or1k.c | 21 ++++++++++++++++++++-
+ bfd/libbfd.h | 1 +
+ bfd/reloc.c | 2 ++
+ cpu/or1k.opc | 7 ++++++-
+ gas/testsuite/gas/or1k/reloc-1.d | 4 +++-
+ gas/testsuite/gas/or1k/reloc-1.s | 4 ++++
+ include/elf/or1k.h | 1 +
+ opcodes/or1k-asm.c | 7 ++++++-
+ 9 files changed, 44 insertions(+), 4 deletions(-)
+
+diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
+index e25da50aafb..530a41fca43 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -5517,6 +5517,7 @@ then it may be truncated to 8 bits. */
+ BFD_RELOC_OR1K_TLS_TPOFF,
+ BFD_RELOC_OR1K_TLS_DTPOFF,
+ BFD_RELOC_OR1K_TLS_DTPMOD,
++ BFD_RELOC_OR1K_GOT_AHI16,
+
+ /* H8 elf Relocations. */
+ BFD_RELOC_H8_DIR16A8,
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 1f2c88b0b3a..a4a64f73b7c 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -808,6 +808,20 @@ static reloc_howto_type or1k_elf_howto_table[] =
+ 0, /* Source Mask. */
+ 0x03ffffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
++
++ HOWTO (R_OR1K_GOT_AHI16, /* type */
++ 16, /* rightshift */
++ 2, /* size (0 = byte, 1 = short, 2 = long) */
++ 16, /* bitsize */
++ FALSE, /* pc_relative */
++ 0, /* bitpos */
++ complain_overflow_signed, /* complain_on_overflow */
++ bfd_elf_generic_reloc, /* special_function */
++ "R_OR1K_GOT_AHI16", /* name */
++ FALSE, /* partial_inplace */
++ 0, /* src_mask */
++ 0xffff, /* dst_mask */
++ FALSE), /* pcrel_offset */
+ };
+
+ /* Map BFD reloc types to Or1k ELF reloc types. */
+@@ -871,6 +885,7 @@ static const struct or1k_reloc_map or1k_reloc_map[] =
+ { BFD_RELOC_OR1K_TLS_IE_LO13, R_OR1K_TLS_IE_LO13 },
+ { BFD_RELOC_OR1K_SLO13, R_OR1K_SLO13 },
+ { BFD_RELOC_OR1K_PLTA26, R_OR1K_PLTA26 },
++ { BFD_RELOC_OR1K_GOT_AHI16, R_OR1K_GOT_AHI16 },
+ };
+
+ #define TLS_UNKNOWN 0
+@@ -1080,6 +1095,7 @@ or1k_final_link_relocate (reloc_howto_type *howto, bfd *input_bfd,
+ switch (howto->type)
+ {
+ case R_OR1K_AHI16:
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOTOFF_AHI16:
+ case R_OR1K_TLS_IE_AHI16:
+ case R_OR1K_TLS_LE_AHI16:
+@@ -1344,6 +1360,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ }
+ break;
+
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOT16:
+ case R_OR1K_GOT_PG21:
+ case R_OR1K_GOT_LO13:
+@@ -1435,7 +1452,8 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ /* The GOT_PG21 and GOT_LO13 relocs are pc-relative,
+ while the GOT16 reloc is GOT relative. */
+ relocation = got_base + off;
+- if (r_type == R_OR1K_GOT16)
++ if (r_type == R_OR1K_GOT16
++ || r_type == R_OR1K_GOT_AHI16)
+ relocation -= got_sym_value;
+
+ /* Addend should be zero. */
+@@ -1945,6 +1963,7 @@ or1k_elf_check_relocs (bfd *abfd,
+ }
+ break;
+
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOT16:
+ case R_OR1K_GOT_PG21:
+ case R_OR1K_GOT_LO13:
+diff --git a/bfd/libbfd.h b/bfd/libbfd.h
+index 36284d71a9b..6e9e3190bb8 100644
+--- a/bfd/libbfd.h
++++ b/bfd/libbfd.h
+@@ -2702,6 +2702,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
+ "BFD_RELOC_OR1K_TLS_TPOFF",
+ "BFD_RELOC_OR1K_TLS_DTPOFF",
+ "BFD_RELOC_OR1K_TLS_DTPMOD",
++ "BFD_RELOC_OR1K_GOT_AHI16",
+ "BFD_RELOC_H8_DIR16A8",
+ "BFD_RELOC_H8_DIR16R8",
+ "BFD_RELOC_H8_DIR24A8",
+diff --git a/bfd/reloc.c b/bfd/reloc.c
+index e6446a78098..b0003ab1175 100644
+--- a/bfd/reloc.c
++++ b/bfd/reloc.c
+@@ -6164,6 +6164,8 @@ ENUMX
+ BFD_RELOC_OR1K_GOTPC_HI16
+ ENUMX
+ BFD_RELOC_OR1K_GOTPC_LO16
++ENUMX
++ BFD_RELOC_OR1K_GOT_AHI16
+ ENUMX
+ BFD_RELOC_OR1K_GOT16
+ ENUMX
+diff --git a/cpu/or1k.opc b/cpu/or1k.opc
+index 5082a30cee1..85163fc96c9 100644
+--- a/cpu/or1k.opc
++++ b/cpu/or1k.opc
+@@ -173,7 +173,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
+ BFD_RELOC_OR1K_GOT_LO13,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+- BFD_RELOC_UNUSED },
++ BFD_RELOC_OR1K_GOT_AHI16 },
+ { BFD_RELOC_OR1K_GOTPC_LO16,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+@@ -276,6 +276,11 @@ parse_reloc (const char **strp)
+ str += 5;
+ cls = RCLASS_TPOFF;
+ }
++ else if (strncasecmp (str, "got", 3) == 0)
++ {
++ str += 3;
++ cls = RCLASS_GOT;
++ }
+
+ if (strncasecmp (str, "hi(", 3) == 0)
+ {
+diff --git a/gas/testsuite/gas/or1k/reloc-1.d b/gas/testsuite/gas/or1k/reloc-1.d
+index d1bcf5608bb..3a001c4ed99 100644
+--- a/gas/testsuite/gas/or1k/reloc-1.d
++++ b/gas/testsuite/gas/or1k/reloc-1.d
+@@ -68,5 +68,7 @@ OFFSET TYPE VALUE
+ 000000ec R_OR1K_LO13 x
+ 000000f0 R_OR1K_GOT_LO13 x
+ 000000f4 R_OR1K_SLO13 x
+-
++000000f8 R_OR1K_GOT_AHI16 x
++000000fc R_OR1K_GOT_AHI16 x
++00000100 R_OR1K_GOT_AHI16 x
+
+diff --git a/gas/testsuite/gas/or1k/reloc-1.s b/gas/testsuite/gas/or1k/reloc-1.s
+index e76abef6532..562609aa869 100644
+--- a/gas/testsuite/gas/or1k/reloc-1.s
++++ b/gas/testsuite/gas/or1k/reloc-1.s
+@@ -74,3 +74,7 @@
+ l.lbz r5,po(x)(r3)
+ l.lbz r5,gotpo(x)(r3)
+ l.sb po(x)(r3),r6
++
++ l.movhi r4,gotha(x)
++ l.ori r3,r4,gotha(x)
++ l.addi r3,r4,gotha(x)
+diff --git a/include/elf/or1k.h b/include/elf/or1k.h
+index 0abef046202..7db3cad18eb 100644
+--- a/include/elf/or1k.h
++++ b/include/elf/or1k.h
+@@ -77,6 +77,7 @@ START_RELOC_NUMBERS (elf_or1k_reloc_type)
+ RELOC_NUMBER (R_OR1K_TLS_IE_LO13, 51)
+ RELOC_NUMBER (R_OR1K_SLO13, 52)
+ RELOC_NUMBER (R_OR1K_PLTA26, 53)
++ RELOC_NUMBER (R_OR1K_GOT_AHI16, 54)
+ END_RELOC_NUMBERS (R_OR1K_max)
+
+ #define EF_OR1K_NODELAY (1UL << 0)
+diff --git a/opcodes/or1k-asm.c b/opcodes/or1k-asm.c
+index 7d058d03f5f..332f4b7a9b5 100644
+--- a/opcodes/or1k-asm.c
++++ b/opcodes/or1k-asm.c
+@@ -177,7 +177,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
+ BFD_RELOC_OR1K_GOT_LO13,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+- BFD_RELOC_UNUSED },
++ BFD_RELOC_OR1K_GOT_AHI16 },
+ { BFD_RELOC_OR1K_GOTPC_LO16,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+@@ -280,6 +280,11 @@ parse_reloc (const char **strp)
+ str += 5;
+ cls = RCLASS_TPOFF;
+ }
++ else if (strncasecmp (str, "got", 3) == 0)
++ {
++ str += 3;
++ cls = RCLASS_GOT;
++ }
+
+ if (strncasecmp (str, "hi(", 3) == 0)
+ {
+--
+2.25.1
+
diff --git a/package/binutils/2.32/0012-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch b/package/binutils/2.32/0012-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
new file mode 100644
index 0000000000..adc6f5f8b9
--- /dev/null
+++ b/package/binutils/2.32/0012-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
@@ -0,0 +1,61 @@
+From 0f61f76454a9420f158f626cb09a4fbc08c3709e Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:16 +0900
+Subject: [PATCH] or1k: Avoid R_OR1K_GOT16 overflow failures in presence
+ of R_OR1K_GOT_AHI16
+
+Now that we support R_OR1K_GOT_AHI16 we can relax the R_OR1K_GOT16
+overflow validation check if the section has R_OR1K_GOT_AHI16.
+
+We cannot simple disable R_OR1K_GOT16 overflow validation as there will
+still be binaries that will have only R_OR1K_GOT16. The
+R_OR1K_GOT_AHI16 relocation will only be added by GCC when building with
+the option -mcmodel=large.
+
+This assumes that R_OR1K_GOT_AHI16 will come before R_OR1K_GOT16, which
+is the code pattern that will be emitted by GCC.
+
+bfd/ChangeLog:
+
+ PR 21464
+ * elf32-or1k.c (or1k_elf_relocate_section): Relax R_OR1K_GOT16
+ overflow check if we have R_OR1K_GOT_AHI16 followed by
+ R_OR1K_GOT16.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index a4a64f73b7c..07fff3602a3 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1248,6 +1248,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ asection *sgot, *splt;
+ bfd_vma plt_base, got_base, got_sym_value;
+ bfd_boolean ret_val = TRUE;
++ bfd_boolean saw_gotha = FALSE;
+
+ if (htab == NULL)
+ return FALSE;
+@@ -1456,6 +1457,16 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ || r_type == R_OR1K_GOT_AHI16)
+ relocation -= got_sym_value;
+
++ if (r_type == R_OR1K_GOT_AHI16)
++ saw_gotha = TRUE;
++
++ /* If we have a R_OR1K_GOT16 followed by a R_OR1K_GOT_AHI16
++ relocation we assume the code is doing the right thing to avoid
++ overflows. Here we mask the lower 16-bit of the relocation to
++ avoid overflow validation failures. */
++ if (r_type == R_OR1K_GOT16 && saw_gotha)
++ relocation &= 0xffff;
++
+ /* Addend should be zero. */
+ if (rel->r_addend != 0)
+ {
+--
+2.25.1
+
diff --git a/package/binutils/2.32/0013-or1k-Support-large-plt_relocs-when-generating-plt-en.patch b/package/binutils/2.32/0013-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
new file mode 100644
index 0000000000..dc0431e0af
--- /dev/null
+++ b/package/binutils/2.32/0013-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
@@ -0,0 +1,500 @@
+From 36c7de7ef77ab0c30cb33e2c7ea7a6f4e3052c73 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:17 +0900
+Subject: [PATCH] or1k: Support large plt_relocs when generating plt
+ entries
+
+The current PLT generation code will generate invalid code when the PLT
+relocation offset exceeds 64k. This fixes the issue by detecting large
+plt_reloc offsets and generare code sequences to create larger plt
+relocations.
+
+The "large" plt code needs 2 extra instructions to create 32-bit offsets.
+
+bfd/ChangeLog:
+
+ PR 27746
+ * elf32-or1k.c (PLT_ENTRY_SIZE_LARGE, PLT_MAX_INSN_COUNT,
+ OR1K_ADD, OR1K_ORI): New macros to help with plt creation.
+ (elf_or1k_link_hash_table): New field plt_count.
+ (elf_or1k_link_hash_entry): New field plt_index.
+ (elf_or1k_plt_entry_size): New function.
+ (or1k_write_plt_entry): Update to support variable size PLTs.
+ (or1k_elf_finish_dynamic_sections): Use new or1k_write_plt_entry
+ API.
+ (or1k_elf_finish_dynamic_symbol): Update to write large PLTs
+ when needed.
+ (allocate_dynrelocs): Use elf_or1k_plt_entry_size to account for
+ PLT size.
+
+ld/ChangeLog:
+
+ PR 27746
+ testsuite/ld-or1k/or1k.exp (or1kplttests): Add tests for linking
+ along with gotha() relocations.
+ testsuite/ld-or1k/gotha1.dd: New file.
+ testsuite/ld-or1k/gotha1.s: New file.
+ testsuite/ld-or1k/gotha2.dd: New file.
+ testsuite/ld-or1k/gotha2.s: New file
+ testsuite/ld-or1k/pltlib.s (x): Define size to avoid link
+ failure.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 149 ++++++++++++++++++++++++---------
+ ld/testsuite/ld-or1k/gotha1.dd | 34 ++++++++
+ ld/testsuite/ld-or1k/gotha1.s | 24 ++++++
+ ld/testsuite/ld-or1k/gotha2.dd | 21 +++++
+ ld/testsuite/ld-or1k/gotha2.s | 22 +++++
+ ld/testsuite/ld-or1k/or1k.exp | 8 ++
+ ld/testsuite/ld-or1k/pltlib.s | 1 +
+ 7 files changed, 220 insertions(+), 39 deletions(-)
+ create mode 100644 ld/testsuite/ld-or1k/gotha1.dd
+ create mode 100644 ld/testsuite/ld-or1k/gotha1.s
+ create mode 100644 ld/testsuite/ld-or1k/gotha2.dd
+ create mode 100644 ld/testsuite/ld-or1k/gotha2.s
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 07fff3602a3..fcebbe5f23a 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -30,10 +30,14 @@
+ #define N_ONES(X) (((bfd_vma)2 << (X)) - 1)
+
+ #define PLT_ENTRY_SIZE 16
++#define PLT_ENTRY_SIZE_LARGE (6*4)
++#define PLT_MAX_INSN_COUNT 6
+
+ #define OR1K_MOVHI(D) (0x18000000 | (D << 21))
+ #define OR1K_ADRP(D) (0x08000000 | (D << 21))
+ #define OR1K_LWZ(D,A) (0x84000000 | (D << 21) | (A << 16))
++#define OR1K_ADD(D,A,B) (0xE0000000 | (D << 21) | (A << 16) | (B << 11))
++#define OR1K_ORI(D,A) (0xA8000000 | (D << 21) | (A << 16))
+ #define OR1K_ORI0(D) (0xA8000000 | (D << 21))
+ #define OR1K_JR(B) (0x44000000 | (B << 11))
+ #define OR1K_NOP 0x15000000
+@@ -903,6 +907,8 @@ struct elf_or1k_link_hash_entry
+ /* Track dynamic relocs copied for this symbol. */
+ struct elf_dyn_relocs *dyn_relocs;
+
++ /* For calculating PLT size. */
++ bfd_vma plt_index;
+ /* Track type of TLS access. */
+ unsigned char tls_type;
+ };
+@@ -930,9 +936,20 @@ struct elf_or1k_link_hash_table
+ /* Small local sym to section mapping cache. */
+ struct sym_cache sym_sec;
+
++ bfd_vma plt_count;
+ bfd_boolean saw_plta;
+ };
+
++static size_t
++elf_or1k_plt_entry_size (bfd_vma plt_index)
++{
++ bfd_vma plt_reloc;
++
++ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
++
++ return (plt_reloc > 0xffff) ? PLT_ENTRY_SIZE_LARGE : PLT_ENTRY_SIZE;
++}
++
+ /* Get the ELF linker hash table from a link_info structure. */
+ #define or1k_elf_hash_table(p) \
+ (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
+@@ -2176,33 +2193,46 @@ or1k_elf_check_relocs (bfd *abfd,
+ }
+
+ static void
+-or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insn1,
+- unsigned insn2, unsigned insn3, unsigned insnj)
++or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
++ unsigned insns[], size_t insn_count)
+ {
+ unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
+- unsigned insn4;
++ unsigned output_insns[PLT_MAX_INSN_COUNT];
++
++ /* Copy instructions into the output buffer. */
++ for (size_t i = 0; i < insn_count; i++)
++ output_insns[i] = insns[i];
+
+ /* Honor the no-delay-slot setting. */
+- if (insn3 == OR1K_NOP)
++ if (insns[insn_count-1] == OR1K_NOP)
+ {
+- insn4 = insn3;
++ unsigned slot1, slot2;
++
+ if (nodelay)
+- insn3 = insnj;
++ slot1 = insns[insn_count-2], slot2 = insnj;
+ else
+- insn3 = insn2, insn2 = insnj;
++ slot1 = insnj, slot2 = insns[insn_count-2];
++
++ output_insns[insn_count-2] = slot1;
++ output_insns[insn_count-1] = slot2;
++ output_insns[insn_count] = OR1K_NOP;
+ }
+ else
+ {
++ unsigned slot1, slot2;
++
+ if (nodelay)
+- insn4 = insnj;
++ slot1 = insns[insn_count-1], slot2 = insnj;
+ else
+- insn4 = insn3, insn3 = insnj;
++ slot1 = insnj, slot2 = insns[insn_count-1];
++
++ output_insns[insn_count-1] = slot1;
++ output_insns[insn_count] = slot2;
+ }
+
+- bfd_put_32 (output_bfd, insn1, contents);
+- bfd_put_32 (output_bfd, insn2, contents + 4);
+- bfd_put_32 (output_bfd, insn3, contents + 8);
+- bfd_put_32 (output_bfd, insn4, contents + 12);
++ /* Write out the output buffer. */
++ for (size_t i = 0; i < (insn_count+1); i++)
++ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
+ }
+
+ /* Finish up the dynamic sections. */
+@@ -2269,7 +2299,8 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
+ splt = htab->root.splt;
+ if (splt && splt->size > 0)
+ {
+- unsigned plt0, plt1, plt2;
++ unsigned plt[PLT_MAX_INSN_COUNT];
++ size_t plt_insn_count = 3;
+ bfd_vma got_addr = sgot->output_section->vma + sgot->output_offset;
+
+ /* Note we force 16 byte alignment on the .got, so that
+@@ -2280,27 +2311,27 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
+ bfd_vma pc = splt->output_section->vma + splt->output_offset;
+ unsigned pa = ((got_addr >> 13) - (pc >> 13)) & 0x1fffff;
+ unsigned po = got_addr & 0x1fff;
+- plt0 = OR1K_ADRP(12) | pa;
+- plt1 = OR1K_LWZ(15,12) | (po + 8);
+- plt2 = OR1K_LWZ(12,12) | (po + 4);
++ plt[0] = OR1K_ADRP(12) | pa;
++ plt[1] = OR1K_LWZ(15,12) | (po + 8);
++ plt[2] = OR1K_LWZ(12,12) | (po + 4);
+ }
+ else if (bfd_link_pic (info))
+ {
+- plt0 = OR1K_LWZ(15, 16) | 8; /* .got+8 */
+- plt1 = OR1K_LWZ(12, 16) | 4; /* .got+4 */
+- plt2 = OR1K_NOP;
++ plt[0] = OR1K_LWZ(15, 16) | 8; /* .got+8 */
++ plt[1] = OR1K_LWZ(12, 16) | 4; /* .got+4 */
++ plt[2] = OR1K_NOP;
+ }
+ else
+ {
+ unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
+ unsigned lo = got_addr & 0xffff;
+- plt0 = OR1K_MOVHI(12) | ha;
+- plt1 = OR1K_LWZ(15,12) | (lo + 8);
+- plt2 = OR1K_LWZ(12,12) | (lo + 4);
++ plt[0] = OR1K_MOVHI(12) | ha;
++ plt[1] = OR1K_LWZ(15,12) | (lo + 8);
++ plt[2] = OR1K_LWZ(12,12) | (lo + 4);
+ }
+
+- or1k_write_plt_entry (output_bfd, splt->contents,
+- plt0, plt1, plt2, OR1K_JR(15));
++ or1k_write_plt_entry (output_bfd, splt->contents, OR1K_JR(15),
++ plt, plt_insn_count);
+
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
+ }
+@@ -2343,7 +2374,8 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+
+ if (h->plt.offset != (bfd_vma) -1)
+ {
+- unsigned int plt0, plt1, plt2;
++ unsigned int plt[PLT_MAX_INSN_COUNT];
++ size_t plt_insn_count = 3;
+ asection *splt;
+ asection *sgot;
+ asection *srela;
+@@ -2355,6 +2387,7 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+ bfd_vma got_offset;
+ bfd_vma got_addr;
+ Elf_Internal_Rela rela;
++ bfd_boolean large_plt_entry;
+
+ /* This symbol has an entry in the procedure linkage table. Set
+ it up. */
+@@ -2372,10 +2405,13 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
+- plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
++ plt_index = ((struct elf_or1k_link_hash_entry *) h)->plt_index;
+ plt_addr = plt_base_addr + h->plt.offset;
+ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
+
++ large_plt_entry = (elf_or1k_plt_entry_size (plt_index)
++ == PLT_ENTRY_SIZE_LARGE);
++
+ /* Get the offset into the .got table of the entry that
+ corresponds to this function. Each .got entry is 4 bytes.
+ The first three are reserved. */
+@@ -2387,27 +2423,57 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+ {
+ unsigned pa = ((got_addr >> 13) - (plt_addr >> 13)) & 0x1fffff;
+ unsigned po = (got_addr & 0x1fff);
+- plt0 = OR1K_ADRP(12) | pa;
+- plt1 = OR1K_LWZ(12,12) | po;
+- plt2 = OR1K_ORI0(11) | plt_reloc;
++ plt[0] = OR1K_ADRP(12) | pa;
++ plt[1] = OR1K_LWZ(12,12) | po;
++ plt[2] = OR1K_ORI0(11) | plt_reloc;
+ }
+ else if (bfd_link_pic (info))
+ {
+- plt0 = OR1K_LWZ(12,16) | got_offset;
+- plt1 = OR1K_ORI0(11) | plt_reloc;
+- plt2 = OR1K_NOP;
++ if (large_plt_entry)
++ {
++ unsigned gotha = ((got_offset + 0x8000) >> 16) & 0xffff;
++ unsigned got = got_offset & 0xffff;
++ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
++ unsigned pltrello = plt_reloc & 0xffff;
++
++ plt[0] = OR1K_MOVHI(12) | gotha;
++ plt[1] = OR1K_ADD(12,12,16);
++ plt[2] = OR1K_LWZ(12,12) | got;
++ plt[3] = OR1K_MOVHI(11) | pltrelhi;
++ plt[4] = OR1K_ORI(11,11) | pltrello;
++ plt_insn_count = 5;
++ }
++ else
++ {
++ plt[0] = OR1K_LWZ(12,16) | got_offset;
++ plt[1] = OR1K_ORI0(11) | plt_reloc;
++ plt[2] = OR1K_NOP;
++ }
+ }
+ else
+ {
+ unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
+ unsigned lo = got_addr & 0xffff;
+- plt0 = OR1K_MOVHI(12) | ha;
+- plt1 = OR1K_LWZ(12,12) | lo;
+- plt2 = OR1K_ORI0(11) | plt_reloc;
++ plt[0] = OR1K_MOVHI(12) | ha;
++ plt[1] = OR1K_LWZ(12,12) | lo;
++ plt[2] = OR1K_ORI0(11) | plt_reloc;
++ }
++
++ /* For large code model we fixup the non-PIC PLT relocation instructions
++ here. */
++ if (large_plt_entry && !bfd_link_pic (info))
++ {
++ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
++ unsigned pltrello = plt_reloc & 0xffff;
++
++ plt[2] = OR1K_MOVHI(11) | pltrelhi;
++ plt[3] = OR1K_ORI(11,11) | pltrello;
++ plt[4] = OR1K_NOP;
++ plt_insn_count = 5;
+ }
+
+ or1k_write_plt_entry (output_bfd, splt->contents + h->plt.offset,
+- plt0, plt1, plt2, OR1K_JR(12));
++ OR1K_JR(12), plt, plt_insn_count);
+
+ /* Fill in the entry in the global offset table. */
+ bfd_put_32 (output_bfd, plt_addr, sgot->contents + got_offset);
+@@ -2699,11 +2765,16 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
+ {
+ asection *s = htab->root.splt;
++ bfd_vma plt_index;
++
++ /* Track the index of our plt entry for use in calculating size. */
++ plt_index = htab->plt_count++;
++ ((struct elf_or1k_link_hash_entry *) h)->plt_index = plt_index;
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->size == 0)
+- s->size = PLT_ENTRY_SIZE;
++ s->size = elf_or1k_plt_entry_size (plt_index);
+
+ h->plt.offset = s->size;
+
+@@ -2720,7 +2791,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
+ }
+
+ /* Make room for this entry. */
+- s->size += PLT_ENTRY_SIZE;
++ s->size += elf_or1k_plt_entry_size (plt_index);
+
+ /* We also need to make an entry in the .got.plt section, which
+ will be placed in the .got section by the linker script. */
+diff --git a/ld/testsuite/ld-or1k/gotha1.dd b/ld/testsuite/ld-or1k/gotha1.dd
+new file mode 100644
+index 00000000000..0ad1f8f5399
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha1.dd
+@@ -0,0 +1,34 @@
++
++.*\.x: file format elf32-or1k
++
++
++Disassembly of section \.plt:
++
++[0-9a-f]+ <\.plt>:
++ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
++ +[0-9a-f]+: 85 ec [0-9a-f]+ [0-9a-f]+ l\.lwz r15,[0-9]+\(r12\)
++ +[0-9a-f]+: 44 00 78 00 l\.jr r15
++ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
++ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
++ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
++ +[0-9a-f]+: 44 00 60 00 l\.jr r12
++ +[0-9a-f]+: a9 60 00 00 l\.ori r11,r0,0x0
++
++Disassembly of section \.text:
++
++[0-9a-f]+ <_start>:
++ +[0-9a-f]+: 9c 21 ff fc l\.addi r1,r1,-4
++ +[0-9a-f]+: d4 01 48 00 l\.sw 0\(r1\),r9
++ +[0-9a-f]+: 04 00 00 02 l\.jal [0-9a-f]+ <_start\+0x10>
++ +[0-9a-f]+: 1a 60 00 00 l\.movhi r19,0x0
++ +[0-9a-f]+: aa 73 [0-9a-f]+ [0-9a-f]+ l\.ori r19,r19,0x[0-9a-f]+
++ +[0-9a-f]+: e2 73 48 00 l\.add r19,r19,r9
++ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
++ +[0-9a-f]+: e2 31 98 00 l\.add r17,r17,r19
++ +[0-9a-f]+: 86 31 00 10 l\.lwz r17,16\(r17\)
++ +[0-9a-f]+: 84 71 00 00 l\.lwz r3,0\(r17\)
++ +[0-9a-f]+: 07 ff ff f2 l\.jal [0-9a-f]+ <\.plt\+0x10>
++ +[0-9a-f]+: 15 00 00 00 l\.nop 0x0
++ +[0-9a-f]+: 85 21 00 00 l\.lwz r9,0\(r1\)
++ +[0-9a-f]+: 44 00 48 00 l\.jr r9
++ +[0-9a-f]+: 9c 21 00 04 l\.addi r1,r1,4
+diff --git a/ld/testsuite/ld-or1k/gotha1.s b/ld/testsuite/ld-or1k/gotha1.s
+new file mode 100644
+index 00000000000..42b16db425c
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha1.s
+@@ -0,0 +1,24 @@
++ .data
++ .p2align 16
++
++ .text
++ .globl _start
++_start:
++ l.addi r1, r1, -4
++ l.sw 0(r1), r9
++
++ l.jal 8
++ l.movhi r19, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
++ l.ori r19, r19, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
++ l.add r19, r19, r9
++
++ l.movhi r17, gotha(x)
++ l.add r17, r17, r19
++ l.lwz r17, got(x)(r17)
++ l.lwz r3, 0(r17)
++
++ l.jal plt(func)
++ l.nop
++ l.lwz r9, 0(r1)
++ l.jr r9
++ l.addi r1, r1, 4
+diff --git a/ld/testsuite/ld-or1k/gotha2.dd b/ld/testsuite/ld-or1k/gotha2.dd
+new file mode 100644
+index 00000000000..fe09da5466b
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha2.dd
+@@ -0,0 +1,21 @@
++
++.*\.x: file format elf32-or1k
++
++
++Disassembly of section \.text:
++
++[0-9a-f]+ <test>:
++ +[0-9a-f]+: 9c 21 ff f8 l\.addi r1,r1,-8
++ +[0-9a-f]+: d4 01 80 00 l\.sw 0\(r1\),r16
++ +[0-9a-f]+: d4 01 48 04 l\.sw 4\(r1\),r9
++ +[0-9a-f]+: 04 00 [0-9a-f]+ [0-9a-f]+ l\.jal [0-9a-f]+ <test\+0x14>
++ +[0-9a-f]+: 1a 00 00 00 l\.movhi r16,0x0
++ +[0-9a-f]+: aa 10 [0-9a-f]+ [0-9a-f]+ l\.ori r16,r16,0x[0-9a-f]+
++ +[0-9a-f]+: e2 10 48 00 l\.add r16,r16,r9
++ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
++ +[0-9a-f]+: e2 31 80 00 l\.add r17,r17,r16
++ +[0-9a-f]+: 86 31 00 0c l\.lwz r17,12\(r17\)
++ +[0-9a-f]+: 85 21 00 04 l\.lwz r9,4\(r1\)
++ +[0-9a-f]+: 86 01 00 00 l\.lwz r16,0\(r1\)
++ +[0-9a-f]+: 44 00 48 00 l\.jr r9
++ +[0-9a-f]+: 9c 21 00 08 l\.addi r1,r1,8
+diff --git a/ld/testsuite/ld-or1k/gotha2.s b/ld/testsuite/ld-or1k/gotha2.s
+new file mode 100644
+index 00000000000..164b282f2dd
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha2.s
+@@ -0,0 +1,22 @@
++ .section .text
++ .align 4
++ .global test
++ .type test, @function
++test:
++ l.addi r1, r1, -8
++ l.sw 0(r1), r16
++ l.sw 4(r1), r9
++
++ l.jal 8
++ l.movhi r16, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
++ l.ori r16, r16, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
++ l.add r16, r16, r9
++
++ l.movhi r17, gotha(i)
++ l.add r17, r17, r16
++ l.lwz r17, got(i)(r17)
++
++ l.lwz r9, 4(r1)
++ l.lwz r16, 0(r1)
++ l.jr r9
++ l.addi r1, r1, 8
+diff --git a/ld/testsuite/ld-or1k/or1k.exp b/ld/testsuite/ld-or1k/or1k.exp
+index 24cdbe5fbf3..9cebc49b946 100644
+--- a/ld/testsuite/ld-or1k/or1k.exp
++++ b/ld/testsuite/ld-or1k/or1k.exp
+@@ -53,6 +53,14 @@ set or1kplttests {
+ "" {plt1.s}
+ {{objdump -dr plt1.x.dd}}
+ "plt1.x"}
++ {"gotha exec plt" "tmpdir/libpltlib.so" ""
++ "" {gotha1.s}
++ {{objdump -dr gotha1.dd}}
++ "gotha1.x"}
++ {"gotha -fpic -shared" "-fpic -shared" ""
++ "" {gotha2.s}
++ {{objdump -dr gotha2.dd}}
++ "gotha2.x"}
+ }
+
+ # Not implemented yet
+diff --git a/ld/testsuite/ld-or1k/pltlib.s b/ld/testsuite/ld-or1k/pltlib.s
+index baf76ca1af7..8b4d7ba48fd 100644
+--- a/ld/testsuite/ld-or1k/pltlib.s
++++ b/ld/testsuite/ld-or1k/pltlib.s
+@@ -1,5 +1,6 @@
+ .section .data
+ .globl x, y
++ .size x, 4
+ x: .long 33
+ y: .long 44
+
+--
+2.25.1
+
diff --git a/package/binutils/2.32/0014-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch b/package/binutils/2.32/0014-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch
new file mode 100644
index 0000000000..c3978e22fa
--- /dev/null
+++ b/package/binutils/2.32/0014-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch
@@ -0,0 +1,50 @@
+From c3003947e4bad18faea4337fd2073feeb30ee078 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Wed, 9 Jun 2021 17:28:27 +0200
+Subject: [PATCH] bfd/elf32-or1k: fix building with gcc version < 5
+
+Gcc version >= 5 has standard C mode not set to -std=gnu11, so if we use
+an old compiler(i.e. gcc 4.9) build fails on:
+```
+elf32-or1k.c:2251:3: error: 'for' loop initial declarations are only allowed in
+C99 or C11 mode
+ for (size_t i = 0; i < insn_count; i++)
+ ^
+```
+
+So let's declare `size_t i` at the top of the function instead of inside
+for loop.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4ae7f324d33..32063ab0289 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -2244,9 +2244,10 @@ or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
+ {
+ unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
+ unsigned output_insns[PLT_MAX_INSN_COUNT];
++ size_t i;
+
+ /* Copy instructions into the output buffer. */
+- for (size_t i = 0; i < insn_count; i++)
++ for (i = 0; i < insn_count; i++)
+ output_insns[i] = insns[i];
+
+ /* Honor the no-delay-slot setting. */
+@@ -2277,7 +2278,7 @@ or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
+ }
+
+ /* Write out the output buffer. */
+- for (size_t i = 0; i < (insn_count+1); i++)
++ for (i = 0; i < (insn_count+1); i++)
+ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
+ }
+
+--
+2.25.1
+
diff --git a/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
new file mode 100644
index 0000000000..585b97b2af
--- /dev/null
+++ b/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
@@ -0,0 +1,59 @@
+From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Sat, 10 Jul 2021 17:57:34 +0200
+Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
+ relative 26 bit relocation
+
+When building openal we were seeing the assert failure:
+
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePausev
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceStopv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceRewindv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePlayv
+collect2: error: ld returned 1 exit status
+
+This happens because in R_OR1K_INSN_REL_26 case we can't reference local
+symbol as previously done but we need to make sure that calls to actual
+symbol always call the version of current object.
+
+bfd/Changelog:
+
+ * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
+ in switch case R_OR1K_INSN_REL_26 where we need to check for
+ !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4ae7f324d33..4f9092539f5 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ break;
+
+ case R_OR1K_INSN_REL_26:
++ /* For a non-shared link, these will reference plt or call the
++ version of actual object. */
++ if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
++ {
++ _bfd_error_handler
++ (_("%pB: pc-relative relocation against dynamic symbol %s"),
++ input_bfd, name);
++ ret_val = FALSE;
++ bfd_set_error (bfd_error_bad_value);
++ }
++ break;
++
+ case R_OR1K_PCREL_PG21:
+ case R_OR1K_LO13:
+ case R_OR1K_SLO13:
+--
+2.25.1
+
diff --git a/package/binutils/2.34/0003-bfd-elf32-or1k-fix-ld-assert.patch b/package/binutils/2.34/0003-bfd-elf32-or1k-fix-ld-assert.patch
deleted file mode 100644
index 756493667f..0000000000
--- a/package/binutils/2.34/0003-bfd-elf32-or1k-fix-ld-assert.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 1659226a96b1daecfd08c057d0d5c39309d207ee Mon Sep 17 00:00:00 2001
-From: Giulio Benetti <giulio.benetti@benettiengineering.com>
-Date: Mon, 22 Mar 2021 13:30:07 +0100
-Subject: [PATCH] bfd/elf32-or1k: fix ld assert
-
-Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=27624
-
-Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
----
- bfd/elf32-or1k.c | 9 ++++-----
- 1 file changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
-index 65938e5137..41908f8938 100644
---- a/bfd/elf32-or1k.c
-+++ b/bfd/elf32-or1k.c
-@@ -2566,11 +2566,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
- if (h->type == STT_FUNC
- || h->needs_plt)
- {
-- if (! bfd_link_pic (info)
-- && !h->def_dynamic
-- && !h->ref_dynamic
-- && h->root.type != bfd_link_hash_undefweak
-- && h->root.type != bfd_link_hash_undefined)
-+ if (h->plt.refcount <= 0
-+ || (SYMBOL_CALLS_LOCAL (info, h)
-+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
-+ && h->root.type == bfd_link_hash_undefweak)))
- {
- /* This case can occur if we saw a PLT reloc in an input
- file, but the symbol was never referred to by a dynamic
---
-2.25.1
-
diff --git a/package/binutils/2.34/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch b/package/binutils/2.34/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch
new file mode 100644
index 0000000000..bc0ef2b224
--- /dev/null
+++ b/package/binutils/2.34/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch
@@ -0,0 +1,59 @@
+From 651c3617a04a1d1f78e89623b81be7ba32ff59a5 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:14 +0900
+Subject: [PATCH] or1k: Fix issue with plt link failure for local calls
+
+When building protobuf we were seeing the assert failure:
+
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ collect2: error: ld returned 1 exit status
+
+This failure happens while writing out PLT entries, there is a check
+"BFD_ASSERT (h->dynindx != -1)" to confirm all plt entries have dynamic
+symbol attributes. This was failing for symbols that were
+"forced_local" in previous linking code.
+
+The fix adds logic to or1k_elf_adjust_dynamic_symbol to identify
+"forced_local" symbols and exclude them from the the PLT.
+
+bfd/ChangeLog:
+
+ PR 27624
+ * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Change
+ condition used to cleanup plt entries to cleanup forced local
+ entries.
+
+Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 31ef758a926..58246875546 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -2535,11 +2535,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
+ if (h->type == STT_FUNC
+ || h->needs_plt)
+ {
+- if (! bfd_link_pic (info)
+- && !h->def_dynamic
+- && !h->ref_dynamic
+- && h->root.type != bfd_link_hash_undefweak
+- && h->root.type != bfd_link_hash_undefined)
++ if (h->plt.refcount <= 0
++ || (SYMBOL_CALLS_LOCAL (info, h)
++ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
++ && h->root.type == bfd_link_hash_undefweak)))
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+--
+2.25.1
+
diff --git a/package/binutils/2.34/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch b/package/binutils/2.34/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
new file mode 100644
index 0000000000..5edef90e1d
--- /dev/null
+++ b/package/binutils/2.34/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
@@ -0,0 +1,256 @@
+From 5fb945116ba058eb8f032f94ab2e0c71024388ec Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:15 +0900
+Subject: [PATCH] or1k: Implement relocation R_OR1K_GOT_AHI16 for gotha()
+
+The gotha() relocation mnemonic will be outputted by OpenRISC GCC when
+using the -mcmodel=large option. This relocation is used along with
+got() to generate 32-bit GOT offsets. This increases the previous GOT
+offset limit from the previous 16-bit (64K) limit.
+
+This is needed on large binaries where the GOT grows larger than 64k.
+
+bfd/ChangeLog:
+
+ PR 21464
+ * bfd-in2.h: Add BFD_RELOC_OR1K_GOT_AHI16 relocation.
+ * elf32-or1k.c (or1k_elf_howto_table, or1k_reloc_map): Likewise.
+ (or1k_final_link_relocate, or1k_elf_relocate_section,
+ or1k_elf_check_relocs): Likewise.
+ * libbfd.h (bfd_reloc_code_real_names): Likewise.
+ * reloc.c: Likewise.
+
+cpu/ChangeLog:
+
+ PR 21464
+ * or1k.opc (or1k_imm16_relocs, parse_reloc): Define parse logic
+ for gotha() relocation.
+
+include/ChangeLog:
+
+ PR 21464
+ * elf/or1k.h (elf_or1k_reloc_type): Define R_OR1K_GOT_AHI16 number.
+
+opcodes/ChangeLog:
+
+ PR 21464
+ * or1k-asm.c: Regenerate.
+
+gas/ChangeLog:
+
+ PR 21464
+ * testsuite/gas/or1k/reloc-1.s: Add test for new relocation.
+ * testsuite/gas/or1k/reloc-1.d: Add test result for new
+ relocation.
+
+Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
+
+fixup reloc, add tests
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/bfd-in2.h | 1 +
+ bfd/elf32-or1k.c | 21 ++++++++++++++++++++-
+ bfd/libbfd.h | 1 +
+ bfd/reloc.c | 2 ++
+ cpu/or1k.opc | 7 ++++++-
+ gas/testsuite/gas/or1k/reloc-1.d | 4 +++-
+ gas/testsuite/gas/or1k/reloc-1.s | 4 ++++
+ include/elf/or1k.h | 1 +
+ opcodes/or1k-asm.c | 7 ++++++-
+ 9 files changed, 44 insertions(+), 4 deletions(-)
+
+diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
+index 7c13bc8c91a..ae1082a67c2 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -5017,6 +5017,7 @@ then it may be truncated to 8 bits. */
+ BFD_RELOC_OR1K_TLS_TPOFF,
+ BFD_RELOC_OR1K_TLS_DTPOFF,
+ BFD_RELOC_OR1K_TLS_DTPMOD,
++ BFD_RELOC_OR1K_GOT_AHI16,
+
+ /* H8 elf Relocations. */
+ BFD_RELOC_H8_DIR16A8,
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 58246875546..1273fbacb3c 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -808,6 +808,20 @@ static reloc_howto_type or1k_elf_howto_table[] =
+ 0, /* Source Mask. */
+ 0x03ffffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
++
++ HOWTO (R_OR1K_GOT_AHI16, /* type */
++ 16, /* rightshift */
++ 2, /* size (0 = byte, 1 = short, 2 = long) */
++ 16, /* bitsize */
++ FALSE, /* pc_relative */
++ 0, /* bitpos */
++ complain_overflow_signed, /* complain_on_overflow */
++ bfd_elf_generic_reloc, /* special_function */
++ "R_OR1K_GOT_AHI16", /* name */
++ FALSE, /* partial_inplace */
++ 0, /* src_mask */
++ 0xffff, /* dst_mask */
++ FALSE), /* pcrel_offset */
+ };
+
+ /* Map BFD reloc types to Or1k ELF reloc types. */
+@@ -871,6 +885,7 @@ static const struct or1k_reloc_map or1k_reloc_map[] =
+ { BFD_RELOC_OR1K_TLS_IE_LO13, R_OR1K_TLS_IE_LO13 },
+ { BFD_RELOC_OR1K_SLO13, R_OR1K_SLO13 },
+ { BFD_RELOC_OR1K_PLTA26, R_OR1K_PLTA26 },
++ { BFD_RELOC_OR1K_GOT_AHI16, R_OR1K_GOT_AHI16 },
+ };
+
+ #define TLS_UNKNOWN 0
+@@ -1080,6 +1095,7 @@ or1k_final_link_relocate (reloc_howto_type *howto, bfd *input_bfd,
+ switch (howto->type)
+ {
+ case R_OR1K_AHI16:
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOTOFF_AHI16:
+ case R_OR1K_TLS_IE_AHI16:
+ case R_OR1K_TLS_LE_AHI16:
+@@ -1344,6 +1360,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ }
+ break;
+
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOT16:
+ case R_OR1K_GOT_PG21:
+ case R_OR1K_GOT_LO13:
+@@ -1435,7 +1452,8 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ /* The GOT_PG21 and GOT_LO13 relocs are pc-relative,
+ while the GOT16 reloc is GOT relative. */
+ relocation = got_base + off;
+- if (r_type == R_OR1K_GOT16)
++ if (r_type == R_OR1K_GOT16
++ || r_type == R_OR1K_GOT_AHI16)
+ relocation -= got_sym_value;
+
+ /* Addend should be zero. */
+@@ -1943,6 +1961,7 @@ or1k_elf_check_relocs (bfd *abfd,
+ }
+ break;
+
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOT16:
+ case R_OR1K_GOT_PG21:
+ case R_OR1K_GOT_LO13:
+diff --git a/bfd/libbfd.h b/bfd/libbfd.h
+index d97d4e57a77..9edc71e0558 100644
+--- a/bfd/libbfd.h
++++ b/bfd/libbfd.h
+@@ -2704,6 +2704,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
+ "BFD_RELOC_OR1K_TLS_TPOFF",
+ "BFD_RELOC_OR1K_TLS_DTPOFF",
+ "BFD_RELOC_OR1K_TLS_DTPMOD",
++ "BFD_RELOC_OR1K_GOT_AHI16",
+ "BFD_RELOC_H8_DIR16A8",
+ "BFD_RELOC_H8_DIR16R8",
+ "BFD_RELOC_H8_DIR24A8",
+diff --git a/bfd/reloc.c b/bfd/reloc.c
+index 33cd67150cf..f57ad14a501 100644
+--- a/bfd/reloc.c
++++ b/bfd/reloc.c
+@@ -6175,6 +6175,8 @@ ENUMX
+ BFD_RELOC_OR1K_GOTPC_HI16
+ ENUMX
+ BFD_RELOC_OR1K_GOTPC_LO16
++ENUMX
++ BFD_RELOC_OR1K_GOT_AHI16
+ ENUMX
+ BFD_RELOC_OR1K_GOT16
+ ENUMX
+diff --git a/cpu/or1k.opc b/cpu/or1k.opc
+index f0adcbb00a5..5d20a1f33a7 100644
+--- a/cpu/or1k.opc
++++ b/cpu/or1k.opc
+@@ -193,7 +193,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
+ BFD_RELOC_OR1K_GOT_LO13,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+- BFD_RELOC_UNUSED },
++ BFD_RELOC_OR1K_GOT_AHI16 },
+ { BFD_RELOC_OR1K_GOTPC_LO16,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+@@ -296,6 +296,11 @@ parse_reloc (const char **strp)
+ str += 5;
+ cls = RCLASS_TPOFF;
+ }
++ else if (strncasecmp (str, "got", 3) == 0)
++ {
++ str += 3;
++ cls = RCLASS_GOT;
++ }
+
+ if (strncasecmp (str, "hi(", 3) == 0)
+ {
+diff --git a/gas/testsuite/gas/or1k/reloc-1.d b/gas/testsuite/gas/or1k/reloc-1.d
+index d1bcf5608bb..3a001c4ed99 100644
+--- a/gas/testsuite/gas/or1k/reloc-1.d
++++ b/gas/testsuite/gas/or1k/reloc-1.d
+@@ -68,5 +68,7 @@ OFFSET TYPE VALUE
+ 000000ec R_OR1K_LO13 x
+ 000000f0 R_OR1K_GOT_LO13 x
+ 000000f4 R_OR1K_SLO13 x
+-
++000000f8 R_OR1K_GOT_AHI16 x
++000000fc R_OR1K_GOT_AHI16 x
++00000100 R_OR1K_GOT_AHI16 x
+
+diff --git a/gas/testsuite/gas/or1k/reloc-1.s b/gas/testsuite/gas/or1k/reloc-1.s
+index e76abef6532..562609aa869 100644
+--- a/gas/testsuite/gas/or1k/reloc-1.s
++++ b/gas/testsuite/gas/or1k/reloc-1.s
+@@ -74,3 +74,7 @@
+ l.lbz r5,po(x)(r3)
+ l.lbz r5,gotpo(x)(r3)
+ l.sb po(x)(r3),r6
++
++ l.movhi r4,gotha(x)
++ l.ori r3,r4,gotha(x)
++ l.addi r3,r4,gotha(x)
+diff --git a/include/elf/or1k.h b/include/elf/or1k.h
+index a215ef5c17e..dff37d875f2 100644
+--- a/include/elf/or1k.h
++++ b/include/elf/or1k.h
+@@ -77,6 +77,7 @@ START_RELOC_NUMBERS (elf_or1k_reloc_type)
+ RELOC_NUMBER (R_OR1K_TLS_IE_LO13, 51)
+ RELOC_NUMBER (R_OR1K_SLO13, 52)
+ RELOC_NUMBER (R_OR1K_PLTA26, 53)
++ RELOC_NUMBER (R_OR1K_GOT_AHI16, 54)
+ END_RELOC_NUMBERS (R_OR1K_max)
+
+ #define EF_OR1K_NODELAY (1UL << 0)
+diff --git a/opcodes/or1k-asm.c b/opcodes/or1k-asm.c
+index 4715c4f2826..a72a4e85363 100644
+--- a/opcodes/or1k-asm.c
++++ b/opcodes/or1k-asm.c
+@@ -177,7 +177,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
+ BFD_RELOC_OR1K_GOT_LO13,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+- BFD_RELOC_UNUSED },
++ BFD_RELOC_OR1K_GOT_AHI16 },
+ { BFD_RELOC_OR1K_GOTPC_LO16,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+@@ -280,6 +280,11 @@ parse_reloc (const char **strp)
+ str += 5;
+ cls = RCLASS_TPOFF;
+ }
++ else if (strncasecmp (str, "got", 3) == 0)
++ {
++ str += 3;
++ cls = RCLASS_GOT;
++ }
+
+ if (strncasecmp (str, "hi(", 3) == 0)
+ {
+--
+2.25.1
+
diff --git a/package/binutils/2.34/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch b/package/binutils/2.34/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
new file mode 100644
index 0000000000..e292c9cb48
--- /dev/null
+++ b/package/binutils/2.34/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
@@ -0,0 +1,61 @@
+From d92116c7df340ff40063c5c97d202e7e87400027 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:16 +0900
+Subject: [PATCH] or1k: Avoid R_OR1K_GOT16 overflow failures in presence of
+ R_OR1K_GOT_AHI16
+
+Now that we support R_OR1K_GOT_AHI16 we can relax the R_OR1K_GOT16
+overflow validation check if the section has R_OR1K_GOT_AHI16.
+
+We cannot simple disable R_OR1K_GOT16 overflow validation as there will
+still be binaries that will have only R_OR1K_GOT16. The
+R_OR1K_GOT_AHI16 relocation will only be added by GCC when building with
+the option -mcmodel=large.
+
+This assumes that R_OR1K_GOT_AHI16 will come before R_OR1K_GOT16, which
+is the code pattern that will be emitted by GCC.
+
+bfd/ChangeLog:
+
+ PR 21464
+ * elf32-or1k.c (or1k_elf_relocate_section): Relax R_OR1K_GOT16
+ overflow check if we have R_OR1K_GOT_AHI16 followed by
+ R_OR1K_GOT16.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 1273fbacb3c..ce2c4fdb3bd 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1248,6 +1248,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ asection *sgot, *splt;
+ bfd_vma plt_base, got_base, got_sym_value;
+ bfd_boolean ret_val = TRUE;
++ bfd_boolean saw_gotha = FALSE;
+
+ if (htab == NULL)
+ return FALSE;
+@@ -1456,6 +1457,16 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ || r_type == R_OR1K_GOT_AHI16)
+ relocation -= got_sym_value;
+
++ if (r_type == R_OR1K_GOT_AHI16)
++ saw_gotha = TRUE;
++
++ /* If we have a R_OR1K_GOT16 followed by a R_OR1K_GOT_AHI16
++ relocation we assume the code is doing the right thing to avoid
++ overflows. Here we mask the lower 16-bit of the relocation to
++ avoid overflow validation failures. */
++ if (r_type == R_OR1K_GOT16 && saw_gotha)
++ relocation &= 0xffff;
++
+ /* Addend should be zero. */
+ if (rel->r_addend != 0)
+ {
+--
+2.25.1
+
diff --git a/package/binutils/2.34/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch b/package/binutils/2.34/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
new file mode 100644
index 0000000000..d6695d4159
--- /dev/null
+++ b/package/binutils/2.34/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
@@ -0,0 +1,500 @@
+From cba29e387040eaa401c52eb20e7cab5a4401185c Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:17 +0900
+Subject: [PATCH] or1k: Support large plt_relocs when generating plt
+ entries
+
+The current PLT generation code will generate invalid code when the PLT
+relocation offset exceeds 64k. This fixes the issue by detecting large
+plt_reloc offsets and generare code sequences to create larger plt
+relocations.
+
+The "large" plt code needs 2 extra instructions to create 32-bit offsets.
+
+bfd/ChangeLog:
+
+ PR 27746
+ * elf32-or1k.c (PLT_ENTRY_SIZE_LARGE, PLT_MAX_INSN_COUNT,
+ OR1K_ADD, OR1K_ORI): New macros to help with plt creation.
+ (elf_or1k_link_hash_table): New field plt_count.
+ (elf_or1k_link_hash_entry): New field plt_index.
+ (elf_or1k_plt_entry_size): New function.
+ (or1k_write_plt_entry): Update to support variable size PLTs.
+ (or1k_elf_finish_dynamic_sections): Use new or1k_write_plt_entry
+ API.
+ (or1k_elf_finish_dynamic_symbol): Update to write large PLTs
+ when needed.
+ (allocate_dynrelocs): Use elf_or1k_plt_entry_size to account for
+ PLT size.
+
+ld/ChangeLog:
+
+ PR 27746
+ testsuite/ld-or1k/or1k.exp (or1kplttests): Add tests for linking
+ along with gotha() relocations.
+ testsuite/ld-or1k/gotha1.dd: New file.
+ testsuite/ld-or1k/gotha1.s: New file.
+ testsuite/ld-or1k/gotha2.dd: New file.
+ testsuite/ld-or1k/gotha2.s: New file
+ testsuite/ld-or1k/pltlib.s (x): Define size to avoid link
+ failure.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 149 ++++++++++++++++++++++++---------
+ ld/testsuite/ld-or1k/gotha1.dd | 34 ++++++++
+ ld/testsuite/ld-or1k/gotha1.s | 24 ++++++
+ ld/testsuite/ld-or1k/gotha2.dd | 21 +++++
+ ld/testsuite/ld-or1k/gotha2.s | 22 +++++
+ ld/testsuite/ld-or1k/or1k.exp | 8 ++
+ ld/testsuite/ld-or1k/pltlib.s | 1 +
+ 7 files changed, 220 insertions(+), 39 deletions(-)
+ create mode 100644 ld/testsuite/ld-or1k/gotha1.dd
+ create mode 100644 ld/testsuite/ld-or1k/gotha1.s
+ create mode 100644 ld/testsuite/ld-or1k/gotha2.dd
+ create mode 100644 ld/testsuite/ld-or1k/gotha2.s
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index ce2c4fdb3bd..8b021b79d92 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -30,10 +30,14 @@
+ #define N_ONES(X) (((bfd_vma)2 << (X)) - 1)
+
+ #define PLT_ENTRY_SIZE 16
++#define PLT_ENTRY_SIZE_LARGE (6*4)
++#define PLT_MAX_INSN_COUNT 6
+
+ #define OR1K_MOVHI(D) (0x18000000 | (D << 21))
+ #define OR1K_ADRP(D) (0x08000000 | (D << 21))
+ #define OR1K_LWZ(D,A) (0x84000000 | (D << 21) | (A << 16))
++#define OR1K_ADD(D,A,B) (0xE0000000 | (D << 21) | (A << 16) | (B << 11))
++#define OR1K_ORI(D,A) (0xA8000000 | (D << 21) | (A << 16))
+ #define OR1K_ORI0(D) (0xA8000000 | (D << 21))
+ #define OR1K_JR(B) (0x44000000 | (B << 11))
+ #define OR1K_NOP 0x15000000
+@@ -903,6 +907,8 @@ struct elf_or1k_link_hash_entry
+ /* Track dynamic relocs copied for this symbol. */
+ struct elf_dyn_relocs *dyn_relocs;
+
++ /* For calculating PLT size. */
++ bfd_vma plt_index;
+ /* Track type of TLS access. */
+ unsigned char tls_type;
+ };
+@@ -930,9 +936,20 @@ struct elf_or1k_link_hash_table
+ /* Small local sym to section mapping cache. */
+ struct sym_cache sym_sec;
+
++ bfd_vma plt_count;
+ bfd_boolean saw_plta;
+ };
+
++static size_t
++elf_or1k_plt_entry_size (bfd_vma plt_index)
++{
++ bfd_vma plt_reloc;
++
++ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
++
++ return (plt_reloc > 0xffff) ? PLT_ENTRY_SIZE_LARGE : PLT_ENTRY_SIZE;
++}
++
+ /* Get the ELF linker hash table from a link_info structure. */
+ #define or1k_elf_hash_table(p) \
+ (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
+@@ -2173,33 +2190,46 @@ or1k_elf_check_relocs (bfd *abfd,
+ }
+
+ static void
+-or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insn1,
+- unsigned insn2, unsigned insn3, unsigned insnj)
++or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
++ unsigned insns[], size_t insn_count)
+ {
+ unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
+- unsigned insn4;
++ unsigned output_insns[PLT_MAX_INSN_COUNT];
++
++ /* Copy instructions into the output buffer. */
++ for (size_t i = 0; i < insn_count; i++)
++ output_insns[i] = insns[i];
+
+ /* Honor the no-delay-slot setting. */
+- if (insn3 == OR1K_NOP)
++ if (insns[insn_count-1] == OR1K_NOP)
+ {
+- insn4 = insn3;
++ unsigned slot1, slot2;
++
+ if (nodelay)
+- insn3 = insnj;
++ slot1 = insns[insn_count-2], slot2 = insnj;
+ else
+- insn3 = insn2, insn2 = insnj;
++ slot1 = insnj, slot2 = insns[insn_count-2];
++
++ output_insns[insn_count-2] = slot1;
++ output_insns[insn_count-1] = slot2;
++ output_insns[insn_count] = OR1K_NOP;
+ }
+ else
+ {
++ unsigned slot1, slot2;
++
+ if (nodelay)
+- insn4 = insnj;
++ slot1 = insns[insn_count-1], slot2 = insnj;
+ else
+- insn4 = insn3, insn3 = insnj;
++ slot1 = insnj, slot2 = insns[insn_count-1];
++
++ output_insns[insn_count-1] = slot1;
++ output_insns[insn_count] = slot2;
+ }
+
+- bfd_put_32 (output_bfd, insn1, contents);
+- bfd_put_32 (output_bfd, insn2, contents + 4);
+- bfd_put_32 (output_bfd, insn3, contents + 8);
+- bfd_put_32 (output_bfd, insn4, contents + 12);
++ /* Write out the output buffer. */
++ for (size_t i = 0; i < (insn_count+1); i++)
++ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
+ }
+
+ /* Finish up the dynamic sections. */
+@@ -2266,7 +2296,8 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
+ splt = htab->root.splt;
+ if (splt && splt->size > 0)
+ {
+- unsigned plt0, plt1, plt2;
++ unsigned plt[PLT_MAX_INSN_COUNT];
++ size_t plt_insn_count = 3;
+ bfd_vma got_addr = sgot->output_section->vma + sgot->output_offset;
+
+ /* Note we force 16 byte alignment on the .got, so that
+@@ -2277,27 +2308,27 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
+ bfd_vma pc = splt->output_section->vma + splt->output_offset;
+ unsigned pa = ((got_addr >> 13) - (pc >> 13)) & 0x1fffff;
+ unsigned po = got_addr & 0x1fff;
+- plt0 = OR1K_ADRP(12) | pa;
+- plt1 = OR1K_LWZ(15,12) | (po + 8);
+- plt2 = OR1K_LWZ(12,12) | (po + 4);
++ plt[0] = OR1K_ADRP(12) | pa;
++ plt[1] = OR1K_LWZ(15,12) | (po + 8);
++ plt[2] = OR1K_LWZ(12,12) | (po + 4);
+ }
+ else if (bfd_link_pic (info))
+ {
+- plt0 = OR1K_LWZ(15, 16) | 8; /* .got+8 */
+- plt1 = OR1K_LWZ(12, 16) | 4; /* .got+4 */
+- plt2 = OR1K_NOP;
++ plt[0] = OR1K_LWZ(15, 16) | 8; /* .got+8 */
++ plt[1] = OR1K_LWZ(12, 16) | 4; /* .got+4 */
++ plt[2] = OR1K_NOP;
+ }
+ else
+ {
+ unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
+ unsigned lo = got_addr & 0xffff;
+- plt0 = OR1K_MOVHI(12) | ha;
+- plt1 = OR1K_LWZ(15,12) | (lo + 8);
+- plt2 = OR1K_LWZ(12,12) | (lo + 4);
++ plt[0] = OR1K_MOVHI(12) | ha;
++ plt[1] = OR1K_LWZ(15,12) | (lo + 8);
++ plt[2] = OR1K_LWZ(12,12) | (lo + 4);
+ }
+
+- or1k_write_plt_entry (output_bfd, splt->contents,
+- plt0, plt1, plt2, OR1K_JR(15));
++ or1k_write_plt_entry (output_bfd, splt->contents, OR1K_JR(15),
++ plt, plt_insn_count);
+
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
+ }
+@@ -2340,7 +2371,8 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+
+ if (h->plt.offset != (bfd_vma) -1)
+ {
+- unsigned int plt0, plt1, plt2;
++ unsigned int plt[PLT_MAX_INSN_COUNT];
++ size_t plt_insn_count = 3;
+ asection *splt;
+ asection *sgot;
+ asection *srela;
+@@ -2352,6 +2384,7 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+ bfd_vma got_offset;
+ bfd_vma got_addr;
+ Elf_Internal_Rela rela;
++ bfd_boolean large_plt_entry;
+
+ /* This symbol has an entry in the procedure linkage table. Set
+ it up. */
+@@ -2369,10 +2402,13 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
+- plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
++ plt_index = ((struct elf_or1k_link_hash_entry *) h)->plt_index;
+ plt_addr = plt_base_addr + h->plt.offset;
+ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
+
++ large_plt_entry = (elf_or1k_plt_entry_size (plt_index)
++ == PLT_ENTRY_SIZE_LARGE);
++
+ /* Get the offset into the .got table of the entry that
+ corresponds to this function. Each .got entry is 4 bytes.
+ The first three are reserved. */
+@@ -2384,27 +2420,57 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+ {
+ unsigned pa = ((got_addr >> 13) - (plt_addr >> 13)) & 0x1fffff;
+ unsigned po = (got_addr & 0x1fff);
+- plt0 = OR1K_ADRP(12) | pa;
+- plt1 = OR1K_LWZ(12,12) | po;
+- plt2 = OR1K_ORI0(11) | plt_reloc;
++ plt[0] = OR1K_ADRP(12) | pa;
++ plt[1] = OR1K_LWZ(12,12) | po;
++ plt[2] = OR1K_ORI0(11) | plt_reloc;
+ }
+ else if (bfd_link_pic (info))
+ {
+- plt0 = OR1K_LWZ(12,16) | got_offset;
+- plt1 = OR1K_ORI0(11) | plt_reloc;
+- plt2 = OR1K_NOP;
++ if (large_plt_entry)
++ {
++ unsigned gotha = ((got_offset + 0x8000) >> 16) & 0xffff;
++ unsigned got = got_offset & 0xffff;
++ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
++ unsigned pltrello = plt_reloc & 0xffff;
++
++ plt[0] = OR1K_MOVHI(12) | gotha;
++ plt[1] = OR1K_ADD(12,12,16);
++ plt[2] = OR1K_LWZ(12,12) | got;
++ plt[3] = OR1K_MOVHI(11) | pltrelhi;
++ plt[4] = OR1K_ORI(11,11) | pltrello;
++ plt_insn_count = 5;
++ }
++ else
++ {
++ plt[0] = OR1K_LWZ(12,16) | got_offset;
++ plt[1] = OR1K_ORI0(11) | plt_reloc;
++ plt[2] = OR1K_NOP;
++ }
+ }
+ else
+ {
+ unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
+ unsigned lo = got_addr & 0xffff;
+- plt0 = OR1K_MOVHI(12) | ha;
+- plt1 = OR1K_LWZ(12,12) | lo;
+- plt2 = OR1K_ORI0(11) | plt_reloc;
++ plt[0] = OR1K_MOVHI(12) | ha;
++ plt[1] = OR1K_LWZ(12,12) | lo;
++ plt[2] = OR1K_ORI0(11) | plt_reloc;
++ }
++
++ /* For large code model we fixup the non-PIC PLT relocation instructions
++ here. */
++ if (large_plt_entry && !bfd_link_pic (info))
++ {
++ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
++ unsigned pltrello = plt_reloc & 0xffff;
++
++ plt[2] = OR1K_MOVHI(11) | pltrelhi;
++ plt[3] = OR1K_ORI(11,11) | pltrello;
++ plt[4] = OR1K_NOP;
++ plt_insn_count = 5;
+ }
+
+ or1k_write_plt_entry (output_bfd, splt->contents + h->plt.offset,
+- plt0, plt1, plt2, OR1K_JR(12));
++ OR1K_JR(12), plt, plt_insn_count);
+
+ /* Fill in the entry in the global offset table. We initialize it to
+ point to the top of the plt. This is done to lazy lookup the actual
+@@ -2699,11 +2765,16 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
+ {
+ asection *s = htab->root.splt;
++ bfd_vma plt_index;
++
++ /* Track the index of our plt entry for use in calculating size. */
++ plt_index = htab->plt_count++;
++ ((struct elf_or1k_link_hash_entry *) h)->plt_index = plt_index;
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->size == 0)
+- s->size = PLT_ENTRY_SIZE;
++ s->size = elf_or1k_plt_entry_size (plt_index);
+
+ h->plt.offset = s->size;
+
+@@ -2720,7 +2791,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
+ }
+
+ /* Make room for this entry. */
+- s->size += PLT_ENTRY_SIZE;
++ s->size += elf_or1k_plt_entry_size (plt_index);
+
+ /* We also need to make an entry in the .got.plt section, which
+ will be placed in the .got section by the linker script. */
+diff --git a/ld/testsuite/ld-or1k/gotha1.dd b/ld/testsuite/ld-or1k/gotha1.dd
+new file mode 100644
+index 00000000000..0ad1f8f5399
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha1.dd
+@@ -0,0 +1,34 @@
++
++.*\.x: file format elf32-or1k
++
++
++Disassembly of section \.plt:
++
++[0-9a-f]+ <\.plt>:
++ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
++ +[0-9a-f]+: 85 ec [0-9a-f]+ [0-9a-f]+ l\.lwz r15,[0-9]+\(r12\)
++ +[0-9a-f]+: 44 00 78 00 l\.jr r15
++ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
++ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
++ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
++ +[0-9a-f]+: 44 00 60 00 l\.jr r12
++ +[0-9a-f]+: a9 60 00 00 l\.ori r11,r0,0x0
++
++Disassembly of section \.text:
++
++[0-9a-f]+ <_start>:
++ +[0-9a-f]+: 9c 21 ff fc l\.addi r1,r1,-4
++ +[0-9a-f]+: d4 01 48 00 l\.sw 0\(r1\),r9
++ +[0-9a-f]+: 04 00 00 02 l\.jal [0-9a-f]+ <_start\+0x10>
++ +[0-9a-f]+: 1a 60 00 00 l\.movhi r19,0x0
++ +[0-9a-f]+: aa 73 [0-9a-f]+ [0-9a-f]+ l\.ori r19,r19,0x[0-9a-f]+
++ +[0-9a-f]+: e2 73 48 00 l\.add r19,r19,r9
++ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
++ +[0-9a-f]+: e2 31 98 00 l\.add r17,r17,r19
++ +[0-9a-f]+: 86 31 00 10 l\.lwz r17,16\(r17\)
++ +[0-9a-f]+: 84 71 00 00 l\.lwz r3,0\(r17\)
++ +[0-9a-f]+: 07 ff ff f2 l\.jal [0-9a-f]+ <\.plt\+0x10>
++ +[0-9a-f]+: 15 00 00 00 l\.nop 0x0
++ +[0-9a-f]+: 85 21 00 00 l\.lwz r9,0\(r1\)
++ +[0-9a-f]+: 44 00 48 00 l\.jr r9
++ +[0-9a-f]+: 9c 21 00 04 l\.addi r1,r1,4
+diff --git a/ld/testsuite/ld-or1k/gotha1.s b/ld/testsuite/ld-or1k/gotha1.s
+new file mode 100644
+index 00000000000..42b16db425c
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha1.s
+@@ -0,0 +1,24 @@
++ .data
++ .p2align 16
++
++ .text
++ .globl _start
++_start:
++ l.addi r1, r1, -4
++ l.sw 0(r1), r9
++
++ l.jal 8
++ l.movhi r19, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
++ l.ori r19, r19, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
++ l.add r19, r19, r9
++
++ l.movhi r17, gotha(x)
++ l.add r17, r17, r19
++ l.lwz r17, got(x)(r17)
++ l.lwz r3, 0(r17)
++
++ l.jal plt(func)
++ l.nop
++ l.lwz r9, 0(r1)
++ l.jr r9
++ l.addi r1, r1, 4
+diff --git a/ld/testsuite/ld-or1k/gotha2.dd b/ld/testsuite/ld-or1k/gotha2.dd
+new file mode 100644
+index 00000000000..fe09da5466b
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha2.dd
+@@ -0,0 +1,21 @@
++
++.*\.x: file format elf32-or1k
++
++
++Disassembly of section \.text:
++
++[0-9a-f]+ <test>:
++ +[0-9a-f]+: 9c 21 ff f8 l\.addi r1,r1,-8
++ +[0-9a-f]+: d4 01 80 00 l\.sw 0\(r1\),r16
++ +[0-9a-f]+: d4 01 48 04 l\.sw 4\(r1\),r9
++ +[0-9a-f]+: 04 00 [0-9a-f]+ [0-9a-f]+ l\.jal [0-9a-f]+ <test\+0x14>
++ +[0-9a-f]+: 1a 00 00 00 l\.movhi r16,0x0
++ +[0-9a-f]+: aa 10 [0-9a-f]+ [0-9a-f]+ l\.ori r16,r16,0x[0-9a-f]+
++ +[0-9a-f]+: e2 10 48 00 l\.add r16,r16,r9
++ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
++ +[0-9a-f]+: e2 31 80 00 l\.add r17,r17,r16
++ +[0-9a-f]+: 86 31 00 0c l\.lwz r17,12\(r17\)
++ +[0-9a-f]+: 85 21 00 04 l\.lwz r9,4\(r1\)
++ +[0-9a-f]+: 86 01 00 00 l\.lwz r16,0\(r1\)
++ +[0-9a-f]+: 44 00 48 00 l\.jr r9
++ +[0-9a-f]+: 9c 21 00 08 l\.addi r1,r1,8
+diff --git a/ld/testsuite/ld-or1k/gotha2.s b/ld/testsuite/ld-or1k/gotha2.s
+new file mode 100644
+index 00000000000..164b282f2dd
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha2.s
+@@ -0,0 +1,22 @@
++ .section .text
++ .align 4
++ .global test
++ .type test, @function
++test:
++ l.addi r1, r1, -8
++ l.sw 0(r1), r16
++ l.sw 4(r1), r9
++
++ l.jal 8
++ l.movhi r16, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
++ l.ori r16, r16, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
++ l.add r16, r16, r9
++
++ l.movhi r17, gotha(i)
++ l.add r17, r17, r16
++ l.lwz r17, got(i)(r17)
++
++ l.lwz r9, 4(r1)
++ l.lwz r16, 0(r1)
++ l.jr r9
++ l.addi r1, r1, 8
+diff --git a/ld/testsuite/ld-or1k/or1k.exp b/ld/testsuite/ld-or1k/or1k.exp
+index 7592e8307c1..8e19ec6c31a 100644
+--- a/ld/testsuite/ld-or1k/or1k.exp
++++ b/ld/testsuite/ld-or1k/or1k.exp
+@@ -53,6 +53,14 @@ set or1kplttests {
+ "" {plt1.s}
+ {{objdump -dr plt1.x.dd}}
+ "plt1.x"}
++ {"gotha exec plt" "tmpdir/libpltlib.so" ""
++ "" {gotha1.s}
++ {{objdump -dr gotha1.dd}}
++ "gotha1.x"}
++ {"gotha -fpic -shared" "-fpic -shared" ""
++ "" {gotha2.s}
++ {{objdump -dr gotha2.dd}}
++ "gotha2.x"}
+ }
+
+ # Not implemented yet
+diff --git a/ld/testsuite/ld-or1k/pltlib.s b/ld/testsuite/ld-or1k/pltlib.s
+index baf76ca1af7..8b4d7ba48fd 100644
+--- a/ld/testsuite/ld-or1k/pltlib.s
++++ b/ld/testsuite/ld-or1k/pltlib.s
+@@ -1,5 +1,6 @@
+ .section .data
+ .globl x, y
++ .size x, 4
+ x: .long 33
+ y: .long 44
+
+--
+2.25.1
+
diff --git a/package/binutils/2.34/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch b/package/binutils/2.34/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch
new file mode 100644
index 0000000000..c3978e22fa
--- /dev/null
+++ b/package/binutils/2.34/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch
@@ -0,0 +1,50 @@
+From c3003947e4bad18faea4337fd2073feeb30ee078 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Wed, 9 Jun 2021 17:28:27 +0200
+Subject: [PATCH] bfd/elf32-or1k: fix building with gcc version < 5
+
+Gcc version >= 5 has standard C mode not set to -std=gnu11, so if we use
+an old compiler(i.e. gcc 4.9) build fails on:
+```
+elf32-or1k.c:2251:3: error: 'for' loop initial declarations are only allowed in
+C99 or C11 mode
+ for (size_t i = 0; i < insn_count; i++)
+ ^
+```
+
+So let's declare `size_t i` at the top of the function instead of inside
+for loop.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4ae7f324d33..32063ab0289 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -2244,9 +2244,10 @@ or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
+ {
+ unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
+ unsigned output_insns[PLT_MAX_INSN_COUNT];
++ size_t i;
+
+ /* Copy instructions into the output buffer. */
+- for (size_t i = 0; i < insn_count; i++)
++ for (i = 0; i < insn_count; i++)
+ output_insns[i] = insns[i];
+
+ /* Honor the no-delay-slot setting. */
+@@ -2277,7 +2278,7 @@ or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
+ }
+
+ /* Write out the output buffer. */
+- for (size_t i = 0; i < (insn_count+1); i++)
++ for (i = 0; i < (insn_count+1); i++)
+ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
+ }
+
+--
+2.25.1
+
diff --git a/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
new file mode 100644
index 0000000000..585b97b2af
--- /dev/null
+++ b/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
@@ -0,0 +1,59 @@
+From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Sat, 10 Jul 2021 17:57:34 +0200
+Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
+ relative 26 bit relocation
+
+When building openal we were seeing the assert failure:
+
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePausev
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceStopv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceRewindv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePlayv
+collect2: error: ld returned 1 exit status
+
+This happens because in R_OR1K_INSN_REL_26 case we can't reference local
+symbol as previously done but we need to make sure that calls to actual
+symbol always call the version of current object.
+
+bfd/Changelog:
+
+ * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
+ in switch case R_OR1K_INSN_REL_26 where we need to check for
+ !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4ae7f324d33..4f9092539f5 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ break;
+
+ case R_OR1K_INSN_REL_26:
++ /* For a non-shared link, these will reference plt or call the
++ version of actual object. */
++ if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
++ {
++ _bfd_error_handler
++ (_("%pB: pc-relative relocation against dynamic symbol %s"),
++ input_bfd, name);
++ ret_val = FALSE;
++ bfd_set_error (bfd_error_bad_value);
++ }
++ break;
++
+ case R_OR1K_PCREL_PG21:
+ case R_OR1K_LO13:
+ case R_OR1K_SLO13:
+--
+2.25.1
+
diff --git a/package/binutils/2.35.2/0003-bfd-elf32-or1k-fix-ld-assert.patch b/package/binutils/2.35.2/0003-bfd-elf32-or1k-fix-ld-assert.patch
deleted file mode 100644
index 756493667f..0000000000
--- a/package/binutils/2.35.2/0003-bfd-elf32-or1k-fix-ld-assert.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 1659226a96b1daecfd08c057d0d5c39309d207ee Mon Sep 17 00:00:00 2001
-From: Giulio Benetti <giulio.benetti@benettiengineering.com>
-Date: Mon, 22 Mar 2021 13:30:07 +0100
-Subject: [PATCH] bfd/elf32-or1k: fix ld assert
-
-Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=27624
-
-Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
----
- bfd/elf32-or1k.c | 9 ++++-----
- 1 file changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
-index 65938e5137..41908f8938 100644
---- a/bfd/elf32-or1k.c
-+++ b/bfd/elf32-or1k.c
-@@ -2566,11 +2566,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
- if (h->type == STT_FUNC
- || h->needs_plt)
- {
-- if (! bfd_link_pic (info)
-- && !h->def_dynamic
-- && !h->ref_dynamic
-- && h->root.type != bfd_link_hash_undefweak
-- && h->root.type != bfd_link_hash_undefined)
-+ if (h->plt.refcount <= 0
-+ || (SYMBOL_CALLS_LOCAL (info, h)
-+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
-+ && h->root.type == bfd_link_hash_undefweak)))
- {
- /* This case can occur if we saw a PLT reloc in an input
- file, but the symbol was never referred to by a dynamic
---
-2.25.1
-
diff --git a/package/binutils/2.35.2/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch b/package/binutils/2.35.2/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch
new file mode 100644
index 0000000000..81fb6b8518
--- /dev/null
+++ b/package/binutils/2.35.2/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch
@@ -0,0 +1,59 @@
+From baf313f84b106a5a29f01796afd857e69abf8b08 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:14 +0900
+Subject: [PATCH] or1k: Fix issue with plt link failure for local calls
+
+When building protobuf we were seeing the assert failure:
+
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ collect2: error: ld returned 1 exit status
+
+This failure happens while writing out PLT entries, there is a check
+"BFD_ASSERT (h->dynindx != -1)" to confirm all plt entries have dynamic
+symbol attributes. This was failing for symbols that were
+"forced_local" in previous linking code.
+
+The fix adds logic to or1k_elf_adjust_dynamic_symbol to identify
+"forced_local" symbols and exclude them from the the PLT.
+
+bfd/ChangeLog:
+
+ PR 27624
+ * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Change
+ condition used to cleanup plt entries to cleanup forced local
+ entries.
+
+Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 7c02d004cc7..bbfa2bfe614 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -2568,11 +2568,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
+ if (h->type == STT_FUNC
+ || h->needs_plt)
+ {
+- if (! bfd_link_pic (info)
+- && !h->def_dynamic
+- && !h->ref_dynamic
+- && h->root.type != bfd_link_hash_undefweak
+- && h->root.type != bfd_link_hash_undefined)
++ if (h->plt.refcount <= 0
++ || (SYMBOL_CALLS_LOCAL (info, h)
++ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
++ && h->root.type == bfd_link_hash_undefweak)))
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+--
+2.25.1
+
diff --git a/package/binutils/2.35.2/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch b/package/binutils/2.35.2/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
new file mode 100644
index 0000000000..a4af57d546
--- /dev/null
+++ b/package/binutils/2.35.2/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
@@ -0,0 +1,256 @@
+From c67656e248d6dadaa2729975a17c8dd03afe48d0 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:15 +0900
+Subject: [PATCH] or1k: Implement relocation R_OR1K_GOT_AHI16 for gotha()
+
+The gotha() relocation mnemonic will be outputted by OpenRISC GCC when
+using the -mcmodel=large option. This relocation is used along with
+got() to generate 32-bit GOT offsets. This increases the previous GOT
+offset limit from the previous 16-bit (64K) limit.
+
+This is needed on large binaries where the GOT grows larger than 64k.
+
+bfd/ChangeLog:
+
+ PR 21464
+ * bfd-in2.h: Add BFD_RELOC_OR1K_GOT_AHI16 relocation.
+ * elf32-or1k.c (or1k_elf_howto_table, or1k_reloc_map): Likewise.
+ (or1k_final_link_relocate, or1k_elf_relocate_section,
+ or1k_elf_check_relocs): Likewise.
+ * libbfd.h (bfd_reloc_code_real_names): Likewise.
+ * reloc.c: Likewise.
+
+cpu/ChangeLog:
+
+ PR 21464
+ * or1k.opc (or1k_imm16_relocs, parse_reloc): Define parse logic
+ for gotha() relocation.
+
+include/ChangeLog:
+
+ PR 21464
+ * elf/or1k.h (elf_or1k_reloc_type): Define R_OR1K_GOT_AHI16 number.
+
+opcodes/ChangeLog:
+
+ PR 21464
+ * or1k-asm.c: Regenerate.
+
+gas/ChangeLog:
+
+ PR 21464
+ * testsuite/gas/or1k/reloc-1.s: Add test for new relocation.
+ * testsuite/gas/or1k/reloc-1.d: Add test result for new
+ relocation.
+
+Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
+
+fixup reloc, add tests
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/bfd-in2.h | 1 +
+ bfd/elf32-or1k.c | 21 ++++++++++++++++++++-
+ bfd/libbfd.h | 1 +
+ bfd/reloc.c | 2 ++
+ cpu/or1k.opc | 7 ++++++-
+ gas/testsuite/gas/or1k/reloc-1.d | 4 +++-
+ gas/testsuite/gas/or1k/reloc-1.s | 4 ++++
+ include/elf/or1k.h | 1 +
+ opcodes/or1k-asm.c | 7 ++++++-
+ 9 files changed, 44 insertions(+), 4 deletions(-)
+
+diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
+index df6f9f45673..ab861395e93 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -5041,6 +5041,7 @@ then it may be truncated to 8 bits. */
+ BFD_RELOC_OR1K_TLS_TPOFF,
+ BFD_RELOC_OR1K_TLS_DTPOFF,
+ BFD_RELOC_OR1K_TLS_DTPMOD,
++ BFD_RELOC_OR1K_GOT_AHI16,
+
+ /* H8 elf Relocations. */
+ BFD_RELOC_H8_DIR16A8,
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index bbfa2bfe614..8e395827123 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -808,6 +808,20 @@ static reloc_howto_type or1k_elf_howto_table[] =
+ 0, /* Source Mask. */
+ 0x03ffffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
++
++ HOWTO (R_OR1K_GOT_AHI16, /* type */
++ 16, /* rightshift */
++ 2, /* size (0 = byte, 1 = short, 2 = long) */
++ 16, /* bitsize */
++ FALSE, /* pc_relative */
++ 0, /* bitpos */
++ complain_overflow_signed, /* complain_on_overflow */
++ bfd_elf_generic_reloc, /* special_function */
++ "R_OR1K_GOT_AHI16", /* name */
++ FALSE, /* partial_inplace */
++ 0, /* src_mask */
++ 0xffff, /* dst_mask */
++ FALSE), /* pcrel_offset */
+ };
+
+ /* Map BFD reloc types to Or1k ELF reloc types. */
+@@ -871,6 +885,7 @@ static const struct or1k_reloc_map or1k_reloc_map[] =
+ { BFD_RELOC_OR1K_TLS_IE_LO13, R_OR1K_TLS_IE_LO13 },
+ { BFD_RELOC_OR1K_SLO13, R_OR1K_SLO13 },
+ { BFD_RELOC_OR1K_PLTA26, R_OR1K_PLTA26 },
++ { BFD_RELOC_OR1K_GOT_AHI16, R_OR1K_GOT_AHI16 },
+ };
+
+ /* tls_type is a mask used to track how each symbol is accessed,
+@@ -1113,6 +1128,7 @@ or1k_final_link_relocate (reloc_howto_type *howto, bfd *input_bfd,
+ switch (howto->type)
+ {
+ case R_OR1K_AHI16:
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOTOFF_AHI16:
+ case R_OR1K_TLS_IE_AHI16:
+ case R_OR1K_TLS_LE_AHI16:
+@@ -1375,6 +1391,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ }
+ break;
+
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOT16:
+ case R_OR1K_GOT_PG21:
+ case R_OR1K_GOT_LO13:
+@@ -1466,7 +1483,8 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ /* The GOT_PG21 and GOT_LO13 relocs are pc-relative,
+ while the GOT16 reloc is GOT relative. */
+ relocation = got_base + off;
+- if (r_type == R_OR1K_GOT16)
++ if (r_type == R_OR1K_GOT16
++ || r_type == R_OR1K_GOT_AHI16)
+ relocation -= got_sym_value;
+
+ /* Addend should be zero. */
+@@ -1992,6 +2010,7 @@ or1k_elf_check_relocs (bfd *abfd,
+ }
+ break;
+
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOT16:
+ case R_OR1K_GOT_PG21:
+ case R_OR1K_GOT_LO13:
+diff --git a/bfd/libbfd.h b/bfd/libbfd.h
+index b97534fc9fe..795c9b9d27f 100644
+--- a/bfd/libbfd.h
++++ b/bfd/libbfd.h
+@@ -2755,6 +2755,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
+ "BFD_RELOC_OR1K_TLS_TPOFF",
+ "BFD_RELOC_OR1K_TLS_DTPOFF",
+ "BFD_RELOC_OR1K_TLS_DTPMOD",
++ "BFD_RELOC_OR1K_GOT_AHI16",
+ "BFD_RELOC_H8_DIR16A8",
+ "BFD_RELOC_H8_DIR16R8",
+ "BFD_RELOC_H8_DIR24A8",
+diff --git a/bfd/reloc.c b/bfd/reloc.c
+index 9aba84ca81e..1e021febef2 100644
+--- a/bfd/reloc.c
++++ b/bfd/reloc.c
+@@ -6175,6 +6175,8 @@ ENUMX
+ BFD_RELOC_OR1K_GOTPC_HI16
+ ENUMX
+ BFD_RELOC_OR1K_GOTPC_LO16
++ENUMX
++ BFD_RELOC_OR1K_GOT_AHI16
+ ENUMX
+ BFD_RELOC_OR1K_GOT16
+ ENUMX
+diff --git a/cpu/or1k.opc b/cpu/or1k.opc
+index f0adcbb00a5..5d20a1f33a7 100644
+--- a/cpu/or1k.opc
++++ b/cpu/or1k.opc
+@@ -193,7 +193,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
+ BFD_RELOC_OR1K_GOT_LO13,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+- BFD_RELOC_UNUSED },
++ BFD_RELOC_OR1K_GOT_AHI16 },
+ { BFD_RELOC_OR1K_GOTPC_LO16,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+@@ -296,6 +296,11 @@ parse_reloc (const char **strp)
+ str += 5;
+ cls = RCLASS_TPOFF;
+ }
++ else if (strncasecmp (str, "got", 3) == 0)
++ {
++ str += 3;
++ cls = RCLASS_GOT;
++ }
+
+ if (strncasecmp (str, "hi(", 3) == 0)
+ {
+diff --git a/gas/testsuite/gas/or1k/reloc-1.d b/gas/testsuite/gas/or1k/reloc-1.d
+index d1bcf5608bb..3a001c4ed99 100644
+--- a/gas/testsuite/gas/or1k/reloc-1.d
++++ b/gas/testsuite/gas/or1k/reloc-1.d
+@@ -68,5 +68,7 @@ OFFSET TYPE VALUE
+ 000000ec R_OR1K_LO13 x
+ 000000f0 R_OR1K_GOT_LO13 x
+ 000000f4 R_OR1K_SLO13 x
+-
++000000f8 R_OR1K_GOT_AHI16 x
++000000fc R_OR1K_GOT_AHI16 x
++00000100 R_OR1K_GOT_AHI16 x
+
+diff --git a/gas/testsuite/gas/or1k/reloc-1.s b/gas/testsuite/gas/or1k/reloc-1.s
+index e76abef6532..562609aa869 100644
+--- a/gas/testsuite/gas/or1k/reloc-1.s
++++ b/gas/testsuite/gas/or1k/reloc-1.s
+@@ -74,3 +74,7 @@
+ l.lbz r5,po(x)(r3)
+ l.lbz r5,gotpo(x)(r3)
+ l.sb po(x)(r3),r6
++
++ l.movhi r4,gotha(x)
++ l.ori r3,r4,gotha(x)
++ l.addi r3,r4,gotha(x)
+diff --git a/include/elf/or1k.h b/include/elf/or1k.h
+index a215ef5c17e..dff37d875f2 100644
+--- a/include/elf/or1k.h
++++ b/include/elf/or1k.h
+@@ -77,6 +77,7 @@ START_RELOC_NUMBERS (elf_or1k_reloc_type)
+ RELOC_NUMBER (R_OR1K_TLS_IE_LO13, 51)
+ RELOC_NUMBER (R_OR1K_SLO13, 52)
+ RELOC_NUMBER (R_OR1K_PLTA26, 53)
++ RELOC_NUMBER (R_OR1K_GOT_AHI16, 54)
+ END_RELOC_NUMBERS (R_OR1K_max)
+
+ #define EF_OR1K_NODELAY (1UL << 0)
+diff --git a/opcodes/or1k-asm.c b/opcodes/or1k-asm.c
+index 5f3c6c74b12..e0c49b3b8cd 100644
+--- a/opcodes/or1k-asm.c
++++ b/opcodes/or1k-asm.c
+@@ -177,7 +177,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
+ BFD_RELOC_OR1K_GOT_LO13,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+- BFD_RELOC_UNUSED },
++ BFD_RELOC_OR1K_GOT_AHI16 },
+ { BFD_RELOC_OR1K_GOTPC_LO16,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+@@ -280,6 +280,11 @@ parse_reloc (const char **strp)
+ str += 5;
+ cls = RCLASS_TPOFF;
+ }
++ else if (strncasecmp (str, "got", 3) == 0)
++ {
++ str += 3;
++ cls = RCLASS_GOT;
++ }
+
+ if (strncasecmp (str, "hi(", 3) == 0)
+ {
+--
+2.25.1
+
diff --git a/package/binutils/2.35.2/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch b/package/binutils/2.35.2/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
new file mode 100644
index 0000000000..82198dd373
--- /dev/null
+++ b/package/binutils/2.35.2/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
@@ -0,0 +1,61 @@
+From 097b83a1c9c694a14e6081cee034bf24f16875c1 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:16 +0900
+Subject: [PATCH] or1k: Avoid R_OR1K_GOT16 overflow failures in presence of
+ R_OR1K_GOT_AHI16
+
+Now that we support R_OR1K_GOT_AHI16 we can relax the R_OR1K_GOT16
+overflow validation check if the section has R_OR1K_GOT_AHI16.
+
+We cannot simple disable R_OR1K_GOT16 overflow validation as there will
+still be binaries that will have only R_OR1K_GOT16. The
+R_OR1K_GOT_AHI16 relocation will only be added by GCC when building with
+the option -mcmodel=large.
+
+This assumes that R_OR1K_GOT_AHI16 will come before R_OR1K_GOT16, which
+is the code pattern that will be emitted by GCC.
+
+bfd/ChangeLog:
+
+ PR 21464
+ * elf32-or1k.c (or1k_elf_relocate_section): Relax R_OR1K_GOT16
+ overflow check if we have R_OR1K_GOT_AHI16 followed by
+ R_OR1K_GOT16.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 8e395827123..9f315bfda99 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1280,6 +1280,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ asection *sgot, *splt;
+ bfd_vma plt_base, got_base, got_sym_value;
+ bfd_boolean ret_val = TRUE;
++ bfd_boolean saw_gotha = FALSE;
+
+ if (htab == NULL)
+ return FALSE;
+@@ -1487,6 +1488,16 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ || r_type == R_OR1K_GOT_AHI16)
+ relocation -= got_sym_value;
+
++ if (r_type == R_OR1K_GOT_AHI16)
++ saw_gotha = TRUE;
++
++ /* If we have a R_OR1K_GOT16 followed by a R_OR1K_GOT_AHI16
++ relocation we assume the code is doing the right thing to avoid
++ overflows. Here we mask the lower 16-bit of the relocation to
++ avoid overflow validation failures. */
++ if (r_type == R_OR1K_GOT16 && saw_gotha)
++ relocation &= 0xffff;
++
+ /* Addend should be zero. */
+ if (rel->r_addend != 0)
+ {
+--
+2.25.1
+
diff --git a/package/binutils/2.35.2/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch b/package/binutils/2.35.2/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
new file mode 100644
index 0000000000..c884ab874d
--- /dev/null
+++ b/package/binutils/2.35.2/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
@@ -0,0 +1,500 @@
+From c87692eb894b4b86eced7b7ba205f9bf27c2c213 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:17 +0900
+Subject: [PATCH] or1k: Support large plt_relocs when generating plt
+ entries
+
+The current PLT generation code will generate invalid code when the PLT
+relocation offset exceeds 64k. This fixes the issue by detecting large
+plt_reloc offsets and generare code sequences to create larger plt
+relocations.
+
+The "large" plt code needs 2 extra instructions to create 32-bit offsets.
+
+bfd/ChangeLog:
+
+ PR 27746
+ * elf32-or1k.c (PLT_ENTRY_SIZE_LARGE, PLT_MAX_INSN_COUNT,
+ OR1K_ADD, OR1K_ORI): New macros to help with plt creation.
+ (elf_or1k_link_hash_table): New field plt_count.
+ (elf_or1k_link_hash_entry): New field plt_index.
+ (elf_or1k_plt_entry_size): New function.
+ (or1k_write_plt_entry): Update to support variable size PLTs.
+ (or1k_elf_finish_dynamic_sections): Use new or1k_write_plt_entry
+ API.
+ (or1k_elf_finish_dynamic_symbol): Update to write large PLTs
+ when needed.
+ (allocate_dynrelocs): Use elf_or1k_plt_entry_size to account for
+ PLT size.
+
+ld/ChangeLog:
+
+ PR 27746
+ testsuite/ld-or1k/or1k.exp (or1kplttests): Add tests for linking
+ along with gotha() relocations.
+ testsuite/ld-or1k/gotha1.dd: New file.
+ testsuite/ld-or1k/gotha1.s: New file.
+ testsuite/ld-or1k/gotha2.dd: New file.
+ testsuite/ld-or1k/gotha2.s: New file
+ testsuite/ld-or1k/pltlib.s (x): Define size to avoid link
+ failure.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 149 ++++++++++++++++++++++++---------
+ ld/testsuite/ld-or1k/gotha1.dd | 34 ++++++++
+ ld/testsuite/ld-or1k/gotha1.s | 24 ++++++
+ ld/testsuite/ld-or1k/gotha2.dd | 21 +++++
+ ld/testsuite/ld-or1k/gotha2.s | 22 +++++
+ ld/testsuite/ld-or1k/or1k.exp | 8 ++
+ ld/testsuite/ld-or1k/pltlib.s | 1 +
+ 7 files changed, 220 insertions(+), 39 deletions(-)
+ create mode 100644 ld/testsuite/ld-or1k/gotha1.dd
+ create mode 100644 ld/testsuite/ld-or1k/gotha1.s
+ create mode 100644 ld/testsuite/ld-or1k/gotha2.dd
+ create mode 100644 ld/testsuite/ld-or1k/gotha2.s
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 9f315bfda99..7a14eaa3a46 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -30,10 +30,14 @@
+ #define N_ONES(X) (((bfd_vma)2 << (X)) - 1)
+
+ #define PLT_ENTRY_SIZE 16
++#define PLT_ENTRY_SIZE_LARGE (6*4)
++#define PLT_MAX_INSN_COUNT 6
+
+ #define OR1K_MOVHI(D) (0x18000000 | (D << 21))
+ #define OR1K_ADRP(D) (0x08000000 | (D << 21))
+ #define OR1K_LWZ(D,A) (0x84000000 | (D << 21) | (A << 16))
++#define OR1K_ADD(D,A,B) (0xE0000000 | (D << 21) | (A << 16) | (B << 11))
++#define OR1K_ORI(D,A) (0xA8000000 | (D << 21) | (A << 16))
+ #define OR1K_ORI0(D) (0xA8000000 | (D << 21))
+ #define OR1K_JR(B) (0x44000000 | (B << 11))
+ #define OR1K_NOP 0x15000000
+@@ -907,6 +911,8 @@ struct elf_or1k_link_hash_entry
+ {
+ struct elf_link_hash_entry root;
+
++ /* For calculating PLT size. */
++ bfd_vma plt_index;
+ /* Track type of TLS access. */
+ unsigned char tls_type;
+ };
+@@ -934,9 +940,20 @@ struct elf_or1k_link_hash_table
+ /* Small local sym to section mapping cache. */
+ struct sym_cache sym_sec;
+
++ bfd_vma plt_count;
+ bfd_boolean saw_plta;
+ };
+
++static size_t
++elf_or1k_plt_entry_size (bfd_vma plt_index)
++{
++ bfd_vma plt_reloc;
++
++ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
++
++ return (plt_reloc > 0xffff) ? PLT_ENTRY_SIZE_LARGE : PLT_ENTRY_SIZE;
++}
++
+ /* Get the ELF linker hash table from a link_info structure. */
+ #define or1k_elf_hash_table(p) \
+ (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
+@@ -2224,33 +2241,46 @@ or1k_elf_check_relocs (bfd *abfd,
+ }
+
+ static void
+-or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insn1,
+- unsigned insn2, unsigned insn3, unsigned insnj)
++or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
++ unsigned insns[], size_t insn_count)
+ {
+ unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
+- unsigned insn4;
++ unsigned output_insns[PLT_MAX_INSN_COUNT];
++
++ /* Copy instructions into the output buffer. */
++ for (size_t i = 0; i < insn_count; i++)
++ output_insns[i] = insns[i];
+
+ /* Honor the no-delay-slot setting. */
+- if (insn3 == OR1K_NOP)
++ if (insns[insn_count-1] == OR1K_NOP)
+ {
+- insn4 = insn3;
++ unsigned slot1, slot2;
++
+ if (nodelay)
+- insn3 = insnj;
++ slot1 = insns[insn_count-2], slot2 = insnj;
+ else
+- insn3 = insn2, insn2 = insnj;
++ slot1 = insnj, slot2 = insns[insn_count-2];
++
++ output_insns[insn_count-2] = slot1;
++ output_insns[insn_count-1] = slot2;
++ output_insns[insn_count] = OR1K_NOP;
+ }
+ else
+ {
++ unsigned slot1, slot2;
++
+ if (nodelay)
+- insn4 = insnj;
++ slot1 = insns[insn_count-1], slot2 = insnj;
+ else
+- insn4 = insn3, insn3 = insnj;
++ slot1 = insnj, slot2 = insns[insn_count-1];
++
++ output_insns[insn_count-1] = slot1;
++ output_insns[insn_count] = slot2;
+ }
+
+- bfd_put_32 (output_bfd, insn1, contents);
+- bfd_put_32 (output_bfd, insn2, contents + 4);
+- bfd_put_32 (output_bfd, insn3, contents + 8);
+- bfd_put_32 (output_bfd, insn4, contents + 12);
++ /* Write out the output buffer. */
++ for (size_t i = 0; i < (insn_count+1); i++)
++ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
+ }
+
+ /* Finish up the dynamic sections. */
+@@ -2317,7 +2347,8 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
+ splt = htab->root.splt;
+ if (splt && splt->size > 0)
+ {
+- unsigned plt0, plt1, plt2;
++ unsigned plt[PLT_MAX_INSN_COUNT];
++ size_t plt_insn_count = 3;
+ bfd_vma got_addr = sgot->output_section->vma + sgot->output_offset;
+
+ /* Note we force 16 byte alignment on the .got, so that
+@@ -2328,27 +2359,27 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
+ bfd_vma pc = splt->output_section->vma + splt->output_offset;
+ unsigned pa = ((got_addr >> 13) - (pc >> 13)) & 0x1fffff;
+ unsigned po = got_addr & 0x1fff;
+- plt0 = OR1K_ADRP(12) | pa;
+- plt1 = OR1K_LWZ(15,12) | (po + 8);
+- plt2 = OR1K_LWZ(12,12) | (po + 4);
++ plt[0] = OR1K_ADRP(12) | pa;
++ plt[1] = OR1K_LWZ(15,12) | (po + 8);
++ plt[2] = OR1K_LWZ(12,12) | (po + 4);
+ }
+ else if (bfd_link_pic (info))
+ {
+- plt0 = OR1K_LWZ(15, 16) | 8; /* .got+8 */
+- plt1 = OR1K_LWZ(12, 16) | 4; /* .got+4 */
+- plt2 = OR1K_NOP;
++ plt[0] = OR1K_LWZ(15, 16) | 8; /* .got+8 */
++ plt[1] = OR1K_LWZ(12, 16) | 4; /* .got+4 */
++ plt[2] = OR1K_NOP;
+ }
+ else
+ {
+ unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
+ unsigned lo = got_addr & 0xffff;
+- plt0 = OR1K_MOVHI(12) | ha;
+- plt1 = OR1K_LWZ(15,12) | (lo + 8);
+- plt2 = OR1K_LWZ(12,12) | (lo + 4);
++ plt[0] = OR1K_MOVHI(12) | ha;
++ plt[1] = OR1K_LWZ(15,12) | (lo + 8);
++ plt[2] = OR1K_LWZ(12,12) | (lo + 4);
+ }
+
+- or1k_write_plt_entry (output_bfd, splt->contents,
+- plt0, plt1, plt2, OR1K_JR(15));
++ or1k_write_plt_entry (output_bfd, splt->contents, OR1K_JR(15),
++ plt, plt_insn_count);
+
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
+ }
+@@ -2391,7 +2422,8 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+
+ if (h->plt.offset != (bfd_vma) -1)
+ {
+- unsigned int plt0, plt1, plt2;
++ unsigned int plt[PLT_MAX_INSN_COUNT];
++ size_t plt_insn_count = 3;
+ asection *splt;
+ asection *sgot;
+ asection *srela;
+@@ -2403,6 +2435,7 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+ bfd_vma got_offset;
+ bfd_vma got_addr;
+ Elf_Internal_Rela rela;
++ bfd_boolean large_plt_entry;
+
+ /* This symbol has an entry in the procedure linkage table. Set
+ it up. */
+@@ -2420,10 +2453,13 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
+- plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
++ plt_index = ((struct elf_or1k_link_hash_entry *) h)->plt_index;
+ plt_addr = plt_base_addr + h->plt.offset;
+ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
+
++ large_plt_entry = (elf_or1k_plt_entry_size (plt_index)
++ == PLT_ENTRY_SIZE_LARGE);
++
+ /* Get the offset into the .got table of the entry that
+ corresponds to this function. Each .got entry is 4 bytes.
+ The first three are reserved. */
+@@ -2435,27 +2471,57 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+ {
+ unsigned pa = ((got_addr >> 13) - (plt_addr >> 13)) & 0x1fffff;
+ unsigned po = (got_addr & 0x1fff);
+- plt0 = OR1K_ADRP(12) | pa;
+- plt1 = OR1K_LWZ(12,12) | po;
+- plt2 = OR1K_ORI0(11) | plt_reloc;
++ plt[0] = OR1K_ADRP(12) | pa;
++ plt[1] = OR1K_LWZ(12,12) | po;
++ plt[2] = OR1K_ORI0(11) | plt_reloc;
+ }
+ else if (bfd_link_pic (info))
+ {
+- plt0 = OR1K_LWZ(12,16) | got_offset;
+- plt1 = OR1K_ORI0(11) | plt_reloc;
+- plt2 = OR1K_NOP;
++ if (large_plt_entry)
++ {
++ unsigned gotha = ((got_offset + 0x8000) >> 16) & 0xffff;
++ unsigned got = got_offset & 0xffff;
++ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
++ unsigned pltrello = plt_reloc & 0xffff;
++
++ plt[0] = OR1K_MOVHI(12) | gotha;
++ plt[1] = OR1K_ADD(12,12,16);
++ plt[2] = OR1K_LWZ(12,12) | got;
++ plt[3] = OR1K_MOVHI(11) | pltrelhi;
++ plt[4] = OR1K_ORI(11,11) | pltrello;
++ plt_insn_count = 5;
++ }
++ else
++ {
++ plt[0] = OR1K_LWZ(12,16) | got_offset;
++ plt[1] = OR1K_ORI0(11) | plt_reloc;
++ plt[2] = OR1K_NOP;
++ }
+ }
+ else
+ {
+ unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
+ unsigned lo = got_addr & 0xffff;
+- plt0 = OR1K_MOVHI(12) | ha;
+- plt1 = OR1K_LWZ(12,12) | lo;
+- plt2 = OR1K_ORI0(11) | plt_reloc;
++ plt[0] = OR1K_MOVHI(12) | ha;
++ plt[1] = OR1K_LWZ(12,12) | lo;
++ plt[2] = OR1K_ORI0(11) | plt_reloc;
++ }
++
++ /* For large code model we fixup the non-PIC PLT relocation instructions
++ here. */
++ if (large_plt_entry && !bfd_link_pic (info))
++ {
++ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
++ unsigned pltrello = plt_reloc & 0xffff;
++
++ plt[2] = OR1K_MOVHI(11) | pltrelhi;
++ plt[3] = OR1K_ORI(11,11) | pltrello;
++ plt[4] = OR1K_NOP;
++ plt_insn_count = 5;
+ }
+
+ or1k_write_plt_entry (output_bfd, splt->contents + h->plt.offset,
+- plt0, plt1, plt2, OR1K_JR(12));
++ OR1K_JR(12), plt, plt_insn_count);
+
+ /* Fill in the entry in the global offset table. We initialize it to
+ point to the top of the plt. This is done to lazy lookup the actual
+@@ -2779,11 +2845,16 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
+ {
+ asection *splt = htab->root.splt;
++ bfd_vma plt_index;
++
++ /* Track the index of our plt entry for use in calculating size. */
++ plt_index = htab->plt_count++;
++ ((struct elf_or1k_link_hash_entry *) h)->plt_index = plt_index;
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (splt->size == 0)
+- splt->size = PLT_ENTRY_SIZE;
++ splt->size = elf_or1k_plt_entry_size (plt_index);
+
+ h->plt.offset = splt->size;
+
+@@ -2800,7 +2871,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
+ }
+
+ /* Make room for this entry. */
+- splt->size += PLT_ENTRY_SIZE;
++ splt->size += elf_or1k_plt_entry_size (plt_index);
+
+ /* We also need to make an entry in the .got.plt section, which
+ will be placed in the .got section by the linker script. */
+diff --git a/ld/testsuite/ld-or1k/gotha1.dd b/ld/testsuite/ld-or1k/gotha1.dd
+new file mode 100644
+index 00000000000..0ad1f8f5399
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha1.dd
+@@ -0,0 +1,34 @@
++
++.*\.x: file format elf32-or1k
++
++
++Disassembly of section \.plt:
++
++[0-9a-f]+ <\.plt>:
++ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
++ +[0-9a-f]+: 85 ec [0-9a-f]+ [0-9a-f]+ l\.lwz r15,[0-9]+\(r12\)
++ +[0-9a-f]+: 44 00 78 00 l\.jr r15
++ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
++ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
++ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
++ +[0-9a-f]+: 44 00 60 00 l\.jr r12
++ +[0-9a-f]+: a9 60 00 00 l\.ori r11,r0,0x0
++
++Disassembly of section \.text:
++
++[0-9a-f]+ <_start>:
++ +[0-9a-f]+: 9c 21 ff fc l\.addi r1,r1,-4
++ +[0-9a-f]+: d4 01 48 00 l\.sw 0\(r1\),r9
++ +[0-9a-f]+: 04 00 00 02 l\.jal [0-9a-f]+ <_start\+0x10>
++ +[0-9a-f]+: 1a 60 00 00 l\.movhi r19,0x0
++ +[0-9a-f]+: aa 73 [0-9a-f]+ [0-9a-f]+ l\.ori r19,r19,0x[0-9a-f]+
++ +[0-9a-f]+: e2 73 48 00 l\.add r19,r19,r9
++ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
++ +[0-9a-f]+: e2 31 98 00 l\.add r17,r17,r19
++ +[0-9a-f]+: 86 31 00 10 l\.lwz r17,16\(r17\)
++ +[0-9a-f]+: 84 71 00 00 l\.lwz r3,0\(r17\)
++ +[0-9a-f]+: 07 ff ff f2 l\.jal [0-9a-f]+ <\.plt\+0x10>
++ +[0-9a-f]+: 15 00 00 00 l\.nop 0x0
++ +[0-9a-f]+: 85 21 00 00 l\.lwz r9,0\(r1\)
++ +[0-9a-f]+: 44 00 48 00 l\.jr r9
++ +[0-9a-f]+: 9c 21 00 04 l\.addi r1,r1,4
+diff --git a/ld/testsuite/ld-or1k/gotha1.s b/ld/testsuite/ld-or1k/gotha1.s
+new file mode 100644
+index 00000000000..42b16db425c
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha1.s
+@@ -0,0 +1,24 @@
++ .data
++ .p2align 16
++
++ .text
++ .globl _start
++_start:
++ l.addi r1, r1, -4
++ l.sw 0(r1), r9
++
++ l.jal 8
++ l.movhi r19, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
++ l.ori r19, r19, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
++ l.add r19, r19, r9
++
++ l.movhi r17, gotha(x)
++ l.add r17, r17, r19
++ l.lwz r17, got(x)(r17)
++ l.lwz r3, 0(r17)
++
++ l.jal plt(func)
++ l.nop
++ l.lwz r9, 0(r1)
++ l.jr r9
++ l.addi r1, r1, 4
+diff --git a/ld/testsuite/ld-or1k/gotha2.dd b/ld/testsuite/ld-or1k/gotha2.dd
+new file mode 100644
+index 00000000000..fe09da5466b
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha2.dd
+@@ -0,0 +1,21 @@
++
++.*\.x: file format elf32-or1k
++
++
++Disassembly of section \.text:
++
++[0-9a-f]+ <test>:
++ +[0-9a-f]+: 9c 21 ff f8 l\.addi r1,r1,-8
++ +[0-9a-f]+: d4 01 80 00 l\.sw 0\(r1\),r16
++ +[0-9a-f]+: d4 01 48 04 l\.sw 4\(r1\),r9
++ +[0-9a-f]+: 04 00 [0-9a-f]+ [0-9a-f]+ l\.jal [0-9a-f]+ <test\+0x14>
++ +[0-9a-f]+: 1a 00 00 00 l\.movhi r16,0x0
++ +[0-9a-f]+: aa 10 [0-9a-f]+ [0-9a-f]+ l\.ori r16,r16,0x[0-9a-f]+
++ +[0-9a-f]+: e2 10 48 00 l\.add r16,r16,r9
++ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
++ +[0-9a-f]+: e2 31 80 00 l\.add r17,r17,r16
++ +[0-9a-f]+: 86 31 00 0c l\.lwz r17,12\(r17\)
++ +[0-9a-f]+: 85 21 00 04 l\.lwz r9,4\(r1\)
++ +[0-9a-f]+: 86 01 00 00 l\.lwz r16,0\(r1\)
++ +[0-9a-f]+: 44 00 48 00 l\.jr r9
++ +[0-9a-f]+: 9c 21 00 08 l\.addi r1,r1,8
+diff --git a/ld/testsuite/ld-or1k/gotha2.s b/ld/testsuite/ld-or1k/gotha2.s
+new file mode 100644
+index 00000000000..164b282f2dd
+--- /dev/null
++++ b/ld/testsuite/ld-or1k/gotha2.s
+@@ -0,0 +1,22 @@
++ .section .text
++ .align 4
++ .global test
++ .type test, @function
++test:
++ l.addi r1, r1, -8
++ l.sw 0(r1), r16
++ l.sw 4(r1), r9
++
++ l.jal 8
++ l.movhi r16, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
++ l.ori r16, r16, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
++ l.add r16, r16, r9
++
++ l.movhi r17, gotha(i)
++ l.add r17, r17, r16
++ l.lwz r17, got(i)(r17)
++
++ l.lwz r9, 4(r1)
++ l.lwz r16, 0(r1)
++ l.jr r9
++ l.addi r1, r1, 8
+diff --git a/ld/testsuite/ld-or1k/or1k.exp b/ld/testsuite/ld-or1k/or1k.exp
+index 7592e8307c1..8e19ec6c31a 100644
+--- a/ld/testsuite/ld-or1k/or1k.exp
++++ b/ld/testsuite/ld-or1k/or1k.exp
+@@ -53,6 +53,14 @@ set or1kplttests {
+ "" {plt1.s}
+ {{objdump -dr plt1.x.dd}}
+ "plt1.x"}
++ {"gotha exec plt" "tmpdir/libpltlib.so" ""
++ "" {gotha1.s}
++ {{objdump -dr gotha1.dd}}
++ "gotha1.x"}
++ {"gotha -fpic -shared" "-fpic -shared" ""
++ "" {gotha2.s}
++ {{objdump -dr gotha2.dd}}
++ "gotha2.x"}
+ }
+
+ # Not implemented yet
+diff --git a/ld/testsuite/ld-or1k/pltlib.s b/ld/testsuite/ld-or1k/pltlib.s
+index baf76ca1af7..8b4d7ba48fd 100644
+--- a/ld/testsuite/ld-or1k/pltlib.s
++++ b/ld/testsuite/ld-or1k/pltlib.s
+@@ -1,5 +1,6 @@
+ .section .data
+ .globl x, y
++ .size x, 4
+ x: .long 33
+ y: .long 44
+
+--
+2.25.1
+
diff --git a/package/binutils/2.35.2/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch b/package/binutils/2.35.2/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch
new file mode 100644
index 0000000000..c3978e22fa
--- /dev/null
+++ b/package/binutils/2.35.2/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch
@@ -0,0 +1,50 @@
+From c3003947e4bad18faea4337fd2073feeb30ee078 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Wed, 9 Jun 2021 17:28:27 +0200
+Subject: [PATCH] bfd/elf32-or1k: fix building with gcc version < 5
+
+Gcc version >= 5 has standard C mode not set to -std=gnu11, so if we use
+an old compiler(i.e. gcc 4.9) build fails on:
+```
+elf32-or1k.c:2251:3: error: 'for' loop initial declarations are only allowed in
+C99 or C11 mode
+ for (size_t i = 0; i < insn_count; i++)
+ ^
+```
+
+So let's declare `size_t i` at the top of the function instead of inside
+for loop.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4ae7f324d33..32063ab0289 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -2244,9 +2244,10 @@ or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
+ {
+ unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
+ unsigned output_insns[PLT_MAX_INSN_COUNT];
++ size_t i;
+
+ /* Copy instructions into the output buffer. */
+- for (size_t i = 0; i < insn_count; i++)
++ for (i = 0; i < insn_count; i++)
+ output_insns[i] = insns[i];
+
+ /* Honor the no-delay-slot setting. */
+@@ -2277,7 +2278,7 @@ or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
+ }
+
+ /* Write out the output buffer. */
+- for (size_t i = 0; i < (insn_count+1); i++)
++ for (i = 0; i < (insn_count+1); i++)
+ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
+ }
+
+--
+2.25.1
+
diff --git a/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
new file mode 100644
index 0000000000..585b97b2af
--- /dev/null
+++ b/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
@@ -0,0 +1,59 @@
+From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Sat, 10 Jul 2021 17:57:34 +0200
+Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
+ relative 26 bit relocation
+
+When building openal we were seeing the assert failure:
+
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePausev
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceStopv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceRewindv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePlayv
+collect2: error: ld returned 1 exit status
+
+This happens because in R_OR1K_INSN_REL_26 case we can't reference local
+symbol as previously done but we need to make sure that calls to actual
+symbol always call the version of current object.
+
+bfd/Changelog:
+
+ * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
+ in switch case R_OR1K_INSN_REL_26 where we need to check for
+ !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4ae7f324d33..4f9092539f5 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ break;
+
+ case R_OR1K_INSN_REL_26:
++ /* For a non-shared link, these will reference plt or call the
++ version of actual object. */
++ if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
++ {
++ _bfd_error_handler
++ (_("%pB: pc-relative relocation against dynamic symbol %s"),
++ input_bfd, name);
++ ret_val = FALSE;
++ bfd_set_error (bfd_error_bad_value);
++ }
++ break;
++
+ case R_OR1K_PCREL_PG21:
+ case R_OR1K_LO13:
+ case R_OR1K_SLO13:
+--
+2.25.1
+
diff --git a/package/binutils/2.36.1/0003-bfd-elf32-or1k-fix-ld-assert.patch b/package/binutils/2.36.1/0003-bfd-elf32-or1k-fix-ld-assert.patch
deleted file mode 100644
index 756493667f..0000000000
--- a/package/binutils/2.36.1/0003-bfd-elf32-or1k-fix-ld-assert.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 1659226a96b1daecfd08c057d0d5c39309d207ee Mon Sep 17 00:00:00 2001
-From: Giulio Benetti <giulio.benetti@benettiengineering.com>
-Date: Mon, 22 Mar 2021 13:30:07 +0100
-Subject: [PATCH] bfd/elf32-or1k: fix ld assert
-
-Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=27624
-
-Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
----
- bfd/elf32-or1k.c | 9 ++++-----
- 1 file changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
-index 65938e5137..41908f8938 100644
---- a/bfd/elf32-or1k.c
-+++ b/bfd/elf32-or1k.c
-@@ -2566,11 +2566,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
- if (h->type == STT_FUNC
- || h->needs_plt)
- {
-- if (! bfd_link_pic (info)
-- && !h->def_dynamic
-- && !h->ref_dynamic
-- && h->root.type != bfd_link_hash_undefweak
-- && h->root.type != bfd_link_hash_undefined)
-+ if (h->plt.refcount <= 0
-+ || (SYMBOL_CALLS_LOCAL (info, h)
-+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
-+ && h->root.type == bfd_link_hash_undefweak)))
- {
- /* This case can occur if we saw a PLT reloc in an input
- file, but the symbol was never referred to by a dynamic
---
-2.25.1
-
diff --git a/package/binutils/2.36.1/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch b/package/binutils/2.36.1/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch
new file mode 100644
index 0000000000..85931ff661
--- /dev/null
+++ b/package/binutils/2.36.1/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch
@@ -0,0 +1,59 @@
+From b5fdaa85790dff45fd2c3fd15405c16dbc50a074 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:14 +0900
+Subject: [PATCH] or1k: Fix issue with plt link failure for local calls
+
+When building protobuf we were seeing the assert failure:
+
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ /home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
+ BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
+ collect2: error: ld returned 1 exit status
+
+This failure happens while writing out PLT entries, there is a check
+"BFD_ASSERT (h->dynindx != -1)" to confirm all plt entries have dynamic
+symbol attributes. This was failing for symbols that were
+"forced_local" in previous linking code.
+
+The fix adds logic to or1k_elf_adjust_dynamic_symbol to identify
+"forced_local" symbols and exclude them from the the PLT.
+
+bfd/ChangeLog:
+
+ PR 27624
+ * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Change
+ condition used to cleanup plt entries to cleanup forced local
+ entries.
+
+Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 65938e51378..4f82cc4c667 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -2566,11 +2566,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
+ if (h->type == STT_FUNC
+ || h->needs_plt)
+ {
+- if (! bfd_link_pic (info)
+- && !h->def_dynamic
+- && !h->ref_dynamic
+- && h->root.type != bfd_link_hash_undefweak
+- && h->root.type != bfd_link_hash_undefined)
++ if (h->plt.refcount <= 0
++ || (SYMBOL_CALLS_LOCAL (info, h)
++ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
++ && h->root.type == bfd_link_hash_undefweak)))
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+--
+2.25.1
+
diff --git a/package/binutils/2.36.1/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch b/package/binutils/2.36.1/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
new file mode 100644
index 0000000000..08c23d2760
--- /dev/null
+++ b/package/binutils/2.36.1/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
@@ -0,0 +1,256 @@
+From 141dee7402871c7b3994838c3eddf64a92d67be7 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:15 +0900
+Subject: [PATCH] or1k: Implement relocation R_OR1K_GOT_AHI16 for gotha()
+
+The gotha() relocation mnemonic will be outputted by OpenRISC GCC when
+using the -mcmodel=large option. This relocation is used along with
+got() to generate 32-bit GOT offsets. This increases the previous GOT
+offset limit from the previous 16-bit (64K) limit.
+
+This is needed on large binaries where the GOT grows larger than 64k.
+
+bfd/ChangeLog:
+
+ PR 21464
+ * bfd-in2.h: Add BFD_RELOC_OR1K_GOT_AHI16 relocation.
+ * elf32-or1k.c (or1k_elf_howto_table, or1k_reloc_map): Likewise.
+ (or1k_final_link_relocate, or1k_elf_relocate_section,
+ or1k_elf_check_relocs): Likewise.
+ * libbfd.h (bfd_reloc_code_real_names): Likewise.
+ * reloc.c: Likewise.
+
+cpu/ChangeLog:
+
+ PR 21464
+ * or1k.opc (or1k_imm16_relocs, parse_reloc): Define parse logic
+ for gotha() relocation.
+
+include/ChangeLog:
+
+ PR 21464
+ * elf/or1k.h (elf_or1k_reloc_type): Define R_OR1K_GOT_AHI16 number.
+
+opcodes/ChangeLog:
+
+ PR 21464
+ * or1k-asm.c: Regenerate.
+
+gas/ChangeLog:
+
+ PR 21464
+ * testsuite/gas/or1k/reloc-1.s: Add test for new relocation.
+ * testsuite/gas/or1k/reloc-1.d: Add test result for new
+ relocation.
+
+Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
+
+fixup reloc, add tests
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/bfd-in2.h | 1 +
+ bfd/elf32-or1k.c | 21 ++++++++++++++++++++-
+ bfd/libbfd.h | 1 +
+ bfd/reloc.c | 2 ++
+ cpu/or1k.opc | 7 ++++++-
+ gas/testsuite/gas/or1k/reloc-1.d | 4 +++-
+ gas/testsuite/gas/or1k/reloc-1.s | 4 ++++
+ include/elf/or1k.h | 1 +
+ opcodes/or1k-asm.c | 7 ++++++-
+ 9 files changed, 44 insertions(+), 4 deletions(-)
+
+diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
+index 7eff85b7eaa..e76b9e7a319 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -5048,6 +5048,7 @@ then it may be truncated to 8 bits. */
+ BFD_RELOC_OR1K_TLS_TPOFF,
+ BFD_RELOC_OR1K_TLS_DTPOFF,
+ BFD_RELOC_OR1K_TLS_DTPMOD,
++ BFD_RELOC_OR1K_GOT_AHI16,
+
+ /* H8 elf Relocations. */
+ BFD_RELOC_H8_DIR16A8,
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4f82cc4c667..48461854a96 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -808,6 +808,20 @@ static reloc_howto_type or1k_elf_howto_table[] =
+ 0, /* Source Mask. */
+ 0x03ffffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
++
++ HOWTO (R_OR1K_GOT_AHI16, /* type */
++ 16, /* rightshift */
++ 2, /* size (0 = byte, 1 = short, 2 = long) */
++ 16, /* bitsize */
++ FALSE, /* pc_relative */
++ 0, /* bitpos */
++ complain_overflow_signed, /* complain_on_overflow */
++ bfd_elf_generic_reloc, /* special_function */
++ "R_OR1K_GOT_AHI16", /* name */
++ FALSE, /* partial_inplace */
++ 0, /* src_mask */
++ 0xffff, /* dst_mask */
++ FALSE), /* pcrel_offset */
+ };
+
+ /* Map BFD reloc types to Or1k ELF reloc types. */
+@@ -871,6 +885,7 @@ static const struct or1k_reloc_map or1k_reloc_map[] =
+ { BFD_RELOC_OR1K_TLS_IE_LO13, R_OR1K_TLS_IE_LO13 },
+ { BFD_RELOC_OR1K_SLO13, R_OR1K_SLO13 },
+ { BFD_RELOC_OR1K_PLTA26, R_OR1K_PLTA26 },
++ { BFD_RELOC_OR1K_GOT_AHI16, R_OR1K_GOT_AHI16 },
+ };
+
+ /* tls_type is a mask used to track how each symbol is accessed,
+@@ -1111,6 +1126,7 @@ or1k_final_link_relocate (reloc_howto_type *howto, bfd *input_bfd,
+ switch (howto->type)
+ {
+ case R_OR1K_AHI16:
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOTOFF_AHI16:
+ case R_OR1K_TLS_IE_AHI16:
+ case R_OR1K_TLS_LE_AHI16:
+@@ -1373,6 +1389,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ }
+ break;
+
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOT16:
+ case R_OR1K_GOT_PG21:
+ case R_OR1K_GOT_LO13:
+@@ -1464,7 +1481,8 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ /* The GOT_PG21 and GOT_LO13 relocs are pc-relative,
+ while the GOT16 reloc is GOT relative. */
+ relocation = got_base + off;
+- if (r_type == R_OR1K_GOT16)
++ if (r_type == R_OR1K_GOT16
++ || r_type == R_OR1K_GOT_AHI16)
+ relocation -= got_sym_value;
+
+ /* Addend should be zero. */
+@@ -1990,6 +2008,7 @@ or1k_elf_check_relocs (bfd *abfd,
+ }
+ break;
+
++ case R_OR1K_GOT_AHI16:
+ case R_OR1K_GOT16:
+ case R_OR1K_GOT_PG21:
+ case R_OR1K_GOT_LO13:
+diff --git a/bfd/libbfd.h b/bfd/libbfd.h
+index 7271a2ad5a1..e0ee2dafc07 100644
+--- a/bfd/libbfd.h
++++ b/bfd/libbfd.h
+@@ -2757,6 +2757,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
+ "BFD_RELOC_OR1K_TLS_TPOFF",
+ "BFD_RELOC_OR1K_TLS_DTPOFF",
+ "BFD_RELOC_OR1K_TLS_DTPMOD",
++ "BFD_RELOC_OR1K_GOT_AHI16",
+ "BFD_RELOC_H8_DIR16A8",
+ "BFD_RELOC_H8_DIR16R8",
+ "BFD_RELOC_H8_DIR24A8",
+diff --git a/bfd/reloc.c b/bfd/reloc.c
+index 4f4b95a0b7f..fe94e0d8f91 100644
+--- a/bfd/reloc.c
++++ b/bfd/reloc.c
+@@ -6204,6 +6204,8 @@ ENUMX
+ BFD_RELOC_OR1K_GOTPC_HI16
+ ENUMX
+ BFD_RELOC_OR1K_GOTPC_LO16
++ENUMX
++ BFD_RELOC_OR1K_GOT_AHI16
+ ENUMX
+ BFD_RELOC_OR1K_GOT16
+ ENUMX
+diff --git a/cpu/or1k.opc b/cpu/or1k.opc
+index f0adcbb00a5..5d20a1f33a7 100644
+--- a/cpu/or1k.opc
++++ b/cpu/or1k.opc
+@@ -193,7 +193,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
+ BFD_RELOC_OR1K_GOT_LO13,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+- BFD_RELOC_UNUSED },
++ BFD_RELOC_OR1K_GOT_AHI16 },
+ { BFD_RELOC_OR1K_GOTPC_LO16,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+@@ -296,6 +296,11 @@ parse_reloc (const char **strp)
+ str += 5;
+ cls = RCLASS_TPOFF;
+ }
++ else if (strncasecmp (str, "got", 3) == 0)
++ {
++ str += 3;
++ cls = RCLASS_GOT;
++ }
+
+ if (strncasecmp (str, "hi(", 3) == 0)
+ {
+diff --git a/gas/testsuite/gas/or1k/reloc-1.d b/gas/testsuite/gas/or1k/reloc-1.d
+index d1bcf5608bb..3a001c4ed99 100644
+--- a/gas/testsuite/gas/or1k/reloc-1.d
++++ b/gas/testsuite/gas/or1k/reloc-1.d
+@@ -68,5 +68,7 @@ OFFSET TYPE VALUE
+ 000000ec R_OR1K_LO13 x
+ 000000f0 R_OR1K_GOT_LO13 x
+ 000000f4 R_OR1K_SLO13 x
+-
++000000f8 R_OR1K_GOT_AHI16 x
++000000fc R_OR1K_GOT_AHI16 x
++00000100 R_OR1K_GOT_AHI16 x
+
+diff --git a/gas/testsuite/gas/or1k/reloc-1.s b/gas/testsuite/gas/or1k/reloc-1.s
+index e76abef6532..562609aa869 100644
+--- a/gas/testsuite/gas/or1k/reloc-1.s
++++ b/gas/testsuite/gas/or1k/reloc-1.s
+@@ -74,3 +74,7 @@
+ l.lbz r5,po(x)(r3)
+ l.lbz r5,gotpo(x)(r3)
+ l.sb po(x)(r3),r6
++
++ l.movhi r4,gotha(x)
++ l.ori r3,r4,gotha(x)
++ l.addi r3,r4,gotha(x)
+diff --git a/include/elf/or1k.h b/include/elf/or1k.h
+index 7f281481061..69ab90584a2 100644
+--- a/include/elf/or1k.h
++++ b/include/elf/or1k.h
+@@ -77,6 +77,7 @@ START_RELOC_NUMBERS (elf_or1k_reloc_type)
+ RELOC_NUMBER (R_OR1K_TLS_IE_LO13, 51)
+ RELOC_NUMBER (R_OR1K_SLO13, 52)
+ RELOC_NUMBER (R_OR1K_PLTA26, 53)
++ RELOC_NUMBER (R_OR1K_GOT_AHI16, 54)
+ END_RELOC_NUMBERS (R_OR1K_max)
+
+ #define EF_OR1K_NODELAY (1UL << 0)
+diff --git a/opcodes/or1k-asm.c b/opcodes/or1k-asm.c
+index 045ab6230b6..fdccf67f9e1 100644
+--- a/opcodes/or1k-asm.c
++++ b/opcodes/or1k-asm.c
+@@ -177,7 +177,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
+ BFD_RELOC_OR1K_GOT_LO13,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+- BFD_RELOC_UNUSED },
++ BFD_RELOC_OR1K_GOT_AHI16 },
+ { BFD_RELOC_OR1K_GOTPC_LO16,
+ BFD_RELOC_UNUSED,
+ BFD_RELOC_UNUSED,
+@@ -280,6 +280,11 @@ parse_reloc (const char **strp)
+ str += 5;
+ cls = RCLASS_TPOFF;
+ }
++ else if (strncasecmp (str, "got", 3) == 0)
++ {
++ str += 3;
++ cls = RCLASS_GOT;
++ }
+
+ if (strncasecmp (str, "hi(", 3) == 0)
+ {
+--
+2.25.1
+
diff --git a/package/binutils/2.36.1/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch b/package/binutils/2.36.1/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
new file mode 100644
index 0000000000..618072fb10
--- /dev/null
+++ b/package/binutils/2.36.1/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
@@ -0,0 +1,61 @@
+From de914df5f2ba23a9f6f1fbf6efdc22e1b045901c Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:16 +0900
+Subject: [PATCH] or1k: Avoid R_OR1K_GOT16 overflow failures in presence of
+ R_OR1K_GOT_AHI16
+
+Now that we support R_OR1K_GOT_AHI16 we can relax the R_OR1K_GOT16
+overflow validation check if the section has R_OR1K_GOT_AHI16.
+
+We cannot simple disable R_OR1K_GOT16 overflow validation as there will
+still be binaries that will have only R_OR1K_GOT16. The
+R_OR1K_GOT_AHI16 relocation will only be added by GCC when building with
+the option -mcmodel=large.
+
+This assumes that R_OR1K_GOT_AHI16 will come before R_OR1K_GOT16, which
+is the code pattern that will be emitted by GCC.
+
+bfd/ChangeLog:
+
+ PR 21464
+ * elf32-or1k.c (or1k_elf_relocate_section): Relax R_OR1K_GOT16
+ overflow check if we have R_OR1K_GOT_AHI16 followed by
+ R_OR1K_GOT16.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 48461854a96..44e67f2b84b 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1278,6 +1278,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ asection *sgot, *splt;
+ bfd_vma plt_base, got_base, got_sym_value;
+ bfd_boolean ret_val = TRUE;
++ bfd_boolean saw_gotha = FALSE;
+
+ if (htab == NULL)
+ return FALSE;
+@@ -1485,6 +1486,16 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ || r_type == R_OR1K_GOT_AHI16)
+ relocation -= got_sym_value;
+
++ if (r_type == R_OR1K_GOT_AHI16)
++ saw_gotha = TRUE;
++
++ /* If we have a R_OR1K_GOT16 followed by a R_OR1K_GOT_AHI16
++ relocation we assume the code is doing the right thing to avoid
++ overflows. Here we mask the lower 16-bit of the relocation to
++ avoid overflow validation failures. */
++ if (r_type == R_OR1K_GOT16 && saw_gotha)
++ relocation &= 0xffff;
++
+ /* Addend should be zero. */
+ if (rel->r_addend != 0)
+ {
+--
+2.25.1
+
diff --git a/package/binutils/2.36.1/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch b/package/binutils/2.36.1/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
new file mode 100644
index 0000000000..6d50852fe9
--- /dev/null
+++ b/package/binutils/2.36.1/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
@@ -0,0 +1,500 @@
+From 4a7b357d0c802685bee7706bafb9702c821286e1 Mon Sep 17 00:00:00 2001
+From: Stafford Horne <shorne@gmail.com>
+Date: Sun, 2 May 2021 06:02:17 +0900
+Subject: [PATCH] or1k: Support large plt_relocs when generating plt
+ entries
+
+The current PLT generation code will generate invalid code when the PLT
+relocation offset exceeds 64k. This fixes the issue by detecting large
+plt_reloc offsets and generare code sequences to create larger plt
+relocations.
+
+The "large" plt code needs 2 extra instructions to create 32-bit offsets.
+
+bfd/ChangeLog:
+
+ PR 27746
+ * elf32-or1k.c (PLT_ENTRY_SIZE_LARGE, PLT_MAX_INSN_COUNT,
+ OR1K_ADD, OR1K_ORI): New macros to help with plt creation.
+ (elf_or1k_link_hash_table): New field plt_count.
+ (elf_or1k_link_hash_entry): New field plt_index.
+ (elf_or1k_plt_entry_size): New function.
+ (or1k_write_plt_entry): Update to support variable size PLTs.
+ (or1k_elf_finish_dynamic_sections): Use new or1k_write_plt_entry
+ API.
+ (or1k_elf_finish_dynamic_symbol): Update to write large PLTs
+ when needed.
+ (allocate_dynrelocs): Use elf_or1k_plt_entry_size to account for
+ PLT size.
+
+ld/ChangeLog:
+
+ PR 27746
+ testsuite/ld-or1k/or1k.exp (or1kplttests): Add tests for linking
+ along with gotha() relocations.
+ testsuite/ld-or1k/gotha1.dd: New file.
+ testsuite/ld-or1k/gotha1.s: New file.
+ testsuite/ld-or1k/gotha2.dd: New file.
+ testsuite/ld-or1k/gotha2.s: New file
+ testsuite/ld-or1k/pltlib.s (x): Define size to avoid link
+ failure.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 149 ++++++++++++++++++++++++---------
+ ld/testsuite/ld-or1k/gotha1.dd | 34 ++++++++
+ ld/testsuite/ld-or1k/gotha1.s | 24 ++++++
+ ld/testsuite/ld-or1k/gotha2.dd | 21 +++++
+ ld/testsuite/ld-or1k/gotha2.s | 22 +++++
+ ld/testsuite/ld-or1k/or1k.exp | 8 ++
+ ld/testsuite/ld-or1k/pltlib.s | 1 +
+ 7 files changed, 220 insertions(+), 39 deletions(-)
+ create mode 100644 ld/testsuite/ld-or1k/gotha1.dd
+ create mode 100644 ld/testsuite/ld-or1k/gotha1.s
+ create mode 100644 ld/testsuite/ld-or1k/gotha2.dd
+ create mode 100644 ld/testsuite/ld-or1k/gotha2.s
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 44e67f2b84b..3da68e52425 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -30,10 +30,14 @@
+ #define N_ONES(X) (((bfd_vma)2 << (X)) - 1)
+
+ #define PLT_ENTRY_SIZE 16
++#define PLT_ENTRY_SIZE_LARGE (6*4)
++#define PLT_MAX_INSN_COUNT 6
+
+ #define OR1K_MOVHI(D) (0x18000000 | (D << 21))
+ #define OR1K_ADRP(D) (0x08000000 | (D << 21))
+ #define OR1K_LWZ(D,A) (0x84000000 | (D << 21) | (A << 16))
++#define OR1K_ADD(D,A,B) (0xE0000000 | (D << 21) | (A << 16) | (B << 11))
++#define OR1K_ORI(D,A) (0xA8000000 | (D << 21) | (A << 16))
+ #define OR1K_ORI0(D) (0xA8000000 | (D << 21))
+ #define OR1K_JR(B) (0x44000000 | (B << 11))
+ #define OR1K_NOP 0x15000000
+@@ -907,6 +911,8 @@ struct elf_or1k_link_hash_entry
+ {
+ struct elf_link_hash_entry root;
+
++ /* For calculating PLT size. */
++ bfd_vma plt_index;
+ /* Track type of TLS access. */
+ unsigned char tls_type;
+ };
+@@ -931,9 +937,20 @@ struct elf_or1k_link_hash_table
+ {
+ struct elf_link_hash_table root;
+
++ bfd_vma plt_count;
+ bfd_boolean saw_plta;
+ };
+
++static size_t
++elf_or1k_plt_entry_size (bfd_vma plt_index)
++{
++ bfd_vma plt_reloc;
++
++ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
++
++ return (plt_reloc > 0xffff) ? PLT_ENTRY_SIZE_LARGE : PLT_ENTRY_SIZE;
++}
++
+ /* Get the ELF linker hash table from a link_info structure. */
+ #define or1k_elf_hash_table(p) \
+ ((is_elf_hash_table ((p)->hash) \
+@@ -2222,33 +2239,46 @@ or1k_elf_check_relocs (bfd *abfd,
+ }
+
+ static void
+-or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insn1,
+- unsigned insn2, unsigned insn3, unsigned insnj)
++or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
++ unsigned insns[], size_t insn_count)
+ {
+ unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
+- unsigned insn4;
++ unsigned output_insns[PLT_MAX_INSN_COUNT];
++
++ /* Copy instructions into the output buffer. */
++ for (size_t i = 0; i < insn_count; i++)
++ output_insns[i] = insns[i];
+
+ /* Honor the no-delay-slot setting. */
+- if (insn3 == OR1K_NOP)
++ if (insns[insn_count-1] == OR1K_NOP)
+ {
+- insn4 = insn3;
++ unsigned slot1, slot2;
++
+ if (nodelay)
+- insn3 = insnj;
++ slot1 = insns[insn_count-2], slot2 = insnj;
+ else
+- insn3 = insn2, insn2 = insnj;
++ slot1 = insnj, slot2 = insns[insn_count-2];
++
++ output_insns[insn_count-2] = slot1;
++ output_insns[insn_count-1] = slot2;
++ output_insns[insn_count] = OR1K_NOP;
+ }
+ else
+ {
++ unsigned slot1, slot2;
++
+ if (nodelay)
+- insn4 = insnj;
++ slot1 = insns[insn_count-1], slot2 = insnj;
+ else
+- insn4 = insn3, insn3 = insnj;
++ slot1 = insnj, slot2 = insns[insn_count-1];
++
++ output_insns[insn_count-1] = slot1;
++ output_insns[insn_count] = slot2;
+ }
+
+- bfd_put_32 (output_bfd, insn1, contents);
+- bfd_put_32 (output_bfd, insn2, contents + 4);
+- bfd_put_32 (output_bfd, insn3, contents + 8);
+- bfd_put_32 (output_bfd, insn4, contents + 12);
++ /* Write out the output buffer. */
++ for (size_t i = 0; i < (insn_count+1); i++)
++ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
+ }
+
+ /* Finish up the dynamic sections. */
+@@ -2315,7 +2345,8 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
+ splt = htab->root.splt;
+ if (splt && splt->size > 0)
+ {
+- unsigned plt0, plt1, plt2;
++ unsigned plt[PLT_MAX_INSN_COUNT];
++ size_t plt_insn_count = 3;
+ bfd_vma got_addr = sgot->output_section->vma + sgot->output_offset;
+
+ /* Note we force 16 byte alignment on the .got, so that
+@@ -2326,27 +2357,27 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
+ bfd_vma pc = splt->output_section->vma + splt->output_offset;
+ unsigned pa = ((got_addr >> 13) - (pc >> 13)) & 0x1fffff;
+ unsigned po = got_addr & 0x1fff;
+- plt0 = OR1K_ADRP(12) | pa;
+- plt1 = OR1K_LWZ(15,12) | (po + 8