diff --git a/buildroot/CHANGES b/buildroot/CHANGES index 80c0125b8..a692ed7ba 100644 --- a/buildroot/CHANGES +++ b/buildroot/CHANGES @@ -1,3 +1,54 @@ +2021.02.4, released August 10th, 2021 + + Important / security related fixes. + + Toolchain: Disable PIC/PIE for Microblaze (like for NIOS II) + as it is not currently working. + + binutils: fix linker assert failure on OpenRisc, or1k build + issue with gcc < 5 + + gdb: Enable on NIOS II + + utils/scanpypi: Various improvements + + Defconfigs: stm32f469_disco: Fix kernel boot issue, Microchip + sam9x60ek mmc_dev: Add missing toolchain/system options + + Updated/fixed packages: apache, arm-trusted-firmware, audit, + avahi, bind, binutils, bird, bluez5_utils, boinc, busybox, + chrony, clamav, cryptsetup, cwiid, dnsmasq, docker-cli, + docker-engine, dovecot, dovecot-pigeonhole, e2fsprogs, exiv2, + fail2ban, fb-test-app, feh, fetchmail, flac, fluxbox, gawk, + gcc, gcr, gdb, gdk-pixbuf, gesftpserver, glibc, go, gptfdisk, + granite, grub2, gqrx, guile, hdparm, heirloom-mailx, + ibrcommon, ibrdtn, ibrdtn-tools, ibrdtnd, intel-microcode, + iodine, irqbalance, keepalived, libass, libconfig, libcurl, + libfreeimage, libfuse3, libgcrypt, libgtk3, libgudev, libhtp, + libjson, libkrb5, libloki, libmodsecurity, libndp, + libnetfilter-log, libnfnetlink, libnice, libodb, libodb-boost, + libodb-mysql, libodb-pgsql, libpcap, libqmi, libressl, + librsvg, libtasn1, libtirpc, libuci, libxmlrpc, + linux-firmware, linuxptp, lrzsz, ltp-testsuite, lvm2, mariadb, + mbedtls, monit, mono, mosquitto, mpd, mpg123, mpv, nbd, neard, + netsnmp, nettle, nginx-modsecurity, nmap, nodejs, ntp, + openntpd, openpgm, openswan, pango, pcre2, + perl-crypt-openssl-rsa, php, pixman, polkit, postgresql, + proxychains-ng, putty, python, python-django, + python-dataproperty, python-pysftp, python-urllib3, python3, + qpdf, redis, ripgrep, ruby, samba4, spice, slirp, suricata, + sysdig, tcpdump, tftpd, thrift, tor, tpm2-tools, trinity, + uboot, uboot-tools, uclibc, util-linux, vlc, wireless-regdb, + wireshark, wolfssl, xapp_fonttosfnt, xlib_libX11, + xlib_libxshmfence, xserver_xorg-server + + Issues resolved (http://bugs.uclibc.org): + + #13586: grub failure with BR2_OPTIMIZE_3 + #13661: host-python2 build fails on aarch64 + #13836: package build failure when target install set to no.. + #13846: BR2_PACKAGE_LVM2_STANDARD_INSTALL should be default to.. + 2021.02.3, released June 12th, 2021 Important / security related fixes. diff --git a/buildroot/Config.in b/buildroot/Config.in index 18a90b3f6..48c373af9 100644 --- a/buildroot/Config.in +++ b/buildroot/Config.in @@ -713,10 +713,17 @@ endmenu comment "Security Hardening Options" -config BR2_PIC_PIE - bool "Build code with PIC/PIE" +config BR2_PIC_PIE_ARCH_SUPPORTS + bool + default y + # Microblaze glibc toolchains don't work with PIC/PIE enabled + depends on !BR2_microblaze # Nios2 toolchains produce non working binaries with -fPIC depends on !BR2_nios2 + +config BR2_PIC_PIE + bool "Build code with PIC/PIE" + depends on BR2_PIC_PIE_ARCH_SUPPORTS depends on BR2_SHARED_LIBS depends on BR2_TOOLCHAIN_SUPPORTS_PIE help @@ -724,7 +731,7 @@ config BR2_PIC_PIE Position-Independent Executables (PIE). comment "PIC/PIE needs a toolchain w/ PIE" - depends on !BR2_nios2 + depends on BR2_PIC_PIE_ARCH_SUPPORTS depends on BR2_SHARED_LIBS depends on !BR2_TOOLCHAIN_SUPPORTS_PIE @@ -811,7 +818,7 @@ config BR2_RELRO_PARTIAL config BR2_RELRO_FULL bool "Full" - depends on !BR2_nios2 # BR2_PIC_PIE + depends on BR2_PIC_PIE_ARCH_SUPPORTS depends on BR2_TOOLCHAIN_SUPPORTS_PIE select BR2_PIC_PIE help @@ -820,7 +827,7 @@ config BR2_RELRO_FULL program loading, i.e every time an executable is started. comment "RELRO Full needs a toolchain w/ PIE" - depends on !BR2_nios2 + depends on BR2_PIC_PIE_ARCH_SUPPORTS depends on !BR2_TOOLCHAIN_SUPPORTS_PIE endchoice diff --git a/buildroot/DEVELOPERS b/buildroot/DEVELOPERS index a5b325626..3b18c5683 100644 --- a/buildroot/DEVELOPERS +++ b/buildroot/DEVELOPERS @@ -122,10 +122,7 @@ F: package/python-docopt/ N: Anders Darander F: package/ktap/ -N: André Hentschel -F: board/freescale/imx8qxpmek/ -F: configs/freescale_imx8qxpmek_defconfig -F: package/freescale-imx/imx-sc-firmware/ +N: André Zwing F: package/libkrb5/ F: package/openal/ F: package/p7zip/ @@ -180,6 +177,9 @@ F: package/sshguard/ F: package/sunwait/ F: package/sysdig/ +N: Andy Shevchenko +F: package/fb-test-app/ + N: Anisse Astier F: package/go/ F: package/nghttp2/ @@ -519,7 +519,7 @@ F: package/rtl8821au/ F: package/runc/ F: package/tini/ -N: Christophe Priouzeau +N: Christophe Priouzeau F: board/stmicroelectronics/stm32f429-disco/ F: board/stmicroelectronics/stm32f469-disco/ F: configs/stm32f429_disco_defconfig @@ -1024,12 +1024,14 @@ F: package/xapian/ N: Giulio Benetti F: package/at/ +F: package/libfuse3/ F: package/libnspr/ F: package/libnss/ F: package/minicom/ F: package/nfs-utils/ F: package/sunxi-mali-mainline/ F: package/sunxi-mali-mainline-driver/ +F: package/udisks/ N: Gregory Dymarek F: package/ding-libs/ @@ -1238,11 +1240,6 @@ F: package/sysrepo/ N: Jan Pedersen F: package/zip/ -N: Jan Viktorin -F: package/python-pexpect/ -F: package/python-ptyprocess/ -F: package/zynq-boot-bin/ - N: Jarkko Sakkinen F: package/quota/ @@ -2134,6 +2131,7 @@ F: package/libtirpc/ F: package/linux-backports/ F: package/ltp-testsuite/ F: package/nfs-utils/ +F: package/rpcbind/ F: support/kconfig/ N: Phil Eichinger @@ -2211,7 +2209,7 @@ F: package/nanomsg/ N: Ramon Fried F: package/bitwise/ -N: Raphaël Mélotte +N: Raphaël Mélotte F: package/jbig2dec/ F: package/python-boto3/ F: package/python-botocore/ @@ -2726,9 +2724,6 @@ F: package/casync/ F: package/gloox/ F: package/tpm2-pkcs11/ -N: Yann CARDAILLAC -F: package/open62541/ - N: Yann E. MORIN F: board/friendlyarm/nanopi-neo/ F: configs/friendlyarm_nanopi_neo_defconfig diff --git a/buildroot/Makefile b/buildroot/Makefile index 7e896e907..c6be0ca7d 100644 --- a/buildroot/Makefile +++ b/buildroot/Makefile @@ -92,9 +92,9 @@ all: .PHONY: all # Set and export the version string -export BR2_VERSION := 2021.02.3 +export BR2_VERSION := 2021.02.4 # Actual time the release is cut (for reproducible builds) -BR2_VERSION_EPOCH = 1623509900 +BR2_VERSION_EPOCH = 1628627000 # Save running make version since it's clobbered by the make package RUNNING_MAKE_VERSION := $(MAKE_VERSION) @@ -1140,6 +1140,7 @@ help: @echo ' -dirclean - Remove build directory' @echo ' -reconfigure - Restart the build from the configure step' @echo ' -rebuild - Restart the build from the build step' + @echo ' -reinstall - Restart the build from the install step' $(foreach p,$(HELP_PACKAGES), \ @echo $(sep) \ @echo '$($(p)_NAME):' $(sep) \ diff --git a/buildroot/board/stmicroelectronics/stm32f469-disco/extlinux.conf b/buildroot/board/stmicroelectronics/stm32f469-disco/extlinux.conf new file mode 100644 index 000000000..1c2db4383 --- /dev/null +++ b/buildroot/board/stmicroelectronics/stm32f469-disco/extlinux.conf @@ -0,0 +1,4 @@ +label stm32f469-disco-buildroot + kernel /zImage + devicetree /stm32f469-disco.dtb + append console=ttySTM0,115200 root=/dev/mmcblk0p2 rw rootfstype=ext2 rootwait earlyprintk consoleblank=0 ignore_loglevel diff --git a/buildroot/board/stmicroelectronics/stm32f469-disco/flash.sh b/buildroot/board/stmicroelectronics/stm32f469-disco/flash.sh index 0ec0beb2d..984d2b259 100755 --- a/buildroot/board/stmicroelectronics/stm32f469-disco/flash.sh +++ b/buildroot/board/stmicroelectronics/stm32f469-disco/flash.sh @@ -13,8 +13,6 @@ ${OUTPUT_DIR}/host/bin/openocd -f board/stm32f469discovery.cfg \ -c "reset init" \ -c "flash probe 0" \ -c "flash info 0" \ - -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469i-disco.bin 0x08000000" \ - -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469-disco.dtb 0x08004000" \ - -c "flash write_image erase ${OUTPUT_DIR}/images/xipImage 0x08008000" \ + -c "flash write_image erase ${OUTPUT_DIR}/images/u-boot.bin 0x08000000" \ -c "reset run" \ -c "shutdown" diff --git a/buildroot/board/stmicroelectronics/stm32f469-disco/genimage.cfg b/buildroot/board/stmicroelectronics/stm32f469-disco/genimage.cfg new file mode 100644 index 000000000..bc945955f --- /dev/null +++ b/buildroot/board/stmicroelectronics/stm32f469-disco/genimage.cfg @@ -0,0 +1,27 @@ +image boot.vfat { + vfat { + files = { + "zImage", + "stm32f469-disco.dtb", + "extlinux" + } + } + size = 16M +} + +image sdcard.img { + hdimage { + } + + partition u-boot { + partition-type = 0xC + image = "boot.vfat" + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext2" + size = 32M + } +} + diff --git a/buildroot/board/stmicroelectronics/stm32f469-disco/linux.fragment b/buildroot/board/stmicroelectronics/stm32f469-disco/linux.fragment new file mode 100644 index 000000000..90f5e8a8f --- /dev/null +++ b/buildroot/board/stmicroelectronics/stm32f469-disco/linux.fragment @@ -0,0 +1 @@ +# CONFIG_XIP_KERNEL is not set \ No newline at end of file diff --git a/buildroot/board/stmicroelectronics/stm32f469-disco/patches/linux/0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch b/buildroot/board/stmicroelectronics/stm32f469-disco/patches/linux/0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch deleted file mode 100644 index 750e477df..000000000 --- a/buildroot/board/stmicroelectronics/stm32f469-disco/patches/linux/0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c8f8f33c2f0460a34c9545b01a7972a7ed2df0e9 Mon Sep 17 00:00:00 2001 -From: Christophe Priouzeau -Date: Mon, 29 May 2017 13:38:16 +0200 -Subject: [PATCH] ARM: stm32f249-disco: don't force init= in /chosen/bootargs - -There is no reason to override the kernel's default init= value, as -this breaks userspace that assumes the kernel default of /init is -used. Since stm32 is often used with a minimal bootloader -(afboot-stm32) that doesn't provide any mechanism to override the DTB, -we need to adjust the kernel command line in the Device Tree source. - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Christophe Priouzeau ---- - arch/arm/boot/dts/stm32f469-disco.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm/boot/dts/stm32f469-disco.dts b/arch/arm/boot/dts/stm32f469-disco.dts -index 0dd56ef..93ee1b2 100644 ---- a/arch/arm/boot/dts/stm32f469-disco.dts -+++ b/arch/arm/boot/dts/stm32f469-disco.dts -@@ -53,7 +53,7 @@ - compatible = "st,stm32f469i-disco", "st,stm32f469"; - - chosen { -- bootargs = "root=/dev/ram rdinit=/linuxrc"; -+ bootargs = "root=/dev/ram"; - stdout-path = "serial0:115200n8"; - }; - --- -2.7.4 - diff --git a/buildroot/board/stmicroelectronics/stm32f469-disco/post-build.sh b/buildroot/board/stmicroelectronics/stm32f469-disco/post-build.sh new file mode 100755 index 000000000..ec20fca7d --- /dev/null +++ b/buildroot/board/stmicroelectronics/stm32f469-disco/post-build.sh @@ -0,0 +1,4 @@ +#!/bin/sh +BOARD_DIR="$(dirname $0)" + +install -m 0644 -D $BOARD_DIR/extlinux.conf $BINARIES_DIR/extlinux/extlinux.conf diff --git a/buildroot/board/stmicroelectronics/stm32f469-disco/readme.txt b/buildroot/board/stmicroelectronics/stm32f469-disco/readme.txt index 888bff08a..c1e1d30e6 100644 --- a/buildroot/board/stmicroelectronics/stm32f469-disco/readme.txt +++ b/buildroot/board/stmicroelectronics/stm32f469-disco/readme.txt @@ -15,5 +15,17 @@ Flashing ./board/stmicroelectronics/stm32f469-disco/flash.sh output/ -It will flash the minimal bootloader, the Device Tree Blob, and the -kernel image which includes the root filesystem as initramfs. +It will flash the U-boot bootloader. + +Creating SD card +---------------- + +Buildroot prepares an"sdcard.img" image in the output/images/ directory, +ready to be dumped on a SD card. Launch the following command as root: + + dd if=output/images/sdcard.img of=/dev/ + +*** WARNING! This will destroy all the card content. Use with care! *** + +For details about the medium image layout and its content, see the +definition in board/stmicroelectronics/stm32f469-disco/genimage.cfg. diff --git a/buildroot/boot/arm-trusted-firmware/Config.in b/buildroot/boot/arm-trusted-firmware/Config.in index c06294040..26c12670d 100644 --- a/buildroot/boot/arm-trusted-firmware/Config.in +++ b/buildroot/boot/arm-trusted-firmware/Config.in @@ -175,4 +175,25 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN Select this option if your ATF board configuration requires an ARM32 bare metal toolchain to be available. +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP + bool "Build with SSP" + default y + depends on BR2_TOOLCHAIN_HAS_SSP + depends on !BR2_SSP_NONE + help + Say 'y' here if you want to build ATF with SSP. + + Your board must have SSP support in ATF: it must have an + implementation for plat_get_stack_protector_canary(). + + If you say 'y', the SSP level will be the level selected + by the global SSP setting. + +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP_LEVEL + string + default "none" if !BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP + default "default" if BR2_SSP_REGULAR + default "strong" if BR2_SSP_STRONG + default "all" if BR2_SSP_ALL + endif diff --git a/buildroot/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/buildroot/boot/arm-trusted-firmware/arm-trusted-firmware.mk index 0597cecf7..d06bc336e 100644 --- a/buildroot/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/buildroot/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -51,7 +51,8 @@ endif ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \ CROSS_COMPILE="$(TARGET_CROSS)" \ $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES)) \ - PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM) + PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM) \ + ENABLE_STACK_PROTECTOR=$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP_LEVEL)) ifeq ($(BR2_ARM_CPU_ARMV7A),y) ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARM_ARCH_MAJOR=7 @@ -100,14 +101,6 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR) ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell endif -ifeq ($(BR2_SSP_REGULAR),y) -ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ENABLE_STACK_PROTECTOR=default -else ifeq ($(BR2_SSP_STRONG),y) -ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ENABLE_STACK_PROTECTOR=strong -else ifeq ($(BR2_SSP_ALL),y) -ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ENABLE_STACK_PROTECTOR=all -endif - ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y) diff --git a/buildroot/boot/grub2/grub2.mk b/buildroot/boot/grub2/grub2.mk index af16ee91e..52e9199ae 100644 --- a/buildroot/boot/grub2/grub2.mk +++ b/buildroot/boot/grub2/grub2.mk @@ -118,9 +118,11 @@ HOST_GRUB2_CONF_ENV = \ GRUB2_CONF_ENV = \ CPP="$(TARGET_CC) -E" \ TARGET_CC="$(TARGET_CC)" \ - TARGET_CFLAGS="$(TARGET_CFLAGS)" \ - TARGET_CPPFLAGS="$(TARGET_CPPFLAGS) -fno-stack-protector" \ - TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \ + CFLAGS="$(TARGET_CFLAGS) -Os" \ + TARGET_CFLAGS="$(TARGET_CFLAGS) -Os" \ + CPPFLAGS="$(TARGET_CPPFLAGS) -Os -fno-stack-protector" \ + TARGET_CPPFLAGS="$(TARGET_CPPFLAGS) -Os -fno-stack-protector" \ + TARGET_LDFLAGS="$(TARGET_LDFLAGS) -Os" \ TARGET_NM="$(TARGET_NM)" \ TARGET_OBJCOPY="$(TARGET_OBJCOPY)" \ TARGET_STRIP="$(TARGET_CROSS)strip" diff --git a/buildroot/boot/uboot/uboot.mk b/buildroot/boot/uboot/uboot.mk index dbe82e65b..a8a8bedc0 100644 --- a/buildroot/boot/uboot/uboot.mk +++ b/buildroot/boot/uboot/uboot.mk @@ -17,7 +17,7 @@ UBOOT_CPE_ID_PRODUCT = u-boot UBOOT_INSTALL_IMAGES = YES # u-boot 2020.01+ needs make 4.0+ -UBOOT_DEPENDENCIES = $(BR2_MAKE_HOST_DEPENDENCY) +UBOOT_DEPENDENCIES = host-pkgconf $(BR2_MAKE_HOST_DEPENDENCY) UBOOT_MAKE = $(BR2_MAKE) ifeq ($(UBOOT_VERSION),custom) @@ -307,6 +307,11 @@ define UBOOT_BUILD_CMDS cp -f $(UBOOT_CUSTOM_DTS_PATH) $(@D)/arch/$(UBOOT_ARCH)/dts/ ) $(TARGET_CONFIGURE_OPTS) \ + PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \ + PKG_CONFIG_SYSROOT_DIR="/" \ + PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \ + PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \ + PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/share/pkgconfig" \ $(UBOOT_MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) \ $(UBOOT_MAKE_TARGET) $(if $(BR2_TARGET_UBOOT_FORMAT_SD), diff --git a/buildroot/configs/microchip_sam9x60ek_mmc_dev_defconfig b/buildroot/configs/microchip_sam9x60ek_mmc_dev_defconfig index 6c3fcc6b3..8b6ecfb7e 100644 --- a/buildroot/configs/microchip_sam9x60ek_mmc_dev_defconfig +++ b/buildroot/configs/microchip_sam9x60ek_mmc_dev_defconfig @@ -1,6 +1,10 @@ BR2_arm=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y +BR2_TOOLCHAIN_BUILDROOT_WCHAR=y +BR2_PTHREAD_DEBUG=y +BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_TARGET_GENERIC_HOSTNAME="sam9x60ek" +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/microchip/sam9x60ek_mmc/genimage.cfg" BR2_LINUX_KERNEL=y diff --git a/buildroot/configs/stm32f469_disco_defconfig b/buildroot/configs/stm32f469_disco_defconfig index 9760d5187..e538a664e 100644 --- a/buildroot/configs/stm32f469_disco_defconfig +++ b/buildroot/configs/stm32f469_disco_defconfig @@ -1,19 +1,25 @@ BR2_arm=y BR2_cortex_m4=y -BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f469-disco/patches" -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_11=y -BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/common/stm32f4xx/stm32-post-build.sh" +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_12=y +BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/common/stm32f4xx/stm32-post-build.sh board/stmicroelectronics/stm32f469-disco/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32f469-disco/genimage.cfg" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.11" +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.12.11" BR2_LINUX_KERNEL_DEFCONFIG="stm32" -BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm/configs/dram_0x00000000.config" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm/configs/dram_0x00000000.config board/stmicroelectronics/stm32f469-disco/linux.fragment" BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y -BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="xipImage" +BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="zImage" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32f469-disco" BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config" -BR2_TARGET_ROOTFS_INITRAMFS=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_SIZE="32M" # BR2_TARGET_ROOTFS_TAR is not set -BR2_TARGET_AFBOOT_STM32=y +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32f469-discovery" +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_HOST_OPENOCD=y diff --git a/buildroot/docs/manual/manual.html b/buildroot/docs/manual/manual.html index bf02256cb..8919f2d5a 100644 --- a/buildroot/docs/manual/manual.html +++ b/buildroot/docs/manual/manual.html @@ -1,8 +1,8 @@ -The Buildroot user manual

The Buildroot user manual


Table of Contents

I. Getting started
1. About Buildroot
2. System requirements
2.1. Mandatory packages
2.2. Optional packages
3. Getting Buildroot
4. Buildroot quick start
5. Community resources
II. User guide
6. Buildroot configuration
6.1. Cross-compilation toolchain
6.2. /dev management
6.3. init system
7. Configuration of other components
8. General Buildroot usage
8.1. make tips
8.2. Understanding when a full rebuild is necessary
8.3. Understanding how to rebuild packages
8.4. Offline builds
8.5. Building out-of-tree
8.6. Environment variables
8.7. Dealing efficiently with filesystem images
8.8. Details about packages
8.9. Graphing the dependencies between packages
8.10. Graphing the build duration
8.11. Graphing the filesystem size contribution of packages
8.12. Top-level parallel build
8.13. Integration with Eclipse
8.14. Advanced usage
9. Project-specific customization
9.1. Recommended directory structure
9.2. Keeping customizations outside of Buildroot
9.3. Storing the Buildroot configuration
9.4. Storing the configuration of other components
9.5. Customizing the generated target filesystem
9.6. Adding custom user accounts
9.7. Customization after the images have been created
9.8. Adding project-specific patches
9.9. Adding project-specific packages
9.10. Quick guide to storing your project-specific customizations
10. Using SELinux in Buildroot
10.1. Enabling SELinux support
10.2. SELinux policy tweaking
11. Frequently Asked Questions & Troubleshooting
11.1. The boot hangs after Starting network…
11.2. Why is there no compiler on the target?
11.3. Why are there no development files on the target?
11.4. Why is there no documentation on the target?
11.5. Why are some packages not visible in the Buildroot config menu?
11.6. Why not use the target directory as a chroot directory?
11.7. Why doesn’t Buildroot generate binary packages (.deb, .ipkg…)?
11.8. How to speed-up the build process?
12. Known issues
13. Legal notice and licensing
13.1. Complying with open source licenses
13.2. Complying with the Buildroot license
14. Beyond Buildroot
14.1. Boot the generated images
14.2. Chroot
III. Developer guide
15. How Buildroot works
16. Coding style
16.1. Config.in file
16.2. The .mk file
16.3. The documentation
16.4. Support scripts
17. Adding support for a particular board
18. Adding new packages to Buildroot
18.1. Package directory
18.2. Config files
18.3. The .mk file
18.4. The .hash file
18.5. Infrastructure for packages with specific build systems
18.6. Infrastructure for autotools-based packages
18.7. Infrastructure for CMake-based packages
18.8. Infrastructure for Python packages
18.9. Infrastructure for LuaRocks-based packages
18.10. Infrastructure for Perl/CPAN packages
18.11. Infrastructure for virtual packages
18.12. Infrastructure for packages using kconfig for configuration files
18.13. Infrastructure for rebar-based packages
18.14. Infrastructure for Waf-based packages
18.15. Infrastructure for Meson-based packages
18.16. Integration of Cargo-based packages
18.17. Infrastructure for Go packages
18.18. Infrastructure for QMake-based packages
18.19. Infrastructure for packages building kernel modules
18.20. Infrastructure for asciidoc documents
18.21. Infrastructure specific to the Linux kernel package
18.22. Hooks available in the various build steps
18.23. Gettext integration and interaction with packages
18.24. Tips and tricks
18.25. Conclusion
19. Patching a package
19.1. Providing patches
19.2. How patches are applied
19.3. Format and licensing of the package patches
19.4. Integrating patches found on the Web
20. Download infrastructure
21. Debugging Buildroot
22. Contributing to Buildroot
22.1. Reproducing, analyzing and fixing bugs
22.2. Analyzing and fixing autobuild failures
22.3. Reviewing and testing patches
22.4. Work on items from the TODO list
22.5. Submitting patches
22.6. Reporting issues/bugs or getting help
22.7. Using the run-tests framework
23. DEVELOPERS file and get-developers
24. Release Engineering
24.1. Releases
24.2. Development
IV. Appendix
25. Makedev syntax documentation
26. Makeusers syntax documentation
27. Migrating from older Buildroot versions
27.1. Migrating to 2016.11
27.2. Migrating to 2017.08

Buildroot 2021.02.3 manual generated on 2021-06-12 -15:00:38 UTC from git revision 5293208a57

The Buildroot manual is written by the Buildroot developers. +The Buildroot user manual

The Buildroot user manual


Table of Contents

I. Getting started
1. About Buildroot
2. System requirements
2.1. Mandatory packages
2.2. Optional packages
3. Getting Buildroot
4. Buildroot quick start
5. Community resources
II. User guide
6. Buildroot configuration
6.1. Cross-compilation toolchain
6.2. /dev management
6.3. init system
7. Configuration of other components
8. General Buildroot usage
8.1. make tips
8.2. Understanding when a full rebuild is necessary
8.3. Understanding how to rebuild packages
8.4. Offline builds
8.5. Building out-of-tree
8.6. Environment variables
8.7. Dealing efficiently with filesystem images
8.8. Details about packages
8.9. Graphing the dependencies between packages
8.10. Graphing the build duration
8.11. Graphing the filesystem size contribution of packages
8.12. Top-level parallel build
8.13. Integration with Eclipse
8.14. Advanced usage
9. Project-specific customization
9.1. Recommended directory structure
9.2. Keeping customizations outside of Buildroot
9.3. Storing the Buildroot configuration
9.4. Storing the configuration of other components
9.5. Customizing the generated target filesystem
9.6. Adding custom user accounts
9.7. Customization after the images have been created
9.8. Adding project-specific patches
9.9. Adding project-specific packages
9.10. Quick guide to storing your project-specific customizations
10. Using SELinux in Buildroot
10.1. Enabling SELinux support
10.2. SELinux policy tweaking
11. Frequently Asked Questions & Troubleshooting
11.1. The boot hangs after Starting network…
11.2. Why is there no compiler on the target?
11.3. Why are there no development files on the target?
11.4. Why is there no documentation on the target?
11.5. Why are some packages not visible in the Buildroot config menu?
11.6. Why not use the target directory as a chroot directory?
11.7. Why doesn’t Buildroot generate binary packages (.deb, .ipkg…)?
11.8. How to speed-up the build process?
12. Known issues
13. Legal notice and licensing
13.1. Complying with open source licenses
13.2. Complying with the Buildroot license
14. Beyond Buildroot
14.1. Boot the generated images
14.2. Chroot
III. Developer guide
15. How Buildroot works
16. Coding style
16.1. Config.in file
16.2. The .mk file
16.3. The documentation
16.4. Support scripts
17. Adding support for a particular board
18. Adding new packages to Buildroot
18.1. Package directory
18.2. Config files
18.3. The .mk file
18.4. The .hash file
18.5. Infrastructure for packages with specific build systems
18.6. Infrastructure for autotools-based packages
18.7. Infrastructure for CMake-based packages
18.8. Infrastructure for Python packages
18.9. Infrastructure for LuaRocks-based packages
18.10. Infrastructure for Perl/CPAN packages
18.11. Infrastructure for virtual packages
18.12. Infrastructure for packages using kconfig for configuration files
18.13. Infrastructure for rebar-based packages
18.14. Infrastructure for Waf-based packages
18.15. Infrastructure for Meson-based packages
18.16. Integration of Cargo-based packages
18.17. Infrastructure for Go packages
18.18. Infrastructure for QMake-based packages
18.19. Infrastructure for packages building kernel modules
18.20. Infrastructure for asciidoc documents
18.21. Infrastructure specific to the Linux kernel package
18.22. Hooks available in the various build steps
18.23. Gettext integration and interaction with packages
18.24. Tips and tricks
18.25. Conclusion
19. Patching a package
19.1. Providing patches
19.2. How patches are applied
19.3. Format and licensing of the package patches
19.4. Integrating patches found on the Web
20. Download infrastructure
21. Debugging Buildroot
22. Contributing to Buildroot
22.1. Reproducing, analyzing and fixing bugs
22.2. Analyzing and fixing autobuild failures
22.3. Reviewing and testing patches
22.4. Work on items from the TODO list
22.5. Submitting patches
22.6. Reporting issues/bugs or getting help
22.7. Using the run-tests framework
23. DEVELOPERS file and get-developers
24. Release Engineering
24.1. Releases
24.2. Development
IV. Appendix
25. Makedev syntax documentation
26. Makeusers syntax documentation
27. Migrating from older Buildroot versions
27.1. Migrating to 2016.11
27.2. Migrating to 2017.08

Buildroot 2021.02.4 manual generated on 2021-08-10 +20:33:48 UTC from git revision 004a792dcf

The Buildroot manual is written by the Buildroot developers. It is licensed under the GNU General Public License, version 2. Refer to the -COPYING +COPYING file in the Buildroot sources for the full text of this license.

Copyright © 2004-2020 The Buildroot developers

logo.png

Part I. Getting started

Chapter 1. About Buildroot

Buildroot is a tool that simplifies and automates the process of building a complete Linux system for an embedded system, using cross-compilation.

In order to achieve this, Buildroot is able to generate a @@ -218,16 +218,14 @@ main method of interaction for Buildroot users and developers.

Mails that are sent to the mailing list are also available in the -mailing list archives and -via Gmane, at -gmane.comp.lib.uclibc.buildroot. -Please search the mailing list archives before asking questions, since -there is a good chance someone else has asked the same question before.

+mailing list archives, available through +Mailman or at +lore.kernel.org.

IRC

The Buildroot IRC channel #buildroot is hosted on OFTC. It is a useful place to ask quick questions or discuss on certain topics.

When asking for help on IRC, share relevant logs or pieces of code -using a code sharing website, such as http://code.bulix.org.

Note that for certain questions, posting to the mailing list may be +using a code sharing website, such as https://paste.ack.tf/.

Note that for certain questions, posting to the mailing list may be better as it will reach more people, both developers and users.

Bug tracker
Bugs in Buildroot can be reported via the mailing list or alternatively @@ -277,7 +275,7 @@ processor. Under most Linux systems, the compilation toolchain uses the GNU libc (glibc) as the C standard library. This compilation toolchain is called the "host compilation toolchain". The machine on which it is running, and on which you’re working, is called the "host -system" [3].

The compilation toolchain is provided by your distribution, and +system" [3].

The compilation toolchain is provided by your distribution, and Buildroot has nothing to do with it (other than using it to build a cross-compilation toolchain and other tools that are run on the development host).

As said above, the compilation toolchain that comes with your system @@ -581,7 +579,7 @@ The third solution is systemd. http://www.freedesktop.org/wiki/Software/systemd.

The solution recommended by Buildroot developers is to use the BusyBox init as it is sufficient for most embedded -systems. systemd can be used for more complex situations.



[3] This terminology differs from what is used by GNU +systems. systemd can be used for more complex situations.



[3] This terminology differs from what is used by GNU configure, where the host is the machine on which the application will run (which is usually the same as target)

Chapter 7. Configuration of other components

Before attempting to modify any of the components below, make sure you have already configured Buildroot itself, and have enabled the @@ -2967,7 +2965,7 @@ flags. The argument to be given to LIBFOO_CONFIG_SCRIPTS is the file name(s) of the shell script(s) needing fixing. All these names are relative to $(STAGING_DIR)/usr/bin and if needed multiple names can be given.

In addition, the scripts listed in LIBFOO_CONFIG_SCRIPTS are removed -from $(TARGET_DIR)/usr/bin, since they are not needed on the target.

Example 18.1. Config script: divine package

Package divine installs shell script $(STAGING_DIR)/usr/bin/divine-config.

So its fixup would be:

DIVINE_CONFIG_SCRIPTS = divine-config

Example 18.2. Config script: imagemagick package:

Package imagemagick installs the following scripts: +from $(TARGET_DIR)/usr/bin, since they are not needed on the target.

Example 18.1. Config script: divine package

Package divine installs shell script $(STAGING_DIR)/usr/bin/divine-config.

So its fixup would be:

DIVINE_CONFIG_SCRIPTS = divine-config

Example 18.2. Config script: imagemagick package:

Package imagemagick installs the following scripts: $(STAGING_DIR)/usr/bin/{Magick,Magick++,MagickCore,MagickWand,Wand}-config

So it’s fixup would be:

IMAGEMAGICK_CONFIG_SCRIPTS = \
    Magick-config Magick++-config \
    MagickCore-config MagickWand-config Wand-config

On line 14, we specify the list of dependencies this package relies @@ -5443,7 +5441,7 @@ large number of commits in the series;

  • deep impact of the changes in the rest of the project;
  • -RFC [4]; +RFC [4];
  • whenever you feel it will help presenting your work, your choices, the review process, etc. @@ -5657,7 +5655,7 @@ to trigger all run-test test case jobs:
  •  $ git push gitlab HEAD:<name>-runtime-tests
    • to trigger one test case job, a specific branch naming string is used that includes the full test case name. -
     $ git push gitlab HEAD:<name>-<test case name>


    [4] RFC: (Request for comments) change proposal

    Chapter 23. DEVELOPERS file and get-developers

    The main Buildroot directory contains a file named DEVELOPERS that +

     $ git push gitlab HEAD:<name>-<test case name>


    [4] RFC: (Request for comments) change proposal

    Chapter 23. DEVELOPERS file and get-developers

    The main Buildroot directory contains a file named DEVELOPERS that lists the developers involved with various areas of Buildroot. Thanks to this file, the get-developers tool allows to:

    • Calculate the list of developers to whom patches should be sent, by diff --git a/buildroot/docs/manual/manual.pdf b/buildroot/docs/manual/manual.pdf index dc9f63ccc..9464614f6 100644 Binary files a/buildroot/docs/manual/manual.pdf and b/buildroot/docs/manual/manual.pdf differ diff --git a/buildroot/docs/manual/manual.text b/buildroot/docs/manual/manual.text index 7b018d584..4a303d2d5 100644 --- a/buildroot/docs/manual/manual.text +++ b/buildroot/docs/manual/manual.text @@ -174,13 +174,13 @@ List of Examples --------------------------------------------------------------------- -Buildroot 2021.02.3 manual generated on 2021-06-12 15:00:43 UTC from -git revision 5293208a57 +Buildroot 2021.02.4 manual generated on 2021-08-10 20:33:55 UTC from +git revision 004a792dcf The Buildroot manual is written by the Buildroot developers. It is licensed under the GNU General Public License, version 2. Refer to the COPYING [http://git.buildroot.org/buildroot/tree/COPYING?id= -5293208a57ce78f9fc958704d7df52f28532cde6] file in the Buildroot +004a792dcf10e6c474070c9571f7504411e786cc] file in the Buildroot sources for the full text of this license. Copyright © 2004-2020 The Buildroot developers @@ -479,12 +479,9 @@ Mailing List page [http://lists.buildroot.org/mailman/listinfo/buildroot]. Mails that are sent to the mailing list are also available in the - mailing list archives [http://lists.buildroot.org/pipermail/ - buildroot] and via Gmane [http://gmane.org], at - gmane.comp.lib.uclibc.buildroot [http://dir.gmane.org/ - gmane.comp.lib.uclibc.buildroot]. Please search the mailing list - archives before asking questions, since there is a good chance - someone else has asked the same question before. + mailing list archives, available through Mailman [http:// + lists.buildroot.org/pipermail/buildroot] or at lore.kernel.org + [https://lore.kernel.org/buildroot/]. IRC @@ -494,7 +491,7 @@ IRC topics. When asking for help on IRC, share relevant logs or pieces of - code using a code sharing website, such as http://code.bulix.org. + code using a code sharing website, such as https://paste.ack.tf/. Note that for certain questions, posting to the mailing list may be better as it will reach more people, both developers and diff --git a/buildroot/docs/manual/resources.txt b/buildroot/docs/manual/resources.txt index 374cdef94..e90a49b2a 100644 --- a/buildroot/docs/manual/resources.txt +++ b/buildroot/docs/manual/resources.txt @@ -21,11 +21,9 @@ http://lists.buildroot.org/mailman/listinfo/buildroot[mailing list info page]. + Mails that are sent to the mailing list are also available in the -http://lists.buildroot.org/pipermail/buildroot[mailing list archives] and -via http://gmane.org[Gmane], at -http://dir.gmane.org/gmane.comp.lib.uclibc.buildroot[+gmane.comp.lib.uclibc.buildroot+]. -Please search the mailing list archives before asking questions, since -there is a good chance someone else has asked the same question before. +mailing list archives, available through +http://lists.buildroot.org/pipermail/buildroot[Mailman] or at +https://lore.kernel.org/buildroot/[lore.kernel.org]. IRC:: + @@ -34,7 +32,7 @@ hosted on https://www.oftc.net/WebChat/[OFTC]. It is a useful place to ask quick questions or discuss on certain topics. + When asking for help on IRC, share relevant logs or pieces of code -using a code sharing website, such as http://code.bulix.org. +using a code sharing website, such as https://paste.ack.tf/. + Note that for certain questions, posting to the mailing list may be better as it will reach more people, both developers and users. diff --git a/buildroot/linux/Config.in b/buildroot/linux/Config.in index d8897ccc8..be1a850cc 100644 --- a/buildroot/linux/Config.in +++ b/buildroot/linux/Config.in @@ -125,7 +125,7 @@ endif config BR2_LINUX_KERNEL_VERSION string - default "5.10.43" if BR2_LINUX_KERNEL_LATEST_VERSION + default "5.10.57" if BR2_LINUX_KERNEL_LATEST_VERSION default "4.19.182-cip45" if BR2_LINUX_KERNEL_LATEST_CIP_VERSION default "4.19.165-cip41-rt18" if BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE \ diff --git a/buildroot/linux/linux.hash b/buildroot/linux/linux.hash index 3944f371d..2b0240e0a 100644 --- a/buildroot/linux/linux.hash +++ b/buildroot/linux/linux.hash @@ -1,11 +1,11 @@ # From https://www.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc -sha256 83b81e433ba2f8ee143064fb163699ee857e26dd789006bc1e9edf1ccd0bd403 linux-5.10.43.tar.xz -sha256 17ee750a4aeb1c883d721e730d1f7e2855124585e2f47766864a1359a7ebe33c linux-5.4.125.tar.xz +sha256 00bbaeaac17f82d9a6d93cbc42cafd39d3b2fa3a6087333503d2344fa5e3142d linux-5.10.57.tar.xz +sha256 0471d0ccb7953cdae7d235192588ac5d72344851969962676d1703e69084a37f linux-5.4.139.tar.xz # From https://www.kernel.org/pub/linux/kernel/v4.x/sha256sums.asc -sha256 d13fa552be602825c443fcca90d6bdd72f4ebef809889ef015dba4593d3224ab linux-4.4.272.tar.xz -sha256 f8bf0c390ae40ca736e104f10f744446bc534bf87ba1b6dbb2b7c9a8bece1058 linux-4.9.272.tar.xz -sha256 e4eae297a6fefefd8ce4781d98178a7c1ee51ca0a4c8a7e46e61b121fbab8b2a linux-4.14.236.tar.xz -sha256 aaaebdccf599f77148fe170642fa7dc2452cf994b5cbbb4d39cab9e7f4058896 linux-4.19.194.tar.xz +sha256 4bdf66494be66a1da857f09b40b95026a0388e373fb01a206c60f67834746cb4 linux-4.4.279.tar.xz +sha256 21edb57dea0fe04a51fcfb6d4e8c0c052787a20015bc74a0a0e63329601f2e07 linux-4.9.279.tar.xz +sha256 7f235d454d703112e86574150652807f42abead92f3837da32ea86b4f148b371 linux-4.14.243.tar.xz +sha256 f2827d0506622fcae0dae0bc72b2f016469210f50c2d3dd1bdd1211a813dca27 linux-4.19.202.tar.xz # Locally computed sha256 9f1de83c5c2bb582a33bd4ee892d45671901cd06af9dc159f0f499f1b5265b20 linux-cip-4.19.182-cip45.tar.gz sha256 0eeba6d6ecc45cf8f16458842b64d22e7064b9de9c31c11d1c395b08a47e3855 linux-cip-4.19.165-cip41-rt18.tar.gz diff --git a/buildroot/package/apache/apache.mk b/buildroot/package/apache/apache.mk index 7dbd1a451..403dc0f76 100644 --- a/buildroot/package/apache/apache.mk +++ b/buildroot/package/apache/apache.mk @@ -11,6 +11,7 @@ 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, diff --git a/buildroot/package/audit/S02auditd b/buildroot/package/audit/S02auditd index 2ecf0f1df..0eef881ce 100644 --- a/buildroot/package/audit/S02auditd +++ b/buildroot/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/buildroot/package/avahi/0001-Fix-NULL-pointer-crashes-from-175.patch b/buildroot/package/avahi/0001-Fix-NULL-pointer-crashes-from-175.patch new file mode 100644 index 000000000..7e191e8da --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/avahi/avahi.mk b/buildroot/package/avahi/avahi.mk index b71fc189a..9de6ebc4d 100644 --- a/buildroot/package/avahi/avahi.mk +++ b/buildroot/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/buildroot/package/bind/bind.mk b/buildroot/package/bind/bind.mk index d01a55760..a5c246a54 100644 --- a/buildroot/package/bind/bind.mk +++ b/buildroot/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/buildroot/package/binutils/2.32/0010-bfd-elf32-or1k-fix-ld-assert.patch b/buildroot/package/binutils/2.32/0010-bfd-elf32-or1k-fix-ld-assert.patch deleted file mode 100644 index 824c9ce3e..000000000 --- a/buildroot/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 -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 ---- - 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/buildroot/package/binutils/2.32/0010-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch b/buildroot/package/binutils/2.32/0010-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch new file mode 100644 index 000000000..a67d12789 --- /dev/null +++ b/buildroot/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 +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 +Signed-off-by: Giulio Benetti +--- + 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/buildroot/package/binutils/2.32/0011-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch b/buildroot/package/binutils/2.32/0011-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch new file mode 100644 index 000000000..5a2b91fe8 --- /dev/null +++ b/buildroot/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 +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 + +fixup reloc, add tests + +Signed-off-by: Giulio Benetti +--- + 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/buildroot/package/binutils/2.32/0012-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch b/buildroot/package/binutils/2.32/0012-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch new file mode 100644 index 000000000..adc6f5f8b --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/binutils/2.32/0013-or1k-Support-large-plt_relocs-when-generating-plt-en.patch b/buildroot/package/binutils/2.32/0013-or1k-Support-large-plt_relocs-when-generating-plt-en.patch new file mode 100644 index 000000000..dc0431e0a --- /dev/null +++ b/buildroot/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 +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 +--- + 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]+ : ++ +[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]+ ++ +[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/buildroot/package/binutils/2.32/0014-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch b/buildroot/package/binutils/2.32/0014-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch new file mode 100644 index 000000000..c3978e22f --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/buildroot/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch new file mode 100644 index 000000000..585b97b2a --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/binutils/2.34/0003-bfd-elf32-or1k-fix-ld-assert.patch b/buildroot/package/binutils/2.34/0003-bfd-elf32-or1k-fix-ld-assert.patch deleted file mode 100644 index 756493667..000000000 --- a/buildroot/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 -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 ---- - 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/buildroot/package/binutils/2.34/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch b/buildroot/package/binutils/2.34/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch new file mode 100644 index 000000000..bc0ef2b22 --- /dev/null +++ b/buildroot/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 +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 +Signed-off-by: Giulio Benetti +--- + 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/buildroot/package/binutils/2.34/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch b/buildroot/package/binutils/2.34/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch new file mode 100644 index 000000000..5edef90e1 --- /dev/null +++ b/buildroot/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 +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 + +fixup reloc, add tests + +Signed-off-by: Giulio Benetti +--- + 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/buildroot/package/binutils/2.34/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch b/buildroot/package/binutils/2.34/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch new file mode 100644 index 000000000..e292c9cb4 --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/binutils/2.34/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch b/buildroot/package/binutils/2.34/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch new file mode 100644 index 000000000..d6695d415 --- /dev/null +++ b/buildroot/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 +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 +--- + 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]+ : ++ +[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]+ ++ +[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/buildroot/package/binutils/2.34/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch b/buildroot/package/binutils/2.34/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch new file mode 100644 index 000000000..c3978e22f --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/buildroot/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch new file mode 100644 index 000000000..585b97b2a --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/binutils/2.35.2/0003-bfd-elf32-or1k-fix-ld-assert.patch b/buildroot/package/binutils/2.35.2/0003-bfd-elf32-or1k-fix-ld-assert.patch deleted file mode 100644 index 756493667..000000000 --- a/buildroot/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 -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 ---- - 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/buildroot/package/binutils/2.35.2/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch b/buildroot/package/binutils/2.35.2/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch new file mode 100644 index 000000000..81fb6b851 --- /dev/null +++ b/buildroot/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 +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 +Signed-off-by: Giulio Benetti +--- + 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/buildroot/package/binutils/2.35.2/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch b/buildroot/package/binutils/2.35.2/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch new file mode 100644 index 000000000..a4af57d54 --- /dev/null +++ b/buildroot/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 +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 + +fixup reloc, add tests + +Signed-off-by: Giulio Benetti +--- + 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/buildroot/package/binutils/2.35.2/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch b/buildroot/package/binutils/2.35.2/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch new file mode 100644 index 000000000..82198dd37 --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/binutils/2.35.2/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch b/buildroot/package/binutils/2.35.2/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch new file mode 100644 index 000000000..c884ab874 --- /dev/null +++ b/buildroot/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 +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 +--- + 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]+ : ++ +[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]+ ++ +[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/buildroot/package/binutils/2.35.2/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch b/buildroot/package/binutils/2.35.2/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch new file mode 100644 index 000000000..c3978e22f --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/buildroot/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch new file mode 100644 index 000000000..585b97b2a --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/binutils/2.36.1/0003-bfd-elf32-or1k-fix-ld-assert.patch b/buildroot/package/binutils/2.36.1/0003-bfd-elf32-or1k-fix-ld-assert.patch deleted file mode 100644 index 756493667..000000000 --- a/buildroot/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 -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 ---- - 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/buildroot/package/binutils/2.36.1/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch b/buildroot/package/binutils/2.36.1/0003-or1k-Fix-issue-with-plt-link-failure-for-local-calls.patch new file mode 100644 index 000000000..85931ff66 --- /dev/null +++ b/buildroot/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 +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 +Signed-off-by: Giulio Benetti +--- + 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/buildroot/package/binutils/2.36.1/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch b/buildroot/package/binutils/2.36.1/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch new file mode 100644 index 000000000..08c23d276 --- /dev/null +++ b/buildroot/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 +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 + +fixup reloc, add tests + +Signed-off-by: Giulio Benetti +--- + 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/buildroot/package/binutils/2.36.1/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch b/buildroot/package/binutils/2.36.1/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch new file mode 100644 index 000000000..618072fb1 --- /dev/null +++ b/buildroot/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 +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 +--- + 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/buildroot/package/binutils/2.36.1/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch b/buildroot/package/binutils/2.36.1/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch new file mode 100644 index 000000000..6d50852fe --- /dev/null +++ b/buildroot/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 +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 +--- + 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); +- 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; + } +@@ -2389,7 +2420,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; +@@ -2401,6 +2433,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. */ +@@ -2418,10 +2451,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. */ +@@ -2433,27 +2469,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 +@@ -2777,11 +2843,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; + +@@ -2798,7 +2869,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]+ : ++ +[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]+ ++ +[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 8bb943aacc9..f10949e89aa 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/buildroot/package/binutils/2.36.1/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch b/buildroot/package/binutils/2.36.1/0007-bfd-elf32-or1k-fix-building-with-gcc-version-5.patch new file mode 100644 index 000000000..c3978e22f --- /dev/null +++ b/buildroot/package/binutils/2.36.1/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 +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 +--- + 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/buildroot/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/buildroot/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch new file mode 100644 index 000000000..585b97b2a --- /dev/null +++ b/buildroot/package/binutils/2.36.1/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 +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 +--- + 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/buildroot/package/bird/bird.mk b/buildroot/package/bird/bird.mk index b711e7de0..4d4dfe1dc 100644 --- a/buildroot/package/bird/bird.mk +++ b/buildroot/package/bird/bird.mk @@ -9,6 +9,7 @@ BIRD_SITE = ftp://bird.network.cz/pub/bird BIRD_LICENSE = GPL-2.0+ BIRD_LICENSE_FILES = README BIRD_CPE_ID_VENDOR = nic +BIRD_SELINUX_MODULES = bird BIRD_DEPENDENCIES = host-flex host-bison ifeq ($(BR2_PACKAGE_BIRD_CLIENT),y) diff --git a/buildroot/package/bluez5_utils/Config.in b/buildroot/package/bluez5_utils/Config.in index 016a16c4c..2c8625a66 100644 --- a/buildroot/package/bluez5_utils/Config.in +++ b/buildroot/package/bluez5_utils/Config.in @@ -1,5 +1,5 @@ config BR2_PACKAGE_BLUEZ5_UTILS - bool "bluez-utils 5.x" + bool "bluez-utils" depends on BR2_USE_WCHAR # libglib2 depends on BR2_TOOLCHAIN_HAS_THREADS # dbus, libglib2 depends on BR2_USE_MMU # dbus @@ -9,17 +9,12 @@ config BR2_PACKAGE_BLUEZ5_UTILS select BR2_PACKAGE_DBUS select BR2_PACKAGE_LIBGLIB2 help - bluez utils version 5.x + BlueZ utils - With this release BlueZ only supports the new Bluetooth - Management kernel interface (introduced in Linux 3.4). + Provides Stack, Library and Tooling for Bluetooth Classic + and Bluetooth LE. - For Low Energy support at least kernel version 3.5 is - needed. - - The API is not backward compatible with BlueZ 4. - - Bluez utils will use systemd and/or udev if enabled. + BlueZ utils will use systemd and/or udev if enabled. http://www.bluez.org http://www.kernel.org/pub/linux/bluetooth @@ -31,7 +26,7 @@ config BR2_PACKAGE_BLUEZ5_UTILS_OBEX depends on BR2_INSTALL_LIBSTDCPP select BR2_PACKAGE_LIBICAL help - Enable the OBEX support in Bluez 5.x. + Enable OBEX support. comment "OBEX support needs a toolchain w/ C++" depends on !BR2_INSTALL_LIBSTDCPP @@ -40,75 +35,77 @@ config BR2_PACKAGE_BLUEZ5_UTILS_CLIENT bool "build CLI client" select BR2_PACKAGE_READLINE help - Enable the Bluez 5.x command line client. + Build the command line client "bluetoothctl". config BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED - bool "install deprecated tool" + bool "install deprecated tools" depends on BR2_PACKAGE_BLUEZ5_UTILS_CLIENT help - Build BlueZ 5.x deprecated tools. These currently include: + Build deprecated tools. These currently include: hciattach, hciconfig, hcitool, hcidump, rfcomm, sdptool, ciptool, gatttool. config BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL - bool "build experimental obexd plugin" + bool "build experimental tools" help - Build BlueZ 5.x experimental Nokia OBEX PC Suite plugin + Build experimental tools. This is currently only the + "Nokia OBEX PC Suite tool". So, only if OBEX support is + enabled this option has an effect. config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HEALTH bool "build health plugin" help - Build BlueZ 5.x health plugin + Build plugin for health profiles. config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_MESH - bool "build mesh profile" + bool "build mesh plugin" depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12 # ell select BR2_PACKAGE_ELL select BR2_PACKAGE_JSON_C select BR2_PACKAGE_READLINE help - Build BlueZ 5.x mesh plugin + Build plugin for Mesh support. comment "mesh profile needs a toolchain w/ headers >= 4.12" depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12 config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_MIDI - bool "build midi profile" + bool "build midi plugin" select BR2_PACKAGE_ALSA_LIB select BR2_PACKAGE_ALSA_LIB_SEQ help - Build BlueZ 5.x midi plugin + Build MIDI support via ALSA sequencer. config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_NFC bool "build nfc plugin" help - Build BlueZ 5.x nfc plugin + Build plugin for NFC pairing. config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_SAP bool "build sap plugin" help - Build BlueZ 5.x sap plugin + Build plugin for SAP profile. config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_SIXAXIS bool "build sixaxis plugin" depends on BR2_PACKAGE_HAS_UDEV help - Build BlueZ 5.x sixaxis plugin (support Sony Dualshock + Build sixaxis plugin (support Sony Dualshock controller) comment "sixaxis plugin needs udev /dev management" depends on !BR2_PACKAGE_HAS_UDEV config BR2_PACKAGE_BLUEZ5_UTILS_TEST - bool "build tests" + bool "install test scripts" help - Build BlueZ 5.x tests + Install the python test scripts from the "test" directory. config BR2_PACKAGE_BLUEZ5_UTILS_TOOLS_HID2HCI bool "build hid2hci tool" depends on BR2_PACKAGE_HAS_UDEV help - Build BlueZ 5.x hid2hci tool + Build hid2hci tool comment "hid2hci tool needs udev /dev management" depends on !BR2_PACKAGE_HAS_UDEV diff --git a/buildroot/package/boinc/boinc.mk b/buildroot/package/boinc/boinc.mk index fe972181d..700683e20 100644 --- a/buildroot/package/boinc/boinc.mk +++ b/buildroot/package/boinc/boinc.mk @@ -11,6 +11,7 @@ BOINC_SITE = \ BOINC_LICENSE = LGPL-3.0+ BOINC_LICENSE_FILES = COPYING COPYING.LESSER BOINC_CPE_ID_VENDOR = rom_walton +BOINC_SELINUX_MODULES = boinc BOINC_DEPENDENCIES = host-pkgconf libcurl openssl BOINC_AUTORECONF = YES BOINC_CONF_ENV = ac_cv_path__libcurl_config=$(STAGING_DIR)/usr/bin/curl-config diff --git a/buildroot/package/busybox/0003-update_passwd-fix-context-variable.patch b/buildroot/package/busybox/0003-update_passwd-fix-context-variable.patch deleted file mode 100644 index 25c07d705..000000000 --- a/buildroot/package/busybox/0003-update_passwd-fix-context-variable.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b4828612abe378491693c9036db19e4f64768307 Mon Sep 17 00:00:00 2001 -From: Bernd Kuhls -Date: Sun, 10 Jan 2021 13:15:04 +0100 -Subject: [PATCH] update_passwd: fix context variable - -Commit -https://git.busybox.net/busybox/commit/libbb/update_passwd.c?id=2496616b0a8d1c80cd1416b73a4847b59b9f969a - -changed the variable used from context to seuser but forgot this -change resulting in build errors detected by buildroot autobuilders: - -http://autobuild.buildroot.net/results/b89/b89b7d0f0601bb706e76cea31cf4e43326e5540c//build-end.log - -libbb/update_passwd.c:51:11: error: 'context' undeclared (first use in - this function); did you mean 'ucontext'? - freecon(context); - -Patch sent upstream: -http://lists.busybox.net/pipermail/busybox/2021-January/088467.html - -Signed-off-by: Bernd Kuhls ---- - libbb/update_passwd.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c -index 7b67f30cd..a228075cc 100644 ---- a/libbb/update_passwd.c -+++ b/libbb/update_passwd.c -@@ -48,7 +48,7 @@ static void check_selinux_update_passwd(const char *username) - bb_simple_error_msg_and_die("SELinux: access denied"); - } - if (ENABLE_FEATURE_CLEAN_UP) -- freecon(context); -+ freecon(seuser); - } - #else - # define check_selinux_update_passwd(username) ((void)0) --- -2.29.2 - diff --git a/buildroot/package/busybox/0004-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch b/buildroot/package/busybox/0004-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch deleted file mode 100644 index d40cb4d6c..000000000 --- a/buildroot/package/busybox/0004-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch +++ /dev/null @@ -1,58 +0,0 @@ -From f25d254dfd4243698c31a4f3153d4ac72aa9e9bd Mon Sep 17 00:00:00 2001 -From: Samuel Sapalski -Date: Wed, 3 Mar 2021 16:31:22 +0100 -Subject: [PATCH] decompress_gunzip: Fix DoS if gzip is corrupt - -On certain corrupt gzip files, huft_build will set the error bit on -the result pointer. If afterwards abort_unzip is called huft_free -might run into a segmentation fault or an invalid pointer to -free(p). - -In order to mitigate this, we check in huft_free if the error bit -is set and clear it before the linked list is freed. - -Signed-off-by: Samuel Sapalski -Signed-off-by: Peter Kaestle -Signed-off-by: Denys Vlasenko -Signed-off-by: Peter Korsgaard ---- - archival/libarchive/decompress_gunzip.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c -index eb3b64930..e93cd5005 100644 ---- a/archival/libarchive/decompress_gunzip.c -+++ b/archival/libarchive/decompress_gunzip.c -@@ -220,10 +220,20 @@ static const uint8_t border[] ALIGN1 = { - * each table. - * t: table to free - */ -+#define BAD_HUFT(p) ((uintptr_t)(p) & 1) -+#define ERR_RET ((huft_t*)(uintptr_t)1) - static void huft_free(huft_t *p) - { - huft_t *q; - -+ /* -+ * If 'p' has the error bit set we have to clear it, otherwise we might run -+ * into a segmentation fault or an invalid pointer to free(p) -+ */ -+ if (BAD_HUFT(p)) { -+ p = (huft_t*)((uintptr_t)(p) ^ (uintptr_t)(ERR_RET)); -+ } -+ - /* Go through linked list, freeing from the malloced (t[-1]) address. */ - while (p) { - q = (--p)->v.t; -@@ -289,8 +299,6 @@ static unsigned fill_bitbuffer(STATE_PARAM unsigned bitbuffer, unsigned *current - * or a valid pointer to a Huffman table, ORed with 0x1 if incompete table - * is given: "fixed inflate" decoder feeds us such data. - */ --#define BAD_HUFT(p) ((uintptr_t)(p) & 1) --#define ERR_RET ((huft_t*)(uintptr_t)1) - static huft_t* huft_build(const unsigned *b, const unsigned n, - const unsigned s, const struct cp_ext *cp_ext, - unsigned *m) --- -2.20.1 - diff --git a/buildroot/package/busybox/busybox.hash b/buildroot/package/busybox/busybox.hash index dffab2140..3e9c30cad 100644 --- a/buildroot/package/busybox/busybox.hash +++ b/buildroot/package/busybox/busybox.hash @@ -1,5 +1,5 @@ -# From https://busybox.net/downloads/busybox-1.33.0.tar.bz2.sha256 -sha256 d568681c91a85edc6710770cebc1e80e042ad74d305b5c2e6d57a5f3de3b8fbd busybox-1.33.0.tar.bz2 +# From https://busybox.net/downloads/busybox-1.33.1.tar.bz2.sha256 +sha256 12cec6bd2b16d8a9446dd16130f2b92982f1819f6e1c5f5887b6db03f5660d28 busybox-1.33.1.tar.bz2 # Locally computed sha256 bbfc9843646d483c334664f651c208b9839626891d8f17604db2146962f43548 LICENSE sha256 b5a136ed67798e51fe2e0ca0b2a21cb01b904ff0c9f7d563a6292e276607e58f archival/libarchive/bz/LICENSE diff --git a/buildroot/package/busybox/busybox.mk b/buildroot/package/busybox/busybox.mk index e979ac4f4..413939e28 100644 --- a/buildroot/package/busybox/busybox.mk +++ b/buildroot/package/busybox/busybox.mk @@ -4,16 +4,13 @@ # ################################################################################ -BUSYBOX_VERSION = 1.33.0 +BUSYBOX_VERSION = 1.33.1 BUSYBOX_SITE = https://www.busybox.net/downloads BUSYBOX_SOURCE = busybox-$(BUSYBOX_VERSION).tar.bz2 BUSYBOX_LICENSE = GPL-2.0, bzip2-1.0.4 BUSYBOX_LICENSE_FILES = LICENSE archival/libarchive/bz/LICENSE BUSYBOX_CPE_ID_VENDOR = busybox -# 0004-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch -BUSYBOX_IGNORE_CVES += CVE-2021-28831 - define BUSYBOX_HELP_CMDS @echo ' busybox-menuconfig - Run BusyBox menuconfig' endef diff --git a/buildroot/package/chrony/chrony.mk b/buildroot/package/chrony/chrony.mk index b73ddb56b..dc162a6c4 100644 --- a/buildroot/package/chrony/chrony.mk +++ b/buildroot/package/chrony/chrony.mk @@ -9,6 +9,7 @@ CHRONY_SITE = http://download.tuxfamily.org/chrony CHRONY_LICENSE = GPL-2.0 CHRONY_LICENSE_FILES = COPYING CHRONY_CPE_ID_VENDOR = tuxfamily +CHRONY_SELINUX_MODULES = chronyd CHRONY_DEPENDENCIES = host-pkgconf CHRONY_CONF_OPTS = \ diff --git a/buildroot/package/chrony/chrony.service b/buildroot/package/chrony/chrony.service index 325b63c49..210122cf5 100644 --- a/buildroot/package/chrony/chrony.service +++ b/buildroot/package/chrony/chrony.service @@ -4,6 +4,10 @@ After=syslog.target network.target Conflicts=systemd-timesyncd.service [Service] +# Turn off DNSSEC validation for hostname look-ups, since those need the +# correct time to work, but we likely won't acquire that without NTP. Let's +# break this chicken-and-egg cycle here. +Environment=SYSTEMD_NSS_RESOLVE_VALIDATE=0 ExecStart=/usr/sbin/chronyd -n Restart=always diff --git a/buildroot/package/clamav/clamav.mk b/buildroot/package/clamav/clamav.mk index 6ab473ab8..b3e1ca98a 100644 --- a/buildroot/package/clamav/clamav.mk +++ b/buildroot/package/clamav/clamav.mk @@ -11,6 +11,7 @@ CLAMAV_LICENSE_FILES = COPYING COPYING.bzip2 COPYING.file COPYING.getopt \ COPYING.LGPL COPYING.llvm COPYING.lzma COPYING.pcre COPYING.regex \ COPYING.unrar COPYING.zlib CLAMAV_CPE_ID_VENDOR = clamav +CLAMAV_SELINUX_MODULES = clamav CLAMAV_DEPENDENCIES = \ host-pkgconf \ libcurl \ diff --git a/buildroot/package/cryptsetup/cryptsetup.mk b/buildroot/package/cryptsetup/cryptsetup.mk index cd5883d0b..b816dc2f2 100644 --- a/buildroot/package/cryptsetup/cryptsetup.mk +++ b/buildroot/package/cryptsetup/cryptsetup.mk @@ -33,6 +33,12 @@ else CRYPTSETUP_CONF_OPTS += --with-crypto_backend=kernel endif +ifeq ($(BR2_PACKAGE_SYSTEMD_TMPFILES),y) +CRYPTSETUP_CONF_OPTS += --with-tmpfilesdir=/usr/lib/tmpfiles.d +else +CRYPTSETUP_CONF_OPTS += --without-tmpfilesdir +endif + HOST_CRYPTSETUP_DEPENDENCIES = \ host-pkgconf \ host-lvm2 \ diff --git a/buildroot/package/cwiid/Config.in b/buildroot/package/cwiid/Config.in index 9dab5d107..374a91ffd 100644 --- a/buildroot/package/cwiid/Config.in +++ b/buildroot/package/cwiid/Config.in @@ -11,7 +11,7 @@ config BR2_PACKAGE_CWIID A collection of Linux tools written in C for interfacing to the Nintendo Wiimote. - http://abstrakraft.org/cwiid/ + https://github.com/abstrakraft/cwiid if BR2_PACKAGE_CWIID config BR2_PACKAGE_CWIID_WMGUI diff --git a/buildroot/package/dnsmasq/dnsmasq.mk b/buildroot/package/dnsmasq/dnsmasq.mk index 200675759..972be1093 100644 --- a/buildroot/package/dnsmasq/dnsmasq.mk +++ b/buildroot/package/dnsmasq/dnsmasq.mk @@ -15,6 +15,7 @@ DNSMASQ_DEPENDENCIES = host-pkgconf $(TARGET_NLS_DEPENDENCIES) DNSMASQ_LICENSE = GPL-2.0 or GPL-3.0 DNSMASQ_LICENSE_FILES = COPYING COPYING-v3 DNSMASQ_CPE_ID_VENDOR = thekelleys +DNSMASQ_SELINUX_MODULES = dnsmasq DNSMASQ_I18N = $(if $(BR2_SYSTEM_ENABLE_NLS),-i18n) diff --git a/buildroot/package/docker-cli/docker-cli.hash b/buildroot/package/docker-cli/docker-cli.hash index bb3444c27..6d380c2fd 100644 --- a/buildroot/package/docker-cli/docker-cli.hash +++ b/buildroot/package/docker-cli/docker-cli.hash @@ -1,3 +1,3 @@ # Locally calculated -sha256 eda53b96ab83a59502df2e5e00ab7ee867243259407ef454be55e695303c1113 docker-cli-20.10.6.tar.gz +sha256 0a7848b1b5031483de075433506d0448ddf834368d9c73770e453e0b89b49747 docker-cli-20.10.7.tar.gz sha256 2d81ea060825006fc8f3fe28aa5dc0ffeb80faf325b612c955229157b8c10dc0 LICENSE diff --git a/buildroot/package/docker-cli/docker-cli.mk b/buildroot/package/docker-cli/docker-cli.mk index 9c3690e4c..24fd26a8c 100644 --- a/buildroot/package/docker-cli/docker-cli.mk +++ b/buildroot/package/docker-cli/docker-cli.mk @@ -4,7 +4,7 @@ # ################################################################################ -DOCKER_CLI_VERSION = 20.10.6 +DOCKER_CLI_VERSION = 20.10.7 DOCKER_CLI_SITE = $(call github,docker,cli,v$(DOCKER_CLI_VERSION)) DOCKER_CLI_LICENSE = Apache-2.0 diff --git a/buildroot/package/docker-engine/0001-fix-port-forwarding-with-ipv6.disable-1.patch b/buildroot/package/docker-engine/0001-fix-port-forwarding-with-ipv6.disable-1.patch deleted file mode 100644 index c5161ef0d..000000000 --- a/buildroot/package/docker-engine/0001-fix-port-forwarding-with-ipv6.disable-1.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 7b9c2905883df5171fda10a364a81b8c6176c8e2 Mon Sep 17 00:00:00 2001 -From: Akihiro Suda -Date: Mon, 26 Apr 2021 15:28:40 +0900 -Subject: [PATCH] fix port forwarding with ipv6.disable=1 - -Make `docker run -p 80:80` functional again on environments with kernel boot parameter `ipv6.disable=1`. - -Fix moby/moby issue 42288 - -Signed-off-by: Akihiro Suda -[Upstream: https://github.com/moby/libnetwork/pull/2635, - https://github.com/moby/moby/pull/42322] -[Rework path/drop test for docker-engine] -Signed-off-by: Peter Korsgaard ---- - vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go | 31 +++++++++++++++++++++++++++++++ - 1 file changed, 35 insertions(+), 0 deletion(-) - -diff --git a/vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go b/vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go -index 946130ec..17bf36f9 100644 ---- a/vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go -+++ b/vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go -@@ -5,6 +5,7 @@ import ( - "errors" - "fmt" - "net" -+ "sync" - - "github.com/docker/libnetwork/types" - "github.com/ishidawataru/sctp" -@@ -50,6 +51,13 @@ func (n *bridgeNetwork) allocatePortsInternal(bindings []types.PortBinding, cont - bs = append(bs, bIPv4) - } - -+ // skip adding implicit v6 addr, when the kernel was booted with `ipv6.disable=1` -+ // https://github.com/moby/moby/issues/42288 -+ isV6Binding := c.HostIP != nil && c.HostIP.To4() == nil -+ if !isV6Binding && !IsV6Listenable() { -+ continue -+ } -+ - // Allocate IPv6 Port mappings - // If the container has no IPv6 address, allow proxying host IPv6 traffic to it - // by setting up the binding with the IPv4 interface if the userland proxy is enabled -@@ -211,3 +219,26 @@ func (n *bridgeNetwork) releasePort(bnd types.PortBinding) error { - - return portmapper.Unmap(host) - } -+ -+var ( -+ v6ListenableCached bool -+ v6ListenableOnce sync.Once -+) -+ -+// IsV6Listenable returns true when `[::1]:0` is listenable. -+// IsV6Listenable returns false mostly when the kernel was booted with `ipv6.disable=1` option. -+func IsV6Listenable() bool { -+ v6ListenableOnce.Do(func() { -+ ln, err := net.Listen("tcp6", "[::1]:0") -+ if err != nil { -+ // When the kernel was booted with `ipv6.disable=1`, -+ // we get err "listen tcp6 [::1]:0: socket: address family not supported by protocol" -+ // https://github.com/moby/moby/issues/42288 -+ logrus.Debugf("port_mapping: v6Listenable=false (%v)", err) -+ } else { -+ v6ListenableCached = true -+ ln.Close() -+ } -+ }) -+ return v6ListenableCached -+} --- -2.20.1 - diff --git a/buildroot/package/docker-engine/docker-engine.hash b/buildroot/package/docker-engine/docker-engine.hash index 6c55b9a9b..d07ca3330 100644 --- a/buildroot/package/docker-engine/docker-engine.hash +++ b/buildroot/package/docker-engine/docker-engine.hash @@ -1,3 +1,3 @@ # Locally calculated -sha256 fd7f5571b1f64f26b5ca520a3e1fefb33c190f3732b931051c23a76bdba5000e docker-engine-20.10.6.tar.gz +sha256 b80142035de46904605fb7b8f18075cd94154f8c3d67ff346ea554d1e9d579b9 docker-engine-20.10.7.tar.gz sha256 7c87873291f289713ac5df48b1f2010eb6963752bbd6b530416ab99fc37914a8 LICENSE diff --git a/buildroot/package/docker-engine/docker-engine.mk b/buildroot/package/docker-engine/docker-engine.mk index 10ecbf603..372717775 100644 --- a/buildroot/package/docker-engine/docker-engine.mk +++ b/buildroot/package/docker-engine/docker-engine.mk @@ -4,7 +4,7 @@ # ################################################################################ -DOCKER_ENGINE_VERSION = 20.10.6 +DOCKER_ENGINE_VERSION = 20.10.7 DOCKER_ENGINE_SITE = $(call github,moby,moby,v$(DOCKER_ENGINE_VERSION)) DOCKER_ENGINE_LICENSE = Apache-2.0 diff --git a/buildroot/package/dovecot-pigeonhole/dovecot-pigeonhole.hash b/buildroot/package/dovecot-pigeonhole/dovecot-pigeonhole.hash index cf3ebdbf5..58444ab7e 100644 --- a/buildroot/package/dovecot-pigeonhole/dovecot-pigeonhole.hash +++ b/buildroot/package/dovecot-pigeonhole/dovecot-pigeonhole.hash @@ -1,3 +1,3 @@ # Locally computed after checking signature -sha256 68ca0f78a3caa6b090a469f45c395c44cf16da8fcb3345755b1ca436c9ffb2d2 dovecot-2.3-pigeonhole-0.5.14.tar.gz +sha256 e1498f50cef74c351a57474cc423b008627ab1ab60724b859283ead6d00550d0 dovecot-2.3-pigeonhole-0.5.15.tar.gz sha256 fc9e9522216f2a9a28b31300e3c73c1df56acc27dfae951bf516e7995366b51a COPYING diff --git a/buildroot/package/dovecot-pigeonhole/dovecot-pigeonhole.mk b/buildroot/package/dovecot-pigeonhole/dovecot-pigeonhole.mk index 35a1e1ef5..c0bef6bed 100644 --- a/buildroot/package/dovecot-pigeonhole/dovecot-pigeonhole.mk +++ b/buildroot/package/dovecot-pigeonhole/dovecot-pigeonhole.mk @@ -4,7 +4,7 @@ # ################################################################################ -DOVECOT_PIGEONHOLE_VERSION = 0.5.14 +DOVECOT_PIGEONHOLE_VERSION = 0.5.15 DOVECOT_PIGEONHOLE_SOURCE = dovecot-2.3-pigeonhole-$(DOVECOT_PIGEONHOLE_VERSION).tar.gz DOVECOT_PIGEONHOLE_SITE = https://pigeonhole.dovecot.org/releases/2.3 DOVECOT_PIGEONHOLE_LICENSE = LGPL-2.1 diff --git a/buildroot/package/dovecot/dovecot.hash b/buildroot/package/dovecot/dovecot.hash index edb9d20e6..cd314cf0d 100644 --- a/buildroot/package/dovecot/dovecot.hash +++ b/buildroot/package/dovecot/dovecot.hash @@ -1,5 +1,5 @@ # Locally computed after checking signature -sha256 c8b3d7f3af1e558a3ff0f970309d4013a4d3ce136f8c02a53a3b05f345b9a34a dovecot-2.3.14.tar.gz +sha256 21bbdd5d45957a99133de8b7e71813ecb73d9476c89dfc63479e9102b3553590 dovecot-2.3.15.tar.gz sha256 319a9830aab406109cd67cb45496587566a8123203d66d037b209ca3e13de02a COPYING sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LGPL sha256 52b8c95fabb19575281874b661ef7968ea47e8f5d74ba0dd40ce512e52b3fc97 COPYING.MIT diff --git a/buildroot/package/dovecot/dovecot.mk b/buildroot/package/dovecot/dovecot.mk index a38cf1941..cb1cc990a 100644 --- a/buildroot/package/dovecot/dovecot.mk +++ b/buildroot/package/dovecot/dovecot.mk @@ -5,7 +5,7 @@ ################################################################################ DOVECOT_VERSION_MAJOR = 2.3 -DOVECOT_VERSION = $(DOVECOT_VERSION_MAJOR).14 +DOVECOT_VERSION = $(DOVECOT_VERSION_MAJOR).15 DOVECOT_SITE = https://dovecot.org/releases/$(DOVECOT_VERSION_MAJOR) DOVECOT_INSTALL_STAGING = YES DOVECOT_LICENSE = LGPL-2.1, MIT, Public Domain, BSD-3-Clause, Unicode-DFS-2015 @@ -18,6 +18,10 @@ DOVECOT_DEPENDENCIES = \ # add host-gettext for AM_ICONV macro DOVECOT_DEPENDENCIES += host-gettext +# CVE-2016-4983 is an issue in a postinstall script in the dovecot rpm, which +# is part of the Red Hat packaging and not part of upstream dovecot +DOVECOT_IGNORE_CVES += CVE-2016-4983 + DOVECOT_CONF_ENV = \ RPCGEN=__disable_RPCGEN_rquota \ i_cv_epoll_works=yes \ diff --git a/buildroot/package/e2fsprogs/e2fsprogs.mk b/buildroot/package/e2fsprogs/e2fsprogs.mk index eb127b42d..e40af73cc 100644 --- a/buildroot/package/e2fsprogs/e2fsprogs.mk +++ b/buildroot/package/e2fsprogs/e2fsprogs.mk @@ -27,6 +27,7 @@ HOST_E2FSPROGS_CONF_OPTS = \ --disable-defrag \ --disable-e2initrd-helper \ --disable-fuse2fs \ + --disable-fsck \ --disable-libblkid \ --disable-libuuid \ --disable-testio-debug \ diff --git a/buildroot/package/exiv2/0001-add-BUILD_WITH_STACK_PROTECTOR-option.patch b/buildroot/package/exiv2/0001-add-BUILD_WITH_STACK_PROTECTOR-option.patch new file mode 100644 index 000000000..18684ebbf --- /dev/null +++ b/buildroot/package/exiv2/0001-add-BUILD_WITH_STACK_PROTECTOR-option.patch @@ -0,0 +1,54 @@ +From 4bb57da5fb0bb0d7e747b9e325e9ec0876ffc1f9 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sat, 31 Jul 2021 16:36:50 +0200 +Subject: [PATCH] add BUILD_WITH_STACK_PROTECTOR option + +Add BUILD_WITH_STACK_PROTECTOR to avoid the following build failure with +toolchains that don't support stack-protector: + +/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/9.3.0/../../../../mipsel-buildroot-linux-uclibc/bin/ld: utils.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0xd0): undefined reference to `__stack_chk_fail' + +Indeed, support for -fstack-protector-strong can't be detected through +check_cxx_compiler_flag as some toolchains need to link with -lssp to +enable SSP support + +Fixes: + - http://autobuild.buildroot.org/results/ae4635899124c602c70d2b342a76f95c34aa4a3d + +Upstream: https://github.com/Exiv2/exiv2/commit/f31c0eba098889899d29b7b0da830aee2b62a7b8 +Signed-off-by: Fabrice Fontaine +--- + CMakeLists.txt | 1 + + cmake/compilerFlags.cmake | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6f0da06a..0746ee14 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,6 +47,7 @@ mark_as_advanced( + EXIV2_TEAM_USE_SANITIZERS + ) + ++option( BUILD_WITH_STACK_PROTECTOR "Build with stack protector" ON ) + option( BUILD_WITH_CCACHE "Use ccache to speed up compilations" OFF ) + option( BUILD_WITH_COVERAGE "Add compiler flags to generate coverage stats" OFF ) + +diff --git a/cmake/compilerFlags.cmake b/cmake/compilerFlags.cmake +index 35faf501..0a646e50 100644 +--- a/cmake/compilerFlags.cmake ++++ b/cmake/compilerFlags.cmake +@@ -33,8 +33,8 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN + endif() + if(HAS_FCF_PROTECTION) + add_compile_options(-fcf-protection) +- endif() +- if(HAS_FSTACK_PROTECTOR_STRONG) ++ endif() ++ if(BUILD_WITH_STACK_PROTECTOR AND HAS_FSTACK_PROTECTOR_STRONG) + add_compile_options(-fstack-protector-strong) + endif() + endif() +-- +2.31.1 + diff --git a/buildroot/package/exiv2/0001-cmake-compilerFlags.cmake-properly-detect-availabili.patch b/buildroot/package/exiv2/0001-cmake-compilerFlags.cmake-properly-detect-availabili.patch deleted file mode 100644 index 7b9fa4881..000000000 --- a/buildroot/package/exiv2/0001-cmake-compilerFlags.cmake-properly-detect-availabili.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 2f6d2e5795382f0d6e22f5aea52e8104110d24ad Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Sun, 19 Jul 2020 16:29:15 +0200 -Subject: [PATCH] cmake/compilerFlags.cmake: properly detect availability of - flags - -Instead of relying on fragile and complex logic to decide if a -compiler flag is available or not, use the check_c_compiler_flag() -macro provided by the CMake standard library. - -This for example avoids using -fcf-protection on architectures that -don't support this option. - -[Upstream: https://github.com/Exiv2/exiv2/pull/1252. The submitted -patch is slightly different than this one, due to other changes -between 0.27.3 and master.] -Signed-off-by: Thomas Petazzoni ---- - cmake/compilerFlags.cmake | 18 +++++++++++------- - 1 file changed, 11 insertions(+), 7 deletions(-) - -diff --git a/cmake/compilerFlags.cmake b/cmake/compilerFlags.cmake -index 0418aa61..be430977 100644 ---- a/cmake/compilerFlags.cmake -+++ b/cmake/compilerFlags.cmake -@@ -1,4 +1,5 @@ - # These flags applies to exiv2lib, the applications, and to the xmp code -+include(CheckCCompilerFlag) - - if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN - if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) -@@ -25,13 +26,16 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN - - # This fails under Fedora, MinGW GCC 8.3.0 and CYGWIN/MSYS 9.3.0 - if (NOT (MINGW OR CMAKE_HOST_SOLARIS OR CYGWIN OR MSYS) ) -- if (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) -- add_compile_options(-fstack-clash-protection -fcf-protection) -- endif() -- -- if( (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) # Not in GCC 4.8 -- OR (COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.7) # Not in Clang 3.4.2 -- ) -+ check_c_compiler_flag(-fstack-clash-protection HAS_FSTACK_CLASH_PROTECTION) -+ check_c_compiler_flag(-fcf-protection HAS_FCF_PROTECTION) -+ check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG) -+ if(HAS_FSTACK_CLASH_PROTECTION) -+ add_compile_options(-fstack-clash-protection) -+ endif() -+ if(GCC_HAS_FCF_PROTECTION) -+ add_compile_options(-fcf-protection) -+ endif() -+ if(GCC_HAS_FSTACK_PROTECTOR_STRONG) - add_compile_options(-fstack-protector-strong) - endif() - endif() ---- -2.26.2 - diff --git a/buildroot/package/exiv2/exiv2.hash b/buildroot/package/exiv2/exiv2.hash index 94ab4ac63..c9af674a5 100644 --- a/buildroot/package/exiv2/exiv2.hash +++ b/buildroot/package/exiv2/exiv2.hash @@ -1,3 +1,3 @@ # Locally calculated -sha256 6398bc743c32b85b2cb2a604273b8c90aa4eb0fd7c1700bf66cbb2712b4f00c1 exiv2-0.27.3.tar.gz -sha256 a7ba75cb966aca374711e2af49e5f3aea6a4443a803440f5d93e73a5a1222f66 COPYING +sha256 84366dba7c162af9a7603bcd6c16f40fe0e9af294ba2fd2f66ffffb9fbec904e exiv2-0.27.4-Source.tar.gz +sha256 a7ba75cb966aca374711e2af49e5f3aea6a4443a803440f5d93e73a5a1222f66 COPYING diff --git a/buildroot/package/exiv2/exiv2.mk b/buildroot/package/exiv2/exiv2.mk index 3d4cf4173..33222e638 100644 --- a/buildroot/package/exiv2/exiv2.mk +++ b/buildroot/package/exiv2/exiv2.mk @@ -4,14 +4,17 @@ # ################################################################################ -EXIV2_VERSION = 0.27.3 -EXIV2_SITE = $(call github,Exiv2,exiv2,v$(EXIV2_VERSION)) +EXIV2_VERSION = 0.27.4 +EXIV2_SOURCE = exiv2-$(EXIV2_VERSION)-Source.tar.gz +EXIV2_SITE = https://exiv2.org/builds EXIV2_INSTALL_STAGING = YES EXIV2_LICENSE = GPL-2.0+ EXIV2_LICENSE_FILES = COPYING EXIV2_CPE_ID_VENDOR = exiv2 -EXIV2_CONF_OPTS += -DEXIV2_BUILD_SAMPLES=OFF +EXIV2_CONF_OPTS += \ + -DBUILD_WITH_STACK_PROTECTOR=OFF \ + -DEXIV2_BUILD_SAMPLES=OFF ifeq ($(BR2_PACKAGE_EXIV2_LENSDATA),y) EXIV2_CONF_OPTS += -DEXIV2_ENABLE_LENSDATA=ON diff --git a/buildroot/package/fail2ban/0001-fixed-possible-RCE-vulnerability-unset-escape-variable.patch b/buildroot/package/fail2ban/0001-fixed-possible-RCE-vulnerability-unset-escape-variable.patch new file mode 100644 index 000000000..6d44f41d8 --- /dev/null +++ b/buildroot/package/fail2ban/0001-fixed-possible-RCE-vulnerability-unset-escape-variable.patch @@ -0,0 +1,158 @@ +From 410a6ce5c80dd981c22752da034f2529b5eee844 Mon Sep 17 00:00:00 2001 +From: sebres +Date: Mon, 21 Jun 2021 17:12:53 +0200 +Subject: [PATCH] fixed possible RCE vulnerability, unset escape variable + (default tilde) stops consider "~" char after new-line as composing escape + sequence + +[Retrieved from: +https://github.com/fail2ban/fail2ban/commit/410a6ce5c80dd981c22752da034f2529b5eee844] +Signed-off-by: Fabrice Fontaine +--- + config/action.d/complain.conf | 2 +- + config/action.d/dshield.conf | 2 +- + config/action.d/mail-buffered.conf | 8 ++++---- + config/action.d/mail-whois-lines.conf | 2 +- + config/action.d/mail-whois.conf | 6 +++--- + config/action.d/mail.conf | 6 +++--- + 6 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/config/action.d/complain.conf b/config/action.d/complain.conf +index 3a5f882c9f..4d73b05859 100644 +--- a/config/action.d/complain.conf ++++ b/config/action.d/complain.conf +@@ -102,7 +102,7 @@ logpath = /dev/null + # Notes.: Your system mail command. Is passed 2 args: subject and recipient + # Values: CMD + # +-mailcmd = mail -s ++mailcmd = mail -E 'set escape' -s + + # Option: mailargs + # Notes.: Additional arguments to mail command. e.g. for standard Unix mail: +diff --git a/config/action.d/dshield.conf b/config/action.d/dshield.conf +index c128bef348..3d5a7a53a9 100644 +--- a/config/action.d/dshield.conf ++++ b/config/action.d/dshield.conf +@@ -179,7 +179,7 @@ tcpflags = + # Notes.: Your system mail command. Is passed 2 args: subject and recipient + # Values: CMD + # +-mailcmd = mail -s ++mailcmd = mail -E 'set escape' -s + + # Option: mailargs + # Notes.: Additional arguments to mail command. e.g. for standard Unix mail: +diff --git a/config/action.d/mail-buffered.conf b/config/action.d/mail-buffered.conf +index 325f185b2f..79b841049c 100644 +--- a/config/action.d/mail-buffered.conf ++++ b/config/action.d/mail-buffered.conf +@@ -17,7 +17,7 @@ actionstart = printf %%b "Hi,\n + The jail has been started successfully.\n + Output will be buffered until lines are available.\n + Regards,\n +- Fail2Ban"|mail -s "[Fail2Ban] : started on " ++ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : started on " + + # Option: actionstop + # Notes.: command executed at the stop of jail (or at the end of Fail2Ban) +@@ -28,13 +28,13 @@ actionstop = if [ -f ]; then + These hosts have been banned by Fail2Ban.\n + `cat ` + Regards,\n +- Fail2Ban"|mail -s "[Fail2Ban] : Summary from " ++ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : Summary from " + rm + fi + printf %%b "Hi,\n + The jail has been stopped.\n + Regards,\n +- Fail2Ban"|mail -s "[Fail2Ban] : stopped on " ++ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : stopped on " + + # Option: actioncheck + # Notes.: command executed once before each actionban command +@@ -55,7 +55,7 @@ actionban = printf %%b "`date`: ( failures)\n" >> + These hosts have been banned by Fail2Ban.\n + `cat ` + \nRegards,\n +- Fail2Ban"|mail -s "[Fail2Ban] : Summary" ++ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : Summary" + rm + fi + +diff --git a/config/action.d/mail-whois-lines.conf b/config/action.d/mail-whois-lines.conf +index 3a3e56b2c7..d2818cb9b9 100644 +--- a/config/action.d/mail-whois-lines.conf ++++ b/config/action.d/mail-whois-lines.conf +@@ -72,7 +72,7 @@ actionunban = + # Notes.: Your system mail command. Is passed 2 args: subject and recipient + # Values: CMD + # +-mailcmd = mail -s ++mailcmd = mail -E 'set escape' -s + + # Default name of the chain + # +diff --git a/config/action.d/mail-whois.conf b/config/action.d/mail-whois.conf +index 7fea34c40d..ab33b616dc 100644 +--- a/config/action.d/mail-whois.conf ++++ b/config/action.d/mail-whois.conf +@@ -20,7 +20,7 @@ norestored = 1 + actionstart = printf %%b "Hi,\n + The jail has been started successfully.\n + Regards,\n +- Fail2Ban"|mail -s "[Fail2Ban] : started on " ++ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : started on " + + # Option: actionstop + # Notes.: command executed at the stop of jail (or at the end of Fail2Ban) +@@ -29,7 +29,7 @@ actionstart = printf %%b "Hi,\n + actionstop = printf %%b "Hi,\n + The jail has been stopped.\n + Regards,\n +- Fail2Ban"|mail -s "[Fail2Ban] : stopped on " ++ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : stopped on " + + # Option: actioncheck + # Notes.: command executed once before each actionban command +@@ -49,7 +49,7 @@ actionban = printf %%b "Hi,\n + Here is more information about :\n + `%(_whois_command)s`\n + Regards,\n +- Fail2Ban"|mail -s "[Fail2Ban] : banned from " ++ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : banned from " + + # Option: actionunban + # Notes.: command executed when unbanning an IP. Take care that the +diff --git a/config/action.d/mail.conf b/config/action.d/mail.conf +index 5d8c0e154c..f4838ddcb6 100644 +--- a/config/action.d/mail.conf ++++ b/config/action.d/mail.conf +@@ -16,7 +16,7 @@ norestored = 1 + actionstart = printf %%b "Hi,\n + The jail has been started successfully.\n + Regards,\n +- Fail2Ban"|mail -s "[Fail2Ban] : started on " ++ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : started on " + + # Option: actionstop + # Notes.: command executed at the stop of jail (or at the end of Fail2Ban) +@@ -25,7 +25,7 @@ actionstart = printf %%b "Hi,\n + actionstop = printf %%b "Hi,\n + The jail has been stopped.\n + Regards,\n +- Fail2Ban"|mail -s "[Fail2Ban] : stopped on " ++ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : stopped on " + + # Option: actioncheck + # Notes.: command executed once before each actionban command +@@ -43,7 +43,7 @@ actionban = printf %%b "Hi,\n + The IP has just been banned by Fail2Ban after + attempts against .\n + Regards,\n +- Fail2Ban"|mail -s "[Fail2Ban] : banned from " ++ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : banned from " + + # Option: actionunban + # Notes.: command executed when unbanning an IP. Take care that the diff --git a/buildroot/package/fail2ban/fail2ban.hash b/buildroot/package/fail2ban/fail2ban.hash index f807d5a82..072f0ef96 100644 --- a/buildroot/package/fail2ban/fail2ban.hash +++ b/buildroot/package/fail2ban/fail2ban.hash @@ -1,3 +1,3 @@ # sha256 locally computed -sha256 71d2a52b66bb0f87ac3812246bdd3819ec561913cd44afd39130a342f043aa6d fail2ban-0.11.1.tar.gz +sha256 383108e5f8644cefb288537950923b7520f642e7e114efb843f6e7ea9268b1e0 fail2ban-0.11.2.tar.gz sha256 a75fec0260742fe6275d63ff6a5d97b924b28766558306b3fa4069763096929b COPYING diff --git a/buildroot/package/fail2ban/fail2ban.mk b/buildroot/package/fail2ban/fail2ban.mk index d2fe19d11..a856d220e 100644 --- a/buildroot/package/fail2ban/fail2ban.mk +++ b/buildroot/package/fail2ban/fail2ban.mk @@ -4,13 +4,16 @@ # ################################################################################ -FAIL2BAN_VERSION = 0.11.1 +FAIL2BAN_VERSION = 0.11.2 FAIL2BAN_SITE = $(call github,fail2ban,fail2ban,$(FAIL2BAN_VERSION)) FAIL2BAN_LICENSE = GPL-2.0+ FAIL2BAN_LICENSE_FILES = COPYING FAIL2BAN_CPE_ID_VENDOR = fail2ban FAIL2BAN_SETUP_TYPE = distutils +# 0001-fixed-possible-RCE-vulnerability-unset-escape-variable.patch +FAIL2BAN_IGNORE_CVES += CVE-2021-32749 + ifeq ($(BR2_PACKAGE_PYTHON3),y) define FAIL2BAN_PYTHON_2TO3 $(HOST_DIR)/bin/2to3 --write --nobackups --no-diffs $(@D)/bin/* $(@D)/fail2ban diff --git a/buildroot/package/feh/feh.mk b/buildroot/package/feh/feh.mk index c1dae9db8..09011cc11 100644 --- a/buildroot/package/feh/feh.mk +++ b/buildroot/package/feh/feh.mk @@ -10,6 +10,7 @@ FEH_SITE = http://feh.finalrewind.org FEH_DEPENDENCIES = imlib2 libpng xlib_libXt FEH_LICENSE = MIT FEH_LICENSE_FILES = COPYING +FEH_CPE_ID_VENDOR = feh_project ifeq ($(BR2_PACKAGE_LIBCURL),y) FEH_DEPENDENCIES += libcurl diff --git a/buildroot/package/fetchmail/fetchmail.hash b/buildroot/package/fetchmail/fetchmail.hash index 698d83c88..41d71088b 100644 --- a/buildroot/package/fetchmail/fetchmail.hash +++ b/buildroot/package/fetchmail/fetchmail.hash @@ -1,6 +1,6 @@ -# From https://sourceforge.net/p/fetchmail/mailman/message/37249830/ -sha256 302dc9bcdc6927dedf375d2baaead2347557faa70d98b1da83f2409fa6fb259f fetchmail-6.4.18.tar.xz +# From https://sourceforge.net/p/fetchmail/mailman/message/37327392/ +sha256 c82141ae2e8f0039ceb0c5c2eda43c5e93ad0bf7f9c6bb628092b3be74386176 fetchmail-6.4.20.tar.xz # From https://sourceforge.net/projects/fetchmail/files/branch_6.4/ -sha1 1fd3e4f30bd9ba7bdcaed5edfca080dc6f66377e fetchmail-6.4.18.tar.xz +sha1 ac6a6c4afa105e097d025340cf78b32e0c3b0c8e fetchmail-6.4.20.tar.xz # Locally computed: -sha256 8e3ec4863456a26fcd1cf84fadd4146efcb2fd8515bcec482e0f2b7060108895 COPYING +sha256 6346b5aa04e258fa4326272ea92372d796b4382aa963535ae98a3bb5f8cd5aeb COPYING diff --git a/buildroot/package/fetchmail/fetchmail.mk b/buildroot/package/fetchmail/fetchmail.mk index 6fe9b5b3d..d1c5fa370 100644 --- a/buildroot/package/fetchmail/fetchmail.mk +++ b/buildroot/package/fetchmail/fetchmail.mk @@ -5,7 +5,7 @@ ################################################################################ FETCHMAIL_VERSION_MAJOR = 6.4 -FETCHMAIL_VERSION = $(FETCHMAIL_VERSION_MAJOR).18 +FETCHMAIL_VERSION = $(FETCHMAIL_VERSION_MAJOR).20 FETCHMAIL_SOURCE = fetchmail-$(FETCHMAIL_VERSION).tar.xz FETCHMAIL_SITE = http://downloads.sourceforge.net/project/fetchmail/branch_$(FETCHMAIL_VERSION_MAJOR) FETCHMAIL_LICENSE = GPL-2.0; some exceptions are mentioned in COPYING diff --git a/buildroot/package/flac/flac.mk b/buildroot/package/flac/flac.mk index 880c176f6..9aa00b7ff 100644 --- a/buildroot/package/flac/flac.mk +++ b/buildroot/package/flac/flac.mk @@ -17,7 +17,7 @@ FLAC_CPE_ID_VENDOR = flac_project FLAC_AUTORECONF = YES FLAC_CONF_OPTS = \ - --disable-cpplibs \ + $(if $(BR2_INSTALL_LIBSTDCPP),--enable-cpplibs,--disable-cpplibs) \ --disable-xmms-plugin \ --disable-altivec diff --git a/buildroot/package/fluxbox/0001-fixes-bug-1138.patch b/buildroot/package/fluxbox/0001-fixes-bug-1138.patch new file mode 100644 index 000000000..9c02e9335 --- /dev/null +++ b/buildroot/package/fluxbox/0001-fixes-bug-1138.patch @@ -0,0 +1,25 @@ +From 22866c4d30f5b289c429c5ca88d800200db4fc4f Mon Sep 17 00:00:00 2001 +From: John Sennesael +Date: Mon, 2 Nov 2015 15:14:32 -0600 +Subject: [PATCH] fixes bug #1138 + +[Retrieved from: +https://github.com/fluxbox/fluxbox/commit/22866c4d30f5b289c429c5ca88d800200db4fc4f] +Signed-off-by: Fabrice Fontaine +--- + util/fluxbox-remote.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/fluxbox-remote.cc b/util/fluxbox-remote.cc +index 59852e6a..504015b5 100644 +--- a/util/fluxbox-remote.cc ++++ b/util/fluxbox-remote.cc +@@ -73,7 +73,7 @@ int main(int argc, char **argv) { + if (strcmp(cmd, "result") == 0) { + XTextProperty text_prop; + if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0 +- && text_prop.value > 0 ++ && text_prop.value != 0 + && text_prop.nitems > 0) { + + printf("%s", text_prop.value); diff --git a/buildroot/package/gawk/gawk.mk b/buildroot/package/gawk/gawk.mk index 16906f6f9..ae2bbe542 100644 --- a/buildroot/package/gawk/gawk.mk +++ b/buildroot/package/gawk/gawk.mk @@ -39,5 +39,11 @@ endef GAWK_POST_INSTALL_TARGET_HOOKS += GAWK_CREATE_SYMLINK +define HOST_GAWK_CREATE_SYMLINK + ln -sf gawk $(HOST_DIR)/usr/bin/awk +endef + +HOST_GAWK_POST_INSTALL_HOOKS += HOST_GAWK_CREATE_SYMLINK + $(eval $(autotools-package)) $(eval $(host-autotools-package)) diff --git a/buildroot/package/gcc/9.3.0/0001-xtensa-fix-PR-target-91880.patch b/buildroot/package/gcc/9.3.0/0001-xtensa-fix-PR-target-91880.patch deleted file mode 100644 index 4e5aea2c7..000000000 --- a/buildroot/package/gcc/9.3.0/0001-xtensa-fix-PR-target-91880.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0a59aa440a4c125b81504c777b066ae4eb1f09f0 Mon Sep 17 00:00:00 2001 -From: Max Filippov -Date: Tue, 24 Sep 2019 04:15:17 -0700 -Subject: [PATCH] xtensa: fix PR target/91880 - -Xtensa hwloop_optimize segfaults when zero overhead loop is about to be -inserted as the first instruction of the function. -Insert zero overhead loop instruction into new basic block before the -loop when basic block that precedes the loop is empty. - -2019-09-26 Max Filippov -gcc/ - * config/xtensa/xtensa.c (hwloop_optimize): Insert zero overhead - loop instruction into new basic block before the loop when basic - block that precedes the loop is empty. - -Signed-off-by: Max Filippov -Signed-off-by: Romain Naour ---- -Backported from: r276166 - - gcc/config/xtensa/xtensa.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c -index ee5612441e2..2527468d57d 100644 ---- a/gcc/config/xtensa/xtensa.c -+++ b/gcc/config/xtensa/xtensa.c -@@ -4235,7 +4235,9 @@ hwloop_optimize (hwloop_info loop) - - seq = get_insns (); - -- if (!single_succ_p (entry_bb) || vec_safe_length (loop->incoming) > 1) -+ entry_after = BB_END (entry_bb); -+ if (!single_succ_p (entry_bb) || vec_safe_length (loop->incoming) > 1 -+ || !entry_after) - { - basic_block new_bb; - edge e; -@@ -4256,7 +4258,6 @@ hwloop_optimize (hwloop_info loop) - } - else - { -- entry_after = BB_END (entry_bb); - while (DEBUG_INSN_P (entry_after) - || (NOTE_P (entry_after) - && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK)) --- -2.24.1 - diff --git a/buildroot/package/gcc/9.3.0/0004-gcc-Makefile.in-move-SELFTEST_DEPS-before-including-.patch b/buildroot/package/gcc/9.3.0/0004-gcc-Makefile.in-move-SELFTEST_DEPS-before-including-.patch deleted file mode 100644 index 227d35a7f..000000000 --- a/buildroot/package/gcc/9.3.0/0004-gcc-Makefile.in-move-SELFTEST_DEPS-before-including-.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 811c8d628045c3d248144fc560a4bf80209ca16e Mon Sep 17 00:00:00 2001 -From: Romain Naour -Date: Thu, 21 May 2020 15:58:02 +0200 -Subject: [PATCH] gcc/Makefile.in: move SELFTEST_DEPS before including language - makefile fragments - -As reported by several Buildroot users [1][2][3], the gcc build -may fail while running selftests makefile target. - -The problem only occurs when ccache is used with gcc 9 and 10, -probably due to a race condition. - -While debuging with "make -p" we can notice that s-selftest-c target -contain only "cc1" as dependency instead of cc1 and SELFTEST_DEPS [4]. - - s-selftest-c: cc1 - -While the build is failing, the s-selftest-c dependencies recipe is -still running and reported as a bug by make. - - "Dependencies recipe running (THIS IS A BUG)." - -A change [5] in gcc 9 seems to introduce the problem since we can't -reproduce this problem with gcc 8. - -As suggested by Yann E. MORIN [6], move SELFTEST_DEPS before -including language makefile fragments. - -With the fix applied, the s-seltest-c dependency contains -SELFTEST_DEPS value. - - s-selftest-c: cc1 xgcc specs stmp-int-hdrs ../../gcc/testsuite/selftests - -[1] http://lists.busybox.net/pipermail/buildroot/2020-May/282171.html -[2] http://lists.busybox.net/pipermail/buildroot/2020-May/282766.html -[3] https://github.com/cirosantilli/linux-kernel-module-cheat/issues/108 -[4] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/c/Make-lang.in;h=bfae6fd2549c4f728816cd355fa9739dcc08fcde;hb=033eb5671769a4c681a44aad08a454e667e08502#l120 -[5] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=033eb5671769a4c681a44aad08a454e667e08502 -[6] http://lists.busybox.net/pipermail/buildroot/2020-May/283213.html - -Upstream status: https://gcc.gnu.org/pipermail/gcc-patches/2020-May/546248.html - -Signed-off-by: Romain Naour -Cc: Ben Dakin-Norris -Cc: Maxim Kochetkov -Cc: Thomas Petazzoni -Cc: Yann E. MORIN -Cc: Cc: David Malcolm ---- -This patch should be backported to gcc 10 and gcc 9. ---- - gcc/Makefile.in | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index abae872cd63..e2ef3c46afc 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -1686,6 +1686,10 @@ $(FULL_DRIVER_NAME): ./xgcc - rm -f $@ - $(LN_S) $< $@ - -+# SELFTEST_DEPS need to be set before including language makefile fragments. -+# Otherwise $(SELFTEST_DEPS) is empty when used from various /Make-lang.in. -+SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs $(srcdir)/testsuite/selftests -+ - # - # Language makefile fragments. - -@@ -1950,8 +1954,6 @@ DEVNULL=$(if $(findstring mingw,$(build)),nul,/dev/null) - SELFTEST_FLAGS = -nostdinc $(DEVNULL) -S -o $(DEVNULL) \ - -fself-test=$(srcdir)/testsuite/selftests - --SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs $(srcdir)/testsuite/selftests -- - # Run the selftests during the build once we have a driver and the frontend, - # so that self-test failures are caught as early as possible. - # Use "s-selftest-FE" to ensure that we only run the selftests if the --- -2.25.4 - diff --git a/buildroot/package/gcc/9.3.0/0002-or1k-Fix-issue-with-set_got-clobbering-LR-r9.patch b/buildroot/package/gcc/9.4.0/0001-or1k-Fix-issue-with-set_got-clobbering-LR-r9.patch similarity index 98% rename from buildroot/package/gcc/9.3.0/0002-or1k-Fix-issue-with-set_got-clobbering-LR-r9.patch rename to buildroot/package/gcc/9.4.0/0001-or1k-Fix-issue-with-set_got-clobbering-LR-r9.patch index e40b96fe0..185e16c17 100644 --- a/buildroot/package/gcc/9.3.0/0002-or1k-Fix-issue-with-set_got-clobbering-LR-r9.patch +++ b/buildroot/package/gcc/9.4.0/0001-or1k-Fix-issue-with-set_got-clobbering-LR-r9.patch @@ -1,4 +1,4 @@ -From 1383012ae409ed91903b2b76ee15137bc1f89900 Mon Sep 17 00:00:00 2001 +From 014db5e5febec94e35c13ce89ee6b389328873a1 Mon Sep 17 00:00:00 2001 From: shorne Date: Sat, 31 Aug 2019 06:00:56 +0000 Subject: [PATCH] or1k: Fix issue with set_got clobbering LR (r9) @@ -101,5 +101,5 @@ index 2dad51cd46b..88f3f02630f 100644 (clobber (reg:SI LR_REGNUM))] "" -- -2.24.1 +2.31.1 diff --git a/buildroot/package/gcc/9.3.0/0003-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch b/buildroot/package/gcc/9.4.0/0002-gcc-define-_REENTRANT-for-OpenRISC-when-pthread-is-p.patch similarity index 88% rename from buildroot/package/gcc/9.3.0/0003-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch rename to buildroot/package/gcc/9.4.0/0002-gcc-define-_REENTRANT-for-OpenRISC-when-pthread-is-p.patch index 3ff64b71f..5ac03d7c0 100644 --- a/buildroot/package/gcc/9.3.0/0003-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch +++ b/buildroot/package/gcc/9.4.0/0002-gcc-define-_REENTRANT-for-OpenRISC-when-pthread-is-p.patch @@ -1,4 +1,4 @@ -From 2aefc4ee703ce3ff70ad25915005cacfbaae0c49 Mon Sep 17 00:00:00 2001 +From f80e9941739fb3973b61fc6a5abddef5ad2faf73 Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Fri, 27 Mar 2020 21:23:53 +0100 Subject: [PATCH] gcc: define _REENTRANT for OpenRISC when -pthread is passed @@ -14,7 +14,7 @@ Signed-off-by: Bernd Kuhls 1 file changed, 2 insertions(+) diff --git a/gcc/config/or1k/linux.h b/gcc/config/or1k/linux.h -index 4b2f7b6e1fd..b00d23ddfa0 100644 +index cbdc781418f..36303af892c 100644 --- a/gcc/config/or1k/linux.h +++ b/gcc/config/or1k/linux.h @@ -32,6 +32,8 @@ @@ -27,5 +27,5 @@ index 4b2f7b6e1fd..b00d23ddfa0 100644 #define LINK_SPEC "%{h*} \ %{static:-Bstatic} \ -- -2.21.0 +2.31.1 diff --git a/buildroot/package/gcc/9.3.0/0005-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch b/buildroot/package/gcc/9.4.0/0003-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch similarity index 93% rename from buildroot/package/gcc/9.3.0/0005-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch rename to buildroot/package/gcc/9.4.0/0003-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch index 8ed281e98..0c69de93b 100644 --- a/buildroot/package/gcc/9.3.0/0005-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch +++ b/buildroot/package/gcc/9.4.0/0003-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch @@ -1,4 +1,4 @@ -From 0d7fe4806d9dce76367c193d5199df6a2b98009f Mon Sep 17 00:00:00 2001 +From 1107ecc3e8af31adc7bbd4e08c0614836bd1cebd Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Wed, 20 Jan 2021 23:22:16 +0100 Subject: [PATCH] Revert "re PR target/92095 (internal error with -O1 @@ -30,7 +30,7 @@ Cc: Eric Botcazou delete mode 100644 gcc/testsuite/gcc.c-torture/compile/20191108-1.c diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h -index ef1adb69ede..9bdae7b9faa 100644 +index f1c120c4860..f4b6f00a7b1 100644 --- a/gcc/config/sparc/sparc-protos.h +++ b/gcc/config/sparc/sparc-protos.h @@ -69,7 +69,6 @@ extern void sparc_split_reg_mem (rtx, rtx, machine_mode); @@ -42,10 +42,10 @@ index ef1adb69ede..9bdae7b9faa 100644 extern const char *output_cbranch (rtx, rtx, int, int, int, rtx_insn *); extern const char *output_return (rtx_insn *); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c -index a993aab7639..2974d174e93 100644 +index 0553dc501e6..516dcf96d7b 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c -@@ -4205,6 +4205,13 @@ eligible_for_sibcall_delay (rtx_insn *trial) +@@ -4170,6 +4170,13 @@ eligible_for_sibcall_delay (rtx_insn *trial) static bool sparc_cannot_force_const_mem (machine_mode mode, rtx x) { @@ -59,7 +59,7 @@ index a993aab7639..2974d174e93 100644 switch (GET_CODE (x)) { case CONST_INT: -@@ -4240,11 +4247,9 @@ sparc_cannot_force_const_mem (machine_mode mode, rtx x) +@@ -4205,11 +4212,9 @@ sparc_cannot_force_const_mem (machine_mode mode, rtx x) } /* Global Offset Table support. */ @@ -73,7 +73,7 @@ index a993aab7639..2974d174e93 100644 /* Return the SYMBOL_REF for the Global Offset Table. */ -@@ -4257,6 +4262,27 @@ sparc_got (void) +@@ -4222,6 +4227,27 @@ sparc_got (void) return got_symbol_rtx; } @@ -101,7 +101,7 @@ index a993aab7639..2974d174e93 100644 /* Wrapper around the load_pcrel_sym{si,di} patterns. */ static rtx -@@ -4276,78 +4302,30 @@ gen_load_pcrel_sym (rtx op0, rtx op1, rtx op2) +@@ -4241,78 +4267,30 @@ gen_load_pcrel_sym (rtx op0, rtx op1, rtx op2) return insn; } @@ -186,7 +186,7 @@ index a993aab7639..2974d174e93 100644 } /* Ensure that we are not using patterns that are not OK with PIC. */ -@@ -5512,7 +5490,7 @@ save_local_or_in_reg_p (unsigned int regno, int leaf_function) +@@ -5477,7 +5455,7 @@ save_local_or_in_reg_p (unsigned int regno, int leaf_function) return true; /* GOT register (%l7) if needed. */ @@ -195,7 +195,7 @@ index a993aab7639..2974d174e93 100644 return true; /* If the function accesses prior frames, the frame pointer and the return -@@ -12555,9 +12533,10 @@ static void +@@ -12520,9 +12498,10 @@ static void sparc_file_end (void) { /* If we need to emit the special GOT helper function, do so now. */ @@ -207,7 +207,7 @@ index a993aab7639..2974d174e93 100644 #ifdef DWARF2_UNWIND_INFO bool do_cfi; #endif -@@ -12594,22 +12573,17 @@ sparc_file_end (void) +@@ -12559,22 +12538,17 @@ sparc_file_end (void) #ifdef DWARF2_UNWIND_INFO do_cfi = dwarf2out_do_cfi_asm (); if (do_cfi) @@ -236,7 +236,7 @@ index a993aab7639..2974d174e93 100644 #endif } -@@ -13115,10 +13089,7 @@ sparc_init_pic_reg (void) +@@ -13080,10 +13054,7 @@ sparc_init_pic_reg (void) edge entry_edge; rtx_insn *seq; @@ -249,10 +249,10 @@ index a993aab7639..2974d174e93 100644 start_sequence (); diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md -index 0a6e27ffa83..7af62d599b9 100644 +index d9ef79c13cc..6dbd054f1c7 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md -@@ -1604,7 +1604,10 @@ +@@ -1601,7 +1601,10 @@ (clobber (reg:P O7_REG))] "REGNO (operands[0]) == INTVAL (operands[3])" { @@ -321,5 +321,5 @@ index f00283f6e7b..67d4ac38095 100644 #include #include -- -2.25.4 +2.31.1 diff --git a/buildroot/package/gcc/Config.in.host b/buildroot/package/gcc/Config.in.host index 5b056a934..a68bdc1b8 100644 --- a/buildroot/package/gcc/Config.in.host +++ b/buildroot/package/gcc/Config.in.host @@ -73,7 +73,7 @@ config BR2_GCC_SUPPORTS_DLANG config BR2_GCC_VERSION string default "8.4.0" if BR2_GCC_VERSION_8_X - default "9.3.0" if BR2_GCC_VERSION_9_X + default "9.4.0" if BR2_GCC_VERSION_9_X default "10.3.0" if BR2_GCC_VERSION_10_X default "arc-2020.09-release" if BR2_GCC_VERSION_ARC default "48152afb96c59733d5bc79e3399bb7b3d4b44266" if BR2_GCC_VERSION_CSKY diff --git a/buildroot/package/gcc/gcc.hash b/buildroot/package/gcc/gcc.hash index 566ae09fc..668f4b9f4 100644 --- a/buildroot/package/gcc/gcc.hash +++ b/buildroot/package/gcc/gcc.hash @@ -1,7 +1,7 @@ # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-8.4.0/sha512.sum sha512 6de904f552a02de33b11ef52312bb664396efd7e1ce3bbe37bfad5ef617f133095b3767b4804bc7fe78df335cb53bc83f1ac055baed40979ce4c2c3e46b70280 gcc-8.4.0.tar.xz -# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-9.3.0/sha512.sum -sha512 4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de gcc-9.3.0.tar.xz +# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-9.4.0/sha512.sum +sha512 dfd3500bf21784b8351a522d53463cf362ede66b0bc302edf350bb44e94418497a8b4b797b6af8ca9b2eeb746b3b115d9c3698381b989546e9151b4496415624 gcc-9.4.0.tar.xz # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-10.3.0/sha512.sum sha512 2b2dd7453d48a398c29eaebd1422b70341001b8c90a62aee51e83344e7fdd8a8e45f82a4a9165bd7edc76dada912c932f4b6632c5636760fec4c5d7e402b3f86 gcc-10.3.0.tar.xz diff --git a/buildroot/package/gcr/gcr.mk b/buildroot/package/gcr/gcr.mk index 97a0e2206..7f71614bc 100644 --- a/buildroot/package/gcr/gcr.mk +++ b/buildroot/package/gcr/gcr.mk @@ -25,9 +25,9 @@ GCR_LICENSE_FILES = COPYING ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y) GCR_DEPENDENCIES += gobject-introspection host-libxslt -GCR_CONF_OPTS += --with-introspection +GCR_CONF_OPTS += --enable-introspection else -GCR_CONF_OPTS += --without-introspection +GCR_CONF_OPTS += --disable-introspection endif # Only the X11 backend is supported for the simple GUI diff --git a/buildroot/package/gdb/4ecb98fbc2f94dbe01b69384afbc515107de73df/0001-Fix-Python3.9-related-runtime-problems.patch b/buildroot/package/gdb/4ecb98fbc2f94dbe01b69384afbc515107de73df/0001-Fix-Python3.9-related-runtime-problems.patch new file mode 100644 index 000000000..8c2a9d3d5 --- /dev/null +++ b/buildroot/package/gdb/4ecb98fbc2f94dbe01b69384afbc515107de73df/0001-Fix-Python3.9-related-runtime-problems.patch @@ -0,0 +1,193 @@ +From 8342feee01e4e8d38affcf35e47ad900567f42e0 Mon Sep 17 00:00:00 2001 +From: Kevin Buettner +Date: Wed, 27 May 2020 20:05:40 -0700 +Subject: [PATCH] Fix Python3.9 related runtime problems + +Python3.9b1 is now available on Rawhide. GDB w/ Python 3.9 support +can be built using the configure switch -with-python=/usr/bin/python3.9. + +Attempting to run gdb/Python3.9 segfaults on startup: + + #0 0x00007ffff7b0582c in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0 + #1 0x000000000069ccbf in do_start_initialization () + at worktree-test1/gdb/python/python.c:1789 + #2 _initialize_python () + at worktree-test1/gdb/python/python.c:1877 + #3 0x00000000007afb0a in initialize_all_files () at init.c:237 + ... + +Consulting the the documentation... + +https://docs.python.org/3/c-api/init.html + +...we find that PyEval_ReleaseLock() has been deprecated since version +3.2. It recommends using PyEval_SaveThread or PyEval_ReleaseThread() +instead. In do_start_initialization, in gdb/python/python.c, we +can replace the calls to PyThreadState_Swap() and PyEval_ReleaseLock() +with a single call to PyEval_SaveThread. (Thanks to Keith Seitz +for working this out.) + +With that in place, GDB gets a little bit further. It still dies +on startup, but the backtrace is different: + + #0 0x00007ffff7b04306 in PyOS_InterruptOccurred () + from /lib64/libpython3.9.so.1.0 + #1 0x0000000000576e86 in check_quit_flag () + at worktree-test1/gdb/extension.c:776 + #2 0x0000000000576f8a in set_active_ext_lang (now_active=now_active@entry=0x983c00 ) + at worktree-test1/gdb/extension.c:705 + #3 0x000000000069d399 in gdbpy_enter::gdbpy_enter (this=0x7fffffffd2d0, + gdbarch=0x0, language=0x0) + at worktree-test1/gdb/python/python.c:211 + #4 0x0000000000686e00 in python_new_inferior (inf=0xddeb10) + at worktree-test1/gdb/python/py-inferior.c:251 + #5 0x00000000005d9fb9 in std::function::operator()(inferior*) const (__args#0=, this=0xccad20) + at /usr/include/c++/10/bits/std_function.h:617 + #6 gdb::observers::observable::notify (args#0=0xddeb10, + this=) + at worktree-test1/gdb/../gdbsupport/observable.h:106 + #7 add_inferior_silent (pid=0) + at worktree-test1/gdb/inferior.c:113 + #8 0x00000000005dbcb8 in initialize_inferiors () + at worktree-test1/gdb/inferior.c:947 + ... + +We checked with some Python Developers and were told that we should +acquire the GIL prior to calling any Python C API function. We +definitely don't have the GIL for calls of PyOS_InterruptOccurred(). + +I moved class_gdbpy_gil earlier in the file and use it in +gdbpy_check_quit_flag() to acquire (and automatically release) the +GIL. + +With those changes in place, I was able to run to a GDB prompt. But, +when trying to quit, it segfaulted again due to due to some other +problems with gdbpy_check_quit_flag(): + + Thread 1 "gdb" received signal SIGSEGV, Segmentation fault. + 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0 + (top-gdb) bt 8 + #0 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0 + #1 0x00007ffff7afa5ea in PyGILState_Ensure.cold () + from /lib64/libpython3.9.so.1.0 + #2 0x000000000069b58c in gdbpy_gil::gdbpy_gil (this=) + at worktree-test1/gdb/python/python.c:278 + #3 gdbpy_check_quit_flag (extlang=) + at worktree-test1/gdb/python/python.c:278 + #4 0x0000000000576e96 in check_quit_flag () + at worktree-test1/gdb/extension.c:776 + #5 0x000000000057700c in restore_active_ext_lang (previous=0xe9c050) + at worktree-test1/gdb/extension.c:729 + #6 0x000000000088913a in do_my_cleanups ( + pmy_chain=0xc31870 , + old_chain=0xae5720 ) + at worktree-test1/gdbsupport/cleanups.cc:131 + #7 do_final_cleanups () + at worktree-test1/gdbsupport/cleanups.cc:143 + +In this case, we're trying to call a Python C API function after +Py_Finalize() has been called from finalize_python(). I made +finalize_python set gdb_python_initialized to false and then cause +check_quit_flag() to return early when it's false. + +With these changes in place, GDB seems to be working again with +Python3.9b1. I think it likely that there are other problems lurking. +I wouldn't be surprised to find that there are other calls into Python +where we don't first make sure that we have the GIL. Further changes +may well be needed. + +I see no regressions testing on Rawhide using a GDB built with the +default Python version (3.8.3) versus one built using Python 3.9b1. + +I've also tested on Fedora 28, 29, 30, 31, and 32 (all x86_64) using +the default (though updated) system installed versions of Python on +those OSes. This means that I've tested against Python versions +2.7.15, 2.7.17, 2.7.18, 3.7.7, 3.8.2, and 3.8.3. In each case GDB +still builds without problem and shows no regressions after applying +this patch. + +gdb/ChangeLog: + +2020-MM-DD Kevin Buettner + Keith Seitz + + * python/python.c (do_start_initialization): For Python 3.9 and + later, call PyEval_SaveThread instead of PyEval_ReleaseLock. + (class gdbpy_gil): Move to earlier in file. + (finalize_python): Set gdb_python_initialized. + (gdbpy_check_quit_flag): Acquire GIL via gdbpy_gil. Return early + when not initialized. + +[import into Buildroot, removing ChangeLog change to avoid conflict] +Signed-off-by: Thomas De Schampheleire +--- + gdb/python/python.c | 32 ++++++++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + +diff --git a/gdb/python/python.c b/gdb/python/python.c +index b00b70be85b..0eee3f0397c 100644 +--- a/gdb/python/python.c ++++ b/gdb/python/python.c +@@ -268,6 +268,30 @@ ensure_python_env (struct gdbarch *gdbarch, + return make_cleanup (restore_python_env, env); + } + ++/* A helper class to save and restore the GIL, but without touching ++ the other globals that are handled by gdbpy_enter. */ ++ ++class gdbpy_gil ++{ ++public: ++ ++ gdbpy_gil () ++ : m_state (PyGILState_Ensure ()) ++ { ++ } ++ ++ ~gdbpy_gil () ++ { ++ PyGILState_Release (m_state); ++ } ++ ++ DISABLE_COPY_AND_ASSIGN (gdbpy_gil); ++ ++private: ++ ++ PyGILState_STATE m_state; ++}; ++ + /* Set the quit flag. */ + + static void +@@ -281,6 +305,10 @@ gdbpy_set_quit_flag (const struct extension_language_defn *extlang) + static int + gdbpy_check_quit_flag (const struct extension_language_defn *extlang) + { ++ if (!gdb_python_initialized) ++ return 0; ++ ++ gdbpy_gil gil; + return PyOS_InterruptOccurred (); + } + +@@ -1620,6 +1648,7 @@ finalize_python (void *ignore) + + Py_Finalize (); + ++ gdb_python_initialized = false; + restore_active_ext_lang (previous_active); + } + #endif +@@ -1854,8 +1883,7 @@ message == an error message without a stack will be printed."), + goto fail; + + /* Release the GIL while gdb runs. */ +- PyThreadState_Swap (NULL); +- PyEval_ReleaseLock (); ++ PyEval_SaveThread (); + + make_final_cleanup (finalize_python, NULL); + +-- +2.31.1 + diff --git a/buildroot/package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch b/buildroot/package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch new file mode 100644 index 000000000..63cfa1bd3 --- /dev/null +++ b/buildroot/package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch @@ -0,0 +1,193 @@ +From 51ef4f6ec819259d4a57fa4155ee78700918f8ff Mon Sep 17 00:00:00 2001 +From: Kevin Buettner +Date: Wed, 27 May 2020 20:05:40 -0700 +Subject: [PATCH] Fix Python3.9 related runtime problems + +Python3.9b1 is now available on Rawhide. GDB w/ Python 3.9 support +can be built using the configure switch -with-python=/usr/bin/python3.9. + +Attempting to run gdb/Python3.9 segfaults on startup: + + #0 0x00007ffff7b0582c in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0 + #1 0x000000000069ccbf in do_start_initialization () + at worktree-test1/gdb/python/python.c:1789 + #2 _initialize_python () + at worktree-test1/gdb/python/python.c:1877 + #3 0x00000000007afb0a in initialize_all_files () at init.c:237 + ... + +Consulting the the documentation... + +https://docs.python.org/3/c-api/init.html + +...we find that PyEval_ReleaseLock() has been deprecated since version +3.2. It recommends using PyEval_SaveThread or PyEval_ReleaseThread() +instead. In do_start_initialization, in gdb/python/python.c, we +can replace the calls to PyThreadState_Swap() and PyEval_ReleaseLock() +with a single call to PyEval_SaveThread. (Thanks to Keith Seitz +for working this out.) + +With that in place, GDB gets a little bit further. It still dies +on startup, but the backtrace is different: + + #0 0x00007ffff7b04306 in PyOS_InterruptOccurred () + from /lib64/libpython3.9.so.1.0 + #1 0x0000000000576e86 in check_quit_flag () + at worktree-test1/gdb/extension.c:776 + #2 0x0000000000576f8a in set_active_ext_lang (now_active=now_active@entry=0x983c00 ) + at worktree-test1/gdb/extension.c:705 + #3 0x000000000069d399 in gdbpy_enter::gdbpy_enter (this=0x7fffffffd2d0, + gdbarch=0x0, language=0x0) + at worktree-test1/gdb/python/python.c:211 + #4 0x0000000000686e00 in python_new_inferior (inf=0xddeb10) + at worktree-test1/gdb/python/py-inferior.c:251 + #5 0x00000000005d9fb9 in std::function::operator()(inferior*) const (__args#0=, this=0xccad20) + at /usr/include/c++/10/bits/std_function.h:617 + #6 gdb::observers::observable::notify (args#0=0xddeb10, + this=) + at worktree-test1/gdb/../gdbsupport/observable.h:106 + #7 add_inferior_silent (pid=0) + at worktree-test1/gdb/inferior.c:113 + #8 0x00000000005dbcb8 in initialize_inferiors () + at worktree-test1/gdb/inferior.c:947 + ... + +We checked with some Python Developers and were told that we should +acquire the GIL prior to calling any Python C API function. We +definitely don't have the GIL for calls of PyOS_InterruptOccurred(). + +I moved class_gdbpy_gil earlier in the file and use it in +gdbpy_check_quit_flag() to acquire (and automatically release) the +GIL. + +With those changes in place, I was able to run to a GDB prompt. But, +when trying to quit, it segfaulted again due to due to some other +problems with gdbpy_check_quit_flag(): + + Thread 1 "gdb" received signal SIGSEGV, Segmentation fault. + 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0 + (top-gdb) bt 8 + #0 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0 + #1 0x00007ffff7afa5ea in PyGILState_Ensure.cold () + from /lib64/libpython3.9.so.1.0 + #2 0x000000000069b58c in gdbpy_gil::gdbpy_gil (this=) + at worktree-test1/gdb/python/python.c:278 + #3 gdbpy_check_quit_flag (extlang=) + at worktree-test1/gdb/python/python.c:278 + #4 0x0000000000576e96 in check_quit_flag () + at worktree-test1/gdb/extension.c:776 + #5 0x000000000057700c in restore_active_ext_lang (previous=0xe9c050) + at worktree-test1/gdb/extension.c:729 + #6 0x000000000088913a in do_my_cleanups ( + pmy_chain=0xc31870 , + old_chain=0xae5720 ) + at worktree-test1/gdbsupport/cleanups.cc:131 + #7 do_final_cleanups () + at worktree-test1/gdbsupport/cleanups.cc:143 + +In this case, we're trying to call a Python C API function after +Py_Finalize() has been called from finalize_python(). I made +finalize_python set gdb_python_initialized to false and then cause +check_quit_flag() to return early when it's false. + +With these changes in place, GDB seems to be working again with +Python3.9b1. I think it likely that there are other problems lurking. +I wouldn't be surprised to find that there are other calls into Python +where we don't first make sure that we have the GIL. Further changes +may well be needed. + +I see no regressions testing on Rawhide using a GDB built with the +default Python version (3.8.3) versus one built using Python 3.9b1. + +I've also tested on Fedora 28, 29, 30, 31, and 32 (all x86_64) using +the default (though updated) system installed versions of Python on +those OSes. This means that I've tested against Python versions +2.7.15, 2.7.17, 2.7.18, 3.7.7, 3.8.2, and 3.8.3. In each case GDB +still builds without problem and shows no regressions after applying +this patch. + +gdb/ChangeLog: + +2020-MM-DD Kevin Buettner + Keith Seitz + + * python/python.c (do_start_initialization): For Python 3.9 and + later, call PyEval_SaveThread instead of PyEval_ReleaseLock. + (class gdbpy_gil): Move to earlier in file. + (finalize_python): Set gdb_python_initialized. + (gdbpy_check_quit_flag): Acquire GIL via gdbpy_gil. Return early + when not initialized. + +[import into Buildroot, removing ChangeLog change to avoid conflict] +Signed-off-by: Thomas De Schampheleire +--- + gdb/python/python.c | 32 ++++++++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + +diff --git a/gdb/python/python.c b/gdb/python/python.c +index c23db2c1261..0b77354630e 100644 +--- a/gdb/python/python.c ++++ b/gdb/python/python.c +@@ -235,6 +235,30 @@ gdbpy_enter::~gdbpy_enter () + restore_active_ext_lang (m_previous_active); + } + ++/* A helper class to save and restore the GIL, but without touching ++ the other globals that are handled by gdbpy_enter. */ ++ ++class gdbpy_gil ++{ ++public: ++ ++ gdbpy_gil () ++ : m_state (PyGILState_Ensure ()) ++ { ++ } ++ ++ ~gdbpy_gil () ++ { ++ PyGILState_Release (m_state); ++ } ++ ++ DISABLE_COPY_AND_ASSIGN (gdbpy_gil); ++ ++private: ++ ++ PyGILState_STATE m_state; ++}; ++ + /* Set the quit flag. */ + + static void +@@ -248,6 +272,10 @@ gdbpy_set_quit_flag (const struct extension_language_defn *extlang) + static int + gdbpy_check_quit_flag (const struct extension_language_defn *extlang) + { ++ if (!gdb_python_initialized) ++ return 0; ++ ++ gdbpy_gil gil; + return PyOS_InterruptOccurred (); + } + +@@ -1573,6 +1601,7 @@ finalize_python (void *ignore) + + Py_Finalize (); + ++ gdb_python_initialized = false; + restore_active_ext_lang (previous_active); + } + +@@ -1736,8 +1765,7 @@ do_start_initialization () + return false; + + /* Release the GIL while gdb runs. */ +- PyThreadState_Swap (NULL); +- PyEval_ReleaseLock (); ++ PyEval_SaveThread (); + + make_final_cleanup (finalize_python, NULL); + +-- +2.31.1 + diff --git a/buildroot/package/gdb/9.2/0007-Fix-Python3.9-related-runtime-problems.patch b/buildroot/package/gdb/9.2/0007-Fix-Python3.9-related-runtime-problems.patch new file mode 100644 index 000000000..89b0cdc4a --- /dev/null +++ b/buildroot/package/gdb/9.2/0007-Fix-Python3.9-related-runtime-problems.patch @@ -0,0 +1,227 @@ +From c47bae859a5af0d95224d90000df0e529f7c5aa0 Mon Sep 17 00:00:00 2001 +From: Kevin Buettner +Date: Wed, 27 May 2020 20:05:40 -0700 +Subject: [PATCH] Fix Python3.9 related runtime problems + +Python3.9b1 is now available on Rawhide. GDB w/ Python 3.9 support +can be built using the configure switch -with-python=/usr/bin/python3.9. + +Attempting to run gdb/Python3.9 segfaults on startup: + + #0 0x00007ffff7b0582c in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0 + #1 0x000000000069ccbf in do_start_initialization () + at worktree-test1/gdb/python/python.c:1789 + #2 _initialize_python () + at worktree-test1/gdb/python/python.c:1877 + #3 0x00000000007afb0a in initialize_all_files () at init.c:237 + ... + +Consulting the the documentation... + +https://docs.python.org/3/c-api/init.html + +...we find that PyEval_ReleaseLock() has been deprecated since version +3.2. It recommends using PyEval_SaveThread or PyEval_ReleaseThread() +instead. In do_start_initialization, in gdb/python/python.c, we +can replace the calls to PyThreadState_Swap() and PyEval_ReleaseLock() +with a single call to PyEval_SaveThread. (Thanks to Keith Seitz +for working this out.) + +With that in place, GDB gets a little bit further. It still dies +on startup, but the backtrace is different: + + #0 0x00007ffff7b04306 in PyOS_InterruptOccurred () + from /lib64/libpython3.9.so.1.0 + #1 0x0000000000576e86 in check_quit_flag () + at worktree-test1/gdb/extension.c:776 + #2 0x0000000000576f8a in set_active_ext_lang (now_active=now_active@entry=0x983c00 ) + at worktree-test1/gdb/extension.c:705 + #3 0x000000000069d399 in gdbpy_enter::gdbpy_enter (this=0x7fffffffd2d0, + gdbarch=0x0, language=0x0) + at worktree-test1/gdb/python/python.c:211 + #4 0x0000000000686e00 in python_new_inferior (inf=0xddeb10) + at worktree-test1/gdb/python/py-inferior.c:251 + #5 0x00000000005d9fb9 in std::function::operator()(inferior*) const (__args#0=, this=0xccad20) + at /usr/include/c++/10/bits/std_function.h:617 + #6 gdb::observers::observable::notify (args#0=0xddeb10, + this=) + at worktree-test1/gdb/../gdbsupport/observable.h:106 + #7 add_inferior_silent (pid=0) + at worktree-test1/gdb/inferior.c:113 + #8 0x00000000005dbcb8 in initialize_inferiors () + at worktree-test1/gdb/inferior.c:947 + ... + +We checked with some Python Developers and were told that we should +acquire the GIL prior to calling any Python C API function. We +definitely don't have the GIL for calls of PyOS_InterruptOccurred(). + +I moved class_gdbpy_gil earlier in the file and use it in +gdbpy_check_quit_flag() to acquire (and automatically release) the +GIL. + +With those changes in place, I was able to run to a GDB prompt. But, +when trying to quit, it segfaulted again due to due to some other +problems with gdbpy_check_quit_flag(): + + Thread 1 "gdb" received signal SIGSEGV, Segmentation fault. + 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0 + (top-gdb) bt 8 + #0 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0 + #1 0x00007ffff7afa5ea in PyGILState_Ensure.cold () + from /lib64/libpython3.9.so.1.0 + #2 0x000000000069b58c in gdbpy_gil::gdbpy_gil (this=) + at worktree-test1/gdb/python/python.c:278 + #3 gdbpy_check_quit_flag (extlang=) + at worktree-test1/gdb/python/python.c:278 + #4 0x0000000000576e96 in check_quit_flag () + at worktree-test1/gdb/extension.c:776 + #5 0x000000000057700c in restore_active_ext_lang (previous=0xe9c050) + at worktree-test1/gdb/extension.c:729 + #6 0x000000000088913a in do_my_cleanups ( + pmy_chain=0xc31870 , + old_chain=0xae5720 ) + at worktree-test1/gdbsupport/cleanups.cc:131 + #7 do_final_cleanups () + at worktree-test1/gdbsupport/cleanups.cc:143 + +In this case, we're trying to call a Python C API function after +Py_Finalize() has been called from finalize_python(). I made +finalize_python set gdb_python_initialized to false and then cause +check_quit_flag() to return early when it's false. + +With these changes in place, GDB seems to be working again with +Python3.9b1. I think it likely that there are other problems lurking. +I wouldn't be surprised to find that there are other calls into Python +where we don't first make sure that we have the GIL. Further changes +may well be needed. + +I see no regressions testing on Rawhide using a GDB built with the +default Python version (3.8.3) versus one built using Python 3.9b1. + +I've also tested on Fedora 28, 29, 30, 31, and 32 (all x86_64) using +the default (though updated) system installed versions of Python on +those OSes. This means that I've tested against Python versions +2.7.15, 2.7.17, 2.7.18, 3.7.7, 3.8.2, and 3.8.3. In each case GDB +still builds without problem and shows no regressions after applying +this patch. + +gdb/ChangeLog: + +2020-MM-DD Kevin Buettner + Keith Seitz + + * python/python.c (do_start_initialization): For Python 3.9 and + later, call PyEval_SaveThread instead of PyEval_ReleaseLock. + (class gdbpy_gil): Move to earlier in file. + (finalize_python): Set gdb_python_initialized. + (gdbpy_check_quit_flag): Acquire GIL via gdbpy_gil. Return early + when not initialized. + + +[import into Buildroot, removing ChangeLog change to avoid conflict] +Signed-off-by: Thomas De Schampheleire + +--- + gdb/ChangeLog | 10 ++++++++ + gdb/python/python.c | 56 ++++++++++++++++++++++++--------------------- + 2 files changed, 40 insertions(+), 26 deletions(-) + +diff --git a/gdb/python/python.c b/gdb/python/python.c +index 67f362b852d..4bdd2201abc 100644 +--- a/gdb/python/python.c ++++ b/gdb/python/python.c +@@ -238,6 +238,30 @@ gdbpy_enter::~gdbpy_enter () + PyGILState_Release (m_state); + } + ++/* A helper class to save and restore the GIL, but without touching ++ the other globals that are handled by gdbpy_enter. */ ++ ++class gdbpy_gil ++{ ++public: ++ ++ gdbpy_gil () ++ : m_state (PyGILState_Ensure ()) ++ { ++ } ++ ++ ~gdbpy_gil () ++ { ++ PyGILState_Release (m_state); ++ } ++ ++ DISABLE_COPY_AND_ASSIGN (gdbpy_gil); ++ ++private: ++ ++ PyGILState_STATE m_state; ++}; ++ + /* Set the quit flag. */ + + static void +@@ -251,6 +275,10 @@ gdbpy_set_quit_flag (const struct extension_language_defn *extlang) + static int + gdbpy_check_quit_flag (const struct extension_language_defn *extlang) + { ++ if (!gdb_python_initialized) ++ return 0; ++ ++ gdbpy_gil gil; + return PyOS_InterruptOccurred (); + } + +@@ -943,30 +971,6 @@ gdbpy_source_script (const struct extension_language_defn *extlang, + + /* Posting and handling events. */ + +-/* A helper class to save and restore the GIL, but without touching +- the other globals that are handled by gdbpy_enter. */ +- +-class gdbpy_gil +-{ +-public: +- +- gdbpy_gil () +- : m_state (PyGILState_Ensure ()) +- { +- } +- +- ~gdbpy_gil () +- { +- PyGILState_Release (m_state); +- } +- +- DISABLE_COPY_AND_ASSIGN (gdbpy_gil); +- +-private: +- +- PyGILState_STATE m_state; +-}; +- + /* A single event. */ + struct gdbpy_event + { +@@ -1616,6 +1620,7 @@ finalize_python (void *ignore) + + Py_Finalize (); + ++ gdb_python_initialized = false; + restore_active_ext_lang (previous_active); + } + +@@ -1785,8 +1790,7 @@ do_start_initialization () + return false; + + /* Release the GIL while gdb runs. */ +- PyThreadState_Swap (NULL); +- PyEval_ReleaseLock (); ++ PyEval_SaveThread (); + + make_final_cleanup (finalize_python, NULL); + +-- +2.26.3 + diff --git a/buildroot/package/gdb/Config.in b/buildroot/package/gdb/Config.in index b1aa5e47d..262740fc4 100644 --- a/buildroot/package/gdb/Config.in +++ b/buildroot/package/gdb/Config.in @@ -3,7 +3,6 @@ config BR2_PACKAGE_GDB_ARCH_SUPPORTS default y depends on !((BR2_arm || BR2_armeb) && BR2_BINFMT_FLAT) depends on !BR2_microblaze - depends on !BR2_nios2 depends on !BR2_or1k depends on !BR2_nds32 diff --git a/buildroot/package/gdb/Config.in.host b/buildroot/package/gdb/Config.in.host index 9ac939ec1..21e6b34ca 100644 --- a/buildroot/package/gdb/Config.in.host +++ b/buildroot/package/gdb/Config.in.host @@ -3,7 +3,6 @@ config BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS default y depends on !((BR2_arm || BR2_armeb) && BR2_BINFMT_FLAT) depends on !BR2_microblaze - depends on !BR2_nios2 depends on !BR2_or1k depends on !BR2_riscv depends on !BR2_nds32 @@ -82,7 +81,7 @@ endchoice endif -# If cross-gdb is not enabled, the latest working version is chosen. +# If cross-gdb is not enabled, the latest stable version is chosen. config BR2_GDB_VERSION string default "arc-2020.09-release-gdb" if BR2_arc diff --git a/buildroot/package/gdk-pixbuf/0001-meson.build-link-with-lintl-if-needed.patch b/buildroot/package/gdk-pixbuf/0001-meson.build-link-with-lintl-if-needed.patch deleted file mode 100644 index 08a3a681c..000000000 --- a/buildroot/package/gdk-pixbuf/0001-meson.build-link-with-lintl-if-needed.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 65c8bc8ec4ae8dd140b0205a61d0d216fa45d819 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Thu, 28 Jan 2021 07:50:44 +0100 -Subject: [PATCH] meson.build: link with lintl if needed - -Link with -lintl to avoid the following build failure: - -/home/giuliobenetti/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-uclibc/5.5.0/../../../../mips64el-buildroot-linux-uclibc/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.so.0.4200.2.p/gdk-pixbuf-util.c.o: in function `_gdk_pixbuf_init_gettext': -gdk-pixbuf-util.c:(.text+0xbc0): undefined reference to `libintl_bindtextdomain' -/home/giuliobenetti/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-uclibc/5.5.0/../../../../mips64el-buildroot-linux-uclibc/bin/ld: gdk-pixbuf-util.c:(.text+0xbc8): undefined reference to `libintl_bindtextdomain' - -Fixes: - - http://autobuild.buildroot.org/results/894359558100ea9637feba16deaf99923805d0f2 - -Signed-off-by: Fabrice Fontaine -[Upstream status: -https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/merge_requests/101] ---- - meson.build | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 1cef125a3..973948108 100644 ---- a/meson.build -+++ b/meson.build -@@ -93,6 +93,7 @@ if cc.has_function('lrint', dependencies: mathlib_dep) - gdk_pixbuf_conf.set('HAVE_LRINT', 1) - endif - -+intl_dep = cc.find_library('intl', required: false) - if cc.has_function('bind_textdomain_codeset', prefix: '#include ') - gdk_pixbuf_conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1) - endif -@@ -212,7 +213,7 @@ if medialib_dep.found() - endif - - gdk_pixbuf_deps = [ mathlib_dep, glib_dep, gobject_dep, gmodule_dep, gio_dep, -- shared_mime_dep, medialib_dep ] -+ shared_mime_dep, medialib_dep, intl_dep ] - - # Check if we can build shared modules - if gmodule_dep.type_name() == 'pkgconfig' --- -2.29.2 - diff --git a/buildroot/package/gdk-pixbuf/0002-gdk-pixbuf-gdk-pixbuf-io.c-fix-build-without-gmodule.patch b/buildroot/package/gdk-pixbuf/0002-gdk-pixbuf-gdk-pixbuf-io.c-fix-build-without-gmodule.patch deleted file mode 100644 index 74bc967a6..000000000 --- a/buildroot/package/gdk-pixbuf/0002-gdk-pixbuf-gdk-pixbuf-io.c-fix-build-without-gmodule.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 46c7fe11bd0ed8595c3f920d42a9914fa864d893 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Sun, 7 Feb 2021 18:51:14 +0100 -Subject: [PATCH] gdk-pixbuf/gdk-pixbuf-io.c: fix build without gmodule - -Fix the following build failure: - -../gdk-pixbuf/gdk-pixbuf-io.c: In function 'gdk_pixbuf_io_init': -../gdk-pixbuf/gdk-pixbuf-io.c:681:16: error: implicit declaration of function 'gdk_pixbuf_get_module_file'; did you mean '_gdk_pixbuf_get_module'? [-Werror=implicit-function-declaration] - 681 | module_file = gdk_pixbuf_get_module_file (); - | ^~~~~~~~~~~~~~~~~~~~~~~~~~ - | _gdk_pixbuf_get_module - -Fixes: - - http://autobuild.buildroot.org/results/6cd54c497f5d19342ec94ece713547b887e4c02d - -Upstream status: Accepted -https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/merge_requests/103 - -Signed-off-by: Fabrice Fontaine ---- - gdk-pixbuf/gdk-pixbuf-io.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c -index 40eb920c8..2dc2ea6da 100644 ---- a/gdk-pixbuf/gdk-pixbuf-io.c -+++ b/gdk-pixbuf/gdk-pixbuf-io.c -@@ -678,7 +678,9 @@ gdk_pixbuf_io_init (void) - gboolean ret; - - gdk_pixbuf_io_init_builtin (); -+#ifdef USE_GMODULE - module_file = gdk_pixbuf_get_module_file (); -+#endif - ret = gdk_pixbuf_io_init_modules (module_file, NULL); - g_free (module_file); - return ret; --- -2.29.2 - diff --git a/buildroot/package/gdk-pixbuf/Config.in b/buildroot/package/gdk-pixbuf/Config.in index 44942ac4f..0ba6dda8a 100644 --- a/buildroot/package/gdk-pixbuf/Config.in +++ b/buildroot/package/gdk-pixbuf/Config.in @@ -9,7 +9,7 @@ config BR2_PACKAGE_GDK_PIXBUF Gdk-Pixbuf is an image loader and scaler. It uses GObject and the GLib, to integrate well with GNOME applications. - http://www.gtk.org/ + https://www.gtk.org/ comment "gdk-pixbuf needs a toolchain w/ wchar, threads" depends on BR2_USE_MMU diff --git a/buildroot/package/gdk-pixbuf/gdk-pixbuf.hash b/buildroot/package/gdk-pixbuf/gdk-pixbuf.hash index be7593aeb..5e7dc7e03 100644 --- a/buildroot/package/gdk-pixbuf/gdk-pixbuf.hash +++ b/buildroot/package/gdk-pixbuf/gdk-pixbuf.hash @@ -1,4 +1,3 @@ -# From http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.2.sha256sum -sha256 83c66a1cfd591d7680c144d2922c5955d38b4db336d7cd3ee109f7bcf9afef15 gdk-pixbuf-2.42.2.tar.xz -# Locally calculated +# From https://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.4.sha256sum +sha256 fe9c5dd88f486194ea2bc09b8814c1ed895bb6c530f37cbbf259757c4e482e4d gdk-pixbuf-2.42.4.tar.xz sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING diff --git a/buildroot/package/gdk-pixbuf/gdk-pixbuf.mk b/buildroot/package/gdk-pixbuf/gdk-pixbuf.mk index 1bd422c0a..cd30d450d 100644 --- a/buildroot/package/gdk-pixbuf/gdk-pixbuf.mk +++ b/buildroot/package/gdk-pixbuf/gdk-pixbuf.mk @@ -5,7 +5,7 @@ ################################################################################ GDK_PIXBUF_VERSION_MAJOR = 2.42 -GDK_PIXBUF_VERSION = $(GDK_PIXBUF_VERSION_MAJOR).2 +GDK_PIXBUF_VERSION = $(GDK_PIXBUF_VERSION_MAJOR).4 GDK_PIXBUF_SOURCE = gdk-pixbuf-$(GDK_PIXBUF_VERSION).tar.xz GDK_PIXBUF_SITE = http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/$(GDK_PIXBUF_VERSION_MAJOR) GDK_PIXBUF_LICENSE = LGPL-2.1+ diff --git a/buildroot/package/gesftpserver/gesftpserver.mk b/buildroot/package/gesftpserver/gesftpserver.mk index 85511a3c9..20ad92d25 100644 --- a/buildroot/package/gesftpserver/gesftpserver.mk +++ b/buildroot/package/gesftpserver/gesftpserver.mk @@ -23,6 +23,10 @@ GESFTPSERVER_DEPENDENCIES += \ $(if $(BR2_ENABLE_LOCALE),,libiconv) \ $(if $(BR2_PACKAGE_OPENSSH),openssh) +# Python on the host is only used for tests, which we don't use in +# Buildroot +GESFTPSERVER_CONF_ENV += rjk_cv_python24=false + # openssh/dropbear looks here define GESFTPSERVER_ADD_SYMLINK ln -sf gesftpserver $(TARGET_DIR)/usr/libexec/sftp-server diff --git a/buildroot/package/glibc/2.32-37-g760e1d287825fa91d4d5a0cc921340c740d803e2/glibc.hash b/buildroot/package/glibc/2.32-50-g737efa27fca5c97f566a2005687fda7d6659cd2e/glibc.hash similarity index 70% rename from buildroot/package/glibc/2.32-37-g760e1d287825fa91d4d5a0cc921340c740d803e2/glibc.hash rename to buildroot/package/glibc/2.32-50-g737efa27fca5c97f566a2005687fda7d6659cd2e/glibc.hash index b1d5243fc..5e00ef7c0 100644 --- a/buildroot/package/glibc/2.32-37-g760e1d287825fa91d4d5a0cc921340c740d803e2/glibc.hash +++ b/buildroot/package/glibc/2.32-50-g737efa27fca5c97f566a2005687fda7d6659cd2e/glibc.hash @@ -1,5 +1,5 @@ # Locally calculated (fetched from Github) -sha256 f4710e9a435a7b83e1d23dd75434f0d36b898eba9b4249c946c32b467d852fd4 glibc-2.32-37-g760e1d287825fa91d4d5a0cc921340c740d803e2.tar.gz +sha256 b634d38ace90752eeecb93246d71c0673bab0db8dfbd69333479ae7b10d63410 glibc-2.32-50-g737efa27fca5c97f566a2005687fda7d6659cd2e.tar.gz # Hashes for license files sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING diff --git a/buildroot/package/glibc/glibc.mk b/buildroot/package/glibc/glibc.mk index f84f670fc..14c3f0359 100644 --- a/buildroot/package/glibc/glibc.mk +++ b/buildroot/package/glibc/glibc.mk @@ -16,7 +16,7 @@ ifeq ($(BR2_RISCV_32),y) # Until 2.33 is released, just use master GLIBC_VERSION = 2.32.9000-69-gbd394d131c10c9ec22c6424197b79410042eed99 else -GLIBC_VERSION = 2.32-37-g760e1d287825fa91d4d5a0cc921340c740d803e2 +GLIBC_VERSION = 2.32-50-g737efa27fca5c97f566a2005687fda7d6659cd2e endif # Upstream doesn't officially provide an https download link. # There is one (https://sourceware.org/git/glibc.git) but it's not reliable, diff --git a/buildroot/package/go/go.hash b/buildroot/package/go/go.hash index e077d5544..d89c01911 100644 --- a/buildroot/package/go/go.hash +++ b/buildroot/package/go/go.hash @@ -1,3 +1,3 @@ # From https://golang.org/dl/ -sha256 99069e7223479cce4553f84f874b9345f6f4045f27cf5089489b546da619a244 go1.15.13.src.tar.gz +sha256 0662ae3813330280d5f1a97a2ee23bbdbe3a5a7cfa6001b24a9873a19a0dc7ec go1.15.15.src.tar.gz sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE diff --git a/buildroot/package/go/go.mk b/buildroot/package/go/go.mk index 3d1dcf02d..913ee6848 100644 --- a/buildroot/package/go/go.mk +++ b/buildroot/package/go/go.mk @@ -4,7 +4,7 @@ # ################################################################################ -GO_VERSION = 1.15.13 +GO_VERSION = 1.15.15 GO_SITE = https://storage.googleapis.com/golang GO_SOURCE = go$(GO_VERSION).src.tar.gz diff --git a/buildroot/package/gptfdisk/gptfdisk.hash b/buildroot/package/gptfdisk/gptfdisk.hash index 7894f2187..caded358e 100644 --- a/buildroot/package/gptfdisk/gptfdisk.hash +++ b/buildroot/package/gptfdisk/gptfdisk.hash @@ -1,5 +1,5 @@ -# From http://sourceforge.net/projects/gptfdisk/files/gptfdisk/1.0.7/ -sha1 406ab2596e1911c916dce677ce7e903076d94c6d gptfdisk-1.0.7.tar.gz +# From http://sourceforge.net/projects/gptfdisk/files/gptfdisk/1.0.8/ +sha1 c8824e779056158fa32887e415f5399a8646c3c5 gptfdisk-1.0.8.tar.gz # Locally computed -sha256 754004b7f85b279287c7ac3c0469b1d7e0eae043a97a2e587b0560ca5f3828c0 gptfdisk-1.0.7.tar.gz +sha256 95d19856f004dabc4b8c342b2612e8d0a9eebdd52004297188369f152e9dc6df gptfdisk-1.0.8.tar.gz sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c COPYING diff --git a/buildroot/package/gptfdisk/gptfdisk.mk b/buildroot/package/gptfdisk/gptfdisk.mk index d92a52710..9869975f5 100644 --- a/buildroot/package/gptfdisk/gptfdisk.mk +++ b/buildroot/package/gptfdisk/gptfdisk.mk @@ -4,7 +4,7 @@ # ################################################################################ -GPTFDISK_VERSION = 1.0.7 +GPTFDISK_VERSION = 1.0.8 GPTFDISK_SITE = http://downloads.sourceforge.net/sourceforge/gptfdisk GPTFDISK_LICENSE = GPL-2.0+ GPTFDISK_LICENSE_FILES = COPYING diff --git a/buildroot/package/gqrx/Config.in b/buildroot/package/gqrx/Config.in index af4d69381..60942c36c 100644 --- a/buildroot/package/gqrx/Config.in +++ b/buildroot/package/gqrx/Config.in @@ -3,7 +3,7 @@ comment "gqrx needs a toolchain w/ C++, threads, wchar, dynamic library" depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC depends on BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \ - !BR2_USE_WCHAR || !BR2_STATIC_LIBS + !BR2_USE_WCHAR || BR2_STATIC_LIBS comment "gqrx needs qt5" depends on !BR2_PACKAGE_QT5 diff --git a/buildroot/package/granite/granite.mk b/buildroot/package/granite/granite.mk index d5dd1fa1f..037113f71 100644 --- a/buildroot/package/granite/granite.mk +++ b/buildroot/package/granite/granite.mk @@ -6,10 +6,17 @@ GRANITE_VERSION = 5.4.0 GRANITE_SITE = $(call github,elementary,granite,$(GRANITE_VERSION)) -GRANITE_DEPENDENCIES = host-pkgconf host-vala libgee libglib2 libgtk3 +GRANITE_DEPENDENCIES = \ + host-pkgconf \ + host-vala \ + libgee \ + libglib2 \ + libgtk3 \ + $(TARGET_NLS_DEPENDENCIES) GRANITE_INSTALL_STAGING = YES GRANITE_LICENSE = LGPL-3.0+ GRANITE_LICENSE_FILES = COPYING +GRANITE_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS) ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y) GRANITE_CONF_OPTS += -Dintrospection=true diff --git a/buildroot/package/guile/0004-module-system-base-target.scm-support-riscv32.patch b/buildroot/package/guile/0004-module-system-base-target.scm-support-riscv32.patch new file mode 100644 index 000000000..a988d2d99 --- /dev/null +++ b/buildroot/package/guile/0004-module-system-base-target.scm-support-riscv32.patch @@ -0,0 +1,33 @@ +From 6142350d7c0562b0525462abdd41309ae0faa2eb Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Fri, 6 Aug 2021 19:49:37 +0200 +Subject: [PATCH] module/system/base/target.scm: support riscv32 + +Fix the following build failure on riscv32: + +system/base/target.scm:132:16: In procedure triplet-pointer-size: +unknown CPU word size "riscv32" + +Fixes: + - http://autobuild.buildroot.org/results/6705630c1484239ec8b73d57ebc2e2570fbfc8f8 + +Signed-off-by: Fabrice Fontaine +--- + module/system/base/target.scm | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/module/system/base/target.scm b/module/system/base/target.scm +index 2088cd866..dba46664d 100644 +--- a/module/system/base/target.scm ++++ b/module/system/base/target.scm +@@ -116,6 +116,7 @@ + + ((string-match "^x86_64-.*-gnux32" triplet) 4) ; x32 + ++ ((string-match "32$" cpu) 4) + ((string-match "64$" cpu) 8) + ((string-match "64_?[lbe][lbe]$" cpu) 8) + ((member cpu '("sparc" "powerpc" "mips" "mipsel" "nios2" "m68k" "sh3" "sh4")) 4) +-- +2.30.2 + diff --git a/buildroot/package/hdparm/Config.in b/buildroot/package/hdparm/Config.in index 52385b18c..17ecb65ce 100644 --- a/buildroot/package/hdparm/Config.in +++ b/buildroot/package/hdparm/Config.in @@ -2,6 +2,6 @@ config BR2_PACKAGE_HDPARM bool "hdparm" depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS help - hdparm - get/set hard disk parameters for Linux IDE drives. + hdparm - get/set ATA/SATA drive parameters under Linux - http://www.ibiblio.org/pub/Linux/system/hardware/ + https://sourceforge.net/projects/hdparm/ diff --git a/buildroot/package/hdparm/hdparm.hash b/buildroot/package/hdparm/hdparm.hash index b35da4527..b37826caf 100644 --- a/buildroot/package/hdparm/hdparm.hash +++ b/buildroot/package/hdparm/hdparm.hash @@ -1,6 +1,5 @@ -# From http://sourceforge.net/projects/hdparm/files/hdparm/ -md5 25a791d47236c58801f8b27074f3ef93 hdparm-9.60.tar.gz -sha1 f15378cf533f79dbbc040cd77183137d24292ecc hdparm-9.60.tar.gz +# From https://sourceforge.net/projects/hdparm/files/hdparm/ +sha1 100b9a5551b71d87b446b415d56c5d45ac41d131 hdparm-9.62.tar.gz # Locally computed -sha256 8397739c73e44d5ab96c4aef28fa9c0147276d53a1b5657ce04c4565cf6635cc hdparm-9.60.tar.gz +sha256 2c0f9d75cdbeda928a25a128cd3d0b7120445ec0910c0b29d4c1038ed1be777f hdparm-9.62.tar.gz sha256 eae572b06d2733f5c65fbe81680ce2b8a109afee2bdd1a161343c772af0e82e1 LICENSE.TXT diff --git a/buildroot/package/hdparm/hdparm.mk b/buildroot/package/hdparm/hdparm.mk index d9470ef7f..6a71c14fa 100644 --- a/buildroot/package/hdparm/hdparm.mk +++ b/buildroot/package/hdparm/hdparm.mk @@ -4,8 +4,8 @@ # ################################################################################ -HDPARM_VERSION = 9.60 -HDPARM_SITE = http://downloads.sourceforge.net/project/hdparm/hdparm +HDPARM_VERSION = 9.62 +HDPARM_SITE = https://downloads.sourceforge.net/project/hdparm/hdparm HDPARM_LICENSE = BSD-Style HDPARM_LICENSE_FILES = LICENSE.TXT diff --git a/buildroot/package/heirloom-mailx/heirloom-mailx.mk b/buildroot/package/heirloom-mailx/heirloom-mailx.mk index 2f7e635e0..b3cece0cf 100644 --- a/buildroot/package/heirloom-mailx/heirloom-mailx.mk +++ b/buildroot/package/heirloom-mailx/heirloom-mailx.mk @@ -9,6 +9,8 @@ HEIRLOOM_MAILX_SOURCE = heirloom-mailx_$(HEIRLOOM_MAILX_VERSION).orig.tar.gz HEIRLOOM_MAILX_SITE = http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/h/heirloom-mailx HEIRLOOM_MAILX_LICENSE = BSD-4-Clause, Bellcore (base64), OpenVision (imap_gssapi), RSA Data Security (md5), Network Working Group (hmac), MPL-1.1 (nss) HEIRLOOM_MAILX_LICENSE_FILES = COPYING +HEIRLOOM_MAILX_CPE_ID_VENDOR = heirloom +HEIRLOOM_MAILX_CPE_ID_PRODUCT = mailx ifeq ($(BR2_PACKAGE_OPENSSL),y) HEIRLOOM_MAILX_DEPENDENCIES += openssl diff --git a/buildroot/package/htop/htop.hash b/buildroot/package/htop/htop.hash index 647feabb8..34d95eb7a 100644 --- a/buildroot/package/htop/htop.hash +++ b/buildroot/package/htop/htop.hash @@ -1,3 +1,3 @@ # Locally calculated -sha256 19535f8f01ac08be2df880c93c9cedfc50fa92320d48e3ef92a30b6edc4d1917 htop-3.0.5.tar.gz +sha256 123476d56a5e6a219654eebb6b2ec747dfa364f39c01a6475bf8030a25c81bff htop-ce6d60e7def146c13d0b8bca4642e7401a0a8995.tar.gz sha256 c228cc14df980a23ea0c3c9ac957b904dd6a8514f6283db403de22e9179471be COPYING diff --git a/buildroot/package/htop/htop.mk b/buildroot/package/htop/htop.mk index aa2ff2475..bb2bcb29a 100644 --- a/buildroot/package/htop/htop.mk +++ b/buildroot/package/htop/htop.mk @@ -4,9 +4,15 @@ # ################################################################################ -HTOP_VERSION = 3.0.5 -HTOP_SITE = https://dl.bintray.com/htop/source +# This commit hash corresponds to version 3.0.5. +# htop sources were moved from bintray to github and the sources tar archive +# was also changed (the build process requires `HTOP_AUTORECONF = YES` now). We +# use commit hash instead of git tag here to avoid breaking existing source +# caches +HTOP_VERSION = ce6d60e7def146c13d0b8bca4642e7401a0a8995 +HTOP_SITE = $(call github,htop-dev,htop,$(HTOP_VERSION)) HTOP_DEPENDENCIES = ncurses +HTOP_AUTORECONF = YES # Prevent htop build system from searching the host paths HTOP_CONF_ENV = HTOP_NCURSES_CONFIG_SCRIPT=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS) HTOP_LICENSE = GPL-2.0 diff --git a/buildroot/package/ibrcommon/ibrcommon.mk b/buildroot/package/ibrcommon/ibrcommon.mk index 4d2d351c8..d9e843ebc 100644 --- a/buildroot/package/ibrcommon/ibrcommon.mk +++ b/buildroot/package/ibrcommon/ibrcommon.mk @@ -10,6 +10,7 @@ IBRCOMMON_INSTALL_STAGING = YES IBRCOMMON_LICENSE = Apache-2.0 IBRCOMMON_LICENSE_FILES = COPYING README IBRCOMMON_DEPENDENCIES = host-pkgconf +IBRCOMMON_CONF_ENV = CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" ifeq ($(BR2_PACKAGE_OPENSSL),y) IBRCOMMON_DEPENDENCIES += openssl diff --git a/buildroot/package/ibrdtn-tools/ibrdtn-tools.mk b/buildroot/package/ibrdtn-tools/ibrdtn-tools.mk index 97ec3c9e1..77dbfc103 100644 --- a/buildroot/package/ibrdtn-tools/ibrdtn-tools.mk +++ b/buildroot/package/ibrdtn-tools/ibrdtn-tools.mk @@ -9,6 +9,7 @@ IBRDTN_TOOLS_SITE = https://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases IBRDTN_TOOLS_LICENSE = Apache-2.0 IBRDTN_TOOLS_LICENSE_FILES = COPYING IBRDTN_TOOLS_DEPENDENCIES = ibrcommon ibrdtn host-pkgconf +IBRDTN_TOOLS_CONF_ENV = CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" ifeq ($(BR2_STATIC_LIBS),y) IBRDTN_TOOLS_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread" diff --git a/buildroot/package/ibrdtn/ibrdtn.mk b/buildroot/package/ibrdtn/ibrdtn.mk index 3f805c402..99ff92d44 100644 --- a/buildroot/package/ibrdtn/ibrdtn.mk +++ b/buildroot/package/ibrdtn/ibrdtn.mk @@ -10,6 +10,7 @@ IBRDTN_INSTALL_STAGING = YES IBRDTN_LICENSE = Apache-2.0 IBRDTN_LICENSE_FILES = COPYING IBRDTN_DEPENDENCIES = ibrcommon host-pkgconf +IBRDTN_CONF_ENV = CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" ifeq ($(BR2_PACKAGE_ZLIB),y) IBRDTN_CONF_OPTS += --with-compression diff --git a/buildroot/package/ibrdtnd/ibrdtnd.mk b/buildroot/package/ibrdtnd/ibrdtnd.mk index 0632ed36b..20ac496fe 100644 --- a/buildroot/package/ibrdtnd/ibrdtnd.mk +++ b/buildroot/package/ibrdtnd/ibrdtnd.mk @@ -18,7 +18,9 @@ IBRDTND_CONF_OPTS = \ --without-vmime # don't build documentation -IBRDTND_CONF_ENV = PDFLATEX='no' +IBRDTND_CONF_ENV = \ + PDFLATEX='no' \ + CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" ifeq ($(BR2_PACKAGE_LIBDAEMON),y) IBRDTND_CONF_OPTS += --enable-libdaemon diff --git a/buildroot/package/intel-microcode/intel-microcode.hash b/buildroot/package/intel-microcode/intel-microcode.hash index 23191d953..6687d4c0e 100644 --- a/buildroot/package/intel-microcode/intel-microcode.hash +++ b/buildroot/package/intel-microcode/intel-microcode.hash @@ -1,3 +1,3 @@ # Locally computed -sha256 b855c81f78705f35341248a0603aa1a6e199ca7f59cd425e061b579329aa9eaa intel-microcode-20210216.tar.gz +sha256 fd85b6b769efd029dec6a2c07106fd18fb4dcb548b7bc4cde09295a8344ef6d7 intel-microcode-20210608.tar.gz sha256 03efb1491c7e899feb2665fa299363e64035e5444c1b8bc1f6ebed30de964e12 license diff --git a/buildroot/package/intel-microcode/intel-microcode.mk b/buildroot/package/intel-microcode/intel-microcode.mk index 208900388..af7f6fa80 100644 --- a/buildroot/package/intel-microcode/intel-microcode.mk +++ b/buildroot/package/intel-microcode/intel-microcode.mk @@ -4,7 +4,7 @@ # ################################################################################ -INTEL_MICROCODE_VERSION = 20210216 +INTEL_MICROCODE_VERSION = 20210608 INTEL_MICROCODE_SITE = $(call github,intel,Intel-Linux-Processor-Microcode-Data-Files,microcode-$(INTEL_MICROCODE_VERSION)) INTEL_MICROCODE_LICENSE = PROPRIETARY INTEL_MICROCODE_LICENSE_FILES = license diff --git a/buildroot/package/iodine/iodine.mk b/buildroot/package/iodine/iodine.mk index 711d709c1..5de638918 100644 --- a/buildroot/package/iodine/iodine.mk +++ b/buildroot/package/iodine/iodine.mk @@ -9,6 +9,7 @@ IODINE_SITE = http://code.kryo.se/iodine IODINE_DEPENDENCIES = zlib IODINE_LICENSE = MIT IODINE_LICENSE_FILES = README +IODINE_CPE_ID_VENDOR = kryo IODINE_CFLAGS = $(TARGET_CFLAGS) diff --git a/buildroot/package/irqbalance/0002-configure.ac-use-pkg-config-to-find-numa.patch b/buildroot/package/irqbalance/0002-configure.ac-use-pkg-config-to-find-numa.patch new file mode 100644 index 000000000..751367ccf --- /dev/null +++ b/buildroot/package/irqbalance/0002-configure.ac-use-pkg-config-to-find-numa.patch @@ -0,0 +1,38 @@ +From 274cb8ea470a10ce46b783e77784b0eb08cf20d8 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sun, 1 Aug 2021 23:26:01 +0200 +Subject: [PATCH] configure.ac: use pkg-config to find numa + +Use pkg-config to find numa and fallback to current mechanism. +Thanks to pkg-config, numa dependencies such as -latomic will be +retrieved. + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/Irqbalance/irqbalance/pull/188] +--- + configure.ac | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index c45b9ce..50c62ba 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -23,7 +23,14 @@ AC_CHECK_HEADERS([numa.h]) + + AC_CHECK_FUNCS(getopt_long) + +-AC_CHECK_LIB(numa, numa_available) ++PKG_CHECK_MODULES([NUMA], [numa], [has_numa=yes], [AC_CHECK_LIB(numa, numa_available)]) ++AS_IF([test "x$has_numa" = "xyes"], [ ++ AC_SUBST([NUMA_CFLAGS]) ++ AC_SUBST([NUMA_LIBS]) ++ LIBS="$LIBS $NUMA_LIBS" ++ AC_SUBST([LIBS]) ++]) ++ + AC_CHECK_LIB(m, floor) + + PKG_CHECK_MODULES([GLIB2], [glib-2.0], [], [AC_MSG_ERROR([glib-2.0 is required])]) +-- +2.30.2 + diff --git a/buildroot/package/keepalived/0001-core-Fix-compiling-on-RHEL-9.patch b/buildroot/package/keepalived/0001-core-Fix-compiling-on-RHEL-9.patch new file mode 100644 index 000000000..39134fcc3 --- /dev/null +++ b/buildroot/package/keepalived/0001-core-Fix-compiling-on-RHEL-9.patch @@ -0,0 +1,34 @@ +From 3fd0c21e4f63ac0a52b5d7a09575f0f364972e4d Mon Sep 17 00:00:00 2001 +From: Quentin Armitage +Date: Tue, 8 Jun 2021 08:57:45 +0100 +Subject: [PATCH] core: Fix compiling on RHEL 9 + +Signed-off-by: Quentin Armitage + +[Retrieved from: +https://github.com/acassen/keepalived/commit/3fd0c21e4f63ac0a52b5d7a09575f0f364972e4d] +Signed-off-by: Fabrice Fontaine +--- + keepalived/core/layer4.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/keepalived/core/layer4.c b/keepalived/core/layer4.c +index d2cc971a3..fdca04913 100644 +--- a/keepalived/core/layer4.c ++++ b/keepalived/core/layer4.c +@@ -27,13 +27,14 @@ + #include + #include + #include ++#include ++#include + #include + #include + #ifdef ERRQUEUE_NEEDS_SYS_TIME + #include + #endif + #include +-#include + + #include "layer4.h" + #include "logger.h" diff --git a/buildroot/package/libass/libass.hash b/buildroot/package/libass/libass.hash index cd3c3af61..882bc456a 100644 --- a/buildroot/package/libass/libass.hash +++ b/buildroot/package/libass/libass.hash @@ -1,3 +1,3 @@ # Locally computed -sha256 9f09230c9a0aa68ef7aa6a9e2ab709ca957020f842e52c5b2e52b801a7d9e833 libass-0.15.0.tar.xz +sha256 1cdd39c9d007b06e737e7738004d7f38cf9b1e92843f37307b24e7ff63ab8e53 libass-0.15.1.tar.xz sha256 f7e30699d02798351e7f839e3d3bfeb29ce65e44efa7735c225464c4fd7dfe9c COPYING diff --git a/buildroot/package/libass/libass.mk b/buildroot/package/libass/libass.mk index 48e70a52c..515f87c68 100644 --- a/buildroot/package/libass/libass.mk +++ b/buildroot/package/libass/libass.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBASS_VERSION = 0.15.0 +LIBASS_VERSION = 0.15.1 LIBASS_SOURCE = libass-$(LIBASS_VERSION).tar.xz # Do not use the github helper here, the generated tarball is *NOT* # the same as the one uploaded by upstream for the release. diff --git a/buildroot/package/libconfig/0001-Add-disable-doc-option.patch b/buildroot/package/libconfig/0001-Add-disable-doc-option.patch deleted file mode 100644 index ac323eba2..000000000 --- a/buildroot/package/libconfig/0001-Add-disable-doc-option.patch +++ /dev/null @@ -1,54 +0,0 @@ -From a0301bde126c2b08b50e789fd025a8c513c914c3 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Sat, 28 Apr 2018 19:15:22 +0200 -Subject: [PATCH] Add --disable-doc option - -Signed-off-by: Fabrice Fontaine ---- - Makefile.am | 6 +++++- - configure.ac | 12 ++++++++++++ - 2 files changed, 17 insertions(+), 1 deletion(-) - -diff --git a/Makefile.am b/Makefile.am -index 50ef4fa..e94d3ec 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -1,7 +1,11 @@ - - ACLOCAL_AMFLAGS = -I m4 - --SUBDIRS = lib doc tinytest tests -+SUBDIRS = lib tinytest tests -+ -+if BUILDDOC -+SUBDIRS += doc -+endif - - if BUILDEXAMPLES - SUBDIRS += examples -diff --git a/configure.ac b/configure.ac -index 62c5c56..8a14855 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -99,6 +99,18 @@ docxx=yes - - AM_CONDITIONAL(BUILDCXX, test x$docxx = xyes) - -+dodoc=yes -+ -+AC_ARG_ENABLE(doc, -+AS_HELP_STRING([--disable-doc], [Disable building of the documentation]), -+[if test "$enableval" = "no"; then dodoc="no"; fi], -+[ -+dodoc=yes -+] -+) -+ -+AM_CONDITIONAL(BUILDDOC, test x$dodoc = xyes) -+ - doexamples=yes - - AC_ARG_ENABLE(examples, --- -2.14.1 - diff --git a/buildroot/package/libconfig/libconfig.hash b/buildroot/package/libconfig/libconfig.hash index e056a17de..d359301d6 100644 --- a/buildroot/package/libconfig/libconfig.hash +++ b/buildroot/package/libconfig/libconfig.hash @@ -1,3 +1,3 @@ # Locally computed: -sha256 f67ac44099916ae260a6c9e290a90809e7d782d96cdd462cac656ebc5b685726 libconfig-1.7.2.tar.gz +sha256 545166d6cac037744381d1e9cc5a5405094e7bfad16a411699bcff40bbb31ee7 libconfig-1.7.3.tar.gz sha256 d80c9d084ebfb50ea1ed91bfbc2410d6ce542097a32c43b00781b83adcb8c77f COPYING.LIB diff --git a/buildroot/package/libconfig/libconfig.mk b/buildroot/package/libconfig/libconfig.mk index a127f9bcc..6cdf60318 100644 --- a/buildroot/package/libconfig/libconfig.mk +++ b/buildroot/package/libconfig/libconfig.mk @@ -4,14 +4,12 @@ # ################################################################################ -LIBCONFIG_VERSION = 1.7.2 -LIBCONFIG_SITE = $(call github,hyperrealm,libconfig,v$(LIBCONFIG_VERSION)) +LIBCONFIG_VERSION = 1.7.3 +LIBCONFIG_SITE = https://github.com/hyperrealm/libconfig/releases/download/v$(LIBCONFIG_VERSION) LIBCONFIG_LICENSE = LGPL-2.1+ LIBCONFIG_LICENSE_FILES = COPYING.LIB LIBCONFIG_INSTALL_STAGING = YES -# From git -LIBCONFIG_AUTORECONF = YES -LIBCONFIG_CONF_OPTS = --disable-examples +LIBCONFIG_CONF_OPTS = --disable-examples --disable-tests ifneq ($(BR2_INSTALL_LIBSTDCPP),y) LIBCONFIG_CONF_OPTS += --disable-cxx diff --git a/buildroot/package/libcurl/0001-bearssl-remove-incorrect-const-on-variable-that-is-m.patch b/buildroot/package/libcurl/0001-bearssl-remove-incorrect-const-on-variable-that-is-m.patch deleted file mode 100644 index b88791fa4..000000000 --- a/buildroot/package/libcurl/0001-bearssl-remove-incorrect-const-on-variable-that-is-m.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a03ea6223950002eba8b1ef0df3133c62f387d6b Mon Sep 17 00:00:00 2001 -From: Michael Forney -Date: Tue, 25 May 2021 23:42:07 -0700 -Subject: [PATCH] bearssl: remove incorrect const on variable that is modified - -hostname may be set to NULL later on in this function if it is an -IP address. - -Closes #7133 - -[peter@korsgaard.com: backported from upstream] -Signed-off-by: Peter Korsgaard ---- - lib/vtls/bearssl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/vtls/bearssl.c b/lib/vtls/bearssl.c -index 7f729713d..40a5e7879 100644 ---- a/lib/vtls/bearssl.c -+++ b/lib/vtls/bearssl.c -@@ -300,7 +300,7 @@ static CURLcode bearssl_connect_step1(struct Curl_easy *data, - struct ssl_connect_data *connssl = &conn->ssl[sockindex]; - struct ssl_backend_data *backend = connssl->backend; - const char * const ssl_cafile = SSL_CONN_CONFIG(CAfile); -- const char * const hostname = SSL_HOST_NAME(); -+ const char *hostname = SSL_HOST_NAME(); - const bool verifypeer = SSL_CONN_CONFIG(verifypeer); - const bool verifyhost = SSL_CONN_CONFIG(verifyhost); - CURLcode ret; --- -2.20.1 - diff --git a/buildroot/package/libcurl/Config.in b/buildroot/package/libcurl/Config.in index b89c46f5e..0674701e0 100644 --- a/buildroot/package/libcurl/Config.in +++ b/buildroot/package/libcurl/Config.in @@ -5,7 +5,7 @@ config BR2_PACKAGE_LIBCURL Telnet, and Dict servers, using any of the supported protocols. - http://curl.haxx.se/ + https://curl.se/ if BR2_PACKAGE_LIBCURL diff --git a/buildroot/package/libcurl/libcurl.hash b/buildroot/package/libcurl/libcurl.hash index 183321588..5e5776d1e 100644 --- a/buildroot/package/libcurl/libcurl.hash +++ b/buildroot/package/libcurl/libcurl.hash @@ -1,5 +1,5 @@ # Locally calculated after checking pgp signature -# https://curl.haxx.se/download/curl-7.77.0.tar.xz.asc +# https://curl.se/download/curl-7.78.0.tar.xz.asc # signed with key 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2 -sha256 0f64582c54282f31c0de9f0a1a596b182776bd4df9a4c4a2a41bbeb54f62594b curl-7.77.0.tar.xz +sha256 be42766d5664a739c3974ee3dfbbcbe978a4ccb1fe628bb1d9b59ac79e445fb5 curl-7.78.0.tar.xz sha256 6fd1a1c008b5ef4c4741dd188c3f8af6944c14c25afa881eb064f98fb98358e7 COPYING diff --git a/buildroot/package/libcurl/libcurl.mk b/buildroot/package/libcurl/libcurl.mk index 53ff9836c..4e3c6d452 100644 --- a/buildroot/package/libcurl/libcurl.mk +++ b/buildroot/package/libcurl/libcurl.mk @@ -4,9 +4,9 @@ # ################################################################################ -LIBCURL_VERSION = 7.77.0 +LIBCURL_VERSION = 7.78.0 LIBCURL_SOURCE = curl-$(LIBCURL_VERSION).tar.xz -LIBCURL_SITE = https://curl.haxx.se/download +LIBCURL_SITE = https://curl.se/download LIBCURL_DEPENDENCIES = host-pkgconf \ $(if $(BR2_PACKAGE_ZLIB),zlib) \ $(if $(BR2_PACKAGE_RTMPDUMP),rtmpdump) @@ -19,7 +19,7 @@ LIBCURL_INSTALL_STAGING = YES # We disable NTLM support because it uses fork(), which doesn't work # on non-MMU platforms. Moreover, this authentication method is # probably almost never used. See -# http://curl.haxx.se/docs/manpage.html#--ntlm. +# http://curl.se/docs/manpage.html#--ntlm. # Likewise, there is no compiler on the target, so libcurl-option (to # generate C code) isn't very useful LIBCURL_CONF_OPTS = --disable-manual --disable-ntlm-wb \ diff --git a/buildroot/package/libfreeimage/libfreeimage.mk b/buildroot/package/libfreeimage/libfreeimage.mk index b254fa884..91299084a 100644 --- a/buildroot/package/libfreeimage/libfreeimage.mk +++ b/buildroot/package/libfreeimage/libfreeimage.mk @@ -9,6 +9,8 @@ LIBFREEIMAGE_SITE = http://downloads.sourceforge.net/freeimage LIBFREEIMAGE_SOURCE = FreeImage$(subst .,,$(LIBFREEIMAGE_VERSION)).zip LIBFREEIMAGE_LICENSE = GPL-2.0 or GPL-3.0 or FreeImage Public License LIBFREEIMAGE_LICENSE_FILES = license-gplv2.txt license-gplv3.txt license-fi.txt +LIBFREEIMAGE_CPE_ID_VENDOR = freeimage_project +LIBFREEIMAGE_CPE_ID_PRODUCT = freeimage LIBFREEIMAGE_INSTALL_STAGING = YES define LIBFREEIMAGE_EXTRACT_CMDS diff --git a/buildroot/package/libfuse3/libfuse3.hash b/buildroot/package/libfuse3/libfuse3.hash index 49c71f402..0414264bf 100644 --- a/buildroot/package/libfuse3/libfuse3.hash +++ b/buildroot/package/libfuse3/libfuse3.hash @@ -1,3 +1,3 @@ # Locally calculated sha256 checksums -sha256 c32527782cef620df58b162aa29901d1fb13253b029375d5860a2253a810344e libfuse3-3.10.3.tar.gz +sha256 bfcb2520fd83db29e9fefd57d3abd5285f38ad484739aeee8e03fbec9b2d984a libfuse3-3.10.4.tar.gz sha256 b8832d9caaa075bbbd2aef24efa09f8b7ab66a832812d88c602da0c7b4397fad LICENSE diff --git a/buildroot/package/libfuse3/libfuse3.mk b/buildroot/package/libfuse3/libfuse3.mk index b1624ba88..fc747c5bf 100644 --- a/buildroot/package/libfuse3/libfuse3.mk +++ b/buildroot/package/libfuse3/libfuse3.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBFUSE3_VERSION = 3.10.3 +LIBFUSE3_VERSION = 3.10.4 LIBFUSE3_SITE = $(call github,libfuse,libfuse,fuse-$(LIBFUSE3_VERSION)) LIBFUSE3_LICENSE = LGPL-2.1 LIBFUSE3_LICENSE_FILES = LICENSE @@ -15,7 +15,8 @@ LIBFUSE3_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv) LIBFUSE3_CONF_OPTS = \ -Dexamples=false \ -Dudevrulesdir=/lib/udev/rules.d \ - -Duseroot=false + -Duseroot=false \ + -Dtests=false define LIBFUSE3_DEVICES /dev/fuse c 666 0 0 10 229 0 0 - diff --git a/buildroot/package/libgcrypt/libgcrypt.hash b/buildroot/package/libgcrypt/libgcrypt.hash index 978ec8b29..26ec492e1 100644 --- a/buildroot/package/libgcrypt/libgcrypt.hash +++ b/buildroot/package/libgcrypt/libgcrypt.hash @@ -1,7 +1,7 @@ # From https://www.gnupg.org/download/integrity_check.html -sha1 29bd5d0a8f674d4521167dd518ef99b26d1e8f27 libgcrypt-1.9.2.tar.bz2 +sha1 6b18f453fee677078586279d96fb88e5df7b3f35 libgcrypt-1.9.3.tar.bz2 # Locally calculated after checking signature -# https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.9.2.tar.bz2.sig +# https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.9.3.tar.bz2.sig # using key D8692123C4065DEA5E0F3AB5249B39D24F25E3B6 -sha256 b2c10d091513b271e47177274607b1ffba3d95b188bbfa8797f948aec9053c5a libgcrypt-1.9.2.tar.bz2 +sha256 97ebe4f94e2f7e35b752194ce15a0f3c66324e0ff6af26659bbfb5ff2ec328fd libgcrypt-1.9.3.tar.bz2 sha256 ca0061fc1381a3ab242310e4b3f56389f28e3d460eb2fd822ed7a21c6f030532 COPYING.LIB diff --git a/buildroot/package/libgcrypt/libgcrypt.mk b/buildroot/package/libgcrypt/libgcrypt.mk index 9c1cd32ac..26be5d2f4 100644 --- a/buildroot/package/libgcrypt/libgcrypt.mk +++ b/buildroot/package/libgcrypt/libgcrypt.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBGCRYPT_VERSION = 1.9.2 +LIBGCRYPT_VERSION = 1.9.3 LIBGCRYPT_SOURCE = libgcrypt-$(LIBGCRYPT_VERSION).tar.bz2 LIBGCRYPT_LICENSE = LGPL-2.1+ LIBGCRYPT_LICENSE_FILES = COPYING.LIB diff --git a/buildroot/package/libgtk3/0001-no-gtk-doc.patch b/buildroot/package/libgtk3/0001-no-gtk-doc.patch index db15c6cba..e1d320802 100644 --- a/buildroot/package/libgtk3/0001-no-gtk-doc.patch +++ b/buildroot/package/libgtk3/0001-no-gtk-doc.patch @@ -14,7 +14,7 @@ Signed-off-by: Hadrien Boutteville --- a/gtk-doc.make +++ b/gtk-doc.make -@@ -299,7 +299,7 @@ +@@ -300,7 +300,7 @@ # # Require gtk-doc when making dist # diff --git a/buildroot/package/libgtk3/0002-fix-introspection-check.patch b/buildroot/package/libgtk3/0002-fix-introspection-check.patch index 90f5facbb..450505c91 100644 --- a/buildroot/package/libgtk3/0002-fix-introspection-check.patch +++ b/buildroot/package/libgtk3/0002-fix-introspection-check.patch @@ -14,7 +14,7 @@ Signed-off-by: Hadrien Boutteville --- a/configure.ac +++ b/configure.ac -@@ -1685,7 +1685,10 @@ +@@ -1650,7 +1650,10 @@ # GObject introspection ################################################## diff --git a/buildroot/package/libgtk3/libgtk3.hash b/buildroot/package/libgtk3/libgtk3.hash index 22cf16dad..149399868 100644 --- a/buildroot/package/libgtk3/libgtk3.hash +++ b/buildroot/package/libgtk3/libgtk3.hash @@ -1,5 +1,5 @@ -# From https://download.gnome.org/sources/gtk+/3.24/gtk+-3.24.24.sha256sum -sha256 cc9d4367c55b724832f6b09ab85481738ea456871f0381768a6a99335a98378a gtk+-3.24.24.tar.xz +# From https://download.gnome.org/sources/gtk+/3.24/gtk+-3.24.30.sha256sum +sha256 ba75bfff320ad1f4cfbee92ba813ec336322cc3c660d406aad014b07087a3ba9 gtk+-3.24.30.tar.xz # Hash for license file: sha256 b7993225104d90ddd8024fd838faf300bea5e83d91203eab98e29512acebd69c COPYING diff --git a/buildroot/package/libgtk3/libgtk3.mk b/buildroot/package/libgtk3/libgtk3.mk index 9ece409ba..80a2affd8 100644 --- a/buildroot/package/libgtk3/libgtk3.mk +++ b/buildroot/package/libgtk3/libgtk3.mk @@ -5,7 +5,7 @@ ################################################################################ LIBGTK3_VERSION_MAJOR = 3.24 -LIBGTK3_VERSION = $(LIBGTK3_VERSION_MAJOR).24 +LIBGTK3_VERSION = $(LIBGTK3_VERSION_MAJOR).30 LIBGTK3_SOURCE = gtk+-$(LIBGTK3_VERSION).tar.xz LIBGTK3_SITE = http://ftp.gnome.org/pub/gnome/sources/gtk+/$(LIBGTK3_VERSION_MAJOR) LIBGTK3_LICENSE = LGPL-2.0+ diff --git a/buildroot/package/libgudev/libgudev.mk b/buildroot/package/libgudev/libgudev.mk index 63d592f9a..9aa64c2c2 100644 --- a/buildroot/package/libgudev/libgudev.mk +++ b/buildroot/package/libgudev/libgudev.mk @@ -13,4 +13,11 @@ LIBGUDEV_LICENSE = LGPL-2.1+ LIBGUDEV_LICENSE_FILES = COPYING LIBGUDEV_CONF_OPTS = --disable-umockdev +ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y) +LIBGUDEV_CONF_OPTS += --enable-introspection +LIBGUDEV_DEPENDENCIES += gobject-introspection +else +LIBGUDEV_CONF_OPTS += --disable-introspection +endif + $(eval $(autotools-package)) diff --git a/buildroot/package/libhtp/libhtp.hash b/buildroot/package/libhtp/libhtp.hash index 805cd4f1f..91c20697d 100644 --- a/buildroot/package/libhtp/libhtp.hash +++ b/buildroot/package/libhtp/libhtp.hash @@ -1,3 +1,3 @@ # Locally computed: -sha256 0f8296ce9db815bbedc1c8a0b738dd25146fdaf910995a8c5f8e147799902b7e libhtp-0.5.37.tar.gz +sha256 8365f338fdf5ef0f3b37f3cb4e2670d218c843eccc42aa87119819c0f018ef39 libhtp-0.5.38.tar.gz sha256 87c93904e5434c81622ea690c2b90097b9f162aaa92a96542649a157dbf98d15 LICENSE diff --git a/buildroot/package/libhtp/libhtp.mk b/buildroot/package/libhtp/libhtp.mk index 752034603..982ffe81c 100644 --- a/buildroot/package/libhtp/libhtp.mk +++ b/buildroot/package/libhtp/libhtp.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBHTP_VERSION = 0.5.37 +LIBHTP_VERSION = 0.5.38 LIBHTP_SITE = $(call github,OISF,libhtp,$(LIBHTP_VERSION)) LIBHTP_LICENSE = BSD-3-Clause LIBHTP_LICENSE_FILES = LICENSE diff --git a/buildroot/package/libjson/libjson.mk b/buildroot/package/libjson/libjson.mk index d04ddc40f..73268c9cc 100644 --- a/buildroot/package/libjson/libjson.mk +++ b/buildroot/package/libjson/libjson.mk @@ -11,7 +11,7 @@ LIBJSON_INSTALL_STAGING = YES LIBJSON_LICENSE = BSD-2-Clause LIBJSON_LICENSE_FILES = License.txt -LIBJSON_CXXFLAGS = $(TARGET_CFLAGS) -DNDEBUG +LIBJSON_CXXFLAGS = $(TARGET_CFLAGS) -DNDEBUG -std=c++11 ifeq ($(BR2_STATIC_LIBS),y) LIBJSON_MAKE_OPTS += SHARED=0 diff --git a/buildroot/package/libkrb5/libkrb5.hash b/buildroot/package/libkrb5/libkrb5.hash index e5b24a3f7..860f82879 100644 --- a/buildroot/package/libkrb5/libkrb5.hash +++ b/buildroot/package/libkrb5/libkrb5.hash @@ -1,5 +1,5 @@ # Locally calculated after checking pgp signature -sha256 e61783c292b5efd9afb45c555a80dd267ac67eebabca42185362bee6c4fbd719 krb5-1.18.3.tar.gz +sha256 66085e2f594751e77e82e0dbf7bbc344320fb48a9df2a633cfdd8f7d6da99fc8 krb5-1.18.4.tar.gz # Hash for license file: -sha256 b7a5f14a8719bce5e49a761998aa55438fc890fb40f71228d6a49546f6d5690d NOTICE +sha256 7fba8b076bdc2cfef1d0813c5d4067d76d5be60c32d84de22d5d1cf451744feb NOTICE diff --git a/buildroot/package/libkrb5/libkrb5.mk b/buildroot/package/libkrb5/libkrb5.mk index e4f3fa418..89f219d91 100644 --- a/buildroot/package/libkrb5/libkrb5.mk +++ b/buildroot/package/libkrb5/libkrb5.mk @@ -5,7 +5,7 @@ ################################################################################ LIBKRB5_VERSION_MAJOR = 1.18 -LIBKRB5_VERSION = $(LIBKRB5_VERSION_MAJOR).3 +LIBKRB5_VERSION = $(LIBKRB5_VERSION_MAJOR).4 LIBKRB5_SITE = https://web.mit.edu/kerberos/dist/krb5/$(LIBKRB5_VERSION_MAJOR) LIBKRB5_SOURCE = krb5-$(LIBKRB5_VERSION).tar.gz LIBKRB5_SUBDIR = src @@ -41,6 +41,21 @@ else LIBKRB5_CONF_OPTS += --without-ldap endif +ifeq ($(BR2_PACKAGE_OPENSSL),y) +LIBKRB5_CONF_OPTS += \ + --enable-pkinit \ + --with-crypto-impl=openssl \ + --with-spake-openssl \ + --with-tls-impl=openssl +LIBKRB5_DEPENDENCIES += openssl +else +LIBKRB5_CONF_OPTS += \ + --disable-pkinit \ + --with-crypto-impl=builtin \ + --without-spake-openssl \ + --without-tls-impl +endif + ifeq ($(BR2_PACKAGE_LIBEDIT),y) LIBKRB5_CONF_OPTS += --with-libedit LIBKRB5_DEPENDENCIES += host-pkgconf libedit diff --git a/buildroot/package/libloki/libloki.mk b/buildroot/package/libloki/libloki.mk index 7564239f6..07a9372df 100644 --- a/buildroot/package/libloki/libloki.mk +++ b/buildroot/package/libloki/libloki.mk @@ -23,6 +23,7 @@ endif define LIBLOKI_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \ + CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" \ -C $(@D) $(LIBLOKI_BUILD_TARGETS) endef diff --git a/buildroot/package/libmodsecurity/0001-Fail-when-CANONICAL_HOST-cannot-be-determined.patch b/buildroot/package/libmodsecurity/0001-Fail-when-CANONICAL_HOST-cannot-be-determined.patch deleted file mode 100644 index ab00a14e2..000000000 --- a/buildroot/package/libmodsecurity/0001-Fail-when-CANONICAL_HOST-cannot-be-determined.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0832208360aab69fbaec76225db67801840a33fe Mon Sep 17 00:00:00 2001 -From: Frank Vanbever -Date: Fri, 10 Jan 2020 11:14:43 +0100 -Subject: [PATCH] Fail when CANONICAL_HOST cannot be determined - -When the CANONICAL_HOST is unknown the configure script exits -with exit code 0 even though no makefile was produced. - -Upstream: https://github.com/SpiderLabs/ModSecurity/pull/2235 - -Signed-off-by: Frank Vanbever ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 95e48843..5e6971f4 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -193,7 +193,7 @@ case $host in - ;; - *) - echo "Unknown CANONICAL_HOST $host" -- exit -+ exit 1 - ;; - esac - --- -2.20.1 - diff --git a/buildroot/package/libmodsecurity/0001-configure.ac-drop-usage-of-git-at-configure-time.patch b/buildroot/package/libmodsecurity/0001-configure.ac-drop-usage-of-git-at-configure-time.patch new file mode 100644 index 000000000..14767fb28 --- /dev/null +++ b/buildroot/package/libmodsecurity/0001-configure.ac-drop-usage-of-git-at-configure-time.patch @@ -0,0 +1,79 @@ +From a2116312068b6b2c5732dfebde19b751cc81d4f3 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sun, 1 Aug 2021 23:21:35 +0200 +Subject: [PATCH] configure.ac: drop usage of git at configure time + +The usage of git is only to print some messages at configure time, +which is not very useful, and causes a significant number of warning +when regenerating the configure script. + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 23 ----------------------- + 1 file changed, 23 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 20163e1e..14e5892a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3,7 +3,6 @@ + + # Get the hash of the last commit, to be used if it is not an + # official release. +-AC_DEFUN([MSC_GIT_HASH], m4_esyscmd_s(git log -1 --format="%h" --abbrev-commit)) + AC_DEFUN([MSC_MAJOR], m4_esyscmd_s(cat headers/modsecurity/modsecurity.h | grep "define MODSECURITY_MAJOR " | awk {'print $3'} | sed 's/\"//g')) + AC_DEFUN([MSC_MINOR], m4_esyscmd_s(cat headers/modsecurity/modsecurity.h | grep "define MODSECURITY_MINOR " | awk {'print $3'} | sed 's/\"//g')) + AC_DEFUN([MSC_PATCHLEVEL], m4_esyscmd_s(cat headers/modsecurity/modsecurity.h | grep "define MODSECURITY_PATCHLEVEL " | awk {'print $3'} | sed 's/\"//g')) +@@ -25,9 +24,6 @@ m4_define([msc_version], + m4_define([msc_version_with_patchlevel], + [msc_version_major.msc_version_minor.msc_version_patchlevel]) + +-m4_define([msc_version_git], +- [m4_esyscmd_s(git describe)]) +- + m4_define([msc_version_info], + [msc_version_c_plus_a:msc_version_patchlevel:msc_version_minor]) + +@@ -73,11 +69,6 @@ AC_MSG_ERROR([\ + + ]) + fi +-# Libinjection version +-AC_DEFUN([LIBINJECTION_VERSION], m4_esyscmd_s(cd "others/libinjection" && git describe && cd ../..)) +- +-# SecLang test version +-AC_DEFUN([SECLANG_TEST_VERSION], m4_esyscmd_s(cd "test/test-cases/secrules-language-tests" && git log -1 --format="%h" --abbrev-commit && cd ../../..)) + + + # Check for yajl +@@ -217,10 +208,6 @@ AC_SUBST([MSC_VERSION_WITH_PATCHLEVEL]) + MSC_VERSION=msc_version + AC_SUBST([MSC_VERSION]) + +-MSC_GIT_VERSION=msc_version_git +-AC_SUBST([MSC_GIT_VERSION]) +- +- + AC_ARG_ENABLE(debug-logs, + [AC_HELP_STRING([--disable-debug-logs],[Turn off the SecDebugLog feature])], + +@@ -412,16 +399,6 @@ AC_OUTPUT + + + # Print a fancy summary +-echo " " +-echo " " +-echo "ModSecurity - ${MSC_GIT_VERSION} for $PLATFORM" +-echo " " +-echo " Mandatory dependencies" +-echo -n " + libInjection ...." +-echo LIBINJECTION_VERSION +-echo -n " + SecLang tests ...." +-echo SECLANG_TEST_VERSION +- + echo " " + echo " Optional dependencies" + +-- +2.31.1 + diff --git a/buildroot/package/libmodsecurity/0002-modsecurity.pc.in-add-lstdc.patch b/buildroot/package/libmodsecurity/0002-modsecurity.pc.in-add-lstdc.patch new file mode 100644 index 000000000..6511e6f1e --- /dev/null +++ b/buildroot/package/libmodsecurity/0002-modsecurity.pc.in-add-lstdc.patch @@ -0,0 +1,32 @@ +From 1a84881b280eb08852d5495c57e44351a40d3f91 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Mon, 26 Jul 2021 00:24:57 +0200 +Subject: [PATCH] modsecurity.pc.in: add -lstdc++ + +Add -lstdc++ to Libs.Private to avoid the following static build failure +with nginx: + +/home/buildroot/autobuild/instance-2/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-2/output-1/host/bin/../xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libmodsecurity.a(libmodsecurity_la-transaction.o): in function `std::basic_streambuf >::sbumpc() [clone .isra.0]': +transaction.cc:(.text+0x40): undefined reference to `std::__cxx11::basic_string, std::allocator >::_M_dispose()' + +Fixes: + - http://autobuild.buildroot.org/results/e5a9eb8448980f1c5cafe97180b7d1f48ddf02ca + +Signed-off-by: Fabrice Fontaine +--- + modsecurity.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modsecurity.pc.in b/modsecurity.pc.in +index 96cdf5ca..7c895ddc 100644 +--- a/modsecurity.pc.in ++++ b/modsecurity.pc.in +@@ -8,4 +8,4 @@ Description: ModSecurity API + Version: @MSC_VERSION_WITH_PATCHLEVEL@ + Cflags: -I@includedir@ + Libs: -L@libdir@ -lmodsecurity +-Libs.private: @CURL_LDADD@ @GEOIP_LDADD@ @MAXMIND_LDADD@ @GLOBAL_LDADD@ @LIBXML2_LDADD@ @LMDB_LDADD@ @LUA_LDADD@ @PCRE_LDADD@ @SSDEEP_LDADD@ @YAJL_LDADD@ ++Libs.private: @CURL_LDADD@ @GEOIP_LDADD@ @MAXMIND_LDADD@ @GLOBAL_LDADD@ @LIBXML2_LDADD@ @LMDB_LDADD@ @LUA_LDADD@ @PCRE_LDADD@ @SSDEEP_LDADD@ @YAJL_LDADD@ -lstdc++ +-- +2.30.2 + diff --git a/buildroot/package/libmodsecurity/0002-test-for-uClinux-in-configure-script.patch b/buildroot/package/libmodsecurity/0002-test-for-uClinux-in-configure-script.patch deleted file mode 100644 index ccd96fea9..000000000 --- a/buildroot/package/libmodsecurity/0002-test-for-uClinux-in-configure-script.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 13c505e30474c919ed9ae552e459769c456da21e Mon Sep 17 00:00:00 2001 -From: Frank Vanbever -Date: Fri, 10 Jan 2020 11:24:43 +0100 -Subject: [PATCH] test for uClinux in configure script - -Upstream: https://github.com/SpiderLabs/ModSecurity/pull/2235 - -Signed-off-by: Frank Vanbever ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 5e6971f4..51d38071 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -156,7 +156,7 @@ case $host in - AC_DEFINE([MACOSX], [1], [Define if the operating system is Macintosh OSX]) - PLATFORM="MacOSX" - ;; -- *-*-linux*) -+ *-*-linux* | *-*uclinux*) - echo "Checking platform... Identified as Linux" - AC_DEFINE([LINUX], [1], [Define if the operating system is LINUX]) - PLATFORM="Linux" --- -2.20.1 - diff --git a/buildroot/package/libmodsecurity/0003-Revert-Fix-maxminddb-link-on-FreeBSD.patch b/buildroot/package/libmodsecurity/0003-Revert-Fix-maxminddb-link-on-FreeBSD.patch new file mode 100644 index 000000000..9608e3d93 --- /dev/null +++ b/buildroot/package/libmodsecurity/0003-Revert-Fix-maxminddb-link-on-FreeBSD.patch @@ -0,0 +1,28 @@ +From 6737dc133cb4811a000c02b4e0a92b72f0b220ee Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Fri, 16 Jul 2021 19:12:51 +0200 +Subject: [PATCH] Revert "Fix maxminddb link on FreeBSD" + +This reverts commit 785958f9b5089b918c7d054cbcc2fe4a3c7b3788. + +Signed-off-by: Fabrice Fontaine +--- + build/libmaxmind.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build/libmaxmind.m4 b/build/libmaxmind.m4 +index 656fc250..02820b5a 100644 +--- a/build/libmaxmind.m4 ++++ b/build/libmaxmind.m4 +@@ -10,7 +10,7 @@ dnl MAXMIND_VERSION + AC_DEFUN([PROG_MAXMIND], [ + + # Possible names for the maxmind library/package (pkg-config) +-MAXMIND_POSSIBLE_LIB_NAMES="maxminddb maxmind" ++MAXMIND_POSSIBLE_LIB_NAMES="libmaxminddb maxminddb maxmind" + + # Possible extensions for the library + MAXMIND_POSSIBLE_EXTENSIONS="so la sl dll dylib" +-- +2.30.2 + diff --git a/buildroot/package/libmodsecurity/Config.in b/buildroot/package/libmodsecurity/Config.in index ea58c6d0e..87f7a9c10 100644 --- a/buildroot/package/libmodsecurity/Config.in +++ b/buildroot/package/libmodsecurity/Config.in @@ -1,7 +1,6 @@ config BR2_PACKAGE_LIBMODSECURITY bool "libmodsecurity" depends on BR2_INSTALL_LIBSTDCPP - depends on !BR2_STATIC_LIBS depends on BR2_TOOLCHAIN_HAS_THREADS select BR2_PACKAGE_PCRE help @@ -16,6 +15,5 @@ config BR2_PACKAGE_LIBMODSECURITY https://github.com/SpiderLabs/ModSecurity -comment "libmodsecurity needs a toolchain w/ C++, dynamic library, threads" - depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \ - !BR2_TOOLCHAIN_HAS_THREADS +comment "libmodsecurity needs a toolchain w/ C++, threads" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/buildroot/package/libmodsecurity/libmodsecurity.hash b/buildroot/package/libmodsecurity/libmodsecurity.hash index ddce3ef9c..dff39569c 100644 --- a/buildroot/package/libmodsecurity/libmodsecurity.hash +++ b/buildroot/package/libmodsecurity/libmodsecurity.hash @@ -1,4 +1,4 @@ -# From https://github.com/SpiderLabs/ModSecurity/releases/download/v3.0.4/modsecurity-v3.0.4.tar.gz.sha256 -sha256 b4231177dd80b4e076b228e57d498670113b69d445bab86db25f65346c24db22 modsecurity-v3.0.4.tar.gz +# From https://github.com/SpiderLabs/ModSecurity/releases/download/v3.0.5/modsecurity-v3.0.5.tar.gz.sha256 +sha256 751bf95a7a8d39c440d0c26ec1f73961550ca2eb2ac9e2e7a56dce2dd7b959e9 modsecurity-v3.0.5.tar.gz # Localy calculated -sha256 c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE +sha256 c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE diff --git a/buildroot/package/libmodsecurity/libmodsecurity.mk b/buildroot/package/libmodsecurity/libmodsecurity.mk index a84cd27b3..66e7e522a 100644 --- a/buildroot/package/libmodsecurity/libmodsecurity.mk +++ b/buildroot/package/libmodsecurity/libmodsecurity.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBMODSECURITY_VERSION = 3.0.4 +LIBMODSECURITY_VERSION = 3.0.5 LIBMODSECURITY_SOURCE = modsecurity-v$(LIBMODSECURITY_VERSION).tar.gz LIBMODSECURITY_SITE = https://github.com/SpiderLabs/ModSecurity/releases/download/v$(LIBMODSECURITY_VERSION) LIBMODSECURITY_INSTALL_STAGING = YES @@ -12,11 +12,8 @@ LIBMODSECURITY_LICENSE = Apache-2.0 LIBMODSECURITY_LICENSE_FILES = LICENSE LIBMODSECURITY_CPE_ID_VENDOR = trustwave LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity -# 0002-test-for-uClinux-in-configure-script.patch +# We're patching build/libmaxmind.m4 LIBMODSECURITY_AUTORECONF = YES -# libinjection uses AC_CHECK_FILE, not available in cross-compile -LIBMODSECURITY_CONF_ENV = \ - ac_cv_file_others_libinjection_src_libinjection_html5_c=yes LIBMODSECURITY_DEPENDENCIES = pcre LIBMODSECURITY_CONF_OPTS = \ diff --git a/buildroot/package/libndp/0001-ndptool.c-Fix-musl-build.patch b/buildroot/package/libndp/0001-ndptool.c-Fix-musl-build.patch deleted file mode 100644 index 547598c6e..000000000 --- a/buildroot/package/libndp/0001-ndptool.c-Fix-musl-build.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 561f80b9a848be923f37bf1afedbecf92da3b2e7 Mon Sep 17 00:00:00 2001 -From: Bernd Kuhls -Date: Sat, 30 Jan 2016 16:36:39 +0100 -Subject: [PATCH 1/1] ndptool.c: Fix musl build - -Fixes a build issue with the musl C library -http://autobuild.buildroot.net/results/d42/d42bebe51bbec38f131840b6bbefdc162f0ad194/build-end.log - -Patch sent upstream: https://github.com/jpirko/libndp/pull/7 - -Signed-off-by: Bernd Kuhls ---- - utils/ndptool.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/utils/ndptool.c b/utils/ndptool.c -index 04ec4e1..c6ef48c 100644 ---- a/utils/ndptool.c -+++ b/utils/ndptool.c -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - #include - - enum verbosity_level { --- -2.7.0.rc3 - diff --git a/buildroot/package/libnetfilter_log/0002-Add-include-needed-for-integer-type-definition.patch b/buildroot/package/libnetfilter_log/0002-Add-include-needed-for-integer-type-definition.patch new file mode 100644 index 000000000..bc8bbb223 --- /dev/null +++ b/buildroot/package/libnetfilter_log/0002-Add-include-needed-for-integer-type-definition.patch @@ -0,0 +1,27 @@ +From 7529487f70e244cd31ef84b037b1c32749c134a7 Mon Sep 17 00:00:00 2001 +From: Eric Leblond +Date: Sun, 4 Nov 2012 09:29:44 +0100 +Subject: Add include needed for integer type definition. + +[Retrieved from: +https://git.netfilter.org/libnetfilter_log/commit/?id=7529487f70e244cd31ef84b037b1c32749c134a7] +Signed-off-by: Fabrice Fontaine +--- + include/libnetfilter_log/libnetfilter_log.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/libnetfilter_log/libnetfilter_log.h b/include/libnetfilter_log/libnetfilter_log.h +index 6b0d3b0..a1331de 100644 +--- a/include/libnetfilter_log/libnetfilter_log.h ++++ b/include/libnetfilter_log/libnetfilter_log.h +@@ -9,6 +9,7 @@ + #ifndef __LIBNETFILTER_LOG_H + #define __LIBNETFILTER_LOG_H + ++#include + #include + + struct nflog_handle; +-- +cgit v1.2.3 + diff --git a/buildroot/package/libnetfilter_log/0003-src-Use-stdint-types-everywhere.patch b/buildroot/package/libnetfilter_log/0003-src-Use-stdint-types-everywhere.patch new file mode 100644 index 000000000..dfc59483a --- /dev/null +++ b/buildroot/package/libnetfilter_log/0003-src-Use-stdint-types-everywhere.patch @@ -0,0 +1,489 @@ +From 42878e88e5b72d3120434564942417cae3723385 Mon Sep 17 00:00:00 2001 +From: Felix Janda +Date: Sat, 16 May 2015 14:01:00 +0200 +Subject: src: Use stdint types everywhere + +Signed-off-by: Felix Janda +Signed-off-by: Pablo Neira Ayuso + +[Retrieved from: +https://git.netfilter.org/libnetfilter_log/commit/?id=42878e88e5b72d3120434564942417cae3723385] +Signed-off-by: Fabrice Fontaine +--- + include/libnetfilter_log/libipulog.h | 5 +- + include/libnetfilter_log/libnetfilter_log.h | 39 ++++++------ + src/libipulog_compat.c | 10 ++-- + src/libnetfilter_log.c | 92 ++++++++++++++--------------- + utils/nfulnl_test.c | 6 +- + 5 files changed, 77 insertions(+), 75 deletions(-) + +diff --git a/include/libnetfilter_log/libipulog.h b/include/libnetfilter_log/libipulog.h +index 1093bdd..ee7890a 100644 +--- a/include/libnetfilter_log/libipulog.h ++++ b/include/libnetfilter_log/libipulog.h +@@ -2,6 +2,7 @@ + #define _LIBIPULOG_H + + #include ++#include + #include + #include + #include +@@ -33,9 +34,9 @@ typedef struct ulog_packet_msg { + struct ipulog_handle; + extern int ipulog_errno; + +-u_int32_t ipulog_group2gmask(u_int32_t group); ++uint32_t ipulog_group2gmask(uint32_t group); + +-struct ipulog_handle *ipulog_create_handle(u_int32_t gmask, u_int32_t rmem); ++struct ipulog_handle *ipulog_create_handle(uint32_t gmask, uint32_t rmem); + + void ipulog_destroy_handle(struct ipulog_handle *h); + +diff --git a/include/libnetfilter_log/libnetfilter_log.h b/include/libnetfilter_log/libnetfilter_log.h +index a1331de..7812877 100644 +--- a/include/libnetfilter_log/libnetfilter_log.h ++++ b/include/libnetfilter_log/libnetfilter_log.h +@@ -9,6 +9,7 @@ + #ifndef __LIBNETFILTER_LOG_H + #define __LIBNETFILTER_LOG_H + ++#include + #include + #include + +@@ -29,19 +30,19 @@ extern struct nflog_handle *nflog_open(void); + extern struct nflog_handle *nflog_open_nfnl(struct nfnl_handle *nfnlh); + extern int nflog_close(struct nflog_handle *h); + +-extern int nflog_bind_pf(struct nflog_handle *h, u_int16_t pf); +-extern int nflog_unbind_pf(struct nflog_handle *h, u_int16_t pf); ++extern int nflog_bind_pf(struct nflog_handle *h, uint16_t pf); ++extern int nflog_unbind_pf(struct nflog_handle *h, uint16_t pf); + + extern struct nflog_g_handle *nflog_bind_group(struct nflog_handle *h, +- u_int16_t num); ++ uint16_t num); + extern int nflog_unbind_group(struct nflog_g_handle *gh); + + extern int nflog_set_mode(struct nflog_g_handle *gh, +- u_int8_t mode, unsigned int len); +-extern int nflog_set_timeout(struct nflog_g_handle *gh, u_int32_t timeout); +-extern int nflog_set_flags(struct nflog_g_handle *gh, u_int16_t flags); +-extern int nflog_set_qthresh(struct nflog_g_handle *gh, u_int32_t qthresh); +-extern int nflog_set_nlbufsiz(struct nflog_g_handle *gh, u_int32_t nlbufsiz); ++ uint8_t mode, unsigned int len); ++extern int nflog_set_timeout(struct nflog_g_handle *gh, uint32_t timeout); ++extern int nflog_set_flags(struct nflog_g_handle *gh, uint16_t flags); ++extern int nflog_set_qthresh(struct nflog_g_handle *gh, uint32_t qthresh); ++extern int nflog_set_nlbufsiz(struct nflog_g_handle *gh, uint32_t nlbufsiz); + + extern int nflog_callback_register(struct nflog_g_handle *gh, + nflog_callback *cb, void *data); +@@ -50,23 +51,23 @@ extern int nflog_handle_packet(struct nflog_handle *h, char *buf, int len); + + extern struct nfulnl_msg_packet_hdr *nflog_get_msg_packet_hdr(struct nflog_data *nfad); + +-extern u_int16_t nflog_get_hwtype(struct nflog_data *nfad); +-extern u_int16_t nflog_get_msg_packet_hwhdrlen(struct nflog_data *nfad); ++extern uint16_t nflog_get_hwtype(struct nflog_data *nfad); ++extern uint16_t nflog_get_msg_packet_hwhdrlen(struct nflog_data *nfad); + extern char *nflog_get_msg_packet_hwhdr(struct nflog_data *nfad); + +-extern u_int32_t nflog_get_nfmark(struct nflog_data *nfad); ++extern uint32_t nflog_get_nfmark(struct nflog_data *nfad); + extern int nflog_get_timestamp(struct nflog_data *nfad, struct timeval *tv); +-extern u_int32_t nflog_get_indev(struct nflog_data *nfad); +-extern u_int32_t nflog_get_physindev(struct nflog_data *nfad); +-extern u_int32_t nflog_get_outdev(struct nflog_data *nfad); +-extern u_int32_t nflog_get_physoutdev(struct nflog_data *nfad); ++extern uint32_t nflog_get_indev(struct nflog_data *nfad); ++extern uint32_t nflog_get_physindev(struct nflog_data *nfad); ++extern uint32_t nflog_get_outdev(struct nflog_data *nfad); ++extern uint32_t nflog_get_physoutdev(struct nflog_data *nfad); + extern struct nfulnl_msg_packet_hw *nflog_get_packet_hw(struct nflog_data *nfad); + extern int nflog_get_payload(struct nflog_data *nfad, char **data); + extern char *nflog_get_prefix(struct nflog_data *nfad); +-extern int nflog_get_uid(struct nflog_data *nfad, u_int32_t *uid); +-extern int nflog_get_gid(struct nflog_data *nfad, u_int32_t *gid); +-extern int nflog_get_seq(struct nflog_data *nfad, u_int32_t *seq); +-extern int nflog_get_seq_global(struct nflog_data *nfad, u_int32_t *seq); ++extern int nflog_get_uid(struct nflog_data *nfad, uint32_t *uid); ++extern int nflog_get_gid(struct nflog_data *nfad, uint32_t *gid); ++extern int nflog_get_seq(struct nflog_data *nfad, uint32_t *seq); ++extern int nflog_get_seq_global(struct nflog_data *nfad, uint32_t *seq); + + enum { + NFLOG_XML_PREFIX = (1 << 0), +diff --git a/src/libipulog_compat.c b/src/libipulog_compat.c +index 64ca7f3..2d5b23a 100644 +--- a/src/libipulog_compat.c ++++ b/src/libipulog_compat.c +@@ -20,7 +20,7 @@ struct ipulog_handle + struct nlmsghdr *last_nlh; + #if 0 + int fd; +- u_int8_t blocking; ++ uint8_t blocking; + struct sockaddr_nl local; + struct sockaddr_nl peer; + #endif +@@ -72,7 +72,7 @@ const char *ipulog_strerror(int errcode) + } + + /* convert a netlink group (1-32) to a group_mask suitable for create_handle */ +-u_int32_t ipulog_group2gmask(u_int32_t group) ++uint32_t ipulog_group2gmask(uint32_t group) + { + if (group < 1 || group > 32) + { +@@ -83,8 +83,8 @@ u_int32_t ipulog_group2gmask(u_int32_t group) + } + + /* create a ipulog handle for the reception of packets sent to gmask */ +-struct ipulog_handle *ipulog_create_handle(u_int32_t gmask, +- u_int32_t rcvbufsize) ++struct ipulog_handle *ipulog_create_handle(uint32_t gmask, ++ uint32_t rcvbufsize) + { + int rv; + struct ipulog_handle *h; +@@ -155,7 +155,7 @@ next_msg: printf("next\n"); + h->upmsg.hook = hdr->hook; + + if (tb[NFULA_MARK-1]) +- h->upmsg.mark = ntohl(*(u_int32_t *)NFA_DATA(tb[NFULA_MARK-1])); ++ h->upmsg.mark = ntohl(*(uint32_t *)NFA_DATA(tb[NFULA_MARK-1])); + else + h->upmsg.mark = 0; + +diff --git a/src/libnetfilter_log.c b/src/libnetfilter_log.c +index 76ed436..e92576b 100644 +--- a/src/libnetfilter_log.c ++++ b/src/libnetfilter_log.c +@@ -72,7 +72,7 @@ struct nflog_g_handle + { + struct nflog_g_handle *next; + struct nflog_handle *h; +- u_int16_t id; ++ uint16_t id; + + nflog_callback *cb; + void *data; +@@ -111,7 +111,7 @@ static void add_gh(struct nflog_g_handle *gh) + gh->h->gh_list = gh; + } + +-static struct nflog_g_handle *find_gh(struct nflog_handle *h, u_int16_t group) ++static struct nflog_g_handle *find_gh(struct nflog_handle *h, uint16_t group) + { + struct nflog_g_handle *gh; + +@@ -124,8 +124,8 @@ static struct nflog_g_handle *find_gh(struct nflog_handle *h, u_int16_t group) + + /* build a NFULNL_MSG_CONFIG message */ + static int +-__build_send_cfg_msg(struct nflog_handle *h, u_int8_t command, +- u_int16_t groupnum, u_int8_t pf) ++__build_send_cfg_msg(struct nflog_handle *h, uint8_t command, ++ uint16_t groupnum, uint8_t pf) + { + union { + char buf[NFNL_HEADER_LEN +@@ -148,7 +148,7 @@ static int __nflog_rcv_pkt(struct nlmsghdr *nlh, struct nfattr *nfa[], + { + struct nfgenmsg *nfmsg = NLMSG_DATA(nlh); + struct nflog_handle *h = data; +- u_int16_t group = ntohs(nfmsg->res_id); ++ uint16_t group = ntohs(nfmsg->res_id); + struct nflog_g_handle *gh = find_gh(h, group); + struct nflog_data nfldata; + +@@ -359,7 +359,7 @@ int nflog_close(struct nflog_handle *h) + * + * \return integer inferior to 0 in case of failure + */ +-int nflog_bind_pf(struct nflog_handle *h, u_int16_t pf) ++int nflog_bind_pf(struct nflog_handle *h, uint16_t pf) + { + return __build_send_cfg_msg(h, NFULNL_CFG_CMD_PF_BIND, 0, pf); + } +@@ -373,7 +373,7 @@ int nflog_bind_pf(struct nflog_handle *h, u_int16_t pf) + * Unbinds the given nflog handle from processing packets belonging + * to the given protocol family. + */ +-int nflog_unbind_pf(struct nflog_handle *h, u_int16_t pf) ++int nflog_unbind_pf(struct nflog_handle *h, uint16_t pf) + { + return __build_send_cfg_msg(h, NFULNL_CFG_CMD_PF_UNBIND, 0, pf); + } +@@ -395,7 +395,7 @@ int nflog_unbind_pf(struct nflog_handle *h, u_int16_t pf) + * \return a nflog_g_handle pointing to the newly created group + */ + struct nflog_g_handle * +-nflog_bind_group(struct nflog_handle *h, u_int16_t num) ++nflog_bind_group(struct nflog_handle *h, uint16_t num) + { + struct nflog_g_handle *gh; + +@@ -461,7 +461,7 @@ int nflog_unbind_group(struct nflog_g_handle *gh) + * \return -1 on error; >= otherwise. + */ + int nflog_set_mode(struct nflog_g_handle *gh, +- u_int8_t mode, u_int32_t range) ++ uint8_t mode, uint32_t range) + { + union { + char buf[NFNL_HEADER_LEN +@@ -493,10 +493,10 @@ int nflog_set_mode(struct nflog_g_handle *gh, + * + * \return -1 in case of error and errno is explicity set. + */ +-int nflog_set_timeout(struct nflog_g_handle *gh, u_int32_t timeout) ++int nflog_set_timeout(struct nflog_g_handle *gh, uint32_t timeout) + { + union { +- char buf[NFNL_HEADER_LEN+NFA_LENGTH(sizeof(u_int32_t))]; ++ char buf[NFNL_HEADER_LEN+NFA_LENGTH(sizeof(uint32_t))]; + struct nlmsghdr nmh; + } u; + +@@ -518,10 +518,10 @@ int nflog_set_timeout(struct nflog_g_handle *gh, u_int32_t timeout) + * + * \return -1 in case of error and errno is explicity set. + */ +-int nflog_set_qthresh(struct nflog_g_handle *gh, u_int32_t qthresh) ++int nflog_set_qthresh(struct nflog_g_handle *gh, uint32_t qthresh) + { + union { +- char buf[NFNL_HEADER_LEN+NFA_LENGTH(sizeof(u_int32_t))]; ++ char buf[NFNL_HEADER_LEN+NFA_LENGTH(sizeof(uint32_t))]; + struct nlmsghdr nmh; + } u; + +@@ -547,10 +547,10 @@ int nflog_set_qthresh(struct nflog_g_handle *gh, u_int32_t qthresh) + * + * \return -1 in case of error and errno is explicity set. + */ +-int nflog_set_nlbufsiz(struct nflog_g_handle *gh, u_int32_t nlbufsiz) ++int nflog_set_nlbufsiz(struct nflog_g_handle *gh, uint32_t nlbufsiz) + { + union { +- char buf[NFNL_HEADER_LEN+NFA_LENGTH(sizeof(u_int32_t))]; ++ char buf[NFNL_HEADER_LEN+NFA_LENGTH(sizeof(uint32_t))]; + struct nlmsghdr nmh; + } u; + int status; +@@ -581,10 +581,10 @@ int nflog_set_nlbufsiz(struct nflog_g_handle *gh, u_int32_t nlbufsiz) + * + * \return -1 in case of error and errno is explicity set. + */ +-int nflog_set_flags(struct nflog_g_handle *gh, u_int16_t flags) ++int nflog_set_flags(struct nflog_g_handle *gh, uint16_t flags) + { + union { +- char buf[NFNL_HEADER_LEN+NFA_LENGTH(sizeof(u_int16_t))]; ++ char buf[NFNL_HEADER_LEN+NFA_LENGTH(sizeof(uint16_t))]; + struct nlmsghdr nmh; + } u; + +@@ -616,9 +616,9 @@ int nflog_set_flags(struct nflog_g_handle *gh, u_int16_t flags) + * The nfulnl_msg_packet_hdr structure is defined in libnetfilter_log.h as: + *\verbatim + struct nfulnl_msg_packet_hdr { +- u_int16_t hw_protocol; // hw protocol (network order) +- u_int8_t hook; // netfilter hook +- u_int8_t _pad; ++ uint16_t hw_protocol; // hw protocol (network order) ++ uint8_t hook; // netfilter hook ++ uint8_t _pad; + } __attribute__ ((packed)); + \endverbatim + */ +@@ -634,9 +634,9 @@ struct nfulnl_msg_packet_hdr *nflog_get_msg_packet_hdr(struct nflog_data *nfad) + * + * \return the hardware link layer type. + */ +-u_int16_t nflog_get_hwtype(struct nflog_data *nfad) ++uint16_t nflog_get_hwtype(struct nflog_data *nfad) + { +- return ntohs(nfnl_get_data(nfad->nfa, NFULA_HWTYPE, u_int16_t)); ++ return ntohs(nfnl_get_data(nfad->nfa, NFULA_HWTYPE, uint16_t)); + } + + /** +@@ -645,9 +645,9 @@ u_int16_t nflog_get_hwtype(struct nflog_data *nfad) + * + * \return the size of the hardware link layer header + */ +-u_int16_t nflog_get_msg_packet_hwhdrlen(struct nflog_data *nfad) ++uint16_t nflog_get_msg_packet_hwhdrlen(struct nflog_data *nfad) + { +- return ntohs(nfnl_get_data(nfad->nfa, NFULA_HWLEN, u_int16_t)); ++ return ntohs(nfnl_get_data(nfad->nfa, NFULA_HWLEN, uint16_t)); + } + + /** +@@ -667,9 +667,9 @@ char *nflog_get_msg_packet_hwhdr(struct nflog_data *nfad) + * + * \return the netfilter mark currently assigned to the logged packet. + */ +-u_int32_t nflog_get_nfmark(struct nflog_data *nfad) ++uint32_t nflog_get_nfmark(struct nflog_data *nfad) + { +- return ntohl(nfnl_get_data(nfad->nfa, NFULA_MARK, u_int32_t)); ++ return ntohl(nfnl_get_data(nfad->nfa, NFULA_MARK, uint32_t)); + } + + /** +@@ -707,9 +707,9 @@ int nflog_get_timestamp(struct nflog_data *nfad, struct timeval *tv) + * \warning all nflog_get_dev() functions return 0 if not set, since linux + * only allows ifindex >= 1, see net/core/dev.c:2600 (in 2.6.13.1) + */ +-u_int32_t nflog_get_indev(struct nflog_data *nfad) ++uint32_t nflog_get_indev(struct nflog_data *nfad) + { +- return ntohl(nfnl_get_data(nfad->nfa, NFULA_IFINDEX_INDEV, u_int32_t)); ++ return ntohl(nfnl_get_data(nfad->nfa, NFULA_IFINDEX_INDEV, uint32_t)); + } + + /** +@@ -720,9 +720,9 @@ u_int32_t nflog_get_indev(struct nflog_data *nfad) + * If the returned index is 0, the packet was locally generated or the + * physical input interface is no longer known (ie. POSTROUTING?). + */ +-u_int32_t nflog_get_physindev(struct nflog_data *nfad) ++uint32_t nflog_get_physindev(struct nflog_data *nfad) + { +- return ntohl(nfnl_get_data(nfad->nfa, NFULA_IFINDEX_PHYSINDEV, u_int32_t)); ++ return ntohl(nfnl_get_data(nfad->nfa, NFULA_IFINDEX_PHYSINDEV, uint32_t)); + } + + /** +@@ -733,9 +733,9 @@ u_int32_t nflog_get_physindev(struct nflog_data *nfad) + * returned index is 0, the packet is destined for localhost or the output + * interface is not yet known (ie. PREROUTING?). + */ +-u_int32_t nflog_get_outdev(struct nflog_data *nfad) ++uint32_t nflog_get_outdev(struct nflog_data *nfad) + { +- return ntohl(nfnl_get_data(nfad->nfa, NFULA_IFINDEX_OUTDEV, u_int32_t)); ++ return ntohl(nfnl_get_data(nfad->nfa, NFULA_IFINDEX_OUTDEV, uint32_t)); + } + + /** +@@ -749,9 +749,9 @@ u_int32_t nflog_get_outdev(struct nflog_data *nfad) + * \return The index of physical interface that the packet output will be + * routed out. + */ +-u_int32_t nflog_get_physoutdev(struct nflog_data *nfad) ++uint32_t nflog_get_physoutdev(struct nflog_data *nfad) + { +- return ntohl(nfnl_get_data(nfad->nfa, NFULA_IFINDEX_PHYSOUTDEV, u_int32_t)); ++ return ntohl(nfnl_get_data(nfad->nfa, NFULA_IFINDEX_PHYSOUTDEV, uint32_t)); + } + + /** +@@ -767,9 +767,9 @@ u_int32_t nflog_get_physoutdev(struct nflog_data *nfad) + * The nfulnl_msg_packet_hw structure is defined in libnetfilter_log.h as: + * \verbatim + struct nfulnl_msg_packet_hw { +- u_int16_t hw_addrlen; +- u_int16_t _pad; +- u_int8_t hw_addr[8]; ++ uint16_t hw_addrlen; ++ uint16_t _pad; ++ uint8_t hw_addr[8]; + } __attribute__ ((packed)); + \endverbatim + */ +@@ -817,12 +817,12 @@ char *nflog_get_prefix(struct nflog_data *nfad) + * + * \return the UID of the user that has genered the packet, if any. + */ +-int nflog_get_uid(struct nflog_data *nfad, u_int32_t *uid) ++int nflog_get_uid(struct nflog_data *nfad, uint32_t *uid) + { + if (!nfnl_attr_present(nfad->nfa, NFULA_UID)) + return -1; + +- *uid = ntohl(nfnl_get_data(nfad->nfa, NFULA_UID, u_int32_t)); ++ *uid = ntohl(nfnl_get_data(nfad->nfa, NFULA_UID, uint32_t)); + return 0; + } + +@@ -832,12 +832,12 @@ int nflog_get_uid(struct nflog_data *nfad, u_int32_t *uid) + * + * \return the GID of the user that has genered the packet, if any. + */ +-int nflog_get_gid(struct nflog_data *nfad, u_int32_t *gid) ++int nflog_get_gid(struct nflog_data *nfad, uint32_t *gid) + { + if (!nfnl_attr_present(nfad->nfa, NFULA_GID)) + return -1; + +- *gid = ntohl(nfnl_get_data(nfad->nfa, NFULA_GID, u_int32_t)); ++ *gid = ntohl(nfnl_get_data(nfad->nfa, NFULA_GID, uint32_t)); + return 0; + } + +@@ -849,12 +849,12 @@ int nflog_get_gid(struct nflog_data *nfad, u_int32_t *gid) + * + * \return the local nflog sequence number. + */ +-int nflog_get_seq(struct nflog_data *nfad, u_int32_t *seq) ++int nflog_get_seq(struct nflog_data *nfad, uint32_t *seq) + { + if (!nfnl_attr_present(nfad->nfa, NFULA_SEQ)) + return -1; + +- *seq = ntohl(nfnl_get_data(nfad->nfa, NFULA_SEQ, u_int32_t)); ++ *seq = ntohl(nfnl_get_data(nfad->nfa, NFULA_SEQ, uint32_t)); + return 0; + } + +@@ -866,12 +866,12 @@ int nflog_get_seq(struct nflog_data *nfad, u_int32_t *seq) + * + * \return the global nflog sequence number. + */ +-int nflog_get_seq_global(struct nflog_data *nfad, u_int32_t *seq) ++int nflog_get_seq_global(struct nflog_data *nfad, uint32_t *seq) + { + if (!nfnl_attr_present(nfad->nfa, NFULA_SEQ_GLOBAL)) + return -1; + +- *seq = ntohl(nfnl_get_data(nfad->nfa, NFULA_SEQ_GLOBAL, u_int32_t)); ++ *seq = ntohl(nfnl_get_data(nfad->nfa, NFULA_SEQ_GLOBAL, uint32_t)); + return 0; + } + +@@ -923,7 +923,7 @@ int nflog_snprintf_xml(char *buf, size_t rem, struct nflog_data *tb, int flags) + { + struct nfulnl_msg_packet_hdr *ph; + struct nfulnl_msg_packet_hw *hwph; +- u_int32_t mark, ifi; ++ uint32_t mark, ifi; + int size, offset = 0, len = 0, ret; + char *data; + +diff --git a/utils/nfulnl_test.c b/utils/nfulnl_test.c +index ae5da79..dd3091b 100644 +--- a/utils/nfulnl_test.c ++++ b/utils/nfulnl_test.c +@@ -9,9 +9,9 @@ + static int print_pkt(struct nflog_data *ldata) + { + struct nfulnl_msg_packet_hdr *ph = nflog_get_msg_packet_hdr(ldata); +- u_int32_t mark = nflog_get_nfmark(ldata); +- u_int32_t indev = nflog_get_indev(ldata); +- u_int32_t outdev = nflog_get_outdev(ldata); ++ uint32_t mark = nflog_get_nfmark(ldata); ++ uint32_t indev = nflog_get_indev(ldata); ++ uint32_t outdev = nflog_get_outdev(ldata); + char *prefix = nflog_get_prefix(ldata); + char *payload; + int payload_len = nflog_get_payload(ldata, &payload); +-- +cgit v1.2.3 + diff --git a/buildroot/package/libnetfilter_log/0004-include-Sync-with-current-kernel-headers.patch b/buildroot/package/libnetfilter_log/0004-include-Sync-with-current-kernel-headers.patch new file mode 100644 index 000000000..bb62411ec --- /dev/null +++ b/buildroot/package/libnetfilter_log/0004-include-Sync-with-current-kernel-headers.patch @@ -0,0 +1,112 @@ +From 614d8b6cfb969c6102ef320de22b1eb199efce2a Mon Sep 17 00:00:00 2001 +From: Felix Janda +Date: Sat, 16 May 2015 13:37:53 +0200 +Subject: include: Sync with current kernel headers + +Signed-off-by: Felix Janda +Signed-off-by: Pablo Neira Ayuso + +[Retrieved from: +https://git.netfilter.org/libnetfilter_log/commit/?id=614d8b6cfb969c6102ef320de22b1eb199efce2a] +Signed-off-by: Fabrice Fontaine +--- + include/libnetfilter_log/linux_nfnetlink_log.h | 51 +++++++++++++------------- + 1 file changed, 25 insertions(+), 26 deletions(-) + +diff --git a/include/libnetfilter_log/linux_nfnetlink_log.h b/include/libnetfilter_log/linux_nfnetlink_log.h +index 4c802c8..9f38277 100644 +--- a/include/libnetfilter_log/linux_nfnetlink_log.h ++++ b/include/libnetfilter_log/linux_nfnetlink_log.h +@@ -20,33 +20,31 @@ enum nfulnl_msg_types { + }; + + struct nfulnl_msg_packet_hdr { +- u_int16_t hw_protocol; /* hw protocol (network order) */ +- u_int8_t hook; /* netfilter hook */ +- u_int8_t _pad; +-} __attribute__ ((packed)); ++ __be16 hw_protocol; /* hw protocol (network order) */ ++ __u8 hook; /* netfilter hook */ ++ __u8 _pad; ++}; + + struct nfulnl_msg_packet_hw { +- u_int16_t hw_addrlen; +- u_int16_t _pad; +- u_int8_t hw_addr[8]; +-} __attribute__ ((packed)); ++ __be16 hw_addrlen; ++ __u16 _pad; ++ __u8 hw_addr[8]; ++}; + + struct nfulnl_msg_packet_timestamp { +- aligned_u64 sec; +- aligned_u64 usec; +-} __attribute__ ((packed)); +- +-#define NFULNL_PREFIXLEN 30 /* just like old log target */ ++ __aligned_be64 sec; ++ __aligned_be64 usec; ++}; + + enum nfulnl_attr_type { + NFULA_UNSPEC, + NFULA_PACKET_HDR, +- NFULA_MARK, /* u_int32_t nfmark */ ++ NFULA_MARK, /* __u32 nfmark */ + NFULA_TIMESTAMP, /* nfulnl_msg_packet_timestamp */ +- NFULA_IFINDEX_INDEV, /* u_int32_t ifindex */ +- NFULA_IFINDEX_OUTDEV, /* u_int32_t ifindex */ +- NFULA_IFINDEX_PHYSINDEV, /* u_int32_t ifindex */ +- NFULA_IFINDEX_PHYSOUTDEV, /* u_int32_t ifindex */ ++ NFULA_IFINDEX_INDEV, /* __u32 ifindex */ ++ NFULA_IFINDEX_OUTDEV, /* __u32 ifindex */ ++ NFULA_IFINDEX_PHYSINDEV, /* __u32 ifindex */ ++ NFULA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */ + NFULA_HWADDR, /* nfulnl_msg_packet_hw */ + NFULA_PAYLOAD, /* opaque data payload */ + NFULA_PREFIX, /* string prefix */ +@@ -71,23 +69,23 @@ enum nfulnl_msg_config_cmds { + }; + + struct nfulnl_msg_config_cmd { +- u_int8_t command; /* nfulnl_msg_config_cmds */ ++ __u8 command; /* nfulnl_msg_config_cmds */ + } __attribute__ ((packed)); + + struct nfulnl_msg_config_mode { +- u_int32_t copy_range; +- u_int8_t copy_mode; +- u_int8_t _pad; ++ __be32 copy_range; ++ __u8 copy_mode; ++ __u8 _pad; + } __attribute__ ((packed)); + + enum nfulnl_attr_config { + NFULA_CFG_UNSPEC, + NFULA_CFG_CMD, /* nfulnl_msg_config_cmd */ + NFULA_CFG_MODE, /* nfulnl_msg_config_mode */ +- NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */ +- NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */ +- NFULA_CFG_QTHRESH, /* u_int32_t */ +- NFULA_CFG_FLAGS, /* u_int16_t */ ++ NFULA_CFG_NLBUFSIZ, /* __u32 buffer size */ ++ NFULA_CFG_TIMEOUT, /* __u32 in 1/100 s */ ++ NFULA_CFG_QTHRESH, /* __u32 */ ++ NFULA_CFG_FLAGS, /* __u16 */ + __NFULA_CFG_MAX + }; + #define NFULA_CFG_MAX (__NFULA_CFG_MAX -1) +@@ -95,6 +93,7 @@ enum nfulnl_attr_config { + #define NFULNL_COPY_NONE 0x00 + #define NFULNL_COPY_META 0x01 + #define NFULNL_COPY_PACKET 0x02 ++/* 0xff is reserved, don't use it for new copy modes. */ + + #define NFULNL_CFG_F_SEQ 0x0001 + #define NFULNL_CFG_F_SEQ_GLOBAL 0x0002 +-- +cgit v1.2.3 + diff --git a/buildroot/package/libnfnetlink/0002-include-Sync-with-kernel-headers.patch b/buildroot/package/libnfnetlink/0002-include-Sync-with-kernel-headers.patch new file mode 100644 index 000000000..f9e9c2e2e --- /dev/null +++ b/buildroot/package/libnfnetlink/0002-include-Sync-with-kernel-headers.patch @@ -0,0 +1,114 @@ +From 7a1a07c0028a1c88cd7716a058697c552a563b24 Mon Sep 17 00:00:00 2001 +From: Felix Janda +Date: Sat, 16 May 2015 14:49:07 +0200 +Subject: include: Sync with kernel headers + +Signed-off-by: Felix Janda +Signed-off-by: Pablo Neira Ayuso + +[Retrieved from: +https://git.netfilter.org/libnfnetlink/commit/?id=7a1a07c0028a1c88cd7716a058697c552a563b24] +Signed-off-by: Fabrice Fontaine +--- + include/libnfnetlink/linux_nfnetlink.h | 44 ++++----------------------- + include/libnfnetlink/linux_nfnetlink_compat.h | 12 ++++---- + 2 files changed, 12 insertions(+), 44 deletions(-) + +diff --git a/include/libnfnetlink/linux_nfnetlink.h b/include/libnfnetlink/linux_nfnetlink.h +index 76a8550..44a38d6 100644 +--- a/include/libnfnetlink/linux_nfnetlink.h ++++ b/include/libnfnetlink/linux_nfnetlink.h +@@ -25,9 +25,9 @@ enum nfnetlink_groups { + /* General form of address family dependent message. + */ + struct nfgenmsg { +- u_int8_t nfgen_family; /* AF_xxx */ +- u_int8_t version; /* nfnetlink version */ +- u_int16_t res_id; /* resource id */ ++ __u8 nfgen_family; /* AF_xxx */ ++ __u8 version; /* nfnetlink version */ ++ __be16 res_id; /* resource id */ + }; + + #define NFNETLINK_V0 0 +@@ -46,40 +46,8 @@ struct nfgenmsg { + #define NFNL_SUBSYS_CTNETLINK_EXP 2 + #define NFNL_SUBSYS_QUEUE 3 + #define NFNL_SUBSYS_ULOG 4 +-#define NFNL_SUBSYS_COUNT 5 ++#define NFNL_SUBSYS_OSF 5 ++#define NFNL_SUBSYS_IPSET 6 ++#define NFNL_SUBSYS_COUNT 7 + +-#ifdef __KERNEL__ +- +-#include +-#include +-#include +- +-struct nfnl_callback +-{ +- int (*call)(struct sock *nl, struct sk_buff *skb, +- struct nlmsghdr *nlh, struct nlattr *cda[]); +- const struct nla_policy *policy; /* netlink attribute policy */ +- const u_int16_t attr_count; /* number of nlattr's */ +-}; +- +-struct nfnetlink_subsystem +-{ +- const char *name; +- __u8 subsys_id; /* nfnetlink subsystem ID */ +- __u8 cb_count; /* number of callbacks */ +- const struct nfnl_callback *cb; /* callback for individual types */ +-}; +- +-extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); +-extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); +- +-extern int nfnetlink_has_listeners(unsigned int group); +-extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, +- int echo); +-extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); +- +-#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ +- MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) +- +-#endif /* __KERNEL__ */ + #endif /* _NFNETLINK_H */ +diff --git a/include/libnfnetlink/linux_nfnetlink_compat.h b/include/libnfnetlink/linux_nfnetlink_compat.h +index e145176..74b9e55 100644 +--- a/include/libnfnetlink/linux_nfnetlink_compat.h ++++ b/include/libnfnetlink/linux_nfnetlink_compat.h +@@ -1,6 +1,8 @@ + #ifndef _NFNETLINK_COMPAT_H + #define _NFNETLINK_COMPAT_H +-#ifndef __KERNEL__ ++ ++#include ++ + /* Old nfnetlink macros for userspace */ + + /* nfnetlink groups: Up to 32 maximum */ +@@ -18,10 +20,9 @@ + * ! nfnetlink use the same attributes methods. - J. Schulist. + */ + +-struct nfattr +-{ +- u_int16_t nfa_len; +- u_int16_t nfa_type; /* we use 15 bits for the type, and the highest ++struct nfattr { ++ __u16 nfa_len; ++ __u16 nfa_type; /* we use 15 bits for the type, and the highest + * bit to indicate whether the payload is nested */ + }; + +@@ -57,5 +58,4 @@ struct nfattr + + NLMSG_ALIGN(sizeof(struct nfgenmsg)))) + #define NFM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg)) + +-#endif /* ! __KERNEL__ */ + #endif /* _NFNETLINK_COMPAT_H */ +-- +cgit v1.2.3 + diff --git a/buildroot/package/libnice/libnice.mk b/buildroot/package/libnice/libnice.mk index 8cbf00352..829225093 100644 --- a/buildroot/package/libnice/libnice.mk +++ b/buildroot/package/libnice/libnice.mk @@ -22,6 +22,13 @@ LIBNICE_CONF_OPTS += \ LIBNICE_DEPENDENCIES += openssl endif +ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y) +LIBNICE_CONF_OPTS += --enable-introspection +LIBNICE_DEPENDENCIES += gobject-introspection +else +LIBNICE_CONF_OPTS += --disable-introspection +endif + ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE),y) LIBNICE_CONF_OPTS += --with-gstreamer LIBNICE_DEPENDENCIES += gst1-plugins-base diff --git a/buildroot/package/libodb-boost/libodb-boost.mk b/buildroot/package/libodb-boost/libodb-boost.mk index 679c9d7a3..bac5f1e78 100644 --- a/buildroot/package/libodb-boost/libodb-boost.mk +++ b/buildroot/package/libodb-boost/libodb-boost.mk @@ -12,5 +12,6 @@ LIBODB_BOOST_INSTALL_STAGING = YES LIBODB_BOOST_LICENSE = GPL-2.0 LIBODB_BOOST_LICENSE_FILES = LICENSE LIBODB_BOOST_DEPENDENCIES = boost libodb +LIBODB_BOOST_CONF_ENV = CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" $(eval $(autotools-package)) diff --git a/buildroot/package/libodb-mysql/libodb-mysql.mk b/buildroot/package/libodb-mysql/libodb-mysql.mk index a9040c65f..88b6f4cb3 100644 --- a/buildroot/package/libodb-mysql/libodb-mysql.mk +++ b/buildroot/package/libodb-mysql/libodb-mysql.mk @@ -12,6 +12,8 @@ LIBODB_MYSQL_INSTALL_STAGING = YES LIBODB_MYSQL_LICENSE = GPL-2.0 LIBODB_MYSQL_LICENSE_FILES = LICENSE LIBODB_MYSQL_DEPENDENCIES = libodb mysql -LIBODB_MYSQL_CONF_ENV = LIBS=`$(STAGING_DIR)/usr/bin/mysql_config --libs` +LIBODB_MYSQL_CONF_ENV = \ + CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" \ + LIBS=`$(STAGING_DIR)/usr/bin/mysql_config --libs` $(eval $(autotools-package)) diff --git a/buildroot/package/libodb-pgsql/libodb-pgsql.mk b/buildroot/package/libodb-pgsql/libodb-pgsql.mk index 038f7878c..014116883 100644 --- a/buildroot/package/libodb-pgsql/libodb-pgsql.mk +++ b/buildroot/package/libodb-pgsql/libodb-pgsql.mk @@ -12,5 +12,6 @@ LIBODB_PGSQL_LICENSE = GPL-2.0 LIBODB_PGSQL_LICENSE_FILES = LICENSE LIBODB_PGSQL_INSTALL_STAGING = YES LIBODB_PGSQL_DEPENDENCIES = postgresql libodb +LIBODB_PGSQL_CONF_ENV = CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" $(eval $(autotools-package)) diff --git a/buildroot/package/libodb/libodb.mk b/buildroot/package/libodb/libodb.mk index f36d8957c..11ca9de86 100644 --- a/buildroot/package/libodb/libodb.mk +++ b/buildroot/package/libodb/libodb.mk @@ -11,5 +11,6 @@ LIBODB_SITE = https://www.codesynthesis.com/download/odb/$(LIBODB_VERSION_MAJOR) LIBODB_INSTALL_STAGING = YES LIBODB_LICENSE = GPL-2.0 LIBODB_LICENSE_FILES = LICENSE +LIBODB_CONF_ENV = CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" $(eval $(autotools-package)) diff --git a/buildroot/package/libpcap/libpcap.hash b/buildroot/package/libpcap/libpcap.hash index e70d07129..84c8e405d 100644 --- a/buildroot/package/libpcap/libpcap.hash +++ b/buildroot/package/libpcap/libpcap.hash @@ -1,6 +1,6 @@ # Locally calculated after checking pgp signature -# https://www.tcpdump.org/release/libpcap-1.10.0.tar.gz.sig -sha256 8d12b42623eeefee872f123bd0dc85d535b00df4d42e865f993c40f7bfc92b1e libpcap-1.10.0.tar.gz +# https://www.tcpdump.org/release/libpcap-1.10.1.tar.gz.sig +sha256 ed285f4accaf05344f90975757b3dbfe772ba41d1c401c2648b7fa45b711bdd4 libpcap-1.10.1.tar.gz # Hash for license file: sha256 8a54594d257e14a5260ac770f1633516cb51e3fc28c40136ce2697014eda7afd LICENSE diff --git a/buildroot/package/libpcap/libpcap.mk b/buildroot/package/libpcap/libpcap.mk index 24215ebed..1e02ec56e 100644 --- a/buildroot/package/libpcap/libpcap.mk +++ b/buildroot/package/libpcap/libpcap.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBPCAP_VERSION = 1.10.0 +LIBPCAP_VERSION = 1.10.1 LIBPCAP_SITE = https://www.tcpdump.org/release LIBPCAP_LICENSE = BSD-3-Clause LIBPCAP_LICENSE_FILES = LICENSE diff --git a/buildroot/package/libqmi/libqmi.mk b/buildroot/package/libqmi/libqmi.mk index a49b8615d..1be9cf457 100644 --- a/buildroot/package/libqmi/libqmi.mk +++ b/buildroot/package/libqmi/libqmi.mk @@ -16,6 +16,13 @@ LIBQMI_DEPENDENCIES = libglib2 LIBQMI_CONF_OPTS = --disable-Werror +ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y) +LIBQMI_DEPENDENCIES += gobject-introspection +LIBQMI_CONF_OPTS += --enable-introspection +else +LIBQMI_CONF_OPTS += --disable-introspection +endif + # if libgudev available, request udev support for a better # qmi-firmware-update experience ifeq ($(BR2_PACKAGE_LIBGUDEV),y) diff --git a/buildroot/package/libressl/libressl.mk b/buildroot/package/libressl/libressl.mk index ad345ba3f..d09df8f40 100644 --- a/buildroot/package/libressl/libressl.mk +++ b/buildroot/package/libressl/libressl.mk @@ -10,6 +10,7 @@ LIBRESSL_LICENSE = ISC (new additions), OpenSSL or SSLeay (original OpenSSL code LIBRESSL_LICENSE_FILES = COPYING LIBRESSL_CPE_ID_VENDOR = openbsd LIBRESSL_INSTALL_STAGING = YES +LIBRESSL_CONF_OPTS = -DOPENSSLDIR="/etc/ssl" ifeq ($(BR2_PACKAGE_LIBRESSL_BIN),) define LIBRESSL_REMOVE_BIN diff --git a/buildroot/package/librsvg/librsvg.hash b/buildroot/package/librsvg/librsvg.hash index 1b3c26687..cb558f147 100644 --- a/buildroot/package/librsvg/librsvg.hash +++ b/buildroot/package/librsvg/librsvg.hash @@ -1,5 +1,5 @@ -# From http://ftp.gnome.org/pub/gnome/sources/librsvg/2.50/librsvg-2.50.2.sha256sum -sha256 6211f271ce4cd44a7318190d36712e9cea384a933d3e3570004edeb210a056d3 librsvg-2.50.2.tar.xz +# From https://ftp.gnome.org/pub/gnome/sources/librsvg/2.50/librsvg-2.50.5.sha256sum +sha256 32701574c234fed352520c6d0bd5081f728184bc1a9b9c87d423dd27c32b9272 librsvg-2.50.5.tar.xz # Locally computed sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LIB diff --git a/buildroot/package/librsvg/librsvg.mk b/buildroot/package/librsvg/librsvg.mk index 5eeb68f9b..5f3d68839 100644 --- a/buildroot/package/librsvg/librsvg.mk +++ b/buildroot/package/librsvg/librsvg.mk @@ -5,7 +5,7 @@ ################################################################################ LIBRSVG_VERSION_MAJOR = 2.50 -LIBRSVG_VERSION = $(LIBRSVG_VERSION_MAJOR).2 +LIBRSVG_VERSION = $(LIBRSVG_VERSION_MAJOR).5 LIBRSVG_SITE = http://ftp.gnome.org/pub/gnome/sources/librsvg/$(LIBRSVG_VERSION_MAJOR) LIBRSVG_SOURCE = librsvg-$(LIBRSVG_VERSION).tar.xz LIBRSVG_INSTALL_STAGING = YES diff --git a/buildroot/package/libtasn1/libtasn1.hash b/buildroot/package/libtasn1/libtasn1.hash index 93cfa1a68..fc3610b96 100644 --- a/buildroot/package/libtasn1/libtasn1.hash +++ b/buildroot/package/libtasn1/libtasn1.hash @@ -1,7 +1,7 @@ # Locally calculated after checking pgp signature -# https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.16.0.tar.gz.sig -sha256 0e0fb0903839117cb6e3b56e68222771bebf22ad7fc2295a0ed7d576e8d4329d libtasn1-4.16.0.tar.gz +# https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.17.0.tar.gz.sig +sha256 ece7551cea7922b8e10d7ebc70bc2248d1fdd73351646a2d6a8d68a9421c45a5 libtasn1-4.17.0.tar.gz # Locally calculated -sha256 7446831f659f7ebfd8d497acc7f05dfa8e31c6cb6ba1b45df33d4895ab80f5a6 LICENSE +sha256 7446831f659f7ebfd8d497acc7f05dfa8e31c6cb6ba1b45df33d4895ab80f5a6 COPYING sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 doc/COPYING sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 doc/COPYING.LESSER diff --git a/buildroot/package/libtasn1/libtasn1.mk b/buildroot/package/libtasn1/libtasn1.mk index a35471682..d9d14fde8 100644 --- a/buildroot/package/libtasn1/libtasn1.mk +++ b/buildroot/package/libtasn1/libtasn1.mk @@ -4,11 +4,11 @@ # ################################################################################ -LIBTASN1_VERSION = 4.16.0 +LIBTASN1_VERSION = 4.17.0 LIBTASN1_SITE = $(BR2_GNU_MIRROR)/libtasn1 LIBTASN1_DEPENDENCIES = host-bison host-pkgconf LIBTASN1_LICENSE = GPL-3.0+ (tests, tools), LGPL-2.1+ (library) -LIBTASN1_LICENSE_FILES = LICENSE doc/COPYING doc/COPYING.LESSER +LIBTASN1_LICENSE_FILES = COPYING doc/COPYING doc/COPYING.LESSER LIBTASN1_CPE_ID_VENDOR = gnu LIBTASN1_INSTALL_STAGING = YES diff --git a/buildroot/package/libtirpc/0003-Automatically-generate-XDR-header-files-from-.x-sour.patch b/buildroot/package/libtirpc/0001-Automatically-generate-XDR-header-files-from-.x-sour.patch similarity index 100% rename from buildroot/package/libtirpc/0003-Automatically-generate-XDR-header-files-from-.x-sour.patch rename to buildroot/package/libtirpc/0001-Automatically-generate-XDR-header-files-from-.x-sour.patch diff --git a/buildroot/package/libtirpc/0004-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch b/buildroot/package/libtirpc/0002-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch similarity index 100% rename from buildroot/package/libtirpc/0004-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch rename to buildroot/package/libtirpc/0002-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch diff --git a/buildroot/package/libuci/libuci.mk b/buildroot/package/libuci/libuci.mk index 55afd53c1..fc8328796 100644 --- a/buildroot/package/libuci/libuci.mk +++ b/buildroot/package/libuci/libuci.mk @@ -7,9 +7,13 @@ LIBUCI_VERSION = 49ec6efbdac4819033d34f08927d795f83a3932d LIBUCI_SITE = git://git.openwrt.org/project/uci.git LIBUCI_LICENSE = LGPL-2.1, GPL-2.0 (tools) +LIBUCI_CPE_ID_VENDOR = openwrt LIBUCI_INSTALL_STAGING = YES LIBUCI_DEPENDENCIES = libubox +# Fixed in commit 19e29ffc15dbd958e8e6a648ee0982c68353516f, older than LIBUCI_VERSION +LIBUCI_IGNORE_CVES += CVE-2019-15513 + ifeq ($(BR2_PACKAGE_LUA_5_1),y) LIBUCI_DEPENDENCIES += lua LIBUCI_CONF_OPTS += -DBUILD_LUA=ON \ diff --git a/buildroot/package/libxmlrpc/libxmlrpc.hash b/buildroot/package/libxmlrpc/libxmlrpc.hash index 13e3b0b53..703477320 100644 --- a/buildroot/package/libxmlrpc/libxmlrpc.hash +++ b/buildroot/package/libxmlrpc/libxmlrpc.hash @@ -1,3 +1,3 @@ # Locally computed -sha256 06dcd87d9c88374559369ffbe83b3139cf41418c1a2d03f20e08808085f89fd0 xmlrpc-c-1.51.06.tgz +sha256 84d20ae33f927582f821d61c0b9194aefbf1d7924590a13fa9da5ae1698aded9 xmlrpc-c-1.51.07.tgz sha256 db7a6d3f187b218c3534010a83424c6bcdef88e6a0b6b1aa3a8762238bd642e6 doc/COPYING diff --git a/buildroot/package/libxmlrpc/libxmlrpc.mk b/buildroot/package/libxmlrpc/libxmlrpc.mk index c74d8a854..0871b6e71 100644 --- a/buildroot/package/libxmlrpc/libxmlrpc.mk +++ b/buildroot/package/libxmlrpc/libxmlrpc.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBXMLRPC_VERSION = 1.51.06 +LIBXMLRPC_VERSION = 1.51.07 LIBXMLRPC_SOURCE = xmlrpc-c-$(LIBXMLRPC_VERSION).tgz LIBXMLRPC_SITE = http://downloads.sourceforge.net/project/xmlrpc-c/Xmlrpc-c%20Super%20Stable/$(LIBXMLRPC_VERSION) LIBXMLRPC_LICENSE = BSD-3-Clause (xml-rpc main code and abyss web server), BSD like (lib/expat), Python 1.5.2 license (parts of xmlrpc_base64.c) diff --git a/buildroot/package/linux-firmware/linux-firmware.mk b/buildroot/package/linux-firmware/linux-firmware.mk index 96da50751..a4d54fff2 100644 --- a/buildroot/package/linux-firmware/linux-firmware.mk +++ b/buildroot/package/linux-firmware/linux-firmware.mk @@ -607,15 +607,13 @@ endif # brcm4366b1 ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM4366B1),y) -LINUX_FIRMWARE_FILES += \ - brcm/brcmfmac4366b-pcie.bin brcm/brcmfmac4366b-pcie.bin +LINUX_FIRMWARE_FILES += brcm/brcmfmac4366b-pcie.bin LINUX_FIRMWARE_ALL_LICENSE_FILES += LICENCE.broadcom_bcm43xx endif # brcm4366c0 ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM4366C0),y) -LINUX_FIRMWARE_FILES += \ - brcm/brcmfmac4366c-pcie.bin brcm/brcmfmac4366c-pcie.bin +LINUX_FIRMWARE_FILES += brcm/brcmfmac4366c-pcie.bin LINUX_FIRMWARE_ALL_LICENSE_FILES += LICENCE.broadcom_bcm43xx endif diff --git a/buildroot/package/linux-headers/Config.in.host b/buildroot/package/linux-headers/Config.in.host index 182ab9863..0567a58be 100644 --- a/buildroot/package/linux-headers/Config.in.host +++ b/buildroot/package/linux-headers/Config.in.host @@ -346,12 +346,12 @@ endchoice config BR2_DEFAULT_KERNEL_HEADERS string - default "4.4.272" if BR2_KERNEL_HEADERS_4_4 - default "4.9.272" if BR2_KERNEL_HEADERS_4_9 - default "4.14.236" if BR2_KERNEL_HEADERS_4_14 - default "4.19.194" if BR2_KERNEL_HEADERS_4_19 - default "5.4.125" if BR2_KERNEL_HEADERS_5_4 - default "5.10.43" if BR2_KERNEL_HEADERS_5_10 + default "4.4.279" if BR2_KERNEL_HEADERS_4_4 + default "4.9.279" if BR2_KERNEL_HEADERS_4_9 + default "4.14.243" if BR2_KERNEL_HEADERS_4_14 + default "4.19.202" if BR2_KERNEL_HEADERS_4_19 + default "5.4.139" if BR2_KERNEL_HEADERS_5_4 + default "5.10.57" if BR2_KERNEL_HEADERS_5_10 default BR2_DEFAULT_KERNEL_VERSION if BR2_KERNEL_HEADERS_VERSION default "custom" if BR2_KERNEL_HEADERS_CUSTOM_TARBALL default BR2_KERNEL_HEADERS_CUSTOM_REPO_VERSION \ diff --git a/buildroot/package/linuxptp/linuxptp.hash b/buildroot/package/linuxptp/linuxptp.hash index 4f8a1f89f..a5479b0eb 100644 --- a/buildroot/package/linuxptp/linuxptp.hash +++ b/buildroot/package/linuxptp/linuxptp.hash @@ -1,9 +1,9 @@ -# From https://sourceforge.net/projects/linuxptp/files/v3.0/ -sha1 9a3869dbd322252c9a6bc0dbdfe8941586810a7f linuxptp-3.1.tgz -md5 2264cb69c9af947028835c12c89a7572 linuxptp-3.1.tgz +# From https://sourceforge.net/projects/linuxptp/files/v3.1.1/ +sha1 f905eabc6fd0f03c6a353f9c4ba188a3bd1b774c linuxptp-3.1.1.tgz +md5 3b79ab5e77c5b5cf06bc1c8350d405bb linuxptp-3.1.1.tgz # Locally computed: -sha256 f58f5b11cf14dc7c4f7c9efdfb27190e43d02cf20c3525f6639edac10528ce7d linuxptp-3.1.tgz +sha256 94d6855f9b7f2d8e9b0ca6d384e3fae6226ce6fc012dbad02608bdef3be1c0d9 linuxptp-3.1.1.tgz # Hash for license file: sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING diff --git a/buildroot/package/linuxptp/linuxptp.mk b/buildroot/package/linuxptp/linuxptp.mk index f91be921a..048dd0b89 100644 --- a/buildroot/package/linuxptp/linuxptp.mk +++ b/buildroot/package/linuxptp/linuxptp.mk @@ -4,11 +4,12 @@ # ################################################################################ -LINUXPTP_VERSION = 3.1 +LINUXPTP_VERSION = 3.1.1 LINUXPTP_SOURCE = linuxptp-$(LINUXPTP_VERSION).tgz LINUXPTP_SITE = http://downloads.sourceforge.net/linuxptp LINUXPTP_LICENSE = GPL-2.0+ LINUXPTP_LICENSE_FILES = COPYING +LINUXPTP_CPE_ID_VENDOR = linuxptp_project LINUXPTP_MAKE_ENV = \ $(TARGET_MAKE_ENV) \ diff --git a/buildroot/package/lrzsz/lrzsz.mk b/buildroot/package/lrzsz/lrzsz.mk index 6c6823285..45c88619e 100644 --- a/buildroot/package/lrzsz/lrzsz.mk +++ b/buildroot/package/lrzsz/lrzsz.mk @@ -9,6 +9,7 @@ LRZSZ_SITE = http://www.ohse.de/uwe/releases LRZSZ_CONF_OPTS = --disable-timesync LRZSZ_LICENSE = GPL-2.0+ LRZSZ_LICENSE_FILES = COPYING +LRZSZ_CPE_ID_VENDOR = lrzsz_project LRZSZ_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) LRZSZ_CONF_ENV = LIBS=$(TARGET_NLS_LIBS) diff --git a/buildroot/package/ltp-testsuite/0002-lapi-Add-sysinfo.h-to-fix-build-with-MUSL-libc.patch b/buildroot/package/ltp-testsuite/0001-lapi-Add-sysinfo.h-to-fix-build-with-MUSL-libc.patch similarity index 100% rename from buildroot/package/ltp-testsuite/0002-lapi-Add-sysinfo.h-to-fix-build-with-MUSL-libc.patch rename to buildroot/package/ltp-testsuite/0001-lapi-Add-sysinfo.h-to-fix-build-with-MUSL-libc.patch diff --git a/buildroot/package/lvm2/Config.in b/buildroot/package/lvm2/Config.in index 5e767e2e9..2d4d6a2bb 100644 --- a/buildroot/package/lvm2/Config.in +++ b/buildroot/package/lvm2/Config.in @@ -26,6 +26,7 @@ if BR2_PACKAGE_LVM2 config BR2_PACKAGE_LVM2_STANDARD_INSTALL bool "standard install instead of only dmsetup" + default y # http://lists.busybox.net/pipermail/buildroot/2016-August/170592.html depends on !BR2_TOOLCHAIN_USES_MUSL help diff --git a/buildroot/package/mariadb/0001-add-extra-check-for-librt.patch b/buildroot/package/mariadb/0001-add-extra-check-for-librt.patch index 90aa626a0..0dd4c546f 100644 --- a/buildroot/package/mariadb/0001-add-extra-check-for-librt.patch +++ b/buildroot/package/mariadb/0001-add-extra-check-for-librt.patch @@ -1,4 +1,4 @@ -From e6244400dfd3547531a3a3289fadbbe19873f096 Mon Sep 17 00:00:00 2001 +From 960c74ec60962f707bd41724edaa2640c0324400 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Thu, 27 Oct 2016 20:33:21 -0700 Subject: [PATCH] add extra check for librt @@ -6,24 +6,26 @@ Subject: [PATCH] add extra check for librt https://jira.mariadb.org/browse/MDEV-10841 Signed-off-by: Ryan Coe +[Rebased on mariadb-10.3.30] +Signed-off-by: Peter Seiderer --- configure.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.cmake b/configure.cmake -index 896226de954f4642a238ca6a72e0930590dc1681..77ca485fb05e6b63bb69f9561b4eabfaa208a419 100644 +index 1b85c31b..4a1cd847 100644 --- a/configure.cmake +++ b/configure.cmake -@@ -126,6 +126,9 @@ IF(UNIX) +@@ -134,6 +134,9 @@ IF(UNIX) IF(NOT LIBRT) MY_SEARCH_LIBS(clock_gettime rt LIBRT) ENDIF() + IF(NOT LIBRT) + MY_SEARCH_LIBS(posix_spawn_file_actions_addclose rt LIBRT) + ENDIF() + set(THREADS_PREFER_PTHREAD_FLAG ON) FIND_PACKAGE(Threads) - SET(CMAKE_REQUIRED_LIBRARIES -- -2.9.3 +2.32.0 diff --git a/buildroot/package/mariadb/mariadb.hash b/buildroot/package/mariadb/mariadb.hash index 26faf529c..4025be317 100644 --- a/buildroot/package/mariadb/mariadb.hash +++ b/buildroot/package/mariadb/mariadb.hash @@ -1,6 +1,6 @@ -# From https://downloads.mariadb.org/mariadb/10.3.28 -sha256 e8c912cae2e5800d0da364cc23437907ed4be767f2cbdf198cf3afc03db6a6a3 mariadb-10.3.28.tar.gz -sha512 f6941bcc818f9b3640e4b5fdbdd3a32b45c62c04087e583f1f0e1c0258b09a21c7639abd1c902e183c057838308ad5eedc00ffee76d44a02043e8e349015fb20 mariadb-10.3.28.tar.gz +# From https://downloads.mariadb.org/mariadb/10.3.30 +sha256 bd8735c65bdb7ebcd5d779fb9d3de3f2fcd319ad6482278d73dfe7301ad4ae1b mariadb-10.3.30.tar.gz +sha512 742c30b3ebc0b6d36b98d4e7a7fb511098142e72d8f42cbfa73a0bdea2059be17e790fbda4732329bbd99e4b50b13cf18e8122964a473e0b62170ab869eca8fc mariadb-10.3.30.tar.gz # Hash for license files sha256 a4665c1189fe31e0bbc27e9b55439df7dad6e99805407fe58d78da7aabe678f8 README.md diff --git a/buildroot/package/mariadb/mariadb.mk b/buildroot/package/mariadb/mariadb.mk index 56d6afab1..374b3dc35 100644 --- a/buildroot/package/mariadb/mariadb.mk +++ b/buildroot/package/mariadb/mariadb.mk @@ -4,7 +4,7 @@ # ################################################################################ -MARIADB_VERSION = 10.3.28 +MARIADB_VERSION = 10.3.30 MARIADB_SITE = https://downloads.mariadb.org/interstitial/mariadb-$(MARIADB_VERSION)/source MARIADB_LICENSE = GPL-2.0 (server), GPL-2.0 with FLOSS exception (GPL client library), LGPL-2.0 (LGPL client library) # Tarball no longer contains LGPL license text @@ -135,5 +135,13 @@ endef MARIADB_POST_INSTALL_TARGET_HOOKS += MARIADB_POST_INSTALL +# overwrite cross-compiled mariadb_config executable by an native one +define MARIADB_POST_STAGING_INSTALL + $(HOSTCC) -I$(@D)/libmariadb/include \ + -o $(STAGING_DIR)/usr/bin/mariadb_config \ + $(@D)/libmariadb/mariadb_config/mariadb_config.c +endef +MARIADB_POST_INSTALL_STAGING_HOOKS += MARIADB_POST_STAGING_INSTALL + $(eval $(cmake-package)) $(eval $(host-cmake-package)) diff --git a/buildroot/package/mbedtls/mbedtls.hash b/buildroot/package/mbedtls/mbedtls.hash index d9912a50d..b93da164f 100644 --- a/buildroot/package/mbedtls/mbedtls.hash +++ b/buildroot/package/mbedtls/mbedtls.hash @@ -1,4 +1,4 @@ -# From https://github.com/ARMmbed/mbedtls/releases/tag/v2.16.10: -sha256 96257bb03b30300b2f35f861ffe204ed957e9fd0329d80646fe57fc49f589b29 mbedtls-2.16.10.tar.gz +# From https://github.com/ARMmbed/mbedtls/releases/tag/v2.16.11: +sha256 c18e7e9abf95e69e425260493720470021384a1728417042060a35d0b7b18b41 mbedtls-2.16.11.tar.gz # Locally calculated sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 apache-2.0.txt diff --git a/buildroot/package/mbedtls/mbedtls.mk b/buildroot/package/mbedtls/mbedtls.mk index 8776fb913..9207daf18 100644 --- a/buildroot/package/mbedtls/mbedtls.mk +++ b/buildroot/package/mbedtls/mbedtls.mk @@ -4,7 +4,7 @@ # ################################################################################ -MBEDTLS_VERSION = 2.16.10 +MBEDTLS_VERSION = 2.16.11 MBEDTLS_SITE = $(call github,ARMmbed,mbedtls,v$(MBEDTLS_VERSION)) MBEDTLS_CONF_OPTS = \ -DENABLE_PROGRAMS=$(if $(BR2_PACKAGE_MBEDTLS_PROGRAMS),ON,OFF) \ diff --git a/buildroot/package/mesa3d/Config.in b/buildroot/package/mesa3d/Config.in index a96fd46bb..1104071e3 100644 --- a/buildroot/package/mesa3d/Config.in +++ b/buildroot/package/mesa3d/Config.in @@ -66,7 +66,8 @@ config BR2_PACKAGE_MESA3D_DRI_DRIVER !BR2_PACKAGE_MESA3D_OPENGL_EGL && \ !BR2_PACKAGE_MESA3D_OSMESA_CLASSIC select BR2_PACKAGE_XLIB_LIBXSHMFENCE if \ - (BR2_PACKAGE_XORG7 && BR2_TOOLCHAIN_HAS_SYNC_4) + (BR2_PACKAGE_XORG7 && BR2_TOOLCHAIN_HAS_SYNC_4 && \ + !BR2_RISCV_32) config BR2_PACKAGE_MESA3D_VULKAN_DRIVER bool diff --git a/buildroot/package/monit/monit.mk b/buildroot/package/monit/monit.mk index 93e310ff7..b9e131a36 100644 --- a/buildroot/package/monit/monit.mk +++ b/buildroot/package/monit/monit.mk @@ -8,6 +8,7 @@ MONIT_VERSION = 5.26.0 MONIT_SITE = http://mmonit.com/monit/dist MONIT_LICENSE = AGPL-3.0 with OpenSSL exception MONIT_LICENSE_FILES = COPYING +MONIT_CPE_ID_VENDOR = mmonit # # Touching Makefile.am: MONIT_AUTORECONF = YES diff --git a/buildroot/package/mono/mono.mk b/buildroot/package/mono/mono.mk index df3481a49..27f788622 100644 --- a/buildroot/package/mono/mono.mk +++ b/buildroot/package/mono/mono.mk @@ -53,7 +53,7 @@ HOST_MONO_CONF_OPTS = $(MONO_COMMON_CONF_OPTS) --disable-libraries # ensure monolite is used HOST_MONO_MAKE_OPTS += EXTERNAL_MCS=false -HOST_MONO_DEPENDENCIES = host-monolite host-gettext +HOST_MONO_DEPENDENCIES = host-monolite host-gettext host-python3 define HOST_MONO_SETUP_MONOLITE rm -rf $(@D)/mcs/class/lib/monolite diff --git a/buildroot/package/mosquitto/mosquitto.hash b/buildroot/package/mosquitto/mosquitto.hash index aa052979f..baa2a90c5 100644 --- a/buildroot/package/mosquitto/mosquitto.hash +++ b/buildroot/package/mosquitto/mosquitto.hash @@ -1,6 +1,6 @@ # Locally calculated after checking gpg signature -# from https://mosquitto.org/files/source/mosquitto-2.0.10.tar.gz.asc -sha256 0188f7b21b91d6d80e992b8d6116ba851468b3bd154030e8a003ed28fb6f4a44 mosquitto-2.0.10.tar.gz +# from https://mosquitto.org/files/source/mosquitto-2.0.11.tar.gz.asc +sha256 7b36a7198bce85cf31b132f5c6ee36dcf5dadf86fb768501eb1e11ce95d4f78a mosquitto-2.0.11.tar.gz # License files sha256 d3c4ccace4e5d3cc89d34cf2a0bc85b8596bfc0a32b815d0d77f9b7c41b5350c LICENSE.txt diff --git a/buildroot/package/mosquitto/mosquitto.mk b/buildroot/package/mosquitto/mosquitto.mk index 7820e8fea..52f9c9873 100644 --- a/buildroot/package/mosquitto/mosquitto.mk +++ b/buildroot/package/mosquitto/mosquitto.mk @@ -4,7 +4,7 @@ # ################################################################################ -MOSQUITTO_VERSION = 2.0.10 +MOSQUITTO_VERSION = 2.0.11 MOSQUITTO_SITE = https://mosquitto.org/files/source MOSQUITTO_LICENSE = EPL-2.0 or EDLv1.0 MOSQUITTO_LICENSE_FILES = LICENSE.txt epl-v20 edl-v10 diff --git a/buildroot/package/mpd/Config.in b/buildroot/package/mpd/Config.in index 9748c7d0a..7a2597558 100644 --- a/buildroot/package/mpd/Config.in +++ b/buildroot/package/mpd/Config.in @@ -5,8 +5,8 @@ menuconfig BR2_PACKAGE_MPD depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # fork depends on BR2_TOOLCHAIN_HAS_ATOMIC - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # C++17 - depends on BR2_HOST_GCC_AT_LEAST_7 # C++17 + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # C++17 + depends on BR2_HOST_GCC_AT_LEAST_8 # C++17 select BR2_PACKAGE_BOOST select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE help @@ -403,5 +403,5 @@ comment "mpd needs a toolchain w/ C++, threads, wchar, gcc >= 7, host gcc >= 7" depends on BR2_TOOLCHAIN_HAS_ATOMIC depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \ !BR2_TOOLCHAIN_HAS_THREADS || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \ - !BR2_HOST_GCC_AT_LEAST_7 + !BR2_TOOLCHAIN_GCC_AT_LEAST_8 || \ + !BR2_HOST_GCC_AT_LEAST_8 diff --git a/buildroot/package/mpg123/mpg123.mk b/buildroot/package/mpg123/mpg123.mk index 9aa9cd1c1..fbb011c2c 100644 --- a/buildroot/package/mpg123/mpg123.mk +++ b/buildroot/package/mpg123/mpg123.mk @@ -7,7 +7,6 @@ MPG123_VERSION = 1.25.15 MPG123_SOURCE = mpg123-$(MPG123_VERSION).tar.bz2 MPG123_SITE = http://downloads.sourceforge.net/project/mpg123/mpg123/$(MPG123_VERSION) -MPG123_CONF_OPTS = --disable-lfs-alias MPG123_INSTALL_STAGING = YES MPG123_LICENSE = LGPL-2.1 MPG123_LICENSE_FILES = COPYING diff --git a/buildroot/package/mpv/mpv.mk b/buildroot/package/mpv/mpv.mk index 25ac783b5..30f377054 100644 --- a/buildroot/package/mpv/mpv.mk +++ b/buildroot/package/mpv/mpv.mk @@ -28,6 +28,10 @@ MPV_CONF_OPTS = \ --disable-uchardet \ --disable-vapoursynth +ifeq ($(BR2_REPRODUCIBLE),y) +MPV_CONF_OPTS += --disable-build-date +endif + ifeq ($(BR2_STATIC_LIBS),y) MPV_CONF_OPTS += --disable-libmpv-shared --enable-libmpv-static else diff --git a/buildroot/package/nbd/0001-Also-close-the-file-descriptor-before-returning.patch b/buildroot/package/nbd/0001-Also-close-the-file-descriptor-before-returning.patch deleted file mode 100644 index 70330c8e9..000000000 --- a/buildroot/package/nbd/0001-Also-close-the-file-descriptor-before-returning.patch +++ /dev/null @@ -1,25 +0,0 @@ -From d2480de925e83c8bf60faa96141f4198bdf7f619 Mon Sep 17 00:00:00 2001 -From: Wouter Verhelst -Date: Fri, 2 Aug 2019 10:33:00 +0200 -Subject: [PATCH] Also close the file descriptor before returning - -Coverity CID#1162721 -[Retrieved from: -https://github.com/NetworkBlockDevice/nbd/commit/d2480de925e83c8bf60faa96141f4198bdf7f619] -Signed-off-by: Fabrice Fontaine ---- - nbd-client.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/nbd-client.c b/nbd-client.c -index e9ec0a86..94035886 100644 ---- a/nbd-client.c -+++ b/nbd-client.c -@@ -930,6 +930,7 @@ void disconnect(char* device) { - if (ioctl(nbd, NBD_CLEAR_SOCK)<0) - err("Ioctl failed: %m\n"); - printf("done\n"); -+ close(nbd); - } - - #if HAVE_NETLINK diff --git a/buildroot/package/nbd/nbd.hash b/buildroot/package/nbd/nbd.hash index d856953c2..f0df35bc2 100644 --- a/buildroot/package/nbd/nbd.hash +++ b/buildroot/package/nbd/nbd.hash @@ -1,7 +1,7 @@ -# From http://sourceforge.net/projects/nbd/files/nbd/3.20/ -md5 910fe6c152f8c30ad8608388e6a4ce89 nbd-3.20.tar.xz -sha1 9240430266ff4bfb2316ef6d880056a9974a59fd nbd-3.20.tar.xz +# From http://sourceforge.net/projects/nbd/files/nbd/3.21/ +md5 c51c4c500fe1ed84c3d5d5dd2ca71d23 nbd-3.21.tar.xz +sha1 88c3296d43d20d7bda97e0f1bab0243a4f6fa880 nbd-3.21.tar.xz # Locally calculated -sha256 e0e1b3538ab7ae5accf56180afd1a9887d415b98d21223b8ad42592b4af7d6cd nbd-3.20.tar.xz -sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING +sha256 e7688af39d91733bbcd2db08062c44fe503d004e51528740139c44aff6a6bef9 nbd-3.21.tar.xz +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING diff --git a/buildroot/package/nbd/nbd.mk b/buildroot/package/nbd/nbd.mk index 6c77bffdf..0a7f08b2c 100644 --- a/buildroot/package/nbd/nbd.mk +++ b/buildroot/package/nbd/nbd.mk @@ -4,7 +4,7 @@ # ################################################################################ -NBD_VERSION = 3.20 +NBD_VERSION = 3.21 NBD_SOURCE = nbd-$(NBD_VERSION).tar.xz NBD_SITE = http://downloads.sourceforge.net/project/nbd/nbd/$(NBD_VERSION) NBD_CONF_OPTS = --enable-lfs diff --git a/buildroot/package/neard/Config.in b/buildroot/package/neard/Config.in index 277e467ce..a60fb3f8f 100644 --- a/buildroot/package/neard/Config.in +++ b/buildroot/package/neard/Config.in @@ -13,9 +13,7 @@ config BR2_PACKAGE_NEARD daemon is a part of the NFC stack provided by the Linux NFC project. - http://git.kernel.org/?p=network/nfc/neard.git;a=summary - - https://01.org/linux-nfc/ + https://git.kernel.org/pub/scm/network/nfc/neard.git if BR2_PACKAGE_NEARD diff --git a/buildroot/package/netsnmp/netsnmp.hash b/buildroot/package/netsnmp/netsnmp.hash index e3adb28c6..9d196c8be 100644 --- a/buildroot/package/netsnmp/netsnmp.hash +++ b/buildroot/package/netsnmp/netsnmp.hash @@ -2,3 +2,6 @@ # https://sourceforge.net/projects/net-snmp/files/net-snmp/5.9/net-snmp-5.9.tar.gz.asc # using key D0F8F495DA6160C44EFFBF10F07B9D2DACB19FD6 sha256 04303a66f85d6d8b16d3cc53bde50428877c82ab524e17591dfceaeb94df6071 net-snmp-5.9.tar.gz + +# Hash for license file +sha256 ed869ea395a1f125819a56676385ab0557a21507764bf56f2943302011381e59 COPYING diff --git a/buildroot/package/nettle/nettle.hash b/buildroot/package/nettle/nettle.hash index 09652dcc8..cd32ad442 100644 --- a/buildroot/package/nettle/nettle.hash +++ b/buildroot/package/nettle/nettle.hash @@ -1,6 +1,6 @@ # Locally calculated after checking pgp signature -# https://ftp.gnu.org/gnu/nettle/nettle-3.7.2.tar.gz.sig -sha256 8d2a604ef1cde4cd5fb77e422531ea25ad064679ff0adf956e78b3352e0ef162 nettle-3.7.2.tar.gz +# https://ftp.gnu.org/gnu/nettle/nettle-3.7.3.tar.gz.sig +sha256 661f5eb03f048a3b924c3a8ad2515d4068e40f67e774e8a26827658007e3bcf0 nettle-3.7.3.tar.gz # Locally calculated sha256 a853c2ffec17057872340eee242ae4d96cbf2b520ae27d903e1b2fef1a5f9d1c COPYING.LESSERv3 sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYINGv2 diff --git a/buildroot/package/nettle/nettle.mk b/buildroot/package/nettle/nettle.mk index bf833eb27..3dbd0cb94 100644 --- a/buildroot/package/nettle/nettle.mk +++ b/buildroot/package/nettle/nettle.mk @@ -4,7 +4,7 @@ # ################################################################################ -NETTLE_VERSION = 3.7.2 +NETTLE_VERSION = 3.7.3 NETTLE_SITE = http://www.lysator.liu.se/~nisse/archive NETTLE_DEPENDENCIES = gmp NETTLE_INSTALL_STAGING = YES diff --git a/buildroot/package/nginx-modsecurity/Config.in b/buildroot/package/nginx-modsecurity/Config.in index 2af11eeee..b1fcbadd7 100644 --- a/buildroot/package/nginx-modsecurity/Config.in +++ b/buildroot/package/nginx-modsecurity/Config.in @@ -2,9 +2,7 @@ config BR2_PACKAGE_NGINX_MODSECURITY bool "nginx-modsecurity" depends on BR2_PACKAGE_NGINX_HTTP depends on BR2_INSTALL_LIBSTDCPP # libmodsecurity - depends on !BR2_STATIC_LIBS # libmodsecurity depends on BR2_TOOLCHAIN_HAS_THREADS # libmodsecurity - select BR2_PACKAGE_PCRE # libmodsecurity select BR2_PACKAGE_LIBMODSECURITY help The ModSecurity-nginx connector is the connection @@ -13,7 +11,6 @@ config BR2_PACKAGE_NGINX_MODSECURITY https://github.com/SpiderLabs/ModSecurity-nginx -comment "nginx-modsecurity needs a toolchain w/ C++, dynamic library, threads" +comment "nginx-modsecurity needs a toolchain w/ C++, threads" depends on BR2_PACKAGE_NGINX_HTTP - depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \ - !BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/buildroot/package/nmap/0002-ncat-unix-socket.patch b/buildroot/package/nmap/0002-ncat-unix-socket.patch new file mode 100644 index 000000000..b6484ebee --- /dev/null +++ b/buildroot/package/nmap/0002-ncat-unix-socket.patch @@ -0,0 +1,30 @@ +ChangeLog: + +o [Ncat][GH#2154] Ncat no longer crashes when used with Unix domain sockets. + +Backported from: r38121 + +Signed-off-by: Alexey Neyman + +Index: ncat/ncat_main.c +=================================================================== +--- a/ncat/ncat_main.c (revision 38120) ++++ b/ncat/ncat_main.c (revision 38121) +@@ -846,7 +846,7 @@ + targetaddrs->addr.un.sun_family = AF_UNIX; + strncpy(targetaddrs->addr.un.sun_path, argv[optind], sizeof(targetaddrs->addr.un.sun_path)); + targetaddrs->addrlen = SUN_LEN(&targetaddrs->addr.un); +- o.target = argv[optind]; ++ o.sslservername = o.target = argv[optind]; + optind++; + } else + #endif +@@ -865,7 +865,7 @@ + targetaddrs->addr.vm.svm_cid = long_cid; + + targetaddrs->addrlen = sizeof(targetaddrs->addr.vm); +- o.target = argv[optind]; ++ o.sslservername = o.target = argv[optind]; + optind++; + } + } else diff --git a/buildroot/package/nodejs/nodejs.hash b/buildroot/package/nodejs/nodejs.hash index 1e0358771..7d11a8d10 100644 --- a/buildroot/package/nodejs/nodejs.hash +++ b/buildroot/package/nodejs/nodejs.hash @@ -1,5 +1,5 @@ -# From https://nodejs.org/dist/v12.22.1/SHASUMS256.txt -sha256 dd650df7773a6ed3e390320ba51ef33cba6499f0e9397709ea3d1debdcbcb989 node-v12.22.1.tar.xz +# From https://nodejs.org/dist/v12.22.4/SHASUMS256.txt +sha256 44cd4eab131e5282fc923e9e720d983a0b44c12e4aa4f6c3598dc97ae1e4cd4c node-v12.22.4.tar.xz # Hash for license file sha256 221417a7ca275112a5ac54639b36ee3c5184e74631ea1e1b01b701293b655190 LICENSE diff --git a/buildroot/package/nodejs/nodejs.mk b/buildroot/package/nodejs/nodejs.mk index 108fce092..08d2f6d7c 100644 --- a/buildroot/package/nodejs/nodejs.mk +++ b/buildroot/package/nodejs/nodejs.mk @@ -4,7 +4,7 @@ # ################################################################################ -NODEJS_VERSION = 12.22.1 +NODEJS_VERSION = 12.22.4 NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION) NODEJS_DEPENDENCIES = host-python host-nodejs c-ares \ diff --git a/buildroot/package/ntp/ntpd.service b/buildroot/package/ntp/ntpd.service index 7964c5389..9a0f4c6db 100644 --- a/buildroot/package/ntp/ntpd.service +++ b/buildroot/package/ntp/ntpd.service @@ -5,6 +5,10 @@ After=network.target [Service] Type=forking PIDFile=/run/ntpd.pid +# Turn off DNSSEC validation for hostname look-ups, since those need the +# correct time to work, but we likely won't acquire that without NTP. Let's +# break this chicken-and-egg cycle here. +Environment=SYSTEMD_NSS_RESOLVE_VALIDATE=0 ExecStart=/usr/sbin/ntpd -g -p /run/ntpd.pid [Install] diff --git a/buildroot/package/openntpd/ntpd.service b/buildroot/package/openntpd/ntpd.service index a4ffa7318..c2924b0c5 100644 --- a/buildroot/package/openntpd/ntpd.service +++ b/buildroot/package/openntpd/ntpd.service @@ -5,6 +5,10 @@ Conflicts=systemd-timesyncd.service [Service] Type=simple +# Turn off DNSSEC validation for hostname look-ups, since those need the +# correct time to work, but we likely won't acquire that without NTP. Let's +# break this chicken-and-egg cycle here. +Environment=SYSTEMD_NSS_RESOLVE_VALIDATE=0 ExecStart=/usr/sbin/ntpd -s -d [Install] diff --git a/buildroot/package/openpgm/0002-openpgm-pgm-checksum.c-fix-build-with-32-bits-MMX.patch b/buildroot/package/openpgm/0002-openpgm-pgm-checksum.c-fix-build-with-32-bits-MMX.patch new file mode 100644 index 000000000..a04dc7dba --- /dev/null +++ b/buildroot/package/openpgm/0002-openpgm-pgm-checksum.c-fix-build-with-32-bits-MMX.patch @@ -0,0 +1,41 @@ +From b7fa865fa6b06d97d424c500fd1c4bc44c096359 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sun, 1 Nov 2020 22:46:18 +0100 +Subject: [PATCH] openpgm/pgm/checksum.c: fix build with 32 bits MMX + +Build with i386-pentium-mmx or i686 is broken since version 5-3-128 and +https://github.com/steve-o/openpgm/commit/b276dc15be5d4e6e1143b9de25d09f63f9c85135 +because _mm_cvtm64_si64 is undefined resulting in the following build +failure for example on zeromq: + +/srv/storage/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/i586-buildroot-linux-musl/8.3.0/../../../../i586-buildroot-linux-musl/bin/ld: /srv/storage/autobuild/run/instance-3/output-1/host/i586-buildroot-linux-musl/sysroot/usr/lib32/libpgm-5.3.so.0: undefined reference to `_mm_cvtm64_si64' + +So use the fallback if __x86_64__ is not defined + +Fixes: + - http://autobuild.buildroot.org/results/01d9be37e8a743307128f53f41785654c9971e1a + +Signed-off-by: Fabrice Fontaine +Signed-off-by: Baruch Siach +--- +Upstream status: commit b7fa865fa6b06d97d424c500fd1c4bc44c096359 + + openpgm/pgm/checksum.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/openpgm/pgm/checksum.c b/openpgm/pgm/checksum.c +index fef89bce237c..8d8dd3f32305 100644 +--- a/openpgm/pgm/checksum.c ++++ b/openpgm/pgm/checksum.c +@@ -948,7 +948,7 @@ do_csumcpy_mmx ( + + sum = _mm_add_pi32 (sum, lo); + sum = _mm_add_pi32 (sum, hi); +-#if 1 ++#if defined(__x86_64__) + *(int64_t*)dst = _mm_cvtm64_si64 (tmp); + #else + ((int*)dst)[1] = _mm_cvtsi64_si32 (tmp); +-- +2.30.2 + diff --git a/buildroot/package/openswan/openswan.mk b/buildroot/package/openswan/openswan.mk index 7f083f695..bb56e4516 100644 --- a/buildroot/package/openswan/openswan.mk +++ b/buildroot/package/openswan/openswan.mk @@ -15,7 +15,7 @@ OPENSWAN_MAKE_OPTS = ARCH=$(BR2_ARCH) CC="$(TARGET_CC)" POD2MAN="" XMLTO="" \ USERCOMPILE="$(TARGET_CFLAGS) $(if $(BR2_TOOLCHAIN_SUPPORTS_PIE),-fPIE)" \ USERLINK="$(TARGET_LDFLAGS) $(if $(BR2_TOOLCHAIN_SUPPORTS_PIE),-fPIE)" \ INC_USRLOCAL=/usr USE_KLIPS=false USE_MAST=false USE_NM=false \ - USE_NOMANINSTALL=true + USE_NOMANINSTALL=true WERROR="" ifeq ($(BR2_PACKAGE_LIBCURL),y) OPENSWAN_DEPENDENCIES += libcurl diff --git a/buildroot/package/pango/pango.hash b/buildroot/package/pango/pango.hash index a672b7cfa..94568a68e 100644 --- a/buildroot/package/pango/pango.hash +++ b/buildroot/package/pango/pango.hash @@ -1,5 +1,5 @@ -# From https://ftp.acc.umu.se/pub/GNOME/sources/pango/1.48/pango-1.48.0.sha256sum -sha256 391f26f3341c2d7053e0fb26a956bd42360dadd825efe7088b1e9340a65e74e6 pango-1.48.0.tar.xz +# From https://ftp.acc.umu.se/pub/GNOME/sources/pango/1.48/pango-1.48.4.sha256sum +sha256 28a82f6a6cab60aa3b75a90f04197ead2d311fa8fe8b7bfdf8666e2781d506dc pango-1.48.7.tar.xz # Locally computed sha256 d245807f90032872d1438d741ed21e2490e1175dc8aa3afa5ddb6c8e529b58e5 COPYING diff --git a/buildroot/package/pango/pango.mk b/buildroot/package/pango/pango.mk index 803e46f19..2a4a9f49d 100644 --- a/buildroot/package/pango/pango.mk +++ b/buildroot/package/pango/pango.mk @@ -5,7 +5,7 @@ ################################################################################ PANGO_VERSION_MAJOR = 1.48 -PANGO_VERSION = $(PANGO_VERSION_MAJOR).0 +PANGO_VERSION = $(PANGO_VERSION_MAJOR).7 PANGO_SOURCE = pango-$(PANGO_VERSION).tar.xz PANGO_SITE = http://ftp.gnome.org/pub/GNOME/sources/pango/$(PANGO_VERSION_MAJOR) PANGO_INSTALL_STAGING = YES diff --git a/buildroot/package/pcre2/pcre2.mk b/buildroot/package/pcre2/pcre2.mk index ddb53280f..84a8413f8 100644 --- a/buildroot/package/pcre2/pcre2.mk +++ b/buildroot/package/pcre2/pcre2.mk @@ -9,6 +9,7 @@ PCRE2_SITE = https://ftp.pcre.org/pub/pcre PCRE2_SOURCE = pcre2-$(PCRE2_VERSION).tar.bz2 PCRE2_LICENSE = BSD-3-Clause PCRE2_LICENSE_FILES = LICENCE +PCRE2_CPE_ID_VENDOR = pcre PCRE2_INSTALL_STAGING = YES PCRE2_CONFIG_SCRIPTS = pcre2-config diff --git a/buildroot/package/perl-crypt-openssl-rsa/Config.in b/buildroot/package/perl-crypt-openssl-rsa/Config.in index e58a921bc..e2c013134 100644 --- a/buildroot/package/perl-crypt-openssl-rsa/Config.in +++ b/buildroot/package/perl-crypt-openssl-rsa/Config.in @@ -1,6 +1,7 @@ config BR2_PACKAGE_PERL_CRYPT_OPENSSL_RSA bool "perl-crypt-openssl-rsa" depends on !BR2_STATIC_LIBS + select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_PERL_CRYPT_OPENSSL_RANDOM # runtime help RSA encoding and decoding, using the openSSL libraries. diff --git a/buildroot/package/perl-crypt-openssl-rsa/perl-crypt-openssl-rsa.mk b/buildroot/package/perl-crypt-openssl-rsa/perl-crypt-openssl-rsa.mk index b16152342..23fd1ac38 100644 --- a/buildroot/package/perl-crypt-openssl-rsa/perl-crypt-openssl-rsa.mk +++ b/buildroot/package/perl-crypt-openssl-rsa/perl-crypt-openssl-rsa.mk @@ -9,7 +9,8 @@ PERL_CRYPT_OPENSSL_RSA_SOURCE = Crypt-OpenSSL-RSA-$(PERL_CRYPT_OPENSSL_RSA_VERSI PERL_CRYPT_OPENSSL_RSA_SITE = $(BR2_CPAN_MIRROR)/authors/id/T/TO/TODDR PERL_CRYPT_OPENSSL_RSA_DEPENDENCIES = \ host-perl-crypt-openssl-guess \ - perl-crypt-openssl-random + perl-crypt-openssl-random \ + openssl PERL_CRYPT_OPENSSL_RSA_LICENSE = Artistic or GPL-1.0+ PERL_CRYPT_OPENSSL_RSA_LICENSE_FILES = LICENSE PERL_CRYPT_OPENSSL_RSA_DISTNAME = Crypt-OpenSSL-RSA diff --git a/buildroot/package/php/php.hash b/buildroot/package/php/php.hash index 3fb0d09d3..2280b3f9b 100644 --- a/buildroot/package/php/php.hash +++ b/buildroot/package/php/php.hash @@ -1,5 +1,5 @@ # From https://www.php.net/downloads.php -sha256 6c17172c4a411ccb694d9752de899bb63c72a0a3ebe5089116bc13658a1467b2 php-7.4.19.tar.xz +sha256 8e078cd7d2f49ac3fcff902490a5bb1addc885e7e3b0d8dd068f42c68297bde8 php-7.4.22.tar.xz # License file sha256 a188db807d711536f71e27b7d36879d63480f7994dc18adc08e624b3c5430fff LICENSE diff --git a/buildroot/package/php/php.mk b/buildroot/package/php/php.mk index 73553e039..41075b2f7 100644 --- a/buildroot/package/php/php.mk +++ b/buildroot/package/php/php.mk @@ -4,7 +4,7 @@ # ################################################################################ -PHP_VERSION = 7.4.19 +PHP_VERSION = 7.4.22 PHP_SITE = http://www.php.net/distributions PHP_SOURCE = php-$(PHP_VERSION).tar.xz PHP_INSTALL_STAGING = YES diff --git a/buildroot/package/pixman/pixman.mk b/buildroot/package/pixman/pixman.mk index d99005ecb..6fab53959 100644 --- a/buildroot/package/pixman/pixman.mk +++ b/buildroot/package/pixman/pixman.mk @@ -44,12 +44,20 @@ ifneq ($(BR2_iwmmxt),y) PIXMAN_CONF_OPTS += --disable-arm-iwmmxt endif +PIXMAN_CFLAGS = $(TARGET_CFLAGS) + # toolchain gets confused about TLS access through GOT (PIC), so disable TLS # movhi r4, %got_hiadj(%tls_ldo(fast_path_cache)) # {standard input}:172: Error: bad expression ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII),y) -PIXMAN_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -DPIXMAN_NO_TLS" +PIXMAN_CFLAGS += -DPIXMAN_NO_TLS endif +ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_101737),y) +PIXMAN_CFLAGS += -O0 +endif + +PIXMAN_CONF_OPTS += CFLAGS="$(PIXMAN_CFLAGS)" + $(eval $(autotools-package)) $(eval $(host-autotools-package)) diff --git a/buildroot/package/pkg-generic.mk b/buildroot/package/pkg-generic.mk index 9fbc63d19..45589bcbb 100644 --- a/buildroot/package/pkg-generic.mk +++ b/buildroot/package/pkg-generic.mk @@ -826,6 +826,7 @@ endif # human-friendly targets and target sequencing $(1): $(1)-install $(1)-install: $$($(2)_TARGET_INSTALL) +$$($(2)_TARGET_INSTALL): $$($(2)_TARGET_BUILD) ifeq ($$($(2)_TYPE),host) $$($(2)_TARGET_INSTALL): $$($(2)_TARGET_INSTALL_HOST) diff --git a/buildroot/package/polkit/S50polkit b/buildroot/package/polkit/S50polkit new file mode 100755 index 000000000..f07e2d613 --- /dev/null +++ b/buildroot/package/polkit/S50polkit @@ -0,0 +1,51 @@ +#!/bin/sh + +DAEMON="polkitd" +DAEMON_PATH="/usr/lib/polkit-1/${DAEMON}" +PIDFILE="/var/run/${DAEMON}.pid" +POLKITD_ARGS="--no-debug" + +# polkitd does not create a pidfile, so pass "-n" in the command line +# and use "-m" to instruct start-stop-daemon to create one. +start() { + printf 'Starting %s: ' "${DAEMON}" + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon -bmSqp "$PIDFILE" -x ${DAEMON_PATH} -- ${POLKITD_ARGS} + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "${DAEMON}" + start-stop-daemon -Kqp "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + rm -f "$PIDFILE" + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +restart() { + stop + sleep 1 + start +} + +case "$1" in + start|stop|restart|reload) + "$1";; + reload) + # Restart, since there is no true "reload" feature. + restart;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac diff --git a/buildroot/package/polkit/polkit.mk b/buildroot/package/polkit/polkit.mk index bf9b5a711..e00b634b7 100644 --- a/buildroot/package/polkit/polkit.mk +++ b/buildroot/package/polkit/polkit.mk @@ -57,4 +57,9 @@ define POLKIT_INSTALL_INIT_SYSTEMD endef +define POLKIT_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/polkit/S50polkit \ + $(TARGET_DIR)/etc/init.d/S50polkit +endef + $(eval $(autotools-package)) diff --git a/buildroot/package/postgresql/pg_config b/buildroot/package/postgresql/pg_config index 3b0cb35f2..099f1ee39 100644 --- a/buildroot/package/postgresql/pg_config +++ b/buildroot/package/postgresql/pg_config @@ -31,6 +31,10 @@ case "$1" in --cflags) echo "@TARGET_CFLAGS@" ;; + --cflags_sl) + # defined at src/template/linux + echo "-fPIC" + ;; --cc) echo "@TARGET_CC@" ;; diff --git a/buildroot/package/proxychains-ng/0001-configure-fix-check_link_silent-test.patch b/buildroot/package/proxychains-ng/0001-configure-fix-check_link_silent-test.patch new file mode 100644 index 000000000..aadfef9cd --- /dev/null +++ b/buildroot/package/proxychains-ng/0001-configure-fix-check_link_silent-test.patch @@ -0,0 +1,41 @@ +From 4a557f242a76c6a2a3134acf1d3279818f8ab371 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Fri, 23 Jul 2021 09:50:36 +0200 +Subject: [PATCH] configure: fix check_link_silent test + +Replace -o /dev/null by -o "$tmpc".out when testing with +check_link_silent otherwise test will fail with some bugged binutils +(https://sourceware.org/bugzilla/show_bug.cgi?id=19526) since version +4.13 and +https://github.com/rofl0r/proxychains-ng/commit/35a674bdbc294730429a1007c9e7ce01e65b49b5: + +checking what's the option to use in linker to set library name ... +cannot find an option to set library name +package/pkg-generic.mk:249: recipe for target '/home/buildroot/autobuild/instance-2/output-1/build/proxychains-ng-4.14/.stamp_configured' failed + +Fixes: + - http://autobuild.buildroot.org/results/9320d9b2c69882e23bbe7b30057eb8bee0c9d2e5 + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/rofl0r/proxychains-ng/pull/387] +--- + configure | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index 8b21b97..cfe19e7 100755 +--- a/configure ++++ b/configure +@@ -49,7 +49,8 @@ check_compile_run() { + + check_link_silent() { + printf "$2" > "$tmpc" +- $CC $OUR_CPPFLAGS $CPPFLAGS $1 $CFLAGS "$tmpc" -o /dev/null >/dev/null 2>&1 ++ $CC $OUR_CPPFLAGS $CPPFLAGS $1 $CFLAGS "$tmpc" -o "$tmpc".out >/dev/null 2>&1 ++ rm -f "$tmpc".out + } + + check_link() { +-- +2.30.2 + diff --git a/buildroot/package/proxychains-ng/proxychains-ng.hash b/buildroot/package/proxychains-ng/proxychains-ng.hash index 9781b77af..779f6b626 100644 --- a/buildroot/package/proxychains-ng/proxychains-ng.hash +++ b/buildroot/package/proxychains-ng/proxychains-ng.hash @@ -1,6 +1,4 @@ -# From https://sourceforge.net/projects/proxychains-ng/files/ -md5 34d840eb184e96bff418201c28a935c5 proxychains-ng-4.11.tar.bz2 -sha1 00bc3dc18f2b638c79112c99f082a7a2878beaad proxychains-ng-4.11.tar.bz2 +# From https://github.com/rofl0r/proxychains-ng/releases/tag/v4.14 +sha512 75a1a4629d2b7ebac9b909a694b395339cf669fa4e23bfcc57938e46377b5619f31c9651d2bc457d1ad10ec1be7747981106392bf8bf65999cb7bb9c748d7e95 proxychains-ng-4.14.tar.xz # Locally computed: -sha256 dcc4149808cd1fb5d9663cc09791f478805816b1f017381f424414c47f6376b6 proxychains-ng-4.11.tar.bz2 sha256 86728623caeff60e9bcc37e03b432fd191de927eed48a72a3bb4ac4e53fe20df COPYING diff --git a/buildroot/package/proxychains-ng/proxychains-ng.mk b/buildroot/package/proxychains-ng/proxychains-ng.mk index 0437f7d91..bb7c9ff68 100644 --- a/buildroot/package/proxychains-ng/proxychains-ng.mk +++ b/buildroot/package/proxychains-ng/proxychains-ng.mk @@ -4,8 +4,8 @@ # ################################################################################ -PROXYCHAINS_NG_VERSION = 4.11 -PROXYCHAINS_NG_SOURCE = proxychains-ng-$(PROXYCHAINS_NG_VERSION).tar.bz2 +PROXYCHAINS_NG_VERSION = 4.14 +PROXYCHAINS_NG_SOURCE = proxychains-ng-$(PROXYCHAINS_NG_VERSION).tar.xz PROXYCHAINS_NG_SITE = http://downloads.sourceforge.net/project/proxychains-ng PROXYCHAINS_NG_LICENSE = GPL-2.0+ PROXYCHAINS_NG_LICENSE_FILES = COPYING diff --git a/buildroot/package/putty/0001-unix-uxutils.h-fix-build-on-uclibc.patch b/buildroot/package/putty/0001-unix-uxutils.h-fix-build-on-uclibc.patch new file mode 100644 index 000000000..78cef8b90 --- /dev/null +++ b/buildroot/package/putty/0001-unix-uxutils.h-fix-build-on-uclibc.patch @@ -0,0 +1,41 @@ +From 3f30f3a7e3f07f5ca3cef0f405b02e22a018c6e4 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sun, 9 May 2021 15:22:29 +0200 +Subject: [PATCH] unix/uxutils.h: fix build on uclibc + +Build on uclibc is broken since version 0.75 and commit +65383082bf0c49cec63f4b36001a40bd9b13edf6 because AT_HWCAP2 is used +even if is not available: + +unix/uxutils.c: In function 'platform_aes_hw_available': +unix/uxutils.c:13:22: error: 'AT_HWCAP2' undeclared (first use in this function) + 13 | return getauxval(AT_HWCAP2) & HWCAP2_AES; + | ^~~~~~~~~ + +To fix this build failure, include + +Fixes: + - http://autobuild.buildroot.org/results/726f7c5ce13e78ed91e827b872e9d7ccfa13f298 + +Signed-off-by: Fabrice Fontaine +[Upstream status: sent to Simon Tatham ] +--- + unix/uxutils.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/unix/uxutils.h b/unix/uxutils.h +index c9acff53..b80bf972 100644 +--- a/unix/uxutils.h ++++ b/unix/uxutils.h +@@ -18,6 +18,8 @@ + + #if defined __arm__ || defined __aarch64__ + ++#include ++ + #ifdef HAVE_SYS_TYPES_H + #include + #endif +-- +2.30.2 + diff --git a/buildroot/package/putty/0002-New-option-to-reject-trivial-success-of-userauth.patch b/buildroot/package/putty/0002-New-option-to-reject-trivial-success-of-userauth.patch new file mode 100644 index 000000000..83b93a346 --- /dev/null +++ b/buildroot/package/putty/0002-New-option-to-reject-trivial-success-of-userauth.patch @@ -0,0 +1,448 @@ +From 1dc5659aa62848f0aeb5de7bd3839fecc7debefa Mon Sep 17 00:00:00 2001 +From: Simon Tatham +Date: Sat, 19 Jun 2021 15:39:15 +0100 +Subject: [PATCH] New option to reject 'trivial' success of userauth. + +Suggested by Manfred Kaiser, who also wrote most of this patch +(although outlying parts, like documentation and SSH-1 support, are by +me). + +This is a second line of defence against the kind of spoofing attacks +in which a malicious or compromised SSH server rushes the client +through the userauth phase of SSH without actually requiring any auth +inputs (passwords or signatures or whatever), and then at the start of +the connection phase it presents something like a spoof prompt, +intended to be taken for part of userauth by the user but in fact with +some more sinister purpose. + +Our existing line of defence against this is the trust sigil system, +and as far as I know, that's still working. This option allows a bit of +extra defence in depth: if you don't expect your SSH server to +trivially accept authentication in the first place, then enabling this +option will cause PuTTY to disconnect if it unexpectedly does so, +without the user having to spot the presence or absence of a fiddly +little sigil anywhere. + +Several types of authentication count as 'trivial'. The obvious one is +the SSH-2 "none" method, which clients always try first so that the +failure message will tell them what else they can try, and which a +server can instead accept in order to authenticate you unconditionally. +But there are two other ways to do it that we know of: one is to run +keyboard-interactive authentication and send an empty INFO_REQUEST +packet containing no actual prompts for the user, and another even +weirder one is to send USERAUTH_SUCCESS in response to the user's +preliminary *offer* of a public key (instead of sending the usual PK_OK +to request an actual signature from the key). + +This new option detects all of those, by clearing the 'is_trivial_auth' +flag only when we send some kind of substantive authentication response +(be it a password, a k-i prompt response, a signature, or a GSSAPI +token). So even if there's a further path through the userauth maze we +haven't spotted, that somehow avoids sending anything substantive, this +strategy should still pick it up. + +(cherry picked from commit 5f5c710cf3704737e24ffceb2c918e412a2a674f) + +[Retrieved from: +https://git.tartarus.org/?p=simon/putty.git;a=commit;h=1dc5659aa62848f0aeb5de7bd3839fecc7debefa] +Signed-off-by: Fabrice Fontaine +--- + cmdline.c | 8 ++++++++ + config.c | 4 ++++ + doc/config.but | 43 +++++++++++++++++++++++++++++++++++++++++++ + pscp.c | 2 ++ + psftp.c | 2 ++ + putty.h | 1 + + settings.c | 2 ++ + ssh.c | 4 +++- + ssh1login.c | 14 +++++++++++++- + ssh2userauth.c | 20 ++++++++++++++++---- + sshppl.h | 2 +- + unix/uxplink.c | 2 ++ + windows/winhelp.h | 1 + + windows/winplink.c | 2 ++ + 14 files changed, 100 insertions(+), 7 deletions(-) + +diff --git a/cmdline.c b/cmdline.c +index 7ea5cacc..62d65e19 100644 +--- a/cmdline.c ++++ b/cmdline.c +@@ -598,6 +598,14 @@ int cmdline_process_param(const char *p, char *value, + SAVEABLE(0); + conf_set_bool(conf, CONF_tryagent, false); + } ++ ++ if (!strcmp(p, "-no-trivial-auth")) { ++ RETURN(1); ++ UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); ++ SAVEABLE(0); ++ conf_set_bool(conf, CONF_ssh_no_trivial_userauth, true); ++ } ++ + if (!strcmp(p, "-share")) { + RETURN(1); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); +diff --git a/config.c b/config.c +index ca808511..b8348530 100644 +--- a/config.c ++++ b/config.c +@@ -2772,6 +2772,10 @@ void setup_config_box(struct controlbox *b, bool midsession, + HELPCTX(ssh_auth_bypass), + conf_checkbox_handler, + I(CONF_ssh_no_userauth)); ++ ctrl_checkbox(s, "Disconnect if authentication succeeds trivially", ++ 'n', HELPCTX(ssh_no_trivial_userauth), ++ conf_checkbox_handler, ++ I(CONF_ssh_no_trivial_userauth)); + + s = ctrl_getset(b, "Connection/SSH/Auth", "methods", + "Authentication methods"); +diff --git a/doc/config.but b/doc/config.but +index a00ae476..77313282 100644 +--- a/doc/config.but ++++ b/doc/config.but +@@ -2623,6 +2623,49 @@ interact with them.) + This option only affects SSH-2 connections. SSH-1 connections always + require an authentication step. + ++\S{config-ssh-notrivialauth} \q{Disconnect if authentication succeeds ++trivially} ++ ++This option causes PuTTY to abandon an SSH session and disconnect from ++the server, if the server accepted authentication without ever having ++asked for any kind of password or signature or token. ++ ++This might be used as a security measure. There are some forms of ++attack against an SSH client user which work by terminating the SSH ++authentication stage early, and then doing something in the main part ++of the SSH session which \e{looks} like part of the authentication, ++but isn't really. ++ ++For example, instead of demanding a signature from your public key, ++for which PuTTY would ask for your key's passphrase, a compromised or ++malicious server might allow you to log in with no signature or ++password at all, and then print a message that \e{imitates} PuTTY's ++request for your passphrase, in the hope that you would type it in. ++(In fact, the passphrase for your public key should not be sent to any ++server.) ++ ++PuTTY's main defence against attacks of this type is the \q{trust ++sigil} system: messages in the PuTTY window that are truly originated ++by PuTTY itself are shown next to a small copy of the PuTTY icon, ++which the server cannot fake when it tries to imitate the same message ++using terminal output. ++ ++However, if you think you might be at risk of this kind of thing ++anyway (if you don't watch closely for the trust sigils, or if you ++think you're at extra risk of one of your servers being malicious), ++then you could enable this option as an extra defence. Then, if the ++server tries any of these attacks involving letting you through the ++authentication stage, PuTTY will disconnect from the server before it ++can send a follow-up fake prompt or other type of attack. ++ ++On the other hand, some servers \e{legitimately} let you through the ++SSH authentication phase trivially, either because they are genuinely ++public, or because the important authentication step happens during ++the terminal session. (An example might be an SSH server that connects ++you directly to the terminal login prompt of a legacy mainframe.) So ++enabling this option might cause some kinds of session to stop ++working. It's up to you. ++ + \S{config-ssh-tryagent} \q{Attempt authentication using Pageant} + + If this option is enabled, then PuTTY will look for Pageant (the SSH +diff --git a/pscp.c b/pscp.c +index 0bfda92d..a11d1e18 100644 +--- a/pscp.c ++++ b/pscp.c +@@ -2203,6 +2203,8 @@ static void usage(void) + printf(" -i key private key file for user authentication\n"); + printf(" -noagent disable use of Pageant\n"); + printf(" -agent enable use of Pageant\n"); ++ printf(" -no-trivial-auth\n"); ++ printf(" disconnect if SSH authentication succeeds trivially\n"); + printf(" -hostkey keyid\n"); + printf(" manually specify a host key (may be repeated)\n"); + printf(" -batch disable all interactive prompts\n"); +diff --git a/psftp.c b/psftp.c +index 40cb73f5..c4b5374b 100644 +--- a/psftp.c ++++ b/psftp.c +@@ -2538,6 +2538,8 @@ static void usage(void) + printf(" -i key private key file for user authentication\n"); + printf(" -noagent disable use of Pageant\n"); + printf(" -agent enable use of Pageant\n"); ++ printf(" -no-trivial-auth\n"); ++ printf(" disconnect if SSH authentication succeeds trivially\n"); + printf(" -hostkey keyid\n"); + printf(" manually specify a host key (may be repeated)\n"); + printf(" -batch disable all interactive prompts\n"); +diff --git a/putty.h b/putty.h +index ef6f7a37..7789f217 100644 +--- a/putty.h ++++ b/putty.h +@@ -1428,6 +1428,7 @@ NORETURN void cleanup_exit(int); + X(INT, NONE, sshprot) \ + X(BOOL, NONE, ssh2_des_cbc) /* "des-cbc" unrecommended SSH-2 cipher */ \ + X(BOOL, NONE, ssh_no_userauth) /* bypass "ssh-userauth" (SSH-2 only) */ \ ++ X(BOOL, NONE, ssh_no_trivial_userauth) /* disable trivial types of auth */ \ + X(BOOL, NONE, ssh_show_banner) /* show USERAUTH_BANNERs (SSH-2 only) */ \ + X(BOOL, NONE, try_tis_auth) \ + X(BOOL, NONE, try_ki_auth) \ +diff --git a/settings.c b/settings.c +index 547af0dc..32a53c54 100644 +--- a/settings.c ++++ b/settings.c +@@ -609,6 +609,7 @@ void save_open_settings(settings_w *sesskey, Conf *conf) + #endif + write_setting_s(sesskey, "RekeyBytes", conf_get_str(conf, CONF_ssh_rekey_data)); + write_setting_b(sesskey, "SshNoAuth", conf_get_bool(conf, CONF_ssh_no_userauth)); ++ write_setting_b(sesskey, "SshNoTrivialAuth", conf_get_bool(conf, CONF_ssh_no_trivial_userauth)); + write_setting_b(sesskey, "SshBanner", conf_get_bool(conf, CONF_ssh_show_banner)); + write_setting_b(sesskey, "AuthTIS", conf_get_bool(conf, CONF_try_tis_auth)); + write_setting_b(sesskey, "AuthKI", conf_get_bool(conf, CONF_try_ki_auth)); +@@ -1025,6 +1026,7 @@ void load_open_settings(settings_r *sesskey, Conf *conf) + gpps(sesskey, "LogHost", "", conf, CONF_loghost); + gppb(sesskey, "SSH2DES", false, conf, CONF_ssh2_des_cbc); + gppb(sesskey, "SshNoAuth", false, conf, CONF_ssh_no_userauth); ++ gppb(sesskey, "SshNoTrivialAuth", false, conf, CONF_ssh_no_trivial_userauth); + gppb(sesskey, "SshBanner", true, conf, CONF_ssh_show_banner); + gppb(sesskey, "AuthTIS", false, conf, CONF_try_tis_auth); + gppb(sesskey, "AuthKI", true, conf, CONF_try_ki_auth); +diff --git a/ssh.c b/ssh.c +index 00a516ea..91e7e869 100644 +--- a/ssh.c ++++ b/ssh.c +@@ -254,7 +254,9 @@ static void ssh_got_ssh_version(struct ssh_version_receiver *rcv, + connection_layer, ssh->savedhost, ssh->fullhostname, + conf_get_filename(ssh->conf, CONF_keyfile), + conf_get_bool(ssh->conf, CONF_ssh_show_banner), +- conf_get_bool(ssh->conf, CONF_tryagent), username, ++ conf_get_bool(ssh->conf, CONF_tryagent), ++ conf_get_bool(ssh->conf, CONF_ssh_no_trivial_userauth), ++ username, + conf_get_bool(ssh->conf, CONF_change_username), + conf_get_bool(ssh->conf, CONF_try_ki_auth), + #ifndef NO_GSSAPI +diff --git a/ssh1login.c b/ssh1login.c +index 8486cbf0..519838d7 100644 +--- a/ssh1login.c ++++ b/ssh1login.c +@@ -27,7 +27,7 @@ struct ssh1_login_state { + + char *savedhost; + int savedport; +- bool try_agent_auth; ++ bool try_agent_auth, is_trivial_auth; + + int remote_protoflags; + int local_protoflags; +@@ -105,6 +105,8 @@ PacketProtocolLayer *ssh1_login_new( + s->savedhost = dupstr(host); + s->savedport = port; + s->successor_layer = successor_layer; ++ s->is_trivial_auth = true; ++ + return &s->ppl; + } + +@@ -645,6 +647,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) + s->ppl.bpp, SSH1_CMSG_AUTH_RSA_RESPONSE); + put_data(pkt, ret + 5, 16); + pq_push(s->ppl.out_pq, pkt); ++ s->is_trivial_auth = false; + crMaybeWaitUntilV( + (pktin = ssh1_login_pop(s)) + != NULL); +@@ -814,6 +817,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) + s->ppl.bpp, SSH1_CMSG_AUTH_RSA_RESPONSE); + put_data(pkt, buffer, 16); + pq_push(s->ppl.out_pq, pkt); ++ s->is_trivial_auth = false; + + mp_free(challenge); + mp_free(response); +@@ -1105,6 +1109,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) + put_stringz(pkt, prompt_get_result_ref(s->cur_prompt->prompts[0])); + pq_push(s->ppl.out_pq, pkt); + } ++ s->is_trivial_auth = false; + ppl_logevent("Sent password"); + free_prompts(s->cur_prompt); + s->cur_prompt = NULL; +@@ -1121,6 +1126,13 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) + } + } + ++ if (conf_get_bool(s->conf, CONF_ssh_no_trivial_userauth) && ++ s->is_trivial_auth) { ++ ssh_proto_error(s->ppl.ssh, "Authentication was trivial! " ++ "Abandoning session as specified in configuration."); ++ return; ++ } ++ + ppl_logevent("Authentication successful"); + + if (conf_get_bool(s->conf, CONF_compression)) { +diff --git a/ssh2userauth.c b/ssh2userauth.c +index 01243baf..451d5abe 100644 +--- a/ssh2userauth.c ++++ b/ssh2userauth.c +@@ -28,7 +28,7 @@ struct ssh2_userauth_state { + + PacketProtocolLayer *transport_layer, *successor_layer; + Filename *keyfile; +- bool show_banner, tryagent, change_username; ++ bool show_banner, tryagent, notrivialauth, change_username; + char *hostname, *fullhostname; + char *default_username; + bool try_ki_auth, try_gssapi_auth, try_gssapi_kex_auth, gssapi_fwd; +@@ -82,6 +82,7 @@ struct ssh2_userauth_state { + int len; + PktOut *pktout; + bool want_user_input; ++ bool is_trivial_auth; + + agent_pending_query *auth_agent_query; + bufchain banner; +@@ -134,7 +135,7 @@ static const PacketProtocolLayerVtable ssh2_userauth_vtable = { + PacketProtocolLayer *ssh2_userauth_new( + PacketProtocolLayer *successor_layer, + const char *hostname, const char *fullhostname, +- Filename *keyfile, bool show_banner, bool tryagent, ++ Filename *keyfile, bool show_banner, bool tryagent, bool notrivialauth, + const char *default_username, bool change_username, + bool try_ki_auth, bool try_gssapi_auth, bool try_gssapi_kex_auth, + bool gssapi_fwd, struct ssh_connection_shared_gss_state *shgss) +@@ -149,6 +150,7 @@ PacketProtocolLayer *ssh2_userauth_new( + s->keyfile = filename_copy(keyfile); + s->show_banner = show_banner; + s->tryagent = tryagent; ++ s->notrivialauth = notrivialauth; + s->default_username = dupstr(default_username); + s->change_username = change_username; + s->try_ki_auth = try_ki_auth; +@@ -157,6 +159,7 @@ PacketProtocolLayer *ssh2_userauth_new( + s->gssapi_fwd = gssapi_fwd; + s->shgss = shgss; + s->last_methods_string = strbuf_new(); ++ s->is_trivial_auth = true; + bufchain_init(&s->banner); + bufchain_sink_init(&s->banner_bs, &s->banner); + +@@ -818,6 +821,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) + sigblob); + pq_push(s->ppl.out_pq, s->pktout); + s->type = AUTH_TYPE_PUBLICKEY; ++ s->is_trivial_auth = false; + } else { + ppl_logevent("Pageant refused signing request"); + ppl_printf("Pageant failed to " +@@ -1038,6 +1042,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) + ssh_key_free(key->key); + sfree(key->comment); + sfree(key); ++ s->is_trivial_auth = false; + } + + #ifndef NO_GSSAPI +@@ -1169,6 +1174,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) + * no longer says CONTINUE_NEEDED + */ + if (s->gss_sndtok.length != 0) { ++ s->is_trivial_auth = false; + s->pktout = + ssh_bpp_new_pktout( + s->ppl.bpp, SSH2_MSG_USERAUTH_GSSAPI_TOKEN); +@@ -1288,7 +1294,6 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) + * Loop while the server continues to send INFO_REQUESTs. + */ + while (pktin->type == SSH2_MSG_USERAUTH_INFO_REQUEST) { +- + ptrlen name, inst; + strbuf *sb; + +@@ -1308,6 +1313,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) + */ + s->num_prompts = get_uint32(pktin); + for (uint32_t i = 0; i < s->num_prompts; i++) { ++ s->is_trivial_auth = false; + ptrlen prompt = get_string(pktin); + bool echo = get_bool(pktin); + +@@ -1472,7 +1478,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) + pq_push_front(s->ppl.in_pq, pktin); + + } else if (s->can_passwd) { +- ++ s->is_trivial_auth = false; + /* + * Plain old password authentication. + */ +@@ -1731,6 +1737,12 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) + } + + userauth_success: ++ if (s->notrivialauth && s->is_trivial_auth) { ++ ssh_proto_error(s->ppl.ssh, "Authentication was trivial! " ++ "Abandoning session as specified in configuration."); ++ return; ++ } ++ + /* + * We've just received USERAUTH_SUCCESS, and we haven't sent + * any packets since. Signal the transport layer to consider +diff --git a/sshppl.h b/sshppl.h +index b339d67c..2c1dbf42 100644 +--- a/sshppl.h ++++ b/sshppl.h +@@ -116,7 +116,7 @@ PacketProtocolLayer *ssh2_transport_new( + PacketProtocolLayer *ssh2_userauth_new( + PacketProtocolLayer *successor_layer, + const char *hostname, const char *fullhostname, +- Filename *keyfile, bool show_banner, bool tryagent, ++ Filename *keyfile, bool show_banner, bool tryagent, bool notrivialauth, + const char *default_username, bool change_username, + bool try_ki_auth, + bool try_gssapi_auth, bool try_gssapi_kex_auth, +diff --git a/unix/uxplink.c b/unix/uxplink.c +index 3e2a9b6b..240783f4 100644 +--- a/unix/uxplink.c ++++ b/unix/uxplink.c +@@ -527,6 +527,8 @@ static void usage(void) + printf(" -i key private key file for user authentication\n"); + printf(" -noagent disable use of Pageant\n"); + printf(" -agent enable use of Pageant\n"); ++ printf(" -no-trivial-auth\n"); ++ printf(" disconnect if SSH authentication succeeds trivially\n"); + printf(" -noshare disable use of connection sharing\n"); + printf(" -share enable use of connection sharing\n"); + printf(" -hostkey keyid\n"); +diff --git a/windows/winhelp.h b/windows/winhelp.h +index ae5a7a7f..9011df45 100644 +--- a/windows/winhelp.h ++++ b/windows/winhelp.h +@@ -111,6 +111,7 @@ + #define WINHELP_CTX_ssh_kex_repeat "config-ssh-kex-rekey" + #define WINHELP_CTX_ssh_kex_manual_hostkeys "config-ssh-kex-manual-hostkeys" + #define WINHELP_CTX_ssh_auth_bypass "config-ssh-noauth" ++#define WINHELP_CTX_ssh_no_trivial_userauth "config-ssh-notrivialauth" + #define WINHELP_CTX_ssh_auth_banner "config-ssh-banner" + #define WINHELP_CTX_ssh_auth_privkey "config-ssh-privkey" + #define WINHELP_CTX_ssh_auth_agentfwd "config-ssh-agentfwd" +diff --git a/windows/winplink.c b/windows/winplink.c +index 9bda0712..58d43e6d 100644 +--- a/windows/winplink.c ++++ b/windows/winplink.c +@@ -149,6 +149,8 @@ static void usage(void) + printf(" -i key private key file for user authentication\n"); + printf(" -noagent disable use of Pageant\n"); + printf(" -agent enable use of Pageant\n"); ++ printf(" -no-trivial-auth\n"); ++ printf(" disconnect if SSH authentication succeeds trivially\n"); + printf(" -noshare disable use of connection sharing\n"); + printf(" -share enable use of connection sharing\n"); + printf(" -hostkey keyid\n"); +-- +2.20.1 + diff --git a/buildroot/package/putty/putty.hash b/buildroot/package/putty/putty.hash index 3885cef9b..8974aaac5 100644 --- a/buildroot/package/putty/putty.hash +++ b/buildroot/package/putty/putty.hash @@ -1,8 +1,8 @@ -# Hashes from: http://the.earth.li/~sgtatham/putty/0.74/{md5,sha1,sha256,sha512}sums -md5 dbfa58f22a91b22b7489173e9dd09e30 putty-0.74.tar.gz -sha1 17b160e9720f67f9af9399d7d185b913b81f18fe putty-0.74.tar.gz -sha256 ddd5d388e51dd9e6e294005b30037f6ae802239a44c9dc9808c779e6d11b847d putty-0.74.tar.gz -sha512 0da86849ea764cd88643bd2c1984ac7211ae72dd7c41232307b1960a29ca9518044b022d87c60272d6db71a3357026862a112bedb90ee732b41494fca3acde9b putty-0.74.tar.gz +# Hashes from: http://the.earth.li/~sgtatham/putty/0.75/{md5,sha1,sha256,sha512}sums +md5 fae57a9ab209f303cc9e9f83eecaa27c putty-0.75.tar.gz +sha1 cdb976811a35eed67c5a2c588908b08edf6e3e1d putty-0.75.tar.gz +sha256 d3173b037eddbe9349abe978101277b4ba9f9959e25dedd44f87e7b85cc8f9f5 putty-0.75.tar.gz +sha512 3dbc15485008a98daf60236061253e66b94a6e5da123fc84c5f0ac006c84e17c70fe748987677775e3b54a12297eb826cccf70a4fc039b633bc2d512938b3028 putty-0.75.tar.gz # Locally calculated -sha256 92028b6d56212bd3e4ce6a36bd2e2454851dca7e8ffe4c6ab51385ca214ca322 LICENCE +sha256 3f3e870dd3d0867d79370b1d433602c60bb91b59de04e5d8f2a149b788530d53 LICENCE diff --git a/buildroot/package/putty/putty.mk b/buildroot/package/putty/putty.mk index 8a494d4e5..a1c588a38 100644 --- a/buildroot/package/putty/putty.mk +++ b/buildroot/package/putty/putty.mk @@ -4,16 +4,15 @@ # ################################################################################ -PUTTY_VERSION = 0.74 +PUTTY_VERSION = 0.75 PUTTY_SITE = http://the.earth.li/~sgtatham/putty/$(PUTTY_VERSION) PUTTY_LICENSE = MIT PUTTY_LICENSE_FILES = LICENCE PUTTY_CPE_ID_VENDOR = putty PUTTY_CONF_OPTS = --disable-gtktest -PUTTY_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -Wno-error" -# Windows only, fixed for Windows with 0.75 -PUTTY_IGNORE_CVES += CVE-2021-33500 +# 0002-New-option-to-reject-trivial-success-of-userauth.patch +PUTTY_IGNORE_CVES += CVE-2021-36367 ifeq ($(BR2_PACKAGE_LIBGTK2),y) PUTTY_CONF_OPTS += --with-gtk=2 diff --git a/buildroot/package/python-dataproperty/Config.in b/buildroot/package/python-dataproperty/Config.in index 2c5da40ff..3de9cc685 100644 --- a/buildroot/package/python-dataproperty/Config.in +++ b/buildroot/package/python-dataproperty/Config.in @@ -1,8 +1,7 @@ config BR2_PACKAGE_PYTHON_DATAPROPERTY bool "python-dataproperty" - depends on BR2_PACKAGE_PYTHON3 # python-mbstrdecoder + depends on BR2_PACKAGE_PYTHON3 select BR2_PACKAGE_PYTHON_MBSTRDECODER # runtime - select BR2_PACKAGE_PYTHON_SIX # runtime select BR2_PACKAGE_PYTHON_TYPEPY # runtime help Python library for extract property from data. diff --git a/buildroot/package/python-django/python-django.hash b/buildroot/package/python-django/python-django.hash index 1c7d7b884..2f5f96a50 100644 --- a/buildroot/package/python-django/python-django.hash +++ b/buildroot/package/python-django/python-django.hash @@ -1,5 +1,5 @@ # md5, sha256 from https://pypi.org/pypi/django/json -md5 43784c090a8805605e3d0b768cd21cb2 Django-3.2.2.tar.gz -sha256 0a1d195ad65c52bf275b8277b3d49680bd1137a5f55039a806f25f6b9752ce3d Django-3.2.2.tar.gz +md5 46e306a5a775cace03a03d5a158ff767 Django-3.2.5.tar.gz +sha256 3da05fea54fdec2315b54a563d5b59f3b4e2b1e69c3a5841dda35019c01855cd Django-3.2.5.tar.gz # Locally computed sha256 checksums sha256 b846415d1b514e9c1dff14a22deb906d794bc546ca6129f950a18cd091e2a669 LICENSE diff --git a/buildroot/package/python-django/python-django.mk b/buildroot/package/python-django/python-django.mk index 0e36a530a..1603063be 100644 --- a/buildroot/package/python-django/python-django.mk +++ b/buildroot/package/python-django/python-django.mk @@ -4,10 +4,10 @@ # ################################################################################ -PYTHON_DJANGO_VERSION = 3.2.2 +PYTHON_DJANGO_VERSION = 3.2.5 PYTHON_DJANGO_SOURCE = Django-$(PYTHON_DJANGO_VERSION).tar.gz # The official Django site has an unpractical URL -PYTHON_DJANGO_SITE = https://files.pythonhosted.org/packages/da/24/e2e6e534464f8e0bd010401f06d2cfc773141776d2952d6418d01c97f12c +PYTHON_DJANGO_SITE = https://files.pythonhosted.org/packages/95/3b/468fa33908feefac03c0a773bd73bb8a1ab1fb4ee06e9dd62d24981f4603 PYTHON_DJANGO_LICENSE = BSD-3-Clause PYTHON_DJANGO_LICENSE_FILES = LICENSE PYTHON_DJANGO_CPE_ID_VENDOR = djangoproject diff --git a/buildroot/package/python-pysftp/Config.in b/buildroot/package/python-pysftp/Config.in index 06f883f60..0866df305 100644 --- a/buildroot/package/python-pysftp/Config.in +++ b/buildroot/package/python-pysftp/Config.in @@ -1,7 +1,11 @@ config BR2_PACKAGE_PYTHON_PYSFTP bool "python-pysftp" + depends on BR2_INSTALL_LIBSTDCPP # python-paramiko select BR2_PACKAGE_PYTHON_PARAMIKO # runtime help A friendly face on SFTP. https://bitbucket.org/dundeemt/pysftp + +comment "python-pysftp needs a toolchain w/ C++" + depends on !BR2_INSTALL_LIBSTDCPP diff --git a/buildroot/package/python-urllib3/python-urllib3.hash b/buildroot/package/python-urllib3/python-urllib3.hash index 820156b4c..288d986e7 100644 --- a/buildroot/package/python-urllib3/python-urllib3.hash +++ b/buildroot/package/python-urllib3/python-urllib3.hash @@ -1,5 +1,5 @@ # md5, sha256 from https://pypi.org/pypi/urllib3/json -md5 e2a2039e22fc29b751e26b7042e8db2f urllib3-1.26.4.tar.gz -sha256 e7b021f7241115872f92f43c6508082facffbd1c048e3c6e2bb9c2a157e28937 urllib3-1.26.4.tar.gz +md5 3a88ec3bcb761ca23df2c3583949be37 urllib3-1.26.6.tar.gz +sha256 f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f urllib3-1.26.6.tar.gz # Locally computed sha256 checksums sha256 c37bf186e27cf9dbe9619e55edfe3cea7b30091ceb3da63c7dacbe0e6d77907b LICENSE.txt diff --git a/buildroot/package/python-urllib3/python-urllib3.mk b/buildroot/package/python-urllib3/python-urllib3.mk index d5a04163f..775986d51 100644 --- a/buildroot/package/python-urllib3/python-urllib3.mk +++ b/buildroot/package/python-urllib3/python-urllib3.mk @@ -4,9 +4,9 @@ # ################################################################################ -PYTHON_URLLIB3_VERSION = 1.26.4 +PYTHON_URLLIB3_VERSION = 1.26.6 PYTHON_URLLIB3_SOURCE = urllib3-$(PYTHON_URLLIB3_VERSION).tar.gz -PYTHON_URLLIB3_SITE = https://files.pythonhosted.org/packages/cb/cf/871177f1fc795c6c10787bc0e1f27bb6cf7b81dbde399fd35860472cecbc +PYTHON_URLLIB3_SITE = https://files.pythonhosted.org/packages/4f/5a/597ef5911cb8919efe4d86206aa8b2658616d676a7088f0825ca08bd7cb8 PYTHON_URLLIB3_LICENSE = MIT PYTHON_URLLIB3_LICENSE_FILES = LICENSE.txt PYTHON_URLLIB3_CPE_ID_VENDOR = python diff --git a/buildroot/package/python/python.mk b/buildroot/package/python/python.mk index f4f9f8563..ae99f382f 100644 --- a/buildroot/package/python/python.mk +++ b/buildroot/package/python/python.mk @@ -24,6 +24,7 @@ HOST_PYTHON_CONF_OPTS += \ --disable-sqlite3 \ --disable-tk \ --with-expat=system \ + --with-system-ffi \ --disable-curses \ --disable-codecs-cjk \ --disable-nis \ @@ -56,7 +57,7 @@ HOST_PYTHON_MAKE = $(MAKE1) PYTHON_DEPENDENCIES = host-python libffi $(TARGET_NLS_DEPENDENCIES) -HOST_PYTHON_DEPENDENCIES = host-expat host-zlib +HOST_PYTHON_DEPENDENCIES = host-expat host-libffi host-zlib ifeq ($(BR2_PACKAGE_HOST_PYTHON_SSL),y) HOST_PYTHON_DEPENDENCIES += host-openssl diff --git a/buildroot/package/python3/0001-Make-the-build-of-pyc-files-conditional.patch b/buildroot/package/python3/0001-Make-the-build-of-pyc-files-conditional.patch index 5eb296c6d..44902725d 100644 --- a/buildroot/package/python3/0001-Make-the-build-of-pyc-files-conditional.patch +++ b/buildroot/package/python3/0001-Make-the-build-of-pyc-files-conditional.patch @@ -18,7 +18,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index 77f91e72b1..0c809f3d8a 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1528,6 +1528,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c +@@ -1550,6 +1550,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ $(DESTDIR)$(LIBDEST)/distutils/tests ; \ fi @@ -26,7 +26,7 @@ index 77f91e72b1..0c809f3d8a 100644 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ -j0 -d $(LIBDEST) -f \ -@@ -1555,6 +1556,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c +@@ -1577,6 +1578,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ -j0 -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages @@ -38,7 +38,7 @@ diff --git a/configure.ac b/configure.ac index d60f05251a..1ee5a09588 100644 --- a/configure.ac +++ b/configure.ac -@@ -1112,6 +1112,12 @@ fi +@@ -1121,6 +1121,12 @@ fi AC_MSG_CHECKING(LDLIBRARY) diff --git a/buildroot/package/python3/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch b/buildroot/package/python3/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch index c291d1446..00177814c 100644 --- a/buildroot/package/python3/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch +++ b/buildroot/package/python3/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch @@ -13,7 +13,7 @@ diff --git a/configure.ac b/configure.ac index 1ee5a09588..c2445edc88 100644 --- a/configure.ac +++ b/configure.ac -@@ -4175,7 +4175,7 @@ fi +@@ -4210,7 +4210,7 @@ fi AC_MSG_RESULT($ac_cv_buggy_getaddrinfo) diff --git a/buildroot/package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch b/buildroot/package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch index b0dcce7d7..7cccc588e 100644 --- a/buildroot/package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch +++ b/buildroot/package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch @@ -47,7 +47,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index 0c809f3d8a..7c3dde8dd4 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -213,6 +213,8 @@ FILEMODE= 644 +@@ -216,6 +216,8 @@ FILEMODE= 644 # configure script arguments CONFIG_ARGS= @CONFIG_ARGS@ @@ -56,7 +56,7 @@ index 0c809f3d8a..7c3dde8dd4 100644 # Subdirectories with code SRCDIRS= @SRCDIRS@ -@@ -629,6 +631,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o +@@ -632,6 +634,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o esac; \ echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ @@ -64,7 +64,7 @@ index 0c809f3d8a..7c3dde8dd4 100644 $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ -@@ -1674,7 +1677,8 @@ libainstall: @DEF_MAKE_RULE@ python-config +@@ -1696,7 +1699,8 @@ libainstall: @DEF_MAKE_RULE@ python-config # Install the dynamically loadable modules # This goes into $(exec_prefix) sharedinstall: sharedmods @@ -78,7 +78,7 @@ diff --git a/configure.ac b/configure.ac index c2445edc88..73d66167de 100644 --- a/configure.ac +++ b/configure.ac -@@ -3052,6 +3052,8 @@ LIBS="$withval $LIBS" +@@ -3081,6 +3081,8 @@ LIBS="$withval $LIBS" PKG_PROG_PKG_CONFIG @@ -91,7 +91,7 @@ diff --git a/setup.py b/setup.py index 770866bca7..b6c829b3a5 100644 --- a/setup.py +++ b/setup.py -@@ -43,7 +43,10 @@ from distutils.spawn import find_executable +@@ -44,7 +44,10 @@ from distutils.spawn import find_executable TEST_EXTENSIONS = True # This global variable is used to hold the list of modules to be disabled. diff --git a/buildroot/package/python3/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch b/buildroot/package/python3/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch index 83c88ff39..c5abcfd78 100644 --- a/buildroot/package/python3/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch +++ b/buildroot/package/python3/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch @@ -12,7 +12,7 @@ diff --git a/setup.py b/setup.py index b6c829b3a5..ec3ba60607 100644 --- a/setup.py +++ b/setup.py -@@ -1056,12 +1056,9 @@ class PyBuildExt(build_ext): +@@ -1041,12 +1041,9 @@ class PyBuildExt(build_ext): pass # Issue 7384: Already linked against curses or tinfo. elif curses_library: readline_libs.append(curses_library) diff --git a/buildroot/package/python3/0006-Don-t-add-multiarch-paths.patch b/buildroot/package/python3/0006-Don-t-add-multiarch-paths.patch index f55238d0c..bb861612b 100644 --- a/buildroot/package/python3/0006-Don-t-add-multiarch-paths.patch +++ b/buildroot/package/python3/0006-Don-t-add-multiarch-paths.patch @@ -20,7 +20,7 @@ diff --git a/setup.py b/setup.py index ec3ba60607..e27620035c 100644 --- a/setup.py +++ b/setup.py -@@ -749,10 +749,10 @@ class PyBuildExt(build_ext): +@@ -734,10 +734,10 @@ class PyBuildExt(build_ext): if not CROSS_COMPILING: add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') diff --git a/buildroot/package/python3/0007-Abort-on-failed-module-build.patch b/buildroot/package/python3/0007-Abort-on-failed-module-build.patch index 0e96e7522..856fcaac2 100644 --- a/buildroot/package/python3/0007-Abort-on-failed-module-build.patch +++ b/buildroot/package/python3/0007-Abort-on-failed-module-build.patch @@ -17,7 +17,7 @@ diff --git a/setup.py b/setup.py index e27620035c..d3f0e663f2 100644 --- a/setup.py +++ b/setup.py -@@ -539,6 +539,7 @@ class PyBuildExt(build_ext): +@@ -524,6 +524,7 @@ class PyBuildExt(build_ext): print("Failed to build these modules:") print_three_column(failed) print() diff --git a/buildroot/package/python3/0011-Override-system-locale-and-set-to-default-when-addin.patch b/buildroot/package/python3/0011-Override-system-locale-and-set-to-default-when-addin.patch index 57f1bb5a2..8b0d4f4c4 100644 --- a/buildroot/package/python3/0011-Override-system-locale-and-set-to-default-when-addin.patch +++ b/buildroot/package/python3/0011-Override-system-locale-and-set-to-default-when-addin.patch @@ -25,7 +25,7 @@ diff --git a/setup.py b/setup.py index d3f0e663f2..926c16f58f 100644 --- a/setup.py +++ b/setup.py -@@ -695,7 +695,7 @@ class PyBuildExt(build_ext): +@@ -680,7 +680,7 @@ class PyBuildExt(build_ext): tmpfile = os.path.join(self.build_temp, 'ccpaths') if not os.path.exists(self.build_temp): os.makedirs(self.build_temp) diff --git a/buildroot/package/python3/0012-Add-importlib-fix-for-PEP-3147-issue.patch b/buildroot/package/python3/0012-Add-importlib-fix-for-PEP-3147-issue.patch index 42dfa0d69..7a885303c 100644 --- a/buildroot/package/python3/0012-Add-importlib-fix-for-PEP-3147-issue.patch +++ b/buildroot/package/python3/0012-Add-importlib-fix-for-PEP-3147-issue.patch @@ -28,7 +28,7 @@ diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_ext index 25a3f8c0e0..2cb9a9aa52 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py -@@ -313,8 +313,6 @@ def cache_from_source(path, debug_override=None, *, optimization=None): +@@ -373,8 +373,6 @@ def cache_from_source(path, debug_override=None, *, optimization=None): a True value is the same as setting 'optimization' to the empty string while a False value is equivalent to setting 'optimization' to '1'. @@ -37,7 +37,7 @@ index 25a3f8c0e0..2cb9a9aa52 100644 """ if debug_override is not None: _warnings.warn('the debug_override parameter is deprecated; use ' -@@ -326,10 +324,7 @@ def cache_from_source(path, debug_override=None, *, optimization=None): +@@ -386,10 +384,7 @@ def cache_from_source(path, debug_override=None, *, optimization=None): path = _os.fspath(path) head, tail = _path_split(path) base, sep, rest = tail.rpartition('.') @@ -49,7 +49,7 @@ index 25a3f8c0e0..2cb9a9aa52 100644 if optimization is None: if sys.flags.optimize == 0: optimization = '' -@@ -366,46 +361,17 @@ def cache_from_source(path, debug_override=None, *, optimization=None): +@@ -426,46 +421,17 @@ def cache_from_source(path, debug_override=None, *, optimization=None): head.lstrip(path_separators), filename, ) diff --git a/buildroot/package/python3/0013-Add-an-option-to-disable-installation-of-test-module.patch b/buildroot/package/python3/0013-Add-an-option-to-disable-installation-of-test-module.patch index b3380fd53..8c1b98936 100644 --- a/buildroot/package/python3/0013-Add-an-option-to-disable-installation-of-test-module.patch +++ b/buildroot/package/python3/0013-Add-an-option-to-disable-installation-of-test-module.patch @@ -21,7 +21,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index 7c3dde8dd4..204f293d53 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1385,8 +1385,29 @@ maninstall: altmaninstall +@@ -1406,8 +1406,29 @@ maninstall: altmaninstall # Install the library XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax @@ -53,7 +53,7 @@ index 7c3dde8dd4..204f293d53 100644 test/audiodata \ test/capath test/data \ test/cjkencodings test/decimaltestdata \ -@@ -1446,28 +1467,25 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ +@@ -1468,28 +1489,25 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ test/test_importlib/zipdata02 \ test/test_zoneinfo test/test_zoneinfo/data \ test/ziptestdata \ @@ -100,7 +100,7 @@ diff --git a/configure.ac b/configure.ac index 73d66167de..92e28d02ee 100644 --- a/configure.ac +++ b/configure.ac -@@ -3329,6 +3329,11 @@ if test "$posix_threads" = "yes"; then +@@ -3358,6 +3358,11 @@ if test "$posix_threads" = "yes"; then AC_CHECK_FUNCS(pthread_getcpuclockid) fi diff --git a/buildroot/package/python3/0014-Add-an-option-to-disable-pydoc.patch b/buildroot/package/python3/0014-Add-an-option-to-disable-pydoc.patch index abb86ea07..0c928a0bb 100644 --- a/buildroot/package/python3/0014-Add-an-option-to-disable-pydoc.patch +++ b/buildroot/package/python3/0014-Add-an-option-to-disable-pydoc.patch @@ -20,7 +20,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index 204f293d53..63e3df0470 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1357,7 +1357,9 @@ bininstall: altbininstall +@@ -1374,7 +1374,9 @@ bininstall: altbininstall -rm -f $(DESTDIR)$(BINDIR)/idle3 (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3) -rm -f $(DESTDIR)$(BINDIR)/pydoc3 @@ -30,7 +30,7 @@ index 204f293d53..63e3df0470 100644 -rm -f $(DESTDIR)$(BINDIR)/2to3 (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ -@@ -1403,7 +1405,7 @@ LIBSUBDIRS= tkinter site-packages \ +@@ -1424,7 +1426,7 @@ LIBSUBDIRS= tkinter site-packages \ multiprocessing multiprocessing/dummy \ unittest \ venv venv/scripts venv/scripts/common venv/scripts/posix \ @@ -39,7 +39,7 @@ index 204f293d53..63e3df0470 100644 zoneinfo TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ -@@ -1486,6 +1488,10 @@ ifeq (@TEST_MODULES@,yes) +@@ -1508,6 +1510,10 @@ ifeq (@TEST_MODULES@,yes) LIBSUBDIRS += $(TESTSUBDIRS) endif @@ -54,7 +54,7 @@ diff --git a/configure.ac b/configure.ac index 92e28d02ee..174ed85a7c 100644 --- a/configure.ac +++ b/configure.ac -@@ -3329,6 +3329,12 @@ if test "$posix_threads" = "yes"; then +@@ -3358,6 +3358,12 @@ if test "$posix_threads" = "yes"; then AC_CHECK_FUNCS(pthread_getcpuclockid) fi @@ -71,7 +71,7 @@ diff --git a/setup.py b/setup.py index 926c16f58f..1fc5fac90c 100644 --- a/setup.py +++ b/setup.py -@@ -2586,6 +2586,12 @@ def main(): +@@ -2565,6 +2565,12 @@ def main(): # turn off warnings when deprecated modules are imported import warnings warnings.filterwarnings("ignore",category=DeprecationWarning) @@ -84,7 +84,7 @@ index 926c16f58f..1fc5fac90c 100644 setup(# PyPI Metadata (PEP 301) name = "Python", version = sys.version.split()[0], -@@ -2610,8 +2616,7 @@ def main(): +@@ -2589,8 +2595,7 @@ def main(): # If you change the scripts installed here, you also need to # check the PyBuildScripts command above, and change the links # created by the bininstall target in Makefile.pre.in diff --git a/buildroot/package/python3/0015-Add-an-option-to-disable-lib2to3.patch b/buildroot/package/python3/0015-Add-an-option-to-disable-lib2to3.patch index 5cec11a00..fe94cdfde 100644 --- a/buildroot/package/python3/0015-Add-an-option-to-disable-lib2to3.patch +++ b/buildroot/package/python3/0015-Add-an-option-to-disable-lib2to3.patch @@ -20,7 +20,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index 63e3df0470..8b7de12999 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1361,7 +1361,9 @@ ifeq (@PYDOC@,yes) +@@ -1378,7 +1378,9 @@ ifeq (@PYDOC@,yes) (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) endif -rm -f $(DESTDIR)$(BINDIR)/2to3 @@ -30,7 +30,7 @@ index 63e3df0470..8b7de12999 100644 if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \ -@@ -1396,7 +1398,6 @@ LIBSUBDIRS= tkinter site-packages \ +@@ -1417,7 +1419,6 @@ LIBSUBDIRS= tkinter site-packages \ html json http dbm xmlrpc \ sqlite3 \ logging csv wsgiref urllib \ @@ -38,7 +38,7 @@ index 63e3df0470..8b7de12999 100644 ctypes ctypes/macholib \ idlelib idlelib/Icons \ distutils distutils/command $(XMLLIBSUBDIRS) \ -@@ -1473,9 +1474,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ +@@ -1495,9 +1496,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ test/test_email test/test_email/data \ test/test_json \ sqlite3/test \ @@ -48,7 +48,7 @@ index 63e3df0470..8b7de12999 100644 ctypes/test \ idlelib/idle_test \ distutils/tests \ -@@ -1484,6 +1482,14 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ +@@ -1506,6 +1504,14 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ test/test_tools test/test_warnings test/test_warnings/data \ unittest/test unittest/test/testmock @@ -63,7 +63,7 @@ index 63e3df0470..8b7de12999 100644 ifeq (@TEST_MODULES@,yes) LIBSUBDIRS += $(TESTSUBDIRS) endif -@@ -1584,10 +1590,12 @@ ifeq (@PYC_BUILD@,yes) +@@ -1606,10 +1612,12 @@ ifeq (@PYC_BUILD@,yes) -j0 -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages endif @@ -80,7 +80,7 @@ diff --git a/configure.ac b/configure.ac index 174ed85a7c..f1f5e9a7b0 100644 --- a/configure.ac +++ b/configure.ac -@@ -3341,6 +3341,12 @@ AC_ARG_ENABLE(test-modules, +@@ -3370,6 +3370,12 @@ AC_ARG_ENABLE(test-modules, AS_HELP_STRING([--disable-test-modules], [disable test modules]), [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ]) @@ -97,7 +97,7 @@ diff --git a/setup.py b/setup.py index 1fc5fac90c..4063d7ffa5 100644 --- a/setup.py +++ b/setup.py -@@ -2587,10 +2587,11 @@ def main(): +@@ -2566,10 +2566,11 @@ def main(): import warnings warnings.filterwarnings("ignore",category=DeprecationWarning) diff --git a/buildroot/package/python3/0016-Add-option-to-disable-the-sqlite3-module.patch b/buildroot/package/python3/0016-Add-option-to-disable-the-sqlite3-module.patch index 47ee112e2..d6c9bccd4 100644 --- a/buildroot/package/python3/0016-Add-option-to-disable-the-sqlite3-module.patch +++ b/buildroot/package/python3/0016-Add-option-to-disable-the-sqlite3-module.patch @@ -16,7 +16,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index 8b7de12999..d826d8ac4b 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1396,7 +1396,6 @@ LIBSUBDIRS= tkinter site-packages \ +@@ -1417,7 +1417,6 @@ LIBSUBDIRS= tkinter site-packages \ email email/mime \ ensurepip ensurepip/_bundled \ html json http dbm xmlrpc \ @@ -24,7 +24,7 @@ index 8b7de12999..d826d8ac4b 100644 logging csv wsgiref urllib \ ctypes ctypes/macholib \ idlelib idlelib/Icons \ -@@ -1473,7 +1472,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ +@@ -1495,7 +1494,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ test/test_asyncio \ test/test_email test/test_email/data \ test/test_json \ @@ -32,7 +32,7 @@ index 8b7de12999..d826d8ac4b 100644 ctypes/test \ idlelib/idle_test \ distutils/tests \ -@@ -1490,6 +1488,11 @@ TESTSUBDIRS += lib2to3/tests \ +@@ -1512,6 +1510,11 @@ TESTSUBDIRS += lib2to3/tests \ lib2to3/tests/data/fixers/myfixes endif @@ -48,7 +48,7 @@ diff --git a/configure.ac b/configure.ac index f1f5e9a7b0..8b5c65974c 100644 --- a/configure.ac +++ b/configure.ac -@@ -3329,6 +3329,15 @@ if test "$posix_threads" = "yes"; then +@@ -3358,6 +3358,15 @@ if test "$posix_threads" = "yes"; then AC_CHECK_FUNCS(pthread_getcpuclockid) fi diff --git a/buildroot/package/python3/0017-Add-an-option-to-disable-the-tk-module.patch b/buildroot/package/python3/0017-Add-an-option-to-disable-the-tk-module.patch index 132fd1738..b798eb56a 100644 --- a/buildroot/package/python3/0017-Add-an-option-to-disable-the-tk-module.patch +++ b/buildroot/package/python3/0017-Add-an-option-to-disable-the-tk-module.patch @@ -16,7 +16,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index d826d8ac4b..dc84384680 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1390,7 +1390,7 @@ maninstall: altmaninstall +@@ -1411,7 +1411,7 @@ maninstall: altmaninstall # Install the library XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax @@ -25,7 +25,7 @@ index d826d8ac4b..dc84384680 100644 asyncio \ collections concurrent concurrent/futures encodings \ email email/mime \ -@@ -1408,8 +1408,7 @@ LIBSUBDIRS= tkinter site-packages \ +@@ -1429,8 +1429,7 @@ LIBSUBDIRS= tkinter site-packages \ curses \ zoneinfo @@ -35,7 +35,7 @@ index d826d8ac4b..dc84384680 100644 test/audiodata \ test/capath test/data \ test/cjkencodings test/decimaltestdata \ -@@ -1480,6 +1479,12 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ +@@ -1502,6 +1501,12 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ test/test_tools test/test_warnings test/test_warnings/data \ unittest/test unittest/test/testmock @@ -52,7 +52,7 @@ diff --git a/configure.ac b/configure.ac index 8b5c65974c..4c72dae960 100644 --- a/configure.ac +++ b/configure.ac -@@ -3338,6 +3338,15 @@ if test "$SQLITE3" = "no" ; then +@@ -3367,6 +3367,15 @@ if test "$SQLITE3" = "no" ; then DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" fi diff --git a/buildroot/package/python3/0018-Add-an-option-to-disable-the-curses-module.patch b/buildroot/package/python3/0018-Add-an-option-to-disable-the-curses-module.patch index d51267bbf..93dfac26e 100644 --- a/buildroot/package/python3/0018-Add-an-option-to-disable-the-curses-module.patch +++ b/buildroot/package/python3/0018-Add-an-option-to-disable-the-curses-module.patch @@ -16,7 +16,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index dc84384680..2a82f3308f 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1405,7 +1405,6 @@ LIBSUBDIRS= site-packages \ +@@ -1426,7 +1426,6 @@ LIBSUBDIRS= site-packages \ multiprocessing multiprocessing/dummy \ unittest \ venv venv/scripts venv/scripts/common venv/scripts/posix \ @@ -24,7 +24,7 @@ index dc84384680..2a82f3308f 100644 zoneinfo TESTSUBDIRS= test \ -@@ -1485,6 +1484,10 @@ TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ +@@ -1507,6 +1506,10 @@ TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ tkinter/test/test_ttk endif @@ -39,7 +39,7 @@ diff --git a/configure.ac b/configure.ac index 4c72dae960..acd98381a3 100644 --- a/configure.ac +++ b/configure.ac -@@ -3347,6 +3347,15 @@ if test "$TK" = "no"; then +@@ -3376,6 +3376,15 @@ if test "$TK" = "no"; then DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter" fi diff --git a/buildroot/package/python3/0019-Add-an-option-to-disable-expat.patch b/buildroot/package/python3/0019-Add-an-option-to-disable-expat.patch index af6e1ebcc..e7349058c 100644 --- a/buildroot/package/python3/0019-Add-an-option-to-disable-expat.patch +++ b/buildroot/package/python3/0019-Add-an-option-to-disable-expat.patch @@ -23,7 +23,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index 2a82f3308f..e678c8817e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1399,7 +1399,7 @@ LIBSUBDIRS= site-packages \ +@@ -1420,7 +1420,7 @@ LIBSUBDIRS= site-packages \ logging csv wsgiref urllib \ ctypes ctypes/macholib \ idlelib idlelib/Icons \ @@ -32,7 +32,7 @@ index 2a82f3308f..e678c8817e 100644 importlib \ turtledemo \ multiprocessing multiprocessing/dummy \ -@@ -1488,6 +1488,10 @@ ifeq (@CURSES@,yes) +@@ -1510,6 +1510,10 @@ ifeq (@CURSES@,yes) LIBSUBDIRS += curses endif @@ -47,7 +47,7 @@ diff --git a/configure.ac b/configure.ac index acd98381a3..9ef0ecd42f 100644 --- a/configure.ac +++ b/configure.ac -@@ -3055,13 +3055,21 @@ PKG_PROG_PKG_CONFIG +@@ -3084,13 +3084,21 @@ PKG_PROG_PKG_CONFIG AC_SUBST(DISABLED_EXTENSIONS) # Check for use of the system expat library @@ -78,7 +78,7 @@ diff --git a/setup.py b/setup.py index 4063d7ffa5..211a160f29 100644 --- a/setup.py +++ b/setup.py -@@ -1681,7 +1681,7 @@ class PyBuildExt(build_ext): +@@ -1666,7 +1666,7 @@ class PyBuildExt(build_ext): # # More information on Expat can be found at www.libexpat.org. # diff --git a/buildroot/package/python3/0020-Add-an-option-to-disable-CJK-codecs.patch b/buildroot/package/python3/0020-Add-an-option-to-disable-CJK-codecs.patch index ede78c9b1..4e2254309 100644 --- a/buildroot/package/python3/0020-Add-an-option-to-disable-CJK-codecs.patch +++ b/buildroot/package/python3/0020-Add-an-option-to-disable-CJK-codecs.patch @@ -12,7 +12,7 @@ diff --git a/configure.ac b/configure.ac index 9ef0ecd42f..18e6fd70a0 100644 --- a/configure.ac +++ b/configure.ac -@@ -3346,6 +3346,12 @@ if test "$SQLITE3" = "no" ; then +@@ -3375,6 +3375,12 @@ if test "$SQLITE3" = "no" ; then DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" fi diff --git a/buildroot/package/python3/0021-Add-an-option-to-disable-NIS.patch b/buildroot/package/python3/0021-Add-an-option-to-disable-NIS.patch index b2668c6eb..9cd54df18 100644 --- a/buildroot/package/python3/0021-Add-an-option-to-disable-NIS.patch +++ b/buildroot/package/python3/0021-Add-an-option-to-disable-NIS.patch @@ -15,7 +15,7 @@ diff --git a/configure.ac b/configure.ac index 18e6fd70a0..46d2a8131e 100644 --- a/configure.ac +++ b/configure.ac -@@ -3352,6 +3352,12 @@ AC_ARG_ENABLE(codecs-cjk, +@@ -3381,6 +3381,12 @@ AC_ARG_ENABLE(codecs-cjk, DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk _codecs_iso2022" fi]) diff --git a/buildroot/package/python3/0022-Add-an-option-to-disable-unicodedata.patch b/buildroot/package/python3/0022-Add-an-option-to-disable-unicodedata.patch index 7a0157fd7..2ddf606a7 100644 --- a/buildroot/package/python3/0022-Add-an-option-to-disable-unicodedata.patch +++ b/buildroot/package/python3/0022-Add-an-option-to-disable-unicodedata.patch @@ -12,7 +12,7 @@ diff --git a/configure.ac b/configure.ac index 46d2a8131e..5844e3b73f 100644 --- a/configure.ac +++ b/configure.ac -@@ -3358,6 +3358,12 @@ AC_ARG_ENABLE(nis, +@@ -3387,6 +3387,12 @@ AC_ARG_ENABLE(nis, DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" fi]) diff --git a/buildroot/package/python3/0023-Add-an-option-to-disable-IDLE.patch b/buildroot/package/python3/0023-Add-an-option-to-disable-IDLE.patch index 0611e3a34..0e35eea69 100644 --- a/buildroot/package/python3/0023-Add-an-option-to-disable-IDLE.patch +++ b/buildroot/package/python3/0023-Add-an-option-to-disable-IDLE.patch @@ -19,7 +19,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index e678c8817e..1148bd8708 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1355,7 +1355,9 @@ bininstall: altbininstall +@@ -1372,7 +1372,9 @@ bininstall: altbininstall -rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc) -rm -f $(DESTDIR)$(BINDIR)/idle3 @@ -29,7 +29,7 @@ index e678c8817e..1148bd8708 100644 -rm -f $(DESTDIR)$(BINDIR)/pydoc3 ifeq (@PYDOC@,yes) (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) -@@ -1398,7 +1400,6 @@ LIBSUBDIRS= site-packages \ +@@ -1419,7 +1421,6 @@ LIBSUBDIRS= site-packages \ html json http dbm xmlrpc \ logging csv wsgiref urllib \ ctypes ctypes/macholib \ @@ -37,7 +37,7 @@ index e678c8817e..1148bd8708 100644 distutils distutils/command \ importlib \ turtledemo \ -@@ -1492,6 +1493,10 @@ ifeq (@EXPAT@,yes) +@@ -1514,6 +1515,10 @@ ifeq (@EXPAT@,yes) LIBSUBDIRS += $(XMLLIBSUBDIRS) endif @@ -52,7 +52,7 @@ diff --git a/configure.ac b/configure.ac index 5844e3b73f..7bd4623ccd 100644 --- a/configure.ac +++ b/configure.ac -@@ -3400,6 +3400,12 @@ AC_ARG_ENABLE(lib2to3, +@@ -3429,6 +3429,12 @@ AC_ARG_ENABLE(lib2to3, AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]), [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ]) @@ -69,7 +69,7 @@ diff --git a/setup.py b/setup.py index 211a160f29..c4ee989ba3 100644 --- a/setup.py +++ b/setup.py -@@ -2587,11 +2587,13 @@ def main(): +@@ -2566,11 +2566,13 @@ def main(): import warnings warnings.filterwarnings("ignore",category=DeprecationWarning) diff --git a/buildroot/package/python3/0024-Add-an-option-to-disable-decimal.patch b/buildroot/package/python3/0024-Add-an-option-to-disable-decimal.patch index 438b76b91..b5a12f7f3 100644 --- a/buildroot/package/python3/0024-Add-an-option-to-disable-decimal.patch +++ b/buildroot/package/python3/0024-Add-an-option-to-disable-decimal.patch @@ -22,7 +22,7 @@ diff --git a/configure.ac b/configure.ac index 7bd4623ccd..e513ef6a20 100644 --- a/configure.ac +++ b/configure.ac -@@ -3106,13 +3106,20 @@ fi +@@ -3135,13 +3135,20 @@ fi AC_SUBST(LIBFFI_INCLUDEDIR) # Check for use of the system libmpdec library @@ -52,7 +52,7 @@ diff --git a/setup.py b/setup.py index c4ee989ba3..3d0c74bb7f 100644 --- a/setup.py +++ b/setup.py -@@ -2221,7 +2221,7 @@ class PyBuildExt(build_ext): +@@ -2195,7 +2195,7 @@ class PyBuildExt(build_ext): # Stefan Krah's _decimal module extra_compile_args = [] undef_macros = [] diff --git a/buildroot/package/python3/0025-Add-an-option-to-disable-the-ossaudiodev-module.patch b/buildroot/package/python3/0025-Add-an-option-to-disable-the-ossaudiodev-module.patch index 8a792c1fa..0f68a0835 100644 --- a/buildroot/package/python3/0025-Add-an-option-to-disable-the-ossaudiodev-module.patch +++ b/buildroot/package/python3/0025-Add-an-option-to-disable-the-ossaudiodev-module.patch @@ -12,7 +12,7 @@ diff --git a/configure.ac b/configure.ac index e513ef6a20..c07505e89e 100644 --- a/configure.ac +++ b/configure.ac -@@ -3136,6 +3136,12 @@ fi +@@ -3165,6 +3165,12 @@ fi AC_MSG_RESULT($with_decimal_contextvar) diff --git a/buildroot/package/python3/0026-Add-an-option-to-disable-openssl-support.patch b/buildroot/package/python3/0026-Add-an-option-to-disable-openssl-support.patch index d9e9d13f3..44d1d3d6b 100644 --- a/buildroot/package/python3/0026-Add-an-option-to-disable-openssl-support.patch +++ b/buildroot/package/python3/0026-Add-an-option-to-disable-openssl-support.patch @@ -12,7 +12,7 @@ diff --git a/configure.ac b/configure.ac index c07505e89e..612e32faf5 100644 --- a/configure.ac +++ b/configure.ac -@@ -3377,6 +3377,12 @@ AC_ARG_ENABLE(unicodedata, +@@ -3406,6 +3406,12 @@ AC_ARG_ENABLE(unicodedata, DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} unicodedata" fi]) diff --git a/buildroot/package/python3/0027-Add-an-option-to-disable-the-readline-module.patch b/buildroot/package/python3/0027-Add-an-option-to-disable-the-readline-module.patch index 2324ffdcf..1597a2a56 100644 --- a/buildroot/package/python3/0027-Add-an-option-to-disable-the-readline-module.patch +++ b/buildroot/package/python3/0027-Add-an-option-to-disable-the-readline-module.patch @@ -12,7 +12,7 @@ diff --git a/configure.ac b/configure.ac index 612e32faf5..2a6aaeff60 100644 --- a/configure.ac +++ b/configure.ac -@@ -3383,6 +3383,12 @@ AC_ARG_ENABLE(openssl, +@@ -3412,6 +3412,12 @@ AC_ARG_ENABLE(openssl, DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ssl _ssl _hashlib" fi]) diff --git a/buildroot/package/python3/0028-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch b/buildroot/package/python3/0028-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch index 04d0ab31b..a1d2ef325 100644 --- a/buildroot/package/python3/0028-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch +++ b/buildroot/package/python3/0028-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch @@ -12,7 +12,7 @@ diff --git a/configure.ac b/configure.ac index 2a6aaeff60..21479bbd7d 100644 --- a/configure.ac +++ b/configure.ac -@@ -3389,6 +3389,24 @@ AC_ARG_ENABLE(readline, +@@ -3418,6 +3418,24 @@ AC_ARG_ENABLE(readline, DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} readline" fi]) diff --git a/buildroot/package/python3/0030-Fix-cross-compiling-the-uuid-module.patch b/buildroot/package/python3/0030-Fix-cross-compiling-the-uuid-module.patch index 806801b2b..1bf5fc6db 100644 --- a/buildroot/package/python3/0030-Fix-cross-compiling-the-uuid-module.patch +++ b/buildroot/package/python3/0030-Fix-cross-compiling-the-uuid-module.patch @@ -23,7 +23,7 @@ diff --git a/setup.py b/setup.py index 3d0c74bb7f..c7be85f352 100644 --- a/setup.py +++ b/setup.py -@@ -1779,7 +1779,8 @@ class PyBuildExt(build_ext): +@@ -1764,7 +1764,8 @@ class PyBuildExt(build_ext): def detect_uuid(self): # Build the _uuid module if possible diff --git a/buildroot/package/python3/0031-Add-an-option-to-disable-uuid-module.patch b/buildroot/package/python3/0031-Add-an-option-to-disable-uuid-module.patch index 6ea57d2cd..92b24b211 100644 --- a/buildroot/package/python3/0031-Add-an-option-to-disable-uuid-module.patch +++ b/buildroot/package/python3/0031-Add-an-option-to-disable-uuid-module.patch @@ -12,7 +12,7 @@ diff --git a/configure.ac b/configure.ac index 21479bbd7d..615c16aced 100644 --- a/configure.ac +++ b/configure.ac -@@ -3425,6 +3425,15 @@ if test "$CURSES" = "no"; then +@@ -3454,6 +3454,15 @@ if test "$CURSES" = "no"; then DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _curses _curses_panel" fi diff --git a/buildroot/package/python3/0033-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch b/buildroot/package/python3/0033-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch index 304a595fc..f70990b25 100644 --- a/buildroot/package/python3/0033-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch +++ b/buildroot/package/python3/0033-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch @@ -32,7 +32,7 @@ diff --git a/configure.ac b/configure.ac index 615c16aced..241298e6cf 100644 --- a/configure.ac +++ b/configure.ac -@@ -718,7 +718,9 @@ then +@@ -727,7 +727,9 @@ then fi diff --git a/buildroot/package/python3/0036-Fix-dictionary-iteration-error-in-_ExecutorManagerTh.patch b/buildroot/package/python3/0036-Fix-dictionary-iteration-error-in-_ExecutorManagerTh.patch new file mode 100644 index 000000000..fbe44c775 --- /dev/null +++ b/buildroot/package/python3/0036-Fix-dictionary-iteration-error-in-_ExecutorManagerTh.patch @@ -0,0 +1,29 @@ +From 331966be70c371b268a4fcce9e97280cd869f137 Mon Sep 17 00:00:00 2001 +From: Jakub Kulik +Date: Mon, 15 Mar 2021 08:49:28 +0100 +Subject: [PATCH] Fix dictionary iteration error in _ExecutorManagerThread + +[Thomas: Taken from upstream pull request +https://github.com/python/cpython/pull/24868, which is aimed at fixing +https://bugs.python.org/issue43498] +Signed-off-by: Thomas Petazzoni +--- + Lib/concurrent/futures/process.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py +index 90bc98bf2ec..e3b36dff572 100644 +--- a/Lib/concurrent/futures/process.py ++++ b/Lib/concurrent/futures/process.py +@@ -373,7 +373,7 @@ class _ExecutorManagerThread(threading.Thread): + assert not self.thread_wakeup._closed + wakeup_reader = self.thread_wakeup._reader + readers = [result_reader, wakeup_reader] +- worker_sentinels = [p.sentinel for p in self.processes.values()] ++ worker_sentinels = [p.sentinel for p in self.processes.copy().values()] + ready = mp.connection.wait(readers + worker_sentinels) + + cause = None +-- +2.31.1 + diff --git a/buildroot/package/python3/python3.hash b/buildroot/package/python3/python3.hash index 78571b5e0..36e89a067 100644 --- a/buildroot/package/python3/python3.hash +++ b/buildroot/package/python3/python3.hash @@ -1,5 +1,5 @@ -# From https://www.python.org/downloads/release/python-395/ -md5 71f7ada6bec9cdbf4538adc326120cfd Python-3.9.5.tar.xz +# From https://www.python.org/downloads/release/python-396/ +md5 ecc29a7688f86e550d29dba2ee66cf80 Python-3.9.6.tar.xz # Locally computed -sha256 0c5a140665436ec3dbfbb79e2dfb6d192655f26ef4a29aeffcb6d1820d716d83 Python-3.9.5.tar.xz +sha256 397920af33efc5b97f2e0b57e91923512ef89fc5b3c1d21dbfc8c4828ce0108a Python-3.9.6.tar.xz sha256 599826df92bfdcd2702eac691072498bb096c55af04ee984cf90f70ed77b5a70 LICENSE diff --git a/buildroot/package/python3/python3.mk b/buildroot/package/python3/python3.mk index b492e0915..c289d41de 100644 --- a/buildroot/package/python3/python3.mk +++ b/buildroot/package/python3/python3.mk @@ -5,7 +5,7 @@ ################################################################################ PYTHON3_VERSION_MAJOR = 3.9 -PYTHON3_VERSION = $(PYTHON3_VERSION_MAJOR).5 +PYTHON3_VERSION = $(PYTHON3_VERSION_MAJOR).6 PYTHON3_SOURCE = Python-$(PYTHON3_VERSION).tar.xz PYTHON3_SITE = https://python.org/ftp/python/$(PYTHON3_VERSION) PYTHON3_LICENSE = Python-2.0, others diff --git a/buildroot/package/qpdf/0002-Fix-some-pipelines-to-be-safe-if-downstream-write-fails.patch b/buildroot/package/qpdf/0002-Fix-some-pipelines-to-be-safe-if-downstream-write-fails.patch new file mode 100644 index 000000000..70017350f --- /dev/null +++ b/buildroot/package/qpdf/0002-Fix-some-pipelines-to-be-safe-if-downstream-write-fails.patch @@ -0,0 +1,86 @@ +From dc92574c10f3e2516ec6445b88c5d584f40df4e5 Mon Sep 17 00:00:00 2001 +From: Jay Berkenbilt +Date: Mon, 4 Jan 2021 11:55:28 -0500 +Subject: [PATCH] Fix some pipelines to be safe if downstream write fails (fuzz + issue 28262) + +[Retrieved (and updated to remove updates on ChangeLog and fuzz) from: +https://github.com/qpdf/qpdf/commit/dc92574c10f3e2516ec6445b88c5d584f40df4e5] +Signed-off-by: Fabrice Fontaine +--- + ChangeLog | 6 ++++++ + fuzz/qpdf_extra/28262.fuzz | Bin 0 -> 40395 bytes + libqpdf/Pl_AES_PDF.cc | 2 +- + libqpdf/Pl_ASCII85Decoder.cc | 7 +++++-- + libqpdf/Pl_ASCIIHexDecoder.cc | 6 ++++-- + libqpdf/Pl_Count.cc | 2 +- + 6 files changed, 17 insertions(+), 6 deletions(-) + create mode 100644 fuzz/qpdf_extra/28262.fuzz + +diff --git a/libqpdf/Pl_AES_PDF.cc b/libqpdf/Pl_AES_PDF.cc +index 18cf3a4d..2865f804 100644 +--- a/libqpdf/Pl_AES_PDF.cc ++++ b/libqpdf/Pl_AES_PDF.cc +@@ -238,6 +238,6 @@ Pl_AES_PDF::flush(bool strip_padding) + } + } + } +- getNext()->write(this->outbuf, bytes); + this->offset = 0; ++ getNext()->write(this->outbuf, bytes); + } +diff --git a/libqpdf/Pl_ASCII85Decoder.cc b/libqpdf/Pl_ASCII85Decoder.cc +index b8df3e87..9d9f6704 100644 +--- a/libqpdf/Pl_ASCII85Decoder.cc ++++ b/libqpdf/Pl_ASCII85Decoder.cc +@@ -119,10 +119,13 @@ Pl_ASCII85Decoder::flush() + + QTC::TC("libtests", "Pl_ASCII85Decoder partial flush", + (this->pos == 5) ? 0 : 1); +- getNext()->write(outbuf, this->pos - 1); +- ++ // Reset before calling getNext()->write in case that throws an ++ // exception. ++ auto t = this->pos - 1; + this->pos = 0; + memset(this->inbuf, 117, 5); ++ ++ getNext()->write(outbuf, t); + } + + void +diff --git a/libqpdf/Pl_ASCIIHexDecoder.cc b/libqpdf/Pl_ASCIIHexDecoder.cc +index f20a9769..7845268e 100644 +--- a/libqpdf/Pl_ASCIIHexDecoder.cc ++++ b/libqpdf/Pl_ASCIIHexDecoder.cc +@@ -97,12 +97,14 @@ Pl_ASCIIHexDecoder::flush() + + QTC::TC("libtests", "Pl_ASCIIHexDecoder partial flush", + (this->pos == 2) ? 0 : 1); +- getNext()->write(&ch, 1); +- ++ // Reset before calling getNext()->write in case that throws an ++ // exception. + this->pos = 0; + this->inbuf[0] = '0'; + this->inbuf[1] = '0'; + this->inbuf[2] = '\0'; ++ ++ getNext()->write(&ch, 1); + } + + void +diff --git a/libqpdf/Pl_Count.cc b/libqpdf/Pl_Count.cc +index 8077092a..c35619b8 100644 +--- a/libqpdf/Pl_Count.cc ++++ b/libqpdf/Pl_Count.cc +@@ -27,8 +27,8 @@ Pl_Count::write(unsigned char* buf, size_t len) + if (len) + { + this->m->count += QIntC::to_offset(len); +- getNext()->write(buf, len); + this->m->last_char = buf[len - 1]; ++ getNext()->write(buf, len); + } + } + diff --git a/buildroot/package/qpdf/qpdf.mk b/buildroot/package/qpdf/qpdf.mk index ec3d3f89a..c96bf6bf2 100644 --- a/buildroot/package/qpdf/qpdf.mk +++ b/buildroot/package/qpdf/qpdf.mk @@ -14,6 +14,9 @@ QPDF_DEPENDENCIES = host-pkgconf zlib jpeg QPDF_CONF_OPTS = --with-random=/dev/urandom +# 0002-Fix-some-pipelines-to-be-safe-if-downstream-write-fails.patch +QPDF_IGNORE_CVES += CVE-2021-36978 + ifeq ($(BR2_PACKAGE_GNUTLS),y) QPDF_CONF_OPTS += --enable-crypto-gnutls QPDF_DEPENDENCIES += gnutls diff --git a/buildroot/package/redis/redis.hash b/buildroot/package/redis/redis.hash index d9f1281aa..d736c0948 100644 --- a/buildroot/package/redis/redis.hash +++ b/buildroot/package/redis/redis.hash @@ -1,5 +1,5 @@ # From https://github.com/redis/redis-hashes/blob/master/README -sha256 3049763f4553ddd5a69552f41da3dd7dde9fbc524dbb15e517fee24cc73b790c redis-6.0.13.tar.gz +sha256 4bc295264a95bc94423c162a9eee66135a24a51eefe5f53f18fc9bde5c3a9f74 redis-6.0.15.tar.gz # Locally calculated sha256 97f0a15b7bbae580d2609dad2e11f1956ae167be296ab60f4691ab9c30ee9828 COPYING diff --git a/buildroot/package/redis/redis.mk b/buildroot/package/redis/redis.mk index b70692ac7..f66397b21 100644 --- a/buildroot/package/redis/redis.mk +++ b/buildroot/package/redis/redis.mk @@ -4,7 +4,7 @@ # ################################################################################ -REDIS_VERSION = 6.0.13 +REDIS_VERSION = 6.0.15 REDIS_SITE = http://download.redis.io/releases REDIS_LICENSE = BSD-3-Clause (core); MIT and BSD family licenses (Bundled components) REDIS_LICENSE_FILES = COPYING diff --git a/buildroot/package/ripgrep/ripgrep.mk b/buildroot/package/ripgrep/ripgrep.mk index 9dd8d58de..313f73624 100644 --- a/buildroot/package/ripgrep/ripgrep.mk +++ b/buildroot/package/ripgrep/ripgrep.mk @@ -8,6 +8,7 @@ RIPGREP_VERSION = 0.8.1 RIPGREP_SITE = $(call github,burntsushi,ripgrep,$(RIPGREP_VERSION)) RIPGREP_LICENSE = MIT RIPGREP_LICENSE_FILES = LICENSE-MIT +RIPGREP_CPE_ID_VENDOR = ripgrep_project RIPGREP_DEPENDENCIES = host-rustc RIPGREP_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo diff --git a/buildroot/package/ruby/ruby.hash b/buildroot/package/ruby/ruby.hash index 58a3b54d7..cba48418e 100644 --- a/buildroot/package/ruby/ruby.hash +++ b/buildroot/package/ruby/ruby.hash @@ -1,5 +1,5 @@ -# https://www.ruby-lang.org/en/news/2021/04/05/ruby-2-7-3-released/ -sha256 5e91d1650857d43cd6852e05ac54683351e9c301811ee0bef43a67c4605e7db1 ruby-2.7.3.tar.xz +# https://www.ruby-lang.org/en/news/2021/07/07/ruby-2-7-4-released/ +sha256 2a80824e0ad6100826b69b9890bf55cfc4cf2b61a1e1330fccbcb30c46cef8d7 ruby-2.7.4.tar.xz # License files, Locally calculated sha256 b09ca195d2de08f0aacfa8793d0af62d7681c304b3ef714b75813721823295a6 LEGAL sha256 967586d538a28955ec2541910cf63c5ac345fcdea94bfb1f1705a1f6eb36bcbb COPYING diff --git a/buildroot/package/ruby/ruby.mk b/buildroot/package/ruby/ruby.mk index aee173cb6..24449eac7 100644 --- a/buildroot/package/ruby/ruby.mk +++ b/buildroot/package/ruby/ruby.mk @@ -5,7 +5,7 @@ ################################################################################ RUBY_VERSION_MAJOR = 2.7 -RUBY_VERSION = $(RUBY_VERSION_MAJOR).3 +RUBY_VERSION = $(RUBY_VERSION_MAJOR).4 RUBY_VERSION_EXT = 2.7.0 RUBY_SITE = http://cache.ruby-lang.org/pub/ruby/$(RUBY_VERSION_MAJOR) RUBY_SOURCE = ruby-$(RUBY_VERSION).tar.xz diff --git a/buildroot/package/samba4/samba4.hash b/buildroot/package/samba4/samba4.hash index 905ec14ce..5ae3e2f2b 100644 --- a/buildroot/package/samba4/samba4.hash +++ b/buildroot/package/samba4/samba4.hash @@ -1,4 +1,4 @@ # Locally calculated after checking pgp signature -# https://download.samba.org/pub/samba/stable/samba-4.14.4.tar.asc -sha256 89af092a0b00f5354ed287f0aa37b8c2cf9ba2ce67ea6464192e2c18528f89b9 samba-4.14.4.tar.gz +# https://download.samba.org/pub/samba/stable/samba-4.14.6.tar.asc +sha256 86760692dd74a04705c0f6d11b31965a477265a50e79eb15838184476146f4b0 samba-4.14.6.tar.gz sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING diff --git a/buildroot/package/samba4/samba4.mk b/buildroot/package/samba4/samba4.mk index 409e2c7a1..ffb582e14 100644 --- a/buildroot/package/samba4/samba4.mk +++ b/buildroot/package/samba4/samba4.mk @@ -4,7 +4,7 @@ # ################################################################################ -SAMBA4_VERSION = 4.14.4 +SAMBA4_VERSION = 4.14.6 SAMBA4_SITE = https://download.samba.org/pub/samba/stable SAMBA4_SOURCE = samba-$(SAMBA4_VERSION).tar.gz SAMBA4_INSTALL_STAGING = YES @@ -13,7 +13,7 @@ SAMBA4_LICENSE_FILES = COPYING SAMBA4_CPE_ID_VENDOR = samba SAMBA4_CPE_ID_PRODUCT = samba SAMBA4_DEPENDENCIES = \ - host-e2fsprogs host-heimdal host-nfs-utils \ + host-e2fsprogs host-flex host-heimdal host-nfs-utils \ host-perl host-perl-parse-yapp host-python3 \ cmocka e2fsprogs gnutls popt zlib \ $(if $(BR2_PACKAGE_LIBAIO),libaio) \ diff --git a/buildroot/package/slirp/0001-slirp-check-pkt_len-before-reading-protocol-header.patch b/buildroot/package/slirp/0001-slirp-check-pkt_len-before-reading-protocol-header.patch deleted file mode 100644 index 404614471..000000000 --- a/buildroot/package/slirp/0001-slirp-check-pkt_len-before-reading-protocol-header.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 2e1dcbc0c2af64fcb17009eaf2ceedd81be2b27f Mon Sep 17 00:00:00 2001 -From: Prasad J Pandit -Date: Thu, 26 Nov 2020 19:27:06 +0530 -Subject: [PATCH] slirp: check pkt_len before reading protocol header -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -While processing ARP/NCSI packets in 'arp_input' or 'ncsi_input' -routines, ensure that pkt_len is large enough to accommodate the -respective protocol headers, lest it should do an OOB access. -Add check to avoid it. - -CVE-2020-29129 CVE-2020-29130 - QEMU: slirp: out-of-bounds access while processing ARP/NCSI packets - -> https://www.openwall.com/lists/oss-security/2020/11/27/1 - -Reported-by: Qiuhao Li -Signed-off-by: Prasad J Pandit -Message-Id: <20201126135706.273950-1-ppandit@redhat.com> -Reviewed-by: Marc-André Lureau -Signed-off-by: Peter Korsgaard ---- - src/ncsi.c | 4 ++++ - src/slirp.c | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/src/ncsi.c b/src/ncsi.c -index 3c1dfef..75dcc08 100644 ---- a/src/ncsi.c -+++ b/src/ncsi.c -@@ -148,6 +148,10 @@ void ncsi_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) - uint32_t checksum; - uint32_t *pchecksum; - -+ if (pkt_len < ETH_HLEN + sizeof(struct ncsi_pkt_hdr)) { -+ return; /* packet too short */ -+ } -+ - memset(ncsi_reply, 0, sizeof(ncsi_reply)); - - memset(reh->h_dest, 0xff, ETH_ALEN); -diff --git a/src/slirp.c b/src/slirp.c -index 9bead0c..abb6f9a 100644 ---- a/src/slirp.c -+++ b/src/slirp.c -@@ -860,6 +860,10 @@ static void arp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) - return; - } - -+ if (pkt_len < ETH_HLEN + sizeof(struct slirp_arphdr)) { -+ return; /* packet too short */ -+ } -+ - ar_op = ntohs(ah->ar_op); - switch (ar_op) { - case ARPOP_REQUEST: --- -2.20.1 - diff --git a/buildroot/package/slirp/slirp.hash b/buildroot/package/slirp/slirp.hash index fe295b3bf..326b2ad24 100644 --- a/buildroot/package/slirp/slirp.hash +++ b/buildroot/package/slirp/slirp.hash @@ -1,3 +1,3 @@ # Locally computed: -sha256 388b4b08a8cc0996cc5155cb027a097dc1a7f2cfe84b1121496608ab5366cc48 libslirp-4.3.1.tar.xz +sha256 b8a22ac4d601ba16122a67827c0f4361785d4d283f21ff8ed48d4aa1e7693477 libslirp-4.6.1.tar.xz sha256 b28aecf4796a6a22054167f0a976de13d9db335669d37afd2dc7ea4c335e1e13 COPYRIGHT diff --git a/buildroot/package/slirp/slirp.mk b/buildroot/package/slirp/slirp.mk index ff92c6051..43d2c520e 100644 --- a/buildroot/package/slirp/slirp.mk +++ b/buildroot/package/slirp/slirp.mk @@ -4,11 +4,9 @@ # ################################################################################ -SLIRP_VERSION = 4.3.1 +SLIRP_VERSION = 4.6.1 SLIRP_SOURCE = libslirp-$(SLIRP_VERSION).tar.xz -# Other "official" tarballs don't ship .tarball-version resulting in a build -# failure: https://gitlab.freedesktop.org/slirp/libslirp/-/issues/24 -SLIRP_SITE = https://elmarco.fedorapeople.org +SLIRP_SITE = https://gitlab.freedesktop.org/slirp/libslirp/uploads/83b199ea6fcdfc0c243dfde8546ee4c9 SLIRP_LICENSE = BSD-3-Clause SLIRP_LICENSE_FILES = COPYRIGHT SLIRP_CPE_ID_VENDOR = libslirp_project @@ -16,7 +14,4 @@ SLIRP_CPE_ID_PRODUCT = libslirp SLIRP_INSTALL_STAGING = YES SLIRP_DEPENDENCIES = libglib2 -# 0001-slirp-check-pkt_len-before-reading-protocol-header.patch -SLIRP_IGNORE_CVES += CVE-2020-29129 CVE-2020-29130 - $(eval $(meson-package)) diff --git a/buildroot/package/spice/spice.hash b/buildroot/package/spice/spice.hash index 8f84c2321..b228f213a 100644 --- a/buildroot/package/spice/spice.hash +++ b/buildroot/package/spice/spice.hash @@ -1,3 +1,3 @@ # Locally calculated -sha256 551d4be4a07667cf0543f3c895beb6da8a93ef5a9829f2ae47817be5e616a114 spice-0.14.3.tar.bz2 +sha256 b320cf8f4bd2852750acb703c15b72856027e5a8554f8217dfbb3cc09deba0f5 spice-0.15.0.tar.bz2 sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING diff --git a/buildroot/package/spice/spice.mk b/buildroot/package/spice/spice.mk index b515431cf..5f7bcd9d2 100644 --- a/buildroot/package/spice/spice.mk +++ b/buildroot/package/spice/spice.mk @@ -4,7 +4,7 @@ # ################################################################################ -SPICE_VERSION = 0.14.3 +SPICE_VERSION = 0.15.0 SPICE_SOURCE = spice-$(SPICE_VERSION).tar.bz2 SPICE_SITE = http://www.spice-space.org/download/releases/spice-server SPICE_LICENSE = LGPL-2.1+ @@ -45,11 +45,6 @@ else SPICE_CONF_OPTS += --disable-opus endif -# no enable/disable, detected using pkg-config -ifeq ($(BR2_PACKAGE_OPUS),y) -SPICE_DEPENDENCIES += opus -endif - # We need to tweak spice.pc because it /forgets/ (for static linking) that # it should link against libz and libjpeg. libz is pkg-config-aware, while # libjpeg isn't, hence the two-line tweak diff --git a/buildroot/package/suricata/suricata.hash b/buildroot/package/suricata/suricata.hash index 839517781..74cc7435c 100644 --- a/buildroot/package/suricata/suricata.hash +++ b/buildroot/package/suricata/suricata.hash @@ -1,5 +1,5 @@ # Locally computed: -sha256 5e4647a07cb31b5d6d0049972a45375c137de908a964a44e2d6d231fa3ad4b52 suricata-6.0.2.tar.gz +sha256 daf134bb2d7c980035e9ae60f7aaf313323a809340009f26e48110ccde81f602 suricata-6.0.3.tar.gz # Hash for license files: sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING diff --git a/buildroot/package/suricata/suricata.mk b/buildroot/package/suricata/suricata.mk index ab8f27c31..ebeaa68d3 100644 --- a/buildroot/package/suricata/suricata.mk +++ b/buildroot/package/suricata/suricata.mk @@ -4,7 +4,7 @@ # ################################################################################ -SURICATA_VERSION = 6.0.2 +SURICATA_VERSION = 6.0.3 SURICATA_SITE = https://www.openinfosecfoundation.org/download SURICATA_LICENSE = GPL-2.0 SURICATA_LICENSE_FILES = COPYING LICENSE diff --git a/buildroot/package/sysdig/Config.in b/buildroot/package/sysdig/Config.in index 7d3c57039..06d20c7f7 100644 --- a/buildroot/package/sysdig/Config.in +++ b/buildroot/package/sysdig/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_SYSDIG bool "sysdig" depends on BR2_LINUX_KERNEL - depends on BR2_INSTALL_LIBSTDCPP # libjson + depends on BR2_INSTALL_LIBSTDCPP # jsoncpp depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 depends on BR2_TOOLCHAIN_HAS_THREADS # elfutils, jq depends on !BR2_STATIC_LIBS # elfutils diff --git a/buildroot/package/tcpdump/tcpdump.hash b/buildroot/package/tcpdump/tcpdump.hash index 4aea5b7cb..1990aa797 100644 --- a/buildroot/package/tcpdump/tcpdump.hash +++ b/buildroot/package/tcpdump/tcpdump.hash @@ -1,5 +1,5 @@ # Locally calculated after checking pgp signature at -# https://www.tcpdump.org/release/tcpdump-4.99.0.tar.gz.sig +# https://www.tcpdump.org/release/tcpdump-4.99.1.tar.gz.sig # using key 1F166A5742ABB9E0249A8D30E089DEF1D9C15D0D -sha256 8cf2f17a9528774a7b41060323be8b73f76024f7778f59c34efa65d49d80b842 tcpdump-4.99.0.tar.gz +sha256 79b36985fb2703146618d87c4acde3e068b91c553fb93f021a337f175fd10ebe tcpdump-4.99.1.tar.gz sha256 8a54594d257e14a5260ac770f1633516cb51e3fc28c40136ce2697014eda7afd LICENSE diff --git a/buildroot/package/tcpdump/tcpdump.mk b/buildroot/package/tcpdump/tcpdump.mk index c562034a4..7741c3b58 100644 --- a/buildroot/package/tcpdump/tcpdump.mk +++ b/buildroot/package/tcpdump/tcpdump.mk @@ -4,7 +4,7 @@ # ################################################################################ -TCPDUMP_VERSION = 4.99.0 +TCPDUMP_VERSION = 4.99.1 TCPDUMP_SITE = https://www.tcpdump.org/release TCPDUMP_LICENSE = BSD-3-Clause TCPDUMP_LICENSE_FILES = LICENSE diff --git a/buildroot/package/tftpd/tftpd.hash b/buildroot/package/tftpd/tftpd.hash index c876b2edc..3cccb0f20 100644 --- a/buildroot/package/tftpd/tftpd.hash +++ b/buildroot/package/tftpd/tftpd.hash @@ -1,5 +1,5 @@ -# From https://www.kernel.org/pub/software/network/tftp/tftp-hpa/sha256sums.asc -sha256 afee361df96a2f88344e191f6a25480fd714e1d28d176c3f10cc43fa206b718b tftp-hpa-5.2.tar.xz +# Locally calculated +sha256 c86520c30dab0b6bcbae021ab26d2ac63227696596d37a9b02aa3e56ec5c2e77 tftpd-b2b34cecc8cbc18ff6f1fc00bda6ae6e9011e6c7-br1.tar.gz # Hash for license file -sha256 5efef82650b8ece733e37790fc70f05e426c9e1ef9640d4ebcb04867bd3f5e28 tftpd/tftpd.c +sha256 67754ebd8f265571d3226ac97e521b1bd6fd8a61363ecd4ab7806a6f90efab92 tftpd/tftpd.c diff --git a/buildroot/package/tftpd/tftpd.mk b/buildroot/package/tftpd/tftpd.mk index 494e963d6..ffd52ce0d 100644 --- a/buildroot/package/tftpd/tftpd.mk +++ b/buildroot/package/tftpd/tftpd.mk @@ -4,14 +4,15 @@ # ################################################################################ -TFTPD_VERSION = 5.2 -TFTPD_SOURCE = tftp-hpa-$(TFTPD_VERSION).tar.xz -TFTPD_SITE = $(BR2_KERNEL_MIRROR)/software/network/tftp/tftp-hpa +TFTPD_VERSION = b2b34cecc8cbc18ff6f1fc00bda6ae6e9011e6c7 +TFTPD_SITE = git://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git TFTPD_CONF_OPTS = --without-tcpwrappers TFTPD_LICENSE = BSD-4-Clause TFTPD_LICENSE_FILES = tftpd/tftpd.c TFTPD_CPE_ID_VENDOR = tftpd-hpa_project TFTPD_CPE_ID_PRODUCT = tftpd-hpa +# From git +TFTPD_AUTORECONF = YES define TFTPD_INSTALL_TARGET_CMDS $(INSTALL) -D $(@D)/tftp/tftp $(TARGET_DIR)/usr/bin/tftp diff --git a/buildroot/package/thrift/thrift.hash b/buildroot/package/thrift/thrift.hash index f342dc348..20d6baeac 100644 --- a/buildroot/package/thrift/thrift.hash +++ b/buildroot/package/thrift/thrift.hash @@ -1,4 +1,4 @@ -# From https://www.apache.org/dist/thrift/0.13.0/thrift-0.13.0.tar.gz.sha256 -sha256 7ad348b88033af46ce49148097afe354d513c1fca7c607b59c33ebb6064b5179 thrift-0.13.0.tar.gz +# From https://www.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz.sha256 +sha256 13da5e1cd9c8a3bb89778c0337cc57eb0c29b08f3090b41cf6ab78594b410ca5 thrift-0.14.1.tar.gz # License files, locally calculated -sha256 23df881cec3192d1f4474633c14eb2ec30a45b84f8daeb82b9de5d2bd3ac8218 LICENSE +sha256 d315e6cdedc07c478de6992027bfb66f220886c6216fd7e9885ced30c3703646 LICENSE diff --git a/buildroot/package/thrift/thrift.mk b/buildroot/package/thrift/thrift.mk index 0f2a8eb07..c36efce2e 100644 --- a/buildroot/package/thrift/thrift.mk +++ b/buildroot/package/thrift/thrift.mk @@ -4,7 +4,7 @@ # ################################################################################ -THRIFT_VERSION = 0.13.0 +THRIFT_VERSION = 0.14.1 THRIFT_SITE = http://www.us.apache.org/dist/thrift/$(THRIFT_VERSION) THRIFT_LICENSE = Apache-2.0 THRIFT_LICENSE_FILES = LICENSE @@ -18,9 +18,10 @@ HOST_THRIFT_DEPENDENCIES = host-bison host-boost \ THRIFT_COMMON_CONF_OPTS = -DBUILD_TUTORIALS=OFF \ -DBUILD_TESTING=OFF \ + -DWITH_NODEJS=OFF \ -DWITH_PYTHON=OFF \ -DWITH_JAVA=OFF \ - -DWITH_QT4=OFF \ + -DWITH_JAVASCRIPT=OFF \ -DWITH_QT5=OFF THRIFT_CONF_OPTS = $(THRIFT_COMMON_CONF_OPTS) -DBUILD_COMPILER=OFF diff --git a/buildroot/package/tor/tor.hash b/buildroot/package/tor/tor.hash index dd20bbc92..8622281c2 100644 --- a/buildroot/package/tor/tor.hash +++ b/buildroot/package/tor/tor.hash @@ -1,3 +1,3 @@ # Locally computed -sha256 57ded091e8bcdcebb0013fe7ef4a4439827cb169358c7874fd05fa00d813e227 tor-0.4.5.8.tar.gz +sha256 f304e456102ed26c39e5f16ece2115585398cdb4e67455139c86ea43cdf70856 tor-0.4.5.9.tar.gz sha256 47b54ed17e8fdcab3c44729a1789a09b208f9a63a845a7e50def9df729eebad0 LICENSE diff --git a/buildroot/package/tor/tor.mk b/buildroot/package/tor/tor.mk index 4a16967d4..f6aeba2d6 100644 --- a/buildroot/package/tor/tor.mk +++ b/buildroot/package/tor/tor.mk @@ -4,11 +4,12 @@ # ################################################################################ -TOR_VERSION = 0.4.5.8 +TOR_VERSION = 0.4.5.9 TOR_SITE = https://dist.torproject.org TOR_LICENSE = BSD-3-Clause TOR_LICENSE_FILES = LICENSE TOR_CPE_ID_VENDOR = torproject +TOR_SELINUX_MODULES = tor TOR_DEPENDENCIES = libevent openssl zlib TOR_AUTORECONF = YES diff --git a/buildroot/package/tpm2-tools/0001-tpm2_import-fix-fixed-AES-key-CVE-2021-3565.patch b/buildroot/package/tpm2-tools/0001-tpm2_import-fix-fixed-AES-key-CVE-2021-3565.patch new file mode 100644 index 000000000..c0a433251 --- /dev/null +++ b/buildroot/package/tpm2-tools/0001-tpm2_import-fix-fixed-AES-key-CVE-2021-3565.patch @@ -0,0 +1,47 @@ +From c069e4f179d5e6653a84fb236816c375dca82515 Mon Sep 17 00:00:00 2001 +From: William Roberts +Date: Fri, 21 May 2021 12:22:31 -0500 +Subject: [PATCH] tpm2_import: fix fixed AES key CVE-2021-3565 + +tpm2_import used a fixed AES key for the inner wrapper, which means that +a MITM attack would be able to unwrap the imported key. Even the +use of an encrypted session will not prevent this. The TPM only +encrypts the first parameter which is the fixed symmetric key. + +To fix this, ensure the key size is 16 bytes or bigger and use +OpenSSL to generate a secure random AES key. + +Fixes: #2738 + +Signed-off-by: William Roberts +Signed-off-by: Peter Korsgaard +--- + tools/tpm2_import.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/tools/tpm2_import.c b/tools/tpm2_import.c +index cfb6f207..f44326c8 100644 +--- a/tools/tpm2_import.c ++++ b/tools/tpm2_import.c +@@ -118,7 +118,17 @@ static tool_rc key_import(ESYS_CONTEXT *ectx, TPM2B_PUBLIC *parent_pub, + TPM2B_DATA enc_sensitive_key = { + .size = parent_pub->publicArea.parameters.rsaDetail.symmetric.keyBits.sym / 8 + }; +- memset(enc_sensitive_key.buffer, 0xFF, enc_sensitive_key.size); ++ ++ if(enc_sensitive_key.size < 16) { ++ LOG_ERR("Calculated wrapping keysize is less than 16 bytes, got: %u", enc_sensitive_key.size); ++ return tool_rc_general_error; ++ } ++ ++ int ossl_rc = RAND_bytes(enc_sensitive_key.buffer, enc_sensitive_key.size); ++ if (ossl_rc != 1) { ++ LOG_ERR("RAND_bytes failed: %s", ERR_error_string(ERR_get_error(), NULL)); ++ return tool_rc_general_error; ++ } + + /* + * Calculate the object name. +-- +2.20.1 + diff --git a/buildroot/package/tpm2-tools/tpm2-tools.mk b/buildroot/package/tpm2-tools/tpm2-tools.mk index 83be53d54..8fd912a1a 100644 --- a/buildroot/package/tpm2-tools/tpm2-tools.mk +++ b/buildroot/package/tpm2-tools/tpm2-tools.mk @@ -8,6 +8,7 @@ TPM2_TOOLS_VERSION = 4.1.2 TPM2_TOOLS_SITE = https://github.com/tpm2-software/tpm2-tools/releases/download/$(TPM2_TOOLS_VERSION) TPM2_TOOLS_LICENSE = BSD-3-Clause TPM2_TOOLS_LICENSE_FILES = LICENSE +TPM2_TOOLS_CPE_ID_VENDOR = tpm2-tools_project TPM2_TOOLS_DEPENDENCIES = libcurl openssl tpm2-tss host-pkgconf # -fstack-protector-all and FORTIFY_SOURCE=2 is used by diff --git a/buildroot/package/trinity/trinity.mk b/buildroot/package/trinity/trinity.mk index adf7d1455..befb8de82 100644 --- a/buildroot/package/trinity/trinity.mk +++ b/buildroot/package/trinity/trinity.mk @@ -9,6 +9,7 @@ TRINITY_SITE = http://codemonkey.org.uk/projects/trinity TRINITY_SOURCE = trinity-$(TRINITY_VERSION).tar.xz TRINITY_LICENSE = GPL-2.0 TRINITY_LICENSE_FILES = COPYING +TRINITY_CPE_ID_VENDOR = trinity_project define TRINITY_CONFIGURE_CMDS (cd $(@D); $(TARGET_CONFIGURE_OPTS) ./configure) diff --git a/buildroot/package/uboot-tools/uboot-tools.mk b/buildroot/package/uboot-tools/uboot-tools.mk index c4006fe3d..b0fc9276b 100644 --- a/buildroot/package/uboot-tools/uboot-tools.mk +++ b/buildroot/package/uboot-tools/uboot-tools.mk @@ -152,11 +152,12 @@ endif #BR_BUILDING define HOST_UBOOT_TOOLS_GENERATE_ENVIMAGE $(HOST_UBOOT_TOOLS_GENERATE_ENV_DEFAULTS) - $(@D)/tools/mkenvimage -s $(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE) \ + cat $(UBOOT_TOOLS_GENERATE_ENV_FILE) | \ + $(@D)/tools/mkenvimage -s $(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE) \ $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_REDUNDANT),-r) \ $(if $(filter "BIG",$(BR2_ENDIAN)),-b) \ -o $(@D)/tools/uboot-env.bin \ - $(UBOOT_TOOLS_GENERATE_ENV_FILE) + - endef define HOST_UBOOT_TOOLS_INSTALL_ENVIMAGE $(INSTALL) -m 0755 -D $(@D)/tools/uboot-env.bin $(BINARIES_DIR)/uboot-env.bin diff --git a/buildroot/package/uclibc/uclibc.mk b/buildroot/package/uclibc/uclibc.mk index a7c96684d..d22164106 100644 --- a/buildroot/package/uclibc/uclibc.mk +++ b/buildroot/package/uclibc/uclibc.mk @@ -30,6 +30,7 @@ ifndef UCLIBC_CONFIG_FILE UCLIBC_CONFIG_FILE = $(call qstrip,$(BR2_UCLIBC_CONFIG)) endif +UCLIBC_KCONFIG_EDITORS = menuconfig nconfig UCLIBC_KCONFIG_FILE = $(UCLIBC_CONFIG_FILE) UCLIBC_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_UCLIBC_CONFIG_FRAGMENT_FILES)) diff --git a/buildroot/package/util-linux/util-linux.hash b/buildroot/package/util-linux/util-linux.hash index c5f5c69a4..3f9fe3981 100644 --- a/buildroot/package/util-linux/util-linux.hash +++ b/buildroot/package/util-linux/util-linux.hash @@ -1,5 +1,5 @@ # From https://www.kernel.org/pub/linux/utils/util-linux/v2.36/sha256sums.asc -sha256 09fac242172cd8ec27f0739d8d192402c69417617091d8c6e974841568f37eed util-linux-2.36.1.tar.xz +sha256 f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f util-linux-2.36.2.tar.xz # License files, locally calculated sha256 869660b5269f4f40a8a679da7f403ea3a6e71d46087aab5e14871b09bcb55955 README.licensing sha256 9b718a9460fed5952466421235bc79eb49d4e9eacc920d7a9dd6285ab8fd6c6d Documentation/licenses/COPYING.BSD-3-Clause diff --git a/buildroot/package/util-linux/util-linux.mk b/buildroot/package/util-linux/util-linux.mk index 09acaca1a..4bc7a1129 100644 --- a/buildroot/package/util-linux/util-linux.mk +++ b/buildroot/package/util-linux/util-linux.mk @@ -8,7 +8,7 @@ # util-linux-libs/util-linux-libs.mk needs to be updated accordingly as well. UTIL_LINUX_VERSION_MAJOR = 2.36 -UTIL_LINUX_VERSION = $(UTIL_LINUX_VERSION_MAJOR).1 +UTIL_LINUX_VERSION = $(UTIL_LINUX_VERSION_MAJOR).2 UTIL_LINUX_SOURCE = util-linux-$(UTIL_LINUX_VERSION).tar.xz UTIL_LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/util-linux/v$(UTIL_LINUX_VERSION_MAJOR) diff --git a/buildroot/package/vlc/vlc.hash b/buildroot/package/vlc/vlc.hash index 396c3a2ab..468ec7df3 100644 --- a/buildroot/package/vlc/vlc.hash +++ b/buildroot/package/vlc/vlc.hash @@ -1,7 +1,7 @@ -# From https://get.videolan.org/vlc/3.0.14/vlc-3.0.14.tar.xz.sha256 -sha256 49b93e5b33deaa37060e6b24a98200cad70c407947f14eb2a8b6a0c64d8535a6 vlc-3.0.14.tar.xz -# From https://get.videolan.org/vlc/3.0.14/vlc-3.0.14.tar.xz.sha1 -sha1 8a8613f16a9053668d7a7dcfa1e6d8be93af3e89 vlc-3.0.14.tar.xz +# From https://get.videolan.org/vlc/3.0.16/vlc-3.0.16.tar.xz.sha256 +sha256 ffae35fc64f625c175571d2346bc5f6207be99762517f15423e74f18399410f6 vlc-3.0.16.tar.xz +# From https://get.videolan.org/vlc/3.0.16/vlc-3.0.16.tar.xz.sha1 +sha1 e22ac839a09b5ead8992ae6aa8ea886364283e6a vlc-3.0.16.tar.xz # Locally computed sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LIB diff --git a/buildroot/package/vlc/vlc.mk b/buildroot/package/vlc/vlc.mk index c1e190099..06fc650f6 100644 --- a/buildroot/package/vlc/vlc.mk +++ b/buildroot/package/vlc/vlc.mk @@ -4,7 +4,7 @@ # ################################################################################ -VLC_VERSION = 3.0.14 +VLC_VERSION = 3.0.16 VLC_SITE = https://get.videolan.org/vlc/$(VLC_VERSION) VLC_SOURCE = vlc-$(VLC_VERSION).tar.xz VLC_LICENSE = GPL-2.0+, LGPL-2.1+ diff --git a/buildroot/package/wireless-regdb/wireless-regdb.hash b/buildroot/package/wireless-regdb/wireless-regdb.hash index 5403110be..d941fc3b1 100644 --- a/buildroot/package/wireless-regdb/wireless-regdb.hash +++ b/buildroot/package/wireless-regdb/wireless-regdb.hash @@ -1,4 +1,4 @@ # From https://www.kernel.org/pub/software/network/wireless-regdb/sha256sums.asc -sha256 b4164490d82ff7b0086e812ac42ab27baf57be24324d4c0ee1c5dd6ba27f2a52 wireless-regdb-2020.11.20.tar.xz +sha256 9e4c02b2a9710df4dbdb327c39612e8cbbae6495987afeddaebab28c1ea3d8fa wireless-regdb-2021.04.21.tar.xz # Locally computed sha256 678b0df753c86198fc496d1f1033429bbd57f101472132ee7eaaf9f5e0a7fae1 LICENSE diff --git a/buildroot/package/wireless-regdb/wireless-regdb.mk b/buildroot/package/wireless-regdb/wireless-regdb.mk index 2f9e91df3..49a3824ce 100644 --- a/buildroot/package/wireless-regdb/wireless-regdb.mk +++ b/buildroot/package/wireless-regdb/wireless-regdb.mk @@ -4,7 +4,7 @@ # ################################################################################ -WIRELESS_REGDB_VERSION = 2020.11.20 +WIRELESS_REGDB_VERSION = 2021.04.21 WIRELESS_REGDB_SOURCE = wireless-regdb-$(WIRELESS_REGDB_VERSION).tar.xz WIRELESS_REGDB_SITE = $(BR2_KERNEL_MIRROR)/software/network/wireless-regdb WIRELESS_REGDB_LICENSE = ISC diff --git a/buildroot/package/wireshark/wireshark.hash b/buildroot/package/wireshark/wireshark.hash index 57290b906..0876703e4 100644 --- a/buildroot/package/wireshark/wireshark.hash +++ b/buildroot/package/wireshark/wireshark.hash @@ -1,6 +1,6 @@ -# From https://www.wireshark.org/download/src/all-versions/SIGNATURES-3.4.5.txt -sha1 d01a9b5f58206fb458fe9fc2dac88ad0ea7152ce wireshark-3.4.5.tar.xz -sha256 de1aafd100a1e1207c850d180e97dd91ab8da0f5eb6beec545f725cdb145d333 wireshark-3.4.5.tar.xz +# From https://www.wireshark.org/download/src/all-versions/SIGNATURES-3.4.7.txt +sha1 3fa4bb774030442b9908243a9927d38479c52bf5 wireshark-3.4.7.tar.xz +sha256 6c4cee51ef997cb9d9aaee84113525a5629157d3c743d7c4e320000de804a09d wireshark-3.4.7.tar.xz # Locally calculated sha256 7cdbed2b697efaa45576a033f1ac0e73cd045644a91c79bbf41d4a7d81dac7bf COPYING diff --git a/buildroot/package/wireshark/wireshark.mk b/buildroot/package/wireshark/wireshark.mk index 3d656cf34..6ee4b2039 100644 --- a/buildroot/package/wireshark/wireshark.mk +++ b/buildroot/package/wireshark/wireshark.mk @@ -4,7 +4,7 @@ # ################################################################################ -WIRESHARK_VERSION = 3.4.5 +WIRESHARK_VERSION = 3.4.7 WIRESHARK_SOURCE = wireshark-$(WIRESHARK_VERSION).tar.xz WIRESHARK_SITE = https://www.wireshark.org/download/src/all-versions WIRESHARK_LICENSE = wireshark license @@ -43,6 +43,10 @@ endef WIRESHARK_PRE_BUILD_HOOKS += WIRESHARK_BUILD_LEMON_TOOL +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +WIRESHARK_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic +endif + ifeq ($(BR2_GCC_ENABLE_LTO),y) WIRESHARK_CONF_OPTS += -DENABLE_LTO=ON else diff --git a/buildroot/package/wolfssl/wolfssl.hash b/buildroot/package/wolfssl/wolfssl.hash index 05fee25b6..9896713ca 100644 --- a/buildroot/package/wolfssl/wolfssl.hash +++ b/buildroot/package/wolfssl/wolfssl.hash @@ -1,5 +1,5 @@ # Locally computed: -sha256 b0e740b31d4d877d540ad50cc539a8873fc41af02bd3091c4357b403f7106e31 wolfssl-4.7.0-stable.tar.gz +sha256 50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444 wolfssl-4.8.1-stable.tar.gz # Hash for license files: sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING diff --git a/buildroot/package/wolfssl/wolfssl.mk b/buildroot/package/wolfssl/wolfssl.mk index fe21ddcd4..d3dce0a40 100644 --- a/buildroot/package/wolfssl/wolfssl.mk +++ b/buildroot/package/wolfssl/wolfssl.mk @@ -4,7 +4,7 @@ # ################################################################################ -WOLFSSL_VERSION = 4.7.0-stable +WOLFSSL_VERSION = 4.8.1-stable WOLFSSL_SITE = $(call github,wolfSSL,wolfssl,v$(WOLFSSL_VERSION)) WOLFSSL_INSTALL_STAGING = YES diff --git a/buildroot/package/x11r7/xapp_fonttosfnt/xapp_fonttosfnt.hash b/buildroot/package/x11r7/xapp_fonttosfnt/xapp_fonttosfnt.hash index 7faa797fd..72077bee6 100644 --- a/buildroot/package/x11r7/xapp_fonttosfnt/xapp_fonttosfnt.hash +++ b/buildroot/package/x11r7/xapp_fonttosfnt/xapp_fonttosfnt.hash @@ -1,5 +1,5 @@ -# From https://lists.x.org/archives/xorg-announce/2020-October/003062.html -sha256 07c835f1f98d7b462be8f1493d072b62418282421be18197e50579c70b0c259b fonttosfnt-1.2.1.tar.bz2 -sha512 3d4ece61e31d4a5ed56923ecc1883e80a9308d2062d37345cb5be081bc2b004aadebf99a989601749a63e03eb641e0522d07773a57bca0b4710ed453e4f20742 fonttosfnt-1.2.1.tar.bz2 +# From https://lists.x.org/archives/xorg-announce/2021-June/003093.html +sha256 1a1bb4ef25856dea7de3d491ae7231493225b400bee0f6a1f949017ffd203a64 fonttosfnt-1.2.2.tar.bz2 +sha512 ceac6ccb064043d46f9f16f31fb89c6cbf7f026d049f7b5325d6af97e809b4cd068e6149413bb328c0af601a98b5070e21d469888a6853f6cabecd5b46f60240 fonttosfnt-1.2.2.tar.bz2 # Locally computed sha256 f83378580cb7909a98b52bf5cd6a29f4894d76318c5c5312dd3f17a3e92beef1 COPYING diff --git a/buildroot/package/x11r7/xapp_fonttosfnt/xapp_fonttosfnt.mk b/buildroot/package/x11r7/xapp_fonttosfnt/xapp_fonttosfnt.mk index bafc52490..9fdccbb84 100644 --- a/buildroot/package/x11r7/xapp_fonttosfnt/xapp_fonttosfnt.mk +++ b/buildroot/package/x11r7/xapp_fonttosfnt/xapp_fonttosfnt.mk @@ -4,7 +4,7 @@ # ################################################################################ -XAPP_FONTTOSFNT_VERSION = 1.2.1 +XAPP_FONTTOSFNT_VERSION = 1.2.2 XAPP_FONTTOSFNT_SOURCE = fonttosfnt-$(XAPP_FONTTOSFNT_VERSION).tar.bz2 XAPP_FONTTOSFNT_SITE = http://xorg.freedesktop.org/releases/individual/app XAPP_FONTTOSFNT_LICENSE = MIT diff --git a/buildroot/package/x11r7/xlib_libX11/xlib_libX11.hash b/buildroot/package/x11r7/xlib_libX11/xlib_libX11.hash index b87b2498e..7aeef3344 100644 --- a/buildroot/package/x11r7/xlib_libX11/xlib_libX11.hash +++ b/buildroot/package/x11r7/xlib_libX11/xlib_libX11.hash @@ -1,6 +1,6 @@ -# From https://lists.x.org/archives/xorg-announce/2021-May/003089.html -sha256 e64e43deaa562cbfb0d5ada64670ec09c6fac7935262dcd77bbc6d984a535d47 libX11-1.7.1.tar.bz2 -sha512 a76f0a82fce6f9b50646a7cd7ec5ee046650f225816050226068a7548fa083ef07d146d40faaf44e033c59c17b0fda5ffdee3a127dac3ab56cee02133819aa3d libX11-1.7.1.tar.bz2 +# From https://lists.x.org/archives/xorg-announce/2021-June/003092.html +sha256 1cfa35e37aaabbe4792e9bb690468efefbfbf6b147d9c69d6f90d13c3092ea6c libX11-1.7.2.tar.bz2 +sha512 d01e5c1848c76218605e5af2d353de6b301a251555b52a38dbe930e6635d5e8a92d1486eb6d328ad5d42a5939e0d16868ffa19a75e5a7863d1a32e0d0727bdc7 libX11-1.7.2.tar.bz2 # Locally computed sha256 2daec087a88e7c9b8082557cdeebad5bbb8155a4137472f0b22e269cd99d0c1e COPYING diff --git a/buildroot/package/x11r7/xlib_libX11/xlib_libX11.mk b/buildroot/package/x11r7/xlib_libX11/xlib_libX11.mk index 39d9dc2cc..aa3ebf159 100644 --- a/buildroot/package/x11r7/xlib_libX11/xlib_libX11.mk +++ b/buildroot/package/x11r7/xlib_libX11/xlib_libX11.mk @@ -4,7 +4,7 @@ # ################################################################################ -XLIB_LIBX11_VERSION = 1.7.1 +XLIB_LIBX11_VERSION = 1.7.2 XLIB_LIBX11_SOURCE = libX11-$(XLIB_LIBX11_VERSION).tar.bz2 XLIB_LIBX11_SITE = https://xorg.freedesktop.org/archive/individual/lib XLIB_LIBX11_LICENSE = MIT diff --git a/buildroot/package/x11r7/xlib_libxshmfence/Config.in b/buildroot/package/x11r7/xlib_libxshmfence/Config.in index 710476b35..7823bda7c 100644 --- a/buildroot/package/x11r7/xlib_libxshmfence/Config.in +++ b/buildroot/package/x11r7/xlib_libxshmfence/Config.in @@ -1,5 +1,8 @@ config BR2_PACKAGE_XLIB_LIBXSHMFENCE bool "libxshmfence" + # Due to use of SYS_futex - can be enabled again when upstream + # adds SYS_futex64 as an alternative + depends on !BR2_RISCV_32 depends on BR2_TOOLCHAIN_HAS_SYNC_4 select BR2_PACKAGE_XORGPROTO help diff --git a/buildroot/package/x11r7/xserver_xorg-server/Config.in b/buildroot/package/x11r7/xserver_xorg-server/Config.in index fcd3d0ae0..4dc15435a 100644 --- a/buildroot/package/x11r7/xserver_xorg-server/Config.in +++ b/buildroot/package/x11r7/xserver_xorg-server/Config.in @@ -53,7 +53,8 @@ config BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR depends on BR2_INSTALL_LIBSTDCPP select BR2_PACKAGE_LIBDRM select BR2_PACKAGE_LIBPCIACCESS - select BR2_PACKAGE_XLIB_LIBXSHMFENCE if BR2_TOOLCHAIN_HAS_SYNC_4 + select BR2_PACKAGE_XLIB_LIBXSHMFENCE if \ + (BR2_TOOLCHAIN_HAS_SYNC_4 && !BR2_RISCV_32) help This variant of the X.org server is the full-blown variant, as used by desktop GNU/Linux distributions. The drivers (for diff --git a/buildroot/package/x11r7/xserver_xorg-server/xserver_xorg-server.hash b/buildroot/package/x11r7/xserver_xorg-server/xserver_xorg-server.hash index 9876255c8..8eb56ba02 100644 --- a/buildroot/package/x11r7/xserver_xorg-server/xserver_xorg-server.hash +++ b/buildroot/package/x11r7/xserver_xorg-server/xserver_xorg-server.hash @@ -1,6 +1,6 @@ -# From https://lists.x.org/archives/xorg-announce/2021-April/003081.html -sha256 914c796e3ffabe1af48071d40ccc85e92117c97a9082ed1df29e4d64e3c34c49 xorg-server-1.20.11.tar.bz2 -sha512 1017015b9fd5d53788abe3641d877e6df8609841fa5c1847c0a5e133ddcc1b758a5d695304ebd36828099ec201a85b6b70b46f5ea4f81c5bd3a16fa6e175e3c2 xorg-server-1.20.11.tar.bz2 +# From https://lists.x.org/archives/xorg-announce/2021-July/003100.html +sha256 40aa4e96a56a81a301f15a9b10e06a22700f12b42d9e0e453c7f11d354386300 xorg-server-1.20.13.tar.xz +sha512 4e0b7bd4e070dc52cb2c51c2056feb133de2c0487d359392ed63abba9702910cd2e2983e9415973d8d6e9672eac78be6f39202687fc56610877914ce722554b3 xorg-server-1.20.13.tar.xz # Locally calculated sha256 4cc0447a22635c7b2f1a93fec4aa94f1970fadeb72a063de006b51cf4963a06f COPYING diff --git a/buildroot/package/x11r7/xserver_xorg-server/xserver_xorg-server.mk b/buildroot/package/x11r7/xserver_xorg-server/xserver_xorg-server.mk index ae17dd535..c326230be 100644 --- a/buildroot/package/x11r7/xserver_xorg-server/xserver_xorg-server.mk +++ b/buildroot/package/x11r7/xserver_xorg-server/xserver_xorg-server.mk @@ -4,8 +4,8 @@ # ################################################################################ -XSERVER_XORG_SERVER_VERSION = 1.20.11 -XSERVER_XORG_SERVER_SOURCE = xorg-server-$(XSERVER_XORG_SERVER_VERSION).tar.bz2 +XSERVER_XORG_SERVER_VERSION = 1.20.13 +XSERVER_XORG_SERVER_SOURCE = xorg-server-$(XSERVER_XORG_SERVER_VERSION).tar.xz XSERVER_XORG_SERVER_SITE = https://xorg.freedesktop.org/archive/individual/xserver XSERVER_XORG_SERVER_LICENSE = MIT XSERVER_XORG_SERVER_LICENSE_FILES = COPYING diff --git a/buildroot/support/misc/Vagrantfile b/buildroot/support/misc/Vagrantfile index 303e266c6..f0d1e7889 100644 --- a/buildroot/support/misc/Vagrantfile +++ b/buildroot/support/misc/Vagrantfile @@ -5,7 +5,7 @@ ################################################################################ # Buildroot version to use -RELEASE='2021.02.3' +RELEASE='2021.02.4' ### Change here for more memory/cores ### VM_MEMORY=2048 diff --git a/buildroot/support/testing/tests/package/test_uboot_openssl_pkgconfig.py b/buildroot/support/testing/tests/package/test_uboot_openssl_pkgconfig.py new file mode 100644 index 000000000..55a45f44f --- /dev/null +++ b/buildroot/support/testing/tests/package/test_uboot_openssl_pkgconfig.py @@ -0,0 +1,19 @@ +import os + +import infra.basetest + + +class TestUbootOpensslPkgConfig(infra.basetest.BRTest): + config = infra.basetest.MINIMAL_CONFIG + \ + """ + BR2_x86_64=y + BR2_x86_atom=y + BR2_PACKAGE_OPENSSL=y + BR2_TARGET_UBOOT=y + BR2_TARGET_UBOOT_BOARD_DEFCONFIG="efi-x86_payload64" + BR2_TARGET_UBOOT_NEEDS_OPENSSL=y + """ + + def test_run(self): + img = os.path.join(self.builddir, "images", "u-boot.bin") + self.assertTrue(os.path.exists(img)) diff --git a/buildroot/toolchain/Config.in b/buildroot/toolchain/Config.in index 5c4af50b8..9dafa173a 100644 --- a/buildroot/toolchain/Config.in +++ b/buildroot/toolchain/Config.in @@ -176,6 +176,13 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_99140 bool default y if BR2_nios2 && !BR2_TOOLCHAIN_GCC_AT_LEAST_8 +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101737 +# ICE: SH4 -Os causes internal compiler error. This bug +# still exists in gcc = 11.1.0 +config BR2_TOOLCHAIN_HAS_GCC_BUG_101737 + bool + default y if BR2_sh4 + config BR2_TOOLCHAIN_HAS_NATIVE_RPC bool diff --git a/buildroot/utils/scanpypi b/buildroot/utils/scanpypi index 47c7c00c6..9dede4e11 100755 --- a/buildroot/utils/scanpypi +++ b/buildroot/utils/scanpypi @@ -297,9 +297,9 @@ class BuildrootPackage(): """ current_dir = os.getcwd() os.chdir(self.tmp_extract) - sys.path.append(self.tmp_extract) + sys.path.insert(0, self.tmp_extract) s_file, s_path, s_desc = imp.find_module('setup', [self.tmp_extract]) - setup = imp.load_module('setup', s_file, s_path, s_desc) + imp.load_module('__main__', s_file, s_path, s_desc) if self.metadata_name in self.setup_args: pass elif self.metadata_name.replace('_', '-') in self.setup_args: @@ -309,19 +309,10 @@ class BuildrootPackage(): try: self.setup_metadata = self.setup_args[self.metadata_name] except KeyError: - # This means setup was not called which most likely mean that it is - # called through the if __name__ == '__main__' directive. - # In this case, we can only pray that it is called through a - # function called main() in setup.py. - setup.main() # Will raise AttributeError if not found - self.setup_metadata = self.setup_args[self.metadata_name] - # Here we must remove the module the hard way. - # We must do this because of a very specific case: if a package calls - # setup from the __main__ but does not come with a 'main()' function, - # for some reason setup.main() will successfully call the main - # function of a previous package... - sys.modules.pop('setup', None) - del setup + # This means setup was not called + print('ERROR: Could not determine package metadata for {pkg}.\n' + .format(pkg=self.real_name)) + raise os.chdir(current_dir) sys.path.remove(self.tmp_extract) @@ -495,8 +486,8 @@ class BuildrootPackage(): """ lines = [] - filenames = ['LICENCE', 'LICENSE', 'LICENSE.RST', 'LICENSE.TXT', - 'COPYING', 'COPYING.TXT'] + filenames = ['LICENCE', 'LICENSE', 'LICENSE.MD', 'LICENSE.RST', + 'LICENSE.TXT', 'COPYING', 'COPYING.TXT'] self.license_files = list(find_file_upper_case(filenames, self.tmp_extract)) lines.append(self.__get_license_names(self.license_files)) @@ -706,7 +697,7 @@ def main(): else: raise continue - except AttributeError as error: + except (AttributeError, KeyError) as error: print('Error: Could not install package {pkg}: {error}'.format( pkg=package.real_name, error=error)) continue